There is no license information available for the latest version (v2.2.2) of this package.

Input Masks library for live-controls

Installs: 880

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 3

Language:Blade

v2.2.2 2024-05-13 20:52 UTC

This package is auto-updated.

Last update: 2024-11-13 22:03:14 UTC


README

Release Version Packagist Version Input Masks library for live-controls

Requirements

  • Laravel 9+
  • Livewire 2+

Translations

  • English (en)
  • German (de)
  • Brazilian Portuguese (pt_BR)

Installation

  1. Install Masks package
composer require live-controls/masks

CDN Installation

  1. Include @livecontrolsMasks() before /head tag
  2. In case you did publish the configuration file, set local_files to false (This is the default option)

Local Installation

  1. Run:
npm install imask
  1. Add to app.js:
import IMask from 'imask';
  1. Run:
npm run build;
  1. Run:
php artisan vendor:publish --tag="livecontrols.masks.config";
  1. 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);