office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
52 lines • 2.44 kB
JavaScript
import * as tslib_1 from "tslib";
import * as React from 'react';
import { ChoiceGroup } from 'office-ui-fabric-react/lib/ChoiceGroup';
import { css } from 'office-ui-fabric-react/lib/Utilities';
import { Dropdown } from 'office-ui-fabric-react/lib/Dropdown';
import * as stylesImport from './ChoiceGroup.Custom.Example.scss';
var styles = stylesImport;
var ChoiceGroupCustomExample = /** @class */ (function (_super) {
tslib_1.__extends(ChoiceGroupCustomExample, _super);
function ChoiceGroupCustomExample() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._onChange = function (ev, option) {
console.dir(option);
};
return _this;
}
ChoiceGroupCustomExample.prototype.render = function () {
return (React.createElement("div", null,
React.createElement(ChoiceGroup, { defaultSelectedKey: "B", options: [
{
key: 'A',
text: 'Mark displayed items as read after',
onRenderField: function (props, render) {
return (React.createElement("div", { className: css(styles.root) },
render(props),
React.createElement(Dropdown, { className: css(styles.dropdown), defaultSelectedKey: "A", options: [
{ key: 'A', text: '5 seconds' },
{ key: 'B', text: '10 seconds' },
{ key: 'C', text: '20 seconds' }
], disabled: false })));
}
},
{
key: 'B',
text: 'Option B'
},
{
key: 'C',
text: 'Option C',
disabled: true
},
{
key: 'D',
text: 'Option D',
disabled: false
}
], onChange: this._onChange, label: "Pick one", required: true })));
};
return ChoiceGroupCustomExample;
}(React.Component));
export { ChoiceGroupCustomExample };
//# sourceMappingURL=ChoiceGroup.Custom.Example.js.map