@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.
Files changed (64) hide show
  1. package/lib/components/Autocomplete/Autocomplete.mjs +53 -53
  2. package/lib/components/DataGrid/Body/Body.d.ts +1 -29
  3. package/lib/components/DataGrid/Body/Body.mjs +26 -29
  4. package/lib/components/DataGrid/DataGrid.d.ts +0 -53
  5. package/lib/components/DataGrid/DataGrid.mjs +49 -71
  6. package/lib/components/DataGrid/HeadCell/HeadCell.mjs +21 -20
  7. package/lib/components/DataGrid/HeadCell/styles.mjs +3 -2
  8. package/lib/components/DataGrid/Row/Row.d.ts +1 -38
  9. package/lib/components/DataGrid/Row/Row.mjs +55 -147
  10. package/lib/components/DataGrid/Row/constants.d.ts +0 -1
  11. package/lib/components/DataGrid/Row/constants.mjs +2 -3
  12. package/lib/components/DataGrid/Row/index.d.ts +0 -1
  13. package/lib/components/DataGrid/Row/styles.d.ts +0 -22
  14. package/lib/components/DataGrid/Row/styles.mjs +11 -78
  15. package/lib/components/DataGrid/Row/useLogic/useLogic.d.ts +2 -10
  16. package/lib/components/DataGrid/Row/useLogic/useLogic.mjs +36 -67
  17. package/lib/components/DataGrid/constants.d.ts +0 -3
  18. package/lib/components/DataGrid/constants.mjs +3 -6
  19. package/lib/components/DataGrid/enums.d.ts +0 -4
  20. package/lib/components/DataGrid/enums.mjs +2 -3
  21. package/lib/components/DataGrid/faker.d.ts +1 -1
  22. package/lib/components/DataGrid/types.d.ts +2 -7
  23. package/lib/components/DataGrid/useLogic/useLogic.d.ts +1 -6
  24. package/lib/components/DataGrid/useLogic/useLogic.mjs +31 -36
  25. package/lib/components/DataGridActionCell/useLogic/useLogic.mjs +13 -42
  26. package/lib/components/DataGridPagination/DataGridPagination.mjs +9 -9
  27. package/lib/components/DataGridPagination/faker.d.ts +1 -1
  28. package/lib/components/SearchField/SearchField.d.ts +3 -1
  29. package/lib/components/SearchField/SearchField.mjs +40 -37
  30. package/lib/components/SearchField/styles.mjs +7 -9
  31. package/lib/components/Select/Select.d.ts +1 -1
  32. package/lib/components/Select/Select.mjs +1 -1
  33. package/lib/components/TextField/TextField.d.ts +1 -1
  34. package/lib/components/TextField/TextField.mjs +26 -26
  35. package/lib/index.mjs +189 -197
  36. package/lib/theme/components/MuiAutocomplete.mjs +1 -2
  37. package/package.json +13 -13
  38. package/lib/components/DataGrid/DataGridContext/DataGridContext.d.ts +0 -7
  39. package/lib/components/DataGrid/DataGridContext/DataGridContext.mjs +0 -12
  40. package/lib/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.d.ts +0 -6
  41. package/lib/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.mjs +0 -41
  42. package/lib/components/DataGrid/DataGridContext/DataGridProvider/index.d.ts +0 -1
  43. package/lib/components/DataGrid/DataGridContext/index.d.ts +0 -2
  44. package/lib/components/DataGrid/Row/NestedChildren/NestedChildren.d.ts +0 -55
  45. package/lib/components/DataGrid/Row/NestedChildren/NestedChildren.mjs +0 -72
  46. package/lib/components/DataGrid/Row/NestedChildren/index.d.ts +0 -1
  47. package/lib/components/DataGrid/Row/NestedChildren/styles.d.ts +0 -20
  48. package/lib/components/DataGrid/Row/NestedChildren/styles.mjs +0 -68
  49. package/lib/components/DataGrid/Row/NestedChildren/useLogic/index.d.ts +0 -1
  50. package/lib/components/DataGrid/Row/NestedChildren/useLogic/useLogic.d.ts +0 -18
  51. package/lib/components/DataGrid/Row/NestedChildren/useLogic/useLogic.mjs +0 -27
  52. package/lib/components/DataGrid/Row/RowContext/RowContext.d.ts +0 -7
  53. package/lib/components/DataGrid/Row/RowContext/RowContext.mjs +0 -11
  54. package/lib/components/DataGrid/Row/RowContext/RowProvider/RowProvider.d.ts +0 -6
  55. package/lib/components/DataGrid/Row/RowContext/RowProvider/RowProvider.mjs +0 -25
  56. package/lib/components/DataGrid/Row/RowContext/RowProvider/index.d.ts +0 -1
  57. package/lib/components/DataGrid/Row/RowContext/index.d.ts +0 -2
  58. package/lib/components/DataGrid/Row/useLogic/utils/getColumnsMap/getColumnsMap.d.ts +0 -4
  59. package/lib/components/DataGrid/Row/useLogic/utils/getColumnsMap/getColumnsMap.mjs +0 -8
  60. package/lib/components/DataGrid/Row/useLogic/utils/getColumnsMap/index.d.ts +0 -1
  61. package/lib/components/DataGrid/Row/useLogic/utils/index.d.ts +0 -2
  62. package/lib/components/DataGrid/Row/useLogic/utils/mergeColumnsOptions/index.d.ts +0 -1
  63. package/lib/components/DataGrid/Row/useLogic/utils/mergeColumnsOptions/mergeColumnsOptions.d.ts +0 -2
  64. package/lib/components/DataGrid/Row/useLogic/utils/mergeColumnsOptions/mergeColumnsOptions.mjs +0 -14
