From 1f81ce361cb454b1655d6e2a7ac031bc1e3b2ede Mon Sep 17 00:00:00 2001 From: Sam Light Date: Thu, 27 Mar 2025 10:53:34 +0000 Subject: Seperating toolbar into its own class and views --- src/Toolbar/ColumnSelect.php | 17 +++++++++++++++++ src/Toolbar/Filter.php | 8 ++++++++ src/Toolbar/Item.php | 32 ++++++++++++++++++++++++++++++++ src/Toolbar/PageSize.php | 19 +++++++++++++++++++ src/Toolbar/Search.php | 25 +++++++++++++++++++++++++ 5 files changed, 101 insertions(+) create mode 100644 src/Toolbar/ColumnSelect.php create mode 100644 src/Toolbar/Filter.php create mode 100644 src/Toolbar/Item.php create mode 100644 src/Toolbar/PageSize.php create mode 100644 src/Toolbar/Search.php (limited to 'src/Toolbar') diff --git a/src/Toolbar/ColumnSelect.php b/src/Toolbar/ColumnSelect.php new file mode 100644 index 0000000..a70c49a --- /dev/null +++ b/src/Toolbar/ColumnSelect.php @@ -0,0 +1,17 @@ + $this->getTable()->getColumns() + ]); + } +} diff --git a/src/Toolbar/Filter.php b/src/Toolbar/Filter.php new file mode 100644 index 0000000..ebda2c6 --- /dev/null +++ b/src/Toolbar/Filter.php @@ -0,0 +1,8 @@ +toolbar = $toolbar; + } + + public function getToolbar(): Toolbar + { + return $this->toolbar; + } + + public function getTable(): TableComponent + { + return $this->getToolbar()->getTable(); + } + + abstract public function render(): View|HtmlString|string|null; + +} diff --git a/src/Toolbar/PageSize.php b/src/Toolbar/PageSize.php new file mode 100644 index 0000000..9c2821a --- /dev/null +++ b/src/Toolbar/PageSize.php @@ -0,0 +1,19 @@ + $this->pageSizes, + ]); + } +} diff --git a/src/Toolbar/Search.php b/src/Toolbar/Search.php new file mode 100644 index 0000000..0b0dc37 --- /dev/null +++ b/src/Toolbar/Search.php @@ -0,0 +1,25 @@ +minLength; + } + + public function render(): View + { + return view('laralight-tables::toolbar.search', [ + 'debounce' => $this->debounce, + ]); + } +} -- cgit v1.2.3