@byeolnaerim/flex-layout 0.0.5 → 0.0.6

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.
Files changed (59) hide show
  1. package/README.en.md +314 -0
  2. package/README.ko.md +312 -0
  3. package/README.md +314 -0
  4. package/dist/components.cjs +651 -657
  5. package/dist/components.cjs.map +1 -1
  6. package/dist/components.js +546 -553
  7. package/dist/components.js.map +1 -1
  8. package/dist/flex-layout/components/FlexLayout.d.ts +2 -0
  9. package/dist/flex-layout/components/FlexLayoutContainer.d.ts +2 -0
  10. package/dist/flex-layout/components/FlexLayoutResizePanel.d.ts +2 -0
  11. package/dist/flex-layout/components/FlexLayoutSplitScreen.d.ts +11 -0
  12. package/dist/flex-layout/components/FlexLayoutSplitScreenDragBox.d.ts +27 -0
  13. package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.d.ts +5 -0
  14. package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxItem.d.ts +8 -0
  15. package/dist/flex-layout/components/FlexLayoutSplitScreenDragBoxTitleMore.d.ts +3 -0
  16. package/dist/flex-layout/components/FlexLayoutSplitScreenScrollBox.d.ts +9 -0
  17. package/dist/flex-layout/components/FlexLayoutStickyBox.d.ts +29 -0
  18. package/dist/flex-layout/components/index.d.ts +7 -0
  19. package/dist/flex-layout/hooks/index.d.ts +2 -0
  20. package/dist/{useDrag-DR01Ob3s.d.ts → flex-layout/hooks/useDrag.d.ts} +19 -22
  21. package/dist/flex-layout/hooks/useFlexLayoutSplitScreen.d.ts +28 -0
  22. package/dist/{hooks.d.ts → flex-layout/hooks/useListPaging.d.ts} +6 -12
  23. package/dist/flex-layout/hooks/useSizes.d.ts +8 -0
  24. package/dist/flex-layout/index.d.ts +5 -0
  25. package/dist/flex-layout/providers/FlexLayoutContext.d.ts +8 -0
  26. package/dist/flex-layout/providers/FlexLayoutHooks.d.ts +51 -0
  27. package/dist/flex-layout/providers/index.d.ts +1 -0
  28. package/dist/flex-layout/store/FlexLayoutContainerStore.d.ts +62 -0
  29. package/dist/flex-layout/store/index.d.ts +1 -0
  30. package/dist/flex-layout/styles/FlexLayout.module.css +416 -0
  31. package/dist/flex-layout/styles/listScroll.module.css +85 -0
  32. package/dist/flex-layout/styles/shake.module.css +41 -0
  33. package/dist/flex-layout/types/FlexDirectionTypes.d.ts +6 -0
  34. package/dist/flex-layout/types/FlexLayoutTypes.d.ts +53 -0
  35. package/dist/flex-layout/utils/FlexLayoutUtils.d.ts +26 -0
  36. package/dist/flex-layout/utils/index.d.ts +1 -0
  37. package/dist/hooks.cjs.map +1 -1
  38. package/dist/hooks.js.map +1 -1
  39. package/dist/index.cjs +3454 -0
  40. package/dist/index.cjs.map +1 -1
  41. package/dist/index.css +471 -0
  42. package/dist/index.css.map +1 -0
  43. package/dist/index.d.ts +1 -2
  44. package/dist/index.js +3395 -0
  45. package/dist/index.js.map +1 -1
  46. package/package.json +18 -64
  47. package/dist/FlexLayoutSplitScreenDragBox-eCtq4kLd.d.cts +0 -31
  48. package/dist/FlexLayoutSplitScreenDragBox-eCtq4kLd.d.ts +0 -31
  49. package/dist/components.d.cts +0 -122
  50. package/dist/components.d.ts +0 -122
  51. package/dist/hooks.d.cts +0 -37
  52. package/dist/index.d.cts +0 -2
  53. package/dist/providers.d.cts +0 -54
  54. package/dist/providers.d.ts +0 -54
  55. package/dist/store.d.cts +0 -67
  56. package/dist/store.d.ts +0 -67
  57. package/dist/useDrag-CYQnhUFk.d.cts +0 -108
  58. package/dist/utils.d.cts +0 -28
  59. package/dist/utils.d.ts +0 -28
@@ -1,8 +1,7 @@
1
- import { createContext, memo, useRef, useState, useEffect, Children, isValidElement, Fragment as Fragment$1, useCallback, useContext, useLayoutEffect, cloneElement } from 'react';
1
+ import React2, { createContext, memo, useRef, useState, useEffect, Children, isValidElement, Fragment, useCallback, useContext, useLayoutEffect, cloneElement } from 'react';
2
2
  import equal from 'fast-deep-equal';
3
3
  import { BehaviorSubject, Subject, fromEvent, distinctUntilChanged as distinctUntilChanged$1, take as take$1, combineLatest, map as map$1 } from 'rxjs';
4
4
  import { throttleTime, take, filter, map, distinctUntilChanged } from 'rxjs/operators';
5
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
6
5
 
7
6
  // src/flex-layout/components/FlexLayout.tsx
8
7
  function updateScrollStore(subject, newValue) {
@@ -438,9 +437,11 @@ function FlexLayoutProvider({
438
437
  value,
439
438
  children
440
439
  }) {
441
- return /* @__PURE__ */ jsx(FlexLayoutContext.Provider, { value, children });
440
+ return /* @__PURE__ */ React.createElement(FlexLayoutContext.Provider, { value }, children);
442
441
  }
443
- var FlexLayout = ({
442
+
443
+ // src/flex-layout/components/FlexLayout.tsx
444
+ function FlexLayout({
444
445
  layoutName,
445
446
  direction,
446
447
  children,
@@ -449,10 +450,10 @@ var FlexLayout = ({
449
450
  panelClassName,
450
451
  panelMovementMode = "divorce",
451
452
  ...props
452
- }) => {
453
+ }) {
453
454
  const containerCount = Children.count(children);
454
455
  const fitContent = direction === "row" ? "width" : "height";
455
- const isFragmentElement = (node) => isValidElement(node) && node.type === Fragment$1;
456
+ const isFragmentElement = (node) => isValidElement(node) && node.type === Fragment;
456
457
  const nodes = Children.toArray(children).flatMap(
457
458
  (node) => isFragmentElement(node) ? Children.toArray(node.props.children) : [node]
458
459
  );
@@ -462,7 +463,7 @@ var FlexLayout = ({
462
463
  if (flattenedChildren.length === 0) {
463
464
  return null;
464
465
  }
465
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
466
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
466
467
  FlexLayoutProvider,
467
468
  {
468
469
  value: {
@@ -472,35 +473,31 @@ var FlexLayout = ({
472
473
  panelClassName,
473
474
  containerCount,
474
475
  fitContent
476
+ }
477
+ },
478
+ /* @__PURE__ */ React.createElement(
479
+ "div",
480
+ {
481
+ className: `${FlexLayout_default["flex-layout"]} ${className && className !== "" ? className : ""}`,
482
+ ...ref ? { ref } : {},
483
+ ...props,
484
+ "data-layout_name": layoutName,
485
+ "data-direction": direction
475
486
  },
476
- children: /* @__PURE__ */ jsx(
477
- "div",
478
- {
479
- className: `${FlexLayout_default["flex-layout"]} ${className && className !== "" ? className : ""}`,
480
- ...ref ? { ref } : {},
481
- ...props,
482
- "data-layout_name": layoutName,
483
- "data-direction": direction,
484
- children: flattenedChildren.map((child, index) => {
485
- if (!child || !isValidElement(child)) return null;
486
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [
487
- child,
488
- /* @__PURE__ */ jsx(
489
- ContainerOpenCloseProvider,
490
- {
491
- layoutName,
492
- containerName: child.props.containerName,
493
- sizeName: fitContent
494
- }
495
- )
496
- ] }, index);
497
- })
498
- }
499
- )
500
- }
501
- ) });
502
- };
503
- var FlexLayout_default2 = FlexLayout;
487
+ flattenedChildren.map((child, index) => {
488
+ if (!child || !isValidElement(child)) return null;
489
+ return /* @__PURE__ */ React.createElement(Fragment, { key: index }, child, /* @__PURE__ */ React.createElement(
490
+ ContainerOpenCloseProvider,
491
+ {
492
+ layoutName,
493
+ containerName: child.props.containerName,
494
+ sizeName: fitContent
495
+ }
496
+ ));
497
+ })
498
+ )
499
+ ));
500
+ }
504
501
  var useSize = (sizeName) => {
505
502
  const ref = useRef(null);
506
503
  const [size, setSize] = useState(void 0);
@@ -541,7 +538,7 @@ var flexDirectionModel = {
541
538
  resizeCursor: "ns-resize"
542
539
  }
543
540
  };
