office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
47 lines • 1.82 kB
JavaScript
import * as tslib_1 from "tslib";
import * as React from 'react';
import { ChoiceGroup } from 'office-ui-fabric-react/lib/ChoiceGroup';
import { autobind } from 'office-ui-fabric-react/lib/Utilities';
var ChoiceGroupBasicExample = /** @class */ (function (_super) {
tslib_1.__extends(ChoiceGroupBasicExample, _super);
function ChoiceGroupBasicExample(props) {
var _this = _super.call(this, props) || this;
_this.state = {
imageKey: ''
};
return _this;
}
ChoiceGroupBasicExample.prototype.render = function () {
return (React.createElement("div", null,
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, label: 'Pick one', required: true })));
};
ChoiceGroupBasicExample.prototype._onChange = function (ev, option) {
console.dir(option);
};
tslib_1.__decorate([
autobind
], ChoiceGroupBasicExample.prototype, "_onChange", null);
return ChoiceGroupBasicExample;
}(React.Component));
export { ChoiceGroupBasicExample };
//# sourceMappingURL=ChoiceGroup.Basic.Example.js.map