ordering-ui-external 2.4.4 → 2.4.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.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.verifyDecimals = exports.sortInputFields = exports.shape = exports.scrollTo = exports.reviewCommentList = exports.priceList = exports.lightenDarkenColor = exports.getTraduction = exports.getTimes = exports.getStarWidth = exports.getOrderStatus = exports.getIconCard = exports.getHourMin = exports.getGoogleMapImage = exports.getDistance = exports.formatUrlVideo = exports.formatSeconds = exports.flatArray = exports.fieldsToSort = exports.convertToRadian = exports.convertHoursToMinutes = exports.checkSiteUrl = exports.capitalize = exports.calendarLanguages = exports.bytesConverter = void 0;
6
+ exports.verifyDecimals = exports.sortInputFields = exports.shape = exports.scrollTo = exports.reviewCommentList = exports.priceList = exports.lightenDarkenColor = exports.getTraduction = exports.getTimes = exports.getStarWidth = exports.getOrderStatus = exports.getIconCard = exports.getHourMin = exports.getGoogleMapImage = exports.getDistance = exports.getCateringValues = exports.formatUrlVideo = exports.formatSeconds = exports.flatArray = exports.fieldsToSort = exports.convertToRadian = exports.convertHoursToMinutes = exports.checkSiteUrl = exports.capitalize = exports.calendarLanguages = exports.bytesConverter = void 0;
7
7
  var _orderingComponentsExternal = require("ordering-components-external");
8
8
  var _styledComponents = require("styled-components");
9
9
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
@@ -1045,4 +1045,27 @@ var calendarLanguages = {
1045
1045
  Su: 'DAYMIN7'
1046
1046
  }
1047
1047
  };
1048
- exports.calendarLanguages = calendarLanguages;
1048
+ exports.calendarLanguages = calendarLanguages;
1049
+ var getCateringValues = function getCateringValues(cateringTypeString, configs) {
1050
+ var splitCateringValue = function splitCateringValue(configName) {
1051
+ var _Object$values, _Object$values$find, _Object$values$find$v, _Object$values$find$v2, _Object$values$find$v3;
1052
+ return (_Object$values = Object.values(configs || {})) === null || _Object$values === void 0 ? void 0 : (_Object$values$find = _Object$values.find(function (config) {
1053
+ return (config === null || config === void 0 ? void 0 : config.key) === configName;
1054
+ })) === null || _Object$values$find === void 0 ? void 0 : (_Object$values$find$v = _Object$values$find.value) === null || _Object$values$find$v === void 0 ? void 0 : (_Object$values$find$v2 = _Object$values$find$v.split('|')) === null || _Object$values$find$v2 === void 0 ? void 0 : (_Object$values$find$v3 = _Object$values$find$v2.find(function (val) {
1055
+ return val.includes(cateringTypeString);
1056
+ })) === null || _Object$values$find$v3 === void 0 ? void 0 : _Object$values$find$v3.split(',')[1];
1057
+ };
1058
+ var preorderSlotInterval = parseInt(splitCateringValue('preorder_slot_interval'));
1059
+ var preorderLeadTime = parseInt(splitCateringValue('preorder_lead_time'));
1060
+ var preorderTimeRange = parseInt(splitCateringValue('preorder_time_range'));
1061
+ var preorderMaximumDays = parseInt(splitCateringValue('preorder_maximum_days'));
1062
+ var preorderMinimumDays = parseInt(splitCateringValue('preorder_minimum_days'));
1063
+ return {
1064
+ preorderSlotInterval: preorderSlotInterval,
1065
+ preorderLeadTime: preorderLeadTime,
1066
+ preorderTimeRange: preorderTimeRange,
1067
+ preorderMaximumDays: preorderMaximumDays,
1068
+ preorderMinimumDays: preorderMinimumDays
1069
+ };
1070
+ };
1071
+ exports.getCateringValues = getCateringValues;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "2.4.4",
3
+ "version": "2.4.5",
4
4
  "description": "Ordering UI Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -676,3 +676,23 @@ export const calendarLanguages = {
676
676
  Su: 'DAYMIN7'
677
677
  }
678
678
  }
679
+
680
+ export const getCateringValues = (cateringTypeString, configs) => {
681
+ const splitCateringValue = (configName) => Object.values(configs || {})
682
+ ?.find(config => config?.key === configName)
683
+ ?.value?.split('|')
684
+ ?.find(val => val.includes(cateringTypeString))?.split(',')[1]
685
+ const preorderSlotInterval = parseInt(splitCateringValue('preorder_slot_interval'))
686
+ const preorderLeadTime = parseInt(splitCateringValue('preorder_lead_time'))
687
+ const preorderTimeRange = parseInt(splitCateringValue('preorder_time_range'))
688
+ const preorderMaximumDays = parseInt(splitCateringValue('preorder_maximum_days'))
689
+ const preorderMinimumDays = parseInt(splitCateringValue('preorder_minimum_days'))
690
+
691
+ return {
692
+ preorderSlotInterval,
693
+ preorderLeadTime,
694
+ preorderTimeRange,
695
+ preorderMaximumDays,
696
+ preorderMinimumDays
697
+ }
698
+ }