@senior-gestao-pessoas/hcm-advanced-filter-general 4.0.0 → 4.0.1

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.
@@ -2018,17 +2018,42 @@
2018
2018
  };
2019
2019
  FilterContainerComponent.prototype.setSelectedFilter = function (tokens) {
2020
2020
  var _a, _b;
2021
- var basicFilterControls = ((_a = this.filterControls) === null || _a === void 0 ? void 0 : _a.BASIC_FILTER) || [];
2022
- var basicTokenEnabled = (tokens === null || tokens === void 0 ? void 0 : tokens.some(function (token) { return basicFilterControls.includes(token === null || token === void 0 ? void 0 : token.id); })) || false;
2023
- if (!((_b = this.selectButton) === null || _b === void 0 ? void 0 : _b.value)) {
2024
- var filterType = this.determineFilterType(basicTokenEnabled);
2025
- this.selectedFilter = this.getFilterOption(filterType);
2026
- }
2027
- else {
2028
- this.selectedFilter = this.getFilterOption(this.selectButton.value.value);
2029
- }
2021
+ return __awaiter(this, void 0, void 0, function () {
2022
+ var basicFilterControls, basicTokenEnabled, filterType;
2023
+ return __generator(this, function (_c) {
2024
+ switch (_c.label) {
2025
+ case 0:
2026
+ basicFilterControls = ((_a = this.filterControls) === null || _a === void 0 ? void 0 : _a.BASIC_FILTER) || [];
2027
+ basicTokenEnabled = (tokens === null || tokens === void 0 ? void 0 : tokens.some(function (token) { return basicFilterControls.includes(token === null || token === void 0 ? void 0 : token.id); })) || false;
2028
+ if (!!((_b = this.selectButton) === null || _b === void 0 ? void 0 : _b.value)) return [3 /*break*/, 2];
2029
+ return [4 /*yield*/, this.determineFilterType(basicTokenEnabled)];
2030
+ case 1:
2031
+ filterType = _c.sent();
2032
+ this.selectedFilter = this.getFilterOption(filterType);
2033
+ return [3 /*break*/, 3];
2034
+ case 2:
2035
+ this.selectedFilter = this.getFilterOption(this.selectButton.value.value);
2036
+ _c.label = 3;
2037
+ case 3: return [2 /*return*/];
2038
+ }
2039
+ });
2040
+ });
2030
2041
  };
2031
2042
  FilterContainerComponent.prototype.storeFilter = function () {
2043
+ return __awaiter(this, void 0, void 0, function () {
2044
+ return __generator(this, function (_a) {
2045
+ switch (_a.label) {
2046
+ case 0: return [4 /*yield*/, this.storageCache()];
2047
+ case 1:
2048
+ _a.sent();
2049
+ this.setSelectedFilter();
2050
+ this.toggleFilterControls();
2051
+ return [2 /*return*/];
2052
+ }
2053
+ });
2054
+ });
2055
+ };
2056
+ FilterContainerComponent.prototype.storageCache = function () {
2032
2057
  return __awaiter(this, void 0, void 0, function () {
2033
2058
  var advancedFilter;
2034
2059
  return __generator(this, function (_a) {
@@ -2039,8 +2064,6 @@
2039
2064
  if (this.isAdvancedFilterPresent(advancedFilter)) {
2040
2065
  this.advancedFilterIsPresentInCache = true;
2041
2066
  }
2042
- this.setSelectedFilter();
2043
- this.toggleFilterControls();
2044
2067
  return [2 /*return*/];
2045
2068
  }
2046
2069
  });
@@ -2090,10 +2113,19 @@
2090
2113
  return this.filterOptions.find(function (option) { return option.value === filterType; }) || this.filterOptions[0];
2091
2114
  };
2092
2115
  FilterContainerComponent.prototype.determineFilterType = function (basicTokenEnabled) {
2093
- if (!basicTokenEnabled && this.advancedFilterIsPresentInCache) {
2094
- return exports.ProcessFilterType.ADVANCED_FILTER;
2095
- }
2096
- return exports.ProcessFilterType.BASIC_FILTER;
2116
+ return __awaiter(this, void 0, void 0, function () {
2117
+ return __generator(this, function (_a) {
2118
+ switch (_a.label) {
2119
+ case 0: return [4 /*yield*/, this.storageCache()];
2120
+ case 1:
2121
+ _a.sent();
2122
+ if (!basicTokenEnabled && this.advancedFilterIsPresentInCache) {
2123
+ return [2 /*return*/, exports.ProcessFilterType.ADVANCED_FILTER];
2124
+ }
2125
+ return [2 /*return*/, exports.ProcessFilterType.BASIC_FILTER];
2126
+ }
2127
+ });
2128
+ });
2097
2129
  };
2098
2130
  FilterContainerComponent.prototype.clearAdvancedFilterControls = function (advancedFilterControls) {
2099
2131
  return __awaiter(this, void 0, void 0, function () {