rc-lib-ui 1.2.24 → 1.2.26

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.
@@ -5,6 +5,7 @@ import { MuiHeaderProps } from './components/MuiHeader';
5
5
  import { MuiMenuProps } from './components/MuiMenu';
6
6
  export type DashboardControlProps = Record<'handleMenuOpen' | 'handleMenuClose' | 'handleMenuToggle', () => void> & {
7
7
  isOpen: boolean;
8
+ listRef: React.RefObject<HTMLUListElement>;
8
9
  };
9
10
  type Statuses_OR = 'isDefaultOpen' | 'isHeader' | 'isMenu' | 'isMenuHeader' | 'isHeaderResize' | 'isButtonCenterMenu' | 'isHeaderDefault';
10
11
  export interface DashboardProps extends Pick<ListMenuProps, 'listMenu' | 'styleList'> {
@@ -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
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";
@@ -171,24 +171,25 @@ const Mi = g("main")(() => ({
171
171
  }
172
172
  }
173
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) => {
174
- const { minWidthColumn: u } = l, [I, S] = O(""), W = li(() => n.map(({ action: H, icon: x, title: F, sx: k = {}, onClick: C, children: w, to: D, id: h }, L) => {
175
- const p = `${h || L}`, b = (m) => {
176
- S(p), C && C(m);
174
+ const { minWidthColumn: u } = l, [I, C] = O(""), W = li(() => n.map(({ action: H, icon: x, title: F, sx: k = {}, onClick: S, children: b, to: D, id: h }, L) => {
175
+ const p = `${h || L}`, m = (w) => {
176
+ C(p), S && S(w);
177
177
  };
178
- return w && Array.isArray(w) ? /* @__PURE__ */ d(vi, { children: /* @__PURE__ */ d(
178
+ return b && Array.isArray(b) ? /* @__PURE__ */ d(vi, { children: /* @__PURE__ */ d(
179
179
  $i,
180
180
  {
181
181
  defaultStatus: t,
182
- render: (m) => /* @__PURE__ */ d(G, { children: /* @__PURE__ */ s(Y, { disablePadding: !0, sx: k, visual: i, children: [
182
+ render: (w) => /* @__PURE__ */ d(G, { children: /* @__PURE__ */ s(Y, { disablePadding: !0, sx: k, visual: i, children: [
183
183
  /* @__PURE__ */ s(
184
184
  U,
185
185
  {
186
- isOpen: m.is,
186
+ isOpen: w.is,
187
187
  isWrapText: e,
188
188
  onClick: (M) => {
189
- m.handleToggle(), typeof C == "function" && C(M);
189
+ w.handleToggle(), typeof S == "function" && S(M);
190
190
  },
191
191
  sx: { ...q({ isIcon: x }) },
192
+ className: "MuiButtonControlCollapse",
192
193
  children: [
193
194
  x && /* @__PURE__ */ d(
194
195
  X,
@@ -208,14 +209,14 @@ const Mi = g("main")(() => ({
208
209
  ),
209
210
  t && /* @__PURE__ */ s(G, { children: [
210
211
  H,
211
- m.is ? /* @__PURE__ */ d(Wi, {}) : /* @__PURE__ */ d(Hi, {})
212
+ w.is ? /* @__PURE__ */ d(Wi, {}) : /* @__PURE__ */ d(Hi, {})
212
213
  ] })
213
214
  ]
214
215
  }
215
216
  ),
216
- /* @__PURE__ */ d(pi, { in: m.is && t, timeout: "auto", unmountOnExit: !0, children: /* @__PURE__ */ d(ai, { disablePadding: !0, children: w.map(({ action: M, icon: y, title: T, to: R, sx: j = {}, id: $, onClick: B }, v) => {
217
+ /* @__PURE__ */ d(pi, { in: w.is && t, timeout: "auto", unmountOnExit: !0, children: /* @__PURE__ */ d(ai, { disablePadding: !0, className: r, children: b.map(({ action: M, icon: y, title: T, to: R, sx: j = {}, id: $, onClick: B }, v) => {
217
218
  const f = `${L}-${$ || v}`, z = (ci) => {
218
- S(f), B && B(ci);
219
+ C(f), B && B(ci);
219
220
  };
220
221
  return /* @__PURE__ */ d(Y, { disablePadding: !0, sx: j, visual: i, children: /* @__PURE__ */ s(
221
222
  U,
@@ -246,7 +247,7 @@ const Mi = g("main")(() => ({
246
247
  U,
247
248
  {
248
249
  isOpen: t,
249
- onClick: b,
250
+ onClick: m,
250
251
  isWrapText: e,
251
252
  ...D ? { to: D, component: ni } : { to: "", className: _({ "Mui-selected": I === p }) },
252
253
  sx: { ...q({ isIcon: x }) },
@@ -383,31 +384,31 @@ const Mi = g("main")(() => ({
383
384
  return l - a;
384
385
  }, Xi = V(({ Footer: i, listMenu: a, children: l, HeaderContent: e, statuses: n, itemsProps: t, classes: o, columnMenu: r, styleList: c, sx: u }, I) => {
385
386
  var R, j, $, B;
386
- const S = bi(), W = (r == null ? void 0 : r.position) === "right", H = !1, x = !0;
387
+ const C = bi(), W = (r == null ? void 0 : r.position) === "right", H = !1, x = !0;
387
388
  //!!statuses?.isScrollIndentation
388
- 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 : {
389
- width: `calc(${S.spacing(7)} + 1px)`,
390
- [S.breakpoints.up("sm")]: {
391
- 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, b = (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)`
392
393
  }
393
394
  }, [r == null ? void 0 : r.minWidthColumn]), [h, L] = O({
394
395
  isOpen: !!(n != null && n.isDefaultOpen),
395
396
  widthCloseColumn: 0,
396
397
  widthScroll: 0
397
- }), p = Ii(h, L), b = K(null);
398
+ }), p = Ii(h, L), m = K(null);
398
399
  Q(() => {
399
- if (b.current) {
400
- const v = ei(b.current);
400
+ if (m.current) {
401
+ const v = ei(m.current);
401
402
  let f = !1;
402
403
  v > 0 && (f = !0), p({ widthScroll: f ? v + 1 : 0 }), window.onresize = function() {
403
- if (b.current) {
404
- const z = ei(b.current);
404
+ if (m.current) {
405
+ const z = ei(m.current);
405
406
  f && !z && (f = !1, p({ widthScroll: 0 })), !f && z && (f = !0, p({ widthScroll: z + 1 }));
406
407
  }
407
408
  };
408
409
  }
409
410
  }, [x]);
410
- const m = () => {
411
+ const w = () => {
411
412
  p({ isOpen: !0 });
412
413
  }, M = () => {
413
414
  p({ isOpen: !1 });
@@ -415,15 +416,16 @@ const Mi = g("main")(() => ({
415
416
  L((v) => ({ ...v, isOpen: !v.isOpen }));
416
417
  }, T = {
417
418
  isOpen: h.isOpen,
418
- handleMenuOpen: m,
419
+ handleMenuOpen: w,
419
420
  handleMenuClose: M,
420
- handleMenuToggle: y
421
+ handleMenuToggle: y,
422
+ listRef: m
421
423
  };
422
- return Si(I, () => T), /* @__PURE__ */ s(J, { className: _("Dashboard", o == null ? void 0 : o.dashboard), sx: { display: "flex", height: "inherit", ...u }, children: [
424
+ return Ci(I, () => T), /* @__PURE__ */ s(J, { className: _("Dashboard", o == null ? void 0 : o.dashboard), sx: { display: "flex", height: "inherit", ...u }, children: [
423
425
  k ? F ? /* @__PURE__ */ d(
424
426
  Vi,
425
427
  {
426
- initWidth: w,
428
+ initWidth: b,
427
429
  isOpen: h.isOpen,
428
430
  bgColor: (R = t == null ? void 0 : t.MuiHeader) == null ? void 0 : R.bgColor,
429
431
  isRight: W,
@@ -434,14 +436,14 @@ const Mi = g("main")(() => ({
434
436
  children: typeof e == "function" ? e(T) : e
435
437
  }
436
438
  ) : typeof e == "function" ? e(T) : e : null,
437
- C && /* @__PURE__ */ s(
439
+ S && /* @__PURE__ */ s(
438
440
  Ei,
439
441
  {
440
442
  variant: "permanent",
441
443
  open: h.isOpen,
442
444
  isRight: W,
443
445
  isWrapText: H,
444
- columnMenu: { initWidth: w, minWidthColumn: D },
446
+ columnMenu: { initWidth: b, minWidthColumn: D },
445
447
  styleList: c,
446
448
  children: [
447
449
  (n == null ? void 0 : n.isMenuHeader) !== !1 && /* @__PURE__ */ s(G, { children: [
@@ -456,10 +458,10 @@ const Mi = g("main")(() => ({
456
458
  }, children: /* @__PURE__ */ d(
457
459
  Ai,
458
460
  {
459
- ref: b,
461
+ ref: m,
460
462
  isRight: W,
461
463
  columnMenu: {
462
- initWidth: w,
464
+ initWidth: b,
463
465
  minWidthColumn: Ri(D, { newProp: "width", positionCorrect: `- ${h.widthScroll}px` })
464
466
  },
465
467
  listMenu: a,
@@ -470,7 +472,7 @@ const Mi = g("main")(() => ({
470
472
  styleList: c
471
473
  }
472
474
  ) }),
473
- (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, {}) }) }),
475
+ (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, {}) }) }),
474
476
  i && /* @__PURE__ */ d(G, { children: /* @__PURE__ */ s(Gi, { children: [
475
477
  /* @__PURE__ */ d(Z, {}),
476
478
  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.24",
4
+ "version": "1.2.26",
5
5
  "author": "SinGlEBW",
6
6
  "license": "MIT",
7
7
  "type": "module",