@salesgenterp/ui-components 0.4.310 → 0.4.311

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,6 +1,6 @@
1
1
  import { Button, CircularProgress, TextField, Grid, Typography, Stack, Skeleton as Skeleton$1, CssBaseline, Box, InputAdornment, IconButton, TableHead, TableRow, Paper, TableContainer as TableContainer$2, Table, TableBody, TableCell, TablePagination, Dialog, DialogContent, DialogActions, DialogTitle, RadioGroup, Radio, FormControlLabel, FormControl, FormLabel, FormHelperText, Select as Select$1, InputLabel, MenuItem, CardMedia, Divider, CardContent, ListItemIcon, ListItem, Collapse, List, ListItemText, Checkbox, Card, CardHeader, Tabs, Tab, Toolbar, Drawer, Tooltip, Avatar as Avatar$1, alpha, Stepper, Step, StepLabel, StepContent } from '@mui/material';
2
2
  import React__default, { useState, useEffect, forwardRef, createElement, memo, useCallback, useRef } from 'react';
3
- import { AiOutlineHome, AiOutlineRight, AiOutlineRise, AiOutlineShoppingCart, AiOutlineHeart, AiOutlineCreditCard, AiOutlineFileText, AiOutlineSetting, AiOutlineLeft, AiOutlineMinus, AiOutlinePlus, AiOutlineClose, AiOutlineDelete, AiOutlineCheckCircle, AiOutlineCheck } from 'react-icons/ai';
3
+ import { AiOutlineHome, AiOutlineRight, AiOutlinePlus, AiOutlineRise, AiOutlineShoppingCart, AiOutlineHeart, AiOutlineCreditCard, AiOutlineFileText, AiOutlineSetting, AiOutlineLeft, AiOutlineMinus, AiOutlineClose, AiOutlineDelete, AiOutlineCheckCircle, AiOutlineCheck } from 'react-icons/ai';
4
4
  import styled, { ThemeProvider } from 'styled-components';
5
5
  import axios from 'axios';
6
6
  import { isEmpty, get, template, isPlainObject, includes, values, filter, cloneDeep, omit, sortBy, uniqBy, isObject, isNumber, remove, sumBy } from 'lodash';
