rc-lib-ui 1.0.33 → 1.0.48

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.
@@ -1,31 +1,29 @@
1
- import { jsx as e, jsxs as p, Fragment as T } from "react/jsx-runtime";
1
+ import { jsxs as c, jsx as o, Fragment as z } from "react/jsx-runtime";
2
2
  import V, { forwardRef as q, useMemo as J, useState as K, useRef as Q, useEffect as U, useImperativeHandle as X } from "react";
3
- import { useTheme as Y } from "@mui/material/styles";
4
- import { Box as y, Divider as B, IconButton as Z } from "@mui/material";
5
- import { c as N, L as M } from "../ListMenu-DEYH0h3L.js";
3
+ import { useTheme as Y } from "@mui/material/styles/index.js";
4
+ import { Box as B, Divider as j, IconButton as Z } from "@mui/material";
5
+ import _ from "@mui/icons-material/ChevronLeft.js";
6
+ import M from "@mui/icons-material/ChevronRight.js";
6
7
  import { setStateDecorator as P } from "../_helpers/index.js";
7
8
  import { ContentBox as u } from "./components/ContentBox.js";
8
9
  import { DrawerToggleMenu as s } from "./components/DrawerToggleMenu.js";
9
- import { MuiHeader as ii } from "./components/MuiHeader.js";
10
- import { MuiMenu as ri } from "./components/MuiMenu.js";
11
- import { MuiMenuHeader as j } from "./components/MuiMenuHeader.js";
10
+ import { ListMenu as ii } from "./components/ListMemu/ListMenu.js";
11
+ import { MuiHeader as ri } from "./components/MuiHeader.js";
12
+ import { MuiMenu as oi } from "./components/MuiMenu.js";
13
+ import { MuiMenuHeader as k } from "./components/MuiMenuHeader.js";
12
14
  import { MuiFooter as ei } from "./components/MuiFooter.js";