@@ -1,45 +1,41 @@
1
- import { useRef as N, useEffect as V, useMemo as j, useCallback as h } from "react";
2
- import { Variant as q } from "../enums.mjs";
3
- import { uniqueBy as M, prop as O } from "remeda";
4
- import { getGridTemplateColumns as S } from "./utils/getGridTemplateColumns/getGridTemplateColumns.mjs";
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: o,
9
+ isLoading: l,
14
10
  isDisabled: u,
15
11
  onSelectRow: n
16
12
  }) => {
17
- const d = !!r?.length, c = !!n, B = o || u, D = Object.is(b, q.Subrows) ? { ...C, isInitialExpanded: !0 } : g, f = r.filter(
13
+ const b = !!r?.length, c = !!n, g = l || u, f = r.filter(
18
14
  (t) => !(t.options?.isDisabled || t.options?.isNotSelectable)
19
- ), p = N([]);
20
- V(() => {
21
- o || (p.current = r);
22
- }, [r, o]);
23
- const m = S(s), v = j(() => f.filter(
24
- (t) => !i.find((l) => l[e] === t[e])
25
- ).length, [f, i, e]), P = h(() => r.length <= 1 ? s.map((t) => ({ ...t, sortable: !1 })) : s, [s, r]), x = o ? p.current : r, A = (t) => {
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 = M(
25
+ const a = q(
30
26
  [...i, ...f],
31
- O(e)
27
+ x(e)
32
28
  );
33
29
  return n(a);
34
30
  }
35
- const l = i.filter(
36
- (a) => !r.find((G) => G[e] === a[e])
31
+ const o = i.filter(
32
+ (a) => !r.find((P) => P[e] === a[e])
37
33
  );
38
- n(l);
39
- }, E = h(
40
- (t) => (l) => {
34
+ n(o);
35
+ }, v = m(
36
+ (t) => (o) => {
41
37
  if (n) {
42
- if (l.target.checked)
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: B,
55
- treeRenderConfig: D,
56
- renderRows: x,
50
+ isDataGridDisabled: g,
51
+ renderRows: D,
57
52
  headProps: {
58
53
  rowsCount: f.length,
59
- uncheckedRowsCount: v,
60
- gridColumns: m,
54
+ uncheckedRowsCount: C,
55
+ gridColumns: h,
61
56
  isSelectable: c,
62
- columns: P(),
63
- onSelectAllRows: A
57
+ columns: B(),
58
+ onSelectAllRows: d
64
59
  },
65
60
  bodyProps: {
66
- gridColumns: m,
61
+ gridColumns: h,
67
62
  isSelectable: c,
68
- onSelectRow: E
63
+ onSelectRow: v
69
64
  },
70
65
  loaderProps: {
71
- isLoading: d && o,
66
+ isLoading: b && l,
72
67
  isVisibleDivider: !!r.length,
73
68
  isDisabled: u
74
69
  }
75
70
  };
76
71
  };
77
72
  export {
78
- J as useLogic
73
+ j as useLogic
79
74
  };
@@ -1,49 +1,20 @@
1
- import { useContext as s, useEffect as l, useCallback as d } from "react";
2
- import "../../../_virtual/jsx-runtime.mjs";
3
- import "../../ConfigProvider/ConfigProvider.mjs";
4
- import "clsx";
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: p, secondary: m } = r, { addDisabledRow: n, removeDisabledRow: e } = s(f), t = [...p, ...m || []].find(
30
- (o) => o.isBlockingOperation && o.loading
31
- ), a = !!t;
32
- l(() => {
33
- if (t)
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
- [i]
12
+ [o]
42
13
  );
43
- return { isDisabledAction: a, handleActionClick: c, handleWrapperClick: (o) => {
44
- o.stopPropagation();
14
+ return { isDisabledAction: a, handleActionClick: l, handleWrapperClick: (n) => {
15
+ n.stopPropagation();
45
16
  } };
46
17
  };
47
18
  export {
48
- H as useLogic
19
+ d as useLogic
49
20
  };
@@ -1,4 +1,4 @@
1
- import { j as e } from "../../_virtual/jsx-runtime.mjs";
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__ */ e.jsxs(E, { className: g, children: [
27
- /* @__PURE__ */ e.jsxs(_, { children: [
28
- u && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
29
- /* @__PURE__ */ e.jsx(j, { variant: "body1", children: "Строк на странице:" }),
30
- /* @__PURE__ */ e.jsx(
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((r) => /* @__PURE__ */ e.jsx(h, { value: r, children: r }, r))
38
+ children: p.map((e) => /* @__PURE__ */ r.jsx(h, { value: e, children: e }, e))
39
39
  }
40
40
  )
41
41
  ] }),
42
- /* @__PURE__ */ e.jsx(O, { variant: "h6", children: i() })
42
+ /* @__PURE__ */ r.jsx(O, { variant: "h6", children: i() })
43
43
  ] }),
44
- o && /* @__PURE__ */ e.jsx(
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<TData>) => DataGridRowWithOptions<TData>[];
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 n } from "../../_virtual/jsx-runtime.mjs";
2
- import { forwardRef as S, useState as h, useRef as C } from "react";
3
- import { StyledTextField as j, StyledIconButton as b, StyledCloseFillSm as y, StyledSearchIcon as A } from "./styles.mjs";
4
- const w = S(
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: c = "none",
7
- placeholder: s = "Поиск",
8
- onChange: r,
9
- disabled: l,
10
- value: i,
11
- defaultValue: d,
12
- ...f
13
- }, m) => {
14
- const [o, u] = h(`${d || i || ""}`), e = C(null), p = (t) => {
15
- u(t.target.value), r?.(t);
16
- }, v = () => {
17
- u(""), e.current && (e.current.value = "");
18
- const t = new InputEvent("input", {
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(t, "target", {
25
+ Object.defineProperty(n, "target", {
23
26
  writable: !0,
24
27
  value: e.current
25
- }), r?.(t), e.current?.focus();
26
- }, x = () => {
28
+ }), l?.(n), e.current?.focus();
29
+ }, C = () => {
27
30
  e.current?.focus();
28
- }, a = !!o.length;
29
- return /* @__PURE__ */ n.jsx(
30
- j,
31
+ }, a = !!c.length;
32
+ return /* @__PURE__ */ r.jsx(
33
+ y,
31
34
  {
32
- margin: c,
33
- placeholder: s,
34
- startAdornment: /* @__PURE__ */ n.jsx(A, { onClick: x }),
35
- disabled: l,
36
- endAdornment: /* @__PURE__ */ n.jsx(
37
- b,
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: v,
41
- disabled: l || !a,
43
+ onClick: h,
44
+ disabled: u || !a,
42
45
  $isActive: a,
43
- children: /* @__PURE__ */ n.jsx(y, {})
46
+ children: /* @__PURE__ */ r.jsx(R, {})
44
47
  }
45
48
  ),
46
- onChange: p,
47
- value: o,
48
- ref: m,
49
+ onChange: S,
50
+ value: c,
51
+ ref: x,
49
52
  inputRef: e,
50
- ...f
53
+ ...v
51
54
  }
52
55
  );
53
56
  }
54
57
  );
55
58
  export {
56
- w as SearchField
59
+ B as SearchField
57
60
  };
@@ -1,10 +1,10 @@
1
1
  import { styled as o } from "@mui/material";
2
- import { Search as e, CircleX as r } from "lucide-react";
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 a = o(e)`
5
+ const d = o(e)`
6
6
  color: ${({ theme: t }) => t.palette.grey[600]};
7
- `, d = o(l, {
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
- fill: ${({ theme: t }) => t.palette.grey[700]};
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
- d as StyledIconButton,
33
- a as StyledSearchIcon,
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: string | number) => string | number;
7
+ getOptionLabel?: (value: Value) => string | number;
8
8
  /**
9
9
  * Добавляет вспомогательный текст под селектом
10
10
  */
@@ -24,7 +24,7 @@ const _ = ({ onClick: s, disabled: o, ref: t }) => /* @__PURE__ */ r.jsx(
24
24
  );
25
25
  function nr({
26
26
  required: s,
27
- getOptionLabel: o = (i) => i,
27
+ getOptionLabel: o = (i) => String(i),
28
28
  placeholder: t,
29
29
  helperText: d,
30
30
  hideHelperText: v = !1,
@@ -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, slotProps, maxLength, trimmed, onBlur, ...props }: TextFieldProps) => import("react/jsx-runtime").JSX.Element;
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";
2
+ import { TextField as B } from "@mui/material";
3
3
  import { useMemo as u } from "react";
4
- import { FormHelperTextContent as l } from "../FormHelperText/FormHelperTextContent/FormHelperTextContent.mjs";
5
- const w = ({
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: a = !1,
9
+ fullWidth: l = !1,
10
10
  startAdornment: m,
11
11
  endAdornment: s,
12
- slotProps: f,
13
- maxLength: x,
14
- trimmed: d = !0,
15
- onBlur: c,
12
+ inputProps: f,
13
+ InputProps: x,
14
+ maxLength: d,
15
+ trimmed: c = !0,
16
+ onBlur: j,
16
17
  ...o
17
18
  }) => {
18
- const j = u(() => {
19
+ const g = u(() => {
19
20
  if (e)
20
21
  return "success";
21
- }, [e]), g = u(() => e ? /* @__PURE__ */ r.jsx(l, { success: !0, children: t }) : i ? /* @__PURE__ */ r.jsx(l, { error: !0, children: t }) : t || /* @__PURE__ */ r.jsx(r.Fragment, {}), [t, e, i]), F = (n) => {
22
- if (d) {
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
- c?.(n);
30
+ j?.(n);
30
31
  };
31
32
  return /* @__PURE__ */ r.jsx(
32
- p,
33
+ B,
33
34
  {
34
35
  variant: "outlined",
35
- fullWidth: a,
36
+ fullWidth: l,
36
37
  error: i,
37
- color: j,
38
- helperText: g,
39
- slotProps: {
40
- htmlInput: {
41
- maxLength: x
42
- },
43
- input: {
44
- startAdornment: m,
45
- endAdornment: s
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: F,
49
+ onBlur: p,
50
50
  ...o
51
51
  }
52
52
  );
53
53
  };
54
54
  export {
55
- w as TextField
55
+ E as TextField
56
56
  };