Skip to content
Snippets Groups Projects
Verified Commit a75635a9 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

feat(filter): add new feature flag autoFilter #279

parent 3e732ce5
No related branches found
No related tags found
No related merge requests found
......@@ -241,6 +241,7 @@ class Filter extends CustomElement {
* @property {Object} formatter.marker.close Marker close
* @property {Object} features Feature definitions
* @property {boolean} features.storedConfig Stored configuration, this replaces the setting `storedConfig.enabled` @since 3.97.0
* @property {boolean} features.autoFilter Auto filter @since 3.100.0
* @property {Object} storedConfig Stored configuration
* @property {boolean} storedConfig.enabled The store has been enabled, this option will no longer have any effect. @deprecated 20250101
* @property {string} storedConfig.selector Selector
......@@ -275,6 +276,7 @@ class Filter extends CustomElement {
features: {
storedConfig: false,
autoFilter: true,
},
storedConfig: {
......@@ -317,6 +319,8 @@ class Filter extends CustomElement {
* @fires monster-filter-initialized
*/
[assembleMethodSymbol]() {
const self = this;
this.setOption(
"templateMapping.filter-save-label",
this.getOption("labels.save"),
......@@ -329,26 +333,30 @@ class Filter extends CustomElement {
super[assembleMethodSymbol]();
initControlReferences.call(this);
initControlReferences.call(self);
getWindow().requestAnimationFrame(() => {
initEventHandler.call(this);
initEventHandler.call(self);
});
initFromConfig
.call(this)
.call(self)
.then(() => {})
.catch((error) => {
addAttributeToken(this, ATTRIBUTE_ERRORMESSAGE, error?.message);
addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, error?.message);
})
.finally(() => {
initFilter.call(this);
updateFilterTabs.call(this);
initFilter.call(self);
updateFilterTabs.call(self);
if (self.getOption("features.autoFilter")===true) {
doSearch
.call(this, { showEffect: false })
.call(self, {showEffect: false})
.then(() => {
fireCustomEvent(this, "monster-filter-initialized");
fireCustomEvent(self, "monster-filter-initialized");
})
.catch(() => {});
.catch(() => {
});
}
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment