-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
36 lines (34 loc) · 897 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
'use strict';
/**
* Telephone Input Plugin
*
*
* Simple input plugin for a telephone number
*/
const validation = require('./lib/validation.js');
/**
* Single Telephone Input Plugin
* @module telephoneInputPlugin
*/
module.exports = {
name: 'Telephone',
description: 'Simple input plugin for a telephone number',
validation: {
telephoneValidation: validation,
},
inputs: {
telephone: {
validation: {
function: 'telephoneValidation',
on: 'blur',
},
label: 'Please enter your telephone number',
placeholder: '(xxx)xxx-xxxx',
type: 'tel',
settings: {
locale: 'en-US',
},
},
},
html: '<label for="{{telephone.id}}">{{telephone.label}}</label><input type="{{telephone.type}}" id="{{telephone.id}}" name="{{telephone.name}}" value="{{telephone.value}}" placeholder="{{telephone.placeholder}}" />',
};