tabexseriescomponents 0.0.173 → 0.0.175

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.cjs.js CHANGED
@@ -72,6 +72,9 @@ var reactIntersectionObserver = require('react-intersection-observer');
72
72
  var FaArrowAltCircleRight = require('@react-icons/all-files/fa/FaArrowAltCircleRight');
73
73
  var FaArrowAltCircleLeft = require('@react-icons/all-files/fa/FaArrowAltCircleLeft');
74
74
  var FiFilter = require('@react-icons/all-files/fi/FiFilter');
75
+ var FiChevronLeft = require('@react-icons/all-files/fi/FiChevronLeft');
76
+ var FiChevronRight = require('@react-icons/all-files/fi/FiChevronRight');
77
+ var ReactPaginate = require('react-paginate');
75
78
  var MdKeyboardArrowDown = require('@react-icons/all-files/md/MdKeyboardArrowDown');
76
79
  var FaMoneyBillWave = require('@react-icons/all-files/fa/FaMoneyBillWave');
77
80
  var BiLogOutCircle = require('@react-icons/all-files/bi/BiLogOutCircle');
@@ -158,6 +161,7 @@ var ImageGallery__default = /*#__PURE__*/_interopDefaultLegacy(ImageGallery);
158
161
  var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
159
162
  var TextareaAutosize__default = /*#__PURE__*/_interopDefaultLegacy(TextareaAutosize);
160
163
  var Dropdown__default = /*#__PURE__*/_interopDefaultLegacy(Dropdown);
164
+ var ReactPaginate__default = /*#__PURE__*/_interopDefaultLegacy(ReactPaginate);
161
165
  var Select__default = /*#__PURE__*/_interopDefaultLegacy(Select$2);
162
166
  var ReactPlayer__default = /*#__PURE__*/_interopDefaultLegacy(ReactPlayer);
163
167
  var BackgroundSlideshow__default = /*#__PURE__*/_interopDefaultLegacy(BackgroundSlideshow);
@@ -432,7 +436,8 @@ var ProductsCardsSectionContext_Provider = function ProductsCardsSectionContext_
432
436
  grouptype: '',
433
437
  grouptyperefid: '',
434
438
  sortprice: '',
435
- sortdates: ''
439
+ sortdates: '',
440
+ page: 0
436
441
  }),
437
442
  _useState4 = _slicedToArray__default["default"](_useState3, 2),
438
443
  ProductFilterObjContext = _useState4[0],
