rc-lib-ui 1.2.25 → 1.3.0
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.
- package/dist/Dashboard/Dashboard.d.ts +2 -25
- package/dist/Dashboard/Dashboard.types.d.ts +24 -0
- package/dist/Dashboard/index.d.ts +1 -0
- package/dist/dashboard.js +24 -23
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/useTimer.d.ts +13 -0
- package/dist/hooks.js +27 -27
- package/package.json +1 -1
- package/dist/hooks/useShowPanel.d.ts +0 -12
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ListMenuProps } from './components/ListMemu/ListMenu';
|
|
4
|
-
import { MuiHeaderProps } from './components/MuiHeader';
|
|
5
|
-
import { MuiMenuProps } from './components/MuiMenu';
|
|
6
|
-
export type DashboardControlProps = Record<'handleMenuOpen' | 'handleMenuClose' | 'handleMenuToggle', () => void> & {
|
|
7
|
-
isOpen: boolean;
|
|
8
|
-
};
|
|
9
|
-
type Statuses_OR = 'isDefaultOpen' | 'isHeader' | 'isMenu' | 'isMenuHeader' | 'isHeaderResize' | 'isButtonCenterMenu' | 'isHeaderDefault';
|
|
10
|
-
export interface DashboardProps extends Pick<ListMenuProps, 'listMenu' | 'styleList'> {
|
|
11
|
-
Footer?: ReactNode;
|
|
12
|
-
columnMenu?: Partial<MuiMenuProps['columnMenu'] & {
|
|
13
|
-
position?: 'right' | 'left';
|
|
14
|
-
}>;
|
|
15
|
-
children?: ReactNode;
|
|
16
|
-
HeaderContent?: ReactNode | ((config: DashboardControlProps) => React.ReactNode);
|
|
17
|
-
statuses?: Partial<Record<Statuses_OR, boolean>>;
|
|
18
|
-
sx?: SxProps<Theme>;
|
|
19
|
-
itemsProps?: {
|
|
20
|
-
MuiHeader?: Pick<MuiHeaderProps, 'sx' | 'bgColor' | 'AfterComponent'>;
|
|
21
|
-
MuiListMenu?: Pick<ListMenuProps, 'sx'>;
|
|
22
|
-
};
|
|
23
|
-
classes?: Partial<Record<'listMenu' | 'header' | 'dashboard' | 'main', string>>;
|
|
24
|
-
}
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DashboardControlProps, DashboardProps } from './Dashboard.types';
|
|
25
3
|
export declare const Dashboard: React.MemoExoticComponent<React.ForwardRefExoticComponent<DashboardProps & React.RefAttributes<DashboardControlProps>>>;
|
|
26
|
-
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
import { ListMenuProps, MuiHeaderProps, MuiMenuProps } from './components';
|
|
4
|
+
export type DashboardControlProps = Record<'handleMenuOpen' | 'handleMenuClose' | 'handleMenuToggle', () => void> & {
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
listRef: React.RefObject<HTMLUListElement>;
|
|
7
|
+
};
|
|
8
|
+
type Statuses_OR = 'isDefaultOpen' | 'isHeader' | 'isMenu' | 'isMenuHeader' | 'isHeaderResize' | 'isButtonCenterMenu' | 'isHeaderDefault';
|
|
9
|
+
export interface DashboardProps extends Pick<ListMenuProps, 'listMenu' | 'styleList'> {
|
|
10
|
+
Footer?: ReactNode;
|
|
11
|
+
columnMenu?: Partial<MuiMenuProps['columnMenu'] & {
|
|
12
|
+
position?: 'right' | 'left';
|
|
13
|
+
}>;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
HeaderContent?: ReactNode | ((config: DashboardControlProps) => React.ReactNode);
|
|
16
|
+
statuses?: Partial<Record<Statuses_OR, boolean>>;
|
|
17
|
+
sx?: SxProps<Theme>;
|
|
18
|
+
itemsProps?: {
|
|
19
|
+
MuiHeader?: Pick<MuiHeaderProps, 'sx' | 'bgColor' | 'AfterComponent'>;
|
|
20
|
+
MuiListMenu?: Pick<ListMenuProps, 'sx'>;
|
|
21
|
+
};
|
|
22
|
+
classes?: Partial<Record<'listMenu' | 'header' | 'dashboard' | 'main', string>>;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
package/dist/dashboard.js
CHANGED
|
@@ -171,22 +171,22 @@ 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, C] = O(""), W = li(() => n.map(({ action: H, icon: x, title: F, sx: k = {}, onClick: S, children:
|
|
175
|
-
const p = `${h || L}`,
|
|
176
|
-
C(p), S && S(
|
|
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
|
|
178
|
+
return b && Array.isArray(b) ? /* @__PURE__ */ d(vi, { children: /* @__PURE__ */ d(
|
|
179
179
|
$i,
|
|
180
180
|
{
|
|
181
181
|
defaultStatus: t,
|
|
182
|
-
render: (
|
|
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:
|
|
186
|
+
isOpen: w.is,
|
|
187
187
|
isWrapText: e,
|
|
188
188
|
onClick: (M) => {
|
|
189
|
-
|
|
189
|
+
w.handleToggle(), typeof S == "function" && S(M);
|
|
190
190
|
},
|
|
191
191
|
sx: { ...q({ isIcon: x }) },
|
|
192
192
|
className: "MuiButtonControlCollapse",
|
|
@@ -209,12 +209,12 @@ const Mi = g("main")(() => ({
|
|
|
209
209
|
),
|
|
210
210
|
t && /* @__PURE__ */ s(G, { children: [
|
|
211
211
|
H,
|
|
212
|
-
|
|
212
|
+
w.is ? /* @__PURE__ */ d(Wi, {}) : /* @__PURE__ */ d(Hi, {})
|
|
213
213
|
] })
|
|
214
214
|
]
|
|
215
215
|
}
|
|
216
216
|
),
|
|
217
|
-
/* @__PURE__ */ d(pi, { in:
|
|
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) => {
|
|
218
218
|
const f = `${L}-${$ || v}`, z = (ci) => {
|
|
219
219
|
C(f), B && B(ci);
|
|
220
220
|
};
|
|
@@ -247,7 +247,7 @@ const Mi = g("main")(() => ({
|
|
|
247
247
|
U,
|
|
248
248
|
{
|
|
249
249
|
isOpen: t,
|
|
250
|
-
onClick:
|
|
250
|
+
onClick: m,
|
|
251
251
|
isWrapText: e,
|
|
252
252
|
...D ? { to: D, component: ni } : { to: "", className: _({ "Mui-selected": I === p }) },
|
|
253
253
|
sx: { ...q({ isIcon: x }) },
|
|
@@ -386,7 +386,7 @@ const Mi = g("main")(() => ({
|
|
|
386
386
|
var R, j, $, B;
|
|
387
387
|
const C = bi(), W = (r == null ? void 0 : r.position) === "right", H = !1, x = !0;
|
|
388
388
|
//!!statuses?.isScrollIndentation
|
|
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,
|
|
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
390
|
width: `calc(${C.spacing(7)} + 1px)`,
|
|
391
391
|
[C.breakpoints.up("sm")]: {
|
|
392
392
|
width: `calc(${C.spacing(8)} + 1px)`
|
|
@@ -395,20 +395,20 @@ const Mi = g("main")(() => ({
|
|
|
395
395
|
isOpen: !!(n != null && n.isDefaultOpen),
|
|
396
396
|
widthCloseColumn: 0,
|
|
397
397
|
widthScroll: 0
|
|
398
|
-
}), p = Ii(h, L),
|
|
398
|
+
}), p = Ii(h, L), m = K(null);
|
|
399
399
|
Q(() => {
|
|
400
|
-
if (
|
|
401
|
-
const v = ei(
|
|
400
|
+
if (m.current) {
|
|
401
|
+
const v = ei(m.current);
|
|
402
402
|
let f = !1;
|
|
403
403
|
v > 0 && (f = !0), p({ widthScroll: f ? v + 1 : 0 }), window.onresize = function() {
|
|
404
|
-
if (
|
|
405
|
-
const z = ei(
|
|
404
|
+
if (m.current) {
|
|
405
|
+
const z = ei(m.current);
|
|
406
406
|
f && !z && (f = !1, p({ widthScroll: 0 })), !f && z && (f = !0, p({ widthScroll: z + 1 }));
|
|
407
407
|
}
|
|
408
408
|
};
|
|
409
409
|
}
|
|
410
410
|
}, [x]);
|
|
411
|
-
const
|
|
411
|
+
const w = () => {
|
|
412
412
|
p({ isOpen: !0 });
|
|
413
413
|
}, M = () => {
|
|
414
414
|
p({ isOpen: !1 });
|
|
@@ -416,15 +416,16 @@ const Mi = g("main")(() => ({
|
|
|
416
416
|
L((v) => ({ ...v, isOpen: !v.isOpen }));
|
|
417
417
|
}, T = {
|
|
418
418
|
isOpen: h.isOpen,
|
|
419
|
-
handleMenuOpen:
|
|
419
|
+
handleMenuOpen: w,
|
|
420
420
|
handleMenuClose: M,
|
|
421
|
-
handleMenuToggle: y
|
|
421
|
+
handleMenuToggle: y,
|
|
422
|
+
listRef: m
|
|
422
423
|
};
|
|
423
424
|
return Ci(I, () => T), /* @__PURE__ */ s(J, { className: _("Dashboard", o == null ? void 0 : o.dashboard), sx: { display: "flex", height: "inherit", ...u }, children: [
|
|
424
425
|
k ? F ? /* @__PURE__ */ d(
|
|
425
426
|
Vi,
|
|
426
427
|
{
|
|
427
|
-
initWidth:
|
|
428
|
+
initWidth: b,
|
|
428
429
|
isOpen: h.isOpen,
|
|
429
430
|
bgColor: (R = t == null ? void 0 : t.MuiHeader) == null ? void 0 : R.bgColor,
|
|
430
431
|
isRight: W,
|
|
@@ -442,7 +443,7 @@ const Mi = g("main")(() => ({
|
|
|
442
443
|
open: h.isOpen,
|
|
443
444
|
isRight: W,
|
|
444
445
|
isWrapText: H,
|
|
445
|
-
columnMenu: { initWidth:
|
|
446
|
+
columnMenu: { initWidth: b, minWidthColumn: D },
|
|
446
447
|
styleList: c,
|
|
447
448
|
children: [
|
|
448
449
|
(n == null ? void 0 : n.isMenuHeader) !== !1 && /* @__PURE__ */ s(G, { children: [
|
|
@@ -457,10 +458,10 @@ const Mi = g("main")(() => ({
|
|
|
457
458
|
}, children: /* @__PURE__ */ d(
|
|
458
459
|
Ai,
|
|
459
460
|
{
|
|
460
|
-
ref:
|
|
461
|
+
ref: m,
|
|
461
462
|
isRight: W,
|
|
462
463
|
columnMenu: {
|
|
463
|
-
initWidth:
|
|
464
|
+
initWidth: b,
|
|
464
465
|
minWidthColumn: Ri(D, { newProp: "width", positionCorrect: `- ${h.widthScroll}px` })
|
|
465
466
|
},
|
|
466
467
|
listMenu: a,
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './useTimer';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface UseTimerProps {
|
|
2
|
+
timer?: number;
|
|
3
|
+
defaultIsActive?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const useTimer: ({ defaultIsActive, timer }: UseTimerProps) => {
|
|
6
|
+
isActive: boolean;
|
|
7
|
+
handleActive: () => void;
|
|
8
|
+
handleResetTimePanel: () => void;
|
|
9
|
+
handlePauseTimer: () => void;
|
|
10
|
+
handleResumeTimer: () => void;
|
|
11
|
+
handleDeActive: () => void;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
package/dist/hooks.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { T
|
|
3
|
-
import { s as
|
|
4
|
-
const
|
|
5
|
-
const [t,
|
|
6
|
-
|
|
7
|
-
}),
|
|
8
|
-
|
|
9
|
-
console.log("Время истекло, скрываем панель"),
|
|
1
|
+
import { useState as v, useRef as A, useEffect as l, useCallback as r } from "react";
|
|
2
|
+
import { T } from "./index-DjJlkTF6.js";
|
|
3
|
+
import { s as p } from "./index-B7GqTJat.js";
|
|
4
|
+
const S = ({ defaultIsActive: c = !0, timer: s = 5e3 }) => {
|
|
5
|
+
const [t, n] = v({
|
|
6
|
+
isActive: c
|
|
7
|
+
}), i = p(t, n), e = A(null);
|
|
8
|
+
l(() => (e.current = new T(s, () => {
|
|
9
|
+
console.log("Время истекло, скрываем панель"), i({ isActive: !1 });
|
|
10
10
|
}), e.current.startTime(), () => {
|
|
11
11
|
e.current && e.current.resetTime();
|
|
12
|
-
}), [s
|
|
13
|
-
const
|
|
14
|
-
t.
|
|
15
|
-
}, [t.
|
|
16
|
-
e.current && t.
|
|
17
|
-
}, [t.
|
|
18
|
-
e.current && t.
|
|
19
|
-
}, [t.
|
|
20
|
-
e.current && t.
|
|
21
|
-
}, [t.
|
|
22
|
-
|
|
12
|
+
}), [s]);
|
|
13
|
+
const u = r(() => {
|
|
14
|
+
t.isActive || (i({ isActive: !0 }), e.current && (e.current.resetTime(), e.current.startTime()));
|
|
15
|
+
}, [t.isActive]), a = r(() => {
|
|
16
|
+
e.current && t.isActive && (e.current.resetTime(), e.current.startTime());
|
|
17
|
+
}, [t.isActive]), m = r(() => {
|
|
18
|
+
e.current && t.isActive && e.current.pauseTime();
|
|
19
|
+
}, [t.isActive]), o = r(() => {
|
|
20
|
+
e.current && t.isActive && e.current.startTime();
|
|
21
|
+
}, [t.isActive]), f = r(() => {
|
|
22
|
+
i({ isActive: !1 }), e.current && e.current.resetTime();
|
|
23
23
|
}, []);
|
|
24
24
|
return {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
handleResetTimePanel:
|
|
28
|
-
handlePauseTimer:
|
|
29
|
-
handleResumeTimer:
|
|
30
|
-
|
|
25
|
+
isActive: t.isActive,
|
|
26
|
+
handleActive: u,
|
|
27
|
+
handleResetTimePanel: a,
|
|
28
|
+
handlePauseTimer: m,
|
|
29
|
+
handleResumeTimer: o,
|
|
30
|
+
handleDeActive: f
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
export {
|
|
34
|
-
|
|
34
|
+
S as useTimer
|
|
35
35
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
interface UseShowPanelProps {
|
|
2
|
-
timerShowPanel?: number;
|
|
3
|
-
}
|
|
4
|
-
export declare const useShowPanel: (props?: UseShowPanelProps) => {
|
|
5
|
-
showPanel: boolean;
|
|
6
|
-
handleShowPanel: () => void;
|
|
7
|
-
handleResetTimePanel: () => void;
|
|
8
|
-
handlePauseTimer: () => void;
|
|
9
|
-
handleResumeTimer: () => void;
|
|
10
|
-
handleHidePanel: () => void;
|
|
11
|
-
};
|
|
12
|
-
export {};
|