@alphakits/ui 2.3.0 → 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 +46 -43
- 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 +69 -63
- 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 +65 -63
- 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,16 +1,16 @@
|
|
|
1
1
|
import { jsx as l, jsxs as O } from "react/jsx-runtime";
|
|
2
|
-
import ue
|
|
2
|
+
import ue from "classnames";
|
|
3
|
+
import de, { forwardRef as fe, useState as W, useRef as u, useCallback as t, useEffect as me } from "react";
|
|
3
4
|
import T from "react-merge-refs";
|
|
4
|
-
import me from "classnames";
|
|
5
5
|
import { Calendar as he } from "../calendar/component.js";
|
|
6
6
|
import { dateInLimits as ve } from "../calendar/utils.js";
|
|
7
7
|
import { MaskedInput as ye } from "../masked-input/component.js";
|
|
8
8
|
import { Popover as Re } from "../popover/component.js";
|
|
9
|
-
import "../toast-notifier/component.js";
|
|
10
9
|
import { formatDate as H } from "../utils/format-date/index.js";
|
|
11
|
-
import
|
|
10
|
+
import "../toast-notifier/component.js";
|
|
12
11
|
import p from "./index.module.css.js";
|
|
13
|
-
|
|
12
|
+
import { parseDateString as I, isCompleteDateInput as ge, DATE_MASK as we, SUPPORTS_INPUT_TYPE_DATE as De, NATIVE_DATE_FORMAT as Te } from "./utils.js";
|
|
13
|
+
const be = fe(
|
|
14
14
|
({
|
|
15
15
|
block: L = !1,
|
|
16
16
|
className: Y,
|
|
@@ -19,7 +19,7 @@ const be = de(
|
|
|
19
19
|
defaultMonth: C,
|
|
20
20
|
defaultValue: d = "",
|
|
21
21
|
calendarPosition: k = "popover",
|
|
22
|
-
value:
|
|
22
|
+
value: s,
|
|
23
23
|
dataTestId: z,
|
|
24
24
|
minDate: f,
|
|
25
25
|
required: G,
|
|
@@ -35,38 +35,38 @@ const be = de(
|
|
|
35
35
|
readOnly: S,
|
|
36
36
|
...X
|
|
37
37
|
}, _) => {
|
|
38
|
-
|
|
39
|
-
const R =
|
|
38
|
+
s = s?.split("-").length ? s.split("-").reverse().join(".") : s;
|
|
39
|
+
const R = s === void 0, K = De && E === "native", P = E === "input", Z = k === "static" && !P, $ = k === "popover" && !K && !P, [i, a] = W(!1), [ee, te] = W(d), g = R ? ee : s, w = g ? I(g).getTime() : void 0, V = ve(w, f, m), D = M || S, b = u(null), j = u(null), ne = u(null), o = u(null), oe = t((e) => {
|
|
40
40
|
e.key === "Escape" && a(!1);
|
|
41
41
|
}, []), re = t(() => {
|
|
42
42
|
i || a(!0);
|
|
43
43
|
}, [i]), se = t(
|
|
44
44
|
(e) => {
|
|
45
|
-
a(!0), !i && e.target.tagName !== "INPUT" &&
|
|
45
|
+
a(!0), !i && e.target.tagName !== "INPUT" && o.current && o.current.focus();
|
|
46
46
|
},
|
|
47
47
|
[i]
|
|
48
48
|
), ae = t((e) => {
|
|
49
|
-
|
|
49
|
+
o.current && o.current.contains(e.relatedTarget) === !1 && a(!1);
|
|
50
50
|
}, []), ce = t((e) => {
|
|
51
|
-
["ArrowDown", "ArrowUp"].includes(e.key) &&
|
|
51
|
+
["ArrowDown", "ArrowUp"].includes(e.key) && o.current && (e.preventDefault(), o.current.focus());
|
|
52
52
|
}, []), c = t(
|
|
53
|
-
(e, n,
|
|
54
|
-
B === "input" && e && v && v(e, { value: n, date:
|
|
55
|
-
date:
|
|
53
|
+
(e, n, r, B = "input", pe = !0) => {
|
|
54
|
+
B === "input" && e && v && v(e, { value: n, date: r }), B === "calendar" && y && y(r.getTime()), pe && (R && te(n), h && h(e, {
|
|
55
|
+
date: r,
|
|
56
56
|
value: n.split(".").reverse().join("-")
|
|
57
57
|
}));
|
|
58
58
|
},
|
|
59
59
|
[y, h, v, R]
|
|
60
60
|
), le = t(
|
|
61
61
|
(e) => {
|
|
62
|
-
const n = e.target.value,
|
|
63
|
-
c(e, n,
|
|
62
|
+
const n = e.target.value, r = I(n);
|
|
63
|
+
c(e, n, r, "input", ge(n));
|
|
64
64
|
},
|
|
65
65
|
[c]
|
|
66
66
|
), ie = t(
|
|
67
67
|
(e) => {
|
|
68
|
-
const n = I(e.target.value, Te),
|
|
69
|
-
c(e,
|
|
68
|
+
const n = I(e.target.value, Te), r = e.target.value === "" ? "" : H(n, { format: "dd.MM.yyyy" });
|
|
69
|
+
c(e, r, n);
|
|
70
70
|
},
|
|
71
71
|
[c]
|
|
72
72
|
), F = t(
|
|
@@ -82,7 +82,7 @@ const be = de(
|
|
|
82
82
|
), U = t((e) => {
|
|
83
83
|
e.preventDefault();
|
|
84
84
|
}, []);
|
|
85
|
-
|
|
85
|
+
me(() => {
|
|
86
86
|
a(N);
|
|
87
87
|
}, [N]);
|
|
88
88
|
const x = t(
|
|
@@ -92,7 +92,7 @@ const be = de(
|
|
|
92
92
|
he,
|
|
93
93
|
{
|
|
94
94
|
...A,
|
|
95
|
-
ref:
|
|
95
|
+
ref: o,
|
|
96
96
|
defaultMonth: C,
|
|
97
97
|
value: V ? w : void 0,
|
|
98
98
|
onChange: F,
|
|
@@ -118,7 +118,7 @@ const be = de(
|
|
|
118
118
|
"div",
|
|
119
119
|
{
|
|
120
120
|
ref: ne,
|
|
121
|
-
className:
|
|
121
|
+
className: ue(p.component, Y, {
|
|
122
122
|
[p.block]: L
|
|
123
123
|
}),
|
|
124
124
|
tabIndex: -1,
|
|
@@ -141,7 +141,7 @@ const be = de(
|
|
|
141
141
|
disabled: M,
|
|
142
142
|
readOnly: S,
|
|
143
143
|
mask: we,
|
|
144
|
-
rightAddons: /* @__PURE__ */ O(
|
|
144
|
+
rightAddons: /* @__PURE__ */ O(de.Fragment, { children: [
|
|
145
145
|
/* @__PURE__ */ l("span", { className: p.calendarIcon }),
|
|
146
146
|
K && /* @__PURE__ */ l(
|
|
147
147
|
"input",
|
package/dist/card/component.js
CHANGED
|
@@ -12,26 +12,10 @@ const y = ({
|
|
|
12
12
|
subtitle: s,
|
|
13
13
|
titleAddons: d
|
|
14
14
|
}) => /* @__PURE__ */ r("div", { className: n([e.component, e[i]]), children: [
|
|
15
|
-
!!o.length && /* @__PURE__ */ t(
|
|
16
|
-
p,
|
|
17
|
-
{
|
|
18
|
-
orientation: l,
|
|
19
|
-
images: o,
|
|
20
|
-
view: i
|
|
21
|
-
}
|
|
22
|
-
),
|
|
15
|
+
!!o.length && /* @__PURE__ */ t(p, { orientation: l, images: o, view: i }),
|
|
23
16
|
/* @__PURE__ */ r("div", { className: e.content, children: [
|
|
24
17
|
/* @__PURE__ */ r("div", { className: e.titleWrap, children: [
|
|
25
|
-
/* @__PURE__ */ t(
|
|
26
|
-
m.Text,
|
|
27
|
-
{
|
|
28
|
-
view: "title",
|
|
29
|
-
color: "primary",
|
|
30
|
-
weight: "medium",
|
|
31
|
-
tag: "div",
|
|
32
|
-
children: c
|
|
33
|
-
}
|
|
34
|
-
),
|
|
18
|
+
/* @__PURE__ */ t(m.Text, { view: "title", color: "primary", weight: "medium", tag: "div", children: c }),
|
|
35
19
|
d
|
|
36
20
|
] }),
|
|
37
21
|
/* @__PURE__ */ t(
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import p from "
|
|
4
|
-
import { getDataTestId as
|
|
5
|
-
import { useFocus as
|
|
1
|
+
import { jsxs as z, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import u from "classnames";
|
|
3
|
+
import { useRef as p, useState as I, useMemo as N, useEffect as E } from "react";
|
|
4
|
+
import { getDataTestId as j } from "../../__internal/utils/get-data-test-id.js";
|
|
5
|
+
import { useFocus as k } from "../../hooks/useFocus/index.js";
|
|
6
6
|
import { Typography as v } from "../../typography/component.js";
|
|
7
7
|
import { Pure as S } from "../pure/component.js";
|
|
8
8
|
import r from "./index.module.css.js";
|
|
9
|
-
const
|
|
10
|
-
className:
|
|
11
|
-
dataTestId:
|
|
9
|
+
const P = ({
|
|
10
|
+
className: w,
|
|
11
|
+
dataTestId: y,
|
|
12
12
|
title: e,
|
|
13
13
|
subtitle: m,
|
|
14
|
-
size:
|
|
15
|
-
addon:
|
|
16
|
-
compactAddon:
|
|
17
|
-
singleLineTitle:
|
|
18
|
-
showTitleTooltipOnOverflow:
|
|
14
|
+
size: h = "m",
|
|
15
|
+
addon: b,
|
|
16
|
+
compactAddon: g,
|
|
17
|
+
singleLineTitle: s,
|
|
18
|
+
showTitleTooltipOnOverflow: i
|
|
19
19
|
}) => {
|
|
20
|
-
const d =
|
|
20
|
+
const d = p(null), a = p(null), [x] = k(d, "keyboard"), [R, f] = I(!1), n = N(
|
|
21
21
|
() => typeof e == "string" || typeof e == "number" ? String(e) : void 0,
|
|
22
22
|
[e]
|
|
23
23
|
);
|
|
24
|
-
return
|
|
25
|
-
if (!
|
|
24
|
+
return E(() => {
|
|
25
|
+
if (!s || !i || !n) {
|
|
26
26
|
f(!1);
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
@@ -36,26 +36,26 @@ const q = ({
|
|
|
36
36
|
return l.observe(t), () => l.disconnect();
|
|
37
37
|
}
|
|
38
38
|
return window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
|
|
39
|
-
}, [i, n
|
|
39
|
+
}, [s, i, n]), /* @__PURE__ */ z(
|
|
40
40
|
S,
|
|
41
41
|
{
|
|
42
|
-
slot:
|
|
43
|
-
compact:
|
|
44
|
-
className:
|
|
45
|
-
dataTestId:
|
|
42
|
+
slot: b,
|
|
43
|
+
compact: g,
|
|
44
|
+
className: u(r.component, { [r.focused]: x }, w),
|
|
45
|
+
dataTestId: j("cell-action", y, !0),
|
|
46
46
|
tabIndex: 0,
|
|
47
|
-
size:
|
|
47
|
+
size: h,
|
|
48
48
|
ref: d,
|
|
49
|
-
children:
|
|
50
|
-
e && /* @__PURE__ */
|
|
49
|
+
children: [
|
|
50
|
+
e && /* @__PURE__ */ c(
|
|
51
51
|
"div",
|
|
52
52
|
{
|
|
53
53
|
ref: a,
|
|
54
|
-
className:
|
|
55
|
-
[r.single_line]:
|
|
54
|
+
className: u(r.title_wrap, {
|
|
55
|
+
[r.single_line]: s
|
|
56
56
|
}),
|
|
57
|
-
title: R &&
|
|
58
|
-
children: /* @__PURE__ */
|
|
57
|
+
title: R && i ? n : void 0,
|
|
58
|
+
children: /* @__PURE__ */ c(
|
|
59
59
|
v.Text,
|
|
60
60
|
{
|
|
61
61
|
view: "title",
|
|
@@ -68,7 +68,7 @@ const q = ({
|
|
|
68
68
|
)
|
|
69
69
|
}
|
|
70
70
|
),
|
|
71
|
-
m && /* @__PURE__ */
|
|
71
|
+
m && /* @__PURE__ */ c(
|
|
72
72
|
v.Text,
|
|
73
73
|
{
|
|
74
74
|
weight: "medium",
|
|
@@ -79,10 +79,10 @@ const q = ({
|
|
|
79
79
|
children: m
|
|
80
80
|
}
|
|
81
81
|
)
|
|
82
|
-
]
|
|
82
|
+
]
|
|
83
83
|
}
|
|
84
84
|
);
|
|
85
85
|
};
|
|
86
86
|
export {
|
|
87
|
-
|
|
87
|
+
P as Base
|
|
88
88
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as u, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as v } from "react";
|
|
3
2
|
import m from "classnames";
|
|
4
|
-
import {
|
|
3
|
+
import { forwardRef as v } from "react";
|
|
4
|
+
import { getDataTestId as h } from "../../__internal/utils/get-data-test-id.js";
|
|
5
5
|
import r from "./index.module.css.js";
|
|
6
6
|
const w = v(
|
|
7
7
|
({
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as c, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import w from "
|
|
6
|
-
import F from "
|
|
2
|
+
import y from "@alphakits/icons/dist/CheckmarkS";
|
|
3
|
+
import C from "@alphakits/icons/dist/MinusM";
|
|
4
|
+
import j from "classnames";
|
|
5
|
+
import { forwardRef as M, useRef as w } from "react";
|
|
6
|
+
import F from "react-merge-refs";
|
|
7
7
|
import { useFocus as I } from "../hooks/useFocus/index.js";
|
|
8
8
|
import e from "./index.module.css.js";
|
|
9
|
-
const G =
|
|
9
|
+
const G = M(
|
|
10
10
|
({
|
|
11
11
|
checked: r,
|
|
12
12
|
label: o,
|
|
@@ -23,7 +23,7 @@ const G = y(
|
|
|
23
23
|
indeterminate: l = !1,
|
|
24
24
|
...k
|
|
25
25
|
}, x) => {
|
|
26
|
-
const i =
|
|
26
|
+
const i = w(null), [R] = I(i, "keyboard"), g = (f) => {
|
|
27
27
|
n && n(f, { checked: f.target.checked, name: N });
|
|
28
28
|
};
|
|
29
29
|
return (
|
|
@@ -31,14 +31,14 @@ const G = y(
|
|
|
31
31
|
/* @__PURE__ */ c(
|
|
32
32
|
"label",
|
|
33
33
|
{
|
|
34
|
-
className:
|
|
34
|
+
className: j(e.component, e[p], e[d], u, {
|
|
35
35
|
[e.disabled]: t,
|
|
36
36
|
[e.checked]: r,
|
|
37
37
|
[e.indeterminate]: l,
|
|
38
38
|
[e.focused]: R,
|
|
39
39
|
[e.block]: h
|
|
40
40
|
}),
|
|
41
|
-
ref:
|
|
41
|
+
ref: F([i, x]),
|
|
42
42
|
children: [
|
|
43
43
|
/* @__PURE__ */ c("span", { className: e.box, children: [
|
|
44
44
|
/* @__PURE__ */ s(
|
|
@@ -52,8 +52,8 @@ const G = y(
|
|
|
52
52
|
...k
|
|
53
53
|
}
|
|
54
54
|
),
|
|
55
|
-
r && /* @__PURE__ */ s(
|
|
56
|
-
l && !r && /* @__PURE__ */ s("div", { className: e.indeterminateIcon, children: /* @__PURE__ */ s(
|
|
55
|
+
r && /* @__PURE__ */ s(y, {}),
|
|
56
|
+
l && !r && /* @__PURE__ */ s("div", { className: e.indeterminateIcon, children: /* @__PURE__ */ s(C, {}) })
|
|
57
57
|
] }),
|
|
58
58
|
(o || a) && /* @__PURE__ */ c("span", { className: e.content, children: [
|
|
59
59
|
o && /* @__PURE__ */ s("span", { className: e.label, children: o }),
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import v from "
|
|
3
|
-
import {
|
|
4
|
-
import { FlexColumns as u } from "../flex-columns/component.js";
|
|
1
|
+
import { jsxs as s, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Checkbox as v } from "../checkbox/component.js";
|
|
3
|
+
import { FlexColumns as y } from "../flex-columns/component.js";
|
|
5
4
|
import { Typography as l } from "../typography/component.js";
|
|
6
|
-
import
|
|
7
|
-
const
|
|
5
|
+
import d from "./index.module.css.js";
|
|
6
|
+
const $ = ({
|
|
8
7
|
title: c,
|
|
9
8
|
subtitle: t,
|
|
10
|
-
selected:
|
|
11
|
-
data:
|
|
9
|
+
selected: h = [],
|
|
10
|
+
data: m = [],
|
|
12
11
|
onChange: a,
|
|
13
12
|
columns: p = 1,
|
|
14
13
|
disabled: x,
|
|
15
14
|
gr: g = 20,
|
|
16
|
-
gc:
|
|
15
|
+
gc: k = 20,
|
|
17
16
|
dataTestId: i
|
|
18
17
|
}) => {
|
|
19
|
-
const
|
|
18
|
+
const o = h || [], b = (e) => {
|
|
20
19
|
a(
|
|
21
|
-
|
|
20
|
+
o?.includes(e) ? o?.filter((n) => n !== e) : [...o, e]
|
|
22
21
|
);
|
|
23
|
-
},
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
(c || t) && /* @__PURE__ */
|
|
26
|
-
c && /* @__PURE__ */
|
|
27
|
-
t && /* @__PURE__ */
|
|
22
|
+
}, f = (e) => i ? `checkbox_${i}_${e}` : `checkbox_${e}`;
|
|
23
|
+
return /* @__PURE__ */ s("div", { children: [
|
|
24
|
+
(c || t) && /* @__PURE__ */ s("div", { className: d.text, children: [
|
|
25
|
+
c && /* @__PURE__ */ r(l.Text, { tag: "div", view: "title", color: "primary", weight: "bold", children: c }),
|
|
26
|
+
t && /* @__PURE__ */ r(
|
|
28
27
|
l.Text,
|
|
29
28
|
{
|
|
30
|
-
className:
|
|
29
|
+
className: d.subtitle,
|
|
31
30
|
tag: "div",
|
|
32
31
|
view: "caps",
|
|
33
32
|
color: "secondary",
|
|
@@ -36,19 +35,19 @@ const F = ({
|
|
|
36
35
|
}
|
|
37
36
|
)
|
|
38
37
|
] }),
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
38
|
+
/* @__PURE__ */ r(y, { columns: p, gr: g, gc: k, children: m?.map((e, n) => /* @__PURE__ */ r(
|
|
39
|
+
v,
|
|
41
40
|
{
|
|
42
41
|
disabled: x,
|
|
43
|
-
dataTestId:
|
|
44
|
-
onChange: () =>
|
|
45
|
-
checked:
|
|
42
|
+
dataTestId: f(n),
|
|
43
|
+
onChange: () => b(e.key),
|
|
44
|
+
checked: o?.includes(e.key),
|
|
46
45
|
label: e.content
|
|
47
46
|
},
|
|
48
47
|
e.key + e.content
|
|
49
|
-
)) })
|
|
48
|
+
)) })
|
|
50
49
|
] });
|
|
51
50
|
};
|
|
52
51
|
export {
|
|
53
|
-
|
|
52
|
+
$ as CheckboxGroup
|
|
54
53
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
type Child = {
|
|
3
2
|
id: number;
|
|
4
3
|
title: string;
|
|
@@ -17,5 +16,5 @@ export interface CheckboxGroupsProps {
|
|
|
17
16
|
collapsable?: boolean;
|
|
18
17
|
disabled?: boolean;
|
|
19
18
|
}
|
|
20
|
-
export declare const CheckboxGroups: ({ parents, childs, selected, checkableParent, collapsable, disabled, onChange, }: CheckboxGroupsProps) =>
|
|
19
|
+
export declare const CheckboxGroups: ({ parents, childs, selected, checkableParent, collapsable, disabled, onChange, }: CheckboxGroupsProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
20
|
export {};
|
|
@@ -1,85 +1,83 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import j from "
|
|
5
|
-
import { Checkbox as
|
|
6
|
-
import { Collapse as
|
|
7
|
-
import { Divider as
|
|
8
|
-
import { FlexColumns as
|
|
9
|
-
import { IconButton as
|
|
10
|
-
import { Padding as
|
|
11
|
-
import { Typography as
|
|
1
|
+
import { jsx as l, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import A from "@alphakits/icons/dist/ChevronDownS";
|
|
3
|
+
import E from "classnames";
|
|
4
|
+
import _, { useState as j } from "react";
|
|
5
|
+
import { Checkbox as f } from "../checkbox/component.js";
|
|
6
|
+
import { Collapse as N } from "../collapse/component.js";
|
|
7
|
+
import { Divider as P } from "../divider/component.js";
|
|
8
|
+
import { FlexColumns as S } from "../flex-columns/component.js";
|
|
9
|
+
import { IconButton as z } from "../icon-button/component.js";
|
|
10
|
+
import { Padding as B } from "../padding/component.js";
|
|
11
|
+
import { Typography as D } from "../typography/component.js";
|
|
12
12
|
import s from "./index.module.css.js";
|
|
13
13
|
const Q = ({
|
|
14
|
-
parents:
|
|
15
|
-
childs:
|
|
16
|
-
selected:
|
|
14
|
+
parents: u,
|
|
15
|
+
childs: C,
|
|
16
|
+
selected: a,
|
|
17
17
|
checkableParent: k,
|
|
18
18
|
collapsable: x,
|
|
19
19
|
disabled: b,
|
|
20
|
-
onChange:
|
|
20
|
+
onChange: d
|
|
21
21
|
}) => {
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
const
|
|
22
|
+
const p = [], i = Array.isArray(a) ? a : [];
|
|
23
|
+
u?.forEach((e) => {
|
|
24
|
+
const o = {
|
|
25
25
|
parent: {},
|
|
26
26
|
childs: [],
|
|
27
27
|
collapsed: !1
|
|
28
28
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}),
|
|
29
|
+
C?.forEach((r) => {
|
|
30
|
+
r.locationId === e.id && (o.parent = e, o.childs.push(r));
|
|
31
|
+
}), o.parent.id && p.push(o);
|
|
32
32
|
});
|
|
33
|
-
const [c,
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
e.forEach((
|
|
38
|
-
i?.includes(
|
|
33
|
+
const [c, g] = j(p), y = (e) => {
|
|
34
|
+
const o = c.map((t, n) => (n === e && (t.collapsed ? t.collapsed = !1 : t.collapsed = !0), t)), r = c.concat(o);
|
|
35
|
+
g(r.filter((t, n) => r.indexOf(t) === n));
|
|
36
|
+
}, m = (e) => {
|
|
37
|
+
e.forEach((o) => {
|
|
38
|
+
i?.includes(o) ? d(i.filter((r) => !e.includes(r))) : d([...i, ...e]);
|
|
39
39
|
});
|
|
40
|
-
},
|
|
41
|
-
let
|
|
42
|
-
return e.forEach((
|
|
43
|
-
i?.includes(
|
|
44
|
-
}),
|
|
45
|
-
},
|
|
46
|
-
|
|
40
|
+
}, v = (e) => {
|
|
41
|
+
let o = !1;
|
|
42
|
+
return e.forEach((r) => {
|
|
43
|
+
i?.includes(r) && (o = !0);
|
|
44
|
+
}), o;
|
|
45
|
+
}, w = ({ element: e }) => k ? /* @__PURE__ */ l(
|
|
46
|
+
f,
|
|
47
47
|
{
|
|
48
48
|
block: !0,
|
|
49
49
|
disabled: b,
|
|
50
|
-
checked:
|
|
51
|
-
|
|
52
|
-
),
|
|
53
|
-
onChange: () => h(e.childs.map((r) => r.id)),
|
|
50
|
+
checked: v(e.childs.map((o) => o.id)),
|
|
51
|
+
onChange: () => m(e.childs.map((o) => o.id)),
|
|
54
52
|
label: `${e.parent.title}`
|
|
55
53
|
}
|
|
56
|
-
) : /* @__PURE__ */ l(
|
|
57
|
-
return /* @__PURE__ */ l("div", { children: c.map((e,
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
!e.collapsed && /* @__PURE__ */ l(z, { padding: "16px 0 0 0" })
|
|
54
|
+
) : /* @__PURE__ */ l(D.Text, { view: "title", weight: "medium", color: "primary", children: e.parent.title });
|
|
55
|
+
return /* @__PURE__ */ l("div", { children: c.map((e, o) => /* @__PURE__ */ h(_.Fragment, { children: [
|
|
56
|
+
/* @__PURE__ */ h("div", { className: s.list_head, children: [
|
|
57
|
+
/* @__PURE__ */ l(w, { element: e }),
|
|
58
|
+
x && /* @__PURE__ */ l(
|
|
59
|
+
z,
|
|
60
|
+
{
|
|
61
|
+
onClick: () => y(o),
|
|
62
|
+
size: "s",
|
|
63
|
+
className: E(s.collapse_btn, {
|
|
64
|
+
[s.collapse_btn_collapsed]: e.collapsed
|
|
65
|
+
}),
|
|
66
|
+
icon: A
|
|
67
|
+
}
|
|
68
|
+
)
|
|
72
69
|
] }),
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
!e.collapsed && /* @__PURE__ */ l(B, { padding: "16px 0 0 0" }),
|
|
71
|
+
/* @__PURE__ */ l(N, { expanded: !e.collapsed, children: /* @__PURE__ */ l("div", { className: s.content, children: /* @__PURE__ */ l(S, { columns: 1, gr: 8, children: e.childs.map((r) => /* @__PURE__ */ l(
|
|
72
|
+
f,
|
|
75
73
|
{
|
|
76
|
-
onChange: () =>
|
|
77
|
-
checked: i?.includes(
|
|
78
|
-
label:
|
|
74
|
+
onChange: () => m([r.id]),
|
|
75
|
+
checked: i?.includes(r.id),
|
|
76
|
+
label: r.title
|
|
79
77
|
},
|
|
80
|
-
|
|
78
|
+
r.id
|
|
81
79
|
)) }) }) }),
|
|
82
|
-
|
|
80
|
+
o !== c?.length - 1 && /* @__PURE__ */ l(P, { size: "m" })
|
|
83
81
|
] }, e.parent.id)) });
|
|
84
82
|
};
|
|
85
83
|
export {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const Content: ({ location, onClick, }: {
|
|
1
|
+
export declare const Content: ({ location, onClick }: {
|
|
3
2
|
location: any;
|
|
4
3
|
onClick: () => void;
|
|
5
|
-
}) =>
|
|
6
|
-
export declare const Addons: ({ onClick }: any) =>
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const Addons: ({ onClick }: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { jsx as o, jsxs as i } from "react/jsx-runtime";
|
|
2
|
-
import e from "
|
|
3
|
-
import m from "@alphakits/icons/dist/
|
|
4
|
-
import s from "
|
|
2
|
+
import e from "@alphakits/icons/dist/EditS";
|
|
3
|
+
import m from "@alphakits/icons/dist/PlusS";
|
|
4
|
+
import s from "react";
|
|
5
5
|
import { Button as n } from "../button/component.js";
|
|
6
6
|
import { IconButton as d } from "../icon-button/component.js";
|
|
7
7
|
import { Typography as p } from "../typography/component.js";
|
|
8
|
-
const w = ({
|
|
9
|
-
location: r,
|
|
10
|
-
onClick: t
|
|
11
|
-
}) => /* @__PURE__ */ i(e.Fragment, { children: [
|
|
8
|
+
const w = ({ location: r, onClick: t }) => /* @__PURE__ */ i(s.Fragment, { children: [
|
|
12
9
|
/* @__PURE__ */ o(p.Text, { view: "title", weight: "bold", color: "primary", children: r.address }),
|
|
13
|
-
/* @__PURE__ */ o(d, { icon:
|
|
14
|
-
] }), y = ({ onClick: r }) => /* @__PURE__ */ o(n, { leftAddons: /* @__PURE__ */ o(
|
|
10
|
+
/* @__PURE__ */ o(d, { icon: e, onClick: t, size: "s", view: "ghost" })
|
|
11
|
+
] }), y = ({ onClick: r }) => /* @__PURE__ */ o(n, { leftAddons: /* @__PURE__ */ o(m, {}), size: "xs", onClick: r, view: "secondary", children: "Добавить квест" });
|
|
15
12
|
export {
|
|
16
13
|
y as Addons,
|
|
17
14
|
w as Content
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import h from "
|
|
2
|
+
import p from "@alphakits/icons/dist/ChevronDownS";
|
|
3
|
+
import d from "classnames";
|
|
4
|
+
import { useState as f, useEffect as h } from "react";
|
|
5
5
|
import { Collapse as w } from "../collapse/component.js";
|
|
6
6
|
import { IconButton as v } from "../icon-button/component.js";
|
|
7
7
|
import { Typography as u } from "../typography/component.js";
|
|
@@ -14,8 +14,8 @@ const E = ({
|
|
|
14
14
|
children: m,
|
|
15
15
|
disabled: n
|
|
16
16
|
}) => {
|
|
17
|
-
const [s, a] =
|
|
18
|
-
return
|
|
17
|
+
const [s, a] = f(r);
|
|
18
|
+
return h(() => {
|
|
19
19
|
a(r);
|
|
20
20
|
}, [r]), /* @__PURE__ */ e("div", { children: [
|
|
21
21
|
/* @__PURE__ */ e("div", { className: o.wrapper, children: [
|
|
@@ -38,10 +38,10 @@ const E = ({
|
|
|
38
38
|
v,
|
|
39
39
|
{
|
|
40
40
|
onClick: () => a(!s),
|
|
41
|
-
className:
|
|
41
|
+
className: d(o.collapse_button, { [o.expanded_icon]: s }),
|
|
42
42
|
disabled: n,
|
|
43
43
|
view: "ghost",
|
|
44
|
-
icon:
|
|
44
|
+
icon: p,
|
|
45
45
|
size: "s"
|
|
46
46
|
}
|
|
47
47
|
)
|