@arsedizioni/ars-utils 21.0.52 → 21.1.0

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.
@@ -1802,28 +1802,22 @@ class ClipperSearchFacetsComponent {
1802
1802
  if (this.snapshot.groups.length > 0) {
1803
1803
  this.snapshot.groups.forEach(n => {
1804
1804
  if (n.index === ClipperFacet.Year) {
1805
- this.snapshot.changedInterval = this.snapshot.fromDate !== undefined;
1806
1805
  this.snapshot.fromDate = undefined;
1807
1806
  this.snapshot.toDate = undefined;
1808
1807
  }
1809
1808
  else if (n.index === ClipperFacet.Sector) {
1810
- this.snapshot.changedSector = this.snapshot.sector !== undefined;
1811
1809
  this.snapshot.sector = undefined;
1812
1810
  }
1813
1811
  else if (n.index === ClipperFacet.Author) {
1814
- this.snapshot.changedAuthor = this.snapshot.author !== undefined;
1815
1812
  this.snapshot.author = undefined;
1816
1813
  }
1817
1814
  else if (n.index === ClipperFacet.DocumentType) {
1818
- this.snapshot.changedType = this.snapshot.type !== undefined;
1819
1815
  this.snapshot.type = undefined;
1820
1816
  }
1821
1817
  else if (n.index === ClipperFacet.Article) {
1822
- this.snapshot.changedAnchor = this.snapshot.anchor !== undefined;
1823
1818
  this.snapshot.anchor = undefined;
1824
1819
  }
1825
1820
  else if (n.index === ClipperFacet.Reason) {
1826
- this.snapshot.changedReason = this.snapshot.reason !== undefined;
1827
1821
  this.snapshot.reason = undefined;
1828
1822
  }
1829
1823
  });
@@ -1840,28 +1834,22 @@ class ClipperSearchFacetsComponent {
1840
1834
  this.snapshot.usedGroups.forEach(n => {
1841
1835
  if (index === -1 || index === n.index) {
1842
1836
  if (n.index === ClipperFacet.Year) {
1843
- this.snapshot.changedInterval = true;
1844
1837
  this.snapshot.fromDate = undefined;
1845
1838
  this.snapshot.toDate = undefined;
1846
1839
  }
1847
1840
  else if (n.index === ClipperFacet.Sector) {
1848
- this.snapshot.changedSector = true;
1849
1841
  this.snapshot.sector = undefined;
1850
1842
  }
1851
1843
  else if (n.index === ClipperFacet.Author) {
1852
- this.snapshot.changedAuthor = true;
1853
1844
  this.snapshot.author = undefined;
1854
1845
  }
1855
1846
  else if (n.index === ClipperFacet.DocumentType) {
1856
- this.snapshot.changedType = true;
1857
1847
  this.snapshot.type = undefined;
1858
1848
  }
1859
1849
  else if (n.index === ClipperFacet.Article) {
1860
- this.snapshot.changedAnchor = true;
1861
1850
  this.snapshot.anchor = undefined;
1862
1851
  }
1863
1852
  else if (n.index === ClipperFacet.Reason) {
1864
- this.snapshot.changedReason = true;
1865
1853
  this.snapshot.reason = undefined;
1866
1854
  }
1867
1855
  this.dismiss(n, false);
@@ -2684,23 +2672,15 @@ class ClipperReferencesComponent extends ClipperSearchResultManager {
2684
2672
  newParams.toDate = this.snapshot.facets?.toDate;
2685
2673
  newParams.year = this.snapshot.facets?.fromDate.getFullYear();
2686
2674
  }
2687
- else if (this.snapshot.facets?.changedInterval) {
2688
- newParams.year = undefined;
2689
- newParams.fromDate = undefined;
2690
- newParams.toDate = undefined;
2691
- }
2692
- if (this.snapshot.facets?.sector || this.snapshot.facets?.changedSector) {
2675
+ if (this.snapshot.facets?.sector) {
2693
2676
  newParams.sector = this.snapshot.facets?.sector;
2694
2677
  }
2695
- if (this.snapshot.facets?.type || this.snapshot.facets?.changedType) {
2678
+ if (this.snapshot.facets?.type) {
2696
2679
  newParams.type = this.snapshot.facets?.type;
2697
2680
  }
2698
- if (this.snapshot.facets?.author || this.snapshot.facets?.changedAuthor) {
2681
+ if (this.snapshot.facets?.author) {
2699
2682
  newParams.author = this.snapshot.facets?.author;
2700
2683
  }
2701
- if (this.snapshot.facets?.anchor || this.snapshot.facets?.changedAnchor) {
2702
- newParams.anchor = this.snapshot.facets?.anchor;
2703
- }
2704
2684
  return newParams;
2705
2685
  }
2706
2686
  /**
@@ -3858,15 +3838,9 @@ class ClipperBrowserComponent extends ClipperSearchResultManager {
3858
3838
  }
3859
3839
  // Setup sort options
3860
3840
  this.sortOptions = ClipperUtils.getClipperAvailableSortOptions(this.filterParams.modules, newParams);
3861
- if (newParams.text) {
3862
- newParams.text = ClipperSearchUtils.normalizeTextQuery(newParams.text);
3863
- if (newSearch) {
3864
- if (this.sortOptions[0].value !== ClipperSort.Relevance) {
3865
- this.sortOptions.splice(0, 0, { name: 'Rilevanza', value: ClipperSort.Relevance });
3866
- }
3867
- this.sortMode = this.sortOptions[0];
3868
- this.changeDetector.markForCheck();
3869
- }
3841
+ if (newParams.text && newSearch) {
3842
+ this.sortMode = this.sortOptions[0];
3843
+ this.changeDetector.markForCheck();
3870
3844
  }
3871
3845
  if (!this.sortMode || this.sortOptions.findIndex(x => x.value == this.sortMode?.value) === -1) {
3872
3846
  this.sortMode = this.sortOptions[0];
@@ -3878,11 +3852,6 @@ class ClipperBrowserComponent extends ClipperSearchResultManager {
3878
3852
  newParams.toDate = this.snapshot.facets?.toDate;
3879
3853
  newParams.year = this.snapshot.facets?.fromDate.getFullYear();
3880
3854
  }
3881
- else if (this.snapshot?.facets?.changedInterval) {
3882
- newParams.year = undefined;
3883
- newParams.fromDate = undefined;
3884
- newParams.toDate = undefined;
3885
- }
3886
3855
  if (this.snapshot?.facets?.sector) {
3887
3856
  if (this.snapshot?.facets?.sector) {
3888
3857
  const model = parseInt(this.snapshot.facets?.sector);