@dmsi/wedgekit-react 0.0.161 → 0.0.163
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/{chunk-SBSHZ327.js → chunk-O4JGGMFE.js} +3 -7
- package/dist/{chunk-RLK4TBXR.js → chunk-UBU6IJML.js} +20 -4
- package/dist/components/DataGridCell.cjs +22 -10
- package/dist/components/DataGridCell.js +2 -2
- package/dist/components/HorizontalDivider.js +8 -3
- package/dist/components/Menu.cjs +20 -4
- package/dist/components/Menu.js +1 -1
- package/dist/components/Radio.js +133 -5
- package/dist/components/WorldpayIframe.js +6 -3
- package/dist/components/index.cjs +51 -1050
- package/dist/components/index.js +3 -18
- package/dist/index.css +0 -6
- package/package.json +1 -1
- package/src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx +1 -0
- package/src/components/DataGridCell.tsx +1 -1
- package/src/components/Menu.tsx +25 -3
- package/src/components/index.ts +0 -1
- package/dist/chunk-BATIOCXB.js +0 -138
- package/dist/chunk-EPQLWHCL.js +0 -11
- package/dist/chunk-NT2ZKA4W.js +0 -266
- package/dist/chunk-WFGKIR5A.js +0 -9
- package/dist/chunk-WFLOAGEI.js +0 -112
- package/dist/components/PaymentOnAccountModal.cjs +0 -2381
- package/dist/components/PaymentOnAccountModal.js +0 -35
- package/dist/components/SelectPaymentMethod.cjs +0 -1355
- package/dist/components/SelectPaymentMethod.js +0 -22
- package/src/components/PaymentOnAccountModal.tsx +0 -121
- package/src/components/SelectPaymentMethod.tsx +0 -315
package/dist/components/index.js
CHANGED
|
@@ -4,21 +4,6 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
Select
|
|
6
6
|
} from "../chunk-XH65MD2C.js";
|
|
7
|
-
import {
|
|
8
|
-
PaymentOnAccountModal
|
|
9
|
-
} from "../chunk-WFLOAGEI.js";
|
|
10
|
-
import "../chunk-NT2ZKA4W.js";
|
|
11
|
-
import "../chunk-WFGKIR5A.js";
|
|
12
|
-
import "../chunk-BATIOCXB.js";
|
|
13
|
-
import "../chunk-FCREADUH.js";
|
|
14
|
-
import "../chunk-4RJKB7LC.js";
|
|
15
|
-
import "../chunk-C4JGTH6G.js";
|
|
16
|
-
import "../chunk-SYEJVSE4.js";
|
|
17
|
-
import "../chunk-R7ELP5C5.js";
|
|
18
|
-
import "../chunk-ZFOANBWG.js";
|
|
19
|
-
import "../chunk-PLMGI5K5.js";
|
|
20
|
-
import "../chunk-AZ7LVLOK.js";
|
|
21
|
-
import "../chunk-EPQLWHCL.js";
|
|
22
7
|
import {
|
|
23
8
|
Checkbox
|
|
24
9
|
} from "../chunk-WFQEE2OO.js";
|
|
@@ -27,10 +12,10 @@ import {
|
|
|
27
12
|
DataGridCell,
|
|
28
13
|
DragAlongCell,
|
|
29
14
|
DraggableCellHeader
|
|
30
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-O4JGGMFE.js";
|
|
31
16
|
import {
|
|
32
17
|
Menu
|
|
33
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-UBU6IJML.js";
|
|
34
19
|
import "../chunk-5GUW4DUY.js";
|
|
35
20
|
import {
|
|
36
21
|
MenuOption
|
|
@@ -575,6 +560,7 @@ function ColumnSelectorHeaderCell({
|
|
|
575
560
|
position: "bottom-right",
|
|
576
561
|
show,
|
|
577
562
|
setShow,
|
|
563
|
+
calculateMinMaxHeight: true,
|
|
578
564
|
children: [
|
|
579
565
|
/* @__PURE__ */ jsx7(
|
|
580
566
|
Button,
|
|
@@ -1124,7 +1110,6 @@ export {
|
|
|
1124
1110
|
Menu,
|
|
1125
1111
|
MenuOption,
|
|
1126
1112
|
Paragraph,
|
|
1127
|
-
PaymentOnAccountModal,
|
|
1128
1113
|
Search,
|
|
1129
1114
|
Select,
|
|
1130
1115
|
Subheader,
|
package/dist/index.css
CHANGED
|
@@ -1872,9 +1872,6 @@
|
|
|
1872
1872
|
.py-\[calc\(var\(--spacing-mobile-component-padding\)_\+_3px\)\] {
|
|
1873
1873
|
padding-block: calc(var(--spacing-mobile-component-padding) + 3px);
|
|
1874
1874
|
}
|
|
1875
|
-
.py-desktop-component-padding {
|
|
1876
|
-
padding-block: var(--spacing-desktop-component-padding);
|
|
1877
|
-
}
|
|
1878
1875
|
.py-mobile-component-gap {
|
|
1879
1876
|
padding-block: var(--spacing-mobile-component-gap);
|
|
1880
1877
|
}
|
|
@@ -1893,9 +1890,6 @@
|
|
|
1893
1890
|
.pt-\[7px\] {
|
|
1894
1891
|
padding-top: 7px;
|
|
1895
1892
|
}
|
|
1896
|
-
.pr-desktop-component-padding {
|
|
1897
|
-
padding-right: var(--spacing-desktop-component-padding);
|
|
1898
|
-
}
|
|
1899
1893
|
.pb-2 {
|
|
1900
1894
|
padding-bottom: calc(var(--spacing) * 2);
|
|
1901
1895
|
}
|
package/package.json
CHANGED
package/src/components/Menu.tsx
CHANGED
|
@@ -31,6 +31,7 @@ type MenuProps = {
|
|
|
31
31
|
useDefaultMinWidth?: boolean;
|
|
32
32
|
autoFocusOff?: boolean;
|
|
33
33
|
menuName?: string;
|
|
34
|
+
calculateMinMaxHeight?: boolean;
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
export const Menu = ({
|
|
@@ -51,6 +52,7 @@ export const Menu = ({
|
|
|
51
52
|
useDefaultMinWidth,
|
|
52
53
|
autoFocusOff,
|
|
53
54
|
menuName,
|
|
55
|
+
calculateMinMaxHeight,
|
|
54
56
|
...props
|
|
55
57
|
}: ComponentProps<"div"> & MenuProps) => {
|
|
56
58
|
const internalRef = useRef<HTMLDivElement>(null);
|
|
@@ -69,8 +71,12 @@ export const Menu = ({
|
|
|
69
71
|
);
|
|
70
72
|
|
|
71
73
|
useEffect(() => {
|
|
74
|
+
if (calculateMinMaxHeight) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
72
78
|
const raf = requestAnimationFrame(() => {
|
|
73
|
-
if (!actualRef
|
|
79
|
+
if (!actualRef.current || customMaxHeight) {
|
|
74
80
|
return;
|
|
75
81
|
}
|
|
76
82
|
|
|
@@ -85,15 +91,31 @@ export const Menu = ({
|
|
|
85
91
|
accumulatedHeight += child.clientHeight;
|
|
86
92
|
});
|
|
87
93
|
|
|
88
|
-
accumulatedHeight = (accumulatedHeight / 5) * 4.5;
|
|
94
|
+
accumulatedHeight = (accumulatedHeight / 5) * 4.5; // default max height is set to 4.5 times of the first 5 child height of the menu
|
|
89
95
|
|
|
90
96
|
setMaxHeight(`${accumulatedHeight}px`);
|
|
91
97
|
}
|
|
92
98
|
});
|
|
99
|
+
|
|
93
100
|
return () => {
|
|
94
101
|
cancelAnimationFrame(raf);
|
|
95
102
|
};
|
|
96
|
-
}, [actualRef, customMaxHeight]);
|
|
103
|
+
}, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
|
|
104
|
+
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
if (!calculateMinMaxHeight) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (positionTo?.current && actualRef.current) {
|
|
111
|
+
const positionToRect = positionTo.current.getBoundingClientRect();
|
|
112
|
+
const offsetInPx = 16;
|
|
113
|
+
|
|
114
|
+
const calculatedMaxHeight = window.innerHeight - positionToRect.bottom - offsetInPx;
|
|
115
|
+
|
|
116
|
+
setMaxHeight(`${calculatedMaxHeight}px`);
|
|
117
|
+
}
|
|
118
|
+
}, [actualRef.current, positionTo?.current, calculateMinMaxHeight])
|
|
97
119
|
|
|
98
120
|
useEffect(() => {
|
|
99
121
|
if (!show) {
|
package/src/components/index.ts
CHANGED
|
@@ -18,6 +18,5 @@ export { MenuOption } from "./MenuOption";
|
|
|
18
18
|
export { Search } from "./Search";
|
|
19
19
|
export { Tooltip } from "./Tooltip";
|
|
20
20
|
export { Input } from "./Input";
|
|
21
|
-
export { PaymentOnAccountModal } from "./PaymentOnAccountModal";
|
|
22
21
|
export { Accordion } from "./Accordion";
|
|
23
22
|
export { Card } from "./Card";
|
package/dist/chunk-BATIOCXB.js
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Paragraph
|
|
3
|
-
} from "./chunk-HVI3CL7Y.js";
|
|
4
|
-
import {
|
|
5
|
-
baseTransition,
|
|
6
|
-
componentGap
|
|
7
|
-
} from "./chunk-RDLEIAQU.js";
|
|
8
|
-
import {
|
|
9
|
-
__objRest,
|
|
10
|
-
__spreadValues
|
|
11
|
-
} from "./chunk-ORMEWXMH.js";
|
|
12
|
-
|
|
13
|
-
// src/components/Radio.tsx
|
|
14
|
-
import clsx from "clsx";
|
|
15
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
-
var Radio = (_a) => {
|
|
17
|
-
var _b = _a, {
|
|
18
|
-
className,
|
|
19
|
-
label,
|
|
20
|
-
error,
|
|
21
|
-
disabled,
|
|
22
|
-
checked,
|
|
23
|
-
readOnly,
|
|
24
|
-
id,
|
|
25
|
-
testid
|
|
26
|
-
} = _b, props = __objRest(_b, [
|
|
27
|
-
"className",
|
|
28
|
-
"label",
|
|
29
|
-
"error",
|
|
30
|
-
"disabled",
|
|
31
|
-
"checked",
|
|
32
|
-
"readOnly",
|
|
33
|
-
"id",
|
|
34
|
-
"testid"
|
|
35
|
-
]);
|
|
36
|
-
const radioId = id;
|
|
37
|
-
const paragraphColor = disabled ? "text-primary-disabled" : error ? "text-primary-error" : "text-primary-normal";
|
|
38
|
-
const defaultClassName = clsx(
|
|
39
|
-
!error && !disabled && "border-border-primary-normal peer-hover:border-border-action-hover peer-hover:bg-background-action-secondary-hover peer-focus:border-border-action-hover peer-focus:bg-background-action-secondary-hover peer-active:border-border-action-active peer-active:bg-background-action-secondary-active peer-checked:border-0 peer-checked:bg-background-action-secondary-hover"
|
|
40
|
-
);
|
|
41
|
-
const errorClassName = clsx(
|
|
42
|
-
error && !disabled && "border-border-action-critical-normal peer-hover:border-border-action-critical-hover peer-hover:bg-background-action-critical-secondary-hover peer-focus:border-border-action-critical-hover peer-focus:bg-background-action-critical-secondary-hover peer-active:border-border-action-critical-active peer-active:bg-background-action-secondary-active peer-checked:bg-background-action-critical-secondary-hover peer-checked:border-0 "
|
|
43
|
-
);
|
|
44
|
-
const disabledClassName = clsx(
|
|
45
|
-
disabled && "peer-disabled:bg-background-action-secondary-disabled peer-disabled:border-border-primary-normal peer-checked:border-0"
|
|
46
|
-
);
|
|
47
|
-
const readonlyClassName = clsx(
|
|
48
|
-
readOnly && "peer-read-only:bg-background-action-secondary-disabled peer-read-only:border-border-primary-normal peer-checked:border-0"
|
|
49
|
-
);
|
|
50
|
-
return /* @__PURE__ */ jsxs(
|
|
51
|
-
"label",
|
|
52
|
-
{
|
|
53
|
-
htmlFor: radioId,
|
|
54
|
-
className: clsx(
|
|
55
|
-
"flex items-center",
|
|
56
|
-
componentGap,
|
|
57
|
-
disabled ? "cursor-default" : "cursor-pointer",
|
|
58
|
-
className
|
|
59
|
-
),
|
|
60
|
-
children: [
|
|
61
|
-
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
62
|
-
/* @__PURE__ */ jsx(
|
|
63
|
-
"input",
|
|
64
|
-
__spreadValues({
|
|
65
|
-
id: radioId,
|
|
66
|
-
"data-testid": testid,
|
|
67
|
-
type: "radio",
|
|
68
|
-
className: "sr-only peer",
|
|
69
|
-
disabled,
|
|
70
|
-
checked,
|
|
71
|
-
readOnly
|
|
72
|
-
}, props)
|
|
73
|
-
),
|
|
74
|
-
/* @__PURE__ */ jsx(
|
|
75
|
-
"div",
|
|
76
|
-
{
|
|
77
|
-
className: clsx(
|
|
78
|
-
"size-6 rounded-full border flex items-center justify-center",
|
|
79
|
-
baseTransition,
|
|
80
|
-
defaultClassName,
|
|
81
|
-
errorClassName,
|
|
82
|
-
disabledClassName,
|
|
83
|
-
readonlyClassName
|
|
84
|
-
),
|
|
85
|
-
children: checked && /* @__PURE__ */ jsx(
|
|
86
|
-
RadioIcon,
|
|
87
|
-
{
|
|
88
|
-
className: clsx(
|
|
89
|
-
"transition-colors",
|
|
90
|
-
!error && !disabled && "text-icon-on-action-secondary-normal hover:text-icon-on-action-secondary-hover active:text-icon-on-action-secondary-active peer-hover:text-icon-on-action-secondary-hover peer-focus:text-icon-on-action-secondary-hover peer-active:text-icon-on-action-secondary-active",
|
|
91
|
-
error && !disabled && "text-icon-action-critical-secondary-normal hover:text-icon-action-critical-secondary-hover active:text-icon-action-critical-secondary-active peer-hover:text-icon-action-critical-secondary-hover peer-focus:text-icon-action-critical-secondary-hover peer-active:text-icon-action-critical-secondary-active",
|
|
92
|
-
disabled && "text-icon-on-action-secondary-disabled",
|
|
93
|
-
readOnly && "text-icon-on-action-secondary-disabled"
|
|
94
|
-
)
|
|
95
|
-
}
|
|
96
|
-
)
|
|
97
|
-
}
|
|
98
|
-
)
|
|
99
|
-
] }),
|
|
100
|
-
label && /* @__PURE__ */ jsx(Paragraph, { id: radioId ? `${radioId}-label` : void 0, testid: testid ? `${testid}-label` : void 0, padded: true, color: paragraphColor, children: label })
|
|
101
|
-
]
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
};
|
|
105
|
-
Radio.displayName = "Radio";
|
|
106
|
-
var RadioIcon = ({ className }) => {
|
|
107
|
-
return /* @__PURE__ */ jsxs(
|
|
108
|
-
"svg",
|
|
109
|
-
{
|
|
110
|
-
className,
|
|
111
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
112
|
-
width: "24",
|
|
113
|
-
height: "24",
|
|
114
|
-
viewBox: "0 0 24 24",
|
|
115
|
-
fill: "none",
|
|
116
|
-
children: [
|
|
117
|
-
/* @__PURE__ */ jsx(
|
|
118
|
-
"rect",
|
|
119
|
-
{
|
|
120
|
-
x: "1",
|
|
121
|
-
y: "1",
|
|
122
|
-
width: "22",
|
|
123
|
-
height: "22",
|
|
124
|
-
rx: "11",
|
|
125
|
-
stroke: "currentColor",
|
|
126
|
-
strokeWidth: "2"
|
|
127
|
-
}
|
|
128
|
-
),
|
|
129
|
-
/* @__PURE__ */ jsx("rect", { x: "4", y: "4", width: "16", height: "16", rx: "8", fill: "currentColor" })
|
|
130
|
-
]
|
|
131
|
-
}
|
|
132
|
-
);
|
|
133
|
-
};
|
|
134
|
-
RadioIcon.displayName = "RadioIcon";
|
|
135
|
-
|
|
136
|
-
export {
|
|
137
|
-
Radio
|
|
138
|
-
};
|
package/dist/chunk-EPQLWHCL.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// src/components/HorizontalDivider.tsx
|
|
2
|
-
import clsx from "clsx";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
function HorizontalDivider({ id, testid, hideOnMobile }) {
|
|
5
|
-
const hideOnMobileStyle = clsx(hideOnMobile && "hidden desktop:block");
|
|
6
|
-
return /* @__PURE__ */ jsx("hr", { id, "data-testid": testid, className: clsx("w-full border-t border-border-primary-normal", hideOnMobileStyle) });
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export {
|
|
10
|
-
HorizontalDivider
|
|
11
|
-
};
|
package/dist/chunk-NT2ZKA4W.js
DELETED
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
WorldpayIframe
|
|
3
|
-
} from "./chunk-WFGKIR5A.js";
|
|
4
|
-
import {
|
|
5
|
-
Radio
|
|
6
|
-
} from "./chunk-BATIOCXB.js";
|
|
7
|
-
import {
|
|
8
|
-
Spinner
|
|
9
|
-
} from "./chunk-PLMGI5K5.js";
|
|
10
|
-
import {
|
|
11
|
-
HorizontalDivider
|
|
12
|
-
} from "./chunk-EPQLWHCL.js";
|
|
13
|
-
import {
|
|
14
|
-
Checkbox
|
|
15
|
-
} from "./chunk-WFQEE2OO.js";
|
|
16
|
-
import {
|
|
17
|
-
formatCurrencyDisplay,
|
|
18
|
-
formatDecimalValue
|
|
19
|
-
} from "./chunk-5UH6QUFB.js";
|
|
20
|
-
import {
|
|
21
|
-
Subheader
|
|
22
|
-
} from "./chunk-CYZL57LH.js";
|
|
23
|
-
import {
|
|
24
|
-
Accordion
|
|
25
|
-
} from "./chunk-WSS2DFTP.js";
|
|
26
|
-
import {
|
|
27
|
-
Stack
|
|
28
|
-
} from "./chunk-N6JVLYEE.js";
|
|
29
|
-
import {
|
|
30
|
-
Card
|
|
31
|
-
} from "./chunk-4LXG6QNT.js";
|
|
32
|
-
import {
|
|
33
|
-
Button
|
|
34
|
-
} from "./chunk-FKMKHLQH.js";
|
|
35
|
-
|
|
36
|
-
// src/components/SelectPaymentMethod.tsx
|
|
37
|
-
import { useEffect, useState } from "react";
|
|
38
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
39
|
-
function SelectPaymentMethod(props) {
|
|
40
|
-
const {
|
|
41
|
-
amountToPay,
|
|
42
|
-
selectedMethod,
|
|
43
|
-
onSelectMethod,
|
|
44
|
-
selectedCredits,
|
|
45
|
-
allCredits,
|
|
46
|
-
allowedMethods,
|
|
47
|
-
selectedACHBankGuid,
|
|
48
|
-
setSelectedACHBankGuid,
|
|
49
|
-
customerBanks,
|
|
50
|
-
onPay,
|
|
51
|
-
isPayLoading,
|
|
52
|
-
withCredits = false,
|
|
53
|
-
isLoadingCCiframe,
|
|
54
|
-
cardPaymentUrl,
|
|
55
|
-
testid
|
|
56
|
-
} = props;
|
|
57
|
-
const payAllWithCredits = withCredits && amountToPay <= 0;
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
if (payAllWithCredits) {
|
|
60
|
-
onSelectMethod("CreditsOnly");
|
|
61
|
-
} else {
|
|
62
|
-
onSelectMethod(null);
|
|
63
|
-
}
|
|
64
|
-
}, [onSelectMethod, payAllWithCredits]);
|
|
65
|
-
function handleToggle(method) {
|
|
66
|
-
onSelectMethod(method);
|
|
67
|
-
}
|
|
68
|
-
return /* @__PURE__ */ jsxs(Stack, { sizing: "layout-group", width: "full", minWidth: 400, children: [
|
|
69
|
-
!!(allCredits == null ? void 0 : allCredits.length) && withCredits && /* @__PURE__ */ jsx(
|
|
70
|
-
CreditsSelector,
|
|
71
|
-
{
|
|
72
|
-
testid: testid ? `${testid}-credit-selector` : void 0,
|
|
73
|
-
selectedCredits: selectedCredits || [],
|
|
74
|
-
allCredits: allCredits || [],
|
|
75
|
-
setSelectedCredits: props.setSelectedCredits || (() => {
|
|
76
|
-
})
|
|
77
|
-
}
|
|
78
|
-
),
|
|
79
|
-
(allowedMethods == null ? void 0 : allowedMethods.includes("ACHPayment")) && !!(customerBanks == null ? void 0 : customerBanks.length) && /* @__PURE__ */ jsx(
|
|
80
|
-
ACHSelector,
|
|
81
|
-
{
|
|
82
|
-
testid: testid ? `${testid}-ach-selector` : void 0,
|
|
83
|
-
selectedMethod,
|
|
84
|
-
handleToggle,
|
|
85
|
-
selectedBankGuid: selectedACHBankGuid || null,
|
|
86
|
-
setSelectedBankGuid: setSelectedACHBankGuid || (() => {
|
|
87
|
-
}),
|
|
88
|
-
customerBanks: customerBanks || [],
|
|
89
|
-
onPay,
|
|
90
|
-
isPayLoading: isPayLoading || false,
|
|
91
|
-
disabled: payAllWithCredits || !amountToPay
|
|
92
|
-
}
|
|
93
|
-
),
|
|
94
|
-
(allowedMethods == null ? void 0 : allowedMethods.includes("CCPayment")) && /* @__PURE__ */ jsx(
|
|
95
|
-
Accordion,
|
|
96
|
-
{
|
|
97
|
-
testid: testid ? `${testid}-cc-payment` : void 0,
|
|
98
|
-
isOpen: !payAllWithCredits && selectedMethod === "CCPayment",
|
|
99
|
-
title: /* @__PURE__ */ jsx(
|
|
100
|
-
Radio,
|
|
101
|
-
{
|
|
102
|
-
testid: testid ? `${testid}-cc-payment-radio` : void 0,
|
|
103
|
-
label: "Pay by Credit/Debit Card",
|
|
104
|
-
checked: !payAllWithCredits && selectedMethod === "CCPayment",
|
|
105
|
-
onChange: (e) => e.stopPropagation(),
|
|
106
|
-
disabled: payAllWithCredits || !amountToPay
|
|
107
|
-
}
|
|
108
|
-
),
|
|
109
|
-
onClick: () => {
|
|
110
|
-
if (payAllWithCredits || !amountToPay) return;
|
|
111
|
-
handleToggle(selectedMethod === "CCPayment" ? null : "CCPayment");
|
|
112
|
-
},
|
|
113
|
-
disabled: payAllWithCredits || !amountToPay,
|
|
114
|
-
children: /* @__PURE__ */ jsx(
|
|
115
|
-
Stack,
|
|
116
|
-
{
|
|
117
|
-
sizing: "layout-group",
|
|
118
|
-
width: "full",
|
|
119
|
-
items: "center",
|
|
120
|
-
justify: "center",
|
|
121
|
-
style: {
|
|
122
|
-
flex: 1
|
|
123
|
-
},
|
|
124
|
-
minHeight: 245,
|
|
125
|
-
children: !isLoadingCCiframe && cardPaymentUrl ? /* @__PURE__ */ jsx(WorldpayIframe, { url: cardPaymentUrl }) : /* @__PURE__ */ jsx(Spinner, {})
|
|
126
|
-
}
|
|
127
|
-
)
|
|
128
|
-
}
|
|
129
|
-
),
|
|
130
|
-
selectedMethod === "ACHPayment" && /* @__PURE__ */ jsx(
|
|
131
|
-
Button,
|
|
132
|
-
{
|
|
133
|
-
block: true,
|
|
134
|
-
onClick: onPay,
|
|
135
|
-
disabled: isPayLoading || amountToPay <= 0,
|
|
136
|
-
testid: testid ? `${testid}-submit-payment-button` : void 0,
|
|
137
|
-
children: isPayLoading ? "Processing..." : "Submit Payment"
|
|
138
|
-
}
|
|
139
|
-
),
|
|
140
|
-
payAllWithCredits && /* @__PURE__ */ jsx(
|
|
141
|
-
Button,
|
|
142
|
-
{
|
|
143
|
-
testid: testid ? `${testid}-submit-payment-button` : void 0,
|
|
144
|
-
block: true,
|
|
145
|
-
onClick: onPay,
|
|
146
|
-
disabled: isPayLoading,
|
|
147
|
-
children: isPayLoading ? "Processing..." : "Submit Payment"
|
|
148
|
-
}
|
|
149
|
-
)
|
|
150
|
-
] });
|
|
151
|
-
}
|
|
152
|
-
function ACHSelector(props) {
|
|
153
|
-
const {
|
|
154
|
-
selectedMethod,
|
|
155
|
-
handleToggle,
|
|
156
|
-
selectedBankGuid,
|
|
157
|
-
setSelectedBankGuid,
|
|
158
|
-
customerBanks,
|
|
159
|
-
disabled,
|
|
160
|
-
testid
|
|
161
|
-
} = props;
|
|
162
|
-
function handleBankSelect(e, bankGuid) {
|
|
163
|
-
if (disabled) return;
|
|
164
|
-
e.stopPropagation();
|
|
165
|
-
setSelectedBankGuid(bankGuid);
|
|
166
|
-
handleToggle("ACHPayment");
|
|
167
|
-
}
|
|
168
|
-
return /* @__PURE__ */ jsx(Fragment, { children: customerBanks.map((bank) => /* @__PURE__ */ jsx(
|
|
169
|
-
Card,
|
|
170
|
-
{
|
|
171
|
-
testid: testid ? `${testid}-bank-${bank.CustBankGUID}` : void 0,
|
|
172
|
-
onClick: (e) => handleBankSelect(e, bank.CustBankGUID),
|
|
173
|
-
selected: !disabled && selectedMethod === "ACHPayment" && selectedBankGuid === bank.CustBankGUID,
|
|
174
|
-
children: /* @__PURE__ */ jsx(
|
|
175
|
-
Radio,
|
|
176
|
-
{
|
|
177
|
-
label: `Pay by ${bank.AccountDisplayString}`,
|
|
178
|
-
checked: !disabled && selectedMethod === "ACHPayment" && selectedBankGuid === bank.CustBankGUID,
|
|
179
|
-
disabled,
|
|
180
|
-
onChange: (e) => e.stopPropagation()
|
|
181
|
-
}
|
|
182
|
-
)
|
|
183
|
-
},
|
|
184
|
-
bank.CustBankGUID
|
|
185
|
-
)) });
|
|
186
|
-
}
|
|
187
|
-
function CreditsSelector(props) {
|
|
188
|
-
const { selectedCredits, allCredits, setSelectedCredits, testid } = props;
|
|
189
|
-
const [isOpen, setIsOpen] = useState(true);
|
|
190
|
-
const handleCreditSelect = (credit) => {
|
|
191
|
-
if (setSelectedCredits) {
|
|
192
|
-
setSelectedCredits(
|
|
193
|
-
(prev) => prev.includes(credit) ? prev.filter((c) => c !== credit) : [...prev, credit]
|
|
194
|
-
);
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
return /* @__PURE__ */ jsxs(
|
|
198
|
-
Accordion,
|
|
199
|
-
{
|
|
200
|
-
isOpen,
|
|
201
|
-
title: "Available Credits",
|
|
202
|
-
onClick: () => setIsOpen((prev) => !prev),
|
|
203
|
-
testid,
|
|
204
|
-
children: [
|
|
205
|
-
/* @__PURE__ */ jsx(HorizontalDivider, {}),
|
|
206
|
-
/* @__PURE__ */ jsx(Stack, { sizing: "layout-group", width: "full", children: /* @__PURE__ */ jsx(
|
|
207
|
-
Stack,
|
|
208
|
-
{
|
|
209
|
-
sizing: "layout-group",
|
|
210
|
-
width: "full",
|
|
211
|
-
overflowY: "auto",
|
|
212
|
-
maxHeight: 300,
|
|
213
|
-
children: allCredits.map((credits) => /* @__PURE__ */ jsxs(
|
|
214
|
-
Stack,
|
|
215
|
-
{
|
|
216
|
-
horizontal: true,
|
|
217
|
-
justify: "between",
|
|
218
|
-
items: "center",
|
|
219
|
-
sizing: "layout-group",
|
|
220
|
-
children: [
|
|
221
|
-
/* @__PURE__ */ jsx(
|
|
222
|
-
Stack,
|
|
223
|
-
{
|
|
224
|
-
sizing: "layout-group",
|
|
225
|
-
onClick: () => handleCreditSelect(credits),
|
|
226
|
-
paddingY: true,
|
|
227
|
-
flexGrow: 1,
|
|
228
|
-
testid: testid ? `${testid}-credit-${credits.InvoiceNumber}` : void 0,
|
|
229
|
-
children: /* @__PURE__ */ jsx(
|
|
230
|
-
Checkbox,
|
|
231
|
-
{
|
|
232
|
-
testid: testid ? `${testid}-credit-${credits.InvoiceNumber}-checkbox` : void 0,
|
|
233
|
-
label: credits.InvoiceNumber,
|
|
234
|
-
checked: selectedCredits == null ? void 0 : selectedCredits.includes(credits),
|
|
235
|
-
onChange: () => handleCreditSelect(credits)
|
|
236
|
-
}
|
|
237
|
-
)
|
|
238
|
-
}
|
|
239
|
-
),
|
|
240
|
-
/* @__PURE__ */ jsxs(
|
|
241
|
-
Subheader,
|
|
242
|
-
{
|
|
243
|
-
testid: testid ? `${testid}-credit-${credits.InvoiceNumber}-InvoiceBalanceDue` : void 0,
|
|
244
|
-
className: " pr-desktop-component-padding",
|
|
245
|
-
children: [
|
|
246
|
-
"$",
|
|
247
|
-
formatCurrencyDisplay(
|
|
248
|
-
formatDecimalValue(Math.abs(credits.InvoiceBalanceDue), 2)
|
|
249
|
-
)
|
|
250
|
-
]
|
|
251
|
-
}
|
|
252
|
-
)
|
|
253
|
-
]
|
|
254
|
-
},
|
|
255
|
-
credits.AROpenGUID
|
|
256
|
-
))
|
|
257
|
-
}
|
|
258
|
-
) })
|
|
259
|
-
]
|
|
260
|
-
}
|
|
261
|
-
);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
export {
|
|
265
|
-
SelectPaymentMethod
|
|
266
|
-
};
|
package/dist/chunk-WFGKIR5A.js
DELETED