@firestitch/filter 9.9.7 → 9.10.0
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/app/components/filter/filter.component.d.ts +5 -2
- package/app/services/external-params-controller.service.d.ts +1 -0
- package/bundles/firestitch-filter.umd.js +33 -19
- package/bundles/firestitch-filter.umd.js.map +1 -1
- package/bundles/firestitch-filter.umd.min.js +2 -2
- package/bundles/firestitch-filter.umd.min.js.map +1 -1
- package/esm2015/app/components/filter/filter.component.js +17 -6
- package/esm2015/app/services/external-params-controller.service.js +16 -13
- package/esm5/app/components/filter/filter.component.js +17 -6
- package/esm5/app/services/external-params-controller.service.js +18 -15
- package/fesm2015/firestitch-filter.js +31 -17
- package/fesm2015/firestitch-filter.js.map +1 -1
- package/fesm5/firestitch-filter.js +33 -19
- package/fesm5/firestitch-filter.js.map +1 -1
- package/firestitch-filter.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -2454,11 +2454,27 @@ var ExternalParamsController = /** @class */ (function () {
|
|
|
2454
2454
|
this._destroy$.complete();
|
|
2455
2455
|
};
|
|
2456
2456
|
ExternalParamsController.prototype.setConfig = function (config) {
|
|
2457
|
-
var _this = this;
|
|
2458
2457
|
this._config = config;
|
|
2459
2458
|
this._initPersistance();
|
|
2460
2459
|
this._initQueryParams();
|
|
2461
2460
|
this._initSavedFilters();
|
|
2461
|
+
this.initItems();
|
|
2462
|
+
};
|
|
2463
|
+
ExternalParamsController.prototype.setActiveSavedFilter = function (savedFilter) {
|
|
2464
|
+
this.savedFiltersController.setActiveFilter(savedFilter);
|
|
2465
|
+
if (savedFilter) {
|
|
2466
|
+
this.reloadFiltersWithValues(savedFilter.filters, false);
|
|
2467
|
+
}
|
|
2468
|
+
};
|
|
2469
|
+
ExternalParamsController.prototype.reloadFiltersWithValues = function (params, shouldResetSavedFilters) {
|
|
2470
|
+
if (shouldResetSavedFilters === void 0) { shouldResetSavedFilters = true; }
|
|
2471
|
+
this._shouldResetSavedFilters = shouldResetSavedFilters;
|
|
2472
|
+
this._itemsStore.updateItemsWithValues(params);
|
|
2473
|
+
this._saveQueryParams();
|
|
2474
|
+
this._savePersistedParams();
|
|
2475
|
+
};
|
|
2476
|
+
ExternalParamsController.prototype.initItems = function () {
|
|
2477
|
+
var _this = this;
|
|
2462
2478
|
this._pending$.next(true);
|
|
2463
2479
|
if (this._savedFilters.enabled) {
|
|
2464
2480
|
this._savedFilters
|
|
@@ -2477,19 +2493,6 @@ var ExternalParamsController = /** @class */ (function () {
|
|
|
2477
2493
|
}
|
|
2478
2494
|
this._listenItemsChange();
|
|
2479
2495
|
};
|
|
2480
|
-
ExternalParamsController.prototype.setActiveSavedFilter = function (savedFilter) {
|
|
2481
|
-
this.savedFiltersController.setActiveFilter(savedFilter);
|
|
2482
|
-
if (savedFilter) {
|
|
2483
|
-
this.reloadFiltersWithValues(savedFilter.filters, false);
|
|
2484
|
-
}
|
|
2485
|
-
};
|
|
2486
|
-
ExternalParamsController.prototype.reloadFiltersWithValues = function (params, shouldResetSavedFilters) {
|
|
2487
|
-
if (shouldResetSavedFilters === void 0) { shouldResetSavedFilters = true; }
|
|
2488
|
-
this._shouldResetSavedFilters = shouldResetSavedFilters;
|
|
2489
|
-
this._itemsStore.updateItemsWithValues(params);
|
|
2490
|
-
this._saveQueryParams();
|
|
2491
|
-
this._savePersistedParams();
|
|
2492
|
-
};
|
|
2493
2496
|
ExternalParamsController.prototype._initItemsValues = function () {
|
|
2494
2497
|
this._itemsStore.initItemValues(this.params);
|
|
2495
2498
|
this._saveQueryParams();
|
|
@@ -3682,6 +3685,14 @@ var FilterComponent = /** @class */ (function () {
|
|
|
3682
3685
|
FilterComponent.prototype.updateDisabledState = function () {
|
|
3683
3686
|
this._actions.updateDisabledState();
|
|
3684
3687
|
};
|
|
3688
|
+
FilterComponent.prototype.setItems = function (items) {
|
|
3689
|
+
this._filterItems.destroyItems();
|
|
3690
|
+
this.config.items = items;
|
|
3691
|
+
this._filterItems.setConfig(this._config);
|
|
3692
|
+
this._externalParams.initItems();
|
|
3693
|
+
this._syncSearchInputWithKeyword();
|
|
3694
|
+
this._listenKeywordItemClear();
|
|
3695
|
+
};
|
|
3685
3696
|
FilterComponent.prototype._initFilterWithConfig = function (config) {
|
|
3686
3697
|
if (this.config) {
|
|
3687
3698
|
this._filterItems.destroyItems();
|
|
@@ -3691,11 +3702,7 @@ var FilterComponent = /** @class */ (function () {
|
|
|
3691
3702
|
this._actions.initActions(this._config.actions);
|
|
3692
3703
|
this._filterItems.setConfig(this._config);
|
|
3693
3704
|
this._externalParams.setConfig(this._config);
|
|
3694
|
-
|
|
3695
|
-
if (keywordItem) {
|
|
3696
|
-
this.searchText.setValue(keywordItem.model);
|
|
3697
|
-
this.searchPlaceholder = keywordItem.label || 'Search';
|
|
3698
|
-
}
|
|
3705
|
+
this._syncSearchInputWithKeyword();
|
|
3699
3706
|
if (!!this.config.reloadWhenConfigChanged) {
|
|
3700
3707
|
this.change();
|
|
3701
3708
|
}
|
|
@@ -3769,6 +3776,13 @@ var FilterComponent = /** @class */ (function () {
|
|
|
3769
3776
|
});
|
|
3770
3777
|
});
|
|
3771
3778
|
};
|
|
3779
|
+
FilterComponent.prototype._syncSearchInputWithKeyword = function () {
|
|
3780
|
+
var keywordItem = this._filterItems.keywordItem;
|
|
3781
|
+
if (keywordItem) {
|
|
3782
|
+
this.searchText.setValue(keywordItem.model);
|
|
3783
|
+
this.searchPlaceholder = keywordItem.label || 'Search';
|
|
3784
|
+
}
|
|
3785
|
+
};
|
|
3772
3786
|
FilterComponent.prototype._listenKeywordItemClear = function () {
|
|
3773
3787
|
var _this = this;
|
|
3774
3788
|
var _a;
|