saasufy-components 5.8.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.
- package/collection-reducer.js +11 -2
- package/collection-viewer.js +10 -1
- package/model-input.js +7 -0
- package/model-text.js +7 -0
- package/model-viewer.js +8 -0
- package/package.json +1 -1
- package/utils.js +2 -2
package/collection-reducer.js
CHANGED
|
@@ -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');
|
package/collection-viewer.js
CHANGED
|
@@ -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
package/utils.js
CHANGED
|
@@ -232,7 +232,7 @@ let templateFormatters = {
|
|
|
232
232
|
return list.map(item => item[field]).join(sep);
|
|
233
233
|
},
|
|
234
234
|
combineFilters: (filterMap, useOr) => {
|
|
235
|
-
return Object.values(filterMap || {}).join(useOr ? '
|
|
235
|
+
return Object.values(filterMap || {}).join(useOr ? ' ~OR~ ' : ' ~AND~ ');
|
|
236
236
|
},
|
|
237
237
|
computeId,
|
|
238
238
|
safeString: toSafeHTML
|
|
@@ -373,7 +373,7 @@ export function generateRandomHexString(byteLength) {
|
|
|
373
373
|
}).join('');
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
-
export const fieldPartsRegExp = /("[^"]*"|'[^']*'|\([^)]*\)|[^,()"']+)+/g
|
|
376
|
+
export const fieldPartsRegExp = /((^|(?<=,))((?=,)|$)|"[^"]*"|'[^']*'|\([^)]*\)|[^,()"']+)+/g
|
|
377
377
|
export const quotedContentRegExp = /^\s*["']?(.*?)["']?\s*$/;
|
|
378
378
|
|
|
379
379
|
export function toBoolean(value) {
|