@popmenu/ordering-ui 0.80.0 → 0.81.0

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/build/index.js CHANGED
@@ -1554,7 +1554,15 @@ var CheckboxGroup = function (props) {
1554
1554
  var value = props.value, modifiers = props.modifiers, onChange = props.onChange, disableNewSelections = props.disableNewSelections;
1555
1555
  var classes = useCheckboxModifierFormStyles();
1556
1556
  var handleChange = function (event) {
1557
- onChange([{ id: parseInt(event.target.value), quantity: 1 }], event.target.checked);
1557
+ var _a;
1558
+ var price = (_a = modifiers.find(function (modifier) { return modifier.id === parseInt(event.target.value); })) === null || _a === void 0 ? void 0 : _a.price;
1559
+ onChange([
1560
+ {
1561
+ id: parseInt(event.target.value),
1562
+ price: (price && parseInt(price)) || 0,
1563
+ quantity: 1,
1564
+ },
1565
+ ], event.target.checked);
1558
1566
  };
1559
1567
  return (React__namespace.createElement(core.Box, { display: "flex", flexDirection: "column" }, modifiers.map(function (modifier, index) {
1560
1568
  var targetValue = value === null || value === void 0 ? void 0 : value.find(function (v) { return v.id == modifier.id; });
@@ -1565,7 +1573,15 @@ var RadioGroup = function (props) {
1565
1573
  var value = props.value, modifiers = props.modifiers, onChange = props.onChange;
1566
1574
  var classes = useRadioModifierFormStyles();
1567
1575
  var handleChange = function (event) {
1568
- onChange([{ id: parseInt(event.target.value), quantity: 1 }]);
1576
+ var _a;
1577
+ var price = (_a = modifiers.find(function (modifier) { return modifier.id === parseInt(event.target.value); })) === null || _a === void 0 ? void 0 : _a.price;
1578
+ onChange([
1579
+ {
1580
+ id: parseInt(event.target.value),
1581
+ price: (price && parseInt(price)) || 0,
1582
+ quantity: 1,
1583
+ },
1584
+ ]);
1569
1585
  };
1570
1586
  return (React__namespace.createElement(MuiRadioGroup__default['default'], { name: "selectedModifiers", value: value ? value[0].id : '', onChange: handleChange }, modifiers.map(function (modifier, index) { return (React__namespace.createElement(core.FormControlLabel, { key: index, value: modifier.id, control: React__namespace.createElement(core.Radio, { className: classes.radio }), label: React__namespace.createElement(Label, { name: modifier.name, price: modifier.price }), className: classes.root })); })));
1571
1587
  };