ordering-ui-external 14.1.32 → 14.1.34

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.
Files changed (22) hide show
  1. package/_bundles/{7.ordering-ui.190402c3fe50b957bac2.js → 7.ordering-ui.2b1fe991b2c45ea68382.js} +1 -1
  2. package/_bundles/ordering-ui.2b1fe991b2c45ea68382.js +2 -0
  3. package/_modules/themes/five/src/components/ProductForm/index.js +4 -2
  4. package/_modules/themes/five/src/components/ProductOptionSubOption/index.js +7 -7
  5. package/_modules/themes/five/src/components/SignUpForm/index.js +2 -2
  6. package/_modules/themes/five/src/components/UserFormDetails/index.js +2 -2
  7. package/package.json +2 -2
  8. package/src/themes/five/src/components/ProductForm/index.js +3 -1
  9. package/src/themes/five/src/components/ProductOptionSubOption/index.js +6 -5
  10. package/src/themes/five/src/components/SignUpForm/index.js +1 -1
  11. package/src/themes/five/src/components/UserFormDetails/index.js +1 -1
  12. package/_bundles/ordering-ui.190402c3fe50b957bac2.js +0 -2
  13. /package/_bundles/{0.ordering-ui.190402c3fe50b957bac2.js → 0.ordering-ui.2b1fe991b2c45ea68382.js} +0 -0
  14. /package/_bundles/{1.ordering-ui.190402c3fe50b957bac2.js → 1.ordering-ui.2b1fe991b2c45ea68382.js} +0 -0
  15. /package/_bundles/{2.ordering-ui.190402c3fe50b957bac2.js → 2.ordering-ui.2b1fe991b2c45ea68382.js} +0 -0
  16. /package/_bundles/{4.ordering-ui.190402c3fe50b957bac2.js → 4.ordering-ui.2b1fe991b2c45ea68382.js} +0 -0
  17. /package/_bundles/{5.ordering-ui.190402c3fe50b957bac2.js → 5.ordering-ui.2b1fe991b2c45ea68382.js} +0 -0
  18. /package/_bundles/{6.ordering-ui.190402c3fe50b957bac2.js → 6.ordering-ui.2b1fe991b2c45ea68382.js} +0 -0
  19. /package/_bundles/{7.ordering-ui.190402c3fe50b957bac2.js.LICENSE.txt → 7.ordering-ui.2b1fe991b2c45ea68382.js.LICENSE.txt} +0 -0
  20. /package/_bundles/{8.ordering-ui.190402c3fe50b957bac2.js → 8.ordering-ui.2b1fe991b2c45ea68382.js} +0 -0
  21. /package/_bundles/{9.ordering-ui.190402c3fe50b957bac2.js → 9.ordering-ui.2b1fe991b2c45ea68382.js} +0 -0
  22. /package/_bundles/{ordering-ui.190402c3fe50b957bac2.js.LICENSE.txt → ordering-ui.2b1fe991b2c45ea68382.js.LICENSE.txt} +0 -0
@@ -77,7 +77,8 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
77
77
  handleCreateGuestUser = props.handleCreateGuestUser,
78
78
  actionStatus = props.actionStatus,
79
79
  isCustomerMode = props.isCustomerMode,
80
- isAlsea = props.isAlsea;
80
+ isAlsea = props.isAlsea,
81
+ quesoYSalsaOptions = props.quesoYSalsaOptions;
81
82
  var product = productObject.product,
82
83
  loading = productObject.loading,
83
84
  error = productObject.error;
@@ -644,7 +645,8 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
644
645
  setIsScrollAvailable: setIsScrollAvailable,
645
646
  pizzaState: pizzaState,
646
647
  productCart: productCart,
647
- isAlsea: isAlsea
648
+ isAlsea: isAlsea,
649
+ quesoYSalsaOptions: quesoYSalsaOptions
648
650
  });
649
651
  }))));
650
652
  });
