@cocreate/element-prototype 1.28.0 → 1.28.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 CHANGED
@@ -1,3 +1,11 @@
1
+ ## [1.28.1](https://github.com/CoCreate-app/CoCreate-element-prototype/compare/v1.28.0...v1.28.1) (2025-01-18)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * comment new regex and reinstate previous regex ([dfe7354](https://github.com/CoCreate-app/CoCreate-element-prototype/commit/dfe7354052718e247414e5c29b566c9532d80e79))
7
+ * range input returns a single number if if min not defiened ([07afdc4](https://github.com/CoCreate-app/CoCreate-element-prototype/commit/07afdc4f5132e800e3f63fa16edc2b8232afa5fe))
8
+
1
9
  # [1.28.0](https://github.com/CoCreate-app/CoCreate-element-prototype/compare/v1.27.0...v1.28.0) (2024-12-14)
2
10
 
3
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/element-prototype",
3
- "version": "1.28.0",
3
+ "version": "1.28.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
@@ -59,7 +59,9 @@ const getValue = (element) => {
59
59
  } else if (element.type === "number") {
60
60
  value = Number(value);
61
61
  } else if (element.type === "range") {
62
- value = [Number(element.min), Number(element.value)];
62
+ if (Number(element.min))
63
+ value = [Number(element.min), Number(element.value)];
64
+ else value = Number(element.value);
63
65
  } else if (element.type === "password") {
64
66
  value = btoa(value || "");
65
67
  } else if (element.type === "email") {
@@ -344,6 +346,9 @@ const getValue = (element) => {
344
346
 
345
347
  function regexParser(string) {
346
348
  let regex, replacement;
349
+ // Match a regex pattern enclosed by delimiters or a bare regex string
350
+ // let regexMatch = string.match(/^\/(.+)\/([gimuy]*)$/) || [null, string, ""];
351
+
347
352
  let regexMatch = string.match(/\/(.+)\/([gimuy]*)/);
348
353
  if (regexMatch) {
349
354
  regex = new RegExp(regexMatch[1], regexMatch[2]);