rc-lib-ui 1.2.23 → 1.2.25

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.
@@ -4,6 +4,7 @@ import { ListButtonProps } from './ui/ListButton';
4
4
  import { ListTextProps } from './ui/ListText';
5
5
  import { RenderIconProps } from './ui/RenderIcon';
6
6
  import { RenderListProps } from './ui/RenderList';
7
+ import { StyledListItemProps } from './ui/styled';
7
8
  interface ItemListMenuCommonProps extends Pick<RenderIconProps, 'icon'>, Pick<ListTextProps, 'title'>, Pick<ListButtonProps, 'onClick'> {
8
9
  action?: ReactNode;
9
10
  sx?: SxProps<Theme>;
@@ -23,7 +24,7 @@ type VariantsMenuListProps = OneVariantMenuList | TwoVariantMenuList;
23
24
  export interface ListMenuProps extends RenderListProps {
24
25
  listMenu: Array<VariantsMenuListProps & ItemListMenuCommonProps>;
25
26
  isOpen: boolean;
26
- sx?: SxProps<Theme>;
27
+ sx?: StyledListItemProps['sx'];
27
28
  className?: string;
28
29
  isWrapText?: boolean;
29
30
  size?: 'normal' | 'small';
@@ -1,4 +1,5 @@
1
- interface StyledListItemProps {
1
+ import { ListItemProps } from '@mui/material';
2
+ export interface StyledListItemProps extends ListItemProps {
2
3
  visual: "variant1" | "variant2";
3
4
  }
4
5
  export declare const StyledListItem: import('@emotion/styled').StyledComponent<{
@@ -6,4 +7,3 @@ export declare const StyledListItem: import('@emotion/styled').StyledComponent<{
6
7
  } & import('@mui/material').ListItemOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
7
8
  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
9
  }, "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 {};
package/dist/dashboard.js CHANGED
@@ -1,8 +1,8 @@
1
- import { jsx as d, jsxs as s, Fragment as G } from "react/jsx-runtime";
1
+ import { jsx as d, Fragment as G, jsxs as s } from "react/jsx-runtime";
2
2
  import { styled as g, ListItemButton as hi, Typography as di, ListItemIcon as si, List as ai, ListItem as fi, Collapse as pi, Box as J, AppBar as gi, Container as ui, Toolbar as xi, Drawer as mi, Divider as Z, IconButton as wi } from "@mui/material";
3
3
  import { useTheme as bi } from "@mui/material/styles";
4
- import N, { useState as O, useCallback as P, useRef as K, useEffect as Q, forwardRef as V, useMemo as li, Fragment as vi, useImperativeHandle as Si } from "react";
5
- import Ci from "@mui/icons-material/ChevronLeft";
4
+ import N, { useState as O, useCallback as P, useRef as K, useEffect as Q, forwardRef as V, useMemo as li, Fragment as vi, useImperativeHandle as Ci } from "react";
5
+ import Si from "@mui/icons-material/ChevronLeft";
6
6
  import Li from "@mui/icons-material/ChevronRight";
7
7
  import { U as yi, s as Ii } from "./index-B7GqTJat.js";
8
8
  import { ExpandLess as Wi, ExpandMore as Hi } from "@mui/icons-material";
@@ -30,7 +30,7 @@ const Mi = g("main")(() => ({
30
30
  easing: i.transitions.easing.sharp,
31
31
  duration: i.transitions.duration.enteringScreen
32
32
  })
33
- })), ii = (i) => typeof i == "number" ? i + "px" : i, $i = (i, a = {}) => {
33
+ })), ii = (i) => typeof i == "number" ? i + "px" : i, Ri = (i, a = {}) => {
34
34
  const { newProp: l = "marginLeft", positionCorrect: e = "- 0px" } = a;
35
35
  let n = {};
36
36
  for (const [t, o] of Object.entries(i))
@@ -42,7 +42,7 @@ const Mi = g("main")(() => ({
42
42
  n[l] = `calc(${r} ${e})`;
43
43
  }
44
44
  return n;
45
- }, Ri = ({ render: i, defaultStatus: a = !1 }) => {
45
+ }, $i = ({ render: i, defaultStatus: a = !1 }) => {
46
46
  const [l, e] = O({ is: a, id: "" }), n = P(() => {
47
47
  e((o) => ({ ...o, is: !o.is }));
48
48
  }, []), t = P((o) => {
@@ -63,7 +63,7 @@ const Mi = g("main")(() => ({
63
63
  return Q(() => {
64
64
  if (a && (n != null && n.current)) {
65
65
  const { scrollHeight: r, clientHeight: c } = n == null ? void 0 : n.current;
66
- l ? (!t.height && o((m) => ({ ...m, height: c })), r !== c && o({ ...A, height: r + c })) : o({ ...A, height: A.minHeight });
66
+ l ? (!t.height && o((u) => ({ ...u, height: c })), r !== c && o({ ...A, height: r + c })) : o({ ...A, height: A.minHeight });
67
67
  }
68
68
  }, [l]), /* @__PURE__ */ d(
69
69
  Bi,
@@ -155,12 +155,13 @@ const Mi = g("main")(() => ({
155
155
  })), Y = g(fi, {
156
156
  shouldForwardProp: (i) => !["visual"].includes(i)
157
157
  })(({ theme: i, visual: a }) => ({
158
+ display: "block",
158
159
  ...a === "variant2" && {
159
160
  "&": {
160
- padding: `0 ${i.spacing(1)}`
161
+ // padding: `0 ${theme.spacing(1)}`,
161
162
  },
162
163
  "& .MuiListItemIcon-root": {
163
- marginLeft: `-${i.spacing(1)}`
164
+ // marginLeft: `-${theme.spacing(1)}`,
164
165
  },
165
166
  "& .MuiButtonBase-root": {
166
167
  borderRadius: "5px",
@@ -170,30 +171,31 @@ const Mi = g("main")(() => ({
170
171
  }
171
172
  }
172
173
  })), q = ({ isIcon: i }) => ({ paddingRight: 1.2, ...!i && { paddingLeft: 1.2 } }), ji = V(({ styleList: i = "variant1", isRight: a, columnMenu: l, isWrapText: e = !1, listMenu: n, isOpen: t, sx: o, className: r }, c) => {
173
- const { minWidthColumn: m } = l, [I, S] = O(""), W = li(() => n.map(({ action: H, icon: u, title: F, sx: k = {}, onClick: C, children: w, to: D, id: h }, L) => {
174
- const p = `${h || L}`, b = (x) => {
175
- S(p), C && C(x);
174
+ const { minWidthColumn: u } = l, [I, C] = O(""), W = li(() => n.map(({ action: H, icon: x, title: F, sx: k = {}, onClick: S, children: w, to: D, id: h }, L) => {
175
+ const p = `${h || L}`, b = (m) => {
176
+ C(p), S && S(m);
176
177
  };
177
178
  return w && Array.isArray(w) ? /* @__PURE__ */ d(vi, { children: /* @__PURE__ */ d(
178
- Ri,
179
+ $i,
179
180
  {
180
181
  defaultStatus: t,
181
- render: (x) => /* @__PURE__ */ s(G, { children: [
182
- /* @__PURE__ */ d(Y, { disablePadding: !0, sx: k, visual: i, children: /* @__PURE__ */ s(
182
+ render: (m) => /* @__PURE__ */ d(G, { children: /* @__PURE__ */ s(Y, { disablePadding: !0, sx: k, visual: i, children: [
183
+ /* @__PURE__ */ s(
183
184
  U,
184
185
  {
185
- isOpen: x.is,
186
+ isOpen: m.is,
186
187
  isWrapText: e,
187
188
  onClick: (M) => {
188
- x.handleToggle(), typeof C == "function" && C(M);
189
+ m.handleToggle(), typeof S == "function" && S(M);
189
190
  },
190
- sx: { ...q({ isIcon: u }) },
191
+ sx: { ...q({ isIcon: x }) },
192
+ className: "MuiButtonControlCollapse",
191
193
  children: [
192
- u && /* @__PURE__ */ d(
194
+ x && /* @__PURE__ */ d(
193
195
  X,
194
196
  {
195
- icon: u,
196
- sx: m
197
+ icon: x,
198
+ sx: u
197
199
  }
198
200
  ),
199
201
  /* @__PURE__ */ d(
@@ -207,14 +209,14 @@ const Mi = g("main")(() => ({
207
209
  ),
208
210
  t && /* @__PURE__ */ s(G, { children: [
209
211
  H,
210
- x.is ? /* @__PURE__ */ d(Wi, {}) : /* @__PURE__ */ d(Hi, {})
212
+ m.is ? /* @__PURE__ */ d(Wi, {}) : /* @__PURE__ */ d(Hi, {})
211
213
  ] })
212
214
  ]
213
215
  }
214
- ) }),
215
- /* @__PURE__ */ d(pi, { in: x.is && t, timeout: "auto", unmountOnExit: !0, children: /* @__PURE__ */ d(ai, { disablePadding: !0, children: w.map(({ action: M, icon: y, title: T, to: $, sx: j = {}, id: R, onClick: B }, v) => {
216
- const f = `${L}-${R || v}`, z = (ci) => {
217
- S(f), B && B(ci);
216
+ ),
217
+ /* @__PURE__ */ d(pi, { in: m.is && t, timeout: "auto", unmountOnExit: !0, children: /* @__PURE__ */ d(ai, { disablePadding: !0, className: r, children: w.map(({ action: M, icon: y, title: T, to: R, sx: j = {}, id: $, onClick: B }, v) => {
218
+ const f = `${L}-${$ || v}`, z = (ci) => {
219
+ C(f), B && B(ci);
218
220
  };
219
221
  return /* @__PURE__ */ d(Y, { disablePadding: !0, sx: j, visual: i, children: /* @__PURE__ */ s(
220
222
  U,
@@ -223,9 +225,9 @@ const Mi = g("main")(() => ({
223
225
  isOpen: !0,
224
226
  onClick: z,
225
227
  isWrapText: e,
226
- ...$ ? { to: $, component: ni } : { to: "", className: _({ "Mui-selected": I === f }) },
228
+ ...R ? { to: R, component: ni } : { to: "", className: _({ "Mui-selected": I === f }) },
227
229
  children: [
228
- y && /* @__PURE__ */ d(X, { icon: y, sx: { ...m, marginLeft: "8px !important" } }),
230
+ y && /* @__PURE__ */ d(X, { icon: y, sx: { ...u, marginLeft: "8px !important" } }),
229
231
  /* @__PURE__ */ d(
230
232
  E,
231
233
  {
@@ -239,7 +241,7 @@ const Mi = g("main")(() => ({
239
241
  }
240
242
  ) }, f);
241
243
  }) }) })
242
- ] })
244
+ ] }) })
243
245
  }
244
246
  ) }, h || L) : /* @__PURE__ */ d(Y, { disablePadding: !0, sx: k, visual: i, children: /* @__PURE__ */ s(
245
247
  U,
@@ -248,9 +250,9 @@ const Mi = g("main")(() => ({
248
250
  onClick: b,
249
251
  isWrapText: e,
250
252
  ...D ? { to: D, component: ni } : { to: "", className: _({ "Mui-selected": I === p }) },
251
- sx: { ...q({ isIcon: u }) },
253
+ sx: { ...q({ isIcon: x }) },
252
254
  children: [
253
- u && /* @__PURE__ */ d(X, { icon: u, sx: m }),
255
+ x && /* @__PURE__ */ d(X, { icon: x, sx: u }),
254
256
  /* @__PURE__ */ d(
255
257
  E,
256
258
  {
@@ -263,7 +265,7 @@ const Mi = g("main")(() => ({
263
265
  ]
264
266
  }
265
267
  ) }, p);
266
- }), [n, t, I, a, q]);
268
+ }), [n, t, I, a, q, u]);
267
269
  return /* @__PURE__ */ d(
268
270
  Fi,
269
271
  {
@@ -380,14 +382,14 @@ const Mi = g("main")(() => ({
380
382
  })), ei = (i) => {
381
383
  const { clientWidth: a, offsetWidth: l } = i;
382
384
  return l - a;
383
- }, Xi = V(({ Footer: i, listMenu: a, children: l, HeaderContent: e, statuses: n, itemsProps: t, classes: o, columnMenu: r, styleList: c, sx: m }, I) => {
384
- var $, j, R, B;
385
- const S = bi(), W = (r == null ? void 0 : r.position) === "right", H = !1, u = !0;
385
+ }, Xi = V(({ Footer: i, listMenu: a, children: l, HeaderContent: e, statuses: n, itemsProps: t, classes: o, columnMenu: r, styleList: c, sx: u }, I) => {
386
+ var R, j, $, B;
387
+ const C = bi(), W = (r == null ? void 0 : r.position) === "right", H = !1, x = !0;
386
388
  //!!statuses?.isScrollIndentation
387
- const F = (n == null ? void 0 : n.isHeaderDefault) === void 0 ? !0 : n == null ? void 0 : n.isHeaderDefault, k = (n == null ? void 0 : n.isHeader) === void 0 ? !0 : n == null ? void 0 : n.isHeader, C = (n == null ? void 0 : n.isMenu) === void 0 ? !0 : n == null ? void 0 : n.isMenu, w = (r == null ? void 0 : r.initWidth) || 250, D = li(() => r != null && r.minWidthColumn && Object.keys(r == null ? void 0 : r.minWidthColumn).length ? r == null ? void 0 : r.minWidthColumn : {
388
- width: `calc(${S.spacing(7)} + 1px)`,
389
- [S.breakpoints.up("sm")]: {
390
- width: `calc(${S.spacing(8)} + 1px)`
389
+ const F = (n == null ? void 0 : n.isHeaderDefault) === void 0 ? !0 : n == null ? void 0 : n.isHeaderDefault, k = (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, w = (r == null ? void 0 : r.initWidth) || 250, D = li(() => r != null && r.minWidthColumn && Object.keys(r == null ? void 0 : r.minWidthColumn).length ? r == null ? void 0 : r.minWidthColumn : {
390
+ width: `calc(${C.spacing(7)} + 1px)`,
391
+ [C.breakpoints.up("sm")]: {
392
+ width: `calc(${C.spacing(8)} + 1px)`
391
393
  }
392
394
  }, [r == null ? void 0 : r.minWidthColumn]), [h, L] = O({
393
395
  isOpen: !!(n != null && n.isDefaultOpen),
@@ -405,8 +407,8 @@ const Mi = g("main")(() => ({
405
407
  }
406
408
  };
407
409
  }
408
- }, [u]);
409
- const x = () => {
410
+ }, [x]);
411
+ const m = () => {
410
412
  p({ isOpen: !0 });
411
413
  }, M = () => {
412
414
  p({ isOpen: !1 });
@@ -414,26 +416,26 @@ const Mi = g("main")(() => ({
414
416
  L((v) => ({ ...v, isOpen: !v.isOpen }));
415
417
  }, T = {
416
418
  isOpen: h.isOpen,
417
- handleMenuOpen: x,
419
+ handleMenuOpen: m,
418
420
  handleMenuClose: M,
419
421
  handleMenuToggle: y
420
422
  };
421
- return Si(I, () => T), /* @__PURE__ */ s(J, { className: _("Dashboard", o == null ? void 0 : o.dashboard), sx: { display: "flex", height: "inherit", ...m }, children: [
423
+ return Ci(I, () => T), /* @__PURE__ */ s(J, { className: _("Dashboard", o == null ? void 0 : o.dashboard), sx: { display: "flex", height: "inherit", ...u }, children: [
422
424
  k ? F ? /* @__PURE__ */ d(
423
425
  Vi,
424
426
  {
425
427
  initWidth: w,
426
428
  isOpen: h.isOpen,
427
- bgColor: ($ = t == null ? void 0 : t.MuiHeader) == null ? void 0 : $.bgColor,
429
+ bgColor: (R = t == null ? void 0 : t.MuiHeader) == null ? void 0 : R.bgColor,
428
430
  isRight: W,
429
431
  isHeaderResize: n == null ? void 0 : n.isHeaderResize,
430
432
  sx: (j = t == null ? void 0 : t.MuiHeader) == null ? void 0 : j.sx,
431
433
  className: o == null ? void 0 : o.header,
432
- AfterComponent: (R = t == null ? void 0 : t.MuiHeader) == null ? void 0 : R.AfterComponent,
434
+ AfterComponent: ($ = t == null ? void 0 : t.MuiHeader) == null ? void 0 : $.AfterComponent,
433
435
  children: typeof e == "function" ? e(T) : e
434
436
  }
435
437
  ) : typeof e == "function" ? e(T) : e : null,
436
- C && /* @__PURE__ */ s(
438
+ S && /* @__PURE__ */ s(
437
439
  Ei,
438
440
  {
439
441
  variant: "permanent",
@@ -459,7 +461,7 @@ const Mi = g("main")(() => ({
459
461
  isRight: W,
460
462
  columnMenu: {
461
463
  initWidth: w,
462
- minWidthColumn: $i(D, { newProp: "width", positionCorrect: `- ${h.widthScroll}px` })
464
+ minWidthColumn: Ri(D, { newProp: "width", positionCorrect: `- ${h.widthScroll}px` })
463
465
  },
464
466
  listMenu: a,
465
467
  isOpen: h.isOpen,
@@ -469,7 +471,7 @@ const Mi = g("main")(() => ({
469
471
  styleList: c
470
472
  }
471
473
  ) }),
472
- (n == null ? void 0 : n.isButtonCenterMenu) !== !1 && /* @__PURE__ */ d(Ti, { children: /* @__PURE__ */ d(wi, { onClick: y, sx: { pointerEvents: "auto" }, children: h.isOpen ? /* @__PURE__ */ d(Li, {}) : /* @__PURE__ */ d(Ci, {}) }) }),
474
+ (n == null ? void 0 : n.isButtonCenterMenu) !== !1 && /* @__PURE__ */ d(Ti, { children: /* @__PURE__ */ d(wi, { onClick: y, sx: { pointerEvents: "auto" }, children: h.isOpen ? /* @__PURE__ */ d(Li, {}) : /* @__PURE__ */ d(Si, {}) }) }),
473
475
  i && /* @__PURE__ */ d(G, { children: /* @__PURE__ */ s(Gi, { children: [
474
476
  /* @__PURE__ */ d(Z, {}),
475
477
  i
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rc-lib-ui",
3
3
  "private": false,
4
- "version": "1.2.23",
4
+ "version": "1.2.25",
5
5
  "author": "SinGlEBW",
6
6
  "license": "MIT",
7
7
  "type": "module",