saasufy-components 2.4.2 → 2.5.1

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/model-input.js CHANGED
@@ -23,6 +23,7 @@ class ModelInput extends SocketConsumer {
23
23
  'input-id',
24
24
  'list',
25
25
  'model-instance-property',
26
+ 'bind-to-model',
26
27
  'bind-to-collection',
27
28
  'type',
28
29
  'placeholder',
@@ -65,8 +66,9 @@ class ModelInput extends SocketConsumer {
65
66
 
66
67
  render() {
67
68
  this.innerHTML = '';
68
- let modelInstanceProperty = this.getAttribute('model-instance-property');
69
+ let bindToModel = this.hasAttribute('bind-to-model');
69
70
  let bindToCollection = this.hasAttribute('bind-to-collection');
71
+ let modelInstanceProperty = this.getAttribute('model-instance-property');
70
72
  let showErrorMessage = this.hasAttribute('show-error-message');
71
73
  let inputId = this.getAttribute('input-id');
72
74
  let inputList = this.getAttribute('list');
@@ -100,6 +102,9 @@ class ModelInput extends SocketConsumer {
100
102
  }
101
103
  }
102
104
  if (!model) {
105
+ if (bindToModel) {
106
+ modelInstanceProperty = 'model';
107
+ }
103
108
  currentNode = this.parentNode;
104
109
  if (modelInstanceProperty) {
105
110
  while (currentNode) {
package/model-text.js CHANGED
@@ -37,8 +37,9 @@ class ModelText extends SocketConsumer {
37
37
 
38
38
  render() {
39
39
  this.innerHTML = '';
40
- let modelInstanceProperty = this.getAttribute('model-instance-property');
40
+ let bindToModel = this.hasAttribute('bind-to-model');
41
41
  let bindToCollection = this.hasAttribute('bind-to-collection');
42
+ let modelInstanceProperty = this.getAttribute('model-instance-property');
42
43
  let modelType = this.getAttribute('model-type');
43
44
  let modelId = this.getAttribute('model-id');
44
45
  let modelField = this.getAttribute('model-field');
@@ -64,6 +65,9 @@ class ModelText extends SocketConsumer {
64
65
  }
65
66
  }
66
67
  if (!model) {
68
+ if (bindToModel) {
69
+ modelInstanceProperty = 'model';
70
+ }
67
71
  currentNode = this.parentNode;
68
72
  if (modelInstanceProperty) {
69
73
  while (currentNode) {
package/model-viewer.js CHANGED
@@ -161,6 +161,8 @@ class ModelViewer extends SocketConsumer {
161
161
  (async () => {
162
162
  this.modelChangeConsumer = this.model.listener('change').createConsumer();
163
163
  for await (let event of this.modelChangeConsumer) {
164
+ // Ignore change events which originate from this collection instance.
165
+ if (!event.isRemote) continue;
164
166
  this.renderItem();
165
167
  }
166
168
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saasufy-components",
3
- "version": "2.4.2",
3
+ "version": "2.5.1",
4
4
  "description": "Components for Saasufy.",
5
5
  "main": "index.js",
6
6
  "scripts": {