@@ -9207,9 +9212,10 @@ var Filter$1 = function Filter(props) {
9207
9212
  function ownKeys$1B(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9208
9213
  function _objectSpread$1B(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1B(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1B(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
9209
9214
  var CardsSection = function CardsSection(props) {
9210
- var _useInView = reactIntersectionObserver.useInView(),
9211
- ref = _useInView.ref,
9212
- inView = _useInView.inView;
9215
+ var refscr = /*#__PURE__*/React.createRef();
9216
+ var _useInView = reactIntersectionObserver.useInView();
9217
+ _useInView.ref;
9218
+ _useInView.inView;
9213
9219
  var StatePagePropertiesContext = props.actions.StatePagePropertiesContext;
9214
9220
  props.actions.lang;
9215
9221
  var langdetect = props.actions.langdetect;
@@ -9259,11 +9265,11 @@ var CardsSection = function CardsSection(props) {
9259
9265
  _useState12 = _slicedToArray__default["default"](_useState11, 2),
9260
9266
  maincontainerarrayofobjs = _useState12[0],
9261
9267
  setmaincontainerarrayofobjs = _useState12[1];
9262
- React__default["default"].useEffect(function () {
9263
- if (inView) {
9264
- fetchProductsQuery.fetchNextPage();
9265
- }
9266
- }, [inView]);
9268
+ // React.useEffect(() => {
9269
+ // if (inView) {
9270
+ // fetchProductsQuery.fetchNextPage();
9271
+ // }
9272
+ // }, [inView]);
9267
9273
  React.useEffect(function () {
9268
9274
  StatePagePropertiesContext.pageobj.sections.forEach(function (sectionitem, sectionindex) {
9269
9275
  if (sectionitem.sectionid == props.sectionidprops) {
@@ -9304,11 +9310,15 @@ var CardsSection = function CardsSection(props) {
9304
9310
  }
9305
9311
  } else if (fetchingtype == 'products') {
9306
9312
  if (fetchProductsQuery.isSuccess) {
9313
+ var _fetchProductsQuery$d, _fetchProductsQuery$d2, _fetchProductsQuery$d3;
9307
9314
  var allpagesarr = [];
9308
- fetchProductsQuery.data.pages.forEach(function (page) {
9309
- page.data.products.forEach(function (productobj) {
9310
- allpagesarr.push(productobj);
9311
- });
9315
+ // fetchProductsQuery.data.pages.forEach((page) => {
9316
+ // page.data.products.forEach((productobj) => {
9317
+ // allpagesarr.push(productobj);
9318
+ // });
9319
+ // });
9320
+ fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : (_fetchProductsQuery$d = fetchProductsQuery.data) === null || _fetchProductsQuery$d === void 0 ? void 0 : (_fetchProductsQuery$d2 = _fetchProductsQuery$d.data) === null || _fetchProductsQuery$d2 === void 0 ? void 0 : (_fetchProductsQuery$d3 = _fetchProductsQuery$d2.products) === null || _fetchProductsQuery$d3 === void 0 ? void 0 : _fetchProductsQuery$d3.forEach(function (item) {
9321
+ allpagesarr.push(item);
9312
9322
  });
9313
9323
  cardobjassigner(allpagesarr);
9314
9324
  }
@@ -9416,11 +9426,15 @@ var CardsSection = function CardsSection(props) {
9416
9426
  React.useEffect(function () {
9417
9427
  if (fetchingtype == 'products') {
9418
9428
  if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
9429
+ var _fetchProductsQuery$d4, _fetchProductsQuery$d5, _fetchProductsQuery$d6;
9419
9430
  var allpagesarr = [];
9420
- fetchProductsQuery.data.pages.forEach(function (page) {
9421
- page.data.products.forEach(function (productobj) {
9422
- allpagesarr.push(productobj);
9423
- });
9431
+ // fetchProductsQuery.data.pages.forEach((page) => {
9432
+ // page.data.products.forEach((productobj) => {
9433
+ // allpagesarr.push(productobj);
9434
+ // });
9435
+ // });
9436
+ fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : (_fetchProductsQuery$d4 = fetchProductsQuery.data) === null || _fetchProductsQuery$d4 === void 0 ? void 0 : (_fetchProductsQuery$d5 = _fetchProductsQuery$d4.data) === null || _fetchProductsQuery$d5 === void 0 ? void 0 : (_fetchProductsQuery$d6 = _fetchProductsQuery$d5.products) === null || _fetchProductsQuery$d6 === void 0 ? void 0 : _fetchProductsQuery$d6.forEach(function (item) {
9437
+ allpagesarr.push(item);
9424
9438
  });
9425
9439
  cardobjassigner(allpagesarr);
9426
9440
  }
@@ -9548,7 +9562,142 @@ var CardsSection = function CardsSection(props) {
9548
9562
  });
9549
9563
  setcardsarray([].concat(temparray));
9550
9564
  };
9565
+ // Example items, to simulate fetching from another resources.
9566
+
9567
+ var handlePageClick = function handlePageClick(event) {
9568
+ props.scrolltotop();
9569
+ var tempProductFilterObjContext = _objectSpread$1B({}, ProductFilterObjContext);
9570
+ tempProductFilterObjContext.page = event === null || event === void 0 ? void 0 : event.selected;
9571
+ setProductFilterObjContext(_objectSpread$1B({}, tempProductFilterObjContext));
9572
+ };
9573
+ function PaginatedItems(_ref) {
9574
+ var _fetchProductsQuery$d7, _fetchProductsQuery$d8, _fetchProductsQuery$d9, _fetchProductsQuery$d10;
9575
+ _ref.itemsPerPage;
9576
+ // Here we use item offsets; we could also use page offsets
9577
+ // following the API or data you're working with.
9578
+ var _useState13 = React.useState(0),
9579
+ _useState14 = _slicedToArray__default["default"](_useState13, 2);
9580
+ _useState14[0];
9581
+ _useState14[1];
9582
+
9583
+ // const currentItems = items.slice(itemOffset, endOffset);
9584
+ // const pageCount = Math.ceil(items.length / itemsPerPage);
9585
+ var pageCount = Math.ceil((fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : (_fetchProductsQuery$d7 = fetchProductsQuery.data) === null || _fetchProductsQuery$d7 === void 0 ? void 0 : (_fetchProductsQuery$d8 = _fetchProductsQuery$d7.data) === null || _fetchProductsQuery$d8 === void 0 ? void 0 : _fetchProductsQuery$d8.productscou) / 12);
9586
+ //
9587
+
9588
+ // Invoke when user click to request another page.
9589
+
9590
+ return /*#__PURE__*/React__default["default"].createElement("div", {
9591
+ "class": "d-flex containerClassName"
9592
+ }, /*#__PURE__*/React__default["default"].createElement(ReactPaginate__default["default"], {
9593
+ breakLabel: "...",
9594
+ forcePage: fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : (_fetchProductsQuery$d9 = fetchProductsQuery.data) === null || _fetchProductsQuery$d9 === void 0 ? void 0 : (_fetchProductsQuery$d10 = _fetchProductsQuery$d9.data) === null || _fetchProductsQuery$d10 === void 0 ? void 0 : _fetchProductsQuery$d10.page,
9595
+ nextLabel: /*#__PURE__*/React__default["default"].createElement(FiChevronRight.FiChevronRight, {
9596
+ size: parseInt(sectionproperties.paginationFontSize) + 3
9597
+ }),
9598
+ onPageChange: handlePageClick,
9599
+ active: true,
9600
+ pageRangeDisplayed: 5,
9601
+ pageCount: pageCount,
9602
+ previousLabel: /*#__PURE__*/React__default["default"].createElement(FiChevronLeft.FiChevronLeft, {
9603
+ size: parseInt(sectionproperties.paginationFontSize) + 3
9604
+ }),
9605
+ renderOnZeroPageCount: null,
9606
+ pageLinkClassName: section_cssstyles.pageLinkClassName,
9607
+ nextLinkClassName: section_cssstyles.nextLinkClassName,
9608
+ previousLinkClassName: section_cssstyles.previousLinkClassName,
9609
+ activeClassName: section_cssstyles.activeClassName,
9610
+ activeLinkClassName: section_cssstyles.activeLinkClassName,
9611
+ previousClassName: section_cssstyles.previousClassName,
9612
+ nextClassName: section_cssstyles.nextClassName,
9613
+ disabledClassName: section_cssstyles.disabledClassName,
9614
+ disabledLinkClassName: section_cssstyles.disabledLinkClassName
9615
+ }));
9616
+ }
9551
9617
  var section_cssstyles = {
9618
+ disabledClassName: glamor.css({
9619
+ cursor: 'not-allowed',
9620
+ ':hover': {
9621
+ cursor: 'not-allowed',
9622
+ color: sectionproperties.paginationColor
9623
+ }
9624
+ }),
9625
+ disabledLinkClassName: glamor.css({
9626
+ cursor: 'not-allowed',
9627
+ ':hover': {
9628
+ cursor: 'not-allowed',
9629
+ color: sectionproperties.paginationColor
9630
+ }
9631
+ }),
9632
+ pageLinkClassName: glamor.css({
9633
+ minWidth: sectionproperties.paginationContainerWidth + 'vh',
9634
+ height: sectionproperties.paginationContainerHeight + 'vh',
9635
+ padding: '17px',
9636
+ display: 'flex',
9637
+ alignItems: 'center',
9638
+ justifyContent: 'center',
9639
+ color: sectionproperties.paginationColor,
9640
+ border: sectionproperties.paginationBorderWidth + 'px solid ' + sectionproperties.paginationBorderColor,
9641
+ transition: '.3s',
9642
+ ':hover': {
9643
+ color: sectionproperties.paginationColoronHover,
9644
+ borderColor: sectionproperties.paginationColoronHover
9645
+ }
9646
+ }),
9647
+ activeClassName: glamor.css({
9648
+ color: sectionproperties.paginationActiveColor,
9649
+ borderColor: sectionproperties.paginationActiveColor
9650
+ }),
9651
+ activeLinkClassName: glamor.css({
9652
+ color: sectionproperties.paginationActiveColor,
9653
+ borderColor: sectionproperties.paginationActiveColor
9654
+ }),
9655
+ previousClassName: glamor.css({
9656
+ width: sectionproperties.paginationContainerWidth + 'vh',
9657
+ height: sectionproperties.paginationContainerHeight + 'vh',
9658
+ padding: '17px',
9659
+ display: 'flex',
9660
+ alignItems: 'center',
9661
+ justifyContent: 'center',
9662
+ color: sectionproperties.paginationColor,
9663
+ border: sectionproperties.paginationBorderWidth + 'px solid ' + sectionproperties.paginationBorderColor,
9664
+ transition: '.3s',
9665
+ ':hover': {
9666
+ color: sectionproperties.paginationColoronHover,
9667
+ borderColor: sectionproperties.paginationColoronHover
9668
+ }
9669
+ }),
9670
+ nextClassName: glamor.css({
9671
+ width: sectionproperties.paginationContainerWidth + 'vh',
9672
+ height: sectionproperties.paginationContainerHeight + 'vh',
9673
+ padding: '17px',
9674
+ display: 'flex',
9675
+ alignItems: 'center',
9676
+ justifyContent: 'center',
9677
+ color: sectionproperties.paginationColor,
9678
+ border: sectionproperties.paginationBorderWidth + 'px solid ' + sectionproperties.paginationBorderColor,
9679
+ transition: '.3s',
9680
+ ':hover': {
9681
+ color: sectionproperties.paginationColoronHover,
9682
+ borderColor: sectionproperties.paginationColoronHover
9683
+ }
9684
+ }),
9685
+ previousLinkClassName: glamor.css({
9686
+ fontSize: sectionproperties.paginationFontSize + 'px',
9687
+ color: sectionproperties.paginationColor,
9688
+ transition: '.3s',
9689
+ ':hover': {
9690
+ color: sectionproperties.paginationColoronHover
9691
+ }
9692
+ }),
9693
+ nextLinkClassName: glamor.css({
9694
+ fontSize: sectionproperties.paginationFontSize + 'px',
9695
+ color: sectionproperties.paginationColor,
9696
+ transition: '.3s',
9697
+ ':hover': {
9698
+ color: sectionproperties.paginationColoronHover
9699
+ }
9700
+ }),
9552
9701
  sectiontitlespan: glamor.css({
9553
9702
  ':after': {
9554
9703
  height: '5px',
@@ -9812,19 +9961,7 @@ var CardsSection = function CardsSection(props) {
9812
9961
  actions: actions,
9813
9962
  fontFamilyprops: sectionproperties.sectiontitlefontfamily == 'ASUL' ? 'ASUL' : ''
9814
9963
  }));
9815
- }), fetchingtype == 'products' && fetchProductsQuery.isFetchingNextPage && /*#__PURE__*/React__default["default"].createElement("button", {
9816
- className: section_cssstyles.loadbtn + ' d-flex justify-content-end align-items-center mt-4 ',
9817
- ref: ref,
9818
- onClick: function onClick() {
9819
- return fetchProductsQuery.fetchNextPage();
9820
- },
9821
- disabled: !fetchProductsQuery.hasNextPage || fetchProductsQuery.isFetchingNextPage
9822
- }, /*#__PURE__*/React__default["default"].createElement(reactCssfxLoading.CircularProgress, {
9823
- color: "#000",
9824
- width: "20px",
9825
- height: "20px",
9826
- duration: "1s"
9827
- })))), sectionproperties.view_as_slider_vertical != 'Slider (Horizontal)' && /*#__PURE__*/React__default["default"].createElement("div", {
9964
+ }))), sectionproperties.view_as_slider_vertical != 'Slider (Horizontal)' && /*#__PURE__*/React__default["default"].createElement("div", {
9828
9965
  className: "row m-0 w-100 d-flex ",
9829
9966
  style: {
9830
9967
  justifyContent: sectionproperties.justifyContentCenter == 'Centered' ? 'center' : 'start'
@@ -9844,30 +9981,15 @@ var CardsSection = function CardsSection(props) {
9844
9981
  }));
9845
9982
  }), fetchingtype == 'products' && /*#__PURE__*/React__default["default"].createElement("div", {
9846
9983
  className: "w-100 col-lg-12 allcentered mt-2"
9847
- }, /*#__PURE__*/React__default["default"].createElement("button", {
9848
- className: section_cssstyles.loadbtn + ' d-flex justify-content-end align-items-center '
9849
- // ref={ref}
9850
- ,
9851
- onClick: function onClick() {
9852
- return fetchProductsQuery.fetchNextPage();
9853
- },
9854
- disabled: !fetchProductsQuery.hasNextPage || fetchProductsQuery.isFetchingNextPage
9855
- }, fetchProductsQuery.isFetchingNextPage ? /*#__PURE__*/React__default["default"].createElement(reactCssfxLoading.CircularProgress, {
9856
- color: "#000",
9857
- width: "20px",
9858
- height: "20px",
9859
- duration: "1s"
9860
- }) : fetchProductsQuery.hasNextPage ? langdetect == 'en' ? 'Load more' : 'المزيد' : /*#__PURE__*/React__default["default"].createElement(reactCssfxLoading.CircularProgress, {
9861
- color: "#000",
9862
- width: "20px",
9863
- height: "20px",
9864
- duration: "1s"
9865
- })))));
9984
+ }, /*#__PURE__*/React__default["default"].createElement(PaginatedItems, {
9985
+ itemsPerPage: 5
9986
+ }))));
9866
9987
  }
9867
9988
  }
9868
9989
  }))));
