@acorex/components 18.12.41 → 18.12.43
Sign up to get free protection for your applications and to get access to all the features.
- package/dialog/lib/dialog.service.d.ts +2 -2
- package/esm2022/dialog/lib/dialog.service.mjs +26 -24
- package/esm2022/notification/lib/notification.service.mjs +60 -58
- package/esm2022/toast/lib/toast.service.mjs +65 -64
- package/esm2022/wysiwyg/lib/wysiwyg/wysiwyg-container/wysiwyg-container.component.mjs +7 -3
- package/fesm2022/acorex-components-dialog.mjs +25 -23
- package/fesm2022/acorex-components-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-notification.mjs +59 -58
- package/fesm2022/acorex-components-notification.mjs.map +1 -1
- package/fesm2022/acorex-components-toast.mjs +63 -63
- package/fesm2022/acorex-components-toast.mjs.map +1 -1
- package/fesm2022/acorex-components-wysiwyg.mjs +6 -2
- package/fesm2022/acorex-components-wysiwyg.mjs.map +1 -1
- package/notification/lib/notification.service.d.ts +3 -3
- package/package.json +1 -1
- package/toast/lib/toast.service.d.ts +3 -3
- package/wysiwyg/lib/wysiwyg/wysiwyg-container/wysiwyg-container.component.d.ts +1 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
import { AXStyleColorType } from '@acorex/components/common';
|
2
|
-
import { AXDialogConfig } from './dialog.class';
|
2
|
+
import { AXDialogConfig, AXDialogRef } from './dialog.class';
|
3
3
|
import * as i0 from "@angular/core";
|
4
4
|
/**
|
5
5
|
* The Button is a component which detects user interaction and triggers a corresponding event
|
@@ -7,7 +7,6 @@ import * as i0 from "@angular/core";
|
|
7
7
|
* @category Components
|
8
8
|
*/
|
9
9
|
export declare class AXDialogService {
|
10
|
-
#private;
|
11
10
|
private dialog;
|
12
11
|
private detectIcon;
|
13
12
|
/**
|
@@ -26,6 +25,7 @@ export declare class AXDialogService {
|
|
26
25
|
show(options: AXDialogConfig): Promise<{
|
27
26
|
name: string;
|
28
27
|
}>;
|
28
|
+
open(config: AXDialogConfig): AXDialogRef;
|
29
29
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXDialogService, never>;
|
30
30
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXDialogService>;
|
31
31
|
}
|
@@ -34,7 +34,7 @@ export class AXDialogService {
|
|
34
34
|
*/
|
35
35
|
alert(title, content, type = 'primary', orientation = 'horizontal', draggable) {
|
36
36
|
return new Promise((resolve) => {
|
37
|
-
const popup = this
|
37
|
+
const popup = this.open({
|
38
38
|
title,
|
39
39
|
type: type,
|
40
40
|
content,
|
@@ -63,7 +63,7 @@ export class AXDialogService {
|
|
63
63
|
*/
|
64
64
|
confirm(title, content, type = 'primary', orientation = 'horizontal', draggable) {
|
65
65
|
return new Promise((resolve) => {
|
66
|
-
const popup = this
|
66
|
+
const popup = this.open({
|
67
67
|
title,
|
68
68
|
content,
|
69
69
|
type,
|
@@ -111,35 +111,37 @@ export class AXDialogService {
|
|
111
111
|
*/
|
112
112
|
show(options) {
|
113
113
|
return new Promise((resolve) => {
|
114
|
-
const popup = this.#open(options);
|
115
114
|
options.orientation = options.orientation || 'horizontal';
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
}
|
126
|
-
else {
|
127
|
-
popup.close();
|
128
|
-
resolve({ name: b.name ?? b.text });
|
129
|
-
}
|
130
|
-
}
|
131
|
-
else if (resolve) {
|
132
|
-
popup.close();
|
115
|
+
options.icon = options.icon ?? this.detectIcon(options.type);
|
116
|
+
const popup = this.open(options);
|
117
|
+
options.buttons?.forEach((b) => {
|
118
|
+
const orginalClick = b.onClick;
|
119
|
+
b.onClick = () => {
|
120
|
+
const e = { source: b, handled: false };
|
121
|
+
if (orginalClick) {
|
122
|
+
orginalClick(e);
|
123
|
+
if (e.handled) {
|
133
124
|
resolve({ name: b.name ?? b.text });
|
134
125
|
}
|
135
126
|
else {
|
136
127
|
popup.close();
|
128
|
+
resolve({ name: b.name ?? b.text });
|
137
129
|
}
|
138
|
-
}
|
139
|
-
|
130
|
+
}
|
131
|
+
else if (resolve) {
|
132
|
+
popup.close();
|
133
|
+
resolve({ name: b.name ?? b.text });
|
134
|
+
}
|
135
|
+
else {
|
136
|
+
popup.close();
|
137
|
+
}
|
138
|
+
};
|
139
|
+
});
|
140
140
|
});
|
141
141
|
}
|
142
|
-
|
142
|
+
open(config) {
|
143
|
+
config.orientation = config.orientation || 'horizontal';
|
144
|
+
config.icon = config.icon ?? this.detectIcon(config.type);
|
143
145
|
const dialogRef = this.dialog.open(AXDialogComponent, {
|
144
146
|
data: config,
|
145
147
|
role: 'alertdialog',
|
@@ -163,4 +165,4 @@ export class AXDialogService {
|
|
163
165
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXDialogService, decorators: [{
|
164
166
|
type: Injectable
|
165
167
|
}] });
|
166
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlhbG9nLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbXBvbmVudHMvZGlhbG9nL3NyYy9saWIvZGlhbG9nLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLE1BQU0sRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQzdDLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRW5ELE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLG9CQUFvQixDQUFDOztBQUV2RDs7OztHQUlHO0FBRUgsTUFBTSxPQUFPLGVBQWU7SUFENUI7UUFFVSxXQUFNLEdBQVcsTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDO0tBaUt6QztJQS9KUyxVQUFVLENBQUMsSUFBSTtRQUNyQixJQUFJLElBQVksQ0FBQztRQUNqQixRQUFRLElBQUksRUFBRSxDQUFDO1lBQ2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EaWFsb2cgPSBpbmplY3QoRGlhbG9nKTtcblxuICBwcml2YXRlIGRldGVjdEljb24odHlwZSkge1xuICAgIGxldCBpY29uOiBzdHJpbmc7XG4gICAgc3dpdGNoICh0eXBlKSB7XG4gICAgICBjYXNlICdzdWNjZXNzJzpcbiAgICAgICAgaWNvbiA9ICdheC1pY29uIGF4LWljb24tY2hlY2snO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ2Rhbmdlcic6XG4gICAgICAgIGljb24gPSAnYXgtaWNvbiBheC1pY29uLWVycm9yJztcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICd3YXJuaW5nJzpcbiAgICAgICAgaWNvbiA9ICdheC1pY29uIGF4LWljb24td2FybmluZyc7XG4gICAgICAgIGJyZWFrO1xuICAgICAgZGVmYXVsdDpcbiAgICAgICAgaWNvbiA9ICdheC1pY29uIGF4LWljb24taW5mbyc7XG4gICAgICAgIGJyZWFrO1xuICAgIH1cbiAgICByZXR1cm4gaWNvbjtcbiAgfVxuICAvKipcbiAgICogIFNob3cgYW4gYWxlcnQgYm94IHdpdGggJ09rYXknIGJ1dHRvbi5cbiAgICovXG4gIGFsZXJ0KFxuICAgIHRpdGxlOiBzdHJpbmcsXG4gICAgY29udGVudDogc3RyaW5nLFxuICAgIHR5cGU6IEFYU3R5bGVDb2xvclR5cGUgPSAncHJpbWFyeScsXG4gICAgb3JpZW50YXRpb246ICdob3Jpem9udGFsJyB8ICd2ZXJ0aWNhbCcgPSAnaG9yaXpvbnRhbCcsXG4gICAgZHJhZ2dhYmxlPzogYm9vbGVhbixcbiAgKTogUHJvbWlzZTx2b2lkPiB7XG4gICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlKSA9PiB7XG4gICAgICBjb25zdCBwb3B1cCA9IHRoaXMuI29wZW4oe1xuICAgICAgICB0aXRsZSxcbiAgICAgICAgdHlwZTogdHlwZSxcbiAgICAgICAgY29udGVudCxcbiAgICAgICAgaWNvbjogdGhpcy5kZXRlY3RJY29uKHR5cGUpLFxuICAgICAgICBvcmllbnRhdGlvbixcbiAgICAgICAgZHJhZ2dhYmxlLFxuICAgICAgICBidXR0b25zOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgbmFtZTogJ2NvbmZpcm0nLFxuICAgICAgICAgICAgdGV4dDogJ29rYXknLFxuICAgICAgICAgICAgY29sb3I6IHR5cGUsXG4gICAgICAgICAgICBhdXRvZm9jdXM6IHRydWUsXG4gICAgICAgICAgICBvbkNsaWNrOiAoKSA9PiB7XG4gICAgICAgICAgICAgIHBvcHVwLmNsb3NlKCk7XG4gICAgICAgICAgICAgIGlmIChyZXNvbHZlKSB7XG4gICAgICAgICAgICAgICAgcmVzb2x2ZSgpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgIH0sXG4gICAgICAgIF0sXG4gICAgICB9KTtcbiAgICB9KTtcbiAgfVxuXG4gIC8qKlxuICAgKiAgU2hvdyBhIGNvbmZpcm0gYm94IHdpdGggJ09rYXknICYgJ0NhbmNlbCcgYnV0dG9ucy5cbiAgICovXG5cbiAgY29uZmlybShcbiAgICB0aXRsZTogc3RyaW5nLFxuICAgIGNvbnRlbnQ6IHN0cmluZyxcbiAgICB0eXBlOiBBWFN0eWxlQ29sb3JUeXBlID0gJ3ByaW1hcnknLFxuICAgIG9yaWVudGF0aW9uOiAnaG9yaXpvbnRhbCcgfCAndmVydGljYWwnID0gJ2hvcml6b250YWwnLFxuICAgIGRyYWdnYWJsZT86IGJvb2xlYW4sXG4gICk6IFByb21pc2U8eyByZXN1bHQ6IGJvb2xlYW4gfT4ge1xuICAgIHJldHVybiBuZXcgUHJvbWlzZTx7IHJlc3VsdDogYm9vbGVhbiB9PigocmVzb2x2ZSkgPT4ge1xuICAgICAgY29uc3QgcG9wdXAgPSB0aGlzLiNvcGVuKHtcbiAgICAgICAgdGl0bGUsXG4gICAgICAgIGNvbnRlbnQsXG4gICAgICAgIHR5cGUsXG4gICAgICAgIGljb246IHRoaXMuZGV0ZWN0SWNvbih0eXBlKSxcbiAgICAgICAgb3JpZW50YXRpb24sXG4gICAgICAgIGRyYWdnYWJsZSxcbiAgICAgICAgYnV0dG9uczogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIG5hbWU6ICdjb25maXJtJyxcbiAgICAgICAgICAgIHRleHQ6ICdva2F5JyxcbiAgICAgICAgICAgIGNvbG9yOiB0eXBlLFxuICAgICAgICAgICAgYXV0b2ZvY3VzOiB0cnVlLFxuICAgICAgICAgICAgb25DbGljazogKCkgPT4ge1xuICAgICAgICAgICAgICBwb3B1cC5jbG9zZSgpO1xuICAgICAgICAgICAgICBpZiAocmVzb2x2ZSkge1xuICAgICAgICAgICAgICAgIHJlc29sdmUoeyByZXN1bHQ6IHRydWUgfSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBuYW1lOiAnY2FuY2VsJyxcbiAgICAgICAgICAgIHRleHQ6ICdjYW5jZWwnLFxuICAgICAgICAgICAgY29sb3I6IGBnaG9zdGAsXG4gICAgICAgICAgICBvbkNsaWNrOiAoKSA9PiB7XG4gICAgICAgICAgICAgIHBvcHVwLmNsb3NlKCk7XG4gICAgICAgICAgICAgIGlmIChyZXNvbHZlKSB7XG4gICAgICAgICAgICAgICAgcmVzb2x2ZSh7IHJlc3VsdDogZmFsc2UgfSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBob3RrZXk6IHtcbiAgICAgICAgICAgICAgRXNjYXBlOiAoKSA9PiB7XG4gICAgICAgICAgICAgICAgcG9wdXAuY2xvc2UoKTtcbiAgICAgICAgICAgICAgICBpZiAocmVzb2x2ZSkge1xuICAgICAgICAgICAgICAgICAgcmVzb2x2ZSh7IHJlc3VsdDogZmFsc2UgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICB9LFxuICAgICAgICBdLFxuICAgICAgfSk7XG4gICAgfSk7XG4gIH1cblxuICAvKipcbiAgICogIFNob3cgYSBjdXN0b20gZGlhbG9nIGJveC5cbiAgICovXG4gIHNob3cob3B0aW9uczogQVhEaWFsb2dDb25maWcpOiBQcm9taXNlPHsgbmFtZTogc3RyaW5nIH0+IHtcbiAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUpID0+IHtcbiAgICAgIGNvbnN0IHBvcHVwID0gdGhpcy4jb3BlbihvcHRpb25zKTtcbiAgICAgIG9wdGlvbnMub3JpZW50YXRpb24gPSBvcHRpb25zLm9yaWVudGF0aW9uIHx8ICdob3Jpem9udGFsJztcbiAgICAgIChvcHRpb25zLmljb24gPSBvcHRpb25zLmljb24gPz8gdGhpcy5kZXRlY3RJY29uKG9wdGlvbnMudHlwZSkpLFxuICAgICAgICBvcHRpb25zLmJ1dHRvbnM/LmZvckVhY2goKGIpID0+IHtcbiAgICAgICAgICBjb25zdCBvcmdpbmFsQ2xpY2sgPSBiLm9uQ2xpY2s7XG4gICAgICAgICAgYi5vbkNsaWNrID0gKCkgPT4ge1xuICAgICAgICAgICAgY29uc3QgZSA9IHsgc291cmNlOiBiLCBoYW5kbGVkOiBmYWxzZSB9O1xuICAgICAgICAgICAgaWYgKG9yZ2luYWxDbGljaykge1xuICAgICAgICAgICAgICBvcmdpbmFsQ2xpY2soZSk7XG4gICAgICAgICAgICAgIGlmIChlLmhhbmRsZWQpIHtcbiAgICAgICAgICAgICAgICByZXNvbHZlKHsgbmFtZTogYi5uYW1lID8/IGIudGV4dCB9KTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBwb3B1cC5jbG9zZSgpO1xuICAgICAgICAgICAgICAgIHJlc29sdmUoeyBuYW1lOiBiLm5hbWUgPz8gYi50ZXh0IH0pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHJlc29sdmUpIHtcbiAgICAgICAgICAgICAgcG9wdXAuY2xvc2UoKTtcbiAgICAgICAgICAgICAgcmVzb2x2ZSh7IG5hbWU6IGIubmFtZSA/PyBiLnRleHQgfSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBwb3B1cC5jbG9zZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH07XG4gICAgICAgIH0pO1xuICAgIH0pO1xuICB9XG5cbiAgI29wZW4oY29uZmlnOiBBWERpYWxvZ0NvbmZpZyk6IEFYRGlhbG9nUmVmIHtcbiAgICBjb25zdCBkaWFsb2dSZWYgPSB0aGlzLmRpYWxvZy5vcGVuKEFYRGlhbG9nQ29tcG9uZW50LCB7XG4gICAgICBkYXRhOiBjb25maWcsXG4gICAgICByb2xlOiAnYWxlcnRkaWFsb2cnLFxuICAgICAgYXJpYU1vZGFsOiB0cnVlLFxuICAgICAgcmVzdG9yZUZvY3VzOiB0cnVlLFxuICAgICAgY2xvc2VPbk5hdmlnYXRpb246IHRydWUsXG4gICAgICBjbG9zZU9uRGVzdHJveTogdHJ1ZSxcbiAgICAgIGhhc0JhY2tkcm9wOiB0cnVlLFxuICAgICAgZGlzYWJsZUNsb3NlOiB0cnVlLFxuICAgICAgcGFuZWxDbGFzczogWydheC1hbmltYXRlLWJvdW5jZUluJywgJ2F4LWFuaW1hdGUtZmFzdGVyJ10sXG4gICAgfSk7XG4gICAgcmV0dXJuIHtcbiAgICAgIGNsb3NlOiAoKSA9PiB7XG4gICAgICAgIGRpYWxvZ1JlZi5jb21wb25lbnRJbnN0YW5jZT8uY2xvc2UoKTtcbiAgICAgIH0sXG4gICAgfTtcbiAgfVxufVxuIl19
|
168
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlhbG9nLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbXBvb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XgtaWNvbi13YXJuaW5nJztcbiAgICAgICAgYnJlYWs7XG4gICAgICBkZWZhdWx0OlxuICAgICAgICBpY29uID0gJ2F4LWljb24gYXgtaWNvbi1pbmZvJztcbiAgICAgICAgYnJlYWs7XG4gICAgfVxuICAgIHJldHVybiBpY29uO1xuICB9XG4gIC8qKlxuICAgKiAgU2hvdyBhbiBhbGVydCBib3ggd2l0aCAnT2theScgYnV0dG9uLlxuICAgKi9cbiAgYWxlcnQoXG4gICAgdGl0bGU6IHN0cmluZyxcbiAgICBjb250ZW50OiBzdHJpbmcsXG4gICAgdHlwZTogQVhTdHlsZUNvbG9yVHlwZSA9ICdwcmltYXJ5JyxcbiAgICBvcmllbnRhdGlvbjogJ2hvcml6b250YWwnIHwgJ3ZlcnRpY2FsJyA9ICdob3Jpem9udGFsJyxcbiAgICBkcmFnZ2FibGU/OiBib29sZWFuLFxuICApOiBQcm9taXNlPHZvaWQ+IHtcbiAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUpID0+IHtcbiAgICAgIGNvbnN0IHBvcHVwID0gdGhpcy5vcGVuKHtcbiAgICAgICAgdGl0bGUsXG4gICAgICAgIHR5cGU6IHR5cGUsXG4gICAgICAgIGNvbnRlbnQsXG4gICAgICAgIGljb246IHRoaXMuZGV0ZWN0SWNvbih0eXBlKSxcbiAgICAgICAgb3JpZW50YXRpb24sXG4gICAgICAgIGRyYWdnYWJsZSxcbiAgICAgICAgYnV0dG9uczogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIG5hbWU6ICdjb25maXJtJyxcbiAgICAgICAgICAgIHRleHQ6ICdva2F5JyxcbiAgICAgICAgICAgIGNvbG9yOiB0eXBlLFxuICAgICAgICAgICAgYXV0b2ZvY3VzOiB0cnVlLFxuICAgICAgICAgICAgb25DbGljazogKCkgPT4ge1xuICAgICAgICAgICAgICBwb3B1cC5jbG9zZSgpO1xuICAgICAgICAgICAgICBpZiAocmVzb2x2ZSkge1xuICAgICAgICAgICAgICAgIHJlc29sdmUoKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICB9LFxuICAgICAgICBdLFxuICAgICAgfSk7XG4gICAgfSk7XG4gIH1cblxuICAvKipcbiAgICogIFNob3cgYSBjb25maXJtIGJveCB3aXRoICdPa2F5JyAmICdDYW5jZWwnIGJ1dHRvbnMuXG4gICAqL1xuXG4gIGNvbmZpcm0oXG4gICAgdGl0bGU6IHN0cmluZyxcbiAgICBjb250ZW50OiBzdHJpbmcsXG4gICAgdHlwZTogQVhTdHlsZUNvbG9yVHlwZSA9ICdwcmltYXJ5JyxcbiAgICBvcmllbnRhdGlvbjogJ2hvcml6b250YWwnIHwgJ3ZlcnRpY2FsJyA9ICdob3Jpem9udGFsJyxcbiAgICBkcmFnZ2FibGU/OiBib29sZWFuLFxuICApOiBQcm9taXNlPHsgcmVzdWx0OiBib29sZWFuIH0+IHtcbiAgICByZXR1cm4gbmV3IFByb21pc2U8eyByZXN1bHQ6IGJvb2xlYW4gfT4oKHJlc29sdmUpID0+IHtcbiAgICAgIGNvbnN0IHBvcHVwID0gdGhpcy5vcGVuKHtcbiAgICAgICAgdGl0bGUsXG4gICAgICAgIGNvbnRlbnQsXG4gICAgICAgIHR5cGUsXG4gICAgICAgIGljb246IHRoaXMuZGV0ZWN0SWNvbih0eXBlKSxcbiAgICAgICAgb3JpZW50YXRpb24sXG4gICAgICAgIGRyYWdnYWJsZSxcbiAgICAgICAgYnV0dG9uczogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIG5hbWU6ICdjb25maXJtJyxcbiAgICAgICAgICAgIHRleHQ6ICdva2F5JyxcbiAgICAgICAgICAgIGNvbG9yOiB0eXBlLFxuICAgICAgICAgICAgYXV0b2ZvY3VzOiB0cnVlLFxuICAgICAgICAgICAgb25DbGljazogKCkgPT4ge1xuICAgICAgICAgICAgICBwb3B1cC5jbG9zZSgpO1xuICAgICAgICAgICAgICBpZiAocmVzb2x2ZSkge1xuICAgICAgICAgICAgICAgIHJlc29sdmUoeyByZXN1bHQ6IHRydWUgfSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBuYW1lOiAnY2FuY2VsJyxcbiAgICAgICAgICAgIHRleHQ6ICdjYW5jZWwnLFxuICAgICAgICAgICAgY29sb3I6IGBnaG9zdGAsXG4gICAgICAgICAgICBvbkNsaWNrOiAoKSA9PiB7XG4gICAgICAgICAgICAgIHBvcHVwLmNsb3NlKCk7XG4gICAgICAgICAgICAgIGlmIChyZXNvbHZlKSB7XG4gICAgICAgICAgICAgICAgcmVzb2x2ZSh7IHJlc3VsdDogZmFsc2UgfSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBob3RrZXk6IHtcbiAgICAgICAgICAgICAgRXNjYXBlOiAoKSA9PiB7XG4gICAgICAgICAgICAgICAgcG9wdXAuY2xvc2UoKTtcbiAgICAgICAgICAgICAgICBpZiAocmVzb2x2ZSkge1xuICAgICAgICAgICAgICAgICAgcmVzb2x2ZSh7IHJlc3VsdDogZmFsc2UgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICB9LFxuICAgICAgICBdLFxuICAgICAgfSk7XG4gICAgfSk7XG4gIH1cblxuICAvKipcbiAgICogIFNob3cgYSBjdXN0b20gZGlhbG9nIGJveC5cbiAgICovXG4gIHNob3cob3B0aW9uczogQVhEaWFsb2dDb25maWcpOiBQcm9taXNlPHsgbmFtZTogc3RyaW5nIH0+IHtcbiAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUpID0+IHtcbiAgICAgIG9wdGlvbnMub3JpZW50YXRpb24gPSBvcHRpb25zLm9yaWVudGF0aW9uIHx8ICdob3Jpem9udGFsJztcbiAgICAgIG9wdGlvbnMuaWNvbiA9IG9wdGlvbnMuaWNvbiA/PyB0aGlzLmRldGVjdEljb24ob3B0aW9ucy50eXBlKTtcblxuICAgICAgY29uc3QgcG9wdXAgPSB0aGlzLm9wZW4ob3B0aW9ucyk7XG5cbiAgICAgIG9wdGlvbnMuYnV0dG9ucz8uZm9yRWFjaCgoYikgPT4ge1xuICAgICAgICBjb25zdCBvcmdpbmFsQ2xpY2sgPSBiLm9uQ2xpY2s7XG4gICAgICAgIGIub25DbGljayA9ICgpID0+IHtcbiAgICAgICAgICBjb25zdCBlID0geyBzb3VyY2U6IGIsIGhhbmRsZWQ6IGZhbHNlIH07XG4gICAgICAgICAgaWYgKG9yZ2luYWxDbGljaykge1xuICAgICAgICAgICAgb3JnaW5hbENsaWNrKGUpO1xuICAgICAgICAgICAgaWYgKGUuaGFuZGxlZCkge1xuICAgICAgICAgICAgICByZXNvbHZlKHsgbmFtZTogYi5uYW1lID8/IGIudGV4dCB9KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHBvcHVwLmNsb3NlKCk7XG4gICAgICAgICAgICAgIHJlc29sdmUoeyBuYW1lOiBiLm5hbWUgPz8gYi50ZXh0IH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZSBpZiAocmVzb2x2ZSkge1xuICAgICAgICAgICAgcG9wdXAuY2xvc2UoKTtcbiAgICAgICAgICAgIHJlc29sdmUoeyBuYW1lOiBiLm5hbWUgPz8gYi50ZXh0IH0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBwb3B1cC5jbG9zZSgpO1xuICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgIH0pO1xuICAgIH0pO1xuICB9XG5cbiAgb3Blbihjb25maWc6IEFYRGlhbG9nQ29uZmlnKTogQVhEaWFsb2dSZWYge1xuICAgIGNvbmZpZy5vcmllbnRhdGlvbiA9IGNvbmZpZy5vcmllbnRhdGlvbiB8fCAnaG9yaXpvbnRhbCc7XG4gICAgY29uZmlnLmljb24gPSBjb25maWcuaWNvbiA/PyB0aGlzLmRldGVjdEljb24oY29uZmlnLnR5cGUpO1xuXG4gICAgY29uc3QgZGlhbG9nUmVmID0gdGhpcy5kaWFsb2cub3BlbihBWERpYWxvZ0NvbXBvbmVudCwge1xuICAgICAgZGF0YTogY29uZmlnLFxuICAgICAgcm9sZTogJ2FsZXJ0ZGlhbG9nJyxcbiAgICAgIGFyaWFNb2RhbDogdHJ1ZSxcbiAgICAgIHJlc3RvcmVGb2N1czogdHJ1ZSxcbiAgICAgIGNsb3NlT25OYXZpZ2F0aW9uOiB0cnVlLFxuICAgICAgY2xvc2VPbkRlc3Ryb3k6IHRydWUsXG4gICAgICBoYXNCYWNrZHJvcDogdHJ1ZSxcbiAgICAgIGRpc2FibGVDbG9zZTogdHJ1ZSxcbiAgICAgIHBhbmVsQ2xhc3M6IFsnYXgtYW5pbWF0ZS1ib3VuY2VJbicsICdheC1hbmltYXRlLWZhc3RlciddLFxuICAgIH0pO1xuICAgIHJldHVybiB7XG4gICAgICBjbG9zZTogKCkgPT4ge1xuICAgICAgICBkaWFsb2dSZWYuY29tcG9uZW50SW5zdGFuY2U/LmNsb3NlKCk7XG4gICAgICB9LFxuICAgIH07XG4gIH1cbn1cbiJdfQ==
|
@@ -1,45 +1,39 @@
|
|
1
|
+
import { AXTranslationService } from '@acorex/core/translation';
|
1
2
|
import { Dialog } from '@angular/cdk/dialog';
|
2
3
|
import { GlobalPositionStrategy } from '@angular/cdk/overlay';
|
3
|
-
import { Injectable,
|
4
|
+
import { Injectable, inject } from '@angular/core';
|
4
5
|
import { AXNotificationComponent } from './notification.component';
|
5
6
|
import { AX_NOTIFICATION_CONFIG } from './notification.config';
|
6
7
|
import * as i0 from "@angular/core";
|
7
8
|
export class AXNotificationService {
|
8
9
|
constructor() {
|
9
10
|
this.dialog = inject(Dialog);
|
11
|
+
this.translationService = inject(AXTranslationService);
|
10
12
|
this.defaultConfig = inject(AX_NOTIFICATION_CONFIG);
|
11
|
-
this.activeNotifications =
|
12
|
-
this.reservedNotifications =
|
13
|
-
this.notificationCounterElement =
|
14
|
-
this.moreNotificationsColor =
|
15
|
-
this.moreNotificationsLocation =
|
16
|
-
this.reserveCounter =
|
17
|
-
this.#effect = effect(() => {
|
18
|
-
if (this.defaultConfig.limit <= 0)
|
19
|
-
return;
|
20
|
-
this.handleShowReservedNotification();
|
21
|
-
this.handleShowReservedNotificationCounter();
|
22
|
-
this.handleReserveCounter();
|
23
|
-
}, { allowSignalWrites: true });
|
13
|
+
this.activeNotifications = [];
|
14
|
+
this.reservedNotifications = [];
|
15
|
+
this.notificationCounterElement = null;
|
16
|
+
this.moreNotificationsColor = 'primary';
|
17
|
+
this.moreNotificationsLocation = 'bottom-center';
|
18
|
+
this.reserveCounter = 0;
|
24
19
|
}
|
25
|
-
#effect;
|
26
20
|
show(config) {
|
27
|
-
config =
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
},
|
40
|
-
};
|
41
|
-
}
|
21
|
+
config = { ...this.defaultConfig, ...config };
|
22
|
+
this.moreNotificationsColor = config.color;
|
23
|
+
this.moreNotificationsLocation = config.location;
|
24
|
+
if (this.defaultConfig.limit > 0 && this.activeNotifications.length >= this.defaultConfig.limit) {
|
25
|
+
const reservedRef = {
|
26
|
+
close: () => {
|
27
|
+
console.warn('Reserved notification cannot be closed until it is displayed.');
|
28
|
+
},
|
29
|
+
};
|
30
|
+
this.reservedNotifications.push({ config, reservedRef });
|
31
|
+
this.handleReservedNotificationCounter();
|
32
|
+
return reservedRef;
|
42
33
|
}
|
34
|
+
return this.displayNotification(config);
|
35
|
+
}
|
36
|
+
displayNotification(config) {
|
43
37
|
const gap = this.defaultConfig.gap;
|
44
38
|
const pos = this.getPosition(config.location) + gap + 'px';
|
45
39
|
const positionStrategy = this.getPositionStrategy(new GlobalPositionStrategy(), config.location, pos, gap);
|
@@ -55,10 +49,13 @@ export class AXNotificationService {
|
|
55
49
|
panelClass: ['ax-animate-animated', 'ax-animate-fadeIn', 'ax-animate-faster'],
|
56
50
|
positionStrategy,
|
57
51
|
});
|
58
|
-
this.activeNotifications.
|
52
|
+
this.activeNotifications.push(dialogRef.id);
|
53
|
+
this.handleReservedNotificationCounter();
|
59
54
|
const notificationRef = dialogRef.componentInstance;
|
60
55
|
dialogRef.closed.subscribe(() => {
|
61
|
-
this.activeNotifications
|
56
|
+
this.activeNotifications = this.activeNotifications.filter((id) => id !== dialogRef.id);
|
57
|
+
this.handleShowReservedNotification();
|
58
|
+
this.handleReservedNotificationCounter();
|
62
59
|
setTimeout(() => {
|
63
60
|
this.reposition(config.location, gap);
|
64
61
|
}, 0);
|
@@ -71,40 +68,45 @@ export class AXNotificationService {
|
|
71
68
|
}
|
72
69
|
hideAll() {
|
73
70
|
this.dialog.closeAll();
|
71
|
+
this.reserveCounter = 0;
|
72
|
+
this.reservedNotifications = [];
|
73
|
+
this.activeNotifications = [];
|
74
|
+
this.handleReservedNotificationCounter();
|
74
75
|
}
|
75
76
|
handleShowReservedNotification() {
|
76
|
-
if (this.activeNotifications
|
77
|
-
return;
|
78
|
-
if (!this.reservedNotifications().length)
|
77
|
+
if (this.activeNotifications.length > this.defaultConfig.limit - 1)
|
79
78
|
return;
|
80
|
-
|
81
|
-
this.reservedNotifications.update((value) => {
|
82
|
-
const arr = [...value];
|
83
|
-
arr.shift();
|
84
|
-
return arr;
|
85
|
-
});
|
86
|
-
}
|
87
|
-
handleShowReservedNotificationCounter() {
|
88
|
-
if (this.reservedNotifications().length === this.reserveCounter())
|
79
|
+
if (!this.reservedNotifications.length)
|
89
80
|
return;
|
90
|
-
this.
|
91
|
-
|
92
|
-
|
93
|
-
|
81
|
+
const { config, reservedRef } = this.reservedNotifications.shift();
|
82
|
+
const displayedRef = this.displayNotification(config);
|
83
|
+
this.handleReservedNotificationCounter();
|
84
|
+
reservedRef.close = displayedRef.close;
|
94
85
|
}
|
95
|
-
|
96
|
-
|
86
|
+
handleReservedNotificationCounter() {
|
87
|
+
const reservedCount = this.reservedNotifications.length;
|
88
|
+
if (reservedCount === this.reserveCounter)
|
97
89
|
return;
|
98
|
-
|
90
|
+
this.reserveCounter = reservedCount;
|
91
|
+
if (reservedCount === 0 && this.notificationCounterElement !== null) {
|
92
|
+
this.notificationCounterElement.close();
|
99
93
|
return;
|
100
|
-
|
94
|
+
}
|
95
|
+
if (reservedCount > 0) {
|
96
|
+
if (this.notificationCounterElement !== null) {
|
97
|
+
this.notificationCounterElement.close();
|
98
|
+
}
|
99
|
+
this.createReservedCounterToast();
|
100
|
+
}
|
101
101
|
}
|
102
|
-
createReservedCounterToast() {
|
102
|
+
async createReservedCounterToast() {
|
103
103
|
const opt = {
|
104
104
|
closeButton: false,
|
105
|
-
color: this.moreNotificationsColor
|
106
|
-
location: this.moreNotificationsLocation
|
107
|
-
title:
|
105
|
+
color: this.moreNotificationsColor,
|
106
|
+
location: this.moreNotificationsLocation,
|
107
|
+
title: await this.translationService.translateAsync('more-notification', {
|
108
|
+
params: { number: this.reserveCounter },
|
109
|
+
}),
|
108
110
|
timeOutProgress: false,
|
109
111
|
};
|
110
112
|
const gap = this.defaultConfig.gap;
|
@@ -122,7 +124,7 @@ export class AXNotificationService {
|
|
122
124
|
panelClass: ['ax-animate-animated', 'ax-animate-fadeIn', 'ax-animate-faster'],
|
123
125
|
positionStrategy,
|
124
126
|
});
|
125
|
-
this.notificationCounterElement
|
127
|
+
this.notificationCounterElement = dialogRef.componentInstance;
|
126
128
|
}
|
127
129
|
reposition(notificationLocation, gap) {
|
128
130
|
const list = this.dialog.openDialogs
|
@@ -190,4 +192,4 @@ export class AXNotificationService {
|
|
190
192
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXNotificationService, decorators: [{
|
191
193
|
type: Injectable
|
192
194
|
}] });
|
193
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlI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Rlckhvcml6b250YWxseSgpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ2JvdHRvbS1lbmQnOlxuICAgICAgICByZXR1cm4gcG9zaXRpb25TdHJhdGVneS5ib3R0b20ocG9zKS5yaWdodChnYXAgKyAncHgnKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICdib3R0b20tc3RhcnQnOlxuICAgICAgICByZXR1cm4gcG9zaXRpb25TdHJhdGVneS5ib3R0b20ocG9zKS5sZWZ0KGdhcCArICdweCcpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ3RvcC1jZW50ZXInOlxuICAgICAgICByZXR1cm4gcG9zaXRpb25TdHJhdGVneS50b3AocG9zKS5jZW50ZXJIb3Jpem9udGFsbHkoKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICd0b3AtZW5kJzpcbiAgICAgICAgcmV0dXJuIHBvc2l0aW9uU3RyYXRlZ3kudG9wKHBvcykucmlnaHQoZ2FwICsgJ3B4Jyk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAndG9wLXN0YXJ0JzpcbiAgICAgICAgcmV0dXJuIHBvc2l0aW9uU3RyYXRlZ3kudG9wKHBvcykubGVmdChnYXAgKyAncHgnKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICdjZW50ZXItc3RhcnQnOlxuICAgICAgICByZXR1cm4gcG9zaXRpb25TdHJhdGVneS5jZW50ZXJWZXJ0aWNhbGx5KCkubGVmdChnYXAgKyAncHgnKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICdjZW50ZXItZW5kJzpcbiAgICAgICAgcmV0dXJuIHBvc2l0aW9uU3RyYXRlZ3kuY2VudGVyVmVydGljYWxseSgpLnJpZ2h0KGdhcCArICdweCcpO1xuICAgICAgICBicmVhaztcbiAgICB9XG4gIH1cbn1cbiJdfQ==
|
195
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlI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gICAgcmV0dXJuIChcbiAgICAgIGxpc3RbbGlzdC5sZW5ndGggLSAxXS5nZXRIb3N0RWxlbWVudCgpLm9mZnNldFRvcCArIGxpc3RbbGlzdC5sZW5ndGggLSAxXS5nZXRIb3N0RWxlbWVudCgpLm9mZnNldEhlaWdodFxuICAgICk7XG4gIH1cblxuICBwcml2YXRlIGdldFBvc2l0aW9uU3RyYXRlZ3koXG4gICAgcG9zaXRpb25TdHJhdGVneTogR2xvYmFsUG9zaXRpb25TdHJhdGVneSxcbiAgICBsb2NhdGlvbjogQVhMb2NhdGlvbixcbiAgICBwb3M6IHN0cmluZyxcbiAgICBnYXA6IG51bWJlcixcbiAgKSB7XG4gICAgc3dpdGNoIChsb2NhdGlvbikge1xuICAgICAgY2FzZSAnYm90dG9tLWNlbnRlcic6XG4gICAgICAgIHJldHVybiBwb3NpdGlvblN0cmF0ZWd5LmJvdHRvbShwb3MpLmNlbnRlckhvcml6b250YWxseSgpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ2JvdHRvbS1lbmQnOlxuICAgICAgICByZXR1cm4gcG9zaXRpb25TdHJhdGVneS5ib3R0b20ocG9zKS5yaWdodChnYXAgKyAncHgnKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICdib3R0b20tc3RhcnQnOlxuICAgICAgICByZXR1cm4gcG9zaXRpb25TdHJhdGVneS5ib3R0b20ocG9zKS5sZWZ0KGdhcCArICdweCcpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ3RvcC1jZW50ZXInOlxuICAgICAgICByZXR1cm4gcG9zaXRpb25TdHJhdGVneS50b3AocG9zKS5jZW50ZXJIb3Jpem9udGFsbHkoKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICd0b3AtZW5kJzpcbiAgICAgICAgcmV0dXJuIHBvc2l0aW9uU3RyYXRlZ3kudG9wKHBvcykucmlnaHQoZ2FwICsgJ3B4Jyk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAndG9wLXN0YXJ0JzpcbiAgICAgICAgcmV0dXJuIHBvc2l0aW9uU3RyYXRlZ3kudG9wKHBvcykubGVmdChnYXAgKyAncHgnKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICdjZW50ZXItc3RhcnQnOlxuICAgICAgICByZXR1cm4gcG9zaXRpb25TdHJhdGVneS5jZW50ZXJWZXJ0aWNhbGx5KCkubGVmdChnYXAgKyAncHgnKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICdjZW50ZXItZW5kJzpcbiAgICAgICAgcmV0dXJuIHBvc2l0aW9uU3RyYXRlZ3kuY2VudGVyVmVydGljYWxseSgpLnJpZ2h0KGdhcCArICdweCcpO1xuICAgICAgICBicmVhaztcbiAgICB9XG4gIH1cbn1cbiJdfQ==
|