@salesgenterp/ui-components 0.4.187 → 0.4.188

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/dist/index.css CHANGED
@@ -68,6 +68,7 @@ input[type='number'] {
68
68
  /* background: #fff0ec; //orlando */
69
69
  background: rgba(240, 249, 240, 1);
70
70
  border-radius: 10px;
71
+ border: 1px solid gray;
71
72
  }
72
73
  ._1vD5N ._yC7t2 {
73
74
  /* background: #fff0ec; //orlando */
package/dist/index.js CHANGED
@@ -2885,10 +2885,17 @@ var CreditCardForm = function CreditCardForm(_ref) {
2885
2885
  handleSave = _ref.handleSave,
2886
2886
  showError = _ref.showError,
2887
2887
  data = _ref.data;
2888
- var name = data.name,
2889
- number = data.number,
2890
- cvc = data.cvc,
2891
- expiry = data.expiry;
2888
+ var firstName = data.firstName,
2889
+ lastName = data.lastName,
2890
+ cardNumber = data.cardNumber,
2891
+ cvv = data.cvv,
2892
+ expirationMonth = data.expirationMonth,
2893
+ expirationYear = data.expirationYear,
2894
+ address = data.address,
2895
+ countryId = data.countryId,
2896
+ stateId = data.stateId,
2897
+ city = data.city,
2898
+ zipcode = data.zipcode;
2892
2899
  return /*#__PURE__*/React__default.createElement(material.Grid, {
2893
2900
  container: true,
2894
2901
  rowSpacing: 2,
@@ -2905,37 +2912,57 @@ var CreditCardForm = function CreditCardForm(_ref) {
2905
2912
  }, /*#__PURE__*/React__default.createElement(material.Grid, {
2906
2913
  item: true,
2907
2914
  xs: 12,
2908
- md: 10
2915
+ md: 6
2909
2916
  }, /*#__PURE__*/React__default.createElement(material.TextField, {
2910
2917
  required: true,
2911
2918
  fullWidth: true,
2912
2919
  onChange: handleChange,
2913
2920
  onFocus: handleFocus,
2914
- name: "name",
2921
+ name: "firstName",
2915
2922
  type: "text",
2916
- value: name,
2917
- placeholder: "Card Holder's Name*"
2918
- }), showError && name.length < 3 ? /*#__PURE__*/React__default.createElement("p", {
2923
+ value: firstName,
2924
+ placeholder: "Card Holder's First Name*"
2925
+ }), showError && (firstName === null || firstName === void 0 ? void 0 : firstName.length) < 3 ? /*#__PURE__*/React__default.createElement("p", {
2919
2926
  style: {
2920
2927
  color: 'red',
2921
2928
  marginLeft: '.5em',
2922
2929
  paddingTop: '.4em',
2923
2930
  fontSize: '.95em'
2924
2931
  }
2925
- }, "Please enter a valid Card Holder's Name") : ''), /*#__PURE__*/React__default.createElement(material.Grid, {
2932
+ }, "Please enter a valid Card Holder's First Name") : ''), /*#__PURE__*/React__default.createElement(material.Grid, {
2926
2933
  item: true,
2927
2934
  xs: 12,
2928
- md: 10
2935
+ md: 6
2936
+ }, /*#__PURE__*/React__default.createElement(material.TextField, {
2937
+ required: true,
2938
+ fullWidth: true,
2939
+ onChange: handleChange,
2940
+ onFocus: handleFocus,
2941
+ name: "lastName",
2942
+ type: "text",
2943
+ value: lastName,
2944
+ placeholder: "Card Holder's Last Name*"
2945
+ }), showError && (lastName === null || lastName === void 0 ? void 0 : lastName.length) < 3 ? /*#__PURE__*/React__default.createElement("p", {
2946
+ style: {
2947
+ color: 'red',
2948
+ marginLeft: '.5em',
2949
+ paddingTop: '.4em',
2950
+ fontSize: '.95em'
2951
+ }
2952
+ }, "Please enter a valid Card Holder's Last Name") : ''), /*#__PURE__*/React__default.createElement(material.Grid, {
2953
+ item: true,
2954
+ xs: 12,
2955
+ md: 12
2929
2956
  }, /*#__PURE__*/React__default.createElement(material.TextField, {
2930
2957
  required: true,
2931
2958
  fullWidth: true,
2932
2959
  onChange: handleChange,
2933
2960
  onFocus: handleFocus,
2934
- name: "number",
2961
+ name: "cardNumber",
2935
2962
  type: "number",
2936
- value: number,
2963
+ value: cardNumber,
2937
2964
  placeholder: "Card Nubmers xxxx-xxxx-xxxx-xxxx"
2938
- }), showError && number.length < 14 || showError && number.length > 16 ? /*#__PURE__*/React__default.createElement("p", {
2965
+ }), showError && (cardNumber === null || cardNumber === void 0 ? void 0 : cardNumber.length) < 14 || showError && (cardNumber === null || cardNumber === void 0 ? void 0 : cardNumber.length) > 16 ? /*#__PURE__*/React__default.createElement("p", {
2939
2966
  style: {
2940
2967
  color: 'red',
2941
2968
  marginLeft: '.5em',
@@ -2945,37 +2972,137 @@ var CreditCardForm = function CreditCardForm(_ref) {
2945
2972
  }, "Please enter a valid card Number") : ''), /*#__PURE__*/React__default.createElement(material.Grid, {
2946
2973
  item: true,
2947
2974
  xs: 12,
2948
- sm: 5
2975
+ sm: 4
2949
2976
  }, /*#__PURE__*/React__default.createElement(material.TextField, {
2950
2977
  required: true,
2951
2978
  fullWidth: true,
2952
2979
  onChange: handleChange,
2953
2980
  onFocus: handleFocus,
2954
- name: "expiry",
2981
+ name: "expirationMonth",
2955
2982
  type: "number",
2956
- value: expiry,
2957
- placeholder: "Expiration Date MM/YYYY "
2958
- }), showError && expiry.length < 4 || showError && expiry.length > 6 ? /*#__PURE__*/React__default.createElement("p", {
2983
+ value: expirationMonth,
2984
+ placeholder: "Expiration Month MM "
2985
+ }), showError && (expirationMonth === null || expirationMonth === void 0 ? void 0 : expirationMonth.length) !== 2 ? /*#__PURE__*/React__default.createElement("p", {
2959
2986
  style: {
2960
2987
  color: 'red',
2961
2988
  marginLeft: '.5em',
2962
2989
  paddingTop: '.4em',
2963
2990
  fontSize: '.95em'
2964
2991
  }
2965
- }, "Please enter a valid date.") : ''), /*#__PURE__*/React__default.createElement(material.Grid, {
2992
+ }, "Please enter a valid Month.") : ''), ' ', /*#__PURE__*/React__default.createElement(material.Grid, {
2966
2993
  item: true,
2967
2994
  xs: 12,
2968
- sm: 3.5
2995
+ sm: 4
2969
2996
  }, /*#__PURE__*/React__default.createElement(material.TextField, {
2970
2997
  required: true,
2971
2998
  fullWidth: true,
2972
2999
  onChange: handleChange,
2973
3000
  onFocus: handleFocus,
2974
- name: "cvc",
3001
+ name: "expirationYear",
3002
+ type: "number",
3003
+ value: expirationYear,
3004
+ placeholder: "Expiration Year YY "
3005
+ }), showError && (expirationYear === null || expirationYear === void 0 ? void 0 : expirationYear.length) !== 2 ? /*#__PURE__*/React__default.createElement("p", {
3006
+ style: {
3007
+ color: 'red',
3008
+ marginLeft: '.5em',
3009
+ paddingTop: '.4em',
3010
+ fontSize: '.95em'
3011
+ }
3012
+ }, "Please enter a valid year.") : ''), /*#__PURE__*/React__default.createElement(material.Grid, {
3013
+ item: true,
3014
+ xs: 12,
3015
+ sm: 4
3016
+ }, /*#__PURE__*/React__default.createElement(material.TextField, {
3017
+ required: true,
3018
+ fullWidth: true,
3019
+ onChange: handleChange,
3020
+ onFocus: handleFocus,
3021
+ name: "cvv",
2975
3022
  type: "number",
2976
3023
  placeholder: "CVC/CVV ***",
2977
- value: cvc
2978
- }), showError && cvc.length < 3 || showError && cvc.length > 4 ? /*#__PURE__*/React__default.createElement("p", {
3024
+ value: cvv
3025
+ }), showError && (cvv === null || cvv === void 0 ? void 0 : cvv.length) < 3 || showError && (cvv === null || cvv === void 0 ? void 0 : cvv.length) > 4 ? /*#__PURE__*/React__default.createElement("p", {
3026
+ style: {
3027
+ color: 'red',
3028
+ marginLeft: '.5em',
3029
+ paddingTop: '.4em',
3030
+ fontSize: '.95em'
3031
+ }
3032
+ }, "Please enter a valid cvv.") : ''), /*#__PURE__*/React__default.createElement(material.Grid, {
3033
+ item: true,
3034
+ xs: 12,
3035
+ md: 12
3036
+ }, /*#__PURE__*/React__default.createElement(material.TextField, {
3037
+ required: true,
3038
+ fullWidth: true,
3039
+ onChange: handleChange,
3040
+ onFocus: handleFocus,
3041
+ name: "address",
3042
+ type: "text",
3043
+ value: address,
3044
+ placeholder: "Address"
3045
+ }), showError && (address === null || address === void 0 ? void 0 : address.length) < 1 ? /*#__PURE__*/React__default.createElement("p", {
3046
+ style: {
3047
+ color: 'red',
3048
+ marginLeft: '.5em',
3049
+ paddingTop: '.4em',
3050
+ fontSize: '.95em'
3051
+ }
3052
+ }, "Please enter a valid Address") : ''), /*#__PURE__*/React__default.createElement(material.Grid, {
3053
+ item: true,
3054
+ xs: 12,
3055
+ sm: 3
3056
+ }, /*#__PURE__*/React__default.createElement(material.TextField, {
3057
+ required: true,
3058
+ fullWidth: true,
3059
+ onChange: handleChange,
3060
+ onFocus: handleFocus,
3061
+ name: "countryId",
3062
+ type: "number",
3063
+ value: countryId,
3064
+ placeholder: "Country"
3065
+ }), showError && !countryId ? /*#__PURE__*/React__default.createElement("p", {
3066
+ style: {
3067
+ color: 'red',
3068
+ marginLeft: '.5em',
3069
+ paddingTop: '.4em',
3070
+ fontSize: '.95em'
3071
+ }
3072
+ }, "Please enter a country.") : ''), ' ', /*#__PURE__*/React__default.createElement(material.Grid, {
3073
+ item: true,
3074
+ xs: 12,
3075
+ sm: 3
3076
+ }, /*#__PURE__*/React__default.createElement(material.TextField, {
3077
+ required: true,
3078
+ fullWidth: true,
3079
+ onChange: handleChange,
3080
+ onFocus: handleFocus,
3081
+ name: "stateId",
3082
+ type: "number",
3083
+ value: stateId,
3084
+ placeholder: "State"
3085
+ }), showError && !stateId ? /*#__PURE__*/React__default.createElement("p", {
3086
+ style: {
3087
+ color: 'red',
3088
+ marginLeft: '.5em',
3089
+ paddingTop: '.4em',
3090
+ fontSize: '.95em'
3091
+ }
3092
+ }, "Please enter a State.") : ''), /*#__PURE__*/React__default.createElement(material.Grid, {
3093
+ item: true,
3094
+ xs: 12,
3095
+ sm: 3
3096
+ }, /*#__PURE__*/React__default.createElement(material.TextField, {
3097
+ required: true,
3098
+ fullWidth: true,
3099
+ onChange: handleChange,
3100
+ onFocus: handleFocus,
3101
+ name: "city",
3102
+ type: "text",
3103
+ placeholder: "CIty",
3104
+ value: city
3105
+ }), showError && (city === null || city === void 0 ? void 0 : city.length) < 1 ? /*#__PURE__*/React__default.createElement("p", {
2979
3106
  style: {
2980
3107
  color: 'red',
2981
3108
  marginLeft: '.5em',
@@ -2983,6 +3110,26 @@ var CreditCardForm = function CreditCardForm(_ref) {
2983
3110
  fontSize: '.95em'
2984
3111
  }
2985
3112
  }, "Please enter a valid cvv.") : ''), /*#__PURE__*/React__default.createElement(material.Grid, {
3113
+ item: true,
3114
+ xs: 12,
3115
+ sm: 3
3116
+ }, /*#__PURE__*/React__default.createElement(material.TextField, {
3117
+ required: true,
3118
+ fullWidth: true,
3119
+ onChange: handleChange,
3120
+ onFocus: handleFocus,
3121
+ name: "zipcode",
3122
+ type: "number",
3123
+ placeholder: "Zip code",
3124
+ value: zipcode
3125
+ }), showError && (zipcode === null || zipcode === void 0 ? void 0 : zipcode.length) < 1 ? /*#__PURE__*/React__default.createElement("p", {
3126
+ style: {
3127
+ color: 'red',
3128
+ marginLeft: '.5em',
3129
+ paddingTop: '.4em',
3130
+ fontSize: '.95em'
3131
+ }
3132
+ }, "Please enter a Zip code.") : ''), /*#__PURE__*/React__default.createElement(material.Grid, {
2986
3133
  item: true,
2987
3134
  xs: 12
2988
3135
  }, /*#__PURE__*/React__default.createElement(SaveButton, {
@@ -3009,11 +3156,17 @@ var PaymentForm = /*#__PURE__*/function (_React$Component) {
3009
3156
  }
3010
3157
  _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
3011
3158
  _this.state = {
3012
- cvc: '',
3013
- expiry: '',
3014
- focus: '',
3015
- name: '',
3016
- number: '',
3159
+ firstName: '',
3160
+ lastName: '',
3161
+ cardNumber: '',
3162
+ cvv: '',
3163
+ expirationMonth: '',
3164
+ expirationYear: '',
3165
+ address: '',
3166
+ countryId: '',
3167
+ stateId: '',
3168
+ city: '',
3169
+ zipcode: '',
3017
3170
  showError: false
3018
3171
  };
3019
3172
  _this.handleInputFocus = function (e) {
@@ -3026,27 +3179,9 @@ var PaymentForm = /*#__PURE__*/function (_React$Component) {
3026
3179
  var _e$target = e.target,
3027
3180
  name = _e$target.name,
3028
3181
  value = _e$target.value;
3029
- console.log(name);
3030
3182
  _this.setState((_this$setState = {}, _this$setState[name] = value, _this$setState));
3031
3183
  };
3032
3184
  _this.handleSave = function (e) {
3033
- var _this$state = _this.state,
3034
- name = _this$state.name,
3035
- number = _this$state.number,
3036
- cvc = _this$state.cvc,
3037
- expiry = _this$state.expiry;
3038
- if (name.length < 3) return _this.setState({
3039
- showError: true
3040
- });
3041
- if (number.length < 14 || number.length > 16) return _this.setState({
3042
- showError: true
3043
- });
3044
- if (cvc.length < 3 || cvc.length > 4) return _this.setState({
3045
- showError: true
3046
- });
3047
- if (expiry.length < 4 || expiry.length > 6) return _this.setState({
3048
- showError: true
3049
- });
3050
3185
  _this.props.handleSave(_this.state);
3051
3186
  };
3052
3187
  return _this;
@@ -3058,10 +3193,10 @@ var PaymentForm = /*#__PURE__*/function (_React$Component) {
3058
3193
  id: "PaymentForm"
3059
3194
  }, /*#__PURE__*/React__default.createElement(Cards, {
3060
3195
  cvc: this.state.cvc,
3061
- expiry: this.state.expiry,
3196
+ expiry: "" + this.state.expirationMonth + this.state.expirationYear,
3062
3197
  focused: this.state.focus,
3063
- name: this.state.name,
3064
- number: this.state.number
3198
+ name: this.state.firstName + " " + this.state.lastName,
3199
+ number: this.state.cardNumber
3065
3200
  }), /*#__PURE__*/React__default.createElement(CreditCardForm, {
3066
3201
  handleChange: this.handleInputChange,
3067
3202
  handleFocus: this.handleInputFocus,
@@ -7217,7 +7352,7 @@ var AccountDetails = function AccountDetails(_ref) {
7217
7352
  var _ref$apiEndPoint = _ref.apiEndPoint,
7218
7353
  apiEndPoint = _ref$apiEndPoint === void 0 ? 'https://dev.salesgent.xyz/api' : _ref$apiEndPoint,
7219
7354
  _ref$token = _ref.token,
7220
- token = _ref$token === void 0 ? 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJjYXJib25zbW9rZXZhcGVAZ21haWwuY29tIiwidGllciI6MSwidXNlclR5cGUiOiJDdXN0b21lciIsInRva2VuVHlwZSI6ImFjY2VzcyIsInN0b3JlSWQiOjIsImV4cCI6MTY2OTc2MzcwMCwidXNlcklkIjoyNDA3LCJpYXQiOjE2Njk2NDM3MDAsInJlc2V0UGsFzc3dvcmRSZXF1aXJlZCI6ZmFsc2V9.s7-e8ERYHM6TYWODLkeB8tDsInwpMRvvkvpfPiXCqKo' : _ref$token,
7355
+ token = _ref$token === void 0 ? 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJzYWxlc2dlbnRlcnBAZ21haWwuY29tIiwidGllciI6MiwidXNlclR5cGUiOiJDdXN0b21lciIsInRva2VuVHlwZSI6ImFjY2VzcyIsInN0b3JlSWQiOjIsImV4cCI6MTY3MDI2ODk4OSwidXNlcklkIjoyNDU1LCJpYXQiOjE2NzAyMzI5ODksInJlc2V0UGFzc3dvcmRSZXF1aXJlZCI6ZmFsc2V9.-SdkA9CatCY-g4ln5ZU9hKsYvBfoTPspZV_hSQHo8wI' : _ref$token,
7221
7356
  _ref$primaryColor = _ref.primaryColor,
7222
7357
  primaryColor = _ref$primaryColor === void 0 ? '#D2122E' : _ref$primaryColor,
7223
7358
  secondaryColor = _ref.secondaryColor,