@popmenu/ordering-ui 0.116.0 → 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/components/DishCheckoutCard/DishCheckoutCardProps.d.ts +1 -1
- package/build/components/DishModifierCard/DishModifierCardProps.d.ts +6 -1
- package/build/index.es.js +16 -5
- package/build/index.es.js.map +1 -1
- package/build/index.js +16 -5
- package/build/index.js.map +1 -1
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -1586,6 +1586,7 @@ var useDishCheckoutCardStyles = styles.makeStyles(function (theme) { return ({
|
|
|
1586
1586
|
height: theme.spacing(7),
|
|
1587
1587
|
marginRight: theme.spacing(1),
|
|
1588
1588
|
overflow: 'hidden',
|
|
1589
|
+
width: theme.spacing(7),
|
|
1589
1590
|
},
|
|
1590
1591
|
name: {
|
|
1591
1592
|
fontSize: 16,
|
|
@@ -1946,7 +1947,7 @@ var MultipleSelectControl = function (props) {
|
|
|
1946
1947
|
}))));
|
|
1947
1948
|
};
|
|
1948
1949
|
var MultipleQuantitySelectControl = function (props) {
|
|
1949
|
-
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;
|
|
1950
1951
|
var makeHandleChange = function (modifier) { return function (_e, customEvent) {
|
|
1951
1952
|
onChange({
|
|
1952
1953
|
isRadio: false,
|
|
@@ -1958,12 +1959,22 @@ var MultipleQuantitySelectControl = function (props) {
|
|
|
1958
1959
|
});
|
|
1959
1960
|
}; };
|
|
1960
1961
|
return (React__default['default'].createElement(core.FormControl, { fullWidth: true },
|
|
1961
|
-
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',
|
|
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" },
|
|
1962
1963
|
React__default['default'].createElement(core.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" },
|
|
1963
1964
|
React__default['default'].createElement(Label, { name: modifier.name, price: modifier.formattedPrice, disabled: isOutOfStock || modifier.outOfStock }),
|
|
1964
1965
|
modifier.outOfStock && (React__default['default'].createElement(core.Box, { minWidth: "90px", marginLeft: 2 },
|
|
1965
1966
|
React__default['default'].createElement(StatusTag, { color: "warning", label: "Out of stock", variant: "outlined", size: "md" }))),
|
|
1966
|
-
!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"))))); }))));
|
|
1967
1978
|
};
|
|
1968
1979
|
var ModifierControls = function (props) {
|
|
1969
1980
|
switch (props.type) {
|
|
@@ -2001,7 +2012,7 @@ var getStatusTagProps = function (props) {
|
|
|
2001
2012
|
return { color: color, label: label, variant: variant };
|
|
2002
2013
|
};
|
|
2003
2014
|
var DishModifierCard = function (props) {
|
|
2004
|
-
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;
|
|
2005
2016
|
var classes = useDishModifierCardStyles();
|
|
2006
2017
|
return (React__default['default'].createElement(core.Box, { className: classes.root },
|
|
2007
2018
|
React__default['default'].createElement(core.Box, { display: "flex", justifyContent: "space-between", width: "100%", alignItems: "center", height: "fit-content", marginBottom: 2 },
|
|
@@ -2009,7 +2020,7 @@ var DishModifierCard = function (props) {
|
|
|
2009
2020
|
!isOutOfStock && (React__default['default'].createElement(Typography, { variant: "subtitle1", className: error ? classes.error : undefined }, messages.helperText))),
|
|
2010
2021
|
React__default['default'].createElement(Typography, { className: classes.name }, name),
|
|
2011
2022
|
React__default['default'].createElement(core.Box, null,
|
|
2012
|
-
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 }))));
|
|
2013
2024
|
};
|
|
2014
2025
|
DishModifierCard.displayName = 'DishModifierCard';
|
|
2015
2026
|
|