@alphakits/ui 2.4.7 → 2.4.9
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/modal/components/modals/index.css +1 -1
- package/dist/modal/components/modals/index.module.css.js +11 -9
- package/dist/modal/components/modals/modal.js +25 -23
- package/dist/modal/hooks/use-modal.d.ts +1 -1
- package/dist/modal/hooks/use-modal.js +14 -13
- package/dist/modal/types.d.ts +2 -1
- package/dist/select/components/options-list/component.js +51 -48
- package/dist/select/components/options-list/index.css +1 -1
- package/dist/select/components/options-list/index.module.css.js +12 -8
- package/dist/select/components/select-search/index.js +41 -40
- package/dist/sidepanel-header/index.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.container_WE0K{position:fixed;inset:0;display:flex;align-items:center;justify-content:center}.content_p1kc{background:var(--color-bg-primary);box-shadow:0 0 10px #0003}@media print{.content_p1kc{width:100%!important}}.button_js2W{position:absolute!important;top:
|
|
1
|
+
.container_WE0K{position:fixed;inset:0;display:flex;align-items:center;justify-content:center}.content_p1kc{background:var(--color-bg-primary);box-shadow:0 0 10px #0003}@media print{.content_p1kc{width:100%!important}}.button_js2W{position:absolute!important;top:34px;right:32px;z-index:999}.button_js2W.doubleModal_1ZTt{right:384px}.inner_Zsdb{height:100%;box-sizing:border-box;overflow:auto}.right_e065{position:fixed;top:0;right:0;bottom:0;transition:width .2s,opacity .2s,right .2s;transition-delay:width .1s;transition-timing-function:ease-in}.bg_8ZfP{transition:opacity .2s;background:#00000080;position:fixed;display:block;border:0;inset:0}@media screen and (max-width:823px){.right_e065,.center_nguy{max-width:100%!important;inset:0!important}.content_p1kc{width:100%!important;height:100%!important;max-height:100%!important;box-shadow:none!important;margin:0!important;border-radius:0!important}.button_js2W{top:24px!important;right:16px!important}}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import * as __css from './index.css';
|
|
2
2
|
export const __cssModule = __css;
|
|
3
|
-
const
|
|
4
|
-
container:
|
|
5
|
-
content:
|
|
3
|
+
const t = "container_WE0K", n = "content_p1kc", o = "button_js2W", e = "doubleModal_1ZTt", c = "inner_Zsdb", s = "right_e065", b = "bg_8ZfP", r = {
|
|
4
|
+
container: t,
|
|
5
|
+
content: n,
|
|
6
6
|
button: o,
|
|
7
|
+
doubleModal: e,
|
|
7
8
|
inner: c,
|
|
8
|
-
right:
|
|
9
|
-
bg:
|
|
9
|
+
right: s,
|
|
10
|
+
bg: b
|
|
10
11
|
};
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
+
b as bg,
|
|
13
14
|
o as button,
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
t as container,
|
|
16
|
+
n as content,
|
|
16
17
|
r as default,
|
|
18
|
+
e as doubleModal,
|
|
17
19
|
c as inner,
|
|
18
|
-
|
|
20
|
+
s as right
|
|
19
21
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as d, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import y from "@alphakits/icons/dist/CloseM";
|
|
3
|
-
import
|
|
3
|
+
import k from "classnames";
|
|
4
4
|
import { useState as v, useLayoutEffect as x, useCallback as w, useEffect as E } from "react";
|
|
5
5
|
import { Button as g } from "../../../button/component.js";
|
|
6
6
|
import { showConfirm as F } from "../../../confirm-popup/component.js";
|
|
7
|
-
import
|
|
7
|
+
import s from "./index.module.css.js";
|
|
8
8
|
const C = {
|
|
9
9
|
s: 488,
|
|
10
10
|
m: 888,
|
|
11
11
|
full: "96%"
|
|
12
|
-
},
|
|
13
|
-
const
|
|
12
|
+
}, b = 102, N = (e) => e === "full" ? `calc(-96vw - ${b}px)` : -C[e] - b, j = ({ modal: e, t: r, index: m, dirtyModals: a, closeModal: l, currentModalId: c }) => {
|
|
13
|
+
const f = N(e.props.size), [h, p] = v(f);
|
|
14
14
|
x(() => {
|
|
15
15
|
const o = requestAnimationFrame(() => p(0));
|
|
16
16
|
return () => cancelAnimationFrame(o);
|
|
@@ -24,56 +24,58 @@ const C = {
|
|
|
24
24
|
}) : Promise.resolve(!0),
|
|
25
25
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
26
|
[a, r]
|
|
27
|
-
),
|
|
27
|
+
), t = w(
|
|
28
28
|
async (o) => {
|
|
29
|
-
const { id:
|
|
30
|
-
await u(o ||
|
|
31
|
-
e.props.closeCallback && e.props.closeCallback(), l(o ||
|
|
29
|
+
const { id: n } = e;
|
|
30
|
+
await u(o || n) && (p(f), setTimeout(() => {
|
|
31
|
+
e.props.closeCallback && e.props.closeCallback(), l(o || n);
|
|
32
32
|
}, 250));
|
|
33
33
|
},
|
|
34
|
-
[l, u, e,
|
|
34
|
+
[l, u, e, f]
|
|
35
35
|
);
|
|
36
36
|
return E(() => {
|
|
37
|
-
const o = (
|
|
38
|
-
(
|
|
37
|
+
const o = (n) => {
|
|
38
|
+
(n.key === "27" || n.key === "Escape") && t(c);
|
|
39
39
|
};
|
|
40
40
|
return e.id === c && window?.addEventListener("keydown", o), () => {
|
|
41
41
|
window?.removeEventListener("keydown", o);
|
|
42
42
|
};
|
|
43
|
-
}, [
|
|
43
|
+
}, [t, c, e.id]), /* @__PURE__ */ d(
|
|
44
44
|
"div",
|
|
45
45
|
{
|
|
46
|
-
className:
|
|
46
|
+
className: s.container,
|
|
47
47
|
style: {
|
|
48
|
-
zIndex: 9999998 +
|
|
48
|
+
zIndex: 9999998 + m
|
|
49
49
|
},
|
|
50
50
|
children: [
|
|
51
51
|
/* @__PURE__ */ i(
|
|
52
52
|
"div",
|
|
53
53
|
{
|
|
54
|
-
className:
|
|
54
|
+
className: k(s.right, s.content),
|
|
55
55
|
style: {
|
|
56
|
-
zIndex: 9999999 +
|
|
56
|
+
zIndex: 9999999 + m,
|
|
57
57
|
width: C[e.props.size],
|
|
58
58
|
right: h
|
|
59
59
|
},
|
|
60
|
-
children: /* @__PURE__ */
|
|
60
|
+
children: /* @__PURE__ */ d("div", { className: s.inner, children: [
|
|
61
61
|
/* @__PURE__ */ i(
|
|
62
62
|
e.modal,
|
|
63
63
|
{
|
|
64
64
|
...e.props,
|
|
65
65
|
modalId: e.id,
|
|
66
|
-
close: () =>
|
|
66
|
+
close: () => t()
|
|
67
67
|
}
|
|
68
68
|
),
|
|
69
69
|
/* @__PURE__ */ i(
|
|
70
70
|
g,
|
|
71
71
|
{
|
|
72
|
-
className:
|
|
72
|
+
className: k(s.button, {
|
|
73
|
+
[s.doubleModal]: e.props.isDouble
|
|
74
|
+
}),
|
|
73
75
|
view: "secondary",
|
|
74
76
|
size: "xs",
|
|
75
77
|
leftAddons: /* @__PURE__ */ i(y, {}),
|
|
76
|
-
onClick: () =>
|
|
78
|
+
onClick: () => t()
|
|
77
79
|
}
|
|
78
80
|
)
|
|
79
81
|
] })
|
|
@@ -82,10 +84,10 @@ const C = {
|
|
|
82
84
|
/* @__PURE__ */ i(
|
|
83
85
|
"button",
|
|
84
86
|
{
|
|
85
|
-
className:
|
|
87
|
+
className: s.bg,
|
|
86
88
|
"aria-label": "close_backdrop",
|
|
87
89
|
type: "button",
|
|
88
|
-
onClick: () =>
|
|
90
|
+
onClick: () => t()
|
|
89
91
|
}
|
|
90
92
|
)
|
|
91
93
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ModalObject, ModalSize, OwnModalProps, TFunction } from '../types';
|
|
3
3
|
export declare const useModal: (t: TFunction) => {
|
|
4
|
-
openModal: <T>(modal: React.FC<T>, size?: ModalSize) => (props?: OwnModalProps<T>, closeCallback?: () => void) => void;
|
|
4
|
+
openModal: <T>(modal: React.FC<T>, size?: ModalSize, isDouble?: boolean) => (props?: OwnModalProps<T>, closeCallback?: () => void) => void;
|
|
5
5
|
modals: ModalObject[];
|
|
6
6
|
setModalDirty: (id: string, isDirty: boolean) => void;
|
|
7
7
|
currentModalId: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import d, { useRef as
|
|
2
|
-
import { v4 as
|
|
3
|
-
import { deletePropertyById as
|
|
4
|
-
const
|
|
5
|
-
const [s, l] = d.useState([]), [f, a] = d.useState(""), [p, c] = d.useState({}), u =
|
|
1
|
+
import d, { useRef as S, useCallback as r, useEffect as b } from "react";
|
|
2
|
+
import { v4 as h } from "uuid";
|
|
3
|
+
import { deletePropertyById as v } from "../utils/delete-property-by-id.js";
|
|
4
|
+
const x = (n) => {
|
|
5
|
+
const [s, l] = d.useState([]), [f, a] = d.useState(""), [p, c] = d.useState({}), u = S(n);
|
|
6
6
|
u.current = n;
|
|
7
7
|
const i = r((t) => {
|
|
8
|
-
c((e) =>
|
|
8
|
+
c((e) => v(e, t)), l((e) => e.filter((o) => o.id !== t));
|
|
9
9
|
}, []), M = r((t) => {
|
|
10
10
|
l((e) => [...e, t]), a(t.id);
|
|
11
11
|
}, []), m = r((t, e) => {
|
|
@@ -14,21 +14,22 @@ const w = (n) => {
|
|
|
14
14
|
[t]: e
|
|
15
15
|
});
|
|
16
16
|
}, []);
|
|
17
|
-
return
|
|
17
|
+
return b(() => {
|
|
18
18
|
const t = [...s].pop()?.id;
|
|
19
19
|
a(t || ""), document.body.style.overflow = s.length ? "hidden" : "unset";
|
|
20
20
|
}, [s]), {
|
|
21
21
|
openModal: r(
|
|
22
|
-
(t, e = "s") => (
|
|
23
|
-
const
|
|
22
|
+
(t, e = "s", o) => (y, I) => {
|
|
23
|
+
const R = h();
|
|
24
24
|
M({
|
|
25
|
-
id:
|
|
25
|
+
id: R,
|
|
26
26
|
modal: t,
|
|
27
27
|
props: {
|
|
28
28
|
size: e,
|
|
29
|
-
|
|
29
|
+
isDouble: o,
|
|
30
|
+
closeCallback: I,
|
|
30
31
|
t: u.current,
|
|
31
|
-
...
|
|
32
|
+
...y
|
|
32
33
|
}
|
|
33
34
|
});
|
|
34
35
|
},
|
|
@@ -42,5 +43,5 @@ const w = (n) => {
|
|
|
42
43
|
};
|
|
43
44
|
};
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
+
x as useModal
|
|
46
47
|
};
|
package/dist/modal/types.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ type ModalProps = {
|
|
|
4
4
|
close: () => void;
|
|
5
5
|
modalId?: string;
|
|
6
6
|
size: ModalSize;
|
|
7
|
+
isDouble?: boolean;
|
|
7
8
|
t: TFunction;
|
|
8
9
|
} & unknown;
|
|
9
10
|
export type TFunction = (field: string, options?: {
|
|
@@ -19,7 +20,7 @@ export type ModalObject = {
|
|
|
19
20
|
props: ModalProps;
|
|
20
21
|
};
|
|
21
22
|
export type ContextProps = {
|
|
22
|
-
openModal: <T>(modal: React.FC<T>, size?: ModalSize) => (props?: OwnModalProps<T>, closeCallback?: () => void) => void;
|
|
23
|
+
openModal: <T>(modal: React.FC<T>, size?: ModalSize, isDouble?: boolean) => (props?: OwnModalProps<T>, closeCallback?: () => void) => void;
|
|
23
24
|
modals: ModalObject[];
|
|
24
25
|
currentModalId: ModalObject['id'];
|
|
25
26
|
setModalDirty: (id: ModalObject['id'], isDirty: boolean) => void;
|
|
@@ -1,71 +1,74 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t, jsxs as c } from "react/jsx-runtime";
|
|
2
2
|
import R from "@alphakits/icons/dist/ClockCircleM";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import G from "react
|
|
6
|
-
import
|
|
7
|
-
import { useVisibleOptions as
|
|
8
|
-
import { Optgroup as
|
|
9
|
-
import
|
|
10
|
-
const
|
|
11
|
-
let
|
|
12
|
-
return () =>
|
|
13
|
-
},
|
|
3
|
+
import v from "@alphakits/icons/dist/PlusS";
|
|
4
|
+
import L from "classnames";
|
|
5
|
+
import { forwardRef as g, useRef as j, useCallback as G } from "react";
|
|
6
|
+
import w from "react-merge-refs";
|
|
7
|
+
import { useVisibleOptions as y, isGroup as I } from "../../utils.js";
|
|
8
|
+
import { Optgroup as M } from "../optgroup/component.js";
|
|
9
|
+
import r from "./index.module.css.js";
|
|
10
|
+
const O = () => {
|
|
11
|
+
let l = 0;
|
|
12
|
+
return () => l++;
|
|
13
|
+
}, J = g(
|
|
14
14
|
({
|
|
15
|
-
size:
|
|
16
|
-
className:
|
|
17
|
-
Option:
|
|
18
|
-
options:
|
|
19
|
-
actionButton:
|
|
20
|
-
Optgroup:
|
|
21
|
-
dataTestId:
|
|
22
|
-
emptyPlaceholder:
|
|
23
|
-
visibleOptions:
|
|
15
|
+
size: l = "s",
|
|
16
|
+
className: u,
|
|
17
|
+
Option: o,
|
|
18
|
+
options: s = [],
|
|
19
|
+
actionButton: n,
|
|
20
|
+
Optgroup: m = M,
|
|
21
|
+
dataTestId: d,
|
|
22
|
+
emptyPlaceholder: i,
|
|
23
|
+
visibleOptions: p = 5,
|
|
24
24
|
onScroll: b,
|
|
25
25
|
toggleMenu: h,
|
|
26
|
-
open:
|
|
27
|
-
},
|
|
28
|
-
const
|
|
29
|
-
(
|
|
26
|
+
open: C
|
|
27
|
+
}, x) => {
|
|
28
|
+
const f = j(null), a = O(), N = G(
|
|
29
|
+
(e) => /* @__PURE__ */ t(m, { label: e.label, size: l, children: e.options.map((k) => o({ option: k, index: a() })) }, e.label),
|
|
30
30
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
31
|
-
[
|
|
31
|
+
[o, a, l, m]
|
|
32
32
|
);
|
|
33
|
-
return
|
|
34
|
-
visibleOptions:
|
|
35
|
-
listRef:
|
|
36
|
-
open:
|
|
37
|
-
invalidate:
|
|
38
|
-
}),
|
|
33
|
+
return y({
|
|
34
|
+
visibleOptions: p,
|
|
35
|
+
listRef: f,
|
|
36
|
+
open: C,
|
|
37
|
+
invalidate: s
|
|
38
|
+
}), s.length === 0 && !i && !n ? null : /* @__PURE__ */ c(
|
|
39
39
|
"div",
|
|
40
40
|
{
|
|
41
|
-
className:
|
|
42
|
-
"data-test-id":
|
|
43
|
-
ref:
|
|
41
|
+
className: L(r.optionsList, r[l], u),
|
|
42
|
+
"data-test-id": d,
|
|
43
|
+
ref: w([f, x]),
|
|
44
44
|
onScroll: b,
|
|
45
45
|
children: [
|
|
46
|
-
|
|
47
|
-
(
|
|
46
|
+
s.map(
|
|
47
|
+
(e) => I(e) ? N(e) : o({ option: e, index: a() })
|
|
48
48
|
),
|
|
49
|
-
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
49
|
+
i && s.length === 0 && /* @__PURE__ */ c("div", { className: r.emptyPlaceholder, children: [
|
|
50
|
+
/* @__PURE__ */ t(R, {}),
|
|
51
|
+
i
|
|
52
52
|
] }),
|
|
53
|
-
!!
|
|
54
|
-
|
|
53
|
+
!!n && /* @__PURE__ */ c(
|
|
54
|
+
"button",
|
|
55
55
|
{
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
type: "button",
|
|
57
|
+
className: r.actionButton,
|
|
58
58
|
onClick: () => {
|
|
59
|
-
|
|
59
|
+
n?.onClick(), h();
|
|
60
60
|
},
|
|
61
|
-
children:
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ t("span", { className: r.actionButtonIcon, children: /* @__PURE__ */ t(v, {}) }),
|
|
63
|
+
/* @__PURE__ */ t("span", { className: r.actionButtonLabel, children: n.label })
|
|
64
|
+
]
|
|
62
65
|
}
|
|
63
|
-
)
|
|
66
|
+
)
|
|
64
67
|
]
|
|
65
68
|
}
|
|
66
69
|
);
|
|
67
70
|
}
|
|
68
71
|
);
|
|
69
72
|
export {
|
|
70
|
-
|
|
73
|
+
J as OptionsList
|
|
71
74
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--select-error-color: var(--color-text-negative);--select-arrow-background: url(https://alfabank.st/icons/icon_chevron-for-select-down_m_black.svg);--select-arrow-hover-opacity: .7;--select-options-list-border-radius: 0 0 4px 4px;--select-options-list-box-shadow: var(--shadow-xs);--select-options-list-offset: 0;--select-options-list-top-padding: 0;--select-options-list-bottom-padding: 0;--select-options-list-empty-placeholder-color: var(--color-text-secondary);--select-option-divider-display: none;--select-option-divider-background: var(--color-border-primary);--select-option-left-padding: var(--gap-s);--select-option-right-padding: var(--gap-s);--select-option-l-left-padding: var(--gap-m);--select-option-l-right-padding: var(--gap-m);--select-option-background: var(--color-bg-primary);--select-option-selected-background: var(--color-bg-primary);--select-option-hover-background: var(--color-bg-secondary);--select-option-active-background: var(--color-bg-tertiary);--select-option-disabled-background: var(--color-bg-primary);--select-option-color: var(--color-text-primary);--select-option-selected-color: var(--color-text-primary);--select-option-hover-color: var(--color-text-primary);--select-option-active-color: var(--color-text-primary);--select-option-disabled-color: var(--color-text-secondary);--select-checkmark-margin: 0 var(--gap-xs) 0 0;--select-checkmark-size: 4px;--select-checkmark-order: 0;--select-checkmark-unselected-opacity: 0;--select-checkmark-background: var(--color-graphic-primary);--select-checkmark-border-radius: var(--border-radius-circle);--select-optgroup-color: var(--color-text-secondary);--select-optgroup-background: var(--color-bg-primary);--select-optgroup-left-padding: var(--gap-s);--select-optgroup-right-padding: var(--gap-s);--select-optgroup-l-left-padding: var(--gap-m);--select-optgroup-l-right-padding: var(--gap-m)}:root{--text-primary-color: var(--color-text-primary);--text-secondary-color: var(--color-text-secondary);--text-tertiary-color: var(--color-text-tertiary);--border-radius: 4px;--focus-color: var(--color-border-link);--font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, sans-serif;--disabled-cursor: not-allowed;--arrow-transform: rotate(180deg)}.optionsList_fDQ-{overflow:auto;width:100%;outline:none;box-sizing:border-box}.emptyPlaceholder_kjeP{padding:var(--gap-m) var(--gap-xl);color:var(--select-option-color);display:flex;align-items:center;font-family:var(--font-family)}.emptyPlaceholder_kjeP svg{color:var(--color-graphic-thirdly);margin-right:12px}.l_rGpg .emptyPlaceholder_kjeP,.xl_T-5w .emptyPlaceholder_kjeP{padding:var(--gap-xl) var(--gap-xl)}.
|
|
1
|
+
:root{--select-error-color: var(--color-text-negative);--select-arrow-background: url(https://alfabank.st/icons/icon_chevron-for-select-down_m_black.svg);--select-arrow-hover-opacity: .7;--select-options-list-border-radius: 0 0 4px 4px;--select-options-list-box-shadow: var(--shadow-xs);--select-options-list-offset: 0;--select-options-list-top-padding: 0;--select-options-list-bottom-padding: 0;--select-options-list-empty-placeholder-color: var(--color-text-secondary);--select-option-divider-display: none;--select-option-divider-background: var(--color-border-primary);--select-option-left-padding: var(--gap-s);--select-option-right-padding: var(--gap-s);--select-option-l-left-padding: var(--gap-m);--select-option-l-right-padding: var(--gap-m);--select-option-background: var(--color-bg-primary);--select-option-selected-background: var(--color-bg-primary);--select-option-hover-background: var(--color-bg-secondary);--select-option-active-background: var(--color-bg-tertiary);--select-option-disabled-background: var(--color-bg-primary);--select-option-color: var(--color-text-primary);--select-option-selected-color: var(--color-text-primary);--select-option-hover-color: var(--color-text-primary);--select-option-active-color: var(--color-text-primary);--select-option-disabled-color: var(--color-text-secondary);--select-checkmark-margin: 0 var(--gap-xs) 0 0;--select-checkmark-size: 4px;--select-checkmark-order: 0;--select-checkmark-unselected-opacity: 0;--select-checkmark-background: var(--color-graphic-primary);--select-checkmark-border-radius: var(--border-radius-circle);--select-optgroup-color: var(--color-text-secondary);--select-optgroup-background: var(--color-bg-primary);--select-optgroup-left-padding: var(--gap-s);--select-optgroup-right-padding: var(--gap-s);--select-optgroup-l-left-padding: var(--gap-m);--select-optgroup-l-right-padding: var(--gap-m)}:root{--text-primary-color: var(--color-text-primary);--text-secondary-color: var(--color-text-secondary);--text-tertiary-color: var(--color-text-tertiary);--border-radius: 4px;--focus-color: var(--color-border-link);--font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, sans-serif;--disabled-cursor: not-allowed;--arrow-transform: rotate(180deg)}.optionsList_fDQ-{overflow:auto;width:100%;outline:none;box-sizing:border-box}.emptyPlaceholder_kjeP{padding:var(--gap-m) var(--gap-xl);color:var(--select-option-color);display:flex;align-items:center;font-family:var(--font-family)}.emptyPlaceholder_kjeP svg{color:var(--color-graphic-thirdly);margin-right:12px}.l_rGpg .emptyPlaceholder_kjeP,.xl_T-5w .emptyPlaceholder_kjeP{padding:var(--gap-xl) var(--gap-xl)}.actionButton_5oxy{font-size:16px!important;line-height:20px;font-weight:400;display:flex;align-items:center;gap:var(--gap-s);width:100%;min-height:var(--size-s-height);padding:var(--gap-s) var(--select-option-left-padding);margin:0;background:var(--select-option-background);color:var(--color-text-main);border:0;border-top:1px solid var(--color-border-secondary);box-sizing:border-box;text-align:left;cursor:pointer;font-family:var(--font-family);transition:background-color .2s ease}.actionButton_5oxy:hover{background:var(--select-option-hover-background)}.actionButton_5oxy:active{background:var(--select-option-active-background)}.actionButton_5oxy:focus-visible{outline:2px solid var(--color-border-accent);outline-offset:-2px}.actionButtonIcon_r3FS{display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--color-graphic-main)}.actionButtonLabel_-jAV{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import * as __css from './index.css';
|
|
2
2
|
export const __cssModule = __css;
|
|
3
|
-
const t = "optionsList_fDQ-", o = "emptyPlaceholder_kjeP",
|
|
3
|
+
const t = "optionsList_fDQ-", o = "emptyPlaceholder_kjeP", n = "l_rGpg", c = "xl_T-5w", a = "actionButton_5oxy", l = "actionButtonIcon_r3FS", s = "actionButtonLabel_-jAV", e = {
|
|
4
4
|
optionsList: t,
|
|
5
5
|
emptyPlaceholder: o,
|
|
6
|
-
l:
|
|
7
|
-
xl:
|
|
8
|
-
|
|
6
|
+
l: n,
|
|
7
|
+
xl: c,
|
|
8
|
+
actionButton: a,
|
|
9
|
+
actionButtonIcon: l,
|
|
10
|
+
actionButtonLabel: s
|
|
9
11
|
};
|
|
10
12
|
export {
|
|
11
|
-
|
|
12
|
-
l as
|
|
13
|
+
a as actionButton,
|
|
14
|
+
l as actionButtonIcon,
|
|
15
|
+
s as actionButtonLabel,
|
|
16
|
+
e as default,
|
|
13
17
|
o as emptyPlaceholder,
|
|
14
|
-
|
|
18
|
+
n as l,
|
|
15
19
|
t as optionsList,
|
|
16
|
-
|
|
20
|
+
c as xl
|
|
17
21
|
};
|
|
@@ -1,67 +1,68 @@
|
|
|
1
1
|
import { jsxs as k, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import v from "@alphakits/icons/dist/SearchS";
|
|
3
|
-
import
|
|
3
|
+
import f, { useState as C, useRef as P, useCallback as p, useMemo as b } from "react";
|
|
4
4
|
import "../../../toast-notifier/component.js";
|
|
5
|
-
import { useClickOutside as
|
|
6
|
-
import { safeStringify as
|
|
7
|
-
import { Input as
|
|
8
|
-
import { BaseSelect as
|
|
9
|
-
import { OptionsList as
|
|
10
|
-
import
|
|
11
|
-
const
|
|
12
|
-
({ inputProps:
|
|
13
|
-
const i =
|
|
14
|
-
return
|
|
15
|
-
i.current?.focus();
|
|
16
|
-
}, []), /* @__PURE__ */ k("div", { ref: n, children: [
|
|
5
|
+
import { useClickOutside as j } from "../../../hooks/useClickOutside/index.js";
|
|
6
|
+
import { safeStringify as F } from "../../../utils/safe-stringify.js";
|
|
7
|
+
import { Input as I } from "../../../input/component.js";
|
|
8
|
+
import { BaseSelect as M } from "../base-select/component.js";
|
|
9
|
+
import { OptionsList as z } from "../options-list/component.js";
|
|
10
|
+
import A from "./index.module.css.js";
|
|
11
|
+
const B = f.forwardRef(
|
|
12
|
+
({ inputProps: e, ...o }, n) => {
|
|
13
|
+
const i = f.useRef(null), c = f.useRef(null);
|
|
14
|
+
return /* @__PURE__ */ k("div", { ref: n, children: [
|
|
17
15
|
/* @__PURE__ */ s("div", { style: { padding: "5px 20px" }, children: /* @__PURE__ */ s(
|
|
18
|
-
|
|
16
|
+
I,
|
|
19
17
|
{
|
|
20
18
|
size: "s",
|
|
21
19
|
leftAddons: /* @__PURE__ */ s(v, {}),
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
inputMode: "search",
|
|
21
|
+
enterKeyHint: "search",
|
|
22
|
+
autoFocus: !0,
|
|
23
|
+
...e,
|
|
24
|
+
fieldClassName: A.innerInput,
|
|
24
25
|
block: !0,
|
|
25
26
|
ref: i
|
|
26
27
|
}
|
|
27
28
|
) }),
|
|
28
|
-
/* @__PURE__ */ s(
|
|
29
|
+
/* @__PURE__ */ s(z, { ...o, ref: c })
|
|
29
30
|
] });
|
|
30
31
|
}
|
|
31
|
-
),
|
|
32
|
-
options:
|
|
32
|
+
), U = ({
|
|
33
|
+
options: e,
|
|
33
34
|
searchType: o = "text",
|
|
34
35
|
onChange: n,
|
|
35
36
|
selected: i = "",
|
|
36
37
|
...c
|
|
37
38
|
}) => {
|
|
38
|
-
const [L,
|
|
39
|
+
const [L, a] = C(e), [m, d] = C(""), h = P(null), S = p(
|
|
39
40
|
(x, { value: l }) => {
|
|
40
41
|
d(l);
|
|
41
42
|
try {
|
|
42
|
-
if (!l) return
|
|
43
|
-
const y = String(l).toLowerCase(), g =
|
|
43
|
+
if (!l) return a(e);
|
|
44
|
+
const y = String(l).toLowerCase(), g = e.reduce(
|
|
44
45
|
(u, r) => u.concat(r.options ? r.options : [r]),
|
|
45
46
|
[]
|
|
46
47
|
).filter(
|
|
47
|
-
({ key: u, value: r, content: w }) =>
|
|
48
|
+
({ key: u, value: r, content: w }) => F({ key: u, value: r, content: w }).toLowerCase().includes(y)
|
|
48
49
|
);
|
|
49
|
-
return
|
|
50
|
+
return a(g);
|
|
50
51
|
} catch {
|
|
51
52
|
return [];
|
|
52
53
|
}
|
|
53
54
|
},
|
|
54
|
-
[
|
|
55
|
-
),
|
|
56
|
-
d(""),
|
|
57
|
-
}, [
|
|
55
|
+
[e]
|
|
56
|
+
), t = p(() => {
|
|
57
|
+
d(""), a(e);
|
|
58
|
+
}, [e]), O = p(
|
|
58
59
|
(x) => {
|
|
59
|
-
n?.(x),
|
|
60
|
+
n?.(x), t();
|
|
60
61
|
},
|
|
61
|
-
[n,
|
|
62
|
+
[n, t]
|
|
62
63
|
);
|
|
63
|
-
|
|
64
|
-
const R =
|
|
64
|
+
j(h, t);
|
|
65
|
+
const R = b(
|
|
65
66
|
() => ({
|
|
66
67
|
ref: h,
|
|
67
68
|
inputProps: {
|
|
@@ -69,27 +70,27 @@ const M = a.forwardRef(
|
|
|
69
70
|
value: m,
|
|
70
71
|
type: o,
|
|
71
72
|
clear: !0,
|
|
72
|
-
onClear:
|
|
73
|
+
onClear: t
|
|
73
74
|
}
|
|
74
75
|
}),
|
|
75
|
-
[S, m, o,
|
|
76
|
+
[S, m, o, t]
|
|
76
77
|
);
|
|
77
78
|
return /* @__PURE__ */ s(
|
|
78
|
-
|
|
79
|
+
M,
|
|
79
80
|
{
|
|
80
81
|
...c,
|
|
81
82
|
selected: i,
|
|
82
83
|
onChange: O,
|
|
83
84
|
showEmptyOptionsList: !0,
|
|
84
|
-
OptionsList:
|
|
85
|
+
OptionsList: B,
|
|
85
86
|
filteredOptions: L,
|
|
86
|
-
options:
|
|
87
|
+
options: e,
|
|
87
88
|
optionsListProps: R
|
|
88
89
|
}
|
|
89
90
|
);
|
|
90
91
|
};
|
|
91
92
|
export {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
B as CustomOptionsList,
|
|
94
|
+
U as SelectSearch,
|
|
95
|
+
F as safeStringify
|
|
95
96
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.wrapper_QxqD{padding:28px 32px 12px;background-color:var(--color-bg-primary);box-sizing:border-box}.heading_XGDy{display:flex;justify-content:space-between;min-height:48px}.title_jwxc,.bottomAddons_3yzd{padding-bottom:8px;padding-top:8px}.rightAddons_aZFa{margin-right:
|
|
1
|
+
.wrapper_QxqD{padding:28px 32px 12px;background-color:var(--color-bg-primary);box-sizing:border-box}.heading_XGDy{display:flex;justify-content:space-between;min-height:48px}.title_jwxc,.bottomAddons_3yzd{padding-bottom:8px;padding-top:8px}.rightAddons_aZFa{margin-right:54px;height:48px;display:flex;align-items:center}.noCloser_O7u0{margin-right:0!important}@media(max-width:823px){.wrapper_QxqD{padding:16px 16px 12px!important}}
|