saasufy-components 6.0.3 → 6.0.5
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 +1 -1
- package/collection-viewer.js +1 -1
- package/input-provider.js +1 -1
- package/package.json +1 -1
- package/utils.js +6 -3
package/collection-reducer.js
CHANGED
|
@@ -181,7 +181,7 @@ class CollectionReducer extends SocketConsumer {
|
|
|
181
181
|
!this.hasAttribute('collection-type') ||
|
|
182
182
|
!this.hasAttribute('collection-fields') ||
|
|
183
183
|
!this.hasAttribute('collection-view') ||
|
|
184
|
-
!this.
|
|
184
|
+
!this.hasAttribute('collection-view-params')
|
|
185
185
|
) {
|
|
186
186
|
return;
|
|
187
187
|
};
|
package/collection-viewer.js
CHANGED
|
@@ -277,7 +277,7 @@ class CollectionViewer extends SocketConsumer {
|
|
|
277
277
|
!this.hasAttribute('collection-type') ||
|
|
278
278
|
!this.hasAttribute('collection-fields') ||
|
|
279
279
|
!this.hasAttribute('collection-view') ||
|
|
280
|
-
!this.
|
|
280
|
+
!this.hasAttribute('collection-view-params')
|
|
281
281
|
) {
|
|
282
282
|
return;
|
|
283
283
|
};
|
package/input-provider.js
CHANGED
|
@@ -137,7 +137,7 @@ class InputProvider extends HTMLElement {
|
|
|
137
137
|
let {
|
|
138
138
|
fieldNames: optionNames,
|
|
139
139
|
fieldValues: optionValues
|
|
140
|
-
} = convertStringToFieldParams(options);
|
|
140
|
+
} = convertStringToFieldParams(options, true);
|
|
141
141
|
|
|
142
142
|
let optionElements = optionNames
|
|
143
143
|
.map((optionName) => {
|
package/package.json
CHANGED
package/utils.js
CHANGED
|
@@ -373,7 +373,9 @@ export function generateRandomHexString(byteLength) {
|
|
|
373
373
|
}).join('');
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
-
export const fieldPartsRegExp = /(
|
|
376
|
+
export const fieldPartsRegExp = /("[^"]*"|'[^']*'|\([^)]*\)|[^,()"']+)+/g;
|
|
377
|
+
export const fieldPartsRegExpWithEmpty = /((^|(?<=,))((?=,)|$)|"[^"]*"|'[^']*'|\([^)]*\)|[^,()"']+)+/g
|
|
378
|
+
|
|
377
379
|
export const quotedContentRegExp = /^\s*["']?(.*?)["']?\s*$/;
|
|
378
380
|
|
|
379
381
|
export function toBoolean(value) {
|
|
@@ -396,8 +398,9 @@ export function getTypeCastFunction(type) {
|
|
|
396
398
|
return typeCastFunctions[type] || ((value) => value);
|
|
397
399
|
}
|
|
398
400
|
|
|
399
|
-
export function convertStringToFieldParams(string) {
|
|
400
|
-
let
|
|
401
|
+
export function convertStringToFieldParams(string, allowEmpty) {
|
|
402
|
+
let partsRegExp = allowEmpty ? fieldPartsRegExpWithEmpty : fieldPartsRegExp;
|
|
403
|
+
let parts = ((string || '').match(partsRegExp) || []).map(field => field.trim());
|
|
401
404
|
let fieldTypeValues = parts.map((part) => {
|
|
402
405
|
let subParts = part.split('=');
|
|
403
406
|
let nameType = (subParts[0] || '').split(':');
|