@webilix/ngx-helper-m3 1.0.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 +6 -0
- package/fesm2022/webilix-ngx-helper-m3.mjs +263 -0
- package/fesm2022/webilix-ngx-helper-m3.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/confirm/bottom-sheet/confirm-bottom-sheet.component.d.ts +11 -0
- package/lib/confirm/confirm.interface.d.ts +10 -0
- package/lib/confirm/confirm.service.d.ts +37 -0
- package/lib/confirm/dialog/confirm-dialog.component.d.ts +7 -0
- package/lib/container/bottom-sheet/container-bottom-sheet.component.d.ts +18 -0
- package/lib/container/container.interface.d.ts +9 -0
- package/lib/container/container.service.d.ts +34 -0
- package/lib/container/dialog/container-dialog.component.d.ts +18 -0
- package/package.json +42 -0
- package/public-api.d.ts +4 -0
package/README.md
ADDED
@@ -0,0 +1,263 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { inject, Component, Injectable, InjectionToken, Injector } from '@angular/core';
|
3
|
+
import * as i1 from '@angular/material/button';
|
4
|
+
import { MatButtonModule } from '@angular/material/button';
|
5
|
+
import * as i2 from '@angular/material/dialog';
|
6
|
+
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
7
|
+
import * as i3 from '@angular/material/icon';
|
8
|
+
import { MatIconModule } from '@angular/material/icon';
|
9
|
+
import * as i1$1 from '@angular/material/bottom-sheet';
|
10
|
+
import { MAT_BOTTOM_SHEET_DATA } from '@angular/material/bottom-sheet';
|
11
|
+
import * as i2$1 from '@angular/common';
|
12
|
+
import { CommonModule } from '@angular/common';
|
13
|
+
|
14
|
+
class ConfirmDialogComponent {
|
15
|
+
confirm = inject(MAT_DIALOG_DATA);
|
16
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: ConfirmDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
17
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: ConfirmDialogComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "selector": "confirm-dialog" } }, ngImport: i0, template: "<mat-dialog-content>\n <content>\n <!-- ICON -->\n @if (confirm.icon) {\n <div class=\"icon\">\n <mat-icon>{{ confirm.icon }}</mat-icon>\n </div>\n }\n\n <!-- CONTENT -->\n <div class=\"content\">\n <div class=\"question\">{{ confirm.question }}</div>\n <!-- DESCRIPTION -->\n @if (confirm.description) {\n <div class=\"description\">{{ confirm.description }}</div>\n }\n <!-- DATA -->\n @if (confirm.data) {\n <div class=\"data\">\n <div class=\"title\">{{ confirm.data.title }}:</div>\n <div class=\"value\">{{ confirm.data.value }}</div>\n </div>\n }\n </div>\n </content>\n</mat-dialog-content>\n<mat-dialog-actions [align]=\"'end'\">\n <button mat-button type=\"button\" mat-dialog-close>\u062E\u06CC\u0631</button>\n <button mat-button type=\"button\" [mat-dialog-close]=\"true\" [class.error]=\"confirm.color === 'error'\">\u0628\u0644\u06CC</button>\n</mat-dialog-actions>\n", styles: ["content{display:flex;align-items:flex-start;column-gap:1rem;padding-top:1rem}content .content{flex:1}content .content .description{font-size:12px;margin-top:.5rem;text-align:justify}content .content .data{display:flex;align-items:center;column-gap:.5rem;font-size:12px;margin-top:1rem}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
18
|
+
}
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: ConfirmDialogComponent, decorators: [{
|
20
|
+
type: Component,
|
21
|
+
args: [{ host: { selector: 'confirm-dialog' }, imports: [MatButtonModule, MatDialogModule, MatIconModule], template: "<mat-dialog-content>\n <content>\n <!-- ICON -->\n @if (confirm.icon) {\n <div class=\"icon\">\n <mat-icon>{{ confirm.icon }}</mat-icon>\n </div>\n }\n\n <!-- CONTENT -->\n <div class=\"content\">\n <div class=\"question\">{{ confirm.question }}</div>\n <!-- DESCRIPTION -->\n @if (confirm.description) {\n <div class=\"description\">{{ confirm.description }}</div>\n }\n <!-- DATA -->\n @if (confirm.data) {\n <div class=\"data\">\n <div class=\"title\">{{ confirm.data.title }}:</div>\n <div class=\"value\">{{ confirm.data.value }}</div>\n </div>\n }\n </div>\n </content>\n</mat-dialog-content>\n<mat-dialog-actions [align]=\"'end'\">\n <button mat-button type=\"button\" mat-dialog-close>\u062E\u06CC\u0631</button>\n <button mat-button type=\"button\" [mat-dialog-close]=\"true\" [class.error]=\"confirm.color === 'error'\">\u0628\u0644\u06CC</button>\n</mat-dialog-actions>\n", styles: ["content{display:flex;align-items:flex-start;column-gap:1rem;padding-top:1rem}content .content{flex:1}content .content .description{font-size:12px;margin-top:.5rem;text-align:justify}content .content .data{display:flex;align-items:center;column-gap:.5rem;font-size:12px;margin-top:1rem}\n"] }]
|
22
|
+
}] });
|
23
|
+
|
24
|
+
class ConfirmBottomSheetComponent {
|
25
|
+
matBottomSheetRef;
|
26
|
+
confirm = inject(MAT_BOTTOM_SHEET_DATA);
|
27
|
+
constructor(matBottomSheetRef) {
|
28
|
+
this.matBottomSheetRef = matBottomSheetRef;
|
29
|
+
}
|
30
|
+
close(confirmed) {
|
31
|
+
this.matBottomSheetRef.dismiss(confirmed);
|
32
|
+
}
|
33
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: ConfirmBottomSheetComponent, deps: [{ token: i1$1.MatBottomSheetRef }], target: i0.ɵɵFactoryTarget.Component });
|
34
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: ConfirmBottomSheetComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "selector": "confirm-bottom-sheet" } }, ngImport: i0, template: "<content>\n <!-- ICON -->\n @if (confirm.icon) {\n <div class=\"icon\">\n <mat-icon>{{ confirm.icon }}</mat-icon>\n </div>\n }\n\n <!-- CONTENT -->\n <div class=\"content\">\n <div class=\"question\">{{ confirm.question }}</div>\n <!-- DESCRIPTION -->\n @if (confirm.description) {\n <div class=\"description\">{{ confirm.description }}</div>\n }\n <!-- DATA -->\n @if (confirm.data) {\n <div class=\"data\">\n <div class=\"title\">{{ confirm.data.title }}:</div>\n <div class=\"value\">{{ confirm.data.value }}</div>\n </div>\n }\n </div>\n</content>\n\n<div class=\"buttons\">\n <button mat-button type=\"button\" (click)=\"close()\">\u062E\u06CC\u0631</button>\n <button mat-button type=\"button\" (click)=\"close(true)\" [class.error]=\"confirm.color === 'error'\">\u0628\u0644\u06CC</button>\n</div>\n", styles: ["content{display:flex;align-items:flex-start;column-gap:1rem;padding-top:1rem;font-size:14px}content .content{flex:1}content .content .description{font-size:12px;margin-top:.5rem;text-align:justify}content .content .data{display:flex;align-items:center;column-gap:.5rem;font-size:12px;margin-top:1rem}.buttons{display:flex;align-items:center;justify-content:flex-end;column-gap:1rem;margin:1rem 0 .5rem}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
35
|
+
}
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: ConfirmBottomSheetComponent, decorators: [{
|
37
|
+
type: Component,
|
38
|
+
args: [{ host: { selector: 'confirm-bottom-sheet' }, imports: [MatButtonModule, MatIconModule], template: "<content>\n <!-- ICON -->\n @if (confirm.icon) {\n <div class=\"icon\">\n <mat-icon>{{ confirm.icon }}</mat-icon>\n </div>\n }\n\n <!-- CONTENT -->\n <div class=\"content\">\n <div class=\"question\">{{ confirm.question }}</div>\n <!-- DESCRIPTION -->\n @if (confirm.description) {\n <div class=\"description\">{{ confirm.description }}</div>\n }\n <!-- DATA -->\n @if (confirm.data) {\n <div class=\"data\">\n <div class=\"title\">{{ confirm.data.title }}:</div>\n <div class=\"value\">{{ confirm.data.value }}</div>\n </div>\n }\n </div>\n</content>\n\n<div class=\"buttons\">\n <button mat-button type=\"button\" (click)=\"close()\">\u062E\u06CC\u0631</button>\n <button mat-button type=\"button\" (click)=\"close(true)\" [class.error]=\"confirm.color === 'error'\">\u0628\u0644\u06CC</button>\n</div>\n", styles: ["content{display:flex;align-items:flex-start;column-gap:1rem;padding-top:1rem;font-size:14px}content .content{flex:1}content .content .description{font-size:12px;margin-top:.5rem;text-align:justify}content .content .data{display:flex;align-items:center;column-gap:.5rem;font-size:12px;margin-top:1rem}.buttons{display:flex;align-items:center;justify-content:flex-end;column-gap:1rem;margin:1rem 0 .5rem}\n"] }]
|
39
|
+
}], ctorParameters: () => [{ type: i1$1.MatBottomSheetRef }] });
|
40
|
+
|
41
|
+
class NgxHelperConfirmCalss {
|
42
|
+
matBottomSheet;
|
43
|
+
matDialog;
|
44
|
+
confirm;
|
45
|
+
constructor(matBottomSheet, matDialog, confirm) {
|
46
|
+
this.matBottomSheet = matBottomSheet;
|
47
|
+
this.matDialog = matDialog;
|
48
|
+
this.confirm = confirm;
|
49
|
+
}
|
50
|
+
dialog(onConfirmed, arg1, arg2) {
|
51
|
+
const onDenied = typeof arg1 === 'function' ? arg1 : undefined;
|
52
|
+
const config = arg2 || (typeof arg1 !== 'function' ? arg1 : {});
|
53
|
+
this.matDialog
|
54
|
+
.open(ConfirmDialogComponent, {
|
55
|
+
// DEFAULT CONFIG
|
56
|
+
width: 'calc(100vw - 4rem)',
|
57
|
+
direction: 'rtl',
|
58
|
+
enterAnimationDuration: '100ms',
|
59
|
+
exitAnimationDuration: '100ms',
|
60
|
+
// OVERWRITE CONFIG
|
61
|
+
...config,
|
62
|
+
maxHeight: '80vh',
|
63
|
+
// DATA
|
64
|
+
data: this.confirm,
|
65
|
+
})
|
66
|
+
.afterClosed()
|
67
|
+
.subscribe({ next: (confirmed) => (!!confirmed ? onConfirmed() : onDenied ? onDenied() : undefined) });
|
68
|
+
}
|
69
|
+
bottomSheet(onConfirmed, arg1, arg2) {
|
70
|
+
const onDenied = typeof arg1 === 'function' ? arg1 : undefined;
|
71
|
+
const config = arg2 || (typeof arg1 !== 'function' ? arg1 : {});
|
72
|
+
this.matBottomSheet
|
73
|
+
.open(ConfirmBottomSheetComponent, {
|
74
|
+
// DEFAULT CONFIG
|
75
|
+
direction: 'rtl',
|
76
|
+
// OVERWRITE CONFIG
|
77
|
+
...config,
|
78
|
+
maxHeight: '80vh',
|
79
|
+
// DATA
|
80
|
+
data: this.confirm,
|
81
|
+
})
|
82
|
+
.afterDismissed()
|
83
|
+
.subscribe({ next: (confirmed) => (!!confirmed ? onConfirmed() : onDenied ? onDenied() : undefined) });
|
84
|
+
}
|
85
|
+
}
|
86
|
+
class NgxHelperConfirmService {
|
87
|
+
matBottomSheet;
|
88
|
+
matDialog;
|
89
|
+
constructor(matBottomSheet, matDialog) {
|
90
|
+
this.matBottomSheet = matBottomSheet;
|
91
|
+
this.matDialog = matDialog;
|
92
|
+
}
|
93
|
+
verify(confirm) {
|
94
|
+
return new NgxHelperConfirmCalss(this.matBottomSheet, this.matDialog, confirm);
|
95
|
+
}
|
96
|
+
active(data, description) {
|
97
|
+
return this.verify({
|
98
|
+
question: `آیا میخواهید ${data.title} انتخاب شده را فعال کنید؟`,
|
99
|
+
description,
|
100
|
+
data: data.value ? { title: data.title, value: data.value } : undefined,
|
101
|
+
icon: 'check_box',
|
102
|
+
color: 'primary',
|
103
|
+
});
|
104
|
+
}
|
105
|
+
deactive(data, description) {
|
106
|
+
return this.verify({
|
107
|
+
question: `آیا میخواهید ${data.title} انتخاب شده را غیرفعال کنید؟`,
|
108
|
+
description,
|
109
|
+
data: data.value ? { title: data.title, value: data.value } : undefined,
|
110
|
+
icon: 'disabled_by_default',
|
111
|
+
color: 'error',
|
112
|
+
});
|
113
|
+
}
|
114
|
+
delete(data, description) {
|
115
|
+
return this.verify({
|
116
|
+
question: `آیا میخواهید ${data.title} انتخاب شده را حذف کنید؟`,
|
117
|
+
description,
|
118
|
+
data: data.value ? { title: data.title, value: data.value } : undefined,
|
119
|
+
icon: 'delete',
|
120
|
+
color: 'error',
|
121
|
+
});
|
122
|
+
}
|
123
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NgxHelperConfirmService, deps: [{ token: i1$1.MatBottomSheet }, { token: i2.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
|
124
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NgxHelperConfirmService, providedIn: 'root' });
|
125
|
+
}
|
126
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NgxHelperConfirmService, decorators: [{
|
127
|
+
type: Injectable,
|
128
|
+
args: [{ providedIn: 'root' }]
|
129
|
+
}], ctorParameters: () => [{ type: i1$1.MatBottomSheet }, { type: i2.MatDialog }] });
|
130
|
+
|
131
|
+
const NGX_HELPER_CONTAINER_TYPE = new InjectionToken('NGX-HELPER-CONTAINER-TYPE');
|
132
|
+
const NGX_HELPER_CONTAINER_DATA = new InjectionToken('NGX-HELPER-CONTAINER-DATA');
|
133
|
+
const NGX_HELPER_CONTAINER_CLOSE = new InjectionToken('NGX-HELPER-CONTAINER-CLOSE');
|
134
|
+
|
135
|
+
class ContainerDialogComponent {
|
136
|
+
matDialogRef;
|
137
|
+
container = inject(MAT_DIALOG_DATA);
|
138
|
+
injector;
|
139
|
+
constructor(matDialogRef) {
|
140
|
+
this.matDialogRef = matDialogRef;
|
141
|
+
}
|
142
|
+
ngOnInit() {
|
143
|
+
this.injector = Injector.create({
|
144
|
+
providers: [
|
145
|
+
{ provide: NGX_HELPER_CONTAINER_TYPE, useValue: 'DIALOG' },
|
146
|
+
{ provide: NGX_HELPER_CONTAINER_DATA, useValue: this.container.config.data },
|
147
|
+
{
|
148
|
+
provide: NGX_HELPER_CONTAINER_CLOSE,
|
149
|
+
useFactory: () => (response) => this.matDialogRef.close(response),
|
150
|
+
},
|
151
|
+
],
|
152
|
+
});
|
153
|
+
}
|
154
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: ContainerDialogComponent, deps: [{ token: i2.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
155
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.1", type: ContainerDialogComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "selector": "container-dialog" } }, ngImport: i0, template: "<header>{{ container.title }}</header>\n<content [style.padding]=\"container.config.padding || '1rem'\">\n <span *ngComponentOutlet=\"container.component; injector: injector\"></span>\n</content>\n", styles: ["header{display:block;padding:0 1rem;border-bottom:1px solid var(--outline-variant);height:50px;line-height:50px}content{display:block;max-height:calc(80vh - 50px);overflow:auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2$1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }] });
|
156
|
+
}
|
157
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: ContainerDialogComponent, decorators: [{
|
158
|
+
type: Component,
|
159
|
+
args: [{ host: { selector: 'container-dialog' }, imports: [CommonModule], template: "<header>{{ container.title }}</header>\n<content [style.padding]=\"container.config.padding || '1rem'\">\n <span *ngComponentOutlet=\"container.component; injector: injector\"></span>\n</content>\n", styles: ["header{display:block;padding:0 1rem;border-bottom:1px solid var(--outline-variant);height:50px;line-height:50px}content{display:block;max-height:calc(80vh - 50px);overflow:auto}\n"] }]
|
160
|
+
}], ctorParameters: () => [{ type: i2.MatDialogRef }] });
|
161
|
+
|
162
|
+
class ContainerBottomSheetComponent {
|
163
|
+
matBottomSheetRef;
|
164
|
+
container = inject(MAT_BOTTOM_SHEET_DATA);
|
165
|
+
injector;
|
166
|
+
constructor(matBottomSheetRef) {
|
167
|
+
this.matBottomSheetRef = matBottomSheetRef;
|
168
|
+
}
|
169
|
+
ngOnInit() {
|
170
|
+
this.injector = Injector.create({
|
171
|
+
providers: [
|
172
|
+
{ provide: NGX_HELPER_CONTAINER_TYPE, useValue: 'BOTTOMSHEET' },
|
173
|
+
{ provide: NGX_HELPER_CONTAINER_DATA, useValue: this.container.config.data },
|
174
|
+
{
|
175
|
+
provide: NGX_HELPER_CONTAINER_CLOSE,
|
176
|
+
useFactory: () => (response) => this.matBottomSheetRef.dismiss(response),
|
177
|
+
},
|
178
|
+
],
|
179
|
+
});
|
180
|
+
}
|
181
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: ContainerBottomSheetComponent, deps: [{ token: i1$1.MatBottomSheetRef }], target: i0.ɵɵFactoryTarget.Component });
|
182
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.1", type: ContainerBottomSheetComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "selector": "container-bottom-sheet" } }, ngImport: i0, template: "<header>{{ container.title }}</header>\n<content>\n <div [style.padding]=\"container.config.padding || '1rem'\">\n <span *ngComponentOutlet=\"container.component; injector: injector\"></span>\n </div>\n</content>\n", styles: ["header{display:block;padding:0 1rem;border-bottom:1px solid var(--outline-variant);height:50px;line-height:50px}content{display:block;max-height:calc(80vh - 51px);overflow:auto}::ng-deep .ngx-helper-bottom-sheet .mat-bottom-sheet-container{padding:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2$1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }] });
|
183
|
+
}
|
184
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: ContainerBottomSheetComponent, decorators: [{
|
185
|
+
type: Component,
|
186
|
+
args: [{ host: { selector: 'container-bottom-sheet' }, imports: [CommonModule], template: "<header>{{ container.title }}</header>\n<content>\n <div [style.padding]=\"container.config.padding || '1rem'\">\n <span *ngComponentOutlet=\"container.component; injector: injector\"></span>\n </div>\n</content>\n", styles: ["header{display:block;padding:0 1rem;border-bottom:1px solid var(--outline-variant);height:50px;line-height:50px}content{display:block;max-height:calc(80vh - 51px);overflow:auto}::ng-deep .ngx-helper-bottom-sheet .mat-bottom-sheet-container{padding:0}\n"] }]
|
187
|
+
}], ctorParameters: () => [{ type: i1$1.MatBottomSheetRef }] });
|
188
|
+
|
189
|
+
class NgxHelperContainerCalss {
|
190
|
+
matBottomSheet;
|
191
|
+
matDialog;
|
192
|
+
container;
|
193
|
+
constructor(matBottomSheet, matDialog, container) {
|
194
|
+
this.matBottomSheet = matBottomSheet;
|
195
|
+
this.matDialog = matDialog;
|
196
|
+
this.container = container;
|
197
|
+
}
|
198
|
+
dialog(arg1, arg2) {
|
199
|
+
const callback = typeof arg1 === 'function' ? arg1 : undefined;
|
200
|
+
const config = arg2 || (typeof arg1 !== 'function' ? arg1 : {});
|
201
|
+
this.matDialog
|
202
|
+
.open(ContainerDialogComponent, {
|
203
|
+
// DEFAULT CONFIG
|
204
|
+
width: 'calc(100vw - 4rem)',
|
205
|
+
direction: 'rtl',
|
206
|
+
enterAnimationDuration: '100ms',
|
207
|
+
exitAnimationDuration: '100ms',
|
208
|
+
// OVERWRITE CONFIG
|
209
|
+
...config,
|
210
|
+
maxHeight: '80vh',
|
211
|
+
// DATA
|
212
|
+
data: this.container,
|
213
|
+
})
|
214
|
+
.afterClosed()
|
215
|
+
.subscribe({ next: (result) => !!result && callback && callback(result) });
|
216
|
+
}
|
217
|
+
bottomSheet(arg1, arg2) {
|
218
|
+
const callback = typeof arg1 === 'function' ? arg1 : undefined;
|
219
|
+
const config = arg2 || (typeof arg1 !== 'function' ? arg1 : {});
|
220
|
+
this.matBottomSheet
|
221
|
+
.open(ContainerBottomSheetComponent, {
|
222
|
+
// DEFAULT CONFIG
|
223
|
+
direction: 'rtl',
|
224
|
+
panelClass: 'ngx-helper-bottom-sheet',
|
225
|
+
// OVERWRITE CONFIG
|
226
|
+
...config,
|
227
|
+
maxHeight: '80vh',
|
228
|
+
// DATA
|
229
|
+
data: this.container,
|
230
|
+
})
|
231
|
+
.afterDismissed()
|
232
|
+
.subscribe({ next: (result) => !!result && callback && callback(result) });
|
233
|
+
}
|
234
|
+
}
|
235
|
+
class NgxHelperContainerService {
|
236
|
+
matBottomSheet;
|
237
|
+
matDialog;
|
238
|
+
constructor(matBottomSheet, matDialog) {
|
239
|
+
this.matBottomSheet = matBottomSheet;
|
240
|
+
this.matDialog = matDialog;
|
241
|
+
}
|
242
|
+
init(component, title, arg1) {
|
243
|
+
const config = arg1 || {};
|
244
|
+
return new NgxHelperContainerCalss(this.matBottomSheet, this.matDialog, { component, title, config });
|
245
|
+
}
|
246
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NgxHelperContainerService, deps: [{ token: i1$1.MatBottomSheet }, { token: i2.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
|
247
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NgxHelperContainerService, providedIn: 'root' });
|
248
|
+
}
|
249
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NgxHelperContainerService, decorators: [{
|
250
|
+
type: Injectable,
|
251
|
+
args: [{ providedIn: 'root' }]
|
252
|
+
}], ctorParameters: () => [{ type: i1$1.MatBottomSheet }, { type: i2.MatDialog }] });
|
253
|
+
|
254
|
+
/*
|
255
|
+
* Public API Surface of ngx-helper-m3
|
256
|
+
*/
|
257
|
+
|
258
|
+
/**
|
259
|
+
* Generated bundle index. Do not edit.
|
260
|
+
*/
|
261
|
+
|
262
|
+
export { NGX_HELPER_CONTAINER_CLOSE, NGX_HELPER_CONTAINER_DATA, NGX_HELPER_CONTAINER_TYPE, NgxHelperConfirmService, NgxHelperContainerService };
|
263
|
+
//# sourceMappingURL=webilix-ngx-helper-m3.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"webilix-ngx-helper-m3.mjs","sources":["../../../ngx-helper-m3/src/lib/confirm/dialog/confirm-dialog.component.ts","../../../ngx-helper-m3/src/lib/confirm/dialog/confirm-dialog.component.html","../../../ngx-helper-m3/src/lib/confirm/bottom-sheet/confirm-bottom-sheet.component.ts","../../../ngx-helper-m3/src/lib/confirm/bottom-sheet/confirm-bottom-sheet.component.html","../../../ngx-helper-m3/src/lib/confirm/confirm.service.ts","../../../ngx-helper-m3/src/lib/container/container.interface.ts","../../../ngx-helper-m3/src/lib/container/dialog/container-dialog.component.ts","../../../ngx-helper-m3/src/lib/container/dialog/container-dialog.component.html","../../../ngx-helper-m3/src/lib/container/bottom-sheet/container-bottom-sheet.component.ts","../../../ngx-helper-m3/src/lib/container/bottom-sheet/container-bottom-sheet.component.html","../../../ngx-helper-m3/src/lib/container/container.service.ts","../../../ngx-helper-m3/src/public-api.ts","../../../ngx-helper-m3/src/webilix-ngx-helper-m3.ts"],"sourcesContent":["import { Component, inject } from '@angular/core';\n\nimport { MatButtonModule } from '@angular/material/button';\nimport { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { INgxHelperConfirm } from '../confirm.interface';\n\n@Component({\n host: { selector: 'confirm-dialog' },\n imports: [MatButtonModule, MatDialogModule, MatIconModule],\n templateUrl: './confirm-dialog.component.html',\n styleUrl: './confirm-dialog.component.scss',\n})\nexport class ConfirmDialogComponent {\n public confirm: INgxHelperConfirm = inject(MAT_DIALOG_DATA);\n}\n","<mat-dialog-content>\n <content>\n <!-- ICON -->\n @if (confirm.icon) {\n <div class=\"icon\">\n <mat-icon>{{ confirm.icon }}</mat-icon>\n </div>\n }\n\n <!-- CONTENT -->\n <div class=\"content\">\n <div class=\"question\">{{ confirm.question }}</div>\n <!-- DESCRIPTION -->\n @if (confirm.description) {\n <div class=\"description\">{{ confirm.description }}</div>\n }\n <!-- DATA -->\n @if (confirm.data) {\n <div class=\"data\">\n <div class=\"title\">{{ confirm.data.title }}:</div>\n <div class=\"value\">{{ confirm.data.value }}</div>\n </div>\n }\n </div>\n </content>\n</mat-dialog-content>\n<mat-dialog-actions [align]=\"'end'\">\n <button mat-button type=\"button\" mat-dialog-close>خیر</button>\n <button mat-button type=\"button\" [mat-dialog-close]=\"true\" [class.error]=\"confirm.color === 'error'\">بلی</button>\n</mat-dialog-actions>\n","import { Component, inject } from '@angular/core';\n\nimport { MAT_BOTTOM_SHEET_DATA, MatBottomSheetRef } from '@angular/material/bottom-sheet';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { INgxHelperConfirm } from '../confirm.interface';\n\n@Component({\n host: { selector: 'confirm-bottom-sheet' },\n imports: [MatButtonModule, MatIconModule],\n templateUrl: './confirm-bottom-sheet.component.html',\n styleUrl: './confirm-bottom-sheet.component.scss',\n})\nexport class ConfirmBottomSheetComponent {\n public confirm: INgxHelperConfirm = inject(MAT_BOTTOM_SHEET_DATA);\n\n constructor(private readonly matBottomSheetRef: MatBottomSheetRef<ConfirmBottomSheetComponent>) {}\n\n close(confirmed?: boolean) {\n this.matBottomSheetRef.dismiss(confirmed);\n }\n}\n","<content>\n <!-- ICON -->\n @if (confirm.icon) {\n <div class=\"icon\">\n <mat-icon>{{ confirm.icon }}</mat-icon>\n </div>\n }\n\n <!-- CONTENT -->\n <div class=\"content\">\n <div class=\"question\">{{ confirm.question }}</div>\n <!-- DESCRIPTION -->\n @if (confirm.description) {\n <div class=\"description\">{{ confirm.description }}</div>\n }\n <!-- DATA -->\n @if (confirm.data) {\n <div class=\"data\">\n <div class=\"title\">{{ confirm.data.title }}:</div>\n <div class=\"value\">{{ confirm.data.value }}</div>\n </div>\n }\n </div>\n</content>\n\n<div class=\"buttons\">\n <button mat-button type=\"button\" (click)=\"close()\">خیر</button>\n <button mat-button type=\"button\" (click)=\"close(true)\" [class.error]=\"confirm.color === 'error'\">بلی</button>\n</div>\n","import { Injectable } from '@angular/core';\n\nimport { MatBottomSheet, MatBottomSheetConfig } from '@angular/material/bottom-sheet';\nimport { MatDialog, MatDialogConfig } from '@angular/material/dialog';\n\nimport { ConfirmDialogComponent } from './dialog/confirm-dialog.component';\nimport { ConfirmBottomSheetComponent } from './bottom-sheet/confirm-bottom-sheet.component';\n\nimport { INgxHelperConfirm } from './confirm.interface';\n\ninterface IConfirmData {\n readonly title: string;\n readonly value?: string;\n}\n\nclass NgxHelperConfirmCalss {\n constructor(\n private readonly matBottomSheet: MatBottomSheet,\n private readonly matDialog: MatDialog,\n private readonly confirm: INgxHelperConfirm,\n ) {}\n\n dialog(onConfirmed: () => void): void;\n dialog(onConfirmed: () => void, onDenied: () => void): void;\n dialog(onConfirmed: () => void, config: MatDialogConfig): void;\n dialog(onConfirmed: () => void, onDenied: () => void, config: MatDialogConfig): void;\n dialog(onConfirmed: () => void, arg1?: any, arg2?: any): void {\n const onDenied: (() => void) | undefined = typeof arg1 === 'function' ? arg1 : undefined;\n const config: MatDialogConfig = arg2 || (typeof arg1 !== 'function' ? arg1 : {});\n\n this.matDialog\n .open<any, any, boolean>(ConfirmDialogComponent, {\n // DEFAULT CONFIG\n width: 'calc(100vw - 4rem)',\n direction: 'rtl',\n enterAnimationDuration: '100ms',\n exitAnimationDuration: '100ms',\n // OVERWRITE CONFIG\n ...config,\n maxHeight: '80vh',\n // DATA\n data: this.confirm,\n })\n .afterClosed()\n .subscribe({ next: (confirmed?: boolean) => (!!confirmed ? onConfirmed() : onDenied ? onDenied() : undefined) });\n }\n\n bottomSheet(onConfirmed: () => void): void;\n bottomSheet(onConfirmed: () => void, onDenied: () => void): void;\n bottomSheet(onConfirmed: () => void, config: MatBottomSheetConfig): void;\n bottomSheet(onConfirmed: () => void, onDenied: () => void, config: MatBottomSheetConfig): void;\n bottomSheet(onConfirmed: () => void, arg1?: any, arg2?: any): void {\n const onDenied: (() => void) | undefined = typeof arg1 === 'function' ? arg1 : undefined;\n const config: MatBottomSheetConfig = arg2 || (typeof arg1 !== 'function' ? arg1 : {});\n\n this.matBottomSheet\n .open<any, any, boolean>(ConfirmBottomSheetComponent, {\n // DEFAULT CONFIG\n direction: 'rtl',\n // OVERWRITE CONFIG\n ...config,\n maxHeight: '80vh',\n // DATA\n data: this.confirm,\n })\n .afterDismissed()\n .subscribe({ next: (confirmed?: boolean) => (!!confirmed ? onConfirmed() : onDenied ? onDenied() : undefined) });\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class NgxHelperConfirmService {\n constructor(private readonly matBottomSheet: MatBottomSheet, private readonly matDialog: MatDialog) {}\n\n verify(confirm: INgxHelperConfirm): NgxHelperConfirmCalss {\n return new NgxHelperConfirmCalss(this.matBottomSheet, this.matDialog, confirm);\n }\n\n active(data: IConfirmData): NgxHelperConfirmCalss;\n active(data: IConfirmData, description: string): NgxHelperConfirmCalss;\n active(data: IConfirmData, description?: string): NgxHelperConfirmCalss {\n return this.verify({\n question: `آیا میخواهید ${data.title} انتخاب شده را فعال کنید؟`,\n description,\n data: data.value ? { title: data.title, value: data.value } : undefined,\n icon: 'check_box',\n color: 'primary',\n });\n }\n\n deactive(data: IConfirmData): NgxHelperConfirmCalss;\n deactive(data: IConfirmData, description: string): NgxHelperConfirmCalss;\n deactive(data: IConfirmData, description?: string): NgxHelperConfirmCalss {\n return this.verify({\n question: `آیا میخواهید ${data.title} انتخاب شده را غیرفعال کنید؟`,\n description,\n data: data.value ? { title: data.title, value: data.value } : undefined,\n icon: 'disabled_by_default',\n color: 'error',\n });\n }\n\n delete(data: IConfirmData): NgxHelperConfirmCalss;\n delete(data: IConfirmData, description: string): NgxHelperConfirmCalss;\n delete(data: IConfirmData, description?: string): NgxHelperConfirmCalss {\n return this.verify({\n question: `آیا میخواهید ${data.title} انتخاب شده را حذف کنید؟`,\n description,\n data: data.value ? { title: data.title, value: data.value } : undefined,\n icon: 'delete',\n color: 'error',\n });\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nexport interface INgxHelperContainerConfig {\n data?: any;\n padding?: string;\n}\n\nexport type NgxHelperContainer = 'DIALOG' | 'BOTTOMSHEET';\n\nexport const NGX_HELPER_CONTAINER_TYPE: InjectionToken<NgxHelperContainer> = new InjectionToken('NGX-HELPER-CONTAINER-TYPE');\nexport const NGX_HELPER_CONTAINER_DATA: InjectionToken<any> = new InjectionToken<any>('NGX-HELPER-CONTAINER-DATA');\nexport const NGX_HELPER_CONTAINER_CLOSE: InjectionToken<(response?: any) => void> = new InjectionToken(\n 'NGX-HELPER-CONTAINER-CLOSE',\n);\n","import { CommonModule } from '@angular/common';\nimport { Component, inject, Injector, OnInit } from '@angular/core';\nimport { ComponentType } from '@angular/cdk/portal';\n\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\n\nimport {\n INgxHelperContainerConfig,\n NGX_HELPER_CONTAINER_CLOSE,\n NGX_HELPER_CONTAINER_DATA,\n NGX_HELPER_CONTAINER_TYPE,\n} from '../container.interface';\n\n@Component({\n host: { selector: 'container-dialog' },\n imports: [CommonModule],\n templateUrl: './container-dialog.component.html',\n styleUrl: './container-dialog.component.scss',\n})\nexport class ContainerDialogComponent implements OnInit {\n public container: {\n component: ComponentType<any>;\n readonly title: string;\n readonly config: INgxHelperContainerConfig;\n } = inject(MAT_DIALOG_DATA);\n\n public injector!: Injector;\n\n constructor(private readonly matDialogRef: MatDialogRef<ContainerDialogComponent>) {}\n\n ngOnInit(): void {\n this.injector = Injector.create({\n providers: [\n { provide: NGX_HELPER_CONTAINER_TYPE, useValue: 'DIALOG' },\n { provide: NGX_HELPER_CONTAINER_DATA, useValue: this.container.config.data },\n {\n provide: NGX_HELPER_CONTAINER_CLOSE,\n useFactory: () => (response?: any) => this.matDialogRef.close(response),\n },\n ],\n });\n }\n}\n","<header>{{ container.title }}</header>\n<content [style.padding]=\"container.config.padding || '1rem'\">\n <span *ngComponentOutlet=\"container.component; injector: injector\"></span>\n</content>\n","import { CommonModule } from '@angular/common';\nimport { Component, inject, Injector, OnInit } from '@angular/core';\nimport { ComponentType } from '@angular/cdk/portal';\n\nimport { MAT_BOTTOM_SHEET_DATA, MatBottomSheetRef } from '@angular/material/bottom-sheet';\n\nimport {\n INgxHelperContainerConfig,\n NGX_HELPER_CONTAINER_CLOSE,\n NGX_HELPER_CONTAINER_DATA,\n NGX_HELPER_CONTAINER_TYPE,\n} from '../container.interface';\n\n@Component({\n host: { selector: 'container-bottom-sheet' },\n imports: [CommonModule],\n templateUrl: './container-bottom-sheet.component.html',\n styleUrl: './container-bottom-sheet.component.scss',\n})\nexport class ContainerBottomSheetComponent implements OnInit {\n public container: {\n component: ComponentType<any>;\n readonly title: string;\n readonly config: INgxHelperContainerConfig;\n } = inject(MAT_BOTTOM_SHEET_DATA);\n\n public injector!: Injector;\n\n constructor(private readonly matBottomSheetRef: MatBottomSheetRef<ContainerBottomSheetComponent>) {}\n\n ngOnInit(): void {\n this.injector = Injector.create({\n providers: [\n { provide: NGX_HELPER_CONTAINER_TYPE, useValue: 'BOTTOMSHEET' },\n { provide: NGX_HELPER_CONTAINER_DATA, useValue: this.container.config.data },\n {\n provide: NGX_HELPER_CONTAINER_CLOSE,\n useFactory: () => (response?: any) => this.matBottomSheetRef.dismiss(response),\n },\n ],\n });\n }\n}\n","<header>{{ container.title }}</header>\n<content>\n <div [style.padding]=\"container.config.padding || '1rem'\">\n <span *ngComponentOutlet=\"container.component; injector: injector\"></span>\n </div>\n</content>\n","import { Injectable } from '@angular/core';\nimport { ComponentType } from '@angular/cdk/portal';\n\nimport { MatBottomSheet, MatBottomSheetConfig } from '@angular/material/bottom-sheet';\nimport { MatDialog, MatDialogConfig } from '@angular/material/dialog';\n\nimport { ContainerDialogComponent } from './dialog/container-dialog.component';\nimport { ContainerBottomSheetComponent } from './bottom-sheet/container-bottom-sheet.component';\n\nimport { INgxHelperContainerConfig } from './container.interface';\n\ninterface IContainerData {\n readonly component: ComponentType<any>;\n readonly title: string;\n readonly config: INgxHelperContainerConfig;\n}\n\nclass NgxHelperContainerCalss {\n constructor(\n private readonly matBottomSheet: MatBottomSheet,\n private readonly matDialog: MatDialog,\n private readonly container: IContainerData,\n ) {}\n\n dialog<T>(): void;\n dialog<T>(callback: (result: T) => void): void;\n dialog<T>(config: MatDialogConfig): void;\n dialog<T>(callback: (result: T) => void, config: MatDialogConfig): void;\n dialog<T>(arg1?: any, arg2?: any): void {\n const callback: ((result: T) => void) | undefined = typeof arg1 === 'function' ? arg1 : undefined;\n const config: MatDialogConfig = arg2 || (typeof arg1 !== 'function' ? arg1 : {});\n\n this.matDialog\n .open(ContainerDialogComponent, {\n // DEFAULT CONFIG\n width: 'calc(100vw - 4rem)',\n direction: 'rtl',\n enterAnimationDuration: '100ms',\n exitAnimationDuration: '100ms',\n // OVERWRITE CONFIG\n ...config,\n maxHeight: '80vh',\n // DATA\n data: this.container,\n })\n .afterClosed()\n .subscribe({ next: (result?: T) => !!result && callback && callback(result) });\n }\n\n bottomSheet<T>(): void;\n bottomSheet<T>(callback: (result: T) => void): void;\n bottomSheet<T>(config: MatBottomSheetConfig): void;\n bottomSheet<T>(callback: (result: T) => void, config: MatBottomSheetConfig): void;\n bottomSheet<T>(arg1?: any, arg2?: any): void {\n const callback: ((result: T) => void) | undefined = typeof arg1 === 'function' ? arg1 : undefined;\n const config: MatBottomSheetConfig = arg2 || (typeof arg1 !== 'function' ? arg1 : {});\n\n this.matBottomSheet\n .open<any, any, T>(ContainerBottomSheetComponent, {\n // DEFAULT CONFIG\n direction: 'rtl',\n panelClass: 'ngx-helper-bottom-sheet',\n // OVERWRITE CONFIG\n ...config,\n maxHeight: '80vh',\n // DATA\n data: this.container,\n })\n .afterDismissed()\n .subscribe({ next: (result?: T) => !!result && callback && callback(result) });\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class NgxHelperContainerService {\n constructor(private readonly matBottomSheet: MatBottomSheet, private readonly matDialog: MatDialog) {}\n\n init(component: ComponentType<any>, title: string): NgxHelperContainerCalss;\n init(component: ComponentType<any>, title: string, config: INgxHelperContainerConfig): NgxHelperContainerCalss;\n init(component: ComponentType<any>, title: string, arg1?: any): NgxHelperContainerCalss {\n const config: INgxHelperContainerConfig = arg1 || {};\n\n return new NgxHelperContainerCalss(this.matBottomSheet, this.matDialog, { component, title, config });\n }\n}\n","/*\n * Public API Surface of ngx-helper-m3\n */\n\nexport * from './lib/confirm/confirm.interface';\nexport * from './lib/confirm/confirm.service';\n\nexport * from './lib/container/container.interface';\nexport * from './lib/container/container.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;MAca,sBAAsB,CAAA;AACxB,I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c,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;;uGARhG,yBAAyB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAD,IAAA,CAAA,cAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,SAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAzB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,cADZ,MAAM,EAAA,CAAA;;2FACnB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACzElC;;AAEG;;ACFH;;AAEG;;;;"}
|
package/index.d.ts
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
import { MatBottomSheetRef } from '@angular/material/bottom-sheet';
|
2
|
+
import { INgxHelperConfirm } from '../confirm.interface';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export declare class ConfirmBottomSheetComponent {
|
5
|
+
private readonly matBottomSheetRef;
|
6
|
+
confirm: INgxHelperConfirm;
|
7
|
+
constructor(matBottomSheetRef: MatBottomSheetRef<ConfirmBottomSheetComponent>);
|
8
|
+
close(confirmed?: boolean): void;
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmBottomSheetComponent, never>;
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmBottomSheetComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
11
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { MatBottomSheet, MatBottomSheetConfig } from '@angular/material/bottom-sheet';
|
2
|
+
import { MatDialog, MatDialogConfig } from '@angular/material/dialog';
|
3
|
+
import { INgxHelperConfirm } from './confirm.interface';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
interface IConfirmData {
|
6
|
+
readonly title: string;
|
7
|
+
readonly value?: string;
|
8
|
+
}
|
9
|
+
declare class NgxHelperConfirmCalss {
|
10
|
+
private readonly matBottomSheet;
|
11
|
+
private readonly matDialog;
|
12
|
+
private readonly confirm;
|
13
|
+
constructor(matBottomSheet: MatBottomSheet, matDialog: MatDialog, confirm: INgxHelperConfirm);
|
14
|
+
dialog(onConfirmed: () => void): void;
|
15
|
+
dialog(onConfirmed: () => void, onDenied: () => void): void;
|
16
|
+
dialog(onConfirmed: () => void, config: MatDialogConfig): void;
|
17
|
+
dialog(onConfirmed: () => void, onDenied: () => void, config: MatDialogConfig): void;
|
18
|
+
bottomSheet(onConfirmed: () => void): void;
|
19
|
+
bottomSheet(onConfirmed: () => void, onDenied: () => void): void;
|
20
|
+
bottomSheet(onConfirmed: () => void, config: MatBottomSheetConfig): void;
|
21
|
+
bottomSheet(onConfirmed: () => void, onDenied: () => void, config: MatBottomSheetConfig): void;
|
22
|
+
}
|
23
|
+
export declare class NgxHelperConfirmService {
|
24
|
+
private readonly matBottomSheet;
|
25
|
+
private readonly matDialog;
|
26
|
+
constructor(matBottomSheet: MatBottomSheet, matDialog: MatDialog);
|
27
|
+
verify(confirm: INgxHelperConfirm): NgxHelperConfirmCalss;
|
28
|
+
active(data: IConfirmData): NgxHelperConfirmCalss;
|
29
|
+
active(data: IConfirmData, description: string): NgxHelperConfirmCalss;
|
30
|
+
deactive(data: IConfirmData): NgxHelperConfirmCalss;
|
31
|
+
deactive(data: IConfirmData, description: string): NgxHelperConfirmCalss;
|
32
|
+
delete(data: IConfirmData): NgxHelperConfirmCalss;
|
33
|
+
delete(data: IConfirmData, description: string): NgxHelperConfirmCalss;
|
34
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxHelperConfirmService, never>;
|
35
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NgxHelperConfirmService>;
|
36
|
+
}
|
37
|
+
export {};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { INgxHelperConfirm } from '../confirm.interface';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
export declare class ConfirmDialogComponent {
|
4
|
+
confirm: INgxHelperConfirm;
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmDialogComponent, never>;
|
6
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmDialogComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
7
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { Injector, OnInit } from '@angular/core';
|
2
|
+
import { ComponentType } from '@angular/cdk/portal';
|
3
|
+
import { MatBottomSheetRef } from '@angular/material/bottom-sheet';
|
4
|
+
import { INgxHelperContainerConfig } from '../container.interface';
|
5
|
+
import * as i0 from "@angular/core";
|
6
|
+
export declare class ContainerBottomSheetComponent implements OnInit {
|
7
|
+
private readonly matBottomSheetRef;
|
8
|
+
container: {
|
9
|
+
component: ComponentType<any>;
|
10
|
+
readonly title: string;
|
11
|
+
readonly config: INgxHelperContainerConfig;
|
12
|
+
};
|
13
|
+
injector: Injector;
|
14
|
+
constructor(matBottomSheetRef: MatBottomSheetRef<ContainerBottomSheetComponent>);
|
15
|
+
ngOnInit(): void;
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ContainerBottomSheetComponent, never>;
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ContainerBottomSheetComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
18
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
2
|
+
export interface INgxHelperContainerConfig {
|
3
|
+
data?: any;
|
4
|
+
padding?: string;
|
5
|
+
}
|
6
|
+
export type NgxHelperContainer = 'DIALOG' | 'BOTTOMSHEET';
|
7
|
+
export declare const NGX_HELPER_CONTAINER_TYPE: InjectionToken<NgxHelperContainer>;
|
8
|
+
export declare const NGX_HELPER_CONTAINER_DATA: InjectionToken<any>;
|
9
|
+
export declare const NGX_HELPER_CONTAINER_CLOSE: InjectionToken<(response?: any) => void>;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { ComponentType } from '@angular/cdk/portal';
|
2
|
+
import { MatBottomSheet, MatBottomSheetConfig } from '@angular/material/bottom-sheet';
|
3
|
+
import { MatDialog, MatDialogConfig } from '@angular/material/dialog';
|
4
|
+
import { INgxHelperContainerConfig } from './container.interface';
|
5
|
+
import * as i0 from "@angular/core";
|
6
|
+
interface IContainerData {
|
7
|
+
readonly component: ComponentType<any>;
|
8
|
+
readonly title: string;
|
9
|
+
readonly config: INgxHelperContainerConfig;
|
10
|
+
}
|
11
|
+
declare class NgxHelperContainerCalss {
|
12
|
+
private readonly matBottomSheet;
|
13
|
+
private readonly matDialog;
|
14
|
+
private readonly container;
|
15
|
+
constructor(matBottomSheet: MatBottomSheet, matDialog: MatDialog, container: IContainerData);
|
16
|
+
dialog<T>(): void;
|
17
|
+
dialog<T>(callback: (result: T) => void): void;
|
18
|
+
dialog<T>(config: MatDialogConfig): void;
|
19
|
+
dialog<T>(callback: (result: T) => void, config: MatDialogConfig): void;
|
20
|
+
bottomSheet<T>(): void;
|
21
|
+
bottomSheet<T>(callback: (result: T) => void): void;
|
22
|
+
bottomSheet<T>(config: MatBottomSheetConfig): void;
|
23
|
+
bottomSheet<T>(callback: (result: T) => void, config: MatBottomSheetConfig): void;
|
24
|
+
}
|
25
|
+
export declare class NgxHelperContainerService {
|
26
|
+
private readonly matBottomSheet;
|
27
|
+
private readonly matDialog;
|
28
|
+
constructor(matBottomSheet: MatBottomSheet, matDialog: MatDialog);
|
29
|
+
init(component: ComponentType<any>, title: string): NgxHelperContainerCalss;
|
30
|
+
init(component: ComponentType<any>, title: string, config: INgxHelperContainerConfig): NgxHelperContainerCalss;
|
31
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxHelperContainerService, never>;
|
32
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NgxHelperContainerService>;
|
33
|
+
}
|
34
|
+
export {};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { Injector, OnInit } from '@angular/core';
|
2
|
+
import { ComponentType } from '@angular/cdk/portal';
|
3
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
4
|
+
import { INgxHelperContainerConfig } from '../container.interface';
|
5
|
+
import * as i0 from "@angular/core";
|
6
|
+
export declare class ContainerDialogComponent implements OnInit {
|
7
|
+
private readonly matDialogRef;
|
8
|
+
container: {
|
9
|
+
component: ComponentType<any>;
|
10
|
+
readonly title: string;
|
11
|
+
readonly config: INgxHelperContainerConfig;
|
12
|
+
};
|
13
|
+
injector: Injector;
|
14
|
+
constructor(matDialogRef: MatDialogRef<ContainerDialogComponent>);
|
15
|
+
ngOnInit(): void;
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ContainerDialogComponent, never>;
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ContainerDialogComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
18
|
+
}
|
package/package.json
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
{
|
2
|
+
"name": "@webilix/ngx-helper-m3",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"author": "Ali Amirnezhad",
|
5
|
+
"description": "Helper library for Angular and Material 3",
|
6
|
+
"repository": {
|
7
|
+
"type": "git",
|
8
|
+
"url": "git+https://github.com/webilix/ngx-helper-m3.git"
|
9
|
+
},
|
10
|
+
"keywords": [
|
11
|
+
"angular",
|
12
|
+
"helper",
|
13
|
+
"persian",
|
14
|
+
"farsi",
|
15
|
+
"material 3"
|
16
|
+
],
|
17
|
+
"license": "MIT",
|
18
|
+
"bugs": {
|
19
|
+
"url": "https://github.com/webilix/ngx-helper-m3/issues"
|
20
|
+
},
|
21
|
+
"homepage": "https://github.com/webilix/ngx-helper-m3#readme",
|
22
|
+
"peerDependencies": {
|
23
|
+
"@angular/common": ">=19.0.0",
|
24
|
+
"@angular/core": ">=19.0.0",
|
25
|
+
"@angular/material": ">=19.0.1"
|
26
|
+
},
|
27
|
+
"dependencies": {
|
28
|
+
"tslib": "^2.3.0"
|
29
|
+
},
|
30
|
+
"sideEffects": false,
|
31
|
+
"module": "fesm2022/webilix-ngx-helper-m3.mjs",
|
32
|
+
"typings": "index.d.ts",
|
33
|
+
"exports": {
|
34
|
+
"./package.json": {
|
35
|
+
"default": "./package.json"
|
36
|
+
},
|
37
|
+
".": {
|
38
|
+
"types": "./index.d.ts",
|
39
|
+
"default": "./fesm2022/webilix-ngx-helper-m3.mjs"
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}
|
package/public-api.d.ts
ADDED