react-application-core
Version:
A react-based application core for the business applications.
81 lines • 3.27 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.RadioGroup = void 0;
var React = require("react");
var select_1 = require("../select");
var definition_1 = require("../../../definition");
var util_1 = require("../../../util");
var checkbox_1 = require("../checkbox");
/**
* @component-impl
* @stable [22.12.2020]
*/
var RadioGroup = /** @class */ (function (_super) {
__extends(RadioGroup, _super);
function RadioGroup() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(RadioGroup.prototype, "inputAttachmentElement", {
/**
* @stable [22.12.2020]
* @protected
*/
get: function () {
return this.getSelfFieldWrapper(this.labelElement);
},
enumerable: false,
configurable: true
});
Object.defineProperty(RadioGroup.prototype, "attachmentBodyElement", {
/**
* @stable [22.12.2020]
* @protected
*/
get: function () {
var _this = this;
var _a = this.originalProps, disabled = _a.disabled, readOnly = _a.readOnly;
var options = this.options;
var id = this.fromSelectValueToId(this.value);
return (React.createElement(React.Fragment, null, options.map(function (option, index) { return (React.createElement(checkbox_1.Radio, { key: "radio-option-" + index, value: _this.fromSelectValueToId(option) === id, label: _this.fieldConverter.fromSelectValueToDisplayValue(option), errorMessageRendered: false, disabled: disabled, readOnly: readOnly, onChange: function () { return _this.onSelect(option); } })); })));
},
enumerable: false,
configurable: true
});
/**
* @stable [22.12.2020]
* @protected
*/
RadioGroup.prototype.getFieldClassName = function () {
return util_1.ClsUtils.joinClassName(_super.prototype.getFieldClassName.call(this), definition_1.RadioGroupClassesEnum.RADIO_GROUP);
};
Object.defineProperty(RadioGroup.prototype, "baseTextFieldClassName", {
/**
* @stable [22.12.2020]
* @protected
*/
get: function () {
return null;
},
enumerable: false,
configurable: true
});
RadioGroup.defaultProps = util_1.PropsUtils.mergeWithParentDefaultProps({
fieldRendered: false,
}, select_1.BaseSelect);
return RadioGroup;
}(select_1.BaseSelect));
exports.RadioGroup = RadioGroup;
//# sourceMappingURL=radio-group.component.js.map