@vlrc-fe/components 1.0.7 → 1.0.8
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/MultiSelect/type.d.ts +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +64 -41
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +46 -80
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +22 -60
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +1147 -43
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +30 -64
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +31 -147
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +93 -19
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +80 -25
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +9 -50
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +30 -156
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +350 -14
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +11 -0
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +55 -60
- package/dist/index110.cjs +1 -0
- package/dist/index110.js +430 -0
- package/dist/index111.cjs +1 -0
- package/dist/index111.js +36 -0
- package/dist/index112.cjs +1 -0
- package/dist/index112.js +28 -0
- package/dist/index113.cjs +1 -0
- package/dist/index113.js +14 -0
- package/dist/index114.cjs +1 -0
- package/dist/index114.js +156 -0
- package/dist/index115.cjs +1 -0
- package/dist/index115.js +19 -0
- package/dist/index116.cjs +1 -0
- package/dist/index116.js +67 -0
- package/dist/index117.cjs +1 -0
- package/dist/index117.js +118 -0
- package/dist/index118.cjs +1 -0
- package/dist/index118.js +36 -0
- package/dist/index119.cjs +1 -0
- package/dist/index119.js +13 -0
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +44 -121
- package/dist/index120.cjs +1 -0
- package/dist/index120.js +31 -0
- package/dist/index121.cjs +1 -0
- package/dist/index121.js +37 -0
- package/dist/index122.cjs +1 -0
- package/dist/index122.js +123 -0
- package/dist/index123.cjs +1 -0
- package/dist/index123.js +44 -0
- package/dist/index124.cjs +1 -0
- package/dist/index124.js +43 -0
- package/dist/index125.cjs +1 -0
- package/dist/index125.js +14 -0
- package/dist/index126.cjs +1 -0
- package/dist/index126.js +64 -0
- package/dist/index127.cjs +1 -0
- package/dist/index127.js +23 -0
- package/dist/index128.cjs +1 -0
- package/dist/index128.js +34 -0
- package/dist/index129.cjs +1 -0
- package/dist/index129.js +27 -0
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +30 -12
- package/dist/index130.cjs +1 -0
- package/dist/index130.js +26 -0
- package/dist/index131.cjs +1 -0
- package/dist/index131.js +157 -0
- package/dist/index132.cjs +1 -0
- package/dist/index132.js +34 -0
- package/dist/index133.cjs +1 -0
- package/dist/index133.js +46 -0
- package/dist/index134.cjs +1 -0
- package/dist/index134.js +142 -0
- package/dist/index135.cjs +1 -0
- package/dist/index135.js +125 -0
- package/dist/index136.cjs +1 -0
- package/dist/index136.js +26 -0
- package/dist/index137.cjs +1 -0
- package/dist/index137.js +88 -0
- package/dist/index138.cjs +1 -0
- package/dist/index138.js +221 -0
- package/dist/index139.cjs +1 -0
- package/dist/index139.js +166 -0
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +8 -12
- package/dist/index140.cjs +1 -0
- package/dist/index140.js +126 -0
- package/dist/index141.cjs +1 -0
- package/dist/index141.js +15 -0
- package/dist/index142.cjs +1 -0
- package/dist/index142.js +9 -0
- package/dist/index143.cjs +1 -0
- package/dist/index143.js +17 -0
- package/dist/index144.cjs +1 -0
- package/dist/index144.js +22 -0
- package/dist/index145.cjs +1 -0
- package/dist/index145.js +18 -0
- package/dist/index146.cjs +1 -0
- package/dist/index146.js +6 -0
- package/dist/index147.cjs +1 -0
- package/dist/index147.js +7 -0
- package/dist/index148.cjs +1 -0
- package/dist/index148.js +8 -0
- package/dist/index149.cjs +1 -0
- package/dist/index149.js +7 -0
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +12 -112
- package/dist/index150.cjs +1 -0
- package/dist/index150.js +7 -0
- package/dist/index151.cjs +1 -0
- package/dist/index151.js +9 -0
- package/dist/index152.cjs +1 -0
- package/dist/index152.js +69 -0
- package/dist/index153.cjs +1 -0
- package/dist/index153.js +11 -0
- package/dist/index154.cjs +1 -0
- package/dist/index154.js +202 -0
- package/dist/index155.cjs +1 -0
- package/dist/index155.js +124 -0
- package/dist/index156.cjs +1 -0
- package/dist/index156.js +32 -0
- package/dist/index157.cjs +1 -0
- package/dist/index157.js +20 -0
- package/dist/index158.cjs +1 -0
- package/dist/index158.js +69 -0
- package/dist/index159.cjs +1 -0
- package/dist/index159.js +32 -0
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +4 -726
- package/dist/index160.cjs +1 -0
- package/dist/index160.js +11 -0
- package/dist/index161.cjs +1 -0
- package/dist/index161.js +280 -0
- package/dist/index162.cjs +1 -0
- package/dist/index162.js +157 -0
- package/dist/index163.cjs +1 -0
- package/dist/index163.js +20 -0
- package/dist/index164.cjs +1 -0
- package/dist/index164.js +10 -0
- package/dist/index165.cjs +1 -0
- package/dist/index165.js +14 -0
- package/dist/index166.cjs +1 -0
- package/dist/index166.js +8 -0
- package/dist/index167.cjs +1 -0
- package/dist/index167.js +8 -0
- package/dist/index168.cjs +1 -0
- package/dist/index168.js +11 -0
- package/dist/index169.cjs +1 -0
- package/dist/index169.js +10 -0
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +79 -339
- package/dist/index170.cjs +1 -0
- package/dist/index170.js +6 -0
- package/dist/index171.cjs +1 -0
- package/dist/index171.js +8 -0
- package/dist/index172.cjs +1 -0
- package/dist/index172.js +8 -0
- package/dist/index173.cjs +1 -0
- package/dist/index173.js +10 -0
- package/dist/index174.cjs +1 -0
- package/dist/index174.js +11 -0
- package/dist/index175.cjs +1 -0
- package/dist/index175.js +15 -0
- package/dist/index176.cjs +1 -0
- package/dist/index176.js +11 -0
- package/dist/index177.cjs +1 -0
- package/dist/index177.js +11 -0
- package/dist/index178.cjs +1 -0
- package/dist/index178.js +6 -0
- package/dist/index179.cjs +1 -0
- package/dist/index179.js +43 -0
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +19 -66
- package/dist/index180.cjs +1 -0
- package/dist/index180.js +382 -0
- package/dist/index181.cjs +1 -0
- package/dist/index181.js +40 -0
- package/dist/index182.cjs +1 -0
- package/dist/index182.js +23 -0
- package/dist/index183.cjs +1 -0
- package/dist/index183.js +59 -0
- package/dist/index184.cjs +1 -0
- package/dist/index184.js +55 -0
- package/dist/index185.cjs +1 -0
- package/dist/index185.js +54 -0
- package/dist/index186.cjs +1 -0
- package/dist/index186.js +57 -0
- package/dist/index187.cjs +1 -0
- package/dist/index187.js +57 -0
- package/dist/index188.cjs +1 -0
- package/dist/index188.js +88 -0
- package/dist/index189.cjs +1 -0
- package/dist/index189.js +66 -0
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +18 -8
- package/dist/index190.cjs +1 -0
- package/dist/index190.js +594 -0
- package/dist/index191.cjs +9 -0
- package/dist/index191.js +30 -0
- package/dist/index192.cjs +1 -0
- package/dist/index192.js +50 -0
- package/dist/index193.cjs +1 -0
- package/dist/index193.js +65 -0
- package/dist/index194.cjs +1 -0
- package/dist/index194.js +48 -0
- package/dist/index195.cjs +1 -0
- package/dist/index195.js +67 -0
- package/dist/index196.cjs +1 -0
- package/dist/index196.js +151 -0
- package/dist/index197.cjs +1 -0
- package/dist/index197.js +23 -0
- package/dist/index198.cjs +1 -0
- package/dist/index198.js +27 -0
- package/dist/index199.cjs +1 -0
- package/dist/index199.js +53 -0
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +51 -98
- package/dist/index200.cjs +1 -0
- package/dist/index200.js +161 -0
- package/dist/index201.cjs +1 -0
- package/dist/index201.js +16 -0
- package/dist/index202.cjs +1 -0
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +81 -28
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +64 -14
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +25 -22
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +1014 -33
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +22 -96
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +108 -25
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +15 -9
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +20 -66
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +81 -11
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +91 -29
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +14 -41
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +93 -12
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +22 -62
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +84 -22
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +85 -33
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +407 -25
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +170 -25
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +28 -154
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +158 -33
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +104 -45
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +337 -140
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +96 -124
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +319 -23
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +205 -81
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +33 -220
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +161 -163
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +20 -125
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +24 -14
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +167 -7
- package/dist/index5.js +26 -14
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +44 -15
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +15 -18
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +3 -17
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +5 -5
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +19 -4
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +24 -6
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +66 -4
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +14 -5
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +4 -8
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +50 -67
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +85 -46
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +6 -10
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +25 -199
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +13 -122
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +9 -30
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +3 -20
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +24 -66
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +68 -30
- package/dist/index67.cjs +38 -1
- package/dist/index67.js +3 -11
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +12 -279
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +50 -155
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +29 -85
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +115 -19
- package/dist/index71.cjs +4 -1
- package/dist/index71.js +6 -9
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +12 -12
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +539 -6
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +197 -6
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +120 -9
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +912 -8
- package/dist/index77.cjs +3 -1
- package/dist/index77.js +76 -4
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +120 -6
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +12 -6
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +35 -62
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +14 -8
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +113 -9
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +725 -13
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +346 -9
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +74 -9
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +148 -4
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +31 -42
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +12 -380
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +345 -37
- package/dist/index89.cjs +20 -1
- package/dist/index89.js +40 -18
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +85 -17
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +113 -56
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +272 -51
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +129 -50
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +13 -54
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +28 -55
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +525 -80
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +75 -61
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +67 -583
- package/dist/index98.cjs +1 -9
- package/dist/index98.js +32 -27
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +17 -49
- package/dist/ui/alert-dialog.d.ts +15 -0
- package/dist/ui/alert-dialog.d.ts.map +1 -0
- package/dist/ui/alert.d.ts +10 -0
- package/dist/ui/alert.d.ts.map +1 -0
- package/dist/ui/aspect-ratio.d.ts +4 -0
- package/dist/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/ui/avatar.d.ts +7 -0
- package/dist/ui/avatar.d.ts.map +1 -0
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/breadcrumb.d.ts +12 -0
- package/dist/ui/breadcrumb.d.ts.map +1 -0
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/carousel.d.ts +20 -0
- package/dist/ui/carousel.d.ts.map +1 -0
- package/dist/ui/collapsible.d.ts +6 -0
- package/dist/ui/collapsible.d.ts.map +1 -0
- package/dist/ui/context-menu.d.ts +26 -0
- package/dist/ui/context-menu.d.ts.map +1 -0
- package/dist/ui/drawer.d.ts +14 -0
- package/dist/ui/drawer.d.ts.map +1 -0
- package/dist/ui/hover-card.d.ts +7 -0
- package/dist/ui/hover-card.d.ts.map +1 -0
- package/dist/ui/index.d.ts +23 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/input-otp.d.ts +12 -0
- package/dist/ui/input-otp.d.ts.map +1 -0
- package/dist/ui/menubar.d.ts +27 -0
- package/dist/ui/menubar.d.ts.map +1 -0
- package/dist/ui/navigation-menu.d.ts +15 -0
- package/dist/ui/navigation-menu.d.ts.map +1 -0
- package/dist/ui/pagination.d.ts +14 -0
- package/dist/ui/pagination.d.ts.map +1 -0
- package/dist/ui/resizable.d.ts +9 -0
- package/dist/ui/resizable.d.ts.map +1 -0
- package/dist/ui/sheet.d.ts +14 -0
- package/dist/ui/sheet.d.ts.map +1 -0
- package/dist/ui/sidebar.d.ts +70 -0
- package/dist/ui/sidebar.d.ts.map +1 -0
- package/dist/ui/skeleton.d.ts +3 -0
- package/dist/ui/skeleton.d.ts.map +1 -0
- package/dist/ui/slider.d.ts +5 -0
- package/dist/ui/slider.d.ts.map +1 -0
- package/dist/ui/switch.d.ts +5 -0
- package/dist/ui/switch.d.ts.map +1 -0
- package/dist/ui/tabs.d.ts +8 -0
- package/dist/ui/tabs.d.ts.map +1 -0
- package/dist/ui/toggle-group.d.ts +8 -0
- package/dist/ui/toggle-group.d.ts.map +1 -0
- package/dist/ui/toggle.d.ts +10 -0
- package/dist/ui/toggle.d.ts.map +1 -0
- package/package.json +23 -5
package/dist/index101.js
CHANGED
|
@@ -1,48 +1,1152 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
import { createContext as t, createElement as n, forwardRef as r, useCallback as i, useContext as a, useEffect as o, useImperativeHandle as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
3
|
+
//#region ../../node_modules/.pnpm/react-resizable-panels@2.1.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-resizable-panels/dist/react-resizable-panels.browser.esm.js
|
|
4
|
+
var f = t(null);
|
|
5
|
+
f.displayName = "PanelGroupContext";
|
|
6
|
+
var p = {
|
|
7
|
+
group: "data-panel-group",
|
|
8
|
+
groupDirection: "data-panel-group-direction",
|
|
9
|
+
groupId: "data-panel-group-id",
|
|
10
|
+
panel: "data-panel",
|
|
11
|
+
panelCollapsible: "data-panel-collapsible",
|
|
12
|
+
panelId: "data-panel-id",
|
|
13
|
+
panelSize: "data-panel-size",
|
|
14
|
+
resizeHandle: "data-resize-handle",
|
|
15
|
+
resizeHandleActive: "data-resize-handle-active",
|
|
16
|
+
resizeHandleEnabled: "data-panel-resize-handle-enabled",
|
|
17
|
+
resizeHandleId: "data-panel-resize-handle-id",
|
|
18
|
+
resizeHandleState: "data-resize-handle-state"
|
|
19
|
+
}, m = 10, h = c, g = e.useId, _ = typeof g == "function" ? g : () => null, v = 0;
|
|
20
|
+
function ee(e = null) {
|
|
21
|
+
let t = _(), n = u(e || t || null);
|
|
22
|
+
return n.current === null && (n.current = "" + v++), e ?? n.current;
|
|
23
|
+
}
|
|
24
|
+
function y({ children: e, className: t = "", collapsedSize: r, collapsible: i, defaultSize: o, forwardedRef: c, id: l, maxSize: d, minSize: m, onCollapse: g, onExpand: _, onResize: v, order: y, style: b, tagName: te = "div", ...x }) {
|
|
25
|
+
let S = a(f);
|
|
26
|
+
if (S === null) throw Error("Panel components must be rendered within a PanelGroup container");
|
|
27
|
+
let { collapsePanel: C, expandPanel: w, getPanelSize: T, getPanelStyle: E, groupId: D, isPanelCollapsed: O, reevaluatePanelConstraints: k, registerPanel: A, resizePanel: j, unregisterPanel: M } = S, N = ee(l), P = u({
|
|
28
|
+
callbacks: {
|
|
29
|
+
onCollapse: g,
|
|
30
|
+
onExpand: _,
|
|
31
|
+
onResize: v
|
|
32
|
+
},
|
|
33
|
+
constraints: {
|
|
34
|
+
collapsedSize: r,
|
|
35
|
+
collapsible: i,
|
|
36
|
+
defaultSize: o,
|
|
37
|
+
maxSize: d,
|
|
38
|
+
minSize: m
|
|
39
|
+
},
|
|
40
|
+
id: N,
|
|
41
|
+
idIsFromProps: l !== void 0,
|
|
42
|
+
order: y
|
|
43
|
+
});
|
|
44
|
+
u({ didLogMissingDefaultSizeWarning: !1 }), h(() => {
|
|
45
|
+
let { callbacks: e, constraints: t } = P.current, n = { ...t };
|
|
46
|
+
P.current.id = N, P.current.idIsFromProps = l !== void 0, P.current.order = y, e.onCollapse = g, e.onExpand = _, e.onResize = v, t.collapsedSize = r, t.collapsible = i, t.defaultSize = o, t.maxSize = d, t.minSize = m, (n.collapsedSize !== t.collapsedSize || n.collapsible !== t.collapsible || n.maxSize !== t.maxSize || n.minSize !== t.minSize) && k(P.current, n);
|
|
47
|
+
}), h(() => {
|
|
48
|
+
let e = P.current;
|
|
49
|
+
return A(e), () => {
|
|
50
|
+
M(e);
|
|
51
|
+
};
|
|
52
|
+
}, [
|
|
53
|
+
y,
|
|
54
|
+
N,
|
|
55
|
+
A,
|
|
56
|
+
M
|
|
57
|
+
]), s(c, () => ({
|
|
58
|
+
collapse: () => {
|
|
59
|
+
C(P.current);
|
|
60
|
+
},
|
|
61
|
+
expand: (e) => {
|
|
62
|
+
w(P.current, e);
|
|
63
|
+
},
|
|
64
|
+
getId() {
|
|
65
|
+
return N;
|
|
66
|
+
},
|
|
67
|
+
getSize() {
|
|
68
|
+
return T(P.current);
|
|
69
|
+
},
|
|
70
|
+
isCollapsed() {
|
|
71
|
+
return O(P.current);
|
|
72
|
+
},
|
|
73
|
+
isExpanded() {
|
|
74
|
+
return !O(P.current);
|
|
75
|
+
},
|
|
76
|
+
resize: (e) => {
|
|
77
|
+
j(P.current, e);
|
|
78
|
+
}
|
|
79
|
+
}), [
|
|
80
|
+
C,
|
|
81
|
+
w,
|
|
82
|
+
T,
|
|
83
|
+
O,
|
|
84
|
+
N,
|
|
85
|
+
j
|
|
86
|
+
]);
|
|
87
|
+
let F = E(P.current, o);
|
|
88
|
+
return n(te, {
|
|
89
|
+
...x,
|
|
90
|
+
children: e,
|
|
91
|
+
className: t,
|
|
92
|
+
id: N,
|
|
93
|
+
style: {
|
|
94
|
+
...F,
|
|
95
|
+
...b
|
|
96
|
+
},
|
|
97
|
+
[p.groupId]: D,
|
|
98
|
+
[p.panel]: "",
|
|
99
|
+
[p.panelCollapsible]: i || void 0,
|
|
100
|
+
[p.panelId]: N,
|
|
101
|
+
[p.panelSize]: parseFloat("" + F.flexGrow).toFixed(1)
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
var b = r((e, t) => n(y, {
|
|
105
|
+
...e,
|
|
106
|
+
forwardedRef: t
|
|
107
|
+
}));
|
|
108
|
+
y.displayName = "Panel", b.displayName = "forwardRef(Panel)";
|
|
109
|
+
var te;
|
|
110
|
+
function x() {
|
|
111
|
+
return te;
|
|
112
|
+
}
|
|
113
|
+
var S = null, C = !0, w = -1, T = null;
|
|
114
|
+
function E(e, t) {
|
|
115
|
+
if (t) {
|
|
116
|
+
let e = (t & ie) !== 0, n = (t & ae) !== 0, r = (t & oe) !== 0, i = (t & se) !== 0;
|
|
117
|
+
if (e) return r ? "se-resize" : i ? "ne-resize" : "e-resize";
|
|
118
|
+
if (n) return r ? "sw-resize" : i ? "nw-resize" : "w-resize";
|
|
119
|
+
if (r) return "s-resize";
|
|
120
|
+
if (i) return "n-resize";
|
|
121
|
+
}
|
|
122
|
+
switch (e) {
|
|
123
|
+
case "horizontal": return "ew-resize";
|
|
124
|
+
case "intersection": return "move";
|
|
125
|
+
case "vertical": return "ns-resize";
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function D() {
|
|
129
|
+
T !== null && (document.head.removeChild(T), S = null, T = null, w = -1);
|
|
130
|
+
}
|
|
131
|
+
function O(e, t) {
|
|
132
|
+
if (!C) return;
|
|
133
|
+
let n = E(e, t);
|
|
134
|
+
if (S !== n) {
|
|
135
|
+
if (S = n, T === null) {
|
|
136
|
+
T = document.createElement("style");
|
|
137
|
+
let e = x();
|
|
138
|
+
e && T.setAttribute("nonce", e), document.head.appendChild(T);
|
|
139
|
+
}
|
|
140
|
+
if (w >= 0) {
|
|
141
|
+
var r;
|
|
142
|
+
(r = T.sheet) == null || r.removeRule(w);
|
|
143
|
+
}
|
|
144
|
+
w = T.sheet?.insertRule(`*{cursor: ${n} !important;}`) ?? -1;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function k(e) {
|
|
148
|
+
return e.type === "keydown";
|
|
149
|
+
}
|
|
150
|
+
function A(e) {
|
|
151
|
+
return e.type.startsWith("pointer");
|
|
152
|
+
}
|
|
153
|
+
function j(e) {
|
|
154
|
+
return e.type.startsWith("mouse");
|
|
155
|
+
}
|
|
156
|
+
function M(e) {
|
|
157
|
+
if (A(e)) {
|
|
158
|
+
if (e.isPrimary) return {
|
|
159
|
+
x: e.clientX,
|
|
160
|
+
y: e.clientY
|
|
161
|
+
};
|
|
162
|
+
} else if (j(e)) return {
|
|
163
|
+
x: e.clientX,
|
|
164
|
+
y: e.clientY
|
|
23
165
|
};
|
|
24
166
|
return {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
167
|
+
x: Infinity,
|
|
168
|
+
y: Infinity
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function N() {
|
|
172
|
+
if (typeof matchMedia == "function") return matchMedia("(pointer:coarse)").matches ? "coarse" : "fine";
|
|
173
|
+
}
|
|
174
|
+
function P(e, t, n) {
|
|
175
|
+
return n ? e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y : e.x <= t.x + t.width && e.x + e.width >= t.x && e.y <= t.y + t.height && e.y + e.height >= t.y;
|
|
176
|
+
}
|
|
177
|
+
function F(e, t) {
|
|
178
|
+
if (e === t) throw Error("Cannot compare node with itself");
|
|
179
|
+
let n = {
|
|
180
|
+
a: ne(e),
|
|
181
|
+
b: ne(t)
|
|
182
|
+
}, r;
|
|
183
|
+
for (; n.a.at(-1) === n.b.at(-1);) e = n.a.pop(), t = n.b.pop(), r = e;
|
|
184
|
+
K(r, "Stacking order can only be calculated for elements with a common ancestor");
|
|
185
|
+
let i = {
|
|
186
|
+
a: B(z(n.a)),
|
|
187
|
+
b: B(z(n.b))
|
|
188
|
+
};
|
|
189
|
+
if (i.a === i.b) {
|
|
190
|
+
let e = r.childNodes, t = {
|
|
191
|
+
a: n.a.at(-1),
|
|
192
|
+
b: n.b.at(-1)
|
|
193
|
+
}, i = e.length;
|
|
194
|
+
for (; i--;) {
|
|
195
|
+
let n = e[i];
|
|
196
|
+
if (n === t.a) return 1;
|
|
197
|
+
if (n === t.b) return -1;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return Math.sign(i.a - i.b);
|
|
201
|
+
}
|
|
202
|
+
var I = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
203
|
+
function L(e) {
|
|
204
|
+
let t = getComputedStyle(re(e) ?? e).display;
|
|
205
|
+
return t === "flex" || t === "inline-flex";
|
|
206
|
+
}
|
|
207
|
+
function R(e) {
|
|
208
|
+
let t = getComputedStyle(e);
|
|
209
|
+
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || L(e)) || +t.opacity < 1 || "transform" in t && t.transform !== "none" || "webkitTransform" in t && t.webkitTransform !== "none" || "mixBlendMode" in t && t.mixBlendMode !== "normal" || "filter" in t && t.filter !== "none" || "webkitFilter" in t && t.webkitFilter !== "none" || "isolation" in t && t.isolation === "isolate" || I.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
210
|
+
}
|
|
211
|
+
function z(e) {
|
|
212
|
+
let t = e.length;
|
|
213
|
+
for (; t--;) {
|
|
214
|
+
let n = e[t];
|
|
215
|
+
if (K(n, "Missing node"), R(n)) return n;
|
|
216
|
+
}
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
function B(e) {
|
|
220
|
+
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
221
|
+
}
|
|
222
|
+
function ne(e) {
|
|
223
|
+
let t = [];
|
|
224
|
+
for (; e;) t.push(e), e = re(e);
|
|
225
|
+
return t;
|
|
226
|
+
}
|
|
227
|
+
function re(e) {
|
|
228
|
+
let { parentNode: t } = e;
|
|
229
|
+
return t && t instanceof ShadowRoot ? t.host : t;
|
|
230
|
+
}
|
|
231
|
+
var ie = 1, ae = 2, oe = 4, se = 8, ce = N() === "coarse", V = [], H = !1, U = /* @__PURE__ */ new Map(), W = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Set();
|
|
232
|
+
function le(e, t, n, r, i) {
|
|
233
|
+
let { ownerDocument: a } = t, o = {
|
|
234
|
+
direction: n,
|
|
235
|
+
element: t,
|
|
236
|
+
hitAreaMargins: r,
|
|
237
|
+
setResizeHandlerState: i
|
|
238
|
+
}, s = U.get(a) ?? 0;
|
|
239
|
+
return U.set(a, s + 1), G.add(o), ve(), function() {
|
|
240
|
+
W.delete(e), G.delete(o);
|
|
241
|
+
let t = U.get(a) ?? 1;
|
|
242
|
+
if (U.set(a, t - 1), ve(), t === 1 && U.delete(a), V.includes(o)) {
|
|
243
|
+
let e = V.indexOf(o);
|
|
244
|
+
e >= 0 && V.splice(e, 1), ge(), i("up", !0, null);
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
function ue(e) {
|
|
249
|
+
let { target: t } = e, { x: n, y: r } = M(e);
|
|
250
|
+
H = !0, me({
|
|
251
|
+
target: t,
|
|
252
|
+
x: n,
|
|
253
|
+
y: r
|
|
254
|
+
}), ve(), V.length > 0 && (ye("down", e), e.preventDefault(), pe(t) || e.stopImmediatePropagation());
|
|
255
|
+
}
|
|
256
|
+
function de(e) {
|
|
257
|
+
let { x: t, y: n } = M(e);
|
|
258
|
+
if (H && e.buttons === 0 && (H = !1, ye("up", e)), !H) {
|
|
259
|
+
let { target: r } = e;
|
|
260
|
+
me({
|
|
261
|
+
target: r,
|
|
262
|
+
x: t,
|
|
263
|
+
y: n
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
ye("move", e), ge(), V.length > 0 && e.preventDefault();
|
|
267
|
+
}
|
|
268
|
+
function fe(e) {
|
|
269
|
+
let { target: t } = e, { x: n, y: r } = M(e);
|
|
270
|
+
W.clear(), H = !1, V.length > 0 && (e.preventDefault(), pe(t) || e.stopImmediatePropagation()), ye("up", e), me({
|
|
271
|
+
target: t,
|
|
272
|
+
x: n,
|
|
273
|
+
y: r
|
|
274
|
+
}), ge(), ve();
|
|
275
|
+
}
|
|
276
|
+
function pe(e) {
|
|
277
|
+
let t = e;
|
|
278
|
+
for (; t;) {
|
|
279
|
+
if (t.hasAttribute(p.resizeHandle)) return !0;
|
|
280
|
+
t = t.parentElement;
|
|
281
|
+
}
|
|
282
|
+
return !1;
|
|
283
|
+
}
|
|
284
|
+
function me({ target: e, x: t, y: n }) {
|
|
285
|
+
V.splice(0);
|
|
286
|
+
let r = null;
|
|
287
|
+
(e instanceof HTMLElement || e instanceof SVGElement) && (r = e), G.forEach((e) => {
|
|
288
|
+
let { element: i, hitAreaMargins: a } = e, o = i.getBoundingClientRect(), { bottom: s, left: c, right: l, top: u } = o, d = ce ? a.coarse : a.fine;
|
|
289
|
+
if (t >= c - d && t <= l + d && n >= u - d && n <= s + d) {
|
|
290
|
+
if (r !== null && document.contains(r) && i !== r && !i.contains(r) && !r.contains(i) && F(r, i) > 0) {
|
|
291
|
+
let e = r, t = !1;
|
|
292
|
+
for (; e && !e.contains(i);) {
|
|
293
|
+
if (P(e.getBoundingClientRect(), o, !0)) {
|
|
294
|
+
t = !0;
|
|
295
|
+
break;
|
|
296
|
+
}
|
|
297
|
+
e = e.parentElement;
|
|
298
|
+
}
|
|
299
|
+
if (t) return;
|
|
300
|
+
}
|
|
301
|
+
V.push(e);
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
function he(e, t) {
|
|
306
|
+
W.set(e, t);
|
|
307
|
+
}
|
|
308
|
+
function ge() {
|
|
309
|
+
let e = !1, t = !1;
|
|
310
|
+
V.forEach((n) => {
|
|
311
|
+
let { direction: r } = n;
|
|
312
|
+
r === "horizontal" ? e = !0 : t = !0;
|
|
313
|
+
});
|
|
314
|
+
let n = 0;
|
|
315
|
+
W.forEach((e) => {
|
|
316
|
+
n |= e;
|
|
317
|
+
}), e && t ? O("intersection", n) : e ? O("horizontal", n) : t ? O("vertical", n) : D();
|
|
318
|
+
}
|
|
319
|
+
var _e = new AbortController();
|
|
320
|
+
function ve() {
|
|
321
|
+
_e.abort(), _e = new AbortController();
|
|
322
|
+
let e = {
|
|
323
|
+
capture: !0,
|
|
324
|
+
signal: _e.signal
|
|
325
|
+
};
|
|
326
|
+
G.size && (H ? (V.length > 0 && U.forEach((t, n) => {
|
|
327
|
+
let { body: r } = n;
|
|
328
|
+
t > 0 && (r.addEventListener("contextmenu", fe, e), r.addEventListener("pointerleave", de, e), r.addEventListener("pointermove", de, e));
|
|
329
|
+
}), window.addEventListener("pointerup", fe, e), window.addEventListener("pointercancel", fe, e)) : U.forEach((t, n) => {
|
|
330
|
+
let { body: r } = n;
|
|
331
|
+
t > 0 && (r.addEventListener("pointerdown", ue, e), r.addEventListener("pointermove", de, e));
|
|
332
|
+
}));
|
|
333
|
+
}
|
|
334
|
+
function ye(e, t) {
|
|
335
|
+
G.forEach((n) => {
|
|
336
|
+
let { setResizeHandlerState: r } = n;
|
|
337
|
+
r(e, V.includes(n), t);
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
function be() {
|
|
341
|
+
let [e, t] = d(0);
|
|
342
|
+
return i(() => t((e) => e + 1), []);
|
|
343
|
+
}
|
|
344
|
+
function K(e, t) {
|
|
345
|
+
if (!e) throw console.error(t), Error(t);
|
|
346
|
+
}
|
|
347
|
+
function q(e, t, n = m) {
|
|
348
|
+
return e.toFixed(n) === t.toFixed(n) ? 0 : e > t ? 1 : -1;
|
|
349
|
+
}
|
|
350
|
+
function J(e, t, n = m) {
|
|
351
|
+
return q(e, t, n) === 0;
|
|
352
|
+
}
|
|
353
|
+
function Y(e, t, n) {
|
|
354
|
+
return q(e, t, n) === 0;
|
|
355
|
+
}
|
|
356
|
+
function xe(e, t, n) {
|
|
357
|
+
if (e.length !== t.length) return !1;
|
|
358
|
+
for (let r = 0; r < e.length; r++) {
|
|
359
|
+
let i = e[r], a = t[r];
|
|
360
|
+
if (!Y(i, a, n)) return !1;
|
|
361
|
+
}
|
|
362
|
+
return !0;
|
|
363
|
+
}
|
|
364
|
+
function X({ panelConstraints: e, panelIndex: t, size: n }) {
|
|
365
|
+
let r = e[t];
|
|
366
|
+
K(r != null, `Panel constraints not found for index ${t}`);
|
|
367
|
+
let { collapsedSize: i = 0, collapsible: a, maxSize: o = 100, minSize: s = 0 } = r;
|
|
368
|
+
if (q(n, s) < 0) if (a) {
|
|
369
|
+
let e = (i + s) / 2;
|
|
370
|
+
n = q(n, e) < 0 ? i : s;
|
|
371
|
+
} else n = s;
|
|
372
|
+
return n = Math.min(o, n), n = parseFloat(n.toFixed(m)), n;
|
|
373
|
+
}
|
|
374
|
+
function Se({ delta: e, initialLayout: t, panelConstraints: n, pivotIndices: r, prevLayout: i, trigger: a }) {
|
|
375
|
+
if (Y(e, 0)) return t;
|
|
376
|
+
let o = [...t], [s, c] = r;
|
|
377
|
+
K(s != null, "Invalid first pivot index"), K(c != null, "Invalid second pivot index");
|
|
378
|
+
let l = 0;
|
|
379
|
+
if (a === "keyboard") {
|
|
380
|
+
{
|
|
381
|
+
let r = e < 0 ? c : s, i = n[r];
|
|
382
|
+
K(i, `Panel constraints not found for index ${r}`);
|
|
383
|
+
let { collapsedSize: a = 0, collapsible: o, minSize: l = 0 } = i;
|
|
384
|
+
if (o) {
|
|
385
|
+
let n = t[r];
|
|
386
|
+
if (K(n != null, `Previous layout not found for panel index ${r}`), Y(n, a)) {
|
|
387
|
+
let t = l - n;
|
|
388
|
+
q(t, Math.abs(e)) > 0 && (e = e < 0 ? 0 - t : t);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
{
|
|
393
|
+
let r = e < 0 ? s : c, i = n[r];
|
|
394
|
+
K(i, `No panel constraints found for index ${r}`);
|
|
395
|
+
let { collapsedSize: a = 0, collapsible: o, minSize: l = 0 } = i;
|
|
396
|
+
if (o) {
|
|
397
|
+
let n = t[r];
|
|
398
|
+
if (K(n != null, `Previous layout not found for panel index ${r}`), Y(n, l)) {
|
|
399
|
+
let t = n - a;
|
|
400
|
+
q(t, Math.abs(e)) > 0 && (e = e < 0 ? 0 - t : t);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
{
|
|
406
|
+
let r = e < 0 ? 1 : -1, i = e < 0 ? c : s, a = 0;
|
|
407
|
+
for (;;) {
|
|
408
|
+
let e = t[i];
|
|
409
|
+
K(e != null, `Previous layout not found for panel index ${i}`);
|
|
410
|
+
let o = X({
|
|
411
|
+
panelConstraints: n,
|
|
412
|
+
panelIndex: i,
|
|
413
|
+
size: 100
|
|
414
|
+
}) - e;
|
|
415
|
+
if (a += o, i += r, i < 0 || i >= n.length) break;
|
|
416
|
+
}
|
|
417
|
+
let o = Math.min(Math.abs(e), Math.abs(a));
|
|
418
|
+
e = e < 0 ? 0 - o : o;
|
|
419
|
+
}
|
|
420
|
+
{
|
|
421
|
+
let r = e < 0 ? s : c;
|
|
422
|
+
for (; r >= 0 && r < n.length;) {
|
|
423
|
+
let i = Math.abs(e) - Math.abs(l), a = t[r];
|
|
424
|
+
K(a != null, `Previous layout not found for panel index ${r}`);
|
|
425
|
+
let s = a - i, c = X({
|
|
426
|
+
panelConstraints: n,
|
|
427
|
+
panelIndex: r,
|
|
428
|
+
size: s
|
|
429
|
+
});
|
|
430
|
+
if (!Y(a, c) && (l += a - c, o[r] = c, l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3), void 0, { numeric: !0 }) >= 0)) break;
|
|
431
|
+
e < 0 ? r-- : r++;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
if (xe(i, o)) return i;
|
|
435
|
+
{
|
|
436
|
+
let r = e < 0 ? c : s, i = t[r];
|
|
437
|
+
K(i != null, `Previous layout not found for panel index ${r}`);
|
|
438
|
+
let a = i + l, u = X({
|
|
439
|
+
panelConstraints: n,
|
|
440
|
+
panelIndex: r,
|
|
441
|
+
size: a
|
|
442
|
+
});
|
|
443
|
+
if (o[r] = u, !Y(u, a)) {
|
|
444
|
+
let t = a - u, r = e < 0 ? c : s;
|
|
445
|
+
for (; r >= 0 && r < n.length;) {
|
|
446
|
+
let i = o[r];
|
|
447
|
+
K(i != null, `Previous layout not found for panel index ${r}`);
|
|
448
|
+
let a = i + t, s = X({
|
|
449
|
+
panelConstraints: n,
|
|
450
|
+
panelIndex: r,
|
|
451
|
+
size: a
|
|
452
|
+
});
|
|
453
|
+
if (Y(i, s) || (t -= s - i, o[r] = s), Y(t, 0)) break;
|
|
454
|
+
e > 0 ? r-- : r++;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
return Y(o.reduce((e, t) => t + e, 0), 100) ? o : i;
|
|
459
|
+
}
|
|
460
|
+
function Ce({ layout: e, panelsArray: t, pivotIndices: n }) {
|
|
461
|
+
let r = 0, i = 100, a = 0, o = 0, s = n[0];
|
|
462
|
+
return K(s != null, "No pivot index found"), t.forEach((e, t) => {
|
|
463
|
+
let { constraints: n } = e, { maxSize: c = 100, minSize: l = 0 } = n;
|
|
464
|
+
t === s ? (r = l, i = c) : (a += l, o += c);
|
|
465
|
+
}), {
|
|
466
|
+
valueMax: Math.min(i, 100 - a),
|
|
467
|
+
valueMin: Math.max(r, 100 - o),
|
|
468
|
+
valueNow: e[s]
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
function we(e, t = document) {
|
|
472
|
+
return Array.from(t.querySelectorAll(`[${p.resizeHandleId}][data-panel-group-id="${e}"]`));
|
|
473
|
+
}
|
|
474
|
+
function Te(e, t, n = document) {
|
|
475
|
+
return we(e, n).findIndex((e) => e.getAttribute(p.resizeHandleId) === t) ?? null;
|
|
476
|
+
}
|
|
477
|
+
function Ee(e, t, n) {
|
|
478
|
+
let r = Te(e, t, n);
|
|
479
|
+
return r == null ? [-1, -1] : [r, r + 1];
|
|
480
|
+
}
|
|
481
|
+
function De(e, t = document) {
|
|
482
|
+
return t instanceof HTMLElement && t?.dataset?.panelGroupId == e ? t : t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`) || null;
|
|
483
|
+
}
|
|
484
|
+
function Oe(e, t = document) {
|
|
485
|
+
return t.querySelector(`[${p.resizeHandleId}="${e}"]`) || null;
|
|
486
|
+
}
|
|
487
|
+
function ke(e, t, n, r = document) {
|
|
488
|
+
let i = Oe(t, r), a = we(e, r), o = i ? a.indexOf(i) : -1;
|
|
489
|
+
return [n[o]?.id ?? null, n[o + 1]?.id ?? null];
|
|
490
|
+
}
|
|
491
|
+
function Ae({ committedValuesRef: e, eagerValuesRef: t, groupId: n, layout: r, panelDataArray: i, panelGroupElement: a, setLayout: s }) {
|
|
492
|
+
u({ didWarnAboutMissingResizeHandle: !1 }), h(() => {
|
|
493
|
+
if (!a) return;
|
|
494
|
+
let e = we(n, a);
|
|
495
|
+
for (let t = 0; t < i.length - 1; t++) {
|
|
496
|
+
let { valueMax: n, valueMin: a, valueNow: o } = Ce({
|
|
497
|
+
layout: r,
|
|
498
|
+
panelsArray: i,
|
|
499
|
+
pivotIndices: [t, t + 1]
|
|
500
|
+
}), s = e[t];
|
|
501
|
+
if (s != null) {
|
|
502
|
+
let e = i[t];
|
|
503
|
+
K(e, `No panel data found for index "${t}"`), s.setAttribute("aria-controls", e.id), s.setAttribute("aria-valuemax", "" + Math.round(n)), s.setAttribute("aria-valuemin", "" + Math.round(a)), s.setAttribute("aria-valuenow", o == null ? "" : "" + Math.round(o));
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
return () => {
|
|
507
|
+
e.forEach((e, t) => {
|
|
508
|
+
e.removeAttribute("aria-controls"), e.removeAttribute("aria-valuemax"), e.removeAttribute("aria-valuemin"), e.removeAttribute("aria-valuenow");
|
|
509
|
+
});
|
|
510
|
+
};
|
|
511
|
+
}, [
|
|
512
|
+
n,
|
|
513
|
+
r,
|
|
514
|
+
i,
|
|
515
|
+
a
|
|
516
|
+
]), o(() => {
|
|
517
|
+
if (!a) return;
|
|
518
|
+
let e = t.current;
|
|
519
|
+
K(e, "Eager values not found");
|
|
520
|
+
let { panelDataArray: i } = e;
|
|
521
|
+
K(De(n, a) != null, `No group found for id "${n}"`);
|
|
522
|
+
let o = we(n, a);
|
|
523
|
+
K(o, `No resize handles found for group id "${n}"`);
|
|
524
|
+
let c = o.map((e) => {
|
|
525
|
+
let t = e.getAttribute(p.resizeHandleId);
|
|
526
|
+
K(t, "Resize handle element has no handle id attribute");
|
|
527
|
+
let [o, c] = ke(n, t, i, a);
|
|
528
|
+
if (o == null || c == null) return () => {};
|
|
529
|
+
let l = (e) => {
|
|
530
|
+
if (!e.defaultPrevented) switch (e.key) {
|
|
531
|
+
case "Enter": {
|
|
532
|
+
e.preventDefault();
|
|
533
|
+
let c = i.findIndex((e) => e.id === o);
|
|
534
|
+
if (c >= 0) {
|
|
535
|
+
let e = i[c];
|
|
536
|
+
K(e, `No panel data found for index ${c}`);
|
|
537
|
+
let o = r[c], { collapsedSize: l = 0, collapsible: u, minSize: d = 0 } = e.constraints;
|
|
538
|
+
if (o != null && u) {
|
|
539
|
+
let e = Se({
|
|
540
|
+
delta: Y(o, l) ? d - l : l - o,
|
|
541
|
+
initialLayout: r,
|
|
542
|
+
panelConstraints: i.map((e) => e.constraints),
|
|
543
|
+
pivotIndices: Ee(n, t, a),
|
|
544
|
+
prevLayout: r,
|
|
545
|
+
trigger: "keyboard"
|
|
546
|
+
});
|
|
547
|
+
r !== e && s(e);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
break;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
return e.addEventListener("keydown", l), () => {
|
|
555
|
+
e.removeEventListener("keydown", l);
|
|
556
|
+
};
|
|
557
|
+
});
|
|
558
|
+
return () => {
|
|
559
|
+
c.forEach((e) => e());
|
|
560
|
+
};
|
|
561
|
+
}, [
|
|
562
|
+
a,
|
|
563
|
+
e,
|
|
564
|
+
t,
|
|
565
|
+
n,
|
|
566
|
+
r,
|
|
567
|
+
i,
|
|
568
|
+
s
|
|
569
|
+
]);
|
|
570
|
+
}
|
|
571
|
+
function je(e, t) {
|
|
572
|
+
if (e.length !== t.length) return !1;
|
|
573
|
+
for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
|
|
574
|
+
return !0;
|
|
575
|
+
}
|
|
576
|
+
function Me(e, t) {
|
|
577
|
+
let n = e === "horizontal", { x: r, y: i } = M(t);
|
|
578
|
+
return n ? r : i;
|
|
579
|
+
}
|
|
580
|
+
function Ne(e, t, n, r, i) {
|
|
581
|
+
let a = n === "horizontal", o = Oe(t, i);
|
|
582
|
+
K(o, `No resize handle element found for id "${t}"`);
|
|
583
|
+
let s = o.getAttribute(p.groupId);
|
|
584
|
+
K(s, "Resize handle element has no group id attribute");
|
|
585
|
+
let { initialCursorPosition: c } = r, l = Me(n, e), u = De(s, i);
|
|
586
|
+
K(u, `No group element found for id "${s}"`);
|
|
587
|
+
let d = u.getBoundingClientRect(), f = a ? d.width : d.height;
|
|
588
|
+
return (l - c) / f * 100;
|
|
589
|
+
}
|
|
590
|
+
function Pe(e, t, n, r, i, a) {
|
|
591
|
+
if (k(e)) {
|
|
592
|
+
let t = n === "horizontal", r = 0;
|
|
593
|
+
r = e.shiftKey ? 100 : i ?? 10;
|
|
594
|
+
let a = 0;
|
|
595
|
+
switch (e.key) {
|
|
596
|
+
case "ArrowDown":
|
|
597
|
+
a = t ? 0 : r;
|
|
598
|
+
break;
|
|
599
|
+
case "ArrowLeft":
|
|
600
|
+
a = t ? -r : 0;
|
|
601
|
+
break;
|
|
602
|
+
case "ArrowRight":
|
|
603
|
+
a = t ? r : 0;
|
|
604
|
+
break;
|
|
605
|
+
case "ArrowUp":
|
|
606
|
+
a = t ? 0 : -r;
|
|
607
|
+
break;
|
|
608
|
+
case "End":
|
|
609
|
+
a = 100;
|
|
610
|
+
break;
|
|
611
|
+
case "Home":
|
|
612
|
+
a = -100;
|
|
613
|
+
break;
|
|
614
|
+
}
|
|
615
|
+
return a;
|
|
616
|
+
} else return r == null ? 0 : Ne(e, t, n, r, a);
|
|
617
|
+
}
|
|
618
|
+
function Fe({ panelDataArray: e }) {
|
|
619
|
+
let t = Array(e.length), n = e.map((e) => e.constraints), r = 0, i = 100;
|
|
620
|
+
for (let a = 0; a < e.length; a++) {
|
|
621
|
+
let e = n[a];
|
|
622
|
+
K(e, `Panel constraints not found for index ${a}`);
|
|
623
|
+
let { defaultSize: o } = e;
|
|
624
|
+
o != null && (r++, t[a] = o, i -= o);
|
|
625
|
+
}
|
|
626
|
+
for (let a = 0; a < e.length; a++) {
|
|
627
|
+
let o = n[a];
|
|
628
|
+
K(o, `Panel constraints not found for index ${a}`);
|
|
629
|
+
let { defaultSize: s } = o;
|
|
630
|
+
if (s != null) continue;
|
|
631
|
+
let c = e.length - r, l = i / c;
|
|
632
|
+
r++, t[a] = l, i -= l;
|
|
633
|
+
}
|
|
634
|
+
return t;
|
|
635
|
+
}
|
|
636
|
+
function Z(e, t, n) {
|
|
637
|
+
t.forEach((t, r) => {
|
|
638
|
+
let i = e[r];
|
|
639
|
+
K(i, `Panel data not found for index ${r}`);
|
|
640
|
+
let { callbacks: a, constraints: o, id: s } = i, { collapsedSize: c = 0, collapsible: l } = o, u = n[s];
|
|
641
|
+
if (u == null || t !== u) {
|
|
642
|
+
n[s] = t;
|
|
643
|
+
let { onCollapse: e, onExpand: r, onResize: i } = a;
|
|
644
|
+
i && i(t, u), l && (e || r) && (r && (u == null || J(u, c)) && !J(t, c) && r(), e && (u == null || !J(u, c)) && J(t, c) && e());
|
|
645
|
+
}
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
function Ie(e, t) {
|
|
649
|
+
if (e.length !== t.length) return !1;
|
|
650
|
+
for (let n = 0; n < e.length; n++) if (e[n] != t[n]) return !1;
|
|
651
|
+
return !0;
|
|
652
|
+
}
|
|
653
|
+
function Le({ defaultSize: e, dragState: t, layout: n, panelData: r, panelIndex: i, precision: a = 3 }) {
|
|
654
|
+
let o = n[i], s;
|
|
655
|
+
return s = o == null ? e == null ? "1" : e.toPrecision(a) : r.length === 1 ? "1" : o.toPrecision(a), {
|
|
656
|
+
flexBasis: 0,
|
|
657
|
+
flexGrow: s,
|
|
658
|
+
flexShrink: 1,
|
|
659
|
+
overflow: "hidden",
|
|
660
|
+
pointerEvents: t === null ? void 0 : "none"
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
function Re(e, t = 10) {
|
|
664
|
+
let n = null;
|
|
665
|
+
return (...r) => {
|
|
666
|
+
n !== null && clearTimeout(n), n = setTimeout(() => {
|
|
667
|
+
e(...r);
|
|
668
|
+
}, t);
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
function ze(e) {
|
|
672
|
+
try {
|
|
673
|
+
if (typeof localStorage < "u") e.getItem = (e) => localStorage.getItem(e), e.setItem = (e, t) => {
|
|
674
|
+
localStorage.setItem(e, t);
|
|
675
|
+
};
|
|
676
|
+
else throw Error("localStorage not supported in this environment");
|
|
677
|
+
} catch (t) {
|
|
678
|
+
console.error(t), e.getItem = () => null, e.setItem = () => {};
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
function Be(e) {
|
|
682
|
+
return `react-resizable-panels:${e}`;
|
|
683
|
+
}
|
|
684
|
+
function Ve(e) {
|
|
685
|
+
return e.map((e) => {
|
|
686
|
+
let { constraints: t, id: n, idIsFromProps: r, order: i } = e;
|
|
687
|
+
return r ? n : i ? `${i}:${JSON.stringify(t)}` : JSON.stringify(t);
|
|
688
|
+
}).sort((e, t) => e.localeCompare(t)).join(",");
|
|
689
|
+
}
|
|
690
|
+
function He(e, t) {
|
|
691
|
+
try {
|
|
692
|
+
let n = Be(e), r = t.getItem(n);
|
|
693
|
+
if (r) {
|
|
694
|
+
let e = JSON.parse(r);
|
|
695
|
+
if (typeof e == "object" && e) return e;
|
|
696
|
+
}
|
|
697
|
+
} catch {}
|
|
698
|
+
return null;
|
|
699
|
+
}
|
|
700
|
+
function Ue(e, t, n) {
|
|
701
|
+
return (He(e, n) ?? {})[Ve(t)] ?? null;
|
|
702
|
+
}
|
|
703
|
+
function We(e, t, n, r, i) {
|
|
704
|
+
let a = Be(e), o = Ve(t), s = He(e, i) ?? {};
|
|
705
|
+
s[o] = {
|
|
706
|
+
expandToSizes: Object.fromEntries(n.entries()),
|
|
707
|
+
layout: r
|
|
708
|
+
};
|
|
709
|
+
try {
|
|
710
|
+
i.setItem(a, JSON.stringify(s));
|
|
711
|
+
} catch (e) {
|
|
712
|
+
console.error(e);
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
function Ge({ layout: e, panelConstraints: t }) {
|
|
716
|
+
let n = [...e], r = n.reduce((e, t) => e + t, 0);
|
|
717
|
+
if (n.length !== t.length) throw Error(`Invalid ${t.length} panel layout: ${n.map((e) => `${e}%`).join(", ")}`);
|
|
718
|
+
if (!Y(r, 100) && n.length > 0) for (let e = 0; e < t.length; e++) {
|
|
719
|
+
let t = n[e];
|
|
720
|
+
K(t != null, `No layout data found for index ${e}`), n[e] = 100 / r * t;
|
|
721
|
+
}
|
|
722
|
+
let i = 0;
|
|
723
|
+
for (let e = 0; e < t.length; e++) {
|
|
724
|
+
let r = n[e];
|
|
725
|
+
K(r != null, `No layout data found for index ${e}`);
|
|
726
|
+
let a = X({
|
|
727
|
+
panelConstraints: t,
|
|
728
|
+
panelIndex: e,
|
|
729
|
+
size: r
|
|
730
|
+
});
|
|
731
|
+
r != a && (i += r - a, n[e] = a);
|
|
732
|
+
}
|
|
733
|
+
if (!Y(i, 0)) for (let e = 0; e < t.length; e++) {
|
|
734
|
+
let r = n[e];
|
|
735
|
+
K(r != null, `No layout data found for index ${e}`);
|
|
736
|
+
let a = r + i, o = X({
|
|
737
|
+
panelConstraints: t,
|
|
738
|
+
panelIndex: e,
|
|
739
|
+
size: a
|
|
740
|
+
});
|
|
741
|
+
if (r !== o && (i -= o - r, n[e] = o, Y(i, 0))) break;
|
|
742
|
+
}
|
|
743
|
+
return n;
|
|
744
|
+
}
|
|
745
|
+
var Ke = 100, qe = {
|
|
746
|
+
getItem: (e) => (ze(qe), qe.getItem(e)),
|
|
747
|
+
setItem: (e, t) => {
|
|
748
|
+
ze(qe), qe.setItem(e, t);
|
|
749
|
+
}
|
|
750
|
+
}, Je = {};
|
|
751
|
+
function Ye({ autoSaveId: e = null, children: t, className: r = "", direction: a, forwardedRef: c, id: m = null, onLayout: g = null, keyboardResizeBy: _ = null, storage: v = qe, style: y, tagName: b = "div", ...te }) {
|
|
752
|
+
let x = ee(m), S = u(null), [C, w] = d(null), [T, E] = d([]), D = be(), O = u({}), M = u(/* @__PURE__ */ new Map()), N = u(0), P = u({
|
|
753
|
+
autoSaveId: e,
|
|
754
|
+
direction: a,
|
|
755
|
+
dragState: C,
|
|
756
|
+
id: x,
|
|
757
|
+
keyboardResizeBy: _,
|
|
758
|
+
onLayout: g,
|
|
759
|
+
storage: v
|
|
760
|
+
}), F = u({
|
|
761
|
+
layout: T,
|
|
762
|
+
panelDataArray: [],
|
|
763
|
+
panelDataArrayChanged: !1
|
|
764
|
+
});
|
|
765
|
+
u({
|
|
766
|
+
didLogIdAndOrderWarning: !1,
|
|
767
|
+
didLogPanelConstraintsWarning: !1,
|
|
768
|
+
prevPanelIds: []
|
|
769
|
+
}), s(c, () => ({
|
|
770
|
+
getId: () => P.current.id,
|
|
771
|
+
getLayout: () => {
|
|
772
|
+
let { layout: e } = F.current;
|
|
773
|
+
return e;
|
|
774
|
+
},
|
|
775
|
+
setLayout: (e) => {
|
|
776
|
+
let { onLayout: t } = P.current, { layout: n, panelDataArray: r } = F.current, i = Ge({
|
|
777
|
+
layout: e,
|
|
778
|
+
panelConstraints: r.map((e) => e.constraints)
|
|
779
|
+
});
|
|
780
|
+
je(n, i) || (E(i), F.current.layout = i, t && t(i), Z(r, i, O.current));
|
|
781
|
+
}
|
|
782
|
+
}), []), h(() => {
|
|
783
|
+
P.current.autoSaveId = e, P.current.direction = a, P.current.dragState = C, P.current.id = x, P.current.onLayout = g, P.current.storage = v;
|
|
784
|
+
}), Ae({
|
|
785
|
+
committedValuesRef: P,
|
|
786
|
+
eagerValuesRef: F,
|
|
787
|
+
groupId: x,
|
|
788
|
+
layout: T,
|
|
789
|
+
panelDataArray: F.current.panelDataArray,
|
|
790
|
+
setLayout: E,
|
|
791
|
+
panelGroupElement: S.current
|
|
792
|
+
}), o(() => {
|
|
793
|
+
let { panelDataArray: t } = F.current;
|
|
794
|
+
if (e) {
|
|
795
|
+
if (T.length === 0 || T.length !== t.length) return;
|
|
796
|
+
let n = Je[e];
|
|
797
|
+
n ?? (n = Re(We, Ke), Je[e] = n);
|
|
798
|
+
let r = [...t], i = new Map(M.current);
|
|
799
|
+
n(e, r, i, T, v);
|
|
800
|
+
}
|
|
801
|
+
}, [
|
|
802
|
+
e,
|
|
803
|
+
T,
|
|
804
|
+
v
|
|
805
|
+
]), o(() => {});
|
|
806
|
+
let I = i((e) => {
|
|
807
|
+
let { onLayout: t } = P.current, { layout: n, panelDataArray: r } = F.current;
|
|
808
|
+
if (e.constraints.collapsible) {
|
|
809
|
+
let i = r.map((e) => e.constraints), { collapsedSize: a = 0, panelSize: o, pivotIndices: s } = $(r, e, n);
|
|
810
|
+
if (K(o != null, `Panel size not found for panel "${e.id}"`), !J(o, a)) {
|
|
811
|
+
M.current.set(e.id, o);
|
|
812
|
+
let c = Se({
|
|
813
|
+
delta: Q(r, e) === r.length - 1 ? o - a : a - o,
|
|
814
|
+
initialLayout: n,
|
|
815
|
+
panelConstraints: i,
|
|
816
|
+
pivotIndices: s,
|
|
817
|
+
prevLayout: n,
|
|
818
|
+
trigger: "imperative-api"
|
|
819
|
+
});
|
|
820
|
+
Ie(n, c) || (E(c), F.current.layout = c, t && t(c), Z(r, c, O.current));
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
}, []), L = i((e, t) => {
|
|
824
|
+
let { onLayout: n } = P.current, { layout: r, panelDataArray: i } = F.current;
|
|
825
|
+
if (e.constraints.collapsible) {
|
|
826
|
+
let a = i.map((e) => e.constraints), { collapsedSize: o = 0, panelSize: s = 0, minSize: c = 0, pivotIndices: l } = $(i, e, r), u = t ?? c;
|
|
827
|
+
if (J(s, o)) {
|
|
828
|
+
let t = M.current.get(e.id), o = t != null && t >= u ? t : u, c = Se({
|
|
829
|
+
delta: Q(i, e) === i.length - 1 ? s - o : o - s,
|
|
830
|
+
initialLayout: r,
|
|
831
|
+
panelConstraints: a,
|
|
832
|
+
pivotIndices: l,
|
|
833
|
+
prevLayout: r,
|
|
834
|
+
trigger: "imperative-api"
|
|
835
|
+
});
|
|
836
|
+
Ie(r, c) || (E(c), F.current.layout = c, n && n(c), Z(i, c, O.current));
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
}, []), R = i((e) => {
|
|
840
|
+
let { layout: t, panelDataArray: n } = F.current, { panelSize: r } = $(n, e, t);
|
|
841
|
+
return K(r != null, `Panel size not found for panel "${e.id}"`), r;
|
|
842
|
+
}, []), z = i((e, t) => {
|
|
843
|
+
let { panelDataArray: n } = F.current;
|
|
844
|
+
return Le({
|
|
845
|
+
defaultSize: t,
|
|
846
|
+
dragState: C,
|
|
847
|
+
layout: T,
|
|
848
|
+
panelData: n,
|
|
849
|
+
panelIndex: Q(n, e)
|
|
850
|
+
});
|
|
851
|
+
}, [C, T]), B = i((e) => {
|
|
852
|
+
let { layout: t, panelDataArray: n } = F.current, { collapsedSize: r = 0, collapsible: i, panelSize: a } = $(n, e, t);
|
|
853
|
+
return K(a != null, `Panel size not found for panel "${e.id}"`), i === !0 && J(a, r);
|
|
854
|
+
}, []), ne = i((e) => {
|
|
855
|
+
let { layout: t, panelDataArray: n } = F.current, { collapsedSize: r = 0, collapsible: i, panelSize: a } = $(n, e, t);
|
|
856
|
+
return K(a != null, `Panel size not found for panel "${e.id}"`), !i || q(a, r) > 0;
|
|
857
|
+
}, []), re = i((e) => {
|
|
858
|
+
let { panelDataArray: t } = F.current;
|
|
859
|
+
t.push(e), t.sort((e, t) => {
|
|
860
|
+
let n = e.order, r = t.order;
|
|
861
|
+
return n == null && r == null ? 0 : n == null ? -1 : r == null ? 1 : n - r;
|
|
862
|
+
}), F.current.panelDataArrayChanged = !0, D();
|
|
863
|
+
}, [D]);
|
|
864
|
+
h(() => {
|
|
865
|
+
if (F.current.panelDataArrayChanged) {
|
|
866
|
+
F.current.panelDataArrayChanged = !1;
|
|
867
|
+
let { autoSaveId: e, onLayout: t, storage: n } = P.current, { layout: r, panelDataArray: i } = F.current, a = null;
|
|
868
|
+
if (e) {
|
|
869
|
+
let t = Ue(e, i, n);
|
|
870
|
+
t && (M.current = new Map(Object.entries(t.expandToSizes)), a = t.layout);
|
|
871
|
+
}
|
|
872
|
+
a ??= Fe({ panelDataArray: i });
|
|
873
|
+
let o = Ge({
|
|
874
|
+
layout: a,
|
|
875
|
+
panelConstraints: i.map((e) => e.constraints)
|
|
876
|
+
});
|
|
877
|
+
je(r, o) || (E(o), F.current.layout = o, t && t(o), Z(i, o, O.current));
|
|
878
|
+
}
|
|
879
|
+
}), h(() => {
|
|
880
|
+
let e = F.current;
|
|
881
|
+
return () => {
|
|
882
|
+
e.layout = [];
|
|
883
|
+
};
|
|
884
|
+
}, []);
|
|
885
|
+
let ce = i((e) => {
|
|
886
|
+
let t = !1, n = S.current;
|
|
887
|
+
return n && window.getComputedStyle(n, null).getPropertyValue("direction") === "rtl" && (t = !0), function(n) {
|
|
888
|
+
n.preventDefault();
|
|
889
|
+
let r = S.current;
|
|
890
|
+
if (!r) return () => null;
|
|
891
|
+
let { direction: i, dragState: a, id: o, keyboardResizeBy: s, onLayout: c } = P.current, { layout: l, panelDataArray: u } = F.current, { initialLayout: d } = a ?? {}, f = Ee(o, e, r), p = Pe(n, e, i, a, s, r), m = i === "horizontal";
|
|
892
|
+
m && t && (p = -p);
|
|
893
|
+
let h = u.map((e) => e.constraints), g = Se({
|
|
894
|
+
delta: p,
|
|
895
|
+
initialLayout: d ?? l,
|
|
896
|
+
panelConstraints: h,
|
|
897
|
+
pivotIndices: f,
|
|
898
|
+
prevLayout: l,
|
|
899
|
+
trigger: k(n) ? "keyboard" : "mouse-or-touch"
|
|
900
|
+
}), _ = !Ie(l, g);
|
|
901
|
+
(A(n) || j(n)) && N.current != p && (N.current = p, !_ && p !== 0 ? m ? he(e, p < 0 ? ie : ae) : he(e, p < 0 ? oe : se) : he(e, 0)), _ && (E(g), F.current.layout = g, c && c(g), Z(u, g, O.current));
|
|
902
|
+
};
|
|
903
|
+
}, []), V = i((e, t) => {
|
|
904
|
+
let { onLayout: n } = P.current, { layout: r, panelDataArray: i } = F.current, a = i.map((e) => e.constraints), { panelSize: o, pivotIndices: s } = $(i, e, r);
|
|
905
|
+
K(o != null, `Panel size not found for panel "${e.id}"`);
|
|
906
|
+
let c = Se({
|
|
907
|
+
delta: Q(i, e) === i.length - 1 ? o - t : t - o,
|
|
908
|
+
initialLayout: r,
|
|
909
|
+
panelConstraints: a,
|
|
910
|
+
pivotIndices: s,
|
|
911
|
+
prevLayout: r,
|
|
912
|
+
trigger: "imperative-api"
|
|
913
|
+
});
|
|
914
|
+
Ie(r, c) || (E(c), F.current.layout = c, n && n(c), Z(i, c, O.current));
|
|
915
|
+
}, []), H = i((e, t) => {
|
|
916
|
+
let { layout: n, panelDataArray: r } = F.current, { collapsedSize: i = 0, collapsible: a } = t, { collapsedSize: o = 0, collapsible: s, maxSize: c = 100, minSize: l = 0 } = e.constraints, { panelSize: u } = $(r, e, n);
|
|
917
|
+
u != null && (a && s && J(u, i) ? J(i, o) || V(e, o) : u < l ? V(e, l) : u > c && V(e, c));
|
|
918
|
+
}, [V]), U = i((e, t) => {
|
|
919
|
+
let { direction: n } = P.current, { layout: r } = F.current;
|
|
920
|
+
if (!S.current) return;
|
|
921
|
+
let i = Oe(e, S.current);
|
|
922
|
+
K(i, `Drag handle element not found for id "${e}"`);
|
|
923
|
+
let a = Me(n, t);
|
|
924
|
+
w({
|
|
925
|
+
dragHandleId: e,
|
|
926
|
+
dragHandleRect: i.getBoundingClientRect(),
|
|
927
|
+
initialCursorPosition: a,
|
|
928
|
+
initialLayout: r
|
|
929
|
+
});
|
|
930
|
+
}, []), W = i(() => {
|
|
931
|
+
w(null);
|
|
932
|
+
}, []), G = i((e) => {
|
|
933
|
+
let { panelDataArray: t } = F.current, n = Q(t, e);
|
|
934
|
+
n >= 0 && (t.splice(n, 1), delete O.current[e.id], F.current.panelDataArrayChanged = !0, D());
|
|
935
|
+
}, [D]), le = l(() => ({
|
|
936
|
+
collapsePanel: I,
|
|
937
|
+
direction: a,
|
|
938
|
+
dragState: C,
|
|
939
|
+
expandPanel: L,
|
|
940
|
+
getPanelSize: R,
|
|
941
|
+
getPanelStyle: z,
|
|
942
|
+
groupId: x,
|
|
943
|
+
isPanelCollapsed: B,
|
|
944
|
+
isPanelExpanded: ne,
|
|
945
|
+
reevaluatePanelConstraints: H,
|
|
946
|
+
registerPanel: re,
|
|
947
|
+
registerResizeHandle: ce,
|
|
948
|
+
resizePanel: V,
|
|
949
|
+
startDragging: U,
|
|
950
|
+
stopDragging: W,
|
|
951
|
+
unregisterPanel: G,
|
|
952
|
+
panelGroupElement: S.current
|
|
953
|
+
}), [
|
|
954
|
+
I,
|
|
955
|
+
C,
|
|
956
|
+
a,
|
|
957
|
+
L,
|
|
958
|
+
R,
|
|
959
|
+
z,
|
|
960
|
+
x,
|
|
961
|
+
B,
|
|
962
|
+
ne,
|
|
963
|
+
H,
|
|
964
|
+
re,
|
|
965
|
+
ce,
|
|
966
|
+
V,
|
|
967
|
+
U,
|
|
968
|
+
W,
|
|
969
|
+
G
|
|
970
|
+
]), ue = {
|
|
971
|
+
display: "flex",
|
|
972
|
+
flexDirection: a === "horizontal" ? "row" : "column",
|
|
973
|
+
height: "100%",
|
|
974
|
+
overflow: "hidden",
|
|
975
|
+
width: "100%"
|
|
976
|
+
};
|
|
977
|
+
return n(f.Provider, { value: le }, n(b, {
|
|
978
|
+
...te,
|
|
979
|
+
children: t,
|
|
980
|
+
className: r,
|
|
981
|
+
id: m,
|
|
982
|
+
ref: S,
|
|
983
|
+
style: {
|
|
984
|
+
...ue,
|
|
985
|
+
...y
|
|
986
|
+
},
|
|
987
|
+
[p.group]: "",
|
|
988
|
+
[p.groupDirection]: a,
|
|
989
|
+
[p.groupId]: x
|
|
990
|
+
}));
|
|
991
|
+
}
|
|
992
|
+
var Xe = r((e, t) => n(Ye, {
|
|
993
|
+
...e,
|
|
994
|
+
forwardedRef: t
|
|
995
|
+
}));
|
|
996
|
+
Ye.displayName = "PanelGroup", Xe.displayName = "forwardRef(PanelGroup)";
|
|
997
|
+
function Q(e, t) {
|
|
998
|
+
return e.findIndex((e) => e === t || e.id === t.id);
|
|
999
|
+
}
|
|
1000
|
+
function $(e, t, n) {
|
|
1001
|
+
let r = Q(e, t), i = r === e.length - 1 ? [r - 1, r] : [r, r + 1], a = n[r];
|
|
1002
|
+
return {
|
|
1003
|
+
...t.constraints,
|
|
1004
|
+
panelSize: a,
|
|
1005
|
+
pivotIndices: i
|
|
1006
|
+
};
|
|
1007
|
+
}
|
|
1008
|
+
function Ze({ disabled: e, handleId: t, resizeHandler: n, panelGroupElement: r }) {
|
|
1009
|
+
o(() => {
|
|
1010
|
+
if (e || n == null || r == null) return;
|
|
1011
|
+
let i = Oe(t, r);
|
|
1012
|
+
if (i == null) return;
|
|
1013
|
+
let a = (e) => {
|
|
1014
|
+
if (!e.defaultPrevented) switch (e.key) {
|
|
1015
|
+
case "ArrowDown":
|
|
1016
|
+
case "ArrowLeft":
|
|
1017
|
+
case "ArrowRight":
|
|
1018
|
+
case "ArrowUp":
|
|
1019
|
+
case "End":
|
|
1020
|
+
case "Home":
|
|
1021
|
+
e.preventDefault(), n(e);
|
|
1022
|
+
break;
|
|
1023
|
+
case "F6": {
|
|
1024
|
+
e.preventDefault();
|
|
1025
|
+
let n = i.getAttribute(p.groupId);
|
|
1026
|
+
K(n, `No group element found for id "${n}"`);
|
|
1027
|
+
let a = we(n, r), o = Te(n, t, r);
|
|
1028
|
+
K(o !== null, `No resize element found for id "${t}"`), a[e.shiftKey ? o > 0 ? o - 1 : a.length - 1 : o + 1 < a.length ? o + 1 : 0].focus();
|
|
1029
|
+
break;
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
};
|
|
1033
|
+
return i.addEventListener("keydown", a), () => {
|
|
1034
|
+
i.removeEventListener("keydown", a);
|
|
1035
|
+
};
|
|
1036
|
+
}, [
|
|
1037
|
+
r,
|
|
1038
|
+
e,
|
|
1039
|
+
t,
|
|
1040
|
+
n
|
|
1041
|
+
]);
|
|
1042
|
+
}
|
|
1043
|
+
function Qe({ children: e = null, className: t = "", disabled: r = !1, hitAreaMargins: i, id: s, onBlur: c, onClick: l, onDragging: m, onFocus: g, onPointerDown: _, onPointerUp: v, style: y = {}, tabIndex: b = 0, tagName: te = "div", ...x }) {
|
|
1044
|
+
let S = u(null), C = u({
|
|
1045
|
+
onClick: l,
|
|
1046
|
+
onDragging: m,
|
|
1047
|
+
onPointerDown: _,
|
|
1048
|
+
onPointerUp: v
|
|
1049
|
+
});
|
|
1050
|
+
o(() => {
|
|
1051
|
+
C.current.onClick = l, C.current.onDragging = m, C.current.onPointerDown = _, C.current.onPointerUp = v;
|
|
1052
|
+
});
|
|
1053
|
+
let w = a(f);
|
|
1054
|
+
if (w === null) throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");
|
|
1055
|
+
let { direction: T, groupId: E, registerResizeHandle: D, startDragging: O, stopDragging: k, panelGroupElement: A } = w, j = ee(s), [M, N] = d("inactive"), [P, F] = d(!1), [I, L] = d(null), R = u({ state: M });
|
|
1056
|
+
h(() => {
|
|
1057
|
+
R.current.state = M;
|
|
1058
|
+
}), o(() => {
|
|
1059
|
+
if (r) L(null);
|
|
1060
|
+
else {
|
|
1061
|
+
let e = D(j);
|
|
1062
|
+
L(() => e);
|
|
1063
|
+
}
|
|
1064
|
+
}, [
|
|
1065
|
+
r,
|
|
1066
|
+
j,
|
|
1067
|
+
D
|
|
1068
|
+
]);
|
|
1069
|
+
let z = i?.coarse ?? 15, B = i?.fine ?? 5;
|
|
1070
|
+
o(() => {
|
|
1071
|
+
if (r || I == null) return;
|
|
1072
|
+
let e = S.current;
|
|
1073
|
+
K(e, "Element ref not attached");
|
|
1074
|
+
let t = !1;
|
|
1075
|
+
return le(j, e, T, {
|
|
1076
|
+
coarse: z,
|
|
1077
|
+
fine: B
|
|
1078
|
+
}, (e, n, r) => {
|
|
1079
|
+
if (!n) {
|
|
1080
|
+
N("inactive");
|
|
1081
|
+
return;
|
|
1082
|
+
}
|
|
1083
|
+
switch (e) {
|
|
1084
|
+
case "down": {
|
|
1085
|
+
N("drag"), t = !1, K(r, "Expected event to be defined for \"down\" action"), O(j, r);
|
|
1086
|
+
let { onDragging: e, onPointerDown: n } = C.current;
|
|
1087
|
+
e?.(!0), n?.();
|
|
1088
|
+
break;
|
|
1089
|
+
}
|
|
1090
|
+
case "move": {
|
|
1091
|
+
let { state: e } = R.current;
|
|
1092
|
+
t = !0, e !== "drag" && N("hover"), K(r, "Expected event to be defined for \"move\" action"), I(r);
|
|
1093
|
+
break;
|
|
1094
|
+
}
|
|
1095
|
+
case "up": {
|
|
1096
|
+
N("hover"), k();
|
|
1097
|
+
let { onClick: e, onDragging: n, onPointerUp: r } = C.current;
|
|
1098
|
+
n?.(!1), r?.(), t || e?.();
|
|
1099
|
+
break;
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
});
|
|
1103
|
+
}, [
|
|
1104
|
+
z,
|
|
1105
|
+
T,
|
|
1106
|
+
r,
|
|
1107
|
+
B,
|
|
1108
|
+
D,
|
|
1109
|
+
j,
|
|
1110
|
+
I,
|
|
1111
|
+
O,
|
|
1112
|
+
k
|
|
1113
|
+
]), Ze({
|
|
1114
|
+
disabled: r,
|
|
1115
|
+
handleId: j,
|
|
1116
|
+
resizeHandler: I,
|
|
1117
|
+
panelGroupElement: A
|
|
1118
|
+
});
|
|
1119
|
+
let ne = {
|
|
1120
|
+
touchAction: "none",
|
|
1121
|
+
userSelect: "none"
|
|
45
1122
|
};
|
|
1123
|
+
return n(te, {
|
|
1124
|
+
...x,
|
|
1125
|
+
children: e,
|
|
1126
|
+
className: t,
|
|
1127
|
+
id: s,
|
|
1128
|
+
onBlur: () => {
|
|
1129
|
+
F(!1), c?.();
|
|
1130
|
+
},
|
|
1131
|
+
onFocus: () => {
|
|
1132
|
+
F(!0), g?.();
|
|
1133
|
+
},
|
|
1134
|
+
ref: S,
|
|
1135
|
+
role: "separator",
|
|
1136
|
+
style: {
|
|
1137
|
+
...ne,
|
|
1138
|
+
...y
|
|
1139
|
+
},
|
|
1140
|
+
tabIndex: b,
|
|
1141
|
+
[p.groupDirection]: T,
|
|
1142
|
+
[p.groupId]: E,
|
|
1143
|
+
[p.resizeHandle]: "",
|
|
1144
|
+
[p.resizeHandleActive]: M === "drag" ? "pointer" : P ? "keyboard" : void 0,
|
|
1145
|
+
[p.resizeHandleEnabled]: !r,
|
|
1146
|
+
[p.resizeHandleId]: j,
|
|
1147
|
+
[p.resizeHandleState]: M
|
|
1148
|
+
});
|
|
46
1149
|
}
|
|
1150
|
+
Qe.displayName = "PanelResizeHandle";
|
|
47
1151
|
//#endregion
|
|
48
|
-
export {
|
|
1152
|
+
export { b as Panel, Xe as PanelGroup, Qe as PanelResizeHandle };
|