-
-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v3 - Add Loading Placeholder (#1421)
* Initial Loading Placeholder Code, Use Hourglass Spinner * Add wrappers, Class Merging, Colouring * Renaming Traits - Adding LoadingPlaceholder Tests, Add Placeholder Test Table * Update Docs for Placeholder --------- Co-authored-by: lrljoe <[email protected]>
- Loading branch information
Showing
20 changed files
with
712 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(''); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: Debugging | ||
weight: 4 | ||
weight: 5 | ||
--- | ||
|
||
## Configuration | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
]); | ||
} | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.