intelicoreact 2.0.10 → 2.0.12

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/layout.js CHANGED
@@ -12,20 +12,6 @@ import { AlertTriangle, HelpCircle } from "react-feather";
12
12
  // src/Functions/utils.js
13
13
  import { useEffect } from "react";
14
14
  import moment from "moment-timezone";
15
- var handleObjectChange = (updateObject, updateFunction) => (data, prop = "", isNumber) => {
16
- let value;
17
- if (data?.target) {
18
- value = data.target.type === "checkbox" ? data.target.checked : data.target.value;
19
- } else value = data;
20
- value = isNumber ? Number(value) : value;
21
- const props = prop.split(".");
22
- const currentObject = props.reduce((res, chapter, index) => {
23
- if (props.length !== index + 1) res = res[chapter];
24
- return res;
25
- }, updateObject);
26
- currentObject[props.pop()] = value;
27
- updateFunction();
28
- };
29
15
  var firstLetterCapital = (str) => typeof str === "string" ? `${str.charAt(0).toUpperCase()}${str.slice(1)}` : str;
30
16
  var capitalized = firstLetterCapital;
31
17
  String.prototype.longerThan = function(compareWith) {
@@ -431,556 +417,10 @@ function Header({
431
417
  }
432
418
  var Header_default = Header;
433
419
 
434
- // src/Atomic/Layout/MainMenu/MainMenu.tsx
435
- import cn7 from "classnames";
436
- import { useState as useState5 } from "react";
437
- import * as Icons3 from "react-feather";
438
- import { NavLink as NavLink3 } from "react-router-dom";
439
-
440
- // src/Langs.js
441
- var Langs = {
442
- en: {
443
- auth: {},
444
- settings: {},
445
- labels: {
446
- industries: "Industries",
447
- includedLenders: "Included Lenders",
448
- admin: "Administrator",
449
- user: "User",
450
- help: "Help",
451
- description: "Description",
452
- value: "Value",
453
- paramName: "Parameter name(key)",
454
- active: "Active",
455
- pause: "Pause",
456
- error: "Error",
457
- sold: "Sold",
458
- processing: "Processing",
459
- home: "Home",
460
- goods: "Goods",
461
- improvement: "Improvement",
462
- jewelry: "Jewelry",
463
- firstName: "First Name",
464
- lastName: "Last Name",
465
- dateOfBirth: "Date of Birth",
466
- militaryStatus: "Military status",
467
- ssn: "SSN",
468
- lengthAtAddress: "Length At Address",
469
- rentOrOwn: "Rent or Own",
470
- zip: "ZIP",
471
- city: "City",
472
- state: "State",
473
- address: "Address",
474
- email: "E-mail",
475
- homePhone: "Home Phone",
476
- cellPhone: "Cell Phone",
477
- contactTime: "Contact Time",
478
- dlState: "DL state",
479
- dlNumber: "DL number",
480
- ownCar: "Do you own a car?",
481
- tcpaOptin: "TCPA OPTIN",
482
- incomeSource: "Income Source",
483
- timeEmployed: "Time Employed",
484
- jobTitle: "Job Title",
485
- currentEmployer: "Current Employer",
486
- employersPhone: "Employer's Phone",
487
- netMonthlyIncome: "Net monthly income",
488
- howOftenIsPaid: "How often is paid",
489
- nextPayDate: "Next Pay Date",
490
- secondPayDate: "Second Pay Date",
491
- loanAmount: "Loan amount",
492
- ip: "IP",
493
- storyName: "Story name",
494
- channelName: "Channel name",
495
- employmentInfo: "Employment Information",
496
- personalDetails: "Personal Details",
497
- offer: "Offer",
498
- offers: "Offers",
499
- status: "Status",
500
- name: "Name",
501
- from: "From",
502
- to: "to",
503
- periodMonths: "Period (months)",
504
- loansSent: "Loans Sent",
505
- approved: "Approved",
506
- rejected: "Rejected",
507
- loanAmountApproved: "Loan Amount Approved ($)",
508
- loanAmountRejected: "Loan Amount Rejected ($)",
509
- approveRate: "Approve Rate (%)",
510
- actions: "Actions",
511
- locations: "Locations",
512
- score: "Score",
513
- priority: "Priority",
514
- lender: "Lender",
515
- weight: "Weight",
516
- selectLender: "Select lender"
517
- },
518
- singulars: {},
519
- titles: {
520
- pingTree: "Ping tree",
521
- edit: "Edit",
522
- create: "Create",
523
- add: "Add",
524
- consumerInfo: "Consumer info",
525
- personalDetails: "Personal Details",
526
- employmentInfo: "Employment Information",
527
- tools: "Tools",
528
- lenders: "Lenders",
529
- settings: "Settings",
530
- dashboard: "Dashboard",
531
- consumers: "Consumers",
532
- ticketDesk: "Ticket desk",
533
- accounting: "Accounting",
534
- users: "Users",
535
- merchants: "Merchants",
536
- lenderPingTree: "Lender Ping Tree",
537
- reports: "Reports",
538
- leads: "Leads",
539
- location: "Location",
540
- mainMenu: "Main menu",
541
- partners: "Partners",
542
- other: "Other",
543
- homeGoodsAndInteriorDesign: "Home Goods and Interior Design"
544
- },
545
- placeholders: {
546
- typeName: "Type name",
547
- params: "Params placeholder",
548
- value: "Value placeholder",
549
- description: "Description placeholder"
550
- },
551
- hints: {
552
- landerNotIncluded: "Lender is not included in Ping Tree by the \u201CHome Goods\u201D industry",
553
- noMerchants: "No Merchants for the \u201CHome Goods\u201D industry"
554
- },
555
- buttons: {
556
- create: "Create",
557
- edit: "Edit",
558
- add: "Add",
559
- close: "Close",
560
- apply: "Apply",
561
- pingTree: "Ping tree",
562
- addRow: "Add row",
563
- consumerInfo: "Consumer Info",
564
- deletePingTree: "Delete Ping Tree",
565
- cancel: "Cancel"
566
- },
567
- radioButtons: {},
568
- weekDays: {
569
- su: "Su",
570
- mo: "Mo",
571
- tu: "Tu",
572
- we: "We",
573
- th: "Th",
574
- fr: "Fr",
575
- sa: "Sa"
576
- },
577
- alerts: {
578
- lendersWillBeRemoved: "lenders will be removed"
579
- },
580
- checkboxes: {
581
- homeGoods: "Home Goods",
582
- travel: "Travel",
583
- energyImprovement: "Energy Improvement",
584
- jewelryIncluded: "Jewelry (included in PingTree name 2)",
585
- jewelry: "Jewelry",
586
- autoRepair: "Auto Repair",
587
- cosmetics: "Cosmetics",
588
- health: "Health"
589
- },
590
- errors: {},
591
- texts: {},
592
- tabs: {
593
- general: "General",
594
- payments: "Payments",
595
- filters: "Filters",
596
- offers: "Offers",
597
- merchants: "Merchants",
598
- integration: "Integration",
599
- customDetails: "Custom details",
600
- customerDetails: "Customer details",
601
- postsLog: "Posts log"
602
- },
603
- toasts: {}
604
- }
605
- };
606
- var Langs_default = Langs;
607
-
608
- // src/Atomic/UI/Accordion/Accordion.tsx
609
- import cn6 from "classnames";
610
- import { useState as useState4 } from "react";
611
- import * as Icons2 from "react-feather";
612
- import { NavLink as NavLink2 } from "react-router-dom";
613
-
614
- // src/Atomic/UI/Accordion/AccordionItem.tsx
615
- import cn5 from "classnames";
616
- import { useEffect as useEffect3, useRef as useRef3, useState as useState3 } from "react";
617
- import * as Icons from "react-feather";
618
- import { NavLink } from "react-router-dom";
619
-
620
- // src/Atomic/UI/Status/Status.tsx
621
- import cn4 from "classnames";
622
- import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
623
- function defaultOnClick() {
624
- }
625
- var Status = ({
626
- icon,
627
- value,
628
- label,
629
- status,
630
- disabled,
631
- type,
632
- active = 0,
633
- pause = 0,
634
- className,
635
- noBackground,
636
- children,
637
- testId = "status",
638
- onClick = defaultOnClick
639
- }) => {
640
- if (!status) return null;
641
- const text = children && typeof children === "string" ? children : value || label || status;
642
- const formattedLabel = text?.[0].toUpperCase() + text?.slice(1);
643
- return /* @__PURE__ */ jsx5("div", { onClick, "data-testid": testId, className: cn4({ disabled }, className), children: type === "number" ? /* @__PURE__ */ jsx5("div", { children: active === 0 && pause === 0 ? /* @__PURE__ */ jsx5("div", { className: "status status--error", children: /* @__PURE__ */ jsx5("span", { children: active }) }) : /* @__PURE__ */ jsxs5("div", { className: "status status--warning", children: [
644
- /* @__PURE__ */ jsx5("span", { className: "status--number-active", children: active }),
645
- /* @__PURE__ */ jsx5("span", { className: "color--gray-gull", children: " / " }),
646
- /* @__PURE__ */ jsx5("span", { className: pause > 0 ? "color--froly" : "color--gray-gull", children: pause })
647
- ] }) }) : /* @__PURE__ */ jsxs5(
648
- "div",
649
- {
650
- className: cn4(
651
- "status",
652
- `status--${status}`,
653
- {
654
- "status--no-bg": noBackground && status === "pause",
655
- "color--gray-gull": noBackground && status === "pause" && !className,
656
- "j4": !!icon
657
- },
658
- className
659
- ),
660
- children: [
661
- icon,
662
- formattedLabel
663
- ]
664
- }
665
- ) });
666
- };
667
- var Status_default = Status;
668
-
669
- // src/Atomic/UI/Status/index.ts
670
- var Status_default2 = Status_default;
671
-
672
- // src/Atomic/UI/Accordion/AccordionItem.tsx
673
- import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
674
- var AccordionItem = ({
675
- item,
676
- onClick,
677
- isOpen,
678
- className,
679
- children,
680
- noChevron,
681
- testId = "accordion-item"
682
- }) => {
683
- const Icon = Icons[item.icon];
684
- const [maxHeight, setMaxHeight] = useState3(0);
685
- const ref = useRef3(null);
686
- const getItemsHeight = () => {
687
- let itemHeight = 0;
688
- ref.current?.childNodes.forEach((el) => {
689
- itemHeight += el.offsetHeight;
690
- });
691
- return itemHeight + 20;
692
- };
693
- useEffect3(() => {
694
- setMaxHeight(isOpen ? getItemsHeight() : 0);
695
- }, [isOpen]);
696
- const calculateStatusCount = () => {
697
- return item?.rows?.reduce(
698
- (acc, row) => {
699
- const result = row.cols.reduce(
700
- (accum, col) => ({
701
- active: accum.active + (col.status === "active" ? 1 : 0),
702
- pause: accum.pause + (col.status === "pause" ? 1 : 0)
703
- }),
704
- { active: 0, pause: 0 }
705
- );
706
- return {
707
- active: acc.active + result.active,
708
- pause: acc.pause + result.pause
709
- };
710
- },
711
- { active: 0, pause: 0 }
712
- );
713
- };
714
- return /* @__PURE__ */ jsxs6(
715
- "div",
716
- {
717
- "data-testid": testId,
718
- className: cn5("accordion--item", className),
719
- role: "region",
720
- "aria-labelledby": `accordion-title-${item.title}`,
721
- children: [
722
- /* @__PURE__ */ jsxs6(
723
- "div",
724
- {
725
- className: cn5("accordion--title-box", {
726
- "accordion--title-open": isOpen
727
- }),
728
- onClick: () => onClick(!isOpen),
729
- id: `accordion-title-${item.title}`,
730
- role: "button",
731
- "aria-expanded": isOpen,
732
- "aria-controls": `accordion-content-${item.title}`,
733
- tabIndex: 0,
734
- children: [
735
- /* @__PURE__ */ jsxs6("div", { className: "j4 no-wrap", children: [
736
- item?.icon && /* @__PURE__ */ jsx6(Icon, { className: cn5("mr5", item?.className), "aria-hidden": "true" }),
737
- /* @__PURE__ */ jsx6("span", { className: "accordion--title", children: item.title || "Menu Chapter" })
738
- ] }),
739
- /* @__PURE__ */ jsxs6("div", { className: "j6 accordion-title__right-box", children: [
740
- item.status && /* @__PURE__ */ jsx6("div", { className: "mr5", children: /* @__PURE__ */ jsx6(
741
- Status_default2,
742
- {
743
- type: item?.status.type,
744
- value: item?.status.value,
745
- status: item?.status.status,
746
- active: calculateStatusCount()?.active,
747
- pause: calculateStatusCount()?.pause
748
- }
749
- ) }),
750
- !noChevron && /* @__PURE__ */ jsx6(
751
- Icons.ChevronRight,
752
- {
753
- "aria-hidden": "true",
754
- className: cn5("accordion--title-chevron", {
755
- "accordion--title-chevron-open": isOpen
756
- })
757
- }
758
- )
759
- ] })
760
- ]
761
- }
762
- ),
763
- /* @__PURE__ */ jsx6(
764
- "div",
765
- {
766
- ref,
767
- style: { maxHeight },
768
- className: cn5("accordion--content", {
769
- "accordion--content-is-open": isOpen
770
- }),
771
- id: `accordion-content-${item.title}`,
772
- role: "region",
773
- "aria-labelledby": `accordion-title-${item.title}`,
774
- children: item.children ? item.children.map((el) => {
775
- return /* @__PURE__ */ jsx6(NavLink, { to: el.link, className: "accordion--content-item accordion--menu-link", children: el?.title || "Menu item" }, el.id);
776
- }) : children
777
- }
778
- )
779
- ]
780
- }
781
- );
782
- };
783
- var AccordionItem_default = AccordionItem;
784
-
785
- // src/Atomic/UI/Accordion/Accordion.tsx
786
- import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
787
- var CN2 = "accordion";
788
- var Accordion = ({
789
- items,
790
- className,
791
- itemClassName,
792
- isMenuHovered,
793
- isOpen,
794
- testId = CN2
795
- }) => {
796
- const [data, setData] = useState4(items);
797
- const onChange = handleObjectChange(setData, () => setData([...data]));
798
- const handleArrayChange = (e, index, prop) => {
799
- data[index][prop] = e;
800
- onChange(data);
801
- };
802
- return /* @__PURE__ */ jsx7("div", { className: cn6(CN2, className), "data-testid": testId, role: "list", "aria-label": "Accordion list", children: items?.map((item, index) => {
803
- const Icon = Icons2[item.icon];
804
- return item.link ? /* @__PURE__ */ jsxs7(
805
- NavLink2,
806
- {
807
- "data-testid": `${testId}-link-${index}`,
808
- to: item.link,
809
- className: cn6("main-menu--item main-menu--items-box-title"),
810
- children: [
811
- item?.icon && /* @__PURE__ */ jsx7(Icon, { className: cn6("mr5", item?.className) }),
812
- /* @__PURE__ */ jsx7("span", { className: cn6({ hidden: !isOpen && !isMenuHovered }), children: item?.title || "Link" })
813
- ]
814
- },
815
- index
816
- ) : /* @__PURE__ */ jsx7(
817
- AccordionItem_default,
818
- {
819
- testId: `${testId}-item-${index}`,
820
- className: itemClassName,
821
- item,
822
- isOpen: !!item.isOpen,
823
- onClick: (value) => handleArrayChange(value, index, "isOpen")
824
- },
825
- index
826
- );
827
- }) });
828
- };
829
- var Accordion_default = Accordion;
830
-
831
- // src/Atomic/Layout/MainMenu/MainMenu.tsx
832
- import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
833
- function MainMenu(props) {
834
- const { items, className } = props;
835
- const lng = globalThis.lng;
836
- const txt = Langs_default[lng];
837
- const [isOpen, setIsOpen] = useState5(true);
838
- const [isMenuHovered, setIsMenuHovered] = useState5(false);
839
- const [isMenuIconHovered, setIsMenuIconHovered] = useState5(false);
840
- const chapterClass = cn7("main-menu--items-box-chapter", {
841
- "main-menu--items-box-chapter-hidden": !isOpen && !isMenuHovered
842
- });
843
- const accordionClass = cn7("main-menu--accordion", {
844
- "main-menu--accordion-hidden": !isOpen && !isMenuHovered
845
- });
846
- const itemsBoxClass = cn7("main-menu--items-box", {
847
- "main-menu--items-box-closed": !isOpen && !isMenuHovered
848
- });
849
- const mainMenuClass = cn7("main-menu", className, {
850
- "main-menu--closed": !isOpen && !isMenuHovered
851
- });
852
- const onMenuHover = () => {
853
- if (!isOpen) {
854
- setIsMenuHovered(!isMenuHovered);
855
- items.mainMenu.forEach((item) => {
856
- item.isOpen = false;
857
- });
858
- items.partners.forEach((item) => {
859
- item.isOpen = false;
860
- });
861
- items.other.forEach((item) => {
862
- item.isOpen = false;
863
- });
864
- }
865
- };
866
- const onCloseMenu = () => {
867
- setIsOpen(!isOpen);
868
- items.mainMenu.forEach((item) => {
869
- item.isOpen = false;
870
- });
871
- items.partners.forEach((item) => {
872
- item.isOpen = false;
873
- });
874
- items.other.forEach((item) => {
875
- item.isOpen = false;
876
- });
877
- };
878
- const changeMenuIcon = () => {
879
- if (isOpen && !isMenuIconHovered) return /* @__PURE__ */ jsx8(Icons3.Menu, {});
880
- if (isOpen && isMenuIconHovered) return /* @__PURE__ */ jsx8(Icons3.ChevronLeft, {});
881
- if (!isOpen && isMenuHovered) return /* @__PURE__ */ jsx8(Icons3.ChevronRight, {});
882
- if (!isOpen) return /* @__PURE__ */ jsx8("div", { className: "main-menu--logo-close" });
883
- return null;
884
- };
885
- return /* @__PURE__ */ jsxs8(
886
- "div",
887
- {
888
- className: mainMenuClass,
889
- onMouseEnter: () => onMenuHover(),
890
- onMouseLeave: () => setIsMenuHovered(false),
891
- children: [
892
- /* @__PURE__ */ jsxs8(
893
- "div",
894
- {
895
- className: cn7("main-menu--header", {
896
- "main-menu--header-closed": !isOpen && !isMenuHovered
897
- }),
898
- children: [
899
- /* @__PURE__ */ jsx8(
900
- "div",
901
- {
902
- className: cn7("main-menu--logo", {
903
- "main-menu--logo-none": !isOpen && !isMenuHovered
904
- })
905
- }
906
- ),
907
- /* @__PURE__ */ jsx8("div", { "data-testid": "main-menu--header-btn", className: "main-menu--header-btn", onClick: () => onCloseMenu(), children: /* @__PURE__ */ jsx8(
908
- "div",
909
- {
910
- className: "j5",
911
- onMouseEnter: () => setIsMenuIconHovered(true),
912
- onMouseLeave: () => setIsMenuIconHovered(false),
913
- children: changeMenuIcon()
914
- }
915
- ) })
916
- ]
917
- }
918
- ),
919
- /* @__PURE__ */ jsxs8("div", { className: itemsBoxClass, children: [
920
- /* @__PURE__ */ jsx8("div", { className: cn7("main-menu--items-box-main"), children: items.main.map((item, index) => {
921
- const Icon = Icons3[item.icon];
922
- return item.link ? /* @__PURE__ */ jsx8(
923
- NavLink3,
924
- {
925
- to: item.link,
926
- className: cn7("main-menu--items-box-title"),
927
- children: /* @__PURE__ */ jsxs8("div", { className: "main-menu--item", children: [
928
- /* @__PURE__ */ jsx8("div", { className: "df", children: /* @__PURE__ */ jsx8(Icon, { className: cn7("mr5", item.className) }) }),
929
- /* @__PURE__ */ jsx8("span", { className: cn7({ hidden: !isOpen && !isMenuHovered }), children: item?.title || "Link" })
930
- ] })
931
- },
932
- index
933
- ) : /* @__PURE__ */ jsx8(
934
- "span",
935
- {
936
- className: cn7("main-menu--items-box-title", {
937
- hidden: !isOpen && !isMenuHovered
938
- }),
939
- children: txt?.titles[item?.title]
940
- },
941
- index
942
- );
943
- }) }),
944
- /* @__PURE__ */ jsx8("div", { className: chapterClass, children: /* @__PURE__ */ jsx8("span", { children: "Main menu" }) }),
945
- /* @__PURE__ */ jsx8(
946
- Accordion_default,
947
- {
948
- className: accordionClass,
949
- items: items.mainMenu
950
- }
951
- ),
952
- /* @__PURE__ */ jsx8("div", { className: chapterClass, children: /* @__PURE__ */ jsx8("span", { children: "Partners" }) }),
953
- /* @__PURE__ */ jsx8(
954
- Accordion_default,
955
- {
956
- isOpen,
957
- isMenuHovered,
958
- className: accordionClass,
959
- items: items.partners
960
- }
961
- ),
962
- /* @__PURE__ */ jsx8("div", { className: chapterClass, children: /* @__PURE__ */ jsx8("span", { children: "Other" }) }),
963
- /* @__PURE__ */ jsx8(
964
- Accordion_default,
965
- {
966
- className: accordionClass,
967
- isOpen,
968
- isMenuHovered,
969
- items: items.other
970
- }
971
- )
972
- ] })
973
- ]
974
- }
975
- );
976
- }
977
- var MainMenu_default = MainMenu;
978
-
979
420
  // src/Atomic/Layout/Spinner/index.ts
980
421
  var Spinner_default2 = Spinner_default;
981
422
  export {
982
423
  Header_default as Header,
983
- MainMenu_default as MainMenu,
984
424
  Spinner_default2 as Spinner
985
425
  };
986
426
  //# sourceMappingURL=layout.js.map