@themarioga/grid-editor 9.2.6 → 9.4.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 +57 -0
- package/README.md +109 -5
- package/dist/grideditor.bundle.min.js +2 -2
- package/dist/grideditor.css +329 -0
- package/dist/grideditor.d.ts +125 -0
- package/dist/grideditor.esm.js +27 -5
- package/dist/grideditor.js +27 -5
- package/dist/grideditor.min.css +1 -1
- package/dist/grideditor.min.css.map +1 -1
- package/dist/grideditor.min.js +1 -1
- package/dist/grideditor.min.js.map +3 -3
- package/dist/locales/grideditor.es.esm.js +125 -0
- package/dist/locales/grideditor.es.js +125 -0
- package/dist/locales/grideditor.es.min.js +1 -1
- package/dist/locales/grideditor.es.min.js.map +2 -2
- package/dist/plugins/grideditor.dropdown.esm.js +2231 -0
- package/dist/plugins/grideditor.dropdown.js +2232 -0
- package/dist/plugins/grideditor.dropdown.min.js +1 -0
- package/dist/plugins/grideditor.dropdown.min.js.map +7 -0
- package/dist/plugins/grideditor.navbar.esm.js +2188 -0
- package/dist/plugins/grideditor.navbar.js +2189 -0
- package/dist/plugins/grideditor.navbar.min.js +1 -0
- package/dist/plugins/grideditor.navbar.min.js.map +7 -0
- package/dist/plugins/grideditor.sidenav.esm.js +2082 -0
- package/dist/plugins/grideditor.sidenav.js +2083 -0
- package/dist/plugins/grideditor.sidenav.min.js +1 -0
- package/dist/plugins/grideditor.sidenav.min.js.map +7 -0
- package/docs/events.md +5 -1
- package/docs/locale-keys.md +126 -1
- package/docs/plugins.md +24 -4
- package/example/containers.html +93 -2
- package/example/index.html +1 -1
- package/example/playground.html +3 -0
- package/package.json +1 -1
- package/src/js/grideditor.js +36 -4
- package/src/js/locales/grideditor.es.js +125 -0
- package/src/js/nav/browse.js +51 -0
- package/src/js/nav/canvas.js +170 -0
- package/src/js/nav/convert.js +179 -0
- package/src/js/nav/drawers.js +290 -0
- package/src/js/nav/dropdown.js +253 -0
- package/src/js/nav/feature.js +113 -0
- package/src/js/nav/locale.js +128 -0
- package/src/js/nav/markup.js +121 -0
- package/src/js/nav/panels.js +454 -0
- package/src/js/nav/pieces.js +253 -0
- package/src/js/plugins/grideditor.dropdown.js +335 -0
- package/src/js/plugins/grideditor.navbar.js +454 -0
- package/src/js/plugins/grideditor.sidenav.js +349 -0
- package/src/less/grideditor.less +231 -0
- package/types/grideditor.d.ts +125 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sidebars for grid-editor: a vertical navigation, as in Bootstrap's
|
|
3
|
+
* Sidebars example.
|
|
4
|
+
*
|
|
5
|
+
* A container plugin: load this file after the editor and the toolbar offers
|
|
6
|
+
* a sidebar - a brand, lists of links, dropdowns or collapsible submenus,
|
|
7
|
+
* texts and free zones of rows and columns - that below a breakpoint of your
|
|
8
|
+
* choice becomes an offcanvas a button opens. It is called `sidenav` because
|
|
9
|
+
* the editor's `sidebar` setting is its own settings panel.
|
|
10
|
+
*
|
|
11
|
+
* <script src="dist/grideditor.min.js"></script>
|
|
12
|
+
* <script src="dist/plugins/grideditor.sidenav.min.js"></script>
|
|
13
|
+
*
|
|
14
|
+
* It is edited as the navbar plugin's navbar is: every piece has a drawer,
|
|
15
|
+
* its text is renamed where it stands, and its options are in the settings
|
|
16
|
+
* panel.
|
|
17
|
+
*
|
|
18
|
+
* new GridEditor('#myGrid', { sidenav: { width: '20rem', responsive: 'lg' } });
|
|
19
|
+
* ge.createContainer('sidenav', { brand: 'ACME', full_height: true });
|
|
20
|
+
*/
|
|
21
|
+
import { GridEditor } from '../grideditor.js';
|
|
22
|
+
import * as dom from '../dom.js';
|
|
23
|
+
import { EN, BACKGROUND_CHOICES } from '../nav/locale.js';
|
|
24
|
+
import * as pieces from '../nav/pieces.js';
|
|
25
|
+
import * as markup from '../nav/markup.js';
|
|
26
|
+
import { registerNav } from '../nav/feature.js';
|
|
27
|
+
import { containerBase } from '../nav/canvas.js';
|
|
28
|
+
import { fieldRow, selectControl, checkControl, textControl, markInvalid, sectionsOf } from '../nav/panels.js';
|
|
29
|
+
|
|
30
|
+
Object.assign(GridEditor.locales.en, EN, { 'container.add_sidenav': 'Sidebar' });
|
|
31
|
+
|
|
32
|
+
registerNav();
|
|
33
|
+
|
|
34
|
+
var BACKGROUNDS = BACKGROUND_CHOICES.map(function(each) { return each.value; });
|
|
35
|
+
var FULL_HEIGHT = 'vh-100 sticky-top overflow-y-auto';
|
|
36
|
+
|
|
37
|
+
/** What a sidenav made new has when neither the call nor the setting says. */
|
|
38
|
+
var DEFAULTS = {
|
|
39
|
+
width: '280px',
|
|
40
|
+
bg: 'body-tertiary',
|
|
41
|
+
theme: null,
|
|
42
|
+
style: 'pills',
|
|
43
|
+
full_height: false,
|
|
44
|
+
responsive: null,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
GridEditor.containers.sidenav = function(ge) {
|
|
48
|
+
var base = containerBase(ge, 'sidenav');
|
|
49
|
+
var baseMark = base.mark;
|
|
50
|
+
var BREAKPOINTS = ge.breakpoints.filter(function(key) { return key !== 'xs'; });
|
|
51
|
+
var sections = sectionsOf();
|
|
52
|
+
|
|
53
|
+
var VALUES = {
|
|
54
|
+
bg: [null].concat(BACKGROUNDS),
|
|
55
|
+
theme: [null, 'light', 'dark'],
|
|
56
|
+
style: ['pills', 'plain'],
|
|
57
|
+
responsive: [null].concat(BREAKPOINTS),
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/** A width the browser takes: a text that is not blank, and that `width` accepts. */
|
|
61
|
+
function widthOk(panel, value) {
|
|
62
|
+
return typeof value === 'string' && value.trim() !== '' && ge.setHostStyle(panel, 'width', value) !== false;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* A value for a new sidenav: the option, or the sidenav setting, or the
|
|
67
|
+
* default. One the option does not take is warned about and the default
|
|
68
|
+
* used.
|
|
69
|
+
*/
|
|
70
|
+
function chosen(options, key, panel) {
|
|
71
|
+
var setting = ge.settings.sidenav || {};
|
|
72
|
+
var value = options[key] !== undefined ? options[key] : setting[key];
|
|
73
|
+
|
|
74
|
+
if (value === undefined) { return DEFAULTS[key]; }
|
|
75
|
+
|
|
76
|
+
if (key === 'width') {
|
|
77
|
+
if (widthOk(panel, value)) { return value; }
|
|
78
|
+
|
|
79
|
+
ge.warn('sidenav: ' + JSON.stringify(value) + ' is not a width: ' + JSON.stringify(DEFAULTS.width) + ' is used');
|
|
80
|
+
return DEFAULTS.width;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
var valid = key === 'full_height' ? typeof value === 'boolean' : VALUES[key].indexOf(value) !== -1;
|
|
84
|
+
if (valid) { return value; }
|
|
85
|
+
|
|
86
|
+
ge.warn('sidenav: ' + JSON.stringify(value) + ' is not a ' + key + ', which takes ' +
|
|
87
|
+
JSON.stringify(key === 'full_height' ? [true, false] : VALUES[key]) + ': ' + JSON.stringify(DEFAULTS[key]) + ' is used');
|
|
88
|
+
return DEFAULTS[key];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function brandOf(options) {
|
|
92
|
+
var brand = options.brand;
|
|
93
|
+
|
|
94
|
+
if (brand === undefined) { return ge.t('container.sidenav_brand'); }
|
|
95
|
+
if (brand === false || (typeof brand === 'string' && brand !== '')) { return brand; }
|
|
96
|
+
|
|
97
|
+
ge.warn('sidenav: ' + JSON.stringify(brand) + ' is not a brand, which takes a text or false: ' +
|
|
98
|
+
JSON.stringify(ge.t('container.sidenav_brand')) + ' is used');
|
|
99
|
+
return ge.t('container.sidenav_brand');
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function offcanvasClassOf(panel) {
|
|
103
|
+
return Array.prototype.filter.call(panel.classList, function(name) {
|
|
104
|
+
return /^offcanvas-(sm|md|lg|xl|xxl)$/.test(name);
|
|
105
|
+
})[0] || null;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** What a sidenav's classes say it is. */
|
|
109
|
+
function read(container) {
|
|
110
|
+
var panel = pieces.panelOf(container);
|
|
111
|
+
var lists = dom.children(panel, 'ul.nav');
|
|
112
|
+
var bg = BACKGROUNDS.filter(function(name) { return dom.hasClass(panel, 'bg-' + name); })[0];
|
|
113
|
+
var responsive = offcanvasClassOf(panel);
|
|
114
|
+
|
|
115
|
+
return {
|
|
116
|
+
brand: !!dom.child(panel, 'a[data-ge-nav="brand"]'),
|
|
117
|
+
width: ge.hostStyle(panel, 'width').value,
|
|
118
|
+
bg: bg === undefined ? null : bg,
|
|
119
|
+
theme: panel.getAttribute('data-bs-theme') || null,
|
|
120
|
+
style: lists.length && !dom.hasClass(lists[0], 'nav-pills') ? 'plain' : 'pills',
|
|
121
|
+
full_height: dom.hasClass(panel, 'vh-100'),
|
|
122
|
+
responsive: responsive ? responsive.slice(10) : null,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function makeTrigger(id, breakpoint, label) {
|
|
127
|
+
return dom.element('button', {
|
|
128
|
+
'class': 'btn btn-outline-secondary d-' + breakpoint + '-none',
|
|
129
|
+
type: 'button',
|
|
130
|
+
'data-bs-toggle': 'offcanvas',
|
|
131
|
+
'data-bs-target': '#' + id,
|
|
132
|
+
'aria-controls': id,
|
|
133
|
+
}, label);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function makeHeader(id) {
|
|
137
|
+
var header = dom.element('div', { 'class': 'offcanvas-header' });
|
|
138
|
+
|
|
139
|
+
header.appendChild(dom.element('h5', { 'class': 'offcanvas-title', id: id + '-label' },
|
|
140
|
+
ge.t('container.sidenav_offcanvas_title')));
|
|
141
|
+
header.appendChild(dom.element('button', {
|
|
142
|
+
type: 'button',
|
|
143
|
+
'class': 'btn-close',
|
|
144
|
+
'data-bs-dismiss': 'offcanvas',
|
|
145
|
+
'data-bs-target': '#' + id,
|
|
146
|
+
'aria-label': ge.t('container.nav_close'),
|
|
147
|
+
}));
|
|
148
|
+
|
|
149
|
+
return header;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** The panel an offcanvas below `value`, or a panel that is always there. */
|
|
153
|
+
function setResponsive(container, value, label) {
|
|
154
|
+
var panel = pieces.panelOf(container);
|
|
155
|
+
var before = offcanvasClassOf(panel);
|
|
156
|
+
var trigger = pieces.triggerOf(container);
|
|
157
|
+
var id = panel.id || ge.containerId('sidenav');
|
|
158
|
+
|
|
159
|
+
if (before) { dom.removeClass(panel, before); }
|
|
160
|
+
|
|
161
|
+
if (value === null) {
|
|
162
|
+
dom.removeClass(panel, 'offcanvas-start');
|
|
163
|
+
['id', 'tabindex', 'aria-labelledby'].forEach(function(name) { panel.removeAttribute(name); });
|
|
164
|
+
dom.children(panel, '.offcanvas-header').forEach(function(header) { header.remove(); });
|
|
165
|
+
if (trigger) { trigger.remove(); }
|
|
166
|
+
dom.dropEmptyClass(panel);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
dom.addClass(panel, 'offcanvas-' + value);
|
|
171
|
+
dom.addClass(panel, 'offcanvas-start');
|
|
172
|
+
panel.setAttribute('id', id);
|
|
173
|
+
panel.setAttribute('tabindex', '-1');
|
|
174
|
+
panel.setAttribute('aria-labelledby', id + '-label');
|
|
175
|
+
|
|
176
|
+
if (!dom.child(panel, '.offcanvas-header')) { panel.insertBefore(makeHeader(id), panel.firstChild); }
|
|
177
|
+
|
|
178
|
+
if (trigger) {
|
|
179
|
+
dom.removeClass(trigger, before ? 'd-' + before.slice(10) + '-none' : '');
|
|
180
|
+
dom.addClass(trigger, 'd-' + value + '-none');
|
|
181
|
+
} else {
|
|
182
|
+
container.insertBefore(makeTrigger(id, value, label || ge.t('container.sidenav_trigger')), panel);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function setBrand(container, text) {
|
|
187
|
+
var panel = pieces.panelOf(container);
|
|
188
|
+
var brand = dom.child(panel, 'a[data-ge-nav="brand"]');
|
|
189
|
+
|
|
190
|
+
if (text === false) {
|
|
191
|
+
if (brand) { brand.remove(); }
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
if (brand) { return; }
|
|
195
|
+
|
|
196
|
+
var after = dom.child(panel, '.offcanvas-header');
|
|
197
|
+
var made = dom.element('a', {
|
|
198
|
+
'class': 'd-flex align-items-center mb-3 link-body-emphasis text-decoration-none fs-4',
|
|
199
|
+
href: '#',
|
|
200
|
+
'data-ge-nav': 'brand',
|
|
201
|
+
}, text);
|
|
202
|
+
|
|
203
|
+
panel.insertBefore(made, after ? after.nextSibling : panel.firstChild);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function write(container, key, value, label) {
|
|
207
|
+
var panel = pieces.panelOf(container);
|
|
208
|
+
|
|
209
|
+
if (key === 'width') { ge.setHostStyle(panel, 'width', value); }
|
|
210
|
+
|
|
211
|
+
if (key === 'bg') {
|
|
212
|
+
Array.prototype.filter.call(panel.classList, function(name) { return /^bg-/.test(name); })
|
|
213
|
+
.forEach(function(name) { panel.classList.remove(name); });
|
|
214
|
+
if (value !== null) { dom.addClass(panel, 'bg-' + value); }
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (key === 'theme') {
|
|
218
|
+
if (value === null) { panel.removeAttribute('data-bs-theme'); } else { panel.setAttribute('data-bs-theme', value); }
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (key === 'style') {
|
|
222
|
+
dom.children(panel, 'ul.nav').forEach(function(list) { dom.toggleClass(list, 'nav-pills', value === 'pills'); });
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (key === 'full_height') {
|
|
226
|
+
dom.toggleClass(panel, FULL_HEIGHT, value);
|
|
227
|
+
dom.dropEmptyClass(panel);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (key === 'responsive') { setResponsive(container, value, label); }
|
|
231
|
+
if (key === 'brand') { setBrand(container, value); }
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/** The Sidebar section of a sidenav's settings panel. */
|
|
235
|
+
function createSection(container) {
|
|
236
|
+
var body = dom.element('div', { 'class': 'ge-nav-options' });
|
|
237
|
+
var fields = {};
|
|
238
|
+
|
|
239
|
+
function change(key, value) {
|
|
240
|
+
write(container, key, value);
|
|
241
|
+
baseMark(container);
|
|
242
|
+
sections.render();
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function select(name, label, choices, onChange) {
|
|
246
|
+
var field = selectControl(choices, onChange);
|
|
247
|
+
|
|
248
|
+
fields[name] = field.control;
|
|
249
|
+
body.appendChild(fieldRow(name, label, field.control, field.id));
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
var brand = checkControl(ge.t('container.nav_brand_show'), function(on) {
|
|
253
|
+
write(container, 'brand', on ? ge.t('container.sidenav_brand') : false);
|
|
254
|
+
baseMark(container);
|
|
255
|
+
sections.render();
|
|
256
|
+
});
|
|
257
|
+
brand.box.setAttribute('data-ge-nav-option', 'brand');
|
|
258
|
+
body.appendChild(brand.box);
|
|
259
|
+
|
|
260
|
+
var width = textControl(function(value) {
|
|
261
|
+
var panel = pieces.panelOf(container);
|
|
262
|
+
var valid = widthOk(panel, value);
|
|
263
|
+
|
|
264
|
+
markInvalid(width.control, !valid);
|
|
265
|
+
});
|
|
266
|
+
fields.width = width.control;
|
|
267
|
+
body.appendChild(fieldRow('width', ge.t('container.sidenav_width'), width.control, width.id));
|
|
268
|
+
|
|
269
|
+
select('bg', ge.t('container.nav_bg'), [{ value: 'none', label: ge.t('container.nav_bg_none') }].concat(
|
|
270
|
+
BACKGROUND_CHOICES.map(function(each) { return { value: each.value, label: ge.t(each.labelKey) }; })
|
|
271
|
+
), function(value) { change('bg', value === 'none' ? null : value); });
|
|
272
|
+
|
|
273
|
+
select('theme', ge.t('container.nav_theme'), [
|
|
274
|
+
{ value: 'auto', label: ge.t('container.nav_theme_auto') },
|
|
275
|
+
{ value: 'light', label: ge.t('container.nav_theme_light') },
|
|
276
|
+
{ value: 'dark', label: ge.t('container.nav_theme_dark') },
|
|
277
|
+
], function(value) { change('theme', value === 'auto' ? null : value); });
|
|
278
|
+
|
|
279
|
+
select('style', ge.t('container.sidenav_style'), [
|
|
280
|
+
{ value: 'pills', label: ge.t('container.sidenav_style_pills') },
|
|
281
|
+
{ value: 'plain', label: ge.t('container.sidenav_style_plain') },
|
|
282
|
+
], function(value) { change('style', value); });
|
|
283
|
+
|
|
284
|
+
var full = checkControl(ge.t('container.sidenav_full_height'), function(on) { change('full_height', on); });
|
|
285
|
+
full.box.setAttribute('data-ge-nav-option', 'full_height');
|
|
286
|
+
body.appendChild(full.box);
|
|
287
|
+
|
|
288
|
+
select('responsive', ge.t('container.sidenav_responsive'), [
|
|
289
|
+
{ value: 'never', label: ge.t('container.sidenav_responsive_never') },
|
|
290
|
+
].concat(BREAKPOINTS.map(function(key) {
|
|
291
|
+
return { value: key, label: ge.t('container.sidenav_responsive_from', { breakpoint: key }) };
|
|
292
|
+
})), function(value) { change('responsive', value === 'never' ? null : value); });
|
|
293
|
+
|
|
294
|
+
function render() {
|
|
295
|
+
var values = read(container);
|
|
296
|
+
|
|
297
|
+
brand.input.checked = values.brand;
|
|
298
|
+
width.control.value = values.width;
|
|
299
|
+
markInvalid(width.control, false);
|
|
300
|
+
fields.bg.value = values.bg === null ? 'none' : values.bg;
|
|
301
|
+
fields.theme.value = values.theme === null ? 'auto' : values.theme;
|
|
302
|
+
fields.style.value = values.style;
|
|
303
|
+
full.input.checked = values.full_height;
|
|
304
|
+
fields.responsive.value = values.responsive === null ? 'never' : values.responsive;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
render();
|
|
308
|
+
sections.add({ node: container, element: body, render: render });
|
|
309
|
+
|
|
310
|
+
return body;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
return Object.assign(base, {
|
|
314
|
+
labelKey: 'container.add_sidenav',
|
|
315
|
+
|
|
316
|
+
create: function(options) {
|
|
317
|
+
options = options || {};
|
|
318
|
+
|
|
319
|
+
var container = dom.element('div', { 'data-ge-container': 'sidenav' });
|
|
320
|
+
var panel = container.appendChild(dom.element('div', { 'class': 'd-flex flex-column flex-shrink-0 p-3' }));
|
|
321
|
+
|
|
322
|
+
var width = chosen(options, 'width', panel);
|
|
323
|
+
var pills = chosen(options, 'style') === 'pills';
|
|
324
|
+
var brand = brandOf(options);
|
|
325
|
+
|
|
326
|
+
ge.setHostStyle(panel, 'width', width);
|
|
327
|
+
if (brand !== false) { setBrand(container, brand); }
|
|
328
|
+
panel.appendChild(markup.list(ge, 'sidenav', pills, 3));
|
|
329
|
+
|
|
330
|
+
write(container, 'bg', chosen(options, 'bg'));
|
|
331
|
+
write(container, 'theme', chosen(options, 'theme'));
|
|
332
|
+
write(container, 'full_height', chosen(options, 'full_height'));
|
|
333
|
+
write(container, 'responsive', chosen(options, 'responsive'),
|
|
334
|
+
typeof options.trigger_label === 'string' && options.trigger_label !== '' ? options.trigger_label : undefined);
|
|
335
|
+
|
|
336
|
+
return container;
|
|
337
|
+
},
|
|
338
|
+
|
|
339
|
+
panelSection: function(node, kind) {
|
|
340
|
+
if (kind !== 'sidenav' || !pieces.panelOf(node)) { return null; }
|
|
341
|
+
|
|
342
|
+
return { labelKey: 'container.sidenav_section', body: createSection(node) };
|
|
343
|
+
},
|
|
344
|
+
|
|
345
|
+
onRefresh: function(scope) { sections.render(scope); },
|
|
346
|
+
|
|
347
|
+
onDeinit: function() { sections.clear(); },
|
|
348
|
+
});
|
|
349
|
+
};
|
package/src/less/grideditor.less
CHANGED
|
@@ -1325,6 +1325,237 @@ html.ge-sidebar-open {
|
|
|
1325
1325
|
.column.ge-resizing > .ge-tools-drawer > .ge-resize-size {
|
|
1326
1326
|
display: block;
|
|
1327
1327
|
}
|
|
1328
|
+
|
|
1329
|
+
/* Navbars and sidenavs. Every piece has a small drawer beside its text,
|
|
1330
|
+
the part that folds is open and so are the menus, and nothing of
|
|
1331
|
+
Bootstrap's javascript is involved: what it would open on a click is
|
|
1332
|
+
rendered open here. */
|
|
1333
|
+
[data-ge-container="navbar"],
|
|
1334
|
+
[data-ge-container="sidenav"],
|
|
1335
|
+
[data-ge-container="dropdown"] {
|
|
1336
|
+
.ge-nav-link,
|
|
1337
|
+
.ge-nav-dropdown,
|
|
1338
|
+
.ge-nav-menu-item {
|
|
1339
|
+
display: flex;
|
|
1340
|
+
flex-wrap: wrap;
|
|
1341
|
+
align-items: center;
|
|
1342
|
+
|
|
1343
|
+
> a,
|
|
1344
|
+
> h6,
|
|
1345
|
+
> span,
|
|
1346
|
+
> hr {
|
|
1347
|
+
flex: 1 1 auto;
|
|
1348
|
+
}
|
|
1349
|
+
> .dropdown-menu,
|
|
1350
|
+
> .collapse {
|
|
1351
|
+
flex: 0 0 100%;
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
.ge-nav-text,
|
|
1355
|
+
.ge-nav-brand {
|
|
1356
|
+
align-items: center;
|
|
1357
|
+
|
|
1358
|
+
> .ge-pane-drawer {
|
|
1359
|
+
margin-right: 4px;
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
.ge-nav-text {
|
|
1363
|
+
display: inline-flex;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
/* Rows and columns in a free zone are an ordinary region */
|
|
1367
|
+
.ge-nav-zone {
|
|
1368
|
+
min-width: 10rem;
|
|
1369
|
+
padding: @editGutter;
|
|
1370
|
+
outline: 1px dashed @containerColor;
|
|
1371
|
+
outline-offset: -2px;
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
/* A menu is shown open, in its place, and folded away with its tool */
|
|
1375
|
+
.ge-nav-dropdown > .dropdown-menu {
|
|
1376
|
+
display: block;
|
|
1377
|
+
position: static;
|
|
1378
|
+
float: none;
|
|
1379
|
+
transform: none;
|
|
1380
|
+
margin: 0;
|
|
1381
|
+
}
|
|
1382
|
+
.ge-nav-dropdown > .collapse {
|
|
1383
|
+
display: block;
|
|
1384
|
+
}
|
|
1385
|
+
.ge-nav-dropdown.ge-nav-folded {
|
|
1386
|
+
> .dropdown-menu,
|
|
1387
|
+
> .collapse {
|
|
1388
|
+
display: none;
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
/* A dropdown on its own: its menu is open, in its place and below the
|
|
1394
|
+
buttons whichever the direction, since a menu beside them would cover
|
|
1395
|
+
what is next to it. The free content of a menu is a region of rows. */
|
|
1396
|
+
[data-ge-container="dropdown"] {
|
|
1397
|
+
/* The buttons side by side and the menu under both, as wide as they are or as it needs */
|
|
1398
|
+
.btn-group {
|
|
1399
|
+
display: inline-grid;
|
|
1400
|
+
grid-template-columns: repeat(2, auto);
|
|
1401
|
+
justify-content: start;
|
|
1402
|
+
}
|
|
1403
|
+
.btn-group > .dropdown-menu {
|
|
1404
|
+
grid-column: 1 / -1;
|
|
1405
|
+
grid-row: 2;
|
|
1406
|
+
}
|
|
1407
|
+
.dropdown-menu {
|
|
1408
|
+
display: block;
|
|
1409
|
+
position: static;
|
|
1410
|
+
float: none;
|
|
1411
|
+
transform: none;
|
|
1412
|
+
margin: 2px 0 0;
|
|
1413
|
+
}
|
|
1414
|
+
div.dropdown-menu {
|
|
1415
|
+
min-width: 10rem;
|
|
1416
|
+
outline: 1px dashed @containerColor;
|
|
1417
|
+
outline-offset: -2px;
|
|
1418
|
+
}
|
|
1419
|
+
.ge-nav-folded .dropdown-menu {
|
|
1420
|
+
display: none;
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
/* The part of a navbar that folds is shown open, whichever the window.
|
|
1425
|
+
Expanded, Bootstrap's own rules, which are !important, win */
|
|
1426
|
+
[data-ge-container="navbar"] {
|
|
1427
|
+
.navbar-collapse.collapse:not(.show) {
|
|
1428
|
+
display: block;
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
/* An offcanvas is a block in place: Bootstrap fixes it to the
|
|
1432
|
+
window and hides it until its javascript shows it */
|
|
1433
|
+
.offcanvas {
|
|
1434
|
+
position: static;
|
|
1435
|
+
z-index: auto;
|
|
1436
|
+
visibility: visible;
|
|
1437
|
+
transform: none;
|
|
1438
|
+
transition: none;
|
|
1439
|
+
width: auto;
|
|
1440
|
+
height: auto;
|
|
1441
|
+
max-width: none;
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
/* A sidenav that becomes an offcanvas: the button and the panel both
|
|
1446
|
+
show, at any width, as the offcanvas plugin's do */
|
|
1447
|
+
[data-ge-container="sidenav"] {
|
|
1448
|
+
> button {
|
|
1449
|
+
display: inline-block !important;
|
|
1450
|
+
margin-bottom: @editGutter;
|
|
1451
|
+
}
|
|
1452
|
+
each(@ge-offcanvases, {
|
|
1453
|
+
> .@{value} {
|
|
1454
|
+
position: static;
|
|
1455
|
+
z-index: auto;
|
|
1456
|
+
visibility: visible;
|
|
1457
|
+
transform: none;
|
|
1458
|
+
transition: none;
|
|
1459
|
+
max-width: none;
|
|
1460
|
+
display: flex;
|
|
1461
|
+
|
|
1462
|
+
> .offcanvas-header {
|
|
1463
|
+
display: flex;
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
});
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
/* A navbar kept in place by Bootstrap's fixed-* and sticky-* would cover
|
|
1471
|
+
the editor: on the canvas it stays where it is in the page, the preview's
|
|
1472
|
+
too */
|
|
1473
|
+
.ge-canvas [data-ge-container="navbar"] {
|
|
1474
|
+
&.fixed-top,
|
|
1475
|
+
&.fixed-bottom,
|
|
1476
|
+
&.sticky-top,
|
|
1477
|
+
&.sticky-bottom {
|
|
1478
|
+
position: static !important;
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
/* A breakpoint view narrows the canvas, not the window, and Bootstrap's
|
|
1483
|
+
classes answer to the window: so the navbar plugin says how the view lays
|
|
1484
|
+
a navbar out, and that is what shows - in the preview too. The selectors
|
|
1485
|
+
outweigh Bootstrap's !important utilities. In the all view there is no
|
|
1486
|
+
attribute, and the window decides */
|
|
1487
|
+
.ge-canvas {
|
|
1488
|
+
[data-ge-navbar-layout="collapsed"] {
|
|
1489
|
+
.navbar-toggler {
|
|
1490
|
+
display: block !important;
|
|
1491
|
+
}
|
|
1492
|
+
.navbar-collapse {
|
|
1493
|
+
display: none !important;
|
|
1494
|
+
flex-basis: 100% !important;
|
|
1495
|
+
|
|
1496
|
+
&.show,
|
|
1497
|
+
&.collapsing {
|
|
1498
|
+
display: block !important;
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
.navbar-nav {
|
|
1502
|
+
flex-direction: column !important;
|
|
1503
|
+
|
|
1504
|
+
.dropdown-menu {
|
|
1505
|
+
position: static !important;
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
[data-ge-navbar-layout="expanded"] {
|
|
1510
|
+
.navbar-toggler {
|
|
1511
|
+
display: none !important;
|
|
1512
|
+
}
|
|
1513
|
+
.navbar-collapse {
|
|
1514
|
+
display: flex !important;
|
|
1515
|
+
flex-basis: auto !important;
|
|
1516
|
+
flex-grow: 1;
|
|
1517
|
+
}
|
|
1518
|
+
.navbar-nav {
|
|
1519
|
+
flex-direction: row !important;
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
/* The same while editing: the part that folds is open, and an offcanvas is
|
|
1525
|
+
a block with its header when collapsed and plain content when expanded */
|
|
1526
|
+
.ge-canvas.ge-editing {
|
|
1527
|
+
[data-ge-navbar-layout="collapsed"] {
|
|
1528
|
+
.navbar-collapse {
|
|
1529
|
+
display: block !important;
|
|
1530
|
+
}
|
|
1531
|
+
.offcanvas {
|
|
1532
|
+
background-color: var(--bs-offcanvas-bg) !important;
|
|
1533
|
+
border: var(--bs-offcanvas-border-width) solid var(--bs-offcanvas-border-color) !important;
|
|
1534
|
+
|
|
1535
|
+
> .offcanvas-header {
|
|
1536
|
+
display: flex !important;
|
|
1537
|
+
}
|
|
1538
|
+
> .offcanvas-body {
|
|
1539
|
+
display: block !important;
|
|
1540
|
+
padding: var(--bs-offcanvas-padding-y) var(--bs-offcanvas-padding-x) !important;
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
[data-ge-navbar-layout="expanded"] {
|
|
1545
|
+
.offcanvas {
|
|
1546
|
+
background-color: transparent !important;
|
|
1547
|
+
border-width: 0 !important;
|
|
1548
|
+
|
|
1549
|
+
> .offcanvas-header {
|
|
1550
|
+
display: none !important;
|
|
1551
|
+
}
|
|
1552
|
+
> .offcanvas-body {
|
|
1553
|
+
display: flex !important;
|
|
1554
|
+
flex-grow: 0;
|
|
1555
|
+
padding: 0 !important;
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1328
1559
|
}
|
|
1329
1560
|
|
|
1330
1561
|
/* drawer_overflow: 'menu'. A drawer keeps its tools to one line; the ones
|