13
- import { convertWidthToLeftPM as oi } from "./components/ListMemu/helpers.js";
14
- const ni = N(/* @__PURE__ */ e("path", {
15
- d: "M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"
16
- }), "ChevronLeft"), di = N(/* @__PURE__ */ e("path", {
17
- d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
18
- }), "ChevronRight"), k = (x) => {
19
- const { clientWidth: g, offsetWidth: w } = x;
20
- return w - g;
21
- }, fi = q(({ Footer: x, listMenu: g, children: w, HeaderContent: d, statuses: i, itemsProps: o, classes: f, columnMenu: r, styleList: m, sx: $ }, A) => {
22
- var L, z, I;
23
- const a = Y(), W = (r == null ? void 0 : r.position) === "right", v = !1, E = !0;
15
+ import { convertWidthToLeftPM as ni } from "./components/ListMemu/helpers.js";
16
+ const L = (x) => {
17
+ const { clientWidth: m, offsetWidth: w } = x;
18
+ return w - m;
19
+ }, di = q(({ Footer: x, listMenu: m, children: w, HeaderContent: d, statuses: i, itemsProps: e, classes: f, columnMenu: r, styleList: W, sx: N }, $) => {
20
+ var I, T, y;
21
+ const g = Y(), a = (r == null ? void 0 : r.position) === "right", H = !1, A = !0;
24
22
  //!!statuses?.isScrollIndentation
25
- const _ = (i == null ? void 0 : i.isHeaderDefault) === void 0 ? !0 : i == null ? void 0 : i.isHeaderDefault, H = (i == null ? void 0 : i.isHeader) === void 0 ? !0 : i == null ? void 0 : i.isHeader, C = (r == null ? void 0 : r.initWidth) || 250, D = J(() => r != null && r.minWidthColumn && Object.keys(r == null ? void 0 : r.minWidthColumn).length ? r == null ? void 0 : r.minWidthColumn : {
26
- width: `calc(${a.spacing(7)} + 1px)`,
27
- [a.breakpoints.up("sm")]: {
28
- width: `calc(${a.spacing(8)} + 1px)`
23
+ const E = (i == null ? void 0 : i.isHeaderDefault) === void 0 ? !0 : i == null ? void 0 : i.isHeaderDefault, D = (i == null ? void 0 : i.isHeader) === void 0 ? !0 : i == null ? void 0 : i.isHeader, O = (r == null ? void 0 : r.initWidth) || 250, v = J(() => r != null && r.minWidthColumn && Object.keys(r == null ? void 0 : r.minWidthColumn).length ? r == null ? void 0 : r.minWidthColumn : {
24
+ width: `calc(${g.spacing(7)} + 1px)`,
25
+ [g.breakpoints.up("sm")]: {
26
+ width: `calc(${g.spacing(8)} + 1px)`
29
27
  }
30
28
  }, [r == null ? void 0 : r.minWidthColumn]), [n, R] = K({
31
29
  isOpen: !!(i != null && i.isDefaultOpen),
@@ -34,94 +32,94 @@ const ni = N(/* @__PURE__ */ e("path", {
34
32
  }), l = P(n, R), t = Q(null);
35
33
  U(() => {
36
34
  if (t.current) {
37
- const c = k(t.current);
35
+ const p = L(t.current);
38
36
  let h = !1;
39
- c > 0 && (h = !0), l({ widthScroll: h ? c + 1 : 0 }), window.onresize = function() {
37
+ p > 0 && (h = !0), l({ widthScroll: h ? p + 1 : 0 }), window.onresize = function() {
40
38
  if (t.current) {
41
- const S = k(t.current);
42
- h && !S && (h = !1, l({ widthScroll: 0 })), !h && S && (h = !0, l({ widthScroll: S + 1 }));
39
+ const C = L(t.current);
40
+ h && !C && (h = !1, l({ widthScroll: 0 })), !h && C && (h = !0, l({ widthScroll: C + 1 }));
43
41
  }
44
42
  };
45
43
  }
46
- }, [E]);
44
+ }, [A]);
47
45
  const F = () => {
48
46
  l({ isOpen: !0 });
49
47
  }, G = () => {
50
48
  l({ isOpen: !1 });
51
49
  }, b = () => {
52
- R((c) => ({ ...c, isOpen: !c.isOpen }));
53
- }, O = {
50
+ R((p) => ({ ...p, isOpen: !p.isOpen }));
51
+ }, S = {
54
52
  isOpen: n.isOpen,
55
53
  handleMenuOpen: F,
56
54
  handleMenuClose: G,
57
55
  handleMenuToggle: b
58
56
  };
59
- return X(A, () => O), /* @__PURE__ */ p(y, { sx: { display: "flex", height: "inherit" }, children: [
60
- H ? _ ? /* @__PURE__ */ e(
61
- ii,
57
+ return X($, () => S), /* @__PURE__ */ c(B, { sx: { display: "flex", height: "inherit" }, children: [
58
+ D ? E ? /* @__PURE__ */ o(
59
+ ri,
62
60
  {
63
- initWidth: C,
61
+ initWidth: O,
64
62
  isOpen: n.isOpen,
65
- bgColor: (L = o == null ? void 0 : o.MuiHeader) == null ? void 0 : L.bgColor,
66
- isRight: W,
63
+ bgColor: (I = e == null ? void 0 : e.MuiHeader) == null ? void 0 : I.bgColor,
64
+ isRight: a,
67
65
  isHeaderResize: i == null ? void 0 : i.isHeaderResize,
68
- sx: (z = o == null ? void 0 : o.MuiHeader) == null ? void 0 : z.sx,
66
+ sx: (T = e == null ? void 0 : e.MuiHeader) == null ? void 0 : T.sx,
69
67
  className: f == null ? void 0 : f.header,
70
- AfterComponent: (I = o == null ? void 0 : o.MuiHeader) == null ? void 0 : I.AfterComponent,
71
- children: typeof d == "function" ? d(O) : d
68
+ AfterComponent: (y = e == null ? void 0 : e.MuiHeader) == null ? void 0 : y.AfterComponent,
69
+ children: typeof d == "function" ? d(S) : d
72
70
  }
73
- ) : typeof d == "function" ? d(O) : d : null,
74
- /* @__PURE__ */ p(
75
- ri,
71
+ ) : typeof d == "function" ? d(S) : d : null,
72
+ /* @__PURE__ */ c(
73
+ oi,
76
74
  {
77
75
  variant: "permanent",
78
76
  open: n.isOpen,
79
- isRight: W,
80
- isWrapText: v,
81
- columnMenu: { initWidth: C, minWidthColumn: D },
82
- styleList: m,
77
+ isRight: a,
78
+ isWrapText: H,
79
+ columnMenu: { initWidth: O, minWidthColumn: v },
80
+ styleList: W,
83
81
  children: [
84
- (i == null ? void 0 : i.isMenuHeader) !== !1 && /* @__PURE__ */ p(T, { children: [
85
- /* @__PURE__ */ e(j, {}),
86
- /* @__PURE__ */ e(B, {})
82
+ (i == null ? void 0 : i.isMenuHeader) !== !1 && /* @__PURE__ */ c(z, { children: [
83
+ /* @__PURE__ */ o(k, {}),
84
+ /* @__PURE__ */ o(j, {})
87
85
  ] }),
88
- /* @__PURE__ */ e(y, { className: "MuiListWrap", sx: {
86
+ /* @__PURE__ */ o(B, { className: "MuiListWrap", sx: {
89
87
  display: "flex",
90
88
  flexDirection: "column",
91
89
  flexGrow: 1,
92
90
  overflow: "hidden"
93
- }, children: /* @__PURE__ */ e(
94
- M,
91
+ }, children: /* @__PURE__ */ o(
92
+ ii,
95
93
  {
96
94
  ref: t,
97
95
  columnMenu: {
98
- initWidth: C,
99
- minWidthColumn: oi(D, { newProp: "width", positionCorrect: `- ${n.widthScroll}px` })
96
+ initWidth: O,
97
+ minWidthColumn: ni(v, { newProp: "width", positionCorrect: `- ${n.widthScroll}px` })
100
98
  },
101
- listMenu: g,
99
+ listMenu: m,
102
100
  isOpen: n.isOpen,
103
101
  sx: {
104
- ...$
102
+ ...N
105
103
  },
106
104
  className: f == null ? void 0 : f.listMenu,
107
- isWrapText: v,
108
- styleList: m
105
+ isWrapText: H,
106
+ styleList: W
109
107
  }
110
108
  ) }),
111
- (i == null ? void 0 : i.isButtonCenterMenu) !== !1 && /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e(Z, { onClick: b, sx: { pointerEvents: "auto" }, children: n.isOpen ? /* @__PURE__ */ e(di, {}) : /* @__PURE__ */ e(ni, {}) }) }),
112
- x && /* @__PURE__ */ e(T, { children: /* @__PURE__ */ p(ei, { children: [
113
- /* @__PURE__ */ e(B, {}),
109
+ (i == null ? void 0 : i.isButtonCenterMenu) !== !1 && /* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(Z, { onClick: b, sx: { pointerEvents: "auto" }, children: n.isOpen ? /* @__PURE__ */ o(M, {}) : /* @__PURE__ */ o(_, {}) }) }),
110
+ x && /* @__PURE__ */ o(z, { children: /* @__PURE__ */ c(ei, { children: [
111
+ /* @__PURE__ */ o(j, {}),
114
112
  x
115
113
  ] }) })
116
114
  ]
117
115
  }
118
116
  ),
119
- /* @__PURE__ */ p(u, { children: [
120
- H && /* @__PURE__ */ e(j, {}),
117
+ /* @__PURE__ */ c(u, { children: [
118
+ D && /* @__PURE__ */ o(k, {}),
121
119
  w
122
120
  ] })
123
121
  ] });
124
- }), Wi = V.memo(fi);
122
+ }), Hi = V.memo(di);
125
123
  export {
126
- Wi as Dashboard
124
+ Hi as Dashboard
127
125
  };
@@ -1,14 +1,103 @@
1
- import "react/jsx-runtime";
2
- import "../../../common/ControlStatusItem.js";
3
- import "@mui/material";
4
- import "react";
5
- import "./helpers.js";
6
- import "./ui/ListButton.js";
7
- import "./ui/ListText.js";
8
- import "./ui/MuiNavLink.js";
9
- import "./ui/RenderIcon.js";
10
- import "./ui/RenderList.js";
11
- import { L as u } from "../../../ListMenu-DEYH0h3L.js";
1
+ import { jsx as t, jsxs as o, Fragment as b } from "react/jsx-runtime";
2
+ import { ControlStatusItem as N } from "../../../common/ControlStatusItem.js";
3
+ import { ExpandLess as q, ExpandMore as z } from "@mui/icons-material";
4
+ import { ListItem as c, Collapse as D, List as H } from "@mui/material";
5
+ import J, { forwardRef as K, useMemo as C, Fragment as Q } from "react";
6
+ import { convertWidthToLeftPM as U } from "./helpers.js";
7
+ import { ListButton as f } from "./ui/ListButton.js";
8
+ import { ListText as h } from "./ui/ListText.js";
9
+ import { MuiNavLink as R } from "./ui/MuiNavLink.js";
10
+ import { RenderIcon as x } from "./ui/RenderIcon.js";
11
+ import { RenderList as V } from "./ui/RenderList.js";
12
+ const X = K(({ styleList: v = "variant1", columnMenu: w, isWrapText: n = !1, listMenu: L, isOpen: r, sx: y, className: E }, F) => {
13
+ const { minWidthColumn: e } = w, m = C(() => U(e, { newProp: "marginLeft" }), [e]), I = C(() => L.map(({ action: p, icon: g, title: M, sx: P = {}, onClick: i, children: d, path: $ }, u) => d && Array.isArray(d) ? /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(
14
+ N,
15
+ {
16
+ render: (s) => /* @__PURE__ */ o(b, { children: [
17
+ /* @__PURE__ */ o(c, { disablePadding: !0, sx: P, children: [
18
+ /* @__PURE__ */ t(
19
+ x,
20
+ {
21
+ icon: g,
22
+ sx: e
23
+ }
24
+ ),
25
+ /* @__PURE__ */ o(
26
+ f,
27
+ {
28
+ isOpen: r,
29
+ isWrapText: n,
30
+ onClick: (a) => {
31
+ s.handleToggle(), typeof i == "function" && i(a);
32
+ },
33
+ children: [
34
+ /* @__PURE__ */ t(
35
+ h,
36
+ {
37
+ unmount: !r,
38
+ title: M,
39
+ sx: { flexGrow: 1, ...m },
40
+ isWrapText: n
41
+ }
42
+ ),
43
+ r && /* @__PURE__ */ o(b, { children: [
44
+ p,
45
+ s.is ? /* @__PURE__ */ t(q, {}) : /* @__PURE__ */ t(z, {})
46
+ ] })
47
+ ]
48
+ }
49
+ )
50
+ ] }),
51
+ /* @__PURE__ */ t(D, { in: s.is && r, timeout: "auto", unmountOnExit: !0, children: /* @__PURE__ */ t(H, { disablePadding: !0, children: d.map(({ action: a, icon: l, title: j, path: k, sx: A = {}, onClick: S }, B) => /* @__PURE__ */ t(c, { disablePadding: !0, sx: A, children: /* @__PURE__ */ o(
52
+ f,
53
+ {
54
+ to: k,
55
+ component: R,
56
+ sx: ({ spacing: G }) => ({ ...!l && { paddingLeft: G(2) } }),
57
+ isOpen: !0,
58
+ onClick: S,
59
+ isWrapText: n,
60
+ children: [
61
+ /* @__PURE__ */ t(
62
+ x,
63
+ {
64
+ icon: l,
65
+ sx: e
66
+ }
67
+ ),
68
+ /* @__PURE__ */ t(
69
+ h,
70
+ {
71
+ sx: () => ({ ...l && m }),
72
+ unmount: !r,
73
+ title: j,
74
+ isWrapText: n
75
+ }
76
+ ),
77
+ r && a
78
+ ]
79
+ }
80
+ ) }, `${u}-${B}`)) }) })
81
+ ] })
82
+ }
83
+ ) }, u) : /* @__PURE__ */ o(c, { disablePadding: !0, sx: P, children: [
84
+ /* @__PURE__ */ t(x, { icon: g, sx: e }),
85
+ /* @__PURE__ */ o(f, { component: R, to: $, isOpen: r, onClick: i, isWrapText: n, children: [
86
+ /* @__PURE__ */ t(h, { sx: m, unmount: !r, title: M, isWrapText: n }),
87
+ r && p
88
+ ] })
89
+ ] }, u)), [L, r, m]);
90
+ return /* @__PURE__ */ t(
91
+ V,
92
+ {
93
+ ref: F,
94
+ styleList: v,
95
+ sx: y,
96
+ className: E,
97
+ children: I
98
+ }
99
+ );
100
+ }), mt = J.memo(X);
12
101
  export {
13
- u as ListMenu
102
+ mt as ListMenu
14
103
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
- import { Tooltips as d } from "../../../../Tooltips/Tooltips.js";
2
+ import { Tooltips as T } from "../../../../Tooltips/Tooltips.js";
3
3
  import { Typography as c } from "@mui/material";
4
- import T, { forwardRef as m, useState as h, useRef as l, useEffect as u } from "react";
4
+ import d, { forwardRef as m, useState as h, useRef as l, useEffect as u } from "react";
5
5
  const W = ({ unmount: o, isWrapText: f, title: t, sx: e = {} }) => {
6
6
  const [p, a] = h(""), s = l(null);
7
7
  return u(() => {
@@ -11,7 +11,7 @@ const W = ({ unmount: o, isWrapText: f, title: t, sx: e = {} }) => {
11
11
  }, 200);
12
12
  }
13
13
  }, [t, o]), f ? !o && /* @__PURE__ */ i(c, { children: t, sx: { textWrap: "wrap", overflowWrap: "break-word", ...e } }) : !o && /* @__PURE__ */ i(w, { ref: s, tooltipText: p, title: t, sx: e });
14
- }, L = T.memo(W), w = m(({ tooltipText: o, title: f, sx: t }, e) => /* @__PURE__ */ i(d, { variant: "default", title: o, children: /* @__PURE__ */ i(c, { ref: e, children: f, noWrap: !0, sx: t }) }));
14
+ }, L = d.memo(W), w = m(({ tooltipText: o, title: f, sx: t }, e) => /* @__PURE__ */ i(T, { variant: "default", title: o, children: /* @__PURE__ */ i(c, { ref: e, children: f, noWrap: !0, sx: t }) }));
15
15
  export {
16
16
  L as ListText
17
17
  };