mdb-ui-kit/js/src/baseFormControl.js
Kevin Ross 3fdbbbec28 es6, umd, and iife bundles are all being created properly for core and docs. Dramatically simplified (using rollup):
- js file generation
- docs js generation
- configuration and bridging to jekyll (removed a bunch of unnecessary code)
2016-01-04 11:28:12 -06:00

43 lines
1.0 KiB
JavaScript

import BaseInput from './baseInput'
const BaseFormControl = (($) => {
/**
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
const Default = {
decorator: {
template: `<span class='mdb-form-control-decorator'></span>`
},
requiredClasses: ['form-control']
}
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
class BaseFormControl extends BaseInput {
constructor($element, config) {
super($element, $.extend(true, Default, config))
// Initially mark as empty
if (this.isEmpty()) {
this.removeIsFilled()
}
// Add marker div the end of the form-group
this.$element.after(this.config.decorator.template)
}
}
return BaseFormControl
})(jQuery)
export default BaseFormControl