@bonlineza/luxity-lib 2.35.2 → 2.36.1-beta.0
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/AddProductInterest.js +127 -5
- package/GraphQLDropdownSelector.js +131 -10
- package/IconHeader.js +2 -2
- package/Interests.js +132 -10
- package/LuxityDesktopHeader.js +60 -138
- package/LuxityFooter.js +4 -4
- package/LuxityGraphQLDropdownSelector.js +131 -10
- package/LuxityMobileHeader.js +99 -225
- package/LuxitySideNav.js +91 -219
- package/MaterialSelector.js +131 -10
- package/ModelSelector.js +131 -10
- package/NotificationDropDown.js +10 -3
- package/build/bundle.css +1 -1
- package/build/bundle.js +293 -353
- package/package.json +1 -1
- package/TestComponent.js +0 -15
- package/build/CountryCodeSelect/index.js +0 -18
- package/build/ReactSelectWrapper/index.js +0 -34
- package/postcss.config.js +0 -6
package/LuxitySideNav.js
CHANGED
|
@@ -260,33 +260,10 @@
|
|
|
260
260
|
var _categories$filter;
|
|
261
261
|
|
|
262
262
|
return (_categories$filter = categories === null || categories === void 0 ? void 0 : categories.filter(function (category) {
|
|
263
|
-
return category.name !== name;
|
|
263
|
+
return category.name.toLowerCase() !== name.toLowerCase();
|
|
264
264
|
})) !== null && _categories$filter !== void 0 ? _categories$filter : [];
|
|
265
265
|
};
|
|
266
266
|
|
|
267
|
-
var categories = {
|
|
268
|
-
shoes: {
|
|
269
|
-
name: 'Shoes',
|
|
270
|
-
slug: 'shoes'
|
|
271
|
-
},
|
|
272
|
-
bags: {
|
|
273
|
-
name: 'Bags',
|
|
274
|
-
slug: 'bags'
|
|
275
|
-
},
|
|
276
|
-
clothing: {
|
|
277
|
-
name: 'Clothing',
|
|
278
|
-
slug: 'apparel'
|
|
279
|
-
},
|
|
280
|
-
watches: {
|
|
281
|
-
name: 'Watches',
|
|
282
|
-
slug: 'watches'
|
|
283
|
-
},
|
|
284
|
-
accessories: {
|
|
285
|
-
name: 'Accessories',
|
|
286
|
-
slug: 'accessories'
|
|
287
|
-
}
|
|
288
|
-
};
|
|
289
|
-
|
|
290
267
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
291
268
|
/* position relative is required for the Body element to be positioned correctly */
|
|
292
269
|
|
|
@@ -499,7 +476,8 @@
|
|
|
499
476
|
onCartClick = _ref.onCartClick,
|
|
500
477
|
onContactUsClick = _ref.onContactUsClick,
|
|
501
478
|
onOurStoryClick = _ref.onOurStoryClick,
|
|
502
|
-
onBlogClick = _ref.onBlogClick,
|
|
479
|
+
_ref$onBlogClick = _ref.onBlogClick,
|
|
480
|
+
onBlogClick = _ref$onBlogClick === void 0 ? undefined : _ref$onBlogClick,
|
|
503
481
|
onSellToUsClick = _ref.onSellToUsClick,
|
|
504
482
|
stores = _ref.stores,
|
|
505
483
|
categoryElements = _ref.categoryElements,
|
|
@@ -511,7 +489,8 @@
|
|
|
511
489
|
onCurrencyChange = _ref.onCurrencyChange,
|
|
512
490
|
isCurrencySelectionDisabled = _ref.isCurrencySelectionDisabled,
|
|
513
491
|
tooltipContent = _ref.tooltipContent,
|
|
514
|
-
LinkComponent = _ref.LinkComponent
|
|
492
|
+
LinkComponent = _ref.LinkComponent,
|
|
493
|
+
categoryConfig = _ref.categoryConfig;
|
|
515
494
|
|
|
516
495
|
var _useState = React.useState(false),
|
|
517
496
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -528,16 +507,7 @@
|
|
|
528
507
|
loading = _useState6[0],
|
|
529
508
|
setLoading = _useState6[1];
|
|
530
509
|
|
|
531
|
-
var _useState7 = React.useState({
|
|
532
|
-
latestArrivals: [],
|
|
533
|
-
bags: [],
|
|
534
|
-
shoes: [],
|
|
535
|
-
apparel: [],
|
|
536
|
-
accessories: [],
|
|
537
|
-
watches: [],
|
|
538
|
-
accessoriesCategories: [],
|
|
539
|
-
apparelStyles: []
|
|
540
|
-
}),
|
|
510
|
+
var _useState7 = React.useState({}),
|
|
541
511
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
542
512
|
dropdownData = _useState8[0],
|
|
543
513
|
setDropdownData = _useState8[1];
|
|
@@ -587,22 +557,88 @@
|
|
|
587
557
|
axios.get("".concat(menuData)).then(function (_ref2) {
|
|
588
558
|
var data = _ref2.data;
|
|
589
559
|
setLoading(false);
|
|
590
|
-
setDropdownData(
|
|
591
|
-
return _objectSpread2(_objectSpread2({}, prev), {}, {
|
|
592
|
-
latestArrivals: data.latest_arrivals,
|
|
593
|
-
bags: data.bags,
|
|
594
|
-
shoes: data.shoes,
|
|
595
|
-
apparel: data.apparel,
|
|
596
|
-
accessories: data.accessories,
|
|
597
|
-
watches: data.watches,
|
|
598
|
-
accessoriesCategories: data.accessories_categories,
|
|
599
|
-
apparelStyles: data.apparel_styles
|
|
600
|
-
});
|
|
601
|
-
});
|
|
560
|
+
setDropdownData(data);
|
|
602
561
|
}).catch(function () {
|
|
603
562
|
return setHasError(true);
|
|
604
563
|
});
|
|
605
564
|
}, [menuData]);
|
|
565
|
+
|
|
566
|
+
var renderMenuItems = function renderMenuItems() {
|
|
567
|
+
return categoryConfig.categories.map(function (category) {
|
|
568
|
+
var title = category.title,
|
|
569
|
+
categorySlug = category.categorySlug;
|
|
570
|
+
var slug = categorySlug;
|
|
571
|
+
|
|
572
|
+
if (categorySlug === 'brands') {
|
|
573
|
+
slug = 'new';
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
577
|
+
className: "side-nav__menu-item"
|
|
578
|
+
}, /*#__PURE__*/React__default.createElement("button", {
|
|
579
|
+
type: "button",
|
|
580
|
+
className: "side-nav__menu-title-wrapper",
|
|
581
|
+
onClick: function onClick() {
|
|
582
|
+
return onSubMenuClick(slug);
|
|
583
|
+
}
|
|
584
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
585
|
+
className: "side-nav__menu-title"
|
|
586
|
+
}, title), /*#__PURE__*/React__default.createElement("img", {
|
|
587
|
+
src: accordionIcon,
|
|
588
|
+
alt: "accordion-icon",
|
|
589
|
+
className: "side-nav__accordion-icon"
|
|
590
|
+
})));
|
|
591
|
+
});
|
|
592
|
+
};
|
|
593
|
+
|
|
594
|
+
var renderDropdownLinks = function renderDropdownLinks() {
|
|
595
|
+
return categoryConfig.categories.map(function (category) {
|
|
596
|
+
var categorySlug = category.categorySlug,
|
|
597
|
+
categoryName = category.categoryName,
|
|
598
|
+
elementsKey = category.elementsKey,
|
|
599
|
+
subCategoryElementsKey = category.subCategoryElementsKey,
|
|
600
|
+
styleElementsKey = category.styleElementsKey;
|
|
601
|
+
var categoryElementsProcessed = categoryElements;
|
|
602
|
+
|
|
603
|
+
if (subCategoryElementsKey && dropdownData[subCategoryElementsKey]) {
|
|
604
|
+
// show subcategory elements
|
|
605
|
+
categoryElementsProcessed = removeCategoryByName(dropdownData[subCategoryElementsKey], categoryName);
|
|
606
|
+
} else if (styleElementsKey && dropdownData[styleElementsKey]) {
|
|
607
|
+
categoryElementsProcessed = addCategoryToElements(dropdownData[styleElementsKey], categorySlug);
|
|
608
|
+
} else {
|
|
609
|
+
categoryElementsProcessed = addCategoryToElements(categoryElementsProcessed, categorySlug);
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
var subMenuTitle = 'Brands';
|
|
613
|
+
|
|
614
|
+
if (categorySlug !== 'brands') {
|
|
615
|
+
subMenuTitle = "".concat(categoryName, " Brands");
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
var subMenu = categorySlug;
|
|
619
|
+
|
|
620
|
+
if (subMenu === 'brands') {
|
|
621
|
+
subMenu = 'new';
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
return /*#__PURE__*/React__default.createElement(BrandsDropDown, {
|
|
625
|
+
subMenuOpen: subMenuOpen && displayedSubMenu === subMenu,
|
|
626
|
+
onBackClick: onBackClick,
|
|
627
|
+
backIcon: backIcon,
|
|
628
|
+
subMenuCategoryTitle: "Department",
|
|
629
|
+
productUrl: productUrl,
|
|
630
|
+
categoryElements: categoryElementsProcessed,
|
|
631
|
+
subMenuBrandsTitle: subMenuTitle,
|
|
632
|
+
brandsList: dropdownData[elementsKey],
|
|
633
|
+
categorySlug: displayedSubMenu,
|
|
634
|
+
isLoading: loading,
|
|
635
|
+
hasError: hasError,
|
|
636
|
+
onCloseSideNav: onCloseSideNav,
|
|
637
|
+
LinkComponent: LinkComponent
|
|
638
|
+
});
|
|
639
|
+
});
|
|
640
|
+
};
|
|
641
|
+
|
|
606
642
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
607
643
|
className: "side-nav"
|
|
608
644
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -623,91 +659,7 @@
|
|
|
623
659
|
className: "side-nav__close-icon"
|
|
624
660
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
625
661
|
className: "side-nav__menu-items-wrapper"
|
|
626
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
627
|
-
className: "side-nav__menu-item"
|
|
628
|
-
}, /*#__PURE__*/React__default.createElement("button", {
|
|
629
|
-
type: "button",
|
|
630
|
-
className: "side-nav__menu-title-wrapper",
|
|
631
|
-
onClick: function onClick() {
|
|
632
|
-
return onSubMenuClick('new');
|
|
633
|
-
}
|
|
634
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
635
|
-
className: "side-nav__menu-title"
|
|
636
|
-
}, "New"), /*#__PURE__*/React__default.createElement("img", {
|
|
637
|
-
src: accordionIcon,
|
|
638
|
-
alt: "accordion-icon",
|
|
639
|
-
className: "side-nav__accordion-icon"
|
|
640
|
-
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
641
|
-
className: "side-nav__menu-item"
|
|
642
|
-
}, /*#__PURE__*/React__default.createElement("button", {
|
|
643
|
-
type: "button",
|
|
644
|
-
className: "side-nav__menu-title-wrapper",
|
|
645
|
-
onClick: function onClick() {
|
|
646
|
-
return onSubMenuClick('bags');
|
|
647
|
-
}
|
|
648
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
649
|
-
className: "side-nav__menu-title"
|
|
650
|
-
}, "Bags"), /*#__PURE__*/React__default.createElement("img", {
|
|
651
|
-
src: accordionIcon,
|
|
652
|
-
alt: "accordion-icon",
|
|
653
|
-
className: "side-nav__accordion-icon"
|
|
654
|
-
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
655
|
-
className: "side-nav__menu-item"
|
|
656
|
-
}, /*#__PURE__*/React__default.createElement("button", {
|
|
657
|
-
type: "button",
|
|
658
|
-
className: "side-nav__menu-title-wrapper",
|
|
659
|
-
onClick: function onClick() {
|
|
660
|
-
return onSubMenuClick('shoes');
|
|
661
|
-
}
|
|
662
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
663
|
-
className: "side-nav__menu-title"
|
|
664
|
-
}, "Shoes"), /*#__PURE__*/React__default.createElement("img", {
|
|
665
|
-
src: accordionIcon,
|
|
666
|
-
alt: "accordion-icon",
|
|
667
|
-
className: "side-nav__accordion-icon"
|
|
668
|
-
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
669
|
-
className: "side-nav__menu-item"
|
|
670
|
-
}, /*#__PURE__*/React__default.createElement("button", {
|
|
671
|
-
type: "button",
|
|
672
|
-
className: "side-nav__menu-title-wrapper",
|
|
673
|
-
onClick: function onClick() {
|
|
674
|
-
return onSubMenuClick('apparel');
|
|
675
|
-
}
|
|
676
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
677
|
-
className: "side-nav__menu-title"
|
|
678
|
-
}, "Clothing"), /*#__PURE__*/React__default.createElement("img", {
|
|
679
|
-
src: accordionIcon,
|
|
680
|
-
alt: "accordion-icon",
|
|
681
|
-
className: "side-nav__accordion-icon"
|
|
682
|
-
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
683
|
-
className: "side-nav__menu-item"
|
|
684
|
-
}, /*#__PURE__*/React__default.createElement("button", {
|
|
685
|
-
type: "button",
|
|
686
|
-
className: "side-nav__menu-title-wrapper",
|
|
687
|
-
onClick: function onClick() {
|
|
688
|
-
return onSubMenuClick('accessories');
|
|
689
|
-
}
|
|
690
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
691
|
-
className: "side-nav__menu-title"
|
|
692
|
-
}, "Accessories"), /*#__PURE__*/React__default.createElement("img", {
|
|
693
|
-
src: accordionIcon,
|
|
694
|
-
alt: "accordion-icon",
|
|
695
|
-
className: "side-nav__accordion-icon"
|
|
696
|
-
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
697
|
-
className: "side-nav__menu-item"
|
|
698
|
-
}, /*#__PURE__*/React__default.createElement("button", {
|
|
699
|
-
type: "button",
|
|
700
|
-
className: "side-nav__menu-title-wrapper",
|
|
701
|
-
onClick: function onClick() {
|
|
702
|
-
return onSubMenuClick('watches');
|
|
703
|
-
}
|
|
704
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
705
|
-
className: "side-nav__menu-title"
|
|
706
|
-
}, "Watches"), /*#__PURE__*/React__default.createElement("img", {
|
|
707
|
-
src: accordionIcon,
|
|
708
|
-
alt: "accordion-icon",
|
|
709
|
-
className: "side-nav__accordion-icon"
|
|
710
|
-
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
662
|
+
}, renderMenuItems(), !!stores.length && /*#__PURE__*/React__default.createElement("div", {
|
|
711
663
|
className: "side-nav__menu-item"
|
|
712
664
|
}, /*#__PURE__*/React__default.createElement("button", {
|
|
713
665
|
type: "button",
|
|
@@ -731,7 +683,7 @@
|
|
|
731
683
|
type: "button",
|
|
732
684
|
className: "side-nav__sub-link",
|
|
733
685
|
onClick: onOurStoryClick
|
|
734
|
-
}, "Our Story")), /*#__PURE__*/React__default.createElement("div", {
|
|
686
|
+
}, "Our Story")), typeof onBlogClick === 'function' && /*#__PURE__*/React__default.createElement("div", {
|
|
735
687
|
className: "side-nav__menu-item"
|
|
736
688
|
}, /*#__PURE__*/React__default.createElement("button", {
|
|
737
689
|
type: "button",
|
|
@@ -761,91 +713,7 @@
|
|
|
761
713
|
onCurrencyChange: onCurrencyChange,
|
|
762
714
|
isCurrencySelectionDisabled: isCurrencySelectionDisabled,
|
|
763
715
|
tooltipContent: tooltipContent
|
|
764
|
-
}))), /*#__PURE__*/React__default.createElement(
|
|
765
|
-
subMenuOpen: subMenuOpen && displayedSubMenu === 'new',
|
|
766
|
-
onBackClick: onBackClick,
|
|
767
|
-
backIcon: backIcon,
|
|
768
|
-
subMenuCategoryTitle: "Department",
|
|
769
|
-
productUrl: productUrl,
|
|
770
|
-
categoryElements: categoryElements,
|
|
771
|
-
subMenuBrandsTitle: "Brands",
|
|
772
|
-
brandsList: dropdownData.latestArrivals,
|
|
773
|
-
categorySlug: displayedSubMenu,
|
|
774
|
-
isLoading: loading,
|
|
775
|
-
hasError: hasError,
|
|
776
|
-
onCloseSideNav: onCloseSideNav,
|
|
777
|
-
LinkComponent: LinkComponent
|
|
778
|
-
}), /*#__PURE__*/React__default.createElement(BrandsDropDown, {
|
|
779
|
-
subMenuOpen: subMenuOpen && displayedSubMenu === 'bags',
|
|
780
|
-
onBackClick: onBackClick,
|
|
781
|
-
backIcon: backIcon,
|
|
782
|
-
subMenuCategoryTitle: "Department",
|
|
783
|
-
productUrl: productUrl,
|
|
784
|
-
categoryElements: addCategoryToElements(categoryElements, categories.bags.slug),
|
|
785
|
-
subMenuBrandsTitle: "Bag Brands",
|
|
786
|
-
brandsList: dropdownData.bags,
|
|
787
|
-
categorySlug: displayedSubMenu,
|
|
788
|
-
isLoading: loading,
|
|
789
|
-
hasError: hasError,
|
|
790
|
-
onCloseSideNav: onCloseSideNav,
|
|
791
|
-
LinkComponent: LinkComponent
|
|
792
|
-
}), /*#__PURE__*/React__default.createElement(BrandsDropDown, {
|
|
793
|
-
subMenuOpen: subMenuOpen && displayedSubMenu === 'shoes',
|
|
794
|
-
onBackClick: onBackClick,
|
|
795
|
-
backIcon: backIcon,
|
|
796
|
-
subMenuCategoryTitle: "Department",
|
|
797
|
-
productUrl: productUrl,
|
|
798
|
-
categoryElements: addCategoryToElements(categoryElements, categories.shoes.slug),
|
|
799
|
-
subMenuBrandsTitle: "Shoe Brands",
|
|
800
|
-
brandsList: dropdownData.shoes,
|
|
801
|
-
categorySlug: displayedSubMenu,
|
|
802
|
-
isLoading: loading,
|
|
803
|
-
hasError: hasError,
|
|
804
|
-
onCloseSideNav: onCloseSideNav,
|
|
805
|
-
LinkComponent: LinkComponent
|
|
806
|
-
}), /*#__PURE__*/React__default.createElement(BrandsDropDown, {
|
|
807
|
-
subMenuOpen: subMenuOpen && displayedSubMenu === 'apparel',
|
|
808
|
-
onBackClick: onBackClick,
|
|
809
|
-
backIcon: backIcon,
|
|
810
|
-
subMenuCategoryTitle: "Department",
|
|
811
|
-
productUrl: productUrl,
|
|
812
|
-
categoryElements: addCategoryToElements(dropdownData.apparelStyles, categories.clothing.slug),
|
|
813
|
-
subMenuBrandsTitle: "Clothing Brands",
|
|
814
|
-
brandsList: dropdownData.apparel,
|
|
815
|
-
categorySlug: displayedSubMenu,
|
|
816
|
-
isLoading: loading,
|
|
817
|
-
hasError: hasError,
|
|
818
|
-
onCloseSideNav: onCloseSideNav,
|
|
819
|
-
LinkComponent: LinkComponent
|
|
820
|
-
}), /*#__PURE__*/React__default.createElement(BrandsDropDown, {
|
|
821
|
-
subMenuOpen: subMenuOpen && displayedSubMenu === 'accessories',
|
|
822
|
-
onBackClick: onBackClick,
|
|
823
|
-
backIcon: backIcon,
|
|
824
|
-
subMenuCategoryTitle: "Categories",
|
|
825
|
-
productUrl: productUrl,
|
|
826
|
-
categoryElements: removeCategoryByName(dropdownData.accessoriesCategories, 'ACCESSORIES'),
|
|
827
|
-
subMenuBrandsTitle: "Accessory Brands",
|
|
828
|
-
brandsList: dropdownData.accessories,
|
|
829
|
-
categorySlug: displayedSubMenu,
|
|
830
|
-
isLoading: loading,
|
|
831
|
-
hasError: hasError,
|
|
832
|
-
onCloseSideNav: onCloseSideNav,
|
|
833
|
-
LinkComponent: LinkComponent
|
|
834
|
-
}), /*#__PURE__*/React__default.createElement(BrandsDropDown, {
|
|
835
|
-
subMenuOpen: subMenuOpen && displayedSubMenu === 'watches',
|
|
836
|
-
onBackClick: onBackClick,
|
|
837
|
-
backIcon: backIcon,
|
|
838
|
-
subMenuCategoryTitle: "Department",
|
|
839
|
-
productUrl: productUrl,
|
|
840
|
-
categoryElements: addCategoryToElements(categoryElements, categories.watches.slug),
|
|
841
|
-
subMenuBrandsTitle: "Watches Brands",
|
|
842
|
-
brandsList: dropdownData.watches,
|
|
843
|
-
categorySlug: displayedSubMenu,
|
|
844
|
-
isLoading: loading,
|
|
845
|
-
hasError: hasError,
|
|
846
|
-
onCloseSideNav: onCloseSideNav,
|
|
847
|
-
LinkComponent: LinkComponent
|
|
848
|
-
}), displayedSubMenu === 'stores' && /*#__PURE__*/React__default.createElement("div", {
|
|
716
|
+
}))), renderDropdownLinks(), displayedSubMenu === 'stores' && /*#__PURE__*/React__default.createElement("div", {
|
|
849
717
|
className: "side-nav__content"
|
|
850
718
|
}, /*#__PURE__*/React__default.createElement(StoresDropdown, {
|
|
851
719
|
backIcon: backIcon,
|
|
@@ -855,6 +723,10 @@
|
|
|
855
723
|
})));
|
|
856
724
|
};
|
|
857
725
|
|
|
726
|
+
LuxitySideNav.defaultProps = {
|
|
727
|
+
onBlogClick: undefined
|
|
728
|
+
};
|
|
729
|
+
|
|
858
730
|
return LuxitySideNav;
|
|
859
731
|
|
|
860
732
|
})));
|
package/MaterialSelector.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react'), require('styled-components'), require('@bonlineza/b-lib/EllipsisLoader'), require('@bonlineza/b-lib/PageReady'), require('react-animate-height'), require('numeral'), require('stylis-rule-sheet'), require('react-dom'), require('prop-types'), require('raf'), require('react-input-autosize'), require('react-transition-group'), require('@bonlineza/b-lib/functions'), require('rc-slider'), require('react-notify-toast'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['react', 'styled-components', '@bonlineza/b-lib/EllipsisLoader', '@bonlineza/b-lib/PageReady', 'react-animate-height', 'numeral', 'stylis-rule-sheet', 'react-dom', 'prop-types', 'raf', 'react-input-autosize', 'react-transition-group', '@bonlineza/b-lib/functions', 'rc-slider', 'react-notify-toast', '
|
|
4
|
-
(global = global || self, global.MaterialSelector = factory(global.React, global.styled, global.EllipsisLoader, global.PageReady, global.AnimateHeight, global.numeral, global['stylis-rule-sheet'], global.reactDom, global.PropTypes, global.raf, global['react-input-autosize'], global['react-transition-group'], global.function, global.rcSlider, global['react-notify-toast'], global.
|
|
5
|
-
}(this, (function (React, styled, EllipsisLoader, PageReady, AnimateHeight, numeral, stylisRuleSheet, reactDom, PropTypes, raf, AutosizeInput, reactTransitionGroup, functions, rcSlider, Notifications,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react'), require('styled-components'), require('@bonlineza/b-lib/EllipsisLoader'), require('@bonlineza/b-lib/PageReady'), require('react-animate-height'), require('numeral'), require('stylis-rule-sheet'), require('react-dom'), require('prop-types'), require('raf'), require('react-input-autosize'), require('react-transition-group'), require('@bonlineza/b-lib/functions'), require('rc-slider'), require('react-notify-toast'), require('axios'), require('js-cookie')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['react', 'styled-components', '@bonlineza/b-lib/EllipsisLoader', '@bonlineza/b-lib/PageReady', 'react-animate-height', 'numeral', 'stylis-rule-sheet', 'react-dom', 'prop-types', 'raf', 'react-input-autosize', 'react-transition-group', '@bonlineza/b-lib/functions', 'rc-slider', 'react-notify-toast', 'axios', 'js-cookie'], factory) :
|
|
4
|
+
(global = global || self, global.MaterialSelector = factory(global.React, global.styled, global.EllipsisLoader, global.PageReady, global.AnimateHeight, global.numeral, global['stylis-rule-sheet'], global.reactDom, global.PropTypes, global.raf, global['react-input-autosize'], global['react-transition-group'], global.function, global.rcSlider, global['react-notify-toast'], global.axios, global.Cookies));
|
|
5
|
+
}(this, (function (React, styled, EllipsisLoader, PageReady, AnimateHeight, numeral, stylisRuleSheet, reactDom, PropTypes, raf, AutosizeInput, reactTransitionGroup, functions, rcSlider, Notifications, axios, Cookies) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var React__default = 'default' in React ? React['default'] : React;
|
|
8
8
|
var styled__default = 'default' in styled ? styled['default'] : styled;
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
raf = raf && Object.prototype.hasOwnProperty.call(raf, 'default') ? raf['default'] : raf;
|
|
16
16
|
AutosizeInput = AutosizeInput && Object.prototype.hasOwnProperty.call(AutosizeInput, 'default') ? AutosizeInput['default'] : AutosizeInput;
|
|
17
17
|
var Notifications__default = 'default' in Notifications ? Notifications['default'] : Notifications;
|
|
18
|
-
axiosInstance = axiosInstance && Object.prototype.hasOwnProperty.call(axiosInstance, 'default') ? axiosInstance['default'] : axiosInstance;
|
|
19
18
|
axios = axios && Object.prototype.hasOwnProperty.call(axios, 'default') ? axios['default'] : axios;
|
|
19
|
+
Cookies = Cookies && Object.prototype.hasOwnProperty.call(Cookies, 'default') ? Cookies['default'] : Cookies;
|
|
20
20
|
|
|
21
21
|
function ownKeys(object, enumerableOnly) {
|
|
22
22
|
var keys = Object.keys(object);
|
|
@@ -9586,9 +9586,9 @@
|
|
|
9586
9586
|
};
|
|
9587
9587
|
|
|
9588
9588
|
var _templateObject$D;
|
|
9589
|
-
var StyledHeader = styled__default.h5(_templateObject$D || (_templateObject$D = _taggedTemplateLiteral(["\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n\n @media (max-width: ", ") {\n display: block;\n }\n\n .icon-header__left {\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n\n @media (max-width: ", ") {\n align-self: flex-start;\n }\n\n svg {\n height: 1.5em;\n width: 1.5em;\n margin-right: ", ";\n }\n }\n\n .icon-header__right {\n display: flex;\n flex-grow: 1;\n justify-content: flex-end;\n }\n"])), media.sm, media.sm, function (props) {
|
|
9589
|
+
var StyledHeader = styled__default.h5(_templateObject$D || (_templateObject$D = _taggedTemplateLiteral(["\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n\n @media (max-width: ", ") {\n display: block;\n }\n\n .icon-header__left {\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n\n @media (max-width: ", ") {\n align-self: flex-start;\n }\n\n svg {\n height: 1.5em;\n width: 1.5em;\n margin-right: ", ";\n }\n }\n\n .icon-header__right {\n display: flex;\n flex-grow: 1;\n justify-content: flex-end;\n\n @media (max-width: ", ") {\n justify-content: flex-start;\n }\n }\n"])), media.sm, media.sm, function (props) {
|
|
9590
9590
|
return props.theme.marginPaddings[1];
|
|
9591
|
-
});
|
|
9591
|
+
}, media.sm);
|
|
9592
9592
|
|
|
9593
9593
|
/**
|
|
9594
9594
|
* IconHeader can render the standard Luxity Page/Section Header nodes with SVG
|
|
@@ -9633,7 +9633,7 @@
|
|
|
9633
9633
|
});
|
|
9634
9634
|
|
|
9635
9635
|
var _templateObject$E;
|
|
9636
|
-
var NotifyContainer = styled__default.div(_templateObject$E || (_templateObject$E = _taggedTemplateLiteral(["\n .page-ready {\n display: flex;\n align-items: center;\n }\n\n .notification-settings {\n display: flex;\n align-items: center;\n\n @media (max-width:
|
|
9636
|
+
var NotifyContainer = styled__default.div(_templateObject$E || (_templateObject$E = _taggedTemplateLiteral(["\n .page-ready {\n display: flex;\n align-items: center;\n }\n\n .notification-settings {\n display: flex;\n align-items: center;\n\n @media (max-width: ", ") {\n flex-direction: column;\n align-items: flex-end;\n padding: 10px 0;\n }\n }\n\n .notification-row-wrapper {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n\n @media (min-width: ", ") {\n justify-content: center;\n width: auto;\n }\n }\n\n .notification-dropdown-label {\n margin-left: 20px;\n\n @media (max-width: ", ") {\n margin-left: 0;\n }\n }\n\n .loader {\n min-width: 150px;\n }\n\n .notification-dropdown-select-container {\n min-width: 110px;\n\n .notification-dropdown-select__control {\n min-height: auto;\n background-color: ", ";\n border: none;\n border-radius: 0;\n\n &--is-focused {\n border: none;\n border-radius: 0;\n box-shadow: none;\n }\n\n .notification-dropdown-select__value-container {\n & > div {\n padding: 0;\n margin: 0;\n color: ", ";\n }\n & .notification-dropdown-select__single-value,\n & .notification-dropdown-select__placeholder {\n overflow: visible;\n font-weight: lighter;\n }\n }\n }\n }\n\n .notification-dropdown-select__indicators {\n padding: 0 !important;\n .notification-dropdown-select__dropdown-indicator {\n color: ", ";\n }\n }\n\n .notification-dropdown-select__menu {\n border-radius: 0;\n\n & > .notification-dropdown-select__menu-list {\n border-radius: 0;\n\n & > .notification-dropdown-select__option {\n font-weight: bold;\n &:last-child {\n border-bottom: none;\n }\n\n &.notification-dropdown-select__option--is-focused {\n background-color: ", ";\n border-style: hidden;\n }\n &.notification-dropdown-select__option--is-selected {\n color: ", ";\n background-color: ", ";\n border-style: hidden;\n }\n &.notification-dropdown-select__option--is-selected.notification-dropdown-select__option--is-focused {\n border-style: hidden;\n }\n }\n }\n }\n"])), media.sm, media.lg, media.sm, function (props) {
|
|
9637
9637
|
return props.theme.colors.ntrlMin;
|
|
9638
9638
|
}, function (props) {
|
|
9639
9639
|
return props.theme.colors.base;
|
|
@@ -9747,7 +9747,7 @@
|
|
|
9747
9747
|
}, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
9748
9748
|
className: "notification-settings"
|
|
9749
9749
|
}, isVip && /*#__PURE__*/React__default.createElement("div", {
|
|
9750
|
-
className: "
|
|
9750
|
+
className: "notification-row-wrapper"
|
|
9751
9751
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9752
9752
|
className: "notification-dropdown-label"
|
|
9753
9753
|
}, "Notify me via WhatsApp:\xA0"), updating ? /*#__PURE__*/React__default.createElement(EllipsisLoader, null) : /*#__PURE__*/React__default.createElement(index$1, {
|
|
@@ -9766,7 +9766,7 @@
|
|
|
9766
9766
|
},
|
|
9767
9767
|
value: whatsappSelectedOption
|
|
9768
9768
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
9769
|
-
className: "
|
|
9769
|
+
className: "notification-row-wrapper"
|
|
9770
9770
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9771
9771
|
className: "notification-dropdown-label"
|
|
9772
9772
|
}, "Notify me via Email:\xA0"), updating ? /*#__PURE__*/React__default.createElement(EllipsisLoader, null) : /*#__PURE__*/React__default.createElement(index$1, {
|
|
@@ -11009,6 +11009,127 @@
|
|
|
11009
11009
|
}));
|
|
11010
11010
|
});
|
|
11011
11011
|
|
|
11012
|
+
function getToken() {
|
|
11013
|
+
var _Cookies$get;
|
|
11014
|
+
|
|
11015
|
+
return (_Cookies$get = Cookies.get('_tk')) === null || _Cookies$get === void 0 ? void 0 : _Cookies$get.replace('*', 'Bearer ');
|
|
11016
|
+
}
|
|
11017
|
+
function setToken(value) {
|
|
11018
|
+
Cookies.set('_tk', value, 30);
|
|
11019
|
+
}
|
|
11020
|
+
|
|
11021
|
+
/** @format */
|
|
11022
|
+
|
|
11023
|
+
function getEncodedSearch(currentUrl) {
|
|
11024
|
+
var splitUrl = currentUrl.split('?');
|
|
11025
|
+
var baseUrl = splitUrl[0];
|
|
11026
|
+
var nextUrlSegments = splitUrl[1].split('&');
|
|
11027
|
+
var nextQueryString = splitUrl[1];
|
|
11028
|
+
|
|
11029
|
+
if (nextUrlSegments.length > 0) {
|
|
11030
|
+
nextQueryString = nextUrlSegments.map(function (v) {
|
|
11031
|
+
var nextValue = v;
|
|
11032
|
+
|
|
11033
|
+
if (v.includes('search=')) {
|
|
11034
|
+
var temp = v.split('=');
|
|
11035
|
+
nextValue = "".concat(temp[0], "=").concat(encodeURIComponent(temp[1]));
|
|
11036
|
+
}
|
|
11037
|
+
|
|
11038
|
+
return nextValue;
|
|
11039
|
+
}).join('&');
|
|
11040
|
+
}
|
|
11041
|
+
|
|
11042
|
+
return "".concat(baseUrl, "?").concat(nextQueryString);
|
|
11043
|
+
}
|
|
11044
|
+
/**
|
|
11045
|
+
* Gets an instance of Axios that is configured with the custom failure handlers
|
|
11046
|
+
* @param {Function} onAuthFailed - callback triggers when auth fails - ie, server error is one of ['token_invalid', 'token_not_provided', 'user_not_found', 'token_expired'] or http status is one of [401, 503, 400]
|
|
11047
|
+
* @param {Function} onForbidden - callback triggers when http status = 403
|
|
11048
|
+
*/
|
|
11049
|
+
|
|
11050
|
+
|
|
11051
|
+
var axiosInstance = function axiosInstance(onAuthFailed, onForbidden) {
|
|
11052
|
+
var instance = axios.create({
|
|
11053
|
+
validateStatus: function validateStatus(status) {
|
|
11054
|
+
return status >= 200 && status < 300;
|
|
11055
|
+
}
|
|
11056
|
+
});
|
|
11057
|
+
var token = getToken();
|
|
11058
|
+
|
|
11059
|
+
if (token !== '') {
|
|
11060
|
+
instance.defaults.headers.common.Authorization = token;
|
|
11061
|
+
}
|
|
11062
|
+
|
|
11063
|
+
instance.defaults.headers.common['Content-Type'] = 'application/json;charset=UTF-8'; // Add a request interceptor
|
|
11064
|
+
|
|
11065
|
+
instance.interceptors.request.use(function (request, error) {
|
|
11066
|
+
if (error) {
|
|
11067
|
+
return Promise.reject(error.response);
|
|
11068
|
+
}
|
|
11069
|
+
|
|
11070
|
+
if (request.url.includes('search') && request.url.includes('?')) {
|
|
11071
|
+
// do some uri manipulation for ie
|
|
11072
|
+
// https://stackoverflow.com/questions/18220057
|
|
11073
|
+
// eslint-disable-next-line no-param-reassign
|
|
11074
|
+
request.url = getEncodedSearch(request.url);
|
|
11075
|
+
} // eslint-disable-next-line no-param-reassign
|
|
11076
|
+
|
|
11077
|
+
|
|
11078
|
+
request.headers.common['Content-Type'] = 'application/json; charset=utf-8';
|
|
11079
|
+
|
|
11080
|
+
if (typeof request.body === 'undefined') {
|
|
11081
|
+
request.body = {};
|
|
11082
|
+
}
|
|
11083
|
+
|
|
11084
|
+
token = getToken();
|
|
11085
|
+
|
|
11086
|
+
if (token !== '') {
|
|
11087
|
+
// eslint-disable-next-line no-param-reassign
|
|
11088
|
+
request.headers.common.Authorization = token;
|
|
11089
|
+
}
|
|
11090
|
+
|
|
11091
|
+
return request;
|
|
11092
|
+
}, function (error) {
|
|
11093
|
+
return Promise.reject(error.message);
|
|
11094
|
+
}); // Add a response interceptor
|
|
11095
|
+
|
|
11096
|
+
instance.interceptors.response.use(function (response, error) {
|
|
11097
|
+
if (error) {
|
|
11098
|
+
return Promise.reject(error.response);
|
|
11099
|
+
}
|
|
11100
|
+
|
|
11101
|
+
if (response.headers.authorization) {
|
|
11102
|
+
setToken(response.headers.authorization);
|
|
11103
|
+
}
|
|
11104
|
+
|
|
11105
|
+
return response;
|
|
11106
|
+
}, function (error) {
|
|
11107
|
+
if (error.response) {
|
|
11108
|
+
// network error
|
|
11109
|
+
if (error.response.data && error.response.data.error && (error.response.data.error === 'token_invalid' || error.response.data.error === 'token_not_provided' || error.response.data.error === 'user_not_found' || error.response.data.error === 'token_expired') || error.response.status === 401 || error.response.status === 503 || error.response.status === 400) {
|
|
11110
|
+
onAuthFailed();
|
|
11111
|
+
} // if (error.response.status === 500) {
|
|
11112
|
+
// // INTERNAL SERVER ERROR
|
|
11113
|
+
// store.dispatch({
|
|
11114
|
+
// type: AppConstants.OVERLAY.SERVER_ERROR,
|
|
11115
|
+
// });
|
|
11116
|
+
// return Promise.reject(error.response);
|
|
11117
|
+
// }
|
|
11118
|
+
|
|
11119
|
+
|
|
11120
|
+
if (error.response.status === 403) {
|
|
11121
|
+
// FORBIDDEN
|
|
11122
|
+
onForbidden();
|
|
11123
|
+
}
|
|
11124
|
+
|
|
11125
|
+
return Promise.reject(error.response);
|
|
11126
|
+
}
|
|
11127
|
+
|
|
11128
|
+
return Promise.reject(error);
|
|
11129
|
+
});
|
|
11130
|
+
return instance;
|
|
11131
|
+
}; // NOTE: this to be instanciated with params: onAuthFailed, onForbidden
|
|
11132
|
+
|
|
11012
11133
|
var _excluded$8 = ["children"];
|
|
11013
11134
|
|
|
11014
11135
|
var DropdownSelector = function DropdownSelector(_ref) {
|