live-controls / masks
Input Masks library for live-controls
Installs: 826
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 3
Language:Blade
Requires
- livewire/livewire: ^3.0
Requires (Dev)
README
Input Masks library for live-controls
Requirements
- Laravel 9+
- Livewire 2+
Translations
- English (en)
- German (de)
- Brazilian Portuguese (pt_BR)
Installation
- Install Masks package
composer require live-controls/masks
CDN Installation
- Include @livecontrolsMasks() before /head tag
- In case you did publish the configuration file, set local_files to false (This is the default option)
Local Installation
- Run:
npm install imask
- Add to app.js:
import IMask from 'imask';
- Run:
npm run build;
- Run:
php artisan vendor:publish --tag="livecontrols.masks.config";
- Edit config/livecontrols-masks.php:
'local_files' => true, //Set local_files to true
Usage
@livewire('livecontrols-currencymask', [
'maskId' => 'someUniqueId',
'maskName' => 'someUniqueName',
'unmaskedId' => 'idforhiddeninput',
'unmaskedName' => 'nameforhiddeninput',
'class' => 'input input-bordered w-full',
'required' => true,
'value' => 'set to something if you want to use it for update',
'currencyString' => 'R$',
'updateCallName' => 'WillBeFiredIfValueGotUpdated'
], key())
To update a value call:
$this->dispatch('update-mask-value-maskId', value: 500);