@esfaenza/core 19.2.87 → 19.2.89
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>;
|
|
@@ -74,6 +74,7 @@ export declare class BaseSelectorComponent<TSearch extends AppSearch<TItem>, TIt
|
|
|
74
74
|
private redirectMap;
|
|
75
75
|
private routesMap;
|
|
76
76
|
constructor(injector: Injector);
|
|
77
|
+
_outer: BaseSelectorComponent<any, any>;
|
|
77
78
|
bridge(outer: BaseSelectorComponent<any, any>): void;
|
|
78
79
|
ngOnInit(): Promise<void>;
|
|
79
80
|
ngOnDestroy(): void;
|
|
@@ -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(..., ..., ..., ...);";
|
|
@@ -1726,8 +1726,8 @@ class BaseSelectorComponent {
|
|
|
1726
1726
|
});
|
|
1727
1727
|
}
|
|
1728
1728
|
bridge(outer) {
|
|
1729
|
+
this._outer = outer;
|
|
1729
1730
|
this.DisplayMode = outer.DisplayMode;
|
|
1730
|
-
outer.searchView = this.searchView;
|
|
1731
1731
|
// Bridge degli input da fuori a dentro
|
|
1732
1732
|
this.DisplayMode = outer.DisplayMode;
|
|
1733
1733
|
this.Readonly = outer.Readonly;
|
|
@@ -1751,11 +1751,11 @@ class BaseSelectorComponent {
|
|
|
1751
1751
|
outer.inputChange = this.inputChange;
|
|
1752
1752
|
outer.firstValueLoaded = this.firstValueLoaded;
|
|
1753
1753
|
// Bridge funzioni di inizializzazione
|
|
1754
|
-
this.applyFilters = outer.applyFilters.bind(
|
|
1755
|
-
this.applyIdFilter = outer.applyIdFilter.bind(
|
|
1756
|
-
this.evaluateLabel = outer.evaluateLabel.bind(
|
|
1757
|
-
this.loadSearchDictionaries = outer.loadSearchDictionaries.bind(
|
|
1758
|
-
this.Initialize = outer.Initialize.bind(
|
|
1754
|
+
this.applyFilters = outer.applyFilters.bind(outer);
|
|
1755
|
+
this.applyIdFilter = outer.applyIdFilter.bind(outer);
|
|
1756
|
+
this.evaluateLabel = outer.evaluateLabel.bind(outer);
|
|
1757
|
+
this.loadSearchDictionaries = outer.loadSearchDictionaries.bind(outer);
|
|
1758
|
+
this.Initialize = outer.Initialize.bind(outer);
|
|
1759
1759
|
// Bridge di funzioni che quando chiamate all'esterno deve rispondere il componente interno
|
|
1760
1760
|
outer.modalVisible = this.modalVisible.bind(this);
|
|
1761
1761
|
outer.resetSearch = this.resetSearch.bind(this);
|
|
@@ -1820,7 +1820,7 @@ class BaseSelectorComponent {
|
|
|
1820
1820
|
this.searchView = new this.searchType();
|
|
1821
1821
|
this.searchView.itemsperpageoverride = this.PageSize;
|
|
1822
1822
|
if (applyFilters)
|
|
1823
|
-
this.applyFilters(true, true);
|
|
1823
|
+
this.applyFilters(this.searchView, true, true);
|
|
1824
1824
|
return true;
|
|
1825
1825
|
}
|
|
1826
1826
|
initStartValue(valueId) {
|
|
@@ -1828,8 +1828,8 @@ class BaseSelectorComponent {
|
|
|
1828
1828
|
// Inizializzare con un valore di partenza, senza valore di partenza, non ha senso
|
|
1829
1829
|
if (!valueId)
|
|
1830
1830
|
return;
|
|
1831
|
-
this.applyIdFilter(valueId);
|
|
1832
|
-
this.applyFilters(true, true);
|
|
1831
|
+
this.applyIdFilter(this.searchView, valueId);
|
|
1832
|
+
this.applyFilters(this.searchView, true, true);
|
|
1833
1833
|
this.sendSearch(true, true, false);
|
|
1834
1834
|
}
|
|
1835
1835
|
ensureClosed() {
|
|
@@ -1850,7 +1850,11 @@ class BaseSelectorComponent {
|
|
|
1850
1850
|
}
|
|
1851
1851
|
sendSearch(resetPage = true, selectResults, applyOtherFilters = true) {
|
|
1852
1852
|
if (applyOtherFilters) {
|
|
1853
|
-
|
|
1853
|
+
for (var prop in this._outer.searchView) {
|
|
1854
|
+
if (prop.startsWith("filter"))
|
|
1855
|
+
this.searchView[prop] = this._outer[prop];
|
|
1856
|
+
}
|
|
1857
|
+
this.applyFilters(this.searchView, this.firstApplication);
|
|
1854
1858
|
this.firstApplication = false;
|
|
1855
1859
|
}
|
|
1856
1860
|
this.searchView.searchinprogress = true;
|
|
@@ -1861,7 +1865,7 @@ class BaseSelectorComponent {
|
|
|
1861
1865
|
if (this.searchApi == dummyCall) {
|
|
1862
1866
|
setTimeout(() => {
|
|
1863
1867
|
this.searchView = AppSearch.newref(this.searchView);
|
|
1864
|
-
this.searchView.items = [{ id: "
|
|
1868
|
+
this.searchView.items = this.searchView.filterdivision == "1" ? [{ id: "11111", description: "Emanuele Ghetti" }] : [{ id: "2222222", description: "Emanuele Ghetti" }];
|
|
1865
1869
|
this.searchView.searchinprogress = false;
|
|
1866
1870
|
this.afterSearch(selectResults);
|
|
1867
1871
|
});
|