@annalib/anna-core 10.0.9 → 10.0.11
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/anna-core-shared-lib/services/anna-persisting-filter.service.mjs +60 -0
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/annalib-anna-core.mjs +59 -1
- package/fesm2015/annalib-anna-core.mjs.map +1 -1
- package/fesm2020/annalib-anna-core.mjs +59 -1
- package/fesm2020/annalib-anna-core.mjs.map +1 -1
- package/lib/anna-core-shared-lib/services/anna-persisting-filter.service.d.ts +8 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -32,6 +32,7 @@ import { coerceNumberProperty } from '@angular/cdk/coercion';
|
|
|
32
32
|
import { isDataSource, ArrayDataSource } from '@angular/cdk/collections';
|
|
33
33
|
import * as i2$2 from '@angular/cdk/table';
|
|
34
34
|
import { _COALESCED_STYLE_SCHEDULER, STICKY_POSITIONING_LISTENER, CdkHeaderRowDef } from '@angular/cdk/table';
|
|
35
|
+
import hash from 'object-hash';
|
|
35
36
|
|
|
36
37
|
class AnnaFilterSearchedTextPipe {
|
|
37
38
|
constructor() {
|
|
@@ -4911,6 +4912,63 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
4911
4912
|
}]
|
|
4912
4913
|
}] });
|
|
4913
4914
|
|
|
4915
|
+
class AnnaPersistingFilterService {
|
|
4916
|
+
constructor() { }
|
|
4917
|
+
storeKeyValueInLocalStorage(val, isFilterKey = true) {
|
|
4918
|
+
let filterOrdering;
|
|
4919
|
+
if (!localStorage.getItem("filterOrdering")) {
|
|
4920
|
+
filterOrdering = [];
|
|
4921
|
+
}
|
|
4922
|
+
else {
|
|
4923
|
+
filterOrdering = JSON.parse(localStorage.getItem("filterOrdering"));
|
|
4924
|
+
}
|
|
4925
|
+
let filterOrderingSet = new Set(filterOrdering);
|
|
4926
|
+
let hashCode = null;
|
|
4927
|
+
let key = null;
|
|
4928
|
+
try {
|
|
4929
|
+
hashCode = hash(val);
|
|
4930
|
+
key = isFilterKey ? "filter_" + hashCode : hashCode;
|
|
4931
|
+
localStorage.setItem(key, JSON.stringify(val));
|
|
4932
|
+
if (isFilterKey) {
|
|
4933
|
+
if (filterOrderingSet.has(key)) {
|
|
4934
|
+
filterOrderingSet.delete(key);
|
|
4935
|
+
}
|
|
4936
|
+
filterOrderingSet.add(key);
|
|
4937
|
+
localStorage.setItem("filterOrdering", JSON.stringify(Array.from(filterOrderingSet)));
|
|
4938
|
+
}
|
|
4939
|
+
}
|
|
4940
|
+
catch (e) {
|
|
4941
|
+
let halfArrayLength = filterOrdering.length / 2;
|
|
4942
|
+
for (let i = 0; i < halfArrayLength; i++) {
|
|
4943
|
+
localStorage.removeItem(filterOrdering[i]);
|
|
4944
|
+
}
|
|
4945
|
+
filterOrdering.splice(0, (filterOrdering.length / 2));
|
|
4946
|
+
hashCode = hash(val);
|
|
4947
|
+
let key = isFilterKey ? "filter_" + hashCode : hashCode;
|
|
4948
|
+
localStorage.setItem(key, JSON.stringify(val));
|
|
4949
|
+
if (isFilterKey) {
|
|
4950
|
+
if (filterOrderingSet.has(key)) {
|
|
4951
|
+
filterOrderingSet.delete(key);
|
|
4952
|
+
}
|
|
4953
|
+
filterOrderingSet.add(key);
|
|
4954
|
+
localStorage.setItem("filterOrdering", JSON.stringify(Array.from(filterOrderingSet)));
|
|
4955
|
+
}
|
|
4956
|
+
}
|
|
4957
|
+
return key;
|
|
4958
|
+
}
|
|
4959
|
+
getActualQueryParams(key) {
|
|
4960
|
+
return localStorage.getItem(key);
|
|
4961
|
+
}
|
|
4962
|
+
}
|
|
4963
|
+
AnnaPersistingFilterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AnnaPersistingFilterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4964
|
+
AnnaPersistingFilterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AnnaPersistingFilterService, providedIn: "root" });
|
|
4965
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AnnaPersistingFilterService, decorators: [{
|
|
4966
|
+
type: Injectable,
|
|
4967
|
+
args: [{
|
|
4968
|
+
providedIn: "root",
|
|
4969
|
+
}]
|
|
4970
|
+
}], ctorParameters: function () { return []; } });
|
|
4971
|
+
|
|
4914
4972
|
class ClickableItem {
|
|
4915
4973
|
constructor(typeOfActionLinkForGt, name, className, showTooltip, tooltipData) {
|
|
4916
4974
|
this.id = typeOfActionLinkForGt;
|
|
@@ -4965,5 +5023,5 @@ var Days;
|
|
|
4965
5023
|
* Generated bundle index. Do not edit.
|
|
4966
5024
|
*/
|
|
4967
5025
|
|
|
4968
|
-
export { AllSelectedStatus, AnnaBuyerApprovalIconTemplateComponent, AnnaCalendarFilterComponent, AnnaConvertZeroOrNullOrUndefinedPipe, AnnaCoreModule, AnnaDateTimeFormatService, AnnaFilterSearchedTextPipe, AnnaFilterService, AnnaFixedRowSizeTableVirtualScrollStrategy, AnnaFixedRowSizeTableVirtualScrollStrategyDirective, AnnaGlobalConfigService, AnnaGtHelperService, AnnaIconColumnComponent, AnnaLiveIconTemplateComponent, AnnaNoDataComponent, AnnaNonEditableGenericTableComponent, AnnaNotifyIconTemplateComponent, AnnaNumberFormatService, AnnaPayForPerformanceIconTemplateComponent, AnnaRejectedIconTemplateComponent, AnnaReplaceCharPipe, AnnaSortComponent, AnnaSortService, AnnaTableVirtualScrollViewportComponent, AnnaTypeofDataPipe, AnnaVirtualTableDirective, AnnaWeekCalendarComponent, ClickableItem, Constants, Days, DigitOnlyDirective, ErrorCodes, SortTypeEnum, TooltipModel, UserActivationStatus, fixedSizeVirtualScrollStrategyFactory, radioButtonModel, showEllipsisTextOnHoverDirective, tooltipModelForColumnLevelFiltering };
|
|
5026
|
+
export { AllSelectedStatus, AnnaBuyerApprovalIconTemplateComponent, AnnaCalendarFilterComponent, AnnaConvertZeroOrNullOrUndefinedPipe, AnnaCoreModule, AnnaDateTimeFormatService, AnnaFilterSearchedTextPipe, AnnaFilterService, AnnaFixedRowSizeTableVirtualScrollStrategy, AnnaFixedRowSizeTableVirtualScrollStrategyDirective, AnnaGlobalConfigService, AnnaGtHelperService, AnnaIconColumnComponent, AnnaLiveIconTemplateComponent, AnnaNoDataComponent, AnnaNonEditableGenericTableComponent, AnnaNotifyIconTemplateComponent, AnnaNumberFormatService, AnnaPayForPerformanceIconTemplateComponent, AnnaPersistingFilterService, AnnaRejectedIconTemplateComponent, AnnaReplaceCharPipe, AnnaSortComponent, AnnaSortService, AnnaTableVirtualScrollViewportComponent, AnnaTypeofDataPipe, AnnaVirtualTableDirective, AnnaWeekCalendarComponent, ClickableItem, Constants, Days, DigitOnlyDirective, ErrorCodes, SortTypeEnum, TooltipModel, UserActivationStatus, fixedSizeVirtualScrollStrategyFactory, radioButtonModel, showEllipsisTextOnHoverDirective, tooltipModelForColumnLevelFiltering };
|
|
4969
5027
|
//# sourceMappingURL=annalib-anna-core.mjs.map
|