@salesgenterp/ui-components 0.4.51 → 0.4.52
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.js +58 -22
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +63 -27
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2357,6 +2357,7 @@ var StoreForm = function StoreForm(_ref) {
|
|
|
2357
2357
|
var AddressForm = function AddressForm(_ref) {
|
|
2358
2358
|
var control = _ref.control,
|
|
2359
2359
|
countries = _ref.countries,
|
|
2360
|
+
states = _ref.states,
|
|
2360
2361
|
_onSubmit = _ref.onSubmit,
|
|
2361
2362
|
handleSubmit = _ref.handleSubmit;
|
|
2362
2363
|
return /*#__PURE__*/React__default.createElement(material.Grid, {
|
|
@@ -2378,8 +2379,18 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
2378
2379
|
sm: 10
|
|
2379
2380
|
}, /*#__PURE__*/React__default.createElement(CheckoutInput, {
|
|
2380
2381
|
controlls: {
|
|
2381
|
-
name: '
|
|
2382
|
-
placeholder: '
|
|
2382
|
+
name: 'address1',
|
|
2383
|
+
placeholder: 'Address 1*',
|
|
2384
|
+
control: control
|
|
2385
|
+
}
|
|
2386
|
+
})), /*#__PURE__*/React__default.createElement(material.Grid, {
|
|
2387
|
+
item: true,
|
|
2388
|
+
xs: 6,
|
|
2389
|
+
sm: 3.34
|
|
2390
|
+
}, /*#__PURE__*/React__default.createElement(CheckoutInput, {
|
|
2391
|
+
controlls: {
|
|
2392
|
+
name: 'address2',
|
|
2393
|
+
placeholder: 'Address 2*',
|
|
2383
2394
|
control: control
|
|
2384
2395
|
}
|
|
2385
2396
|
})), /*#__PURE__*/React__default.createElement(material.Grid, {
|
|
@@ -2397,12 +2408,14 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
2397
2408
|
})), /*#__PURE__*/React__default.createElement(material.Grid, {
|
|
2398
2409
|
item: true,
|
|
2399
2410
|
xs: 6,
|
|
2400
|
-
sm: 3.
|
|
2401
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
2411
|
+
sm: 3.34
|
|
2412
|
+
}, /*#__PURE__*/React__default.createElement(CheckoutSelect, {
|
|
2402
2413
|
controlls: {
|
|
2403
2414
|
name: 'state',
|
|
2404
|
-
placeholder: 'State
|
|
2405
|
-
control: control
|
|
2415
|
+
placeholder: 'State',
|
|
2416
|
+
control: control,
|
|
2417
|
+
List: states,
|
|
2418
|
+
key: 'name'
|
|
2406
2419
|
}
|
|
2407
2420
|
})), /*#__PURE__*/React__default.createElement(material.Grid, {
|
|
2408
2421
|
item: true,
|
|
@@ -2422,7 +2435,8 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
2422
2435
|
controlls: {
|
|
2423
2436
|
name: 'zip',
|
|
2424
2437
|
placeholder: 'Zip/Postal Code*',
|
|
2425
|
-
control: control
|
|
2438
|
+
control: control,
|
|
2439
|
+
type: 'number'
|
|
2426
2440
|
}
|
|
2427
2441
|
})), /*#__PURE__*/React__default.createElement(material.Grid, {
|
|
2428
2442
|
item: true,
|
|
@@ -2455,7 +2469,9 @@ var Step1 = function Step1(_ref) {
|
|
|
2455
2469
|
stores = _ref.stores,
|
|
2456
2470
|
selectedStore = _ref.selectedStore,
|
|
2457
2471
|
setSelectedStore = _ref.setSelectedStore,
|
|
2458
|
-
countries = _ref.countries
|
|
2472
|
+
countries = _ref.countries,
|
|
2473
|
+
setSelectedCountry = _ref.setSelectedCountry,
|
|
2474
|
+
states = _ref.states;
|
|
2459
2475
|
|
|
2460
2476
|
var _useForm = reactHookForm.useForm(),
|
|
2461
2477
|
control = _useForm.control,
|
|
@@ -2467,12 +2483,14 @@ var Step1 = function Step1(_ref) {
|
|
|
2467
2483
|
|
|
2468
2484
|
var _useForm2 = reactHookForm.useForm(),
|
|
2469
2485
|
addressControl = _useForm2.control,
|
|
2486
|
+
watch = _useForm2.watch,
|
|
2470
2487
|
handleSubmitAddress = _useForm2.handleSubmit;
|
|
2471
2488
|
|
|
2472
2489
|
var StoresList = [].concat(stores, [{
|
|
2473
|
-
storeName: '
|
|
2490
|
+
storeName: 'Add Store',
|
|
2474
2491
|
id: 99999999
|
|
2475
2492
|
}]);
|
|
2493
|
+
var selectedCountry = watch('country');
|
|
2476
2494
|
var selectedStores = stores === null || stores === void 0 ? void 0 : stores.find(function (store) {
|
|
2477
2495
|
return (store === null || store === void 0 ? void 0 : store.id) === selectedStore;
|
|
2478
2496
|
});
|
|
@@ -2480,7 +2498,7 @@ var Step1 = function Step1(_ref) {
|
|
|
2480
2498
|
|
|
2481
2499
|
if (selectedStores !== null && selectedStores !== void 0 && selectedStores.customerStoreAddressList) {
|
|
2482
2500
|
addressList = [].concat(selectedStores === null || selectedStores === void 0 ? void 0 : selectedStores.customerStoreAddressList, [{
|
|
2483
|
-
name: '
|
|
2501
|
+
name: 'Add billing Address',
|
|
2484
2502
|
id: 99999999
|
|
2485
2503
|
}]);
|
|
2486
2504
|
}
|
|
@@ -2509,6 +2527,9 @@ var Step1 = function Step1(_ref) {
|
|
|
2509
2527
|
handleNext();
|
|
2510
2528
|
};
|
|
2511
2529
|
|
|
2530
|
+
React.useEffect(function () {
|
|
2531
|
+
setSelectedCountry(selectedCountry);
|
|
2532
|
+
}, [selectedCountry]);
|
|
2512
2533
|
return /*#__PURE__*/React__default.createElement(StepContainer, null, /*#__PURE__*/React__default.createElement(StepsHeaderComponent, {
|
|
2513
2534
|
text: 'billing information',
|
|
2514
2535
|
icon: 2
|
|
@@ -2557,7 +2578,8 @@ var Step1 = function Step1(_ref) {
|
|
|
2557
2578
|
control: addressControl,
|
|
2558
2579
|
handleSubmit: handleSubmitAddress,
|
|
2559
2580
|
onSubmit: addAddress,
|
|
2560
|
-
countries: countries
|
|
2581
|
+
countries: countries,
|
|
2582
|
+
states: states
|
|
2561
2583
|
}), /*#__PURE__*/React__default.createElement(material.Grid, {
|
|
2562
2584
|
item: true,
|
|
2563
2585
|
xs: 12
|
|
@@ -2595,7 +2617,9 @@ var Step2 = function Step2(_ref) {
|
|
|
2595
2617
|
options = _ref.options,
|
|
2596
2618
|
setShipping = _ref.setShipping,
|
|
2597
2619
|
countries = _ref.countries,
|
|
2620
|
+
states = _ref.states,
|
|
2598
2621
|
addShipping = _ref.addShipping,
|
|
2622
|
+
setSelectedCountry = _ref.setSelectedCountry,
|
|
2599
2623
|
showShipping = _ref.showShipping,
|
|
2600
2624
|
selectedStore = _ref.selectedStore,
|
|
2601
2625
|
stores = _ref.stores;
|
|
@@ -2603,12 +2627,14 @@ var Step2 = function Step2(_ref) {
|
|
|
2603
2627
|
var _useForm = reactHookForm.useForm(),
|
|
2604
2628
|
control = _useForm.control,
|
|
2605
2629
|
handleSubmit = _useForm.handleSubmit,
|
|
2606
|
-
resetField = _useForm.resetField
|
|
2630
|
+
resetField = _useForm.resetField,
|
|
2631
|
+
watch = _useForm.watch;
|
|
2607
2632
|
|
|
2608
2633
|
var _React$useState = React__default.useState(options[0]),
|
|
2609
2634
|
method = _React$useState[0],
|
|
2610
2635
|
setmethod = _React$useState[1];
|
|
2611
2636
|
|
|
2637
|
+
var selectedCountry = watch('country');
|
|
2612
2638
|
var selectedStores = stores === null || stores === void 0 ? void 0 : stores.find(function (store) {
|
|
2613
2639
|
return (store === null || store === void 0 ? void 0 : store.id) === selectedStore;
|
|
2614
2640
|
});
|
|
@@ -2616,7 +2642,7 @@ var Step2 = function Step2(_ref) {
|
|
|
2616
2642
|
|
|
2617
2643
|
if (selectedStores !== null && selectedStores !== void 0 && selectedStores.customerStoreAddressList) {
|
|
2618
2644
|
addressList = [].concat(selectedStores === null || selectedStores === void 0 ? void 0 : selectedStores.customerStoreAddressList, [{
|
|
2619
|
-
name: '
|
|
2645
|
+
name: 'Add billing Address',
|
|
2620
2646
|
id: 99999999
|
|
2621
2647
|
}]);
|
|
2622
2648
|
}
|
|
@@ -2631,6 +2657,9 @@ var Step2 = function Step2(_ref) {
|
|
|
2631
2657
|
resetField('shippingAddress');
|
|
2632
2658
|
};
|
|
2633
2659
|
|
|
2660
|
+
useEffect(function () {
|
|
2661
|
+
setSelectedCountry(selectedCountry);
|
|
2662
|
+
}, [selectedCountry]);
|
|
2634
2663
|
return /*#__PURE__*/React__default.createElement(StepContainer, null, /*#__PURE__*/React__default.createElement(StepsHeaderComponent, {
|
|
2635
2664
|
text: showShipping ? 'shipping information' : 'shipping method',
|
|
2636
2665
|
icon: 3
|
|
@@ -2657,7 +2686,8 @@ var Step2 = function Step2(_ref) {
|
|
|
2657
2686
|
control: control,
|
|
2658
2687
|
onSubmit: onSubmit,
|
|
2659
2688
|
handleSubmit: handleSubmit,
|
|
2660
|
-
countries: countries
|
|
2689
|
+
countries: countries,
|
|
2690
|
+
states: states
|
|
2661
2691
|
}), /*#__PURE__*/React__default.createElement(StepsHeaderComponent, {
|
|
2662
2692
|
text: 'shipping method',
|
|
2663
2693
|
icon: 3,
|
|
@@ -3094,7 +3124,6 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
|
|
|
3094
3124
|
handleBack = _ref.handleBack,
|
|
3095
3125
|
loading = _ref.loading,
|
|
3096
3126
|
handleLogin = _ref.handleLogin,
|
|
3097
|
-
setShipping = _ref.setShipping,
|
|
3098
3127
|
userName = _ref.userName,
|
|
3099
3128
|
addStore = _ref.addStore,
|
|
3100
3129
|
setBilling = _ref.setBilling,
|
|
@@ -3103,20 +3132,23 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
|
|
|
3103
3132
|
selectedStore = _ref.selectedStore,
|
|
3104
3133
|
setSelectedStore = _ref.setSelectedStore,
|
|
3105
3134
|
addStoreAddress = _ref.addStoreAddress,
|
|
3135
|
+
setSelectedCountry = _ref.setSelectedCountry,
|
|
3136
|
+
countries = _ref.countries,
|
|
3137
|
+
states = _ref.states,
|
|
3138
|
+
setShipping = _ref.setShipping,
|
|
3106
3139
|
showShipping = _ref.showShipping,
|
|
3107
3140
|
deliveryOptions = _ref.deliveryOptions,
|
|
3108
|
-
countries = _ref.countries,
|
|
3109
3141
|
setPaymentDetails = _ref.setPaymentDetails,
|
|
3110
3142
|
paymentMethods = _ref.paymentMethods,
|
|
3111
3143
|
cartData = _ref.cartData,
|
|
3112
3144
|
vat = _ref.vat,
|
|
3113
|
-
shippingAddress = _ref.shippingAddress,
|
|
3114
|
-
billingAddress = _ref.billingAddress,
|
|
3115
|
-
selectedPaymentMethod = _ref.selectedPaymentMethod,
|
|
3116
3145
|
clickRedirect = _ref.clickRedirect,
|
|
3117
3146
|
ordering = _ref.ordering,
|
|
3118
3147
|
deliveryCharges = _ref.deliveryCharges,
|
|
3119
|
-
placeOrder = _ref.placeOrder
|
|
3148
|
+
placeOrder = _ref.placeOrder,
|
|
3149
|
+
shippingAddress = _ref.shippingAddress,
|
|
3150
|
+
billingAddress = _ref.billingAddress,
|
|
3151
|
+
selectedPaymentMethod = _ref.selectedPaymentMethod;
|
|
3120
3152
|
return /*#__PURE__*/React__default.createElement(CheckoutPageContainer, {
|
|
3121
3153
|
className: "checkout"
|
|
3122
3154
|
}, /*#__PURE__*/React__default.createElement(material.Stack, {
|
|
@@ -3208,7 +3240,9 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
|
|
|
3208
3240
|
selectedStore: selectedStore,
|
|
3209
3241
|
setSelectedStore: setSelectedStore,
|
|
3210
3242
|
countries: countries,
|
|
3211
|
-
|
|
3243
|
+
states: states,
|
|
3244
|
+
addStoreAddress: addStoreAddress,
|
|
3245
|
+
setSelectedCountry: setSelectedCountry
|
|
3212
3246
|
})), index === 2 && /*#__PURE__*/React__default.createElement(material.StepContent, {
|
|
3213
3247
|
sx: {
|
|
3214
3248
|
padding: 0
|
|
@@ -3218,12 +3252,14 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
|
|
|
3218
3252
|
handleBack: handleBack,
|
|
3219
3253
|
handleNext: handleNext,
|
|
3220
3254
|
options: deliveryOptions,
|
|
3255
|
+
states: states,
|
|
3221
3256
|
countries: countries,
|
|
3222
3257
|
setShipping: setShipping,
|
|
3223
3258
|
showShipping: showShipping,
|
|
3224
3259
|
selectedStore: selectedStore,
|
|
3225
3260
|
stores: userStores,
|
|
3226
|
-
addShipping: addStoreAddress
|
|
3261
|
+
addShipping: addStoreAddress,
|
|
3262
|
+
setSelectedCountry: setSelectedCountry
|
|
3227
3263
|
})), index === 3 && /*#__PURE__*/React__default.createElement(material.StepContent, {
|
|
3228
3264
|
sx: {
|
|
3229
3265
|
padding: 0
|