Skip to content

Feat/filter flyout - #2124

Merged
luanfreitasdev merged 12 commits into
Power-Components:7.xfrom
virtualtear:feat/filter-flyout
Aug 17, 2026
Merged

luanfreitasdev merged 12 commits into
Power-Components:7.xfrom
virtualtear:feat/filter-flyout

Conversation

@virtualtear

@virtualtear virtualtear commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

⚡ PowerGrid - Pull Request

  • Bug fix
  • Enhancement
  • New feature
  • Breaking change

Description

Adds flyout as a third filter position, next to inline and outside. Filters move into a drawer that slides in from the left or right edge, opened by the existing filter button in the header.

What's new

  • flyout filter position, backed by a shared drawer view (filter-flyout.blade.php) that every theme inherits through parentTheme.
  • filter.flyout.* theme tokens, set with ->flyout(fn (Components\Flyout $f) => ...) or the array form. Styled for Tailwind, DaisyUI and Flux.
  • Filter fields extracted into filters/fields.blade.php, so the outside panel and the drawer render the same fields with their own grid.
  • close translation added to all 20 locales, used as the close button's aria-label.
  • Drawer closes on Escape, on backdrop click and on the close button, all inside the pg-filters Hot Zone (no full re-render).

Configuration

// config/livewire-powergrid.php

'filter' => 'flyout', // 'inline' | 'outside' | 'flyout'

'filter_flyout' => [
    'position' => 'right',            // 'left' | 'right'
    'close_on_escape' => true,
    'close_on_click_outside' => true,
],

Per table, override in boot():

public function boot(): void
{
    config(['livewire-powergrid.filter' => 'flyout']);
    config(['livewire-powergrid.filter_flyout.position' => 'left']);
}

Theming

Override the classes only, not the view:

->flyout(fn (Components\Flyout $flyout) => $flyout
    ->overlay('fixed inset-0 z-40 bg-zinc-900/40')
    ->panel('fixed inset-y-0 z-50 flex w-full max-w-full flex-col bg-white shadow-xl sm:w-96 sm:max-w-[90vw]')
    ->panelLeft('left-0 border-r border-zinc-200')
    ->panelRight('right-0 border-l border-zinc-200')
    ->header('...')->title('...')->close('...')
    ->body('flex-1 overflow-y-auto px-4 py-4')
    ->footer('...')->clearAll('...')
)

panel carries the positioning (fixed inset-y-0) and must stay above overlay; panel_left / panel_right add only the edge anchoring, since the blade pairs the chosen side with the matching slide-in transform.

Backwards compatibility

Non-breaking. Default stays inline, and outside behaves as before.

grafik

Related Issue(s):

Documentation

This PR requires Documentation update?

  • Yes
  • No
  • I have already submitted a Documentation pull request.

HasProperties::toArray() snake_cases every property, so the layout token is
stored as layout.outside_filters. The camelCase lookup always resolved to an
empty string, dropping the theme's outside filter wrapper classes.
The outside filter panel built its field grid inline. Moving the sorting and
the per-filter-type dispatch into filters/fields.blade.php lets another panel
render the same fields with a different grid, without duplicating the mapping.
The grid classes stay with the caller via $gridClass.
Adds 'flyout' as a third value for the filter config and a filter_flyout
block holding the drawer edge plus its two close behaviours, so a table can
override them from boot() without touching the view.
Used as the accessible label of the filter drawer's close button.
Filter::flyout(Closure) mirrors the other fluent sub-components and exposes
the drawer's class slots: overlay, panel with its per-side anchoring, header,
title, close, body, footer and clearAll.
Tailwind carries the drawer's view alias, which DaisyUI and Flux inherit
through parentTheme; each theme only sets its own classes.
Renders the backdrop and the panel, sliding in from the configured edge with
a matching off-screen transform. Escape and backdrop closing are opt-out via
config, the Escape listener is guarded because it is bound to the window.
Fields come from the shared filters/fields partial in a single column grid.
Adds filterPosition(), usesFilterPanel() and filterPanelView() and routes the
table, the theme headers and the pg-filters partial through them, so 'outside'
and 'flyout' share one panel path instead of each view comparing the config
string itself. filterFlyoutOptions() normalises the drawer settings so an
invalid config value cannot break the panel.
Closing the drawer assigns $wire.showFilters directly, which commits without
registering a partial. The updated hook re-registers them so the commit stays
inside the Hot Zones instead of triggering a full re-render.
Drops the table.view* aliases and the removed header.export entries, and picks
up layout.wrapper, the actions cells, the responsive row tokens, cols.div and
the toggleable colors.
Registers filter.flyout in the generator's canonical alias list and adds the
drawer's tokens to the meta, so theme() and theme_view() autocomplete them.
Adds Flyout.php to the component table, the filter.flyout token block to the
reference, and the rule that themes restyle the shared drawer rather than
replacing its view.
@virtualtear

Copy link
Copy Markdown
Contributor Author

@luanfreitasdev can you check that out if that sits well with you ?

@luanfreitasdev

Copy link
Copy Markdown
Member

Thank you @virtualtear ⚡️

@luanfreitasdev
luanfreitasdev merged commit 522538e into Power-Components:7.x Aug 17, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants