Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…mponents into release
  • Loading branch information
dgvai committed Jul 25, 2020
2 parents 0c99db1 + 993c21a commit d0c91d5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ This package contains [Laravel Blade Components](https://laravel.com/docs/7.x/bl
- [TEXTAREA](#textarea)
- [TEXT-EDITOR](#text-editor)
- [SUBMIT](#submit)
- [Example Codes](#example-codes)
- [Summary](#summary)
- [Changelog](#changelog)
- [License](#license)
Expand Down Expand Up @@ -445,6 +446,10 @@ $(()=>{
| hoverable | is hoverable? ``true/false`` | false | boolean |
| condensed | is condensed? ``true/false`` | false | boolean |
| footer | has footer? ``true/false`` | false | boolean |
| buttons | has buttons (print/export)? ``true/false`` | false | boolean |

**ACKNOWLEDGEMENTS**
Use ``Dom : 'Blftrip'`` while using buttons. See Examples to be more clear!

### Form Components

Expand Down Expand Up @@ -794,6 +799,9 @@ $(()=>{
| icon | button icon | fas fa-save | string |
| inputclass | class along with 'form-control' | null | string |

## Example Codes
You can browse through the examples of advanced usages from [examples](examples/) directory.

## Summary
This document might not be well-documented. I will happily accept any documentation pull-requests.
> PULL REQUESTS for new components should be in non-master branch
Expand Down
5 changes: 3 additions & 2 deletions src/Components/Datatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

class Datatable extends Component
{
public $beautify;
public $beautify, $buttons;
public $id;
public $bordered, $hoverable, $condensed;
public $heads, $footer;

public function __construct(
$beautify = true, $id,
$bordered = true, $hoverable = true, $condensed = false,
$heads, $footer = false
$heads, $footer = false, $buttons = false
)
{
$this->id = $id;
Expand All @@ -24,6 +24,7 @@ public function __construct(
$this->condensed = $condensed;
$this->heads = json_decode(json_encode($heads));
$this->footer = $footer;
$this->buttons = $buttons;
}

public function border()
Expand Down
15 changes: 15 additions & 0 deletions src/resources/components/datatable.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
@if($buttons)
@section('css')
@parent
<link rel="stylesheet" href="https://cdn.datatables.net/v/bs4/jszip-2.5.0/dt-1.10.20/b-1.6.1/b-html5-1.6.1/b-print-1.6.1/datatables.min.css" />
<style>.printer table{counter-reset: rowNumber}.printer tr{counter-increment: rowNumber}.printer tr td:first-child::before{content: counter(rowNumber);min-width: 1em;margin-right: 0.5em} div.dt-buttons.btn-group.flex-wrap {float:right}</style>
@endsection

@section('js')
@parent
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/v/bs4/jszip-2.5.0/dt-1.10.20/b-1.6.1/b-html5-1.6.1/b-print-1.6.1/datatables.min.js"></script>
@endsection
@endif

@if($beautify)
<style>#{{$id}} tbody tr td { vertical-align: middle; text-align: center; }</style>
@endif
Expand Down

0 comments on commit d0c91d5

Please sign in to comment.