@tesouro/embedded-components-react 0.3.19 → 0.3.22
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/index.css +9 -0
- package/dist/index.js +1 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/lib/monite-sdk.js +18 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +14 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +28 -97
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +81 -176
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +50 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +250 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +106 -107
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +209 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +3 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +114 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +21 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +36 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +10 -283
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +199 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +3 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +14 -91
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +314 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +10 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +4 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +85 -105
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +2 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +16 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +113 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +2 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +5 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +30 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +2 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +5 -104
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +34 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +2 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +9 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +81 -145
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +15 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +8 -87
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +170 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +14 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +89 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index.js +19 -19
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index422.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index479.js +16 -20
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index480.js +13 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index481.js +19 -97
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index482.js +98 -42
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index483.js +43 -27
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index484.js +30 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index485.js +1 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index486.js +11 -10
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index487.js +14 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index488.js +4 -13
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index489.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index490.js +18 -9
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index491.js +8 -105
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index492.js +102 -35
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index493.js +36 -45
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index494.js +44 -71
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index495.js +72 -100
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index496.js +99 -43
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index497.js +35 -178
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index498.js +171 -125
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index499.js +134 -123
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index500.js +125 -73
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index501.js +63 -232
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index502.js +248 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index503.js +8 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index504.js +5 -456
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index505.js +455 -21
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index506.js +17 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index507.js +13 -49
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index508.js +51 -43
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index509.js +46 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index510.js +13 -41
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index511.js +39 -144
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index512.js +143 -112
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index513.js +114 -39
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index514.js +33 -25
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index515.js +32 -19
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index516.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index517.js +19 -21
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index518.js +20 -72
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index519.js +73 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index520.js +18 -172
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index521.js +149 -116
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index522.js +136 -30
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index523.js +31 -115
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index524.js +116 -19
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index525.js +10 -36
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index526.js +46 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index527.js +13 -23
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index528.js +21 -25
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index529.js +26 -36
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index530.js +36 -77
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index531.js +77 -50
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index532.js +50 -33
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index533.js +34 -89
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index534.js +86 -48
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index535.js +54 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index536.js +1 -40
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index537.js +40 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index538.js +0 -135
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index539.js +129 -102
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index540.js +105 -50
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index541.js +48 -779
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index542.js +780 -87
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index543.js +84 -97
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index544.js +105 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index545.js +6 -27
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index546.js +23 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index547.js +13 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index548.js +2 -25
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index549.js +25 -14
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index550.js +14 -171
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index551.js +163 -200
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index552.js +204 -78
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index553.js +82 -17
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index554.js +17 -158
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index555.js +146 -85
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index556.js +95 -42
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index557.js +46 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index558.js +4 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index559.js +13 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index560.js +27 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index561.js +0 -186
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index562.js +186 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index563.js +0 -42
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index564.js +41 -3
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index565.js +5 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index566.js +20 -73
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index567.js +74 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index568.js +16 -19
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index569.js +19 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index570.js +4 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index571.js +10 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index572.js +11 -131
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index573.js +129 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index574.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index575.js +8 -5
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index576.js +4 -221
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index577.js +219 -11
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index578.js +12 -34
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index579.js +32 -181
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index580.js +168 -189
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index581.js +192 -88
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index582.js +97 -61
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index583.js +63 -54
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index584.js +46 -83
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index585.js +91 -40
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index586.js +39 -75
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index587.js +63 -71
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index588.js +85 -12
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index589.js +12 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index590.js +25 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index591.js +14 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index592.js +4 -23
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index593.js +23 -0
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index594.js +1 -24
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index595.js +24 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index596.js +4 -13
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index597.js +9 -13
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index598.js +13 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index599.js +4 -8
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index600.js +8 -4
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index601.js +8 -6
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index602.js +6 -22
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index603.js +17 -68
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index604.js +66 -113
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index605.js +104 -64
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index606.js +72 -138
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index607.js +144 -28
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index608.js +28 -16
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index609.js +14 -87
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index610.js +91 -3
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index611.js +3 -26
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index612.js +22 -67
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index613.js +71 -1
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index614.js +0 -65
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index615.js +66 -29
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index616.js +30 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index617.js +2 -34
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index618.js +33 -15
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index619.js +14 -29
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index620.js +29 -26
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index621.js +30 -2
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index622.js +2 -97
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index623.js +97 -0
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/monite-wrapper/feature/dist/lib/MoniteWrapper.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +1 -1
- package/dist/packages/shared-ui-shadcn/dist/index.js +16 -11
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +0 -2
|
@@ -1,10 +1,250 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cn as e } from "./index49.js";
|
|
2
|
+
import { Button as t } from "./index56.js";
|
|
3
|
+
import { useFileInput as n } from "./index209.js";
|
|
4
|
+
import "./index217.js";
|
|
5
|
+
import { Typography as r } from "./index62.js";
|
|
6
|
+
import { Separator as i } from "./index64.js";
|
|
7
|
+
import { ATTACHMENT_ACCEPTED_EXTENSIONS as a, ATTACHMENT_ACCEPTED_FORMATS as o } from "./index93.js";
|
|
8
|
+
import { Checkbox as s } from "./index103.js";
|
|
9
|
+
import { validateAttachmentFile as c } from "./index192.js";
|
|
10
|
+
import { formatFileSize as l } from "./index193.js";
|
|
11
|
+
import { toFileArray as u } from "./index194.js";
|
|
12
|
+
import { useUploadReceivableAttachment as d } from "./index220.js";
|
|
13
|
+
import { useDeleteFile as f } from "./index221.js";
|
|
14
|
+
import { useEffect as p, useRef as m, useState as h } from "react";
|
|
15
|
+
import { FileText as g, ImageIcon as _, Loader2 as v, Trash2 as y, X as b } from "lucide-react";
|
|
16
|
+
import { Fragment as x, jsx as S, jsxs as C } from "@emotion/react/jsx-runtime";
|
|
17
|
+
import { useLingui as w } from "@lingui/react";
|
|
18
|
+
import { useFormContext as T } from "react-hook-form";
|
|
2
19
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index502.js
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
20
|
+
var E = ({ disabled: E, onUploadingChange: D }) => {
|
|
21
|
+
let { i18n: O } = w(), { watch: k, setValue: A, getValues: j } = T(), { mutateAsync: M } = d(), { mutate: N } = f(), { FileInput: P, openFileInput: F, resetInput: I } = n({
|
|
22
|
+
acceptedFormats: o,
|
|
23
|
+
maxFileSizeInMB: 3
|
|
24
|
+
}), L = k("attachments") ?? [], R = k("frequency"), z = !!R && R !== "once", [B, V] = h([]), [H, U] = h(!1), [W, G] = h(!1), K = m(0), q = m(!1);
|
|
25
|
+
p(() => (q.current = !1, () => {
|
|
26
|
+
q.current = !0;
|
|
27
|
+
}), []);
|
|
28
|
+
let J = m(/* @__PURE__ */ new Set()), Y = B.some((e) => e.status === "uploading");
|
|
29
|
+
p(() => {
|
|
30
|
+
D?.(Y);
|
|
31
|
+
}, [Y, D]), p(() => () => D?.(!1), [D]);
|
|
32
|
+
let X = () => (K.current += 1, `attachment-${K.current}`), Z = (e) => e === "too_large" ? O._("File too large (max 3 MB)") : O._("File type not supported. Use PDF, DOC, JPG or PNG"), Q = async (e, t) => {
|
|
33
|
+
try {
|
|
34
|
+
let n = await M({
|
|
35
|
+
file: t,
|
|
36
|
+
file_type: "attachments"
|
|
37
|
+
});
|
|
38
|
+
if (q.current || J.current.delete(e)) {
|
|
39
|
+
N({ path: { file_id: n.id } });
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
V((t) => t.filter((t) => t.localId !== e)), A("attachments", [...j("attachments") ?? [], {
|
|
43
|
+
id: n.id,
|
|
44
|
+
include_in_email: !0,
|
|
45
|
+
name: n.name,
|
|
46
|
+
size: n.size
|
|
47
|
+
}], { shouldDirty: !0 });
|
|
48
|
+
} catch {
|
|
49
|
+
let t = J.current.delete(e);
|
|
50
|
+
if (q.current || t) return;
|
|
51
|
+
V((t) => t.map((t) => t.localId === e ? {
|
|
52
|
+
...t,
|
|
53
|
+
status: "error",
|
|
54
|
+
errorMessage: O._("Upload failed. Please try again.")
|
|
55
|
+
} : t));
|
|
56
|
+
}
|
|
57
|
+
}, $ = (e) => {
|
|
58
|
+
if (e.length === 0) return;
|
|
59
|
+
let t = j("attachments") ?? [], n = B.filter((e) => e.status === "uploading").length, r = 10 - t.length - n, i = [], s = !1;
|
|
60
|
+
for (let t of e) {
|
|
61
|
+
let e = c(t, {
|
|
62
|
+
acceptedFormats: o,
|
|
63
|
+
acceptedExtensions: a,
|
|
64
|
+
maxFileSizeInMB: 3
|
|
65
|
+
});
|
|
66
|
+
if (e) {
|
|
67
|
+
i.push({
|
|
68
|
+
localId: X(),
|
|
69
|
+
name: t.name,
|
|
70
|
+
size: t.size,
|
|
71
|
+
status: "error",
|
|
72
|
+
errorMessage: Z(e)
|
|
73
|
+
});
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if (r <= 0) {
|
|
77
|
+
s = !0;
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
--r;
|
|
81
|
+
let n = X();
|
|
82
|
+
i.push({
|
|
83
|
+
localId: n,
|
|
84
|
+
name: t.name,
|
|
85
|
+
size: t.size,
|
|
86
|
+
status: "uploading"
|
|
87
|
+
}), Q(n, t);
|
|
88
|
+
}
|
|
89
|
+
i.length > 0 && V((e) => [...e, ...i]), U(s);
|
|
90
|
+
}, ee = (e, t) => {
|
|
91
|
+
A("attachments", (j("attachments") ?? []).map((n) => n.id === e ? {
|
|
92
|
+
...n,
|
|
93
|
+
include_in_email: t
|
|
94
|
+
} : n), { shouldDirty: !0 });
|
|
95
|
+
}, te = (e) => {
|
|
96
|
+
A("attachments", (j("attachments") ?? []).filter((t) => t.id !== e), { shouldDirty: !0 }), U(!1), N({ path: { file_id: e } });
|
|
97
|
+
}, ne = (e) => {
|
|
98
|
+
B.some((t) => t.localId === e && t.status === "uploading") && J.current.add(e), V((t) => t.filter((t) => t.localId !== e)), U(!1);
|
|
99
|
+
}, re = (e) => {
|
|
100
|
+
e.preventDefault(), G(!1), !E && $(u(e.dataTransfer.files));
|
|
101
|
+
}, ie = L.length > 0 || B.length > 0;
|
|
102
|
+
return /* @__PURE__ */ C("div", {
|
|
103
|
+
className: "ttw:flex ttw:flex-col ttw:p-6 ttw:gap-2.5 ttw:border ttw:border-border ttw:rounded-xl",
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ C("div", {
|
|
106
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2.5 ttw:pb-4",
|
|
107
|
+
children: [/* @__PURE__ */ S(r, {
|
|
108
|
+
variant: "h4",
|
|
109
|
+
children: O._("Attachments")
|
|
110
|
+
}), /* @__PURE__ */ S(r, {
|
|
111
|
+
variant: "body2",
|
|
112
|
+
color: "muted",
|
|
113
|
+
className: "ttw:font-medium",
|
|
114
|
+
children: O._("Associate additional documents with this invoice for your own reference or to share with the customer. e.g. contracts, photos, terms and conditions, etc.")
|
|
115
|
+
})]
|
|
116
|
+
}),
|
|
117
|
+
ie && /* @__PURE__ */ C("div", {
|
|
118
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
119
|
+
children: [L.length > 0 && /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(r, {
|
|
120
|
+
variant: "caption",
|
|
121
|
+
color: "muted",
|
|
122
|
+
children: z ? O._("Selected files will be attached to every invoice email in the recurring series.") : O._("Selected files will be attached to the invoice email sent to the customer.")
|
|
123
|
+
}), /* @__PURE__ */ S(i, {})] }), /* @__PURE__ */ C("ul", {
|
|
124
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
125
|
+
children: [L.map((e) => {
|
|
126
|
+
let n = `attachment-include-${e.id}`;
|
|
127
|
+
return /* @__PURE__ */ C("li", {
|
|
128
|
+
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
129
|
+
children: [/* @__PURE__ */ S(s, {
|
|
130
|
+
id: n,
|
|
131
|
+
checked: e.include_in_email,
|
|
132
|
+
disabled: E,
|
|
133
|
+
"aria-label": `${O._("Include in email:")} ${e.name}`,
|
|
134
|
+
onCheckedChange: (t) => ee(e.id, t === !0)
|
|
135
|
+
}), /* @__PURE__ */ C("div", {
|
|
136
|
+
className: "ttw:flex ttw:w-full ttw:items-center ttw:rounded-lg ttw:gap-3 ttw:bg-muted ttw:px-2 ttw:py-1",
|
|
137
|
+
children: [/* @__PURE__ */ C("div", {
|
|
138
|
+
className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:items-center ttw:gap-1",
|
|
139
|
+
children: [/* @__PURE__ */ S(r, {
|
|
140
|
+
variant: "body2",
|
|
141
|
+
className: "ttw:truncate",
|
|
142
|
+
children: e.name
|
|
143
|
+
}), /* @__PURE__ */ C(r, {
|
|
144
|
+
variant: "body2",
|
|
145
|
+
color: "muted",
|
|
146
|
+
className: "ttw:shrink-0",
|
|
147
|
+
children: [
|
|
148
|
+
"(",
|
|
149
|
+
l(e.size),
|
|
150
|
+
")"
|
|
151
|
+
]
|
|
152
|
+
})]
|
|
153
|
+
}), /* @__PURE__ */ S(t, {
|
|
154
|
+
type: "button",
|
|
155
|
+
variant: "ghost",
|
|
156
|
+
size: "icon",
|
|
157
|
+
className: "ttw:size-4",
|
|
158
|
+
disabled: E,
|
|
159
|
+
"aria-label": `${O._("Remove")} ${e.name}`,
|
|
160
|
+
onClick: () => te(e.id),
|
|
161
|
+
children: /* @__PURE__ */ S(y, { className: "ttw:size-4" })
|
|
162
|
+
})]
|
|
163
|
+
})]
|
|
164
|
+
}, e.id);
|
|
165
|
+
}), B.map((e) => /* @__PURE__ */ C("li", {
|
|
166
|
+
className: "ttw:flex ttw:w-full ttw:items-center ttw:rounded-lg ttw:gap-3 ttw:bg-muted ttw:px-2 ttw:py-1",
|
|
167
|
+
children: [
|
|
168
|
+
e.status === "uploading" ? /* @__PURE__ */ S(v, { className: "ttw:size-5 ttw:shrink-0 ttw:animate-spin ttw:text-muted-foreground" }) : /* @__PURE__ */ S(g, { className: "ttw:size-5 ttw:shrink-0 ttw:text-destructive" }),
|
|
169
|
+
/* @__PURE__ */ C("div", {
|
|
170
|
+
className: "ttw:flex ttw:min-w-0 ttw:flex-1 ttw:flex-col",
|
|
171
|
+
children: [/* @__PURE__ */ S(r, {
|
|
172
|
+
variant: "body2",
|
|
173
|
+
className: "ttw:truncate",
|
|
174
|
+
children: e.name
|
|
175
|
+
}), e.status === "uploading" ? /* @__PURE__ */ S(r, {
|
|
176
|
+
variant: "caption",
|
|
177
|
+
color: "muted",
|
|
178
|
+
children: O._("Uploading…")
|
|
179
|
+
}) : /* @__PURE__ */ S(r, {
|
|
180
|
+
variant: "caption",
|
|
181
|
+
role: "alert",
|
|
182
|
+
className: "ttw:text-destructive",
|
|
183
|
+
children: e.errorMessage
|
|
184
|
+
})]
|
|
185
|
+
}),
|
|
186
|
+
/* @__PURE__ */ S(t, {
|
|
187
|
+
type: "button",
|
|
188
|
+
variant: "ghost",
|
|
189
|
+
size: "icon",
|
|
190
|
+
disabled: E,
|
|
191
|
+
"aria-label": `${O._("Remove")} ${e.name}`,
|
|
192
|
+
onClick: () => ne(e.localId),
|
|
193
|
+
children: /* @__PURE__ */ S(b, { className: "ttw:size-4" })
|
|
194
|
+
})
|
|
195
|
+
]
|
|
196
|
+
}, e.localId))]
|
|
197
|
+
})]
|
|
198
|
+
}),
|
|
199
|
+
/* @__PURE__ */ C("button", {
|
|
200
|
+
type: "button",
|
|
201
|
+
disabled: E,
|
|
202
|
+
onClick: F,
|
|
203
|
+
onDragOver: (e) => {
|
|
204
|
+
e.preventDefault(), E || G(!0);
|
|
205
|
+
},
|
|
206
|
+
onDragLeave: (e) => {
|
|
207
|
+
e.preventDefault(), G(!1);
|
|
208
|
+
},
|
|
209
|
+
onDrop: re,
|
|
210
|
+
className: e("ttw:flex ttw:w-full ttw:flex-col ttw:items-center ttw:gap-2 ttw:rounded-xl ttw:border ttw:border-dashed ttw:p-6 ttw:text-center ttw:disabled:cursor-not-allowed ttw:disabled:opacity-50", W ? "ttw:border-primary ttw:bg-primary/5" : "ttw:border-border ttw:bg-muted"),
|
|
211
|
+
children: [
|
|
212
|
+
/* @__PURE__ */ S("span", {
|
|
213
|
+
className: "ttw:flex ttw:size-10 ttw:items-center ttw:justify-center ttw:rounded-full ttw:border ttw:border-border",
|
|
214
|
+
children: /* @__PURE__ */ S(_, { className: "ttw:size-5 ttw:text-muted-foreground" })
|
|
215
|
+
}),
|
|
216
|
+
/* @__PURE__ */ C(r, {
|
|
217
|
+
variant: "body2",
|
|
218
|
+
children: [
|
|
219
|
+
O._("Drop your files here, or"),
|
|
220
|
+
" ",
|
|
221
|
+
/* @__PURE__ */ S("span", {
|
|
222
|
+
className: "ttw:text-primary ttw:underline",
|
|
223
|
+
children: O._("browse to upload")
|
|
224
|
+
})
|
|
225
|
+
]
|
|
226
|
+
}),
|
|
227
|
+
/* @__PURE__ */ S(r, {
|
|
228
|
+
variant: "caption",
|
|
229
|
+
color: "muted",
|
|
230
|
+
children: O._("PDF, DOC, JPG, PNG (max. 3MB)")
|
|
231
|
+
})
|
|
232
|
+
]
|
|
233
|
+
}),
|
|
234
|
+
H && /* @__PURE__ */ S(r, {
|
|
235
|
+
variant: "body2",
|
|
236
|
+
role: "alert",
|
|
237
|
+
className: "ttw:text-destructive",
|
|
238
|
+
children: O._("You can attach up to 10 files.")
|
|
239
|
+
}),
|
|
240
|
+
/* @__PURE__ */ S(P, {
|
|
241
|
+
multiple: !0,
|
|
242
|
+
onChange: (e) => {
|
|
243
|
+
$(u(e.target.files)), I();
|
|
244
|
+
}
|
|
245
|
+
})
|
|
246
|
+
]
|
|
247
|
+
});
|
|
248
|
+
};
|
|
9
249
|
//#endregion
|
|
10
|
-
export {
|
|
250
|
+
export { E as AttachmentSection };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { jsx as t, jsxs as n } from "@emotion/react/jsx-runtime";
|
|
1
|
+
import { getCountries as e } from "./index12.js";
|
|
3
2
|
//#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index503.js
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
var t = (e, t) => t.find((t) => t.id === e)?.name ?? null, n = (e) => {
|
|
4
|
+
if (e) {
|
|
5
|
+
if ("organization" in e) return e.organization.phone;
|
|
6
|
+
if ("individual" in e) return e.individual.phone;
|
|
7
|
+
}
|
|
8
|
+
}, r = (t, n) => n ? e(t)[n] ?? n : "";
|
|
7
9
|
//#endregion
|
|
8
|
-
export { r as
|
|
10
|
+
export { n as getCounterpartPhone, r as getCountryName, t as getMeasureUnitName };
|