544
- var FlexLayoutResizePanel = ({
541
+ function FlexLayoutResizePanel({
545
542
  direction,
546
543
  containerCount,
547
544
  panelMode = "default",
@@ -549,7 +546,7 @@ var FlexLayoutResizePanel = ({
549
546
  layoutName,
550
547
  panelClassName,
551
548
  panelMovementMode
552
- }) => {
549
+ }) {
553
550
  let isResizePanelClickRef = useRef(false);
554
551
  let prevTouchEvent = null;
555
552
  let parentSizeRef = useRef(0);
@@ -628,6 +625,8 @@ var FlexLayoutResizePanel = ({
628
625
  }
629
626
  const targetFlexGrow = targetSize / (parentSizeRef.current - 1) * containerCountRef.current;
630
627
  const nextElementFlexGrow = nextElementSize / (parentSizeRef.current - 1) * containerCountRef.current;
628
+ if (!(targetElement instanceof HTMLElement)) return;
629
+ if (!(nextElement instanceof HTMLElement)) return;
631
630
  targetElement.style.flex = `${targetFlexGrow} 1 0%`;
632
631
  nextElement.style.flex = `${nextElementFlexGrow} 1 0%`;
633
632
  }
@@ -676,20 +675,21 @@ var FlexLayoutResizePanel = ({
676
675
  if (!panelRef.current) return;
677
676
  setResizePanelRef(layoutName, containerName, panelRef);
678
677
  }, [containerName, layoutName]);
679
- return /* @__PURE__ */ jsx(
678
+ return /* @__PURE__ */ React.createElement(
680
679
  "div",
681
680
  {
682
681
  id: containerName + "_resize_panel",
683
682
  className: `${FlexLayout_default["flex-resize-panel"]} ${FlexLayout_default[panelMode]} ${panelClassName && panelClassName !== "" ? panelClassName : ""}`,
684
683
  ref: panelRef,
685
684
  onMouseDown: panelMouseDownEvent,
686
- onTouchStart: panelMouseDownEvent,
687
- children: /* @__PURE__ */ jsx("div", { className: FlexLayout_default.hover })
688
- }
685
+ onTouchStart: panelMouseDownEvent
686
+ },
687
+ /* @__PURE__ */ React.createElement("div", { className: FlexLayout_default.hover })
689
688
  );
690
- };
691
- var FlexLayoutResizePanel_default = FlexLayoutResizePanel;
692
- var FlexLayoutContainer = ({
689
+ }
690
+
691
+ // src/flex-layout/components/FlexLayoutContainer.tsx
692
+ function FlexLayoutContainer({
693
693
  isFitContent,
694
694
  isFitResize,
695
695
  // fitContent,
@@ -703,7 +703,7 @@ var FlexLayoutContainer = ({
703
703
  children,
704
704
  className,
705
705
  panelMode
706
- }) => {
706
+ }) {
707
707
  const {
708
708
  direction,
709
709
  panelMovementMode,
@@ -826,46 +826,42 @@ var FlexLayoutContainer = ({
826
826
  });
827
827
  }
828
828
  }, []);
829
- return /* @__PURE__ */ jsxs(Fragment, { children: [
830
- /* @__PURE__ */ jsx(
829
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
830
+ "div",
831
+ {
832
+ id: containerName,
833
+ "data-container_name": containerName,
834
+ ref: flexContainerRef,
835
+ className: `${FlexLayout_default["flex-container"]} ${className && className !== "" ? className : ""}`,
836
+ ...growState !== void 0 ? { ["data-grow"]: growState } : {},
837
+ ...prevGrowState != void 0 ? { ["data-prev_grow"]: prevGrowState } : {},
838
+ "data-is_resize": isInitialResizable,
839
+ "data-is_resize_panel": isResizePanel,
840
+ style: growState !== void 0 && {
841
+ flex: `${growState} 1 0%`
842
+ } || {}
843
+ },
844
+ isFitContent && /* @__PURE__ */ React.createElement(
831
845
  "div",
832
846
  {
833
- id: containerName,
834
- "data-container_name": containerName,
835
- ref: flexContainerRef,
836
- className: `${FlexLayout_default["flex-container"]} ${className && className !== "" ? className : ""}`,
837
- ...growState !== void 0 ? { ["data-grow"]: growState } : {},
838
- ...prevGrowState != void 0 ? { ["data-prev_grow"]: prevGrowState } : {},
839
- "data-is_resize": isInitialResizable,
840
- "data-is_resize_panel": isResizePanel,
841
- style: growState !== void 0 && {
842
- flex: `${growState} 1 0%`
843
- } || {},
844
- children: isFitContent && /* @__PURE__ */ jsx(
845
- "div",
846
- {
847
- className: `${FlexLayout_default["flex-content-fit-wrapper"]}`,
848
- ref,
849
- children
850
- }
851
- ) || children
852
- }
853
- ),
854
- isResizePanel && /* @__PURE__ */ jsx(
855
- FlexLayoutResizePanel_default,
856
- {
857
- containerName,
858
- layoutName,
859
- direction,
860
- containerCount,
861
- panelMode,
862
- panelClassName,
863
- panelMovementMode
864
- }
865
- )
866
- ] });
867
- };
868
- var FlexLayoutContainer_default = FlexLayoutContainer;
847
+ className: `${FlexLayout_default["flex-content-fit-wrapper"]}`,
848
+ ref
849
+ },
850
+ children
851
+ ) || children
852
+ ), isResizePanel && /* @__PURE__ */ React.createElement(
853
+ FlexLayoutResizePanel,
854
+ {
855
+ containerName,
856
+ layoutName,
857
+ direction,
858
+ containerCount,
859
+ panelMode,
860
+ panelClassName,
861
+ panelMovementMode
862
+ }
863
+ ));
864
+ }
869
865
  var dragState = new Subject();
