ngx-kit 2.1.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ngx-kit-menu.mjs +4 -4
- package/fesm2022/ngx-kit-menu.mjs.map +1 -1
- package/fesm2022/ngx-kit-message.mjs +380 -0
- package/fesm2022/ngx-kit-message.mjs.map +1 -0
- package/fesm2022/ngx-kit-notify.mjs +3 -3
- package/fesm2022/ngx-kit-notify.mjs.map +1 -1
- package/fesm2022/ngx-kit-shared.mjs +20 -2
- package/fesm2022/ngx-kit-shared.mjs.map +1 -1
- package/package.json +5 -1
- package/styles/all.css +28 -0
- package/styles/confetti.css +28 -0
- package/types/ngx-kit-message.d.ts +284 -0
- package/types/ngx-kit-shared.d.ts +5 -1
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EnvironmentProviders, Injector, OnInit, AfterViewInit, ElementRef, ComponentRef, ApplicationRef, EnvironmentInjector } from '@angular/core';
|
|
3
|
+
import * as rxjs from 'rxjs';
|
|
4
|
+
import { SafeHtml, DomSanitizer } from '@angular/platform-browser';
|
|
5
|
+
|
|
6
|
+
declare class MessageOptions implements IMessageOptions {
|
|
7
|
+
private config?;
|
|
8
|
+
constructor(config?: IMessageOptions | undefined);
|
|
9
|
+
/**
|
|
10
|
+
* add popover manual to set alert dialog container to top layer
|
|
11
|
+
* - usefull when using alert modal in angular material dialog
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
useOverlay?: boolean;
|
|
15
|
+
title?: string;
|
|
16
|
+
text?: string;
|
|
17
|
+
html?: string | HTMLElement;
|
|
18
|
+
backdrop?: boolean;
|
|
19
|
+
icon?: MessageIcon;
|
|
20
|
+
width?: number | string;
|
|
21
|
+
allowOutsideClick?: boolean;
|
|
22
|
+
allowEscapeKey?: boolean;
|
|
23
|
+
allowEnterKey?: boolean;
|
|
24
|
+
showConfirmButton?: boolean;
|
|
25
|
+
showDenyButton?: boolean;
|
|
26
|
+
showCancelButton?: boolean;
|
|
27
|
+
confirmButtonText: string;
|
|
28
|
+
denyButtonText?: string;
|
|
29
|
+
cancelButtonText?: string;
|
|
30
|
+
confirmButtonColor?: string;
|
|
31
|
+
denyButtonColor?: string;
|
|
32
|
+
cancelButtonColor?: string;
|
|
33
|
+
confirmButtonAriaLabel?: string;
|
|
34
|
+
denyButtonAriaLabel?: string;
|
|
35
|
+
cancelButtonAriaLabel?: string;
|
|
36
|
+
reverseButtons?: boolean;
|
|
37
|
+
showCloseButton?: boolean;
|
|
38
|
+
containerClass?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
type MessageIcon = 'None' | 'success' | 'error' | 'warning' | 'info' | 'question' | 'loading';
|
|
42
|
+
|
|
43
|
+
interface IMessageOptions {
|
|
44
|
+
/**
|
|
45
|
+
* add popover manual to set alert dialog container to top layer
|
|
46
|
+
* - usefull when using alert modal in angular material dialog
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
|
+
useOverlay?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* The title of the popup
|
|
52
|
+
*
|
|
53
|
+
* @default ''
|
|
54
|
+
*/
|
|
55
|
+
title?: string;
|
|
56
|
+
/**
|
|
57
|
+
* A description for the popup.
|
|
58
|
+
*
|
|
59
|
+
* @default ''
|
|
60
|
+
*/
|
|
61
|
+
text?: string;
|
|
62
|
+
/**
|
|
63
|
+
* A HTML description for the popup.
|
|
64
|
+
*
|
|
65
|
+
* [Security] we does NOT sanitize this parameter. It is the developer's responsibility
|
|
66
|
+
* to escape any user input when using the `html` option, so XSS attacks would be prevented.
|
|
67
|
+
*
|
|
68
|
+
* @default ''
|
|
69
|
+
*/
|
|
70
|
+
html?: string | HTMLElement;
|
|
71
|
+
/**
|
|
72
|
+
* Whether or not should show a full screen click-to-dismiss backdrop.
|
|
73
|
+
* Either a boolean value or a css background value (hex, rgb, rgba, url, etc.)
|
|
74
|
+
*
|
|
75
|
+
* @default true
|
|
76
|
+
*/
|
|
77
|
+
backdrop?: boolean;
|
|
78
|
+
icon?: MessageIcon;
|
|
79
|
+
/**
|
|
80
|
+
* Popup width, including paddings (`box-sizing: border-box`).
|
|
81
|
+
*
|
|
82
|
+
* @default undefined
|
|
83
|
+
* @description ❌⚠️NOT Implemented!⚠️❌
|
|
84
|
+
*/
|
|
85
|
+
width?: number | string;
|
|
86
|
+
/**
|
|
87
|
+
* If set to `false`, the user can't dismiss the popup by clicking outside it.
|
|
88
|
+
*
|
|
89
|
+
* @default true
|
|
90
|
+
*/
|
|
91
|
+
allowOutsideClick?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* If set to `false`, the user can't dismiss the popup by pressing the Escape key.
|
|
94
|
+
*
|
|
95
|
+
* @default true
|
|
96
|
+
*/
|
|
97
|
+
allowEscapeKey?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* If set to `false`, the user can't confirm the popup by pressing the Enter or Space keys,
|
|
100
|
+
* unless they manually focus the confirm button.
|
|
101
|
+
*
|
|
102
|
+
* @default true
|
|
103
|
+
*/
|
|
104
|
+
allowEnterKey?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* If set to `false`, the "Confirm" button will not be shown.
|
|
107
|
+
*
|
|
108
|
+
* @default true
|
|
109
|
+
*/
|
|
110
|
+
showConfirmButton?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* If set to `true`, the "Deny" button will be shown, which the user can click on to deny the popup.
|
|
113
|
+
*
|
|
114
|
+
* @default false
|
|
115
|
+
*/
|
|
116
|
+
showDenyButton?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* If set to `true`, the "Cancel" button will be shown, which the user can click on to dismiss the popup.
|
|
119
|
+
*
|
|
120
|
+
* @default false
|
|
121
|
+
*/
|
|
122
|
+
showCancelButton?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Use this to change the text on the "Confirm" button.
|
|
125
|
+
*
|
|
126
|
+
* @default 'OK'
|
|
127
|
+
*/
|
|
128
|
+
confirmButtonText?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Use this to change the text on the "Confirm" button.
|
|
131
|
+
*
|
|
132
|
+
* @default 'No'
|
|
133
|
+
*/
|
|
134
|
+
denyButtonText?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Use this to change the text on the "Cancel" button.
|
|
137
|
+
*
|
|
138
|
+
* @default 'Cancel'
|
|
139
|
+
*/
|
|
140
|
+
cancelButtonText?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Use this to change the background color of the "Confirm" button.
|
|
143
|
+
*
|
|
144
|
+
* @default undefined
|
|
145
|
+
* @description ❌⚠️NOT Implemented!⚠️❌
|
|
146
|
+
*/
|
|
147
|
+
confirmButtonColor?: string;
|
|
148
|
+
/**
|
|
149
|
+
* Use this to change the background color of the "Deny" button.
|
|
150
|
+
*
|
|
151
|
+
* @default undefined
|
|
152
|
+
* @description ❌⚠️NOT Implemented!⚠️❌
|
|
153
|
+
*/
|
|
154
|
+
denyButtonColor?: string;
|
|
155
|
+
/**
|
|
156
|
+
* Use this to change the background color of the "Cancel" button.
|
|
157
|
+
*
|
|
158
|
+
* @default undefined
|
|
159
|
+
* @description ❌⚠️NOT Implemented!⚠️❌
|
|
160
|
+
*/
|
|
161
|
+
cancelButtonColor?: string;
|
|
162
|
+
/**
|
|
163
|
+
* Use this to change the `aria-label` for the "Confirm" button.
|
|
164
|
+
*
|
|
165
|
+
* @default ''
|
|
166
|
+
*/
|
|
167
|
+
confirmButtonAriaLabel?: string;
|
|
168
|
+
/**
|
|
169
|
+
* Use this to change the `aria-label` for the "Deny" button.
|
|
170
|
+
*
|
|
171
|
+
* @default ''
|
|
172
|
+
*/
|
|
173
|
+
denyButtonAriaLabel?: string;
|
|
174
|
+
/**
|
|
175
|
+
* Use this to change the `aria-label` for the "Cancel" button.
|
|
176
|
+
*
|
|
177
|
+
* @default ''
|
|
178
|
+
*/
|
|
179
|
+
cancelButtonAriaLabel?: string;
|
|
180
|
+
/**
|
|
181
|
+
* Set to `true` if you want to invert default buttons positions.
|
|
182
|
+
*
|
|
183
|
+
* @default false
|
|
184
|
+
* @description ❌⚠️NOT Implemented!⚠️❌
|
|
185
|
+
*/
|
|
186
|
+
reverseButtons?: boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Set to `true` to show close button.
|
|
189
|
+
*
|
|
190
|
+
* @default false
|
|
191
|
+
*/
|
|
192
|
+
showCloseButton?: boolean;
|
|
193
|
+
containerClass?: string;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
declare function provideMessage(options?: IMessageOptions): EnvironmentProviders;
|
|
197
|
+
|
|
198
|
+
interface MessageResult<T = any> {
|
|
199
|
+
readonly isConfirmed: boolean;
|
|
200
|
+
readonly isDenied: boolean;
|
|
201
|
+
readonly isDismissed: boolean;
|
|
202
|
+
/**
|
|
203
|
+
* @description ❌⚠️NOT Implemented!⚠️❌
|
|
204
|
+
*/
|
|
205
|
+
readonly value?: T;
|
|
206
|
+
readonly dismiss?: DismissReason;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* An enum of possible reasons that can explain an alert dismissal.
|
|
210
|
+
*/
|
|
211
|
+
declare enum DismissReason {
|
|
212
|
+
cancel = 0,
|
|
213
|
+
backdrop = 1,
|
|
214
|
+
close = 2,
|
|
215
|
+
/**
|
|
216
|
+
* @description ❌⚠️NOT Implemented!⚠️❌
|
|
217
|
+
*/
|
|
218
|
+
esc = 3,
|
|
219
|
+
/**
|
|
220
|
+
* @description ❌⚠️NOT Implemented!⚠️❌
|
|
221
|
+
*/
|
|
222
|
+
timer = 4
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Static facade so call sites can use: MSG.warn('msg', opts)
|
|
227
|
+
* Module will set the service instance in its constructor.
|
|
228
|
+
*/
|
|
229
|
+
declare class MSG {
|
|
230
|
+
static injector: Injector;
|
|
231
|
+
static show(options?: IMessageOptions): Promise<MessageResult<any>>;
|
|
232
|
+
static fire(options?: IMessageOptions): Promise<MessageResult<any>>;
|
|
233
|
+
static info(title: string, text?: string, options?: IMessageOptions): Promise<MessageResult<any>>;
|
|
234
|
+
static success(title: string, text?: string, options?: IMessageOptions): Promise<MessageResult<any>>;
|
|
235
|
+
static warning(title: string, text?: string, options?: IMessageOptions): Promise<MessageResult<any>>;
|
|
236
|
+
static error(title: string, text?: string, options?: IMessageOptions): Promise<MessageResult<any>>;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
declare class NgxMessageComponent implements OnInit, AfterViewInit {
|
|
240
|
+
icon?: SafeHtml;
|
|
241
|
+
showIcon: i0.WritableSignal<boolean>;
|
|
242
|
+
options: IMessageOptions;
|
|
243
|
+
confetti: i0.Signal<ElementRef<HTMLDivElement> | undefined>;
|
|
244
|
+
index: number;
|
|
245
|
+
protected sanitizer: DomSanitizer;
|
|
246
|
+
protected doc: Document;
|
|
247
|
+
private readonly _onClose;
|
|
248
|
+
onClose: rxjs.Observable<{
|
|
249
|
+
index: number;
|
|
250
|
+
result: MessageResult<any>;
|
|
251
|
+
}>;
|
|
252
|
+
ngOnInit(): void;
|
|
253
|
+
ngAfterViewInit(): void;
|
|
254
|
+
onScapeKey(event: Event): void;
|
|
255
|
+
onEnterKey(event: Event): void;
|
|
256
|
+
onConfirm(): void;
|
|
257
|
+
onCancel(): void;
|
|
258
|
+
onDeny(): void;
|
|
259
|
+
close(): void;
|
|
260
|
+
onOutSideClick(): void;
|
|
261
|
+
innerOnClick(ev: Event): void;
|
|
262
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMessageComponent, never>;
|
|
263
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMessageComponent, "ngx-message", never, {}, {}, never, never, true, never>;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
declare class NgxMessageService {
|
|
267
|
+
private appRef;
|
|
268
|
+
private injector;
|
|
269
|
+
private envInjector;
|
|
270
|
+
private _doc;
|
|
271
|
+
currentAdIndex: number;
|
|
272
|
+
alerts: ComponentRef<NgxMessageComponent>[];
|
|
273
|
+
insertedId: number;
|
|
274
|
+
constructor(appRef: ApplicationRef, injector: Injector, envInjector: EnvironmentInjector, _doc: Document);
|
|
275
|
+
show(c?: IMessageOptions): Promise<MessageResult<any>>;
|
|
276
|
+
private removeDialogComponentFromBody;
|
|
277
|
+
private appendDialogComponentToBody;
|
|
278
|
+
closeAll(): void;
|
|
279
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMessageService, never>;
|
|
280
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NgxMessageService>;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export { DismissReason, MSG, MessageOptions, NgxMessageService, provideMessage };
|
|
284
|
+
export type { IMessageOptions, MessageResult };
|
|
@@ -174,6 +174,10 @@ declare const WINDOW: InjectionToken<Window | null>;
|
|
|
174
174
|
|
|
175
175
|
declare function randomStrnig(extraLength?: number, useNumeric?: boolean): string;
|
|
176
176
|
|
|
177
|
+
declare function IsRtl(doc: Document): boolean;
|
|
178
|
+
|
|
179
|
+
declare function makeConfetti(doc: Document, wrap: HTMLElement): void;
|
|
180
|
+
|
|
177
181
|
declare class BrowserService {
|
|
178
182
|
private platformId;
|
|
179
183
|
constructor(platformId: object);
|
|
@@ -270,5 +274,5 @@ interface OverlayInstance {
|
|
|
270
274
|
cleanup: () => void;
|
|
271
275
|
}
|
|
272
276
|
|
|
273
|
-
export { BrowserService, DIALOG_OVERLAY_CLASSNAME, FOCUSABLE_SELECTOR, OverlayRef, OverlayService, RangeSliderComponent, SaturationComponent, SliderComponent, ValueModel, WINDOW, getOffsetPosition, randomStrnig };
|
|
277
|
+
export { BrowserService, DIALOG_OVERLAY_CLASSNAME, FOCUSABLE_SELECTOR, IsRtl, OverlayRef, OverlayService, RangeSliderComponent, SaturationComponent, SliderComponent, ValueModel, WINDOW, getOffsetPosition, makeConfetti, randomStrnig };
|
|
274
278
|
export type { Alignment, BaseOverlayOptions, IPosition, IValue, OverlayInstance, OverlayOptions, Placement, Point, TemplateOptions };
|