Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3 - Add Loading Placeholder #1421

Merged
merged 36 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
bb16e8f
Initial Loading Placeholder Code
lrljoe Oct 14, 2023
5d345d8
Fix styling
lrljoe Oct 14, 2023
e41b023
Amending Helpers
lrljoe Oct 14, 2023
7d4d29f
Fix styling
lrljoe Oct 14, 2023
374e5ac
Add Hourglass CSS
lrljoe Oct 14, 2023
7492574
Test V3 Placeholder CSS
lrljoe Oct 14, 2023
a93f318
Update Table Loader
lrljoe Oct 14, 2023
ceee48d
Update Loading
lrljoe Oct 14, 2023
6661608
Hourglass Spinner
lrljoe Oct 14, 2023
2d6bb7b
Adding methods
lrljoe Oct 15, 2023
a01a2e2
LoadingIndicator
lrljoe Oct 15, 2023
7255493
Adjust Loading - BS4/BS5 and TW2/TW3
lrljoe Oct 15, 2023
a326966
Add wrappers
lrljoe Oct 15, 2023
e9fa77f
Fix errant key
lrljoe Oct 15, 2023
d16dd8f
Fix styling
lrljoe Oct 15, 2023
de041bd
Merging Classes
lrljoe Oct 15, 2023
07075da
Tweaks for loadingPlaceholderBlade
lrljoe Oct 15, 2023
d1fe95e
Fix styling
lrljoe Oct 15, 2023
ded0d18
Invert hasLoadingPlaceholderBlade
lrljoe Oct 15, 2023
e98bbbb
Fix styling
lrljoe Oct 15, 2023
2aa0d55
Adjust loading - bootstrap remove none
lrljoe Oct 15, 2023
fd755e9
Adjust colors
lrljoe Oct 15, 2023
b18906d
Colouring
lrljoe Oct 15, 2023
b368d50
Updates
lrljoe Oct 15, 2023
92f66c3
Adding initial docs
lrljoe Oct 15, 2023
ce512f2
Fix bulk actions -> placeholder
lrljoe Oct 15, 2023
ae7a873
In-Line Fixes
lrljoe Oct 15, 2023
a22c668
Add Basic Tests for Loading Placeholder
lrljoe Oct 17, 2023
3b63458
Fix styling
lrljoe Oct 17, 2023
20b50d0
Renaming Traits - Adding LoadingPlaceholder Tests
lrljoe Oct 17, 2023
3ff4bdd
Fix styling
lrljoe Oct 17, 2023
32305b1
Add blade test
lrljoe Oct 17, 2023
30b26e4
Fix styling
lrljoe Oct 17, 2023
18522b5
Add Placeholder Test Table, Basic Visuals Test
lrljoe Oct 17, 2023
de47656
Fix styling
lrljoe Oct 17, 2023
8b5ced3
Update Docs for Placeholder
lrljoe Oct 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to `laravel-livewire-tables` will be documented in this file

