office-ui-fabric-react
Version: 
Reusable React components for building experiences for Office 365.
54 lines • 2.55 kB
JavaScript
import * as tslib_1 from "tslib";
import * as React from 'react';
import { ChoiceGroup } from 'office-ui-fabric-react/lib/ChoiceGroup';
import { autobind, 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() {
        return _super !== null && _super.apply(this, arguments) || 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 })));
    };
    ChoiceGroupCustomExample.prototype._onChange = function (ev, option) {
        console.dir(option);
    };
    tslib_1.__decorate([
        autobind
    ], ChoiceGroupCustomExample.prototype, "_onChange", null);
    return ChoiceGroupCustomExample;
}(React.Component));
export { ChoiceGroupCustomExample };
//# sourceMappingURL=ChoiceGroup.Custom.Example.js.map