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 1, 2020
2 parents 0f67e92 + f051726 commit 2f646ea
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 13 deletions.
63 changes: 58 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,22 @@ This package contains [Laravel Blade Components](https://laravel.com/docs/7.x/bl
- [Installation](#installation)
- [Extract Plugins](#extract-plugins)
- [Configurations](#configurations)
- [Components](#components)
- [Widgets](#widgets)
- [**INFO BOX**](#info-box)
- [**SMALL BOX**](#small-box)
- [**CARDS**](#cards)
- [**ALERT**](#alert)
- [**CALLOUT**](#callout)
- [**PROGRESS**](#progress)
- [**PROFILE FLAT**](#profile-flat)
- [**PROFILE WIDGET**](#profile-widget)
- [**MODAL**](#modal)
- [**DATATABLE**](#datatable)
- [Form Components](#form-components)
- [INPUT](#input)
- [INPUT-FILE](#input-file)
- [INPUT-COLOR](#input-color)
- [INPUT-DATE](#input-date)
- [DATE-RANGE](#date-range)
- [INPUT-SWITCH](#input-switch)
Expand Down Expand Up @@ -185,12 +197,37 @@ Use this in the [jeroennoten/Laravel-AdminLTE](https://github.com/jeroennoten/La
| icon | The fontawesome icon class. Eg. ``fas fa-star``, ``fas fa-user-plus`` | false | string |
| grad | Use gradient color? ``true/false`` | false | boolean |
| full | Use full INFO BOX? ``true/false`` | false | boolean |
| progress | Show Progress bar? | false | int |
| comment | Show comment? | false | string |
| id | Dynamic Binding? | false | string |

**EXAMPLE**
```html
<x-dg-info-box bg="success" title="Yo title" text="123" icon="fas fa-star" :full="true" :grad="true"/>
```

**DYNAMIC BINDINGS**
Set ``id`` attibute, this will enable dynamic attributes for:
| ID |
|----|
|#{id}-title|
|#{id}-text|
|#{id}-progress|
|#{id}-comment|

**EXAMPLE**
```html
<x-dg-info-box bg="success" title="Users" text="100" icon="fas fa-star" :full="true" :grad="true" id="userbox" />

<script>
$(()=>{
$('#userbox-title').text('Users');
$('#userbox-text').text('102');
});
</script>
```


#### **SMALL BOX**
![Small Box](assets/small-box.png)

Expand All @@ -208,12 +245,33 @@ Use this in the [jeroennoten/Laravel-AdminLTE](https://github.com/jeroennoten/La
| url | The url to follow. | false | string |
| urlText | Text of the HyperLink. | false | string |
| loading | Set loading state ``true/false`` | false | boolean |
| id | Dynamic Binding? | false | string |

**EXAMPLE**
```html
<x-dg-small-box title="Small box" text="500" bg="warning" url="#" urlText="See More" loading="false" />
```

**DYNAMIC BINDINGS**
Set ``id`` attibute, this will enable dynamic attributes for:
| ID |
|----|
|#{id}-title|
|#{id}-text|
|#{id}-link|

**EXAMPLE**
```html
<x-dg-small-box title="Small box" text="500" bg="warning" url="#" urlText="See More" loading="false" $id="userbox"/>

<script>
$(()=>{
$('#userbox-text').text('102');
$('#userbox-link').attr('href',new.link);
});
</script>
```

#### **CARDS**
![Cards](assets/cards.png)

Expand Down Expand Up @@ -409,11 +467,6 @@ $(()=>{
| value | Input value | null | string |
| disabled | is disabled? | false | boolean |
| required | is required? | false | boolean |
| step | attr: step | null | string |
| max | attr: max | null | string |
| maxlength | attr: maxlength | null | string |
| pattern | attr: pattern | null | string |


#### INPUT-FILE
**REQUIRES**
Expand Down
9 changes: 7 additions & 2 deletions src/Components/InfoBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,22 @@
class InfoBox extends Component
{
public $bg, $icon, $title, $text, $full, $grad;
public $id, $progress, $comment;

public function __construct(
$bg = 'info', $icon = 'fas fa-star',
$title, $text, $full = false, $grad = false)
$bg = 'info', $icon = 'fas fa-star', $id = null,
$title, $text, $full = false, $grad = false,
$progress = false, $comment = false)
{
$this->id = $id;
$this->bg = $bg;
$this->icon = $icon;
$this->title = $title;
$this->text = $text;
$this->full = $full;
$this->grad = $grad;
$this->progress = $progress;
$this->comment = $comment;
}

public function background()
Expand Down
4 changes: 3 additions & 1 deletion src/Components/SmallBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
class SmallBox extends Component
{
public $bg, $icon, $title, $text, $url, $urlText, $loading;
public $id;

public function __construct(
$bg = 'info', $icon = 'fas fa-star', $title,
$bg = 'info', $icon = 'fas fa-star', $title, $id = null,
$text, $url='#', $urlText = null,
$loading = false)
{
$this->id = $id;
$this->bg = $bg;
$this->icon = $icon;
$this->title = $title;
Expand Down
19 changes: 17 additions & 2 deletions src/resources/components/info-box.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,22 @@
<i class="{{$icon}}"></i>
</span>
<div class="info-box-content">
<span class="info-box-text">{{$title}}</span>
<span class="info-box-number">{{$text}}</span>
<span class="info-box-text" id="{{!is_null($id) ? $id.'-title' : null}}">
{{$title}}
</span>
<span class="info-box-number" id="{{!is_null($id) ? $id.'-text' : null}}">
{{$text}}
</span>
@if($progress)
<div class="progress">
<div class="progress-bar" id="{{!is_null($id) ? $id.'-progress' : null}}" style="width: {{$progress}}%"></div>
</div>
@endif

@if($comment)
<span class="progress-description" id="{{!is_null($id) ? $id.'-comment' : null}}">
{{$comment}}
</span>
@endif
</div>
</div>
6 changes: 3 additions & 3 deletions src/resources/components/small-box.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
</div>
@endif
<div class="inner">
<h3>{{$text}}</h3>
<p>{{$title}}</p>
<h3 id="{{!is_null($id) ? $id.'-text' : null}}">{{$text}}</h3>
<p id="{{!is_null($id) ? $id.'-title' : null}}">{{$title}}</p>
</div>
<div class="icon">
<i class="{{$icon}}"></i>
</div>
<a href="{{$url}}" class="small-box-footer">
<a id="{{!is_null($id) ? $id.'-link' : null}}" href="{{$url}}" class="small-box-footer">
{{$urlTextLine}} <i class="fas fa-arrow-circle-right"></i>
</a>
</div>

0 comments on commit 2f646ea

Please sign in to comment.