@max-ts/components 0.2.1 → 0.2.3
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/lib/components/Autocomplete/Autocomplete.mjs +53 -53
- package/lib/components/DataGrid/useLogic/utils/getGridTemplateColumns/getGridTemplateColumns.mjs +2 -2
- package/lib/components/SearchField/SearchField.d.ts +3 -1
- package/lib/components/SearchField/SearchField.mjs +40 -37
- package/lib/components/SearchField/styles.mjs +7 -9
- package/lib/components/Select/Select.d.ts +2 -2
- package/lib/components/Select/Select.mjs +35 -34
- package/lib/components/Select/styles.d.ts +1 -1
- package/lib/components/Select/styles.mjs +18 -16
- package/lib/components/Tag/styles.mjs +2 -2
- package/lib/components/TextField/TextField.d.ts +2 -2
- package/lib/components/TextField/TextField.mjs +26 -26
- package/lib/theme/components/MuiAutocomplete.mjs +1 -2
- package/lib/theme/palette/palette.mjs +18 -18
- package/package.json +13 -13
|
@@ -1,92 +1,92 @@
|
|
|
1
1
|
import { j as r } from "../../_virtual/jsx-runtime.mjs";
|
|
2
2
|
import { useCallback as n, createElement as y } from "react";
|
|
3
|
-
import { ListItemIcon as F, Popper as M, Autocomplete as H } from "@mui/material";
|
|
3
|
+
import { ListItemIcon as F, Popper as M, Autocomplete as z, SvgIcon as H } from "@mui/material";
|
|
4
4
|
import { Checkbox as N } from "../Checkbox/Checkbox.mjs";
|
|
5
5
|
import { CircularProgress as V } from "../CircularProgress/CircularProgress.mjs";
|
|
6
6
|
import { OverflowTypography as q } from "../OverflowTypography/OverflowTypography.mjs";
|
|
7
|
-
import { Tag as
|
|
8
|
-
import { TextField as
|
|
9
|
-
import { X as C, ChevronDown as
|
|
10
|
-
import { DEFAULT_PLACEHOLDER as
|
|
11
|
-
import { StyledMenuItem as
|
|
12
|
-
import { useLogic as
|
|
13
|
-
const
|
|
14
|
-
const { isValueEmpty: x, isPopperVisible: f, autocompleteProps: R } =
|
|
7
|
+
import { Tag as B } from "../Tag/Tag.mjs";
|
|
8
|
+
import { TextField as W } from "../TextField/TextField.mjs";
|
|
9
|
+
import { X as C, ChevronDown as X } from "lucide-react";
|
|
10
|
+
import { DEFAULT_PLACEHOLDER as $, DEFAULT_AUTOCOMPLETE_ELEMENT_ROWS_COUNT as G } from "./constants.mjs";
|
|
11
|
+
import { StyledMenuItem as J } from "./styles.mjs";
|
|
12
|
+
import { useLogic as K } from "./useLogic/useLogic.mjs";
|
|
13
|
+
const de = (d) => {
|
|
14
|
+
const { isValueEmpty: x, isPopperVisible: f, autocompleteProps: R } = K(d), {
|
|
15
15
|
required: T,
|
|
16
16
|
success: E,
|
|
17
|
-
error:
|
|
18
|
-
label:
|
|
17
|
+
error: h,
|
|
18
|
+
label: j,
|
|
19
19
|
getOptionLabel: l,
|
|
20
|
-
helperText:
|
|
21
|
-
inputRef:
|
|
20
|
+
helperText: I,
|
|
21
|
+
inputRef: O,
|
|
22
22
|
multiple: t,
|
|
23
23
|
size: i = "medium",
|
|
24
|
-
placeholder: g =
|
|
24
|
+
placeholder: g = $,
|
|
25
25
|
overflowOption: L,
|
|
26
26
|
closeText: k = "Закрыть",
|
|
27
27
|
openText: A = "Открыть",
|
|
28
28
|
clearText: D = "Очистить",
|
|
29
29
|
loadingText: P = /* @__PURE__ */ r.jsx(V, { color: "primary" }),
|
|
30
|
-
isLoadedDataError:
|
|
31
|
-
loadedDataError:
|
|
32
|
-
noOptionsText:
|
|
33
|
-
autoHighlight:
|
|
34
|
-
renderInput:
|
|
35
|
-
renderTags:
|
|
36
|
-
renderOption:
|
|
37
|
-
...
|
|
38
|
-
} = d,
|
|
30
|
+
isLoadedDataError: Q,
|
|
31
|
+
loadedDataError: Y,
|
|
32
|
+
noOptionsText: Z,
|
|
33
|
+
autoHighlight: ee,
|
|
34
|
+
renderInput: s,
|
|
35
|
+
renderTags: c,
|
|
36
|
+
renderOption: p,
|
|
37
|
+
...S
|
|
38
|
+
} = d, _ = n(
|
|
39
39
|
(e) => {
|
|
40
40
|
const o = {
|
|
41
41
|
...e,
|
|
42
|
-
inputRef:
|
|
42
|
+
inputRef: O,
|
|
43
43
|
required: T,
|
|
44
44
|
placeholder: x ? g : "",
|
|
45
|
-
label:
|
|
45
|
+
label: j,
|
|
46
46
|
success: E,
|
|
47
|
-
error:
|
|
48
|
-
helperText:
|
|
47
|
+
error: h,
|
|
48
|
+
helperText: I,
|
|
49
49
|
size: i
|
|
50
50
|
};
|
|
51
|
-
return
|
|
51
|
+
return s ? s(o) : /* @__PURE__ */ r.jsx(W, { ...o });
|
|
52
52
|
},
|
|
53
53
|
[
|
|
54
54
|
x,
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
s,
|
|
56
|
+
O,
|
|
57
57
|
T,
|
|
58
58
|
g,
|
|
59
|
-
h,
|
|
60
|
-
E,
|
|
61
|
-
O,
|
|
62
59
|
j,
|
|
60
|
+
E,
|
|
61
|
+
h,
|
|
62
|
+
I,
|
|
63
63
|
i
|
|
64
64
|
]
|
|
65
|
-
),
|
|
65
|
+
), v = n(
|
|
66
66
|
(e, o, m, a) => {
|
|
67
|
-
if (
|
|
68
|
-
return
|
|
67
|
+
if (p)
|
|
68
|
+
return p(
|
|
69
69
|
e,
|
|
70
70
|
o,
|
|
71
71
|
m,
|
|
72
72
|
a
|
|
73
73
|
);
|
|
74
74
|
const u = !!e["aria-selected"];
|
|
75
|
-
return /* @__PURE__ */ y(
|
|
75
|
+
return /* @__PURE__ */ y(J, { ...e, key: e.id }, t && /* @__PURE__ */ r.jsx(F, { children: /* @__PURE__ */ r.jsx(N, { role: "menuitemcheckbox", checked: u }) }), /* @__PURE__ */ r.jsx(
|
|
76
76
|
q,
|
|
77
77
|
{
|
|
78
|
-
rowsCount:
|
|
78
|
+
rowsCount: G,
|
|
79
79
|
...L,
|
|
80
80
|
children: e.key
|
|
81
81
|
}
|
|
82
82
|
));
|
|
83
83
|
},
|
|
84
|
-
[t, L,
|
|
85
|
-
),
|
|
86
|
-
(e, o, m) =>
|
|
84
|
+
[t, L, p]
|
|
85
|
+
), w = n(
|
|
86
|
+
(e, o, m) => c ? c(e, o, m) : e.map((a, u) => {
|
|
87
87
|
const b = l?.(a) || "";
|
|
88
88
|
return /* @__PURE__ */ y(
|
|
89
|
-
|
|
89
|
+
B,
|
|
90
90
|
{
|
|
91
91
|
deleteIcon: /* @__PURE__ */ r.jsx(C, {}),
|
|
92
92
|
color: "grey",
|
|
@@ -96,15 +96,15 @@ const ue = (d) => {
|
|
|
96
96
|
}
|
|
97
97
|
);
|
|
98
98
|
}),
|
|
99
|
-
[l,
|
|
100
|
-
),
|
|
99
|
+
[l, c]
|
|
100
|
+
), U = n(
|
|
101
101
|
(e) => f ? /* @__PURE__ */ r.jsx(M, { ...e }) : null,
|
|
102
102
|
[f]
|
|
103
103
|
);
|
|
104
104
|
return /* @__PURE__ */ r.jsx(
|
|
105
|
-
|
|
105
|
+
z,
|
|
106
106
|
{
|
|
107
|
-
...
|
|
107
|
+
...S,
|
|
108
108
|
size: i,
|
|
109
109
|
clearText: D,
|
|
110
110
|
closeText: k,
|
|
@@ -112,23 +112,23 @@ const ue = (d) => {
|
|
|
112
112
|
loadingText: P,
|
|
113
113
|
multiple: t,
|
|
114
114
|
disableCloseOnSelect: t,
|
|
115
|
-
clearIcon: /* @__PURE__ */ r.jsx(C, {}),
|
|
116
|
-
popupIcon: /* @__PURE__ */ r.jsx(
|
|
115
|
+
clearIcon: /* @__PURE__ */ r.jsx(H, { children: /* @__PURE__ */ r.jsx(C, {}) }),
|
|
116
|
+
popupIcon: /* @__PURE__ */ r.jsx(X, { size: 16 }),
|
|
117
117
|
forcePopupIcon: !0,
|
|
118
118
|
slotProps: {
|
|
119
119
|
clearIndicator: { disableRipple: !0 },
|
|
120
120
|
popper: {
|
|
121
|
-
component:
|
|
121
|
+
component: U
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
124
|
getOptionLabel: l,
|
|
125
|
-
renderInput:
|
|
126
|
-
renderTags:
|
|
127
|
-
renderOption:
|
|
125
|
+
renderInput: _,
|
|
126
|
+
renderTags: w,
|
|
127
|
+
renderOption: v,
|
|
128
128
|
...R
|
|
129
129
|
}
|
|
130
130
|
);
|
|
131
131
|
};
|
|
132
132
|
export {
|
|
133
|
-
|
|
133
|
+
de as Autocomplete
|
|
134
134
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { TextFieldProps } from '../TextField';
|
|
2
|
-
export type SearchFieldProps = Omit<TextFieldProps, 'startAdornment' | 'endAdornment'
|
|
2
|
+
export type SearchFieldProps = Omit<TextFieldProps, 'startAdornment' | 'endAdornment'> & {
|
|
3
|
+
delay?: number;
|
|
4
|
+
};
|
|
3
5
|
export declare const SearchField: import('react').ForwardRefExoticComponent<Omit<SearchFieldProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,57 +1,60 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { StyledTextField as
|
|
4
|
-
const
|
|
1
|
+
import { j as r } from "../../_virtual/jsx-runtime.mjs";
|
|
2
|
+
import { forwardRef as j, useState as b, useRef as i } from "react";
|
|
3
|
+
import { StyledTextField as y, StyledIconButton as A, StyledCloseFillSm as R, StyledSearchIcon as g } from "./styles.mjs";
|
|
4
|
+
const B = j(
|
|
5
5
|
({
|
|
6
|
-
margin:
|
|
7
|
-
placeholder:
|
|
8
|
-
onChange:
|
|
9
|
-
disabled:
|
|
10
|
-
value:
|
|
11
|
-
defaultValue:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
margin: s = "none",
|
|
7
|
+
placeholder: d = "Поиск",
|
|
8
|
+
onChange: l,
|
|
9
|
+
disabled: u,
|
|
10
|
+
value: m,
|
|
11
|
+
defaultValue: f,
|
|
12
|
+
delay: p = 600,
|
|
13
|
+
...v
|
|
14
|
+
}, x) => {
|
|
15
|
+
const [c, o] = b(`${f || m || ""}`), t = i(null), e = i(null), S = (n) => {
|
|
16
|
+
o(n.target.value), t.current && clearTimeout(t.current), t.current = setTimeout(() => {
|
|
17
|
+
l?.(n);
|
|
18
|
+
}, p);
|
|
19
|
+
}, h = () => {
|
|
20
|
+
o(""), e.current && (e.current.value = ""), t.current && clearTimeout(t.current);
|
|
21
|
+
const n = new InputEvent("input", {
|
|
19
22
|
bubbles: !0,
|
|
20
23
|
cancelable: !0
|
|
21
24
|
});
|
|
22
|
-
Object.defineProperty(
|
|
25
|
+
Object.defineProperty(n, "target", {
|
|
23
26
|
writable: !0,
|
|
24
27
|
value: e.current
|
|
25
|
-
}),
|
|
26
|
-
},
|
|
28
|
+
}), l?.(n), e.current?.focus();
|
|
29
|
+
}, C = () => {
|
|
27
30
|
e.current?.focus();
|
|
28
|
-
}, a = !!
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
|
|
31
|
+
}, a = !!c.length;
|
|
32
|
+
return /* @__PURE__ */ r.jsx(
|
|
33
|
+
y,
|
|
31
34
|
{
|
|
32
|
-
margin:
|
|
33
|
-
placeholder:
|
|
34
|
-
startAdornment: /* @__PURE__ */
|
|
35
|
-
disabled:
|
|
36
|
-
endAdornment: /* @__PURE__ */
|
|
37
|
-
|
|
35
|
+
margin: s,
|
|
36
|
+
placeholder: d,
|
|
37
|
+
startAdornment: /* @__PURE__ */ r.jsx(g, { onClick: C }),
|
|
38
|
+
disabled: u,
|
|
39
|
+
endAdornment: /* @__PURE__ */ r.jsx(
|
|
40
|
+
A,
|
|
38
41
|
{
|
|
39
42
|
variant: "text",
|
|
40
|
-
onClick:
|
|
41
|
-
disabled:
|
|
43
|
+
onClick: h,
|
|
44
|
+
disabled: u || !a,
|
|
42
45
|
$isActive: a,
|
|
43
|
-
children: /* @__PURE__ */
|
|
46
|
+
children: /* @__PURE__ */ r.jsx(R, {})
|
|
44
47
|
}
|
|
45
48
|
),
|
|
46
|
-
onChange:
|
|
47
|
-
value:
|
|
48
|
-
ref:
|
|
49
|
+
onChange: S,
|
|
50
|
+
value: c,
|
|
51
|
+
ref: x,
|
|
49
52
|
inputRef: e,
|
|
50
|
-
...
|
|
53
|
+
...v
|
|
51
54
|
}
|
|
52
55
|
);
|
|
53
56
|
}
|
|
54
57
|
);
|
|
55
58
|
export {
|
|
56
|
-
|
|
59
|
+
B as SearchField
|
|
57
60
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { styled as o } from "@mui/material";
|
|
2
|
-
import { Search as e,
|
|
2
|
+
import { Search as e, X as r } from "lucide-react";
|
|
3
3
|
import { IconButton as l } from "../IconButton/IconButton.mjs";
|
|
4
4
|
import { TextField as i } from "../TextField/TextField.mjs";
|
|
5
|
-
const
|
|
5
|
+
const d = o(e)`
|
|
6
6
|
color: ${({ theme: t }) => t.palette.grey[600]};
|
|
7
|
-
`,
|
|
7
|
+
`, a = o(l, {
|
|
8
8
|
shouldForwardProp: (t) => !["$isActive"].includes(t.toString())
|
|
9
9
|
})`
|
|
10
10
|
opacity: ${({ $isActive: t }) => t ? 1 : 0};
|
|
@@ -13,23 +13,21 @@ const a = o(e)`
|
|
|
13
13
|
background-color: transparent;
|
|
14
14
|
|
|
15
15
|
svg {
|
|
16
|
-
|
|
16
|
+
stroke: ${({ theme: t }) => t.palette.grey[700]};
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
`, m = o(i)`
|
|
20
20
|
& .MuiFormHelperText-root {
|
|
21
|
-
/* TODO Убрать после реализации https://track.astral.ru/soft/browse/UIKIT-1333 */
|
|
22
21
|
display: none;
|
|
23
22
|
}
|
|
24
23
|
`, y = o(r)`
|
|
25
24
|
width: 16px;
|
|
26
25
|
height: 16px;
|
|
27
|
-
|
|
28
|
-
fill: ${({ theme: t }) => t.palette.grey[500]};
|
|
26
|
+
stroke: ${({ theme: t }) => t.palette.grey[500]};
|
|
29
27
|
`;
|
|
30
28
|
export {
|
|
31
29
|
y as StyledCloseFillSm,
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
a as StyledIconButton,
|
|
31
|
+
d as StyledSearchIcon,
|
|
34
32
|
m as StyledTextField
|
|
35
33
|
};
|
|
@@ -4,7 +4,7 @@ import { WithoutEmotionSpecific } from '../types';
|
|
|
4
4
|
export type SelectProps<Value> = WithoutEmotionSpecific<Omit<MuiSelectProps<Value>, 'variant'>> & {
|
|
5
5
|
loading?: boolean;
|
|
6
6
|
placeholder?: string;
|
|
7
|
-
getOptionLabel?: (value:
|
|
7
|
+
getOptionLabel?: (value: Value) => string | number;
|
|
8
8
|
/**
|
|
9
9
|
* Добавляет вспомогательный текст под селектом
|
|
10
10
|
*/
|
|
@@ -22,4 +22,4 @@ export type SelectProps<Value> = WithoutEmotionSpecific<Omit<MuiSelectProps<Valu
|
|
|
22
22
|
error?: boolean;
|
|
23
23
|
label?: string;
|
|
24
24
|
};
|
|
25
|
-
export declare
|
|
25
|
+
export declare function Select<Value>({ required, getOptionLabel, placeholder, helperText, hideHelperText, loading, success, children, disabled, error, label, fullWidth, onChange: externalOnChange, isShowClearButton, ...props }: SelectProps<Value>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,25 +5,26 @@ import { FormHelperText as R } from "../FormHelperText/FormHelperText.mjs";
|
|
|
5
5
|
import "react";
|
|
6
6
|
import "../FormHelperText/FormHelperTextContent/styles.mjs";
|
|
7
7
|
import { MenuItem as w } from "../MenuItem/MenuItem.mjs";
|
|
8
|
-
import { TagsList as
|
|
9
|
-
import { ChevronDown as
|
|
10
|
-
import { CLEAR_TEXT as
|
|
11
|
-
import { StyledSelect as
|
|
12
|
-
import { useLogic as
|
|
13
|
-
const
|
|
8
|
+
import { TagsList as z } from "../TagsList/TagsList.mjs";
|
|
9
|
+
import { ChevronDown as D, ChevronUp as H } from "lucide-react";
|
|
10
|
+
import { CLEAR_TEXT as h } from "./constants.mjs";
|
|
11
|
+
import { StyledSelect as M, Placeholder as N, ProgressWrapper as U, EndAdornmentWrapper as V, StyledIconButton as C, StyledCloseFillSm as W } from "./styles.mjs";
|
|
12
|
+
import { useLogic as X } from "./useLogic/useLogic.mjs";
|
|
13
|
+
const _ = ({ onClick: s, disabled: o, ref: t }) => /* @__PURE__ */ r.jsx(
|
|
14
14
|
C,
|
|
15
15
|
{
|
|
16
|
-
disabled:
|
|
16
|
+
disabled: o,
|
|
17
17
|
ref: t,
|
|
18
18
|
onClick: s,
|
|
19
19
|
variant: "text",
|
|
20
|
-
title:
|
|
21
|
-
"aria-label":
|
|
22
|
-
children: /* @__PURE__ */ r.jsx(
|
|
20
|
+
title: h,
|
|
21
|
+
"aria-label": h,
|
|
22
|
+
children: /* @__PURE__ */ r.jsx(W, {})
|
|
23
23
|
}
|
|
24
|
-
)
|
|
24
|
+
);
|
|
25
|
+
function nr({
|
|
25
26
|
required: s,
|
|
26
|
-
getOptionLabel:
|
|
27
|
+
getOptionLabel: o = (i) => String(i),
|
|
27
28
|
placeholder: t,
|
|
28
29
|
helperText: d,
|
|
29
30
|
hideHelperText: v = !1,
|
|
@@ -31,13 +32,13 @@ const q = ({ onClick: s, disabled: e, ref: t }) => /* @__PURE__ */ r.jsx(
|
|
|
31
32
|
success: y,
|
|
32
33
|
children: c,
|
|
33
34
|
disabled: l,
|
|
34
|
-
error:
|
|
35
|
-
label:
|
|
35
|
+
error: u,
|
|
36
|
+
label: p,
|
|
36
37
|
fullWidth: x,
|
|
37
38
|
onChange: n,
|
|
38
39
|
isShowClearButton: g,
|
|
39
40
|
...j
|
|
40
|
-
})
|
|
41
|
+
}) {
|
|
41
42
|
const {
|
|
42
43
|
isOpened: i,
|
|
43
44
|
isShowingClearButton: S,
|
|
@@ -46,16 +47,16 @@ const q = ({ onClick: s, disabled: e, ref: t }) => /* @__PURE__ */ r.jsx(
|
|
|
46
47
|
openSelect: a,
|
|
47
48
|
closeSelect: I,
|
|
48
49
|
resetButtonRef: k
|
|
49
|
-
} =
|
|
50
|
+
} = X({
|
|
50
51
|
...j,
|
|
51
52
|
children: c,
|
|
52
53
|
onChange: n,
|
|
53
54
|
isShowClearButton: g
|
|
54
|
-
}), B = (
|
|
55
|
-
if (Array.isArray(
|
|
56
|
-
const F = (
|
|
55
|
+
}), B = (e) => {
|
|
56
|
+
if (Array.isArray(e) && e.length) {
|
|
57
|
+
const F = (f) => n?.(f ? {
|
|
57
58
|
target: {
|
|
58
|
-
value:
|
|
59
|
+
value: f
|
|
59
60
|
}
|
|
60
61
|
} : {
|
|
61
62
|
target: {
|
|
@@ -63,22 +64,22 @@ const q = ({ onClick: s, disabled: e, ref: t }) => /* @__PURE__ */ r.jsx(
|
|
|
63
64
|
}
|
|
64
65
|
}, void 0);
|
|
65
66
|
return /* @__PURE__ */ r.jsx(
|
|
66
|
-
|
|
67
|
+
z,
|
|
67
68
|
{
|
|
68
|
-
data:
|
|
69
|
+
data: e,
|
|
69
70
|
keyId: "value",
|
|
70
|
-
getOptionLabel:
|
|
71
|
+
getOptionLabel: o,
|
|
71
72
|
onChange: F,
|
|
72
73
|
onClick: a
|
|
73
74
|
}
|
|
74
75
|
);
|
|
75
76
|
}
|
|
76
|
-
return (Array.isArray(
|
|
77
|
+
return (Array.isArray(e) || typeof e == "string") && !e.length ? t : o(e);
|
|
77
78
|
};
|
|
78
|
-
return /* @__PURE__ */ r.jsxs(T, { error:
|
|
79
|
-
|
|
79
|
+
return /* @__PURE__ */ r.jsxs(T, { error: u, fullWidth: x, children: [
|
|
80
|
+
p && /* @__PURE__ */ r.jsx(L, { htmlFor: "grouped-select", required: s, children: p }),
|
|
80
81
|
/* @__PURE__ */ r.jsxs(
|
|
81
|
-
|
|
82
|
+
M,
|
|
82
83
|
{
|
|
83
84
|
...j,
|
|
84
85
|
open: i,
|
|
@@ -90,9 +91,9 @@ const q = ({ onClick: s, disabled: e, ref: t }) => /* @__PURE__ */ r.jsx(
|
|
|
90
91
|
displayEmpty: !0,
|
|
91
92
|
fullWidth: x,
|
|
92
93
|
onChange: n,
|
|
93
|
-
endAdornment: /* @__PURE__ */ r.jsxs(
|
|
94
|
+
endAdornment: /* @__PURE__ */ r.jsxs(V, { children: [
|
|
94
95
|
S && /* @__PURE__ */ r.jsx(
|
|
95
|
-
|
|
96
|
+
_,
|
|
96
97
|
{
|
|
97
98
|
disabled: l,
|
|
98
99
|
ref: k,
|
|
@@ -105,21 +106,21 @@ const q = ({ onClick: s, disabled: e, ref: t }) => /* @__PURE__ */ r.jsx(
|
|
|
105
106
|
variant: "text",
|
|
106
107
|
disabled: l,
|
|
107
108
|
onClick: a,
|
|
108
|
-
children: i ? /* @__PURE__ */ r.jsx(
|
|
109
|
+
children: i ? /* @__PURE__ */ r.jsx(H, { size: 16 }) : /* @__PURE__ */ r.jsx(D, { size: 16 })
|
|
109
110
|
}
|
|
110
111
|
)
|
|
111
112
|
] }),
|
|
112
113
|
children: [
|
|
113
|
-
/* @__PURE__ */ r.jsx(
|
|
114
|
-
m && /* @__PURE__ */ r.jsx(
|
|
114
|
+
/* @__PURE__ */ r.jsx(N, { value: "", children: t }),
|
|
115
|
+
m && /* @__PURE__ */ r.jsx(U, { children: /* @__PURE__ */ r.jsx(P, { color: "primary" }) }),
|
|
115
116
|
!m && c,
|
|
116
117
|
!m && A && /* @__PURE__ */ r.jsx(w, { disabled: !0, children: "Нет данных" })
|
|
117
118
|
]
|
|
118
119
|
}
|
|
119
120
|
),
|
|
120
|
-
!v && /* @__PURE__ */ r.jsx(R, { error:
|
|
121
|
+
!v && /* @__PURE__ */ r.jsx(R, { error: u, success: y, children: d })
|
|
121
122
|
] });
|
|
122
|
-
}
|
|
123
|
+
}
|
|
123
124
|
export {
|
|
124
125
|
nr as Select
|
|
125
126
|
};
|
|
@@ -19,5 +19,5 @@ export declare const StyledIconButton: import('@emotion/styled').StyledComponent
|
|
|
19
19
|
loading?: boolean;
|
|
20
20
|
} & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
21
21
|
export declare const StyledCloseFillSm: import('@emotion/styled').StyledComponent<Omit<import('lucide-react').LucideProps, "ref"> & import('react').RefAttributes<SVGSVGElement> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
22
|
-
export declare const EndAdornmentWrapper: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
22
|
+
export declare const EndAdornmentWrapper: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
23
23
|
export declare const StyledSelect: typeof Select;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { styled as t, selectClasses as r, Select as o } from "@mui/material";
|
|
2
2
|
import { CircleX as n } from "lucide-react";
|
|
3
|
-
import { IconButton as
|
|
4
|
-
import { MenuItem as
|
|
5
|
-
const
|
|
3
|
+
import { IconButton as i } from "../IconButton/IconButton.mjs";
|
|
4
|
+
import { MenuItem as l } from "../MenuItem/MenuItem.mjs";
|
|
5
|
+
const c = t("div")`
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-direction: column;
|
|
8
8
|
align-items: center;
|
|
@@ -14,16 +14,17 @@ const d = t("div")`
|
|
|
14
14
|
|
|
15
15
|
color: ${({ theme: e }) => e.palette.grey[900]};
|
|
16
16
|
}
|
|
17
|
-
`, g = t(
|
|
17
|
+
`, g = t(l)`
|
|
18
18
|
display: none;
|
|
19
|
-
`, m = t(
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
`, m = t(i)`
|
|
20
|
+
padding: 0;
|
|
21
|
+
svg {
|
|
22
|
+
stroke: ${({ theme: e }) => e.palette.grey[600]};
|
|
23
|
+
}
|
|
22
24
|
&:hover {
|
|
23
25
|
background-color: transparent;
|
|
24
|
-
|
|
25
26
|
svg {
|
|
26
|
-
|
|
27
|
+
stroke: ${({ theme: e }) => e.palette.grey[700]};
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
|
|
@@ -34,23 +35,24 @@ const d = t("div")`
|
|
|
34
35
|
`, h = t(n)`
|
|
35
36
|
width: 16px;
|
|
36
37
|
height: 16px;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
padding: 0;
|
|
39
|
+
`, y = t("div", {
|
|
40
|
+
label: "EndAdornmentWrapper"
|
|
41
|
+
})`
|
|
40
42
|
display: flex;
|
|
41
43
|
align-items: center;
|
|
42
44
|
|
|
43
45
|
margin-left: auto;
|
|
44
|
-
`,
|
|
46
|
+
`, x = t(o)`
|
|
45
47
|
.${r.select} {
|
|
46
48
|
padding-right: ${({ theme: e }) => e.spacing(2)} !important;
|
|
47
49
|
}
|
|
48
50
|
`;
|
|
49
51
|
export {
|
|
50
|
-
|
|
52
|
+
y as EndAdornmentWrapper,
|
|
51
53
|
g as Placeholder,
|
|
52
|
-
|
|
54
|
+
c as ProgressWrapper,
|
|
53
55
|
h as StyledCloseFillSm,
|
|
54
56
|
m as StyledIconButton,
|
|
55
|
-
|
|
57
|
+
x as StyledSelect
|
|
56
58
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TextFieldProps as MuiTextFieldProps } from '@mui/material';
|
|
2
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { TextFieldProps as MuiTextFieldProps } from '@mui/material';
|
|
3
3
|
import { WithoutEmotionSpecific } from '../types';
|
|
4
4
|
export type TextFieldProps = Omit<WithoutEmotionSpecific<MuiTextFieldProps>, 'variant' | 'color'> & {
|
|
5
5
|
/**
|
|
@@ -25,4 +25,4 @@ export type TextFieldProps = Omit<WithoutEmotionSpecific<MuiTextFieldProps>, 'va
|
|
|
25
25
|
*/
|
|
26
26
|
trimmed?: boolean;
|
|
27
27
|
};
|
|
28
|
-
export declare const TextField: ({ success, error, helperText: helperTextProp, fullWidth, startAdornment, endAdornment,
|
|
28
|
+
export declare const TextField: ({ success, error, helperText: helperTextProp, fullWidth, startAdornment, endAdornment, inputProps, InputProps, maxLength, trimmed, onBlur, ...props }: TextFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
import { j as r } from "../../_virtual/jsx-runtime.mjs";
|
|
2
|
-
import { TextField as p } from "@mui/material";
|
|
3
2
|
import { useMemo as u } from "react";
|
|
4
|
-
import {
|
|
5
|
-
|
|
3
|
+
import { TextField as B } from "@mui/material";
|
|
4
|
+
import { FormHelperTextContent as a } from "../FormHelperText/FormHelperTextContent/FormHelperTextContent.mjs";
|
|
5
|
+
const E = ({
|
|
6
6
|
success: e,
|
|
7
7
|
error: i,
|
|
8
8
|
helperText: t,
|
|
9
|
-
fullWidth:
|
|
9
|
+
fullWidth: l = !1,
|
|
10
10
|
startAdornment: m,
|
|
11
11
|
endAdornment: s,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
inputProps: f,
|
|
13
|
+
InputProps: x,
|
|
14
|
+
maxLength: d,
|
|
15
|
+
trimmed: c = !0,
|
|
16
|
+
onBlur: j,
|
|
16
17
|
...o
|
|
17
18
|
}) => {
|
|
18
|
-
const
|
|
19
|
+
const g = u(() => {
|
|
19
20
|
if (e)
|
|
20
21
|
return "success";
|
|
21
|
-
}, [e]),
|
|
22
|
-
if (
|
|
22
|
+
}, [e]), F = u(() => e ? /* @__PURE__ */ r.jsx(a, { success: !0, children: t }) : i ? /* @__PURE__ */ r.jsx(a, { error: !0, children: t }) : t || /* @__PURE__ */ r.jsx(r.Fragment, {}), [t, e, i]), p = (n) => {
|
|
23
|
+
if (c) {
|
|
23
24
|
const h = n.target.value?.trim();
|
|
24
25
|
o.onChange?.({
|
|
25
26
|
...n,
|
|
26
27
|
target: { ...n.target, value: h }
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
+
j?.(n);
|
|
30
31
|
};
|
|
31
32
|
return /* @__PURE__ */ r.jsx(
|
|
32
|
-
|
|
33
|
+
B,
|
|
33
34
|
{
|
|
34
35
|
variant: "outlined",
|
|
35
|
-
fullWidth:
|
|
36
|
+
fullWidth: l,
|
|
36
37
|
error: i,
|
|
37
|
-
color:
|
|
38
|
-
helperText:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
38
|
+
color: g,
|
|
39
|
+
helperText: F,
|
|
40
|
+
InputProps: {
|
|
41
|
+
startAdornment: m,
|
|
42
|
+
endAdornment: s,
|
|
43
|
+
...x
|
|
44
|
+
},
|
|
45
|
+
inputProps: {
|
|
46
|
+
maxLength: d,
|
|
47
47
|
...f
|
|
48
48
|
},
|
|
49
|
-
onBlur:
|
|
49
|
+
onBlur: p,
|
|
50
50
|
...o
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
53
|
};
|
|
54
54
|
export {
|
|
55
|
-
|
|
55
|
+
E as TextField
|
|
56
56
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { componentsColors as
|
|
1
|
+
import { componentsColors as r } from "./componentsColors/componentsColors.mjs";
|
|
2
2
|
const t = () => {
|
|
3
|
-
const
|
|
3
|
+
const F = {
|
|
4
4
|
primary: {
|
|
5
|
-
900: "#
|
|
6
|
-
800: "#
|
|
7
|
-
700: "#
|
|
8
|
-
600: "#
|
|
9
|
-
500: "#
|
|
10
|
-
400: "#
|
|
11
|
-
300: "#
|
|
12
|
-
200: "#
|
|
13
|
-
100: "#
|
|
5
|
+
900: "#213555",
|
|
6
|
+
800: "#2B3E6F",
|
|
7
|
+
700: "#3F51B5",
|
|
8
|
+
600: "#4C6FFF",
|
|
9
|
+
500: "#5F7DFF",
|
|
10
|
+
400: "#7C98FF",
|
|
11
|
+
300: "#99B2FF",
|
|
12
|
+
200: "#B7CCFF",
|
|
13
|
+
100: "#D0E1FF"
|
|
14
14
|
},
|
|
15
15
|
secondary: {
|
|
16
16
|
800: "#55B8F0"
|
|
@@ -62,16 +62,16 @@ const t = () => {
|
|
|
62
62
|
100: "#F0F4F7"
|
|
63
63
|
},
|
|
64
64
|
primary: {
|
|
65
|
-
main:
|
|
66
|
-
dark:
|
|
65
|
+
main: F.primary[800],
|
|
66
|
+
dark: F.primary[900],
|
|
67
67
|
contrastText: "#FFF",
|
|
68
|
-
...
|
|
68
|
+
...F.primary
|
|
69
69
|
},
|
|
70
70
|
secondary: {
|
|
71
|
-
main:
|
|
72
|
-
dark:
|
|
71
|
+
main: F.secondary[800],
|
|
72
|
+
dark: F.primary[900],
|
|
73
73
|
contrastText: "#FFF",
|
|
74
|
-
...
|
|
74
|
+
...F.secondary
|
|
75
75
|
},
|
|
76
76
|
background: {
|
|
77
77
|
default: "#FFF",
|
|
@@ -117,7 +117,7 @@ const t = () => {
|
|
|
117
117
|
contrastText: "#FFF"
|
|
118
118
|
};
|
|
119
119
|
},
|
|
120
|
-
components:
|
|
120
|
+
components: r
|
|
121
121
|
};
|
|
122
122
|
};
|
|
123
123
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@max-ts/components",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"browser": "./src/index.ts",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"module": "./src/index.ts",
|
|
@@ -20,29 +20,29 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@emotion/react": "^11.14.0",
|
|
22
22
|
"@emotion/styled": "^11.14.0",
|
|
23
|
-
"@mui/material": "^6.4.
|
|
23
|
+
"@mui/material": "^6.4.5",
|
|
24
24
|
"@mui/system": "^6.4.3",
|
|
25
25
|
"clsx": "^2.1.1",
|
|
26
26
|
"lucide-react": "^0.475.0",
|
|
27
27
|
"react": "^19.0.0",
|
|
28
28
|
"react-dom": "^19.0.0",
|
|
29
29
|
"react-use": "^17.6.0",
|
|
30
|
-
"remeda": "^2.20.
|
|
30
|
+
"remeda": "^2.20.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@chromatic-com/storybook": "^3.2.4",
|
|
34
34
|
"@faker-js/faker": "^9.5.0",
|
|
35
|
-
"@storybook/addon-essentials": "^8.5.
|
|
36
|
-
"@storybook/addon-interactions": "^8.5.
|
|
37
|
-
"@storybook/addon-onboarding": "^8.5.
|
|
38
|
-
"@storybook/blocks": "^8.5.
|
|
39
|
-
"@storybook/builder-vite": "^8.5.
|
|
40
|
-
"@storybook/react": "^8.5.
|
|
41
|
-
"@storybook/react-vite": "^8.5.
|
|
42
|
-
"@storybook/test": "^8.5.
|
|
43
|
-
"@types/react": "^19.0.
|
|
35
|
+
"@storybook/addon-essentials": "^8.5.8",
|
|
36
|
+
"@storybook/addon-interactions": "^8.5.8",
|
|
37
|
+
"@storybook/addon-onboarding": "^8.5.8",
|
|
38
|
+
"@storybook/blocks": "^8.5.8",
|
|
39
|
+
"@storybook/builder-vite": "^8.5.8",
|
|
40
|
+
"@storybook/react": "^8.5.8",
|
|
41
|
+
"@storybook/react-vite": "^8.5.8",
|
|
42
|
+
"@storybook/test": "^8.5.8",
|
|
43
|
+
"@types/react": "^19.0.10",
|
|
44
44
|
"prop-types": "^15.8.1",
|
|
45
|
-
"storybook": "^8.5.
|
|
45
|
+
"storybook": "^8.5.8"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "vite build",
|