870
866
  var filterChildren = (obj) => {
871
867
  const { children, ...rest } = obj || {};
@@ -1237,10 +1233,18 @@ function FlexLayoutSplitScreenDragBox({
1237
1233
  velocity.current = { vx, vy };
1238
1234
  if (!scrollRAF.current) {
1239
1235
  const step = () => {
1240
- scrollTargetRef?.current?.scrollBy(
1241
- velocity.current.vx,
1242
- velocity.current.vy
1243
- );
1236
+ const target = scrollTargetRef?.current ?? document.scrollingElement;
1237
+ if (target?.scrollBy) {
1238
+ target.scrollBy(
1239
+ velocity.current.vx,
1240
+ velocity.current.vy
1241
+ );
1242
+ } else {
1243
+ window.scrollBy(
1244
+ velocity.current.vx,
1245
+ velocity.current.vy
1246
+ );
1247
+ }
1244
1248
  if (velocity.current.vx === 0 && velocity.current.vy === 0) {
1245
1249
  scrollRAF.current = null;
1246
1250
  return;
@@ -1392,7 +1396,7 @@ function FlexLayoutSplitScreenDragBox({
1392
1396
  el.removeEventListener("contextmenu", onCtx);
1393
1397
  };
1394
1398
  }, []);
1395
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
1399
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
1396
1400
  "div",
1397
1401
  {
1398
1402
  className: `${className || ""} ${FlexLayout_default["flex-split-screen-drag-box"]}`,
@@ -1475,14 +1479,16 @@ function FlexLayoutSplitScreenDragBox({
1475
1479
  });
1476
1480
  },
1477
1481
  style: { ...style },
1478
- ...props,
1479
- children
1480
- }
1481
- ) });
1482
+ ...props
1483
+ },
1484
+ children
1485
+ ));
1482
1486
  }
1483
1487
 
1484
1488
  // src/flex-layout/styles/listScroll.module.css
1485
1489
  var listScroll_default = {};
1490
+
1491
+ // src/flex-layout/components/FlexLayoutSplitScreenScrollBox.tsx
1486
1492
  var FlexLayoutSplitScreenScrollBox = ({
1487
1493
  className,
1488
1494
  children,
@@ -1546,7 +1552,7 @@ var FlexLayoutSplitScreenScrollBox = ({
1546
1552
  scrollRef.current?.removeEventListener("wheel", handleWheel);
1547
1553
  };
1548
1554
  }, []);
1549
- return /* @__PURE__ */ jsx(
1555
+ return /* @__PURE__ */ React.createElement(
1550
1556
  "div",
1551
1557
  {
1552
1558
  ref: scrollRef,
@@ -1569,27 +1575,29 @@ var FlexLayoutSplitScreenScrollBox = ({
1569
1575
  });
1570
1576
  },
1571
1577
  className: `${className || ""} ${isDefaultScrollStyle ? listScroll_default["default-scroll"] : listScroll_default["list-scroll"]} ${direction ? listScroll_default[direction] : ""}`,
1572
- ...props,
1573
- children
1574
- }
1578
+ ...props
1579
+ },
1580
+ children
1575
1581
  );
1576
1582
  };
1577
1583
  var FlexLayoutSplitScreenScrollBox_default = memo(FlexLayoutSplitScreenScrollBox);
1584
+
1585
+ // src/flex-layout/components/FlexLayoutSplitScreenDragBoxContainer.tsx
1578
1586
  function FlexLayoutSplitScreenDragBoxContainer({
1579
1587
  className,
1580
1588
  children,
1581
1589
  layoutName,
1582
1590
  ...props
1583
1591
  }) {
1584
- return /* @__PURE__ */ jsx(
1592
+ return /* @__PURE__ */ React.createElement(
1585
1593
  FlexLayoutSplitScreenScrollBox_default,
1586
1594
  {
1587
1595
  keyName: layoutName,
1588
1596
  className: `${FlexLayout_default["flex-split-screen-drag-box-title-container"]} ${className && className !== "" && className || ""}`,
1589
1597
  direction: "x",
1590
- ...props,
1591
- children
1592
- }
1598
+ ...props
1599
+ },
1600
+ children
1593
1601
  );
1594
1602
  }
1595
1603
  function FlexLayoutSplitScreenDragBoxItem({
@@ -1605,35 +1613,35 @@ function FlexLayoutSplitScreenDragBoxItem({
1605
1613
  allSplitScreenCount.next(allSplitScreenCount.value - 1);
1606
1614
  };
1607
1615
  }, []);
1608
- return /* @__PURE__ */ jsxs(
1616
+ return /* @__PURE__ */ React.createElement(
1609
1617
  "div",
1610
1618
  {
1611
1619
  className: `${FlexLayout_default["flex-split-screen-drag-box-title-item"]} ${isActive ? FlexLayout_default["active"] : ""}`,
1612
- ...props,
1613
- children: [
1614
- children,
1615
- /* @__PURE__ */ jsx("button", { type: "button", onClick: (ev) => onClose(ev), children: "X" })
1616
- ]
1617
- }
1620
+ ...props
1621
+ },
1622
+ children,
1623
+ /* @__PURE__ */ React.createElement("button", { type: "button", onClick: (ev) => onClose(ev) }, "X")
1618
1624
  );
1619
1625
  }
1626
+
1627
+ // src/flex-layout/components/FlexLayoutSplitScreenDragBoxTitleMore.tsx
1620
1628
  function FlexLayoutSplitScreenDragBoxTitleMore({
1621
1629
  className,
1622
1630
  ...props
1623
1631
  }) {
1624
- return /* @__PURE__ */ jsxs(
1632
+ return /* @__PURE__ */ React.createElement(
1625
1633
  "button",
1626
1634
  {
1627
1635
  ...props,
1628
- className: `${FlexLayout_default["flex-split-screen-drag-box-title-more"]} ${className || ""}`,
1629
- children: [
1630
- /* @__PURE__ */ jsx("span", { children: "." }),
1631
- /* @__PURE__ */ jsx("span", { children: "." }),
1632
- /* @__PURE__ */ jsx("span", { children: "." })
1633
- ]
1634
- }
1636
+ className: `${FlexLayout_default["flex-split-screen-drag-box-title-more"]} ${className || ""}`
1637
+ },
1638
+ /* @__PURE__ */ React.createElement("span", null, "."),
1639
+ /* @__PURE__ */ React.createElement("span", null, "."),
1640
+ /* @__PURE__ */ React.createElement("span", null, ".")
1635
1641
  );
1636
1642
  }
