@schukai/monster 3.53.0 → 3.54.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
@@ -1,4 +1,10 @@
1
1
 
2
+ ## [3.54.0] - 2023-11-23
3
+
4
+ ### Add Features
5
+
6
+ - new closeOnSelect feature
7
+
2
8
  ## [3.53.0] - 2023-11-11
3
9
 
4
10
  ### Add Features
@@ -6,6 +12,7 @@
6
12
  - new icons (css) [#130](https://gitlab.schukai.com/oss/libraries/javascript/monster/issues/130)
7
13
  ### Changes
8
14
 
15
+ - release and publish to npm new version 3.53.0
9
16
  - tidy code
10
17
  - tidy code
11
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schukai/monster",
3
- "version": "3.53.0",
3
+ "version": "3.54.0",
4
4
  "description": "Monster is a simple library for creating fast, robust and lightweight websites.",
5
5
  "keywords": [
6
6
  "framework",
@@ -391,6 +391,7 @@ class Select extends CustomControl {
391
391
  * @property {Boolean} features.clearAll=true Display of a delete button to delete the entire selection
392
392
  * @property {Boolean} features.clear=true Display of a delete key for deleting the specific selection
393
393
  * @property {Boolean} features.loadOnOpen=false Load options when opening the dropdown
394
+ * @property {Boolean} features.closeOnSelect=false Close the dropdown when an option is selected (since 3.54.0)
394
395
  * @property {Boolean} filter.defaultValue=* Default filter value, if the filter is empty
395
396
  * @property {Boolean} filter.mode=options Filter mode, values: options, remote, disabled
396
397
  * @property {Object} templates Template definitions
@@ -424,6 +425,7 @@ class Select extends CustomControl {
424
425
  clearAll: true,
425
426
  clear: true,
426
427
  loadOnOpen: false,
428
+ closeOnSelect: false,
427
429
  },
428
430
  url: null,
429
431
  labels: {
@@ -719,7 +721,7 @@ class Select extends CustomControl {
719
721
  fireCustomEvent(this, "monster-options-set", {
720
722
  options,
721
723
  });
722
-
724
+
723
725
  return this;
724
726
  }
725
727
 
@@ -852,7 +854,7 @@ function parseSlotsToOptions() {
852
854
 
853
855
  let counter = 1;
854
856
  getSlottedElements.call(this, "div").forEach((node) => {
855
- let value = String(counter++);
857
+ let value = (counter++).toString();
856
858
  let visibility = "visible";
857
859
 
858
860
  if (node.hasAttribute("data-monster-value")) {
@@ -1532,6 +1534,10 @@ function gatherState() {
1532
1534
  .catch((e) => {
1533
1535
  addAttributeToken(this, ATTRIBUTE_ERRORMESSAGE, `${e}`);
1534
1536
  });
1537
+
1538
+ if (this.getOption("features.closeOnSelect") === true) {
1539
+ toggle.call(this);
1540
+ }
1535
1541
 
1536
1542
  return this;
1537
1543
  }
@@ -152,7 +152,7 @@ function getMonsterVersion() {
152
152
  }
153
153
 
154
154
  /** don't touch, replaced by make with package.json version */
155
- monsterVersion = new Version("3.53.0");
155
+ monsterVersion = new Version("3.54.0");
156
156
 
157
157
  return monsterVersion;
158
158
  }
@@ -7,7 +7,7 @@ describe('Monster', function () {
7
7
  let monsterVersion
8
8
 
9
9
  /** don´t touch, replaced by make with package.json version */
10
- monsterVersion = new Version("3.53.0")
10
+ monsterVersion = new Version("3.54.0")
11
11
 
12
12
  let m = getMonsterVersion();
13
13