mdb-ui-kit/js/baseFormControl.js

33 lines
826 B
JavaScript
Raw Normal View History

2017-08-11 17:59:31 +03:00
import BaseInput from "./baseInput";
2017-08-11 17:59:31 +03:00
const BaseFormControl = ($ => {
/**
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
const Default = {
2017-08-11 17:59:31 +03:00
requiredClasses: ["form-control"]
};
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
class BaseFormControl extends BaseInput {
constructor($element, config) {
2017-08-11 17:59:31 +03:00
super($element, $.extend(true, Default, config));
// Initially mark as empty
if (this.isEmpty()) {
2017-08-11 17:59:31 +03:00
this.removeIsFilled();
}
}
}
2017-08-11 17:59:31 +03:00
return BaseFormControl;
})(jQuery);
2017-08-11 17:59:31 +03:00
export default BaseFormControl;