1643
+
1644
+ // src/flex-layout/components/FlexLayoutSplitScreen.tsx
1637
1645
  function isOverDrop({
1638
1646
  x,
1639
1647
  y,
@@ -2077,142 +2085,137 @@ function FlexLayoutSplitScreen({
2077
2085
  afterDropTargetComponent,
2078
2086
  centerDropTargetComponent
2079
2087
  ]);
2080
- return /* @__PURE__ */ jsxs("div", { className: `${FlexLayout_default["flex-split-screen"]}`, ref: layoutRef, children: [
2081
- /* @__PURE__ */ jsxs(
2082
- FlexLayout_default2,
2083
- {
2084
- direction,
2085
- layoutName,
2086
- "data-is_split": isSplit,
2087
- panelMovementMode: "bulldozer",
2088
- children: [
2089
- beforeDropTargetComponent.length != 0 ? /* @__PURE__ */ jsx(Fragment, { children: beforeDropTargetComponent.map(
2090
- ({
2091
- containerName: cName,
2092
- component,
2093
- navigationTitle: navigationTitle2,
2094
- dropDocumentOutsideOption: dropDocumentOutsideOption2,
2095
- screenKey: screenKey2
2096
- }, i) => /* @__PURE__ */ jsx(
2097
- FlexLayoutContainer_default,
2088
+ return /* @__PURE__ */ React.createElement("div", { className: `${FlexLayout_default["flex-split-screen"]}`, ref: layoutRef }, /* @__PURE__ */ React.createElement(
2089
+ FlexLayout,
2090
+ {
2091
+ direction,
2092
+ layoutName,
2093
+ "data-is_split": isSplit,
2094
+ panelMovementMode: "bulldozer"
2095
+ },
2096
+ beforeDropTargetComponent.length != 0 ? /* @__PURE__ */ React.createElement(React.Fragment, null, beforeDropTargetComponent.map(
2097
+ ({
2098
+ containerName: cName,
2099
+ component,
2100
+ navigationTitle: navigationTitle2,
2101
+ dropDocumentOutsideOption: dropDocumentOutsideOption2,
2102
+ screenKey: screenKey2
2103
+ }, i) => /* @__PURE__ */ React.createElement(
2104
+ FlexLayoutContainer,
2105
+ {
2106
+ containerName: cName,
2107
+ isInitialResizable: true,
2108
+ isResizePanel: true,
2109
+ key: cName
2110
+ },
2111
+ /* @__PURE__ */ React.createElement(
2112
+ FlexLayoutSplitScreenChild,
2113
+ {
2114
+ parentDirection: direction,
2115
+ layoutName: `${layoutName}_before`,
2116
+ parentLayoutName: layoutName,
2117
+ containerName: cName,
2118
+ depth: 1,
2119
+ rootRef: layoutRef,
2120
+ screenKey: screenKey2,
2121
+ initialCenterComponents: [
2098
2122
  {
2123
+ navigationTitle: navigationTitle2,
2124
+ component,
2099
2125
  containerName: cName,
2100
- isInitialResizable: true,
2101
- isResizePanel: true,
2102
- children: /* @__PURE__ */ jsx(
2103
- FlexLayoutSplitScreenChild,
2104
- {
2105
- parentDirection: direction,
2106
- layoutName: `${layoutName}_before`,
2107
- parentLayoutName: layoutName,
2108
- containerName: cName,
2109
- depth: 1,
2110
- rootRef: layoutRef,
2111
- screenKey: screenKey2,
2112
- initialCenterComponents: [
2113
- {
2114
- navigationTitle: navigationTitle2,
2115
- component,
2116
- containerName: cName,
2117
- dropDocumentOutsideOption: dropDocumentOutsideOption2,
2118
- screenKey: screenKey2
2119
- }
2120
- ],
2121
- rootName: layoutName
2122
- }
2123
- )
2124
- },
2125
- cName
2126
- )
2127
- ) }) : /* @__PURE__ */ jsx("div", {}),
2128
- centerDropTargetComponent.length === 0 ? /* @__PURE__ */ jsx("div", {}) : /* @__PURE__ */ jsx(
2129
- FlexLayoutContainer_default,
2126
+ dropDocumentOutsideOption: dropDocumentOutsideOption2,
2127
+ screenKey: screenKey2
2128
+ }
2129
+ ],
2130
+ rootName: layoutName
2131
+ }
2132
+ )
2133
+ )
2134
+ )) : /* @__PURE__ */ React.createElement("div", null),
2135
+ centerDropTargetComponent.length === 0 ? /* @__PURE__ */ React.createElement("div", null) : /* @__PURE__ */ React.createElement(
2136
+ FlexLayoutContainer,
2137
+ {
2138
+ containerName: `${centerDropTargetComponent[0].containerName}`,
2139
+ isInitialResizable: true,
2140
+ isResizePanel: isSplit
2141
+ },
2142
+ isSplit ? /* @__PURE__ */ React.createElement(
2143
+ FlexLayoutSplitScreenChild,
2144
+ {
2145
+ parentDirection: direction,
2146
+ layoutName: `${layoutName}_center`,
2147
+ parentLayoutName: layoutName,
2148
+ containerName: `${centerDropTargetComponent[0].containerName}`,
2149
+ depth: 0,
2150
+ rootRef: layoutRef,
2151
+ screenKey: centerDropTargetComponent[0].screenKey,
2152
+ initialCenterComponents: [
2130
2153
  {
2131
- containerName: `${centerDropTargetComponent[0].containerName}`,
2132
- isInitialResizable: true,
2133
- isResizePanel: isSplit,
2134
- children: isSplit ? /* @__PURE__ */ jsx(
2135
- FlexLayoutSplitScreenChild,
2136
- {
2137
- parentDirection: direction,
2138
- layoutName: `${layoutName}_center`,
2139
- parentLayoutName: layoutName,
2140
- containerName: `${centerDropTargetComponent[0].containerName}`,
2141
- depth: 0,
2142
- rootRef: layoutRef,
2143
- screenKey: centerDropTargetComponent[0].screenKey,
2144
- initialCenterComponents: [
2145
- {
2146
- navigationTitle: centerDropTargetComponent[0].navigationTitle,
2147
- component: centerDropTargetComponent[0].component,
2148
- containerName: centerDropTargetComponent[0].containerName,
2149
- dropDocumentOutsideOption: centerDropTargetComponent[0].dropDocumentOutsideOption,
2150
- screenKey: centerDropTargetComponent[0].screenKey
2151
- }
2152
- ],
2153
- rootName: layoutName
2154
- }
2155
- ) : /* @__PURE__ */ jsx(
2156
- FlexLayoutSplitScreenScrollBox_default,
2157
- {
2158
- keyName: centerDropTargetComponent[0].containerName,
2159
- isDefaultScrollStyle: true,
2160
- children: centerDropTargetComponent[0].component
2161
- }
2162
- )
2154
+ navigationTitle: centerDropTargetComponent[0].navigationTitle,
2155
+ component: centerDropTargetComponent[0].component,
2156
+ containerName: centerDropTargetComponent[0].containerName,
2157
+ dropDocumentOutsideOption: centerDropTargetComponent[0].dropDocumentOutsideOption,
2158
+ screenKey: centerDropTargetComponent[0].screenKey
2163
2159
  }
2164
- ),
2165
- afterDropTargetComponent.length != 0 ? /* @__PURE__ */ jsx(Fragment, { children: afterDropTargetComponent.map(
2166
- ({
2167
- containerName: cName,
2168
- component,
2169
- navigationTitle: navigationTitle2,
2170
- dropDocumentOutsideOption: dropDocumentOutsideOption2,
2171
- screenKey: screenKey2
2172
- }, i) => /* @__PURE__ */ jsx(
2173
- FlexLayoutContainer_default,
2160
+ ],
2161
+ rootName: layoutName
2162
+ }
2163
+ ) : /* @__PURE__ */ React.createElement(
2164
+ FlexLayoutSplitScreenScrollBox_default,
2165
+ {
2166
+ keyName: centerDropTargetComponent[0].containerName,
2167
+ isDefaultScrollStyle: true
2168
+ },
2169
+ centerDropTargetComponent[0].component
2170
+ )
2171
+ ),
2172
+ afterDropTargetComponent.length != 0 ? /* @__PURE__ */ React.createElement(React.Fragment, null, afterDropTargetComponent.map(
2173
+ ({
2174
+ containerName: cName,
2175
+ component,
2176
+ navigationTitle: navigationTitle2,
2177
+ dropDocumentOutsideOption: dropDocumentOutsideOption2,
2178
+ screenKey: screenKey2
2179
+ }, i) => /* @__PURE__ */ React.createElement(
2180
+ FlexLayoutContainer,
2181
+ {
2182
+ containerName: cName,
2183
+ isInitialResizable: true,
2184
+ isResizePanel: afterDropTargetComponent.length - 1 !== i,
2185
+ key: cName
2186
+ },
2187
+ /* @__PURE__ */ React.createElement(
2188
+ FlexLayoutSplitScreenChild,
2189
+ {
2190
+ parentDirection: direction,
2191
+ layoutName: `${layoutName}_after`,
2192
+ parentLayoutName: layoutName,
2193
+ containerName: cName,
2194
+ depth: 1,
2195
+ rootRef: layoutRef,
2196
+ screenKey: screenKey2,
2197
+ initialCenterComponents: [
2174
2198
  {
2199
+ navigationTitle: navigationTitle2,
2200
+ component,
2175
2201
  containerName: cName,
2176
- isInitialResizable: true,
2177
- isResizePanel: afterDropTargetComponent.length - 1 !== i,
2178
- children: /* @__PURE__ */ jsx(
2179
- FlexLayoutSplitScreenChild,
2180
- {
2181
- parentDirection: direction,
2182
- layoutName: `${layoutName}_after`,
2183
- parentLayoutName: layoutName,
2184
- containerName: cName,
2185
- depth: 1,
2186
- rootRef: layoutRef,
2187
- screenKey: screenKey2,
2188
- initialCenterComponents: [
2189
- {
2190
- navigationTitle: navigationTitle2,
2191
- component,
2192
- containerName: cName,
2193
- dropDocumentOutsideOption: dropDocumentOutsideOption2,
2194
- screenKey: screenKey2
2195
- }
2196
- ],
2197
- rootName: layoutName
2198
- }
2199
- )
2200
- },
2201
- cName
2202
- )
2203
- ) }) : /* @__PURE__ */ jsx("div", {})
2204
- ]
2205
- }
2206
- ),
2207
- boundaryContainerSize && /* @__PURE__ */ jsx(
2208
- "div",
2209
- {
2210
- className: `${FlexLayout_default["flex-split-screen-boundary-container"]}`,
2211
- style: { ...boundaryContainerSize },
2212
- children: "\u2B07\uFE0F\uB4DC\uB86D\uD558\uBA74 \uD654\uBA74\uC774 \uBD84\uD560\uB429\uB2C8\uB2E4."
2213
- }
2214
- )
2215
- ] });
2202
+ dropDocumentOutsideOption: dropDocumentOutsideOption2,
2203
+ screenKey: screenKey2
2204
+ }
2205
+ ],
2206
+ rootName: layoutName
2207
+ }
2208
+ )
2209
+ )
2210
+ )) : /* @__PURE__ */ React.createElement("div", null)
2211
+ ), boundaryContainerSize && /* @__PURE__ */ React.createElement(
2212
+ "div",
2213
+ {
2214
+ className: `${FlexLayout_default["flex-split-screen-boundary-container"]}`,
2215
+ style: { ...boundaryContainerSize }
2216
+ },
2217
+ "\u2B07\uFE0F\uB4DC\uB86D\uD558\uBA74 \uD654\uBA74\uC774 \uBD84\uD560\uB429\uB2C8\uB2E4."
2218
+ ));
2216
2219
  }
