@tesouro/embedded-components-react 0.5.214 → 0.5.216
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.d.ts +144 -3
- package/dist/index.js +14 -13
- package/dist/lib/BankAccountOnboardingWidget.d.ts +56 -2
- package/dist/lib/BankAccountOnboardingWidget.js +4 -3
- package/dist/lib/MarketingWidget.js +1 -1
- package/dist/lib/ReceivablesWidget.d.ts +88 -1
- package/dist/lib/ReceivablesWidget.js +1 -1
- package/dist/lib/WidgetSuite.d.ts +53 -0
- package/dist/libs/shared/util-validation/dist/index5.js +7 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index11.js +72 -72
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index13.js +15 -15
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index14.js +60 -60
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index15.js +12 -12
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index16.js +16 -16
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index21.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +71 -5
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index23.js +95 -33
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index24.js +6 -17
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index25.js +16 -616
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index26.js +669 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +15 -13
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index10.js +52 -37
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index11.js +31 -37
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index12.js +33 -89
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index13.js +39 -12
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index14.js +98 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index15.js +14 -4
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index16.js +2 -185
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index17.js +4 -30
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index18.js +183 -21
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index19.js +26 -66
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index20.js +21 -233
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index21.js +66 -27
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index22.js +233 -26
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index23.js +27 -72
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index24.js +26 -85
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index25.js +74 -8
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index26.js +83 -55
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index27.js +6 -7
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index28.js +37 -42
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index29.js +11 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index30.js +64 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index9.js +7 -33
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +63 -67
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +160 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +6 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index2.js +32 -25
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +25 -200
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js +175 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index8.js +1 -101
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index9.js +92 -71
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +44 -100
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +93 -421
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +442 -112
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +166 -157
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +150 -204
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +202 -31
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +32 -145
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +145 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +44 -58
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +113 -87
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +58 -116
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +83 -357
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +111 -65
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +449 -99
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +68 -281
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +115 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +314 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +34 -23
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +444 -92
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +113 -52
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +18 -14
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +2 -92
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +95 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +3 -24
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +24 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +1 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +3 -18
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +18 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +0 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +0 -8
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +11 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +1 -264
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +258 -42
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +38 -62
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +61 -463
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +457 -89
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +91 -234
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +89 -82
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +22 -338
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +236 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index3.js +26 -204
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +249 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +93 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +344 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +208 -32
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index5.js +29 -202
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +183 -137
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +157 -12
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +10 -19
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +23 -2
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index5.js +16 -19
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index6.js +157 -16
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +40 -40
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/onboardingSuppressionReason.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +167 -156
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +66 -34
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/index.js +2 -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/feature/dist/lib/application/bankAccountApplication.js +26 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index16.js +1 -1
- package/dist/packages/shared-ui-shadcn/dist/index.js +13 -13
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index7.js +0 -161
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js
CHANGED
|
@@ -1,115 +1,59 @@
|
|
|
1
1
|
import { minorExponentForCurrency as e } from "../../../shared/util/dist/lib/amountOutputToMajorUnits.js";
|
|
2
|
-
import {
|
|
3
|
-
import { discountFromDraft as s } from "./index9.js";
|
|
2
|
+
import { escapeRegex as t, getNumberSeparators as n, parseLocaleDecimal as r } from "./index6.js";
|
|
4
3
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return Math.round(o(e.price, t) * a(e.quantity));
|
|
4
|
+
function i(t, n) {
|
|
5
|
+
return t === "percentage" ? 2 : e(n);
|
|
8
6
|
}
|
|
9
|
-
function
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
let e = l(n, t);
|
|
13
|
-
n.taxable ? i += e : a += e;
|
|
14
|
-
}
|
|
15
|
-
return {
|
|
16
|
-
taxableItemsSubtotal: i,
|
|
17
|
-
nonTaxableItemsSubtotal: a,
|
|
18
|
-
subtotal: i + a,
|
|
19
|
-
rateMinorUnits: r
|
|
20
|
-
};
|
|
7
|
+
function a(e, r, a, o = n()) {
|
|
8
|
+
let s = `0-9${t(o.digits.join(""))}${t(o.decimal)}${o.group ? t(o.group) : ""}`, c = e.replace(RegExp(`[^${s}]`, "gu"), ""), l = c.indexOf(o.decimal);
|
|
9
|
+
return l === -1 ? c : c.slice(0, l + o.decimal.length) + Array.from(c.slice(l + o.decimal.length).split(o.decimal).join("")).slice(0, i(r, a)).join("");
|
|
21
10
|
}
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
let n = e.value ?? (e.type === "amount" ? e.amount : Math.round(t * e.amount / 1e4));
|
|
25
|
-
return Math.min(Math.max(n, 0), t);
|
|
11
|
+
function o(e, t, a, o = n()) {
|
|
12
|
+
return Math.round(r(e, o) * 10 ** i(t, a));
|
|
26
13
|
}
|
|
27
|
-
function
|
|
28
|
-
let r =
|
|
29
|
-
return {
|
|
30
|
-
|
|
31
|
-
|
|
14
|
+
function s(e, t, n) {
|
|
15
|
+
let r = i(t, n);
|
|
16
|
+
return new Intl.NumberFormat(void 0, {
|
|
17
|
+
minimumFractionDigits: r,
|
|
18
|
+
maximumFractionDigits: r
|
|
19
|
+
}).format(e / 10 ** r);
|
|
20
|
+
}
|
|
21
|
+
function c(e, t, n) {
|
|
22
|
+
let r = i(t, n), a = {
|
|
23
|
+
minimumFractionDigits: r,
|
|
24
|
+
maximumFractionDigits: r
|
|
32
25
|
};
|
|
33
|
-
|
|
34
|
-
function p({ lineItems: e, currency: t, rateMinorUnits: n, keepSavedRate: i, taxableItemsSubtotal: a, taxableSubtotal: o }) {
|
|
35
|
-
if (a <= 0) return 0;
|
|
36
|
-
let s = /* @__PURE__ */ new Map();
|
|
37
|
-
for (let a of e) {
|
|
38
|
-
if (!a.taxable) continue;
|
|
39
|
-
let e = r(a, n, i);
|
|
40
|
-
s.set(e, (s.get(e) ?? 0) + l(a, t));
|
|
41
|
-
}
|
|
42
|
-
let u = [...s], d = o, f = 0;
|
|
43
|
-
return u.forEach(([e, t], n) => {
|
|
44
|
-
let r = n === u.length - 1 ? d : Math.round(o * t / a);
|
|
45
|
-
d -= r, f += r * e;
|
|
46
|
-
}), Math.round(f / c);
|
|
47
|
-
}
|
|
48
|
-
function m({ lineItems: e, currency: t, taxRate: n, keepSavedRate: r = !1, discount: i }) {
|
|
49
|
-
let a = u({
|
|
50
|
-
lineItems: e,
|
|
51
|
-
currency: t,
|
|
52
|
-
taxRate: n
|
|
53
|
-
}), o = d({
|
|
54
|
-
discount: i,
|
|
55
|
-
subtotal: a.subtotal
|
|
56
|
-
}), { taxableSubtotal: s, nonTaxableSubtotal: c } = f({
|
|
26
|
+
return t === "percentage" ? new Intl.NumberFormat(void 0, {
|
|
57
27
|
...a,
|
|
58
|
-
|
|
59
|
-
})
|
|
60
|
-
lineItems: e,
|
|
61
|
-
currency: t,
|
|
62
|
-
rateMinorUnits: a.rateMinorUnits,
|
|
63
|
-
keepSavedRate: r,
|
|
64
|
-
taxableItemsSubtotal: a.taxableItemsSubtotal,
|
|
65
|
-
taxableSubtotal: s
|
|
66
|
-
}), m = a.subtotal - o;
|
|
67
|
-
return {
|
|
28
|
+
style: "percent"
|
|
29
|
+
}).format(e / 10 ** (r + 2)) : new Intl.NumberFormat(void 0, {
|
|
68
30
|
...a,
|
|
69
|
-
discountAmount: o,
|
|
70
|
-
discountedSubtotal: m,
|
|
71
|
-
taxableSubtotal: s,
|
|
72
|
-
nonTaxableSubtotal: c,
|
|
73
|
-
totalTaxes: l,
|
|
74
|
-
total: m + l
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
function h(e) {
|
|
78
|
-
return m({
|
|
79
|
-
lineItems: e.lineItems.filter((e) => !t(e)),
|
|
80
|
-
currency: e.currency,
|
|
81
|
-
taxRate: Number(e.taxRate) || void 0,
|
|
82
|
-
keepSavedRate: n(e.taxRate, e.savedTaxRate),
|
|
83
|
-
discount: s(e)
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
function g(e, t) {
|
|
87
|
-
let n = s(e);
|
|
88
|
-
if (n) return n.type === "percentage" ? n.amount > 1e4 ? t.discountPercentageTooHigh : void 0 : n.amount > h(e).subtotal ? t.discountExceedsSubtotal : void 0;
|
|
89
|
-
}
|
|
90
|
-
function _(e, n) {
|
|
91
|
-
if (e.lineItems.filter((e) => !t(e)).some((t) => o(t.price, e.currency) > 9e15)) return;
|
|
92
|
-
let { subtotal: r, total: a } = h(e), s = i(e.currency);
|
|
93
|
-
if (r > 9e15) return n.invoiceSubtotalTooHigh.replace("{maxAmount}", s);
|
|
94
|
-
if (a > 9e15) return n.invoiceTotalTooHigh.replace("{maxAmount}", s);
|
|
95
|
-
}
|
|
96
|
-
function v(t, n, r) {
|
|
97
|
-
return new Intl.NumberFormat(void 0, {
|
|
98
31
|
style: "currency",
|
|
99
32
|
currency: n,
|
|
100
|
-
currencyDisplay: "narrowSymbol"
|
|
101
|
-
|
|
102
|
-
|
|
33
|
+
currencyDisplay: "narrowSymbol"
|
|
34
|
+
}).format(e / 10 ** r);
|
|
35
|
+
}
|
|
36
|
+
function l({ value: e, type: t, currency: n }) {
|
|
37
|
+
return s(o(e, t, n), t, n);
|
|
103
38
|
}
|
|
104
|
-
function
|
|
39
|
+
function u(e) {
|
|
105
40
|
return {
|
|
106
|
-
|
|
107
|
-
discount:
|
|
108
|
-
nonTaxableSubtotal: v(e.nonTaxableSubtotal, t),
|
|
109
|
-
taxableSubtotal: v(e.taxableSubtotal, t),
|
|
110
|
-
tax: v(e.totalTaxes, t),
|
|
111
|
-
total: v(e.total, t)
|
|
41
|
+
discountType: "amount",
|
|
42
|
+
discount: s(0, "amount", e)
|
|
112
43
|
};
|
|
113
44
|
}
|
|
45
|
+
function d(e) {
|
|
46
|
+
let t = o(e.discount, e.discountType, e.currency);
|
|
47
|
+
return t > 0 ? {
|
|
48
|
+
type: e.discountType,
|
|
49
|
+
amount: t
|
|
50
|
+
} : null;
|
|
51
|
+
}
|
|
52
|
+
function f(e, t) {
|
|
53
|
+
return e ? {
|
|
54
|
+
discountType: e.type,
|
|
55
|
+
discount: s(e.amount, e.type, t)
|
|
56
|
+
} : u(t);
|
|
57
|
+
}
|
|
114
58
|
//#endregion
|
|
115
|
-
export {
|
|
59
|
+
export { l as convertDiscountInput, u as createEmptyDiscount, c as decorateDiscountInput, d as discountFromDraft, o as discountInputToMinorUnits, f as discountToDraft, s as formatDiscountInput, a as sanitizeDiscountInput };
|