@arsedizioni/ars-utils 22.0.4 → 22.0.5

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.
@@ -44,7 +44,7 @@ import { MatTooltipModule } from '@angular/material/tooltip';
44
44
  import { ClipperService, ClipperModel, ClipperUtils, ClipperSearchFacetsSnapshot, ClipperFacet, ClipperMessages, ClipperQueryReferencesMode, ClipperModule, ClipperSelectionMode, ClipperSearchResult, ClipperSearchParams, ClipperSort, ClipperSearchUtils, ClipperQueryDocumentFlags, ClipperSources, ClipperDocumentChangeReasons, ClipperChannel, ClipperSectors, ClipperRegions, ClipperAuthors, ClipperSectorTypes, ClipperTeamProduct, NotesColors } from '@arsedizioni/ars-utils/clipper.common';
45
45
  import * as i19 from '@arsedizioni/ars-utils/core';
46
46
  import { BroadcastService, SystemUtils, ThemeService, ScreenService, DateFormat, FormatPipe, DateInterval, SelectableModel, ArsCoreModule, SafeHtmlPipe } from '@arsedizioni/ars-utils/core';
47
- import { DialogService, SendToDialogComponent, ChipsSelectorComponent, ButtonSelectorComponent, ButtonToggleComponent, FilePreviewComponent, CalendarEmptyHeader } from '@arsedizioni/ars-utils/ui';
47
+ import { ApplicationDialogService, SendToDialogComponent, ChipsSelectorComponent, ButtonSelectorComponent, ButtonToggleComponent, FilePreviewComponent, CalendarEmptyHeader } from '@arsedizioni/ars-utils/ui.application';
48
48
  import * as i1 from '@ngbracket/ngx-layout';
49
49
  import { FlexModule, FlexLayoutModule } from '@ngbracket/ngx-layout';
50
50
  import { finalize, fromEvent } from 'rxjs';
@@ -52,6 +52,7 @@ import { FlexModule as FlexModule$1 } from '@ngbracket/ngx-layout/flex';
52
52
  import { startOfToday, startOfDay, subDays, endOfDay, startOfMonth, endOfMonth } from 'date-fns';
53
53
  import { Clipboard } from '@angular/cdk/clipboard';
54
54
  import saveAs from 'file-saver';
55
+ import { DialogService } from '@arsedizioni/ars-utils/ui';
55
56
  import { Overlay, OverlayModule } from '@angular/cdk/overlay';
56
57
  import { TemplatePortal } from '@angular/cdk/portal';
57
58
  import * as i5 from '@ngbracket/ngx-layout/extended';
