@page "/export-pdf-button"
@inject IStringLocalizer<ExportPdfButtons> Localizer

<h3>@Localizer["ExportPdfButtonsTitle"]</h3>

<h4>@((MarkupString)Localizer["ExportPdfButtonsDescription"].Value)</h4>

<PackageTips Name="BootstrapBlazor.Html2Pdf" />

<p>@((MarkupString)Localizer["ExportPdfButtonTips"].Value)</p>

<DemoBlock Title="@Localizer["NormalTitle"]" Introduction="@Localizer["NormalIntro"]" Name="Normal">
    <section ignore>
        <Table TItem="Foo" Items="@Items.Take(3)" Id="table-9527-01" IsStriped="true">
            <TableColumns>
                <TableColumn @bind-Field="@context.DateTime" Width="180" />
                <TableColumn @bind-Field="@context.Name" />
                <TableColumn @bind-Field="@context.Address" />
            </TableColumns>
        </Table>
    </section>
    <ExportPdfButton ElementId="table-9527-01" IsAsync="true" OnBeforeExport="OnBeforeExport" OnAfterDownload="OnAfterDownload" AutoDownload="true"></ExportPdfButton>
</DemoBlock>

<DemoBlock Title="@Localizer["SelectorTitle"]" Introduction="@Localizer["SelectorIntro"]" Name="Selector">
    <section ignore class="table-9527-02">
        <GroupBox Title="@Localizer["GroupBoxTitle"]">
            <div class="row g-2 form-inline">
                <div class="col-12 col-sm-6">
                    <Display Value="Model.Name" ShowLabel="true" DisplayText="Name"></Display>
                </div>
                <div class="col-12 col-sm-6">
                    <Display Value="Model.Address" ShowLabel="true" DisplayText="Address"></Display>
                </div>
                <div class="col-12 col-sm-6">
                    <Display Value="Model.DateTime" ShowLabel="true" DisplayText="DateTime"></Display>
                </div>
                <div class="col-12 col-sm-6">
                    <Display Value="Model.Education" ShowLabel="true" DisplayText="Education"></Display>
                </div>
            </div>
        </GroupBox>
    </section>
    <ExportPdfButton Selector=".table-9527-02" IsAsync="true" OnBeforeExport="OnBeforeExport" OnAfterDownload="OnAfterDownload" AutoDownload="true" FileName="@PdfFileName"></ExportPdfButton>
</DemoBlock>

<AttributeTable Items="@GetAttributes()" />
