@cocreate/local-storage 1.12.0 → 1.14.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 +14 -0
- package/package.json +3 -3
- package/src/index.js +11 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [1.14.0](https://github.com/CoCreate-app/CoCreate-local-storage/compare/v1.13.0...v1.14.0) (2024-01-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* observe added nodes [localstorage-set] ([7aff443](https://github.com/CoCreate-app/CoCreate-local-storage/commit/7aff4437cd4188fffb8d570df1eb31a4218045b2))
|
|
7
|
+
|
|
8
|
+
# [1.13.0](https://github.com/CoCreate-app/CoCreate-local-storage/compare/v1.12.0...v1.13.0) (2023-11-25)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* upgrade dependencies for latest features and fixes ([f511bf3](https://github.com/CoCreate-app/CoCreate-local-storage/commit/f511bf38c1dfa70e79a60fb0f96c1fbafe97f192))
|
|
14
|
+
|
|
1
15
|
# [1.12.0](https://github.com/CoCreate-app/CoCreate-local-storage/compare/v1.11.1...v1.12.0) (2023-11-25)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/local-storage",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
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",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"webpack-log": "^3.0.1"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@cocreate/actions": "^1.
|
|
62
|
-
"@cocreate/observer": "^1.
|
|
61
|
+
"@cocreate/actions": "^1.14.0",
|
|
62
|
+
"@cocreate/observer": "^1.14.0"
|
|
63
63
|
}
|
|
64
64
|
}
|
package/src/index.js
CHANGED
|
@@ -186,6 +186,17 @@ action.init({
|
|
|
186
186
|
},
|
|
187
187
|
})
|
|
188
188
|
|
|
189
|
+
observer.init({
|
|
190
|
+
observe: ['addedNodes'],
|
|
191
|
+
target: "[localstorage-set]",
|
|
192
|
+
callback: async function (mutation) {
|
|
193
|
+
let key = mutation.target.getAttribute('localstorage-set')
|
|
194
|
+
let value = await mutation.target.getValue()
|
|
195
|
+
if (key && value)
|
|
196
|
+
localStorage.setItem(key, value)
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
|
|
189
200
|
CoCreateLocalStorage.checkSupport()
|
|
190
201
|
|
|
191
202
|
export default CoCreateLocalStorage;
|