@byeolnaerim/flex-layout 0.0.2 → 0.0.3
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/index.cjs +2600 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +209 -78
- package/dist/index.d.ts +209 -78
- package/dist/index.js +2594 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,74 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import * as React$1 from 'react';
|
|
2
|
-
import { HTMLAttributes, MouseEvent, TouchEvent, CSSProperties,
|
|
3
|
+
import React__default, { ReactElement, ReactNode, HTMLAttributes, MouseEvent, TouchEvent, CSSProperties, RefObject, MutableRefObject } from 'react';
|
|
3
4
|
import * as rxjs from 'rxjs';
|
|
4
|
-
import {
|
|
5
|
+
import { BehaviorSubject, Subject } from 'rxjs';
|
|
6
|
+
|
|
7
|
+
type ResizePanelMode =
|
|
8
|
+
| 'default'
|
|
9
|
+
| 'bottom-cylinder'
|
|
10
|
+
| 'bottom-cylinder-reverse'
|
|
11
|
+
| 'top-cylinder'
|
|
12
|
+
| 'left-cylinder'
|
|
13
|
+
| 'right-cylinder';
|
|
14
|
+
|
|
15
|
+
type Direction = 'row' | 'column';
|
|
16
|
+
type PanelMovementMode = 'bulldozer' | 'divorce' | 'stalker';
|
|
17
|
+
type FitContent = 'width' | 'height';
|
|
18
|
+
|
|
19
|
+
interface FlexLayoutChildrenType {
|
|
20
|
+
isInitialResizable?: boolean;
|
|
21
|
+
grow?: number;
|
|
22
|
+
prevGrow?: number;
|
|
23
|
+
panelMode?: ResizePanelMode;
|
|
24
|
+
isFitContent?: boolean;
|
|
25
|
+
isFitResize?: boolean;
|
|
26
|
+
isResizePanel?: boolean;
|
|
27
|
+
containerName: string;
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface FlexContainerProps extends FlexLayoutChildrenType {
|
|
33
|
+
readonly fitContent?: FitContent;
|
|
34
|
+
readonly containerCount?: number;
|
|
35
|
+
readonly layoutName?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface FlexLayoutProps
|
|
39
|
+
extends Omit<
|
|
40
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
41
|
+
'children',
|
|
42
|
+
'id',
|
|
43
|
+
'panelClassName'
|
|
44
|
+
> {
|
|
45
|
+
direction: Direction;
|
|
46
|
+
children:
|
|
47
|
+
| ReactElement<FlexLayoutChildrenType>[]
|
|
48
|
+
| ReactElement<FlexLayoutChildrenType>;
|
|
49
|
+
layoutName: string;
|
|
50
|
+
isSplitScreen?: boolean;
|
|
51
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
52
|
+
className?: string;
|
|
53
|
+
panelClassName?: string;
|
|
54
|
+
panelMovementMode?: PanelMovementMode;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
type FlexLayoutResizePanelProps = {
|
|
58
|
+
direction: string;
|
|
59
|
+
containerCount: number;
|
|
60
|
+
panelMode?: ResizePanelMode;
|
|
61
|
+
containerName: string;
|
|
62
|
+
layoutName: string;
|
|
63
|
+
panelMovementMode: PanelMovementMode;
|
|
64
|
+
panelClassName?: string;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
declare const FlexLayout: ({ layoutName, direction, children, ref, className, panelClassName, panelMovementMode, ...props }: FlexLayoutProps) => react_jsx_runtime.JSX.Element | null;
|
|
68
|
+
|
|
69
|
+
declare const FlexLayoutContainer: ({ isFitContent, isFitResize, containerName, grow: initialGrow, prevGrow: initialPrevGrow, isInitialResizable, isResizePanel, children, className, panelMode, }: FlexContainerProps) => react_jsx_runtime.JSX.Element;
|
|
70
|
+
|
|
71
|
+
declare const FlexLayoutResizePanel: ({ direction, containerCount, panelMode, containerName, layoutName, panelClassName, panelMovementMode, }: FlexLayoutResizePanelProps) => react_jsx_runtime.JSX.Element;
|
|
5
72
|
|
|
6
73
|
interface FlexLayoutSplitScreenDragBoxProps<E extends HTMLElement = HTMLElement> extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
7
74
|
onMouseDown?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
@@ -28,6 +95,7 @@ interface DropDocumentOutsideOption {
|
|
|
28
95
|
heightRatio?: number;
|
|
29
96
|
isNewTap?: boolean;
|
|
30
97
|
}
|
|
98
|
+
declare function FlexLayoutSplitScreenDragBox<E extends HTMLElement>({ onMouseDown, onTouchStart, dropEndCallback, style, navigationTitle, targetComponent, containerName, children, className, dropDocumentOutsideOption, screenKey, isBlockingActiveInput, customData, scrollTargetRef, ...props }: FlexLayoutSplitScreenDragBoxProps): react_jsx_runtime.JSX.Element;
|
|
31
99
|
|
|
32
100
|
type FlexLayoutSplitScreenProps = {
|
|
33
101
|
layoutName: string;
|
|
@@ -37,6 +105,10 @@ type FlexLayoutSplitScreenProps = {
|
|
|
37
105
|
dropDocumentOutsideOption?: DropDocumentOutsideOption;
|
|
38
106
|
screenKey?: string;
|
|
39
107
|
};
|
|
108
|
+
declare function FlexLayoutSplitScreen({ children, containerName, layoutName, navigationTitle, dropDocumentOutsideOption, screenKey, }: FlexLayoutSplitScreenProps): react_jsx_runtime.JSX.Element;
|
|
109
|
+
declare namespace FlexLayoutSplitScreen {
|
|
110
|
+
var displayName: string;
|
|
111
|
+
}
|
|
40
112
|
|
|
41
113
|
interface FlexLayoutSplitScreenScrollBoxProps extends HTMLAttributes<HTMLDivElement> {
|
|
42
114
|
keyName: string;
|
|
@@ -44,56 +116,35 @@ interface FlexLayoutSplitScreenScrollBoxProps extends HTMLAttributes<HTMLDivElem
|
|
|
44
116
|
direction?: "x" | "y";
|
|
45
117
|
isDefaultScrollStyle?: boolean;
|
|
46
118
|
}
|
|
119
|
+
declare const _default: React$1.MemoExoticComponent<({ className, children, keyName, direction, isDefaultScrollStyle, ...props }: FlexLayoutSplitScreenScrollBoxProps) => react_jsx_runtime.JSX.Element>;
|
|
47
120
|
|
|
48
|
-
type
|
|
49
|
-
interface
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
isDsiabledResizePanel?: boolean;
|
|
62
|
-
};
|
|
121
|
+
type Edge = 'auto' | 'top' | 'bottom' | 'left' | 'right';
|
|
122
|
+
interface FlexLayoutStickyBoxProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
123
|
+
/** 어느 방향으로 붙일지. 기본은 'auto' (세로 스크롤이면 top, 가로 스크롤이면 left) */
|
|
124
|
+
edge?: Edge;
|
|
125
|
+
/** 화면 모서리와의 여백(px). 기본 16 */
|
|
126
|
+
offset?: number;
|
|
127
|
+
/** 스크롤 루트. 명시 안 하면 가장 흔한 케이스인 <main> → 없으면 window(=viewport) */
|
|
128
|
+
scrollRoot?: Element | null;
|
|
129
|
+
/** 디버그 보조선 표시 */
|
|
130
|
+
debug?: boolean;
|
|
131
|
+
/** 자식 */
|
|
132
|
+
children: React__default.ReactNode;
|
|
133
|
+
onTranslateChange?: (value: number, rootRef: React__default.RefObject<HTMLDivElement | null>, contentRef: React__default.RefObject<HTMLDivElement | null>) => void;
|
|
63
134
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
declare const
|
|
77
|
-
declare const useLayoutName: (containerName: string) => string | undefined;
|
|
78
|
-
declare const useDecompositionLayout: ({ layoutName: initialLayoutName, containerName, }: {
|
|
79
|
-
layoutName?: string;
|
|
80
|
-
containerName: string;
|
|
81
|
-
}) => {
|
|
82
|
-
layout: HTMLElement[];
|
|
83
|
-
container: HTMLElement | undefined;
|
|
84
|
-
resizePanel: HTMLElement | undefined;
|
|
85
|
-
};
|
|
86
|
-
declare const useContainerSize: (containerName: string) => {
|
|
87
|
-
size: {
|
|
88
|
-
width: number;
|
|
89
|
-
height: number;
|
|
90
|
-
} | undefined;
|
|
91
|
-
};
|
|
92
|
-
declare const useDoubleClick: (containerName: string, opt: ContainerStateRequest) => {
|
|
93
|
-
isOpen: boolean | undefined;
|
|
94
|
-
isDoubleClick: boolean | undefined;
|
|
95
|
-
setIsDoubleClick: React$1.Dispatch<React$1.SetStateAction<boolean | undefined>>;
|
|
96
|
-
};
|
|
135
|
+
/**
|
|
136
|
+
* FlexLayoutStickyBox
|
|
137
|
+
* 부모(실제 경계) 안에서만 움직이며, `transform`을 동적으로 부여해
|
|
138
|
+
* “sticky처럼 보이도록” 만든다.
|
|
139
|
+
*
|
|
140
|
+
* 구조:
|
|
141
|
+
* <div data-root> // 이 박스가 부모 경계 안에서 공간을 차지
|
|
142
|
+
* <div data-content> // 이 박스가 transform으로 부드럽게 움직임
|
|
143
|
+
* {children}
|
|
144
|
+
* </div>
|
|
145
|
+
* </div>
|
|
146
|
+
*/
|
|
147
|
+
declare const FlexLayoutStickyBox: React__default.FC<FlexLayoutStickyBoxProps>;
|
|
97
148
|
|
|
98
149
|
interface DragStateType {
|
|
99
150
|
isDragging: boolean;
|
|
@@ -198,6 +249,113 @@ declare const useFolderEvent: () => {
|
|
|
198
249
|
folderEvent: FolderEventType | null;
|
|
199
250
|
};
|
|
200
251
|
|
|
252
|
+
type OnReachTerminalType = {
|
|
253
|
+
isFirst: boolean;
|
|
254
|
+
isLast: boolean;
|
|
255
|
+
observer: IntersectionObserver;
|
|
256
|
+
};
|
|
257
|
+
interface UseListPagingForInfinityProps {
|
|
258
|
+
onReachTerminal?: (onReachTerminalData: OnReachTerminalType) => void;
|
|
259
|
+
}
|
|
260
|
+
declare const useListPagingForSentinel: <E extends HTMLElement>({ onReachTerminal, }: UseListPagingForInfinityProps) => {
|
|
261
|
+
firstChildRef: (node: E | null) => void;
|
|
262
|
+
lastChildRef: (node: E | null) => void;
|
|
263
|
+
};
|
|
264
|
+
declare const usePaginationViewNumber: ({ initPageNumber, }: {
|
|
265
|
+
initPageNumber: number;
|
|
266
|
+
}) => {
|
|
267
|
+
showCurrentPageNumber: number;
|
|
268
|
+
showCurrentPageObserveTarget: (node: HTMLElement | null) => void;
|
|
269
|
+
};
|
|
270
|
+
declare const usePagingHandler: <T>({ lastCallPageNumber, dataListRef, }: {
|
|
271
|
+
lastCallPageNumber: number;
|
|
272
|
+
dataListRef: MutableRefObject<Array<T[] | null>>;
|
|
273
|
+
}) => {
|
|
274
|
+
jumpingPageNumberRef: MutableRefObject<number | null>;
|
|
275
|
+
paginationScrollIntoViewTarget: MutableRefObject<Record<number, HTMLDivElement | null>>;
|
|
276
|
+
pageNumberRef: MutableRefObject<number>;
|
|
277
|
+
setPaginationRef: (i: number) => (node: HTMLDivElement | null) => void;
|
|
278
|
+
handleReachTerminal: ({ isFirst, isLast, observer }: OnReachTerminalType, dataCallFetch: (callPageNumber: number) => void) => void;
|
|
279
|
+
handleClickPageChange: (page: number, dataCallFetch: (callPageNumber: number) => void) => void;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
type SubjectMap<T> = Record<string, Subject<T>>;
|
|
283
|
+
interface ContainerStateRequest {
|
|
284
|
+
mode: "toggle" | "open" | "close";
|
|
285
|
+
initOpenState?: boolean;
|
|
286
|
+
onOpen?: () => void;
|
|
287
|
+
onClose?: () => void;
|
|
288
|
+
openOption?: {
|
|
289
|
+
isPrevSizeOpen?: boolean;
|
|
290
|
+
isResize?: boolean;
|
|
291
|
+
openGrowImportant?: number;
|
|
292
|
+
};
|
|
293
|
+
closeOption?: {
|
|
294
|
+
isResize?: boolean;
|
|
295
|
+
isDsiabledResizePanel?: boolean;
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
interface ContainerState {
|
|
299
|
+
isOpen: boolean;
|
|
300
|
+
targetContainer: HTMLElement;
|
|
301
|
+
grow: number;
|
|
302
|
+
}
|
|
303
|
+
declare const containerOpenCloseSubjectMap: SubjectMap<ContainerStateRequest>;
|
|
304
|
+
declare const containerSpreadSubjectMap: SubjectMap<ContainerState>;
|
|
305
|
+
declare const ContainerOpenCloseProvider: ({ layoutName, containerName, sizeName, }: {
|
|
306
|
+
layoutName: string;
|
|
307
|
+
containerName: string;
|
|
308
|
+
sizeName: "width" | "height";
|
|
309
|
+
}) => null;
|
|
310
|
+
declare const useContainers: (layoutName: string) => HTMLElement[];
|
|
311
|
+
declare const useLayoutName: (containerName: string) => string | undefined;
|
|
312
|
+
declare const useDecompositionLayout: ({ layoutName: initialLayoutName, containerName, }: {
|
|
313
|
+
layoutName?: string;
|
|
314
|
+
containerName: string;
|
|
315
|
+
}) => {
|
|
316
|
+
layout: HTMLElement[];
|
|
317
|
+
container: HTMLElement | undefined;
|
|
318
|
+
resizePanel: HTMLElement | undefined;
|
|
319
|
+
};
|
|
320
|
+
declare const useContainerSize: (containerName: string) => {
|
|
321
|
+
size: {
|
|
322
|
+
width: number;
|
|
323
|
+
height: number;
|
|
324
|
+
} | undefined;
|
|
325
|
+
};
|
|
326
|
+
declare const useDoubleClick: (containerName: string, opt: ContainerStateRequest) => {
|
|
327
|
+
isOpen: boolean | undefined;
|
|
328
|
+
isDoubleClick: boolean | undefined;
|
|
329
|
+
setIsDoubleClick: React$1.Dispatch<React$1.SetStateAction<boolean | undefined>>;
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
declare function isDocumentOut({ x, y }: {
|
|
333
|
+
x: number;
|
|
334
|
+
y: number;
|
|
335
|
+
}): boolean | undefined;
|
|
336
|
+
declare function getClientXy(event: Event): {
|
|
337
|
+
clientX: number;
|
|
338
|
+
clientY: number;
|
|
339
|
+
} | undefined;
|
|
340
|
+
declare function isOverMove(elementSize: number, elementMinSize: number): boolean;
|
|
341
|
+
declare function findNotCloseFlexContent(target: HTMLElement | Element | null, direction: 'previousElementSibling' | 'nextElementSibling'): HTMLElement | null;
|
|
342
|
+
declare function remain(flexContainerList: Array<HTMLElement>): Promise<unknown>;
|
|
343
|
+
declare function resize(list: Array<HTMLElement>, totalGrow: number): Promise<unknown>;
|
|
344
|
+
declare function mathWeight(totalCount: number, totalGrow: number): number;
|
|
345
|
+
declare function mathGrow(childSize: number, parentSize: number, containerCount: number): number;
|
|
346
|
+
declare function getGrow(growTarget: HTMLElement | Element): number;
|
|
347
|
+
declare function closeFlex(resizeTarget: HTMLElement, containers: HTMLElement[], { isResize, isDsiabledResizePanel, sizeName, }: {
|
|
348
|
+
isResize?: boolean;
|
|
349
|
+
isDsiabledResizePanel?: boolean;
|
|
350
|
+
sizeName: 'width' | 'height';
|
|
351
|
+
}): Promise<unknown>;
|
|
352
|
+
declare function openFlex(resizeTarget: HTMLElement, containers: HTMLElement[], { isPrevSizeOpen, isResize, openGrowImportant, sizeName, }: {
|
|
353
|
+
isPrevSizeOpen?: boolean;
|
|
354
|
+
isResize?: boolean;
|
|
355
|
+
openGrowImportant?: number;
|
|
356
|
+
sizeName?: 'width' | 'height';
|
|
357
|
+
}): Promise<unknown>;
|
|
358
|
+
|
|
201
359
|
interface ScrollPosition {
|
|
202
360
|
x: number;
|
|
203
361
|
y: number;
|
|
@@ -257,31 +415,4 @@ declare const getResizePanelRef: ({ containerName, layoutName, }: {
|
|
|
257
415
|
layoutName?: string;
|
|
258
416
|
}) => rxjs.Observable<RefObject<HTMLElement | null> | undefined>;
|
|
259
417
|
|
|
260
|
-
|
|
261
|
-
x: number;
|
|
262
|
-
y: number;
|
|
263
|
-
}): boolean | undefined;
|
|
264
|
-
declare function getClientXy(event: Event): {
|
|
265
|
-
clientX: number;
|
|
266
|
-
clientY: number;
|
|
267
|
-
} | undefined;
|
|
268
|
-
declare function isOverMove(elementSize: number, elementMinSize: number): boolean;
|
|
269
|
-
declare function findNotCloseFlexContent(target: HTMLElement | Element | null, direction: 'previousElementSibling' | 'nextElementSibling'): HTMLElement | null;
|
|
270
|
-
declare function remain(flexContainerList: Array<HTMLElement>): Promise<unknown>;
|
|
271
|
-
declare function resize(list: Array<HTMLElement>, totalGrow: number): Promise<unknown>;
|
|
272
|
-
declare function mathWeight(totalCount: number, totalGrow: number): number;
|
|
273
|
-
declare function mathGrow(childSize: number, parentSize: number, containerCount: number): number;
|
|
274
|
-
declare function getGrow(growTarget: HTMLElement | Element): number;
|
|
275
|
-
declare function closeFlex(resizeTarget: HTMLElement, containers: HTMLElement[], { isResize, isDsiabledResizePanel, sizeName, }: {
|
|
276
|
-
isResize?: boolean;
|
|
277
|
-
isDsiabledResizePanel?: boolean;
|
|
278
|
-
sizeName: 'width' | 'height';
|
|
279
|
-
}): Promise<unknown>;
|
|
280
|
-
declare function openFlex(resizeTarget: HTMLElement, containers: HTMLElement[], { isPrevSizeOpen, isResize, openGrowImportant, sizeName, }: {
|
|
281
|
-
isPrevSizeOpen?: boolean;
|
|
282
|
-
isResize?: boolean;
|
|
283
|
-
openGrowImportant?: number;
|
|
284
|
-
sizeName?: 'width' | 'height';
|
|
285
|
-
}): Promise<unknown>;
|
|
286
|
-
|
|
287
|
-
export { ContainerOpenCloseProvider, type DragStateResultType, type DragStateType, type DropDocumentOutsideOption, type DropMovementEventType, type DropPositionOrderName, type DropTargetComponent, type DropTargetComponentEvent, type FlexLayoutSplitScreenDragBoxProps, type FlexLayoutSplitScreenProps, type FlexLayoutSplitScreenScrollBoxProps, type FolderEventType, type LayoutSplitScreenState, type PositionName, type ScrollPosition, type SplitScreenComponents, type SubjectMap, allSplitScreenCount, closeFlex, containerOpenCloseSubjectMap, containerSpreadSubjectMap, dragState, dropMovementEventSubject, findNotCloseFlexContent, flexContainerStore, flexResizePanelStore, folderEventSubject, getClientXy, getContainerRef, getCurrentSplitScreenComponents, getGrow, getLayoutInfos, getResizePanelRef, getScrollPosition, getSplitScreen, isDocumentOut, isOverMove, layoutSplitScreenStore, mathGrow, mathWeight, openFlex, remain, removeScrollPosition, removeSplitScreenChild, resetRootSplitScreen, resize, scrollPositions, setContainerRef, setFolderEvent, setResizePanelRef, setScrollPosition, setSplitScreen, useContainerSize, useContainers, useDecompositionLayout, useDoubleClick, useDragCapture, useDragEvents, useFolderEvent, useLayoutName };
|
|
418
|
+
export { ContainerOpenCloseProvider, type DragStateResultType, type DragStateType, type DropMovementEventType, type DropPositionOrderName, type DropTargetComponent, type DropTargetComponentEvent, FlexLayout, FlexLayoutContainer, FlexLayoutResizePanel, FlexLayoutSplitScreen, FlexLayoutSplitScreenDragBox, _default as FlexLayoutSplitScreenScrollBox, FlexLayoutStickyBox, type FolderEventType, type LayoutSplitScreenState, type OnReachTerminalType, type PositionName, type ScrollPosition, type SplitScreenComponents, type SubjectMap, allSplitScreenCount, closeFlex, containerOpenCloseSubjectMap, containerSpreadSubjectMap, dragState, dropMovementEventSubject, findNotCloseFlexContent, flexContainerStore, flexResizePanelStore, folderEventSubject, getClientXy, getContainerRef, getCurrentSplitScreenComponents, getGrow, getLayoutInfos, getResizePanelRef, getScrollPosition, getSplitScreen, isDocumentOut, isOverMove, layoutSplitScreenStore, mathGrow, mathWeight, openFlex, remain, removeScrollPosition, removeSplitScreenChild, resetRootSplitScreen, resize, scrollPositions, setContainerRef, setFolderEvent, setResizePanelRef, setScrollPosition, setSplitScreen, useContainerSize, useContainers, useDecompositionLayout, useDoubleClick, useDragCapture, useDragEvents, useFolderEvent, useLayoutName, useListPagingForSentinel, usePaginationViewNumber, usePagingHandler };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,74 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import * as React$1 from 'react';
|
|
2
|
-
import { HTMLAttributes, MouseEvent, TouchEvent, CSSProperties,
|
|
3
|
+
import React__default, { ReactElement, ReactNode, HTMLAttributes, MouseEvent, TouchEvent, CSSProperties, RefObject, MutableRefObject } from 'react';
|
|
3
4
|
import * as rxjs from 'rxjs';
|
|
4
|
-
import {
|
|
5
|
+
import { BehaviorSubject, Subject } from 'rxjs';
|
|
6
|
+
|
|
7
|
+
type ResizePanelMode =
|
|
8
|
+
| 'default'
|
|
9
|
+
| 'bottom-cylinder'
|
|
10
|
+
| 'bottom-cylinder-reverse'
|
|
11
|
+
| 'top-cylinder'
|
|
12
|
+
| 'left-cylinder'
|
|
13
|
+
| 'right-cylinder';
|
|
14
|
+
|
|
15
|
+
type Direction = 'row' | 'column';
|
|
16
|
+
type PanelMovementMode = 'bulldozer' | 'divorce' | 'stalker';
|
|
17
|
+
type FitContent = 'width' | 'height';
|
|
18
|
+
|
|
19
|
+
interface FlexLayoutChildrenType {
|
|
20
|
+
isInitialResizable?: boolean;
|
|
21
|
+
grow?: number;
|
|
22
|
+
prevGrow?: number;
|
|
23
|
+
panelMode?: ResizePanelMode;
|
|
24
|
+
isFitContent?: boolean;
|
|
25
|
+
isFitResize?: boolean;
|
|
26
|
+
isResizePanel?: boolean;
|
|
27
|
+
containerName: string;
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface FlexContainerProps extends FlexLayoutChildrenType {
|
|
33
|
+
readonly fitContent?: FitContent;
|
|
34
|
+
readonly containerCount?: number;
|
|
35
|
+
readonly layoutName?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface FlexLayoutProps
|
|
39
|
+
extends Omit<
|
|
40
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
41
|
+
'children',
|
|
42
|
+
'id',
|
|
43
|
+
'panelClassName'
|
|
44
|
+
> {
|
|
45
|
+
direction: Direction;
|
|
46
|
+
children:
|
|
47
|
+
| ReactElement<FlexLayoutChildrenType>[]
|
|
48
|
+
| ReactElement<FlexLayoutChildrenType>;
|
|
49
|
+
layoutName: string;
|
|
50
|
+
isSplitScreen?: boolean;
|
|
51
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
52
|
+
className?: string;
|
|
53
|
+
panelClassName?: string;
|
|
54
|
+
panelMovementMode?: PanelMovementMode;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
type FlexLayoutResizePanelProps = {
|
|
58
|
+
direction: string;
|
|
59
|
+
containerCount: number;
|
|
60
|
+
panelMode?: ResizePanelMode;
|
|
61
|
+
containerName: string;
|
|
62
|
+
layoutName: string;
|
|
63
|
+
panelMovementMode: PanelMovementMode;
|
|
64
|
+
panelClassName?: string;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
declare const FlexLayout: ({ layoutName, direction, children, ref, className, panelClassName, panelMovementMode, ...props }: FlexLayoutProps) => react_jsx_runtime.JSX.Element | null;
|
|
68
|
+
|
|
69
|
+
declare const FlexLayoutContainer: ({ isFitContent, isFitResize, containerName, grow: initialGrow, prevGrow: initialPrevGrow, isInitialResizable, isResizePanel, children, className, panelMode, }: FlexContainerProps) => react_jsx_runtime.JSX.Element;
|
|
70
|
+
|
|
71
|
+
declare const FlexLayoutResizePanel: ({ direction, containerCount, panelMode, containerName, layoutName, panelClassName, panelMovementMode, }: FlexLayoutResizePanelProps) => react_jsx_runtime.JSX.Element;
|
|
5
72
|
|
|
6
73
|
interface FlexLayoutSplitScreenDragBoxProps<E extends HTMLElement = HTMLElement> extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
7
74
|
onMouseDown?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
@@ -28,6 +95,7 @@ interface DropDocumentOutsideOption {
|
|
|
28
95
|
heightRatio?: number;
|
|
29
96
|
isNewTap?: boolean;
|
|
30
97
|
}
|
|
98
|
+
declare function FlexLayoutSplitScreenDragBox<E extends HTMLElement>({ onMouseDown, onTouchStart, dropEndCallback, style, navigationTitle, targetComponent, containerName, children, className, dropDocumentOutsideOption, screenKey, isBlockingActiveInput, customData, scrollTargetRef, ...props }: FlexLayoutSplitScreenDragBoxProps): react_jsx_runtime.JSX.Element;
|
|
31
99
|
|
|
32
100
|
type FlexLayoutSplitScreenProps = {
|
|
33
101
|
layoutName: string;
|
|
@@ -37,6 +105,10 @@ type FlexLayoutSplitScreenProps = {
|
|
|
37
105
|
dropDocumentOutsideOption?: DropDocumentOutsideOption;
|
|
38
106
|
screenKey?: string;
|
|
39
107
|
};
|
|
108
|
+
declare function FlexLayoutSplitScreen({ children, containerName, layoutName, navigationTitle, dropDocumentOutsideOption, screenKey, }: FlexLayoutSplitScreenProps): react_jsx_runtime.JSX.Element;
|
|
109
|
+
declare namespace FlexLayoutSplitScreen {
|
|
110
|
+
var displayName: string;
|
|
111
|
+
}
|
|
40
112
|
|
|
41
113
|
interface FlexLayoutSplitScreenScrollBoxProps extends HTMLAttributes<HTMLDivElement> {
|
|
42
114
|
keyName: string;
|
|
@@ -44,56 +116,35 @@ interface FlexLayoutSplitScreenScrollBoxProps extends HTMLAttributes<HTMLDivElem
|
|
|
44
116
|
direction?: "x" | "y";
|
|
45
117
|
isDefaultScrollStyle?: boolean;
|
|
46
118
|
}
|
|
119
|
+
declare const _default: React$1.MemoExoticComponent<({ className, children, keyName, direction, isDefaultScrollStyle, ...props }: FlexLayoutSplitScreenScrollBoxProps) => react_jsx_runtime.JSX.Element>;
|
|
47
120
|
|
|
48
|
-
type
|
|
49
|
-
interface
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
isDsiabledResizePanel?: boolean;
|
|
62
|
-
};
|
|
121
|
+
type Edge = 'auto' | 'top' | 'bottom' | 'left' | 'right';
|
|
122
|
+
interface FlexLayoutStickyBoxProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
123
|
+
/** 어느 방향으로 붙일지. 기본은 'auto' (세로 스크롤이면 top, 가로 스크롤이면 left) */
|
|
124
|
+
edge?: Edge;
|
|
125
|
+
/** 화면 모서리와의 여백(px). 기본 16 */
|
|
126
|
+
offset?: number;
|
|
127
|
+
/** 스크롤 루트. 명시 안 하면 가장 흔한 케이스인 <main> → 없으면 window(=viewport) */
|
|
128
|
+
scrollRoot?: Element | null;
|
|
129
|
+
/** 디버그 보조선 표시 */
|
|
130
|
+
debug?: boolean;
|
|
131
|
+
/** 자식 */
|
|
132
|
+
children: React__default.ReactNode;
|
|
133
|
+
onTranslateChange?: (value: number, rootRef: React__default.RefObject<HTMLDivElement | null>, contentRef: React__default.RefObject<HTMLDivElement | null>) => void;
|
|
63
134
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
declare const
|
|
77
|
-
declare const useLayoutName: (containerName: string) => string | undefined;
|
|
78
|
-
declare const useDecompositionLayout: ({ layoutName: initialLayoutName, containerName, }: {
|
|
79
|
-
layoutName?: string;
|
|
80
|
-
containerName: string;
|
|
81
|
-
}) => {
|
|
82
|
-
layout: HTMLElement[];
|
|
83
|
-
container: HTMLElement | undefined;
|
|
84
|
-
resizePanel: HTMLElement | undefined;
|
|
85
|
-
};
|
|
86
|
-
declare const useContainerSize: (containerName: string) => {
|
|
87
|
-
size: {
|
|
88
|
-
width: number;
|
|
89
|
-
height: number;
|
|
90
|
-
} | undefined;
|
|
91
|
-
};
|
|
92
|
-
declare const useDoubleClick: (containerName: string, opt: ContainerStateRequest) => {
|
|
93
|
-
isOpen: boolean | undefined;
|
|
94
|
-
isDoubleClick: boolean | undefined;
|
|
95
|
-
setIsDoubleClick: React$1.Dispatch<React$1.SetStateAction<boolean | undefined>>;
|
|
96
|
-
};
|
|
135
|
+
/**
|
|
136
|
+
* FlexLayoutStickyBox
|
|
137
|
+
* 부모(실제 경계) 안에서만 움직이며, `transform`을 동적으로 부여해
|
|
138
|
+
* “sticky처럼 보이도록” 만든다.
|
|
139
|
+
*
|
|
140
|
+
* 구조:
|
|
141
|
+
* <div data-root> // 이 박스가 부모 경계 안에서 공간을 차지
|
|
142
|
+
* <div data-content> // 이 박스가 transform으로 부드럽게 움직임
|
|
143
|
+
* {children}
|
|
144
|
+
* </div>
|
|
145
|
+
* </div>
|
|
146
|
+
*/
|
|
147
|
+
declare const FlexLayoutStickyBox: React__default.FC<FlexLayoutStickyBoxProps>;
|
|
97
148
|
|
|
98
149
|
interface DragStateType {
|
|
99
150
|
isDragging: boolean;
|
|
@@ -198,6 +249,113 @@ declare const useFolderEvent: () => {
|
|
|
198
249
|
folderEvent: FolderEventType | null;
|
|
199
250
|
};
|
|
200
251
|
|
|
252
|
+
type OnReachTerminalType = {
|
|
253
|
+
isFirst: boolean;
|
|
254
|
+
isLast: boolean;
|
|
255
|
+
observer: IntersectionObserver;
|
|
256
|
+
};
|
|
257
|
+
interface UseListPagingForInfinityProps {
|
|
258
|
+
onReachTerminal?: (onReachTerminalData: OnReachTerminalType) => void;
|
|
259
|
+
}
|
|
260
|
+
declare const useListPagingForSentinel: <E extends HTMLElement>({ onReachTerminal, }: UseListPagingForInfinityProps) => {
|
|
261
|
+
firstChildRef: (node: E | null) => void;
|
|
262
|
+
lastChildRef: (node: E | null) => void;
|
|
263
|
+
};
|
|
264
|
+
declare const usePaginationViewNumber: ({ initPageNumber, }: {
|
|
265
|
+
initPageNumber: number;
|
|
266
|
+
}) => {
|
|
267
|
+
showCurrentPageNumber: number;
|
|
268
|
+
showCurrentPageObserveTarget: (node: HTMLElement | null) => void;
|
|
269
|
+
};
|
|
270
|
+
declare const usePagingHandler: <T>({ lastCallPageNumber, dataListRef, }: {
|
|
271
|
+
lastCallPageNumber: number;
|
|
272
|
+
dataListRef: MutableRefObject<Array<T[] | null>>;
|
|
273
|
+
}) => {
|
|
274
|
+
jumpingPageNumberRef: MutableRefObject<number | null>;
|
|
275
|
+
paginationScrollIntoViewTarget: MutableRefObject<Record<number, HTMLDivElement | null>>;
|
|
276
|
+
pageNumberRef: MutableRefObject<number>;
|
|
277
|
+
setPaginationRef: (i: number) => (node: HTMLDivElement | null) => void;
|
|
278
|
+
handleReachTerminal: ({ isFirst, isLast, observer }: OnReachTerminalType, dataCallFetch: (callPageNumber: number) => void) => void;
|
|
279
|
+
handleClickPageChange: (page: number, dataCallFetch: (callPageNumber: number) => void) => void;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
type SubjectMap<T> = Record<string, Subject<T>>;
|
|
283
|
+
interface ContainerStateRequest {
|
|
284
|
+
mode: "toggle" | "open" | "close";
|
|
285
|
+
initOpenState?: boolean;
|
|
286
|
+
onOpen?: () => void;
|
|
287
|
+
onClose?: () => void;
|
|
288
|
+
openOption?: {
|
|
289
|
+
isPrevSizeOpen?: boolean;
|
|
290
|
+
isResize?: boolean;
|
|
291
|
+
openGrowImportant?: number;
|
|
292
|
+
};
|
|
293
|
+
closeOption?: {
|
|
294
|
+
isResize?: boolean;
|
|
295
|
+
isDsiabledResizePanel?: boolean;
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
interface ContainerState {
|
|
299
|
+
isOpen: boolean;
|
|
300
|
+
targetContainer: HTMLElement;
|
|
301
|
+
grow: number;
|
|
302
|
+
}
|
|
303
|
+
declare const containerOpenCloseSubjectMap: SubjectMap<ContainerStateRequest>;
|
|
304
|
+
declare const containerSpreadSubjectMap: SubjectMap<ContainerState>;
|
|
305
|
+
declare const ContainerOpenCloseProvider: ({ layoutName, containerName, sizeName, }: {
|
|
306
|
+
layoutName: string;
|
|
307
|
+
containerName: string;
|
|
308
|
+
sizeName: "width" | "height";
|
|
309
|
+
}) => null;
|
|
310
|
+
declare const useContainers: (layoutName: string) => HTMLElement[];
|
|
311
|
+
declare const useLayoutName: (containerName: string) => string | undefined;
|
|
312
|
+
declare const useDecompositionLayout: ({ layoutName: initialLayoutName, containerName, }: {
|
|
313
|
+
layoutName?: string;
|
|
314
|
+
containerName: string;
|
|
315
|
+
}) => {
|
|
316
|
+
layout: HTMLElement[];
|
|
317
|
+
container: HTMLElement | undefined;
|
|
318
|
+
resizePanel: HTMLElement | undefined;
|
|
319
|
+
};
|
|
320
|
+
declare const useContainerSize: (containerName: string) => {
|
|
321
|
+
size: {
|
|
322
|
+
width: number;
|
|
323
|
+
height: number;
|
|
324
|
+
} | undefined;
|
|
325
|
+
};
|
|
326
|
+
declare const useDoubleClick: (containerName: string, opt: ContainerStateRequest) => {
|
|
327
|
+
isOpen: boolean | undefined;
|
|
328
|
+
isDoubleClick: boolean | undefined;
|
|
329
|
+
setIsDoubleClick: React$1.Dispatch<React$1.SetStateAction<boolean | undefined>>;
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
declare function isDocumentOut({ x, y }: {
|
|
333
|
+
x: number;
|
|
334
|
+
y: number;
|
|
335
|
+
}): boolean | undefined;
|
|
336
|
+
declare function getClientXy(event: Event): {
|
|
337
|
+
clientX: number;
|
|
338
|
+
clientY: number;
|
|
339
|
+
} | undefined;
|
|
340
|
+
declare function isOverMove(elementSize: number, elementMinSize: number): boolean;
|
|
341
|
+
declare function findNotCloseFlexContent(target: HTMLElement | Element | null, direction: 'previousElementSibling' | 'nextElementSibling'): HTMLElement | null;
|
|
342
|
+
declare function remain(flexContainerList: Array<HTMLElement>): Promise<unknown>;
|
|
343
|
+
declare function resize(list: Array<HTMLElement>, totalGrow: number): Promise<unknown>;
|
|
344
|
+
declare function mathWeight(totalCount: number, totalGrow: number): number;
|
|
345
|
+
declare function mathGrow(childSize: number, parentSize: number, containerCount: number): number;
|
|
346
|
+
declare function getGrow(growTarget: HTMLElement | Element): number;
|
|
347
|
+
declare function closeFlex(resizeTarget: HTMLElement, containers: HTMLElement[], { isResize, isDsiabledResizePanel, sizeName, }: {
|
|
348
|
+
isResize?: boolean;
|
|
349
|
+
isDsiabledResizePanel?: boolean;
|
|
350
|
+
sizeName: 'width' | 'height';
|
|
351
|
+
}): Promise<unknown>;
|
|
352
|
+
declare function openFlex(resizeTarget: HTMLElement, containers: HTMLElement[], { isPrevSizeOpen, isResize, openGrowImportant, sizeName, }: {
|
|
353
|
+
isPrevSizeOpen?: boolean;
|
|
354
|
+
isResize?: boolean;
|
|
355
|
+
openGrowImportant?: number;
|
|
356
|
+
sizeName?: 'width' | 'height';
|
|
357
|
+
}): Promise<unknown>;
|
|
358
|
+
|
|
201
359
|
interface ScrollPosition {
|
|
202
360
|
x: number;
|
|
203
361
|
y: number;
|
|
@@ -257,31 +415,4 @@ declare const getResizePanelRef: ({ containerName, layoutName, }: {
|
|
|
257
415
|
layoutName?: string;
|
|
258
416
|
}) => rxjs.Observable<RefObject<HTMLElement | null> | undefined>;
|
|
259
417
|
|
|
260
|
-
|
|
261
|
-
x: number;
|
|
262
|
-
y: number;
|
|
263
|
-
}): boolean | undefined;
|
|
264
|
-
declare function getClientXy(event: Event): {
|
|
265
|
-
clientX: number;
|
|
266
|
-
clientY: number;
|
|
267
|
-
} | undefined;
|
|
268
|
-
declare function isOverMove(elementSize: number, elementMinSize: number): boolean;
|
|
269
|
-
declare function findNotCloseFlexContent(target: HTMLElement | Element | null, direction: 'previousElementSibling' | 'nextElementSibling'): HTMLElement | null;
|
|
270
|
-
declare function remain(flexContainerList: Array<HTMLElement>): Promise<unknown>;
|
|
271
|
-
declare function resize(list: Array<HTMLElement>, totalGrow: number): Promise<unknown>;
|
|
272
|
-
declare function mathWeight(totalCount: number, totalGrow: number): number;
|
|
273
|
-
declare function mathGrow(childSize: number, parentSize: number, containerCount: number): number;
|
|
274
|
-
declare function getGrow(growTarget: HTMLElement | Element): number;
|
|
275
|
-
declare function closeFlex(resizeTarget: HTMLElement, containers: HTMLElement[], { isResize, isDsiabledResizePanel, sizeName, }: {
|
|
276
|
-
isResize?: boolean;
|
|
277
|
-
isDsiabledResizePanel?: boolean;
|
|
278
|
-
sizeName: 'width' | 'height';
|
|
279
|
-
}): Promise<unknown>;
|
|
280
|
-
declare function openFlex(resizeTarget: HTMLElement, containers: HTMLElement[], { isPrevSizeOpen, isResize, openGrowImportant, sizeName, }: {
|
|
281
|
-
isPrevSizeOpen?: boolean;
|
|
282
|
-
isResize?: boolean;
|
|
283
|
-
openGrowImportant?: number;
|
|
284
|
-
sizeName?: 'width' | 'height';
|
|
285
|
-
}): Promise<unknown>;
|
|
286
|
-
|
|
287
|
-
export { ContainerOpenCloseProvider, type DragStateResultType, type DragStateType, type DropDocumentOutsideOption, type DropMovementEventType, type DropPositionOrderName, type DropTargetComponent, type DropTargetComponentEvent, type FlexLayoutSplitScreenDragBoxProps, type FlexLayoutSplitScreenProps, type FlexLayoutSplitScreenScrollBoxProps, type FolderEventType, type LayoutSplitScreenState, type PositionName, type ScrollPosition, type SplitScreenComponents, type SubjectMap, allSplitScreenCount, closeFlex, containerOpenCloseSubjectMap, containerSpreadSubjectMap, dragState, dropMovementEventSubject, findNotCloseFlexContent, flexContainerStore, flexResizePanelStore, folderEventSubject, getClientXy, getContainerRef, getCurrentSplitScreenComponents, getGrow, getLayoutInfos, getResizePanelRef, getScrollPosition, getSplitScreen, isDocumentOut, isOverMove, layoutSplitScreenStore, mathGrow, mathWeight, openFlex, remain, removeScrollPosition, removeSplitScreenChild, resetRootSplitScreen, resize, scrollPositions, setContainerRef, setFolderEvent, setResizePanelRef, setScrollPosition, setSplitScreen, useContainerSize, useContainers, useDecompositionLayout, useDoubleClick, useDragCapture, useDragEvents, useFolderEvent, useLayoutName };
|
|
418
|
+
export { ContainerOpenCloseProvider, type DragStateResultType, type DragStateType, type DropMovementEventType, type DropPositionOrderName, type DropTargetComponent, type DropTargetComponentEvent, FlexLayout, FlexLayoutContainer, FlexLayoutResizePanel, FlexLayoutSplitScreen, FlexLayoutSplitScreenDragBox, _default as FlexLayoutSplitScreenScrollBox, FlexLayoutStickyBox, type FolderEventType, type LayoutSplitScreenState, type OnReachTerminalType, type PositionName, type ScrollPosition, type SplitScreenComponents, type SubjectMap, allSplitScreenCount, closeFlex, containerOpenCloseSubjectMap, containerSpreadSubjectMap, dragState, dropMovementEventSubject, findNotCloseFlexContent, flexContainerStore, flexResizePanelStore, folderEventSubject, getClientXy, getContainerRef, getCurrentSplitScreenComponents, getGrow, getLayoutInfos, getResizePanelRef, getScrollPosition, getSplitScreen, isDocumentOut, isOverMove, layoutSplitScreenStore, mathGrow, mathWeight, openFlex, remain, removeScrollPosition, removeSplitScreenChild, resetRootSplitScreen, resize, scrollPositions, setContainerRef, setFolderEvent, setResizePanelRef, setScrollPosition, setSplitScreen, useContainerSize, useContainers, useDecompositionLayout, useDoubleClick, useDragCapture, useDragEvents, useFolderEvent, useLayoutName, useListPagingForSentinel, usePaginationViewNumber, usePagingHandler };
|