@cocreate/elements
Advanced tools
Comparing version 1.26.1 to 1.26.2
{ | ||
"name": "@cocreate/elements", | ||
"version": "1.26.1", | ||
"version": "1.26.2", | ||
"description": "Fetch content into any html element by using html5 attributes to query data stored in CoCreate headless CMS. If data is changed it will instantly reflect in html tags as changes are broadcasted in realtime", | ||
@@ -61,10 +61,10 @@ "keywords": [ | ||
"dependencies": { | ||
"@cocreate/actions": "^1.12.1", | ||
"@cocreate/crud-client": "^1.28.12", | ||
"@cocreate/element-prototype": "^1.11.8", | ||
"@cocreate/filter": "^1.23.6", | ||
"@cocreate/observer": "^1.11.7", | ||
"@cocreate/render": "^1.29.1", | ||
"@cocreate/utils": "^1.26.2" | ||
"@cocreate/actions": "^1.12.3", | ||
"@cocreate/crud-client": "^1.28.14", | ||
"@cocreate/element-prototype": "^1.13.0", | ||
"@cocreate/filter": "^1.23.8", | ||
"@cocreate/observer": "^1.11.9", | ||
"@cocreate/render": "^1.30.1", | ||
"@cocreate/utils": "^1.27.1" | ||
} | ||
} |
@@ -41,3 +41,2 @@ /******************************************************************************** | ||
/** */ | ||
async function init(element) { | ||
@@ -53,3 +52,3 @@ if (element && !(element instanceof HTMLCollection) && !Array.isArray(element)) | ||
for (let i = 0; i < element.length; i++) { | ||
if (elements.has(element[i]) || element.tagName === 'FORM') | ||
if (elements.has(element[i]) || element[i].tagName === 'FORM') | ||
continue | ||
@@ -166,3 +165,3 @@ | ||
if (data.object || data.object === '') { | ||
if (data.object || data.object === '' || data.key || data.key === '') { | ||
if (!data.array || data.array && !data.array.length) return | ||
@@ -230,2 +229,5 @@ data.type = 'object' | ||
if (!data.$filter && (!data[data.type] || !data[data.type].length)) | ||
return | ||
if (!(element instanceof HTMLCollection) && !Array.isArray(element)) | ||
@@ -338,8 +340,9 @@ element = [element] | ||
await checkFilters(element, data, type) | ||
else if (element.renderValue) | ||
element.renderValue(data); | ||
// render({ element, data, key: type }); | ||
else if (data) | ||
else if (element.renderValue) { | ||
await element.renderValue(data); | ||
} else if (data) | ||
element.setValue(data) | ||
filter.filters.get(element).index = data.$filter.index | ||
const evt = new CustomEvent('fetchedData', { bubbles: true }); | ||
@@ -863,2 +866,4 @@ element.dispatchEvent(evt); | ||
keys.get(key).elements.delete(element[i]) | ||
if (!keys.get(key).elements.size) | ||
keys.delete(key) | ||
} | ||
@@ -871,4 +876,9 @@ elements.delete(element[i]) | ||
if (key) { | ||
if (element[i].getFilter) | ||
filter.filters.delete(element[i]) | ||
keys.get(key).elements.delete(element[i]) | ||
elements.delete(element[i]) | ||
if (!keys.get(key).elements.size) | ||
keys.delete(key) | ||
// debounce.delete(key) | ||
@@ -879,2 +889,4 @@ let form = element[i].closest('form') | ||
form.elements.delete(element[i]) | ||
if (!form.elements.size) | ||
forms.delete(form) | ||
} | ||
@@ -887,8 +899,8 @@ } | ||
function initSocket() { | ||
const array = ['create', 'update', 'delete']; | ||
const attributes = ["storage", "database", "array", "index", "object", 'filter']; | ||
const type = ["storage", "database", "array", "index", "object", 'filter']; | ||
const method = ['create', 'update', 'delete']; | ||
for (let i = 0; i < array.length; i++) { | ||
for (let j = 0; j < attributes.length; j++) { | ||
const action = array[i] + '.' + attributes[j]; | ||
for (let i = 0; i < type.length; i++) { | ||
for (let j = 0; j < method.length; j++) { | ||
const action = type[i] + '.' + method[j]; | ||
@@ -1061,3 +1073,4 @@ CRUD.listen(action, function (data) { | ||
// } else | ||
if (mutation.target.hasAttribute('render-clone')) return | ||
if (mutation.target.hasAttribute('render-clone')) | ||
return | ||
remove(mutation.target) | ||
@@ -1064,0 +1077,0 @@ } |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
198374
1281
Updated@cocreate/actions@^1.12.3
Updated@cocreate/filter@^1.23.8
Updated@cocreate/observer@^1.11.9
Updated@cocreate/render@^1.30.1
Updated@cocreate/utils@^1.27.1