|
1 | | -'use strict'; |
| 1 | +"use strict"; |
2 | 2 |
|
3 | 3 | module.exports = [ |
4 | 4 | { |
5 | | - title: 'Showcase', |
6 | | - source: 'showcase', |
| 5 | + title: "Showcase", |
| 6 | + source: "showcase", |
7 | 7 | paragraphs: [ |
8 | | - 'React-Grid-Layout is a grid layout system for React. It features auto-packing, draggable and resizable ' + |
9 | | - 'widgets, static widgets, a fluid layout, and separate layouts per responsive breakpoint.', |
10 | | - 'Try it out! Drag some boxes around, resize them, and resize the window to see the responsive breakpoints.' |
| 8 | + "React-Grid-Layout is a grid layout system for React. It features auto-packing, draggable and resizable " + |
| 9 | + "widgets, static widgets, a fluid layout, and separate layouts per responsive breakpoint.", |
| 10 | + "Try it out! Drag some boxes around, resize them, and resize the window to see the responsive breakpoints." |
11 | 11 | ] |
12 | 12 | }, |
13 | 13 | { |
14 | | - title: 'Basic', |
15 | | - source: 'basic', |
| 14 | + title: "Basic", |
| 15 | + source: "basic", |
16 | 16 | paragraphs: [ |
17 | | - 'Try dragging the elements around.', |
18 | | - 'This is a basic, non-responsive layout with dragging and resizing. Usage is very simple.' |
| 17 | + "Try dragging the elements around.", |
| 18 | + "This is a basic, non-responsive layout with dragging and resizing. Usage is very simple." |
19 | 19 | ] |
20 | 20 | }, |
21 | 21 | { |
22 | | - title: 'No Dragging', |
23 | | - source: 'no-dragging', |
| 22 | + title: "No Dragging", |
| 23 | + source: "no-dragging", |
24 | 24 | paragraphs: [ |
25 | | - 'This particular example has dragging and resizing turned off.' |
| 25 | + "This particular example has dragging and resizing turned off." |
26 | 26 | ] |
27 | 27 | }, |
28 | 28 | { |
29 | | - title: 'Messy', |
30 | | - source: 'messy', |
| 29 | + title: "Messy", |
| 30 | + source: "messy", |
31 | 31 | paragraphs: [ |
32 | | - 'This demo shows what happens when elements are placed randomly all over the layout.', |
33 | | - 'RGL does not auto-pack in the same fashion as other projects, such as jQuery Masonry. Packing is only done ' + |
34 | | - 'in the vertical dimension. If objects all have the same width, they will be packed efficiently.', |
35 | | - 'If a layout is fed to RGL that has items with incorrect dimensions (width too big, overlapping other elements, ' + |
36 | | - 'out of bounds, etc), they will be automatically corrected on startup. See the ' + |
37 | | - 'source of this demo, where elements are placed randomly in the layout.' |
| 32 | + "This demo shows what happens when elements are placed randomly all over the layout.", |
| 33 | + "RGL does not auto-pack in the same fashion as other projects, such as jQuery Masonry. Packing is only done " + |
| 34 | + "in the vertical dimension. If objects all have the same width, they will be packed efficiently.", |
| 35 | + "If a layout is fed to RGL that has items with incorrect dimensions (width too big, overlapping other elements, " + |
| 36 | + "out of bounds, etc), they will be automatically corrected on startup. See the " + |
| 37 | + "source of this demo, where elements are placed randomly in the layout." |
38 | 38 | ] |
39 | 39 | }, |
40 | 40 | { |
41 | | - title: 'Grid Item Properties', |
42 | | - source: 'grid-property', |
| 41 | + title: "Grid Item Properties", |
| 42 | + source: "grid-property", |
43 | 43 | paragraphs: [ |
44 | | - 'This demo uses a layout assigned on the grid items themselves as the <code>data-grid</code> property.', |
| 44 | + "This demo uses a layout assigned on the grid items themselves as the <code>data-grid</code> property." |
45 | 45 | ] |
46 | 46 | }, |
47 | 47 | { |
48 | | - title: 'Static Elements', |
49 | | - source: 'static-elements', |
| 48 | + title: "Static Elements", |
| 49 | + source: "static-elements", |
50 | 50 | paragraphs: [ |
51 | | - 'This demo sets an item to <code>static</code>. Static elements cannot be moved or resized. Other elements ' + |
52 | | - 'move themselves around a static element.' |
| 51 | + "This demo sets an item to <code>static</code>. Static elements cannot be moved or resized. Other elements " + |
| 52 | + "move themselves around a static element." |
53 | 53 | ] |
54 | 54 | }, |
55 | 55 | { |
56 | | - title: 'Dynamic Add/Remove', |
57 | | - source: 'dynamic-add-remove', |
| 56 | + title: "Dynamic Add/Remove", |
| 57 | + source: "dynamic-add-remove", |
58 | 58 | paragraphs: [ |
59 | | - 'This demo shows what happens when items are dynamically added and removed.', |
| 59 | + "This demo shows what happens when items are dynamically added and removed.", |
60 | 60 | 'You can remove an item by clicking its "x", and add a new one with the button.', |
61 | | - 'To further illustration RGL\'s capacities, this particular example is responsive. Trying resizing the window.' |
| 61 | + "To further illustration RGL's capacities, this particular example is responsive. Trying resizing the window." |
62 | 62 | ] |
63 | 63 | }, |
64 | 64 | { |
65 | | - title: 'LocalStorage', |
66 | | - source: 'localstorage', |
| 65 | + title: "LocalStorage", |
| 66 | + source: "localstorage", |
67 | 67 | paragraphs: [ |
68 | | - 'This simple demo synchronizes to localStorage.', |
69 | | - 'Try moving and resizing elements, then reloading.' |
| 68 | + "This simple demo synchronizes to localStorage.", |
| 69 | + "Try moving and resizing elements, then reloading." |
70 | 70 | ] |
71 | 71 | }, |
72 | 72 | { |
73 | | - title: 'Responsive with LocalStorage', |
74 | | - source: 'localstorage-responsive', |
| 73 | + title: "Responsive with LocalStorage", |
| 74 | + source: "localstorage-responsive", |
75 | 75 | paragraphs: [ |
76 | | - 'This simple demo synchronizes to localStorage for each responsive breakpoint.', |
77 | | - 'Try moving and resizing elements, changing window width, moving some more, and refreshing.', |
78 | | - 'Each breakpoint has a separate layout. The <code>onLayoutChange</code> callback calls back with ' + |
79 | | - 'a hash of breakpoints to layouts, which is then synchronized to localStorage.' |
| 76 | + "This simple demo synchronizes to localStorage for each responsive breakpoint.", |
| 77 | + "Try moving and resizing elements, changing window width, moving some more, and refreshing.", |
| 78 | + "Each breakpoint has a separate layout. The <code>onLayoutChange</code> callback calls back with " + |
| 79 | + "a hash of breakpoints to layouts, which is then synchronized to localStorage." |
80 | 80 | ] |
81 | 81 | }, |
82 | 82 | { |
83 | | - title: 'Minimum and Maximum Width/Height', |
84 | | - source: 'min-max-wh', |
| 83 | + title: "Minimum and Maximum Width/Height", |
| 84 | + source: "min-max-wh", |
85 | 85 | paragraphs: [ |
86 | | - 'You can set min and max dimensions on a grid item by using the `minW`, `maxW`, `minH`, and `maxH` properties.', |
87 | | - 'In this demo, the min and max dimensions are generated automatically. Try resizing the items below.', |
88 | | - 'If your mins and maxes collide: for example min > max, or the initial dimensions are out of range, ' + |
89 | | - 'an error will be thrown.' |
| 86 | + "You can set min and max dimensions on a grid item by using the `minW`, `maxW`, `minH`, and `maxH` properties.", |
| 87 | + "In this demo, the min and max dimensions are generated automatically. Try resizing the items below.", |
| 88 | + "If your mins and maxes collide: for example min > max, or the initial dimensions are out of range, " + |
| 89 | + "an error will be thrown." |
90 | 90 | ] |
91 | 91 | }, |
92 | 92 | { |
93 | | - title: 'Dynamic Minimum and Maximum Width/Height', |
94 | | - source: 'dynamic-min-max-wh', |
| 93 | + title: "Dynamic Minimum and Maximum Width/Height", |
| 94 | + source: "dynamic-min-max-wh", |
95 | 95 | paragraphs: [ |
96 | | - 'Your application may have more complex rules for determining an element\'s mins and maxes. This demo ' + |
97 | | - 'demonstrates how to use the `onResize` handler to accomplish this.', |
98 | | - 'In this grid, all elements are allowed a max width of 2 if the height < 3, ' + |
99 | | - 'and a min width of 2 if the height >= 3.' |
| 96 | + "Your application may have more complex rules for determining an element's mins and maxes. This demo " + |
| 97 | + "demonstrates how to use the `onResize` handler to accomplish this.", |
| 98 | + "In this grid, all elements are allowed a max width of 2 if the height < 3, " + |
| 99 | + "and a min width of 2 if the height >= 3." |
100 | 100 | ] |
101 | 101 | }, |
102 | 102 | { |
103 | | - title: 'No Vertical Compacting (Free Movement)', |
104 | | - source: 'no-vertical-compact', |
| 103 | + title: "No Vertical Compacting (Free Movement)", |
| 104 | + source: "no-vertical-compact", |
105 | 105 | paragraphs: [ |
106 | | - 'You may want to turn off vertical compacting so items can be placed anywhere in the grid. Set the ' + |
107 | | - 'property `verticalCompact` to `false` to achieve this effect.' |
| 106 | + "You may want to turn off vertical compacting so items can be placed anywhere in the grid. Set the " + |
| 107 | + "property `verticalCompact` to `false` to achieve this effect." |
108 | 108 | ] |
109 | 109 | }, |
110 | 110 | { |
111 | | - title: 'Prevent Collision', |
112 | | - source: 'prevent-collision', |
| 111 | + title: "Prevent Collision", |
| 112 | + source: "prevent-collision", |
113 | 113 | paragraphs: [ |
114 | | - 'You may want to turn off rearrangement so items don\'t move arround when dragging. Set the ' + |
115 | | - 'property `preventCollision` to `true` to achieve this effect. ' + |
116 | | - 'It\'s particularly useful with `verticalCompact` set to `false`.' |
| 114 | + "You may want to turn off rearrangement so items don't move arround when dragging. Set the " + |
| 115 | + "property `preventCollision` to `true` to achieve this effect. " + |
| 116 | + "It's particularly useful with `verticalCompact` set to `false`." |
117 | 117 | ] |
118 | 118 | }, |
119 | 119 | { |
120 | | - title: 'Error Case', |
121 | | - source: 'error-case', |
| 120 | + title: "Error Case", |
| 121 | + source: "error-case", |
122 | 122 | paragraphs: [ |
123 | | - 'This is an extra test case for a collision bug fixed in November 2017. When you drag 1 over 2, it should not ' + |
124 | | - 'move over 3.' |
| 123 | + "This is an extra test case for a collision bug fixed in November 2017. When you drag 1 over 2, it should not " + |
| 124 | + "move over 3." |
125 | 125 | ] |
126 | 126 | }, |
| 127 | + { |
| 128 | + title: "Toolbox", |
| 129 | + source: "toolbox", |
| 130 | + paragraphs: [ |
| 131 | + "This demonstrates how to implement a toolbox to add and remove widgets." |
| 132 | + ] |
| 133 | + } |
127 | 134 | ]; |
0 commit comments