2217
2220
  function FlexLayoutSplitScreenChild({
2218
2221
  containerName,
@@ -2500,319 +2503,309 @@ function FlexLayoutSplitScreenChild({
2500
2503
  activeIndexRef.current = activeIndex;
2501
2504
  }, [activeIndex]);
2502
2505
  const [isOnlyOneScreen, setIsOnlyOneScreen] = useState(false);
2503
- return /* @__PURE__ */ jsx(Fragment, { children: !isEmptyContent && /* @__PURE__ */ jsxs(
2506
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, !isEmptyContent && /* @__PURE__ */ React.createElement(
2504
2507
  "div",
2505
2508
  {
2506
2509
  className: `${FlexLayout_default["flex-split-screen"]}`,
2507
- ref: layoutRef,
2508
- children: [
2509
- /* @__PURE__ */ jsxs(
2510
- FlexLayout_default2,
2510
+ ref: layoutRef
2511
+ },
2512
+ /* @__PURE__ */ React.createElement(
2513
+ FlexLayout,
2514
+ {
2515
+ direction,
2516
+ layoutName: `${layoutName}`,
2517
+ panelMovementMode: "bulldozer"
2518
+ },
2519
+ beforeDropTargetComponent.length != 0 ? /* @__PURE__ */ React.createElement(React.Fragment, null, beforeDropTargetComponent.map(
2520
+ ({
2521
+ containerName: cName,
2522
+ component,
2523
+ navigationTitle,
2524
+ dropDocumentOutsideOption,
2525
+ screenKey: screenKey2
2526
+ }, i) => /* @__PURE__ */ React.createElement(
2527
+ FlexLayoutContainer,
2511
2528
  {
2512
- direction,
2513
- layoutName: `${layoutName}`,
2514
- panelMovementMode: "bulldozer",
2515
- children: [
2516
- beforeDropTargetComponent.length != 0 ? /* @__PURE__ */ jsx(Fragment, { children: beforeDropTargetComponent.map(
2517
- ({
2518
- containerName: cName,
2519
- component,
2529
+ containerName: cName,
2530
+ isInitialResizable: true,
2531
+ isResizePanel: true,
2532
+ key: cName
2533
+ },
2534
+ /* @__PURE__ */ React.createElement(
2535
+ FlexLayoutSplitScreenChild,
2536
+ {
2537
+ parentDirection: direction,
2538
+ layoutName: `${layoutName}_before-${depth}`,
2539
+ parentLayoutName: layoutName,
2540
+ containerName: cName,
2541
+ depth: depth + 1,
2542
+ rootRef,
2543
+ screenKey: screenKey2,
2544
+ initialCenterComponents: [
2545
+ {
2520
2546
  navigationTitle,
2547
+ component,
2548
+ containerName: cName,
2521
2549
  dropDocumentOutsideOption,
2522
2550
  screenKey: screenKey2
2523
- }, i) => /* @__PURE__ */ jsx(
2524
- FlexLayoutContainer_default,
2525
- {
2526
- containerName: cName,
2527
- isInitialResizable: true,
2528
- isResizePanel: true,
2529
- children: /* @__PURE__ */ jsx(
2530
- FlexLayoutSplitScreenChild,
2531
- {
2532
- parentDirection: direction,
2533
- layoutName: `${layoutName}_before-${depth}`,
2534
- parentLayoutName: layoutName,
2535
- containerName: cName,
2536
- depth: depth + 1,
2537
- rootRef,
2538
- screenKey: screenKey2,
2539
- initialCenterComponents: [
2540
- {
2541
- navigationTitle,
2542
- component,
2543
- containerName: cName,
2544
- dropDocumentOutsideOption,
2545
- screenKey: screenKey2
2546
- }
2547
- ],
2548
- rootName
2549
- }
2550
- )
2551
- },
2552
- cName
2553
- )
2554
- ) }) : /* @__PURE__ */ jsx("div", {}),
2555
- centerDropTargetComponent.length != 0 ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2556
- FlexLayoutContainer_default,
2551
+ }
2552
+ ],
2553
+ rootName
2554
+ }
2555
+ )
2556
+ )
2557
+ )) : /* @__PURE__ */ React.createElement("div", null),
2558
+ centerDropTargetComponent.length != 0 ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
2559
+ FlexLayoutContainer,
2560
+ {
2561
+ containerName: `${(centerDropTargetComponent[activeIndex] || centerDropTargetComponent[0]).containerName}`,
2562
+ isInitialResizable: true,
2563
+ isResizePanel: isSplit,
2564
+ key: (centerDropTargetComponent[activeIndex] || centerDropTargetComponent[0]).containerName
2565
+ },
2566
+ isSplit ? /* @__PURE__ */ React.createElement("div", { "data-key": screenKey }, /* @__PURE__ */ React.createElement(
2567
+ FlexLayoutSplitScreenChild,
2568
+ {
2569
+ parentDirection: direction,
2570
+ layoutName: `${layoutName}_center-${depth}`,
2571
+ parentLayoutName: layoutName,
2572
+ containerName: `${(centerDropTargetComponent[activeIndex] || centerDropTargetComponent[0]).containerName}`,
2573
+ depth: depth + 1,
2574
+ rootRef,
2575
+ initialCenterComponents: centerDropTargetComponent.map(
2576
+ ({
2577
+ navigationTitle,
2578
+ component,
2579
+ containerName: cName,
2580
+ dropDocumentOutsideOption,
2581
+ screenKey: centerScreenKey
2582
+ }) => ({
2583
+ navigationTitle,
2584
+ component,
2585
+ containerName: cName,
2586
+ dropDocumentOutsideOption,
2587
+ screenKey: centerScreenKey
2588
+ })
2589
+ ),
2590
+ screenKey,
2591
+ rootName
2592
+ }
2593
+ )) : /* @__PURE__ */ React.createElement(
2594
+ FlexLayoutSplitScreenScrollBox_default,
2595
+ {
2596
+ keyName: (centerDropTargetComponent[activeIndex] || centerDropTargetComponent[0]).containerName,
2597
+ isDefaultScrollStyle: true
2598
+ },
2599
+ !isOnlyOneScreen && /* @__PURE__ */ React.createElement(
2600
+ "div",
2601
+ {
2602
+ className: `${FlexLayout_default["flex-split-screen-drag-box-title-wrapper-sticky"]}`
2603
+ },
2604
+ /* @__PURE__ */ React.createElement(
2605
+ "div",
2606
+ {
2607
+ "data-is_split": isSplit,
2608
+ "data-layout_name": layoutName,
2609
+ "data-parent_layout_name": parentLayoutName,
2610
+ "data-container_name": `${(centerDropTargetComponent[activeIndex] || centerDropTargetComponent[0]).containerName}`,
2611
+ className: `${FlexLayout_default["flex-split-screen-drag-box-title-wrapper"]}`
2612
+ },
2613
+ /* @__PURE__ */ React.createElement(
2614
+ FlexLayoutSplitScreenDragBoxContainer,
2557
2615
  {
2558
- containerName: `${(centerDropTargetComponent[activeIndex] || centerDropTargetComponent[0]).containerName}`,
2559
- isInitialResizable: true,
2560
- isResizePanel: isSplit,
2561
- children: isSplit ? /* @__PURE__ */ jsx("div", { "data-key": screenKey, children: /* @__PURE__ */ jsx(
2562
- FlexLayoutSplitScreenChild,
2563
- {
2564
- parentDirection: direction,
2565
- layoutName: `${layoutName}_center-${depth}`,
2566
- parentLayoutName: layoutName,
2567
- containerName: `${(centerDropTargetComponent[activeIndex] || centerDropTargetComponent[0]).containerName}`,
2568
- depth: depth + 1,
2569
- rootRef,
2570
- initialCenterComponents: centerDropTargetComponent.map(
2571
- ({
2572
- navigationTitle,
2573
- component,
2574
- containerName: cName,
2575
- dropDocumentOutsideOption,
2576
- screenKey: centerScreenKey
2577
- }) => ({
2578
- navigationTitle,
2579
- component,
2580
- containerName: cName,
2581
- dropDocumentOutsideOption,
2582
- screenKey: centerScreenKey
2583
- })
2584
- ),
2585
- screenKey,
2586
- rootName
2587
- }
2588
- ) }) : /* @__PURE__ */ jsxs(
2589
- FlexLayoutSplitScreenScrollBox_default,
2616
+ key: layoutName,
2617
+ "data-layout_name": layoutName,
2618
+ layoutName
2619
+ },
2620
+ centerDropTargetComponent.map(
2621
+ (item, index) => /* @__PURE__ */ React.createElement(
2622
+ FlexLayoutSplitScreenDragBoxItem,
2590
2623
  {
2591
- keyName: (centerDropTargetComponent[activeIndex] || centerDropTargetComponent[0]).containerName,
2592
- isDefaultScrollStyle: true,
2593
- children: [
2594
- !isOnlyOneScreen && /* @__PURE__ */ jsx(
2595
- "div",
2596
- {
2597
- className: `${FlexLayout_default["flex-split-screen-drag-box-title-wrapper-sticky"]}`,
2598
- children: /* @__PURE__ */ jsxs(
2599
- "div",
2600
- {
2601
- "data-is_split": isSplit,
2602
- "data-layout_name": layoutName,
2603
- "data-parent_layout_name": parentLayoutName,
2604
- "data-container_name": `${(centerDropTargetComponent[activeIndex] || centerDropTargetComponent[0]).containerName}`,
2605
- className: `${FlexLayout_default["flex-split-screen-drag-box-title-wrapper"]}`,
2606
- children: [
2607
- /* @__PURE__ */ jsx(
2608
- FlexLayoutSplitScreenDragBoxContainer,
2609
- {
2610
- "data-layout_name": layoutName,
2611
- layoutName,
2612
- children: centerDropTargetComponent.map(
2613
- (item, index) => /* @__PURE__ */ jsx(
2614
- FlexLayoutSplitScreenDragBoxItem,
2615
- {
2616
- onClose: (ev) => {
2617
- if (activeIndexRef.current === index && centerDropTargetComponent.length === 1) {
2618
- dropMovementEventSubject.next(
2619
- {
2620
- state: "remove",
2621
- targetContainerName: containerName,
2622
- targetParentLayoutName: parentLayoutName,
2623
- targetLayoutName: layoutName
2624
- }
2625
- );
2626
- } else {
2627
- if (centerDropTargetComponent.length === activeIndexRef.current + 1) {
2628
- setActiveIndex(
2629
- activeIndexRef.current - 1
2630
- );
2631
- }
2632
- setCenterDropTargetComponent(
2633
- (prev) => {
2634
- const result = handleRemove(
2635
- prev,
2636
- item.containerName,
2637
- () => {
2638
- }
2639
- );
2640
- return result;
2641
- }
2642
- );
2643
- }
2644
- },
2645
- isActive: activeIndex === index,
2646
- children: /* @__PURE__ */ jsx(
2647
- FlexLayoutSplitScreenDragBox,
2648
- {
2649
- onClick: () => {
2650
- setActiveIndex(
2651
- index
2652
- );
2653
- },
2654
- containerName: item.containerName,
2655
- dropDocumentOutsideOption: item.dropDocumentOutsideOption,
2656
- targetComponent: item.component,
2657
- navigationTitle: item.navigationTitle,
2658
- "data-container-name": item.containerName,
2659
- "data-layout-name": layoutName,
2660
- "data-parent-layout-name": parentLayoutName,
2661
- dropEndCallback: ({
2662
- x,
2663
- y,
2664
- containerName: appendContainerName
2665
- }) => {
2666
- if (!rootRef.current || !layoutRef.current)
2667
- return;
2668
- const isRootOver = isOverDrop(
2669
- {
2670
- x,
2671
- y,
2672
- element: rootRef.current
2673
- }
2674
- );
2675
- const isLayoutInner = isInnerDrop(
2676
- {
2677
- x,
2678
- y,
2679
- element: layoutRef.current
2680
- }
2681
- );
2682
- if (!isRootOver && !isLayoutInner || !isRootOver && isLayoutInner && centerDropTargetComponentRef.current.length > 1) {
2683
- const option = {};
2684
- if (centerDropTargetComponentRef.current.length > 1) {
2685
- const {
2686
- adjacentItem,
2687
- adjacentIndex
2688
- } = getAdjacentItem(
2689
- centerDropTargetComponentRef.current,
2690
- activeIndexRef.current
2691
- );
2692
- if (adjacentItem && activeIndexRef.current === index) {
2693
- Object.assign(
2694
- option,
2695
- {
2696
- x,
2697
- y,
2698
- targetComponent: adjacentItem.component,
2699
- nextContainerName: adjacentItem.containerName,
2700
- orderName: "center",
2701
- dropTargetComponentEvent: {
2702
- navigationTitle: adjacentItem.navigationTitle,
2703
- dropDocumentOutsideOption: adjacentItem.dropDocumentOutsideOption,
2704
- direction,
2705
- screenKey
2706
- }
2707
- }
2708
- );
2709
- }
2710
- }
2711
- if (index === 0) {
2712
- dropMovementEventSubject.next(
2713
- {
2714
- state: "remove",
2715
- targetContainerName: item.containerName,
2716
- targetParentLayoutName: parentLayoutName,
2717
- targetLayoutName: layoutName,
2718
- ...option
2719
- }
2720
- );
2721
- } else {
2722
- dropMovementEventSubject.next(
2723
- {
2724
- state: "remove",
2725
- targetContainerName: item.containerName,
2726
- targetParentLayoutName: "",
2727
- targetLayoutName: layoutName,
2728
- ...option
2729
- }
2730
- );
2731
- }
2732
- }
2733
- },
2734
- children: item.navigationTitle
2735
- }
2736
- )
2737
- },
2738
- item.navigationTitle + layoutName + item.containerName
2739
- )
2740
- )
2741
- },
2742
- layoutName
2743
- ),
2744
- /* @__PURE__ */ jsx(FlexLayoutSplitScreenDragBoxTitleMore, {})
2745
- ]
2746
- }
2747
- )
2624
+ onClose: (ev) => {
2625
+ if (activeIndexRef.current === index && centerDropTargetComponent.length === 1) {
2626
+ dropMovementEventSubject.next(
2627
+ {
2628
+ state: "remove",
2629
+ targetContainerName: containerName,
2630
+ targetParentLayoutName: parentLayoutName,
2631
+ targetLayoutName: layoutName
2632
+ }
2633
+ );
2634
+ } else {
2635
+ if (centerDropTargetComponent.length === activeIndexRef.current + 1) {
2636
+ setActiveIndex(
2637
+ activeIndexRef.current - 1
2638
+ );
2748
2639
  }
2749
- ),
2750
- (() => {
2751
- const target = centerDropTargetComponent[activeIndex] || centerDropTargetComponent[0];
2752
- return target.component;
2753
- })()
2754
- ]
2755
- }
2756
- )
2757
- },
2758
- (centerDropTargetComponent[activeIndex] || centerDropTargetComponent[0]).containerName
2759
- ) }) : /* @__PURE__ */ jsx("div", {}),
2760
- afterDropTargetComponent.length != 0 ? /* @__PURE__ */ jsx(Fragment, { children: afterDropTargetComponent.map(
2761
- ({
2762
- containerName: cName,
2763
- component,
2764
- navigationTitle,
2765
- dropDocumentOutsideOption,
2766
- screenKey: screenKey2
2767
- }, i) => /* @__PURE__ */ jsx(
2768
- FlexLayoutContainer_default,
2769
- {
2770
- containerName: cName,
2771
- isInitialResizable: true,
2772
- isResizePanel: i !== afterDropTargetComponent.length - 1,
2773
- children: /* @__PURE__ */ jsx(
2774
- FlexLayoutSplitScreenChild,
2640
+ setCenterDropTargetComponent(
2641
+ (prev) => {
2642
+ const result = handleRemove(
2643
+ prev,
2644
+ item.containerName,
2645
+ () => {
2646
+ }
2647
+ );
2648
+ return result;
2649
+ }
2650
+ );
2651
+ }
2652
+ },
2653
+ key: item.navigationTitle + layoutName + item.containerName,
2654
+ isActive: activeIndex === index
2655
+ },
2656
+ /* @__PURE__ */ React.createElement(
2657
+ FlexLayoutSplitScreenDragBox,
2775
2658
  {
2776
- parentDirection: direction,
2777
- layoutName: `${layoutName}_after-${depth}`,
2778
- parentLayoutName: layoutName,
2779
- containerName: cName,
2780
- depth: depth + 1,
2781
- rootRef,
2782
- screenKey: screenKey2,
2783
- initialCenterComponents: [
2784
- {
2785
- navigationTitle,
2786
- component,
2787
- containerName: cName,
2788
- dropDocumentOutsideOption,
2789
- screenKey: screenKey2
2659
+ onClick: () => {
2660
+ setActiveIndex(
2661
+ index
2662
+ );
2663
+ },
2664
+ containerName: item.containerName,
2665
+ dropDocumentOutsideOption: item.dropDocumentOutsideOption,
2666
+ targetComponent: item.component,
2667
+ navigationTitle: item.navigationTitle,
2668
+ "data-container-name": item.containerName,
2669
+ "data-layout-name": layoutName,
2670
+ "data-parent-layout-name": parentLayoutName,
2671
+ dropEndCallback: ({
2672
+ x,
2673
+ y,
2674
+ containerName: appendContainerName
2675
+ }) => {
2676
+ if (!rootRef.current || !layoutRef.current)
2677
+ return;
2678
+ const isRootOver = isOverDrop(
2679
+ {
2680
+ x,
2681
+ y,
2682
+ element: rootRef.current
2683
+ }
2684
+ );
2685
+ const isLayoutInner = isInnerDrop(
2686
+ {
2687
+ x,
2688
+ y,
2689
+ element: layoutRef.current
2690
+ }
2691
+ );
2692
+ if (!isRootOver && !isLayoutInner || !isRootOver && isLayoutInner && centerDropTargetComponentRef.current.length > 1) {
2693
+ const option = {};
2694
+ if (centerDropTargetComponentRef.current.length > 1) {
2695
+ const {
2696
+ adjacentItem,
2697
+ adjacentIndex
2698
+ } = getAdjacentItem(
2699
+ centerDropTargetComponentRef.current,
2700
+ activeIndexRef.current
2701
+ );
2702
+ if (adjacentItem && activeIndexRef.current === index) {
2703
+ Object.assign(
2704
+ option,
2705
+ {
2706
+ x,
2707
+ y,
2708
+ targetComponent: adjacentItem.component,
2709
+ nextContainerName: adjacentItem.containerName,
2710
+ orderName: "center",
2711
+ dropTargetComponentEvent: {
2712
+ navigationTitle: adjacentItem.navigationTitle,
2713
+ dropDocumentOutsideOption: adjacentItem.dropDocumentOutsideOption,
2714
+ direction,
2715
+ screenKey
2716
+ }
2717
+ }
2718
+ );
2719
+ }
2720
+ }
2721
+ if (index === 0) {
2722
+ dropMovementEventSubject.next(
2723
+ {
2724
+ state: "remove",
2725
+ targetContainerName: item.containerName,
2726
+ targetParentLayoutName: parentLayoutName,
2727
+ targetLayoutName: layoutName,
2728
+ ...option
2729
+ }
2730
+ );
2731
+ } else {
2732
+ dropMovementEventSubject.next(
2733
+ {
2734
+ state: "remove",
2735
+ targetContainerName: item.containerName,
2736
+ targetParentLayoutName: "",
2737
+ targetLayoutName: layoutName,
2738
+ ...option
2739
+ }
2740
+ );
2741
+ }
2790
2742
  }
2791
- ],
2792
- rootName
2793
- }
2743
+ }
2744
+ },
2745
+ item.navigationTitle
2794
2746
  )
2795
- },
2796
- cName
2747
+ )
2797
2748
  )
2798
- ) }) : /* @__PURE__ */ jsx("div", {})
2799
- ]
2800
- }
2801
- ),
2802
- boundaryContainerSize && /* @__PURE__ */ jsx(
2803
- "div",
2749
+ ),
2750
+ /* @__PURE__ */ React.createElement(FlexLayoutSplitScreenDragBoxTitleMore, null)
2751
+ )
2752
+ ),
2753
+ (() => {
2754
+ const target = centerDropTargetComponent[activeIndex] || centerDropTargetComponent[0];
2755
+ return target.component;
2756
+ })()
2757
+ )
2758
+ )) : /* @__PURE__ */ React.createElement("div", null),
2759
+ afterDropTargetComponent.length != 0 ? /* @__PURE__ */ React.createElement(React.Fragment, null, afterDropTargetComponent.map(
2760
+ ({
2761
+ containerName: cName,
2762
+ component,
2763
+ navigationTitle,
2764
+ dropDocumentOutsideOption,
2765
+ screenKey: screenKey2
2766
+ }, i) => /* @__PURE__ */ React.createElement(
2767
+ FlexLayoutContainer,
2804
2768
  {
2805
- className: `${FlexLayout_default["flex-split-screen-boundary-container"]}`,
2806
- style: { ...boundaryContainerSize },
2807
- children: "\u2B07\uFE0F\uB4DC\uB86D\uD558\uBA74 \uD654\uBA74\uC774 \uBD84\uD560\uB429\uB2C8\uB2E4."
2808
- }
2769
+ containerName: cName,
2770
+ isInitialResizable: true,
2771
+ isResizePanel: i !== afterDropTargetComponent.length - 1,
2772
+ key: cName
2773
+ },
2774
+ /* @__PURE__ */ React.createElement(
2775
+ FlexLayoutSplitScreenChild,
2776
+ {
2777
+ parentDirection: direction,
2778
+ layoutName: `${layoutName}_after-${depth}`,
2779
+ parentLayoutName: layoutName,
2780
+ containerName: cName,
2781
+ depth: depth + 1,
2782
+ rootRef,
2783
+ screenKey: screenKey2,
2784
+ initialCenterComponents: [
2785
+ {
2786
+ navigationTitle,
2787
+ component,
2788
+ containerName: cName,
2789
+ dropDocumentOutsideOption,
2790
+ screenKey: screenKey2
2791
+ }
2792
+ ],
2793
+ rootName
2794
+ }
2795
+ )
2809
2796
  )
2810
- ]
2811
- }
2812
- ) });
2797
+ )) : /* @__PURE__ */ React.createElement("div", null)
2798
+ ),
2799
+ boundaryContainerSize && /* @__PURE__ */ React.createElement(
2800
+ "div",
2801
+ {
2802
+ className: `${FlexLayout_default["flex-split-screen-boundary-container"]}`,
2803
+ style: { ...boundaryContainerSize }
2804
+ },
2805
+ "\u2B07\uFE0F\uB4DC\uB86D\uD558\uBA74 \uD654\uBA74\uC774 \uBD84\uD560\uB429\uB2C8\uB2E4."
2806
+ )
2807
+ ));
2813
2808
  }
