rc-lib-ui 1.2.16-beta.6 → 1.2.18

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.
@@ -26,6 +26,7 @@ export interface ListMenuProps extends RenderListProps {
26
26
  className?: string;
27
27
  isWrapText?: boolean;
28
28
  size?: 'normal' | 'small';
29
+ isRight?: boolean;
29
30
  columnMenu: {
30
31
  initWidth: number;
31
32
  minWidthColumn: Pick<CSSObject, 'width'>;
@@ -0,0 +1,9 @@
1
+ interface StyledListItemProps {
2
+ visual: "variant1" | "variant2";
3
+ }
4
+ export declare const StyledListItem: import('@emotion/styled').StyledComponent<{
5
+ button?: false;
6
+ } & import('@mui/material').ListItemOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
7
+ ref?: ((instance: HTMLLIElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLLIElement> | null | undefined;
8
+ }, "className" | "style" | "classes" | "alignItems" | "children" | "sx" | "button" | "autoFocus" | "dense" | "components" | "componentsProps" | "slotProps" | "slots" | "disabled" | "selected" | "disableGutters" | "divider" | "disablePadding" | "ContainerComponent" | "ContainerProps" | "secondaryAction"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & StyledListItemProps, {}, {}>;
9
+ export {};
@@ -1 +1,2 @@
1
1
  export * from './Dashboard';
2
+ export { MuiHeader, type MuiHeaderProps } from './components/MuiHeader';
@@ -1,37 +1,37 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { styled as a, Tooltip as p, tooltipClasses as r } from "@mui/material";
3
- import e from "react";
4
- const c = a(({ className: o, ...t }) => /* @__PURE__ */ l(p, { ...t, classes: { popper: o } }))(({ theme: o }) => ({
5
- [`& .${r.tooltip}`]: {
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { styled as a, Tooltip as p, tooltipClasses as l } from "@mui/material";
3
+ import c from "react";
4
+ const i = a(({ className: o, ...t }) => /* @__PURE__ */ r(p, { ...t, classes: { popper: o } }))(({ theme: o }) => ({
5
+ [`& .${l.tooltip}`]: {
6
6
  backgroundColor: "#f5f5f9",
7
7
  color: "rgba(0, 0, 0, 0.87)",
8
8
  maxWidth: 220,
9
9
  fontSize: o.typography.pxToRem(12),
10
10
  border: "1px solid #dadde9"
11
11
  }
12
- })), i = a(({ className: o, ...t }) => /* @__PURE__ */ l(p, { ...t, classes: { popper: o } }))(({ theme: o }) => ({
13
- [`& .${r.tooltip}`]: {
12
+ })), n = a(({ className: o, ...t }) => /* @__PURE__ */ r(p, { ...t, classes: { popper: o } }))(({ theme: o }) => ({
13
+ [`& .${l.tooltip}`]: {
14
14
  backgroundColor: o.palette.common.white,
15
15
  color: "rgba(0, 0, 0, 0.87)",
16
16
  boxShadow: o.shadows[1],
17
17
  fontSize: 11
18
18
  }
19
- })), n = a(({ className: o, ...t }) => /* @__PURE__ */ l(p, { ...t, arrow: !0, classes: { popper: o } }))(({ theme: o }) => ({
20
- [`& .${r.arrow}`]: {
19
+ })), m = a(({ className: o, ...t }) => /* @__PURE__ */ r(p, { ...t, arrow: !0, classes: { popper: o } }))(({ theme: o }) => ({
20
+ [`& .${l.arrow}`]: {
21
21
  color: o.palette.common.black
22
22
  },
23
- [`& .${r.tooltip}`]: {
23
+ [`& .${l.tooltip}`]: {
24
24
  backgroundColor: o.palette.common.black
25
25
  }
26
- })), m = {
27
- html: c,
28
- light: i,
29
- bootstrap: n,
26
+ })), s = {
27
+ html: i,
28
+ light: n,
29
+ bootstrap: m,
30
30
  default: p
31
31
  }, d = ({ variant: o = "default", ...t }) => {
32
- const s = m[o];
33
- return /* @__PURE__ */ l(s, { ...t });
34
- }, u = e.memo(d);
32
+ const e = s[o] || s.default;
33
+ return /* @__PURE__ */ r(e, { ...t });
34
+ }, g = c.memo(d);
35
35
  export {
36
- u as T
36
+ g as T
37
37
  };
@@ -1,9 +1,11 @@
1
- import { Dispatch, ReactNode, SetStateAction } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  export interface ControlStatusItemProps {
3
+ defaultStatus?: boolean;
3
4
  render(p: {
4
5
  is: boolean;
5
- setStatus: Dispatch<SetStateAction<boolean>>;
6
+ id: string;
6
7
  handleToggle: () => void;
8
+ setID: (id: string) => void;
7
9
  }): ReactNode;
8
10
  }
9
- export declare const ControlStatusItem: ({ render }: ControlStatusItemProps) => ReactNode;
11
+ export declare const ControlStatusItem: ({ render, defaultStatus }: ControlStatusItemProps) => ReactNode;
package/dist/dashboard.js CHANGED
@@ -1,19 +1,19 @@
1
- import { jsx as e, jsxs as h, Fragment as k } from "react/jsx-runtime";
2
- import { styled as g, ListItemButton as li, Typography as ei, ListItemIcon as ci, List as di, ListItem as j, Collapse as hi, Box as V, AppBar as fi, Container as pi, Toolbar as gi, Drawer as si, Divider as Q, IconButton as xi } from "@mui/material";
3
- import { useTheme as ui } from "@mui/material/styles";
4
- import I, { useState as $, useRef as E, useEffect as X, forwardRef as B, useMemo as U, Fragment as mi, useImperativeHandle as wi } from "react";
5
- import bi from "@mui/icons-material/ChevronLeft";
6
- import vi from "@mui/icons-material/ChevronRight";
7
- import { U as Si, s as Ci } from "./index-B7GqTJat.js";
8
- import { ExpandLess as Li, ExpandMore as Wi } from "@mui/icons-material";
9
- import { T as yi } from "./Tooltips-D4gQprYO.js";
10
- import { NavLink as Hi } from "react-router-dom";
11
- import Z from "classnames";
12
- const Ii = g("main")(() => ({
1
+ import { jsx as d, jsxs as f, Fragment as A } from "react/jsx-runtime";
2
+ import { styled as p, ListItemButton as ci, Typography as di, ListItemIcon as hi, List as ai, ListItem as si, Collapse as fi, Box as J, AppBar as pi, Container as gi, Toolbar as ui, Drawer as xi, Divider as Z, IconButton as mi } from "@mui/material";
3
+ import { useTheme as wi } from "@mui/material/styles";
4
+ import R, { useState as B, useCallback as P, useRef as K, useEffect as Q, forwardRef as _, useMemo as li, Fragment as bi, useImperativeHandle as vi } from "react";
5
+ import Si from "@mui/icons-material/ChevronLeft";
6
+ import Ci from "@mui/icons-material/ChevronRight";
7
+ import { U as Li, s as Ii } from "./index-B7GqTJat.js";
8
+ import { ExpandLess as yi, ExpandMore as Wi } from "@mui/icons-material";
9
+ import { T as Hi } from "./Tooltips-Q_C8jHNF.js";
10
+ import { NavLink as ki } from "react-router-dom";
11
+ import G from "classnames";
12
+ const Di = p("main")(() => ({
13
13
  display: "flex",
14
14
  flexDirection: "column",
15
15
  flexGrow: 1
16
- })), Ti = g("div")(({ theme: i }) => ({
16
+ })), Mi = p("div")(({ theme: i }) => ({
17
17
  display: "flex",
18
18
  alignItems: "center",
19
19
  justifyContent: "center",
@@ -30,82 +30,81 @@ const Ii = g("main")(() => ({
30
30
  easing: i.transitions.easing.sharp,
31
31
  duration: i.transitions.duration.enteringScreen
32
32
  })
33
- })), P = (i) => typeof i == "number" ? i + "px" : i, ai = (i, d = {}) => {
34
- const { newProp: o = "marginLeft", positionCorrect: a = "- 0px" } = d;
33
+ })), ii = (i) => typeof i == "number" ? i + "px" : i, Ti = (i, a = {}) => {
34
+ const { newProp: l = "marginLeft", positionCorrect: e = "- 0px" } = a;
35
35
  let n = {};
36
- for (const [l, t] of Object.entries(i))
37
- if (typeof t == "object" && "width" in t) {
38
- const r = P(t == null ? void 0 : t.width);
39
- n[l] = { [o]: `calc(${r} ${a})` };
36
+ for (const [t, o] of Object.entries(i))
37
+ if (typeof o == "object" && "width" in o) {
38
+ const r = ii(o == null ? void 0 : o.width);
39
+ n[t] = { [l]: `calc(${r} ${e})` };
40
40
  } else {
41
- const r = P(t);
42
- n[o] = `calc(${r} ${a})`;
41
+ const r = ii(o);
42
+ n[l] = `calc(${r} ${e})`;
43
43
  }
44
44
  return n;
45
- }, Mi = ({ render: i }) => {
46
- const [d, o] = $(!1);
47
- return i({ is: d, setStatus: o, handleToggle: () => {
48
- o((n) => !n);
49
- } });
50
- }, Di = g(li, {
45
+ }, $i = ({ render: i, defaultStatus: a = !1 }) => {
46
+ const [l, e] = B({ is: a, id: "" }), n = P(() => {
47
+ e((o) => ({ ...o, is: !o.is }));
48
+ }, []), t = P((o) => {
49
+ e((r) => ({ ...r, id: o }));
50
+ }, []);
51
+ return i({ ...l, setID: t, handleToggle: n });
52
+ }, Ri = p(ci, {
51
53
  shouldForwardProp: (i) => !["minHeight"].includes(i)
52
54
  })(({ minHeight: i }) => ({
53
55
  minHeight: i,
54
- padding: "8px",
56
+ padding: "0px",
55
57
  paddingLeft: 0,
56
58
  transition: "height .1s ease-in-out",
57
59
  overflow: "hidden"
58
- })), D = { minHeight: 48, height: 0 }, A = ({ sx: i = {}, isWrapText: d, isOpen: o, ...a }) => {
59
- const n = E(null), [l, t] = $(D);
60
- return X(() => {
61
- if (d && (n != null && n.current)) {
60
+ // ':hover': { backgroundColor: 'transparent' },
61
+ })), j = { minHeight: 48, height: 0 }, U = ({ sx: i = {}, isWrapText: a, isOpen: l, ...e }) => {
62
+ const n = K(null), [t, o] = B(j);
63
+ return Q(() => {
64
+ if (a && (n != null && n.current)) {
62
65
  const { scrollHeight: r, clientHeight: c } = n == null ? void 0 : n.current;
63
- o ? (!l.height && t((p) => ({ ...p, height: c })), r !== c && t({ ...D, height: r + c })) : t({ ...D, height: D.minHeight });
66
+ l ? (!t.height && o((x) => ({ ...x, height: c })), r !== c && o({ ...j, height: r + c })) : o({ ...j, height: j.minHeight });
64
67
  }
65
- }, [o]), /* @__PURE__ */ e(
66
- Di,
68
+ }, [l]), /* @__PURE__ */ d(
69
+ Ri,
67
70
  {
68
- minHeight: l.minHeight,
71
+ minHeight: t.minHeight,
69
72
  ref: n,
70
73
  sx: i,
71
- ...a
74
+ ...e
72
75
  }
73
76
  );
74
- }, ki = ({ unmount: i, isWrapText: d, title: o, sx: a = {} }) => {
75
- const [n, l] = $(""), t = E(null);
76
- return X(() => {
77
- if (!i && t.current) {
78
- const r = t.current, c = setTimeout(() => {
79
- r != null && r.offsetWidth && (r == null ? void 0 : r.scrollWidth) > (r == null ? void 0 : r.offsetWidth) && l(o), clearTimeout(c);
77
+ }, Bi = ({ unmount: i, isWrapText: a, title: l, sx: e = {} }) => {
78
+ const [n, t] = B(""), o = K(null);
79
+ return Q(() => {
80
+ if (!i && o.current) {
81
+ const r = o.current, c = setTimeout(() => {
82
+ r != null && r.offsetWidth && (r == null ? void 0 : r.scrollWidth) > (r == null ? void 0 : r.offsetWidth) && t(l), clearTimeout(c);
80
83
  }, 200);
81
84
  }
82
- }, [o, i]), d ? !i && /* @__PURE__ */ e(ei, { children: o, sx: { textWrap: "wrap", overflowWrap: "break-word", ...a } }) : !i && /* @__PURE__ */ e($i, { ref: t, tooltipText: n, title: o, sx: a });
83
- }, G = I.memo(ki), $i = B(({ tooltipText: i, title: d, sx: o }, a) => /* @__PURE__ */ e(yi, { variant: "default", title: i, children: /* @__PURE__ */ e(ei, { ref: a, children: d, noWrap: !0, sx: o }) })), Bi = B(({ className: i = "", ...d }, o) => /* @__PURE__ */ e(
84
- Hi,
85
+ }, [l, i]), a ? !i && /* @__PURE__ */ d(di, { children: l, sx: { textWrap: "wrap", overflowWrap: "break-word", ...e } }) : !i && /* @__PURE__ */ d(zi, { ref: o, tooltipText: n, title: l, sx: e });
86
+ }, E = R.memo(Bi), zi = _(({ tooltipText: i, title: a, sx: l }, e) => /* @__PURE__ */ d(Hi, { variant: "default", title: i, children: /* @__PURE__ */ d(di, { component: "span", ref: e, children: a, noWrap: !0, sx: l }) })), Ni = _(({ className: i = "", ...a }, l) => /* @__PURE__ */ d(
87
+ ki,
85
88
  {
86
- ref: o,
87
- className: ({ isActive: a }) => a ? i + " Mui-selected" : i,
89
+ ref: l,
90
+ className: ({ isActive: e }) => e ? i + " Mui-selected" : i,
88
91
  end: !0,
89
- ...d
92
+ ...a
90
93
  }
91
- )), ii = I.memo(Bi), _ = ({ icon: i, sx: d }) => /* @__PURE__ */ e(
92
- ci,
94
+ )), ni = R.memo(Ni), X = ({ icon: i, sx: a }) => /* @__PURE__ */ d(
95
+ hi,
93
96
  {
94
97
  sx: {
95
98
  minWidth: 40,
96
- position: "absolute",
97
- left: 0,
98
- top: 0,
99
- bottom: 0,
100
99
  alignItems: "center",
101
100
  justifyContent: "center",
102
- ...d
101
+ ...a
103
102
  },
104
103
  children: i
105
104
  }
106
- ), Ri = g(di, {
105
+ ), Oi = p(ai, {
107
106
  shouldForwardProp: (i) => !["styleList", "isScrollIndentation"].includes(i)
108
- })(({ theme: i, styleList: d = "variant1" }) => ({
107
+ })(({ theme: i, styleList: a = "variant1" }) => ({
109
108
  display: "flex",
110
109
  flexDirection: "column",
111
110
  overflowX: "hidden",
@@ -133,15 +132,36 @@ const Ii = g("main")(() => ({
133
132
  // scrollbarWidth: 'thin !important'
134
133
  }
135
134
  },
136
- minWidth: d === "variant1" ? "40px" : "53px",
137
- "& .MuiCollapse-root .MuiButtonBase-root": {
138
- marginLeft: i.spacing(1.5)
139
- },
140
- ...d === "variant1" && {},
141
- ...d === "variant2" && {
142
- "& .MuiListItem-root": {
135
+ minWidth: a === "variant1" ? "40px" : "53px"
136
+ // '& .MuiCollapse-root .MuiButtonBase-root': {
137
+ // // marginLeft: theme.spacing(1.5),
138
+ // },
139
+ // ...(styleList === 'variant1') && {
140
+ // '& .MuiCollapse-root .MuiButtonBase-root': {
141
+ // paddingLeft: theme.spacing(1.5),
142
+ // },
143
+ // },
144
+ // ...(styleList === 'variant2') && {
145
+ // '& .MuiListItem-root': {
146
+ // padding: `0 ${theme.spacing(1)}`,
147
+ // },
148
+ // '& .MuiButtonBase-root': {
149
+ // borderRadius: '5px',
150
+ // '&.Mui-selected': {
151
+ // backgroundColor: 'rgba(33,150,243, 0.16)'
152
+ // }
153
+ // },
154
+ // }
155
+ })), Y = p(si, {
156
+ shouldForwardProp: (i) => !["visual"].includes(i)
157
+ })(({ theme: i, visual: a }) => ({
158
+ ...a === "variant2" && {
159
+ "&": {
143
160
  padding: `0 ${i.spacing(1)}`
144
161
  },
162
+ "& .MuiListItemIcon-root": {
163
+ marginLeft: `-${i.spacing(1)}`
164
+ },
145
165
  "& .MuiButtonBase-root": {
146
166
  borderRadius: "5px",
147
167
  "&.Mui-selected": {
@@ -149,95 +169,112 @@ const Ii = g("main")(() => ({
149
169
  }
150
170
  }
151
171
  }
152
- })), zi = B(({ styleList: i = "variant1", columnMenu: d, isWrapText: o = !1, listMenu: a, isOpen: n, sx: l, className: t }, r) => {
153
- const { minWidthColumn: c } = d, p = U(() => ai(c, { newProp: "marginLeft" }), [c]), R = U(() => a.map(({ action: m, icon: C, title: L, sx: T = {}, onClick: W, children: w, to: z }, s) => w && Array.isArray(w) ? /* @__PURE__ */ e(mi, { children: /* @__PURE__ */ e(
154
- Mi,
155
- {
156
- render: (b) => /* @__PURE__ */ h(k, { children: [
157
- /* @__PURE__ */ h(j, { disablePadding: !0, sx: T, children: [
158
- /* @__PURE__ */ e(
159
- _,
160
- {
161
- icon: C,
162
- sx: c
163
- }
164
- ),
165
- /* @__PURE__ */ h(
166
- A,
172
+ })), q = ({ isIcon: i }) => ({ paddingRight: 1.2, ...!i && { paddingLeft: 1.2 } }), Fi = _(({ styleList: i = "variant1", isRight: a, columnMenu: l, isWrapText: e = !1, listMenu: n, isOpen: t, sx: o, className: r }, c) => {
173
+ const { minWidthColumn: x } = l, [I, v] = B(""), y = li(() => n.map(({ action: W, icon: g, title: z, sx: H = {}, onClick: S, children: m, to: k }, h) => {
174
+ const D = `${h}`, w = (s) => {
175
+ v(D), S && S(s);
176
+ };
177
+ return m && Array.isArray(m) ? /* @__PURE__ */ d(bi, { children: /* @__PURE__ */ d(
178
+ $i,
179
+ {
180
+ defaultStatus: t,
181
+ render: (s) => /* @__PURE__ */ f(A, { children: [
182
+ /* @__PURE__ */ d(Y, { disablePadding: !0, sx: H, visual: i, children: /* @__PURE__ */ f(
183
+ U,
167
184
  {
168
- isOpen: n,
169
- isWrapText: o,
170
- onClick: (f) => {
171
- b.handleToggle(), typeof W == "function" && W(f);
185
+ isOpen: s.is,
186
+ isWrapText: e,
187
+ onClick: (M) => {
188
+ s.handleToggle(), typeof S == "function" && S(M);
172
189
  },
190
+ sx: { ...q({ isIcon: g }) },
173
191
  children: [
174
- /* @__PURE__ */ e(
175
- G,
192
+ g && /* @__PURE__ */ d(
193
+ X,
194
+ {
195
+ icon: g,
196
+ sx: x
197
+ }
198
+ ),
199
+ /* @__PURE__ */ d(
200
+ E,
176
201
  {
177
- unmount: !n,
178
- title: L,
179
- sx: { flexGrow: 1, ...p },
180
- isWrapText: o
202
+ unmount: !t,
203
+ title: z,
204
+ sx: { flexGrow: 1 },
205
+ isWrapText: e
181
206
  }
182
207
  ),
183
- n && /* @__PURE__ */ h(k, { children: [
184
- m,
185
- b.is ? /* @__PURE__ */ e(Li, {}) : /* @__PURE__ */ e(Wi, {})
208
+ t && /* @__PURE__ */ f(A, { children: [
209
+ W,
210
+ s.is ? /* @__PURE__ */ d(yi, {}) : /* @__PURE__ */ d(Wi, {})
186
211
  ] })
187
212
  ]
188
213
  }
189
- )
190
- ] }),
191
- /* @__PURE__ */ e(hi, { in: b.is && n, timeout: "auto", unmountOnExit: !0, children: /* @__PURE__ */ e(di, { disablePadding: !0, children: w.map(({ action: f, icon: v, title: x, to: u, sx: O = {}, onClick: F }, M) => /* @__PURE__ */ e(j, { disablePadding: !0, sx: O, children: /* @__PURE__ */ h(
192
- A,
193
- {
194
- to: u,
195
- component: ii,
196
- sx: ({ spacing: y }) => ({ ...!v && { paddingLeft: y(2) } }),
197
- isOpen: !0,
198
- onClick: F,
199
- isWrapText: o,
200
- children: [
201
- /* @__PURE__ */ e(
202
- _,
203
- {
204
- icon: v,
205
- sx: c
206
- }
207
- ),
208
- /* @__PURE__ */ e(
209
- G,
210
- {
211
- sx: () => ({ ...v && p }),
212
- unmount: !n,
213
- title: x,
214
- isWrapText: o
215
- }
216
- ),
217
- n && f
218
- ]
219
- }
220
- ) }, `${s}-${M}`)) }) })
221
- ] })
222
- }
223
- ) }, s) : /* @__PURE__ */ h(j, { disablePadding: !0, sx: T, children: [
224
- /* @__PURE__ */ e(_, { icon: C, sx: c }),
225
- /* @__PURE__ */ h(A, { component: ii, to: z, isOpen: n, onClick: W, isWrapText: o, children: [
226
- /* @__PURE__ */ e(G, { sx: p, unmount: !n, title: L, isWrapText: o }),
227
- n && m
228
- ] })
229
- ] }, s)), [a, n, p]);
230
- return /* @__PURE__ */ e(
231
- Ri,
214
+ ) }),
215
+ /* @__PURE__ */ d(fi, { in: s.is && t, timeout: "auto", unmountOnExit: !0, children: /* @__PURE__ */ d(ai, { disablePadding: !0, children: m.map(({ action: M, icon: T, title: N, to: C, sx: O = {}, onClick: $ }, F) => {
216
+ const L = `${h}-${F}`, b = (u) => {
217
+ v(L), $ && $(u);
218
+ };
219
+ return /* @__PURE__ */ d(Y, { disablePadding: !0, sx: O, visual: i, children: /* @__PURE__ */ f(
220
+ U,
221
+ {
222
+ sx: { paddingRight: 1.2, ...!T && { paddingLeft: 2.5 } },
223
+ isOpen: !0,
224
+ onClick: b,
225
+ isWrapText: e,
226
+ ...C ? { to: C, component: ni } : { to: "", className: G({ "Mui-selected": I === L }) },
227
+ children: [
228
+ T && /* @__PURE__ */ d(X, { icon: T, sx: { ...x, marginLeft: "0 !important" } }),
229
+ /* @__PURE__ */ d(
230
+ E,
231
+ {
232
+ unmount: !t,
233
+ title: N,
234
+ isWrapText: e
235
+ }
236
+ ),
237
+ t && M
238
+ ]
239
+ }
240
+ ) }, L);
241
+ }) }) })
242
+ ] })
243
+ }
244
+ ) }, h) : /* @__PURE__ */ d(Y, { disablePadding: !0, sx: H, visual: i, children: /* @__PURE__ */ f(
245
+ U,
246
+ {
247
+ isOpen: t,
248
+ onClick: w,
249
+ isWrapText: e,
250
+ ...k ? { to: k, component: ni } : { to: "", className: G({ "Mui-selected": I === D }) },
251
+ sx: { ...q({ isIcon: g }) },
252
+ children: [
253
+ g && /* @__PURE__ */ d(X, { icon: g, sx: x }),
254
+ /* @__PURE__ */ d(
255
+ E,
256
+ {
257
+ unmount: !t,
258
+ title: z,
259
+ isWrapText: e
260
+ }
261
+ ),
262
+ t && W
263
+ ]
264
+ }
265
+ ) }, h);
266
+ }), [n, t, I, a, q]);
267
+ return /* @__PURE__ */ d(
268
+ Oi,
232
269
  {
233
- ref: r,
270
+ ref: c,
234
271
  styleList: i,
235
- sx: l,
236
- className: t,
237
- children: R
272
+ sx: o,
273
+ className: r,
274
+ children: y
238
275
  }
239
276
  );
240
- }), Oi = I.memo(zi), Fi = g(V, {
277
+ }), ji = R.memo(Fi), Ai = p(J, {
241
278
  target: "MuiFooter-root",
242
279
  shouldForwardProp: (i) => ![""].includes(i)
243
280
  })(({}) => ({
@@ -246,205 +283,207 @@ const Ii = g("main")(() => ({
246
283
  // bottom: 0,
247
284
  // right: 0,
248
285
  minHeight: 48
249
- })), Ni = ({
286
+ })), Gi = ({
250
287
  initWidth: i,
251
- isOpen: d,
252
- children: o,
253
- isRight: a,
288
+ isOpen: a,
289
+ children: l,
290
+ isRight: e,
254
291
  isHeaderResize: n = !0,
255
- bgColor: l,
256
- className: t,
292
+ bgColor: t,
293
+ className: o,
257
294
  AfterComponent: r,
258
295
  sx: c
259
- }) => /* @__PURE__ */ h(
260
- Ai,
296
+ }) => /* @__PURE__ */ f(
297
+ Vi,
261
298
  {
262
- className: t,
263
- bgColor: l,
264
- isRight: a,
299
+ className: o,
300
+ bgColor: t,
301
+ isRight: e,
265
302
  position: "fixed",
266
303
  initWidth: i,
267
- isOpen: d,
304
+ isOpen: a,
268
305
  isHeaderResize: n,
269
306
  sx: c,
270
307
  children: [
271
- /* @__PURE__ */ e(pi, { maxWidth: "xl", children: /* @__PURE__ */ e(gi, { sx: { flexGrow: 1 }, disableGutters: !0, children: o }) }),
308
+ /* @__PURE__ */ d(gi, { maxWidth: "xl", children: /* @__PURE__ */ d(ui, { sx: { flexGrow: 1 }, disableGutters: !0, children: l }) }),
272
309
  r && r
273
310
  ]
274
311
  }
275
- ), ji = I.memo(Ni), Ai = g(fi, {
312
+ ), _i = R.memo(Gi), Vi = p(pi, {
276
313
  shouldForwardProp: (i) => !["isOpen", "isRight", "initWidth", "bgColor", "isHeaderResize"].includes(i)
277
- })(({ theme: i, isOpen: d, isRight: o, initWidth: a = 250, bgColor: n = "primary", isHeaderResize: l }) => ({
278
- backgroundColor: Si.colors.getColorPalette(i, n),
314
+ })(({ theme: i, isOpen: a, isRight: l, initWidth: e = 250, bgColor: n = "primary", isHeaderResize: t }) => ({
315
+ backgroundColor: Li.colors.getColorPalette(i, n),
279
316
  zIndex: i.zIndex.drawer + 1,
280
317
  color: "info.main",
281
318
  transition: i.transitions.create(["width", "margin"], {
282
319
  easing: i.transitions.easing.sharp,
283
320
  duration: i.transitions.duration.leavingScreen
284
321
  }),
285
- ...d && {
286
- ...o ? { marginRight: a } : { marginLeft: a },
287
- width: `calc(100% - ${a}px)`,
288
- ...!l && { width: "100%", zIndex: 3, margin: 0 },
322
+ ...a && {
323
+ ...l ? { marginRight: e } : { marginLeft: e },
324
+ width: `calc(100% - ${e}px)`,
325
+ ...!t && { width: "100%", zIndex: 3, margin: 0 },
289
326
  transition: i.transitions.create(["width", "margin"], {
290
327
  easing: i.transitions.easing.sharp,
291
328
  duration: i.transitions.duration.enteringScreen
292
329
  })
293
330
  }
294
- })), ni = (i, d, o = !0) => ({
295
- width: d,
296
- ...o && {
331
+ })), ri = (i, a, l = !0) => ({
332
+ width: a,
333
+ ...l && {
297
334
  transition: i.transitions.create("width", {
298
335
  easing: i.transitions.easing.sharp,
299
336
  duration: i.transitions.duration.enteringScreen
300
337
  })
301
338
  },
302
339
  overflow: "hidden"
303
- }), ri = (i, d, o = !0) => ({
304
- ...o && {
340
+ }), ti = (i, a, l = !0) => ({
341
+ ...l && {
305
342
  transition: i.transitions.create("width", {
306
343
  easing: i.transitions.easing.sharp,
307
344
  duration: i.transitions.duration.leavingScreen
308
345
  })
309
346
  },
310
347
  overflow: "hidden",
311
- ...d
348
+ ...a
312
349
  // width: `calc(${theme.spacing(7)} + 1px)`,
313
350
  // [theme.breakpoints.up('sm')]: {
314
351
  // width: `calc(${theme.spacing(8)} + 1px)`,
315
352
  // },
316
- }), Gi = g(si, {
353
+ }), Ui = p(xi, {
317
354
  shouldForwardProp: (i) => !["open", "isWrapText", "columnMenu", "isRight", "styleList"].includes(i)
318
355
  })(
319
- ({ theme: i, open: d, isRight: o, columnMenu: a }) => {
320
- const n = o ? "Left" : "Right", l = a.initWidth, t = a.minWidthColumn;
356
+ ({ theme: i, open: a, isRight: l, columnMenu: e }) => {
357
+ const n = l ? "Left" : "Right", t = e.initWidth, o = e.minWidthColumn;
321
358
  return {
322
- width: l,
359
+ width: t,
323
360
  position: "relative",
324
361
  zIndex: 0,
325
362
  flexShrink: 0,
326
363
  whiteSpace: "nowrap",
327
364
  boxSizing: "border-box",
328
365
  [`border${n}`]: `1px solid ${i.palette.divider}`,
329
- ...o ? { order: 1 } : { order: 0 },
330
- ...d ? ni(i, l) : ri(i, t),
366
+ ...l ? { order: 1 } : { order: 0 },
367
+ ...a ? ri(i, t) : ti(i, o),
331
368
  "& .MuiDrawer-paper": {
332
369
  position: "static",
333
370
  // при isWrapText - при открытии меню текст сжатый и значки смешаются поэтому ставим условие
334
- ...d ? ni(i, l) : ri(i, t)
371
+ ...a ? ri(i, t) : ti(i, o)
335
372
  // ...(open ? openedMixin(theme, initWidth) : closedMixin(theme, isWrapText ? { width: initWidth } : minWidth))
336
373
  }
337
374
  };
338
375
  }
339
- ), oi = g("div")(({ theme: i }) => ({
376
+ ), oi = p("div")(({ theme: i }) => ({
340
377
  display: "flex",
341
378
  padding: i.spacing(0, 1),
342
379
  ...i.mixins.toolbar
343
- })), ti = (i) => {
344
- const { clientWidth: d, offsetWidth: o } = i;
345
- return o - d;
346
- }, _i = B(({ Footer: i, listMenu: d, children: o, HeaderContent: a, statuses: n, itemsProps: l, classes: t, columnMenu: r, styleList: c, sx: p }, R) => {
347
- var Y, q, J, K;
348
- const m = ui(), C = (r == null ? void 0 : r.position) === "right", L = !1, T = !0;
380
+ })), ei = (i) => {
381
+ const { clientWidth: a, offsetWidth: l } = i;
382
+ return l - a;
383
+ }, Ei = _(({ Footer: i, listMenu: a, children: l, HeaderContent: e, statuses: n, itemsProps: t, classes: o, columnMenu: r, styleList: c, sx: x }, I) => {
384
+ var O, $, F, L;
385
+ const v = wi(), y = (r == null ? void 0 : r.position) === "right", W = !1, g = !0;
349
386
  //!!statuses?.isScrollIndentation
350
- const W = (n == null ? void 0 : n.isHeaderDefault) === void 0 ? !0 : n == null ? void 0 : n.isHeaderDefault, w = (n == null ? void 0 : n.isHeader) === void 0 ? !0 : n == null ? void 0 : n.isHeader, z = (n == null ? void 0 : n.isMenu) === void 0 ? !0 : n == null ? void 0 : n.isMenu, s = (r == null ? void 0 : r.initWidth) || 250, b = U(() => r != null && r.minWidthColumn && Object.keys(r == null ? void 0 : r.minWidthColumn).length ? r == null ? void 0 : r.minWidthColumn : {
351
- width: `calc(${m.spacing(7)} + 1px)`,
352
- [m.breakpoints.up("sm")]: {
353
- width: `calc(${m.spacing(8)} + 1px)`
387
+ const z = (n == null ? void 0 : n.isHeaderDefault) === void 0 ? !0 : n == null ? void 0 : n.isHeaderDefault, H = (n == null ? void 0 : n.isHeader) === void 0 ? !0 : n == null ? void 0 : n.isHeader, S = (n == null ? void 0 : n.isMenu) === void 0 ? !0 : n == null ? void 0 : n.isMenu, m = (r == null ? void 0 : r.initWidth) || 250, k = li(() => r != null && r.minWidthColumn && Object.keys(r == null ? void 0 : r.minWidthColumn).length ? r == null ? void 0 : r.minWidthColumn : {
388
+ width: `calc(${v.spacing(7)} + 1px)`,
389
+ [v.breakpoints.up("sm")]: {
390
+ width: `calc(${v.spacing(8)} + 1px)`
354
391
  }
355
- }, [r == null ? void 0 : r.minWidthColumn]), [f, v] = $({
392
+ }, [r == null ? void 0 : r.minWidthColumn]), [h, D] = B({
356
393
  isOpen: !!(n != null && n.isDefaultOpen),
357
394
  widthCloseColumn: 0,
358
395
  widthScroll: 0
359
- }), x = Ci(f, v), u = E(null);
360
- X(() => {
361
- if (u.current) {
362
- const H = ti(u.current);
363
- let S = !1;
364
- H > 0 && (S = !0), x({ widthScroll: S ? H + 1 : 0 }), window.onresize = function() {
365
- if (u.current) {
366
- const N = ti(u.current);
367
- S && !N && (S = !1, x({ widthScroll: 0 })), !S && N && (S = !0, x({ widthScroll: N + 1 }));
396
+ }), w = Ii(h, D), s = K(null);
397
+ Q(() => {
398
+ if (s.current) {
399
+ const b = ei(s.current);
400
+ let u = !1;
401
+ b > 0 && (u = !0), w({ widthScroll: u ? b + 1 : 0 }), window.onresize = function() {
402
+ if (s.current) {
403
+ const V = ei(s.current);
404
+ u && !V && (u = !1, w({ widthScroll: 0 })), !u && V && (u = !0, w({ widthScroll: V + 1 }));
368
405
  }
369
406
  };
370
407
  }
371
- }, [T]);
372
- const O = () => {
373
- x({ isOpen: !0 });
374
- }, F = () => {
375
- x({ isOpen: !1 });
376
- }, M = () => {
377
- v((H) => ({ ...H, isOpen: !H.isOpen }));
378
- }, y = {
379
- isOpen: f.isOpen,
380
- handleMenuOpen: O,
381
- handleMenuClose: F,
382
- handleMenuToggle: M
408
+ }, [g]);
409
+ const M = () => {
410
+ w({ isOpen: !0 });
411
+ }, T = () => {
412
+ w({ isOpen: !1 });
413
+ }, N = () => {
414
+ D((b) => ({ ...b, isOpen: !b.isOpen }));
415
+ }, C = {
416
+ isOpen: h.isOpen,
417
+ handleMenuOpen: M,
418
+ handleMenuClose: T,
419
+ handleMenuToggle: N
383
420
  };
384
- return wi(R, () => y), /* @__PURE__ */ h(V, { className: Z("Dashboard", t == null ? void 0 : t.dashboard), sx: { display: "flex", height: "inherit", ...p }, children: [
385
- w ? W ? /* @__PURE__ */ e(
386
- ji,
421
+ return vi(I, () => C), /* @__PURE__ */ f(J, { className: G("Dashboard", o == null ? void 0 : o.dashboard), sx: { display: "flex", height: "inherit", ...x }, children: [
422
+ H ? z ? /* @__PURE__ */ d(
423
+ _i,
387
424
  {
388
- initWidth: s,
389
- isOpen: f.isOpen,
390
- bgColor: (Y = l == null ? void 0 : l.MuiHeader) == null ? void 0 : Y.bgColor,
391
- isRight: C,
425
+ initWidth: m,
426
+ isOpen: h.isOpen,
427
+ bgColor: (O = t == null ? void 0 : t.MuiHeader) == null ? void 0 : O.bgColor,
428
+ isRight: y,
392
429
  isHeaderResize: n == null ? void 0 : n.isHeaderResize,
393
- sx: (q = l == null ? void 0 : l.MuiHeader) == null ? void 0 : q.sx,
394
- className: t == null ? void 0 : t.header,
395
- AfterComponent: (J = l == null ? void 0 : l.MuiHeader) == null ? void 0 : J.AfterComponent,
396
- children: typeof a == "function" ? a(y) : a
430
+ sx: ($ = t == null ? void 0 : t.MuiHeader) == null ? void 0 : $.sx,
431
+ className: o == null ? void 0 : o.header,
432
+ AfterComponent: (F = t == null ? void 0 : t.MuiHeader) == null ? void 0 : F.AfterComponent,
433
+ children: typeof e == "function" ? e(C) : e
397
434
  }
398
- ) : typeof a == "function" ? a(y) : a : null,
399
- z && /* @__PURE__ */ h(
400
- Gi,
435
+ ) : typeof e == "function" ? e(C) : e : null,
436
+ S && /* @__PURE__ */ f(
437
+ Ui,
401
438
  {
402
439
  variant: "permanent",
403
- open: f.isOpen,
404
- isRight: C,
405
- isWrapText: L,
406
- columnMenu: { initWidth: s, minWidthColumn: b },
440
+ open: h.isOpen,
441
+ isRight: y,
442
+ isWrapText: W,
443
+ columnMenu: { initWidth: m, minWidthColumn: k },
407
444
  styleList: c,
408
445
  children: [
409
- (n == null ? void 0 : n.isMenuHeader) !== !1 && /* @__PURE__ */ h(k, { children: [
410
- /* @__PURE__ */ e(oi, {}),
411
- /* @__PURE__ */ e(Q, {})
446
+ (n == null ? void 0 : n.isMenuHeader) !== !1 && /* @__PURE__ */ f(A, { children: [
447
+ /* @__PURE__ */ d(oi, {}),
448
+ /* @__PURE__ */ d(Z, {})
412
449
  ] }),
413
- /* @__PURE__ */ e(V, { className: "MuiListWrap", sx: {
450
+ /* @__PURE__ */ d(J, { className: "MuiListWrap", sx: {
414
451
  display: "flex",
415
452
  flexDirection: "column",
416
453
  flexGrow: 1,
417
454
  overflow: "hidden"
418
- }, children: /* @__PURE__ */ e(
419
- Oi,
455
+ }, children: /* @__PURE__ */ d(
456
+ ji,
420
457
  {
421
- ref: u,
458
+ ref: s,
459
+ isRight: y,
422
460
  columnMenu: {
423
- initWidth: s,
424
- minWidthColumn: ai(b, { newProp: "width", positionCorrect: `- ${f.widthScroll}px` })
461
+ initWidth: m,
462
+ minWidthColumn: Ti(k, { newProp: "width", positionCorrect: `- ${h.widthScroll}px` })
425
463
  },
426
- listMenu: d,
427
- isOpen: f.isOpen,
428
- sx: (K = l == null ? void 0 : l.MuiListMenu) == null ? void 0 : K.sx,
429
- className: t == null ? void 0 : t.listMenu,
430
- isWrapText: L,
464
+ listMenu: a,
465
+ isOpen: h.isOpen,
466
+ sx: (L = t == null ? void 0 : t.MuiListMenu) == null ? void 0 : L.sx,
467
+ className: o == null ? void 0 : o.listMenu,
468
+ isWrapText: W,
431
469
  styleList: c
432
470
  }
433
471
  ) }),
434
- (n == null ? void 0 : n.isButtonCenterMenu) !== !1 && /* @__PURE__ */ e(Ti, { children: /* @__PURE__ */ e(xi, { onClick: M, sx: { pointerEvents: "auto" }, children: f.isOpen ? /* @__PURE__ */ e(vi, {}) : /* @__PURE__ */ e(bi, {}) }) }),
435
- i && /* @__PURE__ */ e(k, { children: /* @__PURE__ */ h(Fi, { children: [
436
- /* @__PURE__ */ e(Q, {}),
472
+ (n == null ? void 0 : n.isButtonCenterMenu) !== !1 && /* @__PURE__ */ d(Mi, { children: /* @__PURE__ */ d(mi, { onClick: N, sx: { pointerEvents: "auto" }, children: h.isOpen ? /* @__PURE__ */ d(Ci, {}) : /* @__PURE__ */ d(Si, {}) }) }),
473
+ i && /* @__PURE__ */ d(A, { children: /* @__PURE__ */ f(Ai, { children: [
474
+ /* @__PURE__ */ d(Z, {}),
437
475
  i
438
476
  ] }) })
439
477
  ]
440
478
  }
441
479
  ),
442
- /* @__PURE__ */ h(Ii, { className: Z("Dashboard-main", t == null ? void 0 : t.main), children: [
443
- w && /* @__PURE__ */ e(oi, {}),
444
- o
480
+ /* @__PURE__ */ f(Di, { className: G("Dashboard-main", o == null ? void 0 : o.main), children: [
481
+ H && /* @__PURE__ */ d(oi, {}),
482
+ l
445
483
  ] })
446
484
  ] });
447
- }), nn = I.memo(_i);
485
+ }), on = R.memo(Ei);
448
486
  export {
449
- nn as Dashboard
487
+ on as Dashboard,
488
+ _i as MuiHeader
450
489
  };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsxs as g, jsx as e } from "react/jsx-runtime";
2
2
  import { styled as n, Typography as o } from "@mui/material";
3
3
  import h from "react";
4
- import { T as H } from "./Tooltips-D4gQprYO.js";
4
+ import { T as H } from "./Tooltips-Q_C8jHNF.js";
5
5
  const u = n(o)({
6
6
  display: "flex",
7
7
  alignItems: "center",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rc-lib-ui",
3
3
  "private": false,
4
- "version": "1.2.16-beta.6",
4
+ "version": "1.2.18",
5
5
  "author": "SinGlEBW",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -1,3 +0,0 @@
1
- export interface ListButtonInnerProps {
2
- }
3
- export declare const ListButtonInner: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & ListButtonInnerProps, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;