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