ordering-ui-admin-external 1.12.3 → 1.12.5

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.
@@ -36,7 +36,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
36
36
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
37
37
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
38
38
  var PaymentOption = function PaymentOption(props) {
39
- var _sitesState$sites, _localState$sites, _businessPaymethod$pa2, _sitesState$sites4, _sitesState$sites5;
39
+ var _sitesState$sites, _localState$sites, _businessPaymethod$si, _businessPaymethod$pa2, _sitesState$sites4, _sitesState$sites5;
40
40
  var open = props.open,
41
41
  onClose = props.onClose,
42
42
  orderTypes = props.orderTypes,
@@ -77,7 +77,7 @@ var PaymentOption = function PaymentOption(props) {
77
77
  _useState8 = _slicedToArray(_useState7, 2),
78
78
  localState = _useState8[0],
79
79
  setLocalState = _useState8[1];
80
- var filteredOptions = (_localState$sites = localState === null || localState === void 0 ? void 0 : localState.sites) !== null && _localState$sites !== void 0 ? _localState$sites : businessPaymethod === null || businessPaymethod === void 0 ? void 0 : businessPaymethod.sites.filter(function (a) {
80
+ var filteredOptions = (_localState$sites = localState === null || localState === void 0 ? void 0 : localState.sites) !== null && _localState$sites !== void 0 ? _localState$sites : businessPaymethod === null || businessPaymethod === void 0 ? void 0 : (_businessPaymethod$si = businessPaymethod.sites) === null || _businessPaymethod$si === void 0 ? void 0 : _businessPaymethod$si.filter(function (a) {
81
81
  var _sitesState$sites2;
82
82
  return sitesState === null || sitesState === void 0 ? void 0 : (_sitesState$sites2 = sitesState.sites) === null || _sitesState$sites2 === void 0 ? void 0 : _sitesState$sites2.find(function (b) {
83
83
  return a.id === b.id;
@@ -198,7 +198,7 @@ var PaymentOption = function PaymentOption(props) {
198
198
  }, all ? /*#__PURE__*/_react.default.createElement(_RiCheckboxFill.default, {
199
199
  className: "fill"
200
200
  }) : /*#__PURE__*/_react.default.createElement(_RiCheckboxBlankLine.default, null), /*#__PURE__*/_react.default.createElement(_styles3.TabOptionName, null, t('ALL', 'All'))), !all && (sitesState === null || sitesState === void 0 ? void 0 : sitesState.sites.map(function (site) {
201
- var _ref2, _localState$sites2, _businessPaymethod$si;
201
+ var _ref2, _localState$sites2, _businessPaymethod$si2;
202
202
  return /*#__PURE__*/_react.default.createElement(_styles3.TabOption, {
203
203
  key: site.id,
204
204
  onClick: function onClick() {
@@ -207,7 +207,7 @@ var PaymentOption = function PaymentOption(props) {
207
207
  value: site.id
208
208
  });
209
209
  }
210
- }, (_ref2 = (_localState$sites2 = localState === null || localState === void 0 ? void 0 : localState.sites) !== null && _localState$sites2 !== void 0 ? _localState$sites2 : businessPaymethod === null || businessPaymethod === void 0 ? void 0 : (_businessPaymethod$si = businessPaymethod.sites) === null || _businessPaymethod$si === void 0 ? void 0 : _businessPaymethod$si.map(function (s) {
210
+ }, (_ref2 = (_localState$sites2 = localState === null || localState === void 0 ? void 0 : localState.sites) !== null && _localState$sites2 !== void 0 ? _localState$sites2 : businessPaymethod === null || businessPaymethod === void 0 ? void 0 : (_businessPaymethod$si2 = businessPaymethod.sites) === null || _businessPaymethod$si2 === void 0 ? void 0 : _businessPaymethod$si2.map(function (s) {
211
211
  return s.id;
212
212
  })) !== null && _ref2 !== void 0 && _ref2.includes(site.id) ? /*#__PURE__*/_react.default.createElement(_RiCheckboxFill.default, {
213
213
  className: "fill"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-admin-external",
3
- "version": "1.12.3",
3
+ "version": "1.12.5",
4
4
  "description": "Ordering UI Admin Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -83,7 +83,7 @@
83
83
  "lodash": "^4.17.20",
84
84
  "moment": "^2.29.1",
85
85
  "moment-range": "^4.0.2",
86
- "ordering-components-admin-external": "1.12.4",
86
+ "ordering-components-admin-external": "1.12.5",
87
87
  "polished": "^3.6.7",
88
88
  "prop-types": "^15.7.2",
89
89
  "react-big-calendar": "^1.4.2",
@@ -41,7 +41,7 @@ export const PaymentOption = (props) => {
41
41
  const [paymentTabs, setPaymentTabs] = useState(sitesState?.sites?.length > 0 ? 0 : 1)
42
42
  const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
43
43
  const [localState, setLocalState] = useState({ allowed_order_types: businessPaymethod?.allowed_order_types, sites: businessPaymethod?.sites })
44
- const filteredOptions = localState?.sites ?? businessPaymethod?.sites.filter(a => sitesState?.sites?.find(b => a.id === b.id))
44
+ const filteredOptions = localState?.sites ?? businessPaymethod?.sites?.filter(a => sitesState?.sites?.find(b => a.id === b.id))
45
45
  const [all, setAll] = useState(!!!filteredOptions?.length)
46
46
 
47
47
  const setPaymethodInfo = (values) => {