@arsedizioni/ars-utils 18.1.182 → 18.1.184

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.
@@ -32,7 +32,7 @@ import { MatSidenavModule } from '@angular/material/sidenav';
32
32
  import { MatTabsModule } from '@angular/material/tabs';
33
33
  import * as i3$1 from '@angular/material/tooltip';
34
34
  import { MatTooltipModule } from '@angular/material/tooltip';
35
- import { ClipperSearchFacetsSnapshot, ClipperFacet, ClipperService, ClipperMessages, ClipperModel, ClipperQueryReferencesMode, ClipperModule, ClipperSearchResult, ClipperSearchParams, ClipperSort, ClipperChannels, ClipperSectors, ClipperRegions, ClipperAuthors, ClipperSectorTypes, ClipperSearchUtils, ClipperModels, ClipperSources, ClipperDocumentChangeReason } from '@arsedizioni/ars-utils/clipper.common';
35
+ import { ClipperSearchFacetsSnapshot, ClipperFacet, ClipperService, ClipperMessages, ClipperModel, ClipperQueryReferencesMode, ClipperModule, ClipperSearchResult, ClipperSearchParams, ClipperSort, ClipperSectors, ClipperRegions, ClipperChannels, ClipperAuthors, ClipperSectorTypes, ClipperSearchUtils, ClipperModels, ClipperSources, ClipperDocumentChangeReason } from '@arsedizioni/ars-utils/clipper.common';
36
36
  import { SystemUtils, BroadcastService, DateInterval, ScreenService, DateFormat, FormatPipe, SelectableModel, SafeUrlPipe, DateIntervalChangeDirective, SafeHtmlPipe } from '@arsedizioni/ars-utils/core';
37
37
  import * as i6$2 from '@ngbracket/ngx-layout/extended';
38
38
  import { ExtendedModule } from '@ngbracket/ngx-layout/extended';
@@ -1376,20 +1376,17 @@ class ClipperReferencesComponent extends ClipperSearchResultManager {
1376
1376
  this.title += " - " + this.dialogData.anchorTitle;
1377
1377
  }
1378
1378
  // Use service snapshot
1379
- this.snapshot = this.clipperService.referencesSnapshot ?? { searchParams: {}, interval: "-1" };
1379
+ this.snapshot = this.clipperService.referencesSnapshot ?? { searchParams: new ClipperSearchParams(), interval: "-1" };
1380
1380
  if (this.filterParams.mode !== this.dialogData.mode ||
1381
1381
  this.filterParams.id !== this.dialogData.id ||
1382
1382
  this.filterParams.anchor !== this.dialogData.anchor) {
1383
- this.filterParams = {
1384
- mode: this.dialogData.mode,
1385
- model: this.dialogData.model,
1386
- anchor: this.dialogData.anchor,
1387
- id: this.dialogData.id,
1388
- useModifierInfo: this.dialogData.mode === ClipperQueryReferencesMode.ChangesOut,
1389
- returnModifierInfo: this.dialogData.mode !== ClipperQueryReferencesMode.ChangesOut,
1390
- first: 0,
1391
- count: 15,
1392
- };
1383
+ this.filterParams = new ClipperSearchParams();
1384
+ this.filterParams.mode = this.dialogData.mode;
1385
+ this.filterParams.model = this.dialogData.model;
1386
+ this.filterParams.anchor = this.dialogData.anchor;
1387
+ this.filterParams.id = this.dialogData.id;
1388
+ this.filterParams.useModifierInfo = this.dialogData.mode === ClipperQueryReferencesMode.ChangesOut;
1389
+ this.filterParams.returnModifierInfo = this.dialogData.mode !== ClipperQueryReferencesMode.ChangesOut;
1393
1390
  this.clipperService.referencesSnapshot = this.snapshot;
1394
1391
  }
1395
1392
  }
