From 18e25b77d9d21f8d335fa3c2fe032850a1438b91 Mon Sep 17 00:00:00 2001 From: Gustavo Martinez Date: Sat, 27 Jun 2020 14:22:29 -0500 Subject: [PATCH 1/2] fix: Fix some mistakes on the documentation I fixed some mistakes on the documentation like broken links and missing dcumentation, I also changed the input border colors and finally I added a changelog file --- CHANGELOG.md | 20 +++++++++++++++++++ README.md | 7 ++++--- doc/table-view.md | 15 +++++++++++++- .../components/form/input-group.blade.php | 2 +- .../views/components/form/input.blade.php | 2 +- .../views/components/form/select.blade.php | 2 +- .../views/table-view/table-view.blade.php | 16 ++++++++------- 7 files changed, 50 insertions(+), 14 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..9f20274 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,20 @@ +# Changelog + +## [1.0.1] - 2020-06-27 +### Added +- Added the changelog file +- Added a overflow-y utility to the table view layout +- Added missing `renderIf` documentation to the actions by row section +### Changed +- Changed inputs border color +### Fixed +- Fixed some broken links on the documentation + +## [1.0.0] - 2020-06-14 +### Added +- Created base LaravelViews class +- Created the TableView component + - Search inpurt feature + - Customizable filters + - Actions by row +- Definied components customization \ No newline at end of file diff --git a/README.md b/README.md index e9045c0..82cd744 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,9 @@ Laravel package to create beautiful common views like tables using only PHP code - [Specifying a layout and section](#specifying-a-layout-and-section) - [Send extra data](send-extra-data) - [Components customization](#components-customization) - - [Component variants using tailwindcss](#using-tailwindcss) - - [Components full customization](#using-tailwindcss) + - [Component variants using tailwindcss](#component-variants-using-tailwindcss) + - [Components full customization](#components-full-customization) +- [Table view](doc/table-view.md) # Installation and basic usage @@ -102,7 +103,7 @@ The easiest way to render the view is using the facade directly with a blade fil {!! LaravelViews::create(App\Http\Livewire\UsersTableView::class)->render() !!} ``` -At this point, you would be able to see a table with some data +At this point, you would be able to see a table with some data, the table view doesn't have any styled container or title as the image example, you can render the table view inside any container you want. In the example above the view is using the User model created by default in every Laravel project, feel free to use any model you have, the method `row` is receiving a sinlge model object and you can use any property or public method you have difined inside your model. diff --git a/doc/table-view.md b/doc/table-view.md index b06a5f5..582285a 100644 --- a/doc/table-view.md +++ b/doc/table-view.md @@ -1,6 +1,6 @@ # Table view -This view creates a dinamic data table, you can customize the headers, the data to be displayed for each row, add a search input, filters and actions +This view creates a dinamic data table with some features like filters, pagination and search input, you can customize the headers, the data to be displayed for each row. - [Laravel views](../README.md) - [Table view](#table-view) @@ -20,6 +20,7 @@ This view creates a dinamic data table, you can customize the headers, the data - [Registering actions](#registering-actions) - [Redirect action](#redirect-action) - [Showing alert messages](#showing-alert-messages) + - [Hiding actions](#hiding-actions) - [Showing UI components](#showing-ui-components) - [Avatar](#avatar) - [Badges](#badges) @@ -28,6 +29,8 @@ This view creates a dinamic data table, you can customize the headers, the data ![](../doc/table.png) +The table view doesn't have any styled container or title as the image example so you can render the table view inside any container you want. + ## Create new table view ```bash @@ -284,6 +287,16 @@ $this->error(); ![](error.png) +## Hiding actions +You can choose if the action will be shown or hidden for an specific row defining a `renderIf` method and returning a boolean value, if you don't define this method the action will be shown aways. + +```php +public function renderIf($model) +{ + return !$model->active; +} +``` + # Showing UI components You can display some UI components instead of plain text like avateres or badges diff --git a/resources/views/components/form/input-group.blade.php b/resources/views/components/form/input-group.blade.php index 186a66f..e72abaf 100644 --- a/resources/views/components/form/input-group.blade.php +++ b/resources/views/components/form/input-group.blade.php @@ -19,7 +19,7 @@ {{ $label ?? '' }}