@popmenu/ordering-ui 0.121.0 → 0.122.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.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export interface DishCheckoutCardProps {
|
|
2
2
|
/** Adds a border to the bottom of the card */
|
|
3
3
|
borderBottom?: boolean;
|
|
4
|
-
/**
|
|
5
|
-
|
|
4
|
+
/** disables all interactive elements in the card, like "edit" or "delete" */
|
|
5
|
+
disabled?: boolean;
|
|
6
6
|
/** Id of the dish */
|
|
7
7
|
id: number;
|
|
8
8
|
/** Dish image information */
|
|
@@ -10,20 +10,22 @@ export interface DishCheckoutCardProps {
|
|
|
10
10
|
alt?: string;
|
|
11
11
|
src?: string | null;
|
|
12
12
|
};
|
|
13
|
-
/**
|
|
14
|
-
|
|
13
|
+
/** Edit and remove button text and aria-label */
|
|
14
|
+
messages: Record<'edit' | 'ariaEdit' | 'ariaDelete', string>;
|
|
15
|
+
/** Modifier group object of the dish */
|
|
16
|
+
modifierGroups?: ModifierGroupsType[];
|
|
15
17
|
/** Name of the dish */
|
|
16
18
|
name: string;
|
|
17
|
-
/** Quantity of dish selected */
|
|
18
|
-
quantity: number;
|
|
19
|
-
/** Price of an item. numbers will be prepended with the currencySymbol from OrderingAppContext. */
|
|
20
|
-
price: number | string;
|
|
21
19
|
/** Callback for edit button */
|
|
22
20
|
onEdit: () => void;
|
|
23
21
|
/** Callback for delete button */
|
|
24
22
|
onDelete: () => void;
|
|
25
23
|
/** Callback for change of select element */
|
|
26
24
|
onQuantityChange: (id: number, value: number) => void;
|
|
25
|
+
/** Price of an item. numbers will be prepended with the currencySymbol from OrderingAppContext. */
|
|
26
|
+
price: number | string;
|
|
27
|
+
/** Quantity of dish selected */
|
|
28
|
+
quantity: number;
|
|
27
29
|
/** Special instructions text */
|
|
28
30
|
specialInstructions?: string | null;
|
|
29
31
|
/** If item is in cart but is not unavailable */
|
package/build/index.es.js
CHANGED
|
@@ -912,6 +912,8 @@ var getBorder = function (theme) { return function (props) {
|
|
|
912
912
|
}
|
|
913
913
|
return borderColor;
|
|
914
914
|
}; };
|
|
915
|
+
// using `any` here is a bit of cheating but it doesn't matter since this doesn't depend on
|
|
916
|
+
// any component-specific props
|
|
915
917
|
makeStyles(function (theme) { return ({
|
|
916
918
|
root: {
|
|
917
919
|
background: getBackground(theme),
|
|
@@ -1098,6 +1100,7 @@ var useLinkStyles = makeStyles(function (theme) { return ({
|
|
|
1098
1100
|
},
|
|
1099
1101
|
}); });
|
|
1100
1102
|
|
|
1103
|
+
// eslint-disable-next-line react/display-name -- false positive
|
|
1101
1104
|
var Link = forwardRef(function (props, ref) {
|
|
1102
1105
|
var children = props.children, muiProps = __rest(props, ["children"]);
|
|
1103
1106
|
var classes = useLinkStyles(props);
|
|
@@ -1618,7 +1621,7 @@ var OrderingAppContextProvider = function (props) {
|
|
|
1618
1621
|
|
|
1619
1622
|
var DishCheckoutCard = function (props) {
|
|
1620
1623
|
var _a;
|
|
1621
|
-
var id = props.id, name = props.name, quantity = props.quantity, modifierGroups = props.modifierGroups, onDelete = props.onDelete, onEdit = props.onEdit, onQuantityChange = props.onQuantityChange, price = props.price, specialInstructions = props.specialInstructions, disabled = props.disabled, warningMessage = props.warningMessage, _b = props.image, image = _b === void 0 ? {} : _b;
|
|
1624
|
+
var id = props.id, name = props.name, quantity = props.quantity, modifierGroups = props.modifierGroups, onDelete = props.onDelete, onEdit = props.onEdit, onQuantityChange = props.onQuantityChange, price = props.price, specialInstructions = props.specialInstructions, disabled = props.disabled, warningMessage = props.warningMessage, _b = props.image, image = _b === void 0 ? {} : _b, messages = props.messages;
|
|
1622
1625
|
var src = image.src, alt = image.alt;
|
|
1623
1626
|
var classes = useDishCheckoutCardStyles(props);
|
|
1624
1627
|
var appContext = useOrderingAppContext()[0];
|
|
@@ -1674,8 +1677,8 @@ var DishCheckoutCard = function (props) {
|
|
|
1674
1677
|
specialInstructions,
|
|
1675
1678
|
"\"")),
|
|
1676
1679
|
React__default.createElement(Box, { display: "flex", gridGap: 1, height: "100%", alignItems: "center" },
|
|
1677
|
-
React__default.createElement(Button, { disabled: disabled, className: classes.editButton, variant: "text", onClick: onEdit },
|
|
1678
|
-
React__default.createElement(IconButton, { disabled: disabled, onClick: onDelete, classes: { root: classes.deleteButton } },
|
|
1680
|
+
React__default.createElement(Button, { "aria-label": messages.ariaEdit, disabled: disabled, className: classes.editButton, variant: "text", onClick: onEdit }, messages.edit),
|
|
1681
|
+
React__default.createElement(IconButton, { "aria-label": messages.ariaDelete, disabled: disabled, onClick: onDelete, classes: { root: classes.deleteButton } },
|
|
1679
1682
|
React__default.createElement(Icon, { icon: SvgTrash, size: "large" })))),
|
|
1680
1683
|
React__default.createElement(Box, { display: "flex", gridGap: 16, alignItems: "center" },
|
|
1681
1684
|
React__default.createElement(FormControl, { variant: "outlined", hiddenLabel: true },
|