@bagelink/vue 1.15.127 → 1.15.129
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/dist/components/layout/AppContent.vue.d.ts.map +1 -1
- package/dist/components/layout/AppLayout.vue.d.ts.map +1 -1
- package/dist/index.cjs +33 -33
- package/dist/index.mjs +1966 -1972
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/layout/AppContent.vue +38 -15
- package/src/components/layout/AppLayout.vue +14 -2
- package/src/styles/layout.css +10 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { computed, useSlots } from 'vue'
|
|
3
3
|
import { Btn, PageTitle } from '@bagelink/vue'
|
|
4
|
-
import { useAppLayout
|
|
4
|
+
import { useAppLayout } from './appLayoutContext'
|
|
5
5
|
|
|
6
6
|
/** How the header is framed against the page body. */
|
|
7
7
|
type HeaderVariant = 'border' | 'card' | 'none'
|
|
@@ -118,16 +118,10 @@ const isContained = computed(() => !!props.maxWidth)
|
|
|
118
118
|
const slots = useSlots()
|
|
119
119
|
const hasCenter = computed(() => !!slots['header-center'])
|
|
120
120
|
|
|
121
|
-
// AppLayout already wraps the default slot in `.page-content`, which applies the
|
|
122
|
-
// content gutter (`--bgl-content-padding`). When AppContent lives inside that
|
|
123
|
-
// slot it would add its OWN gutter on top → doubled padding on the header and a
|
|
124
|
-
// misaligned body. Detect the nesting so the template can neutralise the parent
|
|
125
|
-
// gutter and own the spacing itself (keeping header + body aligned).
|
|
126
|
-
const insideLayout = useIsInsideAppLayout()
|
|
127
121
|
</script>
|
|
128
122
|
|
|
129
123
|
<template>
|
|
130
|
-
<div class="app-content h-100p flex column" :class="{ 'app-content--
|
|
124
|
+
<div class="app-content h-100p flex column" :class="{ 'app-content--contained': isContained }" :style="headerVars">
|
|
131
125
|
<!-- Header — fixed *minimum* height on every breakpoint so its start
|
|
132
126
|
corner sits in the exact same spot on every page. When content needs
|
|
133
127
|
more room (e.g. mobile) it wraps downward from that floor instead of
|
|
@@ -219,17 +213,36 @@ transition: all 0.15s ease-in;
|
|
|
219
213
|
overflow: hidden;
|
|
220
214
|
}
|
|
221
215
|
|
|
216
|
+
/* Gutter ownership, breakpoint-aware (see AppLayout `.page-content`):
|
|
217
|
+
• Desktop — `.page-content` supplies the gutter, so an AppContent nested in it drops
|
|
218
|
+
its OWN inline padding to avoid doubling; header + body align with the parent edge.
|
|
219
|
+
• Mobile — `.page-content` drops its gutter, so AppContent keeps its own padding
|
|
220
|
+
(declared in the scoped block): the header runs edge-to-edge (its border reaches
|
|
221
|
+
the screen) while its content stays inset. A standalone AppContent (no
|
|
222
|
+
`.page-content` ancestor) always keeps its own padding — this rule simply doesn't
|
|
223
|
+
match there. Unscoped because `.page-content` belongs to AppLayout's scope. */
|
|
224
|
+
@media screen and (min-width: 911px) {
|
|
225
|
+
/* Repeated class (`.app-content.app-content`) lifts specificity above AppContent's
|
|
226
|
+
own scoped `.app-header[data-v]` / `.pageContent[data-v]` padding rule (which is
|
|
227
|
+
also two-specificity), so this reliably wins and zeroes the doubled gutter. */
|
|
228
|
+
.page-content .app-content.app-content .app-header,
|
|
229
|
+
.page-content .app-content.app-content .pageContent {
|
|
230
|
+
padding-inline: 0;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
222
234
|
</style>
|
|
223
235
|
|
|
224
236
|
<style scoped>
|
|
225
237
|
|
|
226
|
-
/*
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
.
|
|
232
|
-
|
|
238
|
+
/* Both the header and the body carry the side gutter themselves (AppLayout's
|
|
239
|
+
`.page-content` no longer applies it). They read the same `--bgl-content-padding`
|
|
240
|
+
so their leading edges line up. The header keeps this padding on its OWN element
|
|
241
|
+
while its bottom border spans the full element width — since `.page-content` is
|
|
242
|
+
now flush to the screen edge, that border reaches the screen edge for free (the
|
|
243
|
+
old negative-margin hack is gone). The body insets its content by the same gutter. */
|
|
244
|
+
.pageContent {
|
|
245
|
+
padding-inline: var(--bgl-content-padding, 1rem);
|
|
233
246
|
}
|
|
234
247
|
|
|
235
248
|
/* The header holds a fixed *minimum* height on every breakpoint — its start
|
|
@@ -277,6 +290,7 @@ row-gap: 0.5rem;
|
|
|
277
290
|
@media screen and (max-width: 910px) {
|
|
278
291
|
.app-header-side {
|
|
279
292
|
row-gap: 0.25rem;
|
|
293
|
+
flex-grow: 1;
|
|
280
294
|
}
|
|
281
295
|
}
|
|
282
296
|
|
|
@@ -293,6 +307,15 @@ row-gap: 0.25rem;
|
|
|
293
307
|
margin-inline-start: auto;
|
|
294
308
|
justify-content: flex-end;
|
|
295
309
|
}
|
|
310
|
+
/* Mobile: don't push the trailing side to the far edge — let it sit right after the
|
|
311
|
+
leading side (no auto margin, start-aligned) so the header reads as one compact
|
|
312
|
+
group instead of splitting title and actions to opposite screen edges. */
|
|
313
|
+
@media screen and (max-width: 910px) {
|
|
314
|
+
.endNavTools {
|
|
315
|
+
margin-inline-start: 0;
|
|
316
|
+
justify-content: flex-start;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
296
319
|
|
|
297
320
|
/* ── Variants ──────────────────────────────────────────────────────────────
|
|
298
321
|
border → hairline under the header (legacy default)
|
|
@@ -318,11 +318,23 @@ transition: margin 300ms ease;
|
|
|
318
318
|
min-height: 0;
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
-
/*
|
|
322
|
-
|
|
321
|
+
/* Content gutter, breakpoint-aware:
|
|
322
|
+
• Desktop — `.page-content` applies the side gutter (as it always did), so every
|
|
323
|
+
view (with or without AppContent) is inset and aligned. An AppContent header
|
|
324
|
+
therefore lines up with its body here; edge-to-edge is opt-in via `edgeHeader`.
|
|
325
|
+
• Mobile — the gutter is dropped from `.page-content` so an AppContent header can
|
|
326
|
+
run flush to the screen edge (full-width divider — the common mobile look). The
|
|
327
|
+
header/body still inset their CONTENT because AppContent applies the same
|
|
328
|
+
`--bgl-content-padding` on its own elements; direct-in-slot views keep their own
|
|
329
|
+
mobile spacing (`m_p-*`). The var stays the single gutter knob. */
|
|
323
330
|
.page-content {
|
|
324
331
|
overflow: auto;
|
|
325
332
|
padding-inline: var(--bgl-content-padding, 1rem);
|
|
326
333
|
}
|
|
334
|
+
@media screen and (max-width: 910px) {
|
|
335
|
+
.page-content {
|
|
336
|
+
padding-inline: 0;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
327
339
|
|
|
328
340
|
</style>
|
package/src/styles/layout.css
CHANGED
|
@@ -7765,4 +7765,14 @@
|
|
|
7765
7765
|
.mobile-only {
|
|
7766
7766
|
display: none !important;
|
|
7767
7767
|
}
|
|
7768
|
+
}
|
|
7769
|
+
|
|
7770
|
+
.page-gutter {
|
|
7771
|
+
/* The app's side gutter as a utility. AppLayout's `.page-content` no longer
|
|
7772
|
+
applies `padding-inline` itself; the content supplies it, so an AppContent
|
|
7773
|
+
header can sit flush to the screen edge. AppContent's body does this
|
|
7774
|
+
internally; a view rendered DIRECTLY in the layout slot (no AppContent
|
|
7775
|
+
wrapper) adds `.page-gutter` to its root for the same inset. Reads the
|
|
7776
|
+
`--bgl-content-padding` var from AppLayout (falls back to 1rem elsewhere). */
|
|
7777
|
+
padding-inline: var(--bgl-content-padding, 1rem);
|
|
7768
7778
|
}
|