@webilix/ngx-helper-m3 0.0.2 → 0.0.4

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.
@@ -1,285 +1,294 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, Component, Injectable, InjectionToken, Injector, Pipe } from '@angular/core';
3
- import { NgClass, NgComponentOutlet } from '@angular/common';
4
- import * as i1 from '@angular/material/button';
2
+ import { InjectionToken, makeEnvironmentProviders, Injectable, EventEmitter, Injector, Component, Optional, Inject, HostBinding, Input, Output, inject, Directive, Pipe } from '@angular/core';
3
+ import { NgComponentOutlet, NgClass } from '@angular/common';
4
+ import * as i3 from '@angular/material/icon';
5
+ import { MatIcon, MatIconModule } from '@angular/material/icon';
6
+ import { Helper } from '@webilix/helper-library';
7
+ import * as i1 from '@angular/router';
8
+ import { JalaliDateTime } from '@webilix/jalali-date-time';
9
+ import * as i1$1 from '@angular/platform-browser';
10
+ import * as i1$2 from '@angular/material/button';
5
11
  import { MatButtonModule, MatIconButton } from '@angular/material/button';
6
12
  import * as i2 from '@angular/material/dialog';
7
13
  import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
8
- import * as i3 from '@angular/material/icon';
9
- import { MatIconModule, MatIcon } from '@angular/material/icon';
10
- import * as i1$1 from '@angular/material/bottom-sheet';
14
+ import * as i1$3 from '@angular/material/bottom-sheet';
11
15
  import { MAT_BOTTOM_SHEET_DATA } from '@angular/material/bottom-sheet';
12
- import { Helper } from '@webilix/helper-library';
13
- import { JalaliDateTime } from '@webilix/jalali-date-time';
14
- import * as i1$2 from '@angular/platform-browser';
15
16
 
16
- class ConfirmDialogComponent {
17
- confirm = inject(MAT_DIALOG_DATA);
18
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ConfirmDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
19
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", 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 [ngClass]=\"confirm.denyClass\">\u062E\u06CC\u0631</button>\n <button mat-button type=\"button\" [mat-dialog-close]=\"true\" [ngClass]=\"confirm.confirmClass\">\u0628\u0644\u06CC</button>\n</mat-dialog-actions>\n", styles: ["content{display:flex;align-items:flex-start;column-gap:1rem;padding-top:1rem}content .icon mat-icon{font-size:200%}content .content{flex:1}content .content .question{text-align:justify}content .content .description{font-size:90%;margin-top:.5rem;text-align:justify}content .content .data{display:flex;align-items:center;column-gap:.5rem;font-size:90%;margin-top:1rem}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { 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"] }] });
20
- }
21
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ConfirmDialogComponent, decorators: [{
22
- type: Component,
23
- args: [{ host: { selector: 'confirm-dialog' }, imports: [NgClass, 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 [ngClass]=\"confirm.denyClass\">\u062E\u06CC\u0631</button>\n <button mat-button type=\"button\" [mat-dialog-close]=\"true\" [ngClass]=\"confirm.confirmClass\">\u0628\u0644\u06CC</button>\n</mat-dialog-actions>\n", styles: ["content{display:flex;align-items:flex-start;column-gap:1rem;padding-top:1rem}content .icon mat-icon{font-size:200%}content .content{flex:1}content .content .question{text-align:justify}content .content .description{font-size:90%;margin-top:.5rem;text-align:justify}content .content .data{display:flex;align-items:center;column-gap:.5rem;font-size:90%;margin-top:1rem}\n"] }]
24
- }] });
17
+ const NGX_HELPER_CONFIG = new InjectionToken('NGX-HELPER-CONFIG');
18
+ const provideNgxHelperConfig = (config) => {
19
+ const providers = [{ provide: NGX_HELPER_CONFIG, useValue: config }];
20
+ return makeEnvironmentProviders(providers);
21
+ };
25
22
 
26
- class ConfirmBottomSheetComponent {
27
- matBottomSheetRef;
28
- confirm = inject(MAT_BOTTOM_SHEET_DATA);
29
- constructor(matBottomSheetRef) {
30
- this.matBottomSheetRef = matBottomSheetRef;
31
- }
32
- close(confirmed) {
33
- this.matBottomSheetRef.dismiss(confirmed);
34
- }
35
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ConfirmBottomSheetComponent, deps: [{ token: i1$1.MatBottomSheetRef }], target: i0.ɵɵFactoryTarget.Component });
36
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", 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()\" [ngClass]=\"confirm.denyClass\">\u062E\u06CC\u0631</button>\n <button mat-button type=\"button\" (click)=\"close(true)\" [ngClass]=\"confirm.confirmClass\">\u0628\u0644\u06CC</button>\n</div>\n", styles: ["content{display:flex;align-items:flex-start;column-gap:1rem;padding-top:1rem}content .icon mat-icon{font-size:200%}content .content{flex:1}content .content .question{text-align:justify}content .content .description{font-size:90%;margin-top:.5rem;text-align:justify}content .content .data{display:flex;align-items:center;column-gap:.5rem;font-size:90%;margin-top:1rem}.buttons{display:flex;align-items:center;justify-content:flex-end;column-gap:1rem;margin:1rem 0 .5rem}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { 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"] }] });
37
- }
38
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ConfirmBottomSheetComponent, decorators: [{
39
- type: Component,
40
- args: [{ host: { selector: 'confirm-bottom-sheet' }, imports: [NgClass, 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()\" [ngClass]=\"confirm.denyClass\">\u062E\u06CC\u0631</button>\n <button mat-button type=\"button\" (click)=\"close(true)\" [ngClass]=\"confirm.confirmClass\">\u0628\u0644\u06CC</button>\n</div>\n", styles: ["content{display:flex;align-items:flex-start;column-gap:1rem;padding-top:1rem}content .icon mat-icon{font-size:200%}content .content{flex:1}content .content .question{text-align:justify}content .content .description{font-size:90%;margin-top:.5rem;text-align:justify}content .content .data{display:flex;align-items:center;column-gap:.5rem;font-size:90%;margin-top:1rem}.buttons{display:flex;align-items:center;justify-content:flex-end;column-gap:1rem;margin:1rem 0 .5rem}\n"] }]
41
- }], ctorParameters: () => [{ type: i1$1.MatBottomSheetRef }] });
42
-
43
- class NgxHelperConfirmCalss {
44
- matBottomSheet;
45
- matDialog;
46
- confirm;
47
- constructor(matBottomSheet, matDialog, confirm) {
48
- this.matBottomSheet = matBottomSheet;
49
- this.matDialog = matDialog;
50
- this.confirm = confirm;
51
- }
52
- dialog(onConfirmed, arg1, arg2) {
53
- const onDenied = typeof arg1 === 'function' ? arg1 : undefined;
54
- const config = arg2 || (typeof arg1 !== 'function' ? arg1 : {});
55
- this.matDialog
56
- .open(ConfirmDialogComponent, {
57
- // DEFAULT CONFIG
58
- width: 'calc(100vw - 4rem)',
59
- direction: 'rtl',
60
- enterAnimationDuration: '100ms',
61
- exitAnimationDuration: '100ms',
62
- // OVERWRITE CONFIG
63
- ...config,
64
- maxHeight: '80vh',
65
- // DATA
66
- data: this.confirm,
67
- })
68
- .afterClosed()
69
- .subscribe({ next: (confirmed) => (!!confirmed ? onConfirmed() : onDenied ? onDenied() : undefined) });
70
- }
71
- bottomSheet(onConfirmed, arg1, arg2) {
72
- const onDenied = typeof arg1 === 'function' ? arg1 : undefined;
73
- const config = arg2 || (typeof arg1 !== 'function' ? arg1 : {});
74
- this.matBottomSheet
75
- .open(ConfirmBottomSheetComponent, {
76
- // DEFAULT CONFIG
77
- direction: 'rtl',
78
- // OVERWRITE CONFIG
79
- ...config,
80
- maxHeight: '80vh',
81
- // DATA
82
- data: this.confirm,
83
- })
84
- .afterDismissed()
85
- .subscribe({ next: (confirmed) => (!!confirmed ? onConfirmed() : onDenied ? onDenied() : undefined) });
86
- }
87
- }
88
- class NgxHelperConfirmService {
89
- matBottomSheet;
90
- matDialog;
91
- constructor(matBottomSheet, matDialog) {
92
- this.matBottomSheet = matBottomSheet;
93
- this.matDialog = matDialog;
94
- }
95
- verify(confirm) {
96
- return new NgxHelperConfirmCalss(this.matBottomSheet, this.matDialog, confirm);
97
- }
98
- active(data, config) {
99
- return this.verify({
100
- question: `آیا می‌خواهید ${data.title} انتخاب شده را فعال کنید؟`,
101
- description: config?.description,
102
- data: data.value ? { title: data.title, value: data.value } : undefined,
103
- icon: 'check_box',
104
- confirmClass: config?.confirmClass,
105
- denyClass: config?.denyClass,
106
- });
107
- }
108
- deactive(data, config) {
109
- return this.verify({
110
- question: `آیا می‌خواهید ${data.title} انتخاب شده را غیرفعال کنید؟`,
111
- description: config?.description,
112
- data: data.value ? { title: data.title, value: data.value } : undefined,
113
- icon: 'disabled_by_default',
114
- confirmClass: config?.confirmClass || 'error',
115
- denyClass: config?.denyClass,
116
- });
117
- }
118
- status(active, data, config) {
119
- return active ? this.active(data, config || {}) : this.deactive(data, config || {});
120
- }
121
- delete(data, config) {
122
- return this.verify({
123
- question: `آیا می‌خواهید ${data.title} انتخاب شده را حذف کنید؟`,
124
- description: config?.description,
125
- data: data.value ? { title: data.title, value: data.value } : undefined,
126
- icon: 'delete',
127
- confirmClass: config?.confirmClass || 'error',
128
- denyClass: config?.denyClass,
129
- });
23
+ class ComponentService {
24
+ getComponentConfig(config) {
25
+ const getStickyView = (config) => {
26
+ return {
27
+ desktopView: typeof config === 'string' ? config : config.desktopView,
28
+ mobileView: typeof config === 'string' ? config : config.mobileView,
29
+ };
30
+ };
31
+ return {
32
+ mobileWidth: config?.mobileWidth || 600,
33
+ pageGroupSidebarWidth: config?.pageGroupSidebarWidth || '200px',
34
+ stickyView: config?.stickyView
35
+ ? {
36
+ top: config.stickyView.top ? getStickyView(config.stickyView.top) : undefined,
37
+ bottom: config.stickyView.bottom ? getStickyView(config.stickyView.bottom) : undefined,
38
+ }
39
+ : undefined,
40
+ };
130
41
  }
131
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperConfirmService, deps: [{ token: i1$1.MatBottomSheet }, { token: i2.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
132
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperConfirmService, providedIn: 'root' });
42
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ComponentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
43
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ComponentService });
133
44
  }
