Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…mponents into release
  • Loading branch information
dgvai committed May 26, 2020
2 parents 64d97cb + 36f79b2 commit f62d296
Show file tree
Hide file tree
Showing 26 changed files with 3,218 additions and 4 deletions.
142 changes: 142 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This package contains [Laravel Blade Components](https://laravel.com/docs/7.x/bl
- [AdminLTE Blade Components for Laravel 7+](#adminlte-blade-components-for-laravel-7)
- [Contents](#contents)
- [Installation](#installation)
- [Extract Plugins](#extract-plugins)
- [Configurations](#configurations)
- [Components](#components)
- [Widgets](#widgets)
Expand All @@ -38,6 +39,7 @@ This package contains [Laravel Blade Components](https://laravel.com/docs/7.x/bl
- [DATE-RANGE](#date-range)
- [INPUT-SWITCH](#input-switch)
- [INPUT-TAG](#input-tag)
- [INPUT-SLIDER](#input-slider)
- [SELECT](#select)
- [SELECT2](#select2)
- [SELECT-ICON](#select-icon)
Expand All @@ -58,11 +60,122 @@ You can install the package via composer:
composer require dgvai/laravel-adminlte-components
```

## Extract Plugins
``` bash
php artisan vendor:publish --tag=adminlte-dg-plugins
```

## Configurations
You can use this package, stand alone with AdminLTE installed in your app. You just need to add an ``@yield('js')`` at the bottom of your <kbd>master</kbd> blade layout.

Or, if you use [jeroennoten/Laravel-AdminLTE](https://github.com/jeroennoten/Laravel-AdminLTE) package, then you do not need to add anything at ``master``. I will prefer to use this package.

Use this in the [jeroennoten/Laravel-AdminLTE](https://github.com/jeroennoten/Laravel-AdminLTE) config:
```php
[
'name' => 'AdminLTE-Components-DG',
'active' => true,
'files' => [
[
'type' => 'css',
'asset' => true,
'location' => '/vendor/dg-plugins/select2/css/select2.min.css',
],
[
'type' => 'css',
'asset' => true,
'location' => '/vendor/dg-plugins/select2/css/select2-bootstrap4.min.css',
],
[
'type' => 'js',
'asset' => true,
'location' => '/vendor/dg-plugins/select2/js/select2.min.js',
],
[
'type' => 'js',
'asset' => true,
'location' => '/vendor/dg-plugins/bs-custom-file-input/bs-custom-file-input.min.js',
],
[
'type' => 'js',
'asset' => true,
'location' => '/vendor/dg-plugins/moment/moment.min.js',
],
[
'type' => 'css',
'asset' => true,
'location' => '/vendor/dg-plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css',
],
[
'type' => 'js',
'asset' => true,
'location' => '/vendor/dg-plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js',
],
[
'type' => 'css',
'asset' => true,
'location' => '/vendor/dg-plugins/summernote/summernote-bs4.css',
],
[
'type' => 'js',
'asset' => true,
'location' => '/vendor/dg-plugins/summernote/summernote-bs4.min.js',
],
[
'type' => 'css',
'asset' => true,
'location' => '/vendor/dg-plugins/bs-select/css/bootstrap-select.min.css',
],
[
'type' => 'js',
'asset' => true,
'location' => '/vendor/dg-plugins/bs-select/js/bootstrap-select.min.js',
],
[
'type' => 'css',
'asset' => true,
'location' => '/vendor/dg-plugins/bootstrap-tags-input/bootstrap-tagsinput.css',
],
[
'type' => 'js',
'asset' => true,
'location' => '/vendor/dg-plugins/bootstrap-tags-input/bootstrap-tagsinput.js',
],
[
'type' => 'js',
'asset' => true,
'location' => '/vendor/dg-plugins/daterangepicker/daterangepicker.js',
],
[
'type' => 'css',
'asset' => true,
'location' => '/vendor/dg-plugins/daterangepicker/daterangepicker.css',
],
[
'type' => 'css',
'asset' => true,
'location' => '/vendor/dg-plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css',
],
[
'type' => 'js',
'asset' => true,
'location' => '/vendor/dg-plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js',
],
[
'type' => 'css',
'asset' => true,
'location' => '/vendor/dg-plugins/bootstrap-slider/css/bootstrap-slider.min.css',
],
[
'type' => 'js',
'asset' => true,
'location' => '/vendor/dg-plugins/bootstrap-slider/js/bootstrap-slider.min.js',
],
],
],

```

## Components

### Widgets
Expand Down Expand Up @@ -392,6 +505,7 @@ $(()=>{
| title | Input Title | Filter Range | string |
| icon | Icon | far fa-calendar-alt | string |
| topclass | class along with 'fomr-group' | null | string |
| inputclass | class along with 'filter button' | null | string |
| init | The initial position of range, (0-5) * | 2 | integer |
| callback | The JS callback function to run on change filter | null | string (js) |

Expand Down Expand Up @@ -448,6 +562,34 @@ $(()=>{
| required | is required? | false | boolean |
| max | max tag count | 10 | integer |

#### INPUT-SLIDER
**REQUIRES**
[bootstrap-slider](https://github.com/seiyria/bootstrap-slider)

**USAGE**
```html
<x-dg-input-slider id="myID"/>
```

**ALL AVAILABLE ATTRIBUTES**
| ATTRIBUTE | DETAILS | DEFAULT | TYPE |
|-------------|---------------------------------|-------------|---------|
| id | Input ID | none | string |
| name | Input name | null | string |
| label | Input Label | Input Label | string |
| topclass | class along with 'fomr-group' | null | string |
| inputclass | class along with 'form-control' | null | string |
| disabled | is disabled? | false | boolean |
| required | is required? | false | boolean |
| min | minimum | 0 | signed int |
| max | maximum | 100 | signed int |
| value | value | null | string |
| color | blue, green, red, teal, yellow, purple | blue | string |
| tick | Enable Tick? | false | boolean |
| ticks | Ticks : [0, 10, 20, ...] | null | string |
| tickLabels | Tick Labels : ["low", "medium", "high" ...] | null | string |
| vertical | Is vertical? | false | boolean |


#### SELECT

Expand Down
5 changes: 5 additions & 0 deletions src/BladeAdminLTEServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ private function publishers()
$this->publishes([
__DIR__.'/resources/components' => base_path('resources/views/vendor/adminlte-components'),
], 'adminlte-dg-components');

$this->publishes([
__DIR__.'/assets' => public_path('vendor/dg-plugins'),
], 'adminlte-dg-plugins');
}

private function loadComponents()
Expand All @@ -44,6 +48,7 @@ private function loadComponents()
Blade::component('dg-submit', Components\Submit::class);
Blade::component('dg-text-editor', Components\TextEditor::class);
Blade::component('dg-date-range', Components\DateRange::class);
Blade::component('dg-input-slider', Components\InputSlider::class);

/**
* WIDGETS
Expand Down
5 changes: 3 additions & 2 deletions src/Components/DateRange.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@

class DateRange extends Component
{
public $topclass, $title, $icon, $id;
public $topclass, $inputclass, $title, $icon, $id;
public $init;
public $callback;

public function __construct(
$id, $topclass = null, $title = 'Filter Range', $icon = 'far fa-calendar-alt',
$init = 2, $callback = null
$init = 2, $callback = null, $inputclass = null
)
{
$this->id = $id;
$this->topclass = $topclass;
$this->inputclass = $inputclass;
$this->title = $title;
$this->icon = $icon;
$this->init = $init;
Expand Down
48 changes: 48 additions & 0 deletions src/Components/InputSlider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

namespace DGvai\BladeAdminLTE\Components;

use Illuminate\View\Component;

class InputSlider extends Component
{
public $id, $name, $label;
public $topclass, $inputclass;
public $value, $disabled, $required;
public $min, $max, $step, $vertical;
public $tick, $ticks, $tickLabels;
public $color;

public function __construct(
$id, $name = null,
$label = 'Input Label',
$topclass = null, $inputclass = null,
$value = null,$disabled = false, $required = false,
$min = 0, $max = 100, $step = 1, $vertical = false,
$tick = false, $ticks = null, $tickLabels = null,
$color = 'blue'
)
{
$this->id = $id;
$this->name = $name;
$this->label = $label;
$this->topclass = $topclass;
$this->inputclass = $inputclass;
$this->required = $required;
$this->disabled = $disabled;
$this->value = $value;
$this->min = $min;
$this->max = $max;
$this->step = $step;
$this->vertical = $vertical;
$this->tick = $tick;
$this->ticks = $ticks;
$this->tickLabels = $tickLabels;
$this->color = $color;
}

public function render()
{
return view('xdg::input-slider');
}
}
10 changes: 10 additions & 0 deletions src/assets/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f62d296

Please sign in to comment.