@citygross/components 0.7.192 → 0.7.193

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.
@@ -368,6 +368,25 @@ var zipRegex = /(^\d{5}$)|(^\d{3} \d{2}$)/;
368
368
  var emailRegex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
369
369
  var validateInput = function (input, regex) { return regex.test(input); };
370
370
 
371
+ var makeCateringPortionsString = function (variant, cartItem, unit) {
372
+ var _a, _b;
373
+ if (unit !== 'per person')
374
+ return;
375
+ var qString = '';
376
+ if ((variant === null || variant === void 0 ? void 0 : variant.quantityFrom) || (variant === null || variant === void 0 ? void 0 : variant.quantityTo)) {
377
+ if (variant === null || variant === void 0 ? void 0 : variant.quantityFrom)
378
+ qString += variant === null || variant === void 0 ? void 0 : variant.quantityFrom;
379
+ if (variant === null || variant === void 0 ? void 0 : variant.quantityTo)
380
+ qString += " - ".concat(variant === null || variant === void 0 ? void 0 : variant.quantityTo);
381
+ }
382
+ else {
383
+ qString = (variant === null || variant === void 0 ? void 0 : variant.quantityFrom)
384
+ ? (_a = variant === null || variant === void 0 ? void 0 : variant.quantityFrom) === null || _a === void 0 ? void 0 : _a.toString()
385
+ : (_b = cartItem === null || cartItem === void 0 ? void 0 : cartItem.value) === null || _b === void 0 ? void 0 : _b.toString();
386
+ }
387
+ return qString;
388
+ };
389
+
371
390
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof commonjsGlobal$1 !== 'undefined' ? commonjsGlobal$1 : typeof self !== 'undefined' ? self : {};
372
391
 
373
392
  function commonjsRequire (path) {
@@ -18642,6 +18661,7 @@ build.formatPrice = formatPrice;
18642
18661
  build.formatPriceWithDecimalsReduced = formatPriceWithDecimalsReduced;
18643
18662
  build.getCountryFromLanguageCode = getCountryFromLanguageCode;
18644
18663
  build.languageCodeToCountryMap = languageCodeToCountryMap;
18664
+ build.makeCateringPortionsString = makeCateringPortionsString;
18645
18665
  build.moment = moment;
18646
18666
  build.nameRegex = nameRegex;
18647
18667
  build.phoneRegex = phoneRegex;