mirror of
https://github.com/tabler/tabler.git
synced 2026-08-01 07:54:38 +04:00
input mask component
This commit is contained in:
@@ -1 +1,19 @@
|
||||
<input type="text" name="input-{{ include.name | default: 'mask' }}" class="form-control" data-mask="{{ include.mask | default: '00/00/0000' }}"{% if include.visible %} data-mask-visible="true"{% endif %}{% if include.placeholder %} placeholder="{{ include.placeholder }}"{% endif %} autocomplete="off"/>
|
||||
|
||||
{% append_lib imask %}
|
||||
{% capture_once scripts %}
|
||||
<script>
|
||||
(function () {
|
||||
const $elem = $('[data-mask]');
|
||||
|
||||
if ($elem) {
|
||||
$elem.each(function () {
|
||||
IMask($(this).get(0), {
|
||||
mask: $(this).attr('data-mask'),
|
||||
lazy: $(this).attr('data-mask-visible') === 'true',
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
{% endcapture_once %}
|
||||
|
||||
Reference in New Issue
Block a user