@@ -1877,7 +1877,6 @@ var AddAuthorizeDotNetCard = function AddAuthorizeDotNetCard(_ref) {
1877
1877
  visible = _ref.visible,
1878
1878
  onCancel = _ref.onCancel,
1879
1879
  styles = _ref.styles,
1880
- fontColor = _ref.fontColor,
1881
1880
  customerId = _ref.customerId,
1882
1881
  setListUpdate = _ref.setListUpdate;
1883
1882
  var _useForm = useForm({
@@ -1885,7 +1884,8 @@ var AddAuthorizeDotNetCard = function AddAuthorizeDotNetCard(_ref) {
1885
1884
  }),
1886
1885
  handleSubmit = _useForm.handleSubmit,
1887
1886
  control = _useForm.control,
1888
- setValue = _useForm.setValue;
1887
+ setValue = _useForm.setValue,
1888
+ watch = _useForm.watch;
1889
1889
  var _useState = useState(false),
1890
1890
  submitLoading = _useState[0],
1891
1891
  setSubmitLoading = _useState[1];
@@ -1895,6 +1895,11 @@ var AddAuthorizeDotNetCard = function AddAuthorizeDotNetCard(_ref) {
1895
1895
  var _useState3 = useState([]),
1896
1896
  states = _useState3[0],
1897
1897
  setStates = _useState3[1];
1898
+ var cardNumber = watch('cardNumber');
1899
+ var expirationYear = watch('expirationYear');
1900
+ var expirationMonth = watch('expirationMonth');
1901
+ var firstName = watch('firstName');
1902
+ var lastName = watch('lastName');
1898
1903
  var getCountryData = function getCountryData() {
1899
1904
  try {
1900
1905
  var _temp = _catch(function () {
@@ -2001,7 +2006,11 @@ var AddAuthorizeDotNetCard = function AddAuthorizeDotNetCard(_ref) {
2001
2006
  },
2002
2007
  onClick: onCancel
2003
2008
  }, "Cancel"))))
2004
- }, /*#__PURE__*/React__default.createElement("form", null, /*#__PURE__*/React__default.createElement(Grid, {
2009
+ }, /*#__PURE__*/React__default.createElement(Cards, {
2010
+ expiry: (expirationMonth || '') + " " + (expirationYear || '') || '----',
2011
+ name: (firstName || '') + " " + (lastName || ''),
2012
+ number: cardNumber || ''
2013
+ }), /*#__PURE__*/React__default.createElement("form", null, /*#__PURE__*/React__default.createElement(Grid, {
2005
2014
  container: true,
2006
2015
  columnSpacing: 2
2007
2016
  }, /*#__PURE__*/React__default.createElement(Grid, {
@@ -2013,7 +2022,7 @@ var AddAuthorizeDotNetCard = function AddAuthorizeDotNetCard(_ref) {
2013
2022
  name: "firstName",
2014
2023
  required: true,
2015
2024
  control: control,
2016
- fontColor: fontColor
2025
+ fontColor: styles === null || styles === void 0 ? void 0 : styles.fontColor
2017
2026
  })), /*#__PURE__*/React__default.createElement(Grid, {
2018
2027
  item: true,
2019
2028
  xs: 12,
@@ -2023,7 +2032,7 @@ var AddAuthorizeDotNetCard = function AddAuthorizeDotNetCard(_ref) {
2023
2032
  name: "lastName",
2024
2033
  required: true,
2025
2034
  control: control,
2026
- fontColor: fontColor
2035
+ fontColor: styles === null || styles === void 0 ? void 0 : styles.fontColor
2027
2036
  })), /*#__PURE__*/React__default.createElement(Grid, {
2028
2037
  item: true,
2029
2038
  xs: 12
@@ -2033,7 +2042,7 @@ var AddAuthorizeDotNetCard = function AddAuthorizeDotNetCard(_ref) {
2033
2042
  type: "number",
2034
2043
  required: true,
2035
2044
  control: control,
2036
- fontColor: fontColor
2045
+ fontColor: styles === null || styles === void 0 ? void 0 : styles.fontColor
2037
2046
  })), /*#__PURE__*/React__default.createElement(Grid, {
2038
2047
  item: true,
2039
2048
  xs: 12,
@@ -2044,7 +2053,7 @@ var AddAuthorizeDotNetCard = function AddAuthorizeDotNetCard(_ref) {
2044
2053
  type: "number",
2045
2054
  required: true,
2046
2055
  control: control,
2047
- fontColor: fontColor
2056
+ fontColor: styles === null || styles === void 0 ? void 0 : styles.fontColor
2048
2057
  })), /*#__PURE__*/React__default.createElement(Grid, {
2049
2058
  item: true,
2050
2059
  xs: 12,
@@ -2055,7 +2064,7 @@ var AddAuthorizeDotNetCard = function AddAuthorizeDotNetCard(_ref) {
2055
2064
  type: "number",
2056
2065
  required: true,
2057
2066
  control: control,
2058
- fontColor: fontColor
2067
+ fontColor: styles === null || styles === void 0 ? void 0 : styles.fontColor
2059
2068
  })), /*#__PURE__*/React__default.createElement(Grid, {
2060
2069
  item: true,
2061
2070
  xs: 12,
@@ -2066,7 +2075,7 @@ var AddAuthorizeDotNetCard = function AddAuthorizeDotNetCard(_ref) {
2066
2075
  type: "number",
2067
2076
  required: true,
2068
2077
  control: control,
2069
- fontColor: fontColor
2078
+ fontColor: styles === null || styles === void 0 ? void 0 : styles.fontColor
2070
2079
  })), /*#__PURE__*/React__default.createElement(Grid, {
2071
2080
  item: true,
2072
2081
  xs: 12,
@@ -2080,7 +2089,7 @@ var AddAuthorizeDotNetCard = function AddAuthorizeDotNetCard(_ref) {
2080
2089
  valueKey: "id",
2081
2090
  labelKey: "code",
2082
2091
  onChangeField: onUpdateCountry,
2083
- fontColor: fontColor
2092
+ fontColor: styles === null || styles === void 0 ? void 0 : styles.fontColor
2084
2093
  })), /*#__PURE__*/React__default.createElement(Grid, {
2085
2094
  item: true,
2086
2095
  xs: 12,
@@ -2093,7 +2102,7 @@ var AddAuthorizeDotNetCard = function AddAuthorizeDotNetCard(_ref) {
2093
2102
  options: states,
2094
2103
  valueKey: "id",
2095
2104
  labelKey: "name",
2096
- fontColor: fontColor
2105
+ fontColor: styles === null || styles === void 0 ? void 0 : styles.fontColor
2097
2106
  })), /*#__PURE__*/React__default.createElement(Grid, {
2098
2107
  item: true,
2099
2108
  xs: 12,
@@ -2103,7 +2112,7 @@ var AddAuthorizeDotNetCard = function AddAuthorizeDotNetCard(_ref) {
2103
2112
  name: "city",
2104
2113
  required: true,
2105
2114
  control: control,
2106
- fontColor: fontColor
2115
+ fontColor: styles === null || styles === void 0 ? void 0 : styles.fontColor
2107
2116
  })), /*#__PURE__*/React__default.createElement(Grid, {
2108
2117
  item: true,
2109
2118
  xs: 12,
@@ -2113,7 +2122,7 @@ var AddAuthorizeDotNetCard = function AddAuthorizeDotNetCard(_ref) {
2113
2122
  name: "zipcode",
2114
2123
  required: true,
2115
2124
  control: control,
2116
- fontColor: fontColor
2125
+ fontColor: styles === null || styles === void 0 ? void 0 : styles.fontColor
2117
2126
  }))))));
2118
2127
  };
