2020-03-06 16:10:25 -05:00
|
|
|
/**
|
|
|
|
* library.js
|
|
|
|
*
|
|
|
|
* Note: We're shipping front end code here, file size is critical. This file is
|
|
|
|
* overly terse for that reason alone, we wouldn't necessarily recommend this.
|
|
|
|
*/
|
|
|
|
const fi = 'FormulateInput'
|
|
|
|
const add = (n, c) => ({
|
|
|
|
classification: n,
|
|
|
|
component: fi + (c || (n[0].toUpperCase() + n.substr(1)))
|
|
|
|
})
|
2019-10-07 10:24:30 -04:00
|
|
|
export default {
|
|
|
|
// === SINGLE LINE TEXT STYLE INPUTS
|
2020-03-06 16:10:25 -05:00
|
|
|
...[
|
|
|
|
'text',
|
|
|
|
'email',
|
|
|
|
'number',
|
|
|
|
'color',
|
|
|
|
'date',
|
|
|
|
'hidden',
|
|
|
|
'month',
|
|
|
|
'password',
|
|
|
|
'search',
|
|
|
|
'tel',
|
|
|
|
'time',
|
|
|
|
'url',
|
|
|
|
'week',
|
|
|
|
'datetime-local'
|
|
|
|
].reduce((lib, type) => ({ ...lib, [type]: add('text') }), {}),
|
2019-10-07 10:24:30 -04:00
|
|
|
|
2019-11-14 01:00:56 -05:00
|
|
|
// === SLIDER INPUTS
|
2020-03-06 16:10:25 -05:00
|
|
|
range: add('slider'),
|
2019-11-14 01:00:56 -05:00
|
|
|
|
2019-10-07 10:24:30 -04:00
|
|
|
// === MULTI LINE TEXT INPUTS
|
2020-03-06 16:10:25 -05:00
|
|
|
textarea: add('textarea', 'TextArea'),
|
2019-10-07 10:24:30 -04:00
|
|
|
|
|
|
|
// === BOX STYLE INPUTS
|
2020-03-06 16:10:25 -05:00
|
|
|
checkbox: add('box'),
|
|
|
|
radio: add('box'),
|
2019-10-07 10:24:30 -04:00
|
|
|
|
|
|
|
// === BUTTON STYLE INPUTS
|
2020-03-06 16:10:25 -05:00
|
|
|
submit: add('button'),
|
|
|
|
button: add('button'),
|
2019-10-07 10:24:30 -04:00
|
|
|
|
|
|
|
// === SELECT STYLE INPUTS
|
2020-03-06 16:10:25 -05:00
|
|
|
select: add('select'),
|
2019-11-15 14:44:01 -05:00
|
|
|
|
|
|
|
// === FILE TYPE
|
2020-03-06 16:10:25 -05:00
|
|
|
file: add('file'),
|
|
|
|
image: add('file')
|
2019-10-07 10:24:30 -04:00
|
|
|
}
|