@alphakits/ui 2.6.1 → 2.6.3
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/amount-input/component.d.ts +1 -1
- package/dist/theme-provider/component.js +44 -33
- package/dist/utils/data/currency-codes.d.ts +7 -0
- package/dist/utils/data/currency-codes.js +13 -117
- package/dist/utils/date/index.js +27 -25
- package/dist/utils/format-amount/util.js +23 -23
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ export type AmountInputProps = Omit<InputProps, 'value' | 'onChange' | 'type'> &
|
|
|
19
19
|
export declare const AmountInput: React.ForwardRefExoticComponent<Omit<InputProps, "onChange" | "value" | "type"> & {
|
|
20
20
|
value?: number | undefined | null;
|
|
21
21
|
type?: AmountValueType | undefined;
|
|
22
|
-
suffix?: "CHF" | "EUR" | "RUR" | "RUB" | "USD" | "GBP" | "SEK" | "DKK" | "NOK" | "CZK" | "PLN" | "HUF" | "RSD" | "BGN" | "HRK" | "RON" | "MKD" | "BAM" | "ALL" | "ISK" | "UAH" | "BYN" | "MDL" | "GEL" | "TRY" | "CAD" | "AUD" | "ILS" | undefined;
|
|
22
|
+
suffix?: "CHF" | "EUR" | "RUR" | "RUB" | "USD" | "GBP" | "SEK" | "DKK" | "NOK" | "CZK" | "PLN" | "HUF" | "RSD" | "BGN" | "HRK" | "RON" | "MKD" | "BAM" | "ALL" | "ISK" | "UAH" | "BYN" | "MDL" | "GEL" | "TRY" | "CAD" | "AUD" | "ILS" | "NZD" | "ARS" | "BRL" | "TWD" | "MXN" | "JPY" | "SGD" | undefined;
|
|
23
23
|
required?: boolean | undefined;
|
|
24
24
|
integerLength?: number | undefined;
|
|
25
25
|
minority?: number | undefined;
|
|
@@ -1,45 +1,56 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
import { jsx as A } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as C, useState as g, useCallback as u, useEffect as k, useContext as w } from "react";
|
|
3
|
+
var x = /* @__PURE__ */ ((e) => (e.DARK = "dark", e.LIGHT = "light", e))(x || {});
|
|
4
|
+
const E = C({
|
|
5
5
|
setTheme: () => {
|
|
6
6
|
},
|
|
7
7
|
currentTheme: void 0
|
|
8
|
-
}),
|
|
9
|
-
|
|
8
|
+
}), v = "theme", i = "theme-styles", _ = "data-theme", b = () => {
|
|
9
|
+
try {
|
|
10
|
+
return window.localStorage?.getItem(v) || void 0;
|
|
11
|
+
} catch {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
}, S = (e) => {
|
|
15
|
+
try {
|
|
16
|
+
window.localStorage?.setItem(v, e);
|
|
17
|
+
} catch {
|
|
18
|
+
}
|
|
19
|
+
}, j = ({
|
|
20
|
+
children: e,
|
|
10
21
|
themes: c,
|
|
11
|
-
selectedTheme:
|
|
22
|
+
selectedTheme: s
|
|
12
23
|
}) => {
|
|
13
|
-
const [
|
|
14
|
-
document?.documentElement.setAttribute(
|
|
15
|
-
}, []),
|
|
16
|
-
let o = document.getElementById(
|
|
17
|
-
o || (o = document.createElement("style"), o.id =
|
|
18
|
-
|
|
19
|
-
const h =
|
|
20
|
-
Object.keys(h).forEach((
|
|
21
|
-
const
|
|
22
|
-
Object.keys(
|
|
23
|
-
|
|
24
|
+
const [f, y] = g(), n = u((t) => {
|
|
25
|
+
document?.documentElement.setAttribute(_, t), S(t), y(t);
|
|
26
|
+
}, []), a = u((t) => {
|
|
27
|
+
let o = document.getElementById(i), r = "";
|
|
28
|
+
o || (o = document.createElement("style"), o.id = i, document.head.appendChild(o)), Object.keys(t).forEach((m) => {
|
|
29
|
+
r += `html[data-theme='${m}'] {`;
|
|
30
|
+
const h = t[m];
|
|
31
|
+
Object.keys(h).forEach((d) => {
|
|
32
|
+
const T = h[d];
|
|
33
|
+
Object.keys(T).forEach((l) => {
|
|
34
|
+
r += `--color-${d}-${l}: ${T[l]};
|
|
24
35
|
`;
|
|
25
36
|
});
|
|
26
|
-
}),
|
|
27
|
-
`, o.textContent =
|
|
37
|
+
}), r += `}
|
|
38
|
+
`, o.textContent = r;
|
|
28
39
|
});
|
|
29
40
|
}, []);
|
|
30
|
-
return
|
|
31
|
-
const
|
|
32
|
-
n(
|
|
33
|
-
}, [c,
|
|
34
|
-
},
|
|
35
|
-
const { setTheme:
|
|
36
|
-
return { setTheme:
|
|
41
|
+
return k(() => {
|
|
42
|
+
const t = b(), o = window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
43
|
+
n(s || t || o), a(c);
|
|
44
|
+
}, [c, s, n, a]), /* @__PURE__ */ A(E.Provider, { value: { setTheme: n, currentTheme: f }, children: e });
|
|
45
|
+
}, p = () => {
|
|
46
|
+
const { setTheme: e, currentTheme: c } = w(E);
|
|
47
|
+
return { setTheme: e, currentTheme: c };
|
|
37
48
|
};
|
|
38
49
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
v as LOACAL_STORAGE_THEME_KEY,
|
|
51
|
+
i as STYLE_TAG_ID,
|
|
52
|
+
x as THEME,
|
|
53
|
+
_ as THEME_DATA_ATTR,
|
|
54
|
+
j as ThemeProvider,
|
|
55
|
+
p as useTheme
|
|
45
56
|
};
|
|
@@ -27,6 +27,13 @@ declare const CURRENCY_SYMBOLS: {
|
|
|
27
27
|
CAD: string;
|
|
28
28
|
AUD: string;
|
|
29
29
|
ILS: string;
|
|
30
|
+
NZD: string;
|
|
31
|
+
ARS: string;
|
|
32
|
+
BRL: string;
|
|
33
|
+
TWD: string;
|
|
34
|
+
MXN: string;
|
|
35
|
+
JPY: string;
|
|
36
|
+
SGD: string;
|
|
30
37
|
};
|
|
31
38
|
export type CurrencyCodes = keyof typeof CURRENCY_SYMBOLS;
|
|
32
39
|
export declare const currency: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const R = {
|
|
2
2
|
EUR: "€",
|
|
3
3
|
RUR: "руб.",
|
|
4
4
|
RUB: "руб.",
|
|
@@ -47,122 +47,18 @@ const K = {
|
|
|
47
47
|
// Турецкая лира
|
|
48
48
|
CAD: "C$",
|
|
49
49
|
AUD: "$",
|
|
50
|
-
ILS: "₪"
|
|
51
|
-
//
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
// BOB: '\u0024\u0062',
|
|
62
|
-
// BAM: '\u004b\u004d',
|
|
63
|
-
// BWP: '\u0050',
|
|
64
|
-
// BGN: '\u043b\u0432',
|
|
65
|
-
// BRL: '\u0052\u0024',
|
|
66
|
-
// BND: '\u0024',
|
|
67
|
-
// KHR: '\u17db',
|
|
68
|
-
// KYD: '\u0024',
|
|
69
|
-
// CLP: '\u0024',
|
|
70
|
-
// CNY: '\u00a5',
|
|
71
|
-
// COP: '\u0024',
|
|
72
|
-
// CRC: '\u20a1',
|
|
73
|
-
// HRK: '\u006b\u006e',
|
|
74
|
-
// CUP: '\u20b1',
|
|
75
|
-
// CZK: '\u004b\u010d',
|
|
76
|
-
// DKK: '\u006b\u0072',
|
|
77
|
-
// DOP: '\u0052\u0044\u0024',
|
|
78
|
-
// XCD: '\u0024',
|
|
79
|
-
// EGP: '\u00a3',
|
|
80
|
-
// SVC: '\u0024',
|
|
81
|
-
// EEK: '\u006b\u0072',
|
|
82
|
-
// EUR: '\u20ac',
|
|
83
|
-
// FKP: '\u00a3',
|
|
84
|
-
// FJD: '\u0024',
|
|
85
|
-
// FRF: '\u20a3',
|
|
86
|
-
// GHC: '\u00a2',
|
|
87
|
-
// GIP: '\u00a3',
|
|
88
|
-
// GTQ: '\u0051',
|
|
89
|
-
// GGP: '\u00a3',
|
|
90
|
-
// GYD: '\u0024',
|
|
91
|
-
// HNL: '\u004c',
|
|
92
|
-
// HKD: '\u0024',
|
|
93
|
-
// HUF: '\u0046\u0074',
|
|
94
|
-
// ISK: '\u006b\u0072',
|
|
95
|
-
// INR: '\u20a8',
|
|
96
|
-
// IDR: '\u0052\u0070',
|
|
97
|
-
// IRR: '\ufdfc',
|
|
98
|
-
// IMP: '\u00a3',
|
|
99
|
-
// ILS: '\u20aa',
|
|
100
|
-
// JMD: '\u004a\u0024',
|
|
101
|
-
// JPY: '\u00a5',
|
|
102
|
-
// JEP: '\u00a3',
|
|
103
|
-
// KZT: '\u20B8',
|
|
104
|
-
// KGS: '\u004B\u0047\u0053',
|
|
105
|
-
// LAK: '\u20ad',
|
|
106
|
-
// LVL: '\u004c\u0073',
|
|
107
|
-
// LBP: '\u00a3',
|
|
108
|
-
// LRD: '\u0024',
|
|
109
|
-
// LTL: '\u004c\u0074',
|
|
110
|
-
// MKD: '\u0434\u0435\u043d',
|
|
111
|
-
// MYR: '\u0052\u004d',
|
|
112
|
-
// MUR: '\u20a8',
|
|
113
|
-
// MXN: '\u0024',
|
|
114
|
-
// MNT: '\u20ae',
|
|
115
|
-
// MZN: '\u004d\u0054',
|
|
116
|
-
// NAD: '\u0024',
|
|
117
|
-
// NPR: '\u20a8',
|
|
118
|
-
// ANG: '\u0192',
|
|
119
|
-
// NZD: '\u0024',
|
|
120
|
-
// NIO: '\u0043\u0024',
|
|
121
|
-
// NGN: '\u20a6',
|
|
122
|
-
// KPW: '\u20a9',
|
|
123
|
-
// NOK: '\u006b\u0072',
|
|
124
|
-
// OMR: '\ufdfc',
|
|
125
|
-
// PKR: '\u20a8',
|
|
126
|
-
// PAB: '\u0042\u002f\u002e',
|
|
127
|
-
// PYG: '\u0047\u0073',
|
|
128
|
-
// PEN: '\u0053\u002f\u002e',
|
|
129
|
-
// PHP: '\u20b1',
|
|
130
|
-
// PLN: '\u007a\u0142',
|
|
131
|
-
// QAR: '\ufdfc',
|
|
132
|
-
// RON: '\u006c\u0065\u0069',
|
|
133
|
-
// RUR: '\u20bd',
|
|
134
|
-
// SHP: '\u00a3',
|
|
135
|
-
// SAR: '\ufdfc',
|
|
136
|
-
// RSD: '\u0414\u0438\u043d\u002e',
|
|
137
|
-
// SCR: '\u20a8',
|
|
138
|
-
// SGD: '\u0024',
|
|
139
|
-
// SBD: '\u0024',
|
|
140
|
-
// SOS: '\u0053',
|
|
141
|
-
// ZAR: '\u0052',
|
|
142
|
-
// KRW: '\u20a9',
|
|
143
|
-
// LKR: '\u20a8',
|
|
144
|
-
// SEK: '\u006b\u0072',
|
|
145
|
-
// CHF: '\u20a3',
|
|
146
|
-
// SRD: '\u0024',
|
|
147
|
-
// SYP: '\u00a3',
|
|
148
|
-
// TWD: '\u004e\u0054\u0024',
|
|
149
|
-
// THB: '\u0e3f',
|
|
150
|
-
// TTD: '\u0054\u0054\u0024',
|
|
151
|
-
// TRY: '\u20ba',
|
|
152
|
-
// TRL: '\u20ba',
|
|
153
|
-
// TVD: '\u0024',
|
|
154
|
-
// UAH: '\u20b4',
|
|
155
|
-
// GBP: '\u00a3',
|
|
156
|
-
// USD: '\u0024',
|
|
157
|
-
// UYU: '\u0024\u0055',
|
|
158
|
-
// UZS: '\u043b\u0432',
|
|
159
|
-
// VEF: '\u0042\u0073',
|
|
160
|
-
// VND: '\u20ab',
|
|
161
|
-
// YER: '\ufdfc',
|
|
162
|
-
// ZWD: '\u005a\u0024',
|
|
163
|
-
}, R = {
|
|
164
|
-
CURRENCY_SYMBOLS: K
|
|
50
|
+
ILS: "₪",
|
|
51
|
+
// Markets we may enable later (countries currently bill in EUR)
|
|
52
|
+
NZD: "$",
|
|
53
|
+
ARS: "$",
|
|
54
|
+
BRL: "R$",
|
|
55
|
+
TWD: "NT$",
|
|
56
|
+
MXN: "$",
|
|
57
|
+
JPY: "¥",
|
|
58
|
+
SGD: "$"
|
|
59
|
+
}, D = {
|
|
60
|
+
CURRENCY_SYMBOLS: R
|
|
165
61
|
};
|
|
166
62
|
export {
|
|
167
|
-
|
|
63
|
+
D as currency
|
|
168
64
|
};
|
package/dist/utils/date/index.js
CHANGED
|
@@ -11,7 +11,7 @@ function L(t) {
|
|
|
11
11
|
const e = new Date(t);
|
|
12
12
|
return new Date(e.getFullYear(), 11, 31, 23, 59, 59, 999);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function T(t) {
|
|
15
15
|
const e = new Date(t);
|
|
16
16
|
return new Date(e.getFullYear(), e.getMonth() + 1, 0, 0, 0, 0, 0);
|
|
17
17
|
}
|
|
@@ -23,12 +23,12 @@ function M(t) {
|
|
|
23
23
|
const e = new Date(t);
|
|
24
24
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate(), 23, 59, 59, 999);
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function O(t) {
|
|
27
27
|
const e = new Date(t.getFullYear(), t.getMonth(), t.getDate()), n = e.getDay(), r = n === 0 ? -6 : 1 - n;
|
|
28
28
|
return e.setDate(e.getDate() + r), new Date(e.getFullYear(), e.getMonth(), e.getDate(), 0, 0, 0, 0);
|
|
29
29
|
}
|
|
30
30
|
function W(t) {
|
|
31
|
-
return M(i(
|
|
31
|
+
return M(i(O(t), 6));
|
|
32
32
|
}
|
|
33
33
|
function N(t, e) {
|
|
34
34
|
const n = e?.weekStartsOn ?? 0, r = new Date(t.getFullYear(), t.getMonth(), t.getDate()), o = (r.getDay() - n + 7) % 7;
|
|
@@ -75,7 +75,7 @@ function _(t, e) {
|
|
|
75
75
|
function q(t, e) {
|
|
76
76
|
return i(t, -7 * e);
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function C(t) {
|
|
79
79
|
let e = D(t.start);
|
|
80
80
|
const n = D(t.end);
|
|
81
81
|
if (e > n) return [];
|
|
@@ -84,7 +84,7 @@ function G(t) {
|
|
|
84
84
|
r.push(new Date(e)), e = i(e, 1);
|
|
85
85
|
return r;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function G(t) {
|
|
88
88
|
let e = m(t.start);
|
|
89
89
|
const n = m(t.end);
|
|
90
90
|
if (e > n) return [];
|
|
@@ -93,7 +93,7 @@ function R(t) {
|
|
|
93
93
|
r.push(new Date(e)), e = f(e, 1);
|
|
94
94
|
return r;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function R(t) {
|
|
97
97
|
const e = l(t.start).getFullYear(), n = l(t.end).getFullYear(), r = Math.min(e, n), a = Math.max(e, n), o = [];
|
|
98
98
|
for (let s = r; s <= a; s += 1)
|
|
99
99
|
o.push(new Date(s, 0, 1));
|
|
@@ -108,13 +108,13 @@ function S(t, e) {
|
|
|
108
108
|
function k(t, e) {
|
|
109
109
|
return t.getFullYear() === e.getFullYear();
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function $(t, e) {
|
|
112
112
|
return t.getTime() < e.getTime();
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function j(t, e) {
|
|
115
115
|
return t.getTime() > e.getTime();
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function z(t) {
|
|
118
118
|
return new Date(Math.max(...t.map((e) => new Date(e).getTime())));
|
|
119
119
|
}
|
|
120
120
|
function J(t) {
|
|
@@ -124,7 +124,7 @@ function K(t, e) {
|
|
|
124
124
|
return new Date(t).getTime() === new Date(e).getTime();
|
|
125
125
|
}
|
|
126
126
|
function Q(t) {
|
|
127
|
-
return t.getDate() ===
|
|
127
|
+
return t.getDate() === T(t).getDate();
|
|
128
128
|
}
|
|
129
129
|
function U(t, e) {
|
|
130
130
|
const n = t.getTime();
|
|
@@ -143,11 +143,13 @@ function v(t) {
|
|
|
143
143
|
return new Date(t);
|
|
144
144
|
}
|
|
145
145
|
function tt(t) {
|
|
146
|
-
const e = new Date(2021, 5, 7, 12, 0, 0, 0);
|
|
147
|
-
return Array.from(
|
|
148
|
-
{
|
|
149
|
-
|
|
150
|
-
|
|
146
|
+
const e = new Date(2021, 5, 7, 12, 0, 0, 0), n = t.toLowerCase().startsWith("pt");
|
|
147
|
+
return Array.from({ length: 7 }, (r, a) => {
|
|
148
|
+
const o = new Intl.DateTimeFormat(t, { weekday: "short" }).format(
|
|
149
|
+
i(e, a)
|
|
150
|
+
);
|
|
151
|
+
return n ? o.replace(/[^\p{L}]/gu, "").slice(0, 3) : o;
|
|
152
|
+
});
|
|
151
153
|
}
|
|
152
154
|
function y(t, e, n) {
|
|
153
155
|
return new Intl.DateTimeFormat(e, { day: "numeric", month: n }).formatToParts(
|
|
@@ -171,8 +173,8 @@ function et(t, e, n) {
|
|
|
171
173
|
[/yy/g, () => c(a % 100)]
|
|
172
174
|
];
|
|
173
175
|
let g = e;
|
|
174
|
-
return d.forEach(([F,
|
|
175
|
-
g = g.replace(F,
|
|
176
|
+
return d.forEach(([F, p]) => {
|
|
177
|
+
g = g.replace(F, p);
|
|
176
178
|
}), g;
|
|
177
179
|
}
|
|
178
180
|
function I(t, e) {
|
|
@@ -206,16 +208,16 @@ export {
|
|
|
206
208
|
i as addDays,
|
|
207
209
|
f as addMonths,
|
|
208
210
|
w as addYears,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
211
|
+
C as eachDayOfInterval,
|
|
212
|
+
G as eachMonthOfInterval,
|
|
213
|
+
R as eachYearOfInterval,
|
|
212
214
|
M as endOfDay,
|
|
213
215
|
W as endOfISOWeek,
|
|
214
216
|
P as endOfWeek,
|
|
215
217
|
L as endOfYear,
|
|
216
218
|
et as format,
|
|
217
|
-
|
|
218
|
-
|
|
219
|
+
j as isAfter,
|
|
220
|
+
$ as isBefore,
|
|
219
221
|
K as isEqual,
|
|
220
222
|
Q as isLastDayOfMonth,
|
|
221
223
|
x as isSameDay,
|
|
@@ -225,13 +227,13 @@ export {
|
|
|
225
227
|
Z as isThisYear,
|
|
226
228
|
V as isToday,
|
|
227
229
|
U as isWithinInterval,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
+
T as lastDayOfMonth,
|
|
231
|
+
z as max,
|
|
230
232
|
J as min,
|
|
231
233
|
H as parse,
|
|
232
234
|
v as parseISO,
|
|
233
235
|
D as startOfDay,
|
|
234
|
-
|
|
236
|
+
O as startOfISOWeek,
|
|
235
237
|
m as startOfMonth,
|
|
236
238
|
N as startOfWeek,
|
|
237
239
|
l as startOfYear,
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { currency as
|
|
1
|
+
import { currency as R } from "../data/currency-codes.js";
|
|
2
2
|
import { getCurrencySymbol as _ } from "../get-currency-symbol/util.js";
|
|
3
3
|
import { splitAmount as C } from "../split-amount/util.js";
|
|
4
|
-
const O = 3,
|
|
5
|
-
const
|
|
6
|
-
return !
|
|
7
|
-
},
|
|
4
|
+
const O = 3, S = 4, T = "−", a = " ", e = ",", l = (t) => t === "USD" || t === "CHF" || t === "GBP" || t === "CAD" || t === "AUD" || t === "NZD" || t === "ARS" || t === "BRL" || t === "TWD" || t === "MXN" || t === "JPY" || t === "SGD" || t === "TRY" || t === "GEL" || t === "ILS" || t === "UAH", N = (t, o, i) => o ? t ? l(i) ? `${o}${a}${t}` : `${t}${a}${o}` : "" : t, U = (t) => t ? t.length > 2 ? t.slice(0, 2) : t.length < 2 ? `${t}0` : t : "00", h = (t, o, i) => {
|
|
5
|
+
const r = U(t);
|
|
6
|
+
return !i && r === "00" ? null : !i && r[1] === "0" ? r.slice(0, 1) : r === "00" && !o ? null : r;
|
|
7
|
+
}, $ = ({
|
|
8
8
|
value: t,
|
|
9
|
-
currency:
|
|
10
|
-
showMinorPart:
|
|
11
|
-
type:
|
|
9
|
+
currency: o,
|
|
10
|
+
showMinorPart: i,
|
|
11
|
+
type: r
|
|
12
12
|
}) => {
|
|
13
|
-
const
|
|
13
|
+
const m = !!o && !!R.CURRENCY_SYMBOLS[o], n = m ? _(o) : o;
|
|
14
14
|
if (t === null)
|
|
15
15
|
return {
|
|
16
16
|
majorPart: "",
|
|
17
17
|
minorPart: "",
|
|
18
18
|
formatted: "",
|
|
19
|
-
currencySymbol:
|
|
19
|
+
currencySymbol: n,
|
|
20
20
|
formattedWithCurrency: ""
|
|
21
21
|
};
|
|
22
|
-
const [
|
|
23
|
-
`${Math.abs(+
|
|
22
|
+
const [M, s] = r === "default" ? `${t}`.split(".") : [`${t}`.slice(0, -2), `${t}`.slice(-2)], A = C(
|
|
23
|
+
`${Math.abs(+M || 0)}`,
|
|
24
24
|
O,
|
|
25
25
|
a,
|
|
26
|
-
|
|
27
|
-
), f = t < 0 ? T +
|
|
26
|
+
S
|
|
27
|
+
), f = t < 0 ? T + A : A, P = s ? f + e + s : f;
|
|
28
28
|
return {
|
|
29
29
|
majorPart: f,
|
|
30
|
-
minorPart: h(s,
|
|
31
|
-
currencySymbol:
|
|
32
|
-
formatted:
|
|
30
|
+
minorPart: h(s, i, m),
|
|
31
|
+
currencySymbol: n,
|
|
32
|
+
formatted: P,
|
|
33
33
|
formattedWithCurrency: N(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
P,
|
|
35
|
+
n || "",
|
|
36
|
+
o
|
|
37
37
|
)
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
export {
|
|
41
|
-
|
|
41
|
+
e as AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR,
|
|
42
42
|
a as THINSP,
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
$ as formatAmount,
|
|
44
|
+
l as isCurrencyFirst
|
|
45
45
|
};
|