@cocreate/element-prototype
Advanced tools
Comparing version 1.17.0 to 1.18.0
@@ -0,1 +1,14 @@ | ||
# [1.18.0](https://github.com/CoCreate-app/CoCreate-element-prototype/compare/v1.17.0...v1.18.0) (2024-01-17) | ||
### Bug Fixes | ||
* handle checkbox value true ([ec73ce0](https://github.com/CoCreate-app/CoCreate-element-prototype/commit/ec73ce0ecfff3a21c2f3b333514ca166ca28a69a)) | ||
* handling checkbox defualt values ([635f262](https://github.com/CoCreate-app/CoCreate-element-prototype/commit/635f2626e7be3117dea6a4603bea45a7d80ba82a)) | ||
### Features | ||
* if value matches operators $user_id, $organization_id, $clientId will return from localStorage ([e4bb41a](https://github.com/CoCreate-app/CoCreate-element-prototype/commit/e4bb41a47350d97c64677f68f0d28b356e981122)) | ||
# [1.17.0](https://github.com/CoCreate-app/CoCreate-element-prototype/compare/v1.16.0...v1.17.0) (2023-12-18) | ||
@@ -2,0 +15,0 @@ |
{ | ||
"name": "@cocreate/element-prototype", | ||
"version": "1.17.0", | ||
"version": "1.18.0", | ||
"description": "A simple element-prototype component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -49,6 +49,9 @@ const storage = new Map() | ||
} else { | ||
if (element.checked) | ||
value = element.value || 'true' | ||
else if (!element.value) | ||
value = 'false' | ||
if (element.checked) { | ||
if (element.hasAttribute('value')) | ||
value = element.value || true | ||
else | ||
value = true | ||
} else | ||
value = false | ||
@@ -110,2 +113,8 @@ } | ||
if (value === '$user_id') | ||
value = localStorage.getItem('user_id') | ||
else if (value === '$organization_id') | ||
value = localStorage.getItem('organization_id') | ||
else if (value === '$clientId') | ||
value = localStorage.getItem('clientId') | ||
return value; | ||
@@ -112,0 +121,0 @@ }; |
@@ -50,3 +50,3 @@ import { getAttributes } from '@cocreate/utils'; | ||
if (inputs[i].value) { | ||
if (value.includes(inputs[i].value)) | ||
if (value === true || value.includes(inputs[i].value)) | ||
inputs[i].checked = true; | ||
@@ -53,0 +53,0 @@ else |
123924
445