snappymail/dev/Component/Select.js

28 lines
766 B
JavaScript
Raw Normal View History

2019-07-05 03:19:24 +08:00
import { i18n } from 'Common/Translator';
import { defaultOptionsAfterRender } from 'Common/Utils';
2019-07-05 03:19:24 +08:00
import { componentExportHelper } from 'Component/Abstract';
import { AbstractInput } from 'Component/AbstractInput';
2015-11-15 08:23:16 +08:00
2019-07-05 03:19:24 +08:00
class SelectComponent extends AbstractInput {
2015-11-15 08:23:16 +08:00
/**
* @param {Object} params
*/
constructor(params) {
super(params);
this.options = params.options || '';
this.optionsText = params.optionsText || null;
this.optionsValue = params.optionsValue || null;
this.optionsCaption = params.optionsCaption || null;
2019-07-05 03:19:24 +08:00
if (this.optionsCaption) {
2016-06-17 07:23:49 +08:00
this.optionsCaption = i18n(this.optionsCaption);
2015-11-15 08:23:16 +08:00
}
this.defaultOptionsAfterRender = defaultOptionsAfterRender;
2015-11-15 08:23:16 +08:00
}
}
2017-03-01 02:44:13 +08:00
export default componentExportHelper(SelectComponent, 'SelectComponent');