134
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperConfirmService, decorators: [{
135
- type: Injectable,
136
- args: [{ providedIn: 'root' }]
137
- }], ctorParameters: () => [{ type: i1$1.MatBottomSheet }, { type: i2.MatDialog }] });
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ComponentService, decorators: [{
46
+ type: Injectable
47
+ }] });
138
48
 
139
- const NGX_HELPER_CONTAINER_TYPE = new InjectionToken('NGX-HELPER-CONTAINER-TYPE');
140
- const NGX_HELPER_CONTAINER_DATA = new InjectionToken('NGX-HELPER-CONTAINER-DATA');
141
- const NGX_HELPER_CONTAINER_CLOSE = new InjectionToken('NGX-HELPER-CONTAINER-CLOSE');
49
+ const NGX_HELPER_PAGE_GROUP_DATA = new InjectionToken('NGX-HELPER-PAGE-GROUP-DATA');
50
+ const NGX_HELPER_PAGE_GROUP_INDEX = new InjectionToken('NGX-HELPER-PAGE-GROUP-INDEX');
51
+ const NGX_HELPER_PAGE_GROUP_TITLE = new InjectionToken('NGX-HELPER-PAGE-GROUP-TITLE');
142
52
 
143
- class ContainerDialogComponent {
144
- matDialogRef;
145
- container = inject(MAT_DIALOG_DATA);
53
+ class NgxHelperPageGroupComponent {
54
+ activatedRoute;
55
+ router;
56
+ componentService;
57
+ config;
58
+ className = 'ngx-helper-m3-page-group';
59
+ display = 'none';
60
+ pageGroup;
61
+ pageIndex = 0;
62
+ data;
63
+ pageIndexChanged = new EventEmitter();
64
+ isMobile = false;
146
65
  injector;
147
- constructor(matDialogRef) {
148
- this.matDialogRef = matDialogRef;
66
+ sidebarWidth;
67
+ componentConfig;
68
+ constructor(activatedRoute, router, componentService, config) {
69
+ this.activatedRoute = activatedRoute;
70
+ this.router = router;
71
+ this.componentService = componentService;
72
+ this.config = config;
149
73
  }
150
74
  ngOnInit() {
75
+ this.display = this.pageGroup.pages.length === 0 ? 'none' : 'flex';
76
+ if (this.pageGroup.pages.length === 0)
77
+ return;
78
+ this.componentConfig = this.componentService.getComponentConfig(this.config);
79
+ this.sidebarWidth = this.pageGroup.sidebarWidth || this.componentConfig.pageGroupSidebarWidth;
80
+ if (this.pageIndex < 0)
81
+ this.pageIndex = 0;
82
+ else if (this.pageIndex > this.pageGroup.pages.length - 1)
83
+ this.pageIndex = this.pageGroup.pages.length - 1;
84
+ const queryParams = { ...this.activatedRoute.snapshot.queryParams };
85
+ if (!!this.pageGroup.route && Helper.IS.number(+queryParams['ngx-helper-page-group'])) {
86
+ const index = +queryParams['ngx-helper-page-group'];
87
+ if (index >= 0 && index <= this.pageGroup.pages.length - 1) {
88
+ this.pageIndex = index;
89
+ this.pageIndexChanged.next(this.pageIndex);
90
+ }
91
+ }
92
+ this.onResize();
93
+ this.setInjector();
94
+ }
95
+ ngOnChanges(changes) {
96
+ this.setInjector();
97
+ }
98
+ onResize() {
99
+ this.isMobile = window.innerWidth <= this.componentConfig.mobileWidth;
100
+ this.className = `ngx-helper-m3-page-group${this.isMobile ? ' mobile-view' : ''}`;
101
+ }
102
+ setInjector() {
103
+ if (this.pageGroup.pages.length === 0)
104
+ return;
151
105
  this.injector = Injector.create({
152
106
  providers: [
153
- { provide: NGX_HELPER_CONTAINER_TYPE, useValue: 'DIALOG' },
154
- { provide: NGX_HELPER_CONTAINER_DATA, useValue: this.container.config.data },
155
- {
156
- provide: NGX_HELPER_CONTAINER_CLOSE,
157
- useFactory: () => (response) => this.matDialogRef.close(response),
158
- },
107
+ { provide: NGX_HELPER_PAGE_GROUP_DATA, useValue: this.data },
108
+ { provide: NGX_HELPER_PAGE_GROUP_INDEX, useValue: this.pageIndex },
109
+ { provide: NGX_HELPER_PAGE_GROUP_TITLE, useValue: this.pageGroup.pages[this.pageIndex].title },
159
110
  ],
160
111
  });
161
112
  }
162
- close() {
163
- this.matDialogRef.close();
113
+ setPage(index) {
114
+ if (this.pageGroup.pages.length === 0)
115
+ return;
116
+ if (this.pageIndex === index || index < 0 || index > this.pageGroup.pages.length - 1)
117
+ return;
118
+ this.pageIndex = index;
119
+ this.pageIndexChanged.next(this.pageIndex);
120
+ this.setInjector();
121
+ if (this.pageGroup.route) {
122
+ const queryParams = { ...this.activatedRoute.snapshot.queryParams };
123
+ queryParams['ngx-helper-page-group'] = this.pageIndex.toString();
124
+ this.router.navigate(this.pageGroup.route, { queryParams });
125
+ }
164
126
  }
165
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ContainerDialogComponent, deps: [{ token: i2.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
166
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: ContainerDialogComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "selector": "container-dialog" } }, ngImport: i0, template: "<header>\n <div class=\"title\">{{ container.title }}</div>\n @if (!container.config.hideClose) {\n <button mat-icon-button type=\"button\" (click)=\"close()\"><mat-icon>close</mat-icon></button>\n }\n</header>\n<content [style.padding]=\"container.config.padding || '1rem'\">\n <span *ngComponentOutlet=\"container.component; injector: injector\"></span>\n</content>\n", styles: ["header{display:flex;align-items:center;height:50px;line-height:50px;font-size:110%;padding:0 .5rem;border-bottom:1px solid var(--outline-variant)}header .title{flex:1;padding-right:.5rem}content{display:block;max-height:calc(80vh - 50px);overflow:auto}\n"], dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
127
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperPageGroupComponent, deps: [{ token: i1.ActivatedRoute }, { token: i1.Router }, { token: ComponentService }, { token: NGX_HELPER_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Component });
128
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: NgxHelperPageGroupComponent, isStandalone: true, selector: "ngx-helper-page-group", inputs: { pageGroup: "pageGroup", pageIndex: "pageIndex", data: "data" }, outputs: { pageIndexChanged: "pageIndexChanged" }, host: { listeners: { "window:resize": "onResize($event)" }, properties: { "className": "this.className", "style.display": "this.display" } }, providers: [ComponentService], usesOnChanges: true, ngImport: i0, template: "@if (pageGroup.pages.length > 0) {\n<!-- DESKTOP VIEW -->\n@if (!isMobile) {\n<aside\n [style.width]=\"sidebarWidth\"\n [style.position]=\"componentConfig.stickyView?.top ? 'sticky' : 'static'\"\n [style.top]=\"componentConfig.stickyView?.top?.desktopView || undefined\"\n>\n @for (item of pageGroup.pages; track $index) {\n <div\n class=\"page\"\n [class.active]=\"pageIndex === $index\"\n [style.cursor]=\"pageIndex === $index ? 'default' : 'pointer'\"\n (click)=\"setPage($index)\"\n >\n <!-- ICON -->\n <mat-icon>{{ item.icon }}</mat-icon>\n <div class=\"title\">{{ item.title }}</div>\n <!-- CURRENT PAGE -->\n @if (pageIndex === $index) { <mat-icon>keyboard_double_arrow_left</mat-icon> }\n </div>\n }\n</aside>\n}\n\n<!-- MOBILE VIEW -->\n@if (isMobile) {\n<nav\n [style.position]=\"componentConfig.stickyView?.top ? 'sticky' : 'static'\"\n [style.top]=\"componentConfig.stickyView?.top?.mobileView || undefined\"\n>\n @for (item of pageGroup.pages; track $index) {\n <div\n class=\"page\"\n [class.active]=\"pageIndex === $index\"\n [style.cursor]=\"pageIndex === $index ? 'default' : 'pointer'\"\n (click)=\"setPage($index)\"\n >\n <mat-icon>{{ item.icon }}</mat-icon>\n @if (pageIndex === $index) {\n <div class=\"title\">{{ item.title }}</div>\n }\n </div>\n }\n</nav>\n\n<div\n class=\"toolbar-spacer\"\n [style.position]=\"componentConfig.stickyView?.top ? 'sticky' : 'static'\"\n [style.top]=\"\n 'calc(' + (componentConfig.stickyView?.top?.mobileView || undefined) + ' + var(--ngx-helper-m3-toolbar-height))'\n \"\n></div>\n}\n\n<content>\n <!-- HEADER -->\n @if (pageGroup.header) {\n <header\n [style.position]=\"componentConfig.stickyView?.top ? 'sticky' : 'static'\"\n [style.top]=\"\n (isMobile\n ? 'calc(' +\n (componentConfig.stickyView?.top?.mobileView || undefined) +\n ' + var(--ngx-helper-m3-toolbar-height) + 1rem)'\n : componentConfig.stickyView?.top?.desktopView) || undefined\n \"\n >\n <span *ngComponentOutlet=\"pageGroup.header; injector: injector\"></span>\n <div class=\"spacer\"></div>\n </header>\n }\n <span *ngComponentOutlet=\"pageGroup.pages[pageIndex].component; injector: injector\"></span>\n</content>\n}\n", styles: [""], dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
167
129
  }
168
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ContainerDialogComponent, decorators: [{
130
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperPageGroupComponent, decorators: [{
169
131
  type: Component,
170
- args: [{ host: { selector: 'container-dialog' }, imports: [NgComponentOutlet, MatIconButton, MatIcon], template: "<header>\n <div class=\"title\">{{ container.title }}</div>\n @if (!container.config.hideClose) {\n <button mat-icon-button type=\"button\" (click)=\"close()\"><mat-icon>close</mat-icon></button>\n }\n</header>\n<content [style.padding]=\"container.config.padding || '1rem'\">\n <span *ngComponentOutlet=\"container.component; injector: injector\"></span>\n</content>\n", styles: ["header{display:flex;align-items:center;height:50px;line-height:50px;font-size:110%;padding:0 .5rem;border-bottom:1px solid var(--outline-variant)}header .title{flex:1;padding-right:.5rem}content{display:block;max-height:calc(80vh - 50px);overflow:auto}\n"] }]
171
- }], ctorParameters: () => [{ type: i2.MatDialogRef }] });
132
+ args: [{ selector: 'ngx-helper-page-group', host: { '(window:resize)': 'onResize($event)' }, imports: [NgComponentOutlet, MatIcon], providers: [ComponentService], template: "@if (pageGroup.pages.length > 0) {\n<!-- DESKTOP VIEW -->\n@if (!isMobile) {\n<aside\n [style.width]=\"sidebarWidth\"\n [style.position]=\"componentConfig.stickyView?.top ? 'sticky' : 'static'\"\n [style.top]=\"componentConfig.stickyView?.top?.desktopView || undefined\"\n>\n @for (item of pageGroup.pages; track $index) {\n <div\n class=\"page\"\n [class.active]=\"pageIndex === $index\"\n [style.cursor]=\"pageIndex === $index ? 'default' : 'pointer'\"\n (click)=\"setPage($index)\"\n >\n <!-- ICON -->\n <mat-icon>{{ item.icon }}</mat-icon>\n <div class=\"title\">{{ item.title }}</div>\n <!-- CURRENT PAGE -->\n @if (pageIndex === $index) { <mat-icon>keyboard_double_arrow_left</mat-icon> }\n </div>\n }\n</aside>\n}\n\n<!-- MOBILE VIEW -->\n@if (isMobile) {\n<nav\n [style.position]=\"componentConfig.stickyView?.top ? 'sticky' : 'static'\"\n [style.top]=\"componentConfig.stickyView?.top?.mobileView || undefined\"\n>\n @for (item of pageGroup.pages; track $index) {\n <div\n class=\"page\"\n [class.active]=\"pageIndex === $index\"\n [style.cursor]=\"pageIndex === $index ? 'default' : 'pointer'\"\n (click)=\"setPage($index)\"\n >\n <mat-icon>{{ item.icon }}</mat-icon>\n @if (pageIndex === $index) {\n <div class=\"title\">{{ item.title }}</div>\n }\n </div>\n }\n</nav>\n\n<div\n class=\"toolbar-spacer\"\n [style.position]=\"componentConfig.stickyView?.top ? 'sticky' : 'static'\"\n [style.top]=\"\n 'calc(' + (componentConfig.stickyView?.top?.mobileView || undefined) + ' + var(--ngx-helper-m3-toolbar-height))'\n \"\n></div>\n}\n\n<content>\n <!-- HEADER -->\n @if (pageGroup.header) {\n <header\n [style.position]=\"componentConfig.stickyView?.top ? 'sticky' : 'static'\"\n [style.top]=\"\n (isMobile\n ? 'calc(' +\n (componentConfig.stickyView?.top?.mobileView || undefined) +\n ' + var(--ngx-helper-m3-toolbar-height) + 1rem)'\n : componentConfig.stickyView?.top?.desktopView) || undefined\n \"\n >\n <span *ngComponentOutlet=\"pageGroup.header; injector: injector\"></span>\n <div class=\"spacer\"></div>\n </header>\n }\n <span *ngComponentOutlet=\"pageGroup.pages[pageIndex].component; injector: injector\"></span>\n</content>\n}\n" }]
133
+ }], ctorParameters: () => [{ type: i1.ActivatedRoute }, { type: i1.Router }, { type: ComponentService }, { type: undefined, decorators: [{
134
+ type: Optional
135
+ }, {
136
+ type: Inject,
137
+ args: [NGX_HELPER_CONFIG]
138
+ }] }], propDecorators: { className: [{
139
+ type: HostBinding,
140
+ args: ['className']
141
+ }], display: [{
142
+ type: HostBinding,
143
+ args: ['style.display']
144
+ }], pageGroup: [{
145
+ type: Input,
146
+ args: [{ required: true }]
147
+ }], pageIndex: [{
148
+ type: Input,
149
+ args: [{ required: false }]
150
+ }], data: [{
151
+ type: Input,
152
+ args: [{ required: false }]
153
+ }], pageIndexChanged: [{
154
+ type: Output
155
+ }] } });
172
156
 
