@salesgenterp/ui-components 0.1.0 → 0.1.6
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 +311 -0
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +311 -1
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -3
package/dist/index.modern.js
CHANGED
|
@@ -14,6 +14,7 @@ import FavoriteIcon from '@mui/icons-material/Favorite';
|
|
|
14
14
|
import ShareIcon from '@mui/icons-material/Share';
|
|
15
15
|
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
16
16
|
import MoreVertIcon from '@mui/icons-material/MoreVert';
|
|
17
|
+
import { Stack } from '@mui/material';
|
|
17
18
|
|
|
18
19
|
function _extends() {
|
|
19
20
|
_extends = Object.assign || function (target) {
|
|
@@ -2770,6 +2771,315 @@ var TestCard = function TestCard(props) {
|
|
|
2770
2771
|
}, "Add rice and stir very gently to distribute. Top with artichokes and peppers, and cook without stirring, until most of the liquid is absorbed, 15 to 18 minutes. Reduce heat to medium-low, add reserved shrimp and mussels, tucking them down into the rice, and cook again without stirring, until mussels have opened and rice is just tender, 5 to 7 minutes more. (Discard any mussels that don't open.)"), /*#__PURE__*/React__default.createElement(Typography, null, "Set aside off of the heat to let rest for 10 minutes, and then serve.")))));
|
|
2771
2772
|
};
|
|
2772
2773
|
|
|
2774
|
+
var DefaultContext = {
|
|
2775
|
+
color: undefined,
|
|
2776
|
+
size: undefined,
|
|
2777
|
+
className: undefined,
|
|
2778
|
+
style: undefined,
|
|
2779
|
+
attr: undefined
|
|
2780
|
+
};
|
|
2781
|
+
var IconContext = React__default.createContext && React__default.createContext(DefaultContext);
|
|
2782
|
+
|
|
2783
|
+
var __assign = undefined && undefined.__assign || function () {
|
|
2784
|
+
__assign = Object.assign || function (t) {
|
|
2785
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2786
|
+
s = arguments[i];
|
|
2787
|
+
|
|
2788
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
2789
|
+
}
|
|
2790
|
+
|
|
2791
|
+
return t;
|
|
2792
|
+
};
|
|
2793
|
+
|
|
2794
|
+
return __assign.apply(this, arguments);
|
|
2795
|
+
};
|
|
2796
|
+
|
|
2797
|
+
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
2798
|
+
var t = {};
|
|
2799
|
+
|
|
2800
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
2801
|
+
|
|
2802
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
2803
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
2804
|
+
}
|
|
2805
|
+
return t;
|
|
2806
|
+
};
|
|
2807
|
+
|
|
2808
|
+
function Tree2Element(tree) {
|
|
2809
|
+
return tree && tree.map(function (node, i) {
|
|
2810
|
+
return React__default.createElement(node.tag, __assign({
|
|
2811
|
+
key: i
|
|
2812
|
+
}, node.attr), Tree2Element(node.child));
|
|
2813
|
+
});
|
|
2814
|
+
}
|
|
2815
|
+
|
|
2816
|
+
function GenIcon(data) {
|
|
2817
|
+
return function (props) {
|
|
2818
|
+
return React__default.createElement(IconBase$1, __assign({
|
|
2819
|
+
attr: __assign({}, data.attr)
|
|
2820
|
+
}, props), Tree2Element(data.child));
|
|
2821
|
+
};
|
|
2822
|
+
}
|
|
2823
|
+
function IconBase$1(props) {
|
|
2824
|
+
var elem = function (conf) {
|
|
2825
|
+
var attr = props.attr,
|
|
2826
|
+
size = props.size,
|
|
2827
|
+
title = props.title,
|
|
2828
|
+
svgProps = __rest(props, ["attr", "size", "title"]);
|
|
2829
|
+
|
|
2830
|
+
var computedSize = size || conf.size || "1em";
|
|
2831
|
+
var className;
|
|
2832
|
+
if (conf.className) className = conf.className;
|
|
2833
|
+
if (props.className) className = (className ? className + ' ' : '') + props.className;
|
|
2834
|
+
return React__default.createElement("svg", __assign({
|
|
2835
|
+
stroke: "currentColor",
|
|
2836
|
+
fill: "currentColor",
|
|
2837
|
+
strokeWidth: "0"
|
|
2838
|
+
}, conf.attr, attr, svgProps, {
|
|
2839
|
+
className: className,
|
|
2840
|
+
style: __assign(__assign({
|
|
2841
|
+
color: props.color || conf.color
|
|
2842
|
+
}, conf.style), props.style),
|
|
2843
|
+
height: computedSize,
|
|
2844
|
+
width: computedSize,
|
|
2845
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2846
|
+
}), title && React__default.createElement("title", null, title), props.children);
|
|
2847
|
+
};
|
|
2848
|
+
|
|
2849
|
+
return IconContext !== undefined ? React__default.createElement(IconContext.Consumer, null, function (conf) {
|
|
2850
|
+
return elem(conf);
|
|
2851
|
+
}) : elem(DefaultContext);
|
|
2852
|
+
}
|
|
2853
|
+
|
|
2854
|
+
// THIS FILE IS AUTO GENERATED
|
|
2855
|
+
function GrClose (props) {
|
|
2856
|
+
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24"},"child":[{"tag":"path","attr":{"fill":"none","stroke":"#000","strokeWidth":"2","d":"M3,3 L21,21 M3,21 L21,3"}}]})(props);
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
// THIS FILE IS AUTO GENERATED
|
|
2860
|
+
function BsCartX (props) {
|
|
2861
|
+
return GenIcon({"tag":"svg","attr":{"fill":"currentColor","viewBox":"0 0 16 16"},"child":[{"tag":"path","attr":{"d":"M7.354 5.646a.5.5 0 1 0-.708.708L7.793 7.5 6.646 8.646a.5.5 0 1 0 .708.708L8.5 8.207l1.146 1.147a.5.5 0 0 0 .708-.708L9.207 7.5l1.147-1.146a.5.5 0 0 0-.708-.708L8.5 6.793 7.354 5.646z"}},{"tag":"path","attr":{"d":"M.5 1a.5.5 0 0 0 0 1h1.11l.401 1.607 1.498 7.985A.5.5 0 0 0 4 12h1a2 2 0 1 0 0 4 2 2 0 0 0 0-4h7a2 2 0 1 0 0 4 2 2 0 0 0 0-4h1a.5.5 0 0 0 .491-.408l1.5-8A.5.5 0 0 0 14.5 3H2.89l-.405-1.621A.5.5 0 0 0 2 1H.5zm3.915 10L3.102 4h10.796l-1.313 7h-8.17zM6 14a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm7 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"}}]})(props);
|
|
2862
|
+
}
|
|
2863
|
+
|
|
2864
|
+
function _templateObject7$1() {
|
|
2865
|
+
var data = _taggedTemplateLiteralLoose(["\n width: 100%;\n height: calc(100vh - 4.6rem);\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n h6 {\n font-size: 1.8rem;\n font-weight: bold;\n text-transform: uppercase;\n margin: 0;\n margin-top: 1rem;\n color: ", ";\n }\n p {\n font-size: 1.1rem;\n text-transform: capitalize;\n font-weight: 500;\n /* color: darkgrey; */\n /* color: orange; */\n }\n .icon {\n font-size: 9.5rem;\n color: darkgrey;\n /* color: orange; */\n }\n"]);
|
|
2866
|
+
|
|
2867
|
+
_templateObject7$1 = function _templateObject7() {
|
|
2868
|
+
return data;
|
|
2869
|
+
};
|
|
2870
|
+
|
|
2871
|
+
return data;
|
|
2872
|
+
}
|
|
2873
|
+
|
|
2874
|
+
function _templateObject6$1() {
|
|
2875
|
+
var data = _taggedTemplateLiteralLoose(["\n background: ", ";\n color: white;\n position: relative;\n margin-bottom: 1rem;\n .icon {\n position: absolute;\n right: 2rem;\n margin: auto 0;\n }\n"]);
|
|
2876
|
+
|
|
2877
|
+
_templateObject6$1 = function _templateObject6() {
|
|
2878
|
+
return data;
|
|
2879
|
+
};
|
|
2880
|
+
|
|
2881
|
+
return data;
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
function _templateObject5$2() {
|
|
2885
|
+
var data = _taggedTemplateLiteralLoose(["\n width: 90%;\n height: 3.55rem;\n border: 2px solid;\n border-radius: 1rem;\n display: grid;\n place-items: center;\n font-weight: 500;\n font-size: 1rem;\n transition: 0.5s;\n outline: none;\n text-transform: capitalize;\n border-color: ", ";\n color: ", ";\n text-transform: capitalize;\n margin: 0.6rem 0;\n cursor: pointer;\n background: white;\n &:hover,\n &:focus {\n opacity: 0.8;\n letter-spacing: 1px;\n outline: none;\n }\n @media only screen and (max-width: 640px) {\n height: 2.9rem;\n }\n @media only screen and (max-width: 340px) {\n height: 2.2rem;\n margin: 0.3rem 0;\n }\n"]);
|
|
2886
|
+
|
|
2887
|
+
_templateObject5$2 = function _templateObject5() {
|
|
2888
|
+
return data;
|
|
2889
|
+
};
|
|
2890
|
+
|
|
2891
|
+
return data;
|
|
2892
|
+
}
|
|
2893
|
+
|
|
2894
|
+
function _templateObject4$3() {
|
|
2895
|
+
var data = _taggedTemplateLiteralLoose(["\n width: 100%;\n /* height: 8rem; */\n background-color: white;\n box-shadow: 3px -2px 10px #b1b1b1;\n display: flex;\n flex-direction: column;\n min-height: 7rem;\n position: sticky;\n bottom: 0;\n /* padding-bottom: 0.5rem; */\n\n /* left: 0; */\n align-items: center;\n .row {\n width: 90%;\n margin: 0rem auto;\n margin-top: 0.3rem;\n h5 {\n font-weight: bold;\n font-size: 1.1rem;\n span {\n font-weight: 400;\n margin-left: 0.5rem;\n }\n }\n }\n @media only screen and (max-width: 340px) {\n min-height: 6rem;\n .row h5 {\n font-size: 0.8rem;\n }\n }\n"]);
|
|
2896
|
+
|
|
2897
|
+
_templateObject4$3 = function _templateObject4() {
|
|
2898
|
+
return data;
|
|
2899
|
+
};
|
|
2900
|
+
|
|
2901
|
+
return data;
|
|
2902
|
+
}
|
|
2903
|
+
|
|
2904
|
+
function _templateObject3$3() {
|
|
2905
|
+
var data = _taggedTemplateLiteralLoose(["\n width: 100%;\n height: max-content;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n /* height: 900px; */\n padding: 1rem;\n min-height: 74vh;\n\n @media only screen and (max-width: 748px) {\n min-height: 75vh;\n }\n /* background-color: red; */\n"]);
|
|
2906
|
+
|
|
2907
|
+
_templateObject3$3 = function _templateObject3() {
|
|
2908
|
+
return data;
|
|
2909
|
+
};
|
|
2910
|
+
|
|
2911
|
+
return data;
|
|
2912
|
+
}
|
|
2913
|
+
|
|
2914
|
+
function _templateObject2$3() {
|
|
2915
|
+
var data = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n position: sticky;\n box-sizing: border-box;\n top: 0;\n left: -1em;\n padding: 1em;\n height: 4.6rem;\n font-size: 1.6rem;\n background-color: white;\n font-weight: bold;\n .icon {\n cursor: pointer;\n font-size: 22px;\n }\n @media only screen and (max-width: 640px) {\n font-size: 1.2rem;\n height: 4rem;\n }\n"]);
|
|
2916
|
+
|
|
2917
|
+
_templateObject2$3 = function _templateObject2() {
|
|
2918
|
+
return data;
|
|
2919
|
+
};
|
|
2920
|
+
|
|
2921
|
+
return data;
|
|
2922
|
+
}
|
|
2923
|
+
|
|
2924
|
+
function _templateObject$7() {
|
|
2925
|
+
var data = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: ", ";\n height: 100%;\n font-family: ", ";\n /* padding: 1em;\n padding-top: 0rem; */\n position: relative;\n /* min-width: 100%; */\n min-height: 100vh;\n max-height: 100vh;\n overflow-y: auto;\n /* background-color: grey; */\n /* border: 1px solid; */\n"]);
|
|
2926
|
+
|
|
2927
|
+
_templateObject$7 = function _templateObject() {
|
|
2928
|
+
return data;
|
|
2929
|
+
};
|
|
2930
|
+
|
|
2931
|
+
return data;
|
|
2932
|
+
}
|
|
2933
|
+
var CartDrawerContainer = styled.div(_templateObject$7(), function (props) {
|
|
2934
|
+
return props.maxWidth || '650px';
|
|
2935
|
+
}, function (props) {
|
|
2936
|
+
return props.fontFamily;
|
|
2937
|
+
});
|
|
2938
|
+
var CartDrawerBar = styled.div(_templateObject2$3());
|
|
2939
|
+
var CartDrawerProductContainer = styled.div(_templateObject3$3());
|
|
2940
|
+
var CartDrawerBottomSection = styled.div(_templateObject4$3());
|
|
2941
|
+
var CartDrawerOutlinedButton = styled.button(_templateObject5$2(), function (props) {
|
|
2942
|
+
return props.color || 'black';
|
|
2943
|
+
}, function (props) {
|
|
2944
|
+
return props.color || 'black';
|
|
2945
|
+
});
|
|
2946
|
+
var CartDrawerFilledButton = styled(CartDrawerOutlinedButton)(_templateObject6$1(), function (props) {
|
|
2947
|
+
return props.color || 'black';
|
|
2948
|
+
});
|
|
2949
|
+
var CartDrawerEmptyCart = styled.div(_templateObject7$1(), function (props) {
|
|
2950
|
+
return props.color || 'red';
|
|
2951
|
+
});
|
|
2952
|
+
|
|
2953
|
+
// THIS FILE IS AUTO GENERATED
|
|
2954
|
+
function RiDeleteBin5Line (props) {
|
|
2955
|
+
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24"},"child":[{"tag":"g","attr":{},"child":[{"tag":"path","attr":{"fill":"none","d":"M0 0h24v24H0z"}},{"tag":"path","attr":{"d":"M4 8h16v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8zm2 2v10h12V10H6zm3 2h2v6H9v-6zm4 0h2v6h-2v-6zM7 5V3a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v2h5v2H2V5h5zm2-1v1h6V4H9z"}}]}]})(props);
|
|
2956
|
+
}
|
|
2957
|
+
|
|
2958
|
+
// THIS FILE IS AUTO GENERATED
|
|
2959
|
+
function AiOutlineMinus (props) {
|
|
2960
|
+
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 1024 1024"},"child":[{"tag":"path","attr":{"d":"M872 474H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h720c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]})(props);
|
|
2961
|
+
}function AiOutlinePlus (props) {
|
|
2962
|
+
return GenIcon({"tag":"svg","attr":{"t":"1551322312294","style":"","viewBox":"0 0 1024 1024","version":"1.1"},"child":[{"tag":"defs","attr":{},"child":[]},{"tag":"path","attr":{"d":"M474 152m8 0l60 0q8 0 8 8l0 704q0 8-8 8l-60 0q-8 0-8-8l0-704q0-8 8-8Z"}},{"tag":"path","attr":{"d":"M168 474m8 0l672 0q8 0 8 8l0 60q0 8-8 8l-672 0q-8 0-8-8l0-60q0-8 8-8Z"}}]})(props);
|
|
2963
|
+
}
|
|
2964
|
+
|
|
2965
|
+
function _templateObject2$4() {
|
|
2966
|
+
var data = _taggedTemplateLiteralLoose(["\n height: 34px;\n width: 82px;\n border: 1px solid rgb(211, 210, 210);\n display: flex;\n align-items: center;\n justify-content: space-between;\n font-size: 13.5px;\n color: #333;\n padding: 0 0.5rem;\n border-radius: 5px;\n max-width: 100%;\n\n span {\n cursor: pointer;\n height: 100%;\n display: grid;\n place-items: center;\n }\n .qt {\n font-size: 12px;\n color: black;\n font-weight: 500;\n cursor: copy;\n }\n @media only screen and (max-width: 640px) {\n min-width: 55px;\n aspect-ratio: 1/2;\n /* min-height: 28px; */\n font-size: 10px;\n }\n @media only screen and (max-width: 340px) {\n min-width: 50px;\n aspect-ratio: 1/2;\n height: 22px;\n font-size: 8px;\n }\n"]);
|
|
2967
|
+
|
|
2968
|
+
_templateObject2$4 = function _templateObject2() {
|
|
2969
|
+
return data;
|
|
2970
|
+
};
|
|
2971
|
+
|
|
2972
|
+
return data;
|
|
2973
|
+
}
|
|
2974
|
+
|
|
2975
|
+
function _templateObject$8() {
|
|
2976
|
+
var data = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n height: 100px;\n justify-content: space-around;\n align-items: center;\n overflow: hidden;\n margin-bottom: 2rem;\n img {\n width: 20%;\n /* aspect-ratio: 1; */\n object-fit: cover;\n }\n .middleSection {\n width: 60%;\n padding-left: 0.8rem;\n height: 100%;\n h6 {\n font-size: 1.1rem;\n font-weight: bold;\n margin: 0;\n\n span {\n font-size: 0.8rem;\n color: grey;\n text-decoration: line-through;\n margin-right: 0.5rem;\n }\n }\n .name {\n font-size: 0.9rem;\n max-height: 1.85rem;\n width: 100%;\n word-wrap: break-word;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: 0.3s;\n cursor: pointer;\n &:hover {\n color: ", ";\n }\n }\n }\n .endSection {\n width: 20%;\n height: 100%;\n .icon {\n cursor: pointer;\n transition: 0.4s;\n &:hover {\n opacity: 0.7;\n }\n }\n }\n @media only screen and (max-width: 340px) {\n height: 80px;\n .middleSection {\n h6 {\n font-size: 0.9rem;\n }\n .name {\n font-size: 0.7rem;\n height: 1.45rem;\n }\n }\n }\n"]);
|
|
2977
|
+
|
|
2978
|
+
_templateObject$8 = function _templateObject() {
|
|
2979
|
+
return data;
|
|
2980
|
+
};
|
|
2981
|
+
|
|
2982
|
+
return data;
|
|
2983
|
+
}
|
|
2984
|
+
var CartDrawerProduct = styled.div(_templateObject$8(), function (props) {
|
|
2985
|
+
return props.color || 'grey';
|
|
2986
|
+
});
|
|
2987
|
+
var CartDrawerQtBox = styled.div(_templateObject2$4());
|
|
2988
|
+
|
|
2989
|
+
var CartDrawerProductCard = function CartDrawerProductCard(_ref) {
|
|
2990
|
+
var _product$cartStandard, _product$standardPric;
|
|
2991
|
+
|
|
2992
|
+
var product = _ref.product,
|
|
2993
|
+
color = _ref.color,
|
|
2994
|
+
handleIncrementDecrement = _ref.handleIncrementDecrement,
|
|
2995
|
+
handleRemoveProduct = _ref.handleRemoveProduct,
|
|
2996
|
+
handleRedirect = _ref.handleRedirect;
|
|
2997
|
+
return /*#__PURE__*/React__default.createElement(CartDrawerProduct, {
|
|
2998
|
+
color: color
|
|
2999
|
+
}, /*#__PURE__*/React__default.createElement("img", {
|
|
3000
|
+
src: product.imageUrl && product.imageUrl !== 'null' ? product.imageUrl : '/images/imgnotfound.jpeg',
|
|
3001
|
+
alt: 'no product image available'
|
|
3002
|
+
}), /*#__PURE__*/React__default.createElement(Stack, {
|
|
3003
|
+
flexDirection: "column",
|
|
3004
|
+
justifyContent: "space-between",
|
|
3005
|
+
alignItems: "flex-start",
|
|
3006
|
+
className: "middleSection"
|
|
3007
|
+
}, /*#__PURE__*/React__default.createElement("h6", {
|
|
3008
|
+
className: "name",
|
|
3009
|
+
onClick: function onClick() {
|
|
3010
|
+
return handleRedirect(product);
|
|
3011
|
+
}
|
|
3012
|
+
}, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement("h6", null, (product === null || product === void 0 ? void 0 : product.standardPrice) === (product === null || product === void 0 ? void 0 : product.cartStandardPrice) ? "$" + (product === null || product === void 0 ? void 0 : product.standardPrice) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("span", null, "$", product === null || product === void 0 ? void 0 : (_product$cartStandard = product.cartStandardPrice) === null || _product$cartStandard === void 0 ? void 0 : _product$cartStandard.toFixed(2)), "$", product === null || product === void 0 ? void 0 : (_product$standardPric = product.standardPrice) === null || _product$standardPric === void 0 ? void 0 : _product$standardPric.toFixed(2)))), /*#__PURE__*/React__default.createElement(Stack, {
|
|
3013
|
+
flexDirection: "column",
|
|
3014
|
+
justifyContent: "space-between",
|
|
3015
|
+
alignItems: "flex-end",
|
|
3016
|
+
className: "endSection"
|
|
3017
|
+
}, /*#__PURE__*/React__default.createElement(RiDeleteBin5Line, {
|
|
3018
|
+
className: "icon",
|
|
3019
|
+
onClick: function onClick() {
|
|
3020
|
+
handleRemoveProduct(product);
|
|
3021
|
+
}
|
|
3022
|
+
}), /*#__PURE__*/React__default.createElement(CartDrawerQtBox, null, /*#__PURE__*/React__default.createElement("span", {
|
|
3023
|
+
onClick: function onClick() {
|
|
3024
|
+
handleIncrementDecrement('decrement', product);
|
|
3025
|
+
}
|
|
3026
|
+
}, ' ', /*#__PURE__*/React__default.createElement(AiOutlineMinus, null)), ' ', /*#__PURE__*/React__default.createElement("span", {
|
|
3027
|
+
className: 'qt'
|
|
3028
|
+
}, product === null || product === void 0 ? void 0 : product.quantity), /*#__PURE__*/React__default.createElement("span", {
|
|
3029
|
+
onClick: function onClick() {
|
|
3030
|
+
handleIncrementDecrement('increment', product);
|
|
3031
|
+
}
|
|
3032
|
+
}, /*#__PURE__*/React__default.createElement(AiOutlinePlus, null)))));
|
|
3033
|
+
};
|
|
3034
|
+
|
|
3035
|
+
var CartDrawer = function CartDrawer(_ref) {
|
|
3036
|
+
var _cartData$cartLineIte, _cartData$totalCartPr;
|
|
3037
|
+
|
|
3038
|
+
var cartData = _ref.cartData,
|
|
3039
|
+
maxWidth = _ref.maxWidth,
|
|
3040
|
+
color = _ref.color,
|
|
3041
|
+
handleRedirect = _ref.handleRedirect,
|
|
3042
|
+
handleIncrementDecrement = _ref.handleIncrementDecrement,
|
|
3043
|
+
handleRemoveProduct = _ref.handleRemoveProduct,
|
|
3044
|
+
handleClose = _ref.handleClose;
|
|
3045
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(CartDrawerContainer, {
|
|
3046
|
+
maxWidth: maxWidth
|
|
3047
|
+
}, /*#__PURE__*/React__default.createElement(CartDrawerBar, null, /*#__PURE__*/React__default.createElement("h2", null, "Your Cart"), /*#__PURE__*/React__default.createElement(GrClose, {
|
|
3048
|
+
className: "icon",
|
|
3049
|
+
onClick: function onClick() {
|
|
3050
|
+
handleClose();
|
|
3051
|
+
}
|
|
3052
|
+
})), cartData && (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartQuantity) > 0 ? /*#__PURE__*/React__default.createElement(CartDrawerProductContainer, null, cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte === void 0 ? void 0 : _cartData$cartLineIte.map(function (product, i) {
|
|
3053
|
+
return /*#__PURE__*/React__default.createElement(CartDrawerProductCard, {
|
|
3054
|
+
product: product,
|
|
3055
|
+
handleRedirect: handleRedirect,
|
|
3056
|
+
handleIncrementDecrement: handleIncrementDecrement,
|
|
3057
|
+
handleRemoveProduct: handleRemoveProduct,
|
|
3058
|
+
color: color,
|
|
3059
|
+
key: i
|
|
3060
|
+
});
|
|
3061
|
+
})) : /*#__PURE__*/React__default.createElement(CartDrawerEmptyCart, {
|
|
3062
|
+
color: color
|
|
3063
|
+
}, /*#__PURE__*/React__default.createElement(BsCartX, {
|
|
3064
|
+
className: "icon"
|
|
3065
|
+
}), /*#__PURE__*/React__default.createElement("h6", null, "OOps!"), /*#__PURE__*/React__default.createElement("p", null, "your cart is empty")), cartData && (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartQuantity) > 0 && /*#__PURE__*/React__default.createElement(CartDrawerBottomSection, null, /*#__PURE__*/React__default.createElement(Stack, {
|
|
3066
|
+
flexDirection: "row",
|
|
3067
|
+
justifyContent: "space-between",
|
|
3068
|
+
alignItems: "center",
|
|
3069
|
+
className: "row"
|
|
3070
|
+
}, /*#__PURE__*/React__default.createElement("h5", null, "Subtotal", /*#__PURE__*/React__default.createElement("span", null, "(", cartData === null || cartData === void 0 ? void 0 : cartData.totalCartQuantity, " items)")), /*#__PURE__*/React__default.createElement("h5", null, "$", cartData === null || cartData === void 0 ? void 0 : (_cartData$totalCartPr = cartData.totalCartPrice) === null || _cartData$totalCartPr === void 0 ? void 0 : _cartData$totalCartPr.toFixed(2))), /*#__PURE__*/React__default.createElement(CartDrawerOutlinedButton, {
|
|
3071
|
+
color: color,
|
|
3072
|
+
onClick: function onClick() {
|
|
3073
|
+
return handleRedirect('cart');
|
|
3074
|
+
}
|
|
3075
|
+
}, "view cart"), /*#__PURE__*/React__default.createElement(CartDrawerFilledButton, {
|
|
3076
|
+
color: color,
|
|
3077
|
+
onClick: function onClick() {
|
|
3078
|
+
return handleRedirect('checkout');
|
|
3079
|
+
}
|
|
3080
|
+
}, "continue to checkout"))));
|
|
3081
|
+
};
|
|
3082
|
+
|
|
2773
3083
|
function debounce(func, wait, immediate) {
|
|
2774
3084
|
var timeout;
|
|
2775
3085
|
return function () {
|
|
@@ -2860,5 +3170,5 @@ function useGridSize() {
|
|
|
2860
3170
|
return layout;
|
|
2861
3171
|
}
|
|
2862
3172
|
|
|
2863
|
-
export { Breakpoint, Product, ProductHelper, ProductSlider, TestCard, Variant, useGridSize, useWindowSize };
|
|
3173
|
+
export { Breakpoint, CartDrawer, Product, ProductHelper, ProductSlider, TestCard, Variant, useGridSize, useWindowSize };
|
|
2864
3174
|
//# sourceMappingURL=index.modern.js.map
|