saasufy-components 6.0.0 → 6.0.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.
@@ -138,6 +138,7 @@ class CollectionReducer extends SocketConsumer {
138
138
 
139
139
  renderReduction() {
140
140
  let viewportSlot = this.shadowRoot.querySelector('slot[name="viewport"]');
141
+ if (!viewportSlot) return;
141
142
 
142
143
  let viewportNode = viewportSlot.assignedNodes()[0];
143
144
  if (!viewportNode) return;
@@ -176,11 +177,19 @@ class CollectionReducer extends SocketConsumer {
176
177
  }
177
178
 
178
179
  render() {
180
+ if (
181
+ !this.hasAttribute('collection-type') ||
182
+ !this.hasAttribute('collection-fields') ||
183
+ !this.hasAttribute('collection-view') ||
184
+ !this.getAttribute('collection-view-params')
185
+ ) {
186
+ return;
187
+ };
179
188
  let collectionType = this.getAttribute('collection-type');
180
189
  let collectionFields = this.getAttribute('collection-fields') || '';
181
- let collectionView = this.getAttribute('collection-view');
182
- let collectionPageSize = this.getAttribute('collection-page-size');
190
+ let collectionView = this.getAttribute('collection-view') || 'defaultView';
183
191
  let collectionViewParams = this.getAttribute('collection-view-params') || '';
192
+ let collectionPageSize = this.getAttribute('collection-page-size');
184
193
  let collectionPageOffset = this.getAttribute('collection-page-offset');
185
194
  let collectionGetCount = this.hasAttribute('collection-get-count');
186
195
  let hideErrorLogs = this.hasAttribute('hide-error-logs');
@@ -201,6 +201,7 @@ class CollectionViewer extends SocketConsumer {
201
201
 
202
202
  renderList() {
203
203
  let viewportSlot = this.shadowRoot.querySelector('slot[name="viewport"]');
204
+ if (!viewportSlot) return;
204
205
 
205
206
  let viewportNode = viewportSlot.assignedNodes()[0];
206
207
  if (!viewportNode) return;
@@ -271,12 +272,20 @@ class CollectionViewer extends SocketConsumer {
271
272
  }
272
273
 
273
274
  render() {
275
+ if (
276
+ !this.hasAttribute('collection-type') ||
277
+ !this.hasAttribute('collection-fields') ||
278
+ !this.hasAttribute('collection-view') ||
279
+ !this.getAttribute('collection-view-params')
280
+ ) {
281
+ return;
282
+ };
274
283
  let collectionType = this.getAttribute('collection-type');
275
284
  let collectionFields = this.getAttribute('collection-fields') || '';
276
285
  let collectionView = this.getAttribute('collection-view') || 'defaultView';
277
- let collectionPageSize = this.getAttribute('collection-page-size');
278
286
  let collectionViewParams = this.getAttribute('collection-view-params') || '';
279
287
  let collectionViewPrimaryFields = this.getAttribute('collection-view-primary-fields');
288
+ let collectionPageSize = this.getAttribute('collection-page-size');
280
289
  let collectionPageOffset = this.getAttribute('collection-page-offset');
281
290
  let collectionGetCount = this.hasAttribute('collection-get-count');
282
291
  let hideErrorLogs = this.hasAttribute('hide-error-logs');
package/model-input.js CHANGED
@@ -105,6 +105,13 @@ class ModelInput extends SocketConsumer {
105
105
  }
106
106
 
107
107
  render() {
108
+ if (
109
+ !this.hasAttribute('model-type') ||
110
+ !this.hasAttribute('model-id') ||
111
+ !this.hasAttribute('model-field')
112
+ ) {
113
+ return;
114
+ };
108
115
  this.innerHTML = '';
109
116
  let socketInstanceProperty = this.getAttribute('socket-instance-property');
110
117
  let showErrorMessage = this.hasAttribute('show-error-message');
package/model-text.js CHANGED
@@ -47,6 +47,13 @@ class ModelText extends SocketConsumer {
47
47
  }
48
48
 
49
49
  render() {
50
+ if (
51
+ !this.hasAttribute('model-type') ||
52
+ !this.hasAttribute('model-id') ||
53
+ !this.hasAttribute('model-field')
54
+ ) {
55
+ return;
56
+ };
50
57
  this.innerHTML = '';
51
58
  let socketInstanceProperty = this.getAttribute('socket-instance-property');
52
59
  let modelType = this.getAttribute('model-type');
package/model-viewer.js CHANGED
@@ -54,6 +54,7 @@ class ModelViewer extends SocketConsumer {
54
54
 
55
55
  renderItem() {
56
56
  let viewportSlot = this.shadowRoot.querySelector('slot[name="viewport"]');
57
+ if (!viewportSlot) return;
57
58
 
58
59
  let viewportNode = viewportSlot.assignedNodes()[0];
59
60
  if (!viewportNode) return;
@@ -89,6 +90,13 @@ class ModelViewer extends SocketConsumer {
89
90
  }
90
91
 
91
92
  render() {
93
+ if (
94
+ !this.hasAttribute('model-type') ||
95
+ !this.hasAttribute('model-id') ||
96
+ !this.hasAttribute('model-fields')
97
+ ) {
98
+ return;
99
+ };
92
100
  let socketInstanceProperty = this.getAttribute('socket-instance-property');
93
101
  let modelType = this.getAttribute('model-type');
94
102
  let modelId = this.getAttribute('model-id');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saasufy-components",
3
- "version": "6.0.0",
3
+ "version": "6.0.1",
4
4
  "description": "Components for Saasufy.",
5
5
  "main": "index.js",
6
6
  "scripts": {