@webilix/ngx-helper-m3 0.0.12 → 0.0.14
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 +552 -107
- package/fesm2022/webilix-ngx-helper-m3.mjs.map +1 -1
- package/lib/components/loader/ngx-helper-loader.component.d.ts +6 -3
- package/lib/components/progress/ngx-helper-progress.component.d.ts +20 -0
- package/lib/http/download/download.component.d.ts +25 -0
- package/lib/http/ngx-helper-http.interface.d.ts +6 -0
- package/lib/http/ngx-helper-http.service.d.ts +13 -2
- package/lib/http/upload/upload.component.d.ts +1 -1
- package/lib/ngx-helper.config.d.ts +5 -0
- package/lib/toast/ngx-helper-toast.interface.d.ts +4 -0
- package/lib/toast/ngx-helper-toast.service.d.ts +41 -0
- package/lib/toast/toast/toast.component.d.ts +35 -0
- package/ngx-helper-m3.css +157 -1
- package/package.json +4 -4
- package/public-api.d.ts +3 -0
@@ -1,13 +1,16 @@
|
|
1
|
-
import { OnChanges, SimpleChanges } from '@angular/core';
|
1
|
+
import { OnChanges, OnInit, SimpleChanges } from '@angular/core';
|
2
2
|
import * as i0 from "@angular/core";
|
3
|
-
export declare class NgxHelperLoaderComponent implements OnChanges {
|
3
|
+
export declare class NgxHelperLoaderComponent implements OnInit, OnChanges {
|
4
4
|
loaderSize: string;
|
5
5
|
loaderColor: string;
|
6
6
|
mode: 'SPINNER' | 'DOTS-SPINNER' | 'WHEEL-SPINNER';
|
7
7
|
size: number;
|
8
8
|
color: string;
|
9
9
|
padding?: string;
|
10
|
+
margin?: string;
|
11
|
+
ngOnInit(): void;
|
10
12
|
ngOnChanges(changes: SimpleChanges): void;
|
13
|
+
init(): void;
|
11
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxHelperLoaderComponent, never>;
|
12
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NgxHelperLoaderComponent, "ngx-helper-loader", never, { "mode": { "alias": "mode"; "required":
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxHelperLoaderComponent, "ngx-helper-loader", never, { "mode": { "alias": "mode"; "required": false; }; "size": { "alias": "size"; "required": false; }; "color": { "alias": "color"; "required": false; }; "padding": { "alias": "padding"; "required": false; }; "margin": { "alias": "margin"; "required": false; }; }, {}, never, never, true, never>;
|
13
16
|
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { OnChanges, SimpleChanges } from '@angular/core';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
export declare class NgxHelperProgressComponent implements OnChanges {
|
4
|
+
private className;
|
5
|
+
borderRadiusCSS: string;
|
6
|
+
backgroundColorCSS: string;
|
7
|
+
value: number | {
|
8
|
+
done: number;
|
9
|
+
total: number;
|
10
|
+
};
|
11
|
+
align: 'LR' | 'RL' | 'TB' | 'BT';
|
12
|
+
borderRadius: string;
|
13
|
+
progressColor: string;
|
14
|
+
backgroundColor?: string;
|
15
|
+
size: string;
|
16
|
+
direction: 'H' | 'V';
|
17
|
+
ngOnChanges(changes: SimpleChanges): void;
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxHelperProgressComponent, never>;
|
19
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxHelperProgressComponent, "ngx-helper-progress", never, { "value": { "alias": "value"; "required": true; }; "align": { "alias": "align"; "required": false; }; "borderRadius": { "alias": "borderRadius"; "required": false; }; "progressColor": { "alias": "progressColor"; "required": false; }; "backgroundColor": { "alias": "backgroundColor"; "required": false; }; }, {}, never, ["*"], true, never>;
|
20
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { AfterViewInit } from '@angular/core';
|
2
|
+
import { HttpClient } from '@angular/common/http';
|
3
|
+
import { NgxHelperToastService } from '../../toast/ngx-helper-toast.service';
|
4
|
+
import { INgxHelperHttpDownloadConfig } from '../ngx-helper-http.interface';
|
5
|
+
import * as i0 from "@angular/core";
|
6
|
+
export declare class DownloadComponent implements AfterViewInit {
|
7
|
+
private readonly httpClient;
|
8
|
+
private readonly ngxHelperToastService;
|
9
|
+
private host;
|
10
|
+
private className;
|
11
|
+
bottom: string;
|
12
|
+
id: string;
|
13
|
+
path: string;
|
14
|
+
title: string;
|
15
|
+
config: Partial<INgxHelperHttpDownloadConfig>;
|
16
|
+
onSuccess: (arrayBuffer: ArrayBuffer) => void;
|
17
|
+
onError: () => void;
|
18
|
+
close: () => void;
|
19
|
+
progress: number;
|
20
|
+
constructor(httpClient: HttpClient, ngxHelperToastService: NgxHelperToastService);
|
21
|
+
ngAfterViewInit(): void;
|
22
|
+
download(): void;
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DownloadComponent, never>;
|
24
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DownloadComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
25
|
+
}
|
@@ -1,3 +1,9 @@
|
|
1
|
+
export interface INgxHelperHttpDownloadConfig {
|
2
|
+
readonly method: 'GET' | 'POST' | 'PUT' | 'PATCH';
|
3
|
+
readonly header: {
|
4
|
+
[key: string]: any;
|
5
|
+
};
|
6
|
+
}
|
1
7
|
export interface INgxHelperHttpUploadConfig {
|
2
8
|
readonly method: 'POST' | 'PUT' | 'PATCH';
|
3
9
|
readonly header: {
|
@@ -1,16 +1,27 @@
|
|
1
1
|
import { ApplicationRef, Injector } from '@angular/core';
|
2
2
|
import { HttpStatusCode } from '@angular/common/http';
|
3
|
-
import {
|
3
|
+
import { NgxHelperToastService } from '../toast/ngx-helper-toast.service';
|
4
|
+
import { INgxHelperHttpDownloadConfig, INgxHelperHttpUploadConfig } from './ngx-helper-http.interface';
|
4
5
|
import * as i0 from "@angular/core";
|
5
6
|
export declare class NgxHelperHttpService {
|
6
7
|
private readonly applicationRef;
|
7
8
|
private readonly injector;
|
9
|
+
private readonly ngxHelperToastService;
|
8
10
|
private components;
|
9
|
-
constructor(applicationRef: ApplicationRef, injector: Injector);
|
11
|
+
constructor(applicationRef: ApplicationRef, injector: Injector, ngxHelperToastService: NgxHelperToastService);
|
10
12
|
private getId;
|
11
13
|
private updatePositions;
|
14
|
+
private getBuffer;
|
15
|
+
download(path: string, title: string): void;
|
16
|
+
download(path: string, title: string, config: Partial<INgxHelperHttpDownloadConfig>): void;
|
12
17
|
upload<R, E>(file: File, url: string, onSuccess: (response: R | undefined, status: HttpStatusCode) => void, onError: (error: E | undefined, status: HttpStatusCode) => void): void;
|
13
18
|
upload<R, E>(file: File, url: string, config: Partial<INgxHelperHttpUploadConfig>, onSuccess: (response: R, status: HttpStatusCode) => void, onError: (error: E, status: HttpStatusCode) => void): void;
|
19
|
+
printPDF(url: string): void;
|
20
|
+
printPDF(url: string, config: Partial<INgxHelperHttpDownloadConfig>): void;
|
21
|
+
printPDF(buffer: ArrayBuffer): void;
|
22
|
+
printPDF(buffer: ArrayBuffer, config: Partial<INgxHelperHttpDownloadConfig>): void;
|
23
|
+
printPDF(blob: Blob): void;
|
24
|
+
printPDF(blob: Blob, config: Partial<INgxHelperHttpDownloadConfig>): void;
|
14
25
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxHelperHttpService, never>;
|
15
26
|
static ɵprov: i0.ɵɵInjectableDeclaration<NgxHelperHttpService>;
|
16
27
|
}
|
@@ -4,8 +4,8 @@ import { INgxHelperHttpUploadConfig } from '../ngx-helper-http.interface';
|
|
4
4
|
import * as i0 from "@angular/core";
|
5
5
|
export declare class UploadComponent<R, E> implements AfterViewInit {
|
6
6
|
private readonly httpClient;
|
7
|
-
private className;
|
8
7
|
private host;
|
8
|
+
private className;
|
9
9
|
bottom: string;
|
10
10
|
id: string;
|
11
11
|
file: File;
|
@@ -2,6 +2,11 @@ import { EnvironmentProviders, InjectionToken } from '@angular/core';
|
|
2
2
|
export interface INgxHelperConfig {
|
3
3
|
readonly mobileWidth: number;
|
4
4
|
readonly pageGroupSidebarWidth: string;
|
5
|
+
readonly toastTimeout: number;
|
6
|
+
readonly toastXPosition: 'LEFT' | 'CENTER' | 'RIGHT';
|
7
|
+
readonly toastAllowDuplicates: boolean;
|
8
|
+
readonly toastResetDuplicates: boolean;
|
9
|
+
readonly toastProgressAnimation: 'DECREASE' | 'INCREASE';
|
5
10
|
readonly stickyView: {
|
6
11
|
readonly top?: string | {
|
7
12
|
readonly desktopView: string;
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import { ApplicationRef, Injector } from '@angular/core';
|
2
|
+
import { INgxHelperConfig } from '../ngx-helper.config';
|
3
|
+
import { INgxHelperToastConfig } from './ngx-helper-toast.interface';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
interface IToast {
|
6
|
+
readonly icon: string;
|
7
|
+
readonly textColor: string;
|
8
|
+
readonly backgroundColor: string;
|
9
|
+
}
|
10
|
+
export declare class NgxHelperToastService {
|
11
|
+
private readonly applicationRef;
|
12
|
+
private readonly injector;
|
13
|
+
private readonly config?;
|
14
|
+
private components;
|
15
|
+
constructor(applicationRef: ApplicationRef, injector: Injector, config?: Partial<INgxHelperConfig> | undefined);
|
16
|
+
private getId;
|
17
|
+
private updatePositions;
|
18
|
+
toast(toast: IToast, message: string | string[]): void;
|
19
|
+
toast(toast: IToast, message: string | string[], config: Partial<INgxHelperToastConfig>): void;
|
20
|
+
toast(toast: IToast, message: string | string[], onClose: () => void): void;
|
21
|
+
toast(toast: IToast, message: string | string[], config: Partial<INgxHelperToastConfig>, onClose: () => void): void;
|
22
|
+
info(message: string | string[]): void;
|
23
|
+
info(message: string | string[], config: Partial<INgxHelperToastConfig>): void;
|
24
|
+
info(message: string | string[], onClose: () => void): void;
|
25
|
+
info(message: string | string[], config: Partial<INgxHelperToastConfig>, onClose: () => void): void;
|
26
|
+
success(message: string | string[]): void;
|
27
|
+
success(message: string | string[], config: Partial<INgxHelperToastConfig>): void;
|
28
|
+
success(message: string | string[], onClose: () => void): void;
|
29
|
+
success(message: string | string[], config: Partial<INgxHelperToastConfig>, onClose: () => void): void;
|
30
|
+
warning(message: string | string[]): void;
|
31
|
+
warning(message: string | string[], config: Partial<INgxHelperToastConfig>): void;
|
32
|
+
warning(message: string | string[], onClose: () => void): void;
|
33
|
+
warning(message: string | string[], config: Partial<INgxHelperToastConfig>, onClose: () => void): void;
|
34
|
+
error(message: string | string[]): void;
|
35
|
+
error(message: string | string[], config: Partial<INgxHelperToastConfig>): void;
|
36
|
+
error(message: string | string[], onClose: () => void): void;
|
37
|
+
error(message: string | string[], config: Partial<INgxHelperToastConfig>, onClose: () => void): void;
|
38
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxHelperToastService, [null, null, { optional: true; }]>;
|
39
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NgxHelperToastService>;
|
40
|
+
}
|
41
|
+
export {};
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { AfterViewInit, ElementRef, OnDestroy, OnInit } from '@angular/core';
|
2
|
+
import { INgxHelperConfig } from '../../ngx-helper.config';
|
3
|
+
import { INgxHelperToastConfig } from '../ngx-helper-toast.interface';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
export declare class ToastComponent implements OnInit, OnDestroy, AfterViewInit {
|
6
|
+
readonly elementRef: ElementRef;
|
7
|
+
private onClick;
|
8
|
+
private host;
|
9
|
+
private className;
|
10
|
+
top: string;
|
11
|
+
textColor: string;
|
12
|
+
borderColor: string;
|
13
|
+
backgroundColor: string;
|
14
|
+
id: string;
|
15
|
+
icon: string;
|
16
|
+
messages: string[];
|
17
|
+
config: {
|
18
|
+
helper?: Partial<INgxHelperConfig>;
|
19
|
+
toast: Partial<INgxHelperToastConfig>;
|
20
|
+
};
|
21
|
+
init: () => void;
|
22
|
+
close: () => void;
|
23
|
+
timeout: number;
|
24
|
+
showClose: boolean;
|
25
|
+
animation: 'DECREASE' | 'INCREASE';
|
26
|
+
progress: number;
|
27
|
+
start: number;
|
28
|
+
private interval?;
|
29
|
+
constructor(elementRef: ElementRef);
|
30
|
+
ngOnInit(): void;
|
31
|
+
ngOnDestroy(): void;
|
32
|
+
ngAfterViewInit(): void;
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ToastComponent, never>;
|
34
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ToastComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
35
|
+
}
|
package/ngx-helper-m3.css
CHANGED
@@ -109,9 +109,21 @@
|
|
109
109
|
flex: 1;
|
110
110
|
|
111
111
|
font-size: 90%;
|
112
|
-
|
113
112
|
text-align: left;
|
114
113
|
direction: ltr;
|
114
|
+
font-family: Roboto, 'Helvetica Neue', sans-serif;
|
115
|
+
|
116
|
+
white-space: nowrap;
|
117
|
+
overflow: hidden;
|
118
|
+
text-overflow: ellipsis;
|
119
|
+
}
|
120
|
+
|
121
|
+
.title {
|
122
|
+
flex: 1;
|
123
|
+
|
124
|
+
font-size: 90%;
|
125
|
+
text-align: right;
|
126
|
+
direction: rtl;
|
115
127
|
|
116
128
|
white-space: nowrap;
|
117
129
|
overflow: hidden;
|
@@ -137,6 +149,93 @@
|
|
137
149
|
}
|
138
150
|
}
|
139
151
|
|
152
|
+
/* NGX HELPER TOAST */
|
153
|
+
.ngx-helper-m3-toast {
|
154
|
+
position: fixed;
|
155
|
+
|
156
|
+
display: block;
|
157
|
+
direction: rtl;
|
158
|
+
width: calc(100vw - 4rem);
|
159
|
+
max-width: 350px;
|
160
|
+
transition: top 0.35s ease-out;
|
161
|
+
z-index: 5000;
|
162
|
+
border-radius: 8px;
|
163
|
+
cursor: pointer;
|
164
|
+
box-sizing: border-box;
|
165
|
+
overflow: hidden;
|
166
|
+
border: 1px solid transparent;
|
167
|
+
|
168
|
+
.content {
|
169
|
+
display: flex;
|
170
|
+
align-items: flex-start;
|
171
|
+
column-gap: 0.5rem;
|
172
|
+
|
173
|
+
.toast {
|
174
|
+
flex: 1;
|
175
|
+
|
176
|
+
display: flex;
|
177
|
+
align-items: center;
|
178
|
+
column-gap: 1rem;
|
179
|
+
|
180
|
+
padding-right: 1rem;
|
181
|
+
|
182
|
+
ul {
|
183
|
+
flex: 1;
|
184
|
+
list-style: none;
|
185
|
+
margin: 0;
|
186
|
+
padding: 1rem 0 1rem 1rem;
|
187
|
+
|
188
|
+
li {
|
189
|
+
margin: 0;
|
190
|
+
padding: 0;
|
191
|
+
font-weight: 500;
|
192
|
+
line-height: 1.45;
|
193
|
+
padding-top: 0.25rem;
|
194
|
+
}
|
195
|
+
|
196
|
+
li:first-of-type {
|
197
|
+
padding-top: 0;
|
198
|
+
}
|
199
|
+
}
|
200
|
+
|
201
|
+
mat-icon.icon {
|
202
|
+
font-size: 26px;
|
203
|
+
}
|
204
|
+
}
|
205
|
+
|
206
|
+
mat-icon.close {
|
207
|
+
padding: 1rem 0 0 1rem;
|
208
|
+
}
|
209
|
+
}
|
210
|
+
|
211
|
+
.progress-container {
|
212
|
+
width: 100%;
|
213
|
+
height: 4px;
|
214
|
+
position: relative;
|
215
|
+
|
216
|
+
.progress-value {
|
217
|
+
position: absolute;
|
218
|
+
top: 0;
|
219
|
+
bottom: 0;
|
220
|
+
left: 0;
|
221
|
+
|
222
|
+
transition: all 0.35s ease-out;
|
223
|
+
}
|
224
|
+
}
|
225
|
+
}
|
226
|
+
.ngx-helper-m3-toast.center {
|
227
|
+
left: 50%;
|
228
|
+
transform: translate(-50%, 0);
|
229
|
+
}
|
230
|
+
|
231
|
+
.ngx-helper-m3-toast.left {
|
232
|
+
left: 1rem;
|
233
|
+
}
|
234
|
+
|
235
|
+
.ngx-helper-m3-toast.right {
|
236
|
+
right: 1rem;
|
237
|
+
}
|
238
|
+
|
140
239
|
/* NGX HELPER VALUE LIST */
|
141
240
|
.ngx-helper-m3-box {
|
142
241
|
display: block;
|
@@ -404,6 +503,63 @@
|
|
404
503
|
}
|
405
504
|
}
|
406
505
|
|
506
|
+
/* NGX HELPER PROGRESS */
|
507
|
+
.ngx-helper-m3-progress {
|
508
|
+
display: block;
|
509
|
+
position: relative;
|
510
|
+
direction: rtl;
|
511
|
+
overflow: hidden;
|
512
|
+
|
513
|
+
.progress {
|
514
|
+
position: absolute;
|
515
|
+
transition: width 0.35s ease-out, height 0.35s ease-out;
|
516
|
+
}
|
517
|
+
|
518
|
+
.content {
|
519
|
+
position: relative;
|
520
|
+
}
|
521
|
+
}
|
522
|
+
|
523
|
+
.ngx-helper-m3-progress.LR,
|
524
|
+
.ngx-helper-m3-progress.RL {
|
525
|
+
.progress {
|
526
|
+
top: 0;
|
527
|
+
bottom: 0;
|
528
|
+
}
|
529
|
+
}
|
530
|
+
|
531
|
+
.ngx-helper-m3-progress.LR {
|
532
|
+
.progress {
|
533
|
+
left: 0;
|
534
|
+
}
|
535
|
+
}
|
536
|
+
|
537
|
+
.ngx-helper-m3-progress.RL {
|
538
|
+
.progress {
|
539
|
+
right: 0;
|
540
|
+
}
|
541
|
+
}
|
542
|
+
|
543
|
+
.ngx-helper-m3-progress.TB,
|
544
|
+
.ngx-helper-m3-progress.BT {
|
545
|
+
.progress {
|
546
|
+
right: 0;
|
547
|
+
left: 0;
|
548
|
+
}
|
549
|
+
}
|
550
|
+
|
551
|
+
.ngx-helper-m3-progress.TB {
|
552
|
+
.progress {
|
553
|
+
top: 0;
|
554
|
+
}
|
555
|
+
}
|
556
|
+
|
557
|
+
.ngx-helper-m3-progress.BT {
|
558
|
+
.progress {
|
559
|
+
bottom: 0;
|
560
|
+
}
|
561
|
+
}
|
562
|
+
|
407
563
|
/* NGX HELPER VALUE BOX */
|
408
564
|
.ngx-helper-m3-value-box {
|
409
565
|
display: grid;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@webilix/ngx-helper-m3",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.14",
|
4
4
|
"author": "Ali Amirnezhad",
|
5
5
|
"description": "Helper library for Angular and Material 3",
|
6
6
|
"repository": {
|
@@ -20,9 +20,9 @@
|
|
20
20
|
},
|
21
21
|
"homepage": "https://github.com/webilix/ngx-helper-m3#readme",
|
22
22
|
"peerDependencies": {
|
23
|
-
"@angular/common": ">=19.0.
|
24
|
-
"@angular/core": ">=19.0.
|
25
|
-
"@angular/material": ">=19.0.
|
23
|
+
"@angular/common": ">=19.0.5",
|
24
|
+
"@angular/core": ">=19.0.5",
|
25
|
+
"@angular/material": ">=19.0.4",
|
26
26
|
"@webilix/helper-library": ">=6.0.2",
|
27
27
|
"@webilix/jalali-date-time": ">=2.0.5"
|
28
28
|
},
|
package/public-api.d.ts
CHANGED
@@ -6,6 +6,7 @@ export * from './lib/components/card/ngx-helper-card.interface';
|
|
6
6
|
export * from './lib/components/loader/ngx-helper-loader.component';
|
7
7
|
export * from './lib/components/page-group/ngx-helper-page-group.component';
|
8
8
|
export * from './lib/components/page-group/ngx-helper-page-group.interface';
|
9
|
+
export * from './lib/components/progress/ngx-helper-progress.component';
|
9
10
|
export * from './lib/components/section/ngx-helper-section-sticky.directive';
|
10
11
|
export * from './lib/components/section/ngx-helper-section.component';
|
11
12
|
export * from './lib/components/section/column/ngx-helper-section-column.component';
|
@@ -31,3 +32,5 @@ export * from './lib/container/container.interface';
|
|
31
32
|
export * from './lib/container/container.service';
|
32
33
|
export * from './lib/http/ngx-helper-http.interface';
|
33
34
|
export * from './lib/http/ngx-helper-http.service';
|
35
|
+
export * from './lib/toast/ngx-helper-toast.interface';
|
36
|
+
export * from './lib/toast/ngx-helper-toast.service';
|