@cocreate/element-prototype 1.22.0 → 1.22.1
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 +8 -0
- package/package.json +1 -1
- package/src/getValue.js +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [1.22.1](https://github.com/CoCreate-app/CoCreate-element-prototype/compare/v1.22.0...v1.22.1) (2024-03-18)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* getAttribute type ([17545c2](https://github.com/CoCreate-app/CoCreate-element-prototype/commit/17545c2c9ebb8766c455bce40a7e386f4fd94c47))
|
|
7
|
+
* handling of valueType text ([6e6663d](https://github.com/CoCreate-app/CoCreate-element-prototype/commit/6e6663db99938fee08178b5e8f136434632884e6))
|
|
8
|
+
|
|
1
9
|
# [1.22.0](https://github.com/CoCreate-app/CoCreate-element-prototype/compare/v1.21.0...v1.22.0) (2024-02-20)
|
|
2
10
|
|
|
3
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/element-prototype",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.1",
|
|
4
4
|
"description": "A simple element-prototype component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"element-prototype",
|
package/src/getValue.js
CHANGED
|
@@ -79,7 +79,7 @@ const getValue = (element) => {
|
|
|
79
79
|
optionValue = prefix + optionValue + suffix;
|
|
80
80
|
value.push(optionValue);
|
|
81
81
|
}
|
|
82
|
-
} else if (["time", "date", "datetime", "datetime-local"].includes(element.type)) {
|
|
82
|
+
} else if (["time", "date", "datetime", "datetime-local"].includes(element.getAttribute('type'))) {
|
|
83
83
|
if (value === '$now')
|
|
84
84
|
value = new Date()
|
|
85
85
|
else if (value)
|
|
@@ -124,6 +124,8 @@ const getValue = (element) => {
|
|
|
124
124
|
value = element.srcdoc;
|
|
125
125
|
} else if (element.hasAttribute('value')) {
|
|
126
126
|
value = element.getAttribute('value');
|
|
127
|
+
} else if (valueType === 'text') {
|
|
128
|
+
value = element.innerText;
|
|
127
129
|
} else {
|
|
128
130
|
value = element.innerHTML;
|
|
129
131
|
}
|