173
- class ContainerBottomSheetComponent {
174
- matBottomSheetRef;
175
- container = inject(MAT_BOTTOM_SHEET_DATA);
176
- injector;
177
- constructor(matBottomSheetRef) {
178
- this.matBottomSheetRef = matBottomSheetRef;
157
+ class NgxHelperSectionStickyDirective {
158
+ elementRef;
159
+ config;
160
+ ngxHelperSectionSticky;
161
+ ngxHelperSectionZIndex;
162
+ componentService = inject(ComponentService);
163
+ componentConfig;
164
+ isMobile = false;
165
+ constructor(elementRef, config) {
166
+ this.elementRef = elementRef;
167
+ this.config = config;
179
168
  }
180
169
  ngOnInit() {
181
- this.injector = Injector.create({
182
- providers: [
183
- { provide: NGX_HELPER_CONTAINER_TYPE, useValue: 'BOTTOMSHEET' },
184
- { provide: NGX_HELPER_CONTAINER_DATA, useValue: this.container.config.data },
185
- {
186
- provide: NGX_HELPER_CONTAINER_CLOSE,
187
- useFactory: () => (response) => this.matBottomSheetRef.dismiss(response),
188
- },
189
- ],
190
- });
191
- }
192
- close() {
193
- this.matBottomSheetRef.dismiss();
170
+ this.componentConfig = this.componentService.getComponentConfig(this.config);
171
+ this.onResize();
172
+ }
173
+ onResize() {
174
+ this.isMobile = window.innerWidth <= this.componentConfig.mobileWidth;
175
+ this.setPosition();
176
+ }
177
+ setPosition() {
178
+ const element = this.elementRef.nativeElement;
179
+ if (!element)
180
+ return;
181
+ switch (this.ngxHelperSectionSticky) {
182
+ case 'TOP':
183
+ const top = this.componentConfig.stickyView?.top;
184
+ if (!top)
185
+ return;
186
+ element.style.position = 'sticky';
187
+ element.style.zIndex = this.ngxHelperSectionZIndex ? this.ngxHelperSectionZIndex.toString() : '1';
188
+ element.style.top = this.isMobile ? top.mobileView : top.desktopView;
189
+ break;
190
+ case 'BOTTOM':
191
+ const bottom = this.componentConfig.stickyView?.bottom;
192
+ if (!bottom)
193
+ return;
194
+ element.style.position = 'sticky';
195
+ element.style.zIndex = this.ngxHelperSectionZIndex ? this.ngxHelperSectionZIndex.toString() : '1';
196
+ element.style.bottom = this.isMobile ? bottom.mobileView : bottom.desktopView;
197
+ break;
198
+ }
194
199
  }
195
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ContainerBottomSheetComponent, deps: [{ token: i1$1.MatBottomSheetRef }], target: i0.ɵɵFactoryTarget.Component });
196
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: ContainerBottomSheetComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "selector": "container-bottom-sheet" } }, ngImport: i0, template: "<header>\n <div class=\"title\">{{ container.title }}</div>\n @if (!container.config.hideClose) {\n <button mat-icon-button type=\"button\" (click)=\"close()\"><mat-icon>close</mat-icon></button>\n }\n</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:flex;align-items:center;height:50px;line-height:50px;font-size:110%;padding:0 .5rem;border-bottom:1px solid var(--outline-variant)}header .title{flex:1;padding-right:.5rem}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: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
200
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperSectionStickyDirective, deps: [{ token: i0.ElementRef }, { token: NGX_HELPER_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
201
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.3", type: NgxHelperSectionStickyDirective, isStandalone: true, selector: "[ngxHelperSectionSticky]", inputs: { ngxHelperSectionSticky: "ngxHelperSectionSticky", ngxHelperSectionZIndex: "ngxHelperSectionZIndex" }, host: { listeners: { "window:resize": "onResize($event)" } }, ngImport: i0 });
197
202
  }
198
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ContainerBottomSheetComponent, decorators: [{
199
- type: Component,
200
- args: [{ host: { selector: 'container-bottom-sheet' }, imports: [NgComponentOutlet, MatIconButton, MatIcon], template: "<header>\n <div class=\"title\">{{ container.title }}</div>\n @if (!container.config.hideClose) {\n <button mat-icon-button type=\"button\" (click)=\"close()\"><mat-icon>close</mat-icon></button>\n }\n</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:flex;align-items:center;height:50px;line-height:50px;font-size:110%;padding:0 .5rem;border-bottom:1px solid var(--outline-variant)}header .title{flex:1;padding-right:.5rem}content{display:block;max-height:calc(80vh - 51px);overflow:auto}::ng-deep .ngx-helper-bottom-sheet .mat-bottom-sheet-container{padding:0}\n"] }]
201
- }], ctorParameters: () => [{ type: i1$1.MatBottomSheetRef }] });
203
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperSectionStickyDirective, decorators: [{
204
+ type: Directive,
205
+ args: [{
206
+ selector: '[ngxHelperSectionSticky]',
207
+ host: { '(window:resize)': 'onResize($event)' },
208
+ }]
209
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: undefined, decorators: [{
210
+ type: Optional
211
+ }, {
212
+ type: Inject,
213
+ args: [NGX_HELPER_CONFIG]
214
+ }] }], propDecorators: { ngxHelperSectionSticky: [{
215
+ type: Input,
216
+ args: [{ required: true }]
217
+ }], ngxHelperSectionZIndex: [{
218
+ type: Input,
219
+ args: [{ required: false }]
220
+ }] } });
202
221
 
