mirror of
https://github.com/tabler/tabler.git
synced 2026-08-07 03:42:27 +04:00
f27c70ad38
`Render Modal as real markup` (#2742) reformatted ~140 files back to tabs/semicolons, breaking the Prettier config added by the Astro quality gates (#2749). Re-run prettier --write to restore it, and fix the type errors it had been masking: HTMLElement casts and `this` typing in ChangePasswordModalContent/ConfirmDeleteModalContent scripts, plain-JS syntax in the inline-injected progress.astro script, narrowed prop unions in Button/Check/Spinner, nullable icon svg casts in Icons/Rating, and a duplicate firstLetters/invalid `placeholder` attribute in Select.astro. Also fix shared/vitest.config.mts's stale `astro/lib/**/*.test.ts` include glob left over from the shared source restructure, which made `pnpm test` report zero test files.
110 lines
4.0 KiB
Plaintext
110 lines
4.0 KiB
Plaintext
---
|
|
// TODO: no-container (<div class="container-xl">-less body) — unused so far.
|
|
import BaseLayout from './BaseLayout.astro'
|
|
import Navbar from '@shared/components/navbar/Navbar.astro'
|
|
import Sidebar from '@shared/components/navbar/Sidebar.astro'
|
|
import PageHeader from '@shared/components/layout/PageHeader.astro'
|
|
import Footer from '@shared/components/layout/Footer.astro'
|
|
|
|
interface Props {
|
|
title?: string
|
|
/** Script/CSS library keys passed to BaseLayout */
|
|
pageLibs?: string[]
|
|
/** page-header — the title in the page header */
|
|
pageHeader?: string
|
|
/** page-header-file — renders a layout/headers/{file} component instead of the title block */
|
|
pageHeaderFile?: string
|
|
/** page-header-pretitle */
|
|
pretitle?: string
|
|
/** page-header-description */
|
|
description?: string
|
|
/** page-header-actions, e.g. "buttons" */
|
|
actions?: string
|
|
/** page-menu from the front matter, e.g. "layout.vertical" — active menu entry */
|
|
pageMenu?: string
|
|
/** layout-sidebar */
|
|
sidebar?: boolean
|
|
/** layout-sidebar-dark */
|
|
sidebarDark?: boolean
|
|
/** layout-hide-topbar */
|
|
hideTopbar?: boolean
|
|
/** page-container-centered — adds my-auto to the .container-xl */
|
|
containerCentered?: boolean
|
|
/** layout-wrapper-full — page-wrapper-full + no .container-xl around the body */
|
|
wrapperFull?: boolean
|
|
/** page-container-class — extra classes appended to the .container-xl */
|
|
containerClass?: string
|
|
/** body-class front matter (e.g. "layout-boxed"/"layout-fluid") → passed to BaseLayout */
|
|
bodyClass?: string
|
|
/** layout-rtl → passed to BaseLayout (dir="rtl" + RTL stylesheets) */
|
|
rtl?: boolean
|
|
/** layout-sidebar-end */
|
|
sidebarEnd?: boolean
|
|
/** layout-navbar-transparent (sidebar variant) */
|
|
navbarTransparent?: boolean
|
|
/** layout-navbar-condensed */
|
|
navbarCondensed?: boolean
|
|
/** layout-navbar-dark */
|
|
navbarDark?: boolean
|
|
/** layout-navbar-overlap */
|
|
navbarOverlap?: boolean
|
|
/** layout-navbar-sticky */
|
|
navbarSticky?: boolean
|
|
/** layout-navbar-hide-brand */
|
|
navbarHideBrand?: boolean
|
|
/** layout-navbar-class */
|
|
navbarClass?: string
|
|
}
|
|
|
|
const { title, pageLibs, pageHeader, pageHeaderFile, pretitle, description, actions, pageMenu, sidebar, sidebarDark, hideTopbar, containerCentered, wrapperFull, containerClass, bodyClass, rtl, sidebarEnd, navbarTransparent, navbarCondensed, navbarDark, navbarOverlap, navbarSticky, navbarHideBrand, navbarClass } =
|
|
Astro.props
|
|
---
|
|
|
|
<BaseLayout title={title} pageLibs={pageLibs} bodyClass={bodyClass} rtl={rtl}>
|
|
<div class="page">
|
|
{
|
|
sidebar && (
|
|
<Fragment>
|
|
<Fragment set:html={'<!-- BEGIN SIDEBAR -->'} />
|
|
<Sidebar dark={sidebarDark} end={sidebarEnd} transparent={navbarTransparent} breakpoint="lg" pageMenu={pageMenu} />
|
|
<Fragment set:html={'<!-- END SIDEBAR -->'} />
|
|
</Fragment>
|
|
)
|
|
}
|
|
|
|
{
|
|
!hideTopbar && (
|
|
<Fragment>
|
|
<Fragment set:html={'<!-- BEGIN NAVBAR -->'} />
|
|
<Navbar hideSearch pageMenu={pageMenu} condensed={navbarCondensed} dark={navbarDark} overlap={navbarOverlap} sticky={navbarSticky} hideBrand={navbarHideBrand} class={navbarClass} />
|
|
<Fragment set:html={'<!-- END NAVBAR -->'} />
|
|
</Fragment>
|
|
)
|
|
}
|
|
|
|
<div class:list={['page-wrapper', wrapperFull && 'page-wrapper-full']}>
|
|
<!-- BEGIN PAGE HEADER -->
|
|
<PageHeader title={pageHeader} pretitle={pretitle} description={description} actions={actions} file={pageHeaderFile} textWhite={navbarOverlap && navbarDark} />
|
|
<!-- END PAGE HEADER -->
|
|
|
|
<!-- BEGIN PAGE BODY -->
|
|
<main id="content" class="page-body">
|
|
{
|
|
wrapperFull ? (
|
|
<slot />
|
|
) : (
|
|
<div class={`container-xl${containerCentered ? ' my-auto' : ''}${containerClass ? ` ${containerClass}` : ''}`}>
|
|
<slot />
|
|
</div>
|
|
)
|
|
}
|
|
</main>
|
|
<!-- END PAGE BODY -->
|
|
|
|
<!-- BEGIN FOOTER -->
|
|
<Footer />
|
|
<!-- END FOOTER -->
|
|
</div>
|
|
</div>
|
|
</BaseLayout>
|