@byeolnaerim/flex-layout 0.0.3 → 0.0.4
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/FlexLayoutSplitScreenDragBox-eCtq4kLd.d.cts +31 -0
- package/dist/FlexLayoutSplitScreenDragBox-eCtq4kLd.d.ts +31 -0
- package/dist/chunk-3EDKZTM3.js +3 -0
- package/dist/chunk-3EDKZTM3.js.map +1 -0
- package/dist/chunk-5HWEFTNQ.js +176 -0
- package/dist/chunk-5HWEFTNQ.js.map +1 -0
- package/dist/chunk-7J5JUVZK.js +3 -0
- package/dist/chunk-7J5JUVZK.js.map +1 -0
- package/dist/chunk-CFQQ6ZDC.js +182 -0
- package/dist/chunk-CFQQ6ZDC.js.map +1 -0
- package/dist/chunk-JM3CZ5DU.js +238 -0
- package/dist/chunk-JM3CZ5DU.js.map +1 -0
- package/dist/chunk-PMTZFSP4.js +219 -0
- package/dist/chunk-PMTZFSP4.js.map +1 -0
- package/dist/chunk-UYI4Z27V.js +2432 -0
- package/dist/chunk-UYI4Z27V.js.map +1 -0
- package/dist/chunk-W4CNFJTK.js +197 -0
- package/dist/chunk-W4CNFJTK.js.map +1 -0
- package/dist/chunk-YIHCWXKY.js +3 -0
- package/dist/chunk-YIHCWXKY.js.map +1 -0
- package/dist/components.cjs +3048 -0
- package/dist/components.cjs.map +1 -0
- package/dist/components.css +471 -0
- package/dist/components.css.map +1 -0
- package/dist/components.d.cts +122 -0
- package/dist/components.d.ts +122 -0
- package/dist/components.js +7 -0
- package/dist/components.js.map +1 -0
- package/dist/hooks.cjs +425 -0
- package/dist/hooks.cjs.map +1 -0
- package/dist/hooks.d.cts +37 -0
- package/dist/hooks.d.ts +37 -0
- package/dist/hooks.js +5 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.d.cts +10 -418
- package/dist/index.d.ts +10 -418
- package/dist/index.js +9 -3403
- package/dist/index.js.map +1 -1
- package/dist/providers.cjs +411 -0
- package/dist/providers.cjs.map +1 -0
- package/dist/providers.d.cts +54 -0
- package/dist/providers.d.ts +54 -0
- package/dist/providers.js +6 -0
- package/dist/providers.js.map +1 -0
- package/dist/store.cjs +204 -0
- package/dist/store.cjs.map +1 -0
- package/dist/store.d.cts +67 -0
- package/dist/store.d.ts +67 -0
- package/dist/store.js +4 -0
- package/dist/store.js.map +1 -0
- package/dist/useDrag-CYQnhUFk.d.cts +108 -0
- package/dist/useDrag-DR01Ob3s.d.ts +108 -0
- package/dist/utils.cjs +209 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +28 -0
- package/dist/utils.d.ts +28 -0
- package/dist/utils.js +4 -0
- package/dist/utils.js.map +1 -0
- package/package.json +25 -5
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('react');
|
|
4
|
+
require('fast-deep-equal');
|
|
5
|
+
var rxjs = require('rxjs');
|
|
6
|
+
var operators = require('rxjs/operators');
|
|
7
|
+
|
|
8
|
+
// src/flex-layout/providers/FlexLayoutHooks.tsx
|
|
9
|
+
var scrollPositions = {};
|
|
10
|
+
new rxjs.BehaviorSubject(scrollPositions);
|
|
11
|
+
new rxjs.BehaviorSubject({});
|
|
12
|
+
var flexContainerStore = new rxjs.BehaviorSubject({});
|
|
13
|
+
var flexResizePanelStore = new rxjs.BehaviorSubject({});
|
|
14
|
+
var getLayoutInfos = (layoutName) => {
|
|
15
|
+
return rxjs.combineLatest([flexContainerStore, flexResizePanelStore]).pipe(
|
|
16
|
+
operators.map(([containerRefs, resizePanelRefs]) => {
|
|
17
|
+
const containerData = containerRefs[layoutName] || {};
|
|
18
|
+
const resizePanelData = resizePanelRefs[layoutName] || {};
|
|
19
|
+
return {
|
|
20
|
+
container: containerData,
|
|
21
|
+
resizePanel: resizePanelData
|
|
22
|
+
};
|
|
23
|
+
}),
|
|
24
|
+
operators.filter((result) => result.container !== null)
|
|
25
|
+
// 빈 객체 제외
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
var getResizePanelRef = ({
|
|
29
|
+
containerName,
|
|
30
|
+
layoutName
|
|
31
|
+
}) => {
|
|
32
|
+
return flexResizePanelStore.pipe(
|
|
33
|
+
operators.map((refs) => {
|
|
34
|
+
if (layoutName) {
|
|
35
|
+
return refs[layoutName]?.[containerName] || null;
|
|
36
|
+
} else {
|
|
37
|
+
return Object.entries(refs).find(
|
|
38
|
+
([key, value]) => refs[key][containerName]
|
|
39
|
+
)?.[1][containerName];
|
|
40
|
+
}
|
|
41
|
+
}),
|
|
42
|
+
operators.filter((ref) => ref !== null)
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// src/flex-layout/utils/FlexLayoutUtils.ts
|
|
47
|
+
function resize(list, totalGrow) {
|
|
48
|
+
return new Promise((resolve) => {
|
|
49
|
+
let resizeWeight = totalGrow / list.length;
|
|
50
|
+
list.forEach((e) => {
|
|
51
|
+
e.dataset.grow = resizeWeight.toString();
|
|
52
|
+
e.style.flex = `${resizeWeight} 1 0%`;
|
|
53
|
+
});
|
|
54
|
+
resolve(resizeWeight);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function mathGrow(childSize, parentSize, containerCount) {
|
|
58
|
+
return containerCount * (childSize / parentSize);
|
|
59
|
+
}
|
|
60
|
+
function getGrow(growTarget) {
|
|
61
|
+
const target = growTarget instanceof Element ? growTarget : growTarget;
|
|
62
|
+
return parseFloat(target.style.flex.split(" ")[0]) || parseFloat(target.dataset.grow || "");
|
|
63
|
+
}
|
|
64
|
+
function closeFlex(resizeTarget, containers, {
|
|
65
|
+
isResize = false,
|
|
66
|
+
isDsiabledResizePanel = false,
|
|
67
|
+
sizeName
|
|
68
|
+
}) {
|
|
69
|
+
return new Promise((resolve) => {
|
|
70
|
+
if (!resizeTarget.hasAttribute("data-is_resize_panel")) ; else if (isDsiabledResizePanel) {
|
|
71
|
+
resizeTarget.dataset.is_resize_panel = "false";
|
|
72
|
+
}
|
|
73
|
+
resizeTarget.dataset.prev_grow = getGrow(resizeTarget).toString();
|
|
74
|
+
let notCloseList = containers.filter(
|
|
75
|
+
(e) => e.style.flex != "0 1 0%" && e != resizeTarget
|
|
76
|
+
);
|
|
77
|
+
let notCloseAndOpenTargetList = [...notCloseList, resizeTarget];
|
|
78
|
+
notCloseAndOpenTargetList.forEach((e) => {
|
|
79
|
+
e.style.transition = "flex 0.5s";
|
|
80
|
+
e.ontransitionend = (event) => {
|
|
81
|
+
if (event.propertyName != "flex-grow") {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
notCloseAndOpenTargetList.forEach(
|
|
85
|
+
(e2) => e2.style.transition = ""
|
|
86
|
+
);
|
|
87
|
+
e.ontransitionend = () => {
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
if (e == resizeTarget) {
|
|
91
|
+
e.dataset.grow = "0";
|
|
92
|
+
e.style.flex = `0 1 0%`;
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (isResize) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
let percent = getGrow(e) / containers.length;
|
|
99
|
+
if (notCloseList.length == 1) {
|
|
100
|
+
e.dataset.grow = containers.length.toString();
|
|
101
|
+
e.style.flex = `${containers.length} 1 0%`;
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
e.dataset.grow = (containers.length * percent).toString();
|
|
105
|
+
e.style.flex = `${containers.length * percent} 1 0%`;
|
|
106
|
+
});
|
|
107
|
+
if (isResize) {
|
|
108
|
+
resize(notCloseList, containers.length);
|
|
109
|
+
}
|
|
110
|
+
resolve(resizeTarget);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function openFlex(resizeTarget, containers, {
|
|
114
|
+
isPrevSizeOpen = false,
|
|
115
|
+
isResize = false,
|
|
116
|
+
openGrowImportant = 0,
|
|
117
|
+
sizeName
|
|
118
|
+
}) {
|
|
119
|
+
return new Promise((resolve) => {
|
|
120
|
+
if (!resizeTarget.hasAttribute("data-is_resize_panel")) ; else if (resizeTarget.hasAttribute("data-is_resize_panel") && resizeTarget.dataset.is_resize_panel == "false") {
|
|
121
|
+
resizeTarget.dataset.is_resize_panel = "true";
|
|
122
|
+
}
|
|
123
|
+
let notCloseList = containers.filter(
|
|
124
|
+
(e) => e.style.flex != "0 1 0%" && e != resizeTarget
|
|
125
|
+
);
|
|
126
|
+
let notCloseAndOpenTargetList = [...notCloseList, resizeTarget];
|
|
127
|
+
let openTargetGrow = 1;
|
|
128
|
+
const sizeStyleName = "client" + sizeName.charAt(0).toUpperCase() + sizeName.substring(1);
|
|
129
|
+
const parentSize = sizeName && resizeTarget.parentElement && resizeTarget.parentElement[sizeStyleName] || 0;
|
|
130
|
+
if (isPrevSizeOpen && resizeTarget.hasAttribute("data-prev_grow")) {
|
|
131
|
+
openTargetGrow = parseFloat(resizeTarget.dataset.prev_grow || "1") || 1;
|
|
132
|
+
} else if (parentSize && parentSize !== 0) {
|
|
133
|
+
openTargetGrow = parentSize / notCloseList.length / (parentSize - 1) * containers.length;
|
|
134
|
+
} else {
|
|
135
|
+
openTargetGrow = 1;
|
|
136
|
+
}
|
|
137
|
+
if (openGrowImportant) {
|
|
138
|
+
openTargetGrow = openGrowImportant;
|
|
139
|
+
}
|
|
140
|
+
openTargetGrow = openTargetGrow === Infinity ? 1 : openTargetGrow;
|
|
141
|
+
notCloseAndOpenTargetList.forEach((e) => {
|
|
142
|
+
e.style.transition = "flex 0.5s";
|
|
143
|
+
e.ontransitionend = (event) => {
|
|
144
|
+
if (event.propertyName != "flex-grow") {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
notCloseAndOpenTargetList.forEach(
|
|
148
|
+
(e2) => e2.style.transition = ""
|
|
149
|
+
);
|
|
150
|
+
e.ontransitionend = () => {
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
if (e == resizeTarget) {
|
|
154
|
+
resizeTarget.dataset.grow = openTargetGrow.toString();
|
|
155
|
+
resizeTarget.style.flex = `${openTargetGrow} 1 0%`;
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (isResize) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
let grow = parentSize / notCloseList.length / (parentSize - 1) * (containers.length - openTargetGrow);
|
|
162
|
+
grow = grow === Infinity ? 1 : grow;
|
|
163
|
+
e.dataset.grow = grow.toString();
|
|
164
|
+
e.style.flex = `${grow} 1 0%`;
|
|
165
|
+
});
|
|
166
|
+
if (isResize) {
|
|
167
|
+
resize(notCloseAndOpenTargetList, containers.length);
|
|
168
|
+
}
|
|
169
|
+
resolve(openTargetGrow);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
var g = globalThis;
|
|
173
|
+
g.__FLEX_SUBJECTS__ ?? (g.__FLEX_SUBJECTS__ = { openClose: {}, spread: {} });
|
|
174
|
+
var containerOpenCloseSubjectMap = g.__FLEX_SUBJECTS__.openClose;
|
|
175
|
+
var containerSpreadSubjectMap = g.__FLEX_SUBJECTS__.spread;
|
|
176
|
+
var ContainerOpenCloseProvider = ({
|
|
177
|
+
layoutName,
|
|
178
|
+
containerName,
|
|
179
|
+
sizeName
|
|
180
|
+
}) => {
|
|
181
|
+
if (!containerOpenCloseSubjectMap[containerName]) {
|
|
182
|
+
containerOpenCloseSubjectMap[containerName] = new rxjs.Subject();
|
|
183
|
+
}
|
|
184
|
+
if (!containerSpreadSubjectMap[containerName]) {
|
|
185
|
+
containerSpreadSubjectMap[containerName] = new rxjs.Subject();
|
|
186
|
+
}
|
|
187
|
+
const [containers, setContainers] = react.useState([]);
|
|
188
|
+
const [container, setContainer] = react.useState();
|
|
189
|
+
react.useEffect(() => {
|
|
190
|
+
const subscription = getLayoutInfos(layoutName).subscribe(
|
|
191
|
+
(layout) => {
|
|
192
|
+
if (!layout || !layout.container[containerName] || !layout.container[containerName].current)
|
|
193
|
+
return;
|
|
194
|
+
setContainers(
|
|
195
|
+
Object.values(layout.container).filter(
|
|
196
|
+
(e) => e.current !== null
|
|
197
|
+
).map((e) => e.current)
|
|
198
|
+
);
|
|
199
|
+
setContainer(layout.container[containerName].current);
|
|
200
|
+
}
|
|
201
|
+
);
|
|
202
|
+
return () => subscription.unsubscribe();
|
|
203
|
+
}, [containerName, layoutName]);
|
|
204
|
+
react.useEffect(() => {
|
|
205
|
+
const styleName = `${sizeName.charAt(0).toUpperCase() + sizeName.substring(1)}`;
|
|
206
|
+
const clientSize = "client" + styleName;
|
|
207
|
+
const outerSize = "outer" + styleName;
|
|
208
|
+
const maxSize = "max" + styleName;
|
|
209
|
+
const subscribe = containerOpenCloseSubjectMap[containerName].subscribe(
|
|
210
|
+
({
|
|
211
|
+
mode,
|
|
212
|
+
initOpenState: isOpenState,
|
|
213
|
+
onClose,
|
|
214
|
+
onOpen,
|
|
215
|
+
openOption = {},
|
|
216
|
+
closeOption = {}
|
|
217
|
+
}) => {
|
|
218
|
+
if (!container || containers.length === 0) return;
|
|
219
|
+
const currentGrow = getGrow(container);
|
|
220
|
+
const styleMap = window.getComputedStyle(container);
|
|
221
|
+
const maxSizeGrow = mathGrow(
|
|
222
|
+
parseInt(styleMap[maxSize]),
|
|
223
|
+
container.parentElement && container.parentElement[clientSize] || window[outerSize],
|
|
224
|
+
containers.length
|
|
225
|
+
);
|
|
226
|
+
const open = () => openFlex(container, containers, {
|
|
227
|
+
sizeName,
|
|
228
|
+
...isNaN(maxSizeGrow) ? {} : {
|
|
229
|
+
openGrowImportant: maxSizeGrow
|
|
230
|
+
},
|
|
231
|
+
...openOption
|
|
232
|
+
}).then((openTargetGrow) => {
|
|
233
|
+
if (onOpen) onOpen();
|
|
234
|
+
containerSpreadSubjectMap[containerName].next({
|
|
235
|
+
isOpen: true,
|
|
236
|
+
grow: openTargetGrow,
|
|
237
|
+
targetContainer: container
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
const close = () => closeFlex(container, containers, {
|
|
241
|
+
sizeName,
|
|
242
|
+
...closeOption
|
|
243
|
+
}).then(() => {
|
|
244
|
+
if (onClose) onClose();
|
|
245
|
+
containerSpreadSubjectMap[containerName].next({
|
|
246
|
+
isOpen: false,
|
|
247
|
+
grow: 0,
|
|
248
|
+
targetContainer: container
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
if (mode === "toggle") {
|
|
252
|
+
if (currentGrow === 0) {
|
|
253
|
+
open();
|
|
254
|
+
} else {
|
|
255
|
+
close();
|
|
256
|
+
}
|
|
257
|
+
} else if (mode === "open") {
|
|
258
|
+
if (currentGrow === 0) {
|
|
259
|
+
open();
|
|
260
|
+
}
|
|
261
|
+
} else if (mode === "close") {
|
|
262
|
+
if (currentGrow !== 0) {
|
|
263
|
+
close();
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
);
|
|
268
|
+
return () => {
|
|
269
|
+
subscribe.unsubscribe();
|
|
270
|
+
};
|
|
271
|
+
}, [containerName, container, containers, sizeName]);
|
|
272
|
+
return null;
|
|
273
|
+
};
|
|
274
|
+
var useContainers = (layoutName) => {
|
|
275
|
+
const [containers, setContainers] = react.useState([]);
|
|
276
|
+
react.useEffect(() => {
|
|
277
|
+
const subscription = getLayoutInfos(layoutName).subscribe(
|
|
278
|
+
(layout) => {
|
|
279
|
+
setContainers(
|
|
280
|
+
Object.values(layout.container).filter(
|
|
281
|
+
(e) => e.current !== null
|
|
282
|
+
).map((e) => e.current)
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
);
|
|
286
|
+
return () => subscription.unsubscribe();
|
|
287
|
+
}, [layoutName]);
|
|
288
|
+
return containers;
|
|
289
|
+
};
|
|
290
|
+
var useLayoutName = (containerName) => {
|
|
291
|
+
const [layoutName, setLayoutName] = react.useState();
|
|
292
|
+
react.useEffect(() => {
|
|
293
|
+
const subscribe = flexContainerStore.pipe(
|
|
294
|
+
rxjs.map(
|
|
295
|
+
(layouts) => Object.entries(layouts).filter(([_, v]) => v[containerName]).map(([k]) => k)[0]
|
|
296
|
+
// 첫 번째 결과 가져오기
|
|
297
|
+
)
|
|
298
|
+
).subscribe(setLayoutName);
|
|
299
|
+
return () => subscribe.unsubscribe();
|
|
300
|
+
}, [containerName]);
|
|
301
|
+
return layoutName;
|
|
302
|
+
};
|
|
303
|
+
var useDecompositionLayout = ({
|
|
304
|
+
layoutName: initialLayoutName,
|
|
305
|
+
containerName
|
|
306
|
+
}) => {
|
|
307
|
+
const derivedLayoutName = useLayoutName(containerName);
|
|
308
|
+
const finalLayoutName = initialLayoutName || derivedLayoutName;
|
|
309
|
+
const [containers, setContainers] = react.useState([]);
|
|
310
|
+
const [container, setContainer] = react.useState();
|
|
311
|
+
const [resizePanel, setResizePanel] = react.useState();
|
|
312
|
+
react.useEffect(() => {
|
|
313
|
+
if (!finalLayoutName) return;
|
|
314
|
+
const subscription = getLayoutInfos(finalLayoutName).subscribe(
|
|
315
|
+
(layout) => {
|
|
316
|
+
if (!layout) return;
|
|
317
|
+
setContainers(
|
|
318
|
+
Object.values(layout.container).filter(
|
|
319
|
+
(e) => e.current !== null
|
|
320
|
+
).map((e) => e.current)
|
|
321
|
+
);
|
|
322
|
+
if (containerName && layout.container[containerName] && layout.container[containerName].current) {
|
|
323
|
+
setContainer(layout.container[containerName].current);
|
|
324
|
+
if (layout.resizePanel[containerName] && layout.resizePanel[containerName].current) {
|
|
325
|
+
setResizePanel(
|
|
326
|
+
layout.resizePanel[containerName].current
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
);
|
|
332
|
+
return () => subscription.unsubscribe();
|
|
333
|
+
}, [containerName, finalLayoutName]);
|
|
334
|
+
return { layout: containers, container, resizePanel };
|
|
335
|
+
};
|
|
336
|
+
var useContainerSize = (containerName) => {
|
|
337
|
+
const { layout, container, resizePanel } = useDecompositionLayout({
|
|
338
|
+
containerName
|
|
339
|
+
});
|
|
340
|
+
const [size, setSize] = react.useState();
|
|
341
|
+
react.useEffect(() => {
|
|
342
|
+
if (!container) return;
|
|
343
|
+
const observer = new ResizeObserver((entries) => {
|
|
344
|
+
for (const entry of entries) {
|
|
345
|
+
setSize({
|
|
346
|
+
width: entry.contentRect.width,
|
|
347
|
+
height: entry.contentRect.height
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
observer.observe(container);
|
|
352
|
+
return () => observer.disconnect();
|
|
353
|
+
}, [container]);
|
|
354
|
+
return { size };
|
|
355
|
+
};
|
|
356
|
+
var useDoubleClick = (containerName, opt) => {
|
|
357
|
+
const [isOpen, setIsOpen] = react.useState();
|
|
358
|
+
const [isDoubleClick, setIsDoubleClick] = react.useState();
|
|
359
|
+
react.useEffect(() => {
|
|
360
|
+
const resizePanelClickEvent = getResizePanelRef({
|
|
361
|
+
containerName
|
|
362
|
+
}).pipe(
|
|
363
|
+
rxjs.filter(
|
|
364
|
+
(resizePanelref) => resizePanelref != void 0 && resizePanelref.current != void 0
|
|
365
|
+
),
|
|
366
|
+
//take(1),
|
|
367
|
+
rxjs.switchMap((resizePanelref) => {
|
|
368
|
+
if (!resizePanelref || !resizePanelref.current) return rxjs.EMPTY;
|
|
369
|
+
return rxjs.fromEvent(resizePanelref.current, "click");
|
|
370
|
+
})
|
|
371
|
+
);
|
|
372
|
+
const subscribe = resizePanelClickEvent.pipe(
|
|
373
|
+
rxjs.buffer(resizePanelClickEvent.pipe(rxjs.debounceTime(500))),
|
|
374
|
+
rxjs.filter((clickEventArray) => clickEventArray.length >= 2),
|
|
375
|
+
rxjs.map((events) => {
|
|
376
|
+
containerOpenCloseSubjectMap[containerName].next({
|
|
377
|
+
...opt,
|
|
378
|
+
openOption: {
|
|
379
|
+
...opt.openOption,
|
|
380
|
+
isPrevSizeOpen: false
|
|
381
|
+
},
|
|
382
|
+
onClose: () => {
|
|
383
|
+
if (opt.onClose) opt.onClose();
|
|
384
|
+
setIsOpen(false);
|
|
385
|
+
setIsDoubleClick(true);
|
|
386
|
+
},
|
|
387
|
+
onOpen: () => {
|
|
388
|
+
if (opt.onOpen) opt.onOpen();
|
|
389
|
+
setIsOpen(true);
|
|
390
|
+
setIsDoubleClick(true);
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
})
|
|
394
|
+
).subscribe();
|
|
395
|
+
return () => {
|
|
396
|
+
subscribe.unsubscribe();
|
|
397
|
+
};
|
|
398
|
+
}, [containerName]);
|
|
399
|
+
return { isOpen, isDoubleClick, setIsDoubleClick };
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
exports.ContainerOpenCloseProvider = ContainerOpenCloseProvider;
|
|
403
|
+
exports.containerOpenCloseSubjectMap = containerOpenCloseSubjectMap;
|
|
404
|
+
exports.containerSpreadSubjectMap = containerSpreadSubjectMap;
|
|
405
|
+
exports.useContainerSize = useContainerSize;
|
|
406
|
+
exports.useContainers = useContainers;
|
|
407
|
+
exports.useDecompositionLayout = useDecompositionLayout;
|
|
408
|
+
exports.useDoubleClick = useDoubleClick;
|
|
409
|
+
exports.useLayoutName = useLayoutName;
|
|
410
|
+
//# sourceMappingURL=providers.cjs.map
|
|
411
|
+
//# sourceMappingURL=providers.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/flex-layout/store/FlexLayoutContainerStore.ts","../src/flex-layout/utils/FlexLayoutUtils.ts","../src/flex-layout/providers/FlexLayoutHooks.tsx"],"names":["BehaviorSubject","combineLatest","map","filter","e","Subject","useState","useEffect","switchMap","EMPTY","fromEvent","buffer","debounceTime"],"mappings":";;;;;;;;AA2CO,IAAM,kBAAkD,EAAC;AAEjC,IAAIA,oBAAA,CAEjC,eAAe;AAgEhB,IAAIA,oBAAA,CAAwC,EAAE;AA8ExC,IAAM,kBAAA,GAAqB,IAAIA,oBAAA,CAA0B,EAAE,CAAA;AAE3D,IAAM,oBAAA,GAAuB,IAAIA,oBAAA,CAA0B,EAAE,CAAA;AAiD7D,IAAM,cAAA,GAAiB,CAAC,UAAA,KAAuB;AACrD,EAAA,OAAOC,kBAAA,CAAc,C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AS,MAAM;AACd,YAAA,IAAI,GAAA,CAAI,OAAA,EAAS,GAAA,CAAI,OAAA,EAAQ;AAC7B,YAAA,SAAA,CAAU,KAAK,CAAA;AACf,YAAA,gBAAA,CAAiB,IAAI,CAAA;AAAA,UACtB,CAAA;AAAA,UACA,QAAQ,MAAM;AACb,YAAA,IAAI,GAAA,CAAI,MAAA,EAAQ,GAAA,CAAI,MAAA,EAAO;AAC3B,YAAA,SAAA,CAAU,IAAI,CAAA;AACd,YAAA,gBAAA,CAAiB,IAAI,CAAA;AAAA,UACtB;AAAA,SACA,CAAA;AAAA,MACF,CAAC;AAAA,MAED,SAAA,EAAU;AACZ,IAAA,OAAO,MAAM;AACZ,MAAA,SAAA,CAAU,WAAA,EAAY;AAAA,IACvB,CAAA;AAAA,EACD,CAAA,EAAG,CAAC,aAAa,CAAC,CAAA;AAClB,EAAA,OAAO,EAAE,MAAA,EAAQ,aAAA,EAAe,gBAAA,EAAiB;AAClD","file":"providers.cjs","sourcesContent":["\"use client\";\r\nimport equal from \"fast-deep-equal\";\r\nimport { RefObject } from \"react\";\r\nimport { BehaviorSubject, combineLatest } from \"rxjs\";\r\nimport { distinctUntilChanged, filter, map } from \"rxjs/operators\";\r\nimport { DropTargetComponent } from \"../hooks/useDrag\";\r\n\r\n/**\r\n * 이전 값과 새 값이 동일하지 않을 때만 store를 업데이트하는 유틸 함수\r\n */\r\nfunction updateScrollStore<T>(subject: BehaviorSubject<T>, newValue: T) {\r\n\tconst currentValue = subject.getValue();\r\n\t// deep 비교를 통해 실제 변경이 있는 경우만 next\r\n\tif (!equal(currentValue, newValue)) {\r\n\t\tsubject.next(newValue);\r\n\t}\r\n}\r\n// 동일한지 확인 후 업데이트하는 유틸\r\nfunction updateRefStore(store: BehaviorSubject<RefStore>, newState: RefStore) {\r\n\tconst prevState = store.getValue();\r\n\tif (!equal(prevState, newState)) {\r\n\t\tstore.next(newState);\r\n\t}\r\n}\r\n\r\nfunction updateSplitScreenStore(newValue: LayoutSplitScreenState) {\r\n\tconst prevValue = layoutSplitScreenStore.getValue();\r\n\t// deep-equal 로 비교\r\n\tif (!equal(prevValue, newValue)) {\r\n\t\tlayoutSplitScreenStore.next(newValue);\r\n\t}\r\n}\r\n\r\n// 구독 시 이전 상태들을 축적하여 관리\r\n// const stateWithHistory$ = flexContainerStore.pipe(\r\n// scan((acc, newState) => [...acc, newState], [] as RefStore[])\r\n// );\r\n\r\nexport interface ScrollPosition {\r\n\tx: number;\r\n\ty: number;\r\n}\r\n\r\nexport const scrollPositions: Record<string, ScrollPosition> = {};\r\n\r\nconst scrollPositionsSubject = new BehaviorSubject<\r\n\tRecord<string, ScrollPosition>\r\n>(scrollPositions);\r\n\r\n/**\r\n * 스크롤 위치 업데이트 함수\r\n *\r\n * 기존: 항상 store.next()가 호출됨 → 바뀌지 않았다면 건너뛰도록 변경\r\n */\r\nexport const setScrollPosition = (\r\n\tlayoutName: string,\r\n\tposition: ScrollPosition,\r\n) => {\r\n\tconst current = scrollPositionsSubject.getValue();\r\n\tconst prevPos = current[layoutName];\r\n\r\n\t// x, y 모두 동일하면 업데이트할 필요가 없으므로 조기 반환\r\n\tif (prevPos && prevPos.x === position.x && prevPos.y === position.y) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t// 변경사항이 있으면 새 객체를 만들어 넘김\r\n\tconst newPositions = {\r\n\t\t...current,\r\n\t\t[layoutName]: position,\r\n\t};\r\n\r\n\tupdateScrollStore(scrollPositionsSubject, newPositions);\r\n};\r\n\r\n/**\r\n * 스크롤 위치 구독\r\n */\r\nexport const getScrollPosition = (layoutName: string) => {\r\n\treturn scrollPositionsSubject.pipe(\r\n\t\t// 해당 layoutName이 정의되지 않았을 때는 제외\r\n\t\tfilter((e) => e[layoutName] !== undefined),\r\n\t\tmap((positions) => positions[layoutName]),\r\n\t\tdistinctUntilChanged(\r\n\t\t\t(prev, curr) => prev?.x === curr?.x && prev?.y === curr?.y,\r\n\t\t),\r\n\t);\r\n};\r\n\r\nexport const removeScrollPosition = (layoutName: string) => {\r\n\tconst current = scrollPositionsSubject.getValue();\r\n\tdelete current[layoutName];\r\n\r\n\t// 꼭 삭제 후에도 이전 상태와 달라졌는지 확인\r\n\tconst newPositions = { ...current };\r\n\tupdateScrollStore(scrollPositionsSubject, newPositions);\r\n};\r\n\r\nexport type SplitScreenComponents = {\r\n\tafterDropTargetComponent: DropTargetComponent[];\r\n\tbeforeDropTargetComponent: DropTargetComponent[];\r\n\tcenterDropTargetComponent: DropTargetComponent[];\r\n\tdirection: \"row\" | \"column\";\r\n};\r\n\r\nexport type LayoutSplitScreenState = Record<\r\n\tstring,\r\n\tRecord<string, SplitScreenComponents>\r\n>;\r\n\r\nexport const layoutSplitScreenStore =\r\n\tnew BehaviorSubject<LayoutSplitScreenState>({});\r\n\r\nexport const setSplitScreen = (\r\n\trootName: string,\r\n\tlayoutName: string,\r\n\tnewComponents: SplitScreenComponents,\r\n) => {\r\n\tconst current = layoutSplitScreenStore.getValue();\r\n\tconst updatedLayout = { ...(current[rootName] || {}) };\r\n\tupdatedLayout[layoutName] = newComponents;\r\n\r\n\tconst newStoreValue = {\r\n\t\t...current,\r\n\t\t[rootName]: updatedLayout,\r\n\t};\r\n\tupdateSplitScreenStore(newStoreValue);\r\n};\r\n\r\nexport const resetRootSplitScreen = (rootName: string) => {\r\n\tconst current = layoutSplitScreenStore.getValue();\r\n\t// rootName 아래만 초기화\r\n\tconst newStoreValue = {\r\n\t\t...current,\r\n\t\t[rootName]: {},\r\n\t};\r\n\tupdateSplitScreenStore(newStoreValue);\r\n};\r\n\r\nexport const removeSplitScreenChild = (\r\n\trootName: string,\r\n\tlayoutName: string,\r\n) => {\r\n\tconst current = layoutSplitScreenStore.getValue();\r\n\tif (!current[rootName]) return;\r\n\r\n\tconst updatedLayout = { ...current[rootName] };\r\n\tdelete updatedLayout[layoutName];\r\n\r\n\tconst newStoreValue = {\r\n\t\t...current,\r\n\t\t[rootName]: updatedLayout,\r\n\t};\r\n\tupdateSplitScreenStore(newStoreValue);\r\n};\r\n\r\nexport const getCurrentSplitScreenComponents = (\r\n\trootName: string,\r\n\tlayoutName: string,\r\n) => {\r\n\tconst current = layoutSplitScreenStore.getValue();\r\n\tif (!current[rootName]) return;\r\n\treturn current[rootName][layoutName];\r\n};\r\n\r\nexport const getSplitScreen = (rootName: string, layoutName: string) => {\r\n\treturn layoutSplitScreenStore.pipe(\r\n\t\tmap((splitScreen) => splitScreen[rootName][layoutName]),\r\n\t\tdistinctUntilChanged((prev, curr) => {\r\n\t\t\t// 이전 상태와 현재 상태를 비교하여 동일하면 필터링\r\n\t\t\tconst filterChildren = (obj: any) => {\r\n\t\t\t\t// 객체 복사 후 children 속성 제거\r\n\t\t\t\tconst { children, component, targetComponent, x, y, ...rest } =\r\n\t\t\t\t\tobj || {};\r\n\t\t\t\treturn rest;\r\n\t\t\t};\r\n\t\t\treturn equal(filterChildren(prev), filterChildren(curr));\r\n\t\t}),\r\n\t);\r\n};\r\n\r\n// 중첩된 객체 구조로 ref를 관리하는 타입\r\ntype RefStore = {\r\n\t[layoutName: string]: {\r\n\t\t[containerName: string]: RefObject<HTMLElement | null>;\r\n\t};\r\n};\r\n\r\n// 초기값으로 빈 객체를 설정한 BehaviorSubject 생성\r\nexport const flexContainerStore = new BehaviorSubject<RefStore>({});\r\n\r\nexport const flexResizePanelStore = new BehaviorSubject<RefStore>({});\r\n/**\r\n * ref를 업데이트하는 함수\r\n * - 기존: 무조건 next() → 새/이전 상태 비교 후 다를 경우에만 next()\r\n */\r\nexport const setContainerRef = <T extends HTMLElement>(\r\n\tlayoutName: string,\r\n\tcontainerName: string,\r\n\tref: React.RefObject<T | null> | null,\r\n) => {\r\n\tconst currentRefs = flexContainerStore.getValue();\r\n\tconst updatedLayoutRefs = { ...(currentRefs[layoutName] || {}) };\r\n\r\n\tif (ref === null) {\r\n\t\tdelete updatedLayoutRefs[containerName];\r\n\t} else {\r\n\t\tupdatedLayoutRefs[containerName] = ref;\r\n\t}\r\n\r\n\tconst newRefs: RefStore = {\r\n\t\t...currentRefs,\r\n\t\t[layoutName]: updatedLayoutRefs,\r\n\t};\r\n\r\n\tupdateRefStore(flexContainerStore, newRefs);\r\n};\r\n\r\nexport const setResizePanelRef = <T extends HTMLElement>(\r\n\tlayoutName: string,\r\n\tcontainerName: string,\r\n\tref: React.RefObject<T | null> | null,\r\n) => {\r\n\tconst currentRefs = flexResizePanelStore.getValue();\r\n\tconst updatedLayoutRefs = { ...(currentRefs[layoutName] || {}) };\r\n\r\n\tif (ref === null) {\r\n\t\tdelete updatedLayoutRefs[containerName];\r\n\t} else {\r\n\t\tupdatedLayoutRefs[containerName] = ref;\r\n\t}\r\n\r\n\tconst newRefs: RefStore = {\r\n\t\t...currentRefs,\r\n\t\t[layoutName]: updatedLayoutRefs,\r\n\t};\r\n\r\n\tupdateRefStore(flexResizePanelStore, newRefs);\r\n};\r\n\r\nexport const getLayoutInfos = (layoutName: string) => {\r\n\treturn combineLatest([flexContainerStore, flexResizePanelStore]).pipe(\r\n\t\tmap(([containerRefs, resizePanelRefs]) => {\r\n\t\t\t// 두 Store에서 layoutName에 해당하는 값을 병합\r\n\t\t\tconst containerData = containerRefs[layoutName] || {};\r\n\t\t\tconst resizePanelData = resizePanelRefs[layoutName] || {};\r\n\r\n\t\t\t// container와 resizePanel 데이터 합치기\r\n\t\t\treturn {\r\n\t\t\t\tcontainer: containerData,\r\n\t\t\t\tresizePanel: resizePanelData,\r\n\t\t\t};\r\n\t\t}),\r\n\t\tfilter((result) => result.container !== null), // 빈 객체 제외\r\n\t);\r\n};\r\n\r\n// 특정 containerName의 ref를 구독하는 함수\r\n// layoutName이 지정되지 않으면 전체 layout에서 해당하는 containerName의 ref를 찾음\r\nexport const getContainerRef = ({\r\n\tcontainerName,\r\n\tlayoutName,\r\n}: {\r\n\tcontainerName: string;\r\n\tlayoutName?: string;\r\n}) => {\r\n\treturn flexContainerStore.pipe(\r\n\t\tmap((refs: RefStore) => {\r\n\t\t\tif (layoutName) {\r\n\t\t\t\t// 지정된 layoutName에서 해당 containerName의 ref 반환\r\n\t\t\t\treturn refs[layoutName]?.[containerName] || null;\r\n\t\t\t} else {\r\n\t\t\t\t// 모든 layout에서 해당 containerName의 ref 찾기\r\n\t\t\t\treturn Object.entries(refs).find(\r\n\t\t\t\t\t([key, value]) => refs[key][containerName],\r\n\t\t\t\t)?.[1][containerName];\r\n\t\t\t}\r\n\t\t\t// else {\r\n\t\t\t// // 모든 layout에서 해당 containerName의 ref 찾기\r\n\t\t\t// for (const layout in refs) {\r\n\t\t\t// if (refs[layout][containerName]) {\r\n\t\t\t// return refs[layout][containerName];\r\n\t\t\t// }\r\n\t\t\t// }\r\n\t\t\t// return null;\r\n\t\t\t// }\r\n\t\t}),\r\n\t\tfilter((ref) => ref !== null),\r\n\t);\r\n};\r\n\r\nexport const getResizePanelRef = ({\r\n\tcontainerName,\r\n\tlayoutName,\r\n}: {\r\n\tcontainerName: string;\r\n\tlayoutName?: string;\r\n}) => {\r\n\treturn flexResizePanelStore.pipe(\r\n\t\tmap((refs: RefStore) => {\r\n\t\t\tif (layoutName) {\r\n\t\t\t\t// 지정된 layoutName에서 해당 containerName의 ref 반환\r\n\t\t\t\treturn refs[layoutName]?.[containerName] || null;\r\n\t\t\t} else {\r\n\t\t\t\t// 모든 layout에서 해당 containerName의 ref 찾기\r\n\t\t\t\treturn Object.entries(refs).find(\r\n\t\t\t\t\t([key, value]) => refs[key][containerName],\r\n\t\t\t\t)?.[1][containerName];\r\n\t\t\t}\r\n\t\t\t// else {\r\n\t\t\t// // 모든 layout에서 해당 containerName의 ref 찾기\r\n\t\t\t// for (const layout in refs) {\r\n\t\t\t// if (refs[layout][containerName]) {\r\n\t\t\t// return refs[layout][containerName];\r\n\t\t\t// }\r\n\t\t\t// }\r\n\t\t\t// return null;\r\n\t\t\t// }\r\n\t\t}),\r\n\t\tfilter((ref) => ref !== null),\r\n\t);\r\n};\r\n","export function isDocumentOut({ x, y }: { x: number; y: number }) {\r\n if (typeof window == 'undefined') return;\r\n const { innerWidth, innerHeight, scrollX, scrollY } = window;\r\n\r\n return (\r\n x < 0 || y < 0 || x > innerWidth + scrollX || y > innerHeight + scrollY\r\n );\r\n}\r\n\r\nlet lastTouchEvent: globalThis.TouchEvent;\r\nexport function getClientXy(event: Event) {\r\n let clientX: number;\r\n let clientY: number;\r\n if (window.MouseEvent && event instanceof window.MouseEvent) {\r\n clientX = event.clientX;\r\n clientY = event.clientY;\r\n } else if (window.TouchEvent && event instanceof window.TouchEvent) {\r\n const _event = event.touches.length == 0 ? lastTouchEvent : event;\r\n clientX = _event!.touches[0].clientX;\r\n clientY = _event!.touches[0].clientY;\r\n lastTouchEvent = event;\r\n } else {\r\n return; // 해당 이벤트 타입이 MouseEvent나 TouchEvent가 아니라면 무시\r\n }\r\n return { clientX, clientY };\r\n}\r\n\r\nexport function isOverMove(elementSize: number, elementMinSize: number) {\r\n return (\r\n Math.floor(elementSize) <= 0 ||\r\n (isNaN(elementMinSize)\r\n ? false\r\n : elementMinSize >= Math.floor(elementSize))\r\n );\r\n}\r\n\r\nexport function findNotCloseFlexContent(\r\n target: HTMLElement | Element | null,\r\n direction: 'previousElementSibling' | 'nextElementSibling'\r\n) {\r\n if (!target) return target;\r\n let _target = target as HTMLElement;\r\n const isCloseCheck = () => {\r\n let grow =\r\n parseFloat(window.getComputedStyle(_target).flex.split(' ')[0]) ||\r\n 0;\r\n if (grow == 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n };\r\n while (isCloseCheck()) {\r\n let nextTarget = _target[direction]?.[direction];\r\n _target = nextTarget as HTMLElement;\r\n if (!_target) {\r\n break;\r\n }\r\n }\r\n return _target as HTMLElement | HTMLDivElement | null;\r\n}\r\n\r\nexport function remain(flexContainerList: Array<HTMLElement>) {\r\n return new Promise(resolve => {\r\n let notGrowList: Array<HTMLElement> = [];\r\n let totalGrow = flexContainerList.reduce((t, e, i) => {\r\n if (e.hasAttribute('data-grow') == false) {\r\n notGrowList.push(e);\r\n return t;\r\n }\r\n let grow = parseFloat(e.dataset.grow || '');\r\n e.style.flex = `${grow} 1 0%`;\r\n t -= grow;\r\n return t;\r\n }, flexContainerList.length);\r\n\r\n if (notGrowList.length != 0) {\r\n resize(notGrowList, totalGrow);\r\n }\r\n\r\n resolve(flexContainerList);\r\n });\r\n}\r\n\r\nexport function resize(list: Array<HTMLElement>, totalGrow: number) {\r\n return new Promise(resolve => {\r\n // totalGrow 값을 리스트의 개수로 나누어 균등 할당\r\n let resizeWeight = totalGrow / list.length;\r\n list.forEach(e => {\r\n e.dataset.grow = resizeWeight.toString();\r\n e.style.flex = `${resizeWeight} 1 0%`;\r\n });\r\n resolve(resizeWeight);\r\n });\r\n}\r\n\r\nexport function mathWeight(totalCount: number, totalGrow: number) {\r\n return 1 + (totalGrow - totalCount) / totalCount;\r\n}\r\nexport function mathGrow(\r\n childSize: number,\r\n parentSize: number,\r\n containerCount: number\r\n) {\r\n return containerCount * (childSize / parentSize);\r\n}\r\n\r\nexport function getGrow(growTarget: HTMLElement | Element) {\r\n const target =\r\n growTarget instanceof Element\r\n ? (growTarget as HTMLElement)\r\n : growTarget;\r\n return (\r\n parseFloat(target.style.flex.split(' ')[0]) ||\r\n parseFloat(target.dataset.grow || '')\r\n );\r\n}\r\n\r\nexport function closeFlex(\r\n resizeTarget: HTMLElement,\r\n containers: HTMLElement[],\r\n {\r\n isResize = false,\r\n isDsiabledResizePanel = false,\r\n sizeName,\r\n }: {\r\n isResize?: boolean;\r\n isDsiabledResizePanel?: boolean;\r\n sizeName: 'width' | 'height';\r\n }\r\n) {\r\n return new Promise(resolve => {\r\n if (!resizeTarget.hasAttribute('data-is_resize_panel')) {\r\n // resolve(resizeTarget);\r\n // return;\r\n } else if (isDsiabledResizePanel) {\r\n resizeTarget.dataset.is_resize_panel = 'false';\r\n }\r\n\r\n resizeTarget.dataset.prev_grow = getGrow(resizeTarget).toString();\r\n\r\n let notCloseList = containers.filter(\r\n e => e.style.flex != '0 1 0%' && e != resizeTarget\r\n );\r\n let notCloseAndOpenTargetList = [...notCloseList, resizeTarget];\r\n //let resizeWeight = this.mathWeight(notCloseList, this.#forResizeList.length);\r\n notCloseAndOpenTargetList.forEach(e => {\r\n e.style.transition = 'flex 0.5s';\r\n e.ontransitionend = event => {\r\n if (event.propertyName != 'flex-grow') {\r\n return;\r\n }\r\n notCloseAndOpenTargetList.forEach(\r\n e => (e.style.transition = '')\r\n );\r\n //e.style.transition = '';\r\n e.ontransitionend = () => {};\r\n };\r\n\r\n if (e == resizeTarget) {\r\n e.dataset.grow = '0';\r\n e.style.flex = `0 1 0%`;\r\n return;\r\n }\r\n\r\n if (isResize) {\r\n return;\r\n }\r\n\r\n let percent = getGrow(e) / containers.length;\r\n //let percentWeight = this.#forResizeList.length * percent;\r\n //let remainWeight = resizeWeight * percent;\r\n if (notCloseList.length == 1) {\r\n e.dataset.grow = containers.length.toString();\r\n e.style.flex = `${containers.length} 1 0%`;\r\n return;\r\n }\r\n e.dataset.grow = (containers.length * percent).toString();\r\n e.style.flex = `${containers.length * percent} 1 0%`;\r\n });\r\n\r\n if (isResize) {\r\n resize(notCloseList, containers.length);\r\n }\r\n\r\n resolve(resizeTarget);\r\n });\r\n}\r\n\r\nexport function openFlex(\r\n resizeTarget: HTMLElement,\r\n containers: HTMLElement[],\r\n {\r\n isPrevSizeOpen = false,\r\n isResize = false,\r\n openGrowImportant = 0,\r\n sizeName,\r\n }: {\r\n isPrevSizeOpen?: boolean;\r\n isResize?: boolean;\r\n openGrowImportant?: number;\r\n sizeName?: 'width' | 'height'; // 유니언 타입으로 수정\r\n }\r\n) {\r\n return new Promise(resolve => {\r\n if (!resizeTarget.hasAttribute('data-is_resize_panel')) {\r\n // resolve(resizeTarget);\r\n // return;\r\n } else if (\r\n resizeTarget.hasAttribute('data-is_resize_panel') &&\r\n resizeTarget.dataset.is_resize_panel == 'false'\r\n ) {\r\n resizeTarget.dataset.is_resize_panel = 'true';\r\n }\r\n\r\n let notCloseList = containers.filter(\r\n e => e.style.flex != '0 1 0%' && e != resizeTarget\r\n );\r\n let notCloseAndOpenTargetList = [...notCloseList, resizeTarget];\r\n //let resizeWeight = this.mathWeight(notCloseAndOpenTargetList, this.#forResizeList.length);\r\n let openTargetGrow = 1;\r\n const sizeStyleName = ('client' +\r\n sizeName!.charAt(0).toUpperCase() +\r\n sizeName!.substring(1)) as 'clientHeight' | 'clientWidth';\r\n const parentSize =\r\n (sizeName &&\r\n resizeTarget.parentElement &&\r\n resizeTarget.parentElement[sizeStyleName]) ||\r\n 0;\r\n if (isPrevSizeOpen && resizeTarget.hasAttribute('data-prev_grow')) {\r\n openTargetGrow =\r\n parseFloat(resizeTarget.dataset.prev_grow || '1') || 1;\r\n //resizeTarget.removeAttribute('data-prev_grow');\r\n } else if (parentSize && parentSize !== 0) {\r\n openTargetGrow =\r\n (parentSize / notCloseList.length / (parentSize - 1)) *\r\n containers.length;\r\n } else {\r\n openTargetGrow = 1;\r\n }\r\n if (openGrowImportant) {\r\n openTargetGrow = openGrowImportant;\r\n }\r\n openTargetGrow = openTargetGrow === Infinity ? 1 : openTargetGrow;\r\n //notCloseList.forEach(e=>{\r\n notCloseAndOpenTargetList.forEach(e => {\r\n e.style.transition = 'flex 0.5s';\r\n e.ontransitionend = event => {\r\n if (event.propertyName != 'flex-grow') {\r\n return;\r\n }\r\n notCloseAndOpenTargetList.forEach(\r\n e => (e.style.transition = '')\r\n );\r\n //e.style.transition = '';\r\n e.ontransitionend = () => {};\r\n };\r\n\r\n if (e == resizeTarget) {\r\n resizeTarget.dataset.grow = openTargetGrow.toString();\r\n resizeTarget.style.flex = `${openTargetGrow} 1 0%`;\r\n return;\r\n }\r\n\r\n if (isResize) {\r\n return;\r\n }\r\n\r\n let grow =\r\n (parentSize / notCloseList.length / (parentSize - 1)) *\r\n (containers.length - openTargetGrow);\r\n grow = grow === Infinity ? 1 : grow;\r\n //let percent = getGrow(e) / totalGrow - openTargetGrow / totalGrow;\r\n e.dataset.grow = grow.toString();\r\n\r\n e.style.flex = `${grow} 1 0%`;\r\n });\r\n\r\n if (isResize) {\r\n resize(notCloseAndOpenTargetList, containers.length);\r\n }\r\n\r\n resolve(openTargetGrow);\r\n });\r\n}\r\n","\"use client\";\r\n\r\nimport { useEffect, useState } from \"react\";\r\nimport {\r\n\tflexContainerStore,\r\n\tgetLayoutInfos,\r\n\tgetResizePanelRef,\r\n} from \"../store/FlexLayoutContainerStore\";\r\nimport {\r\n\tcloseFlex,\r\n\tgetGrow,\r\n\tmathGrow,\r\n\topenFlex,\r\n} from \"../utils/FlexLayoutUtils\";\r\n\r\nimport {\r\n\tbuffer,\r\n\tdebounceTime,\r\n\tEMPTY,\r\n\tfilter,\r\n\tfromEvent,\r\n\tmap,\r\n\tSubject,\r\n\tswitchMap,\r\n} from \"rxjs\";\r\nconst g = globalThis as any;\r\ng.__FLEX_SUBJECTS__ ??= { openClose: {}, spread: {} };\r\n\r\nexport type SubjectMap<T> = Record<string, Subject<T>>;\r\n\r\n// 컨테이너 상태 타입 정의\r\ninterface ContainerStateRequest {\r\n\tmode: \"toggle\" | \"open\" | \"close\";\r\n\tinitOpenState?: boolean;\r\n\tonOpen?: () => void;\r\n\tonClose?: () => void;\r\n\topenOption?: {\r\n\t\tisPrevSizeOpen?: boolean;\r\n\t\tisResize?: boolean;\r\n\t\topenGrowImportant?: number;\r\n\t};\r\n\tcloseOption?: { isResize?: boolean; isDsiabledResizePanel?: boolean };\r\n}\r\n\r\ninterface ContainerState {\r\n\tisOpen: boolean;\r\n\ttargetContainer: HTMLElement;\r\n\tgrow: number;\r\n}\r\nexport const containerOpenCloseSubjectMap: SubjectMap<ContainerStateRequest> =\r\n\tg.__FLEX_SUBJECTS__.openClose;\r\nexport const containerSpreadSubjectMap: SubjectMap<ContainerState> =\r\n\tg.__FLEX_SUBJECTS__.spread;\r\n\r\n// export const containerOpenCloseSubjectMap: SubjectMap<ContainerStateRequest> = (\r\n// Object.keys({}) as Array<string>\r\n// ).reduce((total, key) => {\r\n// total[key] = new Subject<ContainerStateRequest>();\r\n// return total;\r\n// }, {} as SubjectMap<ContainerStateRequest>);\r\n\r\n// export const containerSpreadSubjectMap: SubjectMap<ContainerState> = (\r\n// Object.keys({}) as Array<string>\r\n// ).reduce((total, key) => {\r\n// total[key] = new Subject<ContainerState>();\r\n// return total;\r\n// }, {} as SubjectMap<ContainerState>);\r\n\r\nexport const ContainerOpenCloseProvider = ({\r\n\tlayoutName,\r\n\tcontainerName,\r\n\tsizeName,\r\n}: {\r\n\tlayoutName: string;\r\n\tcontainerName: string;\r\n\tsizeName: \"width\" | \"height\";\r\n}) => {\r\n\t// SubjectMap에 중복 체크 후 Subject 추가\r\n\tif (!containerOpenCloseSubjectMap[containerName]) {\r\n\t\tcontainerOpenCloseSubjectMap[containerName] =\r\n\t\t\tnew Subject<ContainerStateRequest>();\r\n\t}\r\n\tif (!containerSpreadSubjectMap[containerName]) {\r\n\t\tcontainerSpreadSubjectMap[containerName] =\r\n\t\t\tnew Subject<ContainerState>();\r\n\t}\r\n\r\n\tconst [containers, setContainers] = useState<HTMLElement[]>([]);\r\n\tconst [container, setContainer] = useState<HTMLElement>();\r\n\r\n\tuseEffect(() => {\r\n\t\t// 특정 layoutName과 containerName을 통해 ref를 구독\r\n\t\tconst subscription = getLayoutInfos(layoutName as string).subscribe(\r\n\t\t\t(layout) => {\r\n\t\t\t\tif (\r\n\t\t\t\t\t!layout ||\r\n\t\t\t\t\t!layout.container[containerName] ||\r\n\t\t\t\t\t!layout.container[containerName].current\r\n\t\t\t\t)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tsetContainers(\r\n\t\t\t\t\tObject.values(layout.container)\r\n\t\t\t\t\t\t.filter(\r\n\t\t\t\t\t\t\t(e): e is { current: HTMLElement } =>\r\n\t\t\t\t\t\t\t\te.current !== null,\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t\t.map((e) => e.current),\r\n\t\t\t\t);\r\n\t\t\t\tsetContainer(layout.container[containerName].current);\r\n\t\t\t},\r\n\t\t);\r\n\r\n\t\t// 구독 해제\r\n\t\treturn () => subscription.unsubscribe();\r\n\t}, [containerName, layoutName]);\r\n\tuseEffect(() => {\r\n\t\tconst styleName = `${sizeName.charAt(0).toUpperCase() + sizeName.substring(1)}`;\r\n\t\tconst clientSize = (\"client\" + styleName) as\r\n\t\t\t| \"clientWidth\"\r\n\t\t\t| \"clientHeight\";\r\n\t\tconst outerSize = (\"outer\" + styleName) as \"outerWidth\" | \"outerHeight\";\r\n\t\tconst maxSize = (\"max\" + styleName) as \"maxWidth\" | \"maxHeight\";\r\n\t\tconst subscribe = containerOpenCloseSubjectMap[containerName].subscribe(\r\n\t\t\t({\r\n\t\t\t\tmode,\r\n\t\t\t\tinitOpenState: isOpenState,\r\n\t\t\t\tonClose,\r\n\t\t\t\tonOpen,\r\n\t\t\t\topenOption = {},\r\n\t\t\t\tcloseOption = {},\r\n\t\t\t}) => {\r\n\t\t\t\tif (!container || containers.length === 0) return;\r\n\t\t\t\tconst currentGrow = getGrow(container);\r\n\t\t\t\tconst styleMap = window.getComputedStyle(container);\r\n\t\t\t\tconst maxSizeGrow = mathGrow(\r\n\t\t\t\t\tparseInt(styleMap[maxSize]),\r\n\t\t\t\t\t(container.parentElement &&\r\n\t\t\t\t\t\tcontainer.parentElement[clientSize]) ||\r\n\t\t\t\t\t\twindow[outerSize],\r\n\t\t\t\t\tcontainers.length,\r\n\t\t\t\t);\r\n\t\t\t\tconst open = () =>\r\n\t\t\t\t\topenFlex(container, containers, {\r\n\t\t\t\t\t\tsizeName,\r\n\t\t\t\t\t\t...(isNaN(maxSizeGrow)\r\n\t\t\t\t\t\t\t? {}\r\n\t\t\t\t\t\t\t: {\r\n\t\t\t\t\t\t\t\t\topenGrowImportant: maxSizeGrow,\r\n\t\t\t\t\t\t\t\t}),\r\n\t\t\t\t\t\t...openOption,\r\n\t\t\t\t\t}).then((openTargetGrow) => {\r\n\t\t\t\t\t\tif (onOpen) onOpen();\r\n\t\t\t\t\t\tcontainerSpreadSubjectMap[containerName].next({\r\n\t\t\t\t\t\t\tisOpen: true,\r\n\t\t\t\t\t\t\tgrow: openTargetGrow as any,\r\n\t\t\t\t\t\t\ttargetContainer: container,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\tconst close = () =>\r\n\t\t\t\t\tcloseFlex(container, containers, {\r\n\t\t\t\t\t\tsizeName,\r\n\t\t\t\t\t\t...closeOption,\r\n\t\t\t\t\t}).then(() => {\r\n\t\t\t\t\t\tif (onClose) onClose();\r\n\t\t\t\t\t\tcontainerSpreadSubjectMap[containerName].next({\r\n\t\t\t\t\t\t\tisOpen: false,\r\n\t\t\t\t\t\t\tgrow: 0,\r\n\t\t\t\t\t\t\ttargetContainer: container,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\tif (mode === \"toggle\") {\r\n\t\t\t\t\tif (currentGrow === 0) {\r\n\t\t\t\t\t\topen();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tclose();\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (mode === \"open\") {\r\n\t\t\t\t\tif (currentGrow === 0) {\r\n\t\t\t\t\t\topen();\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (mode === \"close\") {\r\n\t\t\t\t\tif (currentGrow !== 0) {\r\n\t\t\t\t\t\tclose();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t);\r\n\r\n\t\treturn () => {\r\n\t\t\tsubscribe.unsubscribe();\r\n\t\t};\r\n\t}, [containerName, container, containers, sizeName]);\r\n\r\n\treturn null;\r\n};\r\n\r\nexport const useContainers = (layoutName: string) => {\r\n\tconst [containers, setContainers] = useState<HTMLElement[]>([]);\r\n\r\n\tuseEffect(() => {\r\n\t\t// 특정 layoutName과 containerName을 통해 ref를 구독\r\n\t\tconst subscription = getLayoutInfos(layoutName as string).subscribe(\r\n\t\t\t(layout) => {\r\n\t\t\t\tsetContainers(\r\n\t\t\t\t\tObject.values(layout.container)\r\n\t\t\t\t\t\t.filter(\r\n\t\t\t\t\t\t\t(e): e is { current: HTMLElement } =>\r\n\t\t\t\t\t\t\t\te.current !== null,\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t\t.map((e) => e.current),\r\n\t\t\t\t);\r\n\t\t\t},\r\n\t\t);\r\n\r\n\t\t// 구독 해제\r\n\t\treturn () => subscription.unsubscribe();\r\n\t}, [layoutName]);\r\n\treturn containers;\r\n};\r\n\r\nexport const useLayoutName = (containerName: string) => {\r\n\tconst [layoutName, setLayoutName] = useState<string>();\r\n\tuseEffect(() => {\r\n\t\tconst subscribe = flexContainerStore\r\n\t\t\t.pipe(\r\n\t\t\t\tmap(\r\n\t\t\t\t\t(layouts) =>\r\n\t\t\t\t\t\tObject.entries(layouts)\r\n\t\t\t\t\t\t\t.filter(([_, v]) => v[containerName])\r\n\t\t\t\t\t\t\t.map(([k]) => k)[0] as string, // 첫 번째 결과 가져오기\r\n\t\t\t\t),\r\n\t\t\t)\r\n\t\t\t.subscribe(setLayoutName);\r\n\r\n\t\t// 컴포넌트 언마운트 시 구독 해제\r\n\t\treturn () => subscribe.unsubscribe();\r\n\t}, [containerName]);\r\n\r\n\treturn layoutName;\r\n};\r\n\r\nexport const useDecompositionLayout = ({\r\n\tlayoutName: initialLayoutName,\r\n\tcontainerName,\r\n}: {\r\n\tlayoutName?: string;\r\n\tcontainerName: string;\r\n}) => {\r\n\tconst derivedLayoutName = useLayoutName(containerName);\r\n\tconst finalLayoutName = initialLayoutName || derivedLayoutName;\r\n\r\n\tconst [containers, setContainers] = useState<HTMLElement[]>([]);\r\n\tconst [container, setContainer] = useState<HTMLElement>();\r\n\tconst [resizePanel, setResizePanel] = useState<HTMLElement>();\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!finalLayoutName) return; // layoutName이 준비될 때까지 대기\r\n\t\t// 특정 layoutName과 containerName을 통해 ref를 구독\r\n\t\tconst subscription = getLayoutInfos(finalLayoutName).subscribe(\r\n\t\t\t(layout) => {\r\n\t\t\t\tif (!layout) return;\r\n\t\t\t\tsetContainers(\r\n\t\t\t\t\tObject.values(layout.container)\r\n\t\t\t\t\t\t.filter(\r\n\t\t\t\t\t\t\t(e): e is { current: HTMLElement } =>\r\n\t\t\t\t\t\t\t\te.current !== null,\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t\t.map((e) => e.current),\r\n\t\t\t\t);\r\n\t\t\t\tif (\r\n\t\t\t\t\tcontainerName &&\r\n\t\t\t\t\tlayout.container[containerName] &&\r\n\t\t\t\t\tlayout.container[containerName].current\r\n\t\t\t\t) {\r\n\t\t\t\t\tsetContainer(layout.container[containerName].current);\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\tlayout.resizePanel[containerName] &&\r\n\t\t\t\t\t\tlayout.resizePanel[containerName].current\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tsetResizePanel(\r\n\t\t\t\t\t\t\tlayout.resizePanel[containerName].current,\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t);\r\n\r\n\t\t// 구독 해제\r\n\t\treturn () => subscription.unsubscribe();\r\n\t}, [containerName, finalLayoutName]);\r\n\r\n\treturn { layout: containers, container, resizePanel };\r\n};\r\n\r\nexport const useContainerSize = (containerName: string) => {\r\n\tconst { layout, container, resizePanel } = useDecompositionLayout({\r\n\t\tcontainerName,\r\n\t});\r\n\tconst [size, setSize] = useState<{ width: number; height: number }>();\r\n\tuseEffect(() => {\r\n\t\tif (!container) return;\r\n\t\tconst observer = new ResizeObserver((entries) => {\r\n\t\t\tfor (const entry of entries) {\r\n\t\t\t\tsetSize({\r\n\t\t\t\t\twidth: entry.contentRect.width,\r\n\t\t\t\t\theight: entry.contentRect.height,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\tobserver.observe(container);\r\n\t\treturn () => observer.disconnect();\r\n\t}, [container]);\r\n\treturn { size };\r\n};\r\n\r\nexport const useDoubleClick = (\r\n\tcontainerName: string,\r\n\topt: ContainerStateRequest,\r\n) => {\r\n\tconst [isOpen, setIsOpen] = useState<boolean>();\r\n\tconst [isDoubleClick, setIsDoubleClick] = useState<boolean>();\r\n\tuseEffect(() => {\r\n\t\tconst resizePanelClickEvent = getResizePanelRef({\r\n\t\t\tcontainerName,\r\n\t\t}).pipe(\r\n\t\t\tfilter(\r\n\t\t\t\t(resizePanelref) =>\r\n\t\t\t\t\tresizePanelref != undefined &&\r\n\t\t\t\t\tresizePanelref.current != undefined,\r\n\t\t\t),\r\n\t\t\t//take(1),\r\n\t\t\tswitchMap((resizePanelref) => {\r\n\t\t\t\tif (!resizePanelref || !resizePanelref.current) return EMPTY;\r\n\t\t\t\treturn fromEvent(resizePanelref.current, \"click\");\r\n\t\t\t}),\r\n\t\t);\r\n\t\tconst subscribe = resizePanelClickEvent\r\n\t\t\t.pipe(\r\n\t\t\t\tbuffer(resizePanelClickEvent.pipe(debounceTime(500))),\r\n\t\t\t\tfilter((clickEventArray) => clickEventArray.length >= 2),\r\n\t\t\t\tmap((events) => {\r\n\t\t\t\t\tcontainerOpenCloseSubjectMap[containerName].next({\r\n\t\t\t\t\t\t...opt,\r\n\t\t\t\t\t\topenOption: {\r\n\t\t\t\t\t\t\t...opt.openOption,\r\n\t\t\t\t\t\t\tisPrevSizeOpen: false,\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tonClose: () => {\r\n\t\t\t\t\t\t\tif (opt.onClose) opt.onClose();\r\n\t\t\t\t\t\t\tsetIsOpen(false);\r\n\t\t\t\t\t\t\tsetIsDoubleClick(true);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tonOpen: () => {\r\n\t\t\t\t\t\t\tif (opt.onOpen) opt.onOpen();\r\n\t\t\t\t\t\t\tsetIsOpen(true);\r\n\t\t\t\t\t\t\tsetIsDoubleClick(true);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t});\r\n\t\t\t\t}),\r\n\t\t\t)\r\n\t\t\t.subscribe();\r\n\t\treturn () => {\r\n\t\t\tsubscribe.unsubscribe();\r\n\t\t};\r\n\t}, [containerName]);\r\n\treturn { isOpen, isDoubleClick, setIsDoubleClick };\r\n};\r\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Subject } from 'rxjs';
|
|
3
|
+
|
|
4
|
+
type SubjectMap<T> = Record<string, Subject<T>>;
|
|
5
|
+
interface ContainerStateRequest {
|
|
6
|
+
mode: "toggle" | "open" | "close";
|
|
7
|
+
initOpenState?: boolean;
|
|
8
|
+
onOpen?: () => void;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
openOption?: {
|
|
11
|
+
isPrevSizeOpen?: boolean;
|
|
12
|
+
isResize?: boolean;
|
|
13
|
+
openGrowImportant?: number;
|
|
14
|
+
};
|
|
15
|
+
closeOption?: {
|
|
16
|
+
isResize?: boolean;
|
|
17
|
+
isDsiabledResizePanel?: boolean;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
interface ContainerState {
|
|
21
|
+
isOpen: boolean;
|
|
22
|
+
targetContainer: HTMLElement;
|
|
23
|
+
grow: number;
|
|
24
|
+
}
|
|
25
|
+
declare const containerOpenCloseSubjectMap: SubjectMap<ContainerStateRequest>;
|
|
26
|
+
declare const containerSpreadSubjectMap: SubjectMap<ContainerState>;
|
|
27
|
+
declare const ContainerOpenCloseProvider: ({ layoutName, containerName, sizeName, }: {
|
|
28
|
+
layoutName: string;
|
|
29
|
+
containerName: string;
|
|
30
|
+
sizeName: "width" | "height";
|
|
31
|
+
}) => null;
|
|
32
|
+
declare const useContainers: (layoutName: string) => HTMLElement[];
|
|
33
|
+
declare const useLayoutName: (containerName: string) => string | undefined;
|
|
34
|
+
declare const useDecompositionLayout: ({ layoutName: initialLayoutName, containerName, }: {
|
|
35
|
+
layoutName?: string;
|
|
36
|
+
containerName: string;
|
|
37
|
+
}) => {
|
|
38
|
+
layout: HTMLElement[];
|
|
39
|
+
container: HTMLElement | undefined;
|
|
40
|
+
resizePanel: HTMLElement | undefined;
|
|
41
|
+
};
|
|
42
|
+
declare const useContainerSize: (containerName: string) => {
|
|
43
|
+
size: {
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
} | undefined;
|
|
47
|
+
};
|
|
48
|
+
declare const useDoubleClick: (containerName: string, opt: ContainerStateRequest) => {
|
|
49
|
+
isOpen: boolean | undefined;
|
|
50
|
+
isDoubleClick: boolean | undefined;
|
|
51
|
+
setIsDoubleClick: React.Dispatch<React.SetStateAction<boolean | undefined>>;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { ContainerOpenCloseProvider, type SubjectMap, containerOpenCloseSubjectMap, containerSpreadSubjectMap, useContainerSize, useContainers, useDecompositionLayout, useDoubleClick, useLayoutName };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Subject } from 'rxjs';
|
|
3
|
+
|
|
4
|
+
type SubjectMap<T> = Record<string, Subject<T>>;
|
|
5
|
+
interface ContainerStateRequest {
|
|
6
|
+
mode: "toggle" | "open" | "close";
|
|
7
|
+
initOpenState?: boolean;
|
|
8
|
+
onOpen?: () => void;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
openOption?: {
|
|
11
|
+
isPrevSizeOpen?: boolean;
|
|
12
|
+
isResize?: boolean;
|
|
13
|
+
openGrowImportant?: number;
|
|
14
|
+
};
|
|
15
|
+
closeOption?: {
|
|
16
|
+
isResize?: boolean;
|
|
17
|
+
isDsiabledResizePanel?: boolean;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
interface ContainerState {
|
|
21
|
+
isOpen: boolean;
|
|
22
|
+
targetContainer: HTMLElement;
|
|
23
|
+
grow: number;
|
|
24
|
+
}
|
|
25
|
+
declare const containerOpenCloseSubjectMap: SubjectMap<ContainerStateRequest>;
|
|
26
|
+
declare const containerSpreadSubjectMap: SubjectMap<ContainerState>;
|
|
27
|
+
declare const ContainerOpenCloseProvider: ({ layoutName, containerName, sizeName, }: {
|
|
28
|
+
layoutName: string;
|
|
29
|
+
containerName: string;
|
|
30
|
+
sizeName: "width" | "height";
|
|
31
|
+
}) => null;
|
|
32
|
+
declare const useContainers: (layoutName: string) => HTMLElement[];
|
|
33
|
+
declare const useLayoutName: (containerName: string) => string | undefined;
|
|
34
|
+
declare const useDecompositionLayout: ({ layoutName: initialLayoutName, containerName, }: {
|
|
35
|
+
layoutName?: string;
|
|
36
|
+
containerName: string;
|
|
37
|
+
}) => {
|
|
38
|
+
layout: HTMLElement[];
|
|
39
|
+
container: HTMLElement | undefined;
|
|
40
|
+
resizePanel: HTMLElement | undefined;
|
|
41
|
+
};
|
|
42
|
+
declare const useContainerSize: (containerName: string) => {
|
|
43
|
+
size: {
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
} | undefined;
|
|
47
|
+
};
|
|
48
|
+
declare const useDoubleClick: (containerName: string, opt: ContainerStateRequest) => {
|
|
49
|
+
isOpen: boolean | undefined;
|
|
50
|
+
isDoubleClick: boolean | undefined;
|
|
51
|
+
setIsDoubleClick: React.Dispatch<React.SetStateAction<boolean | undefined>>;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { ContainerOpenCloseProvider, type SubjectMap, containerOpenCloseSubjectMap, containerSpreadSubjectMap, useContainerSize, useContainers, useDecompositionLayout, useDoubleClick, useLayoutName };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import './chunk-3EDKZTM3.js';
|
|
2
|
+
export { ContainerOpenCloseProvider, containerOpenCloseSubjectMap, containerSpreadSubjectMap, useContainerSize, useContainers, useDecompositionLayout, useDoubleClick, useLayoutName } from './chunk-JM3CZ5DU.js';
|
|
3
|
+
import './chunk-W4CNFJTK.js';
|
|
4
|
+
import './chunk-CFQQ6ZDC.js';
|
|
5
|
+
//# sourceMappingURL=providers.js.map
|
|
6
|
+
//# sourceMappingURL=providers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"providers.js"}
|