mimir-ui-kit 1.62.0 → 1.63.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/Input-CqNPT8os.js +243 -0
- package/dist/components/Accordion/Accordion.d.ts +5 -0
- package/dist/components/Accordion/Accordion.js +242 -220
- package/dist/components/Accordion/AccordionItem/AccordionItem.d.ts +6 -1
- package/dist/components/Accordion/AccordionItem/AccordionItem.js +19 -8
- package/dist/components/Button/Button.d.ts +37 -0
- package/dist/components/Button/Button.js +77 -61
- package/dist/components/CheckboxMimir/CheckboxMimir.d.ts +9 -0
- package/dist/components/CheckboxMimir/CheckboxMimir.js +90 -59
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/Drawer/Drawer.d.ts +5 -0
- package/dist/components/Drawer/Drawer.js +141 -135
- package/dist/components/GosZnak/GosZnak.d.ts +1 -1
- package/dist/components/GosZnak/GosZnak.js +88 -67
- package/dist/components/GosZnak/types.d.ts +5 -0
- package/dist/components/Image/Image.d.ts +5 -0
- package/dist/components/Image/Image.js +55 -50
- package/dist/components/Input/Input.d.ts +5 -0
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/InputPassword/InputPassword.d.ts +5 -0
- package/dist/components/InputPassword/InputPassword.js +80 -69
- package/dist/components/InputPhoneNumber/InputPhoneNumber.d.ts +5 -1
- package/dist/components/InputPhoneNumber/InputPhoneNumber.js +39 -32
- package/dist/components/Loader/Loader.d.ts +6 -1
- package/dist/components/Loader/Loader.js +37 -14
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +1 -1
- package/dist/components/MultiSelectSearch/utils.js +1 -1
- package/dist/components/OtpInput/OtpInput.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +9 -0
- package/dist/components/RadioGroup/RadioGroup.js +142 -129
- package/dist/components/SelectSearch/SelectSearch.d.ts +1 -0
- package/dist/components/SelectSearch/SelectSearch.js +299 -277
- package/dist/components/SelectSearch/types.d.ts +5 -0
- package/dist/components/SelectSearch/utils.js +1 -1
- package/dist/components/TextArea/TextArea.d.ts +1 -1
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/TextAreaV2/TextArea.js +155 -142
- package/dist/components/TextAreaV2/types.d.ts +5 -0
- package/dist/components/UniversalUploader/UniversalUploader.d.ts +1 -0
- package/dist/components/UniversalUploader/UniversalUploader.js +89 -86
- package/dist/components/UniversalUploader/types.d.ts +5 -0
- package/dist/components/Uploader/Uploader.d.ts +5 -0
- package/dist/components/Uploader/Uploader.js +116 -87
- package/dist/components/UploaderFiles/UploaderFiles.js +88 -79
- package/dist/components/UploaderFiles/types.d.ts +5 -0
- package/dist/components/UploaderPhotos/UploaderPhotos.d.ts +5 -0
- package/dist/components/UploaderPhotos/UploaderPhotos.js +60 -57
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/dataTestId.d.ts +1 -0
- package/dist/types/dataTestId.js +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/Input-DPnH8pKc.js +0 -227
|
@@ -1,92 +1,101 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { EUploaderFilesVariant as
|
|
5
|
-
import { useMediaQuery as
|
|
6
|
-
import { EMediaQuery as
|
|
7
|
-
import { ListFiles as
|
|
8
|
-
import { EFileItemVariant as
|
|
9
|
-
import { Uploader as
|
|
10
|
-
import '../../assets/UploaderFiles.css';const
|
|
11
|
-
container:
|
|
12
|
-
white:
|
|
13
|
-
gray:
|
|
14
|
-
compact:
|
|
15
|
-
},
|
|
16
|
-
(
|
|
1
|
+
import { jsxs as X, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { c as k } from "../../index-DIxK0V-G.js";
|
|
3
|
+
import { forwardRef as q, useState as A, useEffect as B } from "react";
|
|
4
|
+
import { EUploaderFilesVariant as F } from "./constants.js";
|
|
5
|
+
import { useMediaQuery as C } from "../../hooks/useMediaQuery/useMediaQuery.js";
|
|
6
|
+
import { EMediaQuery as G } from "../../hooks/useMediaQuery/constants.js";
|
|
7
|
+
import { ListFiles as H } from "../ListFiles/ListFiles.js";
|
|
8
|
+
import { EFileItemVariant as w } from "../ListFiles/constants.js";
|
|
9
|
+
import { Uploader as I } from "../Uploader/Uploader.js";
|
|
10
|
+
import '../../assets/UploaderFiles.css';const J = "_container_aj93w_2", K = "_white_aj93w_11", O = "_gray_aj93w_14", P = "_compact_aj93w_17", n = {
|
|
11
|
+
container: J,
|
|
12
|
+
white: K,
|
|
13
|
+
gray: O,
|
|
14
|
+
compact: P
|
|
15
|
+
}, ri = q(
|
|
16
|
+
(x, _) => {
|
|
17
17
|
const {
|
|
18
|
-
compact:
|
|
19
|
-
readonly:
|
|
20
|
-
filesType:
|
|
21
|
-
arrayName:
|
|
22
|
-
maxSize:
|
|
23
|
-
onChange:
|
|
24
|
-
value:
|
|
25
|
-
name:
|
|
26
|
-
maxFiles:
|
|
18
|
+
compact: h,
|
|
19
|
+
readonly: d,
|
|
20
|
+
filesType: S,
|
|
21
|
+
arrayName: j,
|
|
22
|
+
maxSize: v,
|
|
23
|
+
onChange: s,
|
|
24
|
+
value: r,
|
|
25
|
+
name: p,
|
|
26
|
+
maxFiles: t,
|
|
27
27
|
buttonText: E,
|
|
28
|
-
variant:
|
|
29
|
-
className:
|
|
30
|
-
onMaxFilesExceeded:
|
|
31
|
-
onMaxSizeExceeded:
|
|
32
|
-
onInvalidFileType:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
variant: m = F.White,
|
|
29
|
+
className: b,
|
|
30
|
+
onMaxFilesExceeded: g,
|
|
31
|
+
onMaxSizeExceeded: z,
|
|
32
|
+
onInvalidFileType: N,
|
|
33
|
+
dataTestIdReactMap: a
|
|
34
|
+
} = x, V = C(G.XSS), [e, c] = A(r || []), U = t && e.length >= t, D = m === F.White ? w.gray : w.white;
|
|
35
|
+
B(() => {
|
|
36
|
+
r && c(r);
|
|
37
|
+
}, [r]);
|
|
38
|
+
const M = (o) => {
|
|
39
|
+
const L = [
|
|
39
40
|
...e,
|
|
40
|
-
...
|
|
41
|
-
var
|
|
41
|
+
...o.value.map((i) => {
|
|
42
|
+
var f, y, u;
|
|
42
43
|
return {
|
|
43
|
-
id:
|
|
44
|
+
id: i.id,
|
|
44
45
|
url: "",
|
|
45
|
-
size: (
|
|
46
|
-
name: (
|
|
47
|
-
type: (
|
|
46
|
+
size: (f = i == null ? void 0 : i.file) == null ? void 0 : f.size,
|
|
47
|
+
name: (y = i == null ? void 0 : i.file) == null ? void 0 : y.name,
|
|
48
|
+
type: (u = i == null ? void 0 : i.file) == null ? void 0 : u.type
|
|
48
49
|
};
|
|
49
50
|
})
|
|
50
51
|
];
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
c(L), s == null || s({ type: "add", data: o.value, name: p });
|
|
53
|
+
}, Q = (o) => {
|
|
54
|
+
c(o.list), o.deleteId && (s == null || s({ type: "delete", data: o.deleteId, name: p }));
|
|
55
|
+
}, W = k([
|
|
56
|
+
n.container,
|
|
57
|
+
n[m],
|
|
58
|
+
h && n.compact,
|
|
59
|
+
b
|
|
59
60
|
]);
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
61
|
+
return /* @__PURE__ */ X(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
"data-testid-react": a == null ? void 0 : a.wrapper,
|
|
65
|
+
className: W,
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ l(
|
|
68
|
+
I,
|
|
69
|
+
{
|
|
70
|
+
dataTestIdReactMap: { wrapper: a == null ? void 0 : a.uploader },
|
|
71
|
+
filesType: S,
|
|
72
|
+
arrayName: j,
|
|
73
|
+
maxSize: v,
|
|
74
|
+
onChangeValue: M,
|
|
75
|
+
ref: _,
|
|
76
|
+
buttonSize: V ? "s" : "m",
|
|
77
|
+
maxFiles: t && t - e.length,
|
|
78
|
+
isDisabled: U || d,
|
|
79
|
+
buttonText: E,
|
|
80
|
+
onMaxFilesExceeded: g,
|
|
81
|
+
onMaxSizeExceeded: z,
|
|
82
|
+
onInvalidFileType: N
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ l("div", { "data-testid-react": a == null ? void 0 : a.listFiles, children: /* @__PURE__ */ l(
|
|
86
|
+
H,
|
|
87
|
+
{
|
|
88
|
+
value: e,
|
|
89
|
+
variant: D,
|
|
90
|
+
onChange: Q,
|
|
91
|
+
disabled: d
|
|
92
|
+
}
|
|
93
|
+
) })
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
);
|
|
88
97
|
}
|
|
89
98
|
);
|
|
90
99
|
export {
|
|
91
|
-
|
|
100
|
+
ri as UploaderFiles
|
|
92
101
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EUploaderFilesVariant } from './constants';
|
|
2
|
+
import { TDataTestIdReactMap } from '../../types';
|
|
2
3
|
import { TFilesDetail } from '../ListFiles';
|
|
3
4
|
import { imageTypesArr } from '../Uploader/constants';
|
|
4
5
|
import { TFileItem } from '../Uploader/Uploader';
|
|
@@ -67,6 +68,10 @@ export type TUploaderFiles = {
|
|
|
67
68
|
* Проп для обработки ошибки при загрузке файла неразрешенного типа
|
|
68
69
|
*/
|
|
69
70
|
onInvalidFileType?: (fileName: string) => void;
|
|
71
|
+
/**
|
|
72
|
+
* Объект, для передачи в компонент и его элементы data-testid-react, для автоматизированного тестирования
|
|
73
|
+
*/
|
|
74
|
+
dataTestIdReactMap?: TDataTestIdReactMap<'wrapper' | 'uploader' | 'listFiles'>;
|
|
70
75
|
};
|
|
71
76
|
export type TOnChangeFilesUpdate = {
|
|
72
77
|
type: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TDataTestIdReactMap } from '../../types';
|
|
1
2
|
import { TPhotosDetail } from '../ListPhotos/ListPhotos';
|
|
2
3
|
import { imageTypesArr } from '../Uploader/constants';
|
|
3
4
|
import { TFileItem } from '../Uploader/Uploader';
|
|
@@ -60,6 +61,10 @@ export type TUploaderPhotos = {
|
|
|
60
61
|
* Флаг, указывающий что изображение загружается
|
|
61
62
|
*/
|
|
62
63
|
isDownloadingImage?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Объект, для передачи в компонент и его элементы data-testid-react, для автоматизированного тестирования
|
|
66
|
+
*/
|
|
67
|
+
dataTestIdReactMap?: TDataTestIdReactMap<'wrapper' | 'uploader' | 'listPhotos'>;
|
|
63
68
|
};
|
|
64
69
|
export type TOnChangePhotosUpdate = {
|
|
65
70
|
type: string;
|
|
@@ -1,82 +1,85 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { ListPhotos as
|
|
5
|
-
import { Uploader as
|
|
6
|
-
import '../../assets/UploaderPhotos.css';const
|
|
1
|
+
import { jsxs as L, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { c as N } from "../../index-DIxK0V-G.js";
|
|
3
|
+
import { forwardRef as S, useState as _, useEffect as z } from "react";
|
|
4
|
+
import { ListPhotos as j } from "../ListPhotos/ListPhotos.js";
|
|
5
|
+
import { Uploader as I } from "../Uploader/Uploader.js";
|
|
6
|
+
import '../../assets/UploaderPhotos.css';const m = {
|
|
7
7
|
"upload-file-wrapper": "_upload-file-wrapper_1a115_2"
|
|
8
|
-
},
|
|
9
|
-
(
|
|
8
|
+
}, B = S(
|
|
9
|
+
(c, f) => {
|
|
10
10
|
const {
|
|
11
|
-
filesType:
|
|
12
|
-
arrayName:
|
|
13
|
-
maxSize:
|
|
14
|
-
onChange:
|
|
15
|
-
value:
|
|
16
|
-
maxFiles:
|
|
17
|
-
titleUploader:
|
|
18
|
-
name:
|
|
11
|
+
filesType: u,
|
|
12
|
+
arrayName: x,
|
|
13
|
+
maxSize: h,
|
|
14
|
+
onChange: o,
|
|
15
|
+
value: a,
|
|
16
|
+
maxFiles: r,
|
|
17
|
+
titleUploader: w,
|
|
18
|
+
name: d,
|
|
19
19
|
buttonText: v = "Выберите файлы",
|
|
20
|
-
onMaxFilesExceeded:
|
|
21
|
-
onMaxSizeExceeded:
|
|
22
|
-
onInvalidFileType:
|
|
23
|
-
loadImage:
|
|
24
|
-
isDownloadingImage:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
onMaxFilesExceeded: g,
|
|
21
|
+
onMaxSizeExceeded: y,
|
|
22
|
+
onInvalidFileType: F,
|
|
23
|
+
loadImage: P,
|
|
24
|
+
isDownloadingImage: U,
|
|
25
|
+
dataTestIdReactMap: e
|
|
26
|
+
} = c, [t, i] = _(a || []), p = t.length >= r;
|
|
27
|
+
z(() => {
|
|
28
|
+
a && i(a);
|
|
29
|
+
}, [a]);
|
|
30
|
+
const b = (l) => {
|
|
31
|
+
const E = [
|
|
31
32
|
...t,
|
|
32
|
-
...
|
|
33
|
-
url: URL.createObjectURL(
|
|
34
|
-
id:
|
|
33
|
+
...l.value.map((n) => ({
|
|
34
|
+
url: URL.createObjectURL(n.file),
|
|
35
|
+
id: n.id
|
|
35
36
|
}))
|
|
36
37
|
];
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
l
|
|
38
|
+
i(E), o == null || o({ type: "add", data: l.value, name: d });
|
|
39
|
+
}, D = (l) => {
|
|
40
|
+
i(l.list), l.deleteId && (o == null || o({ type: "delete", data: l.deleteId, name: d }));
|
|
40
41
|
};
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ L(
|
|
42
43
|
"div",
|
|
43
44
|
{
|
|
44
|
-
className:
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
className: N(
|
|
46
|
+
m["upload-file-wrapper"],
|
|
47
|
+
p && m.disabled
|
|
47
48
|
),
|
|
49
|
+
"data-testid-react": e == null ? void 0 : e.wrapper,
|
|
48
50
|
children: [
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
|
|
51
|
+
/* @__PURE__ */ s(
|
|
52
|
+
I,
|
|
51
53
|
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
dataTestIdReactMap: { wrapper: e == null ? void 0 : e.uploader },
|
|
55
|
+
filesType: u,
|
|
56
|
+
arrayName: x,
|
|
57
|
+
maxSize: h,
|
|
58
|
+
onChangeValue: b,
|
|
59
|
+
ref: f,
|
|
60
|
+
maxFiles: r - t.length,
|
|
61
|
+
isDisabled: p,
|
|
62
|
+
titleUploader: w,
|
|
60
63
|
buttonText: v,
|
|
61
|
-
onMaxFilesExceeded:
|
|
62
|
-
onMaxSizeExceeded:
|
|
63
|
-
onInvalidFileType:
|
|
64
|
+
onMaxFilesExceeded: g,
|
|
65
|
+
onMaxSizeExceeded: y,
|
|
66
|
+
onInvalidFileType: F
|
|
64
67
|
}
|
|
65
68
|
),
|
|
66
|
-
!!t.length && /* @__PURE__ */
|
|
67
|
-
|
|
69
|
+
!!t.length && /* @__PURE__ */ s("div", { "data-testid-react": e == null ? void 0 : e.listPhotos, children: /* @__PURE__ */ s(
|
|
70
|
+
j,
|
|
68
71
|
{
|
|
69
72
|
value: t,
|
|
70
|
-
onChange:
|
|
71
|
-
loadImage:
|
|
72
|
-
isDownloadingImage:
|
|
73
|
+
onChange: D,
|
|
74
|
+
loadImage: P,
|
|
75
|
+
isDownloadingImage: U
|
|
73
76
|
}
|
|
74
|
-
)
|
|
77
|
+
) })
|
|
75
78
|
]
|
|
76
79
|
}
|
|
77
80
|
);
|
|
78
81
|
}
|
|
79
82
|
);
|
|
80
83
|
export {
|
|
81
|
-
|
|
84
|
+
B as UploaderPhotos
|
|
82
85
|
};
|
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Button as e } from "./Button/Button.js";
|
|
2
2
|
import { EButtonForm as a, EButtonSize as p, EButtonVariantBorderless as i, EButtonVariantDefault as m, EButtonVariantOutline as n, EButtonVariantRound as x } from "./Button/constants.js";
|
|
3
|
-
import { I as l } from "../Input-
|
|
3
|
+
import { I as l } from "../Input-CqNPT8os.js";
|
|
4
4
|
import { EInputSize as S, EInputStatus as d, EInputVariant as s } from "./Input/constants.js";
|
|
5
5
|
import { TextArea as c } from "./TextArea/TextArea.js";
|
|
6
6
|
import { ETextAreaInputSize as B } from "./TextArea/constants.js";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Button as e } from "./components/Button/Button.js";
|
|
2
2
|
import { EButtonForm as p, EButtonSize as a, EButtonVariantBorderless as i, EButtonVariantDefault as m, EButtonVariantOutline as f, EButtonVariantRound as x } from "./components/Button/constants.js";
|
|
3
|
-
import { I as l } from "./Input-
|
|
3
|
+
import { I as l } from "./Input-CqNPT8os.js";
|
|
4
4
|
import { EInputSize as E, EInputStatus as u, EInputVariant as S } from "./components/Input/constants.js";
|
|
5
5
|
import { TextArea as c } from "./components/TextArea/TextArea.js";
|
|
6
6
|
import { ETextAreaInputSize as B } from "./components/TextArea/constants.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TDataTestIdReactMap<TKey extends string> = Partial<Record<TKey, string>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
package/dist/Input-DPnH8pKc.js
DELETED
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
import { jsxs as V, jsx as s, Fragment as U } from "react/jsx-runtime";
|
|
2
|
-
import { c as i } from "./index-DIxK0V-G.js";
|
|
3
|
-
import { memo as X, forwardRef as Y, useState as Z, useRef as ee, useEffect as B } from "react";
|
|
4
|
-
import { EInputVariant as ae } from "./components/Input/constants.js";
|
|
5
|
-
import { useMergeRefs as te } from "./hooks/useMergeRefs/useMergeRefs.js";
|
|
6
|
-
import { Icon as re } from "./icons/Icon.js";
|
|
7
|
-
import { Button as se } from "./components/Button/Button.js";
|
|
8
|
-
import './assets/Input.css';const le = "_label_1peof_26", oe = "_input_1peof_2", ne = "_disabled_1peof_117", ie = "_clear_1peof_158", ce = "_s_1peof_218", de = "_m_1peof_233", ue = "_l_1peof_26", pe = "_success_1peof_289", _e = "_alarm_1peof_309", fe = "_error_1peof_329", e = {
|
|
9
|
-
"input-wrapper": "_input-wrapper_1peof_2",
|
|
10
|
-
"required-mark": "_required-mark_1peof_16",
|
|
11
|
-
label: le,
|
|
12
|
-
"has-left-slot": "_has-left-slot_1peof_45",
|
|
13
|
-
"has-right-slot": "_has-right-slot_1peof_48",
|
|
14
|
-
"active-label": "_active-label_1peof_53",
|
|
15
|
-
"label-text-wrapper": "_label-text-wrapper_1peof_68",
|
|
16
|
-
input: oe,
|
|
17
|
-
"has-label": "_has-label_1peof_114",
|
|
18
|
-
disabled: ne,
|
|
19
|
-
"addon-icon": "_addon-icon_1peof_123",
|
|
20
|
-
"left-slot": "_left-slot_1peof_127",
|
|
21
|
-
"right-slot": "_right-slot_1peof_128",
|
|
22
|
-
clear: ie,
|
|
23
|
-
"border-radius-left": "_border-radius-left_1peof_206",
|
|
24
|
-
"border-radius-right": "_border-radius-right_1peof_210",
|
|
25
|
-
"border-radius-none": "_border-radius-none_1peof_214",
|
|
26
|
-
s: ce,
|
|
27
|
-
m: de,
|
|
28
|
-
l: ue,
|
|
29
|
-
"default-gray": "_default-gray_1peof_262",
|
|
30
|
-
"default-white": "_default-white_1peof_274",
|
|
31
|
-
success: pe,
|
|
32
|
-
alarm: _e,
|
|
33
|
-
error: fe
|
|
34
|
-
}, z = (a) => {
|
|
35
|
-
var p, l;
|
|
36
|
-
if (!a)
|
|
37
|
-
return null;
|
|
38
|
-
switch (a.addonType) {
|
|
39
|
-
case "icon": {
|
|
40
|
-
const _ = (p = a.addonContent) == null ? void 0 : p.includes("16px"), g = (l = a.addonContent) == null ? void 0 : l.includes("24px");
|
|
41
|
-
return /* @__PURE__ */ s(
|
|
42
|
-
re,
|
|
43
|
-
{
|
|
44
|
-
style: {
|
|
45
|
-
"--icon-size": i({
|
|
46
|
-
"16px": _,
|
|
47
|
-
"24px": g
|
|
48
|
-
})
|
|
49
|
-
},
|
|
50
|
-
className: e["addon-icon"],
|
|
51
|
-
iconName: a.addonContent
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
case "text":
|
|
56
|
-
return a.addonContent;
|
|
57
|
-
case "react-node":
|
|
58
|
-
return /* @__PURE__ */ s(U, { children: a.addonContent });
|
|
59
|
-
default:
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
}, me = X(
|
|
63
|
-
Y(
|
|
64
|
-
(a, p) => {
|
|
65
|
-
const {
|
|
66
|
-
value: l,
|
|
67
|
-
className: _,
|
|
68
|
-
wrapperClassName: g,
|
|
69
|
-
rightSlotClassName: F,
|
|
70
|
-
requiredMarkClassName: L,
|
|
71
|
-
variant: k = ae.DefaultGray,
|
|
72
|
-
type: j = "text",
|
|
73
|
-
autofocus: q,
|
|
74
|
-
readonly: c,
|
|
75
|
-
id: I,
|
|
76
|
-
onFocus: N,
|
|
77
|
-
onBlur: x,
|
|
78
|
-
label: u,
|
|
79
|
-
withClearButton: D,
|
|
80
|
-
disabled: t,
|
|
81
|
-
onChange: d,
|
|
82
|
-
rightAddon: E,
|
|
83
|
-
status: A,
|
|
84
|
-
leftAddon: M,
|
|
85
|
-
size: w = "m",
|
|
86
|
-
numbersOnly: O,
|
|
87
|
-
required: C,
|
|
88
|
-
maxLength: y,
|
|
89
|
-
autocomplete: S = "on",
|
|
90
|
-
borderRadius: R = "all",
|
|
91
|
-
...T
|
|
92
|
-
} = a, [f, m] = Z(!!l), r = ee(null), G = te(r, p);
|
|
93
|
-
B(() => {
|
|
94
|
-
q && r.current && r.current.focus();
|
|
95
|
-
}, [q]), B(() => {
|
|
96
|
-
m(!!l);
|
|
97
|
-
}, [l]);
|
|
98
|
-
const P = (o) => {
|
|
99
|
-
const n = o.currentTarget.value;
|
|
100
|
-
x == null || x(o), m(!!n);
|
|
101
|
-
}, W = (o) => {
|
|
102
|
-
c || N == null || N(o);
|
|
103
|
-
}, $ = () => {
|
|
104
|
-
r != null && r.current && (r.current.value = "", r.current.focus(), m(!1), d == null || d({
|
|
105
|
-
target: r.current
|
|
106
|
-
}));
|
|
107
|
-
}, H = (o) => {
|
|
108
|
-
let n = o.target.value;
|
|
109
|
-
O && (n = n.replace(/\D/g, "")), y !== void 0 && (n = n.slice(0, y)), o.target.value = n, d == null || d(o), m(!!n);
|
|
110
|
-
}, h = z(M), b = z(E), J = {
|
|
111
|
-
[e.readonly]: t || c,
|
|
112
|
-
[e.disabled]: t || c,
|
|
113
|
-
[e["has-label"]]: !!u,
|
|
114
|
-
[e["has-left-slot"]]: !!h,
|
|
115
|
-
[e["has-right-slot"]]: !!b
|
|
116
|
-
}, v = f || !!l, K = i(e.label, _, e[w], {
|
|
117
|
-
[e["active-label"]]: v,
|
|
118
|
-
[e.disabled]: t || c,
|
|
119
|
-
[e["has-left-slot"]]: !!h,
|
|
120
|
-
[e["has-right-slot"]]: !!b
|
|
121
|
-
}), Q = i(e.input, J, _, [
|
|
122
|
-
e[k],
|
|
123
|
-
e[A ?? ""],
|
|
124
|
-
e[w]
|
|
125
|
-
]);
|
|
126
|
-
return /* @__PURE__ */ V(
|
|
127
|
-
"div",
|
|
128
|
-
{
|
|
129
|
-
className: i(
|
|
130
|
-
e["input-wrapper"],
|
|
131
|
-
e[k],
|
|
132
|
-
e[A ?? ""],
|
|
133
|
-
e[w],
|
|
134
|
-
{
|
|
135
|
-
[e.disabled]: t || c,
|
|
136
|
-
[e[`border-radius-${R}`]]: R !== "all"
|
|
137
|
-
},
|
|
138
|
-
g
|
|
139
|
-
),
|
|
140
|
-
children: [
|
|
141
|
-
u && /* @__PURE__ */ V("label", { htmlFor: I, className: K, children: [
|
|
142
|
-
/* @__PURE__ */ s("span", { className: e["label-text-wrapper"], children: u }),
|
|
143
|
-
C && (f || v) && /* @__PURE__ */ s(
|
|
144
|
-
"span",
|
|
145
|
-
{
|
|
146
|
-
className: e["required-mark"],
|
|
147
|
-
"data-testid": "required-mark"
|
|
148
|
-
}
|
|
149
|
-
)
|
|
150
|
-
] }),
|
|
151
|
-
h && /* @__PURE__ */ s(
|
|
152
|
-
"span",
|
|
153
|
-
{
|
|
154
|
-
className: i(e["left-slot"], {
|
|
155
|
-
[e["has-label"]]: !!u,
|
|
156
|
-
[e.disabled]: t
|
|
157
|
-
}),
|
|
158
|
-
children: h
|
|
159
|
-
}
|
|
160
|
-
),
|
|
161
|
-
/* @__PURE__ */ s(
|
|
162
|
-
"input",
|
|
163
|
-
{
|
|
164
|
-
ref: G,
|
|
165
|
-
type: j,
|
|
166
|
-
id: I,
|
|
167
|
-
className: Q,
|
|
168
|
-
onFocus: W,
|
|
169
|
-
onBlur: P,
|
|
170
|
-
readOnly: c,
|
|
171
|
-
value: l,
|
|
172
|
-
onChange: H,
|
|
173
|
-
maxLength: y,
|
|
174
|
-
disabled: t,
|
|
175
|
-
required: C,
|
|
176
|
-
autoComplete: S,
|
|
177
|
-
...T
|
|
178
|
-
}
|
|
179
|
-
),
|
|
180
|
-
b && /* @__PURE__ */ s(
|
|
181
|
-
"span",
|
|
182
|
-
{
|
|
183
|
-
className: i(e["right-slot"], F, {
|
|
184
|
-
[e["has-label"]]: !!u,
|
|
185
|
-
[e.disabled]: t
|
|
186
|
-
}),
|
|
187
|
-
children: b
|
|
188
|
-
}
|
|
189
|
-
),
|
|
190
|
-
C && !f && !v && /* @__PURE__ */ s(
|
|
191
|
-
"span",
|
|
192
|
-
{
|
|
193
|
-
className: i(
|
|
194
|
-
e["required-mark"],
|
|
195
|
-
L
|
|
196
|
-
),
|
|
197
|
-
"data-testid": "required-mark"
|
|
198
|
-
}
|
|
199
|
-
),
|
|
200
|
-
D && f && /* @__PURE__ */ s(
|
|
201
|
-
se,
|
|
202
|
-
{
|
|
203
|
-
tabIndex: -1,
|
|
204
|
-
className: i(e.clear, {
|
|
205
|
-
[e.disabled]: t
|
|
206
|
-
}),
|
|
207
|
-
isIconButton: !0,
|
|
208
|
-
iconName: "Close16px",
|
|
209
|
-
size: "m-s",
|
|
210
|
-
clear: !0,
|
|
211
|
-
disabled: t || c,
|
|
212
|
-
variant: "secondary-gray",
|
|
213
|
-
onClick: $,
|
|
214
|
-
"data-testid": "clear-button"
|
|
215
|
-
}
|
|
216
|
-
)
|
|
217
|
-
]
|
|
218
|
-
}
|
|
219
|
-
);
|
|
220
|
-
}
|
|
221
|
-
)
|
|
222
|
-
);
|
|
223
|
-
me.displayName = "Input";
|
|
224
|
-
export {
|
|
225
|
-
me as I,
|
|
226
|
-
e as c
|
|
227
|
-
};
|