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.
@@ -649,8 +649,8 @@ var __async = (__this, __arguments, generator) => {
649
649
  ] });
650
650
  };
651
651
  const TimelineSection = ({ data, t, section }) => {
652
- var _a, _b;
653
- 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)) || [];
652
+ var _a, _b, _c;
653
+ 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)) || [];
654
654
  const [timelineVisible, setTimelineVisible] = require$$0.useState([]);
655
655
  const timelineRefs = require$$0.useRef([]);
656
656
  const sectionTitle = (section == null ? void 0 : section.title) || "Timeline";
@@ -860,8 +860,8 @@ var __async = (__this, __arguments, generator) => {
860
860
  return width;
861
861
  }
862
862
  const PartnersSection = ({ data, t, imageBaseUrl = "", section }) => {
863
- var _a, _b;
864
- 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)) || [];
863
+ var _a, _b, _c;
864
+ 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)) || [];
865
865
  const [currentPartnerSlide, setCurrentPartnerSlide] = require$$0.useState(0);
866
866
  const [partnersVisible, setPartnersVisible] = require$$0.useState(false);
867
867
  const partnersRef = require$$0.useRef(null);
@@ -959,7 +959,7 @@ var __async = (__this, __arguments, generator) => {
959
959
  const sectionTitle = (section == null ? void 0 : section.title) || "...";
960
960
  require$$0.useEffect(() => {
961
961
  const fetchMilestones = () => __async(null, null, function* () {
962
- var _a, _b;
962
+ var _a, _b, _c;
963
963
  if (getMilestoneTimeline) {
964
964
  try {
965
965
  setLoading(true);
@@ -972,7 +972,7 @@ var __async = (__this, __arguments, generator) => {
972
972
  setLoading(false);
973
973
  }
974
974
  } else {
975
- 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)) || [];
975
+ 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)) || [];
976
976
  setMilestones(milestonesData);
977
977
  setLoading(false);
978
978
  }
@@ -1043,16 +1043,16 @@ var __async = (__this, __arguments, generator) => {
1043
1043
  ] }) });
1044
1044
  };
1045
1045
  const TestimonialsSection = ({ data, t, section }) => {
1046
- var _a, _b;
1046
+ var _a, _b, _c;
1047
1047
  const [currentIndex, setCurrentIndex] = require$$0.useState(0);
1048
1048
  const [isTransitioning, setIsTransitioning] = require$$0.useState(false);
1049
1049
  const sectionTitle = (section == null ? void 0 : section.title) || t("testimonials.sectionTitle") || "Cảm nhận khách hàng";
1050
- 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) => {
1051
- var _a2, _b2, _c, _d;
1050
+ 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) => {
1051
+ var _a2, _b2, _c2, _d;
1052
1052
  return {
1053
1053
  quote: ((_a2 = item.data) == null ? void 0 : _a2.content) || "",
1054
1054
  author: ((_b2 = item.data) == null ? void 0 : _b2.customerName) || "",
1055
- position: ((_c = item.data) == null ? void 0 : _c.customerTitle) || "",
1055
+ position: ((_c2 = item.data) == null ? void 0 : _c2.customerTitle) || "",
1056
1056
  company: ((_d = item.data) == null ? void 0 : _d.customerCompany) || ""
1057
1057
  };
1058
1058
  })) || [];
@@ -1741,8 +1741,8 @@ var __async = (__this, __arguments, generator) => {
1741
1741
  ] }) }) }) }) });
1742
1742
  };
1743
1743
  const ContactInfoSection = ({ data, t, isDarkMode, section }) => {
1744
- var _a, _b;
1745
- 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)) || [];
1744
+ var _a, _b, _c;
1745
+ 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)) || [];
1746
1746
  const sectionTitle = (section == null ? void 0 : section.title) || "...";
1747
1747
  if (!contactData.length) return null;
1748
1748
  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: [
@@ -2379,9 +2379,9 @@ var __async = (__this, __arguments, generator) => {
2379
2379
  );
2380
2380
  };
2381
2381
  const TextWithTitleSection = ({ section, data, isDarkMode }) => {
2382
- var _a;
2383
- const textItems = (data == null ? void 0 : data.sectionDataBindingItems) || [];
2384
- const title = ((_a = textItems[0]) == null ? void 0 : _a.value) || "";
2382
+ var _a, _b;
2383
+ const textItems = ((_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.sort((a, b) => (a.sortOrder || 0) - (b.sortOrder || 0))) || [];
2384
+ const title = ((_b = textItems[0]) == null ? void 0 : _b.value) || "";
2385
2385
  const descriptions = textItems.slice(1);
2386
2386
  return /* @__PURE__ */ jsxRuntimeExports.jsx(SectionWrapper, { isDarkMode, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-6xl mx-auto", children: [
2387
2387
  title && /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-title font-black mb-4 leading-tight text-left text-main", children: title }),
@@ -2396,7 +2396,8 @@ var __async = (__this, __arguments, generator) => {
2396
2396
  ] }) });
2397
2397
  };
