@cocreate/events 1.19.3 → 1.19.5

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,3 +1,17 @@
1
+ ## [1.19.5](https://github.com/CoCreate-app/CoCreate-events/compare/v1.19.4...v1.19.5) (2024-04-29)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * bump cocreate dependencies ([ab88e6e](https://github.com/CoCreate-app/CoCreate-events/commit/ab88e6e5b055e0d33673570846653ce4beb985a5))
7
+
8
+ ## [1.19.4](https://github.com/CoCreate-app/CoCreate-events/compare/v1.19.3...v1.19.4) (2024-03-18)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * ifValue defaults to value or <prefix>-if-value ([74a35c5](https://github.com/CoCreate-app/CoCreate-events/commit/74a35c5b17644caa52c40ce2ca931cbafe161a28))
14
+
1
15
  ## [1.19.3](https://github.com/CoCreate-app/CoCreate-events/compare/v1.19.2...v1.19.3) (2024-02-20)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/events",
3
- "version": "1.19.3",
3
+ "version": "1.19.5",
4
4
  "description": "A simple events component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "events",
@@ -58,9 +58,9 @@
58
58
  "webpack-log": "^3.0.1"
59
59
  },
60
60
  "dependencies": {
61
- "@cocreate/actions": "^1.14.0",
62
- "@cocreate/element-prototype": "^1.15.0",
63
- "@cocreate/observer": "^1.14.0",
64
- "@cocreate/utils": "^1.29.0"
61
+ "@cocreate/actions": "^1.18.1",
62
+ "@cocreate/element-prototype": "^1.22.2",
63
+ "@cocreate/observer": "^1.16.0",
64
+ "@cocreate/utils": "^1.33.6"
65
65
  }
66
66
  }
package/src/index.js CHANGED
@@ -263,11 +263,16 @@ const CoCreateEvents = {
263
263
  let elseCondition = element.getAttribute(`${prefix}-else`);
264
264
 
265
265
  let ifValue = element.getAttribute(`${prefix}-if-value`)
266
- if (ifValue || ifValue === "")
266
+ if (!ifValue && ifValue !== "")
267
+ ifValue = await element.getValue()
268
+ else if (ifValue || ifValue === "")
267
269
  ifValue = [ifValue]
268
270
  else
269
271
  ifValue = values
270
272
 
273
+ if (!Array.isArray(ifValue))
274
+ ifValue = [ifValue]
275
+
271
276
  //TODO: improved resize toggling of values
272
277
  // let hasCondition = this.elements2.get(element)
273
278
  if (ifCondition && evaluateCondition(ifCondition, ifValue)) {