@@ -534,7 +535,7 @@ class ClipperDocumentManager {
534
535
  this.clipboard = inject(Clipboard);
535
536
  this.clipperService = inject(ClipperService);
536
537
  this.broadcastService = inject(BroadcastService);
537
- this.dialogService = inject(DialogService);
538
+ this.dialogService = inject(ApplicationDialogService);
538
539
  this.canUseArchive = signal(false, /* @ts-ignore */
539
540
  ...(ngDevMode ? [{ debugName: "canUseArchive" }] : /* istanbul ignore next */ []));
540
541
  this.canUseNotes = signal(false, /* @ts-ignore */
@@ -833,7 +834,7 @@ class ClipperDocumentManager {
833
834
  /**
834
835
  * Opens a dialog to manage the documents in the working bag (view, select, delete).
835
836
  */
836
- async openBag() {
837
+ openBag() {
837
838
  const items = [];
838
839
  this.clipperService.bag().forEach(n => {
839
840
  const title = n.title1 ?? n.title2 ?? '';
@@ -843,7 +844,7 @@ class ClipperDocumentManager {
843
844
  searchBag: { name: title },
844
845
  });
845
846
  });
846
- const d = await this.dialogService.select({
847
+ const d = this.dialogService.select({
847
848
  title: 'Gestisci documenti di lavoro',
848
849
  multipleSelection: false,
849
850
  mustSelect: false,
@@ -852,8 +853,6 @@ class ClipperDocumentManager {
852
853
  canDelete: true,
853
854
  canView: true,
854
855
  });
855
- if (!d)
856
- return;
857
856
  d.componentInstance.view
858
857
  .subscribe((r) => {
859
858
  let item = r.bag;
@@ -1696,12 +1695,12 @@ class ClipperContactsSelector {
1696
1695
  * @param onSelect - Optional callback invoked with the selection result when the user confirms.
1697
1696
  */
1698
1697
  static Show(injector, canAppend, canEdit, onSelect) {
1699
- runInInjectionContext(injector, async () => {
1700
- const dialogService = inject(DialogService);
1698
+ runInInjectionContext(injector, () => {
1699
+ const dialogService = inject(ApplicationDialogService);
1701
1700
  const clipperService = inject(ClipperService);
1702
1701
  let lookupSubscription;
1703
1702
  const canSelect = onSelect !== undefined;
1704
- const d = await dialogService.select({
1703
+ const d = dialogService.select({
1705
1704
  title: canSelect ? 'Seleziona un contatto' : 'Gestisci contatti',
1706
1705
  multipleSelection: true,
1707
1706
  mustSelect: canSelect,
@@ -1832,7 +1831,7 @@ class ClipperNoteBadgeComponent {
1832
1831
  this.injector = inject(Injector);
1833
1832
  this.clipperService = inject(ClipperService);
1834
1833
  this.broadcastService = inject(BroadcastService);
1835
- this.dialogService = inject(DialogService);
1834
+ this.dialogService = inject(ApplicationDialogService);
1836
1835
  this.destroyRef = inject(DestroyRef);
1837
1836
  this.overlay = inject(Overlay);
1838
1837
  this.overlayRef = null;
@@ -2741,12 +2740,10 @@ class ClipperBrowserComponent extends ClipperSearchResultManager {
2741
2740
  * Saves the current filter parameters as a named search.
2742
2741
  * @param newFilter - When true, always prompts for a new filter name; otherwise updates the existing one. Defaults to false.
2743
2742
  */
2744
- async saveFilter(newFilter = false) {
2743
+ saveFilter(newFilter = false) {
2745
2744
  this.loadFilter();
2746
2745
  if (newFilter || !this.filterParams.searchId) {
2747
- const d = await this.dialogService.prompt("Crea un nuovo filtro", 0, "Nome filtro");
2748
- if (!d)
2749
- return;
2746
+ const d = this.dialogService.prompt("Crea un nuovo filtro", 0, "Nome filtro");
2750
2747
  d.componentInstance.done.subscribe((data) => {
2751
2748
  if (data?.value) {
2752
2749
  this.clipperService.saveSearch({
@@ -3461,12 +3458,12 @@ class ClipperBrowserComponent extends ClipperSearchResultManager {
3461
3458
  /**
3462
3459
  * Open the topic-selection dialog and append the chosen topics to the current filter.
3463
3460
  */
3464
- async addTopic() {
3465
- const d = await this.dialogService
3461
+ addTopic() {
3462
+ this.dialogService
3466
3463
  .selectTree(this.topics, 'Seleziona un argomento', undefined, (this.filterParams.topics && this.filterParams.topics.length > 0)
3467
3464
  ? this.filterParams.topics[this.filterParams.topics.length - 1].name
3468
- : undefined);
3469
- d?.componentInstance.done.subscribe(r => {
3465
+ : undefined)
3466
+ .componentInstance.done.subscribe(r => {
3470
3467
  if (!this.filterParams.topics) {
3471
3468
  this.filterParams.topics = [];
3472
3469
  }
@@ -4569,7 +4566,7 @@ class ClipperNoteEditComponent {
4569
4566
  constructor() {
4570
4567
  this.done = output();
4571
4568
  this.destroyRef = inject(DestroyRef);
4572
- this.dialogService = inject(DialogService);
4569
+ this.dialogService = inject(ApplicationDialogService);
4573
4570
  this.dialogData = inject(MAT_DIALOG_DATA);
4574
4571
  this.dialogTitle = signal((this.dialogData.currentItem?.id ?? 0) > 0 ? 'Modifica annotazione' : 'Nuova annotazione', /* @ts-ignore */
4575
4572
  ...(ngDevMode ? [{ debugName: "dialogTitle" }] : /* istanbul ignore next */ []));