1- import { Box , Callout , Code , Header } from "react-lib-tools" ;
2- import { html as DisabledPanelHTML } from "../../public/generated/examples/DisabledPanel.json" ;
3- import { html as DisabledPanelAndSeparatorHTML } from "../../public/generated/examples/DisabledPanelAndSeparator.json" ;
4- import { html as DisabledPanelsHTML } from "../../public/generated/examples/DisabledPanels.json" ;
5- import { html as DisabledSeparatorHTML } from "../../public/generated/examples/DisabledSeparator.json" ;
6- import { Link } from "../components/Link" ;
1+ import { Box } from "react-lib-tools" ;
72import { Group } from "../components/styled-panels/Group" ;
83import { Panel } from "../components/styled-panels/Panel" ;
9- import { Separator } from "../components/styled-panels/Separator" ;
104
115export default function DisabledPanelsRoute ( ) {
126 return (
137 < Box direction = "column" gap = { 4 } >
14- < Header section = "Examples" title = "Disabling interactions" />
15- < div >
16- < code > Panel</ code > and < code > Separator</ code > components can be disabled
17- to disable or limit resize behavior. Below are a few examples of how
18- this can be used to implement different types of UIs.
19- </ div >
20- < div >
21- In groups with only two panels, disabling a separator is sufficient to
22- completely prevent resizing.
23- </ div >
24- < Code html = { DisabledSeparatorHTML } />
25- < Group >
26- < Panel minSize = { 50 } > left</ Panel >
27- < Separator disabled />
28- < Panel minSize = { 50 } > right</ Panel >
29- </ Group >
30- < div >
31- The same applies to disabling one or both panels when there is no
32- explicit separator element.
33- </ div >
34- < Callout intent = "primary" >
35- Note this is functionally the same as disabling the entire{ " " }
36- < code > Group</ code > component.
37- </ Callout >
38- < Code html = { DisabledPanelsHTML } />
398 < Group >
409 < Panel disabled minSize = { 50 } >
4110 left
@@ -44,62 +13,6 @@ export default function DisabledPanelsRoute() {
4413 right
4514 </ Panel >
4615 </ Group >
47- < div >
48- In groups with three or more panels, disabling a separator does not
49- completely prevent a panel from being resized. In the example below,
50- resizing the center panel can indirectly cause the left panel to be
51- resized as well.
52- </ div >
53- < Group >
54- < Panel minSize = { 50 } > left</ Panel >
55- < Separator disabled />
56- < Panel minSize = { 50 } > center</ Panel >
57- < Separator />
58- < Panel minSize = { 50 } > right</ Panel >
59- </ Group >
60- < div >
61- Disabling a panel prevents it from being resized, though its separator
62- can still be used to resize other panels.
63- </ div >
64- < Code html = { DisabledPanelHTML } />
65- < Group >
66- < Panel minSize = { 50 } > left</ Panel >
67- < Separator />
68- < Panel disabled minSize = { 50 } >
69- center (disabled)
70- </ Panel >
71- < Separator />
72- < Panel minSize = { 50 } > right</ Panel >
73- </ Group >
74- < div >
75- When there is no separator, a disabled panel's edges can also be used to
76- resize other panels.
77- </ div >
78- < Group >
79- < Panel minSize = { 50 } > left</ Panel >
80- < Panel disabled minSize = { 50 } >
81- center (disabled)
82- </ Panel >
83- < Panel minSize = { 50 } > right</ Panel >
84- </ Group >
85- < div >
86- You can also disable both a panel and its separator to completely
87- prevent them from being resized or interacted with in any way.
88- </ div >
89- < Code html = { DisabledPanelAndSeparatorHTML } />
90- < Group >
91- < Panel disabled minSize = { 50 } >
92- left (disabled)
93- </ Panel >
94- < Separator disabled />
95- < Panel minSize = { 50 } > center</ Panel >
96- < Separator />
97- < Panel minSize = { 50 } > right</ Panel >
98- </ Group >
99- < Callout intent = "primary" >
100- Note that a disabled < code > Panel</ code > can still be resized using the{ " " }
101- < Link to = "/imperative-api/panel" > imperative API</ Link > .
102- </ Callout >
10316 </ Box >
10417 ) ;
10518}
0 commit comments