@popmenu/ordering-ui 0.123.0 → 0.124.1

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' | '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'>;
71
71
  export {};
package/build/index.es.js CHANGED
@@ -1896,7 +1896,7 @@ var Options = function (props) {
1896
1896
  React__default.createElement(Icon, { icon: SvgChevronRight }))));
1897
1897
  };
1898
1898
  var SingleSelectModifierControl = function (props) {
1899
- var modifiers = props.modifiers, isOutOfStock = props.isOutOfStock, onChange = props.onChange, value = props.value, handleOptionsClick = props.handleOptionsClick, aggregatePrice = props.aggregatePrice;
1899
+ var modifiers = props.modifiers, isOutOfStock = props.isOutOfStock, onChange = props.onChange, value = props.value, handleOptionsClick = props.handleOptionsClick, aggregatePrice = props.aggregatePrice, isRequired = props.isRequired;
1900
1900
  var radioClasses = useRadioModifierFormStyles();
1901
1901
  var makeHandleChange = function (modifier) { return function (e) {
1902
1902
  var isModifierInValue = Boolean(value.find(function (v) { return v.modifierId === modifier.id; }));
@@ -1917,7 +1917,7 @@ var SingleSelectModifierControl = function (props) {
1917
1917
  var _a, _b;
1918
1918
  var _c;
1919
1919
  return (React__default.createElement(Box, { key: modifier.id },
1920
- React__default.createElement(FormControlLabel$1, { key: modifier.id, value: modifier.id, className: radioClasses.root, control: React__default.createElement(Radio$2, { checked: ((_c = value[0]) === null || _c === void 0 ? void 0 : _c.modifierId) === modifier.id, className: classNames((_a = {}, _a[radioClasses.hideRadio] = modifier.outOfStock, _a), (_b = {}, _b[radioClasses.radio] = !modifier.outOfStock, _b)), disabled: isOutOfStock || modifier.outOfStock, onChange: makeHandleChange(modifier) }), label: React__default.createElement(Box, { className: radioClasses.label },
1920
+ React__default.createElement(FormControlLabel$1, { key: modifier.id, value: modifier.id, className: radioClasses.root, control: React__default.createElement(Radio$2, { checked: ((_c = value[0]) === null || _c === void 0 ? void 0 : _c.modifierId) === modifier.id, className: classNames((_a = {}, _a[radioClasses.hideRadio] = modifier.outOfStock, _a), (_b = {}, _b[radioClasses.radio] = !modifier.outOfStock, _b)), disabled: isOutOfStock || modifier.outOfStock, onChange: makeHandleChange(modifier), required: isRequired }), label: React__default.createElement(Box, { className: radioClasses.label },
1921
1921
  React__default.createElement(Label, { name: modifier.name, price: aggregatePrice[modifier.id] || modifier.formattedPrice, disabled: isOutOfStock || modifier.outOfStock }),
1922
1922
  modifier.outOfStock && (React__default.createElement(Box, { minWidth: "90px", marginLeft: 2 },
1923
1923
  React__default.createElement(StatusTag, { color: "warning", label: "Out of stock", variant: "outlined", size: "md" })))), labelPlacement: "start" }),
@@ -2020,7 +2020,7 @@ var getStatusTagProps = function (props) {
2020
2020
  return { color: color, label: label, variant: variant };
2021
2021
  };
2022
2022
  var DishModifierCard = function (props) {
2023
- 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;
2023
+ 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, isRequired = props.isRequired, handleOptionsClick = props.handleOptionsClick, selectionQuantity = props.selectionQuantity;
2024
2024
  var classes = useDishModifierCardStyles();
2025
2025
  return (React__default.createElement(Box, { className: classes.root },
2026
2026
  React__default.createElement(Box, { display: "flex", justifyContent: "space-between", width: "100%", alignItems: "center", height: "fit-content", marginBottom: 2 },
@@ -2028,7 +2028,7 @@ var DishModifierCard = function (props) {
2028
2028
  !isOutOfStock && (React__default.createElement(Typography, { variant: "subtitle1", className: error ? classes.error : undefined }, messages.helperText))),
2029
2029
  React__default.createElement(Typography, { className: classes.name }, name),
2030
2030
  React__default.createElement(Box, null,
2031
- React__default.createElement(ModifierControls, { value: value, modifiers: modifiers, isOutOfStock: isOutOfStock, onChange: onChange, disableNewSelections: disableNewSelections, type: type, messages: messages, handleOptionsClick: handleOptionsClick, aggregatePrice: aggregatePrice, selectionQuantity: selectionQuantity }))));
2031
+ 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 }))));
2032
2032
  };
2033
2033
  DishModifierCard.displayName = 'DishModifierCard';
2034
2034
 
package/build/index.js CHANGED
@@ -1933,7 +1933,7 @@ var Options = function (props) {
1933
1933
  React__default['default'].createElement(Icon, { icon: SvgChevronRight }))));
1934
1934
  };
1935
1935
  var SingleSelectModifierControl = function (props) {
1936
- var modifiers = props.modifiers, isOutOfStock = props.isOutOfStock, onChange = props.onChange, value = props.value, handleOptionsClick = props.handleOptionsClick, aggregatePrice = props.aggregatePrice;
1936
+ var modifiers = props.modifiers, isOutOfStock = props.isOutOfStock, onChange = props.onChange, value = props.value, handleOptionsClick = props.handleOptionsClick, aggregatePrice = props.aggregatePrice, isRequired = props.isRequired;
1937
1937
  var radioClasses = useRadioModifierFormStyles();
1938
1938
  var makeHandleChange = function (modifier) { return function (e) {
1939
1939
  var isModifierInValue = Boolean(value.find(function (v) { return v.modifierId === modifier.id; }));
@@ -1954,7 +1954,7 @@ var SingleSelectModifierControl = function (props) {
1954
1954
  var _a, _b;
1955
1955
  var _c;
1956
1956
  return (React__default['default'].createElement(core.Box, { key: modifier.id },
1957
- React__default['default'].createElement(core.FormControlLabel, { key: modifier.id, value: modifier.id, className: radioClasses.root, control: React__default['default'].createElement(core.Radio, { checked: ((_c = value[0]) === null || _c === void 0 ? void 0 : _c.modifierId) === modifier.id, className: classNames((_a = {}, _a[radioClasses.hideRadio] = modifier.outOfStock, _a), (_b = {}, _b[radioClasses.radio] = !modifier.outOfStock, _b)), disabled: isOutOfStock || modifier.outOfStock, onChange: makeHandleChange(modifier) }), label: React__default['default'].createElement(core.Box, { className: radioClasses.label },
1957
+ React__default['default'].createElement(core.FormControlLabel, { key: modifier.id, value: modifier.id, className: radioClasses.root, control: React__default['default'].createElement(core.Radio, { checked: ((_c = value[0]) === null || _c === void 0 ? void 0 : _c.modifierId) === modifier.id, className: classNames((_a = {}, _a[radioClasses.hideRadio] = modifier.outOfStock, _a), (_b = {}, _b[radioClasses.radio] = !modifier.outOfStock, _b)), disabled: isOutOfStock || modifier.outOfStock, onChange: makeHandleChange(modifier), required: isRequired }), label: React__default['default'].createElement(core.Box, { className: radioClasses.label },
1958
1958
  React__default['default'].createElement(Label, { name: modifier.name, price: aggregatePrice[modifier.id] || modifier.formattedPrice, disabled: isOutOfStock || modifier.outOfStock }),
1959
1959
  modifier.outOfStock && (React__default['default'].createElement(core.Box, { minWidth: "90px", marginLeft: 2 },
1960
1960
  React__default['default'].createElement(StatusTag, { color: "warning", label: "Out of stock", variant: "outlined", size: "md" })))), labelPlacement: "start" }),
@@ -2057,7 +2057,7 @@ var getStatusTagProps = function (props) {
2057
2057
  return { color: color, label: label, variant: variant };
2058
2058
  };
2059
2059
  var DishModifierCard = function (props) {
2060
- 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;
2060
+ 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, isRequired = props.isRequired, handleOptionsClick = props.handleOptionsClick, selectionQuantity = props.selectionQuantity;
2061
2061
  var classes = useDishModifierCardStyles();
2062
2062
  return (React__default['default'].createElement(core.Box, { className: classes.root },
2063
2063
  React__default['default'].createElement(core.Box, { display: "flex", justifyContent: "space-between", width: "100%", alignItems: "center", height: "fit-content", marginBottom: 2 },
@@ -2065,7 +2065,7 @@ var DishModifierCard = function (props) {
2065
2065
  !isOutOfStock && (React__default['default'].createElement(Typography, { variant: "subtitle1", className: error ? classes.error : undefined }, messages.helperText))),
2066
2066
  React__default['default'].createElement(Typography, { className: classes.name }, name),
2067
2067
  React__default['default'].createElement(core.Box, null,
2068
- 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 }))));
2068
+ React__default['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 }))));
2069
2069
  };
2070
2070
  DishModifierCard.displayName = 'DishModifierCard';
2071
2071
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popmenu/ordering-ui",
3
- "version": "0.123.0",
3
+ "version": "0.124.1",
4
4
  "license": "MIT",
5
5
  "author": "Popmenu Design System Team",
6
6
  "description": "React components specifically for the popmenu Online Ordering web app.",
@@ -32,5 +32,5 @@
32
32
  "acorn-jsx": "^5.3.2"
33
33
  },
34
34
  "sideEffects": false,
35
- "gitHead": "a696dbecef0a8c3135cb9e68abfb938b396250e5"
35
+ "gitHead": "5c16f6ce0a5680d26389616abebe30d532183782"
36
36
  }