@acorex/components 18.12.39 → 18.12.41

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. package/dialog/lib/dialog.component.d.ts +11 -11
  2. package/dialog/lib/dialog.service.d.ts +2 -2
  3. package/esm2022/common/lib/types/placement.mjs +8 -2
  4. package/esm2022/datetime-picker/lib/datetime-picker.component.mjs +3 -3
  5. package/esm2022/dialog/lib/dialog.component.mjs +12 -12
  6. package/esm2022/dialog/lib/dialog.service.mjs +5 -5
  7. package/esm2022/form/lib/validation-rule.directive.mjs +1 -1
  8. package/esm2022/notification/lib/notification.component.mjs +4 -4
  9. package/esm2022/notification/lib/notification.config.mjs +2 -1
  10. package/esm2022/notification/lib/notification.service.mjs +137 -39
  11. package/esm2022/toast/lib/toast.component.mjs +2 -2
  12. package/esm2022/toast/lib/toast.config.mjs +2 -1
  13. package/esm2022/toast/lib/toast.service.mjs +140 -36
  14. package/fesm2022/acorex-components-common.mjs +7 -1
  15. package/fesm2022/acorex-components-common.mjs.map +1 -1
  16. package/fesm2022/acorex-components-datetime-picker.mjs +2 -2
  17. package/fesm2022/acorex-components-datetime-picker.mjs.map +1 -1
  18. package/fesm2022/acorex-components-dialog.mjs +15 -15
  19. package/fesm2022/acorex-components-dialog.mjs.map +1 -1
  20. package/fesm2022/acorex-components-form.mjs.map +1 -1
  21. package/fesm2022/acorex-components-notification.mjs +139 -40
  22. package/fesm2022/acorex-components-notification.mjs.map +1 -1
  23. package/fesm2022/acorex-components-toast.mjs +140 -35
  24. package/fesm2022/acorex-components-toast.mjs.map +1 -1
  25. package/form/lib/validation-rule.directive.d.ts +1 -1
  26. package/notification/lib/notification.component.d.ts +3 -3
  27. package/notification/lib/notification.config.d.ts +1 -0
  28. package/notification/lib/notification.service.d.ts +13 -0
  29. package/package.json +1 -1
  30. package/toast/lib/toast.component.d.ts +1 -1
  31. package/toast/lib/toast.config.d.ts +1 -0
  32. package/toast/lib/toast.service.d.ts +13 -0
@@ -1,6 +1,6 @@
1
1
  import { Dialog } from '@angular/cdk/dialog';
2
2
  import { GlobalPositionStrategy, ScrollStrategyOptions } from '@angular/cdk/overlay';
3
- import { Injectable, inject } from '@angular/core';
3
+ import { Injectable, effect, inject, signal } from '@angular/core';
4
4
  import { AXToastComponent } from './toast.component';
5
5
  import { AX_TOAST_CONFIG } from './toast.config';
6
6
  import * as i0 from "@angular/core";
@@ -10,8 +10,22 @@ export class AXToastService {
10
10
  this.scrollStrategyOptions = scrollStrategyOptions;
11
11
  this.dialog = inject(Dialog);
12
12
  this.defaultConfig = inject(AX_TOAST_CONFIG);
13
+ this.activeToasts = signal([]);
14
+ this.reservedToasts = signal([]);
15
+ this.toastCounterElement = signal(null);
16
+ this.moreToastsColor = signal('primary');
17
+ this.moreToastsLocation = signal('bottom-center');
18
+ this.reserveCounter = signal(0);
19
+ this.#effect = effect(() => {
20
+ if (this.defaultConfig.limit <= 0)
21
+ return;
22
+ this.handleShowReservedToast();
23
+ this.handleShowReservedToastCounter();
24
+ this.handleReserveCounter();
25
+ }, { allowSignalWrites: true });
13
26
  this.scrollStrategy = this.scrollStrategyOptions.noop();
14
27
  }
