monkey-front-core 0.0.84 → 0.0.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.
- package/esm2020/lib/core/services/commons/monkeyecx-commons.service.mjs +34 -16
- package/fesm2015/monkey-front-core.mjs +24 -13
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +33 -15
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/services/commons/monkeyecx-commons.service.d.ts +3 -1
- package/monkey-front-core-0.0.88.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.84.tgz +0 -0
|
@@ -1797,9 +1797,12 @@ class MonkeyEcxCommonsService {
|
|
|
1797
1797
|
this.__onZipCodeDataChanged$ = new BehaviorSubject(null);
|
|
1798
1798
|
this.__oni18nDataChanged$ = new BehaviorSubject(null);
|
|
1799
1799
|
this.__onDoSearch$ = new BehaviorSubject({});
|
|
1800
|
-
this.__onDoPagination$ = new BehaviorSubject(null);
|
|
1801
1800
|
this.__tokenCredentials = null;
|
|
1802
1801
|
this.__schedule = null;
|
|
1802
|
+
this.callbackPagination = () => {
|
|
1803
|
+
// eslint-disable-next-line no-console
|
|
1804
|
+
return console.error('Method callbackPagination needs to be declared');
|
|
1805
|
+
};
|
|
1803
1806
|
this.handleInit();
|
|
1804
1807
|
}
|
|
1805
1808
|
handleInit() {
|
|
@@ -1950,24 +1953,13 @@ class MonkeyEcxCommonsService {
|
|
|
1950
1953
|
},
|
|
1951
1954
|
});
|
|
1952
1955
|
}
|
|
1953
|
-
if (otherArgs?.callbackPagination) {
|
|
1954
|
-
this.__onDoPagination$.subscribe(() => {
|
|
1955
|
-
if (!this.__onLoadingInProgress$.value) {
|
|
1956
|
-
const hasMorePages = this.setPage({
|
|
1957
|
-
page: {
|
|
1958
|
-
...this.__page,
|
|
1959
|
-
},
|
|
1960
|
-
}).nextPage();
|
|
1961
|
-
if (hasMorePages && otherArgs?.callbackPagination) {
|
|
1962
|
-
otherArgs.callbackPagination();
|
|
1963
|
-
}
|
|
1964
|
-
}
|
|
1965
|
-
});
|
|
1966
|
-
}
|
|
1967
1956
|
if (otherArgs?.translateOptions) {
|
|
1968
1957
|
const { service, keys } = otherArgs?.translateOptions;
|
|
1969
1958
|
this.geti18n(service, keys || '');
|
|
1970
1959
|
}
|
|
1960
|
+
if (otherArgs?.callbackPagination) {
|
|
1961
|
+
this.callbackPagination = otherArgs.callbackPagination;
|
|
1962
|
+
}
|
|
1971
1963
|
if (otherArgs?.feature) {
|
|
1972
1964
|
const { flag, service } = otherArgs.feature;
|
|
1973
1965
|
service.onFlags
|
|
@@ -2016,6 +2008,32 @@ class MonkeyEcxCommonsService {
|
|
|
2016
2008
|
this.__oni18nDataChanged$.next(null);
|
|
2017
2009
|
});
|
|
2018
2010
|
}
|
|
2011
|
+
doPagination() {
|
|
2012
|
+
if (!this.__onLoadingInProgress$.value) {
|
|
2013
|
+
const hasMorePages = this.setPage({
|
|
2014
|
+
page: {
|
|
2015
|
+
...this.__page,
|
|
2016
|
+
},
|
|
2017
|
+
}).nextPage();
|
|
2018
|
+
if (hasMorePages && this.callbackPagination) {
|
|
2019
|
+
this.callbackPagination();
|
|
2020
|
+
}
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
setSearchByUrl(router, url, search, extras) {
|
|
2024
|
+
this.__data = null;
|
|
2025
|
+
this.__page = null;
|
|
2026
|
+
this.__onDataChanged$.next(null);
|
|
2027
|
+
this.__onLoadingInProgress$.next(false);
|
|
2028
|
+
router.navigate([url], {
|
|
2029
|
+
queryParams: {
|
|
2030
|
+
...search,
|
|
2031
|
+
r: MonkeyEcxUtils.getRandomString(30),
|
|
2032
|
+
},
|
|
2033
|
+
queryParamsHandling: 'merge',
|
|
2034
|
+
...extras,
|
|
2035
|
+
});
|
|
2036
|
+
}
|
|
2019
2037
|
}
|
|
2020
2038
|
__decorate([
|
|
2021
2039
|
MonkeyEcxCoreService({
|