saasufy-components 6.0.4 → 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/input-provider.js +1 -1
- package/package.json +1 -1
- package/utils.js +6 -3
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(':');
|