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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saasufy-components",
3
- "version": "6.0.4",
3
+ "version": "6.0.5",
4
4
  "description": "Components for Saasufy.",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/utils.js CHANGED
@@ -373,7 +373,9 @@ export function generateRandomHexString(byteLength) {
373
373
  }).join('');
374
374
  }
375
375
 
376
- export const fieldPartsRegExp = /((^|(?<=,))((?=,)|$)|"[^"]*"|'[^']*'|\([^)]*\)|[^,()"']+)+/g
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 parts = ((string || '').match(fieldPartsRegExp) || []).map(field => field.trim());
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(':');