@popmenu/ordering-ui 0.90.0 → 0.92.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/DishModifierCard/DishModifierCardProps.d.ts +18 -15
- package/build/components/DishModifierCard/ModifierControls.d.ts +3 -0
- package/build/components/QuantityPicker/QuantityPicker.styles.d.ts +4 -1
- package/build/components/QuantityPicker/QuantityPickerProps.d.ts +10 -4
- package/build/index.es.js +228 -182
- package/build/index.es.js.map +1 -1
- package/build/index.js +227 -182
- package/build/index.js.map +1 -1
- package/package.json +2 -2
- package/build/components/DishModifierCard/ModifierOptionsControl.d.ts +0 -3
package/build/index.js
CHANGED
|
@@ -50,7 +50,6 @@ var MuiToggleButton = require('@material-ui/lab/ToggleButton');
|
|
|
50
50
|
var MuiToggleButtonGroup = require('@material-ui/lab/ToggleButtonGroup');
|
|
51
51
|
var MuiTooltip = require('@material-ui/core/Tooltip');
|
|
52
52
|
var lab = require('@material-ui/lab');
|
|
53
|
-
var MuiRadioGroup = require('@material-ui/core/RadioGroup');
|
|
54
53
|
|
|
55
54
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
56
55
|
|
|
@@ -89,7 +88,6 @@ var Tab__default = /*#__PURE__*/_interopDefaultLegacy(Tab);
|
|
|
89
88
|
var MuiToggleButton__default = /*#__PURE__*/_interopDefaultLegacy(MuiToggleButton);
|
|
90
89
|
var MuiToggleButtonGroup__default = /*#__PURE__*/_interopDefaultLegacy(MuiToggleButtonGroup);
|
|
91
90
|
var MuiTooltip__default = /*#__PURE__*/_interopDefaultLegacy(MuiTooltip);
|
|
92
|
-
var MuiRadioGroup__default = /*#__PURE__*/_interopDefaultLegacy(MuiRadioGroup);
|
|
93
91
|
|
|
94
92
|
/*! *****************************************************************************
|
|
95
93
|
Copyright (c) Microsoft Corporation.
|
|
@@ -127,6 +125,16 @@ function __rest$1(s, e) {
|
|
|
127
125
|
t[p[i]] = s[p[i]];
|
|
128
126
|
}
|
|
129
127
|
return t;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function __spreadArray(to, from, pack) {
|
|
131
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
132
|
+
if (ar || !(i in from)) {
|
|
133
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
134
|
+
ar[i] = from[i];
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return to.concat(ar || from);
|
|
130
138
|
}
|
|
131
139
|
|
|
132
140
|
var Button = React.forwardRef(function (props, ref) {
|
|
@@ -223,80 +231,80 @@ var MenuItemInfo = function (props) {
|
|
|
223
231
|
return (React__default['default'].createElement(core.Box, { display: "flex", flexGrow: 1, flexDirection: "column", height: "100%" }, props.children));
|
|
224
232
|
};
|
|
225
233
|
|
|
226
|
-
var _path$
|
|
234
|
+
var _path$2o;
|
|
227
235
|
|
|
228
|
-
function _extends$
|
|
236
|
+
function _extends$5o() { _extends$5o = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$5o.apply(this, arguments); }
|
|
229
237
|
|
|
230
238
|
function SvgChevronDown(props) {
|
|
231
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
239
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$5o({
|
|
232
240
|
viewBox: "0 0 16 16",
|
|
233
241
|
fill: "none",
|
|
234
242
|
strokeLinecap: "round",
|
|
235
243
|
strokeLinejoin: "round",
|
|
236
244
|
width: "1em",
|
|
237
245
|
height: "1em"
|
|
238
|
-
}, props), _path$
|
|
246
|
+
}, props), _path$2o || (_path$2o = /*#__PURE__*/React__namespace.createElement("path", {
|
|
239
247
|
d: "M4 6l4 4 4-4",
|
|
240
248
|
stroke: "currentColor"
|
|
241
249
|
})));
|
|
242
250
|
}
|
|
243
251
|
|
|
244
|
-
var _path$
|
|
252
|
+
var _path$2n;
|
|
245
253
|
|
|
246
|
-
function _extends$
|
|
254
|
+
function _extends$5n() { _extends$5n = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$5n.apply(this, arguments); }
|
|
247
255
|
|
|
248
256
|
function SvgChevronUp(props) {
|
|
249
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
257
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$5n({
|
|
250
258
|
viewBox: "0 0 16 16",
|
|
251
259
|
fill: "none",
|
|
252
260
|
strokeLinecap: "round",
|
|
253
261
|
strokeLinejoin: "round",
|
|
254
262
|
width: "1em",
|
|
255
263
|
height: "1em"
|
|
256
|
-
}, props), _path$
|
|
264
|
+
}, props), _path$2n || (_path$2n = /*#__PURE__*/React__namespace.createElement("path", {
|
|
257
265
|
d: "M12 10L8 6l-4 4",
|
|
258
266
|
stroke: "currentColor"
|
|
259
267
|
})));
|
|
260
268
|
}
|
|
261
269
|
|
|
262
|
-
var _path$
|
|
270
|
+
var _path$27;
|
|
263
271
|
|
|
264
|
-
function _extends$
|
|
272
|
+
function _extends$4K() { _extends$4K = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4K.apply(this, arguments); }
|
|
265
273
|
|
|
266
274
|
function SvgCheck(props) {
|
|
267
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
275
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$4K({
|
|
268
276
|
viewBox: "0 0 16 16",
|
|
269
277
|
fill: "none",
|
|
270
278
|
strokeLinecap: "round",
|
|
271
279
|
strokeLinejoin: "round",
|
|
272
280
|
width: "1em",
|
|
273
281
|
height: "1em"
|
|
274
|
-
}, props), _path$
|
|
282
|
+
}, props), _path$27 || (_path$27 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
275
283
|
d: "M13.333 4L6 11.333 2.667 8",
|
|
276
284
|
stroke: "currentColor"
|
|
277
285
|
})));
|
|
278
286
|
}
|
|
279
287
|
|
|
280
|
-
var _g$
|
|
288
|
+
var _g$2z, _defs$1D;
|
|
281
289
|
|
|
282
|
-
function _extends$
|
|
290
|
+
function _extends$4H() { _extends$4H = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4H.apply(this, arguments); }
|
|
283
291
|
|
|
284
292
|
function SvgClock(props) {
|
|
285
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
293
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$4H({
|
|
286
294
|
viewBox: "0 0 16 16",
|
|
287
295
|
fill: "none",
|
|
288
296
|
strokeLinecap: "round",
|
|
289
297
|
strokeLinejoin: "round",
|
|
290
298
|
width: "1em",
|
|
291
299
|
height: "1em"
|
|
292
|
-
}, props), _g$
|
|
300
|
+
}, props), _g$2z || (_g$2z = /*#__PURE__*/React__namespace.createElement("g", {
|
|
293
301
|
clipPath: "url(#clock_svg__clip0_8_5092)",
|
|
294
302
|
stroke: "currentColor"
|
|
295
303
|
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
296
304
|
d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333z"
|
|
297
305
|
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
298
306
|
d: "M8 4v4l2.667 1.333"
|
|
299
|
-
}))), _defs$
|
|
307
|
+
}))), _defs$1D || (_defs$1D = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("clipPath", {
|
|
300
308
|
id: "clock_svg__clip0_8_5092"
|
|
301
309
|
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
302
310
|
fill: "currentColor",
|
|
@@ -304,42 +312,42 @@ function SvgClock(props) {
|
|
|
304
312
|
})))));
|
|
305
313
|
}
|
|
306
314
|
|
|
307
|
-
var _path$
|
|
315
|
+
var _path$26;
|
|
308
316
|
|
|
309
|
-
function _extends$
|
|
317
|
+
function _extends$4G() { _extends$4G = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4G.apply(this, arguments); }
|
|
310
318
|
|
|
311
319
|
function SvgX(props) {
|
|
312
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
320
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$4G({
|
|
313
321
|
viewBox: "0 0 16 16",
|
|
314
322
|
fill: "none",
|
|
315
323
|
strokeLinecap: "round",
|
|
316
324
|
strokeLinejoin: "round",
|
|
317
325
|
width: "1em",
|
|
318
326
|
height: "1em"
|
|
319
|
-
}, props), _path$
|
|
327
|
+
}, props), _path$26 || (_path$26 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
320
328
|
d: "M12 4l-8 8m0-8l8 8",
|
|
321
329
|
stroke: "currentColor"
|
|
322
330
|
})));
|
|
323
331
|
}
|
|
324
332
|
|
|
325
|
-
var _g$
|
|
333
|
+
var _g$2y, _defs$1C;
|
|
326
334
|
|
|
327
|
-
function _extends$
|
|
335
|
+
function _extends$4F() { _extends$4F = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4F.apply(this, arguments); }
|
|
328
336
|
|
|
329
337
|
function SvgXCircle(props) {
|
|
330
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
338
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$4F({
|
|
331
339
|
viewBox: "0 0 16 16",
|
|
332
340
|
fill: "none",
|
|
333
341
|
strokeLinecap: "round",
|
|
334
342
|
strokeLinejoin: "round",
|
|
335
343
|
width: "1em",
|
|
336
344
|
height: "1em"
|
|
337
|
-
}, props), _g$
|
|
345
|
+
}, props), _g$2y || (_g$2y = /*#__PURE__*/React__namespace.createElement("g", {
|
|
338
346
|
clipPath: "url(#x-circle_svg__clip0_8_6136)",
|
|
339
347
|
stroke: "currentColor"
|
|
340
348
|
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
341
349
|
d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333zM10 6l-4 4m0-4l4 4"
|
|
342
|
-
}))), _defs$
|
|
350
|
+
}))), _defs$1C || (_defs$1C = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("clipPath", {
|
|
343
351
|
id: "x-circle_svg__clip0_8_6136"
|
|
344
352
|
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
345
353
|
fill: "currentColor",
|
|
@@ -347,37 +355,37 @@ function SvgXCircle(props) {
|
|
|
347
355
|
})))));
|
|
348
356
|
}
|
|
349
357
|
|
|
350
|
-
var _path$
|
|
358
|
+
var _path$1$;
|
|
351
359
|
|
|
352
|
-
function _extends$
|
|
360
|
+
function _extends$4p() { _extends$4p = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4p.apply(this, arguments); }
|
|
353
361
|
|
|
354
362
|
function SvgHeart(props) {
|
|
355
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
363
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$4p({
|
|
356
364
|
viewBox: "0 0 16 16",
|
|
357
365
|
fill: "none",
|
|
358
366
|
strokeLinecap: "round",
|
|
359
367
|
strokeLinejoin: "round",
|
|
360
368
|
width: "1em",
|
|
361
369
|
height: "1em"
|
|
362
|
-
}, props), _path$
|
|
370
|
+
}, props), _path$1$ || (_path$1$ = /*#__PURE__*/React__namespace.createElement("path", {
|
|
363
371
|
d: "M13.893 3.074a3.667 3.667 0 00-5.186 0L8 3.78l-.707-.706A3.668 3.668 0 002.107 8.26l.706.707L8 14.154l5.187-5.187.706-.707a3.667 3.667 0 000-5.186v0z",
|
|
364
372
|
stroke: "currentColor"
|
|
365
373
|
})));
|
|
366
374
|
}
|
|
367
375
|
|
|
368
|
-
var _g$
|
|
376
|
+
var _g$2k;
|
|
369
377
|
|
|
370
|
-
function _extends$
|
|
378
|
+
function _extends$4k() { _extends$4k = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4k.apply(this, arguments); }
|
|
371
379
|
|
|
372
380
|
function SvgLock(props) {
|
|
373
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
381
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$4k({
|
|
374
382
|
viewBox: "0 0 16 16",
|
|
375
383
|
fill: "none",
|
|
376
384
|
strokeLinecap: "round",
|
|
377
385
|
strokeLinejoin: "round",
|
|
378
386
|
width: "1em",
|
|
379
387
|
height: "1em"
|
|
380
|
-
}, props), _g$
|
|
388
|
+
}, props), _g$2k || (_g$2k = /*#__PURE__*/React__namespace.createElement("g", {
|
|
381
389
|
stroke: "currentColor"
|
|
382
390
|
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
383
391
|
d: "M12.667 7.333H3.333C2.597 7.333 2 7.93 2 8.668v4.667c0 .736.597 1.333 1.333 1.333h9.334c.736 0 1.333-.597 1.333-1.333V8.667c0-.737-.597-1.333-1.333-1.333z"
|
|
@@ -386,24 +394,24 @@ function SvgLock(props) {
|
|
|
386
394
|
}))));
|
|
387
395
|
}
|
|
388
396
|
|
|
389
|
-
var _g$
|
|
397
|
+
var _g$2g, _defs$1q;
|
|
390
398
|
|
|
391
|
-
function _extends$
|
|
399
|
+
function _extends$46() { _extends$46 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$46.apply(this, arguments); }
|
|
392
400
|
|
|
393
401
|
function SvgMinusCircle(props) {
|
|
394
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
402
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$46({
|
|
395
403
|
viewBox: "0 0 16 16",
|
|
396
404
|
fill: "none",
|
|
397
405
|
strokeLinecap: "round",
|
|
398
406
|
strokeLinejoin: "round",
|
|
399
407
|
width: "1em",
|
|
400
408
|
height: "1em"
|
|
401
|
-
}, props), _g$
|
|
409
|
+
}, props), _g$2g || (_g$2g = /*#__PURE__*/React__namespace.createElement("g", {
|
|
402
410
|
clipPath: "url(#minus-circle_svg__clip0_8_5970)",
|
|
403
411
|
stroke: "currentColor"
|
|
404
412
|
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
405
413
|
d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333zM5.333 8h5.334"
|
|
406
|
-
}))), _defs$
|
|
414
|
+
}))), _defs$1q || (_defs$1q = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("clipPath", {
|
|
407
415
|
id: "minus-circle_svg__clip0_8_5970"
|
|
408
416
|
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
409
417
|
fill: "currentColor",
|
|
@@ -411,42 +419,42 @@ function SvgMinusCircle(props) {
|
|
|
411
419
|
})))));
|
|
412
420
|
}
|
|
413
421
|
|
|
414
|
-
var _path$
|
|
422
|
+
var _path$1M;
|
|
415
423
|
|
|
416
|
-
function _extends$
|
|
424
|
+
function _extends$3$() { _extends$3$ = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3$.apply(this, arguments); }
|
|
417
425
|
|
|
418
426
|
function SvgPlus(props) {
|
|
419
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
427
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3$({
|
|
420
428
|
viewBox: "0 0 16 16",
|
|
421
429
|
fill: "none",
|
|
422
430
|
strokeLinecap: "round",
|
|
423
431
|
strokeLinejoin: "round",
|
|
424
432
|
width: "1em",
|
|
425
433
|
height: "1em"
|
|
426
|
-
}, props), _path$
|
|
434
|
+
}, props), _path$1M || (_path$1M = /*#__PURE__*/React__namespace.createElement("path", {
|
|
427
435
|
d: "M8 3.333v9.334M3.333 8h9.334",
|
|
428
436
|
stroke: "currentColor"
|
|
429
437
|
})));
|
|
430
438
|
}
|
|
431
439
|
|
|
432
|
-
var _g$
|
|
440
|
+
var _g$2d, _defs$1n;
|
|
433
441
|
|
|
434
|
-
function _extends$
|
|
442
|
+
function _extends$3_() { _extends$3_ = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3_.apply(this, arguments); }
|
|
435
443
|
|
|
436
444
|
function SvgPlusCircle(props) {
|
|
437
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
445
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3_({
|
|
438
446
|
viewBox: "0 0 16 16",
|
|
439
447
|
fill: "none",
|
|
440
448
|
strokeLinecap: "round",
|
|
441
449
|
strokeLinejoin: "round",
|
|
442
450
|
width: "1em",
|
|
443
451
|
height: "1em"
|
|
444
|
-
}, props), _g$
|
|
452
|
+
}, props), _g$2d || (_g$2d = /*#__PURE__*/React__namespace.createElement("g", {
|
|
445
453
|
clipPath: "url(#plus-circle_svg__clip0_8_5870)",
|
|
446
454
|
stroke: "currentColor"
|
|
447
455
|
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
448
456
|
d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333zm0-9.334v5.334M5.333 8h5.334"
|
|
449
|
-
}))), _defs$
|
|
457
|
+
}))), _defs$1n || (_defs$1n = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("clipPath", {
|
|
450
458
|
id: "plus-circle_svg__clip0_8_5870"
|
|
451
459
|
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
452
460
|
fill: "currentColor",
|
|
@@ -454,76 +462,76 @@ function SvgPlusCircle(props) {
|
|
|
454
462
|
})))));
|
|
455
463
|
}
|
|
456
464
|
|
|
457
|
-
var _path$
|
|
465
|
+
var _path$1E;
|
|
458
466
|
|
|
459
|
-
function _extends$
|
|
467
|
+
function _extends$3N() { _extends$3N = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3N.apply(this, arguments); }
|
|
460
468
|
|
|
461
469
|
function SvgTag(props) {
|
|
462
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
470
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3N({
|
|
463
471
|
viewBox: "0 0 16 16",
|
|
464
472
|
fill: "none",
|
|
465
473
|
strokeLinecap: "round",
|
|
466
474
|
strokeLinejoin: "round",
|
|
467
475
|
width: "1em",
|
|
468
476
|
height: "1em"
|
|
469
|
-
}, props), _path$
|
|
477
|
+
}, props), _path$1E || (_path$1E = /*#__PURE__*/React__namespace.createElement("path", {
|
|
470
478
|
d: "M13.727 8.94l-4.78 4.78a1.334 1.334 0 01-1.887 0L1.333 8V1.333H8l5.727 5.727a1.333 1.333 0 010 1.88v0zm-9.06-4.273h.007",
|
|
471
479
|
stroke: "currentColor"
|
|
472
480
|
})));
|
|
473
481
|
}
|
|
474
482
|
|
|
475
|
-
var _path$
|
|
483
|
+
var _path$1u;
|
|
476
484
|
|
|
477
|
-
function _extends$
|
|
485
|
+
function _extends$3u() { _extends$3u = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3u.apply(this, arguments); }
|
|
478
486
|
|
|
479
487
|
function SvgWarning(props) {
|
|
480
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
488
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3u({
|
|
481
489
|
viewBox: "0 0 16 16",
|
|
482
490
|
fill: "none",
|
|
483
491
|
strokeLinecap: "round",
|
|
484
492
|
strokeLinejoin: "round",
|
|
485
493
|
width: "1em",
|
|
486
494
|
height: "1em"
|
|
487
|
-
}, props), _path$
|
|
495
|
+
}, props), _path$1u || (_path$1u = /*#__PURE__*/React__namespace.createElement("path", {
|
|
488
496
|
d: "M6.86 2.573L1.213 12a1.334 1.334 0 001.14 2h11.294a1.332 1.332 0 001.14-2L9.14 2.573a1.333 1.333 0 00-2.28 0v0zM8 6v2.667m0 2.667h.007",
|
|
489
497
|
stroke: "currentColor"
|
|
490
498
|
})));
|
|
491
499
|
}
|
|
492
500
|
|
|
493
|
-
var _path$
|
|
501
|
+
var _path$18;
|
|
494
502
|
|
|
495
|
-
function _extends$
|
|
503
|
+
function _extends$2U() { _extends$2U = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2U.apply(this, arguments); }
|
|
496
504
|
|
|
497
505
|
function SvgTrash(props) {
|
|
498
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
506
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2U({
|
|
499
507
|
viewBox: "0 0 16 16",
|
|
500
508
|
fill: "none",
|
|
501
509
|
strokeLinecap: "round",
|
|
502
510
|
strokeLinejoin: "round",
|
|
503
511
|
width: "1em",
|
|
504
512
|
height: "1em"
|
|
505
|
-
}, props), _path$
|
|
513
|
+
}, props), _path$18 || (_path$18 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
506
514
|
d: "M2 4h12M5.333 4V2.667a1.333 1.333 0 011.334-1.333h2.666a1.333 1.333 0 011.334 1.333V4m2 0v9.334a1.333 1.333 0 01-1.334 1.333H4.667a1.333 1.333 0 01-1.334-1.333V4h9.334zm-6 3.333v4m2.666-4v4",
|
|
507
515
|
stroke: "currentColor"
|
|
508
516
|
})));
|
|
509
517
|
}
|
|
510
518
|
|
|
511
|
-
var _path$
|
|
519
|
+
var _path$h, _path2$3;
|
|
512
520
|
|
|
513
|
-
function _extends$
|
|
521
|
+
function _extends$C() { _extends$C = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$C.apply(this, arguments); }
|
|
514
522
|
|
|
515
523
|
function SvgReviews(props) {
|
|
516
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
524
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$C({
|
|
517
525
|
viewBox: "0 0 16 16",
|
|
518
526
|
fill: "none",
|
|
519
527
|
strokeLinecap: "round",
|
|
520
528
|
strokeLinejoin: "round",
|
|
521
529
|
width: "1em",
|
|
522
530
|
height: "1em"
|
|
523
|
-
}, props), _path$
|
|
531
|
+
}, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
|
|
524
532
|
d: "M14 7.667a5.587 5.587 0 01-.6 2.533 5.666 5.666 0 01-5.067 3.133 5.588 5.588 0 01-2.533-.6L2 14l1.267-3.8a5.586 5.586 0 01-.6-2.533A5.667 5.667 0 015.8 2.6 5.587 5.587 0 018.333 2h.334A5.654 5.654 0 0114 7.333v.334z",
|
|
525
533
|
stroke: "currentColor"
|
|
526
|
-
})), _path2$
|
|
534
|
+
})), _path2$3 || (_path2$3 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
527
535
|
d: "M8.375 5.363a.2.2 0 01.358 0l.578 1.17a.2.2 0 00.15.11l1.292.189a.2.2 0 01.11.34l-.934.911a.2.2 0 00-.057.177l.22 1.286a.2.2 0 01-.29.21L8.647 9.15a.2.2 0 00-.186 0l-1.155.608a.2.2 0 01-.29-.211l.22-1.286a.2.2 0 00-.058-.177l-.934-.91a.2.2 0 01.11-.341l1.293-.19a.2.2 0 00.15-.109l.578-1.17z",
|
|
528
536
|
fill: "currentColor"
|
|
529
537
|
})));
|
|
@@ -567,19 +575,19 @@ function __rest(s, e) {
|
|
|
567
575
|
return t;
|
|
568
576
|
}
|
|
569
577
|
|
|
570
|
-
var _path$
|
|
578
|
+
var _path$1D;
|
|
571
579
|
|
|
572
|
-
function _extends$
|
|
580
|
+
function _extends$3G() { _extends$3G = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3G.apply(this, arguments); }
|
|
573
581
|
|
|
574
582
|
function SvgUser(props) {
|
|
575
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
583
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3G({
|
|
576
584
|
viewBox: "0 0 16 16",
|
|
577
585
|
fill: "none",
|
|
578
586
|
strokeLinecap: "round",
|
|
579
587
|
strokeLinejoin: "round",
|
|
580
588
|
width: "1em",
|
|
581
589
|
height: "1em"
|
|
582
|
-
}, props), _path$
|
|
590
|
+
}, props), _path$1D || (_path$1D = /*#__PURE__*/React__namespace.createElement("path", {
|
|
583
591
|
d: "M13.333 14v-1.333A2.667 2.667 0 0010.667 10H5.333a2.667 2.667 0 00-2.666 2.667V14M8 7.333A2.667 2.667 0 108 2a2.667 2.667 0 000 5.333z",
|
|
584
592
|
stroke: "currentColor"
|
|
585
593
|
})));
|
|
@@ -972,10 +980,10 @@ var useTypographyStyles = styles.makeStyles(function (theme) {
|
|
|
972
980
|
});
|
|
973
981
|
|
|
974
982
|
var Typography = function (props) {
|
|
975
|
-
props.weight; props.color; var restProps = __rest(props, ["weight", "color"]);
|
|
983
|
+
props.weight; props.color; var TypographyRef = props.TypographyRef, restProps = __rest(props, ["weight", "color", "TypographyRef"]);
|
|
976
984
|
var classes = useTypographyStyles(__assign({}, props));
|
|
977
985
|
var variantMapping = { subtitle1: 'p' };
|
|
978
|
-
return React__default['default'].createElement(core.Typography, __assign({ classes: classes, variantMapping: variantMapping }, restProps));
|
|
986
|
+
return React__default['default'].createElement(core.Typography, __assign({ classes: classes, variantMapping: variantMapping, ref: TypographyRef }, restProps));
|
|
979
987
|
};
|
|
980
988
|
Typography.displayName = 'Typography';
|
|
981
989
|
Typography.defaultProps = defaultTypographyProps;
|
|
@@ -1636,98 +1644,190 @@ var useLabelStyles = styles.makeStyles(function (theme) { return ({
|
|
|
1636
1644
|
},
|
|
1637
1645
|
}); });
|
|
1638
1646
|
|
|
1647
|
+
var useQuantityPickerStyles = styles.makeStyles(function (theme) { return ({
|
|
1648
|
+
root: {
|
|
1649
|
+
height: theme.spacing(7),
|
|
1650
|
+
backgroundColor: 'none',
|
|
1651
|
+
},
|
|
1652
|
+
}); });
|
|
1653
|
+
var useQuantityInputStyles = styles.makeStyles(function (theme) { return ({
|
|
1654
|
+
root: {
|
|
1655
|
+
height: '100%',
|
|
1656
|
+
width: 'min-content',
|
|
1657
|
+
borderRadius: theme.spacing(12.5),
|
|
1658
|
+
background: function (props) { return (props.variation === 'modifierCount' ? 'unset' : theme.palette.grey[100]); },
|
|
1659
|
+
},
|
|
1660
|
+
input: {
|
|
1661
|
+
'&::-webkit-clear-button, &::-webkit-outer-spin-button, &::-webkit-inner-spin-button': {
|
|
1662
|
+
display: 'none',
|
|
1663
|
+
},
|
|
1664
|
+
'-moz-appearance': 'textfield',
|
|
1665
|
+
fontWeight: 600,
|
|
1666
|
+
padding: 0,
|
|
1667
|
+
textAlign: 'center',
|
|
1668
|
+
zIndex: function (props) { return (props.value === 0 && props.variation === 'modifierCount' ? -1 : 1); },
|
|
1669
|
+
backgroundColor: function (props) { return (props.variation === 'modifierCount' ? theme.palette.grey[100] : 'unset'); },
|
|
1670
|
+
alignSelf: function (props) { return (props.variation === 'modifierCount' ? 'stretch' : 'unset'); },
|
|
1671
|
+
height: function (props) { return (props.variation === 'modifierCount' ? 'auto' : 'unset'); },
|
|
1672
|
+
minWidth: function (props) { return (props.variation === 'modifierCount' ? theme.spacing(5) : theme.spacing(2.75)); },
|
|
1673
|
+
borderRadius: function (props) { return (props.variation === 'modifierCount' ? theme.spacing(1) : 'unset'); },
|
|
1674
|
+
margin: function (props) { return (props.variation === 'modifierCount' ? theme.spacing(0.5, 0) : 0); },
|
|
1675
|
+
},
|
|
1676
|
+
}); });
|
|
1677
|
+
var useStartAdornmentStyles = styles.makeStyles(function (theme) { return ({
|
|
1678
|
+
root: {
|
|
1679
|
+
color: theme.palette.text.primary,
|
|
1680
|
+
zIndex: function (props) { return (props.value === 0 && props.variation === 'modifierCount' ? -1 : 1); },
|
|
1681
|
+
},
|
|
1682
|
+
}); });
|
|
1683
|
+
var useEndAdornmentStyles = styles.makeStyles(function (theme) { return ({
|
|
1684
|
+
root: {
|
|
1685
|
+
color: theme.palette.text.primary,
|
|
1686
|
+
},
|
|
1687
|
+
}); });
|
|
1688
|
+
|
|
1689
|
+
var QuantityPicker = function (props) {
|
|
1690
|
+
var value = props.value, onChange = props.onChange, disabled = props.disabled, disableIncrement = props.disableIncrement, preventManualChange = props.preventManualChange, variation = props.variation;
|
|
1691
|
+
var fieldClasses = useQuantityPickerStyles();
|
|
1692
|
+
var inputClasses = useQuantityInputStyles(props);
|
|
1693
|
+
var startAdornmentClasses = useStartAdornmentStyles(props);
|
|
1694
|
+
var endAdornmentClasses = useEndAdornmentStyles(props);
|
|
1695
|
+
var onIncrement = function (event) {
|
|
1696
|
+
onChange(event, { quantity: value + 1, reason: 'increment' });
|
|
1697
|
+
};
|
|
1698
|
+
var onDecrement = function (event) {
|
|
1699
|
+
onChange(event, { quantity: value - 1, reason: 'decrement' });
|
|
1700
|
+
};
|
|
1701
|
+
var handleChange = function (event) {
|
|
1702
|
+
if (preventManualChange) {
|
|
1703
|
+
event.preventDefault();
|
|
1704
|
+
}
|
|
1705
|
+
if (!preventManualChange) {
|
|
1706
|
+
onChange(event, { quantity: parseInt(event.target.value), reason: 'change' });
|
|
1707
|
+
}
|
|
1708
|
+
};
|
|
1709
|
+
return (React__default['default'].createElement(core.TextField, { classes: fieldClasses, type: "number", variant: variation === 'itemCount' ? 'filled' : 'standard', defaultValue: value, value: value, disabled: disabled, onChange: handleChange, InputProps: {
|
|
1710
|
+
classes: inputClasses,
|
|
1711
|
+
disableUnderline: true,
|
|
1712
|
+
endAdornment: (React__default['default'].createElement(IconButton, { "aria-label": "plus one", className: endAdornmentClasses.root, color: "default", onClick: onIncrement, disabled: disabled || disableIncrement },
|
|
1713
|
+
React__default['default'].createElement(Icon, { icon: SvgPlusCircle }))),
|
|
1714
|
+
startAdornment: (React__default['default'].createElement(IconButton, { "aria-label": "minus one", className: startAdornmentClasses.root, color: "default", onClick: onDecrement, disabled: disabled || value <= 0 },
|
|
1715
|
+
React__default['default'].createElement(Icon, { icon: SvgMinusCircle }))),
|
|
1716
|
+
} }));
|
|
1717
|
+
};
|
|
1718
|
+
|
|
1639
1719
|
var Label = function (props) {
|
|
1640
|
-
var name = props.name, price = props.price,
|
|
1720
|
+
var name = props.name, price = props.price, outOfStock = props.outOfStock, messages = props.messages;
|
|
1641
1721
|
var classes = useLabelStyles();
|
|
1642
1722
|
return (React__default['default'].createElement(core.Box, { display: "flex", flexDirection: "column", className: classes.label },
|
|
1643
1723
|
React__default['default'].createElement(core.Box, { display: "flex", alignItems: "center", gridGap: 8 },
|
|
1644
1724
|
React__default['default'].createElement(core.Typography, null, name),
|
|
1645
|
-
|
|
1646
|
-
price && React__default['default'].createElement(core.Typography,
|
|
1725
|
+
outOfStock && (React__default['default'].createElement(core.Typography, { variant: "caption", className: classes.outOfStock }, messages.outOfStockText))),
|
|
1726
|
+
price && React__default['default'].createElement(core.Typography, null,
|
|
1647
1727
|
"+ ",
|
|
1648
1728
|
price)));
|
|
1649
1729
|
};
|
|
1650
|
-
var
|
|
1651
|
-
var
|
|
1652
|
-
var
|
|
1653
|
-
var
|
|
1654
|
-
var handleChange = function (event) {
|
|
1655
|
-
var _a;
|
|
1656
|
-
var price = (_a = modifiers.find(function (modifier) { return modifier.id === parseInt(event.target.value); })) === null || _a === void 0 ? void 0 : _a.price;
|
|
1730
|
+
var SingleSelectModifierControl = function (props) {
|
|
1731
|
+
var modifiers = props.modifiers, isOutOfStock = props.isOutOfStock, onChange = props.onChange, value = props.value, messages = props.messages;
|
|
1732
|
+
var radioClasses = useRadioModifierFormStyles();
|
|
1733
|
+
var makeHandleChange = function (modifier) { return function (e) {
|
|
1657
1734
|
onChange([
|
|
1658
1735
|
{
|
|
1659
|
-
id:
|
|
1660
|
-
price:
|
|
1661
|
-
quantity: 1,
|
|
1662
|
-
},
|
|
1663
|
-
], event.target.checked);
|
|
1664
|
-
};
|
|
1665
|
-
return (React__default['default'].createElement(core.Box, { display: "flex", flexDirection: "column" }, modifiers.map(function (modifier, index) {
|
|
1666
|
-
var targetValue = value === null || value === void 0 ? void 0 : value.find(function (v) { return v.id == modifier.id; });
|
|
1667
|
-
return (React__default['default'].createElement(core.FormControlLabel, { key: index, value: modifier.id, control: React__default['default'].createElement(core.Checkbox, { className: classes.radio, disabled: (!targetValue && disableNewSelections) || isOutOfStock || modifier.outOfStock }), label: React__default['default'].createElement(Label, { name: modifier.name, price: modifier.price
|
|
1668
|
-
? "" + (appContext && appContext.currencySymbol) + Number(modifier.price).toFixed(2)
|
|
1669
|
-
: null, disabled: isOutOfStock || modifier.outOfStock, isOutOfStock: isOutOfStock }), className: classes.root, checked: !!targetValue, onChange: handleChange }));
|
|
1670
|
-
})));
|
|
1671
|
-
};
|
|
1672
|
-
var RadioGroup = function (props) {
|
|
1673
|
-
var value = props.value, modifiers = props.modifiers, onChange = props.onChange, isOutOfStock = props.isOutOfStock;
|
|
1674
|
-
var classes = useRadioModifierFormStyles();
|
|
1675
|
-
var appContext = useOrderingAppContext()[0];
|
|
1676
|
-
var handleChange = function (event) {
|
|
1677
|
-
var _a;
|
|
1678
|
-
var price = (_a = modifiers.find(function (modifier) { return modifier.id === parseInt(event.target.value); })) === null || _a === void 0 ? void 0 : _a.price;
|
|
1679
|
-
onChange([
|
|
1680
|
-
{
|
|
1681
|
-
id: parseInt(event.target.value),
|
|
1682
|
-
price: (price && parseInt(price)) || 0,
|
|
1736
|
+
id: Number(e.target.value),
|
|
1737
|
+
price: modifier.price,
|
|
1683
1738
|
quantity: 1,
|
|
1684
1739
|
},
|
|
1685
1740
|
]);
|
|
1686
|
-
};
|
|
1687
|
-
return (React__default['default'].createElement(
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1741
|
+
}; };
|
|
1742
|
+
return (React__default['default'].createElement(core.FormControl, { fullWidth: true },
|
|
1743
|
+
React__default['default'].createElement(core.RadioGroup, null, modifiers.map(function (modifier) {
|
|
1744
|
+
var _a;
|
|
1745
|
+
return (React__default['default'].createElement(core.FormControlLabel, { key: modifier.id, value: modifier.id, control: React__default['default'].createElement(core.Radio, { checked: ((_a = value[0]) === null || _a === void 0 ? void 0 : _a.id) === modifier.id, className: radioClasses.radio, disabled: isOutOfStock || modifier.outOfStock, onChange: makeHandleChange(modifier) }), label: React__default['default'].createElement(Label, { messages: messages, name: modifier.name, price: modifier.formattedPrice, disabled: isOutOfStock || modifier.outOfStock, outOfStock: isOutOfStock }) }));
|
|
1746
|
+
}))));
|
|
1747
|
+
};
|
|
1748
|
+
var MultipleSelectControl = function (props) {
|
|
1749
|
+
var modifiers = props.modifiers, value = props.value, isOutOfStock = props.isOutOfStock, onChange = props.onChange, messages = props.messages, disableNewSelections = props.disableNewSelections;
|
|
1750
|
+
var classes = useCheckboxModifierFormStyles();
|
|
1751
|
+
var makeHandleChange = function (modifier) { return function () {
|
|
1752
|
+
var isModifierInValue = Boolean(value.find(function (v) { return v.id === modifier.id; }));
|
|
1753
|
+
if (isModifierInValue) {
|
|
1754
|
+
onChange(value.filter(function (v) { return v.id !== modifier.id; }));
|
|
1755
|
+
}
|
|
1756
|
+
else {
|
|
1757
|
+
onChange(__spreadArray(__spreadArray([], value), [{ id: modifier.id, price: modifier.price || 0, quantity: 1 }]));
|
|
1758
|
+
}
|
|
1759
|
+
}; };
|
|
1760
|
+
return (React__default['default'].createElement(core.FormControl, { fullWidth: true },
|
|
1761
|
+
React__default['default'].createElement(core.FormGroup, null, modifiers.map(function (modifier) { return (React__default['default'].createElement(core.FormControlLabel, { key: modifier.id, value: modifier.id, className: classes.root, checked: value.some(function (v) { return v.id === modifier.id; }), onChange: makeHandleChange(modifier), control: React__default['default'].createElement(core.Checkbox, { className: classes.radio, disabled: isOutOfStock || modifier.outOfStock || (!modifier.quantity && disableNewSelections) }), label: React__default['default'].createElement(Label, { messages: messages, name: modifier.name, price: modifier.formattedPrice, disabled: isOutOfStock || modifier.outOfStock, outOfStock: isOutOfStock }) })); }))));
|
|
1762
|
+
};
|
|
1763
|
+
var MultipleQuantitySelectControl = function (props) {
|
|
1764
|
+
var modifiers = props.modifiers, value = props.value, isOutOfStock = props.isOutOfStock, onChange = props.onChange, messages = props.messages, disableNewSelections = props.disableNewSelections;
|
|
1765
|
+
var makeHandleChange = function (modifier) { return function (_e, customEvent) {
|
|
1766
|
+
var isModifierInValue = Boolean(value.find(function (v) { return v.id === modifier.id; }));
|
|
1767
|
+
var isQuantityZero = customEvent.quantity === 0;
|
|
1768
|
+
var shouldRemoveModifierFromValue = isModifierInValue && isQuantityZero;
|
|
1769
|
+
var shouldAddModifierToValue = !isModifierInValue && !isQuantityZero;
|
|
1770
|
+
var shouldUpdateModifierInValue = isModifierInValue && !isQuantityZero;
|
|
1771
|
+
if (shouldRemoveModifierFromValue) {
|
|
1772
|
+
onChange(value.filter(function (v) { return v.id !== modifier.id; }));
|
|
1773
|
+
}
|
|
1774
|
+
if (shouldAddModifierToValue) {
|
|
1775
|
+
onChange(__spreadArray(__spreadArray([], value), [{ id: modifier.id, price: modifier.price, quantity: customEvent.quantity }]));
|
|
1776
|
+
}
|
|
1777
|
+
if (shouldUpdateModifierInValue) {
|
|
1778
|
+
onChange(value.map(function (val) { return (val.id === modifier.id ? __assign$1(__assign$1({}, val), { quantity: customEvent.quantity }) : val); }));
|
|
1779
|
+
}
|
|
1780
|
+
}; };
|
|
1781
|
+
return (React__default['default'].createElement(core.FormControl, { fullWidth: true },
|
|
1782
|
+
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' }, display: "flex" },
|
|
1783
|
+
React__default['default'].createElement(Label, { messages: messages, name: modifier.name, price: modifier.formattedPrice, disabled: isOutOfStock || modifier.outOfStock, outOfStock: isOutOfStock }),
|
|
1784
|
+
React__default['default'].createElement(QuantityPicker, { variation: "modifierCount", value: modifier.quantity, disableIncrement: disableNewSelections, preventManualChange: true, onChange: makeHandleChange(modifier) }))); }))));
|
|
1785
|
+
};
|
|
1786
|
+
var ModifierControls = function (props) {
|
|
1787
|
+
switch (props.type) {
|
|
1693
1788
|
case 'singleSelect':
|
|
1694
|
-
return React__default['default'].createElement(
|
|
1789
|
+
return React__default['default'].createElement(SingleSelectModifierControl, __assign$1({}, props));
|
|
1695
1790
|
case 'multipleSelect':
|
|
1696
|
-
return
|
|
1791
|
+
return React__default['default'].createElement(MultipleSelectControl, __assign$1({}, props));
|
|
1792
|
+
case 'multipleQuantitySelect':
|
|
1793
|
+
return React__default['default'].createElement(MultipleQuantitySelectControl, __assign$1({}, props));
|
|
1697
1794
|
default:
|
|
1698
1795
|
return null;
|
|
1699
1796
|
}
|
|
1700
1797
|
};
|
|
1701
1798
|
|
|
1702
|
-
var
|
|
1703
|
-
var
|
|
1704
|
-
var optionalText = messages.optionalText, outOfStockText = messages.outOfStockText, requiredText = messages.requiredText
|
|
1705
|
-
var isFullyOutOfStock = isOutOfStock || !modifiers.some(function (modifier) { return !modifier.outOfStock; });
|
|
1706
|
-
var classes = useDishModifierCardStyles();
|
|
1799
|
+
var getStatusTagProps = function (props) {
|
|
1800
|
+
var messages = props.messages, error = props.error, isRequired = props.isRequired, isOutOfStock = props.isOutOfStock;
|
|
1801
|
+
var optionalText = messages.optionalText, outOfStockText = messages.outOfStockText, requiredText = messages.requiredText;
|
|
1707
1802
|
var color = 'default';
|
|
1708
1803
|
switch (true) {
|
|
1709
1804
|
case error:
|
|
1710
1805
|
color = 'error';
|
|
1711
|
-
case
|
|
1806
|
+
case isOutOfStock:
|
|
1712
1807
|
color = 'warning';
|
|
1713
1808
|
}
|
|
1714
1809
|
var label = optionalText;
|
|
1715
1810
|
switch (true) {
|
|
1716
|
-
case
|
|
1811
|
+
case isOutOfStock:
|
|
1717
1812
|
label = outOfStockText;
|
|
1718
1813
|
break;
|
|
1719
1814
|
case isRequired:
|
|
1720
1815
|
label = requiredText;
|
|
1721
1816
|
break;
|
|
1722
1817
|
}
|
|
1818
|
+
var variant = isRequired || isOutOfStock ? 'outlined' : 'filled';
|
|
1819
|
+
return { color: color, label: label, variant: variant };
|
|
1820
|
+
};
|
|
1821
|
+
var DishModifierCard = function (props) {
|
|
1822
|
+
var 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;
|
|
1823
|
+
var classes = useDishModifierCardStyles();
|
|
1723
1824
|
return (React__default['default'].createElement(core.Box, { className: classes.root },
|
|
1724
1825
|
React__default['default'].createElement(core.Box, { display: "flex", justifyContent: "space-between", width: "100%", alignItems: "center", height: "fit-content", marginBottom: 2 },
|
|
1725
|
-
React__default['default'].createElement(StatusTag, {
|
|
1726
|
-
!
|
|
1826
|
+
React__default['default'].createElement(StatusTag, __assign$1({}, getStatusTagProps(props))),
|
|
1827
|
+
!isOutOfStock && (React__default['default'].createElement(Typography, { variant: "subtitle1", className: error ? classes.error : undefined }, messages.helperText))),
|
|
1727
1828
|
React__default['default'].createElement(Typography, { className: classes.name }, name),
|
|
1728
1829
|
React__default['default'].createElement(core.Box, null,
|
|
1729
|
-
React__default['default'].createElement(
|
|
1730
|
-
React__default['default'].createElement(ModifierOptionsControl, { type: type, modifiers: modifiers, value: value, onChange: onChange, disableNewSelections: disableNewSelections, isOutOfStock: isFullyOutOfStock })))));
|
|
1830
|
+
React__default['default'].createElement(ModifierControls, { value: value, modifiers: modifiers, isOutOfStock: isOutOfStock, onChange: onChange, disableNewSelections: disableNewSelections, type: type, messages: messages }))));
|
|
1731
1831
|
};
|
|
1732
1832
|
DishModifierCard.displayName = 'DishModifierCard';
|
|
1733
1833
|
|
|
@@ -1947,61 +2047,6 @@ var MenuFilter = function (props) {
|
|
|
1947
2047
|
React__default['default'].createElement(Typography, { variant: "body1", color: "grey.500" }, noOptionsLabel)))))));
|
|
1948
2048
|
};
|
|
1949
2049
|
|
|
1950
|
-
var useQuantityPickerStyles = styles.makeStyles(function (theme) { return ({
|
|
1951
|
-
root: {
|
|
1952
|
-
height: theme.spacing(7),
|
|
1953
|
-
},
|
|
1954
|
-
}); });
|
|
1955
|
-
var useQuantityInputStyles = styles.makeStyles(function (theme) { return ({
|
|
1956
|
-
root: {
|
|
1957
|
-
height: '100%',
|
|
1958
|
-
width: 'min-content',
|
|
1959
|
-
borderRadius: theme.spacing(12.5),
|
|
1960
|
-
background: theme.palette.grey[100],
|
|
1961
|
-
},
|
|
1962
|
-
input: {
|
|
1963
|
-
'&::-webkit-clear-button, &::-webkit-outer-spin-button, &::-webkit-inner-spin-button': {
|
|
1964
|
-
display: 'none',
|
|
1965
|
-
},
|
|
1966
|
-
'-moz-appearance': 'textfield',
|
|
1967
|
-
fontWeight: 600,
|
|
1968
|
-
minWidth: theme.spacing(2.75),
|
|
1969
|
-
padding: 0,
|
|
1970
|
-
textAlign: 'center',
|
|
1971
|
-
position: 'relative',
|
|
1972
|
-
left: 1,
|
|
1973
|
-
},
|
|
1974
|
-
adornedStart: {
|
|
1975
|
-
padding: theme.spacing(0.25),
|
|
1976
|
-
},
|
|
1977
|
-
adornedEnd: {
|
|
1978
|
-
padding: theme.spacing(0.5),
|
|
1979
|
-
},
|
|
1980
|
-
}); });
|
|
1981
|
-
|
|
1982
|
-
var QuantityPicker = function (props) {
|
|
1983
|
-
var value = props.value, onChange = props.onChange, disabled = props.disabled;
|
|
1984
|
-
var fieldClasses = useQuantityPickerStyles();
|
|
1985
|
-
var inputClasses = useQuantityInputStyles();
|
|
1986
|
-
var onIncrement = function () {
|
|
1987
|
-
onChange({ target: { value: value + 1 } }, 'increment');
|
|
1988
|
-
};
|
|
1989
|
-
var onDecrement = function () {
|
|
1990
|
-
onChange({ target: { value: value - 1 } }, 'decrement');
|
|
1991
|
-
};
|
|
1992
|
-
var handleChange = function (event) {
|
|
1993
|
-
onChange({ target: { value: parseInt(event.target.value) } }, 'change');
|
|
1994
|
-
};
|
|
1995
|
-
return (React__default['default'].createElement(core.TextField, { classes: __assign$1({}, fieldClasses), variant: "filled", type: "number", defaultValue: value, value: value, disabled: disabled, onChange: handleChange, InputProps: {
|
|
1996
|
-
classes: __assign$1({}, inputClasses),
|
|
1997
|
-
disableUnderline: true,
|
|
1998
|
-
endAdornment: (React__default['default'].createElement(IconButton, { color: "default", tabIndex: -1, onClick: onIncrement, disabled: disabled },
|
|
1999
|
-
React__default['default'].createElement(Icon, { icon: SvgPlusCircle }))),
|
|
2000
|
-
startAdornment: (React__default['default'].createElement(IconButton, { color: "default", tabIndex: -1, onClick: onDecrement, disabled: disabled },
|
|
2001
|
-
React__default['default'].createElement(Icon, { icon: SvgMinusCircle }))),
|
|
2002
|
-
} }));
|
|
2003
|
-
};
|
|
2004
|
-
|
|
2005
2050
|
var useSelectableChipStyles = styles.makeStyles(function (theme) { return ({
|
|
2006
2051
|
root: {
|
|
2007
2052
|
border: '2px solid',
|