@xwadex/fesd-next 0.3.44-beta.13 → 0.3.44-beta.14
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/components/dragResize/{dragResize copy.d.ts → _dragResize.d.ts} +2 -2
- package/dist/components/dragResize/{dragResize copy.js → _dragResize.js} +10 -16
- package/dist/components/dragResize/dragResize.d.ts +2 -2
- package/dist/components/dragResize/dragResize.js +16 -10
- package/dist/components/dragResize/index.d.ts +1 -1
- package/dist/components/dragResize/index.js +1 -1
- package/package.json +1 -1
|
@@ -5,11 +5,11 @@ type PropsTypes<T extends React.ElementType = "div"> = AsPropsTypes<T, {
|
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
defaultWidth?: number;
|
|
7
7
|
defaultHeight?: number;
|
|
8
|
-
|
|
8
|
+
resizeClass?: string;
|
|
9
9
|
dragLineWidth?: number;
|
|
10
10
|
dragLineColor?: string;
|
|
11
11
|
containerClass?: string;
|
|
12
|
-
|
|
12
|
+
dragClass?: string;
|
|
13
13
|
resizeStore?: boolean;
|
|
14
14
|
resizeStoreKey?: string;
|
|
15
15
|
resizeStoreValue?: ResizeTypes;
|
|
@@ -3,25 +3,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { memo, useCallback, useMemo, useState } from "react";
|
|
4
4
|
import { useDragResize, useCookies } from "../../hooks/index.js";
|
|
5
5
|
import { DragResizeContext } from "./dragResizeContext";
|
|
6
|
-
import {
|
|
6
|
+
import { mergeClassName } from "../../utils/index.js";
|
|
7
|
+
import styles from "./dragResize.module.scss";
|
|
7
8
|
const DragResizeBase = (props) => {
|
|
8
|
-
const { as, children, defaultWidth, defaultHeight,
|
|
9
|
+
const { as, children, defaultWidth, defaultHeight, resizeClass, containerClass, dragClass, resizeStore = true, resizeStoreKey, resizeStoreValue, active = true, direction = "width", minWidth = 500, maxWidth = 950, dragLineWidth = 5, dragLineColor = "rgba(0, 0, 0, 1)", onInit, onResizeStart, onResizing, onResizeEnd, ...othersProps } = props;
|
|
9
10
|
const RootComponent = as || "div";
|
|
10
11
|
const [isActive, setActive] = useState(active);
|
|
11
12
|
const { setCookies, deleteCookies } = useCookies();
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
// ), [resizeClass])
|
|
16
|
-
// const dragCSS = useMemo(() => mergeClassName(
|
|
17
|
-
// styles.drag,
|
|
18
|
-
// dragClass ? dragClass : "",
|
|
19
|
-
// !isActive ? styles.off : ""
|
|
20
|
-
// ), [isActive, dragClass])
|
|
21
|
-
// const containerCSS = useMemo(() => mergeClassName(
|
|
22
|
-
// styles.container,
|
|
23
|
-
// containerClass ? containerClass : "",
|
|
24
|
-
// ), [containerClass])
|
|
13
|
+
const resizeCSS = useMemo(() => mergeClassName(styles.root, resizeClass ? resizeClass : ""), [resizeClass]);
|
|
14
|
+
const dragCSS = useMemo(() => mergeClassName(styles.drag, dragClass ? dragClass : "", !isActive ? styles.off : ""), [isActive, dragClass]);
|
|
15
|
+
const containerCSS = useMemo(() => mergeClassName(styles.container, containerClass ? containerClass : ""), [containerClass]);
|
|
25
16
|
const isCookieStore = useMemo(() => resizeStore
|
|
26
17
|
&& resizeStoreKey
|
|
27
18
|
&& resizeStoreKey !== ""
|
|
@@ -76,7 +67,10 @@ const DragResizeBase = (props) => {
|
|
|
76
67
|
clearResizeStore,
|
|
77
68
|
defaultResizeSize
|
|
78
69
|
]);
|
|
79
|
-
return (_jsx(DragResizeContext, { value: contextValue, children: _jsxs(RootComponent, { ...othersProps, ref: resizeRef, className:
|
|
70
|
+
return (_jsx(DragResizeContext, { value: contextValue, children: _jsxs(RootComponent, { ...othersProps, ref: resizeRef, className: resizeCSS, style: resizeDefauleStyles, children: [_jsx("div", { className: containerCSS, children: children }), _jsx("div", { ref: dragRef, className: dragCSS, style: {
|
|
71
|
+
"--drag-line-width": dragLineWidth + "px",
|
|
72
|
+
"--drag-line-color": dragLineColor
|
|
73
|
+
} })] }) }));
|
|
80
74
|
};
|
|
81
75
|
const DragResize = memo(DragResizeBase);
|
|
82
76
|
DragResize.displayName = "DragResize";
|
|
@@ -5,11 +5,11 @@ type PropsTypes<T extends React.ElementType = "div"> = AsPropsTypes<T, {
|
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
defaultWidth?: number;
|
|
7
7
|
defaultHeight?: number;
|
|
8
|
-
|
|
8
|
+
className?: string;
|
|
9
9
|
dragLineWidth?: number;
|
|
10
10
|
dragLineColor?: string;
|
|
11
11
|
containerClass?: string;
|
|
12
|
-
|
|
12
|
+
handlerClass?: string;
|
|
13
13
|
resizeStore?: boolean;
|
|
14
14
|
resizeStoreKey?: string;
|
|
15
15
|
resizeStoreValue?: ResizeTypes;
|
|
@@ -3,16 +3,25 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { memo, useCallback, useMemo, useState } from "react";
|
|
4
4
|
import { useDragResize, useCookies } from "../../hooks/index.js";
|
|
5
5
|
import { DragResizeContext } from "./dragResizeContext";
|
|
6
|
-
import {
|
|
7
|
-
import styles from "./dragResize.module.scss";
|
|
6
|
+
import { cn } from "../../utils/index.js";
|
|
8
7
|
const DragResizeBase = (props) => {
|
|
9
|
-
const { as, children, defaultWidth, defaultHeight,
|
|
8
|
+
const { as, children, defaultWidth, defaultHeight, className, containerClass, handlerClass, resizeStore = true, resizeStoreKey, resizeStoreValue, active = true, direction = "width", minWidth = 500, maxWidth = 950, dragLineWidth = 5, dragLineColor = "rgba(0, 0, 0, 1)", onInit, onResizeStart, onResizing, onResizeEnd, ...othersProps } = props;
|
|
10
9
|
const RootComponent = as || "div";
|
|
11
10
|
const [isActive, setActive] = useState(active);
|
|
12
11
|
const { setCookies, deleteCookies } = useCookies();
|
|
13
|
-
const resizeCSS = useMemo(() => mergeClassName(
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
// const resizeCSS = useMemo(() => mergeClassName(
|
|
13
|
+
// styles.root,
|
|
14
|
+
// resizeClass ? resizeClass : "",
|
|
15
|
+
// ), [resizeClass])
|
|
16
|
+
// const dragCSS = useMemo(() => mergeClassName(
|
|
17
|
+
// styles.drag,
|
|
18
|
+
// dragClass ? dragClass : "",
|
|
19
|
+
// !isActive ? styles.off : ""
|
|
20
|
+
// ), [isActive, dragClass])
|
|
21
|
+
// const containerCSS = useMemo(() => mergeClassName(
|
|
22
|
+
// styles.container,
|
|
23
|
+
// containerClass ? containerClass : "",
|
|
24
|
+
// ), [containerClass])
|
|
16
25
|
const isCookieStore = useMemo(() => resizeStore
|
|
17
26
|
&& resizeStoreKey
|
|
18
27
|
&& resizeStoreKey !== ""
|
|
@@ -67,10 +76,7 @@ const DragResizeBase = (props) => {
|
|
|
67
76
|
clearResizeStore,
|
|
68
77
|
defaultResizeSize
|
|
69
78
|
]);
|
|
70
|
-
return (_jsx(DragResizeContext, { value: contextValue, children: _jsxs(RootComponent, { ...othersProps, ref: resizeRef, className:
|
|
71
|
-
"--drag-line-width": dragLineWidth + "px",
|
|
72
|
-
"--drag-line-color": dragLineColor
|
|
73
|
-
} })] }) }));
|
|
79
|
+
return (_jsx(DragResizeContext, { value: contextValue, children: _jsxs(RootComponent, { ...othersProps, ref: resizeRef, className: cn("w-[inherit]", "h-[inherit]", "flex", "flex-row", className), style: resizeDefauleStyles, children: [_jsx("div", { className: cn("w-[inherit]", "h-[inherit]"), children: children }), _jsx("div", { ref: dragRef, className: cn("w-0", "h-full", "relative", "z-2", "hover:before:cursor-ew-resize", "hover:before:opacity-100", "before:content-[' ']", "before:w-1", "before:h-full", "before:absolute", "before:z-1", "before:opacity-0", "before:duration-500", "before:transition-opacity", "before:ease-in-out", "before:bg-black", handlerClass) })] }) }));
|
|
74
80
|
};
|
|
75
81
|
const DragResize = memo(DragResizeBase);
|
|
76
82
|
DragResize.displayName = "DragResize";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as DragResize } from "./
|
|
1
|
+
export { default as DragResize } from "./_dragResize";
|
|
2
2
|
export * from "./dragResizeContext";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as DragResize } from "./
|
|
1
|
+
export { default as DragResize } from "./_dragResize";
|
|
2
2
|
export * from "./dragResizeContext";
|