@@ -1538,7 +1535,7 @@ class ClipperReferencesComponent extends ClipperSearchResultManager {
1538
1535
  this.filterParams.returnModifierInfo =
1539
1536
  this.filterParams.mode !== ClipperQueryReferencesMode.ChangesOut;
1540
1537
  this.dialogService.busy('Ricerca in corso...');
1541
- this.clipperService.references(this.filterParams)
1538
+ this.clipperService.references(this.filterParams.toReferencesSearchParams())
1542
1539
  .subscribe({
1543
1540
  next: (r) => {
1544
1541
  if (!r.success)
@@ -1865,18 +1862,13 @@ class ClipperDocumentComponent extends ClipperDocumentManager {
1865
1862
  */
1866
1863
  resize() {
1867
1864
  setTimeout(() => {
1868
- let e = document.getElementsByClassName('clipper-document-fixed');
1869
- if (e) {
1870
- console.log("height 1: " + (window.innerHeight - e[0].clientHeight));
1871
- }
1872
1865
  let elem = document.getElementById('clipper-document-scrollable');
1873
1866
  if (elem) {
1874
- const height = this.dialogService.getCurrentDialogScrollableHeight(['clipper-document-fixed'], window.innerHeight);
1875
- console.log("height 2:" + height);
1867
+ const height = this.dialogService.getCurrentDialogScrollableHeight(['clipper-document-fixed'], window.innerHeight) - 10;
1876
1868
  if (height != this.height) {
1877
1869
  elem.setAttribute('style', 'padding:0;height:' + height + 'px !important;max-height:' + height + 'px !important');
1878
1870
  let elem2 = document.getElementById('clipper-document-iframe');
1879
- elem2?.setAttribute('style', 'height:' + (height - 10) + 'px !important;max-height:' + (height - 10) + 'px !important');
1871
+ elem2?.setAttribute('style', 'height:' + (height - 20) + 'px !important;max-height:' + (height - 20) + 'px !important');
1880
1872
  this.height = height;
1881
1873
  this.resize();
1882
1874
  }
@@ -2178,12 +2170,12 @@ class ClipperDocumentComponent extends ClipperDocumentManager {
2178
2170
  this.handleRelevantsPaneVisibility();
2179
2171
  }
2180
2172
  else {
2173
+ let params = new ClipperSearchParams();
2174
+ params.id = this.lastDocument.documentId ?? this.lastDocument.id;
2175
+ params.text = this.lastQuery;
2176
+ params.count = 1;
2181
2177
  this.clipperService
2182
- .query({
2183
- id: this.lastDocument.documentId ?? this.lastDocument.id,
2184
- text: this.lastQuery,
2185
- count: 1,
2186
- })
2178
+ .query(params)
2187
2179
  .subscribe((r) => {
2188
2180
  if (!r.success)
2189
2181
  this.dialogService.error(r.message);
@@ -2600,10 +2592,7 @@ class ClipperSearchDialogComponent {
2600
2592
  this.clipperService = inject(ClipperService);
2601
2593
  this.dialogService = inject(DialogService);
2602
2594
  this.dialogData = inject(MAT_DIALOG_DATA) ?? { displayMode: 'simple' };
2603
- this.params = {
2604
- channels: [...ClipperChannels],
2605
- count: 15
2606
- };
2595
+ this.params = new ClipperSearchParams();
2607
2596
  this.modulesEnum = ClipperModule;
2608
2597
  this.sectors = ClipperSectors.filter((n) => n.group === 'S').map((n) => {
2609
2598
  return { name: n.shortName ?? n.name, value: n.value };
@@ -2901,10 +2890,7 @@ class ClipperBrowserDialogComponent extends ClipperSearchResultManager {
2901
2890
  this.title = 'Ricerca in Clipper';
2902
2891
  this.snapshot = {
2903
2892
  searchInfo: null,
2904
- searchParams: {
2905
- first: 0,
2906
- count: 25
2907
- },
2893
+ searchParams: new ClipperSearchParams()
2908
2894
  };
2909
2895
  this.currentModel = 'Tutto';
2910
2896
  this.currentSort = 'Rilevanza';
@@ -2917,11 +2903,8 @@ class ClipperBrowserDialogComponent extends ClipperSearchResultManager {
2917
2903
  searchInfo: null,
2918
2904
  searchParams: null,
2919
2905
  };
2920
- if (this.filterParams == null) {
2921
- this.filterParams = {
2922
- first: 0,
2923
- count: 15,
2924
- };
2906
+ if (!this.filterParams) {
2907
+ this.filterParams = new ClipperSearchParams();
2925
2908
  // Store snapshot
2926
2909
  this.clipperService.snapshot = this.snapshot;
2927
2910
  }
@@ -3441,10 +3424,7 @@ class ClipperBrowserDialogComponent extends ClipperSearchResultManager {
3441
3424
  this.snapshot.total = 0;
3442
3425
  this.snapshot.facets = null;
3443
3426
  this.facets.reset();
3444
- this.filterParams = {
3445
- first: 0,
3446
- count: 15,
3447
- };
3427
+ this.filterParams = new ClipperSearchParams();
3448
3428
  this.filterPane.close();
3449
3429
  this.updateSearchInfo();
3450
3430
  }