intelicoreact 2.0.3 → 2.0.5
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/Modal/index.d.ts +3 -0
- package/dist/form.cjs +1853 -1779
- package/dist/form.cjs.map +4 -4
- package/dist/form.d.ts +42 -17
- package/dist/form.js +1848 -1774
- package/dist/form.js.map +4 -4
- package/dist/index.cjs +2219 -2131
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +2036 -1948
- package/dist/index.js.map +4 -4
- package/dist/intelicoreact.css +1 -1
- package/dist/ui.cjs +398 -366
- package/dist/ui.cjs.map +4 -4
- package/dist/ui.d.ts +11 -7
- package/dist/ui.js +270 -238
- package/dist/ui.js.map +4 -4
- package/package.json +1 -1
package/dist/ui.cjs
CHANGED
|
@@ -33,22 +33,24 @@ __export(ui_exports, {
|
|
|
33
33
|
AccordionTable: () => AccordionTable_default,
|
|
34
34
|
AccordionText: () => AccordionText_default,
|
|
35
35
|
AdvTag: () => AdvTag_default,
|
|
36
|
-
AdvancedTags: () =>
|
|
37
|
-
Alert: () =>
|
|
36
|
+
AdvancedTags: () => AdvancedTag_default,
|
|
37
|
+
Alert: () => Alert_default2,
|
|
38
38
|
Arrow: () => Arrow_default,
|
|
39
39
|
Box: () => Box_default,
|
|
40
40
|
Button: () => Button_default,
|
|
41
|
-
ButtonsBar: () =>
|
|
42
|
-
Chart: () =>
|
|
41
|
+
ButtonsBar: () => ButtonsBar_default2,
|
|
42
|
+
Chart: () => Chart_default2,
|
|
43
43
|
CircleProgressBar: () => CircleProgressBar_default,
|
|
44
44
|
DateTime: () => DateTime_default,
|
|
45
45
|
DebugContainer: () => DebugContainer_default,
|
|
46
|
-
DoubleString: () =>
|
|
46
|
+
DoubleString: () => DoubleString_default2,
|
|
47
47
|
DynamicIcon: () => DynamicIcon_default2,
|
|
48
48
|
EVENTS: () => EVENTS,
|
|
49
49
|
Hint: () => Hint_default2,
|
|
50
50
|
Modal: () => Modal_default2,
|
|
51
|
+
ModalFooter: () => ModalFooter_default,
|
|
51
52
|
ModalHOC: () => ModalHOC_default,
|
|
53
|
+
ModalTitle: () => ModalTitle_default,
|
|
52
54
|
MonoAccordion: () => MonoAccordion_default2,
|
|
53
55
|
NavLine: () => NavLine_default2,
|
|
54
56
|
PageTitle: () => PageTitle_default2,
|
|
@@ -62,7 +64,9 @@ __export(ui_exports, {
|
|
|
62
64
|
TagList: () => TagList_default,
|
|
63
65
|
UserBox: () => UserBox_default2,
|
|
64
66
|
WizardStepper: () => WizardStepper_default,
|
|
65
|
-
dispatchEventForModalManagement: () => dispatchEventForModalManagement
|
|
67
|
+
dispatchEventForModalManagement: () => dispatchEventForModalManagement,
|
|
68
|
+
useDebugContainer: () => useDebugContainer_default,
|
|
69
|
+
useMobileModal: () => useMobileModal
|
|
66
70
|
});
|
|
67
71
|
module.exports = __toCommonJS(ui_exports);
|
|
68
72
|
|
|
@@ -7101,6 +7105,9 @@ var AdvancedTags = ({
|
|
|
7101
7105
|
};
|
|
7102
7106
|
var AdvancedTags_default = AdvancedTags;
|
|
7103
7107
|
|
|
7108
|
+
// src/Atomic/UI/AdvancedTag/index.ts
|
|
7109
|
+
var AdvancedTag_default = AdvancedTags_default;
|
|
7110
|
+
|
|
7104
7111
|
// src/Atomic/UI/Alert/Alert.tsx
|
|
7105
7112
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
7106
7113
|
|
|
@@ -7225,6 +7232,9 @@ var Alert = ({
|
|
|
7225
7232
|
};
|
|
7226
7233
|
var Alert_default = Alert;
|
|
7227
7234
|
|
|
7235
|
+
// src/Atomic/UI/Alert/index.ts
|
|
7236
|
+
var Alert_default2 = Alert_default;
|
|
7237
|
+
|
|
7228
7238
|
// src/Atomic/UI/Arrow/Arrow.tsx
|
|
7229
7239
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
7230
7240
|
var import_classnames13 = __toESM(require("classnames"), 1);
|
|
@@ -7488,6 +7498,9 @@ var ButtonsBar = ({
|
|
|
7488
7498
|
};
|
|
7489
7499
|
var ButtonsBar_default = ButtonsBar;
|
|
7490
7500
|
|
|
7501
|
+
// src/Atomic/UI/ButtonsBar/index.ts
|
|
7502
|
+
var ButtonsBar_default2 = ButtonsBar_default;
|
|
7503
|
+
|
|
7491
7504
|
// src/Atomic/UI/Chart/Chart.tsx
|
|
7492
7505
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
7493
7506
|
|
|
@@ -8321,6 +8334,9 @@ var Chart = ({
|
|
|
8321
8334
|
};
|
|
8322
8335
|
var Chart_default = Chart;
|
|
8323
8336
|
|
|
8337
|
+
// src/Atomic/UI/Chart/index.ts
|
|
8338
|
+
var Chart_default2 = Chart_default;
|
|
8339
|
+
|
|
8324
8340
|
// src/Atomic/UI/CircleProgressBar/CircleProgressBar.js
|
|
8325
8341
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
8326
8342
|
var import_react19 = __toESM(require("react"), 1);
|
|
@@ -8529,11 +8545,24 @@ var DebugContainer = ({ data = defaultData, children, className }) => {
|
|
|
8529
8545
|
};
|
|
8530
8546
|
var DebugContainer_default = DebugContainer;
|
|
8531
8547
|
|
|
8532
|
-
// src/Atomic/UI/
|
|
8548
|
+
// src/Atomic/UI/DebugContainer/useDebugContainer.tsx
|
|
8533
8549
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
8550
|
+
var import_react22 = require("react");
|
|
8551
|
+
function useDebugContainer() {
|
|
8552
|
+
const [data, setData] = (0, import_react22.useState)({});
|
|
8553
|
+
return {
|
|
8554
|
+
debugData: data,
|
|
8555
|
+
setDebugData: setData,
|
|
8556
|
+
renderDebugContainer: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DebugContainer_default, { data })
|
|
8557
|
+
};
|
|
8558
|
+
}
|
|
8559
|
+
var useDebugContainer_default = useDebugContainer;
|
|
8560
|
+
|
|
8561
|
+
// src/Atomic/UI/DoubleString/DoubleString.tsx
|
|
8562
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
8534
8563
|
var import_classnames21 = __toESM(require("classnames"), 1);
|
|
8535
8564
|
var import_moment = __toESM(require("moment"), 1);
|
|
8536
|
-
var
|
|
8565
|
+
var import_react23 = require("react");
|
|
8537
8566
|
var import_react_feather7 = require("react-feather");
|
|
8538
8567
|
var RC6 = "double-string";
|
|
8539
8568
|
var DoubleString = ({
|
|
@@ -8554,28 +8583,28 @@ var DoubleString = ({
|
|
|
8554
8583
|
isUseHideMode = false,
|
|
8555
8584
|
isShowHiddenValueAvailable = false
|
|
8556
8585
|
}) => {
|
|
8557
|
-
const [isValueHidden, setIsValueHidden] = (0,
|
|
8586
|
+
const [isValueHidden, setIsValueHidden] = (0, import_react23.useState)(isUseHideMode);
|
|
8558
8587
|
const computedValue = isFormatValueToDate ? (0, import_moment.default)(value, parseFormat).format(displayFormat) : value;
|
|
8559
|
-
const valueRef = (0,
|
|
8588
|
+
const valueRef = (0, import_react23.useRef)(null);
|
|
8560
8589
|
;
|
|
8561
|
-
const descriptionRef = (0,
|
|
8562
|
-
const [elemsWidth, setElemsWidth] = (0,
|
|
8590
|
+
const descriptionRef = (0, import_react23.useRef)(null);
|
|
8591
|
+
const [elemsWidth, setElemsWidth] = (0, import_react23.useState)({
|
|
8563
8592
|
valueWidth: 0,
|
|
8564
8593
|
descriptionWidth: 0
|
|
8565
8594
|
});
|
|
8566
|
-
const [isOnClickON, setIsOnClickON] = (0,
|
|
8595
|
+
const [isOnClickON, setIsOnClickON] = (0, import_react23.useState)(false);
|
|
8567
8596
|
const handle = {
|
|
8568
8597
|
click: () => {
|
|
8569
8598
|
setIsOnClickON(!isOnClickON);
|
|
8570
8599
|
}
|
|
8571
8600
|
};
|
|
8572
|
-
(0,
|
|
8601
|
+
(0, import_react23.useEffect)(() => {
|
|
8573
8602
|
const valueWidth = valueRef?.current?.clientWidth ?? 0;
|
|
8574
8603
|
const descriptionWidth = descriptionRef?.current?.clientWidth ?? 0;
|
|
8575
8604
|
setElemsWidth({ valueWidth, descriptionWidth });
|
|
8576
8605
|
}, [descriptionRef, valueRef]);
|
|
8577
|
-
return /* @__PURE__ */ (0,
|
|
8578
|
-
/* @__PURE__ */ (0,
|
|
8606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { "data-testid": testId, className: (0, import_classnames21.default)(RC6, className), children: [
|
|
8607
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
8579
8608
|
"p",
|
|
8580
8609
|
{
|
|
8581
8610
|
onClick: () => handle.click(),
|
|
@@ -8588,41 +8617,44 @@ var DoubleString = ({
|
|
|
8588
8617
|
{ pointer: isUseOnClick }
|
|
8589
8618
|
),
|
|
8590
8619
|
title: !noTitle && elemsWidth.valueWidth > 99 ? computedValue : "",
|
|
8591
|
-
children: !revert ? /* @__PURE__ */ (0,
|
|
8592
|
-
isUseHideMode ? /* @__PURE__ */ (0,
|
|
8593
|
-
isUseHideMode && isShowHiddenValueAvailable && isValueHidden && /* @__PURE__ */ (0,
|
|
8594
|
-
isUseHideMode && isShowHiddenValueAvailable && !isValueHidden && /* @__PURE__ */ (0,
|
|
8595
|
-
valuePostfix && /* @__PURE__ */ (0,
|
|
8620
|
+
children: !revert ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
8621
|
+
isUseHideMode ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: !isValueHidden ? computedValue : "*********" }) : computedValue,
|
|
8622
|
+
isUseHideMode && isShowHiddenValueAvailable && isValueHidden && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_feather7.Eye, { "data-testid": "double-string-eye", className: `${RC6}__hide-mode-icon`, onClick: () => setIsValueHidden(false) }),
|
|
8623
|
+
isUseHideMode && isShowHiddenValueAvailable && !isValueHidden && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_feather7.EyeOff, { "data-testid": "double-string-eyeoff", className: `${RC6}__hide-mode-icon`, onClick: () => setIsValueHidden(true) }),
|
|
8624
|
+
valuePostfix && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: (0, import_classnames21.default)(`${RC6}__value-postfix`), children: valuePostfix })
|
|
8596
8625
|
] }) : description
|
|
8597
8626
|
}
|
|
8598
8627
|
),
|
|
8599
|
-
/* @__PURE__ */ (0,
|
|
8628
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
8600
8629
|
"p",
|
|
8601
8630
|
{
|
|
8602
8631
|
ref: descriptionRef,
|
|
8603
8632
|
className: (0, import_classnames21.default)(`${RC6}__description`),
|
|
8604
8633
|
title: !noTitle && elemsWidth.descriptionWidth > 99 ? computedValue : "",
|
|
8605
|
-
children: !revert ? description : /* @__PURE__ */ (0,
|
|
8634
|
+
children: !revert ? description : /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
8606
8635
|
computedValue,
|
|
8607
|
-
valuePostfix && /* @__PURE__ */ (0,
|
|
8636
|
+
valuePostfix && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: (0, import_classnames21.default)(`${RC6}__value-postfix`), children: valuePostfix })
|
|
8608
8637
|
] })
|
|
8609
8638
|
}
|
|
8610
8639
|
),
|
|
8611
|
-
subDescription && /* @__PURE__ */ (0,
|
|
8640
|
+
subDescription && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: (0, import_classnames21.default)(`${RC6}__sub-description`), children: subDescription })
|
|
8612
8641
|
] });
|
|
8613
8642
|
};
|
|
8614
8643
|
var DoubleString_default = DoubleString;
|
|
8615
8644
|
|
|
8645
|
+
// src/Atomic/UI/DoubleString/index.ts
|
|
8646
|
+
var DoubleString_default2 = DoubleString_default;
|
|
8647
|
+
|
|
8616
8648
|
// src/Atomic/UI/DynamicIcon/index.ts
|
|
8617
8649
|
var DynamicIcon_default2 = DynamicIcon_default;
|
|
8618
8650
|
|
|
8619
8651
|
// src/Atomic/UI/Hint/Hint.tsx
|
|
8620
|
-
var
|
|
8652
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
8621
8653
|
|
|
8622
8654
|
// src/Molecular/CustomIcons/components/HelpCircleFilled.tsx
|
|
8623
|
-
var
|
|
8655
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
8624
8656
|
function HelpCircleFilled(props) {
|
|
8625
|
-
return /* @__PURE__ */ (0,
|
|
8657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
8626
8658
|
"svg",
|
|
8627
8659
|
{
|
|
8628
8660
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8631,14 +8663,14 @@ function HelpCircleFilled(props) {
|
|
|
8631
8663
|
fill: "none",
|
|
8632
8664
|
...props,
|
|
8633
8665
|
children: [
|
|
8634
|
-
/* @__PURE__ */ (0,
|
|
8666
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8635
8667
|
"path",
|
|
8636
8668
|
{
|
|
8637
8669
|
fill: "#9AA0B9",
|
|
8638
8670
|
d: "M8 14.667A6.667 6.667 0 1 0 8 1.333a6.667 6.667 0 0 0 0 13.334Z"
|
|
8639
8671
|
}
|
|
8640
8672
|
),
|
|
8641
|
-
/* @__PURE__ */ (0,
|
|
8673
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8642
8674
|
"path",
|
|
8643
8675
|
{
|
|
8644
8676
|
stroke: "#fff",
|
|
@@ -8694,7 +8726,7 @@ function HandleClickOutsideObj(id, setIsOpen) {
|
|
|
8694
8726
|
|
|
8695
8727
|
// src/Atomic/UI/Hint/Hint.tsx
|
|
8696
8728
|
var import_classnames22 = __toESM(require("classnames"), 1);
|
|
8697
|
-
var
|
|
8729
|
+
var import_react24 = require("react");
|
|
8698
8730
|
var import_react_dom2 = require("react-dom");
|
|
8699
8731
|
var import_react_feather8 = require("react-feather");
|
|
8700
8732
|
var hintTimeoutMap = /* @__PURE__ */ new Map();
|
|
@@ -8722,13 +8754,13 @@ var Hint = ({
|
|
|
8722
8754
|
isLoading,
|
|
8723
8755
|
isCloseOnChildrenClick = false
|
|
8724
8756
|
}) => {
|
|
8725
|
-
const hintRef = (0,
|
|
8726
|
-
const [hintId] = (0,
|
|
8727
|
-
const [iAmOpenedOptions] = (0,
|
|
8728
|
-
const [isOpen, setIsOpen] = (0,
|
|
8729
|
-
const [isStyleComputed, setIsStyleComputed] = (0,
|
|
8730
|
-
const [handleScroll] = (0,
|
|
8731
|
-
const [handleClickOutside] = (0,
|
|
8757
|
+
const hintRef = (0, import_react24.useRef)(null);
|
|
8758
|
+
const [hintId] = (0, import_react24.useState)(id ?? key ?? Math.random().toString(16).slice(2));
|
|
8759
|
+
const [iAmOpenedOptions] = (0, import_react24.useState)({ ...I_AM_OPENED_EVENT_OPTIONS, detail: { hintId } });
|
|
8760
|
+
const [isOpen, setIsOpen] = (0, import_react24.useState)(false);
|
|
8761
|
+
const [isStyleComputed, setIsStyleComputed] = (0, import_react24.useState)(false);
|
|
8762
|
+
const [handleScroll] = (0, import_react24.useState)(new HandleScrollObj(setIsOpen));
|
|
8763
|
+
const [handleClickOutside] = (0, import_react24.useState)(new HandleClickOutsideObj(hintId, setIsOpen));
|
|
8732
8764
|
const isCallbackExist = typeof onClickCallback === "function";
|
|
8733
8765
|
const handle = {
|
|
8734
8766
|
onMouseEnter: () => {
|
|
@@ -8778,7 +8810,7 @@ var Hint = ({
|
|
|
8778
8810
|
}
|
|
8779
8811
|
};
|
|
8780
8812
|
const getHintMarkUp = (className2) => {
|
|
8781
|
-
return /* @__PURE__ */ (0,
|
|
8813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
8782
8814
|
"div",
|
|
8783
8815
|
{
|
|
8784
8816
|
"data-testid": "test-hint-text",
|
|
@@ -8790,7 +8822,7 @@ var Hint = ({
|
|
|
8790
8822
|
onClick: handle.onClick,
|
|
8791
8823
|
style: { visibility: isStyleComputed ? "visible" : "hidden" },
|
|
8792
8824
|
children: [
|
|
8793
|
-
isLoading && /* @__PURE__ */ (0,
|
|
8825
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Spinner_default, { size: "small" }),
|
|
8794
8826
|
hint,
|
|
8795
8827
|
children
|
|
8796
8828
|
]
|
|
@@ -8847,7 +8879,7 @@ var Hint = ({
|
|
|
8847
8879
|
if (!hc) return null;
|
|
8848
8880
|
return (0, import_react_dom2.createPortal)(getHintMarkUp(className2), hc);
|
|
8849
8881
|
};
|
|
8850
|
-
(0,
|
|
8882
|
+
(0, import_react24.useEffect)(() => {
|
|
8851
8883
|
initHintContainer(hintId, hintContainer);
|
|
8852
8884
|
const iAmOpenedCallback = (ev) => {
|
|
8853
8885
|
const event = ev;
|
|
@@ -8873,7 +8905,7 @@ var Hint = ({
|
|
|
8873
8905
|
}
|
|
8874
8906
|
};
|
|
8875
8907
|
}, []);
|
|
8876
|
-
(0,
|
|
8908
|
+
(0, import_react24.useEffect)(() => {
|
|
8877
8909
|
setIsStyleComputed(false);
|
|
8878
8910
|
setHintContainerStyles();
|
|
8879
8911
|
onOpenChange?.(isOpen);
|
|
@@ -8892,8 +8924,8 @@ var Hint = ({
|
|
|
8892
8924
|
}
|
|
8893
8925
|
};
|
|
8894
8926
|
}, [isOpen]);
|
|
8895
|
-
return /* @__PURE__ */ (0,
|
|
8896
|
-
/* @__PURE__ */ (0,
|
|
8927
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { "data-testid": testId, className: (0, import_classnames22.default)("hint", className), ref: hintRef, children: [
|
|
8928
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
8897
8929
|
"button",
|
|
8898
8930
|
{
|
|
8899
8931
|
tabIndex: isAccessability ? 0 : -1,
|
|
@@ -8904,12 +8936,12 @@ var Hint = ({
|
|
|
8904
8936
|
onMouseLeave: handle.onMouseLeave,
|
|
8905
8937
|
className: (0, import_classnames22.default)("hint__button", { hint__button_active: isOpen }),
|
|
8906
8938
|
children: [
|
|
8907
|
-
icon || icon === null || /* @__PURE__ */ (0,
|
|
8908
|
-
variant === "outlined" && /* @__PURE__ */ (0,
|
|
8909
|
-
variant === "filled" && /* @__PURE__ */ (0,
|
|
8910
|
-
variant === "warning" && /* @__PURE__ */ (0,
|
|
8939
|
+
icon || icon === null || /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
8940
|
+
variant === "outlined" && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_feather8.HelpCircle, { width: 16, height: 16, className: "hint__icon outlined" }),
|
|
8941
|
+
variant === "filled" && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(HelpCircleFilled, { className: "hint__icon filled" }),
|
|
8942
|
+
variant === "warning" && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_feather8.AlertTriangle, { className: "hint__icon", color: "#F06D8D", width: 16, height: 16 })
|
|
8911
8943
|
] }),
|
|
8912
|
-
label && /* @__PURE__ */ (0,
|
|
8944
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: (0, import_classnames22.default)("hint__label", { "color--primary": isOpen }), children: typeof label === "string" ? capitalized(label) : label })
|
|
8913
8945
|
]
|
|
8914
8946
|
}
|
|
8915
8947
|
),
|
|
@@ -8922,17 +8954,17 @@ var Hint_default = Hint;
|
|
|
8922
8954
|
var Hint_default2 = Hint_default;
|
|
8923
8955
|
|
|
8924
8956
|
// src/Atomic/UI/Modal/Modal.tsx
|
|
8925
|
-
var
|
|
8957
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
8926
8958
|
|
|
8927
8959
|
// src/Functions/useKeyPress/useKeyPress.ts
|
|
8928
|
-
var
|
|
8960
|
+
var import_react25 = require("react");
|
|
8929
8961
|
function isISuspendProcessing(x) {
|
|
8930
8962
|
return getIsOnlyAnObject(x) && Object.values(x).every((v) => typeof v === "function");
|
|
8931
8963
|
}
|
|
8932
8964
|
function useKeyPress(targetKey, clamping = true, isForbidden, suspendProcessing) {
|
|
8933
|
-
const [keyPressed, setKeyPressed] = (0,
|
|
8965
|
+
const [keyPressed, setKeyPressed] = (0, import_react25.useState)(false);
|
|
8934
8966
|
const safelySuspendProcessing = isISuspendProcessing(suspendProcessing) ? suspendProcessing : {};
|
|
8935
|
-
const downHandler = (0,
|
|
8967
|
+
const downHandler = (0, import_react25.useCallback)(
|
|
8936
8968
|
(event) => {
|
|
8937
8969
|
const { key, repeat, altKey, ctrlKey, shiftKey, metaKey } = event;
|
|
8938
8970
|
const isPressingWithoutAuxiliaryKeys = !altKey && !ctrlKey && !shiftKey && !metaKey;
|
|
@@ -8945,7 +8977,7 @@ function useKeyPress(targetKey, clamping = true, isForbidden, suspendProcessing)
|
|
|
8945
8977
|
// ? хоть в коде используем "безопасный"
|
|
8946
8978
|
[clamping, targetKey, suspendProcessing]
|
|
8947
8979
|
);
|
|
8948
|
-
const upHandler = (0,
|
|
8980
|
+
const upHandler = (0, import_react25.useCallback)(
|
|
8949
8981
|
(event) => {
|
|
8950
8982
|
const { key, repeat, altKey, ctrlKey, shiftKey, metaKey } = event;
|
|
8951
8983
|
const isPressingWithoutAuxiliaryKeys = !altKey && !ctrlKey && !shiftKey && !metaKey;
|
|
@@ -8958,7 +8990,7 @@ function useKeyPress(targetKey, clamping = true, isForbidden, suspendProcessing)
|
|
|
8958
8990
|
// ? хоть в коде используем "безопасный"
|
|
8959
8991
|
[clamping, targetKey, suspendProcessing]
|
|
8960
8992
|
);
|
|
8961
|
-
(0,
|
|
8993
|
+
(0, import_react25.useEffect)(
|
|
8962
8994
|
() => {
|
|
8963
8995
|
const handleDown = (event) => downHandler(event);
|
|
8964
8996
|
const handleUp = (event) => upHandler(event);
|
|
@@ -8980,7 +9012,7 @@ function useKeyPress(targetKey, clamping = true, isForbidden, suspendProcessing)
|
|
|
8980
9012
|
var useKeyPress_default = useKeyPress;
|
|
8981
9013
|
|
|
8982
9014
|
// src/Functions/useKeyPress/useHandleKeyPress.ts
|
|
8983
|
-
var
|
|
9015
|
+
var import_react26 = require("react");
|
|
8984
9016
|
function useHandleKeyPress({
|
|
8985
9017
|
escCallback,
|
|
8986
9018
|
enterCallback,
|
|
@@ -8991,12 +9023,12 @@ function useHandleKeyPress({
|
|
|
8991
9023
|
const { isWithSubmitAndCloseManagement } = withEventManagementStructure || {};
|
|
8992
9024
|
const isPressEnter = useKeyPress_default("Enter", withClamping, isWithSubmitAndCloseManagement, suspendProcessing);
|
|
8993
9025
|
const isPressEscape = useKeyPress_default("Escape", withClamping, isWithSubmitAndCloseManagement, suspendProcessing);
|
|
8994
|
-
(0,
|
|
9026
|
+
(0, import_react26.useEffect)(() => {
|
|
8995
9027
|
if (!isWithSubmitAndCloseManagement && isPressEscape && typeof escCallback === "function") {
|
|
8996
9028
|
escCallback();
|
|
8997
9029
|
}
|
|
8998
9030
|
}, [isPressEscape, escCallback]);
|
|
8999
|
-
(0,
|
|
9031
|
+
(0, import_react26.useEffect)(() => {
|
|
9000
9032
|
if (!isWithSubmitAndCloseManagement && isPressEnter && typeof enterCallback === "function") {
|
|
9001
9033
|
enterCallback();
|
|
9002
9034
|
}
|
|
@@ -9088,12 +9120,12 @@ function dispatchEventForModalManagement(realEvent, nameOfCustomEvent, uniqueIdO
|
|
|
9088
9120
|
}
|
|
9089
9121
|
|
|
9090
9122
|
// src/Atomic/UI/Modal/partials/ModalFooter.tsx
|
|
9091
|
-
var
|
|
9123
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
9092
9124
|
var import_classnames23 = __toESM(require("classnames"), 1);
|
|
9093
|
-
var
|
|
9094
|
-
var ModalFooter = (0,
|
|
9125
|
+
var import_react27 = require("react");
|
|
9126
|
+
var ModalFooter = (0, import_react27.memo)(
|
|
9095
9127
|
({ className = "", children, wrapperRef, testId = "modal-footer" }) => {
|
|
9096
|
-
return /* @__PURE__ */ (0,
|
|
9128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
9097
9129
|
"footer",
|
|
9098
9130
|
{
|
|
9099
9131
|
"data-testid": testId,
|
|
@@ -9110,11 +9142,11 @@ ModalFooter.displayName = "ModalFooter";
|
|
|
9110
9142
|
var ModalFooter_default = ModalFooter;
|
|
9111
9143
|
|
|
9112
9144
|
// src/Atomic/UI/Modal/partials/ModalTitle.tsx
|
|
9113
|
-
var
|
|
9145
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
9114
9146
|
var import_classnames24 = __toESM(require("classnames"), 1);
|
|
9115
|
-
var
|
|
9147
|
+
var import_react28 = require("react");
|
|
9116
9148
|
var import_react_feather9 = require("react-feather");
|
|
9117
|
-
var ModalTitle = (0,
|
|
9149
|
+
var ModalTitle = (0, import_react28.memo)(
|
|
9118
9150
|
({
|
|
9119
9151
|
variant = "primary",
|
|
9120
9152
|
children,
|
|
@@ -9126,12 +9158,12 @@ var ModalTitle = (0, import_react27.memo)(
|
|
|
9126
9158
|
wrapperRef,
|
|
9127
9159
|
testId = "modal-title"
|
|
9128
9160
|
}) => {
|
|
9129
|
-
const closeModalRef = (0,
|
|
9130
|
-
const handleClick = (0,
|
|
9131
|
-
(0,
|
|
9161
|
+
const closeModalRef = (0, import_react28.useRef)(onClose);
|
|
9162
|
+
const handleClick = (0, import_react28.useMemo)(() => () => closeModalRef.current?.(), []);
|
|
9163
|
+
(0, import_react28.useLayoutEffect)(() => {
|
|
9132
9164
|
closeModalRef.current = closeBtnDisable ? void 0 : onClose;
|
|
9133
9165
|
}, [onClose, closeBtnDisable]);
|
|
9134
|
-
return /* @__PURE__ */ (0,
|
|
9166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
9135
9167
|
"header",
|
|
9136
9168
|
{
|
|
9137
9169
|
"data-testid": testId,
|
|
@@ -9142,7 +9174,7 @@ var ModalTitle = (0, import_react27.memo)(
|
|
|
9142
9174
|
role: "banner",
|
|
9143
9175
|
"aria-label": "Modal header",
|
|
9144
9176
|
children: [
|
|
9145
|
-
/* @__PURE__ */ (0,
|
|
9177
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
9146
9178
|
"span",
|
|
9147
9179
|
{
|
|
9148
9180
|
className: (0, import_classnames24.default)("modal__header-title", {
|
|
@@ -9152,7 +9184,7 @@ var ModalTitle = (0, import_react27.memo)(
|
|
|
9152
9184
|
children
|
|
9153
9185
|
}
|
|
9154
9186
|
),
|
|
9155
|
-
!isForced && /* @__PURE__ */ (0,
|
|
9187
|
+
!isForced && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
9156
9188
|
"button",
|
|
9157
9189
|
{
|
|
9158
9190
|
type: "button",
|
|
@@ -9163,7 +9195,7 @@ var ModalTitle = (0, import_react27.memo)(
|
|
|
9163
9195
|
}),
|
|
9164
9196
|
"aria-label": "Close modal",
|
|
9165
9197
|
title: "Close modal",
|
|
9166
|
-
children: !noHeaderCloseBtn && /* @__PURE__ */ (0,
|
|
9198
|
+
children: !noHeaderCloseBtn && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_feather9.X, { className: "modal-close-icon", role: "img", "aria-hidden": "true" })
|
|
9167
9199
|
}
|
|
9168
9200
|
)
|
|
9169
9201
|
]
|
|
@@ -9175,10 +9207,10 @@ ModalTitle.displayName = "ModalTitle";
|
|
|
9175
9207
|
var ModalTitle_default = ModalTitle;
|
|
9176
9208
|
|
|
9177
9209
|
// src/Atomic/UI/Modal/partials/useMobileModal.tsx
|
|
9178
|
-
var
|
|
9210
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
9179
9211
|
|
|
9180
9212
|
// src/Functions/useIsMobile/useIsMobile.ts
|
|
9181
|
-
var
|
|
9213
|
+
var import_react29 = require("react");
|
|
9182
9214
|
function useIsMobile({ isWithoutWidthCheck = false } = {}) {
|
|
9183
9215
|
const isIPad = () => {
|
|
9184
9216
|
const ua = navigator.userAgent || navigator.vendor || window.opera;
|
|
@@ -9189,8 +9221,8 @@ function useIsMobile({ isWithoutWidthCheck = false } = {}) {
|
|
|
9189
9221
|
const getIsMobile = () => {
|
|
9190
9222
|
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || isIPad();
|
|
9191
9223
|
};
|
|
9192
|
-
const [isMobile, setIsMobile] = (0,
|
|
9193
|
-
(0,
|
|
9224
|
+
const [isMobile, setIsMobile] = (0, import_react29.useState)(getIsMobile());
|
|
9225
|
+
(0, import_react29.useEffect)(() => {
|
|
9194
9226
|
if (getIsMobile()) {
|
|
9195
9227
|
setIsMobile(true);
|
|
9196
9228
|
}
|
|
@@ -9204,7 +9236,7 @@ function useIsMobile({ isWithoutWidthCheck = false } = {}) {
|
|
|
9204
9236
|
var useIsMobile_default = useIsMobile;
|
|
9205
9237
|
|
|
9206
9238
|
// src/Atomic/UI/Modal/partials/useMobileModal.tsx
|
|
9207
|
-
var
|
|
9239
|
+
var import_react30 = require("react");
|
|
9208
9240
|
var SCROLL_DIRECTION = {
|
|
9209
9241
|
UP: "up",
|
|
9210
9242
|
DOWN: "down"
|
|
@@ -9215,28 +9247,28 @@ function useMobileModal({
|
|
|
9215
9247
|
withFixedFooter = false,
|
|
9216
9248
|
isOpen = false
|
|
9217
9249
|
}) {
|
|
9218
|
-
const modalMobileContainerRef = (0,
|
|
9219
|
-
const modalMobileHeaderRef = (0,
|
|
9220
|
-
const modalMobileFooterRef = (0,
|
|
9221
|
-
const modalMobileBodyRef = (0,
|
|
9250
|
+
const modalMobileContainerRef = (0, import_react30.useRef)(null);
|
|
9251
|
+
const modalMobileHeaderRef = (0, import_react30.useRef)(null);
|
|
9252
|
+
const modalMobileFooterRef = (0, import_react30.useRef)(null);
|
|
9253
|
+
const modalMobileBodyRef = (0, import_react30.useRef)(null);
|
|
9222
9254
|
const { isMobile } = useIsMobile_default();
|
|
9223
|
-
const [modalHeight, setModalHeight] = (0,
|
|
9224
|
-
const [modalsLogic, setModalsLogic] = (0,
|
|
9255
|
+
const [modalHeight, setModalHeight] = (0, import_react30.useState)(0);
|
|
9256
|
+
const [modalsLogic, setModalsLogic] = (0, import_react30.useState)({
|
|
9225
9257
|
IS_HEADER_HIDDEN: false,
|
|
9226
9258
|
IS_HEADER_STICKY: false,
|
|
9227
9259
|
IS_FOOTER_HIDDEN: false,
|
|
9228
9260
|
IS_FOOTER_STICKY: withFixedFooter
|
|
9229
9261
|
});
|
|
9230
|
-
const [modalsLogicProps, setModalsLogicProps] = (0,
|
|
9262
|
+
const [modalsLogicProps, setModalsLogicProps] = (0, import_react30.useState)({
|
|
9231
9263
|
headerHeight: 0,
|
|
9232
9264
|
footerHeight: 0
|
|
9233
9265
|
});
|
|
9234
|
-
const [scrollDirection, setScrollDirection] = (0,
|
|
9235
|
-
const [scrollTopPrev, setScrollTopPrev] = (0,
|
|
9236
|
-
const [scrollTop, setScrollTop] = (0,
|
|
9237
|
-
const [scrollHeight, setScrollHeight] = (0,
|
|
9238
|
-
const [, setContainerScrollHeight] = (0,
|
|
9239
|
-
(0,
|
|
9266
|
+
const [scrollDirection, setScrollDirection] = (0, import_react30.useState)(SCROLL_DIRECTION.UP);
|
|
9267
|
+
const [scrollTopPrev, setScrollTopPrev] = (0, import_react30.useState)(0);
|
|
9268
|
+
const [scrollTop, setScrollTop] = (0, import_react30.useState)(0);
|
|
9269
|
+
const [scrollHeight, setScrollHeight] = (0, import_react30.useState)(1);
|
|
9270
|
+
const [, setContainerScrollHeight] = (0, import_react30.useState)(1);
|
|
9271
|
+
(0, import_react30.useLayoutEffect)(() => {
|
|
9240
9272
|
const el = modalMobileContainerRef?.current;
|
|
9241
9273
|
if (el) {
|
|
9242
9274
|
el.addEventListener("scroll", () => {
|
|
@@ -9247,12 +9279,12 @@ function useMobileModal({
|
|
|
9247
9279
|
});
|
|
9248
9280
|
}
|
|
9249
9281
|
}, [modalMobileContainerRef?.current]);
|
|
9250
|
-
(0,
|
|
9282
|
+
(0, import_react30.useEffect)(() => {
|
|
9251
9283
|
setScrollDirection(
|
|
9252
9284
|
(prevScrollDirection) => scrollTop < scrollTopPrev ? SCROLL_DIRECTION.UP : scrollTop > scrollTopPrev ? SCROLL_DIRECTION.DOWN : prevScrollDirection
|
|
9253
9285
|
);
|
|
9254
9286
|
}, [scrollTop, scrollTopPrev]);
|
|
9255
|
-
(0,
|
|
9287
|
+
(0, import_react30.useLayoutEffect)(() => {
|
|
9256
9288
|
if (isOpen) {
|
|
9257
9289
|
const modalStyle = modalRef?.current ? modalRef?.current.style || window.getComputedStyle(modalRef?.current) : {};
|
|
9258
9290
|
const computedModalHeight = modalRef?.current ? modalHeight + Number.parseFloat(modalStyle?.marginTop || "0") : 0;
|
|
@@ -9268,7 +9300,7 @@ function useMobileModal({
|
|
|
9268
9300
|
}
|
|
9269
9301
|
}
|
|
9270
9302
|
}, [modalsLogicProps, isOpen, isMobile, modalHeight]);
|
|
9271
|
-
(0,
|
|
9303
|
+
(0, import_react30.useLayoutEffect)(() => {
|
|
9272
9304
|
if (isMobile && isOpen) {
|
|
9273
9305
|
const newModalHeight = modalRef?.current?.getBoundingClientRect()?.height;
|
|
9274
9306
|
if (newModalHeight && modalHeight !== newModalHeight) {
|
|
@@ -9276,7 +9308,7 @@ function useMobileModal({
|
|
|
9276
9308
|
}
|
|
9277
9309
|
}
|
|
9278
9310
|
});
|
|
9279
|
-
(0,
|
|
9311
|
+
(0, import_react30.useEffect)(() => {
|
|
9280
9312
|
if (isMobile && withMobileLogic) {
|
|
9281
9313
|
const { footerHeight, headerHeight } = modalsLogicProps;
|
|
9282
9314
|
setModalsLogic((prevStickyLogic) => ({
|
|
@@ -9296,7 +9328,7 @@ function useMobileModal({
|
|
|
9296
9328
|
modalHeight,
|
|
9297
9329
|
window.innerHeight
|
|
9298
9330
|
]);
|
|
9299
|
-
(0,
|
|
9331
|
+
(0, import_react30.useLayoutEffect)(() => {
|
|
9300
9332
|
if (modalMobileHeaderRef?.current?.getBoundingClientRect()?.height !== void 0) {
|
|
9301
9333
|
setModalsLogicProps((state) => ({
|
|
9302
9334
|
...state,
|
|
@@ -9304,7 +9336,7 @@ function useMobileModal({
|
|
|
9304
9336
|
}));
|
|
9305
9337
|
}
|
|
9306
9338
|
}, [modalMobileHeaderRef?.current?.getBoundingClientRect()?.height]);
|
|
9307
|
-
(0,
|
|
9339
|
+
(0, import_react30.useLayoutEffect)(() => {
|
|
9308
9340
|
if (modalMobileFooterRef?.current?.getBoundingClientRect()?.height !== void 0) {
|
|
9309
9341
|
setModalsLogicProps((state) => ({
|
|
9310
9342
|
...state,
|
|
@@ -9312,7 +9344,7 @@ function useMobileModal({
|
|
|
9312
9344
|
}));
|
|
9313
9345
|
}
|
|
9314
9346
|
}, [modalMobileFooterRef?.current?.getBoundingClientRect()?.height]);
|
|
9315
|
-
(0,
|
|
9347
|
+
(0, import_react30.useEffect)(() => {
|
|
9316
9348
|
if (modalMobileContainerRef?.current) {
|
|
9317
9349
|
setContainerScrollHeight(modalMobileContainerRef?.current?.scrollHeight);
|
|
9318
9350
|
setScrollHeight(
|
|
@@ -9320,7 +9352,7 @@ function useMobileModal({
|
|
|
9320
9352
|
);
|
|
9321
9353
|
}
|
|
9322
9354
|
}, [scrollTop, modalMobileContainerRef?.current, window.innerHeight]);
|
|
9323
|
-
(0,
|
|
9355
|
+
(0, import_react30.useEffect)(() => {
|
|
9324
9356
|
window.addEventListener("resize", () => {
|
|
9325
9357
|
setContainerScrollHeight((containerScrollHeight) => {
|
|
9326
9358
|
setScrollHeight(containerScrollHeight - window.innerHeight);
|
|
@@ -9328,10 +9360,10 @@ function useMobileModal({
|
|
|
9328
9360
|
});
|
|
9329
9361
|
});
|
|
9330
9362
|
}, []);
|
|
9331
|
-
const renderModal = (0,
|
|
9363
|
+
const renderModal = (0, import_react30.useCallback)(
|
|
9332
9364
|
(modal) => {
|
|
9333
9365
|
if (!isMobile || !withMobileLogic) return modal;
|
|
9334
|
-
return /* @__PURE__ */ (0,
|
|
9366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "modal-mobile-container", ref: modalMobileContainerRef, children: modal });
|
|
9335
9367
|
},
|
|
9336
9368
|
[isMobile, withMobileLogic]
|
|
9337
9369
|
);
|
|
@@ -9351,7 +9383,7 @@ function useMobileModal({
|
|
|
9351
9383
|
|
|
9352
9384
|
// src/Atomic/UI/Modal/Modal.tsx
|
|
9353
9385
|
var import_classnames25 = __toESM(require("classnames"), 1);
|
|
9354
|
-
var
|
|
9386
|
+
var import_react31 = require("react");
|
|
9355
9387
|
var attrsForModalBodyDefault = {};
|
|
9356
9388
|
var KEY_CODE = Object.freeze({
|
|
9357
9389
|
ENTER: 13,
|
|
@@ -9415,11 +9447,11 @@ function Modal({
|
|
|
9415
9447
|
withMobileLogic,
|
|
9416
9448
|
children
|
|
9417
9449
|
}) {
|
|
9418
|
-
const internalRef = (0,
|
|
9450
|
+
const internalRef = (0, import_react31.useRef)(null);
|
|
9419
9451
|
const modalRef = ref || internalRef;
|
|
9420
|
-
const onConfirmRef = (0,
|
|
9421
|
-
const closeModalRef = (0,
|
|
9422
|
-
const onDeclineRef = (0,
|
|
9452
|
+
const onConfirmRef = (0, import_react31.useRef)(onConfirm);
|
|
9453
|
+
const closeModalRef = (0, import_react31.useRef)(closeModal);
|
|
9454
|
+
const onDeclineRef = (0, import_react31.useRef)(onDecline);
|
|
9423
9455
|
const isSubmittingByEnter = submitOnEnter === false ? false : isSubmittingByEnterOuter;
|
|
9424
9456
|
const isClosingByEsc = closeOnEsc === false ? false : isClosingByEscOuter;
|
|
9425
9457
|
const withEventManagementStructure = getWithEventManagementStructure(id, withEventManagement);
|
|
@@ -9441,7 +9473,7 @@ function Modal({
|
|
|
9441
9473
|
withFixedFooter,
|
|
9442
9474
|
isOpen
|
|
9443
9475
|
});
|
|
9444
|
-
const handle = (0,
|
|
9476
|
+
const handle = (0, import_react31.useMemo)(() => ({
|
|
9445
9477
|
confirm: () => onConfirmRef.current?.(),
|
|
9446
9478
|
close: () => closeModalRef.current?.(),
|
|
9447
9479
|
decline: () => {
|
|
@@ -9468,17 +9500,17 @@ function Modal({
|
|
|
9468
9500
|
},
|
|
9469
9501
|
suspendProcessing
|
|
9470
9502
|
});
|
|
9471
|
-
(0,
|
|
9503
|
+
(0, import_react31.useLayoutEffect)(() => {
|
|
9472
9504
|
onConfirmRef.current = isOnConfirmBlocked ? void 0 : onConfirm;
|
|
9473
9505
|
}, [onConfirm, isOnConfirmBlocked]);
|
|
9474
|
-
(0,
|
|
9506
|
+
(0, import_react31.useLayoutEffect)(() => {
|
|
9475
9507
|
closeModalRef.current = isCloseModalBlocked ? void 0 : closeModal;
|
|
9476
9508
|
}, [closeModal, isCloseModalBlocked]);
|
|
9477
|
-
(0,
|
|
9509
|
+
(0, import_react31.useLayoutEffect)(() => {
|
|
9478
9510
|
onDeclineRef.current = isOnDeclineBlocked ? () => {
|
|
9479
9511
|
} : onDecline;
|
|
9480
9512
|
}, [onDecline, isOnDeclineBlocked]);
|
|
9481
|
-
(0,
|
|
9513
|
+
(0, import_react31.useEffect)(() => {
|
|
9482
9514
|
const outerTarget = getIsOnlyAnObject(withEventManagement) ? withEventManagement.listenersTarget : void 0;
|
|
9483
9515
|
const target = outerTarget ?? document;
|
|
9484
9516
|
const onKeyPress = getOnKeyPress({ id, onSubmit: handle.confirm, onClose: handle.close, suspendProcessing });
|
|
@@ -9494,7 +9526,7 @@ function Modal({
|
|
|
9494
9526
|
};
|
|
9495
9527
|
}, []);
|
|
9496
9528
|
if (!isOpen) return null;
|
|
9497
|
-
return /* @__PURE__ */ (0,
|
|
9529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9498
9530
|
"div",
|
|
9499
9531
|
{
|
|
9500
9532
|
id: `${id}`,
|
|
@@ -9505,8 +9537,8 @@ function Modal({
|
|
|
9505
9537
|
"aria-modal": "true",
|
|
9506
9538
|
"aria-labelledby": `${testId}-title`,
|
|
9507
9539
|
children: renderModal(
|
|
9508
|
-
/* @__PURE__ */ (0,
|
|
9509
|
-
/* @__PURE__ */ (0,
|
|
9540
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
9541
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9510
9542
|
"div",
|
|
9511
9543
|
{
|
|
9512
9544
|
"data-testid": `${testId}-overlay`,
|
|
@@ -9515,7 +9547,7 @@ function Modal({
|
|
|
9515
9547
|
role: "presentation"
|
|
9516
9548
|
}
|
|
9517
9549
|
),
|
|
9518
|
-
/* @__PURE__ */ (0,
|
|
9550
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
9519
9551
|
"div",
|
|
9520
9552
|
{
|
|
9521
9553
|
ref: modalRef,
|
|
@@ -9527,7 +9559,7 @@ function Modal({
|
|
|
9527
9559
|
"hidden": !isOpen
|
|
9528
9560
|
}),
|
|
9529
9561
|
children: [
|
|
9530
|
-
customHeader || !noHeader && /* @__PURE__ */ (0,
|
|
9562
|
+
customHeader || !noHeader && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9531
9563
|
ModalTitle_default,
|
|
9532
9564
|
{
|
|
9533
9565
|
wrapperRef: modalMobileHeaderRef,
|
|
@@ -9539,10 +9571,10 @@ function Modal({
|
|
|
9539
9571
|
isForced: forced,
|
|
9540
9572
|
onClose: handle.close,
|
|
9541
9573
|
noHeaderCloseBtn,
|
|
9542
|
-
children: /* @__PURE__ */ (0,
|
|
9574
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { id: `${testId}-title`, children: renderModalTitle({ mode, title, onlyTitle }) })
|
|
9543
9575
|
}
|
|
9544
9576
|
),
|
|
9545
|
-
/* @__PURE__ */ (0,
|
|
9577
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9546
9578
|
"div",
|
|
9547
9579
|
{
|
|
9548
9580
|
...atributesForModalBody,
|
|
@@ -9554,7 +9586,7 @@ function Modal({
|
|
|
9554
9586
|
children
|
|
9555
9587
|
}
|
|
9556
9588
|
),
|
|
9557
|
-
(!noFooter || customFooter) && /* @__PURE__ */ (0,
|
|
9589
|
+
(!noFooter || customFooter) && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9558
9590
|
ModalFooter_default,
|
|
9559
9591
|
{
|
|
9560
9592
|
wrapperRef: modalMobileFooterRef,
|
|
@@ -9563,10 +9595,10 @@ function Modal({
|
|
|
9563
9595
|
"modal__footer--sticky": !MODALS_LOGIC.IS_FOOTER_HIDDEN && MODALS_LOGIC.IS_FOOTER_STICKY && scrollTop !== scrollHeight,
|
|
9564
9596
|
"modal__footer_with-left-content": leftContentOfFooter
|
|
9565
9597
|
}),
|
|
9566
|
-
children: customFooter || /* @__PURE__ */ (0,
|
|
9598
|
+
children: customFooter || /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
9567
9599
|
leftContentOfFooter,
|
|
9568
|
-
(!noCloseBtn || !noConfirmBtn) && /* @__PURE__ */ (0,
|
|
9569
|
-
!noCloseBtn && /* @__PURE__ */ (0,
|
|
9600
|
+
(!noCloseBtn || !noConfirmBtn) && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "modal__buttons-block", children: [
|
|
9601
|
+
!noCloseBtn && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9570
9602
|
Button_default,
|
|
9571
9603
|
{
|
|
9572
9604
|
testId: "modal",
|
|
@@ -9581,7 +9613,7 @@ function Modal({
|
|
|
9581
9613
|
"aria-label": "Close modal"
|
|
9582
9614
|
}
|
|
9583
9615
|
),
|
|
9584
|
-
!noConfirmBtn && /* @__PURE__ */ (0,
|
|
9616
|
+
!noConfirmBtn && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
9585
9617
|
Button_default,
|
|
9586
9618
|
{
|
|
9587
9619
|
testId: "modal",
|
|
@@ -9611,9 +9643,9 @@ Modal.displayName = "Modal";
|
|
|
9611
9643
|
var Modal_default = Modal;
|
|
9612
9644
|
|
|
9613
9645
|
// src/Atomic/UI/Modal/ModalHOC.tsx
|
|
9614
|
-
var
|
|
9646
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
9615
9647
|
var import_classnames26 = __toESM(require("classnames"), 1);
|
|
9616
|
-
var
|
|
9648
|
+
var import_react32 = require("react");
|
|
9617
9649
|
var ModalHOC = ({
|
|
9618
9650
|
id,
|
|
9619
9651
|
zIndex = 100,
|
|
@@ -9631,19 +9663,19 @@ var ModalHOC = ({
|
|
|
9631
9663
|
isClosingByEsc: isClosingByEscOuter = true,
|
|
9632
9664
|
closeOnEsc
|
|
9633
9665
|
}) => {
|
|
9634
|
-
const modalRef = (0,
|
|
9635
|
-
const closeModalRef = (0,
|
|
9666
|
+
const modalRef = (0, import_react32.useRef)(null);
|
|
9667
|
+
const closeModalRef = (0, import_react32.useRef)(closeModal);
|
|
9636
9668
|
const isClosingByEsc = closeOnEsc === false ? false : isClosingByEscOuter;
|
|
9637
9669
|
const withEventManagementStructure = getWithEventManagementStructure(id, withEventManagement);
|
|
9638
|
-
const handleClose = (0,
|
|
9670
|
+
const handleClose = (0, import_react32.useMemo)(() => () => closeModalRef.current?.(), []);
|
|
9639
9671
|
useHandleKeyPress_default({
|
|
9640
9672
|
escCallback: isClosingByEsc && typeof closeModal === "function" ? handleClose : void 0,
|
|
9641
9673
|
withEventManagementStructure
|
|
9642
9674
|
});
|
|
9643
|
-
(0,
|
|
9675
|
+
(0, import_react32.useLayoutEffect)(() => {
|
|
9644
9676
|
closeModalRef.current = closeBtnDisable ? void 0 : closeModal;
|
|
9645
9677
|
}, [closeModal, closeBtnDisable]);
|
|
9646
|
-
(0,
|
|
9678
|
+
(0, import_react32.useEffect)(() => {
|
|
9647
9679
|
const onKeyPress = getOnKeyPress({ id, onClose: handleClose });
|
|
9648
9680
|
if (withEventManagementStructure.isWithSubmitAndCloseManagement && !!onKeyPress) {
|
|
9649
9681
|
if (isClosingByEsc) document.addEventListener(EVENTS.iGotAnEscKeyPress.name, onKeyPress);
|
|
@@ -9655,9 +9687,9 @@ var ModalHOC = ({
|
|
|
9655
9687
|
};
|
|
9656
9688
|
}, []);
|
|
9657
9689
|
if (!isOpen) return null;
|
|
9658
|
-
return /* @__PURE__ */ (0,
|
|
9659
|
-
/* @__PURE__ */ (0,
|
|
9660
|
-
/* @__PURE__ */ (0,
|
|
9690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { id: `${id}`, style: { zIndex }, "data-testid": testId, className: "modal-box j5", role: "presentation", children: [
|
|
9691
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "modal-overlay", onClick: handleClose, role: "presentation", "aria-hidden": "true" }),
|
|
9692
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
9661
9693
|
"div",
|
|
9662
9694
|
{
|
|
9663
9695
|
ref: modalRef,
|
|
@@ -9681,9 +9713,9 @@ var Modal_default2 = Modal_default;
|
|
|
9681
9713
|
var MonoAccordion_default2 = MonoAccordion_default;
|
|
9682
9714
|
|
|
9683
9715
|
// src/Atomic/UI/NavLine/NavLine.tsx
|
|
9684
|
-
var
|
|
9716
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
9685
9717
|
var import_classnames27 = __toESM(require("classnames"), 1);
|
|
9686
|
-
var
|
|
9718
|
+
var import_react33 = require("react");
|
|
9687
9719
|
var Icons3 = __toESM(require("react-feather"), 1);
|
|
9688
9720
|
var CN4 = "nav-line";
|
|
9689
9721
|
function checkedRef2(ref) {
|
|
@@ -9705,14 +9737,14 @@ var NavLine = ({
|
|
|
9705
9737
|
scrollMode = false,
|
|
9706
9738
|
testId = CN4
|
|
9707
9739
|
}) => {
|
|
9708
|
-
const [navLineItems, setNavLineItems] = (0,
|
|
9709
|
-
const wrapperRef = (0,
|
|
9710
|
-
const wrapperInnerRef = (0,
|
|
9711
|
-
const [showScrollButtons, setShowScrollButtons] = (0,
|
|
9712
|
-
const [canScrollLeft, setCanScrollLeft] = (0,
|
|
9713
|
-
const [canScrollRight, setCanScrollRight] = (0,
|
|
9714
|
-
const [isScrollBlocked, setIsScrollBlocked] = (0,
|
|
9715
|
-
const checkScroll = (0,
|
|
9740
|
+
const [navLineItems, setNavLineItems] = (0, import_react33.useState)([]);
|
|
9741
|
+
const wrapperRef = (0, import_react33.useRef)(null);
|
|
9742
|
+
const wrapperInnerRef = (0, import_react33.useRef)(null);
|
|
9743
|
+
const [showScrollButtons, setShowScrollButtons] = (0, import_react33.useState)(false);
|
|
9744
|
+
const [canScrollLeft, setCanScrollLeft] = (0, import_react33.useState)(false);
|
|
9745
|
+
const [canScrollRight, setCanScrollRight] = (0, import_react33.useState)(false);
|
|
9746
|
+
const [isScrollBlocked, setIsScrollBlocked] = (0, import_react33.useState)(false);
|
|
9747
|
+
const checkScroll = (0, import_react33.useCallback)(() => {
|
|
9716
9748
|
const inner = wrapperInnerRef.current;
|
|
9717
9749
|
if (!inner) return;
|
|
9718
9750
|
const hasOverflow = inner.scrollWidth > inner.clientWidth;
|
|
@@ -9722,7 +9754,7 @@ var NavLine = ({
|
|
|
9722
9754
|
setCanScrollLeft(canScrollLeft2);
|
|
9723
9755
|
setCanScrollRight(canScrollRight2);
|
|
9724
9756
|
}, []);
|
|
9725
|
-
const scroll = (0,
|
|
9757
|
+
const scroll = (0, import_react33.useCallback)(
|
|
9726
9758
|
(direction) => {
|
|
9727
9759
|
if (isScrollBlocked || !wrapperInnerRef.current) return;
|
|
9728
9760
|
setIsScrollBlocked(true);
|
|
@@ -9746,7 +9778,7 @@ var NavLine = ({
|
|
|
9746
9778
|
},
|
|
9747
9779
|
[isScrollBlocked, checkScroll]
|
|
9748
9780
|
);
|
|
9749
|
-
const handleWheel = (0,
|
|
9781
|
+
const handleWheel = (0, import_react33.useCallback)(
|
|
9750
9782
|
(e) => {
|
|
9751
9783
|
if (!scrollMode) return;
|
|
9752
9784
|
e.preventDefault();
|
|
@@ -9758,7 +9790,7 @@ var NavLine = ({
|
|
|
9758
9790
|
},
|
|
9759
9791
|
[scroll, scrollMode]
|
|
9760
9792
|
);
|
|
9761
|
-
const onTabChange = (0,
|
|
9793
|
+
const onTabChange = (0, import_react33.useCallback)(
|
|
9762
9794
|
(item) => {
|
|
9763
9795
|
if (!item.disabled && !(mode === "create" && item.tabId !== "general")) {
|
|
9764
9796
|
onChange(item.tabId);
|
|
@@ -9766,7 +9798,7 @@ var NavLine = ({
|
|
|
9766
9798
|
},
|
|
9767
9799
|
[mode, onChange]
|
|
9768
9800
|
);
|
|
9769
|
-
const navigateByKeys = (0,
|
|
9801
|
+
const navigateByKeys = (0, import_react33.useCallback)(
|
|
9770
9802
|
(event) => {
|
|
9771
9803
|
if (event.repeat) return;
|
|
9772
9804
|
const activeTabIndex = items.findIndex((tab) => tab.tabId === activeTab);
|
|
@@ -9780,21 +9812,21 @@ var NavLine = ({
|
|
|
9780
9812
|
},
|
|
9781
9813
|
[activeTab, items, onChange]
|
|
9782
9814
|
);
|
|
9783
|
-
(0,
|
|
9815
|
+
(0, import_react33.useEffect)(() => {
|
|
9784
9816
|
setNavLineItems(
|
|
9785
9817
|
items.map((item) => ({
|
|
9786
9818
|
...item,
|
|
9787
|
-
ref: (0,
|
|
9819
|
+
ref: (0, import_react33.createRef)()
|
|
9788
9820
|
}))
|
|
9789
9821
|
);
|
|
9790
9822
|
}, [items]);
|
|
9791
|
-
(0,
|
|
9823
|
+
(0, import_react33.useEffect)(() => {
|
|
9792
9824
|
if (isNavigateByKeys && !isTabLoading) {
|
|
9793
9825
|
document.addEventListener("keydown", navigateByKeys);
|
|
9794
9826
|
}
|
|
9795
9827
|
return () => document.removeEventListener("keydown", navigateByKeys);
|
|
9796
9828
|
}, [isNavigateByKeys, isTabLoading, navigateByKeys]);
|
|
9797
|
-
(0,
|
|
9829
|
+
(0, import_react33.useEffect)(() => {
|
|
9798
9830
|
if (!scrollMode) return;
|
|
9799
9831
|
const inner = wrapperInnerRef.current;
|
|
9800
9832
|
if (!inner) return;
|
|
@@ -9826,17 +9858,17 @@ var NavLine = ({
|
|
|
9826
9858
|
"aria-disabled": isDisabled,
|
|
9827
9859
|
"tabIndex": isDisabled ? -1 : 0
|
|
9828
9860
|
};
|
|
9829
|
-
const content = /* @__PURE__ */ (0,
|
|
9830
|
-
Icon && /* @__PURE__ */ (0,
|
|
9831
|
-
/* @__PURE__ */ (0,
|
|
9832
|
-
item.count !== void 0 && /* @__PURE__ */ (0,
|
|
9861
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "nav-line__content", children: [
|
|
9862
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "nav-line__item--icon", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, {}) }),
|
|
9863
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: (0, import_classnames27.default)({ "nav-line__item--label": variant !== "simple" }), children: item.label }),
|
|
9864
|
+
item.count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "nav-line-count", "aria-label": `${item.count} items`, children: [
|
|
9833
9865
|
"(",
|
|
9834
9866
|
item.count,
|
|
9835
9867
|
")"
|
|
9836
9868
|
] })
|
|
9837
9869
|
] });
|
|
9838
9870
|
if (isLocal) {
|
|
9839
|
-
return /* @__PURE__ */ (0,
|
|
9871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
9840
9872
|
"span",
|
|
9841
9873
|
{
|
|
9842
9874
|
...commonProps,
|
|
@@ -9853,7 +9885,7 @@ var NavLine = ({
|
|
|
9853
9885
|
`tab__${item.tabId}`
|
|
9854
9886
|
);
|
|
9855
9887
|
}
|
|
9856
|
-
return /* @__PURE__ */ (0,
|
|
9888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
9857
9889
|
NavLink,
|
|
9858
9890
|
{
|
|
9859
9891
|
...commonProps,
|
|
@@ -9868,7 +9900,7 @@ var NavLine = ({
|
|
|
9868
9900
|
`tab__${item.tabId}`
|
|
9869
9901
|
);
|
|
9870
9902
|
};
|
|
9871
|
-
return /* @__PURE__ */ (0,
|
|
9903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "nav-line-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
9872
9904
|
"div",
|
|
9873
9905
|
{
|
|
9874
9906
|
"data-testid": testId,
|
|
@@ -9880,7 +9912,7 @@ var NavLine = ({
|
|
|
9880
9912
|
),
|
|
9881
9913
|
ref: wrapperRef,
|
|
9882
9914
|
children: [
|
|
9883
|
-
scrollMode && showScrollButtons && /* @__PURE__ */ (0,
|
|
9915
|
+
scrollMode && showScrollButtons && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
9884
9916
|
"button",
|
|
9885
9917
|
{
|
|
9886
9918
|
type: "button",
|
|
@@ -9889,10 +9921,10 @@ var NavLine = ({
|
|
|
9889
9921
|
onClick: () => scroll("left"),
|
|
9890
9922
|
"aria-label": "Scroll previous",
|
|
9891
9923
|
disabled: !canScrollLeft,
|
|
9892
|
-
children: /* @__PURE__ */ (0,
|
|
9924
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icons3.ChevronLeft, {})
|
|
9893
9925
|
}
|
|
9894
9926
|
),
|
|
9895
|
-
/* @__PURE__ */ (0,
|
|
9927
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
9896
9928
|
"div",
|
|
9897
9929
|
{
|
|
9898
9930
|
ref: wrapperInnerRef,
|
|
@@ -9902,7 +9934,7 @@ var NavLine = ({
|
|
|
9902
9934
|
children: navLineItems.map(renderNavItem)
|
|
9903
9935
|
}
|
|
9904
9936
|
),
|
|
9905
|
-
scrollMode && showScrollButtons && /* @__PURE__ */ (0,
|
|
9937
|
+
scrollMode && showScrollButtons && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
9906
9938
|
"button",
|
|
9907
9939
|
{
|
|
9908
9940
|
type: "button",
|
|
@@ -9911,10 +9943,10 @@ var NavLine = ({
|
|
|
9911
9943
|
onClick: () => scroll("right"),
|
|
9912
9944
|
"aria-label": "Scroll next",
|
|
9913
9945
|
disabled: !canScrollRight,
|
|
9914
|
-
children: /* @__PURE__ */ (0,
|
|
9946
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icons3.ChevronRight, {})
|
|
9915
9947
|
}
|
|
9916
9948
|
),
|
|
9917
|
-
children && /* @__PURE__ */ (0,
|
|
9949
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "nav-line__body", role: "tabpanel", children })
|
|
9918
9950
|
]
|
|
9919
9951
|
}
|
|
9920
9952
|
) });
|
|
@@ -9925,18 +9957,18 @@ var NavLine_default = NavLine;
|
|
|
9925
9957
|
var NavLine_default2 = NavLine_default;
|
|
9926
9958
|
|
|
9927
9959
|
// src/Atomic/UI/PageTitle/PageTitle.tsx
|
|
9928
|
-
var
|
|
9960
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
9929
9961
|
var import_classnames28 = __toESM(require("classnames"), 1);
|
|
9930
9962
|
var import_react_feather10 = require("react-feather");
|
|
9931
9963
|
var RC7 = "page-title";
|
|
9932
|
-
var PageTitle = ({ title, pages, children, testId = RC7 }) => /* @__PURE__ */ (0,
|
|
9933
|
-
/* @__PURE__ */ (0,
|
|
9934
|
-
/* @__PURE__ */ (0,
|
|
9935
|
-
pages.length > 0 && /* @__PURE__ */ (0,
|
|
9936
|
-
/* @__PURE__ */ (0,
|
|
9937
|
-
pages.map(({ name, path }, index) => /* @__PURE__ */ (0,
|
|
9938
|
-
/* @__PURE__ */ (0,
|
|
9939
|
-
pages.length - 1 === index ? /* @__PURE__ */ (0,
|
|
9964
|
+
var PageTitle = ({ title, pages, children, testId = RC7 }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { "data-testid": testId, className: RC7, role: "region", "aria-label": title, children: [
|
|
9965
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: `${RC7}__wrap`, children: [
|
|
9966
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("h1", { className: `${RC7}__title`, children: title }),
|
|
9967
|
+
pages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("nav", { className: `${RC7}__pages`, "aria-label": "Breadcrumb", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("ol", { className: `${RC7}__list`, children: [
|
|
9968
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("a", { className: `${RC7}__link`, href: "/", "aria-label": "Home page", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_feather10.Home, { "aria-hidden": "true" }) }) }),
|
|
9969
|
+
pages.map(({ name, path }, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("li", { children: [
|
|
9970
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: `${RC7}__delimiter`, "aria-hidden": "true", children: "/" }),
|
|
9971
|
+
pages.length - 1 === index ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: (0, import_classnames28.default)(`${RC7}__link`, `${RC7}__link_last`), "aria-current": "page", children: name }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("a", { className: `${RC7}__link`, href: path, children: name })
|
|
9940
9972
|
] }, path))
|
|
9941
9973
|
] }) })
|
|
9942
9974
|
] }),
|
|
@@ -9948,8 +9980,8 @@ var PageTitle_default = PageTitle;
|
|
|
9948
9980
|
var PageTitle_default2 = PageTitle_default;
|
|
9949
9981
|
|
|
9950
9982
|
// src/Atomic/UI/PieChart/PieChart.js
|
|
9951
|
-
var
|
|
9952
|
-
var
|
|
9983
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
9984
|
+
var import_react35 = __toESM(require("react"), 1);
|
|
9953
9985
|
var import_chart2 = require("chart.js");
|
|
9954
9986
|
var import_react_chartjs_2 = require("react-chartjs-2");
|
|
9955
9987
|
import_chart2.Chart.register(import_chart2.ArcElement, import_chart2.Tooltip);
|
|
@@ -9968,22 +10000,22 @@ var PieChart = ({
|
|
|
9968
10000
|
}
|
|
9969
10001
|
}
|
|
9970
10002
|
};
|
|
9971
|
-
return /* @__PURE__ */ (0,
|
|
9972
|
-
/* @__PURE__ */ (0,
|
|
9973
|
-
Boolean(resultLabel) && /* @__PURE__ */ (0,
|
|
9974
|
-
/* @__PURE__ */ (0,
|
|
10003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "pie-chart-box", style: { maxWidth: `320px` }, children: [
|
|
10004
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_chartjs_2.Pie, { data, options }),
|
|
10005
|
+
Boolean(resultLabel) && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "pie-chart__result", children: [
|
|
10006
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "pie-chart__result-value", children: [
|
|
9975
10007
|
resultValue,
|
|
9976
|
-
/* @__PURE__ */ (0,
|
|
10008
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "pie-chart__result-percent", children: "%" }),
|
|
9977
10009
|
" "
|
|
9978
10010
|
] }),
|
|
9979
|
-
/* @__PURE__ */ (0,
|
|
10011
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "pie-chart__result-label", children: resultLabel })
|
|
9980
10012
|
] })
|
|
9981
10013
|
] });
|
|
9982
10014
|
};
|
|
9983
10015
|
var PieChart_default = PieChart;
|
|
9984
10016
|
|
|
9985
10017
|
// src/Atomic/UI/Price/Price.tsx
|
|
9986
|
-
var
|
|
10018
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
9987
10019
|
|
|
9988
10020
|
// src/Functions/fieldValueFormatters.js
|
|
9989
10021
|
var getSafelyValue = (value) => value !== void 0 && value !== null ? value?.toString?.() || "" : "";
|
|
@@ -10241,7 +10273,7 @@ var import_classnames29 = __toESM(require("classnames"), 1);
|
|
|
10241
10273
|
var CN5 = "price";
|
|
10242
10274
|
var Price = ({ value, currencyCode, isSymbolAfter, className, testId = CN5 }) => {
|
|
10243
10275
|
if (value === void 0 || value === null) return null;
|
|
10244
|
-
return /* @__PURE__ */ (0,
|
|
10276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
10245
10277
|
"div",
|
|
10246
10278
|
{
|
|
10247
10279
|
"data-testid": testId,
|
|
@@ -10258,15 +10290,15 @@ var Price_default = Price;
|
|
|
10258
10290
|
var Price_default2 = Price_default;
|
|
10259
10291
|
|
|
10260
10292
|
// src/Atomic/UI/PriceRange/PriceRange.tsx
|
|
10261
|
-
var
|
|
10293
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
10262
10294
|
var import_classnames30 = __toESM(require("classnames"), 1);
|
|
10263
10295
|
var CN6 = "price-range";
|
|
10264
10296
|
var PriceRange = ({ from, to, mode, testId = CN6 }) => {
|
|
10265
|
-
return /* @__PURE__ */ (0,
|
|
10297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { "data-testid": testId, className: (0, import_classnames30.default)(CN6, "j4"), role: "region", "aria-label": "Price range", children: mode === "simple" ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { "aria-live": "polite", children: [
|
|
10266
10298
|
from,
|
|
10267
10299
|
" - ",
|
|
10268
10300
|
to
|
|
10269
|
-
] }) : /* @__PURE__ */ (0,
|
|
10301
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { "aria-live": "polite", children: [
|
|
10270
10302
|
formatToPriceWithUSD(from?.toString()),
|
|
10271
10303
|
" - ",
|
|
10272
10304
|
formatToPriceWithUSD(to?.toString())
|
|
@@ -10278,7 +10310,7 @@ var PriceRange_default = PriceRange;
|
|
|
10278
10310
|
var PriceRange_default2 = PriceRange_default;
|
|
10279
10311
|
|
|
10280
10312
|
// src/Atomic/UI/ProgressLine/ProgressLine.tsx
|
|
10281
|
-
var
|
|
10313
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
10282
10314
|
var import_classnames31 = __toESM(require("classnames"), 1);
|
|
10283
10315
|
var CN7 = "progress-line";
|
|
10284
10316
|
var ProgressLine = ({
|
|
@@ -10307,21 +10339,21 @@ var ProgressLine = ({
|
|
|
10307
10339
|
};
|
|
10308
10340
|
const renderLabel = () => {
|
|
10309
10341
|
if (!label) return null;
|
|
10310
|
-
return /* @__PURE__ */ (0,
|
|
10342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: `progress-line__wrapper__label align-${labelAlign}`, children: label });
|
|
10311
10343
|
};
|
|
10312
10344
|
const renderProgressValue = () => {
|
|
10313
10345
|
if (!renderValue) return null;
|
|
10314
|
-
return /* @__PURE__ */ (0,
|
|
10346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "progress-line__wrapper__value", "aria-live": "polite", children: renderValueInPercents ? getFilledLineWidth() : `${addBitDepthPoints(String(value))} ${valueMeasurement}` });
|
|
10315
10347
|
};
|
|
10316
10348
|
const renderExtremums = () => {
|
|
10317
10349
|
if (!showExtremums) return null;
|
|
10318
|
-
return /* @__PURE__ */ (0,
|
|
10319
|
-
/* @__PURE__ */ (0,
|
|
10320
|
-
/* @__PURE__ */ (0,
|
|
10350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { "aria-hidden": "true", className: `progress-line__wrapper__extremums position-${extremumsPosition}`, children: [
|
|
10351
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "progress-line__wrapper__extremums--min", children: renderValueInPercents ? "0 %" : `${minValue} ${valueMeasurement}` }),
|
|
10352
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "progress-line__wrapper__extremums--max", children: renderValueInPercents ? "100 %" : `${maxValue} ${valueMeasurement}` })
|
|
10321
10353
|
] });
|
|
10322
10354
|
};
|
|
10323
10355
|
const renderFilledLine = () => {
|
|
10324
|
-
return /* @__PURE__ */ (0,
|
|
10356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
10325
10357
|
"div",
|
|
10326
10358
|
{
|
|
10327
10359
|
className: "progress-line__wrapper__line--filled",
|
|
@@ -10335,14 +10367,14 @@ var ProgressLine = ({
|
|
|
10335
10367
|
);
|
|
10336
10368
|
};
|
|
10337
10369
|
const renderLine = () => {
|
|
10338
|
-
return /* @__PURE__ */ (0,
|
|
10370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "progress-line__wrapper__line", children: [
|
|
10339
10371
|
renderExtremums(),
|
|
10340
10372
|
renderFilledLine()
|
|
10341
10373
|
] });
|
|
10342
10374
|
};
|
|
10343
|
-
return /* @__PURE__ */ (0,
|
|
10375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: (0, import_classnames31.default)(CN7, className), "data-testid": testId, role: "region", "aria-label": "Progress line", children: [
|
|
10344
10376
|
renderLabel(),
|
|
10345
|
-
/* @__PURE__ */ (0,
|
|
10377
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
10346
10378
|
"div",
|
|
10347
10379
|
{
|
|
10348
10380
|
className: `progress-line__wrapper variant-${useVariantLabelColor && variant} value-${valueVerticalPosition}-${valueHorizontalPosition} ${className}`,
|
|
@@ -10360,10 +10392,10 @@ var ProgressLine_default = ProgressLine;
|
|
|
10360
10392
|
var ProgressLine_default2 = ProgressLine_default;
|
|
10361
10393
|
|
|
10362
10394
|
// src/Atomic/UI/Table/Table.js
|
|
10363
|
-
var
|
|
10395
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
10364
10396
|
|
|
10365
10397
|
// src/Atomic/UI/Table/Partials/TdHeader.js
|
|
10366
|
-
var
|
|
10398
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
10367
10399
|
|
|
10368
10400
|
// src/Langs.js
|
|
10369
10401
|
var Langs = {
|
|
@@ -10534,48 +10566,48 @@ var Langs = {
|
|
|
10534
10566
|
var Langs_default = Langs;
|
|
10535
10567
|
|
|
10536
10568
|
// src/Atomic/UI/Table/Partials/TdHeader.js
|
|
10537
|
-
var
|
|
10569
|
+
var import_react39 = __toESM(require("react"), 1);
|
|
10538
10570
|
var import_classnames32 = __toESM(require("classnames"), 1);
|
|
10539
10571
|
var TdHeader = ({ item, testId = "td-header" }) => {
|
|
10540
10572
|
const txt = Langs_default[global.lng];
|
|
10541
10573
|
switch (item.type) {
|
|
10542
10574
|
case "double":
|
|
10543
|
-
return /* @__PURE__ */ (0,
|
|
10544
|
-
/* @__PURE__ */ (0,
|
|
10545
|
-
/* @__PURE__ */ (0,
|
|
10575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("th", { "data-testid": testId, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "j46", children: [
|
|
10576
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "", children: txt.labels[item.left] || item.left }),
|
|
10577
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "", children: txt.labels[item.right] || item.right })
|
|
10546
10578
|
] }) });
|
|
10547
10579
|
default:
|
|
10548
|
-
return /* @__PURE__ */ (0,
|
|
10549
|
-
/* @__PURE__ */ (0,
|
|
10550
|
-
item.button && /* @__PURE__ */ (0,
|
|
10580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("th", { "data-testid": testId, className: (0, import_classnames32.default)(item.className), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: (0, import_classnames32.default)({ df: item.button }), children: [
|
|
10581
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "mr5", children: txt.labels[item.label] || item.label }),
|
|
10582
|
+
item.button && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "cards-table__btn", children: txt.buttons[item.button] || item.button })
|
|
10551
10583
|
] }) });
|
|
10552
10584
|
}
|
|
10553
10585
|
};
|
|
10554
10586
|
var TdHeader_default = TdHeader;
|
|
10555
10587
|
|
|
10556
10588
|
// src/Atomic/UI/Table/Partials/TdRow.js
|
|
10557
|
-
var
|
|
10589
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
10558
10590
|
|
|
10559
10591
|
// src/Atomic/UI/Table/TdTypes/TdRange.js
|
|
10560
|
-
var
|
|
10592
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
10561
10593
|
var TdRange = ({ item }) => {
|
|
10562
10594
|
if (!item) return false;
|
|
10563
|
-
return /* @__PURE__ */ (0,
|
|
10564
|
-
/* @__PURE__ */ (0,
|
|
10565
|
-
/* @__PURE__ */ (0,
|
|
10566
|
-
/* @__PURE__ */ (0,
|
|
10595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
|
|
10596
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: item.from }),
|
|
10597
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: " - " }),
|
|
10598
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: item.to })
|
|
10567
10599
|
] });
|
|
10568
10600
|
};
|
|
10569
10601
|
var TdRange_default = TdRange;
|
|
10570
10602
|
|
|
10571
10603
|
// src/Atomic/UI/Table/Partials/TdCell.js
|
|
10572
|
-
var
|
|
10604
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
10573
10605
|
|
|
10574
10606
|
// src/Atomic/UI/Table/TdTypes/TdActions.js
|
|
10575
|
-
var
|
|
10607
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
10576
10608
|
|
|
10577
10609
|
// src/Atomic/FormElements/Switcher/Switcher.tsx
|
|
10578
|
-
var
|
|
10610
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
10579
10611
|
var import_classnames33 = __toESM(require("classnames"), 1);
|
|
10580
10612
|
var RC8 = "switcher";
|
|
10581
10613
|
var Switcher = ({
|
|
@@ -10589,13 +10621,13 @@ var Switcher = ({
|
|
|
10589
10621
|
hintSide,
|
|
10590
10622
|
testId = "switcher"
|
|
10591
10623
|
}) => {
|
|
10592
|
-
return /* @__PURE__ */ (0,
|
|
10624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
10593
10625
|
"div",
|
|
10594
10626
|
{
|
|
10595
10627
|
"data-testid": testId,
|
|
10596
10628
|
className: (0, import_classnames33.default)(RC8, className, { [`${RC8}_disabled`]: disabled }),
|
|
10597
10629
|
children: [
|
|
10598
|
-
/* @__PURE__ */ (0,
|
|
10630
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
10599
10631
|
"button",
|
|
10600
10632
|
{
|
|
10601
10633
|
type: "button",
|
|
@@ -10604,16 +10636,16 @@ var Switcher = ({
|
|
|
10604
10636
|
disabled,
|
|
10605
10637
|
onClick: (e) => onChange(!isActive, e),
|
|
10606
10638
|
children: [
|
|
10607
|
-
/* @__PURE__ */ (0,
|
|
10639
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10608
10640
|
"div",
|
|
10609
10641
|
{
|
|
10610
10642
|
className: (0, import_classnames33.default)(`${RC8}__button-content`, {
|
|
10611
10643
|
[`${RC8}__button-content_active`]: isActive
|
|
10612
10644
|
}),
|
|
10613
|
-
children: /* @__PURE__ */ (0,
|
|
10645
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: `${RC8}__ball` })
|
|
10614
10646
|
}
|
|
10615
10647
|
),
|
|
10616
|
-
label && /* @__PURE__ */ (0,
|
|
10648
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
10617
10649
|
"span",
|
|
10618
10650
|
{
|
|
10619
10651
|
className: (0, import_classnames33.default)(`${RC8}__label`, {
|
|
@@ -10625,7 +10657,7 @@ var Switcher = ({
|
|
|
10625
10657
|
]
|
|
10626
10658
|
}
|
|
10627
10659
|
),
|
|
10628
|
-
hint && /* @__PURE__ */ (0,
|
|
10660
|
+
hint && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Hint_default, { className: `${RC8}__hint`, hint, side: hintSide })
|
|
10629
10661
|
]
|
|
10630
10662
|
}
|
|
10631
10663
|
);
|
|
@@ -10633,62 +10665,62 @@ var Switcher = ({
|
|
|
10633
10665
|
var Switcher_default = Switcher;
|
|
10634
10666
|
|
|
10635
10667
|
// src/Atomic/UI/Table/TdTypes/TdActions.js
|
|
10636
|
-
var
|
|
10668
|
+
var import_react41 = __toESM(require("react"), 1);
|
|
10637
10669
|
var Icons4 = __toESM(require("react-feather"), 1);
|
|
10638
10670
|
var TdActions = ({ actions, onChange, onActionClick, rowItem }) => {
|
|
10639
10671
|
if (!actions) return false;
|
|
10640
|
-
const [state, setState] = (0,
|
|
10672
|
+
const [state, setState] = (0, import_react41.useState)(actions);
|
|
10641
10673
|
const handleArrayChange = (value, index, prop) => {
|
|
10642
10674
|
state[index][prop] = value;
|
|
10643
10675
|
setState([...state]);
|
|
10644
10676
|
onChange(state);
|
|
10645
10677
|
};
|
|
10646
|
-
return /* @__PURE__ */ (0,
|
|
10678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "j6", children: actions?.map((action, index) => {
|
|
10647
10679
|
switch (action.type) {
|
|
10648
10680
|
case "download":
|
|
10649
|
-
return /* @__PURE__ */ (0,
|
|
10681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10650
10682
|
"div",
|
|
10651
10683
|
{
|
|
10652
10684
|
className: "td-actions--item td-actions--download",
|
|
10653
10685
|
onClick: () => {
|
|
10654
10686
|
},
|
|
10655
|
-
children: /* @__PURE__ */ (0,
|
|
10687
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icons4.Download, {})
|
|
10656
10688
|
},
|
|
10657
10689
|
index
|
|
10658
10690
|
);
|
|
10659
10691
|
case "edit":
|
|
10660
|
-
return /* @__PURE__ */ (0,
|
|
10692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10661
10693
|
"div",
|
|
10662
10694
|
{
|
|
10663
10695
|
className: "td-actions--item td-actions--edit",
|
|
10664
10696
|
onClick: () => {
|
|
10665
10697
|
},
|
|
10666
|
-
children: /* @__PURE__ */ (0,
|
|
10698
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icons4.Edit3, {})
|
|
10667
10699
|
},
|
|
10668
10700
|
index
|
|
10669
10701
|
);
|
|
10670
10702
|
case "delete":
|
|
10671
|
-
return /* @__PURE__ */ (0,
|
|
10703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10672
10704
|
"div",
|
|
10673
10705
|
{
|
|
10674
10706
|
className: "td-actions--item td-actions--delete",
|
|
10675
10707
|
onClick: () => onActionClick("delete", rowItem),
|
|
10676
|
-
children: /* @__PURE__ */ (0,
|
|
10708
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icons4.Trash2, {})
|
|
10677
10709
|
},
|
|
10678
10710
|
index
|
|
10679
10711
|
);
|
|
10680
10712
|
case "undo":
|
|
10681
|
-
return /* @__PURE__ */ (0,
|
|
10713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10682
10714
|
"div",
|
|
10683
10715
|
{
|
|
10684
10716
|
className: "td-actions--item td-actions--undo",
|
|
10685
10717
|
onClick: () => onActionClick("undo", rowItem),
|
|
10686
|
-
children: /* @__PURE__ */ (0,
|
|
10718
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icons4.RotateCcw, {})
|
|
10687
10719
|
},
|
|
10688
10720
|
index
|
|
10689
10721
|
);
|
|
10690
10722
|
case "switcher":
|
|
10691
|
-
return /* @__PURE__ */ (0,
|
|
10723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "df", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
10692
10724
|
Switcher_default,
|
|
10693
10725
|
{
|
|
10694
10726
|
label: action.label || null,
|
|
@@ -10703,15 +10735,15 @@ var TdActions = ({ actions, onChange, onActionClick, rowItem }) => {
|
|
|
10703
10735
|
};
|
|
10704
10736
|
|
|
10705
10737
|
// src/Atomic/UI/Table/TdTypes/TdPriority.js
|
|
10706
|
-
var
|
|
10707
|
-
var
|
|
10738
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
10739
|
+
var import_react42 = __toESM(require("react"), 1);
|
|
10708
10740
|
var import_classnames34 = __toESM(require("classnames"), 1);
|
|
10709
10741
|
var import_react_feather11 = require("react-feather");
|
|
10710
10742
|
var TdPriority = ({ onClick, rowIndex, cardLength }) => {
|
|
10711
|
-
return /* @__PURE__ */ (0,
|
|
10712
|
-
/* @__PURE__ */ (0,
|
|
10713
|
-
/* @__PURE__ */ (0,
|
|
10714
|
-
/* @__PURE__ */ (0,
|
|
10743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "cards-table__priority", children: [
|
|
10744
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "mr5", children: rowIndex + 1 }),
|
|
10745
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "df", children: [
|
|
10746
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
10715
10747
|
import_react_feather11.ArrowDown,
|
|
10716
10748
|
{
|
|
10717
10749
|
onClick: () => onClick(rowIndex),
|
|
@@ -10720,7 +10752,7 @@ var TdPriority = ({ onClick, rowIndex, cardLength }) => {
|
|
|
10720
10752
|
})
|
|
10721
10753
|
}
|
|
10722
10754
|
),
|
|
10723
|
-
/* @__PURE__ */ (0,
|
|
10755
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
10724
10756
|
import_react_feather11.ArrowUp,
|
|
10725
10757
|
{
|
|
10726
10758
|
onClick: () => onClick(rowIndex, true),
|
|
@@ -10733,17 +10765,17 @@ var TdPriority = ({ onClick, rowIndex, cardLength }) => {
|
|
|
10733
10765
|
var TdPriority_default = TdPriority;
|
|
10734
10766
|
|
|
10735
10767
|
// src/Atomic/UI/Table/TdTypes/TdWeight.js
|
|
10736
|
-
var
|
|
10737
|
-
var
|
|
10768
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
10769
|
+
var import_react43 = require("react");
|
|
10738
10770
|
var import_classnames35 = __toESM(require("classnames"), 1);
|
|
10739
10771
|
var TdWeight = ({ value, percent, onChange, className }) => {
|
|
10740
|
-
const [state, setState] = (0,
|
|
10772
|
+
const [state, setState] = (0, import_react43.useState)(value);
|
|
10741
10773
|
const {
|
|
10742
10774
|
isToggled: isEdited,
|
|
10743
10775
|
toggleOff: unsetIsEdited,
|
|
10744
10776
|
toggleOn: setIsEdited
|
|
10745
10777
|
} = useOutsideToggle(false);
|
|
10746
|
-
(0,
|
|
10778
|
+
(0, import_react43.useEffect)(() => {
|
|
10747
10779
|
setState(value);
|
|
10748
10780
|
}, [value, isEdited]);
|
|
10749
10781
|
const handleKeyUp = ({ keyCode, target }) => {
|
|
@@ -10753,7 +10785,7 @@ var TdWeight = ({ value, percent, onChange, className }) => {
|
|
|
10753
10785
|
unsetIsEdited();
|
|
10754
10786
|
}
|
|
10755
10787
|
};
|
|
10756
|
-
return /* @__PURE__ */ (0,
|
|
10788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_jsx_runtime42.Fragment, { children: isEdited ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
10757
10789
|
Input,
|
|
10758
10790
|
{
|
|
10759
10791
|
value: state,
|
|
@@ -10762,9 +10794,9 @@ var TdWeight = ({ value, percent, onChange, className }) => {
|
|
|
10762
10794
|
onKeyUp: handleKeyUp,
|
|
10763
10795
|
autoFocus: true
|
|
10764
10796
|
}
|
|
10765
|
-
) : /* @__PURE__ */ (0,
|
|
10766
|
-
/* @__PURE__ */ (0,
|
|
10767
|
-
/* @__PURE__ */ (0,
|
|
10797
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: (0, import_classnames35.default)("td-weight", className), onClick: setIsEdited, children: [
|
|
10798
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: value }),
|
|
10799
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "ml2 color--grey-gull", children: [
|
|
10768
10800
|
"(",
|
|
10769
10801
|
percent,
|
|
10770
10802
|
"%)"
|
|
@@ -10774,7 +10806,7 @@ var TdWeight = ({ value, percent, onChange, className }) => {
|
|
|
10774
10806
|
var TdWeight_default = TdWeight;
|
|
10775
10807
|
|
|
10776
10808
|
// src/Atomic/UI/Table/Partials/TdCell.js
|
|
10777
|
-
var
|
|
10809
|
+
var import_react44 = __toESM(require("react"), 1);
|
|
10778
10810
|
var TdCell = ({
|
|
10779
10811
|
type,
|
|
10780
10812
|
item,
|
|
@@ -10787,22 +10819,22 @@ var TdCell = ({
|
|
|
10787
10819
|
rowItem,
|
|
10788
10820
|
isDeleted
|
|
10789
10821
|
}) => {
|
|
10790
|
-
const [isAccordionOpen, setIsAccordionOpen] = (0,
|
|
10822
|
+
const [isAccordionOpen, setIsAccordionOpen] = (0, import_react44.useState)(item.isOpen);
|
|
10791
10823
|
const percent = item.type === "weight" && getAdviceWeight(isDeleted ? 0 : item.value);
|
|
10792
10824
|
switch (type) {
|
|
10793
10825
|
case "accordion":
|
|
10794
|
-
return /* @__PURE__ */ (0,
|
|
10826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
10795
10827
|
AccordionItem_default,
|
|
10796
10828
|
{
|
|
10797
10829
|
className: item.itemClassName,
|
|
10798
10830
|
item,
|
|
10799
10831
|
isOpen: isAccordionOpen,
|
|
10800
10832
|
onClick: (e) => setIsAccordionOpen(e),
|
|
10801
|
-
children: /* @__PURE__ */ (0,
|
|
10833
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Table_default, { rows: item.rows, className: "accordion--table" })
|
|
10802
10834
|
}
|
|
10803
10835
|
);
|
|
10804
10836
|
case "actions":
|
|
10805
|
-
return /* @__PURE__ */ (0,
|
|
10837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
10806
10838
|
TdActions,
|
|
10807
10839
|
{
|
|
10808
10840
|
rowItem,
|
|
@@ -10812,11 +10844,11 @@ var TdCell = ({
|
|
|
10812
10844
|
}
|
|
10813
10845
|
);
|
|
10814
10846
|
case "advancedTags":
|
|
10815
|
-
return /* @__PURE__ */ (0,
|
|
10847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(AdvancedTags_default, { items: item });
|
|
10816
10848
|
case "link":
|
|
10817
|
-
return /* @__PURE__ */ (0,
|
|
10849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("a", { href: item.link, children: item.label });
|
|
10818
10850
|
case "priority":
|
|
10819
|
-
return /* @__PURE__ */ (0,
|
|
10851
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
10820
10852
|
TdPriority_default,
|
|
10821
10853
|
{
|
|
10822
10854
|
rowIndex,
|
|
@@ -10825,7 +10857,7 @@ var TdCell = ({
|
|
|
10825
10857
|
}
|
|
10826
10858
|
);
|
|
10827
10859
|
case "status":
|
|
10828
|
-
return /* @__PURE__ */ (0,
|
|
10860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
10829
10861
|
Status_default,
|
|
10830
10862
|
{
|
|
10831
10863
|
className: item.className,
|
|
@@ -10834,9 +10866,9 @@ var TdCell = ({
|
|
|
10834
10866
|
}
|
|
10835
10867
|
);
|
|
10836
10868
|
case "tags":
|
|
10837
|
-
return item.map((tag, index) => /* @__PURE__ */ (0,
|
|
10869
|
+
return item.map((tag, index) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Tag_default, { label: tag.label }, index));
|
|
10838
10870
|
case "weight":
|
|
10839
|
-
return /* @__PURE__ */ (0,
|
|
10871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
10840
10872
|
TdWeight_default,
|
|
10841
10873
|
{
|
|
10842
10874
|
value: item.value,
|
|
@@ -10845,13 +10877,13 @@ var TdCell = ({
|
|
|
10845
10877
|
}
|
|
10846
10878
|
);
|
|
10847
10879
|
default:
|
|
10848
|
-
return /* @__PURE__ */ (0,
|
|
10880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: item.className, children: item.value });
|
|
10849
10881
|
}
|
|
10850
10882
|
};
|
|
10851
10883
|
var TdCell_default = TdCell;
|
|
10852
10884
|
|
|
10853
10885
|
// src/Atomic/UI/Table/Partials/TdRow.js
|
|
10854
|
-
var
|
|
10886
|
+
var import_react45 = __toESM(require("react"), 1);
|
|
10855
10887
|
var import_classnames36 = __toESM(require("classnames"), 1);
|
|
10856
10888
|
var TdRow = ({
|
|
10857
10889
|
item,
|
|
@@ -10869,27 +10901,27 @@ var TdRow = ({
|
|
|
10869
10901
|
isDeleted,
|
|
10870
10902
|
testId = "td-row"
|
|
10871
10903
|
}) => {
|
|
10872
|
-
const [isOpen, setIsOpen] = (0,
|
|
10904
|
+
const [isOpen, setIsOpen] = (0, import_react45.useState)(false);
|
|
10873
10905
|
const handleChange = handleObjectChange(item, () => onChange({ ...item }));
|
|
10874
|
-
return /* @__PURE__ */ (0,
|
|
10875
|
-
/* @__PURE__ */ (0,
|
|
10876
|
-
type && rowSpan && /* @__PURE__ */ (0,
|
|
10906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
10907
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("tr", { "data-testid": testId, children: [
|
|
10908
|
+
type && rowSpan && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("td", { className: "rel", rowSpan: rowSpan + 1, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
10877
10909
|
"span",
|
|
10878
10910
|
{
|
|
10879
10911
|
className: (0, import_classnames36.default)(
|
|
10880
10912
|
type && `cards-table__score cards-table__score-${cardStatus}`
|
|
10881
10913
|
),
|
|
10882
|
-
children: /* @__PURE__ */ (0,
|
|
10914
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(TdRange_default, { item: range })
|
|
10883
10915
|
}
|
|
10884
10916
|
) }),
|
|
10885
10917
|
Object.entries(item).map(
|
|
10886
|
-
([key, value]) => key === "id" || key === "isDeleted" ? null : /* @__PURE__ */ (0,
|
|
10918
|
+
([key, value]) => key === "id" || key === "isDeleted" ? null : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
10887
10919
|
"td",
|
|
10888
10920
|
{
|
|
10889
10921
|
className: (0, import_classnames36.default)("cards-table__body-item", {
|
|
10890
10922
|
"cards-table__accordion": value.type === "accordion"
|
|
10891
10923
|
}),
|
|
10892
|
-
children: /* @__PURE__ */ (0,
|
|
10924
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
10893
10925
|
TdCell_default,
|
|
10894
10926
|
{
|
|
10895
10927
|
onActionClick,
|
|
@@ -10909,10 +10941,10 @@ var TdRow = ({
|
|
|
10909
10941
|
)
|
|
10910
10942
|
)
|
|
10911
10943
|
] }),
|
|
10912
|
-
type && colSpan ? /* @__PURE__ */ (0,
|
|
10913
|
-
/* @__PURE__ */ (0,
|
|
10914
|
-
/* @__PURE__ */ (0,
|
|
10915
|
-
/* @__PURE__ */ (0,
|
|
10944
|
+
type && colSpan ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("tr", { children: [
|
|
10945
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("td", {}),
|
|
10946
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("td", { colSpan, children: [
|
|
10947
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
10916
10948
|
"span",
|
|
10917
10949
|
{
|
|
10918
10950
|
className: "cards-table__title-select-lender-btn",
|
|
@@ -10920,7 +10952,7 @@ var TdRow = ({
|
|
|
10920
10952
|
children: "Select Lender"
|
|
10921
10953
|
}
|
|
10922
10954
|
),
|
|
10923
|
-
/* @__PURE__ */ (0,
|
|
10955
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
10924
10956
|
Modal_default,
|
|
10925
10957
|
{
|
|
10926
10958
|
closeModal: () => setIsOpen(false),
|
|
@@ -10937,7 +10969,7 @@ var TdRow = ({
|
|
|
10937
10969
|
var TdRow_default = TdRow;
|
|
10938
10970
|
|
|
10939
10971
|
// src/Atomic/UI/Table/Table.js
|
|
10940
|
-
var
|
|
10972
|
+
var import_react46 = __toESM(require("react"), 1);
|
|
10941
10973
|
var import_classnames37 = __toESM(require("classnames"), 1);
|
|
10942
10974
|
var Table = ({
|
|
10943
10975
|
rows,
|
|
@@ -10951,16 +10983,16 @@ var Table = ({
|
|
|
10951
10983
|
rows[index] = value;
|
|
10952
10984
|
onChange({ header: [...header], rows: [...rows] });
|
|
10953
10985
|
};
|
|
10954
|
-
return /* @__PURE__ */ (0,
|
|
10986
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
10955
10987
|
"div",
|
|
10956
10988
|
{
|
|
10957
10989
|
"data-testid": testId,
|
|
10958
10990
|
className: (0, import_classnames37.default)("simple-table", {
|
|
10959
10991
|
[`simple-table--${className}`]: className
|
|
10960
10992
|
}),
|
|
10961
|
-
children: /* @__PURE__ */ (0,
|
|
10962
|
-
/* @__PURE__ */ (0,
|
|
10963
|
-
/* @__PURE__ */ (0,
|
|
10993
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("table", { children: [
|
|
10994
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("tr", { children: header?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(TdHeader_default, { item }, item.key)) }) }),
|
|
10995
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("tbody", { children: rows && rows?.length ? rows?.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
10964
10996
|
TdRow_default,
|
|
10965
10997
|
{
|
|
10966
10998
|
onActionClick,
|
|
@@ -10970,7 +11002,7 @@ var Table = ({
|
|
|
10970
11002
|
onChange: (value) => handleArrayChange(value, index)
|
|
10971
11003
|
},
|
|
10972
11004
|
typeof row.id === "object" ? row.id.value : row.id
|
|
10973
|
-
)) : /* @__PURE__ */ (0,
|
|
11005
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("td", { className: "row--not-found", colSpan: header?.length, children: "Not set" }) }) })
|
|
10974
11006
|
] })
|
|
10975
11007
|
}
|
|
10976
11008
|
);
|
|
@@ -10981,9 +11013,9 @@ var Table_default = Table;
|
|
|
10981
11013
|
var Tag_default2 = Tag_default;
|
|
10982
11014
|
|
|
10983
11015
|
// src/Atomic/UI/TagList/TagList.tsx
|
|
10984
|
-
var
|
|
11016
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
10985
11017
|
var import_classnames38 = __toESM(require("classnames"), 1);
|
|
10986
|
-
var
|
|
11018
|
+
var import_react47 = require("react");
|
|
10987
11019
|
var import_react_feather12 = require("react-feather");
|
|
10988
11020
|
var TagList = ({
|
|
10989
11021
|
disabled,
|
|
@@ -11001,11 +11033,11 @@ var TagList = ({
|
|
|
11001
11033
|
onToggleRenderAll,
|
|
11002
11034
|
isUseInTable
|
|
11003
11035
|
}) => {
|
|
11004
|
-
const wrapperRef = (0,
|
|
11005
|
-
const [tagList, setTagList] = (0,
|
|
11006
|
-
const [staticTagsCount, setStaticTagsCount] = (0,
|
|
11007
|
-
const [renderItemsCount, setRenderItemsCount] = (0,
|
|
11008
|
-
const [renderAll, setRenderAll] = (0,
|
|
11036
|
+
const wrapperRef = (0, import_react47.useRef)(null);
|
|
11037
|
+
const [tagList, setTagList] = (0, import_react47.useState)([]);
|
|
11038
|
+
const [staticTagsCount, setStaticTagsCount] = (0, import_react47.useState)(-1);
|
|
11039
|
+
const [renderItemsCount, setRenderItemsCount] = (0, import_react47.useState)(-1);
|
|
11040
|
+
const [renderAll, setRenderAll] = (0, import_react47.useState)(!withToggle);
|
|
11009
11041
|
const wrapperWidth = wrapperRef?.current?.getBoundingClientRect()?.width ?? -1;
|
|
11010
11042
|
const setRenderAllInterceptor = (v, event) => {
|
|
11011
11043
|
setRenderAll(v);
|
|
@@ -11056,12 +11088,12 @@ var TagList = ({
|
|
|
11056
11088
|
});
|
|
11057
11089
|
if (!item) return null;
|
|
11058
11090
|
const isHidden = renderItemsCount !== -1 && staticTagsCount !== -1 ? i >= renderItemsCount : false;
|
|
11059
|
-
return /* @__PURE__ */ (0,
|
|
11091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
11060
11092
|
"div",
|
|
11061
11093
|
{
|
|
11062
11094
|
className: `tag-list_wrapper_item ${isHidden ? "tag-list_wrapper_item--hidden" : ""}`,
|
|
11063
11095
|
ref: checkedRef(item?.itemRef),
|
|
11064
|
-
children: /* @__PURE__ */ (0,
|
|
11096
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
11065
11097
|
Tag_default,
|
|
11066
11098
|
{
|
|
11067
11099
|
testId: `test-taglist-item-${item?.id ?? item?.value}`,
|
|
@@ -11082,7 +11114,7 @@ var TagList = ({
|
|
|
11082
11114
|
}
|
|
11083
11115
|
const restItems = tagList.length - renderItemsCount;
|
|
11084
11116
|
if (restItems === 0 || !withToggle || staticTagsCount === -1) return null;
|
|
11085
|
-
return /* @__PURE__ */ (0,
|
|
11117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
11086
11118
|
Tag_default,
|
|
11087
11119
|
{
|
|
11088
11120
|
label: `+${restItems}`,
|
|
@@ -11097,7 +11129,7 @@ var TagList = ({
|
|
|
11097
11129
|
if (renderItemsCount !== tagList?.length || !withToggle || staticTagsCount === -1 || staticTagsCount === tagList?.length) {
|
|
11098
11130
|
return null;
|
|
11099
11131
|
}
|
|
11100
|
-
return /* @__PURE__ */ (0,
|
|
11132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
11101
11133
|
Tag_default,
|
|
11102
11134
|
{
|
|
11103
11135
|
label: "...",
|
|
@@ -11107,14 +11139,14 @@ var TagList = ({
|
|
|
11107
11139
|
}
|
|
11108
11140
|
);
|
|
11109
11141
|
};
|
|
11110
|
-
(0,
|
|
11142
|
+
(0, import_react47.useEffect)(() => {
|
|
11111
11143
|
setStaticTagsCount(-1);
|
|
11112
11144
|
setRenderItemsCount(-1);
|
|
11113
11145
|
setRenderAllInterceptor(false, null);
|
|
11114
|
-
const itemsWithRef = items.map((item) => ({ ...item, itemRef: (0,
|
|
11146
|
+
const itemsWithRef = items.map((item) => ({ ...item, itemRef: (0, import_react47.createRef)() }));
|
|
11115
11147
|
setTagList(itemsWithRef);
|
|
11116
11148
|
}, [items]);
|
|
11117
|
-
(0,
|
|
11149
|
+
(0, import_react47.useLayoutEffect)(() => {
|
|
11118
11150
|
if (withToggle && wrapperWidth !== -1 && staticTagsCount === -1) {
|
|
11119
11151
|
let computedWidth = wrapperWidth;
|
|
11120
11152
|
if (computedWidth === 0) {
|
|
@@ -11127,16 +11159,16 @@ var TagList = ({
|
|
|
11127
11159
|
}
|
|
11128
11160
|
}
|
|
11129
11161
|
}, [tagList, wrapperWidth, wrapperRef?.current]);
|
|
11130
|
-
(0,
|
|
11162
|
+
(0, import_react47.useLayoutEffect)(() => {
|
|
11131
11163
|
setRenderItemsCount(staticTagsCount);
|
|
11132
11164
|
}, [staticTagsCount]);
|
|
11133
|
-
(0,
|
|
11165
|
+
(0, import_react47.useEffect)(() => {
|
|
11134
11166
|
setRenderItemsCount(renderAll ? tagList?.length : staticTagsCount);
|
|
11135
11167
|
}, [renderAll]);
|
|
11136
|
-
(0,
|
|
11168
|
+
(0, import_react47.useEffect)(() => {
|
|
11137
11169
|
if (wrapperRef?.current && refProp) refProp.current = wrapperRef?.current;
|
|
11138
11170
|
}, [wrapperRef?.current]);
|
|
11139
|
-
return /* @__PURE__ */ (0,
|
|
11171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
11140
11172
|
"div",
|
|
11141
11173
|
{
|
|
11142
11174
|
"data-testid": testId,
|
|
@@ -11155,7 +11187,7 @@ var TagList = ({
|
|
|
11155
11187
|
renderTags(),
|
|
11156
11188
|
renderMoreTags(),
|
|
11157
11189
|
renderHideTags(),
|
|
11158
|
-
typeof onEditClick === "function" && /* @__PURE__ */ (0,
|
|
11190
|
+
typeof onEditClick === "function" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "tag-list__edit-trigger", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react_feather12.Edit3, { onClick: onEditClick }) })
|
|
11159
11191
|
]
|
|
11160
11192
|
}
|
|
11161
11193
|
);
|
|
@@ -11163,10 +11195,10 @@ var TagList = ({
|
|
|
11163
11195
|
var TagList_default = TagList;
|
|
11164
11196
|
|
|
11165
11197
|
// src/Atomic/UI/UserBox/UserBox.tsx
|
|
11166
|
-
var
|
|
11198
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
11167
11199
|
|
|
11168
11200
|
// src/Atomic/FormElements/Label/Label.tsx
|
|
11169
|
-
var
|
|
11201
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
11170
11202
|
var import_classnames39 = __toESM(require("classnames"), 1);
|
|
11171
11203
|
var CN8 = "label";
|
|
11172
11204
|
var Label = ({
|
|
@@ -11182,13 +11214,13 @@ var Label = ({
|
|
|
11182
11214
|
isAccessabilityHint = false,
|
|
11183
11215
|
testId = CN8
|
|
11184
11216
|
}) => {
|
|
11185
|
-
const correctLabel = isRequired ? /* @__PURE__ */ (0,
|
|
11217
|
+
const correctLabel = isRequired ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
11186
11218
|
label,
|
|
11187
11219
|
" ",
|
|
11188
|
-
/* @__PURE__ */ (0,
|
|
11220
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "label_asterisk", children: "*" }),
|
|
11189
11221
|
" ",
|
|
11190
|
-
note && /* @__PURE__ */ (0,
|
|
11191
|
-
hint && /* @__PURE__ */ (0,
|
|
11222
|
+
note && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "label_note", children: note }),
|
|
11223
|
+
hint && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
11192
11224
|
Hint_default,
|
|
11193
11225
|
{
|
|
11194
11226
|
id: `hint-${label}`,
|
|
@@ -11204,11 +11236,11 @@ var Label = ({
|
|
|
11204
11236
|
},
|
|
11205
11237
|
`hint-${label}`
|
|
11206
11238
|
)
|
|
11207
|
-
] }) : /* @__PURE__ */ (0,
|
|
11239
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
11208
11240
|
label,
|
|
11209
11241
|
" ",
|
|
11210
|
-
note && /* @__PURE__ */ (0,
|
|
11211
|
-
hint && /* @__PURE__ */ (0,
|
|
11242
|
+
note && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "label_note", children: note }),
|
|
11243
|
+
hint && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
11212
11244
|
Hint_default,
|
|
11213
11245
|
{
|
|
11214
11246
|
isAccessability: isAccessabilityHint,
|
|
@@ -11225,14 +11257,14 @@ var Label = ({
|
|
|
11225
11257
|
void 0
|
|
11226
11258
|
)
|
|
11227
11259
|
] });
|
|
11228
|
-
return /* @__PURE__ */ (0,
|
|
11260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
11229
11261
|
"span",
|
|
11230
11262
|
{
|
|
11231
11263
|
tabIndex: isAccessability ? 0 : -1,
|
|
11232
11264
|
"aria-label": label,
|
|
11233
11265
|
className: (0, import_classnames39.default)(CN8, { label_bold: isLabelBolt, error, isRequired }, className),
|
|
11234
11266
|
"data-testid": testId,
|
|
11235
|
-
children: /* @__PURE__ */ (0,
|
|
11267
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "label_text", "data-testid": "label-text", children: correctLabel })
|
|
11236
11268
|
}
|
|
11237
11269
|
);
|
|
11238
11270
|
};
|
|
@@ -11253,24 +11285,24 @@ var UserBox = ({
|
|
|
11253
11285
|
const getNameFirstLetter = name.charAt(0).toUpperCase();
|
|
11254
11286
|
const renderUser = () => {
|
|
11255
11287
|
if (isModal) {
|
|
11256
|
-
return /* @__PURE__ */ (0,
|
|
11257
|
-
/* @__PURE__ */ (0,
|
|
11258
|
-
/* @__PURE__ */ (0,
|
|
11259
|
-
/* @__PURE__ */ (0,
|
|
11260
|
-
role && /* @__PURE__ */ (0,
|
|
11288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
11289
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { style: { backgroundColor: getColorById(id, colors) }, className: "td-user-box__avatar", children: getNameFirstLetter }),
|
|
11290
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "td-user-box__user-data", children: [
|
|
11291
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Button_default, { className: "p0 no-shadow", onClick, label: name, variant: "link" }),
|
|
11292
|
+
role && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: role })
|
|
11261
11293
|
] })
|
|
11262
11294
|
] });
|
|
11263
11295
|
} else {
|
|
11264
|
-
return /* @__PURE__ */ (0,
|
|
11265
|
-
/* @__PURE__ */ (0,
|
|
11266
|
-
/* @__PURE__ */ (0,
|
|
11267
|
-
/* @__PURE__ */ (0,
|
|
11268
|
-
role && /* @__PURE__ */ (0,
|
|
11296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
11297
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { style: { backgroundColor: getColorById(id) }, className: "td-user-box__avatar", children: getNameFirstLetter }),
|
|
11298
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "td-user-box__user-data", children: [
|
|
11299
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Label_default, { label: name }),
|
|
11300
|
+
role && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { "aria-label": `User role: ${role}`, children: role })
|
|
11269
11301
|
] })
|
|
11270
11302
|
] });
|
|
11271
11303
|
}
|
|
11272
11304
|
};
|
|
11273
|
-
return /* @__PURE__ */ (0,
|
|
11305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
11274
11306
|
"div",
|
|
11275
11307
|
{
|
|
11276
11308
|
"data-testid": testId,
|
|
@@ -11287,41 +11319,41 @@ var UserBox_default = UserBox;
|
|
|
11287
11319
|
var UserBox_default2 = UserBox_default;
|
|
11288
11320
|
|
|
11289
11321
|
// src/Atomic/UI/WizardStepper/ui/StepWrapper/StepWrapper.tsx
|
|
11290
|
-
var
|
|
11322
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
11291
11323
|
|
|
11292
11324
|
// src/Atomic/UI/WizardStepper/ui/icons.tsx
|
|
11293
|
-
var
|
|
11294
|
-
var DoneIcon = () => /* @__PURE__ */ (0,
|
|
11295
|
-
/* @__PURE__ */ (0,
|
|
11296
|
-
/* @__PURE__ */ (0,
|
|
11297
|
-
/* @__PURE__ */ (0,
|
|
11325
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
11326
|
+
var DoneIcon = () => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
11327
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("rect", { width: "20", height: "20", rx: "10", fill: "#69A457" }),
|
|
11328
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("mask", { id: "mask0_54394_4001", style: { maskType: "alpha" }, maskUnits: "userSpaceOnUse", x: "2", y: "2", width: "16", height: "16", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("path", { d: "M14.5 7L9 12.5L6 9.5", stroke: "black", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }),
|
|
11329
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("g", { mask: "url(#mask0_54394_4001)", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("rect", { x: "2", y: "2", width: "16", height: "16", fill: "white" }) })
|
|
11298
11330
|
] });
|
|
11299
11331
|
var TodoIcon = () => {
|
|
11300
|
-
return /* @__PURE__ */ (0,
|
|
11301
|
-
/* @__PURE__ */ (0,
|
|
11302
|
-
/* @__PURE__ */ (0,
|
|
11332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
11333
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("g", { clipPath: "url(#clip0_54394_4448)", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("circle", { cx: "10", cy: "10", r: "7", fill: "white", stroke: "#B3B8CB", strokeWidth: "2" }) }),
|
|
11334
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("clipPath", { id: "clip0_54394_4448", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("rect", { width: "16", height: "16", fill: "white", transform: "translate(2 2)" }) }) })
|
|
11303
11335
|
] });
|
|
11304
11336
|
};
|
|
11305
11337
|
var ActiveIcon = () => {
|
|
11306
|
-
return /* @__PURE__ */ (0,
|
|
11307
|
-
/* @__PURE__ */ (0,
|
|
11338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
11339
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("rect", { width: "20", height: "20", rx: "10", fill: "#E8F9E5" }),
|
|
11308
11340
|
"ii",
|
|
11309
|
-
/* @__PURE__ */ (0,
|
|
11310
|
-
/* @__PURE__ */ (0,
|
|
11341
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("mask", { id: "mask0_54394_1459", style: { maskType: "alpha" }, maskUnits: "userSpaceOnUse", x: "2", y: "2", width: "16", height: "16", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("circle", { cx: "10", cy: "10", r: "4", fill: "#171D33" }) }),
|
|
11342
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("g", { mask: "url(#mask0_54394_1459)", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("rect", { x: "2", y: "2", width: "16", height: "16", fill: "#171D33" }) })
|
|
11311
11343
|
] });
|
|
11312
11344
|
};
|
|
11313
11345
|
var alternativeIconSet = {
|
|
11314
|
-
defaultIcon: /* @__PURE__ */ (0,
|
|
11315
|
-
doneIcon: /* @__PURE__ */ (0,
|
|
11316
|
-
activeIcon: /* @__PURE__ */ (0,
|
|
11346
|
+
defaultIcon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TodoIcon, {}),
|
|
11347
|
+
doneIcon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(DoneIcon, {}),
|
|
11348
|
+
activeIcon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ActiveIcon, {})
|
|
11317
11349
|
};
|
|
11318
11350
|
|
|
11319
11351
|
// src/Atomic/UI/WizardStepper/ui/StepRow/StepRow.tsx
|
|
11320
|
-
var
|
|
11352
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
11321
11353
|
|
|
11322
11354
|
// src/Atomic/UI/WizardStepper/constructor.js
|
|
11323
|
-
var
|
|
11324
|
-
var
|
|
11355
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
11356
|
+
var import_react51 = __toESM(require("react"), 1);
|
|
11325
11357
|
var WIZARD_STEP_VARIANTS = Object.freeze({
|
|
11326
11358
|
DEFAULT: "default",
|
|
11327
11359
|
DONE: "done",
|
|
@@ -11340,9 +11372,9 @@ var JSXMockComponent = () => {
|
|
|
11340
11372
|
letterSpacing: "0.2px"
|
|
11341
11373
|
};
|
|
11342
11374
|
return arr.map((row) => {
|
|
11343
|
-
return /* @__PURE__ */ (0,
|
|
11344
|
-
/* @__PURE__ */ (0,
|
|
11345
|
-
/* @__PURE__ */ (0,
|
|
11375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { style: { display: "flex", justifyContent: "space-between", maxWidth: "250px" }, children: [
|
|
11376
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { style: textStyles, children: row.title }),
|
|
11377
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { style: textStyles, children: row.value })
|
|
11346
11378
|
] });
|
|
11347
11379
|
});
|
|
11348
11380
|
};
|
|
@@ -11365,14 +11397,14 @@ var mockData = [
|
|
|
11365
11397
|
label: "Add Co-Owners",
|
|
11366
11398
|
description: "{merchantName} will receive that amount from {lenderNmae}",
|
|
11367
11399
|
isActive: true,
|
|
11368
|
-
titleSlot: /* @__PURE__ */ (0,
|
|
11369
|
-
contentSlot: /* @__PURE__ */ (0,
|
|
11400
|
+
titleSlot: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "custom-title-slot", children: "$15,001" }),
|
|
11401
|
+
contentSlot: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(JSXMockComponent, {})
|
|
11370
11402
|
},
|
|
11371
11403
|
{
|
|
11372
11404
|
key: "bankAccount",
|
|
11373
11405
|
label: "Add a Bank Account",
|
|
11374
11406
|
description: "Your bank account information will be used to securely and automatically transfer the funds",
|
|
11375
|
-
titleSlot: /* @__PURE__ */ (0,
|
|
11407
|
+
titleSlot: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Status_default, { label: "Some JSX", status: "draft" })
|
|
11376
11408
|
},
|
|
11377
11409
|
{
|
|
11378
11410
|
key: "documents",
|
|
@@ -11402,24 +11434,24 @@ var mockData = [
|
|
|
11402
11434
|
];
|
|
11403
11435
|
|
|
11404
11436
|
// src/Atomic/UI/WizardStepper/ui/StateIcon/StateIcon.tsx
|
|
11405
|
-
var
|
|
11437
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
11406
11438
|
var import_classnames41 = __toESM(require("classnames"), 1);
|
|
11407
11439
|
var DefaultPoint = () => {
|
|
11408
|
-
return /* @__PURE__ */ (0,
|
|
11440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("circle", { cx: "8", cy: "8", r: "4" }) });
|
|
11409
11441
|
};
|
|
11410
11442
|
var DonePoint = () => {
|
|
11411
|
-
return /* @__PURE__ */ (0,
|
|
11443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("path", { d: "M12.5 5L7 10.5L4 7.5", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
11412
11444
|
};
|
|
11413
11445
|
var RC9 = "state-icon";
|
|
11414
11446
|
var { ACTIVE, DEFAULT, DONE } = WIZARD_STEP_VARIANTS;
|
|
11415
11447
|
var StateIcon = ({ variant = DEFAULT, className }) => {
|
|
11416
11448
|
const computedState = variant === ACTIVE || variant === DONE ? variant : DEFAULT;
|
|
11417
11449
|
const Inner = {
|
|
11418
|
-
[DEFAULT]: /* @__PURE__ */ (0,
|
|
11419
|
-
[ACTIVE]: /* @__PURE__ */ (0,
|
|
11420
|
-
[DONE]: /* @__PURE__ */ (0,
|
|
11450
|
+
[DEFAULT]: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(DefaultPoint, {}),
|
|
11451
|
+
[ACTIVE]: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(DefaultPoint, {}),
|
|
11452
|
+
[DONE]: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(DonePoint, {})
|
|
11421
11453
|
};
|
|
11422
|
-
return /* @__PURE__ */ (0,
|
|
11454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: (0, import_classnames41.default)(RC9, `${RC9}--${computedState}`, className), children: Inner[computedState] });
|
|
11423
11455
|
};
|
|
11424
11456
|
|
|
11425
11457
|
// src/Atomic/UI/WizardStepper/ui/StateIcon/index.ts
|
|
@@ -11453,22 +11485,22 @@ var StepRow = ({
|
|
|
11453
11485
|
})();
|
|
11454
11486
|
const CorrectIcon = () => {
|
|
11455
11487
|
if (!customIcons || Object?.values(customIcons)?.every((icon) => !icon)) {
|
|
11456
|
-
return /* @__PURE__ */ (0,
|
|
11488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(StateIcon_default, { variant: rowVariant });
|
|
11457
11489
|
}
|
|
11458
11490
|
return alternaviteIconFromProps || null;
|
|
11459
11491
|
};
|
|
11460
|
-
return /* @__PURE__ */ (0,
|
|
11461
|
-
/* @__PURE__ */ (0,
|
|
11462
|
-
/* @__PURE__ */ (0,
|
|
11463
|
-
/* @__PURE__ */ (0,
|
|
11464
|
-
/* @__PURE__ */ (0,
|
|
11465
|
-
/* @__PURE__ */ (0,
|
|
11466
|
-
isOptional && /* @__PURE__ */ (0,
|
|
11492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: (0, import_classnames42.default)(RC10, `${RC10}--${rowVariant}`, className), children: [
|
|
11493
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: (0, import_classnames42.default)(`${RC10}__state-point`, `${RC10}__state-point--${rowVariant}`), children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(CorrectIcon, {}) }),
|
|
11494
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: `${RC10}__content`, children: [
|
|
11495
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: `${RC10}__title`, children: [
|
|
11496
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: `${RC10}__title-left`, children: [
|
|
11497
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: (0, import_classnames42.default)(`${RC10}__title-text`, { "text-muted": rowVariant === DEFAULT2 }), children: title }),
|
|
11498
|
+
isOptional && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Status_default, { label: "Optional", status: "draft" })
|
|
11467
11499
|
] }),
|
|
11468
|
-
titleSlot && /* @__PURE__ */ (0,
|
|
11500
|
+
titleSlot && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: `${RC10}__title-right`, children: titleSlot })
|
|
11469
11501
|
] }),
|
|
11470
|
-
description && /* @__PURE__ */ (0,
|
|
11471
|
-
contentSlot && /* @__PURE__ */ (0,
|
|
11502
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: `${RC10}__description`, children: description }),
|
|
11503
|
+
contentSlot && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: `${RC10}__body`, children: contentSlot })
|
|
11472
11504
|
] })
|
|
11473
11505
|
] }, label);
|
|
11474
11506
|
};
|
|
@@ -11483,10 +11515,10 @@ var StepWrapper = ({
|
|
|
11483
11515
|
className,
|
|
11484
11516
|
testId = "step-wrapper"
|
|
11485
11517
|
}) => {
|
|
11486
|
-
if (!steps?.length) return /* @__PURE__ */ (0,
|
|
11518
|
+
if (!steps?.length) return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { "data-testid": "empty-state", children: "No steps available" });
|
|
11487
11519
|
const renderStepRow = (step) => {
|
|
11488
11520
|
const { key, ...stepProps } = step;
|
|
11489
|
-
return /* @__PURE__ */ (0,
|
|
11521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11490
11522
|
StepRow_default,
|
|
11491
11523
|
{
|
|
11492
11524
|
...stepProps,
|
|
@@ -11497,7 +11529,7 @@ var StepWrapper = ({
|
|
|
11497
11529
|
};
|
|
11498
11530
|
switch (variant) {
|
|
11499
11531
|
case "ghost":
|
|
11500
|
-
return /* @__PURE__ */ (0,
|
|
11532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11501
11533
|
Box_default,
|
|
11502
11534
|
{
|
|
11503
11535
|
className: (0, import_classnames43.default)("step-wrapper", "step-wrapper-ghost", className),
|
|
@@ -11506,7 +11538,7 @@ var StepWrapper = ({
|
|
|
11506
11538
|
}
|
|
11507
11539
|
);
|
|
11508
11540
|
case "cardActive":
|
|
11509
|
-
return /* @__PURE__ */ (0,
|
|
11541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11510
11542
|
"div",
|
|
11511
11543
|
{
|
|
11512
11544
|
className: (0, import_classnames43.default)("step-wrapper", "step-wrapper-card-active", className),
|
|
@@ -11515,7 +11547,7 @@ var StepWrapper = ({
|
|
|
11515
11547
|
}
|
|
11516
11548
|
);
|
|
11517
11549
|
default:
|
|
11518
|
-
return /* @__PURE__ */ (0,
|
|
11550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11519
11551
|
"div",
|
|
11520
11552
|
{
|
|
11521
11553
|
className: (0, import_classnames43.default)("step-wrapper", className),
|