203
- class NgxHelperContainerCalss {
204
- matBottomSheet;
205
- matDialog;
206
- container;
207
- constructor(matBottomSheet, matDialog, container) {
208
- this.matBottomSheet = matBottomSheet;
209
- this.matDialog = matDialog;
210
- this.container = container;
222
+ class NgxHelperSectionComponent {
223
+ componentService;
224
+ config;
225
+ gap;
226
+ gapSize;
227
+ componentConfig;
228
+ isMobile = false;
229
+ constructor(componentService, config) {
230
+ this.componentService = componentService;
231
+ this.config = config;
211
232
  }
212
- dialog(arg1, arg2, arg3) {
213
- const onResponse = typeof arg1 === 'function' ? arg1 : undefined;
214
- const onDismiss = typeof arg2 === 'function' ? arg2 : undefined;
215
- const config = arg3 || (typeof arg2 !== 'function' ? arg2 : {});
216
- this.matDialog
217
- .open(ContainerDialogComponent, {
218
- // DEFAULT CONFIG
219
- width: 'calc(100vw - 4rem)',
220
- direction: 'rtl',
221
- enterAnimationDuration: '100ms',
222
- exitAnimationDuration: '100ms',
223
- // OVERWRITE CONFIG
224
- ...config,
225
- maxHeight: '80vh',
226
- // DATA
227
- data: this.container,
228
- })
229
- .afterClosed()
230
- .subscribe({
231
- next: (response) => {
232
- if (onResponse && !!response)
233
- onResponse(response);
234
- if (onDismiss && !response)
235
- onDismiss();
236
- },
237
- });
233
+ ngOnInit() {
234
+ this.componentConfig = this.componentService.getComponentConfig(this.config);
235
+ this.gap = this.gapSize || '1rem';
236
+ this.onResize();
238
237
  }
239
- bottomSheet(arg1, arg2, arg3) {
240
- const onResponse = typeof arg1 === 'function' ? arg1 : undefined;
241
- const onDismiss = typeof arg2 === 'function' ? arg2 : undefined;
242
- const config = arg3 || (typeof arg2 !== 'function' ? arg2 : {});
243
- this.matBottomSheet
244
- .open(ContainerBottomSheetComponent, {
245
- // DEFAULT CONFIG
246
- direction: 'rtl',
247
- panelClass: 'ngx-helper-bottom-sheet',
248
- // OVERWRITE CONFIG
249
- ...config,
250
- maxHeight: '80vh',
251
- // DATA
252
- data: this.container,
253
- })
254
- .afterDismissed()
255
- .subscribe({
256
- next: (response) => {
257
- if (onResponse && !!response)
258
- onResponse(response);
259
- if (onDismiss && !response)
260
- onDismiss();
261
- },
262
- });
238
+ onResize() {
239
+ this.isMobile = window.innerWidth <= this.componentConfig.mobileWidth;
263
240
  }
241
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperSectionComponent, deps: [{ token: ComponentService }, { token: NGX_HELPER_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Component });
242
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: NgxHelperSectionComponent, isStandalone: true, selector: "ngx-helper-section", inputs: { gapSize: "gapSize" }, host: { listeners: { "window:resize": "onResize($event)" }, properties: { "style.--section-gap": "this.gap" } }, providers: [ComponentService], ngImport: i0, template: "<div class=\"columns\" [class.mobile]=\"isMobile\">\n <ng-content></ng-content>\n</div>\n", styles: [":host{display:block;direction:rtl}:host .columns{display:flex;align-items:flex-start;column-gap:var(--section-gap)}:host ::ng-deep ngx-helper-section-column{flex:1;display:flex;flex-direction:column;row-gap:var(--section-gap)}:host .mobile{flex-direction:column;column-gap:0;row-gap:var(--section-gap)}:host .mobile ::ng-deep ngx-helper-section-column{width:100%!important}\n"] });
264
243
  }
265
- class NgxHelperContainerService {
266
- matBottomSheet;
267
- matDialog;
268
- constructor(matBottomSheet, matDialog) {
269
- this.matBottomSheet = matBottomSheet;
270
- this.matDialog = matDialog;
271
- }
272
- init(component, title, arg1) {
273
- const config = arg1 || {};
274
- return new NgxHelperContainerCalss(this.matBottomSheet, this.matDialog, { component, title, config });
275
- }
276
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperContainerService, deps: [{ token: i1$1.MatBottomSheet }, { token: i2.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
277
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperContainerService, providedIn: 'root' });
244
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperSectionComponent, decorators: [{
245
+ type: Component,
246
+ args: [{ selector: 'ngx-helper-section', host: { '(window:resize)': 'onResize($event)' }, imports: [], providers: [ComponentService], template: "<div class=\"columns\" [class.mobile]=\"isMobile\">\n <ng-content></ng-content>\n</div>\n", styles: [":host{display:block;direction:rtl}:host .columns{display:flex;align-items:flex-start;column-gap:var(--section-gap)}:host ::ng-deep ngx-helper-section-column{flex:1;display:flex;flex-direction:column;row-gap:var(--section-gap)}:host .mobile{flex-direction:column;column-gap:0;row-gap:var(--section-gap)}:host .mobile ::ng-deep ngx-helper-section-column{width:100%!important}\n"] }]
247
+ }], ctorParameters: () => [{ type: ComponentService }, { type: undefined, decorators: [{
248
+ type: Optional
249
+ }, {
250
+ type: Inject,
251
+ args: [NGX_HELPER_CONFIG]
252
+ }] }], propDecorators: { gap: [{
253
+ type: HostBinding,
254
+ args: ['style.--section-gap']
255
+ }], gapSize: [{
256
+ type: Input,
257
+ args: [{ required: false }]
258
+ }] } });
259
+
260
+ class NgxHelperSectionColumnComponent {
261
+ flexStyle = '1';
262
+ widthStyle = '*';
263
+ flex;
264
+ width;
265
+ sticky;
266
+ ngOnChanges(changes) {
267
+ this.flexStyle = this.width ? 'unset' : this.flex?.toString() || '1';
268
+ this.widthStyle = this.width || '*';
269
+ }
270
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperSectionColumnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
271
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: NgxHelperSectionColumnComponent, isStandalone: true, selector: "ngx-helper-section-column", inputs: { flex: "flex", width: "width", sticky: "sticky" }, host: { properties: { "style.flex": "this.flexStyle", "style.width": "this.widthStyle" } }, usesOnChanges: true, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [""] });
278
272
  }