2398
2398
  const TextSection = ({ data, isDarkMode }) => {
2399
- const textItems = (data == null ? void 0 : data.sectionDataBindingItems) || [];
2399
+ var _a;
2400
+ const textItems = ((_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.sort((a, b) => (a.sortOrder || 0) - (b.sortOrder || 0))) || [];
2400
2401
  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(
2401
2402
  "div",
2402
2403
  {
@@ -4187,7 +4188,7 @@ var __async = (__this, __arguments, generator) => {
4187
4188
  const [activeIndex, setActiveIndex] = require$$0.useState(-1);
4188
4189
  const faqs = require$$0.useMemo(() => {
4189
4190
  if ((data == null ? void 0 : data.sectionDataBindingItems) && Array.isArray(data.sectionDataBindingItems)) {
4190
- return data.sectionDataBindingItems.map((item) => item.data).filter(Boolean);
4191
+ return data.sectionDataBindingItems.sort((a, b) => (a.sortOrder || 0) - (b.sortOrder || 0)).map((item) => item.data).filter(Boolean);
4191
4192
  }
4192
4193
  return [];
4193
4194
  }, [data]);
@@ -4266,9 +4267,9 @@ var __async = (__this, __arguments, generator) => {
4266
4267
  ] });
4267
4268
  };
4268
4269
  const PageHighlightSection = ({ data, t, isDarkMode, imageBaseUrl = "" }) => {
4269
- var _a;
4270
+ var _a, _b;
4270
4271
  const [activeTab, setActiveTab] = require$$0.useState(0);
4271
- 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)) || [];
4272
+ 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)) || [];
4272
4273
  const getImageUrl = (imagePath) => {
4273
4274
  if (imagePath) {
4274
4275
  return `${imageBaseUrl}${imagePath}`;
@@ -4276,8 +4277,8 @@ var __async = (__this, __arguments, generator) => {
4276
4277
  return null;
4277
4278
  };
4278
4279
  const highlightData = rawData.map((item) => {
4279
- var _a2, _b, _c, _d, _e, _f;
4280
- const mainImagePath = ((_b = (_a2 = item.pageImages) == null ? void 0 : _a2.find((img) => img.isMain)) == null ? void 0 : _b.url) || ((_d = (_c = item.pageImages) == null ? void 0 : _c[0]) == null ? void 0 : _d.url) || null;
4280
+ var _a2, _b2, _c, _d, _e, _f;
4281
+ 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;
4281
4282
  const mainImage = getImageUrl(mainImagePath);
4282
4283
  const primaryTag = ((_f = (_e = item.tagKeys) == null ? void 0 : _e[0]) == null ? void 0 : _f.key) || item.title;
4283
4284
  return {
@@ -4495,8 +4496,8 @@ var __async = (__this, __arguments, generator) => {
4495
4496
  );
4496
4497
  };
4497
4498
  const PageChildrenSelectSection = ({ data, isDarkMode, t, section, imageBaseUrl = "" }) => {
4498
- var _a;
4499
- const pages = ((_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.map((item) => item.data).filter(Boolean)) || [];
4499
+ var _a, _b;
4500
+ 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)) || [];
4500
4501
  const sectionTitle = (section == null ? void 0 : section.title) || "";
4501
4502
  const sectionDescription = (section == null ? void 0 : section.description) || "";
4502
4503
  const [visibleCount, setVisibleCount] = require$$0.useState(8);
@@ -4602,8 +4603,8 @@ var __async = (__this, __arguments, generator) => {
4602
4603
  ] }) });
4603
4604
  };
4604
4605
  const PageChildrenSelectSection1 = ({ data, isDarkMode, t, section, imageBaseUrl = "" }) => {
4605
- var _a;
4606
- const pages = ((_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.map((item) => item.data).filter(Boolean)) || [];
4606
+ var _a, _b;
4607
+ 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)) || [];
4607
4608
  const sectionTitle = (section == null ? void 0 : section.title) || "";
4608
4609
  const [visibleCount, setVisibleCount] = require$$0.useState(5);
4609
4610
  const visiblePages = pages.slice(0, visibleCount);
@@ -4629,8 +4630,8 @@ var __async = (__this, __arguments, generator) => {
4629
4630
  flexDirection: "column",
4630
4631
  gap: "24px"
4631
4632
  }, children: visiblePages.map((page) => {
4632
- var _a2, _b, _c;
4633
- const mainImage = ((_b = (_a2 = page.pageImages) == null ? void 0 : _a2.find((img) => img.isMain)) == null ? void 0 : _b.url) || page.icon;
4633
+ var _a2, _b2, _c;
4634
+ const mainImage = ((_b2 = (_a2 = page.pageImages) == null ? void 0 : _a2.find((img) => img.isMain)) == null ? void 0 : _b2.url) || page.icon;
4634
4635
  const imageUrl = getImageUrl(mainImage);
4635
4636
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
4636
4637
  "a",
@@ -4702,8 +4703,8 @@ var __async = (__this, __arguments, generator) => {
4702
4703
  ] }) });
4703
4704
  };
4704
4705
  const PageChildrenSelectSection2 = ({ data, isDarkMode, t, section, imageBaseUrl = "" }) => {
4705
- var _a;
4706
- const pages = ((_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.map((item) => item.data).filter(Boolean)) || [];
4706
+ var _a, _b;
4707
+ 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)) || [];
4707
4708
  const sectionTitle = (section == null ? void 0 : section.title) || "";
4708
4709
  const [visibleCount, setVisibleCount] = require$$0.useState(6);
4709
4710
  if (!pages || pages.length === 0) {
@@ -4730,8 +4731,8 @@ var __async = (__this, __arguments, generator) => {
4730
4731
  gap: "30px",
4731
4732
  marginBottom: "50px"
4732
4733
  }, children: visiblePages.map((page) => {
4733
- var _a2, _b;
4734
- const mainImage = ((_b = (_a2 = page.pageImages) == null ? void 0 : _a2.find((img) => img.isMain)) == null ? void 0 : _b.url) || page.icon;
4734
+ var _a2, _b2;
4735
+ const mainImage = ((_b2 = (_a2 = page.pageImages) == null ? void 0 : _a2.find((img) => img.isMain)) == null ? void 0 : _b2.url) || page.icon;
4735
4736
  const imageUrl = getImageUrl(mainImage);
4736
4737
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
4737
4738
  "a",