@byeolnaerim/flex-layout 0.0.9 → 0.0.12
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/flex-layout/components/FlexLayout.cjs +1 -110
- package/dist/flex-layout/components/FlexLayout.d.ts +2 -1
- package/dist/flex-layout/components/FlexLayout.js +1 -85
- package/dist/flex-layout/components/FlexLayoutContainer.cjs +1 -262
- package/dist/flex-layout/components/FlexLayoutContainer.d.ts +1 -1
- package/dist/flex-layout/components/FlexLayoutContainer.js +1 -232
- package/dist/flex-layout/components/FlexLayoutDynamicHeight.cjs +1 -0
- package/dist/flex-layout/components/FlexLayoutDynamicHeight.d.ts +6 -0
- package/dist/flex-layout/components/FlexLayoutDynamicHeight.js +1 -0
- package/dist/flex-layout/components/FlexLayoutIFramePane.cjs +1 -68
- package/dist/flex-layout/components/FlexLayoutIFramePane.js +1 -44
- package/dist/flex-layout/components/FlexLayoutResizePanel.cjs +1 -246
- package/dist/flex-layout/components/FlexLayoutResizePanel.js +1 -216
- package/dist/flex-layout/components/FlexLayoutSplitScreen.cjs +1 -1252
- package/dist/flex-layout/components/FlexLayoutSplitScreen.d.ts +14 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreen.js +1 -1236
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBox.cjs +1 -532
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBox.js +1 -509
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.cjs +1 -55
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.js +1 -25
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxItem.cjs +1 -63
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxItem.js +1 -33
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxTitleMore.cjs +1 -53
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxTitleMore.js +1 -23
- package/dist/flex-layout/components/FlexLayoutSplitScreenScrollBox.cjs +1 -133
- package/dist/flex-layout/components/FlexLayoutSplitScreenScrollBox.js +1 -107
- package/dist/flex-layout/components/FlexLayoutStickyBox.cjs +1 -245
- package/dist/flex-layout/components/FlexLayoutStickyBox.js +1 -229
- package/dist/flex-layout/components/index.cjs +1 -57
- package/dist/flex-layout/components/index.d.ts +1 -0
- package/dist/flex-layout/components/index.js +1 -17
- package/dist/flex-layout/hooks/index.cjs +1 -25
- package/dist/flex-layout/hooks/index.js +1 -3
- package/dist/flex-layout/hooks/useDrag.cjs +1 -289
- package/dist/flex-layout/hooks/useDrag.d.ts +15 -0
- package/dist/flex-layout/hooks/useDrag.js +1 -258
- package/dist/flex-layout/hooks/useFlexLayoutSplitScreen.cjs +1 -139
- package/dist/flex-layout/hooks/useFlexLayoutSplitScreen.js +1 -118
- package/dist/flex-layout/hooks/useListPaging.cjs +1 -212
- package/dist/flex-layout/hooks/useListPaging.js +1 -191
- package/dist/flex-layout/hooks/useSizes.cjs +1 -126
- package/dist/flex-layout/hooks/useSizes.d.ts +6 -3
- package/dist/flex-layout/hooks/useSizes.js +1 -101
- package/dist/flex-layout/index.cjs +1 -31
- package/dist/flex-layout/index.js +1 -6
- package/dist/flex-layout/providers/FlexLayoutContext.cjs +1 -49
- package/dist/flex-layout/providers/FlexLayoutContext.js +1 -24
- package/dist/flex-layout/providers/FlexLayoutHooks.cjs +1 -276
- package/dist/flex-layout/providers/FlexLayoutHooks.d.ts +5 -1
- package/dist/flex-layout/providers/FlexLayoutHooks.js +1 -263
- package/dist/flex-layout/providers/index.cjs +1 -23
- package/dist/flex-layout/providers/index.js +1 -2
- package/dist/flex-layout/store/FlexLayoutContainerStore.cjs +1 -257
- package/dist/flex-layout/store/FlexLayoutContainerStore.js +1 -206
- package/dist/flex-layout/store/index.cjs +1 -23
- package/dist/flex-layout/store/index.js +1 -2
- package/dist/flex-layout/styles/FlexLayout.module.css +499 -416
- package/dist/flex-layout/styles/sentinelStyle.module.css +11 -0
- package/dist/flex-layout/types/FlexDirectionTypes.cjs +1 -17
- package/dist/flex-layout/types/FlexDirectionTypes.js +0 -1
- package/dist/flex-layout/types/FlexLayoutTypes.cjs +1 -17
- package/dist/flex-layout/types/FlexLayoutTypes.d.ts +38 -2
- package/dist/flex-layout/types/FlexLayoutTypes.js +0 -1
- package/dist/flex-layout/utils/FlexLayoutUtils.cjs +1 -245
- package/dist/flex-layout/utils/FlexLayoutUtils.js +1 -211
- package/dist/flex-layout/utils/index.cjs +1 -23
- package/dist/flex-layout/utils/index.js +1 -2
- package/dist/index.cjs +1 -23
- package/dist/index.js +1 -2
- package/dist/types/css.d.cjs +0 -1
- package/dist/types/css.d.js +0 -1
- package/package.json +116 -113
- package/dist/flex-layout/components/FlexLayout.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayout.js.map +0 -1
- package/dist/flex-layout/components/FlexLayoutContainer.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayoutContainer.js.map +0 -1
- package/dist/flex-layout/components/FlexLayoutIFramePane.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayoutIFramePane.js.map +0 -1
- package/dist/flex-layout/components/FlexLayoutResizePanel.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayoutResizePanel.js.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreen.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreen.js.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBox.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBox.js.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.js.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxItem.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxItem.js.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxTitleMore.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxTitleMore.js.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenScrollBox.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayoutSplitScreenScrollBox.js.map +0 -1
- package/dist/flex-layout/components/FlexLayoutStickyBox.cjs.map +0 -1
- package/dist/flex-layout/components/FlexLayoutStickyBox.js.map +0 -1
- package/dist/flex-layout/components/index.cjs.map +0 -1
- package/dist/flex-layout/components/index.js.map +0 -1
- package/dist/flex-layout/hooks/index.cjs.map +0 -1
- package/dist/flex-layout/hooks/index.js.map +0 -1
- package/dist/flex-layout/hooks/useDrag.cjs.map +0 -1
- package/dist/flex-layout/hooks/useDrag.js.map +0 -1
- package/dist/flex-layout/hooks/useFlexLayoutSplitScreen.cjs.map +0 -1
- package/dist/flex-layout/hooks/useFlexLayoutSplitScreen.js.map +0 -1
- package/dist/flex-layout/hooks/useListPaging.cjs.map +0 -1
- package/dist/flex-layout/hooks/useListPaging.js.map +0 -1
- package/dist/flex-layout/hooks/useSizes.cjs.map +0 -1
- package/dist/flex-layout/hooks/useSizes.js.map +0 -1
- package/dist/flex-layout/index.cjs.map +0 -1
- package/dist/flex-layout/index.js.map +0 -1
- package/dist/flex-layout/providers/FlexLayoutContext.cjs.map +0 -1
- package/dist/flex-layout/providers/FlexLayoutContext.js.map +0 -1
- package/dist/flex-layout/providers/FlexLayoutHooks.cjs.map +0 -1
- package/dist/flex-layout/providers/FlexLayoutHooks.js.map +0 -1
- package/dist/flex-layout/providers/index.cjs.map +0 -1
- package/dist/flex-layout/providers/index.js.map +0 -1
- package/dist/flex-layout/store/FlexLayoutContainerStore.cjs.map +0 -1
- package/dist/flex-layout/store/FlexLayoutContainerStore.js.map +0 -1
- package/dist/flex-layout/store/index.cjs.map +0 -1
- package/dist/flex-layout/store/index.js.map +0 -1
- package/dist/flex-layout/types/FlexDirectionTypes.cjs.map +0 -1
- package/dist/flex-layout/types/FlexDirectionTypes.js.map +0 -1
- package/dist/flex-layout/types/FlexLayoutTypes.cjs.map +0 -1
- package/dist/flex-layout/types/FlexLayoutTypes.js.map +0 -1
- package/dist/flex-layout/utils/FlexLayoutUtils.cjs.map +0 -1
- package/dist/flex-layout/utils/FlexLayoutUtils.js.map +0 -1
- package/dist/flex-layout/utils/index.cjs.map +0 -1
- package/dist/flex-layout/utils/index.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/metafile-cjs.json +0 -1
- package/dist/metafile-esm.json +0 -1
- package/dist/types/css.d.cjs.map +0 -1
- package/dist/types/css.d.js.map +0 -1
|
@@ -1,31 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
-
var flex_layout_exports = {};
|
|
17
|
-
module.exports = __toCommonJS(flex_layout_exports);
|
|
18
|
-
__reExport(flex_layout_exports, require("./components"), module.exports);
|
|
19
|
-
__reExport(flex_layout_exports, require("./hooks"), module.exports);
|
|
20
|
-
__reExport(flex_layout_exports, require("./providers"), module.exports);
|
|
21
|
-
__reExport(flex_layout_exports, require("./utils"), module.exports);
|
|
22
|
-
__reExport(flex_layout_exports, require("./store"), module.exports);
|
|
23
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
24
|
-
0 && (module.exports = {
|
|
25
|
-
...require("./components"),
|
|
26
|
-
...require("./hooks"),
|
|
27
|
-
...require("./providers"),
|
|
28
|
-
...require("./utils"),
|
|
29
|
-
...require("./store")
|
|
30
|
-
});
|
|
31
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
"use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(f,e,p,x)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of c(e))!d.call(f,m)&&m!==p&&a(f,m,{get:()=>e[m],enumerable:!(x=b(e,m))||x.enumerable});return f},r=(f,e,p)=>(t(f,e,"default"),p&&t(p,e,"default"));var g=f=>t(a({},"__esModule",{value:!0}),f);var o={};module.exports=g(o);r(o,require("./components"),module.exports);r(o,require("./hooks"),module.exports);r(o,require("./providers"),module.exports);r(o,require("./utils"),module.exports);r(o,require("./store"),module.exports);0&&(module.exports={...require("./components"),...require("./hooks"),...require("./providers"),...require("./utils"),...require("./store")});
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from "./hooks";
|
|
3
|
-
export * from "./providers";
|
|
4
|
-
export * from "./utils";
|
|
5
|
-
export * from "./store";
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export*from"./components";export*from"./hooks";export*from"./providers";export*from"./utils";export*from"./store";
|
|
@@ -1,49 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
"use client";
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
var FlexLayoutContext_exports = {};
|
|
21
|
-
__export(FlexLayoutContext_exports, {
|
|
22
|
-
FlexLayoutProvider: () => FlexLayoutProvider,
|
|
23
|
-
useFlexLayoutContext: () => useFlexLayoutContext
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(FlexLayoutContext_exports);
|
|
26
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
27
|
-
var import_react = require("react");
|
|
28
|
-
const FlexLayoutContext = (0, import_react.createContext)(null);
|
|
29
|
-
function useFlexLayoutContext() {
|
|
30
|
-
const context = (0, import_react.useContext)(FlexLayoutContext);
|
|
31
|
-
if (!context) {
|
|
32
|
-
throw new Error(
|
|
33
|
-
"useFlexLayoutContext must be used within FlexLayoutContext.Provider"
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
return context;
|
|
37
|
-
}
|
|
38
|
-
function FlexLayoutProvider({
|
|
39
|
-
value,
|
|
40
|
-
children
|
|
41
|
-
}) {
|
|
42
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FlexLayoutContext.Provider, { value, children });
|
|
43
|
-
}
|
|
44
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
-
0 && (module.exports = {
|
|
46
|
-
FlexLayoutProvider,
|
|
47
|
-
useFlexLayoutContext
|
|
48
|
-
});
|
|
49
|
-
//# sourceMappingURL=FlexLayoutContext.cjs.map
|
|
1
|
+
"use strict";"use client";var n=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var F=Object.prototype.hasOwnProperty;var L=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,r,x)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of y(t))!F.call(e,o)&&o!==r&&n(e,o,{get:()=>t[o],enumerable:!(x=i(t,o))||x.enumerable});return e};var d=e=>c(n({},"__esModule",{value:!0}),e);var v={};L(v,{FlexLayoutProvider:()=>s,useFlexLayoutContext:()=>C});module.exports=d(v);var a=require("react/jsx-runtime"),u=require("react");const l=(0,u.createContext)(null);function C(){const e=(0,u.useContext)(l);if(!e)throw new Error("useFlexLayoutContext must be used within FlexLayoutContext.Provider");return e}function s({value:e,children:t}){return(0,a.jsx)(l.Provider,{value:e,children:t})}0&&(module.exports={FlexLayoutProvider,useFlexLayoutContext});
|
|
@@ -1,24 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, useContext } from "react";
|
|
4
|
-
const FlexLayoutContext = createContext(null);
|
|
5
|
-
function useFlexLayoutContext() {
|
|
6
|
-
const context = useContext(FlexLayoutContext);
|
|
7
|
-
if (!context) {
|
|
8
|
-
throw new Error(
|
|
9
|
-
"useFlexLayoutContext must be used within FlexLayoutContext.Provider"
|
|
10
|
-
);
|
|
11
|
-
}
|
|
12
|
-
return context;
|
|
13
|
-
}
|
|
14
|
-
function FlexLayoutProvider({
|
|
15
|
-
value,
|
|
16
|
-
children
|
|
17
|
-
}) {
|
|
18
|
-
return /* @__PURE__ */ jsx(FlexLayoutContext.Provider, { value, children });
|
|
19
|
-
}
|
|
20
|
-
export {
|
|
21
|
-
FlexLayoutProvider,
|
|
22
|
-
useFlexLayoutContext
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=FlexLayoutContext.js.map
|
|
1
|
+
"use client";import{jsx as n}from"react/jsx-runtime";import{createContext as r,useContext as u}from"react";const t=r(null);function y(){const e=u(t);if(!e)throw new Error("useFlexLayoutContext must be used within FlexLayoutContext.Provider");return e}function F({value:e,children:o}){return n(t.Provider,{value:e,children:o})}export{F as FlexLayoutProvider,y as useFlexLayoutContext};
|
|
@@ -1,276 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
"use client";
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
var FlexLayoutHooks_exports = {};
|
|
21
|
-
__export(FlexLayoutHooks_exports, {
|
|
22
|
-
ContainerOpenCloseProvider: () => ContainerOpenCloseProvider,
|
|
23
|
-
containerOpenCloseSubjectMap: () => containerOpenCloseSubjectMap,
|
|
24
|
-
containerSpreadSubjectMap: () => containerSpreadSubjectMap,
|
|
25
|
-
useContainerSize: () => useContainerSize,
|
|
26
|
-
useContainers: () => useContainers,
|
|
27
|
-
useDecompositionLayout: () => useDecompositionLayout,
|
|
28
|
-
useDoubleClick: () => useDoubleClick,
|
|
29
|
-
useLayoutName: () => useLayoutName
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(FlexLayoutHooks_exports);
|
|
32
|
-
var import_react = require("react");
|
|
33
|
-
var import_FlexLayoutContainerStore = require("../store/FlexLayoutContainerStore");
|
|
34
|
-
var import_FlexLayoutUtils = require("../utils/FlexLayoutUtils");
|
|
35
|
-
var import_rxjs = require("rxjs");
|
|
36
|
-
const g = globalThis;
|
|
37
|
-
g.__FLEX_SUBJECTS__ ?? (g.__FLEX_SUBJECTS__ = { openClose: {}, spread: {} });
|
|
38
|
-
const containerOpenCloseSubjectMap = g.__FLEX_SUBJECTS__.openClose;
|
|
39
|
-
const containerSpreadSubjectMap = g.__FLEX_SUBJECTS__.spread;
|
|
40
|
-
const ContainerOpenCloseProvider = ({
|
|
41
|
-
layoutName,
|
|
42
|
-
containerName,
|
|
43
|
-
sizeName
|
|
44
|
-
}) => {
|
|
45
|
-
if (!containerOpenCloseSubjectMap[containerName]) {
|
|
46
|
-
containerOpenCloseSubjectMap[containerName] = new import_rxjs.Subject();
|
|
47
|
-
}
|
|
48
|
-
if (!containerSpreadSubjectMap[containerName]) {
|
|
49
|
-
containerSpreadSubjectMap[containerName] = new import_rxjs.Subject();
|
|
50
|
-
}
|
|
51
|
-
const [containers, setContainers] = (0, import_react.useState)([]);
|
|
52
|
-
const [container, setContainer] = (0, import_react.useState)();
|
|
53
|
-
(0, import_react.useEffect)(() => {
|
|
54
|
-
const subscription = (0, import_FlexLayoutContainerStore.getLayoutInfos)(layoutName).subscribe(
|
|
55
|
-
(layout) => {
|
|
56
|
-
if (!layout || !layout.container[containerName] || !layout.container[containerName].current)
|
|
57
|
-
return;
|
|
58
|
-
setContainers(
|
|
59
|
-
Object.values(layout.container).filter(
|
|
60
|
-
(e) => e.current !== null
|
|
61
|
-
).map((e) => e.current)
|
|
62
|
-
);
|
|
63
|
-
setContainer(layout.container[containerName].current);
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
return () => subscription.unsubscribe();
|
|
67
|
-
}, [containerName, layoutName]);
|
|
68
|
-
(0, import_react.useEffect)(() => {
|
|
69
|
-
const styleName = `${sizeName.charAt(0).toUpperCase() + sizeName.substring(1)}`;
|
|
70
|
-
const clientSize = "client" + styleName;
|
|
71
|
-
const outerSize = "outer" + styleName;
|
|
72
|
-
const maxSize = "max" + styleName;
|
|
73
|
-
const subscribe = containerOpenCloseSubjectMap[containerName].subscribe(
|
|
74
|
-
({
|
|
75
|
-
mode,
|
|
76
|
-
initOpenState: isOpenState,
|
|
77
|
-
onClose,
|
|
78
|
-
onOpen,
|
|
79
|
-
openOption = {},
|
|
80
|
-
closeOption = {}
|
|
81
|
-
}) => {
|
|
82
|
-
if (!container || containers.length === 0) return;
|
|
83
|
-
const currentGrow = (0, import_FlexLayoutUtils.getGrow)(container);
|
|
84
|
-
const styleMap = window.getComputedStyle(container);
|
|
85
|
-
const maxSizeGrow = (0, import_FlexLayoutUtils.mathGrow)(
|
|
86
|
-
parseInt(styleMap[maxSize]),
|
|
87
|
-
container.parentElement && container.parentElement[clientSize] || window[outerSize],
|
|
88
|
-
containers.length
|
|
89
|
-
);
|
|
90
|
-
const open = () => (0, import_FlexLayoutUtils.openFlex)(container, containers, {
|
|
91
|
-
sizeName,
|
|
92
|
-
...isNaN(maxSizeGrow) ? {} : {
|
|
93
|
-
openGrowImportant: maxSizeGrow
|
|
94
|
-
},
|
|
95
|
-
...openOption
|
|
96
|
-
}).then((openTargetGrow) => {
|
|
97
|
-
if (onOpen) onOpen();
|
|
98
|
-
containerSpreadSubjectMap[containerName].next({
|
|
99
|
-
isOpen: true,
|
|
100
|
-
grow: openTargetGrow,
|
|
101
|
-
targetContainer: container
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
const close = () => (0, import_FlexLayoutUtils.closeFlex)(container, containers, {
|
|
105
|
-
sizeName,
|
|
106
|
-
...closeOption
|
|
107
|
-
}).then(() => {
|
|
108
|
-
if (onClose) onClose();
|
|
109
|
-
containerSpreadSubjectMap[containerName].next({
|
|
110
|
-
isOpen: false,
|
|
111
|
-
grow: 0,
|
|
112
|
-
targetContainer: container
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
if (mode === "toggle") {
|
|
116
|
-
if (currentGrow === 0) {
|
|
117
|
-
open();
|
|
118
|
-
} else {
|
|
119
|
-
close();
|
|
120
|
-
}
|
|
121
|
-
} else if (mode === "open") {
|
|
122
|
-
if (currentGrow === 0) {
|
|
123
|
-
open();
|
|
124
|
-
}
|
|
125
|
-
} else if (mode === "close") {
|
|
126
|
-
if (currentGrow !== 0) {
|
|
127
|
-
close();
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
);
|
|
132
|
-
return () => {
|
|
133
|
-
subscribe.unsubscribe();
|
|
134
|
-
};
|
|
135
|
-
}, [containerName, container, containers, sizeName]);
|
|
136
|
-
return null;
|
|
137
|
-
};
|
|
138
|
-
const useContainers = (layoutName) => {
|
|
139
|
-
const [containers, setContainers] = (0, import_react.useState)([]);
|
|
140
|
-
(0, import_react.useEffect)(() => {
|
|
141
|
-
const subscription = (0, import_FlexLayoutContainerStore.getLayoutInfos)(layoutName).subscribe(
|
|
142
|
-
(layout) => {
|
|
143
|
-
setContainers(
|
|
144
|
-
Object.values(layout.container).filter(
|
|
145
|
-
(e) => e.current !== null
|
|
146
|
-
).map((e) => e.current)
|
|
147
|
-
);
|
|
148
|
-
}
|
|
149
|
-
);
|
|
150
|
-
return () => subscription.unsubscribe();
|
|
151
|
-
}, [layoutName]);
|
|
152
|
-
return containers;
|
|
153
|
-
};
|
|
154
|
-
const useLayoutName = (containerName) => {
|
|
155
|
-
const [layoutName, setLayoutName] = (0, import_react.useState)();
|
|
156
|
-
(0, import_react.useEffect)(() => {
|
|
157
|
-
const subscribe = import_FlexLayoutContainerStore.flexContainerStore.pipe(
|
|
158
|
-
(0, import_rxjs.map)(
|
|
159
|
-
(layouts) => Object.entries(layouts).filter(([_, v]) => v[containerName]).map(([k]) => k)[0]
|
|
160
|
-
// 첫 번째 결과 가져오기
|
|
161
|
-
)
|
|
162
|
-
).subscribe(setLayoutName);
|
|
163
|
-
return () => subscribe.unsubscribe();
|
|
164
|
-
}, [containerName]);
|
|
165
|
-
return layoutName;
|
|
166
|
-
};
|
|
167
|
-
const useDecompositionLayout = ({
|
|
168
|
-
layoutName: initialLayoutName,
|
|
169
|
-
containerName
|
|
170
|
-
}) => {
|
|
171
|
-
const derivedLayoutName = useLayoutName(containerName);
|
|
172
|
-
const finalLayoutName = initialLayoutName || derivedLayoutName;
|
|
173
|
-
const [containers, setContainers] = (0, import_react.useState)([]);
|
|
174
|
-
const [container, setContainer] = (0, import_react.useState)();
|
|
175
|
-
const [resizePanel, setResizePanel] = (0, import_react.useState)();
|
|
176
|
-
(0, import_react.useEffect)(() => {
|
|
177
|
-
if (!finalLayoutName) return;
|
|
178
|
-
const subscription = (0, import_FlexLayoutContainerStore.getLayoutInfos)(finalLayoutName).subscribe(
|
|
179
|
-
(layout) => {
|
|
180
|
-
if (!layout) return;
|
|
181
|
-
setContainers(
|
|
182
|
-
Object.values(layout.container).filter(
|
|
183
|
-
(e) => e.current !== null
|
|
184
|
-
).map((e) => e.current)
|
|
185
|
-
);
|
|
186
|
-
if (containerName && layout.container[containerName] && layout.container[containerName].current) {
|
|
187
|
-
setContainer(layout.container[containerName].current);
|
|
188
|
-
if (layout.resizePanel[containerName] && layout.resizePanel[containerName].current) {
|
|
189
|
-
setResizePanel(
|
|
190
|
-
layout.resizePanel[containerName].current
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
);
|
|
196
|
-
return () => subscription.unsubscribe();
|
|
197
|
-
}, [containerName, finalLayoutName]);
|
|
198
|
-
return { layout: containers, container, resizePanel };
|
|
199
|
-
};
|
|
200
|
-
const useContainerSize = (containerName) => {
|
|
201
|
-
const { layout, container, resizePanel } = useDecompositionLayout({
|
|
202
|
-
containerName
|
|
203
|
-
});
|
|
204
|
-
const [size, setSize] = (0, import_react.useState)();
|
|
205
|
-
(0, import_react.useEffect)(() => {
|
|
206
|
-
if (!container) return;
|
|
207
|
-
const observer = new ResizeObserver((entries) => {
|
|
208
|
-
for (const entry of entries) {
|
|
209
|
-
setSize({
|
|
210
|
-
width: entry.contentRect.width,
|
|
211
|
-
height: entry.contentRect.height
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
observer.observe(container);
|
|
216
|
-
return () => observer.disconnect();
|
|
217
|
-
}, [container]);
|
|
218
|
-
return { size };
|
|
219
|
-
};
|
|
220
|
-
const useDoubleClick = (containerName, opt) => {
|
|
221
|
-
const [isOpen, setIsOpen] = (0, import_react.useState)();
|
|
222
|
-
const [isDoubleClick, setIsDoubleClick] = (0, import_react.useState)();
|
|
223
|
-
(0, import_react.useEffect)(() => {
|
|
224
|
-
const resizePanelClickEvent = (0, import_FlexLayoutContainerStore.getResizePanelRef)({
|
|
225
|
-
containerName
|
|
226
|
-
}).pipe(
|
|
227
|
-
(0, import_rxjs.filter)(
|
|
228
|
-
(resizePanelref) => resizePanelref != void 0 && resizePanelref.current != void 0
|
|
229
|
-
),
|
|
230
|
-
//take(1),
|
|
231
|
-
(0, import_rxjs.switchMap)((resizePanelref) => {
|
|
232
|
-
if (!resizePanelref || !resizePanelref.current) return import_rxjs.EMPTY;
|
|
233
|
-
return (0, import_rxjs.fromEvent)(resizePanelref.current, "click");
|
|
234
|
-
})
|
|
235
|
-
);
|
|
236
|
-
const subscribe = resizePanelClickEvent.pipe(
|
|
237
|
-
(0, import_rxjs.buffer)(resizePanelClickEvent.pipe((0, import_rxjs.debounceTime)(500))),
|
|
238
|
-
(0, import_rxjs.filter)((clickEventArray) => clickEventArray.length >= 2),
|
|
239
|
-
(0, import_rxjs.map)((events) => {
|
|
240
|
-
containerOpenCloseSubjectMap[containerName].next({
|
|
241
|
-
...opt,
|
|
242
|
-
openOption: {
|
|
243
|
-
...opt.openOption,
|
|
244
|
-
isPrevSizeOpen: false
|
|
245
|
-
},
|
|
246
|
-
onClose: () => {
|
|
247
|
-
if (opt.onClose) opt.onClose();
|
|
248
|
-
setIsOpen(false);
|
|
249
|
-
setIsDoubleClick(true);
|
|
250
|
-
},
|
|
251
|
-
onOpen: () => {
|
|
252
|
-
if (opt.onOpen) opt.onOpen();
|
|
253
|
-
setIsOpen(true);
|
|
254
|
-
setIsDoubleClick(true);
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
})
|
|
258
|
-
).subscribe();
|
|
259
|
-
return () => {
|
|
260
|
-
subscribe.unsubscribe();
|
|
261
|
-
};
|
|
262
|
-
}, [containerName]);
|
|
263
|
-
return { isOpen, isDoubleClick, setIsDoubleClick };
|
|
264
|
-
};
|
|
265
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
266
|
-
0 && (module.exports = {
|
|
267
|
-
ContainerOpenCloseProvider,
|
|
268
|
-
containerOpenCloseSubjectMap,
|
|
269
|
-
containerSpreadSubjectMap,
|
|
270
|
-
useContainerSize,
|
|
271
|
-
useContainers,
|
|
272
|
-
useDecompositionLayout,
|
|
273
|
-
useDoubleClick,
|
|
274
|
-
useLayoutName
|
|
275
|
-
});
|
|
276
|
-
//# sourceMappingURL=FlexLayoutHooks.cjs.map
|
|
1
|
+
"use strict";"use client";var m=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var y=(t,e)=>{for(var r in e)m(t,r,{get:e[r],enumerable:!0})},G=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of D(e))!I.call(t,c)&&c!==r&&m(t,c,{get:()=>e[c],enumerable:!(s=k(e,c))||s.enumerable});return t};var F=t=>G(m({},"__esModule",{value:!0}),t);var X={};y(X,{ContainerOpenCloseProvider:()=>q,containerOpenCloseSubjectMap:()=>h,containerSpreadSubjectMap:()=>d,useContainerSize:()=>B,useContainers:()=>U,useDecompositionLayout:()=>_,useDoubleClick:()=>W,useDoubleClickToggle:()=>J,useLayoutName:()=>v});module.exports=F(X);var i=require("react"),b=require("../store/FlexLayoutContainerStore"),f=require("../utils/FlexLayoutUtils"),o=require("rxjs");const S=globalThis;S.__FLEX_SUBJECTS__??(S.__FLEX_SUBJECTS__={openClose:{},spread:{}});const h=S.__FLEX_SUBJECTS__.openClose,d=S.__FLEX_SUBJECTS__.spread,q=({layoutName:t,containerName:e,sizeName:r})=>{h[e]||(h[e]=new o.Subject),d[e]||(d[e]=new o.Subject);const[s,c]=(0,i.useState)([]),[n,l]=(0,i.useState)();return(0,i.useEffect)(()=>{const p=(0,b.getLayoutInfos)(t).subscribe(u=>{!u||!u.container[e]||!u.container[e].current||(c(Object.values(u.container).filter(g=>g.current!==null).map(g=>g.current)),l(u.container[e].current))});return()=>p.unsubscribe()},[e,t]),(0,i.useEffect)(()=>{const p=`${r.charAt(0).toUpperCase()+r.substring(1)}`,u="client"+p,g="outer"+p,E="max"+p,a=h[e].subscribe(({mode:C,initOpenState:$,onClose:w,onOpen:x,openOption:R={},closeOption:H={}})=>{if(!n||s.length===0)return;const O=(0,f.getGrow)(n),P=window.getComputedStyle(n),L=(0,f.mathGrow)(parseInt(P[E]),n.parentElement&&n.parentElement[u]||window[g],s.length),T=()=>(0,f.openFlex)(n,s,{sizeName:r,...isNaN(L)?{}:{openGrowImportant:L},...R}).then(j=>{x&&x(),d[e].next({isOpen:!0,grow:j,targetContainer:n})}),M=()=>(0,f.closeFlex)(n,s,{sizeName:r,...H}).then(()=>{w&&w(),d[e].next({isOpen:!1,grow:0,targetContainer:n})});C==="toggle"?O===0?T():M():C==="open"?O===0&&T():C==="close"&&O!==0&&M()});return()=>{a.unsubscribe()}},[e,n,s,r]),null},U=t=>{const[e,r]=(0,i.useState)([]);return(0,i.useEffect)(()=>{const s=(0,b.getLayoutInfos)(t).subscribe(c=>{r(Object.values(c.container).filter(n=>n.current!==null).map(n=>n.current))});return()=>s.unsubscribe()},[t]),e},v=t=>{const[e,r]=(0,i.useState)();return(0,i.useEffect)(()=>{const s=b.flexContainerStore.pipe((0,o.map)(c=>Object.entries(c).filter(([n,l])=>l[t]).map(([n])=>n)[0])).subscribe(r);return()=>s.unsubscribe()},[t]),e},_=({layoutName:t,containerName:e})=>{const r=v(e),s=t||r,[c,n]=(0,i.useState)([]),[l,p]=(0,i.useState)(),[u,g]=(0,i.useState)();return(0,i.useEffect)(()=>{if(!s)return;const E=(0,b.getLayoutInfos)(s).subscribe(a=>{a&&(n(Object.values(a.container).filter(C=>C.current!==null).map(C=>C.current)),e&&a.container[e]&&a.container[e].current&&(p(a.container[e].current),a.resizePanel[e]&&a.resizePanel[e].current&&g(a.resizePanel[e].current)))});return()=>E.unsubscribe()},[e,s]),{layout:c,container:l,resizePanel:u}},B=t=>{const{layout:e,container:r,resizePanel:s}=_({containerName:t}),[c,n]=(0,i.useState)();return(0,i.useEffect)(()=>{if(!r)return;const l=new ResizeObserver(p=>{for(const u of p)n({width:u.contentRect.width,height:u.contentRect.height})});return l.observe(r),()=>l.disconnect()},[r]),{size:c}},z=t=>(0,b.getResizePanelRef)({containerName:t}).pipe((0,o.filter)(e=>e!=null&&e.current!=null),(0,o.switchMap)(e=>!e||!e.current?o.EMPTY:(0,o.fromEvent)(e.current,"click"))),J=(t,e)=>{const[r,s]=(0,i.useState)(),[c,n]=(0,i.useState)();return(0,i.useEffect)(()=>{const l=z(t),p=l.pipe((0,o.buffer)(l.pipe((0,o.debounceTime)(500))),(0,o.filter)(u=>u.length>=2)).subscribe(()=>{h[t].next({...e,openOption:{...e.openOption,isPrevSizeOpen:!1},onClose:()=>{e.onClose&&e.onClose(),s(!1),n(!0)},onOpen:()=>{e.onOpen&&e.onOpen(),s(!0),n(!0)}})});return()=>{p.unsubscribe()}},[t]),{isOpen:r,isDoubleClick:c,setIsDoubleClick:n}},W=t=>{const[e,r]=(0,i.useState)();return(0,i.useEffect)(()=>{const s=z(t),c=s.pipe((0,o.buffer)(s.pipe((0,o.debounceTime)(500))),(0,o.filter)(n=>n.length>=2)).subscribe(()=>{r(!0)});return()=>{c.unsubscribe()}},[t]),{isDoubleClick:e,setIsDoubleClick:r}};0&&(module.exports={ContainerOpenCloseProvider,containerOpenCloseSubjectMap,containerSpreadSubjectMap,useContainerSize,useContainers,useDecompositionLayout,useDoubleClick,useDoubleClickToggle,useLayoutName});
|
|
@@ -43,9 +43,13 @@ export declare const useContainerSize: (containerName: string) => {
|
|
|
43
43
|
height: number;
|
|
44
44
|
} | undefined;
|
|
45
45
|
};
|
|
46
|
-
export declare const
|
|
46
|
+
export declare const useDoubleClickToggle: (containerName: string, opt: ContainerStateRequest) => {
|
|
47
47
|
isOpen: boolean | undefined;
|
|
48
48
|
isDoubleClick: boolean | undefined;
|
|
49
49
|
setIsDoubleClick: import("react").Dispatch<import("react").SetStateAction<boolean | undefined>>;
|
|
50
50
|
};
|
|
51
|
+
export declare const useDoubleClick: (containerName: string) => {
|
|
52
|
+
isDoubleClick: boolean | undefined;
|
|
53
|
+
setIsDoubleClick: import("react").Dispatch<import("react").SetStateAction<boolean | undefined>>;
|
|
54
|
+
};
|
|
51
55
|
export {};
|