279
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperContainerService, decorators: [{
280
- type: Injectable,
281
- args: [{ providedIn: 'root' }]
282
- }], ctorParameters: () => [{ type: i1$1.MatBottomSheet }, { type: i2.MatDialog }] });
273
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperSectionColumnComponent, decorators: [{
274
+ type: Component,
275
+ args: [{ selector: 'ngx-helper-section-column', imports: [], template: "<ng-content></ng-content>\n" }]
276
+ }], propDecorators: { flexStyle: [{
277
+ type: HostBinding,
278
+ args: ['style.flex']
279
+ }], widthStyle: [{
280
+ type: HostBinding,
281
+ args: ['style.width']
282
+ }], flex: [{
283
+ type: Input,
284
+ args: [{ required: false }]
285
+ }], width: [{
286
+ type: Input,
287
+ args: [{ required: false }]
288
+ }], sticky: [{
289
+ type: Input,
290
+ args: [{ required: false }]
291
+ }] } });
283
292
 
284
293
  class NgxHelperBankCardPipe {
285
294
  transform(value, options) {
@@ -421,13 +430,13 @@ class NgxHelperMultiLinePipe {
421
430
  ? this.sanitizer.bypassSecurityTrustHtml(value.replace(/(?:\r\n|\r|\n)/g, '<br />'))
422
431
  : Helper.STRING.escapeHTML(value).replace(/(?:\r\n|\r|\n)/g, '<br />');
423
432
  }
424
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperMultiLinePipe, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
433
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperMultiLinePipe, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
425
434
  static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperMultiLinePipe, isStandalone: true, name: "ngxHelperMultiLine" });
