@max-ts/components 0.2.2 → 0.2.4
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/Body/Body.d.ts +1 -29
- package/lib/components/DataGrid/Body/Body.mjs +26 -29
- package/lib/components/DataGrid/DataGrid.d.ts +0 -53
- package/lib/components/DataGrid/DataGrid.mjs +49 -71
- package/lib/components/DataGrid/HeadCell/HeadCell.mjs +21 -20
- package/lib/components/DataGrid/HeadCell/styles.mjs +3 -2
- package/lib/components/DataGrid/Row/Row.d.ts +1 -38
- package/lib/components/DataGrid/Row/Row.mjs +55 -147
- package/lib/components/DataGrid/Row/constants.d.ts +0 -1
- package/lib/components/DataGrid/Row/constants.mjs +2 -3
- package/lib/components/DataGrid/Row/index.d.ts +0 -1
- package/lib/components/DataGrid/Row/styles.d.ts +0 -22
- package/lib/components/DataGrid/Row/styles.mjs +11 -78
- package/lib/components/DataGrid/Row/useLogic/useLogic.d.ts +2 -10
- package/lib/components/DataGrid/Row/useLogic/useLogic.mjs +36 -67
- package/lib/components/DataGrid/constants.d.ts +0 -3
- package/lib/components/DataGrid/constants.mjs +3 -6
- package/lib/components/DataGrid/enums.d.ts +0 -4
- package/lib/components/DataGrid/enums.mjs +2 -3
- package/lib/components/DataGrid/faker.d.ts +1 -1
- package/lib/components/DataGrid/types.d.ts +2 -7
- package/lib/components/DataGrid/useLogic/useLogic.d.ts +1 -6
- package/lib/components/DataGrid/useLogic/useLogic.mjs +31 -36
- package/lib/components/DataGridActionCell/useLogic/useLogic.mjs +13 -42
- package/lib/components/DataGridPagination/DataGridPagination.mjs +9 -9
- package/lib/components/DataGridPagination/faker.d.ts +1 -1
- 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 +1 -1
- package/lib/components/Select/Select.mjs +1 -1
- package/lib/components/TextField/TextField.d.ts +1 -1
- package/lib/components/TextField/TextField.mjs +26 -26
- package/lib/index.mjs +189 -197
- package/lib/theme/components/MuiAutocomplete.mjs +1 -2
- package/package.json +13 -13
- package/lib/components/DataGrid/DataGridContext/DataGridContext.d.ts +0 -7
- package/lib/components/DataGrid/DataGridContext/DataGridContext.mjs +0 -12
- package/lib/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.d.ts +0 -6
- package/lib/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.mjs +0 -41
- package/lib/components/DataGrid/DataGridContext/DataGridProvider/index.d.ts +0 -1
- package/lib/components/DataGrid/DataGridContext/index.d.ts +0 -2
- package/lib/components/DataGrid/Row/NestedChildren/NestedChildren.d.ts +0 -55
- package/lib/components/DataGrid/Row/NestedChildren/NestedChildren.mjs +0 -72
- package/lib/components/DataGrid/Row/NestedChildren/index.d.ts +0 -1
- package/lib/components/DataGrid/Row/NestedChildren/styles.d.ts +0 -20
- package/lib/components/DataGrid/Row/NestedChildren/styles.mjs +0 -68
- package/lib/components/DataGrid/Row/NestedChildren/useLogic/index.d.ts +0 -1
- package/lib/components/DataGrid/Row/NestedChildren/useLogic/useLogic.d.ts +0 -18
- package/lib/components/DataGrid/Row/NestedChildren/useLogic/useLogic.mjs +0 -27
- package/lib/components/DataGrid/Row/RowContext/RowContext.d.ts +0 -7
- package/lib/components/DataGrid/Row/RowContext/RowContext.mjs +0 -11
- package/lib/components/DataGrid/Row/RowContext/RowProvider/RowProvider.d.ts +0 -6
- package/lib/components/DataGrid/Row/RowContext/RowProvider/RowProvider.mjs +0 -25
- package/lib/components/DataGrid/Row/RowContext/RowProvider/index.d.ts +0 -1
- package/lib/components/DataGrid/Row/RowContext/index.d.ts +0 -2
- package/lib/components/DataGrid/Row/useLogic/utils/getColumnsMap/getColumnsMap.d.ts +0 -4
- package/lib/components/DataGrid/Row/useLogic/utils/getColumnsMap/getColumnsMap.mjs +0 -8
- package/lib/components/DataGrid/Row/useLogic/utils/getColumnsMap/index.d.ts +0 -1
- package/lib/components/DataGrid/Row/useLogic/utils/index.d.ts +0 -2
- package/lib/components/DataGrid/Row/useLogic/utils/mergeColumnsOptions/index.d.ts +0 -1
- package/lib/components/DataGrid/Row/useLogic/utils/mergeColumnsOptions/mergeColumnsOptions.d.ts +0 -2
- package/lib/components/DataGrid/Row/useLogic/utils/mergeColumnsOptions/mergeColumnsOptions.mjs +0 -14
|
@@ -1,45 +1,41 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const J = ({
|
|
1
|
+
import { useRef as A, useEffect as G, useMemo as N, useCallback as m } from "react";
|
|
2
|
+
import { uniqueBy as q, prop as x } from "remeda";
|
|
3
|
+
import { getGridTemplateColumns as E } from "./utils/getGridTemplateColumns/getGridTemplateColumns.mjs";
|
|
4
|
+
const j = ({
|
|
6
5
|
keyId: e,
|
|
7
6
|
columns: s,
|
|
8
7
|
rows: r = [],
|
|
9
|
-
variant: b,
|
|
10
|
-
tree: g,
|
|
11
|
-
subrows: C,
|
|
12
8
|
selectedRows: i = [],
|
|
13
|
-
isLoading:
|
|
9
|
+
isLoading: l,
|
|
14
10
|
isDisabled: u,
|
|
15
11
|
onSelectRow: n
|
|
16
12
|
}) => {
|
|
17
|
-
const
|
|
13
|
+
const b = !!r?.length, c = !!n, g = l || u, f = r.filter(
|
|
18
14
|
(t) => !(t.options?.isDisabled || t.options?.isNotSelectable)
|
|
19
|
-
), p =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}, [r,
|
|
23
|
-
const
|
|
24
|
-
(t) => !i.find((
|
|
25
|
-
).length, [f, i, e]),
|
|
15
|
+
), p = A([]);
|
|
16
|
+
G(() => {
|
|
17
|
+
l || (p.current = r);
|
|
18
|
+
}, [r, l]);
|
|
19
|
+
const h = E(s), C = N(() => f.filter(
|
|
20
|
+
(t) => !i.find((o) => o[e] === t[e])
|
|
21
|
+
).length, [f, i, e]), B = m(() => r.length <= 1 ? s.map((t) => ({ ...t, sortable: !1 })) : s, [s, r]), D = l ? p.current : r, d = (t) => {
|
|
26
22
|
if (!n)
|
|
27
23
|
return;
|
|
28
24
|
if (t.target.checked) {
|
|
29
|
-
const a =
|
|
25
|
+
const a = q(
|
|
30
26
|
[...i, ...f],
|
|
31
|
-
|
|
27
|
+
x(e)
|
|
32
28
|
);
|
|
33
29
|
return n(a);
|
|
34
30
|
}
|
|
35
|
-
const
|
|
36
|
-
(a) => !r.find((
|
|
31
|
+
const o = i.filter(
|
|
32
|
+
(a) => !r.find((P) => P[e] === a[e])
|
|
37
33
|
);
|
|
38
|
-
n(
|
|
39
|
-
},
|
|
40
|
-
(t) => (
|
|
34
|
+
n(o);
|
|
35
|
+
}, v = m(
|
|
36
|
+
(t) => (o) => {
|
|
41
37
|
if (n) {
|
|
42
|
-
if (
|
|
38
|
+
if (o.target.checked)
|
|
43
39
|
return n([...i, t]);
|
|
44
40
|
n(
|
|
45
41
|
i.filter(
|
|
@@ -51,29 +47,28 @@ const J = ({
|
|
|
51
47
|
[i, n, e]
|
|
52
48
|
);
|
|
53
49
|
return {
|
|
54
|
-
isDataGridDisabled:
|
|
55
|
-
|
|
56
|
-
renderRows: x,
|
|
50
|
+
isDataGridDisabled: g,
|
|
51
|
+
renderRows: D,
|
|
57
52
|
headProps: {
|
|
58
53
|
rowsCount: f.length,
|
|
59
|
-
uncheckedRowsCount:
|
|
60
|
-
gridColumns:
|
|
54
|
+
uncheckedRowsCount: C,
|
|
55
|
+
gridColumns: h,
|
|
61
56
|
isSelectable: c,
|
|
62
|
-
columns:
|
|
63
|
-
onSelectAllRows:
|
|
57
|
+
columns: B(),
|
|
58
|
+
onSelectAllRows: d
|
|
64
59
|
},
|
|
65
60
|
bodyProps: {
|
|
66
|
-
gridColumns:
|
|
61
|
+
gridColumns: h,
|
|
67
62
|
isSelectable: c,
|
|
68
|
-
onSelectRow:
|
|
63
|
+
onSelectRow: v
|
|
69
64
|
},
|
|
70
65
|
loaderProps: {
|
|
71
|
-
isLoading:
|
|
66
|
+
isLoading: b && l,
|
|
72
67
|
isVisibleDivider: !!r.length,
|
|
73
68
|
isDisabled: u
|
|
74
69
|
}
|
|
75
70
|
};
|
|
76
71
|
};
|
|
77
72
|
export {
|
|
78
|
-
|
|
73
|
+
j as useLogic
|
|
79
74
|
};
|
|
@@ -1,49 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import "../../Button/styles.mjs";
|
|
6
|
-
import "@mui/material";
|
|
7
|
-
import "../../ErrorBoundary/ErrorBoundary.mjs";
|
|
8
|
-
import "../../Placeholder/Image/Image.mjs";
|
|
9
|
-
import "../../Placeholder/styles.mjs";
|
|
10
|
-
import "../../Typography/styles.mjs";
|
|
11
|
-
import "../../ContentState/styles.mjs";
|
|
12
|
-
import "../../Checkbox/Checkbox.mjs";
|
|
13
|
-
import "../../Tooltip/styles.mjs";
|
|
14
|
-
import "../../DataGrid/Row/NestedChildren/NestedChildren.mjs";
|
|
15
|
-
import "../../DataGrid/Row/styles.mjs";
|
|
16
|
-
import "../../DataGrid/DataGridContext/DataGridContext.mjs";
|
|
17
|
-
import { RowContext as f } from "../../DataGrid/Row/RowContext/RowContext.mjs";
|
|
18
|
-
import "../../DataGrid/Body/styles.mjs";
|
|
19
|
-
import "lucide-react";
|
|
20
|
-
import "../../DataGrid/HeadCell/styles.mjs";
|
|
21
|
-
import "../../DataGrid/Head/styles.mjs";
|
|
22
|
-
import "../../DataGrid/Loader/styles.mjs";
|
|
23
|
-
import "../../DataGrid/styles.mjs";
|
|
24
|
-
import "remeda";
|
|
25
|
-
const H = ({
|
|
26
|
-
row: i,
|
|
27
|
-
actions: r
|
|
1
|
+
import { useCallback as e } from "react";
|
|
2
|
+
const d = ({
|
|
3
|
+
row: o,
|
|
4
|
+
actions: i
|
|
28
5
|
}) => {
|
|
29
|
-
const { main:
|
|
30
|
-
(
|
|
31
|
-
),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return n(t?.loadingNote);
|
|
35
|
-
e();
|
|
36
|
-
}, [t]);
|
|
37
|
-
const c = d(
|
|
38
|
-
(o) => () => {
|
|
39
|
-
o?.(i);
|
|
6
|
+
const { main: c, secondary: t } = i, a = !![...c, ...t || []].find(
|
|
7
|
+
(n) => n.isBlockingOperation && n.loading
|
|
8
|
+
), l = e(
|
|
9
|
+
(n) => () => {
|
|
10
|
+
n?.(o);
|
|
40
11
|
},
|
|
41
|
-
[
|
|
12
|
+
[o]
|
|
42
13
|
);
|
|
43
|
-
return { isDisabledAction: a, handleActionClick:
|
|
44
|
-
|
|
14
|
+
return { isDisabledAction: a, handleActionClick: l, handleWrapperClick: (n) => {
|
|
15
|
+
n.stopPropagation();
|
|
45
16
|
} };
|
|
46
17
|
};
|
|
47
18
|
export {
|
|
48
|
-
|
|
19
|
+
d as useLogic
|
|
49
20
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as r } from "../../_virtual/jsx-runtime.mjs";
|
|
2
2
|
import { MenuItem as h } from "../MenuItem/MenuItem.mjs";
|
|
3
3
|
import { Pagination as f } from "../Pagination/Pagination.mjs";
|
|
4
4
|
import { Select as x } from "../Select/Select.mjs";
|
|
@@ -23,11 +23,11 @@ const D = (a) => {
|
|
|
23
23
|
onSetCountPerPage: u,
|
|
24
24
|
...d
|
|
25
25
|
} = a;
|
|
26
|
-
return !o && !c || !l ? null : /* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
u && /* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
26
|
+
return !o && !c || !l ? null : /* @__PURE__ */ r.jsxs(E, { className: g, children: [
|
|
27
|
+
/* @__PURE__ */ r.jsxs(_, { children: [
|
|
28
|
+
u && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
29
|
+
/* @__PURE__ */ r.jsx(j, { variant: "body1", children: "Строк на странице:" }),
|
|
30
|
+
/* @__PURE__ */ r.jsx(
|
|
31
31
|
x,
|
|
32
32
|
{
|
|
33
33
|
size: "small",
|
|
@@ -35,13 +35,13 @@ const D = (a) => {
|
|
|
35
35
|
disabled: n,
|
|
36
36
|
isShowClearButton: !1,
|
|
37
37
|
onChange: s,
|
|
38
|
-
children: p.map((
|
|
38
|
+
children: p.map((e) => /* @__PURE__ */ r.jsx(h, { value: e, children: e }, e))
|
|
39
39
|
}
|
|
40
40
|
)
|
|
41
41
|
] }),
|
|
42
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ r.jsx(O, { variant: "h6", children: i() })
|
|
43
43
|
] }),
|
|
44
|
-
o && /* @__PURE__ */
|
|
44
|
+
o && /* @__PURE__ */ r.jsx(
|
|
45
45
|
f,
|
|
46
46
|
{
|
|
47
47
|
disabled: n,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CellValue, DataGridRowOptions, DataGridRowWithOptions } from '../DataGrid';
|
|
2
2
|
export declare const makeRandomDate: () => string;
|
|
3
|
-
export declare const makeDataList: <TData extends Record<string, CellValue>>(dataObjTemplate: TData, options?: DataGridRowOptions
|
|
3
|
+
export declare const makeDataList: <TData extends Record<string, CellValue>>(dataObjTemplate: TData, options?: DataGridRowOptions) => DataGridRowWithOptions<TData>[];
|
|
@@ -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
|
*/
|
|
@@ -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
|
|
2
|
+
import { TextField as B } from "@mui/material";
|
|
3
3
|
import { useMemo as u } from "react";
|
|
4
|
-
import { FormHelperTextContent as
|
|
5
|
-
const
|
|
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
|
};
|