@schukai/monster 3.99.7 → 3.100.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/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
 
4
4
 
5
+ ## [3.100.0] - 2025-01-12
6
+
7
+ ### Add Features
8
+
9
+ - **filter:** add new feature flag autoFilter [#279](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/279)
10
+ ### Bug Fixes
11
+
12
+ - update selection after import [#280](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/280)
13
+ ### Changes
14
+
15
+ - update versions information
16
+
17
+
18
+
5
19
  ## [3.99.7] - 2025-01-12
6
20
 
7
21
  ### Bug Fixes
package/package.json CHANGED
@@ -1 +1 @@
1
- {"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.6.13","@popperjs/core":"^2.11.8"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"3.99.7"}
1
+ {"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.6.13","@popperjs/core":"^2.11.8"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"3.100.0"}
@@ -241,6 +241,7 @@ class Filter extends CustomElement {
241
241
  * @property {Object} formatter.marker.close Marker close
242
242
  * @property {Object} features Feature definitions
243
243
  * @property {boolean} features.storedConfig Stored configuration, this replaces the setting `storedConfig.enabled` @since 3.97.0
244
+ * @property {boolean} features.autoFilter Auto filter @since 3.100.0
244
245
  * @property {Object} storedConfig Stored configuration
245
246
  * @property {boolean} storedConfig.enabled The store has been enabled, this option will no longer have any effect. @deprecated 20250101
246
247
  * @property {string} storedConfig.selector Selector
@@ -275,6 +276,7 @@ class Filter extends CustomElement {
275
276
 
276
277
  features: {
277
278
  storedConfig: false,
279
+ autoFilter: true,
278
280
  },
279
281
 
280
282
  storedConfig: {
@@ -317,6 +319,8 @@ class Filter extends CustomElement {
317
319
  * @fires monster-filter-initialized
318
320
  */
319
321
  [assembleMethodSymbol]() {
322
+ const self = this;
323
+
320
324
  this.setOption(
321
325
  "templateMapping.filter-save-label",
322
326
  this.getOption("labels.save"),
@@ -329,26 +333,30 @@ class Filter extends CustomElement {
329
333
 
330
334
  super[assembleMethodSymbol]();
331
335
 
332
- initControlReferences.call(this);
336
+ initControlReferences.call(self);
333
337
  getWindow().requestAnimationFrame(() => {
334
- initEventHandler.call(this);
338
+ initEventHandler.call(self);
335
339
  });
336
340
 
337
341
  initFromConfig
338
- .call(this)
342
+ .call(self)
339
343
  .then(() => {})
340
344
  .catch((error) => {
341
- addAttributeToken(this, ATTRIBUTE_ERRORMESSAGE, error?.message);
345
+ addAttributeToken(self, ATTRIBUTE_ERRORMESSAGE, error?.message);
342
346
  })
343
347
  .finally(() => {
344
- initFilter.call(this);
345
- updateFilterTabs.call(this);
346
- doSearch
347
- .call(this, { showEffect: false })
348
- .then(() => {
349
- fireCustomEvent(this, "monster-filter-initialized");
350
- })
351
- .catch(() => {});
348
+ initFilter.call(self);
349
+ updateFilterTabs.call(self);
350
+
351
+ if (self.getOption("features.autoFilter")===true) {
352
+ doSearch
353
+ .call(self, {showEffect: false})
354
+ .then(() => {
355
+ fireCustomEvent(self, "monster-filter-initialized");
356
+ })
357
+ .catch(() => {
358
+ });
359
+ }
352
360
  });
353
361
  }
354
362