426
435
  }
427
436
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperMultiLinePipe, decorators: [{
428
437
  type: Pipe,
429
438
  args: [{ name: 'ngxHelperMultiLine' }]
430
- }], ctorParameters: () => [{ type: i1$2.DomSanitizer }] });
439
+ }], ctorParameters: () => [{ type: i1$1.DomSanitizer }] });
431
440
 
432
441
  class NgxHelperNumberPipe {
433
442
  transform(value, options) {
@@ -508,13 +517,13 @@ class NgxHelperSafePipe {
508
517
  return this.domSanitizer.bypassSecurityTrustHtml(value);
509
518
  }
510
519
  }
511
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperSafePipe, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
520
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperSafePipe, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
512
521
  static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperSafePipe, isStandalone: true, name: "ngxHelperSafe" });
513
522
  }
514
523
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperSafePipe, decorators: [{
515
524
  type: Pipe,
516
525
  args: [{ name: 'ngxHelperSafe' }]
517
- }], ctorParameters: () => [{ type: i1$2.DomSanitizer }] });
526
+ }], ctorParameters: () => [{ type: i1$1.DomSanitizer }] });
518
527
 
519
528
  class NgxHelperVolumePipe {
520
529
  transform(value, options) {
@@ -572,6 +581,291 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
572
581
  args: [{ name: 'ngxHelperWeight' }]
573
582
  }] });
574
583
 
