@arsedizioni/ars-utils 19.0.71 → 19.0.72

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.
@@ -6,6 +6,7 @@ import * as i0 from "@angular/core";
6
6
  export declare class ClipperDocumentManager {
7
7
  protected clipboard: Clipboard;
8
8
  clipperService: ClipperService;
9
+ private clipperReferencesService;
9
10
  protected broadcastService: BroadcastService;
10
11
  protected dialogService: ApplicationDialogService;
11
12
  /**
@@ -13,7 +13,7 @@ export declare class ClipperDocumentMenuComponent implements OnInit, OnDestroy {
13
13
  private changeDetector;
14
14
  private clipperService;
15
15
  readonly useSelections: import("@angular/core").InputSignal<boolean>;
16
- readonly selectionSource: import("@angular/core").InputSignal<"bag" | "selection" | "none">;
16
+ readonly selectionSource: import("@angular/core").InputSignal<"none" | "bag" | "selection">;
17
17
  protected selection: () => ClipperDocumentInfo[];
18
18
  readonly parent: import("@angular/core").InputSignal<ClipperSearchResultManager>;
19
19
  readonly item: import("@angular/core").InputSignal<ClipperDocumentInfo>;
@@ -0,0 +1,11 @@
1
+ import { ClipperQueryReferencesMode } from '@arsedizioni/ars-utils/clipper.common';
2
+ export declare class ClipperReferencesService {
3
+ private dialogService;
4
+ private broacastService;
5
+ /**
6
+ * Browse document references
7
+ * @param document id : the document id
8
+ * @param mode : the reference mode
9
+ */
10
+ openReferences(documentId: string, mode?: ClipperQueryReferencesMode): void;
11
+ }
@@ -1532,10 +1532,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImpor
1532
1532
  ], template: "<h2 mat-dialog-title>Indice</h2>\r\n<mat-dialog-content>\r\n @if (!items || items.length === 0) {\r\n <div>\r\n <p class=\"message\"><i>Nessun elemento da visualizzare.</i></p>\r\n </div>\r\n } @else {\r\n <mat-selection-list dense #selection (selectionChange)=\"select();\" [multiple]=\"dialogData.multiple\"\r\n hideSingleSelectionIndicator=\"true\">\r\n @for (item of items; track item) {\r\n @if (item.type > 4) {\r\n <div class=\"small uppercase truncated accent\" style=\"display: flex; align-items: center; min-height: 36px;\">\r\n <div><b>{{item.description}}</b></div>\r\n </div>\r\n } @else {\r\n <mat-list-option [selected]=\"false\" [value]=\"item\" (click)=\"use(item)\">\r\n <div fxLayout=\"row\" fxLayoutGap=\"10px\" fxFill>\r\n <div [fxFlex]=\"(10 * item.level) + 'px'\"></div>\r\n <div fxFlex=\"*\" class=\"truncated\">\r\n <div class=\"small\" [matTooltip]=\"item.description\">{{item.description}}</div>\r\n </div>\r\n </div>\r\n </mat-list-option>\r\n }\r\n }\r\n </mat-selection-list>\r\n }\r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <div fxLayout=\"row\" fxLayoutAlign=\"end\" fxFill>\r\n @if (dialogData.multiple) {\r\n <button mat-flat-button color=\"primary\" [disabled]=\"okDisabled()\" (click)=\"use()\">Usa</button>\r\n }\r\n <button mat-stroked-button [mat-dialog-close]=\"true\" color=\"primary\">Chiudi</button>\r\n </div>\r\n</mat-dialog-actions>" }]
1533
1533
  }] });
1534
1534
 
1535
+ class ClipperReferencesService {
1536
+ constructor() {
1537
+ this.dialogService = inject(DialogService);
1538
+ this.broacastService = inject(BroadcastService);
1539
+ }
1540
+ /**
1541
+ * Browse document references
1542
+ * @param document id : the document id
1543
+ * @param mode : the reference mode
1544
+ */
1545
+ openReferences(documentId, mode = ClipperQueryReferencesMode.ReferencesIn) {
1546
+ if (!documentId)
1547
+ return;
1548
+ const d = this.dialogService.open(ClipperReferencesComponent, {
1549
+ ariaLabel: 'riferimenti legati al documento',
1550
+ autoFocus: false,
1551
+ restoreFocus: false,
1552
+ disableClose: false,
1553
+ closeOnNavigation: false,
1554
+ data: { documentId: documentId, mode: mode },
1555
+ minWidth: '375px',
1556
+ maxWidth: '1200px',
1557
+ width: '100%',
1558
+ height: '100%',
1559
+ });
1560
+ d.afterClosed()
1561
+ .subscribe((r) => {
1562
+ if (r && r.documentId) {
1563
+ this.broacastService.sendMessage(ClipperMessages.DOCUMENT_NAVIGATE, { data: r.documentId });
1564
+ }
1565
+ });
1566
+ }
1567
+ }
1568
+
1535
1569
  class ClipperDocumentManager {
1536
1570
  constructor() {
1537
1571
  this.clipboard = inject(Clipboard);
1538
1572
  this.clipperService = inject(ClipperService);
1573
+ this.clipperReferencesService = inject(ClipperReferencesService);
1539
1574
  this.broadcastService = inject(BroadcastService);
1540
1575
  this.dialogService = inject(ApplicationDialogService);
1541
1576
  }
@@ -1783,23 +1818,7 @@ class ClipperDocumentManager {
1783
1818
  openReferences(documentId, mode = ClipperQueryReferencesMode.ReferencesIn) {
1784
1819
  if (!documentId)
1785
1820
  return;
1786
- const d = this.dialogService.open(ClipperReferencesComponent, {
1787
- ariaLabel: 'riferimenti legati al documento',
1788
- autoFocus: false,
1789
- restoreFocus: false,
1790
- disableClose: false,
1791
- closeOnNavigation: false,
1792
- data: { documentId: documentId, mode: mode },
1793
- minWidth: '375px',
1794
- maxWidth: '1200px',
1795
- width: '100%',
1796
- height: '100%',
1797
- });
1798
- d.afterClosed()
1799
- .subscribe((r) => {
1800
- if (r && r.documentId)
1801
- this.open(r.documentId);
1802
- });
1821
+ this.clipperReferencesService.openReferences(documentId, mode);
1803
1822
  }
1804
1823
  /**
1805
1824
  * Manage clipper bag
@@ -1962,13 +1981,14 @@ class ClipperDocumentManager {
1962
1981
  this.broadcastService.sendMessage(ClipperMessages.INTEROP_RS_USAGE_REPORT, document);
1963
1982
  }
1964
1983
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ClipperDocumentManager, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1965
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0", type: ClipperDocumentManager, isStandalone: true, selector: "ng-component", ngImport: i0, template: '<div></div>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1984
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0", type: ClipperDocumentManager, isStandalone: true, selector: "ng-component", providers: [ClipperReferencesService], ngImport: i0, template: '<div></div>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1966
1985
  }
1967
1986
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ClipperDocumentManager, decorators: [{
1968
1987
  type: Component,
1969
1988
  args: [{
1970
1989
  template: '<div></div>',
1971
1990
  standalone: true,
1991
+ providers: [ClipperReferencesService],
1972
1992
  changeDetection: ChangeDetectionStrategy.OnPush
1973
1993
  }]
1974
1994
  }] });