s-platform-landing-section 0.1.11 → 0.1.12
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 +65 -21
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +65 -22
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -765,15 +765,15 @@ var Input = React.forwardRef(function (props, ref) {
|
|
|
765
765
|
for (var _iterator = _createForOfIteratorHelperLoose(rules), _step; !(_step = _iterator()).done;) {
|
|
766
766
|
var _e$pattern, _e$validate;
|
|
767
767
|
var e = _step.value;
|
|
768
|
-
if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && value === '') {
|
|
768
|
+
if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && (value === '' || value === null)) {
|
|
769
769
|
_setError(e === null || e === void 0 ? void 0 : e.message);
|
|
770
770
|
count++;
|
|
771
771
|
break;
|
|
772
|
-
} else if ((e === null || e === void 0 ? void 0 : e.type) === 'pattern' && !(e !== null && e !== void 0 && (_e$pattern = e.pattern) !== null && _e$pattern !== void 0 && _e$pattern.test(value))) {
|
|
772
|
+
} else if (value !== "" && (e === null || e === void 0 ? void 0 : e.type) === 'pattern' && !(e !== null && e !== void 0 && (_e$pattern = e.pattern) !== null && _e$pattern !== void 0 && _e$pattern.test(value))) {
|
|
773
773
|
_setError(e === null || e === void 0 ? void 0 : e.message);
|
|
774
774
|
count++;
|
|
775
775
|
break;
|
|
776
|
-
} else if ((e === null || e === void 0 ? void 0 : e.type) === "validate" && e !== null && e !== void 0 && e.validate && !(e !== null && e !== void 0 && (_e$validate = e.validate) !== null && _e$validate !== void 0 && _e$validate.call(e))) {
|
|
776
|
+
} else if (value !== "" && (e === null || e === void 0 ? void 0 : e.type) === "validate" && e !== null && e !== void 0 && e.validate && !(e !== null && e !== void 0 && (_e$validate = e.validate) !== null && _e$validate !== void 0 && _e$validate.call(e))) {
|
|
777
777
|
_setError(e === null || e === void 0 ? void 0 : e.message);
|
|
778
778
|
count++;
|
|
779
779
|
break;
|
|
@@ -8165,7 +8165,7 @@ var InputPhoneNumber = React.forwardRef(function (props, ref) {
|
|
|
8165
8165
|
_setError(e === null || e === void 0 ? void 0 : e.message);
|
|
8166
8166
|
count++;
|
|
8167
8167
|
break;
|
|
8168
|
-
} else if ((e === null || e === void 0 ? void 0 : e.type) === 'pattern' && !(e !== null && e !== void 0 && (_e$pattern = e.pattern) !== null && _e$pattern !== void 0 && _e$pattern.test(value))) {
|
|
8168
|
+
} else if (value !== "" && (e === null || e === void 0 ? void 0 : e.type) === 'pattern' && !(e !== null && e !== void 0 && (_e$pattern = e.pattern) !== null && _e$pattern !== void 0 && _e$pattern.test(value))) {
|
|
8169
8169
|
_setError(e === null || e === void 0 ? void 0 : e.message);
|
|
8170
8170
|
count++;
|
|
8171
8171
|
break;
|
|
@@ -8190,9 +8190,9 @@ var InputPhoneNumber = React.forwardRef(function (props, ref) {
|
|
|
8190
8190
|
}, label ? /*#__PURE__*/React__default.createElement("label", {
|
|
8191
8191
|
className: "mb-1 " + labelClassName
|
|
8192
8192
|
}, label, labelRequired) : null, /*#__PURE__*/React__default.createElement("div", {
|
|
8193
|
-
className: "flex items-center h-10 rounded-lg border " + className
|
|
8193
|
+
className: "flex items-center h-10 rounded-lg border border-stroke " + className
|
|
8194
8194
|
}, /*#__PURE__*/React__default.createElement("button", {
|
|
8195
|
-
className: "border-r-2 "
|
|
8195
|
+
className: "border-stroke border-r-2 "
|
|
8196
8196
|
}, /*#__PURE__*/React__default.createElement(Select$1, {
|
|
8197
8197
|
className: 'w-max border-0 !rounded-none !rounded-l-lg',
|
|
8198
8198
|
defaultValue: countryCode,
|
|
@@ -9418,6 +9418,7 @@ var ProductItem2 = function ProductItem2(props) {
|
|
|
9418
9418
|
Link = _props$Link === void 0 ? null : _props$Link,
|
|
9419
9419
|
_props$className = props.className,
|
|
9420
9420
|
className = _props$className === void 0 ? "" : _props$className;
|
|
9421
|
+
console.log("checkkkkkkkk:::::::", className);
|
|
9421
9422
|
return /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
9422
9423
|
Link: Link,
|
|
9423
9424
|
href: getLinkProductDetail(product)
|
|
@@ -9444,12 +9445,12 @@ var ProductItem3 = function ProductItem3(props) {
|
|
|
9444
9445
|
Link: Link,
|
|
9445
9446
|
href: getLinkProductDetail(product)
|
|
9446
9447
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9447
|
-
className: "w-full border rounded-2xl " + className
|
|
9448
|
+
className: "w-full border border-stroke rounded-2xl " + className
|
|
9448
9449
|
}, /*#__PURE__*/React__default.createElement(ProductImage, {
|
|
9449
9450
|
product: product,
|
|
9450
9451
|
className: "w-full h-44 md:h-56 lg:h-64 xl:h-72 bg-cover bg-no-repeat rounded-t-2xl"
|
|
9451
9452
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9452
|
-
className: "p-4 flex flex-col gap-4
|
|
9453
|
+
className: "p-4 flex flex-col gap-4 items-start"
|
|
9453
9454
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9454
9455
|
className: "line-clamp-1"
|
|
9455
9456
|
}, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
|
|
@@ -9470,15 +9471,15 @@ var ProductItem4 = function ProductItem4(props) {
|
|
|
9470
9471
|
Link: Link,
|
|
9471
9472
|
href: getLinkProductDetail(product)
|
|
9472
9473
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9473
|
-
className: "w-full border flex flex-col gap-2 md:gap-4 rounded-2xl p-2 md:p-4 xl:p-6 " + className
|
|
9474
|
+
className: "w-full border border-stroke flex flex-col gap-2 md:gap-4 rounded-2xl p-2 md:p-4 xl:p-6 " + className
|
|
9474
9475
|
}, /*#__PURE__*/React__default.createElement(ProductImage, {
|
|
9475
9476
|
product: product,
|
|
9476
9477
|
className: "w-full h-44 sm:h-56 xl:h-72 bg-cover bg-no-repeat rounded-2xl"
|
|
9477
9478
|
}), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
9478
|
-
className: "line-clamp-1"
|
|
9479
|
+
className: "text-start line-clamp-1"
|
|
9479
9480
|
}, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
|
|
9480
9481
|
product: product,
|
|
9481
|
-
className: "text-lg text-start"
|
|
9482
|
+
className: "text-lg text-start mt-2"
|
|
9482
9483
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
9483
9484
|
className: "flex pt-4 gap-2 md:gap-4 border-t items-center"
|
|
9484
9485
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -9509,7 +9510,7 @@ var ProductItem5 = function ProductItem5(props) {
|
|
|
9509
9510
|
product: product,
|
|
9510
9511
|
className: "w-full w-full h-44 md:h-56 lg:h-64 xl:h-72 bg-cover bg-no-repeat rounded-2xl"
|
|
9511
9512
|
}), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
9512
|
-
className: "line-clamp-1 mb-2"
|
|
9513
|
+
className: "text-start line-clamp-1 mb-2"
|
|
9513
9514
|
}, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
|
|
9514
9515
|
product: product,
|
|
9515
9516
|
className: "text-lg text-start"
|
|
@@ -9536,12 +9537,12 @@ var ProductItem6 = function ProductItem6(props) {
|
|
|
9536
9537
|
Link: Link,
|
|
9537
9538
|
href: getLinkProductDetail(product)
|
|
9538
9539
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9539
|
-
className: "w-full border flex flex-col gap-2 md:gap-4 rounded-2xl p-2 md:p-4 xl:p-6 " + className
|
|
9540
|
+
className: "w-full border border-stroke flex flex-col gap-2 md:gap-4 rounded-2xl p-2 md:p-4 xl:p-6 " + className
|
|
9540
9541
|
}, /*#__PURE__*/React__default.createElement(ProductImage, {
|
|
9541
9542
|
product: product,
|
|
9542
9543
|
className: "w-full h-44 sm:h-56 xl:h-72 bg-cover bg-no-repeat rounded-2xl"
|
|
9543
9544
|
}), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
9544
|
-
className: "line-clamp-1"
|
|
9545
|
+
className: "text start line-clamp-1"
|
|
9545
9546
|
}, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
|
|
9546
9547
|
product: product,
|
|
9547
9548
|
className: "text-lg text-start"
|
|
@@ -9556,6 +9557,32 @@ var ProductItem6 = function ProductItem6(props) {
|
|
|
9556
9557
|
}))));
|
|
9557
9558
|
};
|
|
9558
9559
|
|
|
9560
|
+
var ProductItem7 = function ProductItem7(props) {
|
|
9561
|
+
var product = props.product,
|
|
9562
|
+
_props$Link = props.Link,
|
|
9563
|
+
Link = _props$Link === void 0 ? null : _props$Link,
|
|
9564
|
+
_props$className = props.className,
|
|
9565
|
+
className = _props$className === void 0 ? "" : _props$className;
|
|
9566
|
+
return /*#__PURE__*/React__default.createElement(LinkToPage, {
|
|
9567
|
+
Link: Link,
|
|
9568
|
+
href: getLinkProductDetail(product)
|
|
9569
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9570
|
+
className: "w-full bg-bgSecondary relative rounded-2xl " + className
|
|
9571
|
+
}, /*#__PURE__*/React__default.createElement(ProductImage, {
|
|
9572
|
+
product: product,
|
|
9573
|
+
className: "w-full h-44 md:h-56 lg:h-64 xl:h-72 bg-cover bg-no-repeat rounded-t-2xl"
|
|
9574
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
9575
|
+
className: "p-4 flex flex-col gap-4 items-start"
|
|
9576
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9577
|
+
className: "line-clamp-1"
|
|
9578
|
+
}, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
|
|
9579
|
+
product: product,
|
|
9580
|
+
className: "text-lg text-start"
|
|
9581
|
+
})), product !== null && product !== void 0 && product.priceBeforeDiscount && (product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) !== (product === null || product === void 0 ? void 0 : product.price) ? /*#__PURE__*/React__default.createElement("div", {
|
|
9582
|
+
className: "absolute top-5 left-0 font-semibold px-3 py-1 bg-danger text-textButton rounded-r-2xl shadow-lg v-max"
|
|
9583
|
+
}, 1 - 100 * (product === null || product === void 0 ? void 0 : product.price) / (product === null || product === void 0 ? void 0 : product.priceBeforeDiscount)) : null));
|
|
9584
|
+
};
|
|
9585
|
+
|
|
9559
9586
|
var TreatmentItem1 = function TreatmentItem1(props) {
|
|
9560
9587
|
var product = props.product,
|
|
9561
9588
|
_props$Link = props.Link,
|
|
@@ -9737,13 +9764,12 @@ var Products2 = function Products2(props) {
|
|
|
9737
9764
|
primaryColor: primary,
|
|
9738
9765
|
renderItem: function renderItem(item, index) {
|
|
9739
9766
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
9740
|
-
|
|
9741
|
-
className: "flex-shrink-0 w-[calc(50%-2px)] md:w-[calc(34%-16px)] lg:w-[calc(25%-12px)] xl:w-[calc(25%-19px)]"
|
|
9767
|
+
className: "border-0 flex-shrink-0 w-[calc(50%-2px)] md:w-[calc(34%-16px)] lg:w-[calc(25%-12px)] xl:w-[calc(25%-19px)]"
|
|
9742
9768
|
}, /*#__PURE__*/React__default.createElement(ProductItem, {
|
|
9743
9769
|
product: item.productInfo,
|
|
9770
|
+
key: "carousel-" + index,
|
|
9744
9771
|
Link: Link,
|
|
9745
|
-
shopConfigStyle: shopConfigStyle
|
|
9746
|
-
className: "border-0 bg-bgSecondary"
|
|
9772
|
+
shopConfigStyle: shopConfigStyle
|
|
9747
9773
|
}));
|
|
9748
9774
|
}
|
|
9749
9775
|
})));
|
|
@@ -10281,7 +10307,7 @@ var ProductsTop1 = function ProductsTop1(props) {
|
|
|
10281
10307
|
}, products === null || products === void 0 ? void 0 : products.map(function (product, idx) {
|
|
10282
10308
|
return /*#__PURE__*/React__default.createElement(ProductItem, {
|
|
10283
10309
|
Link: Link,
|
|
10284
|
-
className: "
|
|
10310
|
+
className: "border-0",
|
|
10285
10311
|
shopConfigStyle: shopConfigStyle,
|
|
10286
10312
|
product: product === null || product === void 0 ? void 0 : product.productInfo,
|
|
10287
10313
|
key: "htrhr-" + idx
|
|
@@ -10402,7 +10428,9 @@ var ProductHighlight1 = function ProductHighlight1(props) {
|
|
|
10402
10428
|
var ProductDetail10 = function ProductDetail10(props) {
|
|
10403
10429
|
var _product$images;
|
|
10404
10430
|
var shopConfigStyle = props.shopConfigStyle,
|
|
10405
|
-
shopConfig = props.shopConfig
|
|
10431
|
+
shopConfig = props.shopConfig,
|
|
10432
|
+
_props$handleRedirect = props.handleRedirect,
|
|
10433
|
+
handleRedirect = _props$handleRedirect === void 0 ? function () {} : _props$handleRedirect;
|
|
10406
10434
|
var _ProductDetailControl = ProductDetailController(props),
|
|
10407
10435
|
product = _ProductDetailControl.product;
|
|
10408
10436
|
var _useState = React.useState(),
|
|
@@ -10491,7 +10519,22 @@ var ProductDetail10 = function ProductDetail10(props) {
|
|
|
10491
10519
|
return Promise.reject(e);
|
|
10492
10520
|
}
|
|
10493
10521
|
};
|
|
10494
|
-
var buyNow = function buyNow() {
|
|
10522
|
+
var buyNow = function buyNow() {
|
|
10523
|
+
try {
|
|
10524
|
+
var _temp2 = function () {
|
|
10525
|
+
if (validateData()) {
|
|
10526
|
+
var _refInputQuantity$cur3;
|
|
10527
|
+
var quantity = refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur3 = refInputQuantity.current) === null || _refInputQuantity$cur3 === void 0 ? void 0 : _refInputQuantity$cur3.getValue();
|
|
10528
|
+
return Promise.resolve(addProductToCart(product, variant, quantity)).then(function () {
|
|
10529
|
+
handleRedirect("/carts");
|
|
10530
|
+
});
|
|
10531
|
+
}
|
|
10532
|
+
}();
|
|
10533
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
10534
|
+
} catch (e) {
|
|
10535
|
+
return Promise.reject(e);
|
|
10536
|
+
}
|
|
10537
|
+
};
|
|
10495
10538
|
var handleDisplayImage = function handleDisplayImage(item) {
|
|
10496
10539
|
setDisplayImage(item);
|
|
10497
10540
|
};
|
|
@@ -12758,6 +12801,7 @@ exports.ProductItem3 = ProductItem3;
|
|
|
12758
12801
|
exports.ProductItem4 = ProductItem4;
|
|
12759
12802
|
exports.ProductItem5 = ProductItem5;
|
|
12760
12803
|
exports.ProductItem6 = ProductItem6;
|
|
12804
|
+
exports.ProductItem7 = ProductItem7;
|
|
12761
12805
|
exports.ProductList5 = ProductList5;
|
|
12762
12806
|
exports.ProductSale2 = ProductSale2;
|
|
12763
12807
|
exports.ProductSearch1 = ProductSearch1;
|