@cocreate/local-storage 1.2.51 → 1.2.55
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 +28 -0
- package/demo/index.html +8 -8
- package/docs/index.html +2 -2
- package/package.json +1 -1
- package/src/index.js +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
## [1.2.55](https://github.com/CoCreate-app/CoCreate-local-storage/compare/v1.2.54...v1.2.55) (2022-02-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* update action param to name ([7b19bbd](https://github.com/CoCreate-app/CoCreate-local-storage/commit/7b19bbd45195e625a4b33e27b394868497bb2c64))
|
|
7
|
+
|
|
8
|
+
## [1.2.54](https://github.com/CoCreate-app/CoCreate-local-storage/compare/v1.2.53...v1.2.54) (2022-02-10)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* replace class hidden with attribute hidden ([c1a89d5](https://github.com/CoCreate-app/CoCreate-local-storage/commit/c1a89d55b38f2bd223d007f017db296c647b603e))
|
|
14
|
+
|
|
15
|
+
## [1.2.53](https://github.com/CoCreate-app/CoCreate-local-storage/compare/v1.2.52...v1.2.53) (2022-01-01)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* get-value attribute value now supports a selector added # to all values currently in get-value attributes ([d793164](https://github.com/CoCreate-app/CoCreate-local-storage/commit/d7931643e607bba6f630e492d8139b3a93a2bc68))
|
|
21
|
+
|
|
22
|
+
## [1.2.52](https://github.com/CoCreate-app/CoCreate-local-storage/compare/v1.2.51...v1.2.52) (2022-01-01)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* removed data- from attributes ([f618968](https://github.com/CoCreate-app/CoCreate-local-storage/commit/f6189689a6879387e900a4b35c2b0159497a8c8f))
|
|
28
|
+
|
|
1
29
|
## [1.2.51](https://github.com/CoCreate-app/CoCreate-local-storage/compare/v1.2.50...v1.2.51) (2021-12-15)
|
|
2
30
|
|
|
3
31
|
|
package/demo/index.html
CHANGED
|
@@ -7,24 +7,24 @@
|
|
|
7
7
|
</head>
|
|
8
8
|
<body>
|
|
9
9
|
<form>set
|
|
10
|
-
<input type="text"
|
|
10
|
+
<input type="text" localstorage-set="test" name="" placeholder="SET"/>
|
|
11
11
|
<!--<button type="submit" value="Submit" actions="localstorage">RUN</button>-->
|
|
12
12
|
<button type="button" class="outline red-white" actions="localStorage">RUN</button>
|
|
13
13
|
</form>
|
|
14
14
|
<form>set
|
|
15
|
-
<input type="text"
|
|
16
|
-
<input type="text"
|
|
17
|
-
<!--<input type="text"
|
|
15
|
+
<input type="text" localstorage-get="test" name="" placeholder="get"/>
|
|
16
|
+
<input type="text" localstorage-set="test2" name="" placeholder="SET"/>
|
|
17
|
+
<!--<input type="text" localstorage-remove="test" name="" placeholder="remove"/>-->
|
|
18
18
|
<button type="button" class="outline red-white" actions="localStorage">RUN</button>
|
|
19
19
|
</form>
|
|
20
20
|
<form>get
|
|
21
|
-
<input type="text"
|
|
22
|
-
<input type="text"
|
|
21
|
+
<input type="text" localstorage-get="test" name="" placeholder="get"/>
|
|
22
|
+
<input type="text" localstorage-get="test2" name="" placeholder="get"/>
|
|
23
23
|
<button type="button" class="outline red-white" actions="localStorage">RUN</button>
|
|
24
24
|
</form>
|
|
25
25
|
<form>remove
|
|
26
|
-
<input type="text"
|
|
27
|
-
<input type="text"
|
|
26
|
+
<input type="text" localstorage-remove="test" name="" placeholder="remove"/>
|
|
27
|
+
<input type="text" localstorage-remove="test2" name="" placeholder="remove"/>
|
|
28
28
|
<button type="button" class="outline red-white" actions="localStorage">RUN</button>
|
|
29
29
|
</form>
|
|
30
30
|
|
package/docs/index.html
CHANGED
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
<div class="container svColumn overflow:hidden card position:relative border-radius:2px width:auto height:100%" id="sandbox">
|
|
102
102
|
<div class="font-size:20px position:absolute top:10px right:10px opacity:0.6">
|
|
103
103
|
<a class="margin-right:10px" id="code" show="#preview" hide="#code, #view"><i class="far fa-eye"></i></a>
|
|
104
|
-
<a class="margin-right:10px
|
|
104
|
+
<a class="margin-right:10px" id="preview" show="#code, #view" hide="#preview" hidden><i class="fas fa-code"></i></a>
|
|
105
105
|
<a class="margin-right:5px" fullscreen target="#playground"><i class="fas fa-expand"></i></a>
|
|
106
106
|
</div>
|
|
107
107
|
<div class="svRow">
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
<div class="svSplitter svHorizontal"> </div>
|
|
115
115
|
|
|
116
116
|
<div class="svPanel">
|
|
117
|
-
<iframe get-value="demo" frameBorder="0" height="100%" width="100%" class="min-width:300px"></iframe>
|
|
117
|
+
<iframe get-value="#demo" frameBorder="0" height="100%" width="100%" class="min-width:300px"></iframe>
|
|
118
118
|
</div>
|
|
119
119
|
|
|
120
120
|
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/local-storage",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.55",
|
|
4
4
|
"description": "A Simple component similar to CoCreate-input & CoCreate-fetch which Save and fetch data for inputs, textarea, selects from localstorage. Easily configured using HTML5 attributes and/or JavaScript API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"local-storage",
|
package/src/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const CoCreateLocalStorage = {
|
|
3
3
|
|
|
4
4
|
init: function() {
|
|
5
|
-
var elements = document.querySelectorAll('[
|
|
5
|
+
var elements = document.querySelectorAll('[localstorage-set], [localstorage-get]');
|
|
6
6
|
this.initElements(elements)
|
|
7
7
|
},
|
|
8
8
|
|
|
@@ -21,7 +21,7 @@ const CoCreateLocalStorage = {
|
|
|
21
21
|
},
|
|
22
22
|
|
|
23
23
|
get: function(element) {
|
|
24
|
-
let key = element.getAttribute('
|
|
24
|
+
let key = element.getAttribute('localstorage-get');
|
|
25
25
|
if (!key) return;
|
|
26
26
|
let value = window.localStorage.getItem(key)
|
|
27
27
|
if(value != null){
|
|
@@ -30,7 +30,7 @@ const CoCreateLocalStorage = {
|
|
|
30
30
|
},
|
|
31
31
|
|
|
32
32
|
set: function(element) {
|
|
33
|
-
let key = element.getAttribute('
|
|
33
|
+
let key = element.getAttribute('localstorage-set');
|
|
34
34
|
if(element.value && key){
|
|
35
35
|
window.localStorage.setItem(key, element.value);
|
|
36
36
|
}
|
|
@@ -38,7 +38,7 @@ const CoCreateLocalStorage = {
|
|
|
38
38
|
|
|
39
39
|
remove: function(element) {
|
|
40
40
|
element.value = '';
|
|
41
|
-
let key = element.getAttribute('
|
|
41
|
+
let key = element.getAttribute('localstorage-remove');
|
|
42
42
|
if (key) {
|
|
43
43
|
window.localStorage.removeItem(key)
|
|
44
44
|
}
|
|
@@ -49,26 +49,26 @@ const CoCreateLocalStorage = {
|
|
|
49
49
|
let storage = window.localStorage;
|
|
50
50
|
if (!form) return;
|
|
51
51
|
|
|
52
|
-
let set_els = form.querySelectorAll('[
|
|
52
|
+
let set_els = form.querySelectorAll('[localstorage-set]')
|
|
53
53
|
set_els.forEach(input=>{
|
|
54
|
-
let key = input.getAttribute('
|
|
54
|
+
let key = input.getAttribute('localstorage-set');
|
|
55
55
|
if(input.value && key){
|
|
56
56
|
storage.setItem(key, input.value);
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
|
-
let get_els = form.querySelectorAll('[
|
|
59
|
+
let get_els = form.querySelectorAll('[localstorage-get]')
|
|
60
60
|
get_els.forEach(input=>{
|
|
61
|
-
let key = input.getAttribute('
|
|
61
|
+
let key = input.getAttribute('localstorage-get');
|
|
62
62
|
if (!key) return;
|
|
63
63
|
let value = storage.getItem(key)
|
|
64
64
|
if(value != null){
|
|
65
65
|
input.value = value;
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
|
-
let remove_els = form.querySelectorAll('[
|
|
68
|
+
let remove_els = form.querySelectorAll('[localstorage-remove]')
|
|
69
69
|
remove_els.forEach(input=>{
|
|
70
70
|
input.value = '';
|
|
71
|
-
let key = input.getAttribute('
|
|
71
|
+
let key = input.getAttribute('localstorage-remove');
|
|
72
72
|
if (key) {
|
|
73
73
|
storage.removeItem(key)
|
|
74
74
|
}
|
|
@@ -82,7 +82,7 @@ const CoCreateLocalStorage = {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
CoCreate.action.init({
|
|
85
|
-
|
|
85
|
+
name: "localStorage",
|
|
86
86
|
endEvent: "localStorage",
|
|
87
87
|
callback: (btn, data) => {
|
|
88
88
|
CoCreateLocalStorage.runStorage(btn)
|
|
@@ -90,7 +90,7 @@ CoCreate.action.init({
|
|
|
90
90
|
})
|
|
91
91
|
|
|
92
92
|
CoCreate.action.init({
|
|
93
|
-
|
|
93
|
+
name: "localStorageRemove",
|
|
94
94
|
endEvent: "localStorageRemoved",
|
|
95
95
|
callback: (btn, data) => {
|
|
96
96
|
CoCreateLocalStorage.runStorage(btn)
|