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