2814
- FlexLayoutSplitScreen.displayName = "FlexLayoutSplitScreen";
2815
- var FlexLayoutSplitScreen_default = FlexLayoutSplitScreen;
2816
2809
  function clamp(n, min, max) {
2817
2810
  return Math.max(min, Math.min(max, n));
2818
2811
  }
@@ -3004,7 +2997,7 @@ var FlexLayoutStickyBox = ({
3004
2997
  }
3005
2998
  };
3006
2999
  }, [ioRoot, resolvedEdge, offset, debug]);
3007
- return /* @__PURE__ */ jsx(
3000
+ return /* @__PURE__ */ React2.createElement(
3008
3001
  "div",
3009
3002
  {
3010
3003
  ref: rootRef,
@@ -3017,20 +3010,20 @@ var FlexLayoutStickyBox = ({
3017
3010
  // 부모 높이를 채우도록 설정
3018
3011
  ...style
3019
3012
  },
3020
- ...rest,
3021
- children: /* @__PURE__ */ jsx(
3022
- "div",
3023
- {
3024
- ref: contentRef,
3025
- style: contentDynamicStyle,
3026
- children
3027
- }
3028
- )
3029
- }
3013
+ ...rest
3014
+ },
3015
+ /* @__PURE__ */ React2.createElement(
3016
+ "div",
3017
+ {
3018
+ ref: contentRef,
3019
+ style: contentDynamicStyle
3020
+ },
3021
+ children
3022
+ )
3030
3023
  );
3031
3024
  };
3032
3025
  var FlexLayoutStickyBox_default = FlexLayoutStickyBox;
3033
3026
 
3034
- export { FlexLayout_default2 as FlexLayout, FlexLayoutContainer_default as FlexLayoutContainer, FlexLayoutResizePanel_default as FlexLayoutResizePanel, FlexLayoutSplitScreen_default as FlexLayoutSplitScreen, FlexLayoutSplitScreenDragBox, FlexLayoutSplitScreenScrollBox_default as FlexLayoutSplitScreenScrollBox, FlexLayoutStickyBox_default as FlexLayoutStickyBox };
3027
+ export { FlexLayout, FlexLayoutContainer, FlexLayoutResizePanel, FlexLayoutSplitScreen, FlexLayoutSplitScreenDragBox, FlexLayoutSplitScreenScrollBox_default as FlexLayoutSplitScreenScrollBox, FlexLayoutStickyBox_default as FlexLayoutStickyBox };
3035
3028
  //# sourceMappingURL=components.js.map
3036
3029
  //# sourceMappingURL=components.js.map