584
+ class ConfirmDialogComponent {
585
+ className = 'ngx-helper-m3-confirm';
586
+ confirm = inject(MAT_DIALOG_DATA);
587
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ConfirmDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
588
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: ConfirmDialogComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "selector": "confirm-dialog" }, properties: { "className": "this.className" } }, ngImport: i0, template: "<content>\n <!-- ICON -->\n @if (confirm.icon) {\n <mat-icon>{{ confirm.icon }}</mat-icon>\n }\n\n <!-- CONTENT -->\n <div class=\"confirm\">\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<footer>\n <button mat-button type=\"button\" mat-dialog-close [ngClass]=\"confirm.denyClass\">\u062E\u06CC\u0631</button>\n <button mat-button type=\"button\" [mat-dialog-close]=\"true\" [ngClass]=\"confirm.confirmClass\">\u0628\u0644\u06CC</button>\n</footer>\n", styles: [""], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$2.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: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
589
+ }
590
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ConfirmDialogComponent, decorators: [{
591
+ type: Component,
592
+ args: [{ host: { selector: 'confirm-dialog' }, imports: [NgClass, MatButtonModule, MatDialogModule, MatIconModule], template: "<content>\n <!-- ICON -->\n @if (confirm.icon) {\n <mat-icon>{{ confirm.icon }}</mat-icon>\n }\n\n <!-- CONTENT -->\n <div class=\"confirm\">\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<footer>\n <button mat-button type=\"button\" mat-dialog-close [ngClass]=\"confirm.denyClass\">\u062E\u06CC\u0631</button>\n <button mat-button type=\"button\" [mat-dialog-close]=\"true\" [ngClass]=\"confirm.confirmClass\">\u0628\u0644\u06CC</button>\n</footer>\n" }]
593
+ }], propDecorators: { className: [{
594
+ type: HostBinding,
595
+ args: ['className']
596
+ }] } });
597
+
598
+ class ConfirmBottomSheetComponent {
599
+ matBottomSheetRef;
600
+ className = 'ngx-helper-m3-confirm';
601
+ confirm = inject(MAT_BOTTOM_SHEET_DATA);
602
+ constructor(matBottomSheetRef) {
603
+ this.matBottomSheetRef = matBottomSheetRef;
604
+ }
605
+ close(confirmed) {
606
+ this.matBottomSheetRef.dismiss(confirmed);
607
+ }
608
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ConfirmBottomSheetComponent, deps: [{ token: i1$3.MatBottomSheetRef }], target: i0.ɵɵFactoryTarget.Component });
609
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: ConfirmBottomSheetComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "selector": "confirm-bottom-sheet" }, properties: { "className": "this.className" } }, ngImport: i0, template: "<content>\n <!-- ICON -->\n @if (confirm.icon) {\n <mat-icon>{{ confirm.icon }}</mat-icon>\n }\n\n <!-- CONTENT -->\n <div class=\"confirm\">\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<footer>\n <button mat-button type=\"button\" (click)=\"close()\" [ngClass]=\"confirm.denyClass\">\u062E\u06CC\u0631</button>\n <button mat-button type=\"button\" (click)=\"close(true)\" [ngClass]=\"confirm.confirmClass\">\u0628\u0644\u06CC</button>\n</footer>\n", styles: ["::ng-deep .ngx-helper-bottom-sheet .mat-bottom-sheet-container{padding:0}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1$2.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"] }] });
610
+ }
611
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ConfirmBottomSheetComponent, decorators: [{
612
+ type: Component,
613
+ args: [{ host: { selector: 'confirm-bottom-sheet' }, imports: [NgClass, MatButtonModule, MatIconModule], template: "<content>\n <!-- ICON -->\n @if (confirm.icon) {\n <mat-icon>{{ confirm.icon }}</mat-icon>\n }\n\n <!-- CONTENT -->\n <div class=\"confirm\">\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<footer>\n <button mat-button type=\"button\" (click)=\"close()\" [ngClass]=\"confirm.denyClass\">\u062E\u06CC\u0631</button>\n <button mat-button type=\"button\" (click)=\"close(true)\" [ngClass]=\"confirm.confirmClass\">\u0628\u0644\u06CC</button>\n</footer>\n", styles: ["::ng-deep .ngx-helper-bottom-sheet .mat-bottom-sheet-container{padding:0}\n"] }]
614
+ }], ctorParameters: () => [{ type: i1$3.MatBottomSheetRef }], propDecorators: { className: [{
615
+ type: HostBinding,
616
+ args: ['className']
617
+ }] } });
618
+
619
+ class NgxHelperConfirmCalss {
620
+ matBottomSheet;
621
+ matDialog;
622
+ confirm;
623
+ constructor(matBottomSheet, matDialog, confirm) {
624
+ this.matBottomSheet = matBottomSheet;
625
+ this.matDialog = matDialog;
626
+ this.confirm = confirm;
627
+ }
628
+ dialog(onConfirmed, arg1, arg2) {
629
+ const onDenied = typeof arg1 === 'function' ? arg1 : undefined;
630
+ const config = arg2 || (typeof arg1 !== 'function' ? arg1 : {});
631
+ this.matDialog
632
+ .open(ConfirmDialogComponent, {
633
+ // DEFAULT CONFIG
634
+ width: 'calc(100vw - 4rem)',
635
+ direction: 'rtl',
636
+ enterAnimationDuration: '100ms',
637
+ exitAnimationDuration: '100ms',
638
+ // OVERWRITE CONFIG
639
+ ...config,
640
+ maxHeight: '80vh',
641
+ // DATA
642
+ data: this.confirm,
643
+ })
644
+ .afterClosed()
645
+ .subscribe({ next: (confirmed) => (!!confirmed ? onConfirmed() : onDenied ? onDenied() : undefined) });
646
+ }
647
+ bottomSheet(onConfirmed, arg1, arg2) {
648
+ const onDenied = typeof arg1 === 'function' ? arg1 : undefined;
649
+ const config = arg2 || (typeof arg1 !== 'function' ? arg1 : {});
650
+ this.matBottomSheet
651
+ .open(ConfirmBottomSheetComponent, {
652
+ // DEFAULT CONFIG
653
+ direction: 'rtl',
654
+ panelClass: 'ngx-helper-bottom-sheet',
655
+ // OVERWRITE CONFIG
656
+ ...config,
657
+ maxHeight: '80vh',
658
+ // DATA
659
+ data: this.confirm,
660
+ })
661
+ .afterDismissed()
662
+ .subscribe({ next: (confirmed) => (!!confirmed ? onConfirmed() : onDenied ? onDenied() : undefined) });
663
+ }
664
+ }
665
+ class NgxHelperConfirmService {
666
+ matBottomSheet;
667
+ matDialog;
668
+ constructor(matBottomSheet, matDialog) {
669
+ this.matBottomSheet = matBottomSheet;
670
+ this.matDialog = matDialog;
671
+ }
672
+ verify(confirm) {
673
+ return new NgxHelperConfirmCalss(this.matBottomSheet, this.matDialog, confirm);
674
+ }
675
+ active(data, config) {
676
+ return this.verify({
677
+ question: `آیا می‌خواهید ${data.title} انتخاب شده را فعال کنید؟`,
678
+ description: config?.description,
679
+ data: data.value ? { title: data.title, value: data.value } : undefined,
680
+ icon: 'check_box',
681
+ confirmClass: config?.confirmClass,
682
+ denyClass: config?.denyClass,
683
+ });
684
+ }
685
+ deactive(data, config) {
686
+ return this.verify({
687
+ question: `آیا می‌خواهید ${data.title} انتخاب شده را غیرفعال کنید؟`,
688
+ description: config?.description,
689
+ data: data.value ? { title: data.title, value: data.value } : undefined,
690
+ icon: 'disabled_by_default',
691
+ confirmClass: config?.confirmClass || 'error',
692
+ denyClass: config?.denyClass,
693
+ });
694
+ }
695
+ status(active, data, config) {
696
+ return active ? this.active(data, config || {}) : this.deactive(data, config || {});
697
+ }
698
+ delete(data, config) {
699
+ return this.verify({
700
+ question: `آیا می‌خواهید ${data.title} انتخاب شده را حذف کنید؟`,
701
+ description: config?.description,
702
+ data: data.value ? { title: data.title, value: data.value } : undefined,
703
+ icon: 'delete',
704
+ confirmClass: config?.confirmClass || 'error',
705
+ denyClass: config?.denyClass,
706
+ });
707
+ }
708
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperConfirmService, deps: [{ token: i1$3.MatBottomSheet }, { token: i2.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
709
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperConfirmService, providedIn: 'root' });
710
+ }
711
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperConfirmService, decorators: [{
712
+ type: Injectable,
713
+ args: [{ providedIn: 'root' }]
714
+ }], ctorParameters: () => [{ type: i1$3.MatBottomSheet }, { type: i2.MatDialog }] });
715
+
716
+ const NGX_HELPER_CONTAINER_TYPE = new InjectionToken('NGX-HELPER-CONTAINER-TYPE');
717
+ const NGX_HELPER_CONTAINER_DATA = new InjectionToken('NGX-HELPER-CONTAINER-DATA');
718
+ const NGX_HELPER_CONTAINER_CLOSE = new InjectionToken('NGX-HELPER-CONTAINER-CLOSE');
719
+
720
+ class ContainerDialogComponent {
721
+ matDialogRef;
722
+ className = 'ngx-helper-m3-container';
723
+ container = inject(MAT_DIALOG_DATA);
724
+ injector;
725
+ constructor(matDialogRef) {
726
+ this.matDialogRef = matDialogRef;
727
+ }
728
+ ngOnInit() {
729
+ this.injector = Injector.create({
730
+ providers: [
731
+ { provide: NGX_HELPER_CONTAINER_TYPE, useValue: 'DIALOG' },
732
+ { provide: NGX_HELPER_CONTAINER_DATA, useValue: this.container.config.data },
733
+ {
734
+ provide: NGX_HELPER_CONTAINER_CLOSE,
735
+ useFactory: () => (response) => this.matDialogRef.close(response),
736
+ },
737
+ ],
738
+ });
739
+ }
740
+ close() {
741
+ this.matDialogRef.close();
742
+ }
743
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ContainerDialogComponent, deps: [{ token: i2.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
744
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: ContainerDialogComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "selector": "container-dialog" }, properties: { "className": "this.className" } }, ngImport: i0, template: "<header>\n <div class=\"title\">{{ container.title }}</div>\n @if (!container.config.hideClose) {\n <button mat-icon-button type=\"button\" (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n</header>\n<content [style.padding]=\"container.config.padding || '1rem'\">\n <span *ngComponentOutlet=\"container.component; injector: injector\"></span>\n</content>\n", styles: [""], dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
745
+ }
746
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ContainerDialogComponent, decorators: [{
747
+ type: Component,
748
+ args: [{ host: { selector: 'container-dialog' }, imports: [NgComponentOutlet, MatIconButton, MatIcon], template: "<header>\n <div class=\"title\">{{ container.title }}</div>\n @if (!container.config.hideClose) {\n <button mat-icon-button type=\"button\" (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n</header>\n<content [style.padding]=\"container.config.padding || '1rem'\">\n <span *ngComponentOutlet=\"container.component; injector: injector\"></span>\n</content>\n" }]
749
+ }], ctorParameters: () => [{ type: i2.MatDialogRef }], propDecorators: { className: [{
750
+ type: HostBinding,
751
+ args: ['className']
752
+ }] } });
753
+
754
+ class ContainerBottomSheetComponent {
755
+ matBottomSheetRef;
756
+ className = 'ngx-helper-m3-container';
757
+ container = inject(MAT_BOTTOM_SHEET_DATA);
758
+ injector;
759
+ constructor(matBottomSheetRef) {
760
+ this.matBottomSheetRef = matBottomSheetRef;
761
+ }
762
+ ngOnInit() {
763
+ this.injector = Injector.create({
764
+ providers: [
765
+ { provide: NGX_HELPER_CONTAINER_TYPE, useValue: 'BOTTOMSHEET' },
766
+ { provide: NGX_HELPER_CONTAINER_DATA, useValue: this.container.config.data },
767
+ {
768
+ provide: NGX_HELPER_CONTAINER_CLOSE,
769
+ useFactory: () => (response) => this.matBottomSheetRef.dismiss(response),
770
+ },
771
+ ],
772
+ });
773
+ }
774
+ close() {
775
+ this.matBottomSheetRef.dismiss();
776
+ }
777
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ContainerBottomSheetComponent, deps: [{ token: i1$3.MatBottomSheetRef }], target: i0.ɵɵFactoryTarget.Component });
778
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: ContainerBottomSheetComponent, isStandalone: true, selector: "ng-component", host: { attributes: { "selector": "container-bottom-sheet" }, properties: { "className": "this.className" } }, ngImport: i0, template: "<header>\n <div class=\"title\">{{ container.title }}</div>\n @if (!container.config.hideClose) {\n <button mat-icon-button type=\"button\" (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n</header>\n<content [style.padding]=\"container.config.padding || '1rem'\">\n <span *ngComponentOutlet=\"container.component; injector: injector\"></span>\n</content>\n", styles: ["::ng-deep .ngx-helper-bottom-sheet .mat-bottom-sheet-container{padding:0}\n"], dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
779
+ }
780
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: ContainerBottomSheetComponent, decorators: [{
781
+ type: Component,
782
+ args: [{ host: { selector: 'container-bottom-sheet' }, imports: [NgComponentOutlet, MatIconButton, MatIcon], template: "<header>\n <div class=\"title\">{{ container.title }}</div>\n @if (!container.config.hideClose) {\n <button mat-icon-button type=\"button\" (click)=\"close()\">\n <mat-icon>close</mat-icon>\n </button>\n }\n</header>\n<content [style.padding]=\"container.config.padding || '1rem'\">\n <span *ngComponentOutlet=\"container.component; injector: injector\"></span>\n</content>\n", styles: ["::ng-deep .ngx-helper-bottom-sheet .mat-bottom-sheet-container{padding:0}\n"] }]
783
+ }], ctorParameters: () => [{ type: i1$3.MatBottomSheetRef }], propDecorators: { className: [{
784
+ type: HostBinding,
785
+ args: ['className']
786
+ }] } });
787
+
788
+ class NgxHelperContainerCalss {
789
+ matBottomSheet;
790
+ matDialog;
791
+ container;
792
+ constructor(matBottomSheet, matDialog, container) {
793
+ this.matBottomSheet = matBottomSheet;
794
+ this.matDialog = matDialog;
795
+ this.container = container;
796
+ }
797
+ dialog(arg1, arg2, arg3) {
798
+ const onResponse = typeof arg1 === 'function' ? arg1 : undefined;
799
+ const onDismiss = typeof arg2 === 'function' ? arg2 : undefined;
800
+ const config = arg3 || (typeof arg2 !== 'function' ? arg2 : {});
801
+ this.matDialog
802
+ .open(ContainerDialogComponent, {
803
+ // DEFAULT CONFIG
804
+ width: 'calc(100vw - 4rem)',
805
+ direction: 'rtl',
806
+ enterAnimationDuration: '100ms',
807
+ exitAnimationDuration: '100ms',
808
+ // OVERWRITE CONFIG
809
+ ...config,
810
+ maxHeight: '80vh',
811
+ // DATA
812
+ data: this.container,
813
+ })
814
+ .afterClosed()
815
+ .subscribe({
816
+ next: (response) => {
817
+ if (onResponse && !!response)
818
+ onResponse(response);
819
+ if (onDismiss && !response)
820
+ onDismiss();
821
+ },
822
+ });
823
+ }
824
+ bottomSheet(arg1, arg2, arg3) {
825
+ const onResponse = typeof arg1 === 'function' ? arg1 : undefined;
826
+ const onDismiss = typeof arg2 === 'function' ? arg2 : undefined;
827
+ const config = arg3 || (typeof arg2 !== 'function' ? arg2 : {});
828
+ this.matBottomSheet
829
+ .open(ContainerBottomSheetComponent, {
830
+ // DEFAULT CONFIG
831
+ direction: 'rtl',
832
+ panelClass: 'ngx-helper-bottom-sheet',
833
+ // OVERWRITE CONFIG
834
+ ...config,
835
+ maxHeight: '80vh',
836
+ // DATA
837
+ data: this.container,
838
+ })
839
+ .afterDismissed()
840
+ .subscribe({
841
+ next: (response) => {
842
+ if (onResponse && !!response)
843
+ onResponse(response);
844
+ if (onDismiss && !response)
845
+ onDismiss();
846
+ },
847
+ });
848
+ }
849
+ }
850
+ class NgxHelperContainerService {
851
+ matBottomSheet;
852
+ matDialog;
853
+ constructor(matBottomSheet, matDialog) {
854
+ this.matBottomSheet = matBottomSheet;
855
+ this.matDialog = matDialog;
856
+ }
857
+ init(component, title, arg1) {
858
+ const config = arg1 || {};
859
+ return new NgxHelperContainerCalss(this.matBottomSheet, this.matDialog, { component, title, config });
860
+ }
861
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperContainerService, deps: [{ token: i1$3.MatBottomSheet }, { token: i2.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
862
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperContainerService, providedIn: 'root' });
863
+ }
864
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxHelperContainerService, decorators: [{
865
+ type: Injectable,
866
+ args: [{ providedIn: 'root' }]
867
+ }], ctorParameters: () => [{ type: i1$3.MatBottomSheet }, { type: i2.MatDialog }] });
868
+
575
869
  /*
576
870
  * Public API Surface of ngx-helper-m3
577
871
  */
