@craftsjs/modal 5.2.0 → 6.1.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/LICENSE +21 -21
- package/README.md +147 -113
- package/_craftsjs-modal.theme.scss +70 -70
- package/esm2022/lib/components/modal-body/modal-body.component.mjs +23 -0
- package/esm2022/lib/directives/modal-footer.directive.mjs +15 -0
- package/esm2022/lib/directives/modal-header.directive.mjs +15 -0
- package/esm2022/lib/modal.component.mjs +13 -0
- package/esm2022/lib/modal.module.mjs +64 -0
- package/esm2022/lib/modal.providers.mjs +16 -0
- package/{esm2020 → esm2022}/lib/models/modal-config.model.mjs +1 -1
- package/esm2022/lib/services/modal.service.mjs +28 -0
- package/{esm2020 → esm2022}/lib/tokens.mjs +1 -1
- package/{esm2020 → esm2022}/public-api.mjs +2 -1
- package/fesm2022/craftsjs-modal.mjs +168 -0
- package/fesm2022/craftsjs-modal.mjs.map +1 -0
- package/lib/components/modal-body/modal-body.component.d.ts +1 -1
- package/lib/directives/modal-footer.directive.d.ts +1 -1
- package/lib/directives/modal-header.directive.d.ts +1 -1
- package/lib/modal.component.d.ts +1 -1
- package/lib/modal.module.d.ts +8 -8
- package/lib/modal.providers.d.ts +7 -0
- package/package.json +11 -16
- package/public-api.d.ts +1 -0
- package/esm2020/lib/components/modal-body/modal-body.component.mjs +0 -24
- package/esm2020/lib/directives/modal-footer.directive.mjs +0 -14
- package/esm2020/lib/directives/modal-header.directive.mjs +0 -14
- package/esm2020/lib/modal.component.mjs +0 -13
- package/esm2020/lib/modal.module.mjs +0 -63
- package/esm2020/lib/services/modal.service.mjs +0 -28
- package/fesm2015/craftsjs-modal.mjs +0 -158
- package/fesm2015/craftsjs-modal.mjs.map +0 -1
- package/fesm2020/craftsjs-modal.mjs +0 -154
- package/fesm2020/craftsjs-modal.mjs.map +0 -1
- /package/{esm2020 → esm2022}/craftsjs-modal.mjs +0 -0
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, ChangeDetectionStrategy, ViewEncapsulation, Directive, ViewChild, InjectionToken, Injectable, Inject, NgModule } from '@angular/core';
|
|
3
|
-
import { CommonModule } from '@angular/common';
|
|
4
|
-
import * as i1$1 from '@angular/material/dialog';
|
|
5
|
-
import { MatDialogModule } from '@angular/material/dialog';
|
|
6
|
-
import PerfectScrollbar from 'perfect-scrollbar';
|
|
7
|
-
import * as i1 from '@craftsjs/perfect-scrollbar';
|
|
8
|
-
import { PerfectScrollbarModule } from '@craftsjs/perfect-scrollbar';
|
|
9
|
-
|
|
10
|
-
class ModalComponent {
|
|
11
|
-
}
|
|
12
|
-
ModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13
|
-
ModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ModalComponent, selector: "craftsjs-modal", host: { classAttribute: "modal" }, ngImport: i0, template: "<ng-content select=\"modal-header\"></ng-content>\n<ng-content select=\"modal-body\"></ng-content>\n<ng-content select=\"modal-footer\"></ng-content>", styles: [".mat-mdc-dialog-container{overflow:hidden!important}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
14
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalComponent, decorators: [{
|
|
15
|
-
type: Component,
|
|
16
|
-
args: [{ selector: 'craftsjs-modal', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
17
|
-
class: 'modal'
|
|
18
|
-
}, template: "<ng-content select=\"modal-header\"></ng-content>\n<ng-content select=\"modal-body\"></ng-content>\n<ng-content select=\"modal-footer\"></ng-content>", styles: [".mat-mdc-dialog-container{overflow:hidden!important}\n"] }]
|
|
19
|
-
}] });
|
|
20
|
-
|
|
21
|
-
class ModalHeaderDirective {
|
|
22
|
-
}
|
|
23
|
-
ModalHeaderDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
24
|
-
ModalHeaderDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: ModalHeaderDirective, selector: "modal-header, [modal-header], [craftsjsModalHeader]", host: { classAttribute: "modal-header" }, ngImport: i0 });
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalHeaderDirective, decorators: [{
|
|
26
|
-
type: Directive,
|
|
27
|
-
args: [{
|
|
28
|
-
selector: 'modal-header, [modal-header], [craftsjsModalHeader]',
|
|
29
|
-
host: { class: 'modal-header' }
|
|
30
|
-
}]
|
|
31
|
-
}] });
|
|
32
|
-
|
|
33
|
-
class ModalFooterDirective {
|
|
34
|
-
}
|
|
35
|
-
ModalFooterDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
36
|
-
ModalFooterDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: ModalFooterDirective, selector: "modal-footer, [modal-footer], [craftsjsModalFooter]", host: { classAttribute: "modal-footer" }, ngImport: i0 });
|
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalFooterDirective, decorators: [{
|
|
38
|
-
type: Directive,
|
|
39
|
-
args: [{
|
|
40
|
-
selector: 'modal-footer, [modal-footer], [craftsjsModalFooter]',
|
|
41
|
-
host: { class: 'modal-footer' }
|
|
42
|
-
}]
|
|
43
|
-
}] });
|
|
44
|
-
|
|
45
|
-
class ModalBodyComponent {
|
|
46
|
-
ngAfterViewInit() {
|
|
47
|
-
var _a;
|
|
48
|
-
(_a = this.ps) === null || _a === void 0 ? void 0 : _a.update();
|
|
49
|
-
}
|
|
50
|
-
ngAfterViewChecked() {
|
|
51
|
-
var _a;
|
|
52
|
-
(_a = this.ps) === null || _a === void 0 ? void 0 : _a.update();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
ModalBodyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
56
|
-
ModalBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ModalBodyComponent, selector: "modal-body, [modal-body], [craftsjsModalBody]", host: { classAttribute: "modal-body" }, viewQueries: [{ propertyName: "ps", first: true, predicate: PerfectScrollbar, descendants: true }], ngImport: i0, template: "<div class=\"modal-body-responsive\" perfectScrollbar>\n <ng-content></ng-content>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.PerfectScrollbarDirective, selector: "[perfectScrollbar]", inputs: ["perfectScrollOptions"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
57
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalBodyComponent, decorators: [{
|
|
58
|
-
type: Component,
|
|
59
|
-
args: [{ selector: 'modal-body, [modal-body], [craftsjsModalBody]', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
60
|
-
class: 'modal-body'
|
|
61
|
-
}, encapsulation: ViewEncapsulation.None, template: "<div class=\"modal-body-responsive\" perfectScrollbar>\n <ng-content></ng-content>\n</div>\n" }]
|
|
62
|
-
}], propDecorators: { ps: [{
|
|
63
|
-
type: ViewChild,
|
|
64
|
-
args: [PerfectScrollbar]
|
|
65
|
-
}] } });
|
|
66
|
-
|
|
67
|
-
const CRAFTSJS_MODAL_CONFIG = new InjectionToken('CRAFTSJS_MODAL_CONFIG');
|
|
68
|
-
|
|
69
|
-
class ModalConfig {
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
class ModalService {
|
|
73
|
-
constructor(_dialog, modalConfig) {
|
|
74
|
-
this._dialog = _dialog;
|
|
75
|
-
this.modalConfig = modalConfig;
|
|
76
|
-
}
|
|
77
|
-
show(component, data) {
|
|
78
|
-
return this._dialog.open(component, {
|
|
79
|
-
data: data === null || data === void 0 ? void 0 : data.data,
|
|
80
|
-
width: this.modalConfig.width,
|
|
81
|
-
injector: data === null || data === void 0 ? void 0 : data.injector,
|
|
82
|
-
viewContainerRef: data === null || data === void 0 ? void 0 : data.viewContainerRef
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
ModalService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalService, deps: [{ token: i1$1.MatDialog }, { token: CRAFTSJS_MODAL_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
87
|
-
ModalService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalService });
|
|
88
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalService, decorators: [{
|
|
89
|
-
type: Injectable
|
|
90
|
-
}], ctorParameters: function () {
|
|
91
|
-
return [{ type: i1$1.MatDialog }, { type: ModalConfig, decorators: [{
|
|
92
|
-
type: Inject,
|
|
93
|
-
args: [CRAFTSJS_MODAL_CONFIG]
|
|
94
|
-
}] }];
|
|
95
|
-
} });
|
|
96
|
-
|
|
97
|
-
class ModalModule {
|
|
98
|
-
static forRoot(config = { width: '800px' }) {
|
|
99
|
-
return {
|
|
100
|
-
ngModule: ModalModule,
|
|
101
|
-
providers: [
|
|
102
|
-
{ provide: CRAFTSJS_MODAL_CONFIG, useValue: config },
|
|
103
|
-
ModalService
|
|
104
|
-
]
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
ModalModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
109
|
-
ModalModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: ModalModule, declarations: [ModalComponent,
|
|
110
|
-
ModalHeaderDirective,
|
|
111
|
-
ModalFooterDirective,
|
|
112
|
-
ModalBodyComponent], imports: [CommonModule,
|
|
113
|
-
MatDialogModule,
|
|
114
|
-
PerfectScrollbarModule], exports: [ModalComponent,
|
|
115
|
-
ModalBodyComponent,
|
|
116
|
-
ModalHeaderDirective,
|
|
117
|
-
ModalFooterDirective] });
|
|
118
|
-
ModalModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalModule, providers: [
|
|
119
|
-
ModalService,
|
|
120
|
-
], imports: [CommonModule,
|
|
121
|
-
MatDialogModule,
|
|
122
|
-
PerfectScrollbarModule] });
|
|
123
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalModule, decorators: [{
|
|
124
|
-
type: NgModule,
|
|
125
|
-
args: [{
|
|
126
|
-
declarations: [
|
|
127
|
-
ModalComponent,
|
|
128
|
-
ModalHeaderDirective,
|
|
129
|
-
ModalFooterDirective,
|
|
130
|
-
ModalBodyComponent,
|
|
131
|
-
],
|
|
132
|
-
imports: [
|
|
133
|
-
CommonModule,
|
|
134
|
-
MatDialogModule,
|
|
135
|
-
PerfectScrollbarModule,
|
|
136
|
-
],
|
|
137
|
-
exports: [
|
|
138
|
-
ModalComponent,
|
|
139
|
-
ModalBodyComponent,
|
|
140
|
-
ModalHeaderDirective,
|
|
141
|
-
ModalFooterDirective
|
|
142
|
-
],
|
|
143
|
-
providers: [
|
|
144
|
-
ModalService,
|
|
145
|
-
]
|
|
146
|
-
}]
|
|
147
|
-
}] });
|
|
148
|
-
|
|
149
|
-
/*
|
|
150
|
-
* Public API Surface of modal
|
|
151
|
-
*/
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Generated bundle index. Do not edit.
|
|
155
|
-
*/
|
|
156
|
-
|
|
157
|
-
export { CRAFTSJS_MODAL_CONFIG, ModalBodyComponent, ModalComponent, ModalConfig, ModalFooterDirective, ModalHeaderDirective, ModalModule, ModalService };
|
|
158
|
-
//# sourceMappingURL=craftsjs-modal.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"craftsjs-modal.mjs","sources":["../../../../projects/craftsjs/modal/src/lib/modal.component.ts","../../../../projects/craftsjs/modal/src/lib/modal.component.html","../../../../projects/craftsjs/modal/src/lib/directives/modal-header.directive.ts","../../../../projects/craftsjs/modal/src/lib/directives/modal-footer.directive.ts","../../../../projects/craftsjs/modal/src/lib/components/modal-body/modal-body.component.ts","../../../../projects/craftsjs/modal/src/lib/components/modal-body/modal-body.component.html","../../../../projects/craftsjs/modal/src/lib/tokens.ts","../../../../projects/craftsjs/modal/src/lib/models/modal-config.model.ts","../../../../projects/craftsjs/modal/src/lib/services/modal.service.ts","../../../../projects/craftsjs/modal/src/lib/modal.module.ts","../../../../projects/craftsjs/modal/src/public-api.ts","../../../../projects/craftsjs/modal/src/craftsjs-modal.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'craftsjs-modal',\n templateUrl: './modal.component.html',\n styleUrls: ['./modal.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'modal'\n }\n})\nexport class ModalComponent { }\n","<ng-content select=\"modal-header\"></ng-content>\n<ng-content select=\"modal-body\"></ng-content>\n<ng-content select=\"modal-footer\"></ng-content>","import { Directive } from '@angular/core';\n\n@Directive({\n selector: 'modal-header, [modal-header], [craftsjsModalHeader]',\n host: { class: 'modal-header' }\n})\nexport class ModalHeaderDirective { }\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: 'modal-footer, [modal-footer], [craftsjsModalFooter]',\n host: { class: 'modal-footer' }\n})\nexport class ModalFooterDirective { }\n","import { Component, ChangeDetectionStrategy, ViewEncapsulation, ViewChild, AfterViewInit, AfterViewChecked } from '@angular/core';\nimport PerfectScrollbar from 'perfect-scrollbar';\n\n@Component({\n selector: 'modal-body, [modal-body], [craftsjsModalBody]',\n templateUrl: './modal-body.component.html',\n styleUrls: ['./modal-body.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'modal-body'\n },\n encapsulation: ViewEncapsulation.None\n})\nexport class ModalBodyComponent implements AfterViewInit, AfterViewChecked { \n\n @ViewChild(PerfectScrollbar)\n private ps: PerfectScrollbar;\n\n\n ngAfterViewInit() {\n this.ps?.update();\n }\n\n ngAfterViewChecked(): void {\n this.ps?.update();\n }\n\n}\n","<div class=\"modal-body-responsive\" perfectScrollbar>\n <ng-content></ng-content>\n</div>\n","import { InjectionToken } from '@angular/core';\n\nexport const CRAFTSJS_MODAL_CONFIG = new InjectionToken<string>('CRAFTSJS_MODAL_CONFIG');\n","export class ModalConfig {\n width: string;\n}\n","import { Injectable, TemplateRef, Inject, Injector, ViewContainerRef } from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { ComponentType } from '@angular/cdk/portal';\nimport { CRAFTSJS_MODAL_CONFIG } from '../tokens';\nimport { ModalConfig } from '../models/modal-config.model';\n\nexport interface ModalData<T = any> { \n data?: T;\n injector?: Injector;\n viewContainerRef?: ViewContainerRef;\n}\n\n@Injectable()\nexport class ModalService {\n\n constructor(\n private _dialog: MatDialog,\n @Inject(CRAFTSJS_MODAL_CONFIG) private modalConfig: ModalConfig\n ) { }\n\n show<T = any>(component: ComponentType<T> | TemplateRef<T>, data?: ModalData) {\n return this._dialog.open(component, {\n data: data?.data,\n width: this.modalConfig.width,\n injector: data?.injector,\n viewContainerRef: data?.viewContainerRef\n });\n }\n\n}\n","import { NgModule, ModuleWithProviders } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { ModalComponent } from './modal.component';\nimport { ModalHeaderDirective } from './directives/modal-header.directive';\nimport { ModalFooterDirective } from './directives/modal-footer.directive';\nimport { ModalBodyComponent } from './components/modal-body/modal-body.component';\nimport { PerfectScrollbarModule } from '@craftsjs/perfect-scrollbar';\nimport { ModalConfig } from './models/modal-config.model';\nimport { ModalService } from './services/modal.service';\nimport { CRAFTSJS_MODAL_CONFIG } from './tokens';\n\n@NgModule({\n declarations: [\n ModalComponent,\n ModalHeaderDirective,\n ModalFooterDirective,\n ModalBodyComponent,\n ],\n imports: [\n CommonModule,\n MatDialogModule,\n PerfectScrollbarModule,\n ],\n exports: [\n ModalComponent,\n ModalBodyComponent,\n ModalHeaderDirective,\n ModalFooterDirective\n ],\n providers: [\n ModalService,\n ]\n})\nexport class ModalModule {\n static forRoot(config: ModalConfig = { width: '800px' }): ModuleWithProviders<ModalModule> {\n return {\n ngModule: ModalModule,\n providers: [\n { provide: CRAFTSJS_MODAL_CONFIG, useValue: config },\n ModalService\n ]\n };\n }\n}\n","/*\n * Public API Surface of modal\n */\n\nexport * from './lib/modal.component';\nexport * from './lib/modal.module';\nexport * from './lib/components/modal-body/modal-body.component';\nexport * from './lib/directives/modal-footer.directive';\nexport * from './lib/directives/modal-header.directive';\nexport * from './lib/models/modal-config.model';\nexport * from './lib/services/modal.service';\nexport * from './lib/tokens';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAYa,cAAc,CAAA;;2GAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAd,cA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A,EAAA,CAZC,YAAY;QACZ,eAAe;QACf,sBAAsB,CAAA,EAAA,CAAA,CAAA;2FAYb,WAAW,EAAA,UAAA,EAAA,CAAA;kBAtBvB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,cAAc;wBACd,oBAAoB;wBACpB,oBAAoB;wBACpB,kBAAkB;AACnB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,eAAe;wBACf,sBAAsB;AACvB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,cAAc;wBACd,kBAAkB;wBAClB,oBAAoB;wBACpB,oBAAoB;AACrB,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACT,YAAY;AACb,qBAAA;iBACF,CAAA;;;ACjCD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, ChangeDetectionStrategy, ViewEncapsulation, Directive, ViewChild, InjectionToken, Injectable, Inject, NgModule } from '@angular/core';
|
|
3
|
-
import { CommonModule } from '@angular/common';
|
|
4
|
-
import * as i1$1 from '@angular/material/dialog';
|
|
5
|
-
import { MatDialogModule } from '@angular/material/dialog';
|
|
6
|
-
import PerfectScrollbar from 'perfect-scrollbar';
|
|
7
|
-
import * as i1 from '@craftsjs/perfect-scrollbar';
|
|
8
|
-
import { PerfectScrollbarModule } from '@craftsjs/perfect-scrollbar';
|
|
9
|
-
|
|
10
|
-
class ModalComponent {
|
|
11
|
-
}
|
|
12
|
-
ModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13
|
-
ModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ModalComponent, selector: "craftsjs-modal", host: { classAttribute: "modal" }, ngImport: i0, template: "<ng-content select=\"modal-header\"></ng-content>\n<ng-content select=\"modal-body\"></ng-content>\n<ng-content select=\"modal-footer\"></ng-content>", styles: [".mat-mdc-dialog-container{overflow:hidden!important}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
14
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalComponent, decorators: [{
|
|
15
|
-
type: Component,
|
|
16
|
-
args: [{ selector: 'craftsjs-modal', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
17
|
-
class: 'modal'
|
|
18
|
-
}, template: "<ng-content select=\"modal-header\"></ng-content>\n<ng-content select=\"modal-body\"></ng-content>\n<ng-content select=\"modal-footer\"></ng-content>", styles: [".mat-mdc-dialog-container{overflow:hidden!important}\n"] }]
|
|
19
|
-
}] });
|
|
20
|
-
|
|
21
|
-
class ModalHeaderDirective {
|
|
22
|
-
}
|
|
23
|
-
ModalHeaderDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
24
|
-
ModalHeaderDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: ModalHeaderDirective, selector: "modal-header, [modal-header], [craftsjsModalHeader]", host: { classAttribute: "modal-header" }, ngImport: i0 });
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalHeaderDirective, decorators: [{
|
|
26
|
-
type: Directive,
|
|
27
|
-
args: [{
|
|
28
|
-
selector: 'modal-header, [modal-header], [craftsjsModalHeader]',
|
|
29
|
-
host: { class: 'modal-header' }
|
|
30
|
-
}]
|
|
31
|
-
}] });
|
|
32
|
-
|
|
33
|
-
class ModalFooterDirective {
|
|
34
|
-
}
|
|
35
|
-
ModalFooterDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
36
|
-
ModalFooterDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: ModalFooterDirective, selector: "modal-footer, [modal-footer], [craftsjsModalFooter]", host: { classAttribute: "modal-footer" }, ngImport: i0 });
|
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalFooterDirective, decorators: [{
|
|
38
|
-
type: Directive,
|
|
39
|
-
args: [{
|
|
40
|
-
selector: 'modal-footer, [modal-footer], [craftsjsModalFooter]',
|
|
41
|
-
host: { class: 'modal-footer' }
|
|
42
|
-
}]
|
|
43
|
-
}] });
|
|
44
|
-
|
|
45
|
-
class ModalBodyComponent {
|
|
46
|
-
ngAfterViewInit() {
|
|
47
|
-
this.ps?.update();
|
|
48
|
-
}
|
|
49
|
-
ngAfterViewChecked() {
|
|
50
|
-
this.ps?.update();
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
ModalBodyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
54
|
-
ModalBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ModalBodyComponent, selector: "modal-body, [modal-body], [craftsjsModalBody]", host: { classAttribute: "modal-body" }, viewQueries: [{ propertyName: "ps", first: true, predicate: PerfectScrollbar, descendants: true }], ngImport: i0, template: "<div class=\"modal-body-responsive\" perfectScrollbar>\n <ng-content></ng-content>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.PerfectScrollbarDirective, selector: "[perfectScrollbar]", inputs: ["perfectScrollOptions"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalBodyComponent, decorators: [{
|
|
56
|
-
type: Component,
|
|
57
|
-
args: [{ selector: 'modal-body, [modal-body], [craftsjsModalBody]', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
58
|
-
class: 'modal-body'
|
|
59
|
-
}, encapsulation: ViewEncapsulation.None, template: "<div class=\"modal-body-responsive\" perfectScrollbar>\n <ng-content></ng-content>\n</div>\n" }]
|
|
60
|
-
}], propDecorators: { ps: [{
|
|
61
|
-
type: ViewChild,
|
|
62
|
-
args: [PerfectScrollbar]
|
|
63
|
-
}] } });
|
|
64
|
-
|
|
65
|
-
const CRAFTSJS_MODAL_CONFIG = new InjectionToken('CRAFTSJS_MODAL_CONFIG');
|
|
66
|
-
|
|
67
|
-
class ModalConfig {
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
class ModalService {
|
|
71
|
-
constructor(_dialog, modalConfig) {
|
|
72
|
-
this._dialog = _dialog;
|
|
73
|
-
this.modalConfig = modalConfig;
|
|
74
|
-
}
|
|
75
|
-
show(component, data) {
|
|
76
|
-
return this._dialog.open(component, {
|
|
77
|
-
data: data?.data,
|
|
78
|
-
width: this.modalConfig.width,
|
|
79
|
-
injector: data?.injector,
|
|
80
|
-
viewContainerRef: data?.viewContainerRef
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
ModalService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalService, deps: [{ token: i1$1.MatDialog }, { token: CRAFTSJS_MODAL_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
85
|
-
ModalService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalService });
|
|
86
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalService, decorators: [{
|
|
87
|
-
type: Injectable
|
|
88
|
-
}], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: ModalConfig, decorators: [{
|
|
89
|
-
type: Inject,
|
|
90
|
-
args: [CRAFTSJS_MODAL_CONFIG]
|
|
91
|
-
}] }]; } });
|
|
92
|
-
|
|
93
|
-
class ModalModule {
|
|
94
|
-
static forRoot(config = { width: '800px' }) {
|
|
95
|
-
return {
|
|
96
|
-
ngModule: ModalModule,
|
|
97
|
-
providers: [
|
|
98
|
-
{ provide: CRAFTSJS_MODAL_CONFIG, useValue: config },
|
|
99
|
-
ModalService
|
|
100
|
-
]
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
ModalModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
105
|
-
ModalModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: ModalModule, declarations: [ModalComponent,
|
|
106
|
-
ModalHeaderDirective,
|
|
107
|
-
ModalFooterDirective,
|
|
108
|
-
ModalBodyComponent], imports: [CommonModule,
|
|
109
|
-
MatDialogModule,
|
|
110
|
-
PerfectScrollbarModule], exports: [ModalComponent,
|
|
111
|
-
ModalBodyComponent,
|
|
112
|
-
ModalHeaderDirective,
|
|
113
|
-
ModalFooterDirective] });
|
|
114
|
-
ModalModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalModule, providers: [
|
|
115
|
-
ModalService,
|
|
116
|
-
], imports: [CommonModule,
|
|
117
|
-
MatDialogModule,
|
|
118
|
-
PerfectScrollbarModule] });
|
|
119
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ModalModule, decorators: [{
|
|
120
|
-
type: NgModule,
|
|
121
|
-
args: [{
|
|
122
|
-
declarations: [
|
|
123
|
-
ModalComponent,
|
|
124
|
-
ModalHeaderDirective,
|
|
125
|
-
ModalFooterDirective,
|
|
126
|
-
ModalBodyComponent,
|
|
127
|
-
],
|
|
128
|
-
imports: [
|
|
129
|
-
CommonModule,
|
|
130
|
-
MatDialogModule,
|
|
131
|
-
PerfectScrollbarModule,
|
|
132
|
-
],
|
|
133
|
-
exports: [
|
|
134
|
-
ModalComponent,
|
|
135
|
-
ModalBodyComponent,
|
|
136
|
-
ModalHeaderDirective,
|
|
137
|
-
ModalFooterDirective
|
|
138
|
-
],
|
|
139
|
-
providers: [
|
|
140
|
-
ModalService,
|
|
141
|
-
]
|
|
142
|
-
}]
|
|
143
|
-
}] });
|
|
144
|
-
|
|
145
|
-
/*
|
|
146
|
-
* Public API Surface of modal
|
|
147
|
-
*/
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Generated bundle index. Do not edit.
|
|
151
|
-
*/
|
|
152
|
-
|
|
153
|
-
export { CRAFTSJS_MODAL_CONFIG, ModalBodyComponent, ModalComponent, ModalConfig, ModalFooterDirective, ModalHeaderDirective, ModalModule, ModalService };
|
|
154
|
-
//# sourceMappingURL=craftsjs-modal.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"craftsjs-modal.mjs","sources":["../../../../projects/craftsjs/modal/src/lib/modal.component.ts","../../../../projects/craftsjs/modal/src/lib/modal.component.html","../../../../projects/craftsjs/modal/src/lib/directives/modal-header.directive.ts","../../../../projects/craftsjs/modal/src/lib/directives/modal-footer.directive.ts","../../../../projects/craftsjs/modal/src/lib/components/modal-body/modal-body.component.ts","../../../../projects/craftsjs/modal/src/lib/components/modal-body/modal-body.component.html","../../../../projects/craftsjs/modal/src/lib/tokens.ts","../../../../projects/craftsjs/modal/src/lib/models/modal-config.model.ts","../../../../projects/craftsjs/modal/src/lib/services/modal.service.ts","../../../../projects/craftsjs/modal/src/lib/modal.module.ts","../../../../projects/craftsjs/modal/src/public-api.ts","../../../../projects/craftsjs/modal/src/craftsjs-modal.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'craftsjs-modal',\n templateUrl: './modal.component.html',\n styleUrls: ['./modal.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'modal'\n }\n})\nexport class ModalComponent { }\n","<ng-content select=\"modal-header\"></ng-content>\n<ng-content select=\"modal-body\"></ng-content>\n<ng-content select=\"modal-footer\"></ng-content>","import { Directive } from '@angular/core';\n\n@Directive({\n selector: 'modal-header, [modal-header], [craftsjsModalHeader]',\n host: { class: 'modal-header' }\n})\nexport class ModalHeaderDirective { }\n","import { Directive } from '@angular/core';\n\n@Directive({\n selector: 'modal-footer, [modal-footer], [craftsjsModalFooter]',\n host: { class: 'modal-footer' }\n})\nexport class ModalFooterDirective { }\n","import { Component, ChangeDetectionStrategy, ViewEncapsulation, ViewChild, AfterViewInit, AfterViewChecked } from '@angular/core';\nimport PerfectScrollbar from 'perfect-scrollbar';\n\n@Component({\n selector: 'modal-body, [modal-body], [craftsjsModalBody]',\n templateUrl: './modal-body.component.html',\n styleUrls: ['./modal-body.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'modal-body'\n },\n encapsulation: ViewEncapsulation.None\n})\nexport class ModalBodyComponent implements AfterViewInit, AfterViewChecked { \n\n @ViewChild(PerfectScrollbar)\n private ps: PerfectScrollbar;\n\n\n ngAfterViewInit() {\n this.ps?.update();\n }\n\n ngAfterViewChecked(): void {\n this.ps?.update();\n }\n\n}\n","<div class=\"modal-body-responsive\" perfectScrollbar>\n <ng-content></ng-content>\n</div>\n","import { InjectionToken } from '@angular/core';\n\nexport const CRAFTSJS_MODAL_CONFIG = new InjectionToken<string>('CRAFTSJS_MODAL_CONFIG');\n","export class ModalConfig {\n width: string;\n}\n","import { Injectable, TemplateRef, Inject, Injector, ViewContainerRef } from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { ComponentType } from '@angular/cdk/portal';\nimport { CRAFTSJS_MODAL_CONFIG } from '../tokens';\nimport { ModalConfig } from '../models/modal-config.model';\n\nexport interface ModalData<T = any> { \n data?: T;\n injector?: Injector;\n viewContainerRef?: ViewContainerRef;\n}\n\n@Injectable()\nexport class ModalService {\n\n constructor(\n private _dialog: MatDialog,\n @Inject(CRAFTSJS_MODAL_CONFIG) private modalConfig: ModalConfig\n ) { }\n\n show<T = any>(component: ComponentType<T> | TemplateRef<T>, data?: ModalData) {\n return this._dialog.open(component, {\n data: data?.data,\n width: this.modalConfig.width,\n injector: data?.injector,\n viewContainerRef: data?.viewContainerRef\n });\n }\n\n}\n","import { NgModule, ModuleWithProviders } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { ModalComponent } from './modal.component';\nimport { ModalHeaderDirective } from './directives/modal-header.directive';\nimport { ModalFooterDirective } from './directives/modal-footer.directive';\nimport { ModalBodyComponent } from './components/modal-body/modal-body.component';\nimport { PerfectScrollbarModule } from '@craftsjs/perfect-scrollbar';\nimport { ModalConfig } from './models/modal-config.model';\nimport { ModalService } from './services/modal.service';\nimport { CRAFTSJS_MODAL_CONFIG } from './tokens';\n\n@NgModule({\n declarations: [\n ModalComponent,\n ModalHeaderDirective,\n ModalFooterDirective,\n ModalBodyComponent,\n ],\n imports: [\n CommonModule,\n MatDialogModule,\n PerfectScrollbarModule,\n ],\n exports: [\n ModalComponent,\n ModalBodyComponent,\n ModalHeaderDirective,\n ModalFooterDirective\n ],\n providers: [\n ModalService,\n ]\n})\nexport class ModalModule {\n static forRoot(config: ModalConfig = { width: '800px' }): ModuleWithProviders<ModalModule> {\n return {\n ngModule: ModalModule,\n providers: [\n { provide: CRAFTSJS_MODAL_CONFIG, useValue: config },\n ModalService\n ]\n };\n }\n}\n","/*\n * Public API Surface of modal\n */\n\nexport * from './lib/modal.component';\nexport * from './lib/modal.module';\nexport * from './lib/components/modal-body/modal-body.component';\nexport * from './lib/directives/modal-footer.directive';\nexport * from './lib/directives/modal-header.directive';\nexport * from './lib/models/modal-config.model';\nexport * from './lib/services/modal.service';\nexport * from './lib/tokens';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAYa,cAAc,CAAA;;2GAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAd,cAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,cAAc,yFCZ3B,uJAE+C,EAAA,MAAA,EAAA,CAAA,wDAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;2FDUlC,cAAc,EAAA,UAAA,EAAA,CAAA;kBAV1B,SAAS;+BACE,gBAAgB,EAAA,eAAA,EAGT,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,IAAI,EAC/B,IAAA,EAAA;AACJ,wBAAA,KAAK,EAAE,OAAO;AACf,qBAAA,EAAA,QAAA,EAAA,uJAAA,EAAA,MAAA,EAAA,CAAA,wDAAA,CAAA,EAAA,CAAA;;;MEJU,oBAAoB,CAAA;;iHAApB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;qGAApB,oBAAoB,EAAA,QAAA,EAAA,qDAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,cAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;2FAApB,oBAAoB,EAAA,UAAA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