@libs-ui/services-notification 0.2.356-42 → 0.2.356-43
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/README.md
CHANGED
|
@@ -1,17 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @libs-ui/services-notification
|
|
2
2
|
|
|
3
|
-
Service toast notification cho Angular —
|
|
3
|
+
> Service toast notification cho Angular — hiển thị 4 kiểu thông báo (success, error, info, warn), quản lý queue tự động, tích hợp ngx-translate, và hỗ trợ bridge sang micro-frontend qua iFrame messaging.
|
|
4
|
+
|
|
5
|
+
## Giới thiệu
|
|
6
|
+
|
|
7
|
+
`LibsUiNotificationService` là service singleton (`providedIn: 'root'`) dùng để hiển thị toast notification động trực tiếp vào `document.body` thông qua `LibsUiDynamicComponentService`. Service tự quản lý queue tối đa 5 thông báo đồng thời theo cơ chế FIFO, tự động stack vị trí các toast, và có khả năng phát hiện môi trường iFrame để bridge thông báo lên parent shell trong kiến trúc micro-frontend.
|
|
4
8
|
|
|
5
9
|
## Tính năng
|
|
6
10
|
|
|
7
|
-
- ✅ 4 kiểu toast: `success` (xanh), `error` (đỏ), `info` (xanh dương), `warn` (vàng)
|
|
11
|
+
- ✅ 4 kiểu toast: `success` (xanh lá), `error` (đỏ), `info` (xanh dương), `warn` (vàng)
|
|
8
12
|
- ✅ Queue tối đa 5 — FIFO auto-remove khi overflow
|
|
9
|
-
- ✅ Tích hợp ngx-translate — truyền key hoặc text đều được
|
|
10
|
-
- ✅ interpolateParams với XSS-safe escaping tự động
|
|
11
|
-
- ✅ Callback onClick / onMouseenter
|
|
12
|
-
- ✅ Tùy chỉnh timeRemove
|
|
13
|
-
- ✅
|
|
14
|
-
- ✅
|
|
13
|
+
- ✅ Tích hợp ngx-translate — truyền translation key hoặc text thường đều được
|
|
14
|
+
- ✅ `interpolateParams` với XSS-safe escaping tự động qua `escapeHtml()`
|
|
15
|
+
- ✅ Callback `onClick` / `onMouseenter` trên từng toast
|
|
16
|
+
- ✅ Tùy chỉnh `timeRemove` (ms) và `positionRight` (px)
|
|
17
|
+
- ✅ Dynamic stacking — tự tính lại vị trí top/right sau mỗi add/remove
|
|
18
|
+
- ✅ iFrame bridge cho micro-frontend — tự phát hiện `isEmbedFrame()` và gửi PostMessage lên parent
|
|
19
|
+
- ✅ Browser native Notification API (`systemSpawnNotification`) trả về `Observable`
|
|
20
|
+
|
|
21
|
+
## Khi nào sử dụng
|
|
22
|
+
|
|
23
|
+
- Thông báo kết quả sau action: lưu, xóa, cập nhật — dùng `success` hoặc `error`
|
|
24
|
+
- Thông báo lỗi hệ thống hoặc lỗi network API — dùng `error` hoặc `warn`
|
|
25
|
+
- Thông báo thông tin cho user (tips, hướng dẫn ngắn) — dùng `info`
|
|
26
|
+
- Cần hiển thị notification từ micro-frontend (child iFrame) lên parent shell — dùng `init()` + iFrame bridge
|
|
27
|
+
- Cần push native OS/browser notification khi tab không active — dùng `systemSpawnNotification()`
|
|
15
28
|
|
|
16
29
|
## Cài đặt
|
|
17
30
|
|
|
@@ -25,111 +38,327 @@ npm install @libs-ui/services-notification
|
|
|
25
38
|
import { LibsUiNotificationService } from '@libs-ui/services-notification';
|
|
26
39
|
```
|
|
27
40
|
|
|
28
|
-
|
|
41
|
+
Service được đăng ký `providedIn: 'root'` — không cần thêm vào `providers[]` của module hay component.
|
|
42
|
+
|
|
43
|
+
## Ví dụ sử dụng
|
|
44
|
+
|
|
45
|
+
### 1. Cơ bản — 4 kiểu toast
|
|
29
46
|
|
|
30
47
|
```typescript
|
|
31
|
-
|
|
48
|
+
import { Component, inject } from '@angular/core';
|
|
49
|
+
import { LibsUiNotificationService } from '@libs-ui/services-notification';
|
|
50
|
+
|
|
51
|
+
@Component({
|
|
52
|
+
standalone: true,
|
|
53
|
+
selector: 'app-example',
|
|
54
|
+
template: `
|
|
55
|
+
<button (click)="handlerSave()">Lưu</button>
|
|
56
|
+
<button (click)="handlerDelete()">Xóa</button>
|
|
57
|
+
`,
|
|
58
|
+
})
|
|
32
59
|
export class ExampleComponent {
|
|
33
|
-
private notif = inject(LibsUiNotificationService);
|
|
60
|
+
private readonly notif = inject(LibsUiNotificationService);
|
|
61
|
+
|
|
62
|
+
handlerSave() {
|
|
63
|
+
this.notif.showCompTypeTextSuccess('Lưu thành công!');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
handlerDelete() {
|
|
67
|
+
this.notif.showCompTypeTextError('Xóa thất bại. Vui lòng thử lại.');
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
handlerInfo() {
|
|
71
|
+
this.notif.showCompTypeTextInfo('Phiên làm việc sẽ hết hạn sau 5 phút.');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
handlerWarning() {
|
|
75
|
+
this.notif.showCompTypeTextWarning('Dung lượng lưu trữ gần đầy.');
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 2. Đầy đủ config — title, timeRemove, positionRight, callback
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
import { Component, inject } from '@angular/core';
|
|
84
|
+
import { Router } from '@angular/router';
|
|
85
|
+
import { LibsUiNotificationService } from '@libs-ui/services-notification';
|
|
34
86
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
87
|
+
@Component({
|
|
88
|
+
standalone: true,
|
|
89
|
+
selector: 'app-create-user',
|
|
90
|
+
template: `<button (click)="handlerCreate()">Tạo tài khoản</button>`,
|
|
91
|
+
})
|
|
92
|
+
export class CreateUserComponent {
|
|
93
|
+
private readonly notif = inject(LibsUiNotificationService);
|
|
94
|
+
private readonly router = inject(Router);
|
|
95
|
+
|
|
96
|
+
handlerCreate() {
|
|
97
|
+
this.notif.showCompTypeTextSuccess('Tạo tài khoản thành công!', {
|
|
98
|
+
title: 'Thành công', // tiêu đề (optional)
|
|
99
|
+
timeRemove: 5000, // ms — tự động đóng sau 5 giây (default: 3000)
|
|
100
|
+
positionRight: 24, // px từ phải màn hình (default: 12)
|
|
101
|
+
eventName: 'click', // 'click' | 'mouseenter' — trigger callback
|
|
102
|
+
callback: () => this.router.navigate(['/users']),
|
|
103
|
+
interpolateParams: { // params cho ngx-translate interpolation (tự động escaped)
|
|
104
|
+
name: 'Nguyễn Văn A',
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
}
|
|
39
108
|
}
|
|
40
109
|
```
|
|
41
110
|
|
|
42
|
-
|
|
111
|
+
### 3. Dùng với ngx-translate key và interpolation
|
|
43
112
|
|
|
44
113
|
```typescript
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
114
|
+
import { Component, inject } from '@angular/core';
|
|
115
|
+
import { LibsUiNotificationService } from '@libs-ui/services-notification';
|
|
116
|
+
|
|
117
|
+
@Component({
|
|
118
|
+
standalone: true,
|
|
119
|
+
selector: 'app-report',
|
|
120
|
+
template: `<button (click)="handlerDelete()">Xóa báo cáo</button>`,
|
|
121
|
+
})
|
|
122
|
+
export class ReportComponent {
|
|
123
|
+
private readonly notif = inject(LibsUiNotificationService);
|
|
124
|
+
|
|
125
|
+
handlerDelete() {
|
|
126
|
+
// Truyền translation key — ngx-translate xử lý tự động
|
|
127
|
+
this.notif.showCompTypeTextSuccess('notifications.save_success');
|
|
128
|
+
|
|
129
|
+
// Với interpolation params (tự động escape HTML để ngăn XSS):
|
|
130
|
+
this.notif.showCompTypeTextError('notifications.delete_error', {
|
|
131
|
+
interpolateParams: { itemName: 'Báo cáo tháng 1' },
|
|
132
|
+
});
|
|
133
|
+
// JSON: { "notifications": { "delete_error": "Không thể xóa '{{itemName}}'. Vui lòng thử lại." } }
|
|
134
|
+
// Kết quả: "Không thể xóa 'Báo cáo tháng 1'. Vui lòng thử lại."
|
|
135
|
+
}
|
|
136
|
+
}
|
|
56
137
|
```
|
|
57
138
|
|
|
58
|
-
|
|
139
|
+
### 4. Callback khi user tương tác với toast
|
|
59
140
|
|
|
60
141
|
```typescript
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
142
|
+
import { Component, inject } from '@angular/core';
|
|
143
|
+
import { Router } from '@angular/router';
|
|
144
|
+
import { LibsUiNotificationService } from '@libs-ui/services-notification';
|
|
145
|
+
|
|
146
|
+
@Component({
|
|
147
|
+
standalone: true,
|
|
148
|
+
selector: 'app-inbox',
|
|
149
|
+
template: `<button (click)="handlerNewMessage()">Kiểm tra tin nhắn</button>`,
|
|
150
|
+
})
|
|
151
|
+
export class InboxComponent {
|
|
152
|
+
private readonly notif = inject(LibsUiNotificationService);
|
|
153
|
+
private readonly router = inject(Router);
|
|
154
|
+
|
|
155
|
+
handlerNewMessage() {
|
|
156
|
+
// Callback khi user click vào toast
|
|
157
|
+
this.notif.showCompTypeTextInfo('Bạn có thông báo mới. Click để xem.', {
|
|
158
|
+
eventName: 'click',
|
|
159
|
+
timeRemove: 8000,
|
|
160
|
+
callback: () => {
|
|
161
|
+
this.router.navigate(['/notifications']);
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
handlerStorageWarning() {
|
|
167
|
+
// Callback khi user hover vào toast
|
|
168
|
+
this.notif.showCompTypeTextWarning('Dung lượng gần đầy. Hover để xem chi tiết.', {
|
|
169
|
+
eventName: 'mouseenter',
|
|
170
|
+
timeRemove: 6000,
|
|
171
|
+
callback: () => this.showStorageDetail(),
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
private showStorageDetail() {
|
|
176
|
+
// xử lý hiển thị chi tiết
|
|
177
|
+
}
|
|
178
|
+
}
|
|
69
179
|
```
|
|
70
180
|
|
|
71
|
-
|
|
181
|
+
### 5. iFrame Bridge — Micro-frontend
|
|
72
182
|
|
|
73
183
|
```typescript
|
|
74
|
-
// AppComponent của Shell (parent)
|
|
184
|
+
// === AppComponent của Shell (parent) ===
|
|
185
|
+
import { Component, inject } from '@angular/core';
|
|
186
|
+
import { LibsUiNotificationService } from '@libs-ui/services-notification';
|
|
187
|
+
|
|
188
|
+
@Component({
|
|
189
|
+
standalone: true,
|
|
190
|
+
selector: 'app-root',
|
|
191
|
+
template: `<router-outlet />`,
|
|
192
|
+
})
|
|
75
193
|
export class AppComponent {
|
|
76
|
-
private notif = inject(LibsUiNotificationService);
|
|
194
|
+
private readonly notif = inject(LibsUiNotificationService);
|
|
195
|
+
|
|
77
196
|
constructor() {
|
|
78
|
-
|
|
197
|
+
// Gọi 1 lần duy nhất — service có guard isInit để tránh duplicate listener
|
|
198
|
+
this.notif.init(
|
|
199
|
+
['MICRO_SITE_PUSH_MESSAGE_FROM_CHILD'], // message names để lắng nghe từ child
|
|
200
|
+
'MICRO_SITE_PUSH_MESSAGE_FROM_CHILD', // tên PostMessage gửi lên parent (optional)
|
|
201
|
+
);
|
|
79
202
|
}
|
|
80
203
|
}
|
|
81
204
|
|
|
82
|
-
//
|
|
83
|
-
// Gọi notification bình thường — service tự
|
|
205
|
+
// === Micro-frontend child (embedded trong iFrame) ===
|
|
206
|
+
// Gọi notification bình thường — service tự phát hiện isEmbedFrame()
|
|
84
207
|
// và gửi PostMessage lên parent thay vì render tại chỗ
|
|
85
|
-
|
|
208
|
+
@Component({
|
|
209
|
+
standalone: true,
|
|
210
|
+
selector: 'app-upload',
|
|
211
|
+
template: `<button (click)="handlerUpload()">Upload</button>`,
|
|
212
|
+
})
|
|
213
|
+
export class UploadComponent {
|
|
214
|
+
private readonly notif = inject(LibsUiNotificationService);
|
|
215
|
+
|
|
216
|
+
handlerUpload() {
|
|
217
|
+
this.notif.showCompTypeTextSuccess('Upload hoàn tất!');
|
|
218
|
+
// → parent shell nhận PostMessage và render notification thay vì child
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### 6. Browser Native Notification
|
|
224
|
+
|
|
225
|
+
```typescript
|
|
226
|
+
import { Component, inject } from '@angular/core';
|
|
227
|
+
import { LibsUiNotificationService } from '@libs-ui/services-notification';
|
|
228
|
+
|
|
229
|
+
@Component({
|
|
230
|
+
standalone: true,
|
|
231
|
+
selector: 'app-push-setup',
|
|
232
|
+
template: `
|
|
233
|
+
<button (click)="handlerRequestPermission()">Bật thông báo</button>
|
|
234
|
+
<button (click)="handlerSpawnNotification()">Gửi thông báo</button>
|
|
235
|
+
`,
|
|
236
|
+
})
|
|
237
|
+
export class PushSetupComponent {
|
|
238
|
+
private readonly notif = inject(LibsUiNotificationService);
|
|
239
|
+
|
|
240
|
+
handlerRequestPermission() {
|
|
241
|
+
// Xin quyền browser native notification
|
|
242
|
+
this.notif.systemRequestPermission();
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
handlerSpawnNotification() {
|
|
246
|
+
// Hiển thị native notification (chỉ khi đã granted)
|
|
247
|
+
this.notif
|
|
248
|
+
.systemSpawnNotification('Thông báo mới', {
|
|
249
|
+
body: 'Bạn có 3 tin nhắn chưa đọc từ Team',
|
|
250
|
+
icon: '/assets/icons/icon-192x192.png',
|
|
251
|
+
tag: 'inbox-notification',
|
|
252
|
+
})
|
|
253
|
+
.subscribe({
|
|
254
|
+
next: (event) => {
|
|
255
|
+
// Trả về { notification, event } khi show hoặc click
|
|
256
|
+
},
|
|
257
|
+
error: (err) => {
|
|
258
|
+
// Notification lỗi
|
|
259
|
+
},
|
|
260
|
+
complete: () => {
|
|
261
|
+
// Notification đã đóng
|
|
262
|
+
},
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
## Methods (Service)
|
|
269
|
+
|
|
270
|
+
| Method | Signature | Mô tả |
|
|
271
|
+
|---|---|---|
|
|
272
|
+
| `showCompTypeTextSuccess` | `(message: string, config?: INotificationTextPublicConfig): void` | Hiển thị toast màu xanh lá — thành công |
|
|
273
|
+
| `showCompTypeTextError` | `(message: string, config?: INotificationTextPublicConfig): void` | Hiển thị toast màu đỏ — lỗi |
|
|
274
|
+
| `showCompTypeTextInfo` | `(message: string, config?: INotificationTextPublicConfig): void` | Hiển thị toast màu xanh dương — thông tin |
|
|
275
|
+
| `showCompTypeTextWarning` | `(message: string, config?: INotificationTextPublicConfig): void` | Hiển thị toast màu vàng — cảnh báo |
|
|
276
|
+
| `init` | `(messageNameHandler: string[], messageNamePostToParent?: string): void` | Khởi tạo iFrame bridge listener — gọi 1 lần trong AppComponent của shell |
|
|
277
|
+
| `systemRequestPermission` | `(): void` | Xin quyền browser native notification |
|
|
278
|
+
| `systemSpawnNotification` | `(title: string, options?: NotificationOptions): Observable<unknown>` | Hiển thị browser native notification, trả về Observable theo vòng đời notification |
|
|
279
|
+
| `get TranslateService` | `TranslateService` | Getter trả về instance của TranslateService đang inject |
|
|
280
|
+
|
|
281
|
+
## Types & Interfaces
|
|
282
|
+
|
|
283
|
+
```typescript
|
|
284
|
+
import {
|
|
285
|
+
INotificationTextPublicConfig,
|
|
286
|
+
INotificationTextConfig,
|
|
287
|
+
INotificationQueue,
|
|
288
|
+
INotificationPushFromIFrame,
|
|
289
|
+
} from '@libs-ui/services-notification';
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### INotificationTextPublicConfig
|
|
293
|
+
|
|
294
|
+
Config truyền vào các method `showCompTypeText*()`:
|
|
295
|
+
|
|
296
|
+
```typescript
|
|
297
|
+
interface INotificationTextPublicConfig {
|
|
298
|
+
title?: string; // Tiêu đề hiển thị trên toast
|
|
299
|
+
timeRemove?: number; // ms — tự động đóng (default: 3000)
|
|
300
|
+
positionRight?: number; // px từ phải màn hình (default: 12)
|
|
301
|
+
eventName?: 'click' | 'mouseenter'; // Event trigger callback
|
|
302
|
+
callback?: () => void; // Hàm gọi khi user tương tác
|
|
303
|
+
interpolateParams?: Record<string, any>; // Params ngx-translate (tự động escaped)
|
|
304
|
+
}
|
|
86
305
|
```
|
|
87
306
|
|
|
88
|
-
|
|
307
|
+
| Field | Type | Default | Mô tả | Ví dụ |
|
|
308
|
+
|---|---|---|---|---|
|
|
309
|
+
| `title` | `string` | `undefined` | Tiêu đề hiển thị phía trên message trong toast | `title: 'Thành công'` |
|
|
310
|
+
| `timeRemove` | `number` (ms) | `3000` | Thời gian tự động đóng tính bằng milliseconds | `timeRemove: 5000` |
|
|
311
|
+
| `positionRight` | `number` (px) | `12` | Khoảng cách từ phải màn hình tính bằng pixel | `positionRight: 24` |
|
|
312
|
+
| `eventName` | `'click' \| 'mouseenter'` | `undefined` | Event DOM sẽ trigger `callback` | `eventName: 'click'` |
|
|
313
|
+
| `callback` | `() => void` | `undefined` | Hàm gọi khi user thực hiện event tương ứng | `callback: () => router.navigate(['/'])` |
|
|
314
|
+
| `interpolateParams` | `Record<string, any>` | `undefined` | Params truyền vào ngx-translate interpolation, tự động escape HTML | `interpolateParams: { name: 'An' }` |
|
|
315
|
+
|
|
316
|
+
### INotificationTextConfig (Internal)
|
|
317
|
+
|
|
318
|
+
Config nội bộ dùng khi tạo component động — thường không dùng trực tiếp:
|
|
89
319
|
|
|
90
320
|
```typescript
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
//
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
321
|
+
interface INotificationTextConfig {
|
|
322
|
+
type: 'success' | 'info' | 'error' | 'warn'; // Kiểu toast
|
|
323
|
+
timeRemove: number; // ms
|
|
324
|
+
positionRight?: number; // px
|
|
325
|
+
zIndex?: number; // CSS z-index (default: 2000)
|
|
326
|
+
eventName?: 'click' | 'mouseenter';
|
|
327
|
+
callback?: () => void;
|
|
328
|
+
}
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### INotificationPushFromIFrame (Internal)
|
|
332
|
+
|
|
333
|
+
Payload nhận từ child iFrame qua PostMessage:
|
|
334
|
+
|
|
335
|
+
```typescript
|
|
336
|
+
interface INotificationPushFromIFrame {
|
|
337
|
+
functionName: 'success' | 'info' | 'error' | 'warn';
|
|
338
|
+
message: string;
|
|
339
|
+
title?: string;
|
|
340
|
+
timeRemove?: number;
|
|
341
|
+
}
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
## Lưu ý quan trọng
|
|
345
|
+
|
|
346
|
+
⚠️ **Queue MAX 5 — FIFO**: Nếu đang có đủ 5 toast trên màn hình, toast cũ nhất sẽ tự bị remove (kèm hủy timeout của nó) khi toast mới xuất hiện. Hành vi này không thể tắt.
|
|
347
|
+
|
|
348
|
+
⚠️ **interpolateParams XSS-safe**: Mỗi value trong `interpolateParams` tự động qua `escapeHtml()` trước khi truyền vào ngx-translate. Đây là bảo vệ XSS cho user-generated content. Message string gốc không bị escape — phải là translation key hoặc text an toàn.
|
|
349
|
+
|
|
350
|
+
⚠️ **init() chỉ gọi 1 lần**: Service có guard `isInit` signal — gọi `init()` nhiều lần an toàn, chỉ listener đầu tiên được đăng ký. Nên gọi trong `AppComponent` constructor của shell.
|
|
351
|
+
|
|
352
|
+
⚠️ **iFrame auto-detection**: Service tự gọi `isEmbedFrame()` — không cần config thêm trong child app. Khi chạy trong iFrame, payload được `encrypt()` trước khi gửi lên parent qua PostMessage.
|
|
353
|
+
|
|
354
|
+
⚠️ **systemSpawnNotification yêu cầu granted**: Observable sẽ `complete()` ngay lập tức nếu browser không hỗ trợ Notification API hoặc quyền chưa được cấp (`'granted'`). Luôn gọi `systemRequestPermission()` trước.
|
|
355
|
+
|
|
356
|
+
⚠️ **Dynamic stacking dùng getBoundingClientRect()**: Vị trí top/right của các toast được tính lại sau mỗi add/remove thông qua `setTimeout` để đảm bảo DOM đã render. Tránh can thiệp vào style inline `top`/`right` của các element toast từ bên ngoài.
|
|
357
|
+
|
|
358
|
+
## Demo
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
npx nx serve core-ui
|
|
104
362
|
```
|
|
105
363
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
| Method | Mô tả |
|
|
109
|
-
| ------------------------------------------- | ---------------------------------------------------- |
|
|
110
|
-
| `showCompTypeTextSuccess(message, config?)` | Toast màu xanh lá — thành công |
|
|
111
|
-
| `showCompTypeTextError(message, config?)` | Toast màu đỏ — lỗi |
|
|
112
|
-
| `showCompTypeTextInfo(message, config?)` | Toast màu xanh dương — thông tin |
|
|
113
|
-
| `showCompTypeTextWarning(message, config?)` | Toast màu vàng — cảnh báo |
|
|
114
|
-
| `init(messageNames, parentName?)` | Khởi tạo iFrame bridge; gọi 1 lần trong AppComponent |
|
|
115
|
-
| `systemRequestPermission()` | Xin quyền browser native notification |
|
|
116
|
-
| `systemSpawnNotification(title, opts?)` | Hiển thị native notification → `Observable` |
|
|
117
|
-
| `get TranslateService` | Getter cho TranslateService instance |
|
|
118
|
-
|
|
119
|
-
## INotificationTextPublicConfig
|
|
120
|
-
|
|
121
|
-
| Field | Type | Default | Mô tả |
|
|
122
|
-
| ------------------- | ------------------------- | ----------- | ------------------------------------- |
|
|
123
|
-
| `title` | `string` | `undefined` | Tiêu đề trên toast |
|
|
124
|
-
| `timeRemove` | `number (ms)` | `3000` | Thời gian tự động đóng |
|
|
125
|
-
| `positionRight` | `number (px)` | `12` | Khoảng cách từ phải |
|
|
126
|
-
| `eventName` | `'click' \| 'mouseenter'` | `undefined` | Event trigger callback |
|
|
127
|
-
| `callback` | `() => void` | `undefined` | Hàm gọi khi interact |
|
|
128
|
-
| `interpolateParams` | `Record<string, any>` | `undefined` | Params cho translate (tự escape HTML) |
|
|
129
|
-
|
|
130
|
-
## Lưu ý
|
|
131
|
-
|
|
132
|
-
- **Queue MAX 5**: Nếu đang có đủ 5 toast, toast cũ nhất tự bị remove khi toast mới xuất hiện.
|
|
133
|
-
- **interpolateParams escaping**: Mỗi value trong `interpolateParams` tự động qua `escapeHtml()` — safe với user input.
|
|
134
|
-
- **iFrame detection**: Service tự phát hiện `isEmbedFrame()`. Không cần config thêm trong child app.
|
|
135
|
-
- **init() chỉ gọi 1 lần**: Service có guard `isInit` signal — gọi nhiều lần không bị duplicate listener.
|
|
364
|
+
Truy cập: http://localhost:4500/services/notification
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, Directive, signal, inject, ElementRef,
|
|
2
|
+
import { input, Directive, signal, inject, ElementRef, Component, ChangeDetectionStrategy, Injectable } from '@angular/core';
|
|
3
3
|
import { LibsUiDynamicComponentService } from '@libs-ui/services-dynamic-component';
|
|
4
4
|
import { UtilsCommunicateMicro, isEmbedFrame, escapeHtml, get, encrypt } from '@libs-ui/utils';
|
|
5
5
|
import * as i1 from '@ngx-translate/core';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libs-ui-services-notification.mjs","sources":["../../../../../libs-ui/services/notification/src/components/base.component.ts","../../../../../libs-ui/services/notification/src/components/text/text.component.ts","../../../../../libs-ui/services/notification/src/components/text/text.component.html","../../../../../libs-ui/services/notification/src/notification.service.ts","../../../../../libs-ui/services/notification/src/libs-ui-services-notification.ts"],"sourcesContent":["import { Directive, OnDestroy, input } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { INotificationTextConfig } from '../interfaces/notification';\n@Directive()\nexport class LibUiServiceNotificationBaseComponent implements OnDestroy {\n // #region PROPERTY\n protected onDestroy = new Subject<void>();\n\n // #region INPUT\n readonly message = input<string>('');\n readonly interpolateParams = input<Record<string, unknown>>();\n readonly title = input<string>('');\n readonly config = input<INotificationTextConfig>({ type: 'success', timeRemove: 2000 });\n readonly removeComponent = input.required<(component: unknown) => Promise<void>>();\n\n ngOnDestroy(): void {\n this.onDestroy.next();\n this.onDestroy.complete();\n }\n}\n","import { ChangeDetectionStrategy, Component, ElementRef, OnDestroy, OnInit, inject, signal } from '@angular/core';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { fromEvent } from 'rxjs';\nimport { take, takeUntil } from 'rxjs/operators';\nimport { LibUiServiceNotificationBaseComponent } from '../base.component';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'libs_ui-services-notification-components-text',\n templateUrl: './text.component.html',\n styleUrls: ['./text.component.scss'],\n standalone: true,\n imports: [TranslateModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class LibUiServicesComponentsTextComponent extends LibUiServiceNotificationBaseComponent implements OnInit, OnDestroy {\n // #region PROPERTY\n protected containerClass = signal<string>('');\n protected icon = signal<string>('');\n\n // #region INJECT\n private readonly elementRef = inject(ElementRef);\n\n constructor() {\n super();\n }\n\n ngOnInit(): void {\n switch (this.config().type) {\n case 'success':\n this.containerClass.set('libs-ui-toast_success');\n this.icon.set('libs-ui-icon-check-circle-solid');\n break;\n\n case 'info':\n this.containerClass.set('libs-ui-toast_info');\n this.icon.set('libs-ui-icon-tooltip-solid');\n break;\n\n case 'error':\n this.containerClass.set('libs-ui-toast_error');\n this.icon.set('libs-ui-icon-close-circle-solid');\n break;\n\n case 'warn':\n this.containerClass.set('libs-ui-toast_warning');\n this.icon.set('libs-ui-icon-alert-triangle-solid');\n break;\n\n default:\n this.containerClass.set('bg-[#6fd100] libs-ui-toast_success');\n this.icon.set('mo-icn-toast_success');\n }\n const { eventName, callback } = this.config();\n\n if (!eventName || !callback) {\n return;\n }\n if (eventName === 'click') {\n this.containerClass.update((value) => `${value} cursor-pointer`);\n }\n fromEvent(this.elementRef.nativeElement, eventName).pipe(takeUntil(this.onDestroy), take(1)).subscribe(callback);\n }\n\n /* FUNCTIONS */\n\n protected handlerClickClose(e: Event) {\n e.stopPropagation();\n this.removeComponent()(e);\n }\n}\n","<div\n class=\"libs-ui-toast\"\n [class]=\"containerClass()\"\n [style.zIndex]=\"config().zIndex || 2000\">\n <div class=\"flex items-center\">\n <i class=\"{{ icon() }}\"></i>\n </div>\n <div class=\"flex flex-col w-full\">\n @if (title()) {\n <div\n class=\"libs-ui-font-h5m text-break\"\n [innerHtml]=\"title() | translate\"></div>\n }\n @if (message()) {\n <div\n class=\"text-break\"\n [class.libs-ui-font-h5r]=\"!title()\"\n [class.libs-ui-font-h7r]=\"title()\"\n [class.mt-[4ppx]]=\"title()\"\n [innerHtml]=\"message() | translate: interpolateParams() || {}\"></div>\n }\n </div>\n <div class=\"flex items-center\">\n <i\n class=\"libs-ui-icon-close mr-0 ml-[8px] cursor-pointer\"\n (click)=\"handlerClickClose($event)\"\n (keydown.enter)=\"handlerClickClose($event)\"></i>\n </div>\n</div>\n","import { ComponentRef, Injectable, inject, signal } from '@angular/core';\nimport { LibsUiDynamicComponentService } from '@libs-ui/services-dynamic-component';\nimport { UtilsCommunicateMicro, encrypt, escapeHtml, get, isEmbedFrame } from '@libs-ui/utils';\nimport { TranslateService } from '@ngx-translate/core';\nimport { Observable } from 'rxjs';\nimport { LibUiServicesComponentsTextComponent } from './components';\nimport { INotificationPushFromIFrame, INotificationQueue, INotificationTextConfig, INotificationTextPublicConfig } from './interfaces/notification';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class LibsUiNotificationService {\n // #region PROPERTY\n private readonly notificationPermission = signal<NotificationPermission>('default');\n private readonly queueMessage = signal<Array<INotificationQueue>>(new Array<INotificationQueue>());\n private readonly timeoutUpdatePosition = signal<number>(0);\n private readonly MAX_QUEUE_MESSAGE: number = 5;\n private readonly isInit = signal<boolean>(false);\n private readonly messageNamePostToParent = signal<string>('MICRO_SITE_PUSH_MESSAGE_FROM_CHILD');\n\n // #region INJECT\n private readonly dynamicService = inject(LibsUiDynamicComponentService);\n private readonly translateService = inject(TranslateService);\n\n constructor() {\n this.notificationPermission.set(this.systemSupportNotification() ? 'default' : 'denied');\n }\n\n /* FUNCTIONS */\n public init(messageNameHandler: Array<string>, messageNamePostToParent?: string) {\n if (this.isInit()) {\n return;\n }\n this.isInit.set(true);\n if (messageNamePostToParent) {\n this.messageNamePostToParent.set(messageNamePostToParent);\n }\n UtilsCommunicateMicro.GetMessage(messageNameHandler).subscribe((e) => {\n if (!isEmbedFrame()) {\n const dataMessage = e.data.response as INotificationPushFromIFrame;\n\n this.showCompTypeText(dataMessage.message, undefined, dataMessage.title, { type: dataMessage.functionName, timeRemove: dataMessage.timeRemove || 2000 });\n\n return;\n }\n UtilsCommunicateMicro.PostMessageToParent(e.data);\n });\n }\n\n public get TranslateService() {\n return this.translateService;\n }\n\n private systemSupportNotification(): boolean {\n return 'Notification' in window;\n }\n\n public systemRequestPermission() {\n if (!this.systemSupportNotification()) {\n return;\n }\n Notification.requestPermission()\n .then((permission: NotificationPermission) => (this.Permission = permission))\n .catch((error: unknown) => {\n if (error instanceof TypeError) {\n Notification.requestPermission((permission: NotificationPermission) => (this.Permission = permission));\n }\n });\n }\n\n private set Permission(permission: NotificationPermission) {\n this.notificationPermission.set(permission);\n }\n\n public systemSpawnNotification(title: string, options?: NotificationOptions): Observable<unknown> {\n return new Observable((obs) => {\n if (!this.systemSupportNotification()) {\n obs.complete();\n }\n if (this.notificationPermission() !== 'granted') {\n obs.complete();\n }\n const notify = new Notification(title, options);\n\n notify.onshow = (e) => {\n return obs.next({\n notification: notify,\n event: e,\n });\n };\n notify.onclick = (e) => {\n notify.close();\n window.focus();\n\n return obs.next({\n notification: notify,\n event: e,\n });\n };\n notify.onerror = (e) => {\n return obs.error({\n notification: notify,\n event: e,\n });\n };\n notify.onclose = () => {\n return obs.complete();\n };\n });\n }\n\n public showCompTypeTextSuccess(message: string, config?: INotificationTextPublicConfig) {\n this.showCompTypeText(message, config?.interpolateParams, config?.title, { type: 'success', timeRemove: config?.timeRemove || 3000, positionRight: config?.positionRight, eventName: config?.eventName, callback: config?.callback });\n }\n\n public showCompTypeTextError(message: string, config?: INotificationTextPublicConfig) {\n this.showCompTypeText(message, config?.interpolateParams, config?.title, { type: 'error', timeRemove: config?.timeRemove || 3000, positionRight: config?.positionRight, eventName: config?.eventName, callback: config?.callback });\n }\n\n public showCompTypeTextInfo(message: string, config?: INotificationTextPublicConfig) {\n this.showCompTypeText(message, config?.interpolateParams, config?.title, { type: 'info', timeRemove: config?.timeRemove || 3000, positionRight: config?.positionRight, eventName: config?.eventName, callback: config?.callback });\n }\n\n public showCompTypeTextWarning(message: string, config?: INotificationTextPublicConfig) {\n this.showCompTypeText(message, config?.interpolateParams, config?.title, { type: 'warn', timeRemove: config?.timeRemove || 3000, positionRight: config?.positionRight, eventName: config?.eventName, callback: config?.callback });\n }\n\n private showCompTypeText(message: string, interpolateParams?: Record<string, unknown>, title?: string, config: INotificationTextConfig = { type: 'success', timeRemove: 2000 }): void {\n if (!message) {\n return;\n }\n\n this.checkQueueMessage();\n if (interpolateParams && typeof interpolateParams === 'object') {\n Object.keys(interpolateParams).forEach((key) => {\n interpolateParams[key] = escapeHtml(get(interpolateParams, key));\n });\n }\n\n if (isEmbedFrame()) {\n const messageTranslate = this.translateService.instant(message, interpolateParams) as string;\n const titleTranslate = title ? this.translateService.instant(title, interpolateParams) : title;\n\n return UtilsCommunicateMicro.PostMessageToParent({ type: this.messageNamePostToParent(), response: encrypt(JSON.stringify({ functionName: config.type, message: messageTranslate, titleTranslate, timeRemove: config.timeRemove || 2000 })) });\n }\n const component = this.dynamicService.resolveComponentFactory(LibUiServicesComponentsTextComponent);\n\n component.setInput('title', title);\n component.setInput('message', message);\n component.setInput('interpolateParams', interpolateParams);\n component.setInput('config', config);\n component.setInput('removeComponent', this.removeComponent.bind(this, component));\n const timeout = setTimeout(() => {\n this.removeComponent(component);\n }, config?.timeRemove);\n\n this.queueMessage.update((queue) => {\n queue.push({\n component,\n config,\n timeout,\n });\n\n return [...queue];\n });\n this.dynamicService.addToBody(component);\n this.updatePositionMessage();\n }\n\n private removeComponent(component: ComponentRef<unknown>) {\n this.dynamicService.remove(component);\n const indexRemove = this.queueMessage().findIndex((config) => config.component === component);\n\n if (indexRemove !== -1) {\n this.queueMessage.update((queue) => {\n queue.splice(indexRemove, 1);\n return [...queue];\n });\n }\n }\n\n private checkQueueMessage(): void {\n if (this.queueMessage.length < this.MAX_QUEUE_MESSAGE) {\n return;\n }\n const firstQueue = this.queueMessage().shift() as INotificationQueue;\n\n clearTimeout(firstQueue.timeout);\n this.dynamicService.remove(firstQueue.component);\n this.updatePositionMessage();\n }\n\n private updatePositionMessage(): void {\n if (!this.queueMessage().length) {\n return;\n }\n clearTimeout(this.timeoutUpdatePosition());\n this.timeoutUpdatePosition.set(\n setTimeout(() => {\n let topMessage = 12;\n\n this.queueMessage().forEach((message: INotificationQueue) => {\n const firstEl = message.component.instance.elementRef.nativeElement.firstElementChild;\n const rect = firstEl.getBoundingClientRect();\n\n firstEl.style.top = `${topMessage}px`;\n topMessage += rect.height + 12;\n let right = message.config.positionRight ?? 12;\n\n if (isEmbedFrame()) {\n right = 40;\n }\n firstEl.style.right = `${right}px`;\n });\n })\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAIa,qCAAqC,CAAA;;AAEtC,IAAA,SAAS,GAAG,IAAI,OAAO,EAAQ;;AAGhC,IAAA,OAAO,GAAG,KAAK,CAAS,EAAE,CAAC;IAC3B,iBAAiB,GAAG,KAAK,EAA2B;AACpD,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,CAAC;AACzB,IAAA,MAAM,GAAG,KAAK,CAA0B,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;AAC9E,IAAA,eAAe,GAAG,KAAK,CAAC,QAAQ,EAAyC;IAElF,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;AACrB,QAAA,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE;IAC3B;wGAdW,qCAAqC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAArC,qCAAqC,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,S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O,CAAC,MAAM,CAAC,aAAa,IAAI,EAAE;gBAE9C,IAAI,YAAY,EAAE,EAAE;oBAClB,KAAK,GAAG,EAAE;gBACZ;gBACA,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,CAAA,EAAG,KAAK,IAAI;AACpC,YAAA,CAAC,CAAC;QACJ,CAAC,CAAC,CACH;IACH;wGA7MW,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAzB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,cAFxB,MAAM,EAAA,CAAA;;4FAEP,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAHrC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACVD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"libs-ui-services-notification.mjs","sources":["../../../../../libs-ui/services/notification/src/components/base.component.ts","../../../../../libs-ui/services/notification/src/components/text/text.component.ts","../../../../../libs-ui/services/notification/src/components/text/text.component.html","../../../../../libs-ui/services/notification/src/notification.service.ts","../../../../../libs-ui/services/notification/src/libs-ui-services-notification.ts"],"sourcesContent":["import { Directive, OnDestroy, input } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { INotificationTextConfig } from '../interfaces/notification';\n@Directive()\nexport class LibUiServiceNotificationBaseComponent implements OnDestroy {\n // #region PROPERTY\n protected onDestroy = new Subject<void>();\n\n // #region INPUT\n readonly message = input<string>('');\n readonly interpolateParams = input<Record<string, unknown>>();\n readonly title = input<string>('');\n readonly config = input<INotificationTextConfig>({ type: 'success', timeRemove: 2000 });\n readonly removeComponent = input.required<(component: unknown) => Promise<void>>();\n\n ngOnDestroy(): void {\n this.onDestroy.next();\n this.onDestroy.complete();\n }\n}\n","import { ChangeDetectionStrategy, Component, ElementRef, OnDestroy, OnInit, inject, signal } from '@angular/core';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { fromEvent } from 'rxjs';\nimport { take, takeUntil } from 'rxjs/operators';\nimport { LibUiServiceNotificationBaseComponent } from '../base.component';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'libs_ui-services-notification-components-text',\n templateUrl: './text.component.html',\n styleUrls: ['./text.component.scss'],\n standalone: true,\n imports: [TranslateModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class LibUiServicesComponentsTextComponent extends LibUiServiceNotificationBaseComponent implements OnInit, OnDestroy {\n // #region PROPERTY\n protected containerClass = signal<string>('');\n protected icon = signal<string>('');\n\n // #region INJECT\n private readonly elementRef = inject(ElementRef);\n\n constructor() {\n super();\n }\n\n ngOnInit(): void {\n switch (this.config().type) {\n case 'success':\n this.containerClass.set('libs-ui-toast_success');\n this.icon.set('libs-ui-icon-check-circle-solid');\n break;\n\n case 'info':\n this.containerClass.set('libs-ui-toast_info');\n this.icon.set('libs-ui-icon-tooltip-solid');\n break;\n\n case 'error':\n this.containerClass.set('libs-ui-toast_error');\n this.icon.set('libs-ui-icon-close-circle-solid');\n break;\n\n case 'warn':\n this.containerClass.set('libs-ui-toast_warning');\n this.icon.set('libs-ui-icon-alert-triangle-solid');\n break;\n\n default:\n this.containerClass.set('bg-[#6fd100] libs-ui-toast_success');\n this.icon.set('mo-icn-toast_success');\n }\n const { eventName, callback } = this.config();\n\n if (!eventName || !callback) {\n return;\n }\n if (eventName === 'click') {\n this.containerClass.update((value) => `${value} cursor-pointer`);\n }\n fromEvent(this.elementRef.nativeElement, eventName).pipe(takeUntil(this.onDestroy), take(1)).subscribe(callback);\n }\n\n /* FUNCTIONS */\n\n protected handlerClickClose(e: Event) {\n e.stopPropagation();\n this.removeComponent()(e);\n }\n}\n","<div\n class=\"libs-ui-toast\"\n [class]=\"containerClass()\"\n [style.zIndex]=\"config().zIndex || 2000\">\n <div class=\"flex items-center\">\n <i class=\"{{ icon() }}\"></i>\n </div>\n <div class=\"flex flex-col w-full\">\n @if (title()) {\n <div\n class=\"libs-ui-font-h5m text-break\"\n [innerHtml]=\"title() | translate\"></div>\n }\n @if (message()) {\n <div\n class=\"text-break\"\n [class.libs-ui-font-h5r]=\"!title()\"\n [class.libs-ui-font-h7r]=\"title()\"\n [class.mt-[4ppx]]=\"title()\"\n [innerHtml]=\"message() | translate: interpolateParams() || {}\"></div>\n }\n </div>\n <div class=\"flex items-center\">\n <i\n class=\"libs-ui-icon-close mr-0 ml-[8px] cursor-pointer\"\n (click)=\"handlerClickClose($event)\"\n (keydown.enter)=\"handlerClickClose($event)\"></i>\n </div>\n</div>\n","import { ComponentRef, Injectable, inject, signal } from '@angular/core';\nimport { LibsUiDynamicComponentService } from '@libs-ui/services-dynamic-component';\nimport { UtilsCommunicateMicro, encrypt, escapeHtml, get, isEmbedFrame } from '@libs-ui/utils';\nimport { TranslateService } from '@ngx-translate/core';\nimport { Observable } from 'rxjs';\nimport { LibUiServicesComponentsTextComponent } from './components';\nimport { INotificationPushFromIFrame, INotificationQueue, INotificationTextConfig, INotificationTextPublicConfig } from './interfaces/notification';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class LibsUiNotificationService {\n // #region PROPERTY\n private readonly notificationPermission = signal<NotificationPermission>('default');\n private readonly queueMessage = signal<Array<INotificationQueue>>(new Array<INotificationQueue>());\n private readonly timeoutUpdatePosition = signal<number>(0);\n private readonly MAX_QUEUE_MESSAGE: number = 5;\n private readonly isInit = signal<boolean>(false);\n private readonly messageNamePostToParent = signal<string>('MICRO_SITE_PUSH_MESSAGE_FROM_CHILD');\n\n // #region INJECT\n private readonly dynamicService = inject(LibsUiDynamicComponentService);\n private readonly translateService = inject(TranslateService);\n\n constructor() {\n this.notificationPermission.set(this.systemSupportNotification() ? 'default' : 'denied');\n }\n\n /* FUNCTIONS */\n public init(messageNameHandler: Array<string>, messageNamePostToParent?: string) {\n if (this.isInit()) {\n return;\n }\n this.isInit.set(true);\n if (messageNamePostToParent) {\n this.messageNamePostToParent.set(messageNamePostToParent);\n }\n UtilsCommunicateMicro.GetMessage(messageNameHandler).subscribe((e) => {\n if (!isEmbedFrame()) {\n const dataMessage = e.data.response as INotificationPushFromIFrame;\n\n this.showCompTypeText(dataMessage.message, undefined, dataMessage.title, { type: dataMessage.functionName, timeRemove: dataMessage.timeRemove || 2000 });\n\n return;\n }\n UtilsCommunicateMicro.PostMessageToParent(e.data);\n });\n }\n\n public get TranslateService() {\n return this.translateService;\n }\n\n private systemSupportNotification(): boolean {\n return 'Notification' in window;\n }\n\n public systemRequestPermission() {\n if (!this.systemSupportNotification()) {\n return;\n }\n Notification.requestPermission()\n .then((permission: NotificationPermission) => (this.Permission = permission))\n .catch((error: unknown) => {\n if (error instanceof TypeError) {\n Notification.requestPermission((permission: NotificationPermission) => (this.Permission = permission));\n }\n });\n }\n\n private set Permission(permission: NotificationPermission) {\n this.notificationPermission.set(permission);\n }\n\n public systemSpawnNotification(title: string, options?: NotificationOptions): Observable<unknown> {\n return new Observable((obs) => {\n if (!this.systemSupportNotification()) {\n obs.complete();\n }\n if (this.notificationPermission() !== 'granted') {\n obs.complete();\n }\n const notify = new Notification(title, options);\n\n notify.onshow = (e) => {\n return obs.next({\n notification: notify,\n event: e,\n });\n };\n notify.onclick = (e) => {\n notify.close();\n window.focus();\n\n return obs.next({\n notification: notify,\n event: e,\n });\n };\n notify.onerror = (e) => {\n return obs.error({\n notification: notify,\n event: e,\n });\n };\n notify.onclose = () => {\n return obs.complete();\n };\n });\n }\n\n public showCompTypeTextSuccess(message: string, config?: INotificationTextPublicConfig) {\n this.showCompTypeText(message, config?.interpolateParams, config?.title, { type: 'success', timeRemove: config?.timeRemove || 3000, positionRight: config?.positionRight, eventName: config?.eventName, callback: config?.callback });\n }\n\n public showCompTypeTextError(message: string, config?: INotificationTextPublicConfig) {\n this.showCompTypeText(message, config?.interpolateParams, config?.title, { type: 'error', timeRemove: config?.timeRemove || 3000, positionRight: config?.positionRight, eventName: config?.eventName, callback: config?.callback });\n }\n\n public showCompTypeTextInfo(message: string, config?: INotificationTextPublicConfig) {\n this.showCompTypeText(message, config?.interpolateParams, config?.title, { type: 'info', timeRemove: config?.timeRemove || 3000, positionRight: config?.positionRight, eventName: config?.eventName, callback: config?.callback });\n }\n\n public showCompTypeTextWarning(message: string, config?: INotificationTextPublicConfig) {\n this.showCompTypeText(message, config?.interpolateParams, config?.title, { type: 'warn', timeRemove: config?.timeRemove || 3000, positionRight: config?.positionRight, eventName: config?.eventName, callback: config?.callback });\n }\n\n private showCompTypeText(message: string, interpolateParams?: Record<string, unknown>, title?: string, config: INotificationTextConfig = { type: 'success', timeRemove: 2000 }): void {\n if (!message) {\n return;\n }\n\n this.checkQueueMessage();\n if (interpolateParams && typeof interpolateParams === 'object') {\n Object.keys(interpolateParams).forEach((key) => {\n interpolateParams[key] = escapeHtml(get(interpolateParams, key));\n });\n }\n\n if (isEmbedFrame()) {\n const messageTranslate = this.translateService.instant(message, interpolateParams) as string;\n const titleTranslate = title ? this.translateService.instant(title, interpolateParams) : title;\n\n return UtilsCommunicateMicro.PostMessageToParent({ type: this.messageNamePostToParent(), response: encrypt(JSON.stringify({ functionName: config.type, message: messageTranslate, titleTranslate, timeRemove: config.timeRemove || 2000 })) });\n }\n const component = this.dynamicService.resolveComponentFactory(LibUiServicesComponentsTextComponent);\n\n component.setInput('title', title);\n component.setInput('message', message);\n component.setInput('interpolateParams', interpolateParams);\n component.setInput('config', config);\n component.setInput('removeComponent', this.removeComponent.bind(this, component));\n const timeout = setTimeout(() => {\n this.removeComponent(component);\n }, config?.timeRemove);\n\n this.queueMessage.update((queue) => {\n queue.push({\n component,\n config,\n timeout,\n });\n\n return [...queue];\n });\n this.dynamicService.addToBody(component);\n this.updatePositionMessage();\n }\n\n private removeComponent(component: ComponentRef<unknown>) {\n this.dynamicService.remove(component);\n const indexRemove = this.queueMessage().findIndex((config) => config.component === component);\n\n if (indexRemove !== -1) {\n this.queueMessage.update((queue) => {\n queue.splice(indexRemove, 1);\n return [...queue];\n });\n }\n }\n\n private checkQueueMessage(): void {\n if (this.queueMessage.length < this.MAX_QUEUE_MESSAGE) {\n return;\n }\n const firstQueue = this.queueMessage().shift() as INotificationQueue;\n\n clearTimeout(firstQueue.timeout);\n this.dynamicService.remove(firstQueue.component);\n this.updatePositionMessage();\n }\n\n private updatePositionMessage(): void {\n if (!this.queueMessage().length) {\n return;\n }\n clearTimeout(this.timeoutUpdatePosition());\n this.timeoutUpdatePosition.set(\n setTimeout(() => {\n let topMessage = 12;\n\n this.queueMessage().forEach((message: INotificationQueue) => {\n const firstEl = message.component.instance.elementRef.nativeElement.firstElementChild;\n const rect = firstEl.getBoundingClientRect();\n\n firstEl.style.top = `${topMessage}px`;\n topMessage += rect.height + 12;\n let right = message.config.positionRight ?? 12;\n\n if (isEmbedFrame()) {\n right = 40;\n }\n firstEl.style.right = `${right}px`;\n });\n })\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAIa,qCAAqC,CAAA;;AAEtC,IAAA,SAAS,GAAG,IAAI,OAAO,EAAQ,CAAC;;AAGjC,IAAA,OAAO,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;IAC5B,iBAAiB,GAAG,KAAK,EAA2B,CAAC;AACrD,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;AAC1B,IAAA,MAAM,GAAG,KAAK,CAA0B,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;AAC/E,IAAA,eAAe,GAAG,KAAK,CAAC,QAAQ,EAAyC,CAAC;IAEnF,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;AACtB,QAAA,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;KAC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EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,cAFxB,MAAM,EAAA,CAAA,CAAA;;4FAEP,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAHrC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libs-ui/services-notification",
|
|
3
|
-
"version": "0.2.356-
|
|
3
|
+
"version": "0.2.356-43",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/core": ">=18.0.0",
|
|
6
6
|
"rxjs": "~7.8.0",
|
|
7
7
|
"@ngx-translate/core": "^15.0.0",
|
|
8
|
-
"@libs-ui/services-dynamic-component": "0.2.356-
|
|
9
|
-
"@libs-ui/utils": "0.2.356-
|
|
8
|
+
"@libs-ui/services-dynamic-component": "0.2.356-43",
|
|
9
|
+
"@libs-ui/utils": "0.2.356-43"
|
|
10
10
|
},
|
|
11
11
|
"sideEffects": false,
|
|
12
12
|
"module": "fesm2022/libs-ui-services-notification.mjs",
|