@salesgenterp/ui-components 0.4.37 → 0.4.38
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 +107 -81
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +107 -81
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -21,8 +21,8 @@ var cg = require('react-icons/cg');
|
|
|
21
21
|
var md = require('react-icons/md');
|
|
22
22
|
var reactHookForm = require('react-hook-form');
|
|
23
23
|
var hi = require('react-icons/hi');
|
|
24
|
-
var fi = require('react-icons/fi');
|
|
25
24
|
var io5 = require('react-icons/io5');
|
|
25
|
+
var fi = require('react-icons/fi');
|
|
26
26
|
|
|
27
27
|
function _extends() {
|
|
28
28
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -2057,7 +2057,13 @@ var ButtonRowContainer = styled.div(_templateObject7$3 || (_templateObject7$3 =
|
|
|
2057
2057
|
var CheckBoxRow = styled.div(_templateObject8$1 || (_templateObject8$1 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n cursor: pointer;\n padding: ", ";\n p {\n font-size: 0.85em;\n }\n button {\n border: none;\n padding: 0.8em 3em;\n background: rgba(253, 0, 21, 1);\n color: white;\n text-transform: uppercase;\n font-weight: 600;\n margin: 1em;\n margin-top: 2em;\n transition: 0.4s;\n cursor: pointer;\n font-family: 'karla-fonts';\n &:hover {\n padding: 0.7em 2.7em;\n }\n }\n .back {\n background-color: rgba(107, 106, 106, 1);\n padding: 0.8em 2em;\n &:hover {\n padding: 0.8em 2.4em;\n }\n }\n"])), function (props) {
|
|
2058
2058
|
return props.padding;
|
|
2059
2059
|
});
|
|
2060
|
-
var
|
|
2060
|
+
var DeliveryOption = styled.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n max-width: 705px;\n height: 40px;\n padding: 0 1em;\n border: 1px solid transparent;\n transition: 0.3s;\n background-color: ", ";\n border: ", ";\n border-radius: ", ";\n &:hover {\n background-color: #fff0ec;\n border: 1px solid #fce1d9;\n border-radius: 5px;\n }\n p {\n font-weight: 500;\n color: black;\n font-size: 0.95em;\n text-transform: capitalize;\n }\n .circle {\n border-radius: 50%;\n display: grid;\n place-items: center;\n background: linear-gradient(345.48deg, #3c332a -131.29%, #ffffff 124.82%);\n margin-right: 1em;\n width: 14px;\n cursor: pointer;\n height: 14px;\n .inner {\n width: 10px;\n height: 10px;\n border-radius: 50%;\n display: grid;\n place-items: center;\n background: linear-gradient(\n 326.37deg,\n rgba(67, 58, 42, 0.9) -219.66%,\n rgba(255, 255, 255, 0.9) 90.45%\n );\n box-shadow: inset -1px -1px 1px rgba(255, 255, 255, 0.45),\n inset 0px 0px 10px rgba(0, 0, 0, 0.2);\n }\n .fill {\n width: 6px;\n height: 6px;\n background: radial-gradient(\n 15.79% 15.79% at 36.84% 31.58%,\n #ffffff 0%,\n rgba(255, 255, 255, 0) 100%\n )\n /* warning: gradient uses a rotation that is not supported by CSS and may not behave as expected */,\n linear-gradient(\n 358.85deg,\n rgba(157, 18, 30, 0.2) -19.81%,\n rgba(12, 96, 157, 0) 64.74%\n ),\n radial-gradient(50% 50% at 50% 50%, #fab0b6 0%, #fd0015 100%), #fd0015;\n background-blend-mode: normal, multiply, normal, normal;\n box-shadow: 0px 0.5px 0px rgba(253, 0, 21, 0.25),\n 0px 1px 1px rgba(253, 0, 21, 0.2);\n border-radius: 50%;\n background: #fd0015;\n }\n }\n .amount {\n margin-left: auto;\n color: #fd0015;\n font-weight: 700;\n font-size: 0.95em;\n }\n"])), function (props) {
|
|
2061
|
+
return props.hovered ? '#fff0ec' : '';
|
|
2062
|
+
}, function (props) {
|
|
2063
|
+
return props.hovered ? '1px solid #fce1d9' : '';
|
|
2064
|
+
}, function (props) {
|
|
2065
|
+
return props.hovered ? '5px' : '0';
|
|
2066
|
+
});
|
|
2061
2067
|
var CreditCard = styled.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteralLoose(["\n width: 70px;\n min-height: 48px;\n max-height: 50px;\n background-color: white;\n border: 3px solid rgba(217, 217, 217, 0.1);\n display: grid;\n place-items: center;\n margin: auto;\n cursor: pointer;\n overflow: hidden;\n border-radius: 5px;\n transition: 0.1s;\n border: 1px solid transparent;\n text-align: center;\n p {\n font-size: 10px;\n }\n &:hover,\n &:focus {\n border: 1px solid black;\n }\n"])));
|
|
2062
2068
|
var StyledTableRow = styled(material.TableRow)(_templateObject11 || (_templateObject11 = _taggedTemplateLiteralLoose(["\n && {\n box-shadow: none;\n border: none;\n background-color: ", ";\n p {\n font-size: 0.9em;\n font-family: 'karla-fonts';\n }\n .max {\n min-width: max-content;\n }\n .red {\n color: red;\n font-weight: inherit;\n }\n .price {\n font-weight: 600;\n }\n @media only screen and (max-width: 640px) {\n p {\n font-size: 12px;\n }\n .sm {\n font-size: 8px;\n }\n .price,\n .red {\n font-size: 10px;\n }\n .total {\n font-size: 14px;\n }\n }\n }\n"])), function (props) {
|
|
2063
2069
|
return props.colored ? 'rgba(255, 240, 236, 1)' : 'white';
|
|
@@ -2138,7 +2144,8 @@ var StepsHeaderComponent = function StepsHeaderComponent(_ref) {
|
|
|
2138
2144
|
icon = _ref.icon,
|
|
2139
2145
|
single = _ref.single,
|
|
2140
2146
|
closed = _ref.closed,
|
|
2141
|
-
handleClick = _ref.handleClick
|
|
2147
|
+
handleClick = _ref.handleClick,
|
|
2148
|
+
withoutIcon = _ref.withoutIcon;
|
|
2142
2149
|
console.log("/images/checkout/vector-" + icon + ".svg");
|
|
2143
2150
|
return /*#__PURE__*/React__default.createElement(StepsHeaderContainer, {
|
|
2144
2151
|
single: single
|
|
@@ -2152,12 +2159,12 @@ var StepsHeaderComponent = function StepsHeaderComponent(_ref) {
|
|
|
2152
2159
|
}, /*#__PURE__*/React__default.createElement(material.Stack, {
|
|
2153
2160
|
flexDirection: "row",
|
|
2154
2161
|
alignItems: "center"
|
|
2155
|
-
}, /*#__PURE__*/React__default.createElement("img", {
|
|
2162
|
+
}, !withoutIcon && /*#__PURE__*/React__default.createElement("img", {
|
|
2156
2163
|
src: "/images/checkout/vector-" + icon + ".svg",
|
|
2157
2164
|
alt: "vector",
|
|
2158
2165
|
width: 18,
|
|
2159
2166
|
height: 18
|
|
2160
|
-
}), /*#__PURE__*/React__default.createElement("h5", null, text, " ", username && "" + username)), /*#__PURE__*/React__default.createElement(hi.HiOutlineChevronDown, {
|
|
2167
|
+
}), /*#__PURE__*/React__default.createElement("h5", null, text, " ", username && "" + username)), !withoutIcon && /*#__PURE__*/React__default.createElement(hi.HiOutlineChevronDown, {
|
|
2161
2168
|
className: "dropIcon",
|
|
2162
2169
|
style: closed ? {
|
|
2163
2170
|
transform: 'rotate(-90deg)'
|
|
@@ -2429,11 +2436,14 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
2429
2436
|
sm: 8
|
|
2430
2437
|
}, /*#__PURE__*/React__default.createElement(SaveButton, {
|
|
2431
2438
|
type: "submit"
|
|
2432
|
-
}, "
|
|
2439
|
+
}, "Save address")));
|
|
2433
2440
|
};
|
|
2434
2441
|
|
|
2435
2442
|
var Step1 = function Step1(_ref) {
|
|
2436
|
-
var
|
|
2443
|
+
var handleBack = _ref.handleBack,
|
|
2444
|
+
handleNext = _ref.handleNext,
|
|
2445
|
+
setBilling = _ref.setBilling,
|
|
2446
|
+
addStore = _ref.addStore,
|
|
2437
2447
|
addStoreAddress = _ref.addStoreAddress,
|
|
2438
2448
|
stores = _ref.stores,
|
|
2439
2449
|
addresses = _ref.addresses,
|
|
@@ -2474,6 +2484,15 @@ var Step1 = function Step1(_ref) {
|
|
|
2474
2484
|
resetAddress('billingAddress');
|
|
2475
2485
|
};
|
|
2476
2486
|
|
|
2487
|
+
var next = function next() {
|
|
2488
|
+
setBilling({
|
|
2489
|
+
store: selectedStore
|
|
2490
|
+
}, {
|
|
2491
|
+
billingAddress: selectedAddress
|
|
2492
|
+
});
|
|
2493
|
+
handleNext();
|
|
2494
|
+
};
|
|
2495
|
+
|
|
2477
2496
|
return /*#__PURE__*/React__default.createElement(StepContainer, null, /*#__PURE__*/React__default.createElement(StepsHeaderComponent, {
|
|
2478
2497
|
text: 'billing information',
|
|
2479
2498
|
icon: 2
|
|
@@ -2519,101 +2538,107 @@ var Step1 = function Step1(_ref) {
|
|
|
2519
2538
|
handleSubmit: handleSubmitAddress,
|
|
2520
2539
|
onSubmit: addAddress,
|
|
2521
2540
|
countries: countries
|
|
2541
|
+
}), /*#__PURE__*/React__default.createElement(ButtonRow, {
|
|
2542
|
+
handleBack: handleBack,
|
|
2543
|
+
handleNext: function handleNext() {
|
|
2544
|
+
next();
|
|
2545
|
+
},
|
|
2546
|
+
nextDisabled: !selectedStore || !selectedAddress || selectedStore === 99999999 || selectedAddress === 99999999
|
|
2522
2547
|
})));
|
|
2523
2548
|
};
|
|
2524
2549
|
|
|
2525
2550
|
var Step2 = function Step2(_ref) {
|
|
2526
|
-
var _Object$keys2;
|
|
2527
|
-
|
|
2528
2551
|
var handleBack = _ref.handleBack,
|
|
2529
2552
|
_handleNext = _ref.handleNext,
|
|
2530
2553
|
options = _ref.options,
|
|
2531
2554
|
setShipping = _ref.setShipping,
|
|
2532
2555
|
countries = _ref.countries,
|
|
2533
|
-
|
|
2556
|
+
addShipping = _ref.addShipping,
|
|
2557
|
+
showShipping = _ref.showShipping,
|
|
2558
|
+
addresses = _ref.addresses;
|
|
2534
2559
|
|
|
2535
2560
|
var _useForm = reactHookForm.useForm(),
|
|
2536
2561
|
control = _useForm.control,
|
|
2537
|
-
|
|
2538
|
-
|
|
2562
|
+
handleSubmit = _useForm.handleSubmit,
|
|
2563
|
+
resetField = _useForm.resetField,
|
|
2564
|
+
watch = _useForm.watch;
|
|
2539
2565
|
|
|
2540
2566
|
var _React$useState = React__default.useState(options[0]),
|
|
2541
2567
|
method = _React$useState[0],
|
|
2542
2568
|
setmethod = _React$useState[1];
|
|
2543
2569
|
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2570
|
+
var addressList = [].concat(addresses, [{
|
|
2571
|
+
name: 'add shipping Address',
|
|
2572
|
+
id: 99999999
|
|
2573
|
+
}]);
|
|
2574
|
+
var selectedAddress = watch('shippingAddress');
|
|
2575
|
+
|
|
2576
|
+
var onSubmit = function onSubmit(data) {
|
|
2577
|
+
console.log(data);
|
|
2578
|
+
addShipping(data);
|
|
2579
|
+
resetField('shippingAddress');
|
|
2580
|
+
};
|
|
2549
2581
|
|
|
2550
2582
|
return /*#__PURE__*/React__default.createElement(StepContainer, null, /*#__PURE__*/React__default.createElement(StepsHeaderComponent, {
|
|
2551
|
-
text: 'shipping information',
|
|
2552
|
-
|
|
2553
|
-
}), /*#__PURE__*/React__default.createElement(StepsContent, null, /*#__PURE__*/React__default.createElement(
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2583
|
+
text: showShipping ? 'shipping information' : 'shipping method',
|
|
2584
|
+
icon: 3
|
|
2585
|
+
}), /*#__PURE__*/React__default.createElement(StepsContent, null, showShipping && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(material.Grid, {
|
|
2586
|
+
container: true
|
|
2587
|
+
}, /*#__PURE__*/React__default.createElement(material.Grid, {
|
|
2588
|
+
item: true,
|
|
2589
|
+
xs: 12,
|
|
2590
|
+
sm: 10,
|
|
2591
|
+
sx: {
|
|
2592
|
+
padding: '1em 0'
|
|
2561
2593
|
}
|
|
2562
|
-
}
|
|
2594
|
+
}, /*#__PURE__*/React__default.createElement(CheckoutSelect, {
|
|
2563
2595
|
controlls: {
|
|
2564
|
-
name: '
|
|
2565
|
-
placeholder: '
|
|
2566
|
-
control: control
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
container: true,
|
|
2570
|
-
columnSpacing: 0.5,
|
|
2571
|
-
rowSpacing: 2,
|
|
2572
|
-
sx: {
|
|
2573
|
-
margin: '1em 0'
|
|
2596
|
+
name: 'shippingAddress',
|
|
2597
|
+
placeholder: 'Select shipping Address ',
|
|
2598
|
+
control: control,
|
|
2599
|
+
List: addressList,
|
|
2600
|
+
key: 'name'
|
|
2574
2601
|
}
|
|
2602
|
+
}))), selectedAddress === 99999999 && /*#__PURE__*/React__default.createElement(AddressForm, {
|
|
2603
|
+
control: control,
|
|
2604
|
+
onSubmit: onSubmit,
|
|
2605
|
+
handleSubmit: handleSubmit,
|
|
2606
|
+
countries: countries
|
|
2607
|
+
}), /*#__PURE__*/React__default.createElement(StepsHeaderComponent, {
|
|
2608
|
+
text: 'shipping method',
|
|
2609
|
+
icon: 3,
|
|
2610
|
+
withoutIcon: showShipping
|
|
2611
|
+
})), /*#__PURE__*/React__default.createElement(material.Stack, {
|
|
2612
|
+
flexDirection: "column",
|
|
2613
|
+
width: "100%",
|
|
2614
|
+
alignItems: 'flex-start',
|
|
2615
|
+
paddingBottom: '2em'
|
|
2575
2616
|
}, options === null || options === void 0 ? void 0 : options.map(function (option, i) {
|
|
2576
|
-
var _option$
|
|
2577
|
-
|
|
2578
|
-
var fedex = option === null || option === void 0 ? void 0 : (_option$name = option.name) === null || _option$name === void 0 ? void 0 : (_option$name$toLowerC = _option$name.toLowerCase()) === null || _option$name$toLowerC === void 0 ? void 0 : _option$name$toLowerC.includes('fedex');
|
|
2579
|
-
var replaced;
|
|
2580
|
-
|
|
2581
|
-
if (fedex) {
|
|
2582
|
-
var _option$name2;
|
|
2583
|
-
|
|
2584
|
-
replaced = (_option$name2 = option.name) === null || _option$name2 === void 0 ? void 0 : _option$name2.replace(/fedex/i, ' ');
|
|
2585
|
-
}
|
|
2617
|
+
var _option$amount;
|
|
2586
2618
|
|
|
2587
|
-
return /*#__PURE__*/React__default.createElement(
|
|
2588
|
-
|
|
2589
|
-
justifyContent: "space-around",
|
|
2590
|
-
aligItems: "center",
|
|
2591
|
-
flexWrap: 'wrap'
|
|
2592
|
-
}, /*#__PURE__*/React__default.createElement(DeliveryCard, {
|
|
2619
|
+
return /*#__PURE__*/React__default.createElement(DeliveryOption, {
|
|
2620
|
+
hovered: (option === null || option === void 0 ? void 0 : option.id) === (method === null || method === void 0 ? void 0 : method.id),
|
|
2593
2621
|
onClick: function onClick() {
|
|
2594
|
-
|
|
2595
|
-
}
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
alt: "fedex"
|
|
2599
|
-
}), fedex ? /*#__PURE__*/React__default.createElement("p", null, replaced) : /*#__PURE__*/React__default.createElement("p", null, /*#__PURE__*/React__default.createElement("p", null, option.name)), /*#__PURE__*/React__default.createElement("span", {
|
|
2622
|
+
setmethod(option);
|
|
2623
|
+
},
|
|
2624
|
+
key: i
|
|
2625
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2600
2626
|
className: "circle"
|
|
2627
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
2628
|
+
className: "inner"
|
|
2601
2629
|
}, (option === null || option === void 0 ? void 0 : option.id) === (method === null || method === void 0 ? void 0 : method.id) && /*#__PURE__*/React__default.createElement("span", {
|
|
2602
|
-
className: "
|
|
2603
|
-
}))))
|
|
2630
|
+
className: "fill"
|
|
2631
|
+
}))), /*#__PURE__*/React__default.createElement("p", null, option === null || option === void 0 ? void 0 : option.name), /*#__PURE__*/React__default.createElement("h6", {
|
|
2632
|
+
className: "amount"
|
|
2633
|
+
}, "$", option === null || option === void 0 ? void 0 : (_option$amount = option.amount) === null || _option$amount === void 0 ? void 0 : _option$amount.toFixed(2)));
|
|
2604
2634
|
})), /*#__PURE__*/React__default.createElement(ButtonRow, {
|
|
2605
2635
|
handleBack: handleBack,
|
|
2606
2636
|
handleNext: function handleNext() {
|
|
2607
|
-
|
|
2637
|
+
setShipping(selectedAddress, method);
|
|
2608
2638
|
|
|
2609
|
-
|
|
2610
|
-
setShipping(getValues());
|
|
2611
|
-
setShippingMethod(method);
|
|
2612
|
-
|
|
2613
|
-
_handleNext();
|
|
2614
|
-
}
|
|
2639
|
+
_handleNext();
|
|
2615
2640
|
},
|
|
2616
|
-
nextDisabled:
|
|
2641
|
+
nextDisabled: showShipping && !selectedAddress || (selectedAddress === null || selectedAddress === void 0 ? void 0 : selectedAddress.id) === 99999999
|
|
2617
2642
|
})));
|
|
2618
2643
|
};
|
|
2619
2644
|
|
|
@@ -2687,7 +2712,7 @@ var Step3 = function Step3(_ref) {
|
|
|
2687
2712
|
}, /*#__PURE__*/React__default.createElement(material.Grid, {
|
|
2688
2713
|
item: true,
|
|
2689
2714
|
xs: 12,
|
|
2690
|
-
md:
|
|
2715
|
+
md: 103
|
|
2691
2716
|
}, /*#__PURE__*/React__default.createElement(CheckoutInput, {
|
|
2692
2717
|
controlls: {
|
|
2693
2718
|
name: 'cardName',
|
|
@@ -2702,7 +2727,7 @@ var Step3 = function Step3(_ref) {
|
|
|
2702
2727
|
})), /*#__PURE__*/React__default.createElement(material.Grid, {
|
|
2703
2728
|
item: true,
|
|
2704
2729
|
xs: 12,
|
|
2705
|
-
md:
|
|
2730
|
+
md: 103
|
|
2706
2731
|
}, /*#__PURE__*/React__default.createElement(CheckoutInput, {
|
|
2707
2732
|
controlls: {
|
|
2708
2733
|
name: 'cardNumber',
|
|
@@ -3016,9 +3041,10 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
|
|
|
3016
3041
|
userName = _ref.userName,
|
|
3017
3042
|
addStore = _ref.addStore,
|
|
3018
3043
|
addStoreAddress = _ref.addStoreAddress,
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3044
|
+
setBilling = _ref.setBilling,
|
|
3045
|
+
addShipping = _ref.addShipping,
|
|
3046
|
+
showShipping = _ref.showShipping,
|
|
3047
|
+
setShowShipping = _ref.setShowShipping,
|
|
3022
3048
|
deliveryOptions = _ref.deliveryOptions,
|
|
3023
3049
|
countries = _ref.countries,
|
|
3024
3050
|
setPaymentDetails = _ref.setPaymentDetails,
|
|
@@ -3030,7 +3056,6 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
|
|
|
3030
3056
|
selectedPaymentMethod = _ref.selectedPaymentMethod,
|
|
3031
3057
|
userStores = _ref.userStores,
|
|
3032
3058
|
userAddresses = _ref.userAddresses,
|
|
3033
|
-
showShipping = _ref.showShipping,
|
|
3034
3059
|
clickRedirect = _ref.clickRedirect,
|
|
3035
3060
|
ordering = _ref.ordering,
|
|
3036
3061
|
deliveryCharges = _ref.deliveryCharges,
|
|
@@ -3112,8 +3137,8 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
|
|
|
3112
3137
|
currstep: currStep,
|
|
3113
3138
|
handleBack: handleBack,
|
|
3114
3139
|
handleNext: handleNext,
|
|
3115
|
-
setShipping:
|
|
3116
|
-
|
|
3140
|
+
setShipping: setShowShipping,
|
|
3141
|
+
setBilling: setBilling,
|
|
3117
3142
|
stores: userStores,
|
|
3118
3143
|
addresses: userAddresses,
|
|
3119
3144
|
addStore: addStore,
|
|
@@ -3129,9 +3154,10 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
|
|
|
3129
3154
|
handleNext: handleNext,
|
|
3130
3155
|
options: deliveryOptions,
|
|
3131
3156
|
countries: countries,
|
|
3132
|
-
setShipping:
|
|
3133
|
-
|
|
3134
|
-
|
|
3157
|
+
setShipping: setShipping,
|
|
3158
|
+
showShipping: showShipping,
|
|
3159
|
+
addresses: userAddresses,
|
|
3160
|
+
addShipping: addShipping
|
|
3135
3161
|
})), index === 3 && /*#__PURE__*/React__default.createElement(material.StepContent, {
|
|
3136
3162
|
sx: {
|
|
3137
3163
|
padding: 0
|