## [3.0.0-beta.4] - 2023-10-17
- Introduction of Loading Placeholder
- Docs livewire namespace fix [Here](https://github.com/rappasoft/laravel-livewire-tables/pull/1420)
- Add CollapseAlways capability for Columns

## [3.0.0-beta.3] - 2023-10-13
- Fix for Livewire ^3.0.6 where the table loading causes an additional lifecycle
- Add unminified files to .gitattributes export-ignore
Expand Down Expand Up @@ -1000,4 +1005,4 @@ Ground Up Rebuild
[0.1.4]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.3...v0.1.4
[0.1.3]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.2...v0.1.3
[0.1.2]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.1...v0.1.2
[0.1.1]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.0...v0.1.1
[0.1.1]: https://github.com/rappasoft/laravel-livewire-tables/compare/v0.1.0...v0.1.1
80 changes: 80 additions & 0 deletions docs/datatable/loaders.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
title: Loaders
weight: 4
---

With the introduction of Livewire 3, there are several new methods available for use:

## Loading Placeholder
```php
public function configure(): void
{
$this->setLoadingPlaceholderBlade('');
}
```

### setLoadingPlaceholderStatus
```php
public function configure(): void
{
$this->setLoadingPlaceholderStatus(true);
}
```

### setLoadingPlaceholderEnabled
```php
public function configure(): void
{
$this->setLoadingPlaceholderEnabled();
}
```


### setLoadingPlaceholderDisabled
```php
public function configure(): void
{
$this->setLoadingPlaceholderDisabled();
}
```

### setLoadingPlaceholderContent
```php
public function configure(): void
{
$this->setLoadingPlaceholderContent('');
}
```

### setLoadingPlaceHolderAttributes
```php
public function configure(): void
{
$this->setLoadingPlaceHolderAttributes([]);
}
```

### setLoadingPlaceHolderIconAttributes
```php
public function configure(): void
{
$this->setLoadingPlacehosetLoadingPlaceHolderIconAttributeslderBlade([]);
}
```

### setLoadingPlaceHolderWrapperAttributes
```php
public function configure(): void
{
$this->setLoadingPlaceHolderWrapperAttributes([]);
}
```


### setLoadingPlaceholderBlade
```php
public function configure(): void
{
$this->setLoadingPlaceholderBlade('');
}
```
4 changes: 2 additions & 2 deletions docs/misc/custom-markup.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Adding Custom Markup
weight: 3
weight: 4
---

If you would like to append any custom markup right before the end of the component, you may use the `customView` method and return a view.
Expand All @@ -12,4 +12,4 @@ public function customView(): string
{
return 'includes.custom';
}
```
```
2 changes: 1 addition & 1 deletion docs/misc/debugging.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Debugging
weight: 4
weight: 5
---

## Configuration
Expand Down
78 changes: 78 additions & 0 deletions docs/misc/loading-placeholder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
title: Loading Placeholder
weight: 2
---

When running complex filters or searches, or displaying larger number of records, you can make use of the built-in Loading Placeholder, this is disabled by default.

### setLoadingPlaceholderStatus
You may pass a boolean to this, which will either enable (true) or disable (false) the loading placeholder

```php
public function configure(): void
{
$this->setLoadingPlaceholderStatus(true);
}
```

### setLoadingPlaceholderEnabled

Use this method to enable the loading placeholder:

```php
public function configure(): void
{
$this->setLoadingPlaceholderEnabled();
}
```

### setLoadingPlaceholderDisabled

Use this method to disable the loading placeholder:

```php
public function configure(): void
{
$this->setLoadingPlaceholderDisabled();
}
```

### setLoadingPlaceholderContent

You may use this method to set custom text for the placeholder:

```php
public function configure(): void
{
$this->setLoadingPlaceholderContent('Text To Display');
}
```
### setLoadingPlaceHolderWrapperAttributes

This method allows you to customise the attributes for the <tr> element used as a Placeholder when the table is loading. Similar to other setAttribute methods, this accepts a range of attributes, and a boolean "default", which will enable/disable the default attributes.

```php
public function configure(): void
{
$this->setLoadingPlaceHolderWrapperAttributes([
'class' => 'text-bold',
'default' => false,
]);
}

```

### setLoadingPlaceHolderIconAttributes

This method allows you to customise the attributes for the <div> element that is used solely for the PlaceholderIcon. Similar to other setAttribute methods, this accepts a range of attributes, and a boolean "default", which will enable/disable the default attributes.

```php
public function configure(): void
{
$this->setLoadingPlaceHolderIconAttributes([
'class' => 'lds-hourglass',
'default' => false,
]);
}

```
2 changes: 1 addition & 1 deletion docs/misc/multiple-tables.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Multiple Tables Same Page
weight: 2
weight: 3
---

This feature works for mutiple tables on the same page that are **different** components.
Expand Down
2 changes: 1 addition & 1 deletion docs/misc/saving-state.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Saving Table State
weight: 5
weight: 6
---

There may be occasions that you'd like to save the table state, for example if you have a complex set of filters, search parameters, or simply to remember which page you were on!
Expand Down
38 changes: 38 additions & 0 deletions resources/css/laravel-livewire-tables.css
Original file line number Diff line number Diff line change
Expand Up @@ -362,3 +362,41 @@ label[dir=rtl] .range-slider {
.superhide {
display: none;
}

.lds-hourglass {
display: inline-block;
position: relative;
width: 80px;
height: 80px;
}
.lds-hourglass:after {
content: " ";
display: block;
border-radius: 50%;
width: 0;
height: 0;
margin: 8px;
box-sizing: border-box;
border: 32px solid #000;
border-color: #fff transparent #fff transparent;
animation: lds-hourglass 1.2s infinite;
}
.dark .lds-hourglass:after {
border: 32px solid #FFF;

}


@keyframes lds-hourglass {
0% {
transform: rotate(0);
animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
}
50% {
transform: rotate(900deg);
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}
100% {
transform: rotate(1800deg);
}
}
2 changes: 1 addition & 1 deletion resources/css/laravel-livewire-tables.min.css

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

Loading