UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

1 lines 1.33 kB
module.exports = "/* tslint:disable:no-unused-variable */\nimport * as React from 'react';\n/* tslint:enable:no-unused-variable */\nimport {\n DetailsList,\n DetailsRow,\n css,\n autobind\n} from '../../../../index';\nimport { createListItems } from '../../../utilities/data';\nimport './DetailsListExample.scss';\n\nlet _items: any[];\n\nexport class DetailsListCustomRowsExample extends React.Component<any, any> {\n constructor() {\n super();\n\n _items = _items || createListItems(500);\n }\n\n public render() {\n return (\n <DetailsList\n items={ _items }\n setKey='set'\n onRenderRow={ this._onRenderRow }\n />\n );\n }\n\n @autobind\n private _onRenderRow(props) {\n return <DetailsRow { ...props } onRenderCheck={ this._onRenderCheck } />;\n }\n\n @autobind\n private _onRenderCheck(props) {\n return (\n <div\n className={ css(\n 'ms-DetailsRow-check DetailsListExample-customCheck', {\n 'is-any-selected': props.anySelected\n }) }\n role='button'\n aria-pressed={ props.isSelected }\n data-selection-toggle={ true }\n aria-label={ props.ariaLabel }\n >\n <input\n type='checkbox'\n checked={ props.isSelected }\n />\n </div>\n );\n }\n}\n";