@webilix/ngx-helper-m3 0.0.6 → 0.0.8
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/fesm2022/webilix-ngx-helper-m3.mjs +360 -66
- package/fesm2022/webilix-ngx-helper-m3.mjs.map +1 -1
- package/lib/components/box/ngx-helper-box.component.d.ts +17 -0
- package/lib/components/box/ngx-helper-box.interface.d.ts +2 -0
- package/lib/components/card/ngx-helper-card.component.d.ts +2 -1
- package/lib/components/value/box/ngx-helper-value-box.component.d.ts +43 -0
- package/lib/components/value/list/ngx-helper-value-list.component.d.ts +28 -0
- package/lib/components/value/ngx-helper-value.info.d.ts +2 -0
- package/lib/components/value/ngx-helper-value.interface.d.ts +76 -0
- package/lib/components/value/ngx-helper-value.pipe.d.ts +10 -0
- package/lib/pipe.types.d.ts +2 -0
- package/lib/pipes/bank-card.pipe.d.ts +1 -1
- package/lib/pipes/date.pipe.d.ts +5 -6
- package/lib/pipes/duration.pipe.d.ts +14 -15
- package/lib/pipes/file-size.pipe.d.ts +1 -1
- package/lib/pipes/mobile.pipe.d.ts +1 -1
- package/lib/pipes/multi-line.pipe.d.ts +3 -3
- package/lib/pipes/number.pipe.d.ts +1 -1
- package/lib/pipes/period.pipe.d.ts +7 -7
- package/lib/pipes/price.pipe.d.ts +1 -1
- package/lib/pipes/safe.pipe.d.ts +1 -1
- package/lib/pipes/volume.pipe.d.ts +1 -1
- package/lib/pipes/weight.pipe.d.ts +1 -1
- package/ngx-helper-m3.css +192 -0
- package/package.json +1 -1
- package/public-api.d.ts +6 -0
@@ -1,15 +1,17 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { InjectionToken, makeEnvironmentProviders,
|
3
|
-
import {
|
2
|
+
import { InjectionToken, makeEnvironmentProviders, Injector, Component, HostBinding, Input, Injectable, Optional, Inject, EventEmitter, Output, inject, Directive, Pipe } from '@angular/core';
|
3
|
+
import { NgComponentOutlet, NgClass } from '@angular/common';
|
4
4
|
import * as i1$2 from '@angular/material/button';
|
5
|
-
import { MatButton,
|
5
|
+
import { MatButton, MatIconButton, MatButtonModule } from '@angular/material/button';
|
6
6
|
import { MatDivider } from '@angular/material/divider';
|
7
|
-
import * as i3 from '@angular/material/icon';
|
7
|
+
import * as i3$1 from '@angular/material/icon';
|
8
8
|
import { MatIcon, MatIconModule } from '@angular/material/icon';
|
9
9
|
import * as i2 from '@angular/material/menu';
|
10
10
|
import { MatMenuModule } from '@angular/material/menu';
|
11
11
|
import { Helper } from '@webilix/helper-library';
|
12
12
|
import * as i1 from '@angular/router';
|
13
|
+
import * as i3 from '@angular/cdk/clipboard';
|
14
|
+
import { ClipboardModule } from '@angular/cdk/clipboard';
|
13
15
|
import { JalaliDateTime } from '@webilix/jalali-date-time';
|
14
16
|
import * as i1$1 from '@angular/platform-browser';
|
15
17
|
import * as i2$1 from '@angular/material/dialog';
|
@@ -23,6 +25,57 @@ const provideNgxHelperConfig = (config) => {
|
|
23
25
|
return makeEnvironmentProviders(providers);
|
24
26
|
};
|
25
27
|
|
28
|
+
const NGX_HELPER_BOX_DATA = new InjectionToken('NGX-HELPER-BOX-DATA');
|
29
|
+
|
30
|
+
class NgxHelperBoxComponent {
|
31
|
+
className = 'ngx-helper-m3-box';
|
32
|
+
paddingCSS;
|
33
|
+
component;
|
34
|
+
data;
|
35
|
+
padding = '1rem';
|
36
|
+
hideShadow = false;
|
37
|
+
injector;
|
38
|
+
ngOnInit() {
|
39
|
+
this.setInjector();
|
40
|
+
}
|
41
|
+
ngOnChanges(changes) {
|
42
|
+
this.setInjector();
|
43
|
+
}
|
44
|
+
setInjector() {
|
45
|
+
this.paddingCSS = this.padding;
|
46
|
+
this.className = `ngx-helper-m3-box${this.hideShadow ? ' hide-shadow' : ''}`;
|
47
|
+
if (!this.component)
|
48
|
+
return;
|
49
|
+
this.injector = Injector.create({
|
50
|
+
providers: [{ provide: NGX_HELPER_BOX_DATA, useValue: this.data }],
|
51
|
+
});
|
52
|
+
}
|
53
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
54
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: NgxHelperBoxComponent, isStandalone: true, selector: "ngx-helper-box", inputs: { component: "component", data: "data", padding: "padding", hideShadow: "hideShadow" }, host: { properties: { "className": "this.className", "style.padding": "this.paddingCSS" } }, usesOnChanges: true, ngImport: i0, template: "@if (component) {\n<span *ngComponentOutlet=\"component; injector: injector\"></span>\n} @else {\n<ng-content></ng-content>\n}\n", styles: [""], dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }] });
|
55
|
+
}
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperBoxComponent, decorators: [{
|
57
|
+
type: Component,
|
58
|
+
args: [{ selector: 'ngx-helper-box', imports: [NgComponentOutlet], template: "@if (component) {\n<span *ngComponentOutlet=\"component; injector: injector\"></span>\n} @else {\n<ng-content></ng-content>\n}\n" }]
|
59
|
+
}], propDecorators: { className: [{
|
60
|
+
type: HostBinding,
|
61
|
+
args: ['className']
|
62
|
+
}], paddingCSS: [{
|
63
|
+
type: HostBinding,
|
64
|
+
args: ['style.padding']
|
65
|
+
}], component: [{
|
66
|
+
type: Input,
|
67
|
+
args: [{ required: false }]
|
68
|
+
}], data: [{
|
69
|
+
type: Input,
|
70
|
+
args: [{ required: false }]
|
71
|
+
}], padding: [{
|
72
|
+
type: Input,
|
73
|
+
args: [{ required: false }]
|
74
|
+
}], hideShadow: [{
|
75
|
+
type: Input,
|
76
|
+
args: [{ required: false }]
|
77
|
+
}] } });
|
78
|
+
|
26
79
|
class ComponentService {
|
27
80
|
getComponentConfig(config) {
|
28
81
|
const getStickyView = (config) => {
|
@@ -59,6 +112,7 @@ class NgxHelperCardComponent {
|
|
59
112
|
actions = [];
|
60
113
|
padding = '1rem';
|
61
114
|
backgroundColor;
|
115
|
+
hasShadow = false;
|
62
116
|
isMobile = false;
|
63
117
|
buttons = [];
|
64
118
|
componentConfig;
|
@@ -71,6 +125,7 @@ class NgxHelperCardComponent {
|
|
71
125
|
this.onResize();
|
72
126
|
}
|
73
127
|
ngOnChanges(changes) {
|
128
|
+
this.className = `ngx-helper-m3-card${this.hasShadow ? ' has-shadow' : ''}`;
|
74
129
|
this.buttons = this.actions.map((action) => {
|
75
130
|
return 'buttons' in action ? { type: 'MENU', ...action } : { type: 'BUTTON', ...action };
|
76
131
|
});
|
@@ -79,7 +134,7 @@ class NgxHelperCardComponent {
|
|
79
134
|
this.isMobile = window.innerWidth <= this.componentConfig.mobileWidth;
|
80
135
|
}
|
81
136
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperCardComponent, deps: [{ token: ComponentService }, { token: NGX_HELPER_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
82
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: NgxHelperCardComponent, isStandalone: true, selector: "ngx-helper-card", inputs: { title: "title", subTitle: "subTitle", icon: "icon", actions: "actions", padding: "padding", backgroundColor: "backgroundColor" }, host: { listeners: { "window:resize": "onResize($event)" }, properties: { "className": "this.className" } }, providers: [ComponentService], usesOnChanges: true, ngImport: i0, template: "<header>\n <!-- ICON -->\n @if (icon) { <mat-icon>{{ icon }}</mat-icon> }\n\n <!-- TITLE -->\n <div class=\"content\">\n <div class=\"title\">{{ title }}</div>\n <!-- SUB TITLE -->\n @if (subTitle) {\n <div class=\"sub-title\">{{ subTitle }}</div>\n }\n </div>\n\n <!-- BUTTONS -->\n @if (buttons.length > 0) {\n <div class=\"buttons\" [ngClass]=\"isMobile ? 'mobile-view' : ''\">\n @for (item of buttons; track $index) {\n <!-- TYPE -->\n @switch (item.type) {\n\n <!-- BUTTON -->\n @case('BUTTON') {\n <button mat-button type=\"button\" [style.color]=\"item.color\" (click)=\"item.action()\">\n @if (!isMobile) {\n <div class=\"title\">{{ item.title }}</div>\n }\n <!-- ICON -->\n @if (isMobile || item.showIcon) {\n <mat-icon>{{ item.icon }}</mat-icon>\n }\n </button>\n }\n\n <!-- MENU -->\n @case('MENU') {\n <button mat-button type=\"button\" [style.color]=\"item.color\" [matMenuTriggerFor]=\"actionMenu\">\n @if (!isMobile) {\n <div class=\"title\">{{ item.title }}</div>\n }\n <!-- ICON -->\n @if (isMobile || item.showIcon) {\n <mat-icon>{{ item.icon }}</mat-icon>\n }\n </button>\n <mat-menu #actionMenu=\"matMenu\" class=\"ngx-helper-card-action-menu\">\n @for (menu of item.buttons; track $index) {\n <!-- DIVIDER -->\n @if (menu === 'DIVIDER') { <mat-divider></mat-divider> }\n <!-- BUTTON -->\n @else {\n <button mat-menu-item type=\"button\" (click)=\"menu.action()\" [style.color]=\"menu.color\">\n <div class=\"title\">{{ menu.title }}</div>\n <mat-icon [style.color]=\"menu.color\">{{ menu.icon }}</mat-icon>\n </button>\n } }\n </mat-menu>\n } } }\n </div>\n }\n</header>\n\n<content [style.padding]=\"padding\" [style.background-color]=\"backgroundColor\"><ng-content></ng-content></content>\n", styles: ["::ng-deep .ngx-helper-card-action-menu button mat-icon{font-size:115%;margin:0 0 0 .75rem!important}::ng-deep .ngx-helper-card-action-menu button .title{font-size:90%!important}::ng-deep .ngx-helper-card-action-menu .mat-mdc-menu-content{padding:0}::ng-deep .ngx-helper-card-action-menu .mat-mdc-menu-item{direction:rtl;text-align:right}::ng-deep .ngx-helper-card-action-menu .mat-divider{margin:0;border-top-color:var(--outline-variant)}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i2.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i2.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }] });
|
137
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: NgxHelperCardComponent, isStandalone: true, selector: "ngx-helper-card", inputs: { title: "title", subTitle: "subTitle", icon: "icon", actions: "actions", padding: "padding", backgroundColor: "backgroundColor", hasShadow: "hasShadow" }, host: { listeners: { "window:resize": "onResize($event)" }, properties: { "className": "this.className" } }, providers: [ComponentService], usesOnChanges: true, ngImport: i0, template: "<header>\n <!-- ICON -->\n @if (icon) { <mat-icon>{{ icon }}</mat-icon> }\n\n <!-- TITLE -->\n <div class=\"content\">\n <div class=\"title\">{{ title }}</div>\n <!-- SUB TITLE -->\n @if (subTitle) {\n <div class=\"sub-title\">{{ subTitle }}</div>\n }\n </div>\n\n <!-- BUTTONS -->\n @if (buttons.length > 0) {\n <div class=\"buttons\" [ngClass]=\"isMobile ? 'mobile-view' : ''\">\n @for (item of buttons; track $index) {\n <!-- TYPE -->\n @switch (item.type) {\n\n <!-- BUTTON -->\n @case('BUTTON') {\n <button mat-button type=\"button\" [style.color]=\"item.color\" (click)=\"item.action()\">\n @if (!isMobile) {\n <div class=\"title\">{{ item.title }}</div>\n }\n <!-- ICON -->\n @if (isMobile || item.showIcon) {\n <mat-icon>{{ item.icon }}</mat-icon>\n }\n </button>\n }\n\n <!-- MENU -->\n @case('MENU') {\n <button mat-button type=\"button\" [style.color]=\"item.color\" [matMenuTriggerFor]=\"actionMenu\">\n @if (!isMobile) {\n <div class=\"title\">{{ item.title }}</div>\n }\n <!-- ICON -->\n @if (isMobile || item.showIcon) {\n <mat-icon>{{ item.icon }}</mat-icon>\n }\n </button>\n <mat-menu #actionMenu=\"matMenu\" class=\"ngx-helper-card-action-menu\">\n @for (menu of item.buttons; track $index) {\n <!-- DIVIDER -->\n @if (menu === 'DIVIDER') { <mat-divider></mat-divider> }\n <!-- BUTTON -->\n @else {\n <button mat-menu-item type=\"button\" (click)=\"menu.action()\" [style.color]=\"menu.color\">\n <div class=\"title\">{{ menu.title }}</div>\n <mat-icon [style.color]=\"menu.color\">{{ menu.icon }}</mat-icon>\n </button>\n } }\n </mat-menu>\n } } }\n </div>\n }\n</header>\n\n<content [style.padding]=\"padding\" [style.background-color]=\"backgroundColor\"><ng-content></ng-content></content>\n", styles: ["::ng-deep .ngx-helper-card-action-menu button mat-icon{font-size:115%;margin:0 0 0 .75rem!important}::ng-deep .ngx-helper-card-action-menu button .title{font-size:90%!important}::ng-deep .ngx-helper-card-action-menu .mat-mdc-menu-content{padding:0}::ng-deep .ngx-helper-card-action-menu .mat-mdc-menu-item{direction:rtl;text-align:right}::ng-deep .ngx-helper-card-action-menu .mat-divider{margin:0;border-top-color:var(--outline-variant)}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i2.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i2.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }] });
|
83
138
|
}
|
84
139
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperCardComponent, decorators: [{
|
85
140
|
type: Component,
|
@@ -110,6 +165,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
110
165
|
}], backgroundColor: [{
|
111
166
|
type: Input,
|
112
167
|
args: [{ required: false }]
|
168
|
+
}], hasShadow: [{
|
169
|
+
type: Input,
|
170
|
+
args: [{ required: false }]
|
113
171
|
}] } });
|
114
172
|
|
115
173
|
class NgxHelperLoaderComponent {
|
@@ -395,9 +453,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
395
453
|
args: [{ required: false }]
|
396
454
|
}] } });
|
397
455
|
|
456
|
+
const ltrValues = ['BANK-CARD', 'MOBILE', 'NUMBER'];
|
457
|
+
|
398
458
|
class NgxHelperBankCardPipe {
|
399
459
|
transform(value, options) {
|
400
|
-
if (!Helper.IS.string(value) || value === '')
|
460
|
+
if (value === undefined || value === null || !Helper.IS.string(value) || value === '')
|
401
461
|
return '';
|
402
462
|
switch (options?.view) {
|
403
463
|
case 'BANK':
|
@@ -416,7 +476,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
416
476
|
|
417
477
|
class NgxHelperDatePipe {
|
418
478
|
transform(value, options) {
|
419
|
-
if (
|
479
|
+
if (value === undefined || value === null || (!Helper.IS.date(value) && !Helper.IS.number(value)))
|
420
480
|
return '';
|
421
481
|
const date = typeof value === 'number' ? new Date(value) : value;
|
422
482
|
const jalali = JalaliDateTime();
|
@@ -451,6 +511,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
451
511
|
|
452
512
|
class NgxHelperDurationPipe {
|
453
513
|
transform(value, options) {
|
514
|
+
if (value === undefined || value === null)
|
515
|
+
return '';
|
454
516
|
let seconds = 0;
|
455
517
|
if (Helper.IS.number(value))
|
456
518
|
seconds = Math.abs(value);
|
@@ -498,8 +560,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
498
560
|
}] });
|
499
561
|
|
500
562
|
class NgxHelperFileSizePipe {
|
501
|
-
transform(
|
502
|
-
|
563
|
+
transform(value, options) {
|
564
|
+
if (value === undefined || value === null || !Helper.IS.number(value))
|
565
|
+
return '';
|
566
|
+
return Helper.NUMBER.toFileSize(value, !!options?.english ? 'EN' : 'FA');
|
503
567
|
}
|
504
568
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperFileSizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
505
569
|
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperFileSizePipe, isStandalone: true, name: "ngxHelperFileSize" });
|
@@ -511,7 +575,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
511
575
|
|
512
576
|
class NgxHelperMobilePipe {
|
513
577
|
transform(value, options) {
|
514
|
-
if (!Helper.IS.string(value) || value === '')
|
578
|
+
if (value === undefined || value === null || !Helper.IS.string(value) || value === '')
|
515
579
|
return '';
|
516
580
|
return Helper.STRING.getMobileView(value, options?.join || '-');
|
517
581
|
}
|
@@ -523,29 +587,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
523
587
|
args: [{ name: 'ngxHelperMobile' }]
|
524
588
|
}] });
|
525
589
|
|
526
|
-
class NgxHelperMultiLinePipe {
|
527
|
-
sanitizer;
|
528
|
-
constructor(sanitizer) {
|
529
|
-
this.sanitizer = sanitizer;
|
530
|
-
}
|
531
|
-
transform(value, options) {
|
532
|
-
if (!Helper.IS.string(value) || value === '')
|
533
|
-
return '';
|
534
|
-
return options?.html
|
535
|
-
? this.sanitizer.bypassSecurityTrustHtml(value.replace(/(?:\r\n|\r|\n)/g, '<br />'))
|
536
|
-
: Helper.STRING.escapeHTML(value).replace(/(?:\r\n|\r|\n)/g, '<br />');
|
537
|
-
}
|
538
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperMultiLinePipe, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
539
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperMultiLinePipe, isStandalone: true, name: "ngxHelperMultiLine" });
|
540
|
-
}
|
541
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperMultiLinePipe, decorators: [{
|
542
|
-
type: Pipe,
|
543
|
-
args: [{ name: 'ngxHelperMultiLine' }]
|
544
|
-
}], ctorParameters: () => [{ type: i1$1.DomSanitizer }] });
|
545
|
-
|
546
590
|
class NgxHelperNumberPipe {
|
547
591
|
transform(value, options) {
|
548
|
-
if (!Helper.IS.number(value))
|
592
|
+
if (value === undefined || value === null || !Helper.IS.number(value))
|
549
593
|
return '';
|
550
594
|
value = options?.fractionDigits ? +value.toFixed(options?.fractionDigits) : value;
|
551
595
|
return Helper.NUMBER.format(value, options?.english ? 'EN' : 'FA');
|
@@ -560,6 +604,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
560
604
|
|
561
605
|
class NgxHelperPeriodPipe {
|
562
606
|
transform(value, options) {
|
607
|
+
if (value === undefined || value === null)
|
608
|
+
return '';
|
563
609
|
const from = Helper.IS.date(value) ? value : 'from' in value ? value.from : new Date();
|
564
610
|
const to = Helper.IS.date(value) ? new Date() : 'to' in value ? value.to : new Date();
|
565
611
|
return Helper.DATE.jalaliPeriod(from, to, options?.timezone || '');
|
@@ -574,9 +620,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
574
620
|
|
575
621
|
class NgxHelperPricePipe {
|
576
622
|
transform(value, options) {
|
577
|
-
if (!Helper.IS.number(value) || value < 0)
|
623
|
+
if (value === undefined || value === null || !Helper.IS.number(value) || value < 0)
|
578
624
|
return '';
|
579
625
|
const getPrice = (...titles) => {
|
626
|
+
if (value === undefined || value === null)
|
627
|
+
return '';
|
580
628
|
const price = Helper.NUMBER.format(+value.toFixed(2), !!options?.english ? 'EN' : 'FA');
|
581
629
|
const unit = titles[options?.short ? 0 : 1][options?.english ? 0 : 1];
|
582
630
|
const currency = options?.currency ? ' ' + options?.currency : '';
|
@@ -601,40 +649,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
601
649
|
args: [{ name: 'ngxHelperPrice' }]
|
602
650
|
}] });
|
603
651
|
|
604
|
-
class NgxHelperSafePipe {
|
605
|
-
domSanitizer;
|
606
|
-
constructor(domSanitizer) {
|
607
|
-
this.domSanitizer = domSanitizer;
|
608
|
-
}
|
609
|
-
transform(value, options) {
|
610
|
-
if (!Helper.IS.string(value) || value === '')
|
611
|
-
return '';
|
612
|
-
switch (options?.type || 'HTML') {
|
613
|
-
case 'STYLE':
|
614
|
-
return this.domSanitizer.bypassSecurityTrustStyle(value);
|
615
|
-
case 'SCRIPT':
|
616
|
-
return this.domSanitizer.bypassSecurityTrustScript(value);
|
617
|
-
case 'URL':
|
618
|
-
return this.domSanitizer.bypassSecurityTrustUrl(value);
|
619
|
-
case 'RESOURCE_URL':
|
620
|
-
return this.domSanitizer.bypassSecurityTrustResourceUrl(value);
|
621
|
-
case 'HTML':
|
622
|
-
return this.domSanitizer.bypassSecurityTrustHtml(value);
|
623
|
-
}
|
624
|
-
}
|
625
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperSafePipe, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
626
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperSafePipe, isStandalone: true, name: "ngxHelperSafe" });
|
627
|
-
}
|
628
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperSafePipe, decorators: [{
|
629
|
-
type: Pipe,
|
630
|
-
args: [{ name: 'ngxHelperSafe' }]
|
631
|
-
}], ctorParameters: () => [{ type: i1$1.DomSanitizer }] });
|
632
|
-
|
633
652
|
class NgxHelperVolumePipe {
|
634
653
|
transform(value, options) {
|
635
|
-
if (!Helper.IS.number(value) || value < 0)
|
654
|
+
if (value === undefined || value === null || !Helper.IS.number(value) || value < 0)
|
636
655
|
return '';
|
637
656
|
const getVolume = (...titles) => {
|
657
|
+
if (value === undefined || value === null)
|
658
|
+
return '';
|
638
659
|
const volume = Helper.NUMBER.format(+value.toFixed(2), options?.english ? 'EN' : 'FA');
|
639
660
|
const shortIndex = options?.short ? 0 : 1;
|
640
661
|
const titleIndex = options?.english ? 0 : 1;
|
@@ -657,9 +678,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
657
678
|
|
658
679
|
class NgxHelperWeightPipe {
|
659
680
|
transform(value, options) {
|
660
|
-
if (!Helper.IS.number(value) || value < 0)
|
681
|
+
if (value === undefined || value === null || !Helper.IS.number(value) || value < 0)
|
661
682
|
return '';
|
662
683
|
const getWeight = (...titles) => {
|
684
|
+
if (value === undefined || value === null)
|
685
|
+
return '';
|
663
686
|
const weight = Helper.NUMBER.format(+value.toFixed(2), options?.english ? 'EN' : 'FA');
|
664
687
|
const shortIndex = options?.short ? 0 : 1;
|
665
688
|
const titleIndex = options?.english ? 0 : 1;
|
@@ -686,11 +709,282 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
686
709
|
args: [{ name: 'ngxHelperWeight' }]
|
687
710
|
}] });
|
688
711
|
|
712
|
+
class NgxHelperValuePipe {
|
713
|
+
transform(value, options) {
|
714
|
+
const emptyText = options?.emptyText || '';
|
715
|
+
if (value === undefined || Helper.IS.empty(value))
|
716
|
+
return emptyText;
|
717
|
+
switch (value.type) {
|
718
|
+
case 'BANK-CARD':
|
719
|
+
return new NgxHelperBankCardPipe().transform(value.value, value) || emptyText;
|
720
|
+
case 'DATE':
|
721
|
+
return new NgxHelperDatePipe().transform(value.value, value) || emptyText;
|
722
|
+
case 'DURATION':
|
723
|
+
return new NgxHelperDurationPipe().transform(value.value, value) || emptyText;
|
724
|
+
case 'FILE-SIZE':
|
725
|
+
return new NgxHelperFileSizePipe().transform(value.value, value) || emptyText;
|
726
|
+
case 'MOBILE':
|
727
|
+
return new NgxHelperMobilePipe().transform(value.value, value) || emptyText;
|
728
|
+
case 'NUMBER':
|
729
|
+
return new NgxHelperNumberPipe().transform(value.value, value) || emptyText;
|
730
|
+
case 'PERIOD':
|
731
|
+
return new NgxHelperPeriodPipe().transform(value.value, value) || emptyText;
|
732
|
+
case 'PRICE':
|
733
|
+
return new NgxHelperPricePipe().transform(value.value, value) || emptyText;
|
734
|
+
case 'STRING':
|
735
|
+
return Helper.IS.string(value.value) ? value.value : emptyText;
|
736
|
+
case 'VOLUME':
|
737
|
+
return new NgxHelperVolumePipe().transform(value.value, value) || emptyText;
|
738
|
+
case 'WEIGHT':
|
739
|
+
return new NgxHelperWeightPipe().transform(value.value, value) || emptyText;
|
740
|
+
}
|
741
|
+
}
|
742
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
743
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperValuePipe, isStandalone: true, name: "ngxHelperValue" });
|
744
|
+
}
|
745
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperValuePipe, decorators: [{
|
746
|
+
type: Pipe,
|
747
|
+
args: [{ name: 'ngxHelperValue' }]
|
748
|
+
}] });
|
749
|
+
|
750
|
+
class NgxHelperValueBoxComponent {
|
751
|
+
router;
|
752
|
+
componentService;
|
753
|
+
config;
|
754
|
+
className = 'ngx-helper-m3-value-box';
|
755
|
+
gridTemplateColumns;
|
756
|
+
boxGap;
|
757
|
+
values;
|
758
|
+
column;
|
759
|
+
clearBox = false;
|
760
|
+
emptyText = 'نامشخص';
|
761
|
+
gapSize = '1rem';
|
762
|
+
hideShadow = false;
|
763
|
+
data = [];
|
764
|
+
copyIndex;
|
765
|
+
copyTimeout;
|
766
|
+
componentConfig;
|
767
|
+
pipeTransform = new NgxHelperValuePipe().transform;
|
768
|
+
constructor(router, componentService, config) {
|
769
|
+
this.router = router;
|
770
|
+
this.componentService = componentService;
|
771
|
+
this.config = config;
|
772
|
+
}
|
773
|
+
ngOnInit() {
|
774
|
+
this.componentConfig = this.componentService.getComponentConfig(this.config);
|
775
|
+
this.onResize();
|
776
|
+
}
|
777
|
+
ngOnChanges(changes) {
|
778
|
+
this.boxGap = this.gapSize;
|
779
|
+
this.className = `ngx-helper-m3-value-box${this.hideShadow ? ' hide-shadow' : ''}`;
|
780
|
+
this.data = this.values.map((item) => {
|
781
|
+
const value = item.value;
|
782
|
+
return value === undefined
|
783
|
+
? { title: item.title, value: '' }
|
784
|
+
: typeof value === 'string'
|
785
|
+
? { title: item.title, value: value.trim() }
|
786
|
+
: {
|
787
|
+
title: item.title,
|
788
|
+
value: this.pipeTransform(value),
|
789
|
+
action: item.action,
|
790
|
+
copyToClipboard: item.copyToClipboard,
|
791
|
+
ltr: ltrValues.includes(value.type),
|
792
|
+
english: 'english' in value && !!value.english,
|
793
|
+
};
|
794
|
+
});
|
795
|
+
}
|
796
|
+
onResize() {
|
797
|
+
if (this.values.length === 0)
|
798
|
+
return;
|
799
|
+
const isMobile = window.innerWidth <= this.componentConfig.mobileWidth;
|
800
|
+
const columnSize = this.column === undefined
|
801
|
+
? this.values.length
|
802
|
+
: typeof this.column === 'number'
|
803
|
+
? this.column
|
804
|
+
: isMobile
|
805
|
+
? this.column.mobile || this.values.length
|
806
|
+
: this.column.desktop || this.values.length;
|
807
|
+
const column = columnSize <= 0 || columnSize > this.values.length ? this.values.length : columnSize;
|
808
|
+
this.gridTemplateColumns = Array(column).fill('1fr').join(' ');
|
809
|
+
}
|
810
|
+
onClick(action) {
|
811
|
+
if (!action)
|
812
|
+
return;
|
813
|
+
const response = action();
|
814
|
+
if (response)
|
815
|
+
this.router.navigate(response);
|
816
|
+
}
|
817
|
+
onCopy(event, index) {
|
818
|
+
event.preventDefault();
|
819
|
+
if (this.copyTimeout)
|
820
|
+
clearTimeout(this.copyTimeout);
|
821
|
+
this.copyIndex = index;
|
822
|
+
this.copyTimeout = setTimeout(() => {
|
823
|
+
this.copyIndex = undefined;
|
824
|
+
this.copyTimeout = undefined;
|
825
|
+
}, 2000);
|
826
|
+
}
|
827
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperValueBoxComponent, deps: [{ token: i1.Router }, { token: ComponentService }, { token: NGX_HELPER_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
828
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: NgxHelperValueBoxComponent, isStandalone: true, selector: "ngx-helper-value-box", inputs: { values: "values", column: "column", clearBox: "clearBox", emptyText: "emptyText", gapSize: "gapSize", hideShadow: "hideShadow" }, host: { listeners: { "window:resize": "onResize($event)" }, properties: { "className": "this.className", "style.grid-template-columns": "this.gridTemplateColumns", "style.--gap-size": "this.boxGap" } }, providers: [ComponentService], usesOnChanges: true, ngImport: i0, template: "@for (item of data; track $index) {\n<div class=\"box\" [class.clear-box]=\"clearBox\" [class.click]=\"!!item.action\">\n <div class=\"title\" (click)=\"onClick(item.action)\">{{ item.title }}</div>\n <div\n class=\"value\"\n [style.display]=\"'inline-block'\"\n [style.direction]=\"item.ltr ? 'ltr' : '*'\"\n [class.en]=\"item.english\"\n [class.empty]=\"!item.value\"\n (click)=\"onClick(item.action)\"\n >\n {{ item.value || emptyText }}\n </div>\n <!-- COPY TO CLIPBOARD -->\n @if (item.copyToClipboard && item.value) {\n <button mat-icon-button type=\"button\" [cdkCopyToClipboard]=\"item.value\" (click)=\"onCopy($event, $index)\">\n <mat-icon>{{ copyIndex === $index ? 'done_all' : 'copy' }}</mat-icon>\n </button>\n }\n</div>\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ClipboardModule }, { kind: "directive", type: i3.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }] });
|
829
|
+
}
|
830
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperValueBoxComponent, decorators: [{
|
831
|
+
type: Component,
|
832
|
+
args: [{ selector: 'ngx-helper-value-box', host: { '(window:resize)': 'onResize($event)' }, imports: [ClipboardModule, MatIcon, MatIconButton], providers: [ComponentService], template: "@for (item of data; track $index) {\n<div class=\"box\" [class.clear-box]=\"clearBox\" [class.click]=\"!!item.action\">\n <div class=\"title\" (click)=\"onClick(item.action)\">{{ item.title }}</div>\n <div\n class=\"value\"\n [style.display]=\"'inline-block'\"\n [style.direction]=\"item.ltr ? 'ltr' : '*'\"\n [class.en]=\"item.english\"\n [class.empty]=\"!item.value\"\n (click)=\"onClick(item.action)\"\n >\n {{ item.value || emptyText }}\n </div>\n <!-- COPY TO CLIPBOARD -->\n @if (item.copyToClipboard && item.value) {\n <button mat-icon-button type=\"button\" [cdkCopyToClipboard]=\"item.value\" (click)=\"onCopy($event, $index)\">\n <mat-icon>{{ copyIndex === $index ? 'done_all' : 'copy' }}</mat-icon>\n </button>\n }\n</div>\n}\n" }]
|
833
|
+
}], ctorParameters: () => [{ type: i1.Router }, { type: ComponentService }, { type: undefined, decorators: [{
|
834
|
+
type: Optional
|
835
|
+
}, {
|
836
|
+
type: Inject,
|
837
|
+
args: [NGX_HELPER_CONFIG]
|
838
|
+
}] }], propDecorators: { className: [{
|
839
|
+
type: HostBinding,
|
840
|
+
args: ['className']
|
841
|
+
}], gridTemplateColumns: [{
|
842
|
+
type: HostBinding,
|
843
|
+
args: ['style.grid-template-columns']
|
844
|
+
}], boxGap: [{
|
845
|
+
type: HostBinding,
|
846
|
+
args: ['style.--gap-size']
|
847
|
+
}], values: [{
|
848
|
+
type: Input,
|
849
|
+
args: [{ required: true }]
|
850
|
+
}], column: [{
|
851
|
+
type: Input,
|
852
|
+
args: [{ required: false }]
|
853
|
+
}], clearBox: [{
|
854
|
+
type: Input,
|
855
|
+
args: [{ required: false }]
|
856
|
+
}], emptyText: [{
|
857
|
+
type: Input,
|
858
|
+
args: [{ required: false }]
|
859
|
+
}], gapSize: [{
|
860
|
+
type: Input,
|
861
|
+
args: [{ required: false }]
|
862
|
+
}], hideShadow: [{
|
863
|
+
type: Input,
|
864
|
+
args: [{ required: false }]
|
865
|
+
}] } });
|
866
|
+
|
867
|
+
class NgxHelperValueListComponent {
|
868
|
+
router;
|
869
|
+
className = 'ngx-helper-m3-value-list';
|
870
|
+
values;
|
871
|
+
titleWidth = '20%';
|
872
|
+
emptyText = 'نامشخص';
|
873
|
+
data = [];
|
874
|
+
copyIndex;
|
875
|
+
copyTimeout;
|
876
|
+
pipeTransform = new NgxHelperValuePipe().transform;
|
877
|
+
constructor(router) {
|
878
|
+
this.router = router;
|
879
|
+
}
|
880
|
+
ngOnChanges(changes) {
|
881
|
+
this.data = this.values.map((item) => {
|
882
|
+
const value = item.value;
|
883
|
+
return value === undefined
|
884
|
+
? { title: item.title, value: '' }
|
885
|
+
: typeof value === 'string'
|
886
|
+
? { title: item.title, value: value.trim() }
|
887
|
+
: {
|
888
|
+
title: item.title,
|
889
|
+
value: this.pipeTransform(value),
|
890
|
+
action: item.action,
|
891
|
+
copyToClipboard: item.copyToClipboard,
|
892
|
+
ltr: ltrValues.includes(value.type),
|
893
|
+
english: 'english' in value && !!value.english,
|
894
|
+
};
|
895
|
+
});
|
896
|
+
}
|
897
|
+
onClick(action) {
|
898
|
+
if (!action)
|
899
|
+
return;
|
900
|
+
const response = action();
|
901
|
+
if (response)
|
902
|
+
this.router.navigate(response);
|
903
|
+
}
|
904
|
+
onCopy(event, index) {
|
905
|
+
event.preventDefault();
|
906
|
+
if (this.copyTimeout)
|
907
|
+
clearTimeout(this.copyTimeout);
|
908
|
+
this.copyIndex = index;
|
909
|
+
this.copyTimeout = setTimeout(() => {
|
910
|
+
this.copyIndex = undefined;
|
911
|
+
this.copyTimeout = undefined;
|
912
|
+
}, 2000);
|
913
|
+
}
|
914
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperValueListComponent, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Component });
|
915
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", type: NgxHelperValueListComponent, isStandalone: true, selector: "ngx-helper-value-list", inputs: { values: "values", titleWidth: "titleWidth", emptyText: "emptyText" }, host: { properties: { "className": "this.className" } }, usesOnChanges: true, ngImport: i0, template: "@for (item of data; track $index) {\n<div class=\"item\" [class.even]=\"$index % 2 === 0\" [class.odd]=\"$index % 2 === 1\">\n <div class=\"title\" [style.width]=\"titleWidth\">{{ item.title }}:</div>\n <div class=\"value\">\n <div\n [style.display]=\"'inline-block'\"\n [style.direction]=\"item.ltr ? 'ltr' : '*'\"\n [class.en]=\"item.english\"\n [class.empty]=\"!item.value\"\n [class.click]=\"!!item.action\"\n (click)=\"onClick(item.action)\"\n >\n {{ item.value || emptyText }}\n </div>\n <!-- ACTION -->\n @if (item.action) {\n <button mat-icon-button type=\"button\" (click)=\"onClick(item.action)\">\n <mat-icon>open_in_new</mat-icon>\n </button>\n\n }\n </div>\n <!-- COPY TO CLIPBOARD -->\n @if (item.copyToClipboard && item.value) {\n <button mat-icon-button type=\"button\" [cdkCopyToClipboard]=\"item.value\" (click)=\"onCopy($event, $index)\">\n <mat-icon>{{ copyIndex === $index ? 'done_all' : 'copy' }}</mat-icon>\n </button>\n }\n</div>\n}\n", styles: [""], dependencies: [{ kind: "ngmodule", type: ClipboardModule }, { kind: "directive", type: i3.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }] });
|
916
|
+
}
|
917
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperValueListComponent, decorators: [{
|
918
|
+
type: Component,
|
919
|
+
args: [{ selector: 'ngx-helper-value-list', imports: [ClipboardModule, MatIcon, MatIconButton], template: "@for (item of data; track $index) {\n<div class=\"item\" [class.even]=\"$index % 2 === 0\" [class.odd]=\"$index % 2 === 1\">\n <div class=\"title\" [style.width]=\"titleWidth\">{{ item.title }}:</div>\n <div class=\"value\">\n <div\n [style.display]=\"'inline-block'\"\n [style.direction]=\"item.ltr ? 'ltr' : '*'\"\n [class.en]=\"item.english\"\n [class.empty]=\"!item.value\"\n [class.click]=\"!!item.action\"\n (click)=\"onClick(item.action)\"\n >\n {{ item.value || emptyText }}\n </div>\n <!-- ACTION -->\n @if (item.action) {\n <button mat-icon-button type=\"button\" (click)=\"onClick(item.action)\">\n <mat-icon>open_in_new</mat-icon>\n </button>\n\n }\n </div>\n <!-- COPY TO CLIPBOARD -->\n @if (item.copyToClipboard && item.value) {\n <button mat-icon-button type=\"button\" [cdkCopyToClipboard]=\"item.value\" (click)=\"onCopy($event, $index)\">\n <mat-icon>{{ copyIndex === $index ? 'done_all' : 'copy' }}</mat-icon>\n </button>\n }\n</div>\n}\n" }]
|
920
|
+
}], ctorParameters: () => [{ type: i1.Router }], propDecorators: { className: [{
|
921
|
+
type: HostBinding,
|
922
|
+
args: ['className']
|
923
|
+
}], values: [{
|
924
|
+
type: Input,
|
925
|
+
args: [{ required: true }]
|
926
|
+
}], titleWidth: [{
|
927
|
+
type: Input,
|
928
|
+
args: [{ required: false }]
|
929
|
+
}], emptyText: [{
|
930
|
+
type: Input,
|
931
|
+
args: [{ required: false }]
|
932
|
+
}] } });
|
933
|
+
|
934
|
+
class NgxHelperMultiLinePipe {
|
935
|
+
domSanitizer;
|
936
|
+
constructor(domSanitizer) {
|
937
|
+
this.domSanitizer = domSanitizer;
|
938
|
+
}
|
939
|
+
transform(value, options) {
|
940
|
+
if (value === undefined || value === null || !Helper.IS.string(value) || value === '')
|
941
|
+
return '';
|
942
|
+
return options?.html
|
943
|
+
? this.domSanitizer.bypassSecurityTrustHtml(value.replace(/(?:\r\n|\r|\n)/g, '<br />'))
|
944
|
+
: Helper.STRING.escapeHTML(value).replace(/(?:\r\n|\r|\n)/g, '<br />');
|
945
|
+
}
|
946
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperMultiLinePipe, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
947
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperMultiLinePipe, isStandalone: true, name: "ngxHelperMultiLine" });
|
948
|
+
}
|
949
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperMultiLinePipe, decorators: [{
|
950
|
+
type: Pipe,
|
951
|
+
args: [{ name: 'ngxHelperMultiLine' }]
|
952
|
+
}], ctorParameters: () => [{ type: i1$1.DomSanitizer }] });
|
953
|
+
|
954
|
+
class NgxHelperSafePipe {
|
955
|
+
domSanitizer;
|
956
|
+
constructor(domSanitizer) {
|
957
|
+
this.domSanitizer = domSanitizer;
|
958
|
+
}
|
959
|
+
transform(value, options) {
|
960
|
+
if (value === undefined || value === null || !Helper.IS.string(value) || value === '')
|
961
|
+
return '';
|
962
|
+
switch (options?.type || 'HTML') {
|
963
|
+
case 'STYLE':
|
964
|
+
return this.domSanitizer.bypassSecurityTrustStyle(value);
|
965
|
+
case 'SCRIPT':
|
966
|
+
return this.domSanitizer.bypassSecurityTrustScript(value);
|
967
|
+
case 'URL':
|
968
|
+
return this.domSanitizer.bypassSecurityTrustUrl(value);
|
969
|
+
case 'RESOURCE_URL':
|
970
|
+
return this.domSanitizer.bypassSecurityTrustResourceUrl(value);
|
971
|
+
case 'HTML':
|
972
|
+
return this.domSanitizer.bypassSecurityTrustHtml(value);
|
973
|
+
}
|
974
|
+
}
|
975
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperSafePipe, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
976
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperSafePipe, isStandalone: true, name: "ngxHelperSafe" });
|
977
|
+
}
|
978
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: NgxHelperSafePipe, decorators: [{
|
979
|
+
type: Pipe,
|
980
|
+
args: [{ name: 'ngxHelperSafe' }]
|
981
|
+
}], ctorParameters: () => [{ type: i1$1.DomSanitizer }] });
|
982
|
+
|
689
983
|
class ConfirmDialogComponent {
|
690
984
|
className = 'ngx-helper-m3-confirm';
|
691
985
|
confirm = inject(MAT_DIALOG_DATA);
|
692
986
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: ConfirmDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
693
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", 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$1.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"] }] });
|
987
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", 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$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
694
988
|
}
|
695
989
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: ConfirmDialogComponent, decorators: [{
|
696
990
|
type: Component,
|
@@ -711,7 +1005,7 @@ class ConfirmBottomSheetComponent {
|
|
711
1005
|
this.matBottomSheetRef.dismiss(confirmed);
|
712
1006
|
}
|
713
1007
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: ConfirmBottomSheetComponent, deps: [{ token: i1$3.MatBottomSheetRef }], target: i0.ɵɵFactoryTarget.Component });
|
714
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", 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"] }] });
|
1008
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.4", 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$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
715
1009
|
}
|
716
1010
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImport: i0, type: ConfirmBottomSheetComponent, decorators: [{
|
717
1011
|
type: Component,
|
@@ -979,5 +1273,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.4", ngImpor
|
|
979
1273
|
* Generated bundle index. Do not edit.
|
980
1274
|
*/
|
981
1275
|
|
982
|
-
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_ICON, NGX_HELPER_PAGE_GROUP_INDEX, NGX_HELPER_PAGE_GROUP_TITLE, NgxHelperBankCardPipe, NgxHelperCardComponent, NgxHelperConfirmService, NgxHelperContainerService, NgxHelperDatePipe, NgxHelperDurationPipe, NgxHelperFileSizePipe, NgxHelperLoaderComponent, NgxHelperMobilePipe, NgxHelperMultiLinePipe, NgxHelperNumberPipe, NgxHelperPageGroupComponent, NgxHelperPeriodPipe, NgxHelperPricePipe, NgxHelperSafePipe, NgxHelperSectionColumnComponent, NgxHelperSectionComponent, NgxHelperSectionStickyDirective, NgxHelperVolumePipe, NgxHelperWeightPipe, provideNgxHelperConfig };
|
1276
|
+
export { NGX_HELPER_BOX_DATA, NGX_HELPER_CONFIG, NGX_HELPER_CONTAINER_CLOSE, NGX_HELPER_CONTAINER_DATA, NGX_HELPER_CONTAINER_TYPE, NGX_HELPER_PAGE_GROUP_DATA, NGX_HELPER_PAGE_GROUP_ICON, NGX_HELPER_PAGE_GROUP_INDEX, NGX_HELPER_PAGE_GROUP_TITLE, NgxHelperBankCardPipe, NgxHelperBoxComponent, NgxHelperCardComponent, NgxHelperConfirmService, NgxHelperContainerService, NgxHelperDatePipe, NgxHelperDurationPipe, NgxHelperFileSizePipe, NgxHelperLoaderComponent, NgxHelperMobilePipe, NgxHelperMultiLinePipe, NgxHelperNumberPipe, NgxHelperPageGroupComponent, NgxHelperPeriodPipe, NgxHelperPricePipe, NgxHelperSafePipe, NgxHelperSectionColumnComponent, NgxHelperSectionComponent, NgxHelperSectionStickyDirective, NgxHelperValueBoxComponent, NgxHelperValueListComponent, NgxHelperValuePipe, NgxHelperVolumePipe, NgxHelperWeightPipe, provideNgxHelperConfig };
|
983
1277
|
//# sourceMappingURL=webilix-ngx-helper-m3.mjs.map
|