@cocreate/elements 1.4.7 → 1.4.11

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,31 @@
1
+ ## [1.4.11](https://github.com/CoCreate-app/CoCreate-elements/compare/v1.4.10...v1.4.11) (2021-12-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * renamed filter-value_type to filter-value-type ([5ec9280](https://github.com/CoCreate-app/CoCreate-elements/commit/5ec928076ba52fe83f526208091778eb00a81a03))
7
+
8
+ ## [1.4.10](https://github.com/CoCreate-app/CoCreate-elements/compare/v1.4.9...v1.4.10) (2021-12-20)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * firefox setValue content is removed if iframe.srcDoc is removed ([68da8ec](https://github.com/CoCreate-app/CoCreate-elements/commit/68da8ec1736997af6e814e50c737b8761013a5b7))
14
+
15
+ ## [1.4.9](https://github.com/CoCreate-app/CoCreate-elements/compare/v1.4.8...v1.4.9) (2021-12-15)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * update dependencies ([bdaac79](https://github.com/CoCreate-app/CoCreate-elements/commit/bdaac7913394558924241d4bd284834b0c26b626))
21
+
22
+ ## [1.4.8](https://github.com/CoCreate-app/CoCreate-elements/compare/v1.4.7...v1.4.8) (2021-12-14)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * update dependencies ([2978bf0](https://github.com/CoCreate-app/CoCreate-elements/commit/2978bf01751416468ed1677b30cfc47c592bf6ab))
28
+
1
29
  ## [1.4.7](https://github.com/CoCreate-app/CoCreate-elements/compare/v1.4.6...v1.4.7) (2021-11-27)
2
30
 
3
31
 
@@ -50,13 +50,13 @@
50
50
  <!--<table class="width:100% border-collapse:collapse">-->
51
51
  <!-- <tr class="border-bottom:1px_solid_darkgray">-->
52
52
  <!-- <td class="position:sticky top:0 background:white padding-top:0 padding:10px ">-->
53
- <!-- <input type="text" class="floating-label" filter-name="name" filter-value_type="string" filter-operator="" template_id="datatable" placeholder="Name">-->
53
+ <!-- <input type="text" class="floating-label" filter-name="name" template_id="datatable" placeholder="Name">-->
54
54
  <!-- <span class="position:absolute bottom:18px right:20px float:right font-size:18px z-index:6">-->
55
55
  <!-- <a order-by="name" toggle-order="asc" template_id="datatable"></a>-->
56
56
  <!-- </span>-->
57
57
  <!-- </td>-->
58
58
  <!-- <td class="position:sticky top:0 background:white padding:10px padding-top:0">-->
59
- <!-- <input type="text" class="floating-label" filter-name="Document Id" filter-value_type="string" template_id="datatable" placeholder="Type" />-->
59
+ <!-- <input type="text" class="floating-label" filter-name="Document Id" template_id="datatable" placeholder="Type" />-->
60
60
  <!-- <span class="position:absolute bottom:18px right:20px float:right font-size:18px z-index:6">-->
61
61
  <!-- <a order-by="_id" toggle-order="asc" template_id="datatable"></a>-->
62
62
  <!-- </span>-->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/elements",
3
- "version": "1.4.7",
3
+ "version": "1.4.11",
4
4
  "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",
5
5
  "keywords": [
6
6
  "elements",
@@ -61,9 +61,9 @@
61
61
  "webpack-log": "^3.0.1"
62
62
  },
63
63
  "dependencies": {
64
- "@cocreate/actions": "^1.3.23",
65
- "@cocreate/crud-client": "^1.4.38",
66
- "@cocreate/docs": "^1.2.60",
67
- "@cocreate/observer": "^1.3.52"
64
+ "@cocreate/actions": "^1.3.25",
65
+ "@cocreate/crud-client": "^1.4.40",
66
+ "@cocreate/docs": "^1.2.62",
67
+ "@cocreate/observer": "^1.3.54"
68
68
  }
69
69
  }
package/src/getValue.js CHANGED
@@ -18,15 +18,17 @@ function initElement(element) {
18
18
  let value = getValue(valueEl)
19
19
  setValue(element, value)
20
20
 
21
- if (['INPUT', 'TEXTAREA', 'SELECT'].includes(valueEl.tagName) || valueEl.contentEditable)
21
+ // if (['INPUT', 'TEXTAREA', 'SELECT'].includes(valueEl.tagName) || valueEl.contentEditable)
22
22
 
23
- valueEl.addEventListener('input', (e) => {
24
- setValueByFind(e.target)
25
- })
23
+ // valueEl.addEventListener('input', (e) => {
24
+ // setValueByFind(e.target)
25
+ // })
26
26
 
27
- valueEl.addEventListener('updated_by_fetch', (e) => {
28
- setValueByFind(e.target)
29
- })
27
+ // valueEl.addEventListener('updated_by_fetch', (e) => {
28
+ // setValueByFind(e.target)
29
+ // })
30
+
31
+ initEvents(valueEl);
30
32
 
31
33
  element.dispatchEvent(new Event("input", {
32
34
  "bubbles": true
@@ -34,6 +36,21 @@ function initElement(element) {
34
36
 
35
37
  }
36
38
 
39
+ const valueEls = new Map();
40
+ function initEvents(valueEl){
41
+ if (!valueEls.has(valueEl)) {
42
+ valueEls.set(valueEl);
43
+ if (['INPUT', 'TEXTAREA', 'SELECT'].includes(valueEl.tagName) || valueEl.contentEditable)
44
+ valueEl.addEventListener('input', (e) => {
45
+ setValueByFind(e.target)
46
+ })
47
+
48
+ valueEl.addEventListener('updated_by_fetch', (e) => {
49
+ setValueByFind(e.target)
50
+ })
51
+ }
52
+ }
53
+
37
54
  function setValueByFind(valueEl){
38
55
  let value = getValue(valueEl)
39
56
  let id = valueEl.getAttribute('id')
package/src/setValue.js CHANGED
@@ -38,6 +38,11 @@ var setValue = (el, value) => {
38
38
 
39
39
  else if (el.tagName === 'IFRAME') {
40
40
  el.srcdoc = value;
41
+ // el.contentDocument.documentElement.innerHTML = value;
42
+ if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1){
43
+ // Do Firefox-related activities
44
+ }
45
+ else
41
46
  el.onload = function(e) {
42
47
  el.removeAttribute('srcdoc');
43
48
  };