@themarioga/grid-editor 4.0.0 → 4.1.0
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/CHANGELOG.md +42 -0
- package/README.md +53 -1
- package/dist/grideditor.css +148 -0
- package/dist/grideditor.min.css +1 -1
- package/dist/grideditor.min.css.map +1 -1
- package/dist/jquery.grideditor.bundle.min.js +2 -2
- package/dist/jquery.grideditor.js +555 -9
- package/dist/jquery.grideditor.min.js +1 -1
- package/dist/jquery.grideditor.min.js.map +1 -1
- package/dist/locales/grideditor.es.js +32 -0
- package/dist/locales/grideditor.es.min.js +1 -1
- package/dist/locales/grideditor.es.min.js.map +1 -1
- package/dist/plugins/grideditor.alignment.js +81 -0
- package/dist/plugins/grideditor.alignment.min.js +2 -0
- package/dist/plugins/grideditor.alignment.min.js.map +1 -0
- package/dist/plugins/grideditor.gutters.js +145 -0
- package/dist/plugins/grideditor.gutters.min.js +2 -0
- package/dist/plugins/grideditor.gutters.min.js.map +1 -0
- package/dist/plugins/grideditor.order.js +206 -0
- package/dist/plugins/grideditor.order.min.js +2 -0
- package/dist/plugins/grideditor.order.min.js.map +1 -0
- package/dist/plugins/grideditor.spacing.js +299 -0
- package/dist/plugins/grideditor.spacing.min.js +2 -0
- package/dist/plugins/grideditor.spacing.min.js.map +1 -0
- package/dist/plugins/grideditor.visibility.js +172 -0
- package/dist/plugins/grideditor.visibility.min.js +2 -0
- package/dist/plugins/grideditor.visibility.min.js.map +1 -0
- package/docs/events.md +20 -1
- package/docs/locale-keys.md +52 -0
- package/docs/plugins.md +108 -3
- package/example/autosave.html +5 -0
- package/example/basic.html +5 -0
- package/example/breakpoints.html +5 -0
- package/example/ckeditor.html +5 -0
- package/example/containers.html +4 -0
- package/example/elements.html +5 -0
- package/example/index.html +24 -1
- package/example/locale.html +5 -0
- package/example/plugins.html +5 -0
- package/example/summernote.html +5 -0
- package/example/utilities.html +145 -0
- package/example/wrap_content.html +5 -0
- package/package.json +1 -1
- package/src/js/jquery.grideditor.js +555 -9
- package/src/js/locales/grideditor.es.js +32 -0
- package/src/js/plugins/grideditor.alignment.js +81 -0
- package/src/js/plugins/grideditor.gutters.js +145 -0
- package/src/js/plugins/grideditor.order.js +206 -0
- package/src/js/plugins/grideditor.spacing.js +299 -0
- package/src/js/plugins/grideditor.visibility.js +172 -0
- package/src/less/grideditor.less +167 -0
package/docs/plugins.md
CHANGED
|
@@ -14,11 +14,13 @@ the one to read first if you are about to write your own.
|
|
|
14
14
|
<script src="dist/plugins/grideditor.elements.min.js"></script>
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
There are
|
|
17
|
+
There are three kinds. A **container plugin** builds a type of container — it
|
|
18
18
|
registers under `$.fn.gridEditor.containers`, and the toolbar offers a button
|
|
19
|
-
for it. A **
|
|
19
|
+
for it. A **utility plugin** declares families of Bootstrap's responsive
|
|
20
|
+
utility classes — `$.fn.gridEditor.utilities` — and the editor edits them per
|
|
21
|
+
breakpoint. A **feature plugin** is anything else the editor can do —
|
|
20
22
|
`$.fn.gridEditor.features`, hooks into the canvas, and may contribute methods.
|
|
21
|
-
|
|
23
|
+
All three are factories called once per editor with the same handle.
|
|
22
24
|
|
|
23
25
|
The `plugins` setting names which of the loaded ones to use:
|
|
24
26
|
|
|
@@ -114,6 +116,13 @@ not change without a major version.
|
|
|
114
116
|
| `ge.emit(name, payload)` | Fire an event and its callbacks; false means a handler canceled |
|
|
115
117
|
| `ge.payloadFor(kind, node, extra)` | Build a payload the documented way |
|
|
116
118
|
| `ge.operate(body)` | Run `body` as one operation, so a handler calling back in is queued |
|
|
119
|
+
| `ge.kindOf(node)` | What an event calls a node: `row`, `column`, `element`, a container's type… |
|
|
120
|
+
| `ge.view()` | The view being edited: a breakpoint key, or `'all'` |
|
|
121
|
+
| `ge.viewTiers()` | The breakpoint keys that view writes: one, or all six |
|
|
122
|
+
| `ge.breakpoints` | Every breakpoint key, smallest first |
|
|
123
|
+
| `ge.getUtility(node, family, view?)` | A utility's value, as in the public method |
|
|
124
|
+
| `ge.setUtility(node, family, value, options?)` | Write one through the events. `options` is a view key or `{ view, source }` |
|
|
125
|
+
| `ge.utilityField(node, family)` | A panel field for one family, for a plugin that builds its own panel |
|
|
117
126
|
|
|
118
127
|
The add, delete and move events for a container and its panes are fired by the
|
|
119
128
|
editor, not by the plugin: `createPaneControls` handles a pane's delete, and
|
|
@@ -177,3 +186,99 @@ the plugin.
|
|
|
177
186
|
Sorting is the one thing a plugin sets up itself, in `mark`, because only the
|
|
178
187
|
plugin knows which of its parts move: the tabs plugin makes its strip sortable
|
|
179
188
|
and puts the panes back in strip order in `afterPaneMove`.
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
Utility plugins
|
|
192
|
+
---------------
|
|
193
|
+
|
|
194
|
+
A utility plugin edits one of Bootstrap's responsive utility classes — the
|
|
195
|
+
ones spelled `{property}-{breakpoint}-{value}`, like `order-md-2` or
|
|
196
|
+
`d-lg-none` — and hardly has to do anything to do it. It declares **families**,
|
|
197
|
+
and the editor reads, writes, previews and announces them:
|
|
198
|
+
|
|
199
|
+
```javascript
|
|
200
|
+
$.fn.gridEditor.utilities.order = function(ge) {
|
|
201
|
+
return {
|
|
202
|
+
families: [{
|
|
203
|
+
name: 'order', // what events and setUtility call it
|
|
204
|
+
prefix: 'order', // order-2, order-md-2, order-xxl-2
|
|
205
|
+
values: ['first', 0, 1, 2, 3, 4, 5, 'last'],
|
|
206
|
+
appliesTo: ['column'], // row | column | element | container | a container type
|
|
207
|
+
labelKey: 'utility.order', // the field's label, optional
|
|
208
|
+
label: function(value) { … }, // an option's text, optional: the value itself otherwise
|
|
209
|
+
choices: function(node, kind) { … }, // what to offer this node, optional: every value otherwise
|
|
210
|
+
panel: false, // optional: no field of its own, see "A panel of your own"
|
|
211
|
+
preview: function(value, node, kind) { // what the value looks like, see below
|
|
212
|
+
return { order: value === null ? 0 : value };
|
|
213
|
+
},
|
|
214
|
+
}],
|
|
215
|
+
drawerTools: function(drawer, node, kind) { … }, // optional, tools beside the gear
|
|
216
|
+
onRefresh: function(scope) { … }, // optional, see below
|
|
217
|
+
panel: function(node, kind) { … }, // optional, see "A panel of your own"
|
|
218
|
+
preview: function(node, kind, breakpoint) { … }, // optional, the same
|
|
219
|
+
onViewChange: function(view) { … }, // optional
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
What the editor does with a family:
|
|
225
|
+
|
|
226
|
+
- **Reading follows the cascade.** A breakpoint's value is its own class or the
|
|
227
|
+
nearest smaller breakpoint's. The all view reads the class with no infix.
|
|
228
|
+
- **Writing depends on the view.** A breakpoint view writes its own tier and
|
|
229
|
+
nothing else. The all view writes the class with no infix and takes the
|
|
230
|
+
family off every other breakpoint, because choosing one value for every size
|
|
231
|
+
is choosing it over what the sizes said; the event says what it took off.
|
|
232
|
+
`null` is inherit: the tier's class comes off.
|
|
233
|
+
- **The panel.** Every node with a gear gets a folded *Responsive* section in
|
|
234
|
+
its settings panel, with a field per family that applies to it. A field shows
|
|
235
|
+
the view being edited, says what it inherits and from which breakpoint, and
|
|
236
|
+
follows the classes field when the user types there.
|
|
237
|
+
- **The preview.** A breakpoint view narrows the canvas, not the window, and
|
|
238
|
+
Bootstrap's utilities answer to the window with `!important`. So in a
|
|
239
|
+
breakpoint view each node that carries a family's class gets
|
|
240
|
+
`preview(value)` — the value that applies there, or `null` — as inline
|
|
241
|
+
`!important` styles. Return what `null` looks like too: a wider breakpoint's
|
|
242
|
+
class is still live in a wide window and has to be overruled. The all view
|
|
243
|
+
previews nothing, since every breakpoint there is live and what Bootstrap
|
|
244
|
+
shows is the truth. The styles come off on `deinit`, leaving the host's own
|
|
245
|
+
`style` as it was, so `getHtml` never sees them.
|
|
246
|
+
- **The events.** Every write goes through `before-utility`, which can cancel
|
|
247
|
+
it, and `after-utility`. See [events.md](events.md).
|
|
248
|
+
|
|
249
|
+
`drawerTools` runs for every drawer that has a gear — rows, columns, elements,
|
|
250
|
+
containers and panes — so a plugin checks `kind` and adds nothing where its
|
|
251
|
+
tool does not belong. A tool writes with `ge.setUtility(node, family, value,
|
|
252
|
+
{ source: 'tool' })`, and the panel, the classes field and the preview follow.
|
|
253
|
+
|
|
254
|
+
`onRefresh(scope)` runs whenever the preview is redrawn — on `init`, on a view
|
|
255
|
+
change, after a write, after the user types in a classes field — with the node
|
|
256
|
+
whose utilities changed, or the canvas. It is for what a plugin marks the canvas
|
|
257
|
+
with beyond inline styles: the visibility plugin keeps hidden nodes on the
|
|
258
|
+
canvas and fades them there. Whatever it adds, `onDeinit` takes away.
|
|
259
|
+
|
|
260
|
+
### A panel of your own
|
|
261
|
+
|
|
262
|
+
A field per family is the right panel for most plugins and the wrong one for
|
|
263
|
+
some: spacing has fourteen families, and fourteen fields. Such a plugin marks
|
|
264
|
+
its families `panel: false` and returns its own element from
|
|
265
|
+
`panel(node, kind)` — or null where it does not apply — and the editor puts it
|
|
266
|
+
in the Responsive section. Inside it, `ge.utilityField(node, family)` makes the
|
|
267
|
+
same field the editor would, and the editor keeps every such field up to date
|
|
268
|
+
with the view and the classes; swapping one field for another is the plugin's
|
|
269
|
+
business. The spacing plugin's panel is a side and one field, and choosing a
|
|
270
|
+
side swaps the field for that side's family.
|
|
271
|
+
|
|
272
|
+
The same plugins tend to need the node as a whole for the preview, because
|
|
273
|
+
their families settle one property between them — `p-3` and `pt-md-1` both
|
|
274
|
+
set the top padding. A plugin-level `preview(node, kind, breakpoint)` is called
|
|
275
|
+
for every node in a breakpoint view, after the families' own, and returns the
|
|
276
|
+
styles for the node or an empty object.
|
|
277
|
+
|
|
278
|
+
Two plugins cannot declare the same family name: the second one is ignored,
|
|
279
|
+
with a warning.
|
|
280
|
+
|
|
281
|
+
Plugin options live in the `utilities` setting, under the plugin's name:
|
|
282
|
+
`utilities: { spacing: { values: ['0', '2', '4'] } }`. The editor passes the
|
|
283
|
+
setting through as it is; each plugin fills in its own defaults.
|
|
284
|
+
|
package/example/autosave.html
CHANGED
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
<script src="../dist/jquery.grideditor.min.js"></script>
|
|
21
21
|
</head>
|
|
22
22
|
<body>
|
|
23
|
+
<!-- Back to the demo index -->
|
|
24
|
+
<div class="container pt-3">
|
|
25
|
+
<a class="link-secondary" href="index.html"><i class="bi bi-arrow-left"></i> All demos</a>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
23
28
|
<div class="container py-3">
|
|
24
29
|
<h2>Grid Editor example - auto save and import/export</h2>
|
|
25
30
|
<div class="mb-3">
|
package/example/basic.html
CHANGED
|
@@ -37,6 +37,11 @@
|
|
|
37
37
|
<title>Grid Editor example</title>
|
|
38
38
|
</head>
|
|
39
39
|
<body>
|
|
40
|
+
<!-- Back to the demo index -->
|
|
41
|
+
<div class="container pt-3">
|
|
42
|
+
<a class="link-secondary" href="index.html"><i class="bi bi-arrow-left"></i> All demos</a>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
40
45
|
|
|
41
46
|
<div class="container">
|
|
42
47
|
<div id="myGrid">
|
package/example/breakpoints.html
CHANGED
|
@@ -41,6 +41,11 @@
|
|
|
41
41
|
<title>Grid Editor breakpoints example</title>
|
|
42
42
|
</head>
|
|
43
43
|
<body>
|
|
44
|
+
<!-- Back to the demo index -->
|
|
45
|
+
<div class="container pt-3">
|
|
46
|
+
<a class="link-secondary" href="index.html"><i class="bi bi-arrow-left"></i> All demos</a>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
44
49
|
|
|
45
50
|
<div class="container">
|
|
46
51
|
|
package/example/ckeditor.html
CHANGED
|
@@ -47,6 +47,11 @@
|
|
|
47
47
|
<title>Grid Editor example</title>
|
|
48
48
|
</head>
|
|
49
49
|
<body>
|
|
50
|
+
<!-- Back to the demo index -->
|
|
51
|
+
<div class="container pt-3">
|
|
52
|
+
<a class="link-secondary" href="index.html"><i class="bi bi-arrow-left"></i> All demos</a>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
50
55
|
|
|
51
56
|
<div class="container">
|
|
52
57
|
<div id="myGrid">
|
package/example/containers.html
CHANGED
|
@@ -70,6 +70,10 @@
|
|
|
70
70
|
<title>Grid Editor containers example</title>
|
|
71
71
|
</head>
|
|
72
72
|
<body>
|
|
73
|
+
<!-- Back to the demo index -->
|
|
74
|
+
<div class="container pt-3">
|
|
75
|
+
<a class="link-secondary" href="index.html"><i class="bi bi-arrow-left"></i> All demos</a>
|
|
76
|
+
</div>
|
|
73
77
|
|
|
74
78
|
<div class="container">
|
|
75
79
|
|
package/example/elements.html
CHANGED
|
@@ -89,6 +89,11 @@
|
|
|
89
89
|
<title>Grid Editor elements example</title>
|
|
90
90
|
</head>
|
|
91
91
|
<body>
|
|
92
|
+
<!-- Back to the demo index -->
|
|
93
|
+
<div class="container pt-3">
|
|
94
|
+
<a class="link-secondary" href="index.html"><i class="bi bi-arrow-left"></i> All demos</a>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
92
97
|
|
|
93
98
|
<div class="container">
|
|
94
99
|
|
package/example/index.html
CHANGED
|
@@ -21,6 +21,21 @@
|
|
|
21
21
|
<code>npm run build</code> after changing anything under
|
|
22
22
|
<code>src/</code>.
|
|
23
23
|
</p>
|
|
24
|
+
<p class="text-body-secondary">
|
|
25
|
+
Since 4.0 every gesture works with a finger as well as with a
|
|
26
|
+
mouse — sorting, resizing a column, dragging a button off the
|
|
27
|
+
toolbar — so these are worth opening on a phone. The editor
|
|
28
|
+
needs jQuery, <a href="https://sortablejs.github.io/Sortable/">SortableJS</a>
|
|
29
|
+
and Bootstrap 5; the first demo loads
|
|
30
|
+
<code>jquery.grideditor.bundle.min.js</code> instead, which is the
|
|
31
|
+
editor and SortableJS in one file.
|
|
32
|
+
</p>
|
|
33
|
+
<p class="text-body-secondary">
|
|
34
|
+
New in 4.1: utility plugins, which edit Bootstrap's responsive
|
|
35
|
+
utility classes — visibility, column order, alignment,
|
|
36
|
+
gutters and spacing — per breakpoint. See
|
|
37
|
+
<a href="utilities.html">Responsive utilities</a>.
|
|
38
|
+
</p>
|
|
24
39
|
|
|
25
40
|
<div class="list-group my-4">
|
|
26
41
|
|
|
@@ -29,7 +44,7 @@
|
|
|
29
44
|
<strong>The editor</strong>
|
|
30
45
|
<code class="text-body-secondary">basic.html</code>
|
|
31
46
|
</div>
|
|
32
|
-
<span class="text-body-secondary">tinyMCE in the content areas,
|
|
47
|
+
<span class="text-body-secondary">tinyMCE in the content areas, the drawer as the drag handle, and the bundled build</span>
|
|
33
48
|
</a>
|
|
34
49
|
|
|
35
50
|
<a class="list-group-item list-group-item-action" href="plugins.html">
|
|
@@ -64,6 +79,14 @@
|
|
|
64
79
|
<span class="text-body-secondary">The six breakpoints, the “all sizes” view, and resizing by dragging</span>
|
|
65
80
|
</a>
|
|
66
81
|
|
|
82
|
+
<a class="list-group-item list-group-item-action" href="utilities.html">
|
|
83
|
+
<div class="d-flex justify-content-between">
|
|
84
|
+
<strong>Responsive utilities</strong>
|
|
85
|
+
<code class="text-body-secondary">utilities.html</code>
|
|
86
|
+
</div>
|
|
87
|
+
<span class="text-body-secondary">Bootstrap's utility classes edited per breakpoint: visibility, column order, alignment, gutters and spacing</span>
|
|
88
|
+
</a>
|
|
89
|
+
|
|
67
90
|
<a class="list-group-item list-group-item-action" href="locale.html">
|
|
68
91
|
<div class="d-flex justify-content-between">
|
|
69
92
|
<strong>Languages</strong>
|
package/example/locale.html
CHANGED
|
@@ -41,6 +41,11 @@
|
|
|
41
41
|
<title>Grid Editor locale example</title>
|
|
42
42
|
</head>
|
|
43
43
|
<body>
|
|
44
|
+
<!-- Back to the demo index -->
|
|
45
|
+
<div class="container pt-3">
|
|
46
|
+
<a class="link-secondary" href="index.html"><i class="bi bi-arrow-left"></i> All demos</a>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
44
49
|
|
|
45
50
|
<div class="container">
|
|
46
51
|
|
package/example/plugins.html
CHANGED
|
@@ -111,6 +111,11 @@
|
|
|
111
111
|
<title>Grid Editor plugins example</title>
|
|
112
112
|
</head>
|
|
113
113
|
<body>
|
|
114
|
+
<!-- Back to the demo index -->
|
|
115
|
+
<div class="container pt-3">
|
|
116
|
+
<a class="link-secondary" href="index.html"><i class="bi bi-arrow-left"></i> All demos</a>
|
|
117
|
+
</div>
|
|
118
|
+
|
|
114
119
|
|
|
115
120
|
<div class="container">
|
|
116
121
|
|
package/example/summernote.html
CHANGED
|
@@ -49,6 +49,11 @@
|
|
|
49
49
|
<title>Grid Editor example</title>
|
|
50
50
|
</head>
|
|
51
51
|
<body>
|
|
52
|
+
<!-- Back to the demo index -->
|
|
53
|
+
<div class="container pt-3">
|
|
54
|
+
<a class="link-secondary" href="index.html"><i class="bi bi-arrow-left"></i> All demos</a>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
52
57
|
|
|
53
58
|
<div class="container">
|
|
54
59
|
<div id="myGrid">
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
5
|
+
|
|
6
|
+
<!-- CSS dependencies -->
|
|
7
|
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
|
|
8
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.css">
|
|
9
|
+
|
|
10
|
+
<!-- Javascript dependencies -->
|
|
11
|
+
<script src="https://code.jquery.com/jquery-4.0.0.min.js"></script>
|
|
12
|
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"></script>
|
|
13
|
+
|
|
14
|
+
<!-- Grid editor CSS -->
|
|
15
|
+
<link rel="stylesheet" type="text/css" href="../dist/grideditor.css" />
|
|
16
|
+
|
|
17
|
+
<!-- The editor, and the utility plugins. Each is a file of its own, and
|
|
18
|
+
loading it is what puts its field in the settings panels. -->
|
|
19
|
+
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.6/Sortable.min.js"></script>
|
|
20
|
+
<script src="../dist/jquery.grideditor.min.js"></script>
|
|
21
|
+
<script src="../dist/plugins/grideditor.visibility.min.js"></script>
|
|
22
|
+
<script src="../dist/plugins/grideditor.order.min.js"></script>
|
|
23
|
+
<script src="../dist/plugins/grideditor.alignment.min.js"></script>
|
|
24
|
+
<script src="../dist/plugins/grideditor.gutters.min.js"></script>
|
|
25
|
+
<script src="../dist/plugins/grideditor.spacing.min.js"></script>
|
|
26
|
+
|
|
27
|
+
<script>
|
|
28
|
+
$(function() {
|
|
29
|
+
$('#myGrid').gridEditor({
|
|
30
|
+
new_row_layouts: [[12], [6,6], [4,4,4], [8,4]],
|
|
31
|
+
content_types: [],
|
|
32
|
+
|
|
33
|
+
// Utilities are edited per breakpoint, so this page starts in
|
|
34
|
+
// one. Switch to "All sizes" to see the page as it will render.
|
|
35
|
+
default_view: 'xs',
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// Every change to a utility is announced, like any other operation
|
|
39
|
+
$('#myGrid').on('grideditor:after-utility', function(e, payload) {
|
|
40
|
+
$('#last').text(payload.family + ' at ' + payload.breakpoint + ': ' +
|
|
41
|
+
(payload.from === null ? 'default' : payload.from) + ' → ' +
|
|
42
|
+
(payload.to === null ? 'inherit' : payload.to));
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
$('#output').on('click', function() {
|
|
46
|
+
$('#html').text($('#myGrid').gridEditor('getHtml'));
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<title>Grid Editor utilities example</title>
|
|
52
|
+
</head>
|
|
53
|
+
<body>
|
|
54
|
+
<!-- Back to the demo index -->
|
|
55
|
+
<div class="container pt-3">
|
|
56
|
+
<a class="link-secondary" href="index.html"><i class="bi bi-arrow-left"></i> All demos</a>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
<div class="container">
|
|
61
|
+
|
|
62
|
+
<div class="row my-3">
|
|
63
|
+
<div class="col-lg-8">
|
|
64
|
+
<h1 class="h4">Responsive utilities</h1>
|
|
65
|
+
<p class="form-text">
|
|
66
|
+
Bootstrap's responsive utility classes, edited per
|
|
67
|
+
breakpoint. Pick a breakpoint in the dropdown and every
|
|
68
|
+
change is written for that breakpoint alone; in
|
|
69
|
+
<strong>All sizes</strong> it is written once, for every
|
|
70
|
+
size. Each drawer's gear has a <strong>Responsive</strong>
|
|
71
|
+
section with a field per utility, which says what the
|
|
72
|
+
breakpoint inherits and from where.
|
|
73
|
+
</p>
|
|
74
|
+
<p class="form-text">
|
|
75
|
+
<strong>Visibility:</strong> the eye in a drawer hides the
|
|
76
|
+
node in the view being edited. It stays on the canvas,
|
|
77
|
+
faded, so you can show it again; in All sizes a badge says
|
|
78
|
+
at which breakpoints it is hidden. The sidebar below is
|
|
79
|
+
hidden on phones and tablets.
|
|
80
|
+
</p>
|
|
81
|
+
<p class="form-text">
|
|
82
|
+
<strong>Order:</strong> the arrows in a column's drawer
|
|
83
|
+
move it earlier or later in the view being edited,
|
|
84
|
+
without moving the markup. In the second row, "Second"
|
|
85
|
+
comes first on phones only.
|
|
86
|
+
</p>
|
|
87
|
+
<p class="form-text">
|
|
88
|
+
<strong>Alignment:</strong> fields in the panel of a row
|
|
89
|
+
(justify and align its columns) and of a column (align
|
|
90
|
+
itself). The third row centres its narrow column from
|
|
91
|
+
small desktop up.
|
|
92
|
+
</p>
|
|
93
|
+
<p class="form-text">
|
|
94
|
+
<strong>Gutters:</strong> fields in a row's panel. A row
|
|
95
|
+
with gutter classes is drawn with its real gutters; the
|
|
96
|
+
second row has none on phones and wide ones from small
|
|
97
|
+
desktop up.
|
|
98
|
+
</p>
|
|
99
|
+
<p class="form-text">
|
|
100
|
+
<strong>Spacing:</strong> a padding and a margin group in
|
|
101
|
+
every panel, each a side and a value. The centred column
|
|
102
|
+
below gets more padding from small desktop up.
|
|
103
|
+
</p>
|
|
104
|
+
<p class="form-text">Last change: <span id="last">none yet</span></p>
|
|
105
|
+
<button class="btn btn-sm btn-secondary" id="output" type="button">Show the html this produces</button>
|
|
106
|
+
<pre id="html" class="form-text"></pre>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<div id="myGrid">
|
|
111
|
+
|
|
112
|
+
<div class="row">
|
|
113
|
+
<div class="col-12 col-md-8">
|
|
114
|
+
<h2 class="h5">Main content</h2>
|
|
115
|
+
<p>Full width on phones and tablets, two thirds from small desktop up.</p>
|
|
116
|
+
</div>
|
|
117
|
+
<div class="col-12 col-md-4 d-none d-md-block">
|
|
118
|
+
<h2 class="h5">Sidebar</h2>
|
|
119
|
+
<p>Only from small desktop up: <code>d-none d-md-block</code>.</p>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<div class="row g-0 g-md-5">
|
|
124
|
+
<div class="col-6">
|
|
125
|
+
<h2 class="h5">First</h2>
|
|
126
|
+
<p>Change the views and the utilities of these two.</p>
|
|
127
|
+
</div>
|
|
128
|
+
<div class="col-6 order-first order-sm-0">
|
|
129
|
+
<h2 class="h5">Second</h2>
|
|
130
|
+
<p>First on phones, with <code>order-first order-sm-0</code>.</p>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
<div class="row justify-content-md-center">
|
|
135
|
+
<div class="col-12 col-md-6 py-2 py-md-4">
|
|
136
|
+
<h2 class="h5">Centred</h2>
|
|
137
|
+
<p>Its row has <code>justify-content-md-center</code>, and it has <code>py-2 py-md-4</code>.</p>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
</div> <!-- /#myGrid -->
|
|
142
|
+
</div> <!-- /.container -->
|
|
143
|
+
|
|
144
|
+
</body>
|
|
145
|
+
</html>
|
|
@@ -35,6 +35,11 @@
|
|
|
35
35
|
<title>Grid Editor example</title>
|
|
36
36
|
</head>
|
|
37
37
|
<body>
|
|
38
|
+
<!-- Back to the demo index -->
|
|
39
|
+
<div class="container pt-3">
|
|
40
|
+
<a class="link-secondary" href="index.html"><i class="bi bi-arrow-left"></i> All demos</a>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
38
43
|
<div id="myGrid">
|
|
39
44
|
<h1>Hello!</h1>
|
|
40
45
|
<p>Test</p>
|