9869
9990
  };
9870
9991
  return /*#__PURE__*/React__default["default"].createElement("div", {
9992
+ ref: refscr,
9871
9993
  "class": ' row m-0 d-flex justify-content-center ml-auto mr-auto w-md-100 w-sm-100 ',
9872
9994
  style: {
9873
9995
  zIndex: 2,
@@ -28745,11 +28867,10 @@ var CardsSection2 = function CardsSection2(props) {
28745
28867
  }
28746
28868
  } else if (fetchingtype == 'products') {
28747
28869
  if (fetchProductsQuery.isSuccess) {
28870
+ var _fetchProductsQuery$d, _fetchProductsQuery$d2, _fetchProductsQuery$d3;
28748
28871
  var allpagesarr = [];
28749
- fetchProductsQuery.data.pages.forEach(function (page) {
28750
- page.data.products.forEach(function (productobj) {
28751
- allpagesarr.push(productobj);
28752
- });
28872
+ fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : (_fetchProductsQuery$d = fetchProductsQuery.data) === null || _fetchProductsQuery$d === void 0 ? void 0 : (_fetchProductsQuery$d2 = _fetchProductsQuery$d.data) === null || _fetchProductsQuery$d2 === void 0 ? void 0 : (_fetchProductsQuery$d3 = _fetchProductsQuery$d2.products) === null || _fetchProductsQuery$d3 === void 0 ? void 0 : _fetchProductsQuery$d3.forEach(function (item) {
28873
+ allpagesarr.push(item);
28753
28874
  });
28754
28875
  cardobjassigner(allpagesarr);
28755
28876
  }
@@ -28781,11 +28902,10 @@ var CardsSection2 = function CardsSection2(props) {
28781
28902
  React.useEffect(function () {
28782
28903
  if (fetchingtype == 'products') {
28783
28904
  if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
28905
+ var _fetchProductsQuery$d4, _fetchProductsQuery$d5, _fetchProductsQuery$d6;
28784
28906
  var allpagesarr = [];
28785
- fetchProductsQuery.data.pages.forEach(function (page) {
28786
- page.data.products.forEach(function (productobj) {
28787
- allpagesarr.push(productobj);
28788
- });
28907
+ fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : (_fetchProductsQuery$d4 = fetchProductsQuery.data) === null || _fetchProductsQuery$d4 === void 0 ? void 0 : (_fetchProductsQuery$d5 = _fetchProductsQuery$d4.data) === null || _fetchProductsQuery$d5 === void 0 ? void 0 : (_fetchProductsQuery$d6 = _fetchProductsQuery$d5.products) === null || _fetchProductsQuery$d6 === void 0 ? void 0 : _fetchProductsQuery$d6.forEach(function (item) {
28908
+ allpagesarr.push(item);
28789
28909
  });
28790
28910
  cardobjassigner(allpagesarr);
28791
28911
  }
@@ -29140,11 +29260,10 @@ var Sixverticalcardssection = function Sixverticalcardssection(props) {
29140
29260
  }
29141
29261
  } else if (fetchingtype == 'products') {
29142
29262
  if (fetchProductsQuery.isSuccess) {
29263
+ var _fetchProductsQuery$d, _fetchProductsQuery$d2, _fetchProductsQuery$d3;
29143
29264
  var allpagesarr = [];
29144
- fetchProductsQuery.data.pages.forEach(function (page) {
29145
- page.data.products.forEach(function (productobj) {
29146
- allpagesarr.push(productobj);
29147
- });
29265
+ fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : (_fetchProductsQuery$d = fetchProductsQuery.data) === null || _fetchProductsQuery$d === void 0 ? void 0 : (_fetchProductsQuery$d2 = _fetchProductsQuery$d.data) === null || _fetchProductsQuery$d2 === void 0 ? void 0 : (_fetchProductsQuery$d3 = _fetchProductsQuery$d2.products) === null || _fetchProductsQuery$d3 === void 0 ? void 0 : _fetchProductsQuery$d3.forEach(function (item) {
29266
+ allpagesarr.push(item);
29148
29267
  });
29149
29268
  cardobjassigner(allpagesarr);
29150
29269
  }
@@ -29175,11 +29294,10 @@ var Sixverticalcardssection = function Sixverticalcardssection(props) {
29175
29294
  React.useEffect(function () {
29176
29295
  if (fetchingtype == 'products') {
29177
29296
  if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
29297
+ var _fetchProductsQuery$d4, _fetchProductsQuery$d5, _fetchProductsQuery$d6;
29178
29298
  var allpagesarr = [];
29179
- fetchProductsQuery.data.pages.forEach(function (page) {
29180
- page.data.products.forEach(function (productobj) {
29181
- allpagesarr.push(productobj);
29182
- });
29299
+ fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : (_fetchProductsQuery$d4 = fetchProductsQuery.data) === null || _fetchProductsQuery$d4 === void 0 ? void 0 : (_fetchProductsQuery$d5 = _fetchProductsQuery$d4.data) === null || _fetchProductsQuery$d5 === void 0 ? void 0 : (_fetchProductsQuery$d6 = _fetchProductsQuery$d5.products) === null || _fetchProductsQuery$d6 === void 0 ? void 0 : _fetchProductsQuery$d6.forEach(function (item) {
29300
+ allpagesarr.push(item);
29183
29301
  });
29184
29302
  cardobjassigner(allpagesarr);
29185
29303
  }
@@ -29536,222 +29654,6 @@ var ModernCardsSection = function ModernCardsSection(props) {
29536
29654
  var _useInView = reactIntersectionObserver.useInView(),
29537
29655
  ref = _useInView.ref,
29538
29656
  inView = _useInView.inView;
29539
- // const StatePagePropertiesContext = props.actions.StatePagePropertiesContext;
29540
- // const lang = props.actions.lang;
29541
- // const langdetect = props.actions.langdetect;
29542
- // const fetchcustomercartQueryContext = props.actions.fetchcustomercartQueryContext;
29543
- // const favoriteprojectscountContext = props.actions.favoriteprojectscountContext;
29544
- // const routingcountext = props.actions.routingcountext;
29545
- // const StaticPagesLinksContext = props.actions.StaticPagesLinksContext;
29546
- // const ProductFilterObjContext = props.actions.ProductFilterObjContext;
29547
- // const setProductFilterObjContext = props.actions.setProductFilterObjContext;
29548
- // const TabexSectionsComponentsContext = props.actions.TabexSectionsComponentsContext;
29549
- // const FetchQueriesEngineContext = props.actions.FetchQueriesEngineContext;
29550
- // const setFetchQueriesEngineContext = props.actions.setFetchQueriesEngineContext;
29551
- // const fetchProductsQuery = props.actions.fetchProductsQuery;
29552
- // const fetchcollectionsQueryContext = props.actions.fetchcollectionsQueryContext;
29553
- // const setParentCollectionsForCollectionQueryArr = props.actions.setParentCollectionsForCollectionQueryArr;
29554
- // const ParentCollectionsForCollectionQueryArr = props.actions.ParentCollectionsForCollectionQueryArr;
29555
- // const setfetchingtype = props.actions.setfetchingtype;
29556
- // const fetchingtype = props.actions.fetchingtype;
29557
- // const addtofavoritescontext = props.actions.addtofavoritescontext;
29558
- // const actions = props.actions;
29559
- // const [sectionproperties, setsectionproperties] = useState('');
29560
- // const [imagesarray, setimagesarray] = useState([]);
29561
- // const [cardsarray, setcardsarray] = useState([]);
29562
- // const [searchinput, setsearchinput] = useState('');
29563
- // React.useEffect(() => {
29564
- // if (inView) {
29565
- // fetchProductsQuery.fetchNextPage();
29566
- // }
29567
- // }, [inView]);
29568
- // const [ProductsFetchingTypeSectionObj, setProductsFetchingTypeSectionObj] = useState({ productfetchingtype: 'Random', collectionid: '', grouptype: '' });
29569
-
29570
- // useEffect(() => {
29571
- // StatePagePropertiesContext.pageobj.sections.forEach(function (sectionitem, sectionindex) {
29572
- // if (sectionitem.sectionid == props.sectionidprops) {
29573
- // var secpropobj = {};
29574
- // sectionitem.sectionproperties.forEach(function (sectionpropertiesobj, sectionpropertiesindex) {
29575
- // secpropobj[sectionpropertiesobj.property_css_name] = sectionpropertiesobj.property_value;
29576
- // });
29577
- // setsectionproperties({ ...secpropobj });
29578
-
29579
- // if (props.srcfromprops == 'GeneralProductsComponent') {
29580
- // setfetchingtype('products');
29581
- // setProductsFetchingTypeSectionObj({
29582
- // productfetchingtype: 'Random',
29583
- // collectionid: props.collectionidprops,
29584
- // grouptype: props.grouptypeprops,
29585
- // grouptyperefid: props.grouptyperefidprops,
29586
- // });
29587
- // } else {
29588
- // setfetchingtype(sectionitem.fetchingtype);
29589
- // setProductsFetchingTypeSectionObj({
29590
- // productfetchingtype: sectionitem.productsfetchingtype,
29591
- // collectionid: sectionitem.productsfetchingtypeCollectioncollectionid,
29592
- // grouptype: props.grouptypeprops,
29593
- // grouptyperefid: props.grouptyperefidprops,
29594
- // });
29595
- // }
29596
- // }
29597
- // });
29598
- // }, [StatePagePropertiesContext]);
29599
- // useEffect(() => {
29600
- // if (sectionproperties.length != 0) {
29601
- // if (cardsarray.length == 0) {
29602
- // if (fetchingtype == 'collections') {
29603
- // if (fetchcollectionsQueryContext.isSuccess) {
29604
- // cardobjassigner(fetchcollectionsQueryContext.data.data.collections);
29605
- // }
29606
- // } else if (fetchingtype == 'products') {
29607
- // if (fetchProductsQuery.isSuccess) {
29608
- // var allpagesarr = [];
29609
- // fetchProductsQuery.data.pages.forEach((page) => {
29610
- // page.data.products.forEach((productobj) => {
29611
- // allpagesarr.push(productobj);
29612
- // });
29613
- // });
29614
- // cardobjassigner(allpagesarr);
29615
- // }
29616
- // }
29617
- // }
29618
- // }
29619
- // }, [sectionproperties]);
29620
- // useEffect(() => {
29621
- // if (fetchingtype.length != 0) {
29622
- // var tempFetchQueriesEngineContext = FetchQueriesEngineContext;
29623
- // if (fetchingtype == 'collections') {
29624
- // // tempFetchQueriesEngineContext.collections = true;
29625
- // if (ProductsFetchingTypeSectionObj.collectionid == 'all' || ProductsFetchingTypeSectionObj.collectionid == null || ProductsFetchingTypeSectionObj.collectionid == undefined) {
29626
- // setParentCollectionsForCollectionQueryArr('all');
29627
- // } else {
29628
- // setParentCollectionsForCollectionQueryArr([ProductsFetchingTypeSectionObj.collectionid]);
29629
- // }
29630
- // }
29631
- // if (fetchingtype == 'products') {
29632
- // var tempfetchproductsfilerobjcontext = ProductFilterObjContext;
29633
- // tempfetchproductsfilerobjcontext.ProductFetchingType = ProductsFetchingTypeSectionObj.productfetchingtype;
29634
- // if (
29635
- // ProductsFetchingTypeSectionObj.grouptype == 'collections' ||
29636
- // ProductsFetchingTypeSectionObj.grouptype == 'categories' ||
29637
- // ProductsFetchingTypeSectionObj.grouptype == 'parentcollections'
29638
- // ) {
29639
- // } else {
29640
- // tempfetchproductsfilerobjcontext.collections.push(ProductsFetchingTypeSectionObj.collectionid);
29641
- // }
29642
- // tempfetchproductsfilerobjcontext.grouptype = ProductsFetchingTypeSectionObj.grouptype;
29643
- // tempfetchproductsfilerobjcontext.grouptyperefid = ProductsFetchingTypeSectionObj.grouptyperefid;
29644
- // setProductFilterObjContext({ ...tempfetchproductsfilerobjcontext });
29645
- // }
29646
-
29647
- // setFetchQueriesEngineContext({ ...tempFetchQueriesEngineContext });
29648
- // }
29649
- // }, [fetchingtype, ProductsFetchingTypeSectionObj]);
29650
- // useEffect(() => {
29651
- // if (fetchingtype == 'products') {
29652
- // if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
29653
- // var allpagesarr = [];
29654
- // fetchProductsQuery.data.pages.forEach((page) => {
29655
- // page.data.products.forEach((productobj) => {
29656
- // allpagesarr.push(productobj);
29657
- // });
29658
- // });
29659
- // cardobjassigner(allpagesarr);
29660
- // }
29661
- // }
29662
- // }, [fetchProductsQuery.isSuccess, fetchProductsQuery.dataUpdatedAt, fetchProductsQuery.data, fetchcustomercartQueryContext.dataUpdatedAt]);
29663
- // useEffect(() => {
29664
- // if (fetchingtype == 'collections') {
29665
- // if (fetchcollectionsQueryContext.isSuccess) {
29666
- // cardobjassigner(fetchcollectionsQueryContext.data.data.collections);
29667
- // }
29668
- // }
29669
- // }, [fetchcollectionsQueryContext.isSuccess]);
29670
- // useEffect(() => {
29671
- // favassigner();
29672
- // }, [favoriteprojectscountContext]);
29673
- // const favassigner = () => {
29674
- // if (fetchingtype == 'products') {
29675
- // if (cardsarray.length != 0) {
29676
- // if (favoriteprojectscountContext != undefined && Array.isArray(favoriteprojectscountContext)) {
29677
- // var tempcardsarray = [...cardsarray];
29678
- // tempcardsarray.forEach(function (arrayItem, arrayindex) {
29679
- // arrayItem.IsFavExists = false;
29680
- // });
29681
- // tempcardsarray.forEach(function (arrayItem, arrayindex) {
29682
- // favoriteprojectscountContext.forEach(function (favitem, favindex) {
29683
- // if (arrayItem.productid == favitem) {
29684
- // arrayItem.IsFavExists = true;
29685
- // }
29686
- // });
29687
- // });
29688
- // setcardsarray([...tempcardsarray]);
29689
- // }
29690
- // }
29691
- // }
29692
- // };
29693
- // const cardobjassigner = (fetchedarray) => {
29694
- // var temparray = [];
29695
- // fetchedarray.forEach(function (arrayItem, arrayindex) {
29696
- // var cardobj = {
29697
- // name: '',
29698
- // image: '',
29699
- // };
29700
- // if (fetchingtype == 'products') {
29701
- // var itemquantity = 0;
29702
- // if (langdetect == 'en') {
29703
- // cardobj.name = arrayItem.productinfo.name_en;
29704
- // } else {
29705
- // cardobj.name = arrayItem.productinfo.name_ar;
29706
- // }
29707
- // if (langdetect == 'en') {
29708
- // cardobj.description = arrayItem.productinfo.description_en;
29709
- // } else {
29710
- // cardobj.description = arrayItem.productinfo.description_ar;
29711
- // }
29712
- // if (arrayItem.productinfo.hasvariants == 0) {
29713
- // fetchcustomercartQueryContext.data.data.customercart.cartitems.forEach(function (cartitem, cartindex) {
29714
- // if (cartitem.productid == arrayItem.productinfo.productid) {
29715
- // itemquantity = cartitem.quantity;
29716
- // }
29717
- // });
29718
- // }
29719
- // cardobj.image = arrayItem.productinfo.productmainimage;
29720
- // cardobj.hassale = arrayItem.productinfo.hassale;
29721
- // cardobj.productid = arrayItem.productinfo.productid;
29722
- // cardobj.hasvariants = arrayItem.productinfo.hasvariants;
29723
- // cardobj.description_en = arrayItem.productinfo.description_en;
29724
- // cardobj.description_ar = arrayItem.productinfo.description_ar;
29725
- // cardobj.defaultprice = arrayItem.productinfo.defaultprice;
29726
- // cardobj.defaultsaleprice = arrayItem.productinfo.defaultsaleprice;
29727
- // cardobj.productimages = arrayItem.productinfo.productimages;
29728
- // cardobj.quantity = itemquantity;
29729
- // cardobj.timestamp = arrayItem.productinfo.timestamp;
29730
-
29731
- // if (favoriteprojectscountContext != undefined && favoriteprojectscountContext.length != 0) {
29732
- // favoriteprojectscountContext.forEach(function (favitem, favindex) {
29733
- // if (arrayItem.productinfo.productid == favitem) {
29734
- // cardobj.IsFavExists = true;
29735
- // }
29736
- // });
29737
- // }
29738
- // } else if (fetchingtype == 'collections') {
29739
- // cardobj.collectionid = arrayItem.collectionid;
29740
- // if (langdetect == 'en') {
29741
- // cardobj.name = arrayItem.title_en;
29742
- // cardobj.description = arrayItem.description_en;
29743
- // } else if (langdetect == 'ar') {
29744
- // cardobj.name = arrayItem.title_ar;
29745
- // cardobj.description = arrayItem.description_ar;
29746
- // }
29747
- // cardobj.image = arrayItem.collectionlogo;
29748
- // } else if (fetchingtype == 'custom') {
29749
- // }
29750
- // temparray.push(cardobj);
29751
- // });
29752
-
29753
- // setcardsarray([...temparray]);
29754
- // };
29755
29657
  var StatePagePropertiesContext = props.actions.StatePagePropertiesContext;
29756
29658
  props.actions.lang;
29757
29659
  var langdetect = props.actions.langdetect;
@@ -29838,11 +29740,10 @@ var ModernCardsSection = function ModernCardsSection(props) {
29838
29740
  }
29839
29741
  } else if (fetchingtype == 'products') {
29840
29742
  if (fetchProductsQuery.isSuccess) {
29743
+ var _fetchProductsQuery$d, _fetchProductsQuery$d2, _fetchProductsQuery$d3;
29841
29744
  var allpagesarr = [];
29842
- fetchProductsQuery.data.pages.forEach(function (page) {
29843
- page.data.products.forEach(function (productobj) {
29844
- allpagesarr.push(productobj);
29845
- });
29745
+ fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : (_fetchProductsQuery$d = fetchProductsQuery.data) === null || _fetchProductsQuery$d === void 0 ? void 0 : (_fetchProductsQuery$d2 = _fetchProductsQuery$d.data) === null || _fetchProductsQuery$d2 === void 0 ? void 0 : (_fetchProductsQuery$d3 = _fetchProductsQuery$d2.products) === null || _fetchProductsQuery$d3 === void 0 ? void 0 : _fetchProductsQuery$d3.forEach(function (item) {
29746
+ allpagesarr.push(item);
29846
29747
  });
29847
29748
  cardobjassigner(allpagesarr);
29848
29749
  }
@@ -29951,11 +29852,10 @@ var ModernCardsSection = function ModernCardsSection(props) {
29951
29852
  React.useEffect(function () {
29952
29853
  if (fetchingtype == 'products') {
29953
29854
  if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
29855
+ var _fetchProductsQuery$d4, _fetchProductsQuery$d5, _fetchProductsQuery$d6;
29954
29856
  var allpagesarr = [];
29955
- fetchProductsQuery.data.pages.forEach(function (page) {
29956
- page.data.products.forEach(function (productobj) {
29957
- allpagesarr.push(productobj);
29958
- });
29857
+ fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : (_fetchProductsQuery$d4 = fetchProductsQuery.data) === null || _fetchProductsQuery$d4 === void 0 ? void 0 : (_fetchProductsQuery$d5 = _fetchProductsQuery$d4.data) === null || _fetchProductsQuery$d5 === void 0 ? void 0 : (_fetchProductsQuery$d6 = _fetchProductsQuery$d5.products) === null || _fetchProductsQuery$d6 === void 0 ? void 0 : _fetchProductsQuery$d6.forEach(function (item) {
29858
+ allpagesarr.push(item);
29959
29859
  });
29960
29860
  cardobjassigner(allpagesarr);
29961
29861
  }
@@ -31289,11 +31189,10 @@ var CardsSectionwithfilter = function CardsSectionwithfilter(props) {
31289
31189
  }
31290
31190
  // } else if (fetchingtype == 'products') {
31291
31191
  if (fetchProductsQuery.isSuccess) {
31192
+ var _fetchProductsQuery$d, _fetchProductsQuery$d2, _fetchProductsQuery$d3;
31292
31193
  var allpagesarr = [];
31293
- fetchProductsQuery.data.pages.forEach(function (page) {
31294
- page.data.products.forEach(function (productobj) {
31295
- allpagesarr.push(productobj);
31296
- });
31194
+ fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : (_fetchProductsQuery$d = fetchProductsQuery.data) === null || _fetchProductsQuery$d === void 0 ? void 0 : (_fetchProductsQuery$d2 = _fetchProductsQuery$d.data) === null || _fetchProductsQuery$d2 === void 0 ? void 0 : (_fetchProductsQuery$d3 = _fetchProductsQuery$d2.products) === null || _fetchProductsQuery$d3 === void 0 ? void 0 : _fetchProductsQuery$d3.forEach(function (item) {
31195
+ allpagesarr.push(item);
31297
31196
  });
31298
31197
  productcardobjassigner(allpagesarr);
31299
31198
  }
@@ -31324,11 +31223,10 @@ var CardsSectionwithfilter = function CardsSectionwithfilter(props) {
31324
31223
  React.useEffect(function () {
31325
31224
  // if (fetchingtype == 'products') {
31326
31225
  if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
31226
+ var _fetchProductsQuery$d4, _fetchProductsQuery$d5, _fetchProductsQuery$d6;
31327
31227
  var allpagesarr = [];
31328
- fetchProductsQuery.data.pages.forEach(function (page) {
31329
- page.data.products.forEach(function (productobj) {
31330
- allpagesarr.push(productobj);
31331
- });
31228
+ fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : (_fetchProductsQuery$d4 = fetchProductsQuery.data) === null || _fetchProductsQuery$d4 === void 0 ? void 0 : (_fetchProductsQuery$d5 = _fetchProductsQuery$d4.data) === null || _fetchProductsQuery$d5 === void 0 ? void 0 : (_fetchProductsQuery$d6 = _fetchProductsQuery$d5.products) === null || _fetchProductsQuery$d6 === void 0 ? void 0 : _fetchProductsQuery$d6.forEach(function (item) {
31229
+ allpagesarr.push(item);
31332
31230
  });
31333
31231
  productcardobjassigner(allpagesarr);
31334
31232
  }
@@ -31750,16 +31648,6 @@ var CardsSectionwithfilter = function CardsSectionwithfilter(props) {
31750
31648
  },
31751
31649
  onClick: function onClick() {
31752
31650
  alert('hh0');
31753
- // if (fetchProductsQuery.isSuccess) {
31754
- // var allpagesarr = [];
31755
- // fetchProductsQuery.data.data.pages.forEach((page) => {
31756
- // page.data.products.forEach((productobj) => {
31757
- // allpagesarr.push(productobj);
31758
- // });
31759
- // });
31760
- // cardobjassigner(allpagesarr);
31761
- // alert(JSON.stringify(allpagesarr));
31762
- // }
31763
31651
  }
31764
31652
  }, /*#__PURE__*/React__default["default"].createElement("p", null, item.name));
31765
31653
  }))), /*#__PURE__*/React__default["default"].createElement("div", {
@@ -39897,7 +39785,7 @@ var Card23 = function Card23(props) {
39897
39785
  fontSize: '12px'
39898
39786
  }
39899
39787
  }, langdetect == 'en' ? sectionproperties.badgeContentEn : sectionproperties.badgeContentAr))), /*#__PURE__*/React__default["default"].createElement("div", {
39900
- "class": sectionproperties.paddingLeft != 0 && sectionproperties.paddingRight != 0 ? langdetect == 'en' ? 'row m-0 w-100 pl-sm-0 pr-sm-0' : ' row m-0 w-100' : ' row m-0 w-100',
39788
+ "class": 'row m-0 w-100 pl-sm-0 pr-sm-0',
39901
39789
  style: {
39902
39790
  paddingLeft: '10px',
39903
39791
  paddingRight: '10px',