nvis-fe-cms-libs 2.1.3 → 2.1.4
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.
|
@@ -646,8 +646,8 @@ const AboutCompanySection = ({ data, t, isDarkMode, imageBaseUrl = "" }) => {
|
|
|
646
646
|
] });
|
|
647
647
|
};
|
|
648
648
|
const TimelineSection = ({ data, t, section }) => {
|
|
649
|
-
var _a, _b;
|
|
650
|
-
const timelineData = ((_b = (_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.filter((item) => item == null ? void 0 : item.data)) == null ? void 0 : _b.map((item) => item.data)) || [];
|
|
649
|
+
var _a, _b, _c;
|
|
650
|
+
const timelineData = ((_c = (_b = (_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.filter((item) => item == null ? void 0 : item.data)) == null ? void 0 : _b.sort((a, b) => (a.sortOrder || 0) - (b.sortOrder || 0))) == null ? void 0 : _c.map((item) => item.data)) || [];
|
|
651
651
|
const [timelineVisible, setTimelineVisible] = useState([]);
|
|
652
652
|
const timelineRefs = useRef([]);
|
|
653
653
|
const sectionTitle = (section == null ? void 0 : section.title) || "Timeline";
|
|
@@ -857,8 +857,8 @@ function useWindowSize$1() {
|
|
|
857
857
|
return width;
|
|
858
858
|
}
|
|
859
859
|
const PartnersSection = ({ data, t, imageBaseUrl = "", section }) => {
|
|
860
|
-
var _a, _b;
|
|
861
|
-
const partnersData = ((_b = (_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.filter((item) => item == null ? void 0 : item.data)) == null ? void 0 : _b.map((item) => item.data)) || [];
|
|
860
|
+
var _a, _b, _c;
|
|
861
|
+
const partnersData = ((_c = (_b = (_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.filter((item) => item == null ? void 0 : item.data)) == null ? void 0 : _b.sort((a, b) => (a.sortOrder || 0) - (b.sortOrder || 0))) == null ? void 0 : _c.map((item) => item.data)) || [];
|
|
862
862
|
const [currentPartnerSlide, setCurrentPartnerSlide] = useState(0);
|
|
863
863
|
const [partnersVisible, setPartnersVisible] = useState(false);
|
|
864
864
|
const partnersRef = useRef(null);
|
|
@@ -956,7 +956,7 @@ const MilestoneSection = ({ data, t, isDarkMode, getMilestoneTimeline, section }
|
|
|
956
956
|
const sectionTitle = (section == null ? void 0 : section.title) || "...";
|
|
957
957
|
useEffect(() => {
|
|
958
958
|
const fetchMilestones = () => __async(null, null, function* () {
|
|
959
|
-
var _a, _b;
|
|
959
|
+
var _a, _b, _c;
|
|
960
960
|
if (getMilestoneTimeline) {
|
|
961
961
|
try {
|
|
962
962
|
setLoading(true);
|
|
@@ -969,7 +969,7 @@ const MilestoneSection = ({ data, t, isDarkMode, getMilestoneTimeline, section }
|
|
|
969
969
|
setLoading(false);
|
|
970
970
|
}
|
|
971
971
|
} else {
|
|
972
|
-
const milestonesData = ((_b = (_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.filter((item) => item == null ? void 0 : item.data)) == null ? void 0 : _b.map((item) => item.data)) || [];
|
|
972
|
+
const milestonesData = ((_c = (_b = (_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.filter((item) => item == null ? void 0 : item.data)) == null ? void 0 : _b.sort((a, b) => (a.sortOrder || 0) - (b.sortOrder || 0))) == null ? void 0 : _c.map((item) => item.data)) || [];
|
|
973
973
|
setMilestones(milestonesData);
|
|
974
974
|
setLoading(false);
|
|
975
975
|
}
|
|
@@ -1040,16 +1040,16 @@ const MilestoneSection = ({ data, t, isDarkMode, getMilestoneTimeline, section }
|
|
|
1040
1040
|
] }) });
|
|
1041
1041
|
};
|
|
1042
1042
|
const TestimonialsSection = ({ data, t, section }) => {
|
|
1043
|
-
var _a, _b;
|
|
1043
|
+
var _a, _b, _c;
|
|
1044
1044
|
const [currentIndex, setCurrentIndex] = useState(0);
|
|
1045
1045
|
const [isTransitioning, setIsTransitioning] = useState(false);
|
|
1046
1046
|
const sectionTitle = (section == null ? void 0 : section.title) || t("testimonials.sectionTitle") || "Cảm nhận khách hàng";
|
|
1047
|
-
const testimonials = ((_b = (_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.filter((item) => item == null ? void 0 : item.data)) == null ? void 0 : _b.map((item) => {
|
|
1048
|
-
var _a2, _b2,
|
|
1047
|
+
const testimonials = ((_c = (_b = (_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.filter((item) => item == null ? void 0 : item.data)) == null ? void 0 : _b.sort((a, b) => (a.sortOrder || 0) - (b.sortOrder || 0))) == null ? void 0 : _c.map((item) => {
|
|
1048
|
+
var _a2, _b2, _c2, _d;
|
|
1049
1049
|
return {
|
|
1050
1050
|
quote: ((_a2 = item.data) == null ? void 0 : _a2.content) || "",
|
|
1051
1051
|
author: ((_b2 = item.data) == null ? void 0 : _b2.customerName) || "",
|
|
1052
|
-
position: ((
|
|
1052
|
+
position: ((_c2 = item.data) == null ? void 0 : _c2.customerTitle) || "",
|
|
1053
1053
|
company: ((_d = item.data) == null ? void 0 : _d.customerCompany) || ""
|
|
1054
1054
|
};
|
|
1055
1055
|
})) || [];
|
|
@@ -1738,8 +1738,8 @@ const ContactFormSection = ({ data, t, isDarkMode, consultationRequestService })
|
|
|
1738
1738
|
] }) }) }) }) });
|
|
1739
1739
|
};
|
|
1740
1740
|
const ContactInfoSection = ({ data, t, isDarkMode, section }) => {
|
|
1741
|
-
var _a, _b;
|
|
1742
|
-
const contactData = ((_b = (_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.filter((item) => item == null ? void 0 : item.data)) == null ? void 0 : _b.map((item) => item.data)) || [];
|
|
1741
|
+
var _a, _b, _c;
|
|
1742
|
+
const contactData = ((_c = (_b = (_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.filter((item) => item == null ? void 0 : item.data)) == null ? void 0 : _b.sort((a, b) => (a.sortOrder || 0) - (b.sortOrder || 0))) == null ? void 0 : _c.map((item) => item.data)) || [];
|
|
1743
1743
|
const sectionTitle = (section == null ? void 0 : section.title) || "...";
|
|
1744
1744
|
if (!contactData.length) return null;
|
|
1745
1745
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(SectionWrapper, { isDarkMode, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [
|
|
@@ -2376,9 +2376,9 @@ const ProductCard = ({ product, t, isDarkMode }) => {
|
|
|
2376
2376
|
);
|
|
2377
2377
|
};
|
|
2378
2378
|
const TextWithTitleSection = ({ section, data, isDarkMode }) => {
|
|
2379
|
-
var _a;
|
|
2380
|
-
const textItems = (data == null ? void 0 : data.sectionDataBindingItems) || [];
|
|
2381
|
-
const title = ((
|
|
2379
|
+
var _a, _b;
|
|
2380
|
+
const textItems = ((_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.sort((a, b) => (a.sortOrder || 0) - (b.sortOrder || 0))) || [];
|
|
2381
|
+
const title = ((_b = textItems[0]) == null ? void 0 : _b.value) || "";
|
|
2382
2382
|
const descriptions = textItems.slice(1);
|
|
2383
2383
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(SectionWrapper, { isDarkMode, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-6xl mx-auto", children: [
|
|
2384
2384
|
title && /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-title font-black mb-4 leading-tight text-left text-main", children: title }),
|
|
@@ -2393,7 +2393,8 @@ const TextWithTitleSection = ({ section, data, isDarkMode }) => {
|
|
|
2393
2393
|
] }) });
|
|
2394
2394
|
};
|
|
2395
2395
|
const TextSection = ({ data, isDarkMode }) => {
|
|
2396
|
-
|
|
2396
|
+
var _a;
|
|
2397
|
+
const textItems = ((_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.sort((a, b) => (a.sortOrder || 0) - (b.sortOrder || 0))) || [];
|
|
2397
2398
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(SectionWrapper, { isDarkMode, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-w-3xl mx-auto", children: textItems.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2398
2399
|
"div",
|
|
2399
2400
|
{
|
|
@@ -4184,7 +4185,7 @@ const FaqSection = ({ data, t, isDarkMode, section }) => {
|
|
|
4184
4185
|
const [activeIndex, setActiveIndex] = useState(-1);
|
|
4185
4186
|
const faqs = useMemo(() => {
|
|
4186
4187
|
if ((data == null ? void 0 : data.sectionDataBindingItems) && Array.isArray(data.sectionDataBindingItems)) {
|
|
4187
|
-
return data.sectionDataBindingItems.map((item) => item.data).filter(Boolean);
|
|
4188
|
+
return data.sectionDataBindingItems.sort((a, b) => (a.sortOrder || 0) - (b.sortOrder || 0)).map((item) => item.data).filter(Boolean);
|
|
4188
4189
|
}
|
|
4189
4190
|
return [];
|
|
4190
4191
|
}, [data]);
|
|
@@ -4263,9 +4264,9 @@ const FaqSection = ({ data, t, isDarkMode, section }) => {
|
|
|
4263
4264
|
] });
|
|
4264
4265
|
};
|
|
4265
4266
|
const PageHighlightSection = ({ data, t, isDarkMode, imageBaseUrl = "" }) => {
|
|
4266
|
-
var _a;
|
|
4267
|
+
var _a, _b;
|
|
4267
4268
|
const [activeTab, setActiveTab] = useState(0);
|
|
4268
|
-
const rawData = ((_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.filter((item) => item == null ? void 0 : item.data).map((item) => item.data)) || [];
|
|
4269
|
+
const rawData = ((_b = (_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.filter((item) => item == null ? void 0 : item.data)) == null ? void 0 : _b.sort((a, b) => (a.sortOrder || 0) - (b.sortOrder || 0)).map((item) => item.data)) || [];
|
|
4269
4270
|
const getImageUrl = (imagePath) => {
|
|
4270
4271
|
if (imagePath) {
|
|
4271
4272
|
return `${imageBaseUrl}${imagePath}`;
|
|
@@ -4273,8 +4274,8 @@ const PageHighlightSection = ({ data, t, isDarkMode, imageBaseUrl = "" }) => {
|
|
|
4273
4274
|
return null;
|
|
4274
4275
|
};
|
|
4275
4276
|
const highlightData = rawData.map((item) => {
|
|
4276
|
-
var _a2,
|
|
4277
|
-
const mainImagePath = ((
|
|
4277
|
+
var _a2, _b2, _c, _d, _e, _f;
|
|
4278
|
+
const mainImagePath = ((_b2 = (_a2 = item.pageImages) == null ? void 0 : _a2.find((img) => img.isMain)) == null ? void 0 : _b2.url) || ((_d = (_c = item.pageImages) == null ? void 0 : _c[0]) == null ? void 0 : _d.url) || null;
|
|
4278
4279
|
const mainImage = getImageUrl(mainImagePath);
|
|
4279
4280
|
const primaryTag = ((_f = (_e = item.tagKeys) == null ? void 0 : _e[0]) == null ? void 0 : _f.key) || item.title;
|
|
4280
4281
|
return {
|
|
@@ -4492,8 +4493,8 @@ const PageHighlightSection = ({ data, t, isDarkMode, imageBaseUrl = "" }) => {
|
|
|
4492
4493
|
);
|
|
4493
4494
|
};
|
|
4494
4495
|
const PageChildrenSelectSection = ({ data, isDarkMode, t, section, imageBaseUrl = "" }) => {
|
|
4495
|
-
var _a;
|
|
4496
|
-
const pages = ((_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.map((item) => item.data).filter(Boolean)) || [];
|
|
4496
|
+
var _a, _b;
|
|
4497
|
+
const pages = ((_b = (_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.sort((a, b) => (a.sortOrder || 0) - (b.sortOrder || 0))) == null ? void 0 : _b.map((item) => item.data).filter(Boolean)) || [];
|
|
4497
4498
|
const sectionTitle = (section == null ? void 0 : section.title) || "";
|
|
4498
4499
|
const sectionDescription = (section == null ? void 0 : section.description) || "";
|
|
4499
4500
|
const [visibleCount, setVisibleCount] = useState(8);
|
|
@@ -4599,8 +4600,8 @@ const PageChildrenSelectSection = ({ data, isDarkMode, t, section, imageBaseUrl
|
|
|
4599
4600
|
] }) });
|
|
4600
4601
|
};
|
|
4601
4602
|
const PageChildrenSelectSection1 = ({ data, isDarkMode, t, section, imageBaseUrl = "" }) => {
|
|
4602
|
-
var _a;
|
|
4603
|
-
const pages = ((_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.map((item) => item.data).filter(Boolean)) || [];
|
|
4603
|
+
var _a, _b;
|
|
4604
|
+
const pages = ((_b = (_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.sort((a, b) => (a.sortOrder || 0) - (b.sortOrder || 0))) == null ? void 0 : _b.map((item) => item.data).filter(Boolean)) || [];
|
|
4604
4605
|
const sectionTitle = (section == null ? void 0 : section.title) || "";
|
|
4605
4606
|
const [visibleCount, setVisibleCount] = useState(5);
|
|
4606
4607
|
const visiblePages = pages.slice(0, visibleCount);
|
|
@@ -4626,8 +4627,8 @@ const PageChildrenSelectSection1 = ({ data, isDarkMode, t, section, imageBaseUrl
|
|
|
4626
4627
|
flexDirection: "column",
|
|
4627
4628
|
gap: "24px"
|
|
4628
4629
|
}, children: visiblePages.map((page) => {
|
|
4629
|
-
var _a2,
|
|
4630
|
-
const mainImage = ((
|
|
4630
|
+
var _a2, _b2, _c;
|
|
4631
|
+
const mainImage = ((_b2 = (_a2 = page.pageImages) == null ? void 0 : _a2.find((img) => img.isMain)) == null ? void 0 : _b2.url) || page.icon;
|
|
4631
4632
|
const imageUrl = getImageUrl(mainImage);
|
|
4632
4633
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
4633
4634
|
"a",
|
|
@@ -4699,8 +4700,8 @@ const PageChildrenSelectSection1 = ({ data, isDarkMode, t, section, imageBaseUrl
|
|
|
4699
4700
|
] }) });
|
|
4700
4701
|
};
|
|
4701
4702
|
const PageChildrenSelectSection2 = ({ data, isDarkMode, t, section, imageBaseUrl = "" }) => {
|
|
4702
|
-
var _a;
|
|
4703
|
-
const pages = ((_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.map((item) => item.data).filter(Boolean)) || [];
|
|
4703
|
+
var _a, _b;
|
|
4704
|
+
const pages = ((_b = (_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.sort((a, b) => (a.sortOrder || 0) - (b.sortOrder || 0))) == null ? void 0 : _b.map((item) => item.data).filter(Boolean)) || [];
|
|
4704
4705
|
const sectionTitle = (section == null ? void 0 : section.title) || "";
|
|
4705
4706
|
const [visibleCount, setVisibleCount] = useState(6);
|
|
4706
4707
|
if (!pages || pages.length === 0) {
|
|
@@ -4727,8 +4728,8 @@ const PageChildrenSelectSection2 = ({ data, isDarkMode, t, section, imageBaseUrl
|
|
|
4727
4728
|
gap: "30px",
|
|
4728
4729
|
marginBottom: "50px"
|
|
4729
4730
|
}, children: visiblePages.map((page) => {
|
|
4730
|
-
var _a2,
|
|
4731
|
-
const mainImage = ((
|
|
4731
|
+
var _a2, _b2;
|
|
4732
|
+
const mainImage = ((_b2 = (_a2 = page.pageImages) == null ? void 0 : _a2.find((img) => img.isMain)) == null ? void 0 : _b2.url) || page.icon;
|
|
4732
4733
|
const imageUrl = getImageUrl(mainImage);
|
|
4733
4734
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
4734
4735
|
"a",
|