@@ -36,7 +36,7 @@ var ProductOptionSubOptionPropsAreEqual = function ProductOptionSubOptionPropsAr
36
36
  return JSON.stringify(prevProps.state) === JSON.stringify(nextProps.state) && JSON.stringify(prevProps.pizzaState) === JSON.stringify(nextProps.pizzaState) && prevProps.balance === nextProps.balance && JSON.stringify(prevProps.productCart) === JSON.stringify(nextProps.productCart);
37
37
  };
38
38
  var ProductOptionSubOptionUI = /*#__PURE__*/_react.default.memo(function (props) {
39
- var _pizzaState, _option$name, _option$name$toLowerC, _pizzaState2, _props$beforeElements, _props$beforeComponen, _option$name3, _pizzaState3, _pizzaState4, _props$afterComponent, _props$afterElements;
39
+ var _pizzaState, _option$name, _option$name$toLowerC, _pizzaState2, _props$beforeElements, _props$beforeComponen, _pizzaState3, _pizzaState4, _props$afterComponent, _props$afterElements;
40
40
  var state = props.state,
41
41
  increment = props.increment,
42
42
  decrement = props.decrement,
@@ -50,9 +50,10 @@ var ProductOptionSubOptionUI = /*#__PURE__*/_react.default.memo(function (props)
50
50
  usePizzaValidation = props.usePizzaValidation,
51
51
  pizzaState = props.pizzaState,
52
52
  changeQuantity = props.changeQuantity,
53
- isAlsea = props.isAlsea;
53
+ isAlsea = props.isAlsea,
54
+ quesoYSalsaOptions = props.quesoYSalsaOptions;
54
55
  var disableIncrement = option !== null && option !== void 0 && option.with_half_option ? (pizzaState === null || pizzaState === void 0 || (_pizzaState = pizzaState["option:".concat(option === null || option === void 0 ? void 0 : option.id)]) === null || _pizzaState === void 0 ? void 0 : _pizzaState.value) >= (option === null || option === void 0 ? void 0 : option.max) : option !== null && option !== void 0 && option.limit_suboptions_by_max ? balance === (option === null || option === void 0 ? void 0 : option.max) || state.quantity === suboption.max : state.quantity === (suboption === null || suboption === void 0 ? void 0 : suboption.max) || !state.selected && balance === (option === null || option === void 0 ? void 0 : option.max);
55
- var quesoYSalsa = (option === null || option === void 0 || (_option$name = option.name) === null || _option$name === void 0 || (_option$name$toLowerC = _option$name.toLowerCase) === null || _option$name$toLowerC === void 0 ? void 0 : _option$name$toLowerC.call(_option$name)) === 'queso y salsa';
56
+ var quesoYSalsa = quesoYSalsaOptions.includes(option === null || option === void 0 || (_option$name = option.name) === null || _option$name === void 0 || (_option$name$toLowerC = _option$name.toLowerCase) === null || _option$name$toLowerC === void 0 ? void 0 : _option$name$toLowerC.call(_option$name));
56
57
  var price = option !== null && option !== void 0 && option.with_half_option && suboption !== null && suboption !== void 0 && suboption.half_price && state.position !== 'whole' ? suboption === null || suboption === void 0 ? void 0 : suboption.half_price : suboption === null || suboption === void 0 ? void 0 : suboption.price;
57
58
  var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
58
59
  _useLanguage2 = _slicedToArray(_useLanguage, 2),
@@ -120,10 +121,9 @@ var ProductOptionSubOptionUI = /*#__PURE__*/_react.default.memo(function (props)
120
121
  }, props));
121
122
  }), /*#__PURE__*/_react.default.createElement(_styles.Container, {
122
123
  onClick: function onClick(e) {
123
- var _option$name2;
124
- return (option === null || option === void 0 || (_option$name2 = option.name) === null || _option$name2 === void 0 ? void 0 : _option$name2.toLowerCase()) === 'queso y salsa' && isAlsea ? handleChangeQuantity(e, state.quantity === 0 ? 1 : 0) : handleSuboptionClick();
124
+ return quesoYSalsa && isAlsea ? handleChangeQuantity(e, state.quantity === 0 ? 1 : 0) : handleSuboptionClick();
125
125
  }
126
- }, /*#__PURE__*/_react.default.createElement(_styles.LeftOptionContainer, null, /*#__PURE__*/_react.default.createElement(_styles.IconControl, null, (option === null || option === void 0 ? void 0 : option.min) === 0 && (option === null || option === void 0 ? void 0 : option.max) === 1 || (option === null || option === void 0 ? void 0 : option.max) > 1 ? state !== null && state !== void 0 && state.selected && !((option === null || option === void 0 || (_option$name3 = option.name) === null || _option$name3 === void 0 ? void 0 : _option$name3.toLowerCase()) === 'queso y salsa' && isAlsea && state.quantity === 0) ? /*#__PURE__*/_react.default.createElement(_MdCheckBox.default, null) : /*#__PURE__*/_react.default.createElement(_MdCheckBoxOutlineBlank.default, {
126
+ }, /*#__PURE__*/_react.default.createElement(_styles.LeftOptionContainer, null, /*#__PURE__*/_react.default.createElement(_styles.IconControl, null, (option === null || option === void 0 ? void 0 : option.min) === 0 && (option === null || option === void 0 ? void 0 : option.max) === 1 || (option === null || option === void 0 ? void 0 : option.max) > 1 ? state !== null && state !== void 0 && state.selected && !(quesoYSalsa && isAlsea && state.quantity === 0) ? /*#__PURE__*/_react.default.createElement(_MdCheckBox.default, null) : /*#__PURE__*/_react.default.createElement(_MdCheckBoxOutlineBlank.default, {
127
127
  disabled: true
128
128
  }) : state !== null && state !== void 0 && state.selected ? /*#__PURE__*/_react.default.createElement(_RiRadioButtonFill.default, null) : /*#__PURE__*/_react.default.createElement(_MdRadioButtonUnchecked.default, {
129
129
  disabled: true
@@ -156,7 +156,7 @@ var ProductOptionSubOptionUI = /*#__PURE__*/_react.default.memo(function (props)
156
156
  onClick: function onClick(e) {
157
157
  return handlePosition(e, 'right');
158
158
  }
159
- }))), ((option === null || option === void 0 ? void 0 : option.with_half_option) || quesoYSalsa) && (state === null || state === void 0 ? void 0 : state.selected) && isAlsea && /*#__PURE__*/_react.default.createElement(_styles.ExtraControl, null, state.quantity >= 2 ? /*#__PURE__*/_react.default.createElement(_styles.ExtraItem, {
159
+ }))), ((option === null || option === void 0 ? void 0 : option.with_half_option) || quesoYSalsa) && (state === null || state === void 0 ? void 0 : state.selected) && state.quantity > 0 && isAlsea && /*#__PURE__*/_react.default.createElement(_styles.ExtraControl, null, state.quantity >= 2 ? /*#__PURE__*/_react.default.createElement(_styles.ExtraItem, {
160
160
  onClick: function onClick(e) {
161
161
  return handleChangeQuantity(e, 1);
162
162
  }
@@ -264,8 +264,8 @@ var SignUpFormUI = function SignUpFormUI(props) {
264
264
  var _configs$validation_p, _configs$validation_p2;
265
265
  phoneNumberParser = (0, _libphonenumberJs.default)(number);
266
266
  if (!parseInt((_configs$validation_p = configs === null || configs === void 0 || (_configs$validation_p2 = configs.validation_phone_number_lib) === null || _configs$validation_p2 === void 0 ? void 0 : _configs$validation_p2.value) !== null && _configs$validation_p !== void 0 ? _configs$validation_p : 1, 10)) {
267
- var _phoneNumberParser;
268
- if ((_phoneNumberParser = phoneNumberParser) !== null && _phoneNumberParser !== void 0 && _phoneNumberParser.nationalNumber) phoneNumberParser.nationalNumber = (0, _reactPhoneNumberInput.formatPhoneNumber)(number);
267
+ var _phoneNumberParser, _formatPhoneNumber, _formatPhoneNumber$re;
268
+ if ((_phoneNumberParser = phoneNumberParser) !== null && _phoneNumberParser !== void 0 && _phoneNumberParser.nationalNumber) phoneNumberParser.nationalNumber = (_formatPhoneNumber = (0, _reactPhoneNumberInput.formatPhoneNumber)(number)) === null || _formatPhoneNumber === void 0 || (_formatPhoneNumber$re = _formatPhoneNumber.replace) === null || _formatPhoneNumber$re === void 0 ? void 0 : _formatPhoneNumber$re.call(_formatPhoneNumber, /\s/g, '');
269
269
  }
270
270
  }
271
271
  if (phoneNumberParser) {
@@ -253,8 +253,8 @@ var UserFormDetailsUI = exports.UserFormDetailsUI = function UserFormDetailsUI(p
253
253
  var _configs$validation_p, _configs$validation_p2;
254
254
  phoneNumberParser = (0, _libphonenumberJs.default)(number);
255
255
  if (!parseInt((_configs$validation_p = configs === null || configs === void 0 || (_configs$validation_p2 = configs.validation_phone_number_lib) === null || _configs$validation_p2 === void 0 ? void 0 : _configs$validation_p2.value) !== null && _configs$validation_p !== void 0 ? _configs$validation_p : 1, 10)) {
256
- var _phoneNumberParser;
257
- if ((_phoneNumberParser = phoneNumberParser) !== null && _phoneNumberParser !== void 0 && _phoneNumberParser.nationalNumber) phoneNumberParser.nationalNumber = (0, _reactPhoneNumberInput.formatPhoneNumber)(number);
256
+ var _phoneNumberParser, _formatPhoneNumber, _formatPhoneNumber$re;
257
+ if ((_phoneNumberParser = phoneNumberParser) !== null && _phoneNumberParser !== void 0 && _phoneNumberParser.nationalNumber) phoneNumberParser.nationalNumber = (_formatPhoneNumber = (0, _reactPhoneNumberInput.formatPhoneNumber)(number)) === null || _formatPhoneNumber === void 0 || (_formatPhoneNumber$re = _formatPhoneNumber.replace) === null || _formatPhoneNumber$re === void 0 ? void 0 : _formatPhoneNumber$re.call(_formatPhoneNumber, /\s/g, '');
258
258
  }
259
259
  }
260
260
  if (phoneNumberParser) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "14.1.32",
3
+ "version": "14.1.34",
4
4
  "description": "Ordering UI Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -88,7 +88,7 @@
88
88
  "lodash": "^4.17.19",
89
89
  "moment": "^2.29.4",
90
90
  "nanoid": "^4.0.0",
91
- "ordering-components-external": "13.0.34",
91
+ "ordering-components-external": "13.0.35",
92
92
  "payment": "^2.4.6",
93
93
  "polished": "^3.6.6",
94
94
  "react-bootstrap-icons": "^1.7.2",
@@ -103,7 +103,8 @@ const ProductOptionsUI = (props) => {
103
103
  handleCreateGuestUser,
104
104
  actionStatus,
105
105
  isCustomerMode,
106
- isAlsea
106
+ isAlsea,
107
+ quesoYSalsaOptions
107
108
  } = props
108
109
 
109
110
  const { product, loading, error } = productObject
@@ -673,6 +674,7 @@ const ProductOptionsUI = (props) => {
673
674
  pizzaState={pizzaState}
674
675
  productCart={productCart}
675
676
  isAlsea={isAlsea}
677
+ quesoYSalsaOptions={quesoYSalsaOptions}
676
678
  />
677
679
  )
678
680
  })
@@ -50,7 +50,8 @@ const ProductOptionSubOptionUI = React.memo((props) => {
50
50
  usePizzaValidation,
51
51
  pizzaState,
52
52
  changeQuantity,
53
- isAlsea
53
+ isAlsea,
54
+ quesoYSalsaOptions
54
55
  } = props
55
56
 
56
57
  const disableIncrement =
@@ -60,7 +61,7 @@ const ProductOptionSubOptionUI = React.memo((props) => {
60
61
  ? (balance === option?.max || state.quantity === suboption.max)
61
62
  : state.quantity === suboption?.max || (!state.selected && balance === option?.max)
62
63
 
63
- const quesoYSalsa = option?.name?.toLowerCase?.() === 'queso y salsa'
64
+ const quesoYSalsa = quesoYSalsaOptions.includes(option?.name?.toLowerCase?.())
64
65
  const price = option?.with_half_option && suboption?.half_price && state.position !== 'whole' ? suboption?.half_price : suboption?.price
65
66
  const [, t] = useLanguage()
66
67
  const [{ parsePrice }] = useUtils()
@@ -122,11 +123,11 @@ const ProductOptionSubOptionUI = React.memo((props) => {
122
123
  </React.Fragment>))}
123
124
  {props.beforeComponents?.map((BeforeComponent, i) => (
124
125
  <BeforeComponent key={i} {...props} />))}
125
- <Container onClick={(e) => option?.name?.toLowerCase() === 'queso y salsa' && isAlsea ? handleChangeQuantity(e, state.quantity === 0 ? 1 : 0) : handleSuboptionClick()}>
126
+ <Container onClick={(e) => quesoYSalsa && isAlsea ? handleChangeQuantity(e, state.quantity === 0 ? 1 : 0) : handleSuboptionClick()}>
126
127
  <LeftOptionContainer>
127
128
  <IconControl>
128
129
  {((option?.min === 0 && option?.max === 1) || option?.max > 1) ? (
129
- state?.selected && !(option?.name?.toLowerCase() === 'queso y salsa' && isAlsea && state.quantity === 0) ? (
130
+ state?.selected && !(quesoYSalsa && isAlsea && state.quantity === 0) ? (
130
131
  <MdCheckBox />
131
132
  ) : (
132
133
  <MdCheckBoxOutlineBlank disabled />
@@ -188,7 +189,7 @@ const ProductOptionSubOptionUI = React.memo((props) => {
188
189
  )
189
190
  }
190
191
  </PositionControl>
191
- {(option?.with_half_option || quesoYSalsa) && state?.selected && isAlsea && (
192
+ {(option?.with_half_option || quesoYSalsa) && state?.selected && state.quantity > 0 && isAlsea && (
192
193
  <ExtraControl>
193
194
  {(state.quantity >= 2) ? (
194
195
  <ExtraItem
@@ -232,7 +232,7 @@ const SignUpFormUI = (props) => {
232
232
  if (isValid) {
233
233
  phoneNumberParser = parsePhoneNumber(number)
234
234
  if (!parseInt(configs?.validation_phone_number_lib?.value ?? 1, 10)) {
235
- if (phoneNumberParser?.nationalNumber) phoneNumberParser.nationalNumber = formatPhoneNumber(number)
235
+ if (phoneNumberParser?.nationalNumber) phoneNumberParser.nationalNumber = formatPhoneNumber(number)?.replace?.(/\s/g, '')
236
236
  }
237
237
  }
238
238
  if (phoneNumberParser) {
@@ -208,7 +208,7 @@ export const UserFormDetailsUI = (props) => {
208
208
  if (isValid) {
209
209
  phoneNumberParser = parsePhoneNumber(number)
210
210
  if (!parseInt(configs?.validation_phone_number_lib?.value ?? 1, 10)) {
211
- if (phoneNumberParser?.nationalNumber) phoneNumberParser.nationalNumber = formatPhoneNumber(number)
211
+ if (phoneNumberParser?.nationalNumber) phoneNumberParser.nationalNumber = formatPhoneNumber(number)?.replace?.(/\s/g, '')
212
212
  }
213
213
  }
214
214
  if (phoneNumberParser) {