@popmenu/ordering-ui 0.116.1 → 0.117.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
@@ -1947,7 +1947,7 @@ var MultipleSelectControl = function (props) {
1947
1947
  }))));
1948
1948
  };
1949
1949
  var MultipleQuantitySelectControl = function (props) {
1950
- var modifiers = props.modifiers, isOutOfStock = props.isOutOfStock, onChange = props.onChange, disableNewSelections = props.disableNewSelections;
1950
+ var modifiers = props.modifiers, isOutOfStock = props.isOutOfStock, onChange = props.onChange, disableNewSelections = props.disableNewSelections, handleOptionsClick = props.handleOptionsClick, selectionQuantity = props.selectionQuantity;
1951
1951
  var makeHandleChange = function (modifier) { return function (_e, customEvent) {
1952
1952
  onChange({
1953
1953
  isRadio: false,
@@ -1959,12 +1959,22 @@ var MultipleQuantitySelectControl = function (props) {
1959
1959
  });
1960
1960
  }; };
1961
1961
  return (React__default['default'].createElement(core.FormControl, { fullWidth: true },
1962
- React__default['default'].createElement(core.FormGroup, null, modifiers.map(function (modifier) { return (React__default['default'].createElement(core.Box, { key: modifier.id, style: { justifyContent: 'space-between', alignItems: 'center' }, display: "flex" },
1962
+ React__default['default'].createElement(core.FormGroup, null, modifiers.map(function (modifier) { return (React__default['default'].createElement(core.Box, { key: modifier.id, style: { justifyContent: 'space-between', flexDirection: 'column' }, display: "flex" },
1963
1963
  React__default['default'].createElement(core.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" },
1964
1964
  React__default['default'].createElement(Label, { name: modifier.name, price: modifier.formattedPrice, disabled: isOutOfStock || modifier.outOfStock }),
1965
1965
  modifier.outOfStock && (React__default['default'].createElement(core.Box, { minWidth: "90px", marginLeft: 2 },
1966
1966
  React__default['default'].createElement(StatusTag, { color: "warning", label: "Out of stock", variant: "outlined", size: "md" }))),
1967
- !modifier.outOfStock && (React__default['default'].createElement(QuantityPicker, { variation: "modifierCount", value: modifier.quantity, disableIncrement: disableNewSelections, preventManualChange: true, onChange: makeHandleChange(modifier), disabled: isOutOfStock || modifier.outOfStock }))))); }))));
1967
+ !modifier.outOfStock && (React__default['default'].createElement(QuantityPicker, { variation: "modifierCount", value: modifier.quantity, disableIncrement: disableNewSelections, preventManualChange: true, onChange: makeHandleChange(modifier), disabled: isOutOfStock || modifier.outOfStock }))),
1968
+ React__default['default'].createElement(core.Box, { display: "flex", alignItems: "flex-start", gridGap: 4 },
1969
+ modifier.hasModifiers && !modifier.outOfStock && (React__default['default'].createElement(Options, { handleOptionsClick: function () { return handleOptionsClick(modifier.id); } })),
1970
+ selectionQuantity[modifier.id] &&
1971
+ selectionQuantity[modifier.id].requiredSelectionCount > 0 &&
1972
+ selectionQuantity[modifier.id].requiredSelectionCount !==
1973
+ selectionQuantity[modifier.id].currentSelectionCount && (React__default['default'].createElement(core.Typography, { variant: "caption", color: "error" },
1974
+ selectionQuantity[modifier.id].currentSelectionCount,
1975
+ "/",
1976
+ selectionQuantity[modifier.id].requiredSelectionCount,
1977
+ " selected"))))); }))));
1968
1978
  };
1969
1979
  var ModifierControls = function (props) {
1970
1980
  switch (props.type) {
@@ -2002,7 +2012,7 @@ var getStatusTagProps = function (props) {
2002
2012
  return { color: color, label: label, variant: variant };
2003
2013
  };
2004
2014
  var DishModifierCard = function (props) {
2005
- var aggregatePrice = props.aggregatePrice, name = props.name, disableNewSelections = props.disableNewSelections, modifiers = props.modifiers, value = props.value, messages = props.messages, onChange = props.onChange, type = props.type, error = props.error, isOutOfStock = props.isOutOfStock, handleOptionsClick = props.handleOptionsClick;
2015
+ var aggregatePrice = props.aggregatePrice, name = props.name, disableNewSelections = props.disableNewSelections, modifiers = props.modifiers, value = props.value, messages = props.messages, onChange = props.onChange, type = props.type, error = props.error, isOutOfStock = props.isOutOfStock, handleOptionsClick = props.handleOptionsClick, selectionQuantity = props.selectionQuantity;
2006
2016
  var classes = useDishModifierCardStyles();
2007
2017
  return (React__default['default'].createElement(core.Box, { className: classes.root },
2008
2018
  React__default['default'].createElement(core.Box, { display: "flex", justifyContent: "space-between", width: "100%", alignItems: "center", height: "fit-content", marginBottom: 2 },
@@ -2010,7 +2020,7 @@ var DishModifierCard = function (props) {
2010
2020
  !isOutOfStock && (React__default['default'].createElement(Typography, { variant: "subtitle1", className: error ? classes.error : undefined }, messages.helperText))),
2011
2021
  React__default['default'].createElement(Typography, { className: classes.name }, name),
2012
2022
  React__default['default'].createElement(core.Box, null,
2013
- React__default['default'].createElement(ModifierControls, { value: value, modifiers: modifiers, isOutOfStock: isOutOfStock, onChange: onChange, disableNewSelections: disableNewSelections, type: type, messages: messages, handleOptionsClick: handleOptionsClick, aggregatePrice: aggregatePrice }))));
2023
+ React__default['default'].createElement(ModifierControls, { value: value, modifiers: modifiers, isOutOfStock: isOutOfStock, onChange: onChange, disableNewSelections: disableNewSelections, type: type, messages: messages, handleOptionsClick: handleOptionsClick, aggregatePrice: aggregatePrice, selectionQuantity: selectionQuantity }))));
2014
2024
  };
2015
2025
  DishModifierCard.displayName = 'DishModifierCard';
2016
2026