coer-elements 0.0.52 → 0.0.54
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2022/components/lib/coer-list/coer-list.component.mjs +3 -3
- package/esm2022/tools/lib/filters.class.mjs +15 -7
- package/esm2022/tools/lib/page.class.mjs +7 -1
- package/fesm2022/coer-elements-components.mjs +2 -2
- package/fesm2022/coer-elements-components.mjs.map +1 -1
- package/fesm2022/coer-elements-tools.mjs +20 -6
- package/fesm2022/coer-elements-tools.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/coer-elements.css +4 -2
- package/tools/lib/page.class.d.ts +2 -0
@@ -797,19 +797,27 @@ class Filters {
|
|
797
797
|
static Get(path) {
|
798
798
|
let storage = sessionStorage.getItem(this.storage);
|
799
799
|
storage = JSON.parse(storage);
|
800
|
-
|
801
|
-
|
802
|
-
|
800
|
+
if (Tools.IsNotNull(storage?.filters)) {
|
801
|
+
for (const filterList of storage.filters) {
|
802
|
+
if (filterList.some((x) => x === path)) {
|
803
|
+
return filterList[1];
|
804
|
+
}
|
805
|
+
}
|
806
|
+
}
|
807
|
+
return null;
|
803
808
|
}
|
804
809
|
/** */
|
805
810
|
static Remove(path) {
|
806
811
|
let storage = sessionStorage.getItem(this.storage);
|
807
812
|
storage = JSON.parse(storage);
|
808
813
|
if (Tools.IsNotNull(storage?.filters)) {
|
809
|
-
|
810
|
-
|
811
|
-
storage.filters.
|
814
|
+
let index = 0;
|
815
|
+
for (index; index < storage.filters.length; index++) {
|
816
|
+
if (storage.filters[index].some((x) => x === path)) {
|
817
|
+
break;
|
818
|
+
}
|
812
819
|
}
|
820
|
+
storage.filters.splice(index, 1);
|
813
821
|
}
|
814
822
|
sessionStorage.setItem(this.storage, JSON.stringify(storage));
|
815
823
|
}
|
@@ -1051,6 +1059,7 @@ class Page {
|
|
1051
1059
|
if (this._source) {
|
1052
1060
|
Breadcrumbs.RemoveLast();
|
1053
1061
|
this.SetPageResponse(pageResponse);
|
1062
|
+
this.RemovePageFilter();
|
1054
1063
|
Tools.Sleep().then(_ => this.router.navigateByUrl(this._source.path));
|
1055
1064
|
}
|
1056
1065
|
}
|
@@ -1078,6 +1087,11 @@ class Page {
|
|
1078
1087
|
this.pageFilters = Filters.Get(this._path);
|
1079
1088
|
}
|
1080
1089
|
/** */
|
1090
|
+
RemovePageFilter() {
|
1091
|
+
this.pageFilters = {};
|
1092
|
+
Filters.Remove(this._path);
|
1093
|
+
}
|
1094
|
+
/** */
|
1081
1095
|
Log(value, log = null) {
|
1082
1096
|
if (Tools.IsNotNull(log))
|
1083
1097
|
console.log({ log, value });
|