@arsedizioni/ars-utils 18.2.444 → 18.2.445
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/clipper.common/common/messages.d.ts +1 -0
- package/clipper.ui/ui/document-menu/document-menu.component.d.ts +1 -1
- package/clipper.ui/ui/search-result-item/search-result-item.component.d.ts +2 -1
- package/esm2022/clipper.common/common/messages.mjs +2 -1
- package/esm2022/clipper.ui/ui/document-menu/document-menu.component.mjs +4 -4
- package/esm2022/clipper.ui/ui/search-result-item/search-result-item.component.mjs +11 -7
- package/esm2022/clipper.ui/ui/search-result-manager/search-result-manager.mjs +3 -2
- package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs +1 -0
- package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs +15 -10
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs.map +1 -1
- package/package.json +11 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
|
2
2
|
import { NgClass, NgStyle } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { viewChild, inject, Renderer2, ChangeDetectorRef, input, Component, ChangeDetectionStrategy, EventEmitter, Output, signal, ViewChild } from '@angular/core';
|
|
4
|
+
import { viewChild, inject, Renderer2, ChangeDetectorRef, input, Component, ChangeDetectionStrategy, EventEmitter, Output, signal, ViewChild, computed } from '@angular/core';
|
|
5
5
|
import * as i3$3 from '@angular/forms';
|
|
6
6
|
import { FormsModule } from '@angular/forms';
|
|
7
7
|
import * as i9 from '@angular/material/badge';
|
|
@@ -32,7 +32,7 @@ import { MatSidenavModule } from '@angular/material/sidenav';
|
|
|
32
32
|
import { MatTabsModule } from '@angular/material/tabs';
|
|
33
33
|
import * as i3 from '@angular/material/tooltip';
|
|
34
34
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
35
|
-
import { ClipperModel, ClipperSearchFacetsSnapshot, ClipperFacet, ClipperService, ClipperMessages, ClipperQueryReferencesMode, ClipperModule, ClipperSearchResult, ClipperSearchParams, ClipperSort,
|
|
35
|
+
import { ClipperModel, ClipperUtils, ClipperSearchFacetsSnapshot, ClipperFacet, ClipperService, ClipperMessages, ClipperQueryReferencesMode, ClipperModule, ClipperSearchResult, ClipperSearchParams, ClipperSort, ClipperSectors, ClipperRegions, ClipperChannels, ClipperSources, ClipperAuthors, ClipperSectorTypes, ClipperSearchUtils, ClipperModels, ClipperDocumentChangeReasons } from '@arsedizioni/ars-utils/clipper.common';
|
|
36
36
|
import { BroadcastService, SystemUtils, DateInterval, ThemeService, ScreenService, DateFormat, FormatPipe, SelectableModel, SafeUrlPipe, DateIntervalChangeDirective, SafeHtmlPipe } from '@arsedizioni/ars-utils/core';
|
|
37
37
|
import { Subject, takeUntil, finalize, fromEvent } from 'rxjs';
|
|
38
38
|
import { takeUntil as takeUntil$1, debounceTime, finalize as finalize$1 } from 'rxjs/operators';
|
|
@@ -104,12 +104,12 @@ class ClipperDocumentMenuComponent {
|
|
|
104
104
|
this.canSetAsRead = () => {
|
|
105
105
|
const items = this.getMultipleSelection();
|
|
106
106
|
return this.isReadable() && (items.length > 1 || (items.length === 1 && items[0].isRead !== true &&
|
|
107
|
-
items[0].model
|
|
107
|
+
ClipperUtils.isClipperModelReadable(items[0].model)));
|
|
108
108
|
};
|
|
109
109
|
this.canSetAsUnread = () => {
|
|
110
110
|
const items = this.getMultipleSelection();
|
|
111
111
|
return this.isReadable() && (items.length > 1 || (items.length === 1 && items[0].isRead === true &&
|
|
112
|
-
items[0].model
|
|
112
|
+
ClipperUtils.isClipperModelReadable(items[0].model)));
|
|
113
113
|
};
|
|
114
114
|
this.canAccessRS = () => {
|
|
115
115
|
const items = this.getMultipleSelection();
|
|
@@ -1349,15 +1349,16 @@ class ClipperSearchResultManager extends ClipperDocumentManager {
|
|
|
1349
1349
|
if (r.success) {
|
|
1350
1350
|
if (item) {
|
|
1351
1351
|
item.isRead = value;
|
|
1352
|
+
this.broadcastService.sendMessage(ClipperMessages.DOCUMENT_READ, { document: item, value: value });
|
|
1352
1353
|
}
|
|
1353
1354
|
else if (this.hasAnySelection()) {
|
|
1354
1355
|
this.selection?.all?.forEach(n => {
|
|
1355
1356
|
n.isRead = value;
|
|
1357
|
+
this.broadcastService.sendMessage(ClipperMessages.DOCUMENT_READ, { document: n, value: value });
|
|
1356
1358
|
});
|
|
1357
1359
|
}
|
|
1358
1360
|
// Update dashboard
|
|
1359
1361
|
this.clipperService.updateUnreadItems(ClipperUtils.getClipperModuleFromModel(item.model), value ? -1 : 1);
|
|
1360
|
-
this.changeDetector.markForCheck();
|
|
1361
1362
|
}
|
|
1362
1363
|
});
|
|
1363
1364
|
}
|
|
@@ -1472,6 +1473,7 @@ class ClipperSearchResultItemComponent {
|
|
|
1472
1473
|
this.changeDetector = inject(ChangeDetectorRef);
|
|
1473
1474
|
this.parent = input();
|
|
1474
1475
|
this.item = input();
|
|
1476
|
+
this.current = computed(() => this.item());
|
|
1475
1477
|
this.actions = input();
|
|
1476
1478
|
this.tileNoPictureUrl = input();
|
|
1477
1479
|
this.tilePictureUrl = input();
|
|
@@ -1494,11 +1496,14 @@ class ClipperSearchResultItemComponent {
|
|
|
1494
1496
|
.pipe(takeUntil(this.unsubscribe))
|
|
1495
1497
|
.subscribe(message => {
|
|
1496
1498
|
if (message.id === ClipperMessages.DOCUMENT_NAVIGATED) {
|
|
1497
|
-
if (this.isReadable && this.item().documentId === message.data.document.documentId && !this.item().isRead) {
|
|
1498
|
-
this.parent()?.setRead(true, this.item())
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1499
|
+
if (this.isReadable() && this.item().documentId === message.data.document.documentId && !this.item().isRead) {
|
|
1500
|
+
this.parent()?.setRead(true, this.item());
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
else if (message.id === ClipperMessages.DOCUMENT_READ) {
|
|
1504
|
+
if (this.isReadable() && this.item().documentId === message.data.document.documentId) {
|
|
1505
|
+
this.item().isRead = message.data.value;
|
|
1506
|
+
this.changeDetector.markForCheck();
|
|
1502
1507
|
}
|
|
1503
1508
|
}
|
|
1504
1509
|
});
|