@dmsi/wedgekit-react 0.0.152 → 0.0.154
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-ODWBREZN.js → chunk-2KBVPH75.js} +28 -11
- package/dist/{chunk-AMM762XG.js → chunk-2VT3YJ47.js} +3 -3
- package/dist/{chunk-KHQX42T7.js → chunk-IDN3IN2A.js} +7 -0
- package/dist/{chunk-PMBEIP24.js → chunk-IDSFWKOR.js} +1 -1
- package/dist/{chunk-56Y5DDG3.js → chunk-KADNOKNW.js} +6 -2
- package/dist/{chunk-4NCDT5ZY.js → chunk-WJ447JB5.js} +5 -5
- package/dist/components/DataGridCell.js +8 -8
- package/dist/components/DateInput.js +9 -9
- package/dist/components/DateRangeInput.js +10 -10
- package/dist/components/FilterGroup.js +7 -7
- package/dist/components/Input.js +2 -2
- package/dist/components/Menu.js +2 -2
- package/dist/components/MenuOption.js +2 -2
- package/dist/components/MobileDataGrid.js +3 -3
- package/dist/components/Modal.js +2 -2
- package/dist/components/NestedMenu.js +2 -2
- package/dist/components/Notification.js +3 -3
- package/dist/components/PDFViewer.js +5 -5
- package/dist/components/Password.js +2 -2
- package/dist/components/PaymentOnAccountModal.cjs +23 -7
- package/dist/components/PaymentOnAccountModal.js +7 -7
- package/dist/components/Search.js +3 -3
- package/dist/components/Select.cjs +5 -1
- package/dist/components/Select.js +3 -3
- package/dist/components/SelectPaymentMethod.cjs +36 -7
- package/dist/components/SelectPaymentMethod.js +2 -2
- package/dist/components/Stepper.js +2 -2
- package/dist/components/Time.js +2 -2
- package/dist/components/Toast.js +3 -3
- package/dist/components/Upload.js +3 -3
- package/dist/components/index.cjs +28 -8
- package/dist/components/index.js +22 -22
- package/dist/utils/index.cjs +211 -0
- package/dist/utils/index.js +39 -0
- package/package.json +6 -1
- package/src/components/Select.tsx +1 -0
- package/src/components/SelectPaymentMethod.tsx +29 -9
- package/src/utils/index.ts +2 -0
- package/dist/{chunk-FFU6FB3K.js → chunk-AEDEFN7A.js} +3 -3
- package/dist/{chunk-YR7JUKYO.js → chunk-LPARJM6S.js} +3 -3
- package/dist/{chunk-4T3DRGLF.js → chunk-MVGOAMTP.js} +3 -3
- package/dist/{chunk-5GOJRLQO.js → chunk-NRCUFAOZ.js} +3 -3
|
@@ -14,7 +14,11 @@ import {
|
|
|
14
14
|
Checkbox
|
|
15
15
|
} from "./chunk-WFQEE2OO.js";
|
|
16
16
|
import {
|
|
17
|
-
|
|
17
|
+
Button
|
|
18
|
+
} from "./chunk-FKMKHLQH.js";
|
|
19
|
+
import {
|
|
20
|
+
formatCurrencyDisplay,
|
|
21
|
+
formatDecimalValue
|
|
18
22
|
} from "./chunk-5UH6QUFB.js";
|
|
19
23
|
import {
|
|
20
24
|
Subheader
|
|
@@ -28,9 +32,6 @@ import {
|
|
|
28
32
|
import {
|
|
29
33
|
Card
|
|
30
34
|
} from "./chunk-4LXG6QNT.js";
|
|
31
|
-
import {
|
|
32
|
-
Button
|
|
33
|
-
} from "./chunk-FKMKHLQH.js";
|
|
34
35
|
|
|
35
36
|
// src/components/SelectPaymentMethod.tsx
|
|
36
37
|
import { useEffect, useState } from "react";
|
|
@@ -136,7 +137,16 @@ function SelectPaymentMethod(props) {
|
|
|
136
137
|
children: isPayLoading ? "Processing..." : "Submit Payment"
|
|
137
138
|
}
|
|
138
139
|
),
|
|
139
|
-
payAllWithCredits && /* @__PURE__ */ jsx(
|
|
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
|
+
)
|
|
140
150
|
] });
|
|
141
151
|
}
|
|
142
152
|
function ACHSelector(props) {
|
|
@@ -227,12 +237,19 @@ function CreditsSelector(props) {
|
|
|
227
237
|
)
|
|
228
238
|
}
|
|
229
239
|
),
|
|
230
|
-
/* @__PURE__ */ jsxs(
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
`${
|
|
234
|
-
|
|
235
|
-
|
|
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
|
+
)
|
|
236
253
|
]
|
|
237
254
|
},
|
|
238
255
|
credits.AROpenGUID
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SelectPaymentMethod
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2KBVPH75.js";
|
|
4
4
|
import {
|
|
5
5
|
Modal
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NRCUFAOZ.js";
|
|
7
7
|
import {
|
|
8
8
|
Input
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MVGOAMTP.js";
|
|
10
10
|
import {
|
|
11
11
|
formatCurrencyDisplay
|
|
12
12
|
} from "./chunk-5UH6QUFB.js";
|
|
@@ -121,7 +121,14 @@ export {
|
|
|
121
121
|
parseInputDate,
|
|
122
122
|
isValidDate,
|
|
123
123
|
formatInputValue,
|
|
124
|
+
isDigit,
|
|
125
|
+
isSlash,
|
|
126
|
+
countDigitsUpToCursor,
|
|
127
|
+
findPositionAfterDigitCount,
|
|
124
128
|
calculateCursorPosition,
|
|
129
|
+
parseDateParts,
|
|
130
|
+
isValidDateRange,
|
|
131
|
+
formatDatePartsToDisplay,
|
|
125
132
|
formatDate,
|
|
126
133
|
isValidDateRangeOrder
|
|
127
134
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
InputBase
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MVGOAMTP.js";
|
|
4
4
|
import {
|
|
5
5
|
Icon
|
|
6
6
|
} from "./chunk-NKUETCDA.js";
|
|
@@ -95,7 +95,11 @@ var Select = (_a) => {
|
|
|
95
95
|
error,
|
|
96
96
|
readOnly,
|
|
97
97
|
removeRoundness,
|
|
98
|
-
focus: show
|
|
98
|
+
focus: show,
|
|
99
|
+
onChange: (e) => {
|
|
100
|
+
var _a2;
|
|
101
|
+
return (_a2 = props.onChange) == null ? void 0 : _a2.call(props, e);
|
|
102
|
+
}
|
|
99
103
|
}, props), {
|
|
100
104
|
value: displayValue != null ? displayValue : value
|
|
101
105
|
})
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Menu
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LPARJM6S.js";
|
|
4
4
|
import {
|
|
5
5
|
useSubMenuSystem
|
|
6
6
|
} from "./chunk-5GUW4DUY.js";
|
|
7
7
|
import {
|
|
8
8
|
MenuOption
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import {
|
|
11
|
-
Search
|
|
12
|
-
} from "./chunk-PMBEIP24.js";
|
|
9
|
+
} from "./chunk-AEDEFN7A.js";
|
|
13
10
|
import {
|
|
14
11
|
CSS
|
|
15
12
|
} from "./chunk-WVUIIBRR.js";
|
|
13
|
+
import {
|
|
14
|
+
Search
|
|
15
|
+
} from "./chunk-IDSFWKOR.js";
|
|
16
16
|
import {
|
|
17
17
|
Icon
|
|
18
18
|
} from "./chunk-NKUETCDA.js";
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
DataGridCell,
|
|
5
5
|
DragAlongCell,
|
|
6
6
|
DraggableCellHeader
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-WJ447JB5.js";
|
|
8
|
+
import "../chunk-LPARJM6S.js";
|
|
9
9
|
import "../chunk-5GUW4DUY.js";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-AEDEFN7A.js";
|
|
11
|
+
import "../chunk-WVUIIBRR.js";
|
|
12
12
|
import "../chunk-4T7F5BZZ.js";
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-5UH6QUFB.js";
|
|
13
|
+
import "../chunk-IDSFWKOR.js";
|
|
14
|
+
import "../chunk-MVGOAMTP.js";
|
|
16
15
|
import "../chunk-JWCT72WR.js";
|
|
17
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-WNQ53SVY.js";
|
|
17
|
+
import "../chunk-5UH6QUFB.js";
|
|
18
18
|
import "../chunk-HVI3CL7Y.js";
|
|
19
19
|
import "../chunk-NKUETCDA.js";
|
|
20
20
|
import "../chunk-RDLEIAQU.js";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
calculateCursorPosition,
|
|
3
|
-
formatDate,
|
|
4
|
-
formatInputValue,
|
|
5
|
-
isValidDate,
|
|
6
|
-
parseInputDate
|
|
7
|
-
} from "../chunk-KHQX42T7.js";
|
|
8
1
|
import {
|
|
9
2
|
findDocumentRoot
|
|
10
3
|
} from "../chunk-4T7F5BZZ.js";
|
|
11
4
|
import {
|
|
12
5
|
InputBase
|
|
13
|
-
} from "../chunk-
|
|
14
|
-
import "../chunk-5UH6QUFB.js";
|
|
6
|
+
} from "../chunk-MVGOAMTP.js";
|
|
15
7
|
import "../chunk-JWCT72WR.js";
|
|
16
8
|
import {
|
|
17
9
|
CalendarRange
|
|
18
10
|
} from "../chunk-NMVSRA5Y.js";
|
|
11
|
+
import {
|
|
12
|
+
calculateCursorPosition,
|
|
13
|
+
formatDate,
|
|
14
|
+
formatInputValue,
|
|
15
|
+
isValidDate,
|
|
16
|
+
parseInputDate
|
|
17
|
+
} from "../chunk-IDN3IN2A.js";
|
|
18
|
+
import "../chunk-5UH6QUFB.js";
|
|
19
19
|
import {
|
|
20
20
|
Icon
|
|
21
21
|
} from "../chunk-NKUETCDA.js";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
calculateCursorPosition,
|
|
3
|
-
formatDate,
|
|
4
|
-
formatInputValue,
|
|
5
|
-
isValidDate,
|
|
6
|
-
isValidDateRangeOrder,
|
|
7
|
-
parseInputDate
|
|
8
|
-
} from "../chunk-KHQX42T7.js";
|
|
9
1
|
import {
|
|
10
2
|
findDocumentRoot
|
|
11
3
|
} from "../chunk-4T7F5BZZ.js";
|
|
12
4
|
import {
|
|
13
5
|
InputBase
|
|
14
|
-
} from "../chunk-
|
|
15
|
-
import "../chunk-5UH6QUFB.js";
|
|
6
|
+
} from "../chunk-MVGOAMTP.js";
|
|
16
7
|
import "../chunk-JWCT72WR.js";
|
|
17
8
|
import {
|
|
18
9
|
CalendarRange
|
|
19
10
|
} from "../chunk-NMVSRA5Y.js";
|
|
11
|
+
import {
|
|
12
|
+
calculateCursorPosition,
|
|
13
|
+
formatDate,
|
|
14
|
+
formatInputValue,
|
|
15
|
+
isValidDate,
|
|
16
|
+
isValidDateRangeOrder,
|
|
17
|
+
parseInputDate
|
|
18
|
+
} from "../chunk-IDN3IN2A.js";
|
|
19
|
+
import "../chunk-5UH6QUFB.js";
|
|
20
20
|
import {
|
|
21
21
|
Icon
|
|
22
22
|
} from "../chunk-NKUETCDA.js";
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
import {
|
|
3
3
|
OptionPill
|
|
4
4
|
} from "../chunk-LM5MKBPM.js";
|
|
5
|
-
import {
|
|
6
|
-
Checkbox
|
|
7
|
-
} from "../chunk-WFQEE2OO.js";
|
|
8
5
|
import {
|
|
9
6
|
Search
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-5UH6QUFB.js";
|
|
7
|
+
} from "../chunk-IDSFWKOR.js";
|
|
8
|
+
import "../chunk-MVGOAMTP.js";
|
|
13
9
|
import {
|
|
14
10
|
Label
|
|
15
11
|
} from "../chunk-JWCT72WR.js";
|
|
12
|
+
import {
|
|
13
|
+
Checkbox
|
|
14
|
+
} from "../chunk-WFQEE2OO.js";
|
|
15
|
+
import "../chunk-FKMKHLQH.js";
|
|
16
|
+
import "../chunk-5UH6QUFB.js";
|
|
16
17
|
import "../chunk-HVI3CL7Y.js";
|
|
17
18
|
import {
|
|
18
19
|
Link
|
|
19
20
|
} from "../chunk-I6GEUF6Y.js";
|
|
20
|
-
import "../chunk-FKMKHLQH.js";
|
|
21
21
|
import {
|
|
22
22
|
Icon
|
|
23
23
|
} from "../chunk-NKUETCDA.js";
|
package/dist/components/Input.js
CHANGED
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
InputBase,
|
|
7
7
|
Percentage,
|
|
8
8
|
UOM
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-5UH6QUFB.js";
|
|
9
|
+
} from "../chunk-MVGOAMTP.js";
|
|
11
10
|
import "../chunk-JWCT72WR.js";
|
|
11
|
+
import "../chunk-5UH6QUFB.js";
|
|
12
12
|
import "../chunk-NKUETCDA.js";
|
|
13
13
|
import "../chunk-RDLEIAQU.js";
|
|
14
14
|
import "../chunk-ORMEWXMH.js";
|
package/dist/components/Menu.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Menu
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-LPARJM6S.js";
|
|
5
5
|
import "../chunk-5GUW4DUY.js";
|
|
6
|
-
import "../chunk-WNQ53SVY.js";
|
|
7
6
|
import "../chunk-4T7F5BZZ.js";
|
|
7
|
+
import "../chunk-WNQ53SVY.js";
|
|
8
8
|
import "../chunk-ORMEWXMH.js";
|
|
9
9
|
export {
|
|
10
10
|
Menu
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
MenuOption
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-WNQ53SVY.js";
|
|
4
|
+
} from "../chunk-AEDEFN7A.js";
|
|
6
5
|
import "../chunk-JWCT72WR.js";
|
|
6
|
+
import "../chunk-WNQ53SVY.js";
|
|
7
7
|
import "../chunk-HVI3CL7Y.js";
|
|
8
8
|
import "../chunk-NKUETCDA.js";
|
|
9
9
|
import "../chunk-RDLEIAQU.js";
|
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
Heading3
|
|
6
6
|
} from "../chunk-AZ7LVLOK.js";
|
|
7
|
+
import {
|
|
8
|
+
Button
|
|
9
|
+
} from "../chunk-FKMKHLQH.js";
|
|
7
10
|
import {
|
|
8
11
|
Stack
|
|
9
12
|
} from "../chunk-N6JVLYEE.js";
|
|
10
13
|
import {
|
|
11
14
|
Paragraph
|
|
12
15
|
} from "../chunk-HVI3CL7Y.js";
|
|
13
|
-
import {
|
|
14
|
-
Button
|
|
15
|
-
} from "../chunk-FKMKHLQH.js";
|
|
16
16
|
import {
|
|
17
17
|
Icon
|
|
18
18
|
} from "../chunk-NKUETCDA.js";
|
package/dist/components/Modal.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Modal
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-NRCUFAOZ.js";
|
|
5
5
|
import "../chunk-4RJKB7LC.js";
|
|
6
6
|
import "../chunk-C4JGTH6G.js";
|
|
7
7
|
import "../chunk-SYEJVSE4.js";
|
|
8
8
|
import "../chunk-R7ELP5C5.js";
|
|
9
9
|
import "../chunk-ZFOANBWG.js";
|
|
10
10
|
import "../chunk-AZ7LVLOK.js";
|
|
11
|
-
import "../chunk-WNQ53SVY.js";
|
|
12
11
|
import "../chunk-4T7F5BZZ.js";
|
|
13
12
|
import "../chunk-FKMKHLQH.js";
|
|
13
|
+
import "../chunk-WNQ53SVY.js";
|
|
14
14
|
import "../chunk-NKUETCDA.js";
|
|
15
15
|
import "../chunk-RDLEIAQU.js";
|
|
16
16
|
import "../chunk-ORMEWXMH.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
MenuOption
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-AEDEFN7A.js";
|
|
5
|
+
import "../chunk-JWCT72WR.js";
|
|
5
6
|
import {
|
|
6
7
|
useKeydown
|
|
7
8
|
} from "../chunk-WNQ53SVY.js";
|
|
8
|
-
import "../chunk-JWCT72WR.js";
|
|
9
9
|
import "../chunk-HVI3CL7Y.js";
|
|
10
10
|
import {
|
|
11
11
|
Icon
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Heading3
|
|
4
4
|
} from "../chunk-AZ7LVLOK.js";
|
|
5
|
+
import {
|
|
6
|
+
Button
|
|
7
|
+
} from "../chunk-FKMKHLQH.js";
|
|
5
8
|
import {
|
|
6
9
|
Stack
|
|
7
10
|
} from "../chunk-N6JVLYEE.js";
|
|
8
11
|
import {
|
|
9
12
|
Paragraph
|
|
10
13
|
} from "../chunk-HVI3CL7Y.js";
|
|
11
|
-
import {
|
|
12
|
-
Button
|
|
13
|
-
} from "../chunk-FKMKHLQH.js";
|
|
14
14
|
import {
|
|
15
15
|
Icon
|
|
16
16
|
} from "../chunk-NKUETCDA.js";
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Modal
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-NRCUFAOZ.js";
|
|
5
5
|
import "../chunk-4RJKB7LC.js";
|
|
6
6
|
import "../chunk-C4JGTH6G.js";
|
|
7
7
|
import "../chunk-SYEJVSE4.js";
|
|
8
8
|
import "../chunk-R7ELP5C5.js";
|
|
9
9
|
import "../chunk-ZFOANBWG.js";
|
|
10
10
|
import "../chunk-AZ7LVLOK.js";
|
|
11
|
+
import "../chunk-4T7F5BZZ.js";
|
|
11
12
|
import {
|
|
12
13
|
Caption
|
|
13
14
|
} from "../chunk-E7D24OHM.js";
|
|
15
|
+
import {
|
|
16
|
+
Button
|
|
17
|
+
} from "../chunk-FKMKHLQH.js";
|
|
14
18
|
import "../chunk-WNQ53SVY.js";
|
|
15
|
-
import "../chunk-4T7F5BZZ.js";
|
|
16
19
|
import {
|
|
17
20
|
Stack
|
|
18
21
|
} from "../chunk-N6JVLYEE.js";
|
|
19
|
-
import {
|
|
20
|
-
Button
|
|
21
|
-
} from "../chunk-FKMKHLQH.js";
|
|
22
22
|
import {
|
|
23
23
|
Icon
|
|
24
24
|
} from "../chunk-NKUETCDA.js";
|
|
@@ -2170,7 +2170,16 @@ function SelectPaymentMethod(props) {
|
|
|
2170
2170
|
children: isPayLoading ? "Processing..." : "Submit Payment"
|
|
2171
2171
|
}
|
|
2172
2172
|
),
|
|
2173
|
-
payAllWithCredits && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2173
|
+
payAllWithCredits && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2174
|
+
Button,
|
|
2175
|
+
{
|
|
2176
|
+
testid: testid ? `${testid}-submit-payment-button` : void 0,
|
|
2177
|
+
block: true,
|
|
2178
|
+
onClick: onPay,
|
|
2179
|
+
disabled: isPayLoading,
|
|
2180
|
+
children: isPayLoading ? "Processing..." : "Submit Payment"
|
|
2181
|
+
}
|
|
2182
|
+
)
|
|
2174
2183
|
] });
|
|
2175
2184
|
}
|
|
2176
2185
|
function ACHSelector(props) {
|
|
@@ -2261,12 +2270,19 @@ function CreditsSelector(props) {
|
|
|
2261
2270
|
)
|
|
2262
2271
|
}
|
|
2263
2272
|
),
|
|
2264
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
`${
|
|
2268
|
-
|
|
2269
|
-
|
|
2273
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2274
|
+
Subheader,
|
|
2275
|
+
{
|
|
2276
|
+
testid: testid ? `${testid}-credit-${credits.InvoiceNumber}-InvoiceBalanceDue` : void 0,
|
|
2277
|
+
className: " pr-desktop-component-padding",
|
|
2278
|
+
children: [
|
|
2279
|
+
"$",
|
|
2280
|
+
formatCurrencyDisplay(
|
|
2281
|
+
formatDecimalValue(Math.abs(credits.InvoiceBalanceDue), 2)
|
|
2282
|
+
)
|
|
2283
|
+
]
|
|
2284
|
+
}
|
|
2285
|
+
)
|
|
2270
2286
|
]
|
|
2271
2287
|
},
|
|
2272
2288
|
credits.AROpenGUID
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PaymentOnAccountModal,
|
|
3
3
|
calculateSurcharge
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-2VT3YJ47.js";
|
|
5
|
+
import "../chunk-2KBVPH75.js";
|
|
6
6
|
import "../chunk-WFGKIR5A.js";
|
|
7
7
|
import "../chunk-BATIOCXB.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-NRCUFAOZ.js";
|
|
9
9
|
import "../chunk-4RJKB7LC.js";
|
|
10
10
|
import "../chunk-C4JGTH6G.js";
|
|
11
11
|
import "../chunk-SYEJVSE4.js";
|
|
@@ -14,18 +14,18 @@ import "../chunk-ZFOANBWG.js";
|
|
|
14
14
|
import "../chunk-GG5JOFS6.js";
|
|
15
15
|
import "../chunk-AZ7LVLOK.js";
|
|
16
16
|
import "../chunk-EPQLWHCL.js";
|
|
17
|
+
import "../chunk-4T7F5BZZ.js";
|
|
18
|
+
import "../chunk-MVGOAMTP.js";
|
|
19
|
+
import "../chunk-JWCT72WR.js";
|
|
17
20
|
import "../chunk-WFQEE2OO.js";
|
|
21
|
+
import "../chunk-FKMKHLQH.js";
|
|
18
22
|
import "../chunk-WNQ53SVY.js";
|
|
19
|
-
import "../chunk-4T7F5BZZ.js";
|
|
20
|
-
import "../chunk-4T3DRGLF.js";
|
|
21
23
|
import "../chunk-5UH6QUFB.js";
|
|
22
|
-
import "../chunk-JWCT72WR.js";
|
|
23
24
|
import "../chunk-CYZL57LH.js";
|
|
24
25
|
import "../chunk-WSS2DFTP.js";
|
|
25
26
|
import "../chunk-N6JVLYEE.js";
|
|
26
27
|
import "../chunk-4LXG6QNT.js";
|
|
27
28
|
import "../chunk-HVI3CL7Y.js";
|
|
28
|
-
import "../chunk-FKMKHLQH.js";
|
|
29
29
|
import "../chunk-NKUETCDA.js";
|
|
30
30
|
import "../chunk-RDLEIAQU.js";
|
|
31
31
|
import "../chunk-ORMEWXMH.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Search
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-5UH6QUFB.js";
|
|
4
|
+
} from "../chunk-IDSFWKOR.js";
|
|
5
|
+
import "../chunk-MVGOAMTP.js";
|
|
7
6
|
import "../chunk-JWCT72WR.js";
|
|
7
|
+
import "../chunk-5UH6QUFB.js";
|
|
8
8
|
import "../chunk-NKUETCDA.js";
|
|
9
9
|
import "../chunk-RDLEIAQU.js";
|
|
10
10
|
import "../chunk-ORMEWXMH.js";
|
|
@@ -777,7 +777,11 @@ var Select = (_a) => {
|
|
|
777
777
|
error,
|
|
778
778
|
readOnly,
|
|
779
779
|
removeRoundness,
|
|
780
|
-
focus: show
|
|
780
|
+
focus: show,
|
|
781
|
+
onChange: (e) => {
|
|
782
|
+
var _a2;
|
|
783
|
+
return (_a2 = props.onChange) == null ? void 0 : _a2.call(props, e);
|
|
784
|
+
}
|
|
781
785
|
}, props), {
|
|
782
786
|
value: displayValue != null ? displayValue : value
|
|
783
787
|
})
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Select
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-5UH6QUFB.js";
|
|
4
|
+
} from "../chunk-KADNOKNW.js";
|
|
5
|
+
import "../chunk-MVGOAMTP.js";
|
|
7
6
|
import "../chunk-JWCT72WR.js";
|
|
7
|
+
import "../chunk-5UH6QUFB.js";
|
|
8
8
|
import "../chunk-NKUETCDA.js";
|
|
9
9
|
import "../chunk-RDLEIAQU.js";
|
|
10
10
|
import "../chunk-ORMEWXMH.js";
|
|
@@ -975,6 +975,19 @@ var Subheader = (_a) => {
|
|
|
975
975
|
Subheader.displayName = "Subheader";
|
|
976
976
|
|
|
977
977
|
// src/utils/formatting.tsx
|
|
978
|
+
function formatDecimalValue(value, decimals) {
|
|
979
|
+
if (!value || value === "") {
|
|
980
|
+
return "";
|
|
981
|
+
}
|
|
982
|
+
const numValue = typeof value === "string" ? parseFloat(value) : value;
|
|
983
|
+
if (isNaN(numValue)) {
|
|
984
|
+
return "";
|
|
985
|
+
}
|
|
986
|
+
if (!decimals || decimals <= 0) {
|
|
987
|
+
return String(Math.round(numValue));
|
|
988
|
+
}
|
|
989
|
+
return numValue.toFixed(decimals);
|
|
990
|
+
}
|
|
978
991
|
function formatCurrencyDisplay(value) {
|
|
979
992
|
if (!value || value === "") {
|
|
980
993
|
return "";
|
|
@@ -1213,7 +1226,16 @@ function SelectPaymentMethod(props) {
|
|
|
1213
1226
|
children: isPayLoading ? "Processing..." : "Submit Payment"
|
|
1214
1227
|
}
|
|
1215
1228
|
),
|
|
1216
|
-
payAllWithCredits && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1229
|
+
payAllWithCredits && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1230
|
+
Button,
|
|
1231
|
+
{
|
|
1232
|
+
testid: testid ? `${testid}-submit-payment-button` : void 0,
|
|
1233
|
+
block: true,
|
|
1234
|
+
onClick: onPay,
|
|
1235
|
+
disabled: isPayLoading,
|
|
1236
|
+
children: isPayLoading ? "Processing..." : "Submit Payment"
|
|
1237
|
+
}
|
|
1238
|
+
)
|
|
1217
1239
|
] });
|
|
1218
1240
|
}
|
|
1219
1241
|
function ACHSelector(props) {
|
|
@@ -1304,12 +1326,19 @@ function CreditsSelector(props) {
|
|
|
1304
1326
|
)
|
|
1305
1327
|
}
|
|
1306
1328
|
),
|
|
1307
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
`${
|
|
1311
|
-
|
|
1312
|
-
|
|
1329
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1330
|
+
Subheader,
|
|
1331
|
+
{
|
|
1332
|
+
testid: testid ? `${testid}-credit-${credits.InvoiceNumber}-InvoiceBalanceDue` : void 0,
|
|
1333
|
+
className: " pr-desktop-component-padding",
|
|
1334
|
+
children: [
|
|
1335
|
+
"$",
|
|
1336
|
+
formatCurrencyDisplay(
|
|
1337
|
+
formatDecimalValue(Math.abs(credits.InvoiceBalanceDue), 2)
|
|
1338
|
+
)
|
|
1339
|
+
]
|
|
1340
|
+
}
|
|
1341
|
+
)
|
|
1313
1342
|
]
|
|
1314
1343
|
},
|
|
1315
1344
|
credits.AROpenGUID
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
SelectPaymentMethod
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-2KBVPH75.js";
|
|
5
5
|
import "../chunk-WFGKIR5A.js";
|
|
6
6
|
import "../chunk-BATIOCXB.js";
|
|
7
7
|
import "../chunk-GG5JOFS6.js";
|
|
8
8
|
import "../chunk-EPQLWHCL.js";
|
|
9
9
|
import "../chunk-WFQEE2OO.js";
|
|
10
|
+
import "../chunk-FKMKHLQH.js";
|
|
10
11
|
import "../chunk-5UH6QUFB.js";
|
|
11
12
|
import "../chunk-CYZL57LH.js";
|
|
12
13
|
import "../chunk-WSS2DFTP.js";
|
|
13
14
|
import "../chunk-N6JVLYEE.js";
|
|
14
15
|
import "../chunk-4LXG6QNT.js";
|
|
15
16
|
import "../chunk-HVI3CL7Y.js";
|
|
16
|
-
import "../chunk-FKMKHLQH.js";
|
|
17
17
|
import "../chunk-NKUETCDA.js";
|
|
18
18
|
import "../chunk-RDLEIAQU.js";
|
|
19
19
|
import "../chunk-ORMEWXMH.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
InputBase
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-5UH6QUFB.js";
|
|
4
|
+
} from "../chunk-MVGOAMTP.js";
|
|
6
5
|
import "../chunk-JWCT72WR.js";
|
|
7
6
|
import {
|
|
8
7
|
Button
|
|
9
8
|
} from "../chunk-FKMKHLQH.js";
|
|
9
|
+
import "../chunk-5UH6QUFB.js";
|
|
10
10
|
import {
|
|
11
11
|
Icon
|
|
12
12
|
} from "../chunk-NKUETCDA.js";
|
package/dist/components/Time.js
CHANGED
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
} from "../chunk-4T7F5BZZ.js";
|
|
4
4
|
import {
|
|
5
5
|
InputBase
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-5UH6QUFB.js";
|
|
6
|
+
} from "../chunk-MVGOAMTP.js";
|
|
8
7
|
import "../chunk-JWCT72WR.js";
|
|
8
|
+
import "../chunk-5UH6QUFB.js";
|
|
9
9
|
import {
|
|
10
10
|
Stack
|
|
11
11
|
} from "../chunk-N6JVLYEE.js";
|
package/dist/components/Toast.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Heading3
|
|
4
4
|
} from "../chunk-AZ7LVLOK.js";
|
|
5
|
-
import {
|
|
6
|
-
Paragraph
|
|
7
|
-
} from "../chunk-HVI3CL7Y.js";
|
|
8
5
|
import {
|
|
9
6
|
Button
|
|
10
7
|
} from "../chunk-FKMKHLQH.js";
|
|
8
|
+
import {
|
|
9
|
+
Paragraph
|
|
10
|
+
} from "../chunk-HVI3CL7Y.js";
|
|
11
11
|
import {
|
|
12
12
|
Icon
|
|
13
13
|
} from "../chunk-NKUETCDA.js";
|
|
@@ -3252,7 +3252,11 @@ var Select = (_a) => {
|
|
|
3252
3252
|
error,
|
|
3253
3253
|
readOnly,
|
|
3254
3254
|
removeRoundness,
|
|
3255
|
-
focus: show
|
|
3255
|
+
focus: show,
|
|
3256
|
+
onChange: (e) => {
|
|
3257
|
+
var _a2;
|
|
3258
|
+
return (_a2 = props.onChange) == null ? void 0 : _a2.call(props, e);
|
|
3259
|
+
}
|
|
3256
3260
|
}, props), {
|
|
3257
3261
|
value: displayValue != null ? displayValue : value
|
|
3258
3262
|
})
|
|
@@ -4766,7 +4770,16 @@ function SelectPaymentMethod(props) {
|
|
|
4766
4770
|
children: isPayLoading ? "Processing..." : "Submit Payment"
|
|
4767
4771
|
}
|
|
4768
4772
|
),
|
|
4769
|
-
payAllWithCredits && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4773
|
+
payAllWithCredits && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4774
|
+
Button,
|
|
4775
|
+
{
|
|
4776
|
+
testid: testid ? `${testid}-submit-payment-button` : void 0,
|
|
4777
|
+
block: true,
|
|
4778
|
+
onClick: onPay,
|
|
4779
|
+
disabled: isPayLoading,
|
|
4780
|
+
children: isPayLoading ? "Processing..." : "Submit Payment"
|
|
4781
|
+
}
|
|
4782
|
+
)
|
|
4770
4783
|
] });
|
|
4771
4784
|
}
|
|
4772
4785
|
function ACHSelector(props) {
|
|
@@ -4857,12 +4870,19 @@ function CreditsSelector(props) {
|
|
|
4857
4870
|
)
|
|
4858
4871
|
}
|
|
4859
4872
|
),
|
|
4860
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
`${
|
|
4864
|
-
|
|
4865
|
-
|
|
4873
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
4874
|
+
Subheader,
|
|
4875
|
+
{
|
|
4876
|
+
testid: testid ? `${testid}-credit-${credits.InvoiceNumber}-InvoiceBalanceDue` : void 0,
|
|
4877
|
+
className: " pr-desktop-component-padding",
|
|
4878
|
+
children: [
|
|
4879
|
+
"$",
|
|
4880
|
+
formatCurrencyDisplay(
|
|
4881
|
+
formatDecimalValue(Math.abs(credits.InvoiceBalanceDue), 2)
|
|
4882
|
+
)
|
|
4883
|
+
]
|
|
4884
|
+
}
|
|
4885
|
+
)
|
|
4866
4886
|
]
|
|
4867
4887
|
},
|
|
4868
4888
|
credits.AROpenGUID
|
package/dist/components/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Tooltip
|
|
3
3
|
} from "../chunk-4VTOTNKJ.js";
|
|
4
|
-
import {
|
|
5
|
-
Select
|
|
6
|
-
} from "../chunk-56Y5DDG3.js";
|
|
7
4
|
import {
|
|
8
5
|
PaymentOnAccountModal
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import
|
|
6
|
+
} from "../chunk-2VT3YJ47.js";
|
|
7
|
+
import {
|
|
8
|
+
Select
|
|
9
|
+
} from "../chunk-KADNOKNW.js";
|
|
10
|
+
import "../chunk-2KBVPH75.js";
|
|
11
11
|
import "../chunk-WFGKIR5A.js";
|
|
12
12
|
import "../chunk-BATIOCXB.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-NRCUFAOZ.js";
|
|
14
14
|
import "../chunk-4RJKB7LC.js";
|
|
15
15
|
import "../chunk-C4JGTH6G.js";
|
|
16
16
|
import "../chunk-SYEJVSE4.js";
|
|
@@ -19,37 +19,40 @@ import "../chunk-ZFOANBWG.js";
|
|
|
19
19
|
import "../chunk-GG5JOFS6.js";
|
|
20
20
|
import "../chunk-AZ7LVLOK.js";
|
|
21
21
|
import "../chunk-EPQLWHCL.js";
|
|
22
|
-
import {
|
|
23
|
-
Checkbox
|
|
24
|
-
} from "../chunk-WFQEE2OO.js";
|
|
25
22
|
import {
|
|
26
23
|
DataCellHeader,
|
|
27
24
|
DataGridCell,
|
|
28
25
|
DragAlongCell,
|
|
29
26
|
DraggableCellHeader
|
|
30
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-WJ447JB5.js";
|
|
31
28
|
import {
|
|
32
29
|
Menu
|
|
33
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-LPARJM6S.js";
|
|
34
31
|
import "../chunk-5GUW4DUY.js";
|
|
35
32
|
import {
|
|
36
33
|
MenuOption
|
|
37
|
-
} from "../chunk-
|
|
38
|
-
import
|
|
39
|
-
useInfiniteScroll
|
|
40
|
-
} from "../chunk-WNQ53SVY.js";
|
|
34
|
+
} from "../chunk-AEDEFN7A.js";
|
|
35
|
+
import "../chunk-WVUIIBRR.js";
|
|
41
36
|
import "../chunk-4T7F5BZZ.js";
|
|
42
37
|
import {
|
|
43
38
|
Search
|
|
44
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-IDSFWKOR.js";
|
|
45
40
|
import {
|
|
46
41
|
Input
|
|
47
|
-
} from "../chunk-
|
|
48
|
-
import "../chunk-5UH6QUFB.js";
|
|
42
|
+
} from "../chunk-MVGOAMTP.js";
|
|
49
43
|
import {
|
|
50
44
|
Label
|
|
51
45
|
} from "../chunk-JWCT72WR.js";
|
|
52
|
-
import
|
|
46
|
+
import {
|
|
47
|
+
Checkbox
|
|
48
|
+
} from "../chunk-WFQEE2OO.js";
|
|
49
|
+
import {
|
|
50
|
+
Button
|
|
51
|
+
} from "../chunk-FKMKHLQH.js";
|
|
52
|
+
import {
|
|
53
|
+
useInfiniteScroll
|
|
54
|
+
} from "../chunk-WNQ53SVY.js";
|
|
55
|
+
import "../chunk-5UH6QUFB.js";
|
|
53
56
|
import {
|
|
54
57
|
Subheader
|
|
55
58
|
} from "../chunk-CYZL57LH.js";
|
|
@@ -63,9 +66,6 @@ import {
|
|
|
63
66
|
import {
|
|
64
67
|
Paragraph
|
|
65
68
|
} from "../chunk-HVI3CL7Y.js";
|
|
66
|
-
import {
|
|
67
|
-
Button
|
|
68
|
-
} from "../chunk-FKMKHLQH.js";
|
|
69
69
|
import {
|
|
70
70
|
Icon
|
|
71
71
|
} from "../chunk-NKUETCDA.js";
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/utils/index.ts
|
|
21
|
+
var utils_exports = {};
|
|
22
|
+
__export(utils_exports, {
|
|
23
|
+
calculateCursorPosition: () => calculateCursorPosition,
|
|
24
|
+
countDigitsUpToCursor: () => countDigitsUpToCursor,
|
|
25
|
+
findPositionAfterDigitCount: () => findPositionAfterDigitCount,
|
|
26
|
+
formatCurrencyDisplay: () => formatCurrencyDisplay,
|
|
27
|
+
formatDate: () => formatDate,
|
|
28
|
+
formatDatePartsToDisplay: () => formatDatePartsToDisplay,
|
|
29
|
+
formatDecimalValue: () => formatDecimalValue,
|
|
30
|
+
formatInputValue: () => formatInputValue,
|
|
31
|
+
getDecimalPlaceholder: () => getDecimalPlaceholder,
|
|
32
|
+
isDigit: () => isDigit,
|
|
33
|
+
isSlash: () => isSlash,
|
|
34
|
+
isValidDate: () => isValidDate,
|
|
35
|
+
isValidDateRange: () => isValidDateRange,
|
|
36
|
+
isValidDateRangeOrder: () => isValidDateRangeOrder,
|
|
37
|
+
parseDateParts: () => parseDateParts,
|
|
38
|
+
parseInputDate: () => parseInputDate
|
|
39
|
+
});
|
|
40
|
+
module.exports = __toCommonJS(utils_exports);
|
|
41
|
+
|
|
42
|
+
// src/utils/formatting.tsx
|
|
43
|
+
function getDecimalPlaceholder(decimals) {
|
|
44
|
+
if (!decimals || decimals <= 0) {
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
placeholder: `0.${"0".repeat(decimals)}`
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function formatDecimalValue(value, decimals) {
|
|
52
|
+
if (!value || value === "") {
|
|
53
|
+
return "";
|
|
54
|
+
}
|
|
55
|
+
const numValue = typeof value === "string" ? parseFloat(value) : value;
|
|
56
|
+
if (isNaN(numValue)) {
|
|
57
|
+
return "";
|
|
58
|
+
}
|
|
59
|
+
if (!decimals || decimals <= 0) {
|
|
60
|
+
return String(Math.round(numValue));
|
|
61
|
+
}
|
|
62
|
+
return numValue.toFixed(decimals);
|
|
63
|
+
}
|
|
64
|
+
function formatCurrencyDisplay(value) {
|
|
65
|
+
if (!value || value === "") {
|
|
66
|
+
return "";
|
|
67
|
+
}
|
|
68
|
+
const parts = value.split(".");
|
|
69
|
+
const integerPart = parts[0];
|
|
70
|
+
const decimalPart = parts[1];
|
|
71
|
+
const formattedInteger = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
72
|
+
return decimalPart !== void 0 ? `${formattedInteger}.${decimalPart}` : formattedInteger;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// src/utils/date.ts
|
|
76
|
+
function parseInputDate(input) {
|
|
77
|
+
const match = input.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);
|
|
78
|
+
if (!match) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
const [, month, day, year] = match;
|
|
82
|
+
const paddedMonth = month.padStart(2, "0");
|
|
83
|
+
const paddedDay = day.padStart(2, "0");
|
|
84
|
+
return `${year}-${paddedMonth}-${paddedDay}`;
|
|
85
|
+
}
|
|
86
|
+
function isValidDate(dateString) {
|
|
87
|
+
const date = new Date(dateString);
|
|
88
|
+
return date instanceof Date && !isNaN(date.getTime()) && dateString === date.toISOString().split("T")[0];
|
|
89
|
+
}
|
|
90
|
+
function formatInputValue(value) {
|
|
91
|
+
const digits = value.replace(/\D/g, "");
|
|
92
|
+
if (digits.length < 2) {
|
|
93
|
+
return digits;
|
|
94
|
+
}
|
|
95
|
+
if (digits.length >= 4) {
|
|
96
|
+
return `${digits.slice(0, 2)}/${digits.slice(2, 4)}/${digits.slice(4, 8)}`;
|
|
97
|
+
}
|
|
98
|
+
return `${digits.slice(0, 2)}/${digits.slice(2)}`;
|
|
99
|
+
}
|
|
100
|
+
function isDigit(character) {
|
|
101
|
+
return /\d/.test(character);
|
|
102
|
+
}
|
|
103
|
+
function isSlash(character) {
|
|
104
|
+
return character === "/";
|
|
105
|
+
}
|
|
106
|
+
function countDigitsUpToCursor(value, cursorPosition) {
|
|
107
|
+
let digitCount = 0;
|
|
108
|
+
for (let i = 0; i < cursorPosition && i < value.length; i++) {
|
|
109
|
+
if (!isDigit(value[i])) {
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
digitCount++;
|
|
113
|
+
}
|
|
114
|
+
return digitCount;
|
|
115
|
+
}
|
|
116
|
+
function findPositionAfterDigitCount(formattedValue, targetDigitCount) {
|
|
117
|
+
let currentDigitCount = 0;
|
|
118
|
+
for (let i = 0; i < formattedValue.length; i++) {
|
|
119
|
+
if (!isDigit(formattedValue[i])) {
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
currentDigitCount++;
|
|
123
|
+
if (currentDigitCount !== targetDigitCount) {
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
const positionAfterDigit = i + 1;
|
|
127
|
+
const nextCharacter = formattedValue[positionAfterDigit];
|
|
128
|
+
if (nextCharacter && isSlash(nextCharacter)) {
|
|
129
|
+
return positionAfterDigit + 1;
|
|
130
|
+
}
|
|
131
|
+
return positionAfterDigit;
|
|
132
|
+
}
|
|
133
|
+
return formattedValue.length;
|
|
134
|
+
}
|
|
135
|
+
function calculateCursorPosition(originalValue, formattedValue, originalPosition) {
|
|
136
|
+
const targetDigitCount = countDigitsUpToCursor(originalValue, originalPosition);
|
|
137
|
+
const newPosition = findPositionAfterDigitCount(formattedValue, targetDigitCount);
|
|
138
|
+
return Math.min(newPosition, formattedValue.length);
|
|
139
|
+
}
|
|
140
|
+
function parseDateParts(dateString) {
|
|
141
|
+
const [yearStr, monthStr, dayStr] = dateString.split("-");
|
|
142
|
+
if (!yearStr || !monthStr || !dayStr) {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
const year = parseInt(yearStr, 10);
|
|
146
|
+
const month = parseInt(monthStr, 10);
|
|
147
|
+
const day = parseInt(dayStr, 10);
|
|
148
|
+
if (isNaN(year) || isNaN(month) || isNaN(day)) {
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
return { year, month, day };
|
|
152
|
+
}
|
|
153
|
+
function isValidDateRange(month, day) {
|
|
154
|
+
if (month < 1 || month > 12) {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
if (day < 1 || day > 31) {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
function formatDatePartsToDisplay(year, month, day) {
|
|
163
|
+
const paddedMonth = month.toString().padStart(2, "0");
|
|
164
|
+
const paddedDay = day.toString().padStart(2, "0");
|
|
165
|
+
return `${paddedMonth}/${paddedDay}/${year}`;
|
|
166
|
+
}
|
|
167
|
+
function formatDate(date) {
|
|
168
|
+
if (!date) {
|
|
169
|
+
return "";
|
|
170
|
+
}
|
|
171
|
+
try {
|
|
172
|
+
const dateParts = parseDateParts(date);
|
|
173
|
+
if (!dateParts) {
|
|
174
|
+
return "";
|
|
175
|
+
}
|
|
176
|
+
const { year, month, day } = dateParts;
|
|
177
|
+
if (!isValidDateRange(month, day)) {
|
|
178
|
+
return "";
|
|
179
|
+
}
|
|
180
|
+
return formatDatePartsToDisplay(year, month, day);
|
|
181
|
+
} catch (error) {
|
|
182
|
+
return "";
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
function isValidDateRangeOrder(fromDate, toDate) {
|
|
186
|
+
if (!fromDate || !toDate || !isValidDate(fromDate) || !isValidDate(toDate)) {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
const from = new Date(fromDate);
|
|
190
|
+
const to = new Date(toDate);
|
|
191
|
+
return to >= from;
|
|
192
|
+
}
|
|
193
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
194
|
+
0 && (module.exports = {
|
|
195
|
+
calculateCursorPosition,
|
|
196
|
+
countDigitsUpToCursor,
|
|
197
|
+
findPositionAfterDigitCount,
|
|
198
|
+
formatCurrencyDisplay,
|
|
199
|
+
formatDate,
|
|
200
|
+
formatDatePartsToDisplay,
|
|
201
|
+
formatDecimalValue,
|
|
202
|
+
formatInputValue,
|
|
203
|
+
getDecimalPlaceholder,
|
|
204
|
+
isDigit,
|
|
205
|
+
isSlash,
|
|
206
|
+
isValidDate,
|
|
207
|
+
isValidDateRange,
|
|
208
|
+
isValidDateRangeOrder,
|
|
209
|
+
parseDateParts,
|
|
210
|
+
parseInputDate
|
|
211
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
calculateCursorPosition,
|
|
3
|
+
countDigitsUpToCursor,
|
|
4
|
+
findPositionAfterDigitCount,
|
|
5
|
+
formatDate,
|
|
6
|
+
formatDatePartsToDisplay,
|
|
7
|
+
formatInputValue,
|
|
8
|
+
isDigit,
|
|
9
|
+
isSlash,
|
|
10
|
+
isValidDate,
|
|
11
|
+
isValidDateRange,
|
|
12
|
+
isValidDateRangeOrder,
|
|
13
|
+
parseDateParts,
|
|
14
|
+
parseInputDate
|
|
15
|
+
} from "../chunk-IDN3IN2A.js";
|
|
16
|
+
import {
|
|
17
|
+
formatCurrencyDisplay,
|
|
18
|
+
formatDecimalValue,
|
|
19
|
+
getDecimalPlaceholder
|
|
20
|
+
} from "../chunk-5UH6QUFB.js";
|
|
21
|
+
import "../chunk-ORMEWXMH.js";
|
|
22
|
+
export {
|
|
23
|
+
calculateCursorPosition,
|
|
24
|
+
countDigitsUpToCursor,
|
|
25
|
+
findPositionAfterDigitCount,
|
|
26
|
+
formatCurrencyDisplay,
|
|
27
|
+
formatDate,
|
|
28
|
+
formatDatePartsToDisplay,
|
|
29
|
+
formatDecimalValue,
|
|
30
|
+
formatInputValue,
|
|
31
|
+
getDecimalPlaceholder,
|
|
32
|
+
isDigit,
|
|
33
|
+
isSlash,
|
|
34
|
+
isValidDate,
|
|
35
|
+
isValidDateRange,
|
|
36
|
+
isValidDateRangeOrder,
|
|
37
|
+
parseDateParts,
|
|
38
|
+
parseInputDate
|
|
39
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dmsi/wedgekit-react",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.154",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsup",
|
|
@@ -37,6 +37,11 @@
|
|
|
37
37
|
"import": "./dist/types.js",
|
|
38
38
|
"require": "./dist/types.cjs"
|
|
39
39
|
},
|
|
40
|
+
"./utils": {
|
|
41
|
+
"types": "./src/utils/index.ts",
|
|
42
|
+
"import": "./dist/utils/index.js",
|
|
43
|
+
"require": "./dist/utils/index.cjs"
|
|
44
|
+
},
|
|
40
45
|
"./styles.css": "./dist/index.css",
|
|
41
46
|
"./fonts.css": "./dist/fonts.css",
|
|
42
47
|
"./package.json": "./package.json"
|
|
@@ -8,7 +8,7 @@ import { Radio } from "./Radio";
|
|
|
8
8
|
import { Stack } from "./Stack";
|
|
9
9
|
import { Checkbox } from "./Checkbox";
|
|
10
10
|
import { Subheader } from "./Subheader";
|
|
11
|
-
import { formatCurrencyDisplay } from "../utils/formatting";
|
|
11
|
+
import { formatCurrencyDisplay, formatDecimalValue } from "../utils/formatting";
|
|
12
12
|
import { HorizontalDivider } from "./HorizontalDivider";
|
|
13
13
|
import { Spinner } from "./Spinner";
|
|
14
14
|
import { WorldpayIframe } from "./WorldpayIframe";
|
|
@@ -60,7 +60,7 @@ export function SelectPaymentMethod(props: SelectPaymentMethodProps) {
|
|
|
60
60
|
withCredits = false,
|
|
61
61
|
isLoadingCCiframe,
|
|
62
62
|
cardPaymentUrl,
|
|
63
|
-
testid
|
|
63
|
+
testid,
|
|
64
64
|
} = props;
|
|
65
65
|
|
|
66
66
|
const payAllWithCredits = withCredits && amountToPay <= 0;
|
|
@@ -148,7 +148,12 @@ export function SelectPaymentMethod(props: SelectPaymentMethodProps) {
|
|
|
148
148
|
</Button>
|
|
149
149
|
)}
|
|
150
150
|
{payAllWithCredits && (
|
|
151
|
-
<Button
|
|
151
|
+
<Button
|
|
152
|
+
testid={testid ? `${testid}-submit-payment-button` : undefined}
|
|
153
|
+
block
|
|
154
|
+
onClick={onPay}
|
|
155
|
+
disabled={isPayLoading}
|
|
156
|
+
>
|
|
152
157
|
{isPayLoading ? "Processing..." : "Submit Payment"}
|
|
153
158
|
</Button>
|
|
154
159
|
)}
|
|
@@ -175,7 +180,7 @@ function ACHSelector(props: ACHSelectorProps) {
|
|
|
175
180
|
setSelectedBankGuid,
|
|
176
181
|
customerBanks,
|
|
177
182
|
disabled,
|
|
178
|
-
testid
|
|
183
|
+
testid,
|
|
179
184
|
} = props;
|
|
180
185
|
|
|
181
186
|
function handleBankSelect(
|
|
@@ -220,7 +225,7 @@ type CreditsSelectorProps = {
|
|
|
220
225
|
selectedCredits: unknown[];
|
|
221
226
|
allCredits: unknown[];
|
|
222
227
|
setSelectedCredits: React.Dispatch<React.SetStateAction<unknown[]>>;
|
|
223
|
-
testid?: string
|
|
228
|
+
testid?: string;
|
|
224
229
|
};
|
|
225
230
|
function CreditsSelector(props: CreditsSelectorProps) {
|
|
226
231
|
const { selectedCredits, allCredits, setSelectedCredits, testid } = props;
|
|
@@ -270,20 +275,35 @@ function CreditsSelector(props: CreditsSelectorProps) {
|
|
|
270
275
|
onClick={() => handleCreditSelect(credits)}
|
|
271
276
|
paddingY
|
|
272
277
|
flexGrow={1}
|
|
273
|
-
testid={
|
|
278
|
+
testid={
|
|
279
|
+
testid
|
|
280
|
+
? `${testid}-credit-${credits.InvoiceNumber}`
|
|
281
|
+
: undefined
|
|
282
|
+
}
|
|
274
283
|
>
|
|
275
284
|
<Checkbox
|
|
276
|
-
testid={
|
|
285
|
+
testid={
|
|
286
|
+
testid
|
|
287
|
+
? `${testid}-credit-${credits.InvoiceNumber}-checkbox`
|
|
288
|
+
: undefined
|
|
289
|
+
}
|
|
277
290
|
label={credits.InvoiceNumber}
|
|
278
291
|
checked={selectedCredits?.includes(credits)}
|
|
279
292
|
onChange={() => handleCreditSelect(credits)}
|
|
280
293
|
/>
|
|
281
294
|
</Stack>
|
|
282
295
|
|
|
283
|
-
<Subheader
|
|
296
|
+
<Subheader
|
|
297
|
+
testid={
|
|
298
|
+
testid
|
|
299
|
+
? `${testid}-credit-${credits.InvoiceNumber}-InvoiceBalanceDue`
|
|
300
|
+
: undefined
|
|
301
|
+
}
|
|
302
|
+
className=" pr-desktop-component-padding"
|
|
303
|
+
>
|
|
284
304
|
$
|
|
285
305
|
{formatCurrencyDisplay(
|
|
286
|
-
|
|
306
|
+
formatDecimalValue(Math.abs(credits.InvoiceBalanceDue), 2),
|
|
287
307
|
)}
|
|
288
308
|
</Subheader>
|
|
289
309
|
</Stack>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useMenuPosition
|
|
3
3
|
} from "./chunk-5GUW4DUY.js";
|
|
4
|
-
import {
|
|
5
|
-
useMatchesMobile
|
|
6
|
-
} from "./chunk-WNQ53SVY.js";
|
|
7
4
|
import {
|
|
8
5
|
findDocumentRoot
|
|
9
6
|
} from "./chunk-4T7F5BZZ.js";
|
|
7
|
+
import {
|
|
8
|
+
useMatchesMobile
|
|
9
|
+
} from "./chunk-WNQ53SVY.js";
|
|
10
10
|
import {
|
|
11
11
|
__objRest,
|
|
12
12
|
__spreadProps,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Label
|
|
3
|
+
} from "./chunk-JWCT72WR.js";
|
|
1
4
|
import {
|
|
2
5
|
formatCurrencyDisplay,
|
|
3
6
|
formatDecimalValue,
|
|
4
7
|
getDecimalPlaceholder
|
|
5
8
|
} from "./chunk-5UH6QUFB.js";
|
|
6
|
-
import {
|
|
7
|
-
Label
|
|
8
|
-
} from "./chunk-JWCT72WR.js";
|
|
9
9
|
import {
|
|
10
10
|
Icon
|
|
11
11
|
} from "./chunk-NKUETCDA.js";
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
ModalScrim
|
|
15
15
|
} from "./chunk-ZFOANBWG.js";
|
|
16
|
-
import {
|
|
17
|
-
useMatchesMobile
|
|
18
|
-
} from "./chunk-WNQ53SVY.js";
|
|
19
16
|
import {
|
|
20
17
|
findDocumentRoot
|
|
21
18
|
} from "./chunk-4T7F5BZZ.js";
|
|
19
|
+
import {
|
|
20
|
+
useMatchesMobile
|
|
21
|
+
} from "./chunk-WNQ53SVY.js";
|
|
22
22
|
|
|
23
23
|
// src/components/Modal.tsx
|
|
24
24
|
import clsx from "clsx";
|