@alphakits/ui 2.5.5 → 2.5.8
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/component.js +39 -39
- package/dist/amount-input/component.js +124 -101
- package/dist/amount-input/index.css +1 -1
- package/dist/amount-input/index.module.css.js +12 -8
- package/dist/amount-input/utils/index.d.ts +5 -0
- package/dist/amount-input/utils/index.js +40 -12
- package/dist/calendar/components/days-table/index.css +1 -1
- package/dist/calendar/components/header/index.css +1 -1
- package/dist/calendar/components/months-table/index.css +1 -1
- package/dist/calendar/components/select-button/index.css +1 -1
- package/dist/calendar/components/years-table/index.css +1 -1
- package/dist/calendar/index.css +1 -1
- package/dist/calendar-input/index.css +1 -1
- package/dist/form/templates/base-form/index.js +8 -8
- package/dist/form/templates/filters-form/index.js +13 -13
- package/dist/form/templates/rest-form/form.js +28 -28
- package/dist/form/templates/rest-form/index.js +12 -12
- package/dist/form-control/component.d.ts +8 -0
- package/dist/form-control/component.js +49 -28
- package/dist/index.js +43 -42
- package/dist/input/component.d.ts +4 -0
- package/dist/input/component.js +159 -105
- package/dist/input/index.css +1 -1
- package/dist/input/index.module.css.js +16 -8
- package/dist/input/utils/get-default-input-mode.d.ts +3 -0
- package/dist/input/utils/get-default-input-mode.js +14 -0
- package/dist/input-autocomplete/component.d.ts +4 -0
- package/dist/masked-input/component.d.ts +2 -0
- package/dist/modal/components/modals/modal.js +59 -51
- package/dist/select/component.d.ts +4 -0
- package/dist/select/components/arrow/index.css +1 -1
- package/dist/select/components/checkmark/index.css +1 -1
- package/dist/select/components/field/index.css +1 -1
- package/dist/select/components/optgroup/index.css +1 -1
- package/dist/select/components/option/index.css +1 -1
- package/dist/select/components/options-list/index.css +1 -1
- package/dist/select/components/virtual-options-list/index.css +1 -1
- package/dist/toast-notifier/component.js +51 -49
- package/dist/utils/data/currency-codes.js +2 -2
- package/dist/utils/format-amount/util.d.ts +1 -0
- package/dist/utils/format-amount/util.js +31 -26
- package/dist/utils/index.js +33 -32
- package/dist/with-suffix/component.d.ts +2 -0
- package/package.json +3 -2
|
@@ -1,40 +1,45 @@
|
|
|
1
|
-
import { currency as
|
|
2
|
-
import { getCurrencySymbol as
|
|
3
|
-
import { splitAmount as
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
return !n &&
|
|
7
|
-
},
|
|
1
|
+
import { currency as M } from "../data/currency-codes.js";
|
|
2
|
+
import { getCurrencySymbol as _ } from "../get-currency-symbol/util.js";
|
|
3
|
+
import { splitAmount as C } from "../split-amount/util.js";
|
|
4
|
+
const O = 3, R = 4, T = "−", a = " ", l = ",", S = (t) => t === "EUR" || t === "USD" || t === "CHF" || t === "GBP" || t === "CAD" || t === "AUD" || t === "TRY" || t === "GEL" || t === "ILS" || t === "UAH", U = (t, r, n) => r ? t ? S(n) ? `${r}${a}${t}` : `${t}${a}${r}` : "" : t, E = (t) => t ? t.length > 2 ? t.slice(0, 2) : t.length < 2 ? `${t}0` : t : "00", N = (t, r, n) => {
|
|
5
|
+
const o = E(t);
|
|
6
|
+
return !n && o === "00" ? null : !n && o[1] === "0" ? o.slice(0, 1) : o === "00" && !r ? null : o;
|
|
7
|
+
}, d = ({
|
|
8
8
|
value: t,
|
|
9
|
-
currency:
|
|
9
|
+
currency: r,
|
|
10
10
|
showMinorPart: n,
|
|
11
|
-
type:
|
|
11
|
+
type: o
|
|
12
12
|
}) => {
|
|
13
|
-
const
|
|
13
|
+
const e = !!r && !!M.CURRENCY_SYMBOLS[r], i = e ? _(r) : r;
|
|
14
14
|
if (t === null)
|
|
15
15
|
return {
|
|
16
16
|
majorPart: "",
|
|
17
17
|
minorPart: "",
|
|
18
18
|
formatted: "",
|
|
19
|
-
currencySymbol:
|
|
20
|
-
formattedWithCurrency:
|
|
19
|
+
currencySymbol: i,
|
|
20
|
+
formattedWithCurrency: ""
|
|
21
21
|
};
|
|
22
|
-
const [
|
|
23
|
-
`${Math.abs(+
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
),
|
|
22
|
+
const [P, s] = o === "default" ? `${t}`.split(".") : [`${t}`.slice(0, -2), `${t}`.slice(-2)], m = C(
|
|
23
|
+
`${Math.abs(+P || 0)}`,
|
|
24
|
+
O,
|
|
25
|
+
a,
|
|
26
|
+
R
|
|
27
|
+
), f = t < 0 ? T + m : m, A = s ? f + l + s : f;
|
|
28
28
|
return {
|
|
29
|
-
majorPart:
|
|
30
|
-
minorPart:
|
|
31
|
-
currencySymbol:
|
|
32
|
-
formatted:
|
|
33
|
-
formattedWithCurrency:
|
|
29
|
+
majorPart: f,
|
|
30
|
+
minorPart: N(s, n, e),
|
|
31
|
+
currencySymbol: i,
|
|
32
|
+
formatted: A,
|
|
33
|
+
formattedWithCurrency: U(
|
|
34
|
+
A,
|
|
35
|
+
i || "",
|
|
36
|
+
r
|
|
37
|
+
)
|
|
34
38
|
};
|
|
35
39
|
};
|
|
36
40
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
l as AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR,
|
|
42
|
+
a as THINSP,
|
|
43
|
+
d as formatAmount,
|
|
44
|
+
S as isCurrencyFirst
|
|
40
45
|
};
|
package/dist/utils/index.js
CHANGED
|
@@ -1,60 +1,61 @@
|
|
|
1
|
-
import { add as
|
|
2
|
-
import { debounce as
|
|
3
|
-
import { AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR as
|
|
4
|
-
import { formatDate as
|
|
5
|
-
import { safeStringify as
|
|
6
|
-
import { showCompactSuccess as
|
|
7
|
-
import { splitAmount as
|
|
8
|
-
import { capitalize as
|
|
1
|
+
import { add as r, addDays as s, addMonths as t, addYears as o, eachDayOfInterval as f, eachMonthOfInterval as i, eachYearOfInterval as n, endOfDay as O, endOfISOWeek as m, endOfWeek as h, endOfYear as d, format as p, isAfter as S, isBefore as c, isEqual as y, isLastDayOfMonth as u, isSameDay as M, isSameMonth as l, isSameYear as D, isThisMonth as x, isThisYear as I, isToday as A, isWithinInterval as T, lastDayOfMonth as Y, max as k, min as W, parse as b, parseISO as R, startOfDay as v, startOfISOWeek as w, startOfMonth as _, startOfWeek as E, startOfYear as N, subDays as P, subMonths as C, subWeeks as g, subYears as q, weekDaysShort as z } from "./date/index.js";
|
|
2
|
+
import { debounce as F } from "./debounce.js";
|
|
3
|
+
import { AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR as J, THINSP as L, formatAmount as U, isCurrencyFirst as j } from "./format-amount/util.js";
|
|
4
|
+
import { formatDate as K, locales as Q } from "./format-date/index.js";
|
|
5
|
+
import { safeStringify as X } from "./safe-stringify.js";
|
|
6
|
+
import { showCompactSuccess as $, showError as ee, showSuccess as ae } from "./show-toast/index.js";
|
|
7
|
+
import { splitAmount as se } from "./split-amount/util.js";
|
|
8
|
+
import { capitalize as oe } from "./string.js";
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
J as AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR,
|
|
11
|
+
L as THINSP,
|
|
12
|
+
r as add,
|
|
13
|
+
s as addDays,
|
|
14
|
+
t as addMonths,
|
|
15
15
|
o as addYears,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
oe as capitalize,
|
|
17
|
+
F as debounce,
|
|
18
18
|
f as eachDayOfInterval,
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
i as eachMonthOfInterval,
|
|
20
|
+
n as eachYearOfInterval,
|
|
21
21
|
O as endOfDay,
|
|
22
22
|
m as endOfISOWeek,
|
|
23
23
|
h as endOfWeek,
|
|
24
24
|
d as endOfYear,
|
|
25
25
|
p as format,
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
U as formatAmount,
|
|
27
|
+
K as formatDate,
|
|
28
28
|
S as isAfter,
|
|
29
29
|
c as isBefore,
|
|
30
|
+
j as isCurrencyFirst,
|
|
30
31
|
y as isEqual,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
u as isLastDayOfMonth,
|
|
33
|
+
M as isSameDay,
|
|
34
|
+
l as isSameMonth,
|
|
34
35
|
D as isSameYear,
|
|
35
36
|
x as isThisMonth,
|
|
36
37
|
I as isThisYear,
|
|
37
38
|
A as isToday,
|
|
38
39
|
T as isWithinInterval,
|
|
39
40
|
Y as lastDayOfMonth,
|
|
40
|
-
|
|
41
|
+
Q as locales,
|
|
41
42
|
k as max,
|
|
42
43
|
W as min,
|
|
43
44
|
b as parse,
|
|
44
45
|
R as parseISO,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
X as safeStringify,
|
|
47
|
+
$ as showCompactSuccess,
|
|
48
|
+
ee as showError,
|
|
49
|
+
ae as showSuccess,
|
|
50
|
+
se as splitAmount,
|
|
50
51
|
v as startOfDay,
|
|
51
52
|
w as startOfISOWeek,
|
|
52
53
|
_ as startOfMonth,
|
|
53
54
|
E as startOfWeek,
|
|
54
55
|
N as startOfYear,
|
|
55
56
|
P as subDays,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
C as subMonths,
|
|
58
|
+
g as subWeeks,
|
|
59
|
+
q as subYears,
|
|
60
|
+
z as weekDaysShort
|
|
60
61
|
};
|
|
@@ -14,8 +14,10 @@ export declare const withSuffix: (Input: FC<InputProps & RefAttributes<HTMLInput
|
|
|
14
14
|
error?: string | boolean | undefined;
|
|
15
15
|
success?: boolean | undefined;
|
|
16
16
|
hint?: string | undefined;
|
|
17
|
+
showCount?: boolean | undefined;
|
|
17
18
|
label?: ReactNode;
|
|
18
19
|
type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
|
|
20
|
+
passwordReveal?: boolean | undefined;
|
|
19
21
|
wrapperRef?: import('react').Ref<HTMLDivElement> | undefined;
|
|
20
22
|
leftAddons?: ReactNode;
|
|
21
23
|
rightAddons?: ReactNode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alphakits/ui",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.8",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -19,8 +19,9 @@
|
|
|
19
19
|
"build:clean": "rm -rf dist",
|
|
20
20
|
"build:index": "node tools/generate-index.cjs",
|
|
21
21
|
"build:js": "vite build",
|
|
22
|
+
"build:icons": "node tools/generate-icon-urls.cjs",
|
|
22
23
|
"build:vars": "node tools/build-vars.cjs",
|
|
23
|
-
"build": "yarn build:clean && yarn build:index && yarn build:js && yarn build:vars",
|
|
24
|
+
"build": "yarn build:clean && yarn build:index && yarn build:icons && yarn build:js && yarn build:vars",
|
|
24
25
|
"test": "echo \"no tests\"",
|
|
25
26
|
"start": "vite",
|
|
26
27
|
"storybook": "storybook dev -p 6006 --no-open",
|