@@ -6,85 +6,88 @@ import { argsTypes } from "../../types/args.types.ts";
66import { normalizeArgs } from " ../../utils" ;
77
88import exampleImg from " ../../assets/small-image.jpg" ;
9+ import { useTransformComponent } from " ../../../hooks" ;
910
10- export const Template = (args ) => (
11- <TransformWrapper { ... normalizeArgs (args )} >
12- <TransformComponent
13- wrapperStyle = { { maxWidth: " 100%" , maxHeight: " calc(100vh - 50px)" }}
14- >
15- <div style = { { background: " #444" , color: " white" , padding: " 50px" }} >
16- <h1 >No scrollbars needed</h1 >
17- <h2 >Use mouse or gestures to move around</h2 >
18- <button
19- onClick = { () => alert (" You can still interact with click events!" )}
20- >
21- Click me!
22- </button >
23- <div
24- style = { {
25- display: " flex" ,
26- overflow: " auto" ,
27- maxWidth: " 100%" ,
28- padding: " 10px" ,
29- }}
30- >
31- <div
32- style = { {
33- width: " 100px" ,
34- height: " 100px" ,
35- padding: " 10px" ,
36- background: " red" ,
37- }}
38- className = " panningDisabled"
11+ export const Template = (args ) => {
12+ return (
13+ <TransformWrapper { ... normalizeArgs (args )} >
14+ <TransformComponent
15+ wrapperStyle = { { maxWidth: " 100%" , maxHeight: " calc(100vh - 50px)" }}
16+ >
17+ <div style = { { background: " #444" , color: " white" , padding: " 50px" }} >
18+ <h1 >No scrollbars needed</h1 >
19+ <h2 >Use mouse or gestures to move around</h2 >
20+ <button
21+ onClick = { () => alert (" You can still interact with click events!" )}
3922 >
40- Panning is DISABLED on this element
41- </div >
42- <div
43- style = { {
44- width: " 100px" ,
45- height: " 100px" ,
46- padding: " 10px" ,
47- background: " blue" ,
48- }}
49- className = " wheelDisabled"
50- >
51- Wheel is DISABLED on this element
52- </div >
23+ Click me!
24+ </button >
5325 <div
5426 style = { {
55- width: " 100px" ,
56- height: " 100px" ,
27+ display: " flex" ,
28+ overflow: " auto" ,
29+ maxWidth: " 100%" ,
5730 padding: " 10px" ,
58- background: " green" ,
5931 }}
60- className = " pinchDisabled"
6132 >
62- Pinch is DISABLED on this element
33+ <div
34+ style = { {
35+ width: " 100px" ,
36+ height: " 100px" ,
37+ padding: " 10px" ,
38+ background: " red" ,
39+ }}
40+ className = " panningDisabled"
41+ >
42+ Panning is DISABLED on this element
43+ </div >
44+ <div
45+ style = { {
46+ width: " 100px" ,
47+ height: " 100px" ,
48+ padding: " 10px" ,
49+ background: " blue" ,
50+ }}
51+ className = " wheelDisabled"
52+ >
53+ Wheel is DISABLED on this element
54+ </div >
55+ <div
56+ style = { {
57+ width: " 100px" ,
58+ height: " 100px" ,
59+ padding: " 10px" ,
60+ background: " green" ,
61+ }}
62+ className = " pinchDisabled"
63+ >
64+ Pinch is DISABLED on this element
65+ </div >
6366 </div >
67+ <p >
68+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
69+ eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
70+ ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
71+ aliquip ex ea commodo consequat. Duis aute irure dolor in
72+ reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
73+ pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
74+ culpa qui officia deserunt mollit anim id est laborum
75+ </p >
76+ <img src = { exampleImg } alt = " " />
77+ <p >
78+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
79+ eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
80+ ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
81+ aliquip ex ea commodo consequat. Duis aute irure dolor in
82+ reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
83+ pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
84+ culpa qui officia deserunt mollit anim id est laborum
85+ </p >
6486 </div >
65- <p >
66- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
67- eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
68- minim veniam, quis nostrud exercitation ullamco laboris nisi ut
69- aliquip ex ea commodo consequat. Duis aute irure dolor in
70- reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
71- pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
72- culpa qui officia deserunt mollit anim id est laborum
73- </p >
74- <img src = { exampleImg } alt = " " />
75- <p >
76- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
77- eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
78- minim veniam, quis nostrud exercitation ullamco laboris nisi ut
79- aliquip ex ea commodo consequat. Duis aute irure dolor in
80- reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
81- pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
82- culpa qui officia deserunt mollit anim id est laborum
83- </p >
84- </div >
85- </TransformComponent >
86- </TransformWrapper >
87- );
87+ </TransformComponent >
88+ </TransformWrapper >
89+ );
90+ };
8891
8992<Meta
9093 title = " Examples/Mixed Content"
0 commit comments