office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
45 lines • 1.74 kB
JavaScript
import * as tslib_1 from "tslib";
// @codepen
import * as React from 'react';
import { ChoiceGroup } from 'office-ui-fabric-react/lib/ChoiceGroup';
var ChoiceGroupLabelExample = /** @class */ (function (_super) {
tslib_1.__extends(ChoiceGroupLabelExample, _super);
function ChoiceGroupLabelExample(props) {
var _this = _super.call(this, props) || this;
_this._onChange = function (ev, option) {
console.dir(option);
};
_this.state = {
imageKey: ''
};
return _this;
}
ChoiceGroupLabelExample.prototype.render = function () {
return (React.createElement("div", null,
React.createElement("div", { id: "labelElement" }, "Here is a custom label"),
React.createElement(ChoiceGroup, { defaultSelectedKey: "B", options: [
{
key: 'A',
text: 'Option A',
'data-automation-id': 'auto1'
},
{
key: 'B',
text: 'Option B'
},
{
key: 'C',
text: 'Option C',
disabled: true
},
{
key: 'D',
text: 'Option D',
disabled: true
}
], onChange: this._onChange, ariaLabelledBy: "labelElement", required: true })));
};
return ChoiceGroupLabelExample;
}(React.Component));
export { ChoiceGroupLabelExample };
//# sourceMappingURL=ChoiceGroup.Label.Example.js.map