s-platform-landing-section 0.1.16 → 0.1.17
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 +43 -8
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +43 -8
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -306,7 +306,7 @@ var NavBar7 = function NavBar7(props) {
|
|
|
306
306
|
href: item === null || item === void 0 ? void 0 : item.route,
|
|
307
307
|
key: index
|
|
308
308
|
}, (item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? /*#__PURE__*/React__default.createElement("div", {
|
|
309
|
-
className: "py-1 border-b text-textHeading border-textHeading"
|
|
309
|
+
className: "whitespace-nowrap py-1 border-b text-textHeading border-textHeading"
|
|
310
310
|
}, item === null || item === void 0 ? void 0 : item.label) : /*#__PURE__*/React__default.createElement("div", {
|
|
311
311
|
className: "py-1 text-textBody"
|
|
312
312
|
}, item === null || item === void 0 ? void 0 : item.label));
|
|
@@ -508,7 +508,7 @@ var NavBar1 = function NavBar1(props) {
|
|
|
508
508
|
href: item === null || item === void 0 ? void 0 : item.route,
|
|
509
509
|
key: index
|
|
510
510
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
511
|
-
className: "py-1 " + ((item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? "border-b text-primary border-primary" : "text-textBody") + " "
|
|
511
|
+
className: "py-1 whitespace-nowrap " + ((item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? "border-b text-primary border-primary" : "text-textBody") + " "
|
|
512
512
|
}, item === null || item === void 0 ? void 0 : item.label));
|
|
513
513
|
})), cart(), userInfo ?
|
|
514
514
|
/*#__PURE__*/
|
|
@@ -848,7 +848,7 @@ var Hero1 = function Hero1(props) {
|
|
|
848
848
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
849
849
|
className: "w-[80%] md:w-2/3 xl:w-1/2 md:h-2/3 flex flex-col gap-2 md:gap-8 justify-center items-center bg-background opacity-90 absolute top-5 md:top-10 px-6 py-4 rounded-tr-[40px] rounded-bl-[40px] md:rounded-tr-[80px] md:rounded-bl-[80px]"
|
|
850
850
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
851
|
-
className: "text-xl md:text-4xl lg:text-[40px] text-primary font-medium"
|
|
851
|
+
className: "text-xl text-center md:text-4xl lg:text-[40px] text-primary font-medium"
|
|
852
852
|
}, sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$2 = sectionData[0]) === null || _sectionData$2 === void 0 ? void 0 : _sectionData$2.title), /*#__PURE__*/React__default.createElement("div", {
|
|
853
853
|
className: "text-center md:text-2xl lg:text-3xl font-medium"
|
|
854
854
|
}, sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$3 = sectionData[0]) === null || _sectionData$3 === void 0 ? void 0 : _sectionData$3.description), /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
@@ -1042,7 +1042,7 @@ var CarouselItem = function CarouselItem(props) {
|
|
|
1042
1042
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1043
1043
|
className: "col-span-12 lg:col-span-10 md:col-span-9 overflow-hidden "
|
|
1044
1044
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1045
|
-
className: "flex overflow-x-auto gap-2
|
|
1045
|
+
className: "flex overflow-x-auto gap-2 no-scrollbar items-center",
|
|
1046
1046
|
ref: listRef
|
|
1047
1047
|
}, isAll ? /*#__PURE__*/React__default.createElement("div", {
|
|
1048
1048
|
className: " " + ((Object === null || Object === void 0 ? void 0 : (_Object$keys = Object.keys(value)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) <= 0 ? "bg-primary text-textButton" : "bg-background") + " w-max border border-primary p-1 md:p-2 rounded-lg cursor-pointer whitespace-nowrap",
|
|
@@ -9638,7 +9638,7 @@ var Carousel = function Carousel(props) {
|
|
|
9638
9638
|
className: "relative " + className + " ",
|
|
9639
9639
|
style: style
|
|
9640
9640
|
}, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
9641
|
-
className: " w-full pe-2 h-full flex gap-2 md:gap-4 xl:gap-6 overflow-x-auto
|
|
9641
|
+
className: " w-full pe-2 h-full flex gap-2 md:gap-4 xl:gap-6 overflow-x-auto no-scrollbar",
|
|
9642
9642
|
ref: carouselRef
|
|
9643
9643
|
}, data && (data === null || data === void 0 ? void 0 : data.length) > 0 ? data === null || data === void 0 ? void 0 : data.map(function (item, index) {
|
|
9644
9644
|
return renderItem(item, index);
|
|
@@ -12496,7 +12496,25 @@ var SearchProduct1 = function SearchProduct1(props) {
|
|
|
12496
12496
|
setListProducts = _useState[1];
|
|
12497
12497
|
var _ProductController = ProductController(_extends({}, props)),
|
|
12498
12498
|
getProductListSearch = _ProductController.getProductListSearch;
|
|
12499
|
+
var _useState2 = React.useState(""),
|
|
12500
|
+
valueSearch = _useState2[0],
|
|
12501
|
+
setSearchValue = _useState2[1];
|
|
12502
|
+
React.useEffect(function () {
|
|
12503
|
+
if (valueSearch === "") {
|
|
12504
|
+
setProducts([]);
|
|
12505
|
+
} else {
|
|
12506
|
+
var delayDebounceFn = setTimeout(function () {
|
|
12507
|
+
handleSearch(valueSearch);
|
|
12508
|
+
}, 500);
|
|
12509
|
+
return function () {
|
|
12510
|
+
return clearTimeout(delayDebounceFn);
|
|
12511
|
+
};
|
|
12512
|
+
}
|
|
12513
|
+
}, [valueSearch]);
|
|
12499
12514
|
var handleSearch = function handleSearch(productName) {
|
|
12515
|
+
if (productName === void 0) {
|
|
12516
|
+
productName = "";
|
|
12517
|
+
}
|
|
12500
12518
|
try {
|
|
12501
12519
|
var _temp = function () {
|
|
12502
12520
|
if (productName) {
|
|
@@ -12523,7 +12541,7 @@ var SearchProduct1 = function SearchProduct1(props) {
|
|
|
12523
12541
|
},
|
|
12524
12542
|
inputClassName: "w-full h-full p-2 text-lg",
|
|
12525
12543
|
placeholder: (data === null || data === void 0 ? void 0 : data.sectionTitle) || "Tìm kiếm sản phẩm",
|
|
12526
|
-
onChange:
|
|
12544
|
+
onChange: setSearchValue,
|
|
12527
12545
|
icons: /*#__PURE__*/React__default.createElement("div", {
|
|
12528
12546
|
className: "px-2"
|
|
12529
12547
|
}, /*#__PURE__*/React__default.createElement(fi.FiSearch, {
|
|
@@ -12561,15 +12579,32 @@ var SearchBar2 = function SearchBar2(props) {
|
|
|
12561
12579
|
var _useState = React.useState([]),
|
|
12562
12580
|
products = _useState[0],
|
|
12563
12581
|
setProducts = _useState[1];
|
|
12582
|
+
var _useState2 = React.useState(""),
|
|
12583
|
+
valueSearch = _useState2[0],
|
|
12584
|
+
setSearchValue = _useState2[1];
|
|
12564
12585
|
var _ProductController = ProductController(_extends({}, props)),
|
|
12565
12586
|
getProductListSearch = _ProductController.getProductListSearch;
|
|
12587
|
+
React.useEffect(function () {
|
|
12588
|
+
if (valueSearch === "") {
|
|
12589
|
+
setProducts([]);
|
|
12590
|
+
} else {
|
|
12591
|
+
var delayDebounceFn = setTimeout(function () {
|
|
12592
|
+
handleSearch(valueSearch);
|
|
12593
|
+
}, 500);
|
|
12594
|
+
return function () {
|
|
12595
|
+
return clearTimeout(delayDebounceFn);
|
|
12596
|
+
};
|
|
12597
|
+
}
|
|
12598
|
+
}, [valueSearch]);
|
|
12566
12599
|
var handleSearch = function handleSearch(productName) {
|
|
12567
12600
|
if (productName === void 0) {
|
|
12568
12601
|
productName = "";
|
|
12569
12602
|
}
|
|
12570
12603
|
try {
|
|
12571
12604
|
var _temp = function () {
|
|
12572
|
-
if (productName === "")
|
|
12605
|
+
if (productName === "") {
|
|
12606
|
+
setProducts([]);
|
|
12607
|
+
} else {
|
|
12573
12608
|
return Promise.resolve(getProductListSearch({
|
|
12574
12609
|
productName: productName
|
|
12575
12610
|
})).then(function (productList) {
|
|
@@ -12591,7 +12626,7 @@ var SearchBar2 = function SearchBar2(props) {
|
|
|
12591
12626
|
className: "w-full",
|
|
12592
12627
|
inputClassName: "w-full",
|
|
12593
12628
|
placeholder: data !== null && data !== void 0 && data.sectionTitle ? data === null || data === void 0 ? void 0 : data.sectionTitle : "Tìm kiếm sản phẩm",
|
|
12594
|
-
onChange:
|
|
12629
|
+
onChange: setSearchValue
|
|
12595
12630
|
}), (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
|
|
12596
12631
|
className: "max-h-64 overflow-y-auto flex flex-col gap-2"
|
|
12597
12632
|
}, products === null || products === void 0 ? void 0 : products.map(function (item, index) {
|