@alphakits/ui 2.3.1 → 2.4.0
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/__internal/utils/index.d.ts +1 -1
- package/dist/__internal/utils/index.js +4 -4
- package/dist/amount-input/component.js +41 -41
- package/dist/avatar/component.js +2 -18
- package/dist/badge/component.d.ts +1 -1
- package/dist/base-card/component.js +1 -7
- package/dist/bottom-sheet/component.d.ts +1 -1
- package/dist/bottom-sheet/component.js +9 -13
- package/dist/box/component.d.ts +2 -2
- package/dist/box/component.js +4 -4
- package/dist/button/component.js +9 -9
- package/dist/button-arrow/component.js +6 -1
- package/dist/calendar/component.d.ts +1 -2
- package/dist/calendar/component.js +77 -74
- package/dist/calendar/components/days-table/component.js +31 -34
- package/dist/calendar/components/header/{/321/201omponent.js → component.js} +3 -12
- package/dist/calendar/components/header/index.d.ts +1 -1
- package/dist/calendar/components/header/index.js +1 -1
- package/dist/calendar/components/months-table/{/321/201omponent.js → component.js} +7 -7
- package/dist/calendar/components/months-table/index.d.ts +1 -1
- package/dist/calendar/components/months-table/index.js +1 -1
- package/dist/calendar/components/select-button/{/321/201omponent.d.ts → component.d.ts} +3 -3
- package/dist/calendar/components/select-button/{/321/201omponent.js → component.js} +5 -11
- package/dist/calendar/components/select-button/index.d.ts +1 -1
- package/dist/calendar/components/select-button/index.js +1 -1
- package/dist/calendar/components/years-table/{/321/201omponent.js → component.js} +14 -14
- package/dist/calendar/components/years-table/index.d.ts +1 -1
- package/dist/calendar/components/years-table/index.js +1 -1
- package/dist/calendar/index.d.ts +2 -2
- package/dist/calendar/index.js +4 -4
- package/dist/calendar/use-calendar.js +51 -47
- package/dist/calendar/utils.js +7 -9
- package/dist/calendar-input/component.js +22 -22
- package/dist/card/component.js +2 -18
- package/dist/cell/base/component.js +31 -31
- package/dist/cell/pure/component.js +2 -2
- package/dist/checkbox/component.js +11 -11
- package/dist/checkbox-group/component.js +23 -24
- package/dist/checkbox-lists/component.d.ts +1 -2
- package/dist/checkbox-lists/component.js +59 -61
- package/dist/collapsable-row/addons.d.ts +3 -4
- package/dist/collapsable-row/addons.js +6 -9
- package/dist/collapsable-row/component.d.ts +1 -1
- package/dist/collapsable-row/component.js +7 -7
- package/dist/collapse/component.js +45 -54
- package/dist/copy-button/component.d.ts +1 -2
- package/dist/copy-button/component.js +1 -5
- package/dist/date/component.js +1 -1
- package/dist/date-switcher/component.d.ts +1 -2
- package/dist/date-switcher/component.js +8 -8
- package/dist/decorated-item/component.js +10 -20
- package/dist/dot/component.js +1 -4
- package/dist/empty-page/component.js +1 -9
- package/dist/filter-tag/component.d.ts +1 -1
- package/dist/flex/component.d.ts +2 -2
- package/dist/footer/component.js +57 -53
- package/dist/form/component.d.ts +1 -2
- package/dist/form/component.js +2 -12
- package/dist/form/templates/base-form/index.d.ts +3 -3
- package/dist/form/templates/base-form/index.js +26 -26
- package/dist/form/templates/filters-form/index.d.ts +1 -1
- package/dist/form/templates/filters-form/index.js +20 -23
- package/dist/form/templates/rest-form/form.d.ts +1 -2
- package/dist/form/templates/rest-form/form.js +51 -56
- package/dist/form/templates/rest-form/index.d.ts +3 -3
- package/dist/form/templates/rest-form/index.js +16 -27
- package/dist/form/utils/get-default-values.js +3 -6
- package/dist/form/utils/remove-undefined-from-object.js +1 -3
- package/dist/form-control/component.js +1 -1
- package/dist/formik/index.d.ts +2 -2
- package/dist/header-search/component.js +1 -6
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +10 -10
- package/dist/hooks/use-get-one/index.js +16 -16
- package/dist/icon-button/component.d.ts +3 -3
- package/dist/icon-button/component.js +2 -8
- package/dist/image/component.js +52 -30
- package/dist/image/image-base.js +1 -7
- package/dist/image/use-image-render-component.d.ts +1 -1
- package/dist/image/use-image-render-component.js +11 -14
- package/dist/image-gallery/component.js +40 -45
- package/dist/image-uploader/component.js +56 -53
- package/dist/index.js +41 -41
- package/dist/info-block-wrapper/component.d.ts +1 -1
- package/dist/input/component.js +1 -1
- package/dist/input-autocomplete/autocomplete-field/index.d.ts +1 -2
- package/dist/input-autocomplete/autocomplete-field/index.js +6 -6
- package/dist/input-autocomplete/component.d.ts +26 -26
- package/dist/input-ghost/component.d.ts +1 -1
- package/dist/link/component.d.ts +2 -2
- package/dist/link/component.js +1 -1
- package/dist/loader/component.js +6 -5
- package/dist/masked-input/component.js +7 -16
- package/dist/menu/component.js +12 -17
- package/dist/menu/components/content-header/index.js +1 -9
- package/dist/menu/components/menu-avatar/index.js +1 -6
- package/dist/menu/components/menu-button/index.js +1 -10
- package/dist/menu/components/menu-buttons-list/index.d.ts +1 -1
- package/dist/menu/components/menu-buttons-list/index.js +1 -7
- package/dist/menu/hooks/use-menu.js +12 -12
- package/dist/message/component.js +33 -14
- package/dist/modal/components/modals/modal.d.ts +1 -2
- package/dist/modal/components/modals/modal.js +30 -33
- package/dist/modal/context.js +12 -9
- package/dist/modal/hooks/use-modal.d.ts +1 -1
- package/dist/mq/component.js +1 -6
- package/dist/notification/component.js +14 -12
- package/dist/page-container/component.js +1 -6
- package/dist/page-loading/component.d.ts +1 -2
- package/dist/page-with-controls/component.js +4 -7
- package/dist/picker-button/common/labeled-button/index.js +18 -12
- package/dist/picker-button/component.js +5 -5
- package/dist/picker-button/field/{Component.d.ts → component.d.ts} +1 -2
- package/dist/picker-button/field/index.d.ts +1 -1
- package/dist/picker-button/field/index.js +1 -1
- package/dist/picker-button/index.d.ts +1 -1
- package/dist/picker-button/index.js +4 -4
- package/dist/popover/component.d.ts +2 -2
- package/dist/popover/component.js +56 -56
- package/dist/radio/component.js +7 -7
- package/dist/radio-groups/component.d.ts +1 -2
- package/dist/radio-groups/component.js +9 -7
- package/dist/select/component.d.ts +8 -9
- package/dist/select/component.js +1 -9
- package/dist/select/components/arrow/component.d.ts +1 -2
- package/dist/select/components/base-select/component.js +97 -90
- package/dist/select/components/checkmark/component.d.ts +1 -2
- package/dist/select/components/field/component.d.ts +1 -2
- package/dist/select/components/field/component.js +8 -5
- package/dist/select/components/native-select/component.js +4 -11
- package/dist/select/components/optgroup/component.d.ts +1 -2
- package/dist/select/components/optgroup/component.js +4 -4
- package/dist/select/components/option/component.js +1 -1
- package/dist/select/components/options-list/component.d.ts +1 -2
- package/dist/select/components/options-list/component.js +25 -23
- package/dist/select/components/select-search/index.d.ts +1 -1
- package/dist/select/components/select-search/index.js +28 -26
- package/dist/select/components/virtual-options-list/component.d.ts +1 -2
- package/dist/select/components/virtual-options-list/component.js +52 -45
- package/dist/select/index.js +4 -4
- package/dist/select/presets/index.d.ts +1 -1
- package/dist/select/presets/index.js +4 -4
- package/dist/select/presets/use-lazy-loading/index.d.ts +3 -4
- package/dist/select/presets/use-lazy-loading/index.js +45 -43
- package/dist/select/presets/use-select-with-loading/hook.d.ts +1 -2
- package/dist/select/presets/use-select-with-loading/hook.js +8 -1
- package/dist/select/utils.js +32 -32
- package/dist/sidepanel/component.js +21 -15
- package/dist/sidepanel-header/component.js +17 -16
- package/dist/skeleton/component.js +4 -4
- package/dist/space/component.d.ts +2 -2
- package/dist/space/component.js +42 -45
- package/dist/space/{Item.d.ts → item.d.ts} +2 -2
- package/dist/spinner/component.js +6 -5
- package/dist/stack/index.d.ts +1 -1
- package/dist/stack/index.js +5 -5
- package/dist/stepped-progress-bar/components/step-bar.js +3 -3
- package/dist/stepped-progress-bar/index.d.ts +2 -2
- package/dist/stepped-progress-bar/index.js +37 -22
- package/dist/sticker/component.js +1 -17
- package/dist/suffix-input/component.js +13 -13
- package/dist/switch/component.js +7 -7
- package/dist/table/components/cells/index.d.ts +1 -2
- package/dist/table/components/empty-list/index.d.ts +1 -2
- package/dist/table/components/error/index.d.ts +2 -3
- package/dist/table/components/error/index.js +1 -1
- package/dist/table/components/loading/index.d.ts +1 -1
- package/dist/table/components/loading/index.js +18 -12
- package/dist/table/components/pagination/index.js +56 -53
- package/dist/table/components/table-header/index.js +59 -56
- package/dist/table/hooks/use-table-data.js +63 -60
- package/dist/table/table.d.ts +1 -1
- package/dist/table/table.js +73 -73
- package/dist/table/types.d.ts +3 -3
- package/dist/table/utils/get-query-from-url.js +1 -8
- package/dist/table/utils/get-tags.d.ts +1 -1
- package/dist/table/utils/get-tags.js +9 -12
- package/dist/table/utils/index.d.ts +1 -1
- package/dist/table/utils/index.js +4 -4
- package/dist/table/utils/parse-query-params.js +5 -1
- package/dist/table/utils/prepare-rows.d.ts +1 -2
- package/dist/table/utils/prepare-rows.js +4 -3
- package/dist/table/utils/query-adapter.d.ts +1 -1
- package/dist/table/utils/query-adapter.js +5 -5
- package/dist/table/utils/remove-query-param.js +3 -1
- package/dist/table/utils/reset-query-param.js +16 -9
- package/dist/table-status/component.js +5 -1
- package/dist/textarea/component.js +36 -28
- package/dist/theme-provider/component.js +33 -29
- package/dist/toast/component.d.ts +7 -8
- package/dist/toast/component.js +6 -6
- package/dist/toast-notifier/component.js +13 -13
- package/dist/toast-notifier/use-timer.d.ts +1 -1
- package/dist/toast-notifier/use-timer.js +5 -5
- package/dist/toast-plate/component.d.ts +3 -3
- package/dist/toast-plate/component.js +7 -7
- package/dist/tooltip/component.js +35 -35
- package/dist/tooltip/node-resolver.js +7 -7
- package/dist/typings/api.d.ts +3 -5
- package/dist/typography/colors.d.ts +1 -1
- package/dist/typography/title/component.d.ts +3 -3
- package/dist/typography/title/index.d.ts +1 -1
- package/dist/typography/title/index.js +3 -3
- package/dist/utils/date/index.js +12 -2
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +14 -14
- package/dist/utils/split-amount/util.js +4 -4
- package/dist/with-suffix/component.d.ts +13 -13
- package/dist/with-suffix/component.js +8 -8
- package/package.json +9 -34
- /package/dist/__internal/utils/{getDataTestId.d.ts → get-data-test-id.d.ts} +0 -0
- /package/dist/__internal/utils/{getDataTestId.js → get-data-test-id.js} +0 -0
- /package/dist/calendar/components/header/{/321/201omponent.d.ts" → component.d.ts} +0 -0
- /package/dist/calendar/components/months-table/{/321/201omponent.d.ts" → component.d.ts} +0 -0
- /package/dist/calendar/components/years-table/{/321/201omponent.d.ts" → component.d.ts} +0 -0
- /package/dist/picker-button/field/{Component.js → component.js} +0 -0
- /package/dist/space/{Item.js → item.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { clearText as r } from "./clear-text.js";
|
|
2
|
+
import { getDataTestId as a } from "./get-data-test-id.js";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
r as clearText,
|
|
5
|
+
a as getDataTestId
|
|
6
6
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsx as F, jsxs as
|
|
1
|
+
import { jsx as F, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import C from "classnames";
|
|
2
3
|
import { forwardRef as T, useState as z, useEffect as D, useCallback as G, Fragment as J } from "react";
|
|
3
|
-
import x from "classnames";
|
|
4
4
|
import { getCurrencySymbol as K } from "../utils/get-currency-symbol/util.js";
|
|
5
5
|
import { Input as M } from "../input/component.js";
|
|
6
|
-
import { formatAmount as
|
|
6
|
+
import { formatAmount as R, THINSP as O } from "../utils/format-amount/util.js";
|
|
7
7
|
import { withSuffix as Q } from "../with-suffix/component.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import a from "./index.module.css.js";
|
|
9
|
+
import { getAmountValueFromStr as v, getFormattedValue as X } from "./utils/index.js";
|
|
10
10
|
const Y = Q(M), lt = T(
|
|
11
11
|
({
|
|
12
|
-
value:
|
|
12
|
+
value: s = null,
|
|
13
13
|
integerLength: E = 9,
|
|
14
14
|
suffix: f = "RUR",
|
|
15
15
|
placeholder: N = "",
|
|
16
16
|
bold: $ = !0,
|
|
17
|
-
type:
|
|
18
|
-
className:
|
|
19
|
-
focusedClassName:
|
|
20
|
-
required:
|
|
17
|
+
type: o = "default",
|
|
18
|
+
className: I,
|
|
19
|
+
focusedClassName: q,
|
|
20
|
+
required: y,
|
|
21
21
|
dataTestId: P,
|
|
22
22
|
clear: b = !1,
|
|
23
23
|
allowNegative: d = !1,
|
|
@@ -25,23 +25,23 @@ const Y = Q(M), lt = T(
|
|
|
25
25
|
onClear: c,
|
|
26
26
|
...j
|
|
27
27
|
}, U) => {
|
|
28
|
-
const u =
|
|
29
|
-
|
|
28
|
+
const u = o === "default" ? s : (s || 0) / 100, [r, m] = z(
|
|
29
|
+
R({
|
|
30
30
|
value: u || 0,
|
|
31
31
|
currency: "RUR",
|
|
32
32
|
type: "default"
|
|
33
33
|
}).formatted
|
|
34
34
|
);
|
|
35
|
-
D(() =>
|
|
36
|
-
|
|
35
|
+
D(() => v(r, o === "default") !== s ? m(
|
|
36
|
+
R({
|
|
37
37
|
value: u,
|
|
38
38
|
currency: "RUR",
|
|
39
39
|
type: "default"
|
|
40
40
|
}).formatted
|
|
41
41
|
) : () => {
|
|
42
|
-
}, [u]);
|
|
43
|
-
const W = (
|
|
44
|
-
const t =
|
|
42
|
+
}, [u, s, o, r]);
|
|
43
|
+
const W = (i) => {
|
|
44
|
+
const t = i.target;
|
|
45
45
|
let n = t.value.replace(/\s/g, "").replace(".", ",");
|
|
46
46
|
const g = n.startsWith("-");
|
|
47
47
|
if (g) {
|
|
@@ -54,9 +54,9 @@ const Y = Q(M), lt = T(
|
|
|
54
54
|
}
|
|
55
55
|
n = n.slice(1);
|
|
56
56
|
}
|
|
57
|
-
if (!RegExp(
|
|
58
|
-
|
|
59
|
-
)
|
|
57
|
+
if (!RegExp(`(^[0-9]{1,${E}}(,([0-9]+)?)?$|^\\s*$)`).test(
|
|
58
|
+
n
|
|
59
|
+
)) {
|
|
60
60
|
const e = t.selectionStart - 1;
|
|
61
61
|
window.requestAnimationFrame(() => {
|
|
62
62
|
t.selectionStart = e, t.selectionEnd = e;
|
|
@@ -64,8 +64,8 @@ const Y = Q(M), lt = T(
|
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
66
|
g && d && (n = `-${n}`);
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
67
|
+
const l = X(n, o === "default");
|
|
68
|
+
if (l === r) {
|
|
69
69
|
const e = t.selectionStart;
|
|
70
70
|
window.requestAnimationFrame(() => {
|
|
71
71
|
t.selectionStart = e, t.selectionEnd = e;
|
|
@@ -74,51 +74,51 @@ const Y = Q(M), lt = T(
|
|
|
74
74
|
const [e, V] = n.replace("-", "").split(/\.|,/);
|
|
75
75
|
let w = e.length;
|
|
76
76
|
V && (w += 1 + V.slice(0, 2).length);
|
|
77
|
-
const L =
|
|
77
|
+
const L = l.length - w, A = t.selectionStart + L;
|
|
78
78
|
window.requestAnimationFrame(() => {
|
|
79
79
|
t.selectionStart = A, t.selectionEnd = A;
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
m(
|
|
83
|
-
const h =
|
|
84
|
-
p && p(
|
|
85
|
-
value:
|
|
82
|
+
m(l);
|
|
83
|
+
const h = l;
|
|
84
|
+
p && p(i, {
|
|
85
|
+
value: v(h.toString(), o === "default"),
|
|
86
86
|
valueString: h.toString()
|
|
87
87
|
});
|
|
88
88
|
}, k = G(
|
|
89
|
-
(
|
|
90
|
-
m(""), c && c(
|
|
89
|
+
(i) => {
|
|
90
|
+
m(""), c && c(i);
|
|
91
91
|
},
|
|
92
92
|
[c]
|
|
93
|
-
), [B, S] =
|
|
93
|
+
), [B, S] = r.replace("-", "").split(","), H = r.startsWith("-");
|
|
94
94
|
return /* @__PURE__ */ F(
|
|
95
95
|
"div",
|
|
96
96
|
{
|
|
97
|
-
className:
|
|
98
|
-
[
|
|
99
|
-
[
|
|
97
|
+
className: C(a.container, {
|
|
98
|
+
[a.bold]: $,
|
|
99
|
+
[a.filled]: !!r
|
|
100
100
|
}),
|
|
101
101
|
children: /* @__PURE__ */ F(
|
|
102
102
|
Y,
|
|
103
103
|
{
|
|
104
104
|
...j,
|
|
105
|
-
suffix: /* @__PURE__ */
|
|
105
|
+
suffix: /* @__PURE__ */ x(J, { children: [
|
|
106
106
|
H && "-",
|
|
107
107
|
B,
|
|
108
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ x("span", { className: a.minorPartAndCurrency, children: [
|
|
109
109
|
S !== void 0 && `,${S}`,
|
|
110
110
|
O,
|
|
111
111
|
K(f) || f
|
|
112
112
|
] })
|
|
113
113
|
] }),
|
|
114
|
-
suffixContainerClassName:
|
|
114
|
+
suffixContainerClassName: a.suffixContainer,
|
|
115
115
|
clear: b,
|
|
116
|
-
required:
|
|
116
|
+
required: y,
|
|
117
117
|
placeholder: N,
|
|
118
|
-
value:
|
|
119
|
-
className:
|
|
120
|
-
focusedClassName:
|
|
121
|
-
inputClassName:
|
|
118
|
+
value: r,
|
|
119
|
+
className: C(a.component, I),
|
|
120
|
+
focusedClassName: q,
|
|
121
|
+
inputClassName: a.input,
|
|
122
122
|
onChange: W,
|
|
123
123
|
onClear: k,
|
|
124
124
|
dataTestId: P,
|
package/dist/avatar/component.js
CHANGED
|
@@ -4,14 +4,7 @@ import i from "classnames";
|
|
|
4
4
|
import { Button as p } from "../button/component.js";
|
|
5
5
|
import { Image as f } from "../image/component.js";
|
|
6
6
|
import r from "./index.module.css.js";
|
|
7
|
-
const N = ({
|
|
8
|
-
src: m,
|
|
9
|
-
text: t,
|
|
10
|
-
slot: o,
|
|
11
|
-
selected: l,
|
|
12
|
-
ref: a,
|
|
13
|
-
onClick: s
|
|
14
|
-
}) => /* @__PURE__ */ c(
|
|
7
|
+
const N = ({ src: m, text: t, slot: o, selected: l, ref: a, onClick: s }) => /* @__PURE__ */ c(
|
|
15
8
|
p,
|
|
16
9
|
{
|
|
17
10
|
ref: a,
|
|
@@ -24,16 +17,7 @@ const N = ({
|
|
|
24
17
|
]),
|
|
25
18
|
view: "ghost",
|
|
26
19
|
children: [
|
|
27
|
-
/* @__PURE__ */ e(
|
|
28
|
-
f,
|
|
29
|
-
{
|
|
30
|
-
view: "circle",
|
|
31
|
-
bgColor: "secondary",
|
|
32
|
-
size: "s",
|
|
33
|
-
src: m,
|
|
34
|
-
text: t
|
|
35
|
-
}
|
|
36
|
-
),
|
|
20
|
+
/* @__PURE__ */ e(f, { view: "circle", bgColor: "secondary", size: "s", src: m, text: t }),
|
|
37
21
|
l && /* @__PURE__ */ e("div", { className: i(r.slot, r.selected), children: /* @__PURE__ */ e(d, {}) }),
|
|
38
22
|
o && /* @__PURE__ */ e("div", { className: r.slot, children: o })
|
|
39
23
|
]
|
|
@@ -9,4 +9,4 @@ export interface BadgeProps {
|
|
|
9
9
|
iconColor?: 'positive' | 'attention' | 'negative' | 'tertiary' | 'secondary' | 'primary';
|
|
10
10
|
dataTestId?: string;
|
|
11
11
|
}
|
|
12
|
-
export declare const Badge: ({ className, size, view, visibleIconOutline, content, iconColor, color, dataTestId, }: BadgeProps) =>
|
|
12
|
+
export declare const Badge: ({ className, size, view, visibleIconOutline, content, iconColor, color, dataTestId, }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -38,13 +38,7 @@ const T = (i) => /* @__PURE__ */ a("a", { ...i, children: i.children }), b = (i)
|
|
|
38
38
|
),
|
|
39
39
|
children: [
|
|
40
40
|
!!m && /* @__PURE__ */ r("div", { className: e.imageWrap, children: [
|
|
41
|
-
/* @__PURE__ */ a(
|
|
42
|
-
y,
|
|
43
|
-
{
|
|
44
|
-
src: m,
|
|
45
|
-
size: "auto"
|
|
46
|
-
}
|
|
47
|
-
),
|
|
41
|
+
/* @__PURE__ */ a(y, { src: m, size: "auto" }),
|
|
48
42
|
!!s && /* @__PURE__ */ a("div", { className: e.topLeftAddons, children: s }),
|
|
49
43
|
!!c && /* @__PURE__ */ a("div", { className: e.topRightAddons, children: c }),
|
|
50
44
|
!t && /* @__PURE__ */ a("div", { className: e.shadow })
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import x from "
|
|
3
|
-
import d from "
|
|
2
|
+
import x from "@alphakits/icons/dist/ChevronBackM";
|
|
3
|
+
import d from "react-swipeable-bottom-sheet";
|
|
4
4
|
import l from "./index.module.css.js";
|
|
5
5
|
const h = ({
|
|
6
6
|
children: r,
|
|
@@ -9,7 +9,7 @@ const h = ({
|
|
|
9
9
|
marginTop: o = 40,
|
|
10
10
|
onBackClick: e
|
|
11
11
|
}) => /* @__PURE__ */ n(
|
|
12
|
-
|
|
12
|
+
d,
|
|
13
13
|
{
|
|
14
14
|
overflowHeight: 0,
|
|
15
15
|
style: { zIndex: 999999, maxWidth: "100%" },
|
|
@@ -18,17 +18,13 @@ const h = ({
|
|
|
18
18
|
topShadow: !1,
|
|
19
19
|
open: i,
|
|
20
20
|
onChange: p,
|
|
21
|
-
bodyStyle: {
|
|
21
|
+
bodyStyle: {
|
|
22
|
+
borderRadius: o ? "21px 21px 0 0 " : "0px",
|
|
23
|
+
padding: "16px 16px",
|
|
24
|
+
boxSizing: "border-box"
|
|
25
|
+
},
|
|
22
26
|
children: [
|
|
23
|
-
!!e && /* @__PURE__ */ t(
|
|
24
|
-
"button",
|
|
25
|
-
{
|
|
26
|
-
type: "button",
|
|
27
|
-
className: l.back_btn,
|
|
28
|
-
onClick: e,
|
|
29
|
-
children: /* @__PURE__ */ t(d, {})
|
|
30
|
-
}
|
|
31
|
-
),
|
|
27
|
+
!!e && /* @__PURE__ */ t("button", { type: "button", className: l.back_btn, onClick: e, children: /* @__PURE__ */ t(x, {}) }),
|
|
32
28
|
r
|
|
33
29
|
]
|
|
34
30
|
}
|
package/dist/box/component.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
export declare enum Radiuses {
|
|
3
3
|
xs = 8,
|
|
4
4
|
sm = 12,
|
|
@@ -29,5 +29,5 @@ type Props = {
|
|
|
29
29
|
margin?: keyof typeof Spaces;
|
|
30
30
|
marginCustom?: string;
|
|
31
31
|
};
|
|
32
|
-
export declare const Box: ({ children, id, className, padding, paddingCustom, border, margin, marginCustom, background, width, height, rounded, }: Props) =>
|
|
32
|
+
export declare const Box: ({ children, id, className, padding, paddingCustom, border, margin, marginCustom, background, width, height, rounded, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
33
33
|
export {};
|
package/dist/box/component.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as M } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import b from "
|
|
2
|
+
import N from "classnames";
|
|
3
|
+
import { useMemo as b } from "react";
|
|
4
4
|
import m from "./index.module.css.js";
|
|
5
5
|
var q = /* @__PURE__ */ ((r) => (r[r.xs = 8] = "xs", r[r.sm = 12] = "sm", r[r.md = 16] = "md", r.round = "round", r))(q || {}), z = /* @__PURE__ */ ((r) => (r[r.xxs = 4] = "xxs", r[r.xs = 8] = "xs", r[r.sm = 12] = "sm", r[r.md = 16] = "md", r[r.ml = 20] = "ml", r[r.l = 20] = "l", r[r.xl = 24] = "xl", r[r.xxl = 32] = "xxl", r))(z || {});
|
|
6
6
|
const G = ({
|
|
@@ -17,7 +17,7 @@ const G = ({
|
|
|
17
17
|
height: n,
|
|
18
18
|
rounded: _
|
|
19
19
|
}) => {
|
|
20
|
-
const B =
|
|
20
|
+
const B = b(() => {
|
|
21
21
|
const x = {};
|
|
22
22
|
return f && (x.background = f), o && (x.padding = o), l && (x.margin = l), t && (x.width = `${t}px`), n && (x.height = `${n}px`), x;
|
|
23
23
|
}, [f, t, n, o, l]);
|
|
@@ -26,7 +26,7 @@ const G = ({
|
|
|
26
26
|
{
|
|
27
27
|
id: y,
|
|
28
28
|
style: B,
|
|
29
|
-
className:
|
|
29
|
+
className: N([
|
|
30
30
|
i,
|
|
31
31
|
m.component,
|
|
32
32
|
{
|
package/dist/button/component.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as F, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import i
|
|
3
|
-
import u from "react
|
|
4
|
-
import d from "
|
|
2
|
+
import i from "classnames";
|
|
3
|
+
import u, { useRef as v } from "react";
|
|
4
|
+
import d from "react-merge-refs";
|
|
5
5
|
import { useFocus as C } from "../hooks/useFocus/index.js";
|
|
6
6
|
import { Loader as L } from "../loader/component.js";
|
|
7
7
|
import e from "./index.module.css.js";
|
|
8
|
-
const E =
|
|
8
|
+
const E = u.forwardRef(
|
|
9
9
|
({
|
|
10
10
|
children: r,
|
|
11
11
|
view: b = "secondary",
|
|
@@ -21,7 +21,7 @@ const E = i.forwardRef(
|
|
|
21
21
|
...a
|
|
22
22
|
}, l) => {
|
|
23
23
|
const c = v(null), [h] = C(c, "keyboard"), f = {
|
|
24
|
-
className:
|
|
24
|
+
className: i(
|
|
25
25
|
e.component,
|
|
26
26
|
e[b],
|
|
27
27
|
e[x],
|
|
@@ -35,12 +35,12 @@ const E = i.forwardRef(
|
|
|
35
35
|
R
|
|
36
36
|
),
|
|
37
37
|
"data-test-id": y || null
|
|
38
|
-
}, p = /* @__PURE__ */ F(
|
|
38
|
+
}, p = /* @__PURE__ */ F(u.Fragment, { children: [
|
|
39
39
|
t && /* @__PURE__ */ o("span", { className: e.addons, children: t }),
|
|
40
40
|
r && /* @__PURE__ */ o(
|
|
41
41
|
"span",
|
|
42
42
|
{
|
|
43
|
-
className:
|
|
43
|
+
className: i(e.text, {
|
|
44
44
|
[e.stretchText]: !(t || s)
|
|
45
45
|
}),
|
|
46
46
|
children: r
|
|
@@ -58,7 +58,7 @@ const E = i.forwardRef(
|
|
|
58
58
|
...f,
|
|
59
59
|
...a,
|
|
60
60
|
href: m,
|
|
61
|
-
ref:
|
|
61
|
+
ref: d([c, l]),
|
|
62
62
|
children: p
|
|
63
63
|
}
|
|
64
64
|
);
|
|
@@ -72,7 +72,7 @@ const E = i.forwardRef(
|
|
|
72
72
|
...f,
|
|
73
73
|
...w,
|
|
74
74
|
disabled: j || n,
|
|
75
|
-
ref:
|
|
75
|
+
ref: d([c, l]),
|
|
76
76
|
children: p
|
|
77
77
|
}
|
|
78
78
|
)
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { locales } from '../utils/format-date';
|
|
3
2
|
import { View } from './typings';
|
|
4
3
|
export type ExternalLocale = keyof typeof locales;
|
|
@@ -21,4 +20,4 @@ export type CalendarProps = {
|
|
|
21
20
|
locale?: ExternalLocale;
|
|
22
21
|
shortNames?: boolean;
|
|
23
22
|
};
|
|
24
|
-
export declare const Calendar:
|
|
23
|
+
export declare const Calendar: import('react').ForwardRefExoticComponent<CalendarProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,108 +1,111 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import ae from "
|
|
1
|
+
import { jsxs as P, jsx as y } from "react/jsx-runtime";
|
|
2
|
+
import se from "classnames";
|
|
3
|
+
import { forwardRef as ae, useState as S, useMemo as o, useCallback as a } from "react";
|
|
4
4
|
import { startOfMonth as D, isSameDay as le } from "../utils/date/index.js";
|
|
5
5
|
import { locales as ce } from "../utils/format-date/index.js";
|
|
6
6
|
import { DaysTable as ie } from "./components/days-table/component.js";
|
|
7
|
-
import { Header as de } from "./components/header
|
|
8
|
-
import { MonthsTable as he } from "./components/months-table
|
|
9
|
-
import { useCalendar as fe } from "./use-calendar.js";
|
|
10
|
-
import { useDidUpdateEffect as S, monthName as we } from "./utils.js";
|
|
7
|
+
import { Header as de } from "./components/header/component.js";
|
|
8
|
+
import { MonthsTable as he } from "./components/months-table/component.js";
|
|
11
9
|
import g from "./index.module.css.js";
|
|
12
|
-
|
|
10
|
+
import { useCalendar as fe } from "./use-calendar.js";
|
|
11
|
+
import { useDidUpdateEffect as A, monthName as we } from "./utils.js";
|
|
12
|
+
const me = ce, Pe = ae(
|
|
13
13
|
({
|
|
14
|
-
className:
|
|
15
|
-
defaultView:
|
|
14
|
+
className: b,
|
|
15
|
+
defaultView: Y = "days",
|
|
16
16
|
value: n,
|
|
17
17
|
month: i,
|
|
18
|
-
defaultMonth:
|
|
18
|
+
defaultMonth: p = Date.now(),
|
|
19
19
|
minDate: d,
|
|
20
20
|
maxDate: h,
|
|
21
|
-
selectedFrom:
|
|
21
|
+
selectedFrom: l,
|
|
22
22
|
selectedTo: V,
|
|
23
23
|
offDays: j,
|
|
24
24
|
events: R,
|
|
25
|
-
onChange:
|
|
26
|
-
onMonthChange:
|
|
27
|
-
onYearChange:
|
|
28
|
-
locale:
|
|
29
|
-
shortNames:
|
|
30
|
-
dataTestId:
|
|
31
|
-
},
|
|
32
|
-
const [e,
|
|
25
|
+
onChange: f,
|
|
26
|
+
onMonthChange: B,
|
|
27
|
+
onYearChange: E,
|
|
28
|
+
locale: H = "en",
|
|
29
|
+
shortNames: L = !0,
|
|
30
|
+
dataTestId: O
|
|
31
|
+
}, T) => {
|
|
32
|
+
const [e, w] = S(Y), [U, W] = S(!1), m = me[H], r = o(() => n ? new Date(n) : void 0, [n]), q = o(
|
|
33
33
|
() => D(
|
|
34
|
-
|
|
34
|
+
r ?? (l != null ? new Date(l) : new Date(p))
|
|
35
35
|
),
|
|
36
36
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
37
|
-
[]
|
|
37
|
+
[p, l, r]
|
|
38
38
|
), z = o(
|
|
39
39
|
() => i ? new Date(i) : void 0,
|
|
40
40
|
[i]
|
|
41
|
-
),
|
|
41
|
+
), G = o(
|
|
42
42
|
() => d ? new Date(d) : void 0,
|
|
43
43
|
[d]
|
|
44
|
-
),
|
|
44
|
+
), I = o(
|
|
45
45
|
() => h ? new Date(h) : void 0,
|
|
46
46
|
[h]
|
|
47
47
|
), {
|
|
48
48
|
activeMonth: c,
|
|
49
|
-
activeYear:
|
|
50
|
-
weeks:
|
|
51
|
-
months:
|
|
52
|
-
canSetPrevMonth:
|
|
53
|
-
canSetNextMonth:
|
|
49
|
+
activeYear: J,
|
|
50
|
+
weeks: k,
|
|
51
|
+
months: K,
|
|
52
|
+
canSetPrevMonth: Q,
|
|
53
|
+
canSetNextMonth: X,
|
|
54
54
|
setMonthByDate: M,
|
|
55
|
-
setPrevMonth:
|
|
56
|
-
setNextMonth:
|
|
57
|
-
setNextYear:
|
|
55
|
+
setPrevMonth: v,
|
|
56
|
+
setNextMonth: x,
|
|
57
|
+
setNextYear: C,
|
|
58
58
|
setPrevYear: u,
|
|
59
|
-
highlighted:
|
|
60
|
-
getDayProps:
|
|
61
|
-
getMonthProps:
|
|
62
|
-
getRootProps:
|
|
59
|
+
highlighted: Z,
|
|
60
|
+
getDayProps: _,
|
|
61
|
+
getMonthProps: $,
|
|
62
|
+
getRootProps: F
|
|
63
63
|
} = fe({
|
|
64
64
|
month: z,
|
|
65
65
|
defaultMonth: q,
|
|
66
66
|
view: e,
|
|
67
|
-
minDate:
|
|
68
|
-
maxDate:
|
|
69
|
-
selected:
|
|
67
|
+
minDate: G,
|
|
68
|
+
maxDate: I,
|
|
69
|
+
selected: r,
|
|
70
70
|
offDays: j,
|
|
71
71
|
events: R,
|
|
72
|
-
onChange:
|
|
73
|
-
onMonthChange:
|
|
74
|
-
onYearChange:
|
|
75
|
-
setView:
|
|
76
|
-
}),
|
|
72
|
+
onChange: f,
|
|
73
|
+
onMonthChange: B,
|
|
74
|
+
onYearChange: E,
|
|
75
|
+
setView: w
|
|
76
|
+
}), N = a(
|
|
77
77
|
(t) => {
|
|
78
|
-
|
|
78
|
+
w(e === t ? "days" : t);
|
|
79
79
|
},
|
|
80
80
|
[e]
|
|
81
|
-
),
|
|
81
|
+
), s = o(() => {
|
|
82
82
|
const t = /* @__PURE__ */ new Date();
|
|
83
83
|
return new Date(t.getFullYear(), t.getMonth(), t.getDate());
|
|
84
|
-
}, []), ee = o(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
84
|
+
}, []), ee = o(
|
|
85
|
+
() => !r || !le(r, s),
|
|
86
|
+
[r, s]
|
|
87
|
+
), te = a(() => {
|
|
88
|
+
w("days"), M(D(s)), f?.(s.getTime());
|
|
89
|
+
}, [f, M, s]), oe = a(() => {
|
|
90
|
+
e === "days" ? v() : u();
|
|
91
|
+
}, [v, e, u]), ne = a(() => {
|
|
92
|
+
e === "days" ? x() : C();
|
|
93
|
+
}, [x, e, C]), re = a(() => {
|
|
94
|
+
N("months");
|
|
95
|
+
}, [N]);
|
|
96
|
+
return A(() => {
|
|
94
97
|
W(!1);
|
|
95
|
-
}, [e]),
|
|
98
|
+
}, [e]), A(() => {
|
|
96
99
|
const t = n != null && D(new Date(n));
|
|
97
100
|
t && t.getTime() !== c.getTime() && M(t);
|
|
98
|
-
}, [n]), /* @__PURE__ */
|
|
101
|
+
}, [n]), /* @__PURE__ */ P(
|
|
99
102
|
"div",
|
|
100
103
|
{
|
|
101
|
-
|
|
102
|
-
className:
|
|
103
|
-
[g.sixWeeks]:
|
|
104
|
+
...F({ ref: T }),
|
|
105
|
+
className: se(g.component, b, {
|
|
106
|
+
[g.sixWeeks]: k.length === 6
|
|
104
107
|
}),
|
|
105
|
-
"data-test-id":
|
|
108
|
+
"data-test-id": O,
|
|
106
109
|
children: [
|
|
107
110
|
/* @__PURE__ */ y(
|
|
108
111
|
de,
|
|
@@ -110,27 +113,27 @@ const me = ce, Pe = re(
|
|
|
110
113
|
month: we(c, m, !1),
|
|
111
114
|
onTodayClick: te,
|
|
112
115
|
showToday: ee,
|
|
113
|
-
year:
|
|
114
|
-
prevArrowVisible:
|
|
115
|
-
nextArrowVisible:
|
|
116
|
+
year: J.getFullYear().toString(),
|
|
117
|
+
prevArrowVisible: Q,
|
|
118
|
+
nextArrowVisible: X,
|
|
116
119
|
onPrevArrowClick: oe,
|
|
117
120
|
onNextArrowClick: ne,
|
|
118
|
-
onMonthClick:
|
|
121
|
+
onMonthClick: re,
|
|
119
122
|
view: e,
|
|
120
123
|
withShadow: U
|
|
121
124
|
}
|
|
122
125
|
),
|
|
123
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ P("div", { className: g.container, children: [
|
|
124
127
|
e === "days" && /* @__PURE__ */ y(
|
|
125
128
|
ie,
|
|
126
129
|
{
|
|
127
130
|
locale: m,
|
|
128
|
-
weeks:
|
|
131
|
+
weeks: k,
|
|
129
132
|
activeMonth: c,
|
|
130
|
-
selectedFrom:
|
|
133
|
+
selectedFrom: l,
|
|
131
134
|
selectedTo: V,
|
|
132
|
-
getDayProps:
|
|
133
|
-
highlighted:
|
|
135
|
+
getDayProps: _,
|
|
136
|
+
highlighted: Z
|
|
134
137
|
}
|
|
135
138
|
),
|
|
136
139
|
e === "months" && /* @__PURE__ */ y(
|
|
@@ -138,9 +141,9 @@ const me = ce, Pe = re(
|
|
|
138
141
|
{
|
|
139
142
|
selectedMonth: c,
|
|
140
143
|
selectedLocale: m,
|
|
141
|
-
shortNames:
|
|
142
|
-
months:
|
|
143
|
-
getMonthProps:
|
|
144
|
+
shortNames: L,
|
|
145
|
+
months: K,
|
|
146
|
+
getMonthProps: $
|
|
144
147
|
}
|
|
145
148
|
)
|
|
146
149
|
] })
|