tabexseriescomponents 0.0.174 → 0.0.176

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.umd.js CHANGED
@@ -8296,6 +8296,8 @@
8296
8296
  var ProductFilterObjContext = props.actions.ProductFilterObjContext;
8297
8297
  var setProductFilterObjContext = props.actions.setProductFilterObjContext;
8298
8298
  var authdetailsContext = props.actions.authdetailsContext;
8299
+ var routingcountext = props.actions.routingcountext;
8300
+ var StaticPagesLinksContext = props.actions.StaticPagesLinksContext;
8299
8301
  var _useState = React.useState(''),
8300
8302
  _useState2 = _slicedToArray__default["default"](_useState, 2),
8301
8303
  sectionproperties = _useState2[0],
@@ -8357,15 +8359,17 @@
8357
8359
  }, [ProductFilterObjContext]);
8358
8360
  var filterupdater = function filterupdater() {
8359
8361
  if (instfilters.length != 0) {
8362
+ var _ProductFilterObjCont;
8360
8363
  var tempinstfilters = _toConsumableArray__default["default"](instfilters);
8361
- tempinstfilters.forEach(function (instfilteritem, instfilterindex) {
8364
+ tempinstfilters === null || tempinstfilters === void 0 ? void 0 : tempinstfilters.forEach(function (instfilteritem, instfilterindex) {
8362
8365
  instfilteritem.productvaluesfilter.forEach(function (valefilteritem, valefilteritemindex) {
8363
8366
  valefilteritem.isfilterselected = false;
8364
8367
  });
8365
8368
  });
8366
- ProductFilterObjContext.FilterOptions.forEach(function (filteritem, filterindex) {
8367
- tempinstfilters.forEach(function (instfilteritem, instfilterindex) {
8368
- instfilteritem.productvaluesfilter.forEach(function (valefilteritem, valefilteritemindex) {
8369
+ ProductFilterObjContext === null || ProductFilterObjContext === void 0 ? void 0 : (_ProductFilterObjCont = ProductFilterObjContext.FilterOptions) === null || _ProductFilterObjCont === void 0 ? void 0 : _ProductFilterObjCont.forEach(function (filteritem, filterindex) {
8370
+ tempinstfilters === null || tempinstfilters === void 0 ? void 0 : tempinstfilters.forEach(function (instfilteritem, instfilterindex) {
8371
+ var _instfilteritem$produ;
8372
+ instfilteritem === null || instfilteritem === void 0 ? void 0 : (_instfilteritem$produ = instfilteritem.productvaluesfilter) === null || _instfilteritem$produ === void 0 ? void 0 : _instfilteritem$produ.forEach(function (valefilteritem, valefilteritemindex) {
8369
8373
  if (filteritem.valueid == valefilteritem.valueid) {
8370
8374
  valefilteritem.isfilterselected = true;
8371
8375
  }
@@ -8375,12 +8379,13 @@
8375
8379
  setinstfilters(_toConsumableArray__default["default"](tempinstfilters));
8376
8380
  }
8377
8381
  if (instcollections.length != 0) {
8382
+ var _ProductFilterObjCont2;
8378
8383
  var tempInstcollections = _toConsumableArray__default["default"](instcollections);
8379
8384
  tempInstcollections.forEach(function (instfilteritem, valefilteritemindex) {
8380
8385
  instfilteritem.isfilterselected = false;
8381
8386
  });
8382
- ProductFilterObjContext.collections.forEach(function (filteritem, filterindex) {
8383
- tempInstcollections.forEach(function (instfilteritem, instfilterindex) {
8387
+ ProductFilterObjContext === null || ProductFilterObjContext === void 0 ? void 0 : (_ProductFilterObjCont2 = ProductFilterObjContext.collections) === null || _ProductFilterObjCont2 === void 0 ? void 0 : _ProductFilterObjCont2.forEach(function (filteritem, filterindex) {
8388
+ tempInstcollections === null || tempInstcollections === void 0 ? void 0 : tempInstcollections.forEach(function (instfilteritem, instfilterindex) {
8384
8389
  if (instfilteritem.collectionid == filteritem) {
8385
8390
  instfilteritem.isfilterselected = true;
8386
8391
  }
@@ -8394,8 +8399,9 @@
8394
8399
  if (type == 'clearfilters') {
8395
8400
  tempfetchproductsfilerobjcontext.FilterOptions = [];
8396
8401
  } else {
8402
+ var _tempfetchproductsfil;
8397
8403
  var FilterExists = false;
8398
- tempfetchproductsfilerobjcontext.FilterOptions.forEach(function (filteritem, filterindex) {
8404
+ tempfetchproductsfilerobjcontext === null || tempfetchproductsfilerobjcontext === void 0 ? void 0 : (_tempfetchproductsfil = tempfetchproductsfilerobjcontext.FilterOptions) === null || _tempfetchproductsfil === void 0 ? void 0 : _tempfetchproductsfil.forEach(function (filteritem, filterindex) {
8399
8405
  if (filteritem.valueid == valueid) {
8400
8406
  FilterExists = true;
8401
8407
  tempfetchproductsfilerobjcontext.FilterOptions.splice(filterindex, 1);
@@ -8412,12 +8418,15 @@
8412
8418
  } else {
8413
8419
  tempfetchproductsfilerobjcontext.isfilter = 1;
8414
8420
  }
8421
+ tempfetchproductsfilerobjcontext.page = 0;
8415
8422
  setProductFilterObjContext(_objectSpread$1C({}, tempfetchproductsfilerobjcontext));
8423
+ routingcountext(StaticPagesLinksContext.GeneralProductsComponent, true, encodeURIComponent(JSON.stringify(tempfetchproductsfilerobjcontext)));
8416
8424
  };
8417
8425
  var setCollectionFilterFunc = function setCollectionFilterFunc(collectionid) {
8426
+ var _tempfetchproductsfil2;
8418
8427
  var tempfetchproductsfilerobjcontext = _objectSpread$1C({}, ProductFilterObjContext);
8419
8428
  var CollectionExists = false;
8420
- tempfetchproductsfilerobjcontext.collections.forEach(function (filteritem, filterindex) {
8429
+ tempfetchproductsfilerobjcontext === null || tempfetchproductsfilerobjcontext === void 0 ? void 0 : (_tempfetchproductsfil2 = tempfetchproductsfilerobjcontext.collections) === null || _tempfetchproductsfil2 === void 0 ? void 0 : _tempfetchproductsfil2.forEach(function (filteritem, filterindex) {
8421
8430
  if (filteritem == collectionid) {
8422
8431
  CollectionExists = true;
8423
8432
  tempfetchproductsfilerobjcontext.collections.splice(filterindex, 1);
@@ -8426,7 +8435,9 @@
8426
8435
  if (!CollectionExists) {
8427
8436
  tempfetchproductsfilerobjcontext.collections.push(collectionid);
8428
8437
  }
8438
+ tempfetchproductsfilerobjcontext.page = 0;
8429
8439
  setProductFilterObjContext(_objectSpread$1C({}, tempfetchproductsfilerobjcontext));
8440
+ routingcountext(StaticPagesLinksContext.GeneralProductsComponent, true, encodeURIComponent(JSON.stringify(tempfetchproductsfilerobjcontext)));
8430
8441
  };
8431
8442
  var filter_cssstyles = {
8432
8443
  collapsetitle: glamor.css({
@@ -8669,6 +8680,7 @@
8669
8680
  tempfetchproductsfilerobjcontext[item.payloadvalue] = valueitem.value;
8670
8681
  }
8671
8682
  setProductFilterObjContext(_objectSpread$1C({}, tempfetchproductsfilerobjcontext));
8683
+ routingcountext(StaticPagesLinksContext.GeneralProductsComponent, true, encodeURIComponent(JSON.stringify(tempfetchproductsfilerobjcontext)));
8672
8684
  }
8673
8685
  }, /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("div", {
8674
8686
  className: " ".concat(ischecked ? filter_cssstyles.btn_item_active : '', " ").concat(filterstyles.btn_item, " ").concat(filter_cssstyles.btn_item) + ' mb-2 d-flex align-items-center '
@@ -9132,6 +9144,13 @@
9132
9144
  // }
9133
9145
  // }, [inView]);
9134
9146
  React.useEffect(function () {
9147
+ if (props.filterparamsprops != undefined) {
9148
+ var filterpar = decodeURIComponent(props.filterparamsprops);
9149
+ var filterparsed = JSON.parse(filterpar);
9150
+ if (filterparsed != undefined) {
9151
+ setProductFilterObjContext(filterparsed);
9152
+ }
9153
+ }
9135
9154
  StatePagePropertiesContext.pageobj.sections.forEach(function (sectionitem, sectionindex) {
9136
9155
  if (sectionitem.sectionid == props.sectionidprops) {
9137
9156
  var secpropobj = {};
@@ -9201,7 +9220,9 @@
9201
9220
  var tempfetchproductsfilerobjcontext = ProductFilterObjContext;
9202
9221
  tempfetchproductsfilerobjcontext.ProductFetchingType = ProductsFetchingTypeSectionObj.productfetchingtype;
9203
9222
  if (ProductsFetchingTypeSectionObj.grouptype == 'collections' || ProductsFetchingTypeSectionObj.grouptype == 'categories' || ProductsFetchingTypeSectionObj.grouptype == 'parentcollections') ; else {
9204
- tempfetchproductsfilerobjcontext.collections.push(ProductsFetchingTypeSectionObj.collectionid);
9223
+ if (tempfetchproductsfilerobjcontext.collections != undefined) {
9224
+ tempfetchproductsfilerobjcontext.collections.push(ProductsFetchingTypeSectionObj.collectionid);
9225
+ }
9205
9226
  }
9206
9227
  tempfetchproductsfilerobjcontext.grouptype = ProductsFetchingTypeSectionObj.grouptype;
9207
9228
  tempfetchproductsfilerobjcontext.grouptyperefid = ProductsFetchingTypeSectionObj.grouptyperefid;
@@ -9428,18 +9449,26 @@
9428
9449
  var handlePageClick = function handlePageClick(event) {
9429
9450
  props.scrolltotop();
9430
9451
  var tempProductFilterObjContext = _objectSpread$1B({}, ProductFilterObjContext);
9431
- tempProductFilterObjContext.page = event.selected;
9452
+ tempProductFilterObjContext.page = event === null || event === void 0 ? void 0 : event.selected;
9432
9453
  setProductFilterObjContext(_objectSpread$1B({}, tempProductFilterObjContext));
9454
+ var pasturl = '';
9455
+ if (props.grouptypeprops != undefined) {
9456
+ if (props.collectionidprops != undefined) {
9457
+ pasturl = props.grouptypeprops + '/' + props.collectionidprops + '/';
9458
+ }
9459
+ }
9460
+ routingcountext(StaticPagesLinksContext.GeneralProductsComponent, true, pasturl + encodeURIComponent(JSON.stringify(tempProductFilterObjContext)));
9433
9461
  };
9434
9462
  function PaginatedItems(_ref) {
9435
9463
  var _fetchProductsQuery$d7, _fetchProductsQuery$d8, _fetchProductsQuery$d9, _fetchProductsQuery$d10;
9436
9464
  _ref.itemsPerPage;
9437
9465
  // Here we use item offsets; we could also use page offsets
9438
9466
  // following the API or data you're working with.
9439
- var _useState13 = React.useState(0),
9440
- _useState14 = _slicedToArray__default["default"](_useState13, 2);
9441
- _useState14[0];
9442
- _useState14[1];
9467
+ // const [itemOffset, setItemOffset] = useState(0);
9468
+ // Simulate fetching items from another resources.
9469
+ // (This could be items from props; or items loaded in a local state
9470
+ // from an API endpoint with useEffect and useState)
9471
+ // const endOffset = itemOffset + itemsPerPage;
9443
9472
 
9444
9473
  // const currentItems = items.slice(itemOffset, endOffset);
9445
9474
  // const pageCount = Math.ceil(items.length / itemsPerPage);
@@ -28728,11 +28757,10 @@
28728
28757
  }
28729
28758
  } else if (fetchingtype == 'products') {
28730
28759
  if (fetchProductsQuery.isSuccess) {
28760
+ var _fetchProductsQuery$d, _fetchProductsQuery$d2, _fetchProductsQuery$d3;
28731
28761
  var allpagesarr = [];
28732
- fetchProductsQuery.data.pages.forEach(function (page) {
28733
- page.data.products.forEach(function (productobj) {
28734
- allpagesarr.push(productobj);
28735
- });
28762
+ 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) {
28763
+ allpagesarr.push(item);
28736
28764
  });
28737
28765
  cardobjassigner(allpagesarr);
28738
28766
  }
@@ -28764,11 +28792,10 @@
28764
28792
  React.useEffect(function () {
28765
28793
  if (fetchingtype == 'products') {
28766
28794
  if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
28795
+ var _fetchProductsQuery$d4, _fetchProductsQuery$d5, _fetchProductsQuery$d6;
28767
28796
  var allpagesarr = [];
28768
- fetchProductsQuery.data.pages.forEach(function (page) {
28769
- page.data.products.forEach(function (productobj) {
28770
- allpagesarr.push(productobj);
28771
- });
28797
+ 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) {
28798
+ allpagesarr.push(item);
28772
28799
  });
28773
28800
  cardobjassigner(allpagesarr);
28774
28801
  }
@@ -29123,11 +29150,10 @@
29123
29150
  }
29124
29151
  } else if (fetchingtype == 'products') {
29125
29152
  if (fetchProductsQuery.isSuccess) {
29153
+ var _fetchProductsQuery$d, _fetchProductsQuery$d2, _fetchProductsQuery$d3;
29126
29154
  var allpagesarr = [];
29127
- fetchProductsQuery.data.pages.forEach(function (page) {
29128
- page.data.products.forEach(function (productobj) {
29129
- allpagesarr.push(productobj);
29130
- });
29155
+ 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) {
29156
+ allpagesarr.push(item);
29131
29157
  });
29132
29158
  cardobjassigner(allpagesarr);
29133
29159
  }
@@ -29158,11 +29184,10 @@
29158
29184
  React.useEffect(function () {
29159
29185
  if (fetchingtype == 'products') {
29160
29186
  if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
29187
+ var _fetchProductsQuery$d4, _fetchProductsQuery$d5, _fetchProductsQuery$d6;
29161
29188
  var allpagesarr = [];
29162
- fetchProductsQuery.data.pages.forEach(function (page) {
29163
- page.data.products.forEach(function (productobj) {
29164
- allpagesarr.push(productobj);
29165
- });
29189
+ 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) {
29190
+ allpagesarr.push(item);
29166
29191
  });
29167
29192
  cardobjassigner(allpagesarr);
29168
29193
  }
@@ -29519,222 +29544,6 @@
29519
29544
  var _useInView = reactIntersectionObserver.useInView(),
29520
29545
  ref = _useInView.ref,
29521
29546
  inView = _useInView.inView;
29522
- // const StatePagePropertiesContext = props.actions.StatePagePropertiesContext;
29523
- // const lang = props.actions.lang;
29524
- // const langdetect = props.actions.langdetect;
29525
- // const fetchcustomercartQueryContext = props.actions.fetchcustomercartQueryContext;
29526
- // const favoriteprojectscountContext = props.actions.favoriteprojectscountContext;
29527
- // const routingcountext = props.actions.routingcountext;
29528
- // const StaticPagesLinksContext = props.actions.StaticPagesLinksContext;
29529
- // const ProductFilterObjContext = props.actions.ProductFilterObjContext;
29530
- // const setProductFilterObjContext = props.actions.setProductFilterObjContext;
29531
- // const TabexSectionsComponentsContext = props.actions.TabexSectionsComponentsContext;
29532
- // const FetchQueriesEngineContext = props.actions.FetchQueriesEngineContext;
29533
- // const setFetchQueriesEngineContext = props.actions.setFetchQueriesEngineContext;
29534
- // const fetchProductsQuery = props.actions.fetchProductsQuery;
29535
- // const fetchcollectionsQueryContext = props.actions.fetchcollectionsQueryContext;
29536
- // const setParentCollectionsForCollectionQueryArr = props.actions.setParentCollectionsForCollectionQueryArr;
29537
- // const ParentCollectionsForCollectionQueryArr = props.actions.ParentCollectionsForCollectionQueryArr;
29538
- // const setfetchingtype = props.actions.setfetchingtype;
29539
- // const fetchingtype = props.actions.fetchingtype;
29540
- // const addtofavoritescontext = props.actions.addtofavoritescontext;
29541
- // const actions = props.actions;
29542
- // const [sectionproperties, setsectionproperties] = useState('');
29543
- // const [imagesarray, setimagesarray] = useState([]);
29544
- // const [cardsarray, setcardsarray] = useState([]);
29545
- // const [searchinput, setsearchinput] = useState('');
29546
- // React.useEffect(() => {
29547
- // if (inView) {
29548
- // fetchProductsQuery.fetchNextPage();
29549
- // }
29550
- // }, [inView]);
29551
- // const [ProductsFetchingTypeSectionObj, setProductsFetchingTypeSectionObj] = useState({ productfetchingtype: 'Random', collectionid: '', grouptype: '' });
29552
-
29553
- // useEffect(() => {
29554
- // StatePagePropertiesContext.pageobj.sections.forEach(function (sectionitem, sectionindex) {
29555
- // if (sectionitem.sectionid == props.sectionidprops) {
29556
- // var secpropobj = {};
29557
- // sectionitem.sectionproperties.forEach(function (sectionpropertiesobj, sectionpropertiesindex) {
29558
- // secpropobj[sectionpropertiesobj.property_css_name] = sectionpropertiesobj.property_value;
29559
- // });
29560
- // setsectionproperties({ ...secpropobj });
29561
-
29562
- // if (props.srcfromprops == 'GeneralProductsComponent') {
29563
- // setfetchingtype('products');
29564
- // setProductsFetchingTypeSectionObj({
29565
- // productfetchingtype: 'Random',
29566
- // collectionid: props.collectionidprops,
29567
- // grouptype: props.grouptypeprops,
29568
- // grouptyperefid: props.grouptyperefidprops,
29569
- // });
29570
- // } else {
29571
- // setfetchingtype(sectionitem.fetchingtype);
29572
- // setProductsFetchingTypeSectionObj({
29573
- // productfetchingtype: sectionitem.productsfetchingtype,
29574
- // collectionid: sectionitem.productsfetchingtypeCollectioncollectionid,
29575
- // grouptype: props.grouptypeprops,
29576
- // grouptyperefid: props.grouptyperefidprops,
29577
- // });
29578
- // }
29579
- // }
29580
- // });
29581
- // }, [StatePagePropertiesContext]);
29582
- // useEffect(() => {
29583
- // if (sectionproperties.length != 0) {
29584
- // if (cardsarray.length == 0) {
29585
- // if (fetchingtype == 'collections') {
29586
- // if (fetchcollectionsQueryContext.isSuccess) {
29587
- // cardobjassigner(fetchcollectionsQueryContext.data.data.collections);
29588
- // }
29589
- // } else if (fetchingtype == 'products') {
29590
- // if (fetchProductsQuery.isSuccess) {
29591
- // var allpagesarr = [];
29592
- // fetchProductsQuery.data.pages.forEach((page) => {
29593
- // page.data.products.forEach((productobj) => {
29594
- // allpagesarr.push(productobj);
29595
- // });
29596
- // });
29597
- // cardobjassigner(allpagesarr);
29598
- // }
29599
- // }
29600
- // }
29601
- // }
29602
- // }, [sectionproperties]);
29603
- // useEffect(() => {
29604
- // if (fetchingtype.length != 0) {
29605
- // var tempFetchQueriesEngineContext = FetchQueriesEngineContext;
29606
- // if (fetchingtype == 'collections') {
29607
- // // tempFetchQueriesEngineContext.collections = true;
29608
- // if (ProductsFetchingTypeSectionObj.collectionid == 'all' || ProductsFetchingTypeSectionObj.collectionid == null || ProductsFetchingTypeSectionObj.collectionid == undefined) {
29609
- // setParentCollectionsForCollectionQueryArr('all');
29610
- // } else {
29611
- // setParentCollectionsForCollectionQueryArr([ProductsFetchingTypeSectionObj.collectionid]);
29612
- // }
29613
- // }
29614
- // if (fetchingtype == 'products') {
29615
- // var tempfetchproductsfilerobjcontext = ProductFilterObjContext;
29616
- // tempfetchproductsfilerobjcontext.ProductFetchingType = ProductsFetchingTypeSectionObj.productfetchingtype;
29617
- // if (
29618
- // ProductsFetchingTypeSectionObj.grouptype == 'collections' ||
29619
- // ProductsFetchingTypeSectionObj.grouptype == 'categories' ||
29620
- // ProductsFetchingTypeSectionObj.grouptype == 'parentcollections'
29621
- // ) {
29622
- // } else {
29623
- // tempfetchproductsfilerobjcontext.collections.push(ProductsFetchingTypeSectionObj.collectionid);
29624
- // }
29625
- // tempfetchproductsfilerobjcontext.grouptype = ProductsFetchingTypeSectionObj.grouptype;
29626
- // tempfetchproductsfilerobjcontext.grouptyperefid = ProductsFetchingTypeSectionObj.grouptyperefid;
29627
- // setProductFilterObjContext({ ...tempfetchproductsfilerobjcontext });
29628
- // }
29629
-
29630
- // setFetchQueriesEngineContext({ ...tempFetchQueriesEngineContext });
29631
- // }
29632
- // }, [fetchingtype, ProductsFetchingTypeSectionObj]);
29633
- // useEffect(() => {
29634
- // if (fetchingtype == 'products') {
29635
- // if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
29636
- // var allpagesarr = [];
29637
- // fetchProductsQuery.data.pages.forEach((page) => {
29638
- // page.data.products.forEach((productobj) => {
29639
- // allpagesarr.push(productobj);
29640
- // });
29641
- // });
29642
- // cardobjassigner(allpagesarr);
29643
- // }
29644
- // }
29645
- // }, [fetchProductsQuery.isSuccess, fetchProductsQuery.dataUpdatedAt, fetchProductsQuery.data, fetchcustomercartQueryContext.dataUpdatedAt]);
29646
- // useEffect(() => {
29647
- // if (fetchingtype == 'collections') {
29648
- // if (fetchcollectionsQueryContext.isSuccess) {
29649
- // cardobjassigner(fetchcollectionsQueryContext.data.data.collections);
29650
- // }
29651
- // }
29652
- // }, [fetchcollectionsQueryContext.isSuccess]);
29653
- // useEffect(() => {
29654
- // favassigner();
29655
- // }, [favoriteprojectscountContext]);
29656
- // const favassigner = () => {
29657
- // if (fetchingtype == 'products') {
29658
- // if (cardsarray.length != 0) {
29659
- // if (favoriteprojectscountContext != undefined && Array.isArray(favoriteprojectscountContext)) {
29660
- // var tempcardsarray = [...cardsarray];
29661
- // tempcardsarray.forEach(function (arrayItem, arrayindex) {
29662
- // arrayItem.IsFavExists = false;
29663
- // });
29664
- // tempcardsarray.forEach(function (arrayItem, arrayindex) {
29665
- // favoriteprojectscountContext.forEach(function (favitem, favindex) {
29666
- // if (arrayItem.productid == favitem) {
29667
- // arrayItem.IsFavExists = true;
29668
- // }
29669
- // });
29670
- // });
29671
- // setcardsarray([...tempcardsarray]);
29672
- // }
29673
- // }
29674
- // }
29675
- // };
29676
- // const cardobjassigner = (fetchedarray) => {
29677
- // var temparray = [];
29678
- // fetchedarray.forEach(function (arrayItem, arrayindex) {
29679
- // var cardobj = {
29680
- // name: '',
29681
- // image: '',
29682
- // };
29683
- // if (fetchingtype == 'products') {
29684
- // var itemquantity = 0;
29685
- // if (langdetect == 'en') {
29686
- // cardobj.name = arrayItem.productinfo.name_en;
29687
- // } else {
29688
- // cardobj.name = arrayItem.productinfo.name_ar;
29689
- // }
29690
- // if (langdetect == 'en') {
29691
- // cardobj.description = arrayItem.productinfo.description_en;
29692
- // } else {
29693
- // cardobj.description = arrayItem.productinfo.description_ar;
29694
- // }
29695
- // if (arrayItem.productinfo.hasvariants == 0) {
29696
- // fetchcustomercartQueryContext.data.data.customercart.cartitems.forEach(function (cartitem, cartindex) {
29697
- // if (cartitem.productid == arrayItem.productinfo.productid) {
29698
- // itemquantity = cartitem.quantity;
29699
- // }
29700
- // });
29701
- // }
29702
- // cardobj.image = arrayItem.productinfo.productmainimage;
29703
- // cardobj.hassale = arrayItem.productinfo.hassale;
29704
- // cardobj.productid = arrayItem.productinfo.productid;
29705
- // cardobj.hasvariants = arrayItem.productinfo.hasvariants;
29706
- // cardobj.description_en = arrayItem.productinfo.description_en;
29707
- // cardobj.description_ar = arrayItem.productinfo.description_ar;
29708
- // cardobj.defaultprice = arrayItem.productinfo.defaultprice;
29709
- // cardobj.defaultsaleprice = arrayItem.productinfo.defaultsaleprice;
29710
- // cardobj.productimages = arrayItem.productinfo.productimages;
29711
- // cardobj.quantity = itemquantity;
29712
- // cardobj.timestamp = arrayItem.productinfo.timestamp;
29713
-
29714
- // if (favoriteprojectscountContext != undefined && favoriteprojectscountContext.length != 0) {
29715
- // favoriteprojectscountContext.forEach(function (favitem, favindex) {
29716
- // if (arrayItem.productinfo.productid == favitem) {
29717
- // cardobj.IsFavExists = true;
29718
- // }
29719
- // });
29720
- // }
29721
- // } else if (fetchingtype == 'collections') {
29722
- // cardobj.collectionid = arrayItem.collectionid;
29723
- // if (langdetect == 'en') {
29724
- // cardobj.name = arrayItem.title_en;
29725
- // cardobj.description = arrayItem.description_en;
29726
- // } else if (langdetect == 'ar') {
29727
- // cardobj.name = arrayItem.title_ar;
29728
- // cardobj.description = arrayItem.description_ar;
29729
- // }
29730
- // cardobj.image = arrayItem.collectionlogo;
29731
- // } else if (fetchingtype == 'custom') {
29732
- // }
29733
- // temparray.push(cardobj);
29734
- // });
29735
-
29736
- // setcardsarray([...temparray]);
29737
- // };
29738
29547
  var StatePagePropertiesContext = props.actions.StatePagePropertiesContext;
29739
29548
  props.actions.lang;
29740
29549
  var langdetect = props.actions.langdetect;
@@ -29821,11 +29630,10 @@
29821
29630
  }
29822
29631
  } else if (fetchingtype == 'products') {
29823
29632
  if (fetchProductsQuery.isSuccess) {
29633
+ var _fetchProductsQuery$d, _fetchProductsQuery$d2, _fetchProductsQuery$d3;
29824
29634
  var allpagesarr = [];
29825
- fetchProductsQuery.data.pages.forEach(function (page) {
29826
- page.data.products.forEach(function (productobj) {
29827
- allpagesarr.push(productobj);
29828
- });
29635
+ 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) {
29636
+ allpagesarr.push(item);
29829
29637
  });
29830
29638
  cardobjassigner(allpagesarr);
29831
29639
  }
@@ -29934,11 +29742,10 @@
29934
29742
  React.useEffect(function () {
29935
29743
  if (fetchingtype == 'products') {
29936
29744
  if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
29745
+ var _fetchProductsQuery$d4, _fetchProductsQuery$d5, _fetchProductsQuery$d6;
29937
29746
  var allpagesarr = [];
29938
- fetchProductsQuery.data.pages.forEach(function (page) {
29939
- page.data.products.forEach(function (productobj) {
29940
- allpagesarr.push(productobj);
29941
- });
29747
+ 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) {
29748
+ allpagesarr.push(item);
29942
29749
  });
29943
29750
  cardobjassigner(allpagesarr);
29944
29751
  }
@@ -31272,11 +31079,10 @@
31272
31079
  }
31273
31080
  // } else if (fetchingtype == 'products') {
31274
31081
  if (fetchProductsQuery.isSuccess) {
31082
+ var _fetchProductsQuery$d, _fetchProductsQuery$d2, _fetchProductsQuery$d3;
31275
31083
  var allpagesarr = [];
31276
- fetchProductsQuery.data.pages.forEach(function (page) {
31277
- page.data.products.forEach(function (productobj) {
31278
- allpagesarr.push(productobj);
31279
- });
31084
+ 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) {
31085
+ allpagesarr.push(item);
31280
31086
  });
31281
31087
  productcardobjassigner(allpagesarr);
31282
31088
  }
@@ -31307,11 +31113,10 @@
31307
31113
  React.useEffect(function () {
31308
31114
  // if (fetchingtype == 'products') {
31309
31115
  if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
31116
+ var _fetchProductsQuery$d4, _fetchProductsQuery$d5, _fetchProductsQuery$d6;
31310
31117
  var allpagesarr = [];
31311
- fetchProductsQuery.data.pages.forEach(function (page) {
31312
- page.data.products.forEach(function (productobj) {
31313
- allpagesarr.push(productobj);
31314
- });
31118
+ 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) {
31119
+ allpagesarr.push(item);
31315
31120
  });
31316
31121
  productcardobjassigner(allpagesarr);
31317
31122
  }
@@ -31733,16 +31538,6 @@
31733
31538
  },
31734
31539
  onClick: function onClick() {
31735
31540
  alert('hh0');
31736
- // if (fetchProductsQuery.isSuccess) {
31737
- // var allpagesarr = [];
31738
- // fetchProductsQuery.data.data.pages.forEach((page) => {
31739
- // page.data.products.forEach((productobj) => {
31740
- // allpagesarr.push(productobj);
31741
- // });
31742
- // });
31743
- // cardobjassigner(allpagesarr);
31744
- // alert(JSON.stringify(allpagesarr));
31745
- // }
31746
31541
  }
31747
31542
  }, /*#__PURE__*/React__default["default"].createElement("p", null, item.name));
31748
31543
  }))), /*#__PURE__*/React__default["default"].createElement("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tabexseriescomponents",
3
- "version": "0.0.174",
3
+ "version": "0.0.176",
4
4
  "description": "your description",
5
5
  "main": "dist/index.cjs.js",
6
6
  "scripts": {
package/src.zip ADDED
Binary file
package/{ DELETED
File without changes