@esfaenza/core 19.2.87 → 19.2.88

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.
@@ -49,8 +49,8 @@ export declare class BaseSelectorComponent<TSearch extends AppSearch<TItem>, TIt
49
49
  private itemIdProperty;
50
50
  private searchIndependantProperties;
51
51
  navigationEntity: string;
52
- protected applyFilters(firstApplication?: boolean, onlyEssentials?: boolean): void;
53
- protected applyIdFilter(itemid?: string): void;
52
+ protected applyFilters(view: TSearch, firstApplication?: boolean, onlyEssentials?: boolean): void;
53
+ protected applyIdFilter(view: TSearch, itemid?: string): void;
54
54
  protected evaluateLabel(item: TItem[]): string;
55
55
  protected loadSearchDictionaries(): Promise<void>;
56
56
  protected Initialize(): BaseSelectorInitialization<TSearch>;
@@ -1650,9 +1650,9 @@ const dummyCall = "_DUMMY_";
1650
1650
  class BaseSelectorComponent {
1651
1651
  registerOnChange(fn) { this.propagateChange = fn; }
1652
1652
  registerOnTouched(fn) { }
1653
- applyFilters(firstApplication, onlyEssentials) { }
1653
+ applyFilters(view, firstApplication, onlyEssentials) { }
1654
1654
  ;
1655
- applyIdFilter(itemid) { }
1655
+ applyIdFilter(view, itemid) { }
1656
1656
  ;
1657
1657
  evaluateLabel(item) {
1658
1658
  throw "[@esfaenza/core] Missing implementation for evaluateLabel, please register capabilities by doing selector.registerSelectorCapabilities(..., ..., ..., ...);";
@@ -1727,7 +1727,6 @@ class BaseSelectorComponent {
1727
1727
  }
1728
1728
  bridge(outer) {
1729
1729
  this.DisplayMode = outer.DisplayMode;
1730
- outer.searchView = this.searchView;
1731
1730
  // Bridge degli input da fuori a dentro
1732
1731
  this.DisplayMode = outer.DisplayMode;
1733
1732
  this.Readonly = outer.Readonly;
@@ -1751,11 +1750,11 @@ class BaseSelectorComponent {
1751
1750
  outer.inputChange = this.inputChange;
1752
1751
  outer.firstValueLoaded = this.firstValueLoaded;
1753
1752
  // Bridge funzioni di inizializzazione
1754
- this.applyFilters = outer.applyFilters.bind(this);
1755
- this.applyIdFilter = outer.applyIdFilter.bind(this);
1756
- this.evaluateLabel = outer.evaluateLabel.bind(this);
1757
- this.loadSearchDictionaries = outer.loadSearchDictionaries.bind(this);
1758
- this.Initialize = outer.Initialize.bind(this);
1753
+ this.applyFilters = outer.applyFilters.bind(outer);
1754
+ this.applyIdFilter = outer.applyIdFilter.bind(outer);
1755
+ this.evaluateLabel = outer.evaluateLabel.bind(outer);
1756
+ this.loadSearchDictionaries = outer.loadSearchDictionaries.bind(outer);
1757
+ this.Initialize = outer.Initialize.bind(outer);
1759
1758
  // Bridge di funzioni che quando chiamate all'esterno deve rispondere il componente interno
1760
1759
  outer.modalVisible = this.modalVisible.bind(this);
1761
1760
  outer.resetSearch = this.resetSearch.bind(this);
@@ -1820,7 +1819,7 @@ class BaseSelectorComponent {
1820
1819
  this.searchView = new this.searchType();
1821
1820
  this.searchView.itemsperpageoverride = this.PageSize;
1822
1821
  if (applyFilters)
1823
- this.applyFilters(true, true);
1822
+ this.applyFilters(this.searchView, true, true);
1824
1823
  return true;
1825
1824
  }
1826
1825
  initStartValue(valueId) {
@@ -1828,8 +1827,8 @@ class BaseSelectorComponent {
1828
1827
  // Inizializzare con un valore di partenza, senza valore di partenza, non ha senso
1829
1828
  if (!valueId)
1830
1829
  return;
1831
- this.applyIdFilter(valueId);
1832
- this.applyFilters(true, true);
1830
+ this.applyIdFilter(this.searchView, valueId);
1831
+ this.applyFilters(this.searchView, true, true);
1833
1832
  this.sendSearch(true, true, false);
1834
1833
  }
1835
1834
  ensureClosed() {
@@ -1850,7 +1849,7 @@ class BaseSelectorComponent {
1850
1849
  }
1851
1850
  sendSearch(resetPage = true, selectResults, applyOtherFilters = true) {
1852
1851
  if (applyOtherFilters) {
1853
- this.applyFilters(this.firstApplication);
1852
+ this.applyFilters(this.searchView, this.firstApplication);
1854
1853
  this.firstApplication = false;
1855
1854
  }
1856
1855
  this.searchView.searchinprogress = true;
@@ -1861,7 +1860,7 @@ class BaseSelectorComponent {
1861
1860
  if (this.searchApi == dummyCall) {
1862
1861
  setTimeout(() => {
1863
1862
  this.searchView = AppSearch.newref(this.searchView);
1864
- this.searchView.items = [{ id: "9999", description: "Emanuele Ghetti" }];
1863
+ this.searchView.items = this.searchView.filterdivision == "1" ? [{ id: "11111", description: "Emanuele Ghetti" }] : [{ id: "2222222", description: "Emanuele Ghetti" }];
1865
1864
  this.searchView.searchinprogress = false;
1866
1865
  this.afterSearch(selectResults);
1867
1866
  });