Skip to content

Commit 2f646ea

Browse files
committed
Merge branch 'master' of https://github.com/dgvai/laravel-adminlte-components into release
2 parents 0f67e92 + f051726 commit 2f646ea

File tree

5 files changed

+88
-13
lines changed

5 files changed

+88
-13
lines changed

README.md

Lines changed: 58 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,22 @@ This package contains [Laravel Blade Components](https://laravel.com/docs/7.x/bl
1919
- [Installation](#installation)
2020
- [Extract Plugins](#extract-plugins)
2121
- [Configurations](#configurations)
22+
- [Components](#components)
23+
- [Widgets](#widgets)
24+
- [**INFO BOX**](#info-box)
25+
- [**SMALL BOX**](#small-box)
26+
- [**CARDS**](#cards)
27+
- [**ALERT**](#alert)
2228
- [**CALLOUT**](#callout)
2329
- [**PROGRESS**](#progress)
2430
- [**PROFILE FLAT**](#profile-flat)
2531
- [**PROFILE WIDGET**](#profile-widget)
32+
- [**MODAL**](#modal)
33+
- [**DATATABLE**](#datatable)
34+
- [Form Components](#form-components)
35+
- [INPUT](#input)
36+
- [INPUT-FILE](#input-file)
37+
- [INPUT-COLOR](#input-color)
2638
- [INPUT-DATE](#input-date)
2739
- [DATE-RANGE](#date-range)
2840
- [INPUT-SWITCH](#input-switch)
@@ -185,12 +197,37 @@ Use this in the [jeroennoten/Laravel-AdminLTE](https://github.com/jeroennoten/La
185197
| icon | The fontawesome icon class. Eg. ``fas fa-star``, ``fas fa-user-plus`` | false | string |
186198
| grad | Use gradient color? ``true/false`` | false | boolean |
187199
| full | Use full INFO BOX? ``true/false`` | false | boolean |
200+
| progress | Show Progress bar? | false | int |
201+
| comment | Show comment? | false | string |
202+
| id | Dynamic Binding? | false | string |
188203

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

209+
**DYNAMIC BINDINGS**
210+
Set ``id`` attibute, this will enable dynamic attributes for:
211+
| ID |
212+
|----|
213+
|#{id}-title|
214+
|#{id}-text|
215+
|#{id}-progress|
216+
|#{id}-comment|
217+
218+
**EXAMPLE**
219+
```html
220+
<x-dg-info-box bg="success" title="Users" text="100" icon="fas fa-star" :full="true" :grad="true" id="userbox" />
221+
222+
<script>
223+
$(()=>{
224+
$('#userbox-title').text('Users');
225+
$('#userbox-text').text('102');
226+
});
227+
</script>
228+
```
229+
230+
194231
#### **SMALL BOX**
195232
![Small Box](assets/small-box.png)
196233

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

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

255+
**DYNAMIC BINDINGS**
256+
Set ``id`` attibute, this will enable dynamic attributes for:
257+
| ID |
258+
|----|
259+
|#{id}-title|
260+
|#{id}-text|
261+
|#{id}-link|
262+
263+
**EXAMPLE**
264+
```html
265+
<x-dg-small-box title="Small box" text="500" bg="warning" url="#" urlText="See More" loading="false" $id="userbox"/>
266+
267+
<script>
268+
$(()=>{
269+
$('#userbox-text').text('102');
270+
$('#userbox-link').attr('href',new.link);
271+
});
272+
</script>
273+
```
274+
217275
#### **CARDS**
218276
![Cards](assets/cards.png)
219277

@@ -409,11 +467,6 @@ $(()=>{
409467
| value | Input value | null | string |
410468
| disabled | is disabled? | false | boolean |
411469
| required | is required? | false | boolean |
412-
| step | attr: step | null | string |
413-
| max | attr: max | null | string |
414-
| maxlength | attr: maxlength | null | string |
415-
| pattern | attr: pattern | null | string |
416-
417470

418471
#### INPUT-FILE
419472
**REQUIRES**

src/Components/InfoBox.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,22 @@
77
class InfoBox extends Component
88
{
99
public $bg, $icon, $title, $text, $full, $grad;
10+
public $id, $progress, $comment;
1011

1112
public function __construct(
12-
$bg = 'info', $icon = 'fas fa-star',
13-
$title, $text, $full = false, $grad = false)
13+
$bg = 'info', $icon = 'fas fa-star', $id = null,
14+
$title, $text, $full = false, $grad = false,
15+
$progress = false, $comment = false)
1416
{
17+
$this->id = $id;
1518
$this->bg = $bg;
1619
$this->icon = $icon;
1720
$this->title = $title;
1821
$this->text = $text;
1922
$this->full = $full;
2023
$this->grad = $grad;
24+
$this->progress = $progress;
25+
$this->comment = $comment;
2126
}
2227

2328
public function background()

src/Components/SmallBox.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
class SmallBox extends Component
88
{
99
public $bg, $icon, $title, $text, $url, $urlText, $loading;
10+
public $id;
1011

1112
public function __construct(
12-
$bg = 'info', $icon = 'fas fa-star', $title,
13+
$bg = 'info', $icon = 'fas fa-star', $title, $id = null,
1314
$text, $url='#', $urlText = null,
1415
$loading = false)
1516
{
17+
$this->id = $id;
1618
$this->bg = $bg;
1719
$this->icon = $icon;
1820
$this->title = $title;

src/resources/components/info-box.blade.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,22 @@
33
<i class="{{$icon}}"></i>
44
</span>
55
<div class="info-box-content">
6-
<span class="info-box-text">{{$title}}</span>
7-
<span class="info-box-number">{{$text}}</span>
6+
<span class="info-box-text" id="{{!is_null($id) ? $id.'-title' : null}}">
7+
{{$title}}
8+
</span>
9+
<span class="info-box-number" id="{{!is_null($id) ? $id.'-text' : null}}">
10+
{{$text}}
11+
</span>
12+
@if($progress)
13+
<div class="progress">
14+
<div class="progress-bar" id="{{!is_null($id) ? $id.'-progress' : null}}" style="width: {{$progress}}%"></div>
15+
</div>
16+
@endif
17+
18+
@if($comment)
19+
<span class="progress-description" id="{{!is_null($id) ? $id.'-comment' : null}}">
20+
{{$comment}}
21+
</span>
22+
@endif
823
</div>
924
</div>

src/resources/components/small-box.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
</div>
66
@endif
77
<div class="inner">
8-
<h3>{{$text}}</h3>
9-
<p>{{$title}}</p>
8+
<h3 id="{{!is_null($id) ? $id.'-text' : null}}">{{$text}}</h3>
9+
<p id="{{!is_null($id) ? $id.'-title' : null}}">{{$title}}</p>
1010
</div>
1111
<div class="icon">
1212
<i class="{{$icon}}"></i>
1313
</div>
14-
<a href="{{$url}}" class="small-box-footer">
14+
<a id="{{!is_null($id) ? $id.'-link' : null}}" href="{{$url}}" class="small-box-footer">
1515
{{$urlTextLine}} <i class="fas fa-arrow-circle-right"></i>
1616
</a>
1717
</div>

0 commit comments

Comments
 (0)