1
0
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:
codecalm
2020-01-05 13:52:44 +01:00
parent fb53969181
commit a3442a54ac
2 changed files with 18 additions and 34 deletions
+18
View File
@@ -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 %}