@cocreate/element-prototype 1.11.8 → 1.13.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 +27 -0
- package/demo/index.html +3 -3
- package/docs/index.html +2 -2
- package/package.json +2 -2
- package/src/getValue.js +4 -0
- package/src/setValue.js +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
# [1.13.0](https://github.com/CoCreate-app/CoCreate-element-prototype/compare/v1.12.0...v1.13.0) (2023-11-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* date updated to ISO format ([8ec67ff](https://github.com/CoCreate-app/CoCreate-element-prototype/commit/8ec67ffef140da947d04c8536020cea5fc6f52aa))
|
|
7
|
+
* meta name typo ([c06c126](https://github.com/CoCreate-app/CoCreate-element-prototype/commit/c06c12612b00e97b5b34f199dbc53e0754175ca5))
|
|
8
|
+
* typo el to element ([66a53cb](https://github.com/CoCreate-app/CoCreate-element-prototype/commit/66a53cb65b2069fd5eae5b5dafdd3a2b77c9c2ba))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* input date types are automatically converted to ISO format with UTC timezone Z and rendered in inputs in users local time ([c628140](https://github.com/CoCreate-app/CoCreate-element-prototype/commit/c628140baedeb85ea54da98267ea751bd3026258))
|
|
14
|
+
|
|
15
|
+
# [1.12.0](https://github.com/CoCreate-app/CoCreate-element-prototype/compare/v1.11.8...v1.12.0) (2023-11-03)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* favicon.ico path ([7570a08](https://github.com/CoCreate-app/CoCreate-element-prototype/commit/7570a0887e2aefac5f8f52d8b98a33f377c49183))
|
|
21
|
+
* update dependencies to the lates versions ([871484a](https://github.com/CoCreate-app/CoCreate-element-prototype/commit/871484ab69816515ca968599c72bc23432e1f6e0))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* converts input type date to systems local date timezone ([4235ceb](https://github.com/CoCreate-app/CoCreate-element-prototype/commit/4235ceb2ddb1a9aca026864a53c2418ff47b3d52))
|
|
27
|
+
|
|
1
28
|
## [1.11.8](https://github.com/CoCreate-app/CoCreate-element-prototype/compare/v1.11.7...v1.11.8) (2023-10-25)
|
|
2
29
|
|
|
3
30
|
|
package/demo/index.html
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
7
|
<link
|
|
8
8
|
rel="icon"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
type="image/png"
|
|
10
|
+
sizes="32x32"
|
|
11
|
+
href="../assets/favicon.ico" />
|
|
12
12
|
<title>element-prototype | CoCreateJS</title>
|
|
13
13
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
14
14
|
</head>
|
package/docs/index.html
CHANGED
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
sizes="32x32"
|
|
12
12
|
href="https://cocreate.app/images/favicon.ico" />
|
|
13
13
|
<meta
|
|
14
|
-
|
|
14
|
+
name="description"
|
|
15
15
|
content="A simple HTML5 and pure javascript component. Easy configuration using data-attributes and highly styleable." />
|
|
16
16
|
<meta
|
|
17
|
-
|
|
17
|
+
name="keywords"
|
|
18
18
|
content="helper classes, utility classes, css framework, css library, inline style classes" />
|
|
19
19
|
<meta name="robots" content="index,follow" />
|
|
20
20
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/element-prototype",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
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",
|
|
@@ -58,6 +58,6 @@
|
|
|
58
58
|
"webpack-log": "^3.0.1"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@cocreate/utils": "^1.26.
|
|
61
|
+
"@cocreate/utils": "^1.26.2"
|
|
62
62
|
}
|
|
63
63
|
}
|
package/src/getValue.js
CHANGED
|
@@ -70,6 +70,10 @@ const getValue = (element) => {
|
|
|
70
70
|
optionValue = prefix + optionValue + suffix;
|
|
71
71
|
value.push(optionValue);
|
|
72
72
|
}
|
|
73
|
+
} else if (["time", "datetime", "datetime-local"].includes(element.type)) {
|
|
74
|
+
value = new Date(value).toISOString();
|
|
75
|
+
if (el.type === 'time')
|
|
76
|
+
value = value.substring(11, 8) + 'Z';
|
|
73
77
|
} else if (element.tagName == 'INPUT' || element.tagName == 'SELECT') {
|
|
74
78
|
value = element.value;
|
|
75
79
|
} else if (element.tagName == 'TEXTAREA') {
|
package/src/setValue.js
CHANGED
|
@@ -22,6 +22,9 @@ const setValue = (el, value) => {
|
|
|
22
22
|
else if (typeof value === 'object')
|
|
23
23
|
value = JSON.stringify(value, null, 2)
|
|
24
24
|
|
|
25
|
+
if (["time", "datetime", "datetime-local"].includes(el.type))
|
|
26
|
+
value = new Date(el.value).toLocalString();
|
|
27
|
+
|
|
25
28
|
let valueType = el.getAttribute('value-type');
|
|
26
29
|
let prefix = el.getAttribute('value-prefix') || "";
|
|
27
30
|
if (prefix)
|