@popmenu/ordering-ui 0.125.2 → 0.125.3
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.
|
@@ -67,5 +67,5 @@ export declare type RadioModifierFormProps = Base;
|
|
|
67
67
|
export declare type CheckboxModifierFormProps = Base & {
|
|
68
68
|
disableNewSelections?: boolean;
|
|
69
69
|
};
|
|
70
|
-
export declare type ModifierOptionsControlProps = Pick<DishModifierCardProps, 'value' | 'modifiers' | 'isOutOfStock' | 'isRequired' | 'onChange' | 'disableNewSelections' | 'type' | 'messages' | 'handleOptionsClick' | 'aggregatePrice' | 'selectionQuantity'>;
|
|
70
|
+
export declare type ModifierOptionsControlProps = Pick<DishModifierCardProps, 'value' | 'modifiers' | 'isOutOfStock' | 'isRequired' | 'onChange' | 'disableNewSelections' | 'type' | 'messages' | 'handleOptionsClick' | 'aggregatePrice' | 'selectionQuantity' | 'name'>;
|
|
71
71
|
export {};
|
package/build/index.es.js
CHANGED
|
@@ -1899,7 +1899,7 @@ var Options = function (props) {
|
|
|
1899
1899
|
React__default.createElement(Icon, { icon: SvgChevronRight }))));
|
|
1900
1900
|
};
|
|
1901
1901
|
var SingleSelectModifierControl = function (props) {
|
|
1902
|
-
var modifiers = props.modifiers, isOutOfStock = props.isOutOfStock, onChange = props.onChange, value = props.value, handleOptionsClick = props.handleOptionsClick, aggregatePrice = props.aggregatePrice, isRequired = props.isRequired;
|
|
1902
|
+
var modifiers = props.modifiers, name = props.name, isOutOfStock = props.isOutOfStock, onChange = props.onChange, value = props.value, handleOptionsClick = props.handleOptionsClick, aggregatePrice = props.aggregatePrice, isRequired = props.isRequired;
|
|
1903
1903
|
var radioClasses = useRadioModifierFormStyles();
|
|
1904
1904
|
var makeHandleChange = function (modifier) { return function (e) {
|
|
1905
1905
|
var isModifierInValue = Boolean(value.find(function (v) { return v.modifierId === modifier.id; }));
|
|
@@ -1916,11 +1916,14 @@ var SingleSelectModifierControl = function (props) {
|
|
|
1916
1916
|
});
|
|
1917
1917
|
}; };
|
|
1918
1918
|
return (React__default.createElement(FormControl, { fullWidth: true },
|
|
1919
|
-
React__default.createElement(RadioGroup,
|
|
1920
|
-
var _a
|
|
1921
|
-
var
|
|
1919
|
+
React__default.createElement(RadioGroup, { "aria-label": name }, modifiers.map(function (modifier) {
|
|
1920
|
+
var _a;
|
|
1921
|
+
var _b;
|
|
1922
1922
|
return (React__default.createElement(Box, { key: modifier.id },
|
|
1923
|
-
React__default.createElement(FormControlLabel$1, { key: modifier.id, value: modifier.id, className: radioClasses.root, control: React__default.createElement(Radio$2, { checked: ((
|
|
1923
|
+
React__default.createElement(FormControlLabel$1, { key: modifier.id, value: modifier.id, className: radioClasses.root, control: React__default.createElement(Radio$2, { checked: ((_b = value[0]) === null || _b === void 0 ? void 0 : _b.modifierId) === modifier.id, className: classNames((_a = {},
|
|
1924
|
+
_a[radioClasses.hideRadio] = modifier.outOfStock,
|
|
1925
|
+
_a[radioClasses.radio] = !modifier.outOfStock,
|
|
1926
|
+
_a)), disabled: isOutOfStock || modifier.outOfStock, onChange: makeHandleChange(modifier), required: isRequired }), label: React__default.createElement(Box, { className: radioClasses.label },
|
|
1924
1927
|
React__default.createElement(Label, { name: modifier.name, price: aggregatePrice[modifier.id] || modifier.formattedPrice, disabled: isOutOfStock || modifier.outOfStock }),
|
|
1925
1928
|
modifier.outOfStock && (React__default.createElement(Box, { minWidth: "90px", marginLeft: 2 },
|
|
1926
1929
|
React__default.createElement(StatusTag, { color: "warning", label: "Out of stock", variant: "outlined", size: "md" })))), labelPlacement: "start" }),
|
|
@@ -2032,7 +2035,7 @@ var DishModifierCard = function (props) {
|
|
|
2032
2035
|
!isOutOfStock && (React__default.createElement(Typography, { variant: "subtitle1", className: classNames((_a = {}, _a[classes.error] = error, _a[classes.helperText] = !error, _a)) }, messages.helperText))),
|
|
2033
2036
|
React__default.createElement(Typography, { className: classes.name }, name),
|
|
2034
2037
|
React__default.createElement(Box, null,
|
|
2035
|
-
React__default.createElement(ModifierControls, { value: value, modifiers: modifiers, isOutOfStock: isOutOfStock, isRequired: isRequired, onChange: onChange, disableNewSelections: disableNewSelections, type: type, messages: messages, handleOptionsClick: handleOptionsClick, aggregatePrice: aggregatePrice, selectionQuantity: selectionQuantity }))));
|
|
2038
|
+
React__default.createElement(ModifierControls, { name: name, value: value, modifiers: modifiers, isOutOfStock: isOutOfStock, isRequired: isRequired, onChange: onChange, disableNewSelections: disableNewSelections, type: type, messages: messages, handleOptionsClick: handleOptionsClick, aggregatePrice: aggregatePrice, selectionQuantity: selectionQuantity }))));
|
|
2036
2039
|
};
|
|
2037
2040
|
DishModifierCard.displayName = 'DishModifierCard';
|
|
2038
2041
|
|