-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
37 lines (35 loc) · 916 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
37
'use strict';
/**
* Currency Input Plugin
*
* A currency input plugin
*/
const validation = require('./lib/validation.js');
/**
* Currency Input Plugin
* @module currencyInputPlugin
*/
module.exports = {
name: 'boolean',
description: 'A boolean input type',
validation: {
currencyValidation: validation,
},
inputs: {
currency: {
validation: {
function: 'currencyValidation',
on: 'blur',
},
label: 'Please enter a currency',
placeholder: '42.42',
type: 'number',
settings: {
min: 0,
step: '0.01',
symbol: '$',
},
},
},
html: '<label for="{{currency.id}}">{{currency.label}}</label>{{currency.symbol}}<input type="{{currency.type}}" id="{{currency.id}}" min="{{currency.min}}" name="{{currency.name}}" step="{{currency.step}}" value="{{currency.value}}" placeholder="{{currency.placeholder}}" />',
};