2119
2128
 
@@ -2124,7 +2133,6 @@ var PaymentModal = function PaymentModal(_ref) {
2124
2133
  visible = _ref.visible,
2125
2134
  onCancel = _ref.onCancel,
2126
2135
  styles = _ref.styles,
2127
- fontColor = _ref.fontColor,
2128
2136
  orderId = _ref.orderId,
2129
2137
  storeIdList = _ref.storeIdList;
2130
2138
  var _useState = useState(),
@@ -2285,7 +2293,8 @@ var PaymentModal = function PaymentModal(_ref) {
2285
2293
  }
2286
2294
  },
2287
2295
  customerId: orderDto === null || orderDto === void 0 ? void 0 : orderDto.customerId,
2288
- setListUpdate: setListUpdate
2296
+ setListUpdate: setListUpdate,
2297
+ styles: styles
2289
2298
  }), visible && /*#__PURE__*/React__default.createElement(MuiModal, {
2290
2299
  onClose: onCancel,
2291
2300
  "aria-labelledby": "customized-dialog-title",
@@ -2337,7 +2346,7 @@ var PaymentModal = function PaymentModal(_ref) {
2337
2346
  type: "number",
2338
2347
  required: true,
2339
2348
  control: control,
2340
- fontColor: fontColor,
2349
+ fontColor: styles === null || styles === void 0 ? void 0 : styles.fontColor,
2341
2350
  max: orderDto === null || orderDto === void 0 ? void 0 : orderDto.dueAmount
2342
2351
  })), /*#__PURE__*/React__default.createElement(Grid, {
2343
2352
  item: true,
@@ -2349,7 +2358,7 @@ var PaymentModal = function PaymentModal(_ref) {
2349
2358
  required: true,
2350
2359
  disabled: true,
2351
2360
  control: control,
2352
- fontColor: fontColor
2361
+ fontColor: styles === null || styles === void 0 ? void 0 : styles.fontColor
2353
2362
  })), /*#__PURE__*/React__default.createElement(Grid, {
2354
2363
  item: true,
2355
2364
  xs: 12,
@@ -2359,7 +2368,7 @@ var PaymentModal = function PaymentModal(_ref) {
2359
2368
  name: "paymentModeId",
2360
2369
  required: true,
2361
2370
  control: control,
2362
- fontColor: fontColor,
2371
+ fontColor: styles === null || styles === void 0 ? void 0 : styles.fontColor,
2363
2372
  valueKey: "id",
2364
2373
  labelKey: "name",
2365
2374
  options: (_filter = filter(paymentMethods || [], {
@@ -2385,7 +2394,7 @@ var PaymentModal = function PaymentModal(_ref) {
2385
2394
  name: "authorizeDotNetCard",
2386
2395
  required: true,
2387
2396
  control: control,
2388
- fontColor: fontColor,
2397
+ fontColor: styles === null || styles === void 0 ? void 0 : styles.fontColor,
2389
2398
  options: customerCreditCards === null || customerCreditCards === void 0 ? void 0 : (_customerCreditCards$4 = customerCreditCards.profile) === null || _customerCreditCards$4 === void 0 ? void 0 : (_customerCreditCards$5 = _customerCreditCards$4.paymentProfiles) === null || _customerCreditCards$5 === void 0 ? void 0 : _customerCreditCards$5.map(function (profile) {
2390
2399
  var _profile$payment, _profile$payment$cred, _profile$payment2, _profile$payment2$cre, _profile$payment2$cre2, _profile$payment2$cre3;
2391
2400
  return {
@@ -2394,12 +2403,17 @@ var PaymentModal = function PaymentModal(_ref) {
2394
2403
  };
2395
2404
  })
2396
2405
  })), /*#__PURE__*/React__default.createElement(MuiButton, {
2397
- variant: "outlined",
2398
2406
  onClick: function onClick() {
2399
2407
  setOpenAddNewCardModal(true);
2400
2408
  setValue('authorizeDotNetCard', null);
2401
- }
2402
- }, "Add New Card")))))));
2409
+ },
2410
+ primaryColor: styles === null || styles === void 0 ? void 0 : styles.primaryColor,
2411
+ startIcon: /*#__PURE__*/React__default.createElement(AiOutlinePlus, {
2412
+ style: {
2413
+ fontSize: 'inherit'
2414
+ }
2415
+ })
2416
+ }, /*#__PURE__*/React__default.createElement("span", null, "Add New Card"))))))));
2403
2417
  };
