@esfaenza/core 19.2.86 → 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.
@@ -6,7 +6,7 @@ export declare abstract class BaseComponent extends ReactiveComponent {
6
6
  protected CompletePath: string;
7
7
  protected ComponentPath: string;
8
8
  protected BasePath: string;
9
- protected NavigationParameters: {
9
+ protected Parameters: {
10
10
  [name: string]: string;
11
11
  };
12
12
  protected QueryParameters: {
@@ -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>;
@@ -1044,7 +1044,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
1044
1044
  class BaseComponent extends ReactiveComponent {
1045
1045
  constructor(injector) {
1046
1046
  super();
1047
- this.NavigationParameters = null;
1047
+ // Disallineato dalla versione NG15
1048
+ this.Parameters = null;
1048
1049
  this.QueryParameters = null;
1049
1050
  let _activatedRoute = injector.get(ActivatedRoute);
1050
1051
  let _state = injector.get(AppState);
@@ -1053,7 +1054,7 @@ class BaseComponent extends ReactiveComponent {
1053
1054
  this._router = injector.get(Router);
1054
1055
  _state.registerNavigationIfMeaningful(_activatedRoute.snapshot);
1055
1056
  // Parametri in maniera "dinamica"
1056
- _activatedRoute.params.pipe(takeUntil$1(this.destroyed$)).subscribe(t => { this.NavigationParameters = t; });
1057
+ _activatedRoute.params.pipe(takeUntil$1(this.destroyed$)).subscribe(t => { this.Parameters = t; });
1057
1058
  _activatedRoute.queryParams.pipe(takeUntil$1(this.destroyed$)).subscribe(t => { this.QueryParameters = t; });
1058
1059
  combineLatest([_activatedRoute.url, _activatedRoute.data]).subscribe((t) => {
1059
1060
  this.gatherRouteInformations(null, t[1]);
@@ -1459,8 +1460,8 @@ class EmbeddingComponent extends BaseComponent {
1459
1460
  requestAnimationFrame(() => {
1460
1461
  this.Page = this.CompletePath.split("/").slice(4).join("/");
1461
1462
  console.log("Page: " + this.Page);
1462
- let navParKeys = Object.keys(this.NavigationParameters)?.filter(p => p != "module");
1463
- this.Pars = (navParKeys?.length || 0) == 0 ? "" : ";" + navParKeys.map(t => `${t}=${this.NavigationParameters[t]}`).join(";");
1463
+ let navParKeys = Object.keys(this.Parameters)?.filter(p => p != "module");
1464
+ this.Pars = (navParKeys?.length || 0) == 0 ? "" : ";" + navParKeys.map(t => `${t}=${this.Parameters[t]}`).join(";");
1464
1465
  console.log("Pars: " + this.Pars);
1465
1466
  let queryParKeys = Object.keys(this.QueryParameters);
1466
1467
  this.QueryPars = (queryParKeys?.length || 0) == 0 ? "" : "?" + queryParKeys.map(t => `${t}=${this.QueryParameters[t]}`).join(";");
@@ -1649,9 +1650,9 @@ const dummyCall = "_DUMMY_";
1649
1650
  class BaseSelectorComponent {
1650
1651
  registerOnChange(fn) { this.propagateChange = fn; }
1651
1652
  registerOnTouched(fn) { }
1652
- applyFilters(firstApplication, onlyEssentials) { }
1653
+ applyFilters(view, firstApplication, onlyEssentials) { }
1653
1654
  ;
1654
- applyIdFilter(itemid) { }
1655
+ applyIdFilter(view, itemid) { }
1655
1656
  ;
1656
1657
  evaluateLabel(item) {
1657
1658
  throw "[@esfaenza/core] Missing implementation for evaluateLabel, please register capabilities by doing selector.registerSelectorCapabilities(..., ..., ..., ...);";
@@ -1726,7 +1727,6 @@ class BaseSelectorComponent {
1726
1727
  }
1727
1728
  bridge(outer) {
1728
1729
  this.DisplayMode = outer.DisplayMode;
1729
- outer.searchView = this.searchView;
1730
1730
  // Bridge degli input da fuori a dentro
1731
1731
  this.DisplayMode = outer.DisplayMode;
1732
1732
  this.Readonly = outer.Readonly;
@@ -1750,11 +1750,11 @@ class BaseSelectorComponent {
1750
1750
  outer.inputChange = this.inputChange;
1751
1751
  outer.firstValueLoaded = this.firstValueLoaded;
1752
1752
  // Bridge funzioni di inizializzazione
1753
- this.applyFilters = outer.applyFilters.bind(this);
1754
- this.applyIdFilter = outer.applyIdFilter.bind(this);
1755
- this.evaluateLabel = outer.evaluateLabel.bind(this);
1756
- this.loadSearchDictionaries = outer.loadSearchDictionaries.bind(this);
1757
- 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);
1758
1758
  // Bridge di funzioni che quando chiamate all'esterno deve rispondere il componente interno
1759
1759
  outer.modalVisible = this.modalVisible.bind(this);
1760
1760
  outer.resetSearch = this.resetSearch.bind(this);
@@ -1819,7 +1819,7 @@ class BaseSelectorComponent {
1819
1819
  this.searchView = new this.searchType();
1820
1820
  this.searchView.itemsperpageoverride = this.PageSize;
1821
1821
  if (applyFilters)
1822
- this.applyFilters(true, true);
1822
+ this.applyFilters(this.searchView, true, true);
1823
1823
  return true;
1824
1824
  }
1825
1825
  initStartValue(valueId) {
@@ -1827,8 +1827,8 @@ class BaseSelectorComponent {
1827
1827
  // Inizializzare con un valore di partenza, senza valore di partenza, non ha senso
1828
1828
  if (!valueId)
1829
1829
  return;
1830
- this.applyIdFilter(valueId);
1831
- this.applyFilters(true, true);
1830
+ this.applyIdFilter(this.searchView, valueId);
1831
+ this.applyFilters(this.searchView, true, true);
1832
1832
  this.sendSearch(true, true, false);
1833
1833
  }
1834
1834
  ensureClosed() {
@@ -1849,7 +1849,7 @@ class BaseSelectorComponent {
1849
1849
  }
1850
1850
  sendSearch(resetPage = true, selectResults, applyOtherFilters = true) {
1851
1851
  if (applyOtherFilters) {
1852
- this.applyFilters(this.firstApplication);
1852
+ this.applyFilters(this.searchView, this.firstApplication);
1853
1853
  this.firstApplication = false;
1854
1854
  }
1855
1855
  this.searchView.searchinprogress = true;
@@ -1860,7 +1860,7 @@ class BaseSelectorComponent {
1860
1860
  if (this.searchApi == dummyCall) {
1861
1861
  setTimeout(() => {
1862
1862
  this.searchView = AppSearch.newref(this.searchView);
1863
- 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" }];
1864
1864
  this.searchView.searchinprogress = false;
1865
1865
  this.afterSearch(selectResults);
1866
1866
  });