saasufy-components 9.3.1 → 9.4.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.
@@ -75,6 +75,7 @@ class CollectionReducer extends SocketConsumer {
75
75
  'collection-page-size',
76
76
  'collection-page-offset',
77
77
  'collection-get-count',
78
+ 'realtime-fields',
78
79
  'max-show-loader',
79
80
  'type-alias'
80
81
  ];
@@ -217,6 +218,8 @@ class CollectionReducer extends SocketConsumer {
217
218
  let collectionPageOffset = this.getAttribute('collection-page-offset');
218
219
  let collectionGetCount = this.hasAttribute('collection-get-count');
219
220
 
221
+ let realtimeFields = this.hasAttribute('realtime-fields') ?
222
+ this.getAttribute('realtime-fields').split(',').map(field => field.trim()).filter(field => field) : null;
220
223
  let collectionReloadDelay = Number(
221
224
  this.getAttribute('collection-reload-delay') || DEFAULT_RELOAD_DELAY
222
225
  );
@@ -234,7 +237,8 @@ class CollectionReducer extends SocketConsumer {
234
237
  pageSize: Number(collectionPageSize || 10),
235
238
  pageOffset: Number(collectionPageOffset || 0),
236
239
  changeReloadDelay: collectionReloadDelay,
237
- getCount: collectionGetCount
240
+ getCount: collectionGetCount,
241
+ realtimeFields
238
242
  });
239
243
 
240
244
  this.shadowRoot.innerHTML = `
@@ -163,6 +163,7 @@ class CollectionViewer extends SocketConsumer {
163
163
  'collection-page-offset',
164
164
  'collection-get-count',
165
165
  'collection-disable-realtime',
166
+ 'realtime-fields',
166
167
  'auto-reset-page-offset',
167
168
  'max-show-loader',
168
169
  'type-alias'
@@ -379,6 +380,8 @@ class CollectionViewer extends SocketConsumer {
379
380
  let collectionPageOffset = this.getAttribute('collection-page-offset');
380
381
  let collectionGetCount = this.hasAttribute('collection-get-count');
381
382
  let collectionDisableRealtime = this.hasAttribute('collection-disable-realtime');
383
+ let realtimeFields = this.hasAttribute('realtime-fields') ?
384
+ this.getAttribute('realtime-fields').split(',').map(field => field.trim()).filter(field => field) : null;
382
385
  let collectionReloadDelay = Number(
383
386
  this.getAttribute('collection-reload-delay') || DEFAULT_RELOAD_DELAY
384
387
  );
@@ -402,7 +405,8 @@ class CollectionViewer extends SocketConsumer {
402
405
  pageOffset: Number(collectionPageOffset || 0),
403
406
  changeReloadDelay: collectionReloadDelay,
404
407
  getCount: collectionGetCount,
405
- realtimeCollection: !collectionDisableRealtime
408
+ realtimeCollection: !collectionDisableRealtime,
409
+ realtimeFields
406
410
  });
407
411
 
408
412
  this.shadowRoot.innerHTML = `
package/model-input.js CHANGED
@@ -50,7 +50,8 @@ class ModelInput extends SocketConsumer {
50
50
  'autocorrect',
51
51
  'input-id',
52
52
  'input-props',
53
- 'ignore-invalid-selection'
53
+ 'ignore-invalid-selection',
54
+ 'realtime-fields'
54
55
  ];
55
56
  }
56
57
 
package/model-viewer.js CHANGED
@@ -35,7 +35,8 @@ class ModelViewer extends SocketConsumer {
35
35
  'model-id',
36
36
  'model-fields',
37
37
  'fields-slice-to',
38
- 'type-alias'
38
+ 'type-alias',
39
+ 'realtime-fields'
39
40
  ];
40
41
  }
41
42
 
@@ -160,12 +161,16 @@ class ModelViewer extends SocketConsumer {
160
161
  }
161
162
  this.socket = socket;
162
163
 
164
+ let realtimeFields = this.hasAttribute('realtime-fields') ?
165
+ this.getAttribute('realtime-fields').split(',').map(field => field.trim()).filter(field => field) : null;
166
+
163
167
  this.model = new AGModel({
164
168
  socket: this.socket,
165
169
  type: modelType,
166
170
  id: modelId,
167
171
  fields: modelFields.split(',').map(field => field.trim()).filter(field => field),
168
- fieldTransformations
172
+ fieldTransformations,
173
+ realtimeFields
169
174
  });
170
175
 
171
176
  this.shadowRoot.innerHTML = `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saasufy-components",
3
- "version": "9.3.1",
3
+ "version": "9.4.0",
4
4
  "description": "Components for Saasufy.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,8 +17,8 @@
17
17
  "author": "Jonathan Gros-Dubois",
18
18
  "license": "MIT",
19
19
  "dependencies": {
20
- "ag-collection": "^5.4.1",
21
- "ag-model": "^3.2.1",
20
+ "ag-collection": "^6.0.0",
21
+ "ag-model": "^4.0.0",
22
22
  "capitalisk-auth-client": "^2.0.0",
23
23
  "socketcluster-client": "^20.0.1",
24
24
  "uuid": "^8.3.2"