28
+ #effect;
15
29
  primary(content) {
16
30
  this.show({
17
31
  timeOut: this.defaultConfig.timeOut,
@@ -52,35 +66,21 @@ export class AXToastService {
52
66
  closeButton: true,
53
67
  location: this.defaultConfig.location ?? 'bottom-center',
54
68
  }, config);
69
+ this.moreToastsColor.set(opt.color);
70
+ this.moreToastsLocation.set(opt.location);
71
+ if (this.defaultConfig.limit > 0) {
72
+ if (this.activeToasts().length >= this.defaultConfig.limit) {
73
+ this.reservedToasts.update((value) => [...value, opt]);
74
+ return {
75
+ close: () => {
76
+ //TODO close reserved toast
77
+ },
78
+ };
79
+ }
80
+ }
55
81
  const gap = this.defaultConfig.gap;
56
- let positionStrategy = new GlobalPositionStrategy();
57
82
  const pos = this.getPosition(opt.location) + gap + 'px';
58
- switch (opt.location) {
59
- case 'bottom-center':
60
- positionStrategy = positionStrategy.bottom(pos).centerHorizontally();
61
- break;
62
- case 'bottom-end':
63
- positionStrategy = positionStrategy.bottom(pos).right(gap + 'px');
64
- break;
65
- case 'bottom-start':
66
- positionStrategy = positionStrategy.bottom(pos).left(gap + 'px');
67
- break;
68
- case 'top-center':
69
- positionStrategy = positionStrategy.top(pos).centerHorizontally();
70
- break;
71
- case 'top-end':
72
- positionStrategy = positionStrategy.top(pos).right(gap + 'px');
73
- break;
74
- case 'top-start':
75
- positionStrategy = positionStrategy.top(pos).left(gap + 'px');
76
- break;
77
- case 'center-start':
78
- positionStrategy = positionStrategy.centerVertically().left(gap + 'px');
79
- break;
80
- case 'center-end':
81
- positionStrategy = positionStrategy.centerVertically().right(gap + 'px');
82
- break;
83
- }
83
+ const positionStrategy = this.getPositionStrategy(new GlobalPositionStrategy(), opt.location, pos, gap);
84
84
  const dialogRef = this.dialog.open(AXToastComponent, {
85
85
  data: opt,
86
86
  autoFocus: '__no_element__',
@@ -91,12 +91,16 @@ export class AXToastService {
91
91
  closeOnDestroy: true,
92
92
  hasBackdrop: false,
93
93
  panelClass: ['ax-animate-animated', 'ax-animate-fadeIn', 'ax-animate-faster'],
94
- positionStrategy: positionStrategy,
94
+ positionStrategy,
95
95
  scrollStrategy: this.scrollStrategy,
96
96
  });
97
+ this.activeToasts.update((value) => [...value, dialogRef.id]);
97
98
  const toastRef = dialogRef.componentInstance;
98
99
  dialogRef.closed.subscribe(() => {
99
- this.reposition();
100
+ this.activeToasts.update((value) => [...value].filter((dialogID) => dialogID !== dialogRef.id));
101
+ setTimeout(() => {
102
+ this.reposition(opt.location, gap);
103
+ }, 0);
100
104
  });
101
105
  return {
102
106
  close: () => {
@@ -107,18 +111,118 @@ export class AXToastService {
107
111
  hideAll() {
108
112
  this.dialog.closeAll();
109
113
  }
110
- reposition() {
111
- //TODO: reposition vertically afer close toast
114
+ handleShowReservedToast() {
115
+ if (this.activeToasts().length > this.defaultConfig.limit - 1)
116
+ return;
117
+ if (!this.reservedToasts().length)
118
+ return;
119
+ this.show(this.reservedToasts()[0]);
120
+ this.reservedToasts.update((value) => {
121
+ const toasts = [...value];
122
+ toasts.shift();
123
+ return toasts;
124
+ });
125
+ }
126
+ handleShowReservedToastCounter() {
127
+ if (this.reservedToasts().length === this.reserveCounter())
128
+ return;
129
+ this.reserveCounter.set(this.reservedToasts().length);
130
+ if (this.toastCounterElement() !== null)
131
+ this.toastCounterElement().close();
132
+ this.createReservedCounterToast();
133
+ }
134
+ handleReserveCounter() {
135
+ if (this.reserveCounter() !== 0)
136
+ return;
137
+ if (this.toastCounterElement() === null)
138
+ return;
139
+ this.toastCounterElement().close();
140
+ }
141
+ createReservedCounterToast() {
142
+ const opt = {
143
+ closeButton: false,
144
+ color: this.moreToastsColor(),
145
+ location: this.moreToastsLocation(),
146
+ title: `And ${this.reserveCounter()} more...`,
147
+ timeOutProgress: false,
148
+ };
149
+ const gap = this.defaultConfig.gap;
150
+ const pos = this.getPosition(opt.location) + gap + 'px';
151
+ const positionStrategy = this.getPositionStrategy(new GlobalPositionStrategy(), opt.location, pos, gap);
152
+ const dialogRef = this.dialog.open(AXToastComponent, {
153
+ data: opt,
154
+ autoFocus: '__no_element__',
155
+ restoreFocus: true,
156
+ role: 'dialog',
157
+ ariaModal: true,
158
+ closeOnNavigation: true,
159
+ closeOnDestroy: true,
160
+ hasBackdrop: false,
161
+ panelClass: ['ax-animate-animated', 'ax-animate-fadeIn', 'ax-animate-faster'],
162
+ positionStrategy,
163
+ scrollStrategy: this.scrollStrategy,
164
+ });
165
+ this.toastCounterElement.set(dialogRef.componentInstance);
166
+ }
167
+ reposition(toastLocation, gap) {
168
+ const list = this.dialog.openDialogs
169
+ .map((c) => c.componentInstance)
170
+ .filter((c) => c.config?.location == toastLocation);
171
+ list.forEach((element, index) => {
172
+ const pos = this.getRepositionPosition(index, gap, list, toastLocation);
173
+ console.log(index, element);
174
+ this.getPositionStrategy(element.dialogRef.config.positionStrategy, toastLocation, pos, gap).apply();
175
+ });
176
+ }
177
+ getRepositionPosition(index, gap, list, toastLocation) {
178
+ if (index === 0)
179
+ return gap + 'px';
180
+ const previouseElement = list[index - 1];
181
+ if (toastLocation.split('-')[0] == 'bottom') {
182
+ return window.innerHeight - previouseElement.getHostElement().offsetTop + gap + 'px';
183
+ }
184
+ return (previouseElement.getHostElement().offsetTop +
185
+ previouseElement.getHostElement().offsetHeight +
186
+ gap +
187
+ 'px');
112
188
  }
113
189
  getPosition(location) {
114
- const list = this.dialog.openDialogs.map((c) => c.componentInstance).filter((c) => c.config?.location == location);
190
+ const list = this.dialog.openDialogs
191
+ .map((c) => c.componentInstance)
192
+ .filter((c) => c.config?.location == location);
115
193
  if (list.length == 0)
116
194
  return 0;
117
195
  if (location.split('-')[0] == 'bottom') {
118
196
  return window.innerHeight - list[list.length - 1].getHostElement().offsetTop;
119
197
  }
120
- else {
121
- return list[list.length - 1].getHostElement().offsetTop + list[list.length - 1].getHostElement().offsetHeight;
198
+ return (list[list.length - 1].getHostElement().offsetTop + list[list.length - 1].getHostElement().offsetHeight);
199
+ }
200
+ getPositionStrategy(positionStrategy, location, pos, gap) {
201
+ switch (location) {
202
+ case 'bottom-center':
203
+ return positionStrategy.bottom(pos).centerHorizontally();
204
+ break;
205
+ case 'bottom-end':
206
+ return positionStrategy.bottom(pos).right(gap + 'px');
207
+ break;
208
+ case 'bottom-start':
209
+ return positionStrategy.bottom(pos).left(gap + 'px');
210
+ break;
211
+ case 'top-center':
212
+ return positionStrategy.top(pos).centerHorizontally();
213
+ break;
214
+ case 'top-end':
215
+ return positionStrategy.top(pos).right(gap + 'px');
216
+ break;
217
+ case 'top-start':
218
+ return positionStrategy.top(pos).left(gap + 'px');
219
+ break;
220
+ case 'center-start':
221
+ return positionStrategy.centerVertically().left(gap + 'px');
222
+ break;
223
+ case 'center-end':
224
+ return positionStrategy.centerVertically().right(gap + 'px');
225
+ break;
122
226
  }
123
227
  }
124
228
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXToastService, deps: [{ token: i1.ScrollStrategyOptions }], target: i0.ɵɵFactoryTarget.Injectable }); }
@@ -127,4 +231,4 @@ export class AXToastService {
127
231
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXToastService, decorators: [{
128
232
  type: Injectable
129
233
  }], ctorParameters: () => [{ type: i1.ScrollStrategyOptions }] });
130
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9hc3Quc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29tcG9uZW50cy90b2FzdC9zcmMvbGliL3RvYXN0LnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE1BQU0sRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQzdDLE9BQU8sRUFBRSxzQkFBc0IsRUFBa0IscUJBQXFCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUNyRyxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUVuRCxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUNyRCxPQUFPLEVBQWlCLGVBQWUsRUFBRSxNQUFNLGdCQUFnQixDQUFDOzs7QUFHaEUsTUFBTSxPQUFPLGNBQWM7SUFNekIsWUFBNkIscUJBQTRDO1FBQTVDLDBCQUFxQixHQUFyQixxQkFBcUIsQ0FBdUI7UUFMakUsV0FBTSxHQUFXLE1BQU0sQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUNoQyxrQkFBYSxHQUFrQixNQUFNLENBQUMsZUFBZSxDQUFDLENBQUM7UUFLN0QsSUFBSSxDQUFDLGNBQWMsR0FBRyxJQUFJLENBQUMscUJBQXFCLENBQUMsSUFBSSxFQUFFLENBQUM7SUFDMUQs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aXMuc2hvdyh7XG4gICAgICB0aW1lT3V0OiB0aGlzLmRlZmF1bHRDb25maWcudGltZU91dCxcbiAgICAgIGNvbG9yOiAncHJpbWFyeScsXG4gICAgICBjb250ZW50OiBjb250ZW50LFxuICAgIH0pO1xuICB9XG4gIHNlY29uZGFyeShjb250ZW50OiBzdHJpbmcpIHtcbiAgICB0aGlzLnNob3coe1xuICAgICAgdGltZU91dDogdGhpcy5kZWZhdWx0Q29uZmlnLnRpbWVPdXQsXG4gICAgICBjb2xvcjogJ3NlY29uZGFyeScsXG4gICAgICBjb250ZW50OiBjb250ZW50LFxuICAgIH0pO1xuICB9XG4gIHN1Y2Nlc3MoY29udGVudDogc3RyaW5nKSB7XG4gICAgdGhpcy5zaG93KHtcbiAgICAgIHRpbWVPdXQ6IHRoaXMuZGVmYXVsdENvbmZpZy50aW1lT3V0LFxuICAgICAgY29sb3I6ICdzdWNjZXNzJyxcbiAgICAgIGNvbnRlbnQ6IGNvbnRlbnQsXG4gICAgfSk7XG4gIH1cbiAgd2FybmluZyhjb250ZW50OiBzdHJpbmcpIHtcbiAgICB0aGlzLnNob3coe1xuICAgICAgdGltZU91dDogdGhpcy5kZWZhdWx0Q29uZmlnLnRpbWVPdXQsXG4gICAgICBjb2xvcjogJ3dhcm5pbmcnLFxuICAgICAgY29udGVudDogY29udGVudCxcbiAgICB9KTtcbiAgfVxuICBkYW5nZXIoY29udGVudDogc3RyaW5nKSB7XG4gICAgdGhpcy5zaG93KHtcbiAgICAgIHRpbWVPdXQ6IHRoaXMuZGVmYXVsdENvbmZpZy50aW1lT3V0LFxuICAgICAgY29sb3I6ICdkYW5nZXInLFxuICAgICAgY29udGVudDogY29udGVudCxcbiAgICB9KTtcbiAgfVxuXG4gIHNob3coY29uZmlnOiBBWFRvYXN0RGlzcGxheUNvbmZpZyk6IEFYVG9hc3RSZWYge1xuICAgIGNvbnN0IG9wdCA9IE9iamVjdC5hc3NpZ24oXG4gICAgICB7XG4gICAgICAgIGNsb3NlQn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3MpLmNlbnRlckhvcml6b250YWxseSgpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ3RvcC1lbmQnOlxuICAgICAgICByZXR1cm4gcG9zaXRpb25TdHJhdGVneS50b3AocG9zKS5yaWdodChnYXAgKyAncHgnKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICd0b3Atc3RhcnQnOlxuICAgICAgICByZXR1cm4gcG9zaXRpb25TdHJhdGVneS50b3AocG9zKS5sZWZ0KGdhcCArICdweCcpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ2NlbnRlci1zdGFydCc6XG4gICAgICAgIHJldHVybiBwb3NpdGlvblN0cmF0ZWd5LmNlbnRlclZlcnRpY2FsbHkoKS5sZWZ0KGdhcCArICdweCcpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ2NlbnRlci1lbmQnOlxuICAgICAgICByZXR1cm4gcG9zaXRpb25TdHJhdGVneS5jZW50ZXJWZXJ0aWNhbGx5KCkucmlnaHQoZ2FwICsgJ3B4Jyk7XG4gICAgICAgIGJyZWFrO1xuICAgIH1cbiAgfVxufVxuIl19
@@ -274,7 +274,13 @@ const AX_PLACEMENT_MAP = {
274
274
  },
275
275
  'bottom-start': {
276
276
  origin: AX_PLACEMENT_BOTTOM_START,
277
- alts: [AX_PLACEMENT_BOTTOM_END, AX_PLACEMENT_TOP_START, AX_PLACEMENT_TOP_END],
277
+ alts: [
278
+ AX_PLACEMENT_BOTTOM_END,
279
+ AX_PLACEMENT_TOP_START,
280
+ AX_PLACEMENT_TOP_END,
281
+ AX_PLACEMENT_START,
282
+ AX_PLACEMENT_END,
283
+ ],
278
284
  },
279
285
  'bottom-end': {
280
286
  origin: AX_PLACEMENT_BOTTOM_END,