2404
2418
 
2405
2419
  var _templateObject$c, _templateObject2$6, _templateObject3$3, _templateObject4$1, _templateObject5$1, _templateObject6$1, _templateObject7$1, _templateObject8$1, _templateObject9$1, _templateObject10$1, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18;
@@ -2422,6 +2436,7 @@ var Dashboard = function Dashboard(_ref) {
2422
2436
  serviceApiEndPoint = _ref.serviceApiEndPoint,
2423
2437
  token = _ref.token,
2424
2438
  queryParams = _ref.queryParams,
2439
+ styles = _ref.styles,
2425
2440
  primaryColor = _ref.primaryColor,
2426
2441
  secondaryColor = _ref.secondaryColor,
2427
2442
  backgroundColor = _ref.backgroundColor,
@@ -2659,7 +2674,8 @@ var Dashboard = function Dashboard(_ref) {
2659
2674
  return Promise.reject(e);
2660
2675
  }
2661
2676
  },
2662
- orderId: isPaymentModal === null || isPaymentModal === void 0 ? void 0 : isPaymentModal.orderId
2677
+ orderId: isPaymentModal === null || isPaymentModal === void 0 ? void 0 : isPaymentModal.orderId,
2678
+ styles: styles
2663
2679
  }), /*#__PURE__*/React__default.createElement(Grid, {
2664
2680
  container: true,
2665
2681
  columnSpacing: 4
@@ -4464,6 +4480,7 @@ var AccountDetails = function AccountDetails(_ref) {
4464
4480
  serviceApiEndPoint: serviceApiEndPoint,
4465
4481
  token: token,
4466
4482
  queryParams: queryParams,
4483
+ styles: colors,
4467
4484
  primaryColor: colors.primaryColor,
4468
4485
  secondaryColor: colors.secondaryColor,
4469
4486
  backgroundColor: colors.backgroundColor,