@acorex-platform/module-communication-management-client 0.0.21
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/acorex-platform-module-communication-management-client-acorex-platform-module-communication-management-client-09UhY2Rc.mjs +2375 -0
- package/fesm2022/acorex-platform-module-communication-management-client-acorex-platform-module-communication-management-client-09UhY2Rc.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-communication-management-client-communication-email-send.command-wuqLiY8s.mjs +69 -0
- package/fesm2022/acorex-platform-module-communication-management-client-communication-email-send.command-wuqLiY8s.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-communication-management-client-communication-email-show-dialog.command-CP0zAEe4.mjs +285 -0
- package/fesm2022/acorex-platform-module-communication-management-client-communication-email-show-dialog.command-CP0zAEe4.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-communication-management-client-communication-in-app-inbox-page.component-b7ZqkMTt.mjs +514 -0
- package/fesm2022/acorex-platform-module-communication-management-client-communication-in-app-inbox-page.component-b7ZqkMTt.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-communication-management-client-communication-send.command-D7_MmGQe.mjs +85 -0
- package/fesm2022/acorex-platform-module-communication-management-client-communication-send.command-D7_MmGQe.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-communication-management-client-communication-show-sent-message.command-D8125Jxi.mjs +111 -0
- package/fesm2022/acorex-platform-module-communication-management-client-communication-show-sent-message.command-D8125Jxi.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-communication-management-client-communication-test-smtp.command-BySmN1Lz.mjs +155 -0
- package/fesm2022/acorex-platform-module-communication-management-client-communication-test-smtp.command-BySmN1Lz.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-communication-management-client-contracts.mjs +278 -0
- package/fesm2022/acorex-platform-module-communication-management-client-contracts.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-communication-management-client.mjs +2 -0
- package/fesm2022/acorex-platform-module-communication-management-client.mjs.map +1 -0
- package/package.json +28 -0
- package/types/acorex-platform-module-communication-management-client-contracts.d.ts +330 -0
- package/types/acorex-platform-module-communication-management-client.d.ts +360 -0
|
@@ -0,0 +1,514 @@
|
|
|
1
|
+
import * as i1$1 from '@acorex/components/button';
|
|
2
|
+
import { AXButtonModule } from '@acorex/components/button';
|
|
3
|
+
import * as i5 from '@acorex/components/check-box';
|
|
4
|
+
import { AXCheckBoxModule } from '@acorex/components/check-box';
|
|
5
|
+
import * as i8 from '@acorex/components/data-pager';
|
|
6
|
+
import { AXDataPagerModule } from '@acorex/components/data-pager';
|
|
7
|
+
import * as i3 from '@acorex/components/decorators';
|
|
8
|
+
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
9
|
+
import * as i6 from '@acorex/components/label';
|
|
10
|
+
import { AXLabelModule } from '@acorex/components/label';
|
|
11
|
+
import { AXContextMenuComponent } from '@acorex/components/menu';
|
|
12
|
+
import * as i4 from '@acorex/components/skeleton';
|
|
13
|
+
import { AXSkeletonModule } from '@acorex/components/skeleton';
|
|
14
|
+
import * as i7 from '@acorex/components/sliding-item';
|
|
15
|
+
import { AXSlidingItemModule } from '@acorex/components/sliding-item';
|
|
16
|
+
import * as i4$1 from '@acorex/core/translation';
|
|
17
|
+
import { AXTranslationModule } from '@acorex/core/translation';
|
|
18
|
+
import { AXPDeviceService } from '@acorex-platform/framework-client/core';
|
|
19
|
+
import { AXPThemeLayoutBlockComponent, AXPStateMessageComponent, AXPQueryFiltersComponent } from '@acorex-platform/framework-client/layout/components';
|
|
20
|
+
import { AXPPageLayoutBaseComponent, AXPPageLayoutComponent, AXPPageLayoutBase } from '@acorex-platform/framework-client/layout/views';
|
|
21
|
+
import { AXP_QUERY_QUICK_SEARCH_FIELD } from '@acorex-platform/framework-shared/core';
|
|
22
|
+
import * as i1 from '@angular/common';
|
|
23
|
+
import { CommonModule } from '@angular/common';
|
|
24
|
+
import * as i0 from '@angular/core';
|
|
25
|
+
import { inject, computed, signal, viewChild, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
26
|
+
import { A as AXPInAppInboxConnectorService, a as AXPInAppInboxActionService, b as AXP_IN_APP_INBOX_I18N, c as AXPInAppInboxItemComponent } from './acorex-platform-module-communication-management-client-acorex-platform-module-communication-management-client-09UhY2Rc.mjs';
|
|
27
|
+
|
|
28
|
+
//#region ---- Communication in-app inbox page ----
|
|
29
|
+
class AXMCommunicationInAppInboxPageComponent extends AXPPageLayoutBaseComponent {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
this.connector = inject(AXPInAppInboxConnectorService);
|
|
33
|
+
this.inboxActions = inject(AXPInAppInboxActionService);
|
|
34
|
+
this.i18n = inject(AXP_IN_APP_INBOX_I18N);
|
|
35
|
+
this.deviceService = inject(AXPDeviceService);
|
|
36
|
+
this.pageLoading = this.connector.pageLoadingState;
|
|
37
|
+
this.pageItems = this.connector.pagedInboxList;
|
|
38
|
+
this.pageTotal = this.connector.pagedTotal;
|
|
39
|
+
this.unreadCount = this.connector.unreadCount;
|
|
40
|
+
this.totalCount = this.connector.total;
|
|
41
|
+
this.showPin = computed(() => this.connector.capabilities.pinSupport, /* @ts-ignore */
|
|
42
|
+
...(ngDevMode ? [{ debugName: "showPin" }] : /* istanbul ignore next */ []));
|
|
43
|
+
this.filterDefinitions = signal([], /* @ts-ignore */
|
|
44
|
+
...(ngDevMode ? [{ debugName: "filterDefinitions" }] : /* istanbul ignore next */ []));
|
|
45
|
+
this.panelInitialFilters = signal([], /* @ts-ignore */
|
|
46
|
+
...(ngDevMode ? [{ debugName: "panelInitialFilters" }] : /* istanbul ignore next */ []));
|
|
47
|
+
this.queryFiltersKey = signal(0, /* @ts-ignore */
|
|
48
|
+
...(ngDevMode ? [{ debugName: "queryFiltersKey" }] : /* istanbul ignore next */ []));
|
|
49
|
+
this.activeFilters = signal([], /* @ts-ignore */
|
|
50
|
+
...(ngDevMode ? [{ debugName: "activeFilters" }] : /* istanbul ignore next */ []));
|
|
51
|
+
this.pageIndex = signal(0, /* @ts-ignore */
|
|
52
|
+
...(ngDevMode ? [{ debugName: "pageIndex" }] : /* istanbul ignore next */ []));
|
|
53
|
+
this.pageSize = signal(AXMCommunicationInAppInboxPageComponent.DEFAULT_PAGE_SIZE, /* @ts-ignore */
|
|
54
|
+
...(ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []));
|
|
55
|
+
this.isEditing = signal(false, /* @ts-ignore */
|
|
56
|
+
...(ngDevMode ? [{ debugName: "isEditing" }] : /* istanbul ignore next */ []));
|
|
57
|
+
this.contextMenu = viewChild('contextMenu', /* @ts-ignore */
|
|
58
|
+
...(ngDevMode ? [{ debugName: "contextMenu" }] : /* istanbul ignore next */ []));
|
|
59
|
+
this.contextItem = signal(null, /* @ts-ignore */
|
|
60
|
+
...(ngDevMode ? [{ debugName: "contextItem" }] : /* istanbul ignore next */ []));
|
|
61
|
+
this.selectedIds = signal(new Set(), /* @ts-ignore */
|
|
62
|
+
...(ngDevMode ? [{ debugName: "selectedIds" }] : /* istanbul ignore next */ []));
|
|
63
|
+
this.selectedCount = computed(() => this.selectedIds().size, /* @ts-ignore */
|
|
64
|
+
...(ngDevMode ? [{ debugName: "selectedCount" }] : /* istanbul ignore next */ []));
|
|
65
|
+
this.pagerDisplayMode = computed(() => (this.deviceService.isSmall() ? 'compact' : 'full'), /* @ts-ignore */
|
|
66
|
+
...(ngDevMode ? [{ debugName: "pagerDisplayMode" }] : /* istanbul ignore next */ []));
|
|
67
|
+
this.skeletonPlaceholders = computed(() => Array.from({ length: Math.max(this.pageSize(), 1) }, (_, index) => index), /* @ts-ignore */
|
|
68
|
+
...(ngDevMode ? [{ debugName: "skeletonPlaceholders" }] : /* istanbul ignore next */ []));
|
|
69
|
+
this.hasActiveFilters = computed(() => this.activeFilters().some((filter) => {
|
|
70
|
+
if (filter.field === 'readStatus' && (!filter.value || filter.value === 'all')) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
return filter.value != null && String(filter.value).trim() !== '';
|
|
74
|
+
}), /* @ts-ignore */
|
|
75
|
+
...(ngDevMode ? [{ debugName: "hasActiveFilters" }] : /* istanbul ignore next */ []));
|
|
76
|
+
this.searchText = computed(() => {
|
|
77
|
+
const searchFilter = this.activeFilters().find((f) => f.field === 'all' || f.field === AXP_QUERY_QUICK_SEARCH_FIELD);
|
|
78
|
+
return searchFilter?.value != null ? String(searchFilter.value).trim().toLowerCase() : '';
|
|
79
|
+
}, /* @ts-ignore */
|
|
80
|
+
...(ngDevMode ? [{ debugName: "searchText" }] : /* istanbul ignore next */ []));
|
|
81
|
+
this.isUnreadFilterActive = computed(() => {
|
|
82
|
+
const readFilter = this.activeFilters().find((f) => f.field === 'readStatus');
|
|
83
|
+
return readFilter?.value === 'unread';
|
|
84
|
+
}, /* @ts-ignore */
|
|
85
|
+
...(ngDevMode ? [{ debugName: "isUnreadFilterActive" }] : /* istanbul ignore next */ []));
|
|
86
|
+
this.highlightUnreadBackground = computed(() => !this.isUnreadFilterActive(), /* @ts-ignore */
|
|
87
|
+
...(ngDevMode ? [{ debugName: "highlightUnreadBackground" }] : /* istanbul ignore next */ []));
|
|
88
|
+
}
|
|
89
|
+
static { this.DEFAULT_PAGE_SIZE = 10; }
|
|
90
|
+
async ngOnInit() {
|
|
91
|
+
super.ngOnInit();
|
|
92
|
+
await this.loadFilterDefinitions();
|
|
93
|
+
await this.connector.ensureReady();
|
|
94
|
+
await this.loadPage();
|
|
95
|
+
await this.connector.markUnseenAsSeen();
|
|
96
|
+
}
|
|
97
|
+
async getPageTitle() {
|
|
98
|
+
return this.translateService.translateAsync(this.i18n.pageTitle);
|
|
99
|
+
}
|
|
100
|
+
async getPageDescription() {
|
|
101
|
+
const unread = this.unreadCount();
|
|
102
|
+
const total = this.totalCount();
|
|
103
|
+
if (!total) {
|
|
104
|
+
return this.translateService.translateAsync(this.i18n.pageDescriptionNone);
|
|
105
|
+
}
|
|
106
|
+
if (unread > 0) {
|
|
107
|
+
return this.translateService.translateAsync(this.i18n.pageDescriptionUnread, {
|
|
108
|
+
params: { unread, total },
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return this.translateService.translateAsync(this.i18n.pageDescriptionAllRead, { params: { total } });
|
|
112
|
+
}
|
|
113
|
+
async getPrimaryMenuItems() {
|
|
114
|
+
if (this.selectedCount() === 0) {
|
|
115
|
+
return [];
|
|
116
|
+
}
|
|
117
|
+
return [
|
|
118
|
+
{
|
|
119
|
+
title: await this.translateService.translateAsync(this.i18n.delete),
|
|
120
|
+
icon: 'fa-light fa-trash',
|
|
121
|
+
command: { name: 'delete-selected' },
|
|
122
|
+
color: 'danger',
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
title: await this.translateService.translateAsync(this.i18n.archive),
|
|
126
|
+
icon: 'fa-light fa-box-archive',
|
|
127
|
+
command: { name: 'archive-selected' },
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
title: await this.translateService.translateAsync(this.i18n.markAsRead),
|
|
131
|
+
icon: 'fa-light fa-envelopes-bulk',
|
|
132
|
+
command: { name: 'mark-selected-as-read' },
|
|
133
|
+
color: 'primary',
|
|
134
|
+
},
|
|
135
|
+
];
|
|
136
|
+
}
|
|
137
|
+
async getSecondaryMenuItems() {
|
|
138
|
+
if (this.selectedCount() > 0) {
|
|
139
|
+
return [];
|
|
140
|
+
}
|
|
141
|
+
return [
|
|
142
|
+
{
|
|
143
|
+
title: await this.translateService.translateAsync(this.i18n.refresh),
|
|
144
|
+
icon: 'fa-light fa-rotate',
|
|
145
|
+
command: { name: 'refresh' },
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
title: await this.translateService.translateAsync(this.i18n.markAllAsRead),
|
|
149
|
+
icon: 'fa-light fa-envelopes-bulk',
|
|
150
|
+
command: { name: 'mark-all-read' },
|
|
151
|
+
disabled: this.unreadCount() === 0,
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
title: await this.translateService.translateAsync(this.i18n.selectItems),
|
|
155
|
+
icon: 'fa-light fa-pen',
|
|
156
|
+
command: { name: 'edit-mode' },
|
|
157
|
+
color: 'primary',
|
|
158
|
+
},
|
|
159
|
+
];
|
|
160
|
+
}
|
|
161
|
+
async execute(command) {
|
|
162
|
+
switch (command.name) {
|
|
163
|
+
case 'refresh':
|
|
164
|
+
await this.onRefresh();
|
|
165
|
+
this.exitEditModeIfNeeded();
|
|
166
|
+
break;
|
|
167
|
+
case 'delete-selected':
|
|
168
|
+
await this.deleteSelected();
|
|
169
|
+
this.exitEditModeIfNeeded();
|
|
170
|
+
break;
|
|
171
|
+
case 'archive-selected':
|
|
172
|
+
await this.archiveSelected();
|
|
173
|
+
this.exitEditModeIfNeeded();
|
|
174
|
+
break;
|
|
175
|
+
case 'mark-selected-as-read':
|
|
176
|
+
await this.markSelectedAsRead();
|
|
177
|
+
this.exitEditModeIfNeeded();
|
|
178
|
+
break;
|
|
179
|
+
case 'mark-all-read':
|
|
180
|
+
await this.onMarkAllAsRead();
|
|
181
|
+
this.exitEditModeIfNeeded();
|
|
182
|
+
break;
|
|
183
|
+
case 'edit-mode':
|
|
184
|
+
if (this.isEditing()) {
|
|
185
|
+
this.deselectAll();
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
this.isEditing.set(true);
|
|
189
|
+
}
|
|
190
|
+
this.recompute();
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
handleFiltersChanged(filters) {
|
|
195
|
+
this.activeFilters.set(filters);
|
|
196
|
+
this.pageIndex.set(0);
|
|
197
|
+
void this.loadPage();
|
|
198
|
+
}
|
|
199
|
+
clearFilters() {
|
|
200
|
+
this.activeFilters.set([]);
|
|
201
|
+
this.panelInitialFilters.set([]);
|
|
202
|
+
this.pageIndex.set(0);
|
|
203
|
+
this.queryFiltersKey.update((key) => key + 1);
|
|
204
|
+
void this.loadPage();
|
|
205
|
+
}
|
|
206
|
+
onPageChanged(event) {
|
|
207
|
+
if (!event.isUserInteraction) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
const nextIndex = Math.floor(event.skip / event.take);
|
|
211
|
+
if (nextIndex === this.pageIndex() && event.take === this.pageSize()) {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
this.pageSize.set(event.take);
|
|
215
|
+
this.pageIndex.set(nextIndex);
|
|
216
|
+
void this.loadPage();
|
|
217
|
+
}
|
|
218
|
+
async onItemPress(id) {
|
|
219
|
+
if (this.isEditing()) {
|
|
220
|
+
this.toggleSelectionById(id);
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
if (this.selectedCount() > 0) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
await this.inboxActions.openItem(id);
|
|
227
|
+
}
|
|
228
|
+
async onTogglePin(id) {
|
|
229
|
+
await this.connector.togglePin(id);
|
|
230
|
+
}
|
|
231
|
+
async onDismissUnread(id) {
|
|
232
|
+
await this.connector.markAsRead([id]);
|
|
233
|
+
this.recompute();
|
|
234
|
+
}
|
|
235
|
+
isSelected(id) {
|
|
236
|
+
return this.selectedIds().has(id);
|
|
237
|
+
}
|
|
238
|
+
toggleSelectionWithModel(id, event) {
|
|
239
|
+
const checked = Boolean(event.value);
|
|
240
|
+
const next = new Set(this.selectedIds());
|
|
241
|
+
if (checked) {
|
|
242
|
+
next.add(id);
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
next.delete(id);
|
|
246
|
+
}
|
|
247
|
+
this.selectedIds.set(next);
|
|
248
|
+
this.recompute();
|
|
249
|
+
}
|
|
250
|
+
deselectAll() {
|
|
251
|
+
if (this.selectedCount() > 0) {
|
|
252
|
+
this.selectedIds.set(new Set());
|
|
253
|
+
}
|
|
254
|
+
if (this.isEditing()) {
|
|
255
|
+
this.isEditing.set(false);
|
|
256
|
+
}
|
|
257
|
+
this.recompute();
|
|
258
|
+
}
|
|
259
|
+
slidingItemsHandler(item, action) {
|
|
260
|
+
switch (action) {
|
|
261
|
+
case 'mark-as-read':
|
|
262
|
+
void this.markSelectedAsRead(item);
|
|
263
|
+
break;
|
|
264
|
+
case 'delete':
|
|
265
|
+
void this.deleteSelected(item);
|
|
266
|
+
break;
|
|
267
|
+
case 'archive':
|
|
268
|
+
void this.archiveSelected(item);
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
openContextMenu(event, item) {
|
|
273
|
+
if (this.isEditing() || this.selectedCount() > 0) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
event.preventDefault();
|
|
277
|
+
this.contextItem.set(item);
|
|
278
|
+
this.contextMenu()?.showAt({ x: event.clientX, y: event.clientY });
|
|
279
|
+
}
|
|
280
|
+
async handleContextMenuOpening(event) {
|
|
281
|
+
const item = this.contextItem();
|
|
282
|
+
const isPinned = item?.isPinned ?? false;
|
|
283
|
+
event.items = [
|
|
284
|
+
{
|
|
285
|
+
name: isPinned ? 'unpin' : 'pin',
|
|
286
|
+
text: await this.translateService.translateAsync(isPinned ? this.i18n.unpin : this.i18n.pin),
|
|
287
|
+
icon: isPinned ? 'fa-light fa-thumbtack-slash' : 'fa-light fa-thumbtack',
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
name: 'mark-as-read',
|
|
291
|
+
text: await this.translateService.translateAsync(this.i18n.markAsRead),
|
|
292
|
+
icon: 'fa-light fa-envelopes-bulk',
|
|
293
|
+
color: 'primary',
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
name: 'archive',
|
|
297
|
+
text: await this.translateService.translateAsync(this.i18n.archive),
|
|
298
|
+
icon: 'fa-light fa-box-archive',
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
name: 'delete',
|
|
302
|
+
text: await this.translateService.translateAsync(this.i18n.delete),
|
|
303
|
+
icon: 'fa-light fa-trash-can',
|
|
304
|
+
color: 'danger',
|
|
305
|
+
},
|
|
306
|
+
];
|
|
307
|
+
}
|
|
308
|
+
handleContextMenuItemClick(event) {
|
|
309
|
+
const item = this.contextItem();
|
|
310
|
+
if (!item) {
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
switch (event.item.name) {
|
|
314
|
+
case 'mark-as-read':
|
|
315
|
+
void this.markSelectedAsRead(item);
|
|
316
|
+
break;
|
|
317
|
+
case 'pin':
|
|
318
|
+
case 'unpin':
|
|
319
|
+
void this.onTogglePin(item.id);
|
|
320
|
+
break;
|
|
321
|
+
case 'archive':
|
|
322
|
+
void this.archiveSelected(item);
|
|
323
|
+
break;
|
|
324
|
+
case 'delete':
|
|
325
|
+
void this.deleteSelected(item);
|
|
326
|
+
break;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
getEmptyIcon() {
|
|
330
|
+
if (this.searchText()) {
|
|
331
|
+
return 'fa-solid fa-magnifying-glass';
|
|
332
|
+
}
|
|
333
|
+
if (this.isUnreadFilterActive()) {
|
|
334
|
+
return 'fa-solid fa-check-circle';
|
|
335
|
+
}
|
|
336
|
+
return 'fa-solid fa-bell';
|
|
337
|
+
}
|
|
338
|
+
getEmptyTitle() {
|
|
339
|
+
if (this.hasActiveFilters()) {
|
|
340
|
+
return '@communication-management:in-app.state.no-results.title';
|
|
341
|
+
}
|
|
342
|
+
if (this.isUnreadFilterActive()) {
|
|
343
|
+
return '@communication-management:in-app.state.all-caught-up.title';
|
|
344
|
+
}
|
|
345
|
+
return this.i18n.emptyTitle;
|
|
346
|
+
}
|
|
347
|
+
getEmptyDescription() {
|
|
348
|
+
if (this.hasActiveFilters()) {
|
|
349
|
+
return '@communication-management:in-app.state.no-results.description';
|
|
350
|
+
}
|
|
351
|
+
if (this.isUnreadFilterActive()) {
|
|
352
|
+
return '@communication-management:in-app.state.all-caught-up.description';
|
|
353
|
+
}
|
|
354
|
+
return this.i18n.emptyDescription;
|
|
355
|
+
}
|
|
356
|
+
async onRefresh() {
|
|
357
|
+
await this.connector.refresh();
|
|
358
|
+
await this.loadPage();
|
|
359
|
+
}
|
|
360
|
+
async onMarkAllAsRead() {
|
|
361
|
+
await this.connector.markAllAsRead();
|
|
362
|
+
}
|
|
363
|
+
async markSelectedAsRead(item) {
|
|
364
|
+
const ids = item ? [item.id] : Array.from(this.selectedIds());
|
|
365
|
+
if (ids.length === 0) {
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
await this.connector.markAsRead(ids);
|
|
369
|
+
this.selectedIds.set(new Set());
|
|
370
|
+
this.recompute();
|
|
371
|
+
}
|
|
372
|
+
async deleteSelected(item) {
|
|
373
|
+
const ids = item ? [item.id] : Array.from(this.selectedIds());
|
|
374
|
+
for (const id of ids) {
|
|
375
|
+
await this.connector.deleteOne(id);
|
|
376
|
+
}
|
|
377
|
+
this.selectedIds.set(new Set());
|
|
378
|
+
this.recompute();
|
|
379
|
+
}
|
|
380
|
+
async archiveSelected(item) {
|
|
381
|
+
const ids = item ? [item.id] : Array.from(this.selectedIds());
|
|
382
|
+
if (ids.length === 0) {
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
await this.connector.archive(ids);
|
|
386
|
+
this.selectedIds.set(new Set());
|
|
387
|
+
this.recompute();
|
|
388
|
+
}
|
|
389
|
+
toggleSelectionById(id) {
|
|
390
|
+
const next = new Set(this.selectedIds());
|
|
391
|
+
if (next.has(id)) {
|
|
392
|
+
next.delete(id);
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
next.add(id);
|
|
396
|
+
}
|
|
397
|
+
this.selectedIds.set(next);
|
|
398
|
+
this.recompute();
|
|
399
|
+
}
|
|
400
|
+
exitEditModeIfNeeded() {
|
|
401
|
+
if (this.isEditing()) {
|
|
402
|
+
this.isEditing.set(false);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
async loadPage() {
|
|
406
|
+
await this.connector.loadPage(this.activeFilters(), this.pageIndex() * this.pageSize(), this.pageSize());
|
|
407
|
+
}
|
|
408
|
+
async loadFilterDefinitions() {
|
|
409
|
+
const [allLabel, unreadLabel, inboxLabel, archiveLabel, warningLabel, dangerLabel, noticeLabel] = await Promise.all([
|
|
410
|
+
this.translateService.translateAsync(this.i18n.all),
|
|
411
|
+
this.translateService.translateAsync(this.i18n.unread),
|
|
412
|
+
this.translateService.translateAsync('@communication-management:in-app.filters.category.options.inbox'),
|
|
413
|
+
this.translateService.translateAsync('@communication-management:in-app.filters.category.options.archive'),
|
|
414
|
+
this.translateService.translateAsync('@communication-management:in-app.filters.priority.options.warning'),
|
|
415
|
+
this.translateService.translateAsync('@communication-management:in-app.filters.priority.options.danger'),
|
|
416
|
+
this.translateService.translateAsync('@communication-management:in-app.filters.priority.options.notice'),
|
|
417
|
+
]);
|
|
418
|
+
this.filterDefinitions.set([
|
|
419
|
+
{
|
|
420
|
+
field: 'all',
|
|
421
|
+
title: '@communication-management:in-app.filters.search.title',
|
|
422
|
+
icon: 'fa-light fa-magnifying-glass',
|
|
423
|
+
widget: { type: 'string-filter' },
|
|
424
|
+
filterType: { inline: true, advance: false },
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
field: 'readStatus',
|
|
428
|
+
operator: { type: 'equal' },
|
|
429
|
+
title: '@communication-management:in-app.filters.read-status.title',
|
|
430
|
+
icon: 'fa-light fa-envelope-open-text',
|
|
431
|
+
widget: {
|
|
432
|
+
type: 'select-filter',
|
|
433
|
+
options: {
|
|
434
|
+
dataSource: [
|
|
435
|
+
{ id: 'all', title: allLabel },
|
|
436
|
+
{ id: 'unread', title: unreadLabel },
|
|
437
|
+
],
|
|
438
|
+
valueField: 'id',
|
|
439
|
+
textField: 'title',
|
|
440
|
+
allowClear: true,
|
|
441
|
+
},
|
|
442
|
+
},
|
|
443
|
+
filterType: { advance: true, inline: false },
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
field: 'priority',
|
|
447
|
+
operator: { type: 'equal' },
|
|
448
|
+
title: '@communication-management:in-app.filters.priority.title',
|
|
449
|
+
icon: 'fa-light fa-flag',
|
|
450
|
+
widget: {
|
|
451
|
+
type: 'select-filter',
|
|
452
|
+
options: {
|
|
453
|
+
dataSource: [
|
|
454
|
+
{ id: 'Warning', title: warningLabel },
|
|
455
|
+
{ id: 'Danger', title: dangerLabel },
|
|
456
|
+
{ id: 'Notice', title: noticeLabel },
|
|
457
|
+
],
|
|
458
|
+
valueField: 'id',
|
|
459
|
+
textField: 'title',
|
|
460
|
+
allowClear: true,
|
|
461
|
+
},
|
|
462
|
+
},
|
|
463
|
+
filterType: { advance: true, inline: false },
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
field: 'category',
|
|
467
|
+
operator: { type: 'equal' },
|
|
468
|
+
title: '@communication-management:in-app.filters.category.title',
|
|
469
|
+
icon: 'fa-light fa-inbox',
|
|
470
|
+
widget: {
|
|
471
|
+
type: 'select-filter',
|
|
472
|
+
options: {
|
|
473
|
+
dataSource: [
|
|
474
|
+
{ id: 'Inbox', title: inboxLabel },
|
|
475
|
+
{ id: 'Archive', title: archiveLabel },
|
|
476
|
+
],
|
|
477
|
+
valueField: 'id',
|
|
478
|
+
textField: 'title',
|
|
479
|
+
allowClear: true,
|
|
480
|
+
},
|
|
481
|
+
},
|
|
482
|
+
filterType: { advance: true, inline: false },
|
|
483
|
+
},
|
|
484
|
+
]);
|
|
485
|
+
}
|
|
486
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMCommunicationInAppInboxPageComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
487
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMCommunicationInAppInboxPageComponent, isStandalone: true, selector: "axm-communication-in-app-inbox-page", host: { listeners: { "document:keydown.escape": "deselectAll()" }, classAttribute: "axm-communication-in-app-inbox-page" }, providers: [{ provide: AXPPageLayoutBase, useExisting: AXMCommunicationInAppInboxPageComponent }], viewQueries: [{ propertyName: "contextMenu", first: true, predicate: ["contextMenu"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<axp-page-layout>\n <axp-page-toolbar>\n <div class=\"w-full flex items-center\">\n <axp-layout-prefix class=\"w-full\">\n @if (selectedCount() > 0 || isEditing()) {\n <!-- ----- Bulk selection bar ----- -->\n <div class=\"axm-communication-in-app-inbox-page__selection-bar\">\n <span class=\"axm-communication-in-app-inbox-page__selection-count\">\n {{ selectedCount() }} {{ '@general:terms.items-selected' | translate | async }}\n </span>\n <button type=\"button\" class=\"axm-communication-in-app-inbox-page__unselect\" (click)=\"deselectAll()\">\n {{ '@general:actions.unselect.title' | translate | async }}\n </button>\n </div>\n } @else {\n @for (_k of [queryFiltersKey()]; track _k) {\n <axp-query-filters\n [filtersDefinitions]=\"filterDefinitions()\"\n [initialFilters]=\"panelInitialFilters()\"\n [quickSearch]=\"true\"\n (onFiltersChanged)=\"handleFiltersChanged($event)\"\n />\n }\n }\n </axp-layout-prefix>\n </div>\n </axp-page-toolbar>\n\n <axp-page-content class=\"axm-communication-in-app-inbox-page__content\">\n <div class=\"axm-communication-in-app-inbox-page__panel\">\n @if (pageLoading()) {\n <!-- ----- Loading skeleton list ----- -->\n <div class=\"axm-communication-in-app-inbox-page__list axm-communication-in-app-inbox-page__list--loading\">\n @for (_ of skeletonPlaceholders(); track $index) {\n <div class=\"axm-communication-in-app-inbox-page__skeleton\">\n <ax-skeleton [animated]=\"true\" class=\"axm-communication-in-app-inbox-page__skeleton-avatar\"></ax-skeleton>\n <div class=\"axm-communication-in-app-inbox-page__skeleton-body\">\n <ax-skeleton [animated]=\"true\" class=\"axm-communication-in-app-inbox-page__skeleton-line --wide\"></ax-skeleton>\n <ax-skeleton [animated]=\"true\" class=\"axm-communication-in-app-inbox-page__skeleton-line\"></ax-skeleton>\n </div>\n </div>\n }\n </div>\n } @else if (pageTotal() === 0) {\n <axp-state-message\n mode=\"empty\"\n [icon]=\"getEmptyIcon()\"\n [title]=\"getEmptyTitle()\"\n [description]=\"getEmptyDescription()\"\n >\n @if (hasActiveFilters()) {\n <ax-button\n slot=\"actions\"\n look=\"outline\"\n [text]=\"((i18n.clearFilters | translate | async) ?? '')\"\n (onClick)=\"clearFilters()\"\n />\n }\n </axp-state-message>\n } @else {\n <div class=\"axm-communication-in-app-inbox-page__list\">\n @for (item of pageItems(); track item.id) {\n @if (deviceService.isMobileDevice()) {\n <ng-container [ngTemplateOutlet]=\"mobile\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n } @else {\n <ng-container [ngTemplateOutlet]=\"desktop\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n }\n }\n </div>\n }\n </div>\n </axp-page-content>\n\n @if (!pageLoading() && pageTotal() > 0) {\n <!-- ----- Pagination pinned to page footer ----- -->\n <axp-page-footer\n class=\"axm-communication-in-app-inbox-page__footer\"\n [class.axm-communication-in-app-inbox-page__footer--compact]=\"deviceService.isSmall()\"\n >\n <ax-data-pager\n [displayMode]=\"pagerDisplayMode()\"\n [total]=\"pageTotal()\"\n [size]=\"pageSize()\"\n [value]=\"pageIndex() + 1\"\n (onChanged)=\"onPageChanged($event)\"\n />\n </axp-page-footer>\n }\n</axp-page-layout>\n\n<ng-template #mobile let-item>\n <ax-sliding-item class=\"axm-communication-in-app-inbox-page__sliding-item\">\n <ax-content class=\"p-0!\">\n <div\n class=\"axm-communication-in-app-inbox-page__row\"\n [class.--selected]=\"isSelected(item.id)\"\n (contextmenu)=\"openContextMenu($event, item)\"\n >\n @if (isEditing()) {\n <ax-check-box\n class=\"axm-communication-in-app-inbox-page__checkbox\"\n [value]=\"isSelected(item.id)\"\n (onValueChanged)=\"toggleSelectionWithModel(item.id, $event)\"\n >\n <ax-label></ax-label>\n </ax-check-box>\n }\n <axp-in-app-inbox-item\n class=\"flex-1 min-w-0\"\n [data]=\"item\"\n [highlightUnreadBackground]=\"highlightUnreadBackground()\"\n [showPin]=\"showPin()\"\n [pinLabelKey]=\"i18n.pin\"\n [unpinLabelKey]=\"i18n.unpin\"\n [markAsReadLabelKey]=\"i18n.markAsRead\"\n (itemPress)=\"onItemPress($event)\"\n (markAsRead)=\"onDismissUnread($event)\"\n (togglePin)=\"onTogglePin($event)\"\n />\n </div>\n </ax-content>\n\n <ax-sliding-item-suffix (onClick)=\"slidingItemsHandler(item, 'mark-as-read')\" color=\"primary\">\n <ax-icon class=\"fa-light fa-envelopes-bulk fa-xl\"></ax-icon>\n </ax-sliding-item-suffix>\n\n <ax-sliding-item-suffix (onClick)=\"slidingItemsHandler(item, 'archive')\" color=\"default\">\n <ax-icon class=\"fa-light fa-box-archive fa-xl\"></ax-icon>\n </ax-sliding-item-suffix>\n\n <ax-sliding-item-suffix (onClick)=\"slidingItemsHandler(item, 'delete')\" color=\"danger\">\n <ax-icon class=\"fa-light fa-trash-can fa-xl\"></ax-icon>\n </ax-sliding-item-suffix>\n </ax-sliding-item>\n</ng-template>\n\n<ng-template #desktop let-item>\n <div\n class=\"axm-communication-in-app-inbox-page__row\"\n [class.--selected]=\"isSelected(item.id)\"\n (contextmenu)=\"openContextMenu($event, item)\"\n >\n @if (isEditing()) {\n <ax-check-box\n class=\"axm-communication-in-app-inbox-page__checkbox\"\n [value]=\"isSelected(item.id)\"\n (onValueChanged)=\"toggleSelectionWithModel(item.id, $event)\"\n >\n <ax-label></ax-label>\n </ax-check-box>\n }\n <axp-in-app-inbox-item\n class=\"flex-1 min-w-0\"\n [data]=\"item\"\n [highlightUnreadBackground]=\"highlightUnreadBackground()\"\n [showPin]=\"showPin()\"\n [pinLabelKey]=\"i18n.pin\"\n [unpinLabelKey]=\"i18n.unpin\"\n [markAsReadLabelKey]=\"i18n.markAsRead\"\n (itemPress)=\"onItemPress($event)\"\n (markAsRead)=\"onDismissUnread($event)\"\n (togglePin)=\"onTogglePin($event)\"\n />\n </div>\n</ng-template>\n\n<ax-context-menu\n #contextMenu\n [openOn]=\"'click'\"\n [closeOn]=\"'click'\"\n [orientation]=\"'horizontal'\"\n (onOpening)=\"handleContextMenuOpening($event)\"\n (onItemClick)=\"handleContextMenuItemClick($event)\"\n/>\n", styles: ["@reference \"@acorex/styles/themes/default.css\";.axm-communication-in-app-inbox-page{@apply flex min-h-0 flex-1 flex-col;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__selection-bar{@apply flex h-10 w-full items-center gap-3;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__selection-count{@apply text-xl font-semibold;color:rgb(var(--ax-sys-color-on-surface))}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__unselect{@apply cursor-pointer border-0 bg-transparent p-0 text-sm underline;color:rgb(var(--ax-sys-color-on-surface-variant))}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__content,.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__panel{@apply flex min-h-0 flex-1 flex-col overflow-hidden;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__list{@apply min-h-0 flex-1 overflow-auto rounded-lg border;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__list--loading{@apply space-y-0 p-2;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__row{@apply flex max-w-full items-center gap-3 border-b transition-colors;border-color:rgb(var(--ax-sys-color-border-lightest-surface))}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__row:last-child{@apply border-b-0;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__row:hover{background:rgb(var(--ax-sys-color-lightest-surface))}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__row.--selected{background:rgb(var(--ax-sys-color-lighter-surface))}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__checkbox{@apply shrink-0 ps-4;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__sliding-item{@apply max-h-24 overflow-hidden border-b;border-color:rgb(var(--ax-sys-color-border-lightest-surface))}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__sliding-item:last-child{@apply border-b-0;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__footer{@apply w-full;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__footer ax-data-pager{@apply w-full;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__footer--compact ::ng-deep ax-data-pager{@apply justify-center;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__footer--compact ::ng-deep ax-data-pager .compact-prefix{@apply flex w-full justify-center;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__footer--compact ::ng-deep ax-data-pager .compact-suffix{@apply hidden;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__skeleton{@apply flex gap-4 p-4;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__skeleton-avatar{@apply size-12 shrink-0 rounded-full;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__skeleton-body{@apply flex-1 space-y-2 py-1;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__skeleton-line{@apply h-3 rounded-md;background:rgb(var(--ax-sys-color-lighter-surface))}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__skeleton-line.--wide{@apply w-3/4;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__skeleton-line:not(.--wide){@apply w-1/2;}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXSkeletonModule }, { kind: "component", type: i4.AXSkeletonComponent, selector: "ax-skeleton", inputs: ["animated"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXCheckBoxModule }, { kind: "component", type: i5.AXCheckBoxComponent, selector: "ax-check-box", inputs: ["disabled", "tabIndex", "readonly", "color", "value", "name", "id", "isLoading", "indeterminate"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged"] }, { kind: "ngmodule", type: AXLabelModule }, { kind: "component", type: i6.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "ngmodule", type: AXSlidingItemModule }, { kind: "component", type: i7.AXSlidingItemComponent, selector: "ax-sliding-item" }, { kind: "component", type: i7.AXSlidingItemSuffixComponent, selector: "ax-sliding-item-suffix", inputs: ["color", "text"], outputs: ["onClick"] }, { kind: "ngmodule", type: AXDataPagerModule }, { kind: "component", type: i8.AXDataPagerComponent, selector: "ax-data-pager", inputs: ["value", "name", "disabled", "readonly", "isLoading", "size", "total", "displayMode"], outputs: ["valueChange", "onValueChanged", "disabledChange", "readonlyChange", "displayModeChange", "onChanged"] }, { kind: "component", type: AXContextMenuComponent, selector: "ax-context-menu", inputs: ["orientation", "openOn", "closeOn", "closeOnRouteChange", "items", "target"], outputs: ["onItemClick", "onOpening", "onClose"] }, { kind: "component", type: AXPPageLayoutComponent, selector: "axp-page-layout" }, { kind: "component", type: AXPThemeLayoutBlockComponent, selector: " axp-page-content, axp-page-footer-container, axp-page-footer, axp-page-header, axp-page-header-container, axp-page-toolbar, axp-layout-content, axp-layout-page-content, axp-layout-sections, axp-layout-body, axp-layout-page-body, axp-layout-prefix, axp-layout-suffix, axp-layout-title-bar, axp-layout-title, axp-layout-title-actions, axp-layout-nav-button, axp-layout-description, axp-layout-breadcrumbs, axp-layout-list-action, " }, { kind: "component", type: AXPStateMessageComponent, selector: "axp-state-message", inputs: ["mode", "icon", "title", "description", "titleParams", "descriptionParams", "look"] }, { kind: "component", type: AXPQueryFiltersComponent, selector: "axp-query-filters", inputs: ["filtersDefinitions", "initialFilters", "quickSearch"], outputs: ["onFiltersChanged"] }, { kind: "component", type: AXPInAppInboxItemComponent, selector: "axp-in-app-inbox-item", inputs: ["data", "showAvatar", "showDate", "showPin", "pinLabelKey", "unpinLabelKey", "highlightUnreadBackground", "showDismissUnread", "markAsReadLabelKey"], outputs: ["itemPress", "markAsRead", "togglePin", "closePopover"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4$1.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
488
|
+
}
|
|
489
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMCommunicationInAppInboxPageComponent, decorators: [{
|
|
490
|
+
type: Component,
|
|
491
|
+
args: [{ selector: 'axm-communication-in-app-inbox-page', changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: AXPPageLayoutBase, useExisting: AXMCommunicationInAppInboxPageComponent }], host: {
|
|
492
|
+
class: 'axm-communication-in-app-inbox-page',
|
|
493
|
+
'(document:keydown.escape)': 'deselectAll()',
|
|
494
|
+
}, imports: [
|
|
495
|
+
CommonModule,
|
|
496
|
+
AXButtonModule,
|
|
497
|
+
AXDecoratorModule,
|
|
498
|
+
AXSkeletonModule,
|
|
499
|
+
AXTranslationModule,
|
|
500
|
+
AXCheckBoxModule,
|
|
501
|
+
AXLabelModule,
|
|
502
|
+
AXSlidingItemModule,
|
|
503
|
+
AXDataPagerModule,
|
|
504
|
+
AXContextMenuComponent,
|
|
505
|
+
AXPPageLayoutComponent,
|
|
506
|
+
AXPThemeLayoutBlockComponent,
|
|
507
|
+
AXPStateMessageComponent,
|
|
508
|
+
AXPQueryFiltersComponent,
|
|
509
|
+
AXPInAppInboxItemComponent,
|
|
510
|
+
], template: "<axp-page-layout>\n <axp-page-toolbar>\n <div class=\"w-full flex items-center\">\n <axp-layout-prefix class=\"w-full\">\n @if (selectedCount() > 0 || isEditing()) {\n <!-- ----- Bulk selection bar ----- -->\n <div class=\"axm-communication-in-app-inbox-page__selection-bar\">\n <span class=\"axm-communication-in-app-inbox-page__selection-count\">\n {{ selectedCount() }} {{ '@general:terms.items-selected' | translate | async }}\n </span>\n <button type=\"button\" class=\"axm-communication-in-app-inbox-page__unselect\" (click)=\"deselectAll()\">\n {{ '@general:actions.unselect.title' | translate | async }}\n </button>\n </div>\n } @else {\n @for (_k of [queryFiltersKey()]; track _k) {\n <axp-query-filters\n [filtersDefinitions]=\"filterDefinitions()\"\n [initialFilters]=\"panelInitialFilters()\"\n [quickSearch]=\"true\"\n (onFiltersChanged)=\"handleFiltersChanged($event)\"\n />\n }\n }\n </axp-layout-prefix>\n </div>\n </axp-page-toolbar>\n\n <axp-page-content class=\"axm-communication-in-app-inbox-page__content\">\n <div class=\"axm-communication-in-app-inbox-page__panel\">\n @if (pageLoading()) {\n <!-- ----- Loading skeleton list ----- -->\n <div class=\"axm-communication-in-app-inbox-page__list axm-communication-in-app-inbox-page__list--loading\">\n @for (_ of skeletonPlaceholders(); track $index) {\n <div class=\"axm-communication-in-app-inbox-page__skeleton\">\n <ax-skeleton [animated]=\"true\" class=\"axm-communication-in-app-inbox-page__skeleton-avatar\"></ax-skeleton>\n <div class=\"axm-communication-in-app-inbox-page__skeleton-body\">\n <ax-skeleton [animated]=\"true\" class=\"axm-communication-in-app-inbox-page__skeleton-line --wide\"></ax-skeleton>\n <ax-skeleton [animated]=\"true\" class=\"axm-communication-in-app-inbox-page__skeleton-line\"></ax-skeleton>\n </div>\n </div>\n }\n </div>\n } @else if (pageTotal() === 0) {\n <axp-state-message\n mode=\"empty\"\n [icon]=\"getEmptyIcon()\"\n [title]=\"getEmptyTitle()\"\n [description]=\"getEmptyDescription()\"\n >\n @if (hasActiveFilters()) {\n <ax-button\n slot=\"actions\"\n look=\"outline\"\n [text]=\"((i18n.clearFilters | translate | async) ?? '')\"\n (onClick)=\"clearFilters()\"\n />\n }\n </axp-state-message>\n } @else {\n <div class=\"axm-communication-in-app-inbox-page__list\">\n @for (item of pageItems(); track item.id) {\n @if (deviceService.isMobileDevice()) {\n <ng-container [ngTemplateOutlet]=\"mobile\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n } @else {\n <ng-container [ngTemplateOutlet]=\"desktop\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n }\n }\n </div>\n }\n </div>\n </axp-page-content>\n\n @if (!pageLoading() && pageTotal() > 0) {\n <!-- ----- Pagination pinned to page footer ----- -->\n <axp-page-footer\n class=\"axm-communication-in-app-inbox-page__footer\"\n [class.axm-communication-in-app-inbox-page__footer--compact]=\"deviceService.isSmall()\"\n >\n <ax-data-pager\n [displayMode]=\"pagerDisplayMode()\"\n [total]=\"pageTotal()\"\n [size]=\"pageSize()\"\n [value]=\"pageIndex() + 1\"\n (onChanged)=\"onPageChanged($event)\"\n />\n </axp-page-footer>\n }\n</axp-page-layout>\n\n<ng-template #mobile let-item>\n <ax-sliding-item class=\"axm-communication-in-app-inbox-page__sliding-item\">\n <ax-content class=\"p-0!\">\n <div\n class=\"axm-communication-in-app-inbox-page__row\"\n [class.--selected]=\"isSelected(item.id)\"\n (contextmenu)=\"openContextMenu($event, item)\"\n >\n @if (isEditing()) {\n <ax-check-box\n class=\"axm-communication-in-app-inbox-page__checkbox\"\n [value]=\"isSelected(item.id)\"\n (onValueChanged)=\"toggleSelectionWithModel(item.id, $event)\"\n >\n <ax-label></ax-label>\n </ax-check-box>\n }\n <axp-in-app-inbox-item\n class=\"flex-1 min-w-0\"\n [data]=\"item\"\n [highlightUnreadBackground]=\"highlightUnreadBackground()\"\n [showPin]=\"showPin()\"\n [pinLabelKey]=\"i18n.pin\"\n [unpinLabelKey]=\"i18n.unpin\"\n [markAsReadLabelKey]=\"i18n.markAsRead\"\n (itemPress)=\"onItemPress($event)\"\n (markAsRead)=\"onDismissUnread($event)\"\n (togglePin)=\"onTogglePin($event)\"\n />\n </div>\n </ax-content>\n\n <ax-sliding-item-suffix (onClick)=\"slidingItemsHandler(item, 'mark-as-read')\" color=\"primary\">\n <ax-icon class=\"fa-light fa-envelopes-bulk fa-xl\"></ax-icon>\n </ax-sliding-item-suffix>\n\n <ax-sliding-item-suffix (onClick)=\"slidingItemsHandler(item, 'archive')\" color=\"default\">\n <ax-icon class=\"fa-light fa-box-archive fa-xl\"></ax-icon>\n </ax-sliding-item-suffix>\n\n <ax-sliding-item-suffix (onClick)=\"slidingItemsHandler(item, 'delete')\" color=\"danger\">\n <ax-icon class=\"fa-light fa-trash-can fa-xl\"></ax-icon>\n </ax-sliding-item-suffix>\n </ax-sliding-item>\n</ng-template>\n\n<ng-template #desktop let-item>\n <div\n class=\"axm-communication-in-app-inbox-page__row\"\n [class.--selected]=\"isSelected(item.id)\"\n (contextmenu)=\"openContextMenu($event, item)\"\n >\n @if (isEditing()) {\n <ax-check-box\n class=\"axm-communication-in-app-inbox-page__checkbox\"\n [value]=\"isSelected(item.id)\"\n (onValueChanged)=\"toggleSelectionWithModel(item.id, $event)\"\n >\n <ax-label></ax-label>\n </ax-check-box>\n }\n <axp-in-app-inbox-item\n class=\"flex-1 min-w-0\"\n [data]=\"item\"\n [highlightUnreadBackground]=\"highlightUnreadBackground()\"\n [showPin]=\"showPin()\"\n [pinLabelKey]=\"i18n.pin\"\n [unpinLabelKey]=\"i18n.unpin\"\n [markAsReadLabelKey]=\"i18n.markAsRead\"\n (itemPress)=\"onItemPress($event)\"\n (markAsRead)=\"onDismissUnread($event)\"\n (togglePin)=\"onTogglePin($event)\"\n />\n </div>\n</ng-template>\n\n<ax-context-menu\n #contextMenu\n [openOn]=\"'click'\"\n [closeOn]=\"'click'\"\n [orientation]=\"'horizontal'\"\n (onOpening)=\"handleContextMenuOpening($event)\"\n (onItemClick)=\"handleContextMenuItemClick($event)\"\n/>\n", styles: ["@reference \"@acorex/styles/themes/default.css\";.axm-communication-in-app-inbox-page{@apply flex min-h-0 flex-1 flex-col;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__selection-bar{@apply flex h-10 w-full items-center gap-3;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__selection-count{@apply text-xl font-semibold;color:rgb(var(--ax-sys-color-on-surface))}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__unselect{@apply cursor-pointer border-0 bg-transparent p-0 text-sm underline;color:rgb(var(--ax-sys-color-on-surface-variant))}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__content,.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__panel{@apply flex min-h-0 flex-1 flex-col overflow-hidden;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__list{@apply min-h-0 flex-1 overflow-auto rounded-lg border;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__list--loading{@apply space-y-0 p-2;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__row{@apply flex max-w-full items-center gap-3 border-b transition-colors;border-color:rgb(var(--ax-sys-color-border-lightest-surface))}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__row:last-child{@apply border-b-0;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__row:hover{background:rgb(var(--ax-sys-color-lightest-surface))}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__row.--selected{background:rgb(var(--ax-sys-color-lighter-surface))}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__checkbox{@apply shrink-0 ps-4;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__sliding-item{@apply max-h-24 overflow-hidden border-b;border-color:rgb(var(--ax-sys-color-border-lightest-surface))}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__sliding-item:last-child{@apply border-b-0;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__footer{@apply w-full;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__footer ax-data-pager{@apply w-full;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__footer--compact ::ng-deep ax-data-pager{@apply justify-center;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__footer--compact ::ng-deep ax-data-pager .compact-prefix{@apply flex w-full justify-center;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__footer--compact ::ng-deep ax-data-pager .compact-suffix{@apply hidden;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__skeleton{@apply flex gap-4 p-4;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__skeleton-avatar{@apply size-12 shrink-0 rounded-full;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__skeleton-body{@apply flex-1 space-y-2 py-1;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__skeleton-line{@apply h-3 rounded-md;background:rgb(var(--ax-sys-color-lighter-surface))}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__skeleton-line.--wide{@apply w-3/4;}.axm-communication-in-app-inbox-page .axm-communication-in-app-inbox-page__skeleton-line:not(.--wide){@apply w-1/2;}\n"] }]
|
|
511
|
+
}], propDecorators: { contextMenu: [{ type: i0.ViewChild, args: ['contextMenu', { isSignal: true }] }] } });
|
|
512
|
+
|
|
513
|
+
export { AXMCommunicationInAppInboxPageComponent };
|
|
514
|
+
//# sourceMappingURL=acorex-platform-module-communication-management-client-communication-in-app-inbox-page.component-b7ZqkMTt.mjs.map
|