@cocreate/events 1.13.6 → 1.13.8
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 +14 -0
- package/demo/observer.html +39 -0
- package/package.json +5 -5
- package/src/index.js +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.13.8](https://github.com/CoCreate-app/CoCreate-events/compare/v1.13.7...v1.13.8) (2023-10-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* bump dependencies ([bee4795](https://github.com/CoCreate-app/CoCreate-events/commit/bee4795595054791a183c60fb29e148da9ec94c7))
|
|
7
|
+
|
|
8
|
+
## [1.13.7](https://github.com/CoCreate-app/CoCreate-events/compare/v1.13.6...v1.13.7) (2023-10-17)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* await getValue() ([2d6cefa](https://github.com/CoCreate-app/CoCreate-events/commit/2d6cefaa39dbc655030938ed01fab04f6af0125f))
|
|
14
|
+
|
|
1
15
|
## [1.13.6](https://github.com/CoCreate-app/CoCreate-events/compare/v1.13.5...v1.13.6) (2023-10-14)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<title>Observer Events | CoCreateJS</title>
|
|
5
|
+
|
|
6
|
+
<!-- CoCreate Favicon -->
|
|
7
|
+
<link
|
|
8
|
+
rel="icon"
|
|
9
|
+
href="https://cdn.cocreate.app/favicon.ico"
|
|
10
|
+
type="image/ico"
|
|
11
|
+
sizes="16x16" />
|
|
12
|
+
|
|
13
|
+
<!-- Custom CSS -->
|
|
14
|
+
<style type="text/css">
|
|
15
|
+
.test {
|
|
16
|
+
background: red;
|
|
17
|
+
}
|
|
18
|
+
.new {
|
|
19
|
+
background: yellow;
|
|
20
|
+
}
|
|
21
|
+
.active {
|
|
22
|
+
background-color: blue;
|
|
23
|
+
}
|
|
24
|
+
.hidden {
|
|
25
|
+
display: none;
|
|
26
|
+
}
|
|
27
|
+
</style>
|
|
28
|
+
<link rel="manifest" href="/manifest.webmanifest" />
|
|
29
|
+
</head>
|
|
30
|
+
<body>
|
|
31
|
+
<div click-parent click-value="active">click here</div>
|
|
32
|
+
<div observe-parent observe-attribute="class" observe-value="active">
|
|
33
|
+
testing this new value
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<!--<script src="../dist/CoCreate-events.js"></script>-->
|
|
37
|
+
<script src="https://CoCreate.app/dist/CoCreate.js"></script>
|
|
38
|
+
</body>
|
|
39
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/events",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.8",
|
|
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.
|
|
62
|
-
"@cocreate/element-prototype": "^1.11.
|
|
63
|
-
"@cocreate/observer": "^1.11.
|
|
64
|
-
"@cocreate/utils": "^1.
|
|
61
|
+
"@cocreate/actions": "^1.12.0",
|
|
62
|
+
"@cocreate/element-prototype": "^1.11.7",
|
|
63
|
+
"@cocreate/observer": "^1.11.6",
|
|
64
|
+
"@cocreate/utils": "^1.26.1"
|
|
65
65
|
}
|
|
66
66
|
}
|
package/src/index.js
CHANGED
|
@@ -213,7 +213,7 @@ const CoCreateEvents = {
|
|
|
213
213
|
}
|
|
214
214
|
},
|
|
215
215
|
|
|
216
|
-
__updateElements: function (element, prefix, target) {
|
|
216
|
+
__updateElements: async function (element, prefix, target) {
|
|
217
217
|
const self = this;
|
|
218
218
|
// TODO: support empty value when prefix-attribute defined, add and remove the attribute
|
|
219
219
|
|
|
@@ -229,7 +229,7 @@ const CoCreateEvents = {
|
|
|
229
229
|
if (values)
|
|
230
230
|
values = values.split(',');
|
|
231
231
|
else {
|
|
232
|
-
values = element.getValue()
|
|
232
|
+
values = await element.getValue()
|
|
233
233
|
if (!Array.isArray(values))
|
|
234
234
|
values = [values]
|
|
235
235
|
}
|
|
@@ -279,7 +279,7 @@ const CoCreateEvents = {
|
|
|
279
279
|
|
|
280
280
|
},
|
|
281
281
|
|
|
282
|
-
setValue: function (prefix, element, attrName, values, key, deactivate) {
|
|
282
|
+
setValue: async function (prefix, element, attrName, values, key, deactivate) {
|
|
283
283
|
let attrValues, oldValue;
|
|
284
284
|
if (key) {
|
|
285
285
|
key = `{{${key}}}`;
|
|
@@ -310,7 +310,7 @@ const CoCreateEvents = {
|
|
|
310
310
|
}
|
|
311
311
|
} else {
|
|
312
312
|
if (attrName === 'value') {
|
|
313
|
-
oldValue = element.getValue()
|
|
313
|
+
oldValue = await element.getValue()
|
|
314
314
|
} else if (attrName === 'text') {
|
|
315
315
|
attrValues = element.getAttribute(attrName).split(' ').map(x => x.trim());
|
|
316
316
|
oldValue = values.filter(x => attrValues.includes(x))[0] || '';
|