@@ -580,5 +874,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
580
874
  * Generated bundle index. Do not edit.
581
875
  */
582
876
 
583
- export { NGX_HELPER_CONTAINER_CLOSE, NGX_HELPER_CONTAINER_DATA, NGX_HELPER_CONTAINER_TYPE, NgxHelperBankCardPipe, NgxHelperConfirmService, NgxHelperContainerService, NgxHelperDatePipe, NgxHelperDurationPipe, NgxHelperFileSizePipe, NgxHelperMobilePipe, NgxHelperMultiLinePipe, NgxHelperNumberPipe, NgxHelperPeriodPipe, NgxHelperPricePipe, NgxHelperSafePipe, NgxHelperVolumePipe, NgxHelperWeightPipe };
877
+ export { NGX_HELPER_CONFIG, NGX_HELPER_CONTAINER_CLOSE, NGX_HELPER_CONTAINER_DATA, NGX_HELPER_CONTAINER_TYPE, NGX_HELPER_PAGE_GROUP_DATA, NGX_HELPER_PAGE_GROUP_INDEX, NGX_HELPER_PAGE_GROUP_TITLE, NgxHelperBankCardPipe, NgxHelperConfirmService, NgxHelperContainerService, NgxHelperDatePipe, NgxHelperDurationPipe, NgxHelperFileSizePipe, NgxHelperMobilePipe, NgxHelperMultiLinePipe, NgxHelperNumberPipe, NgxHelperPageGroupComponent, NgxHelperPeriodPipe, NgxHelperPricePipe, NgxHelperSafePipe, NgxHelperSectionColumnComponent, NgxHelperSectionComponent, NgxHelperSectionStickyDirective, NgxHelperVolumePipe, NgxHelperWeightPipe, provideNgxHelperConfig };
584
878
  //# sourceMappingURL=webilix-ngx-helper-m3.mjs.map