UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

19 lines 1.14 kB
import * as React from 'react'; import { createArray } from 'office-ui-fabric-react/lib/Utilities'; import { FocusZone } from 'office-ui-fabric-react/lib/FocusZone'; import { Image } from 'office-ui-fabric-react/lib/Image'; import './FocusZone.Photos.Example.scss'; var PHOTOS = createArray(25, function () { var randomWidth = 50 + Math.floor(Math.random() * 150); return { url: "http://placehold.it/" + randomWidth + "x100", width: randomWidth, height: 100 }; }); var log = function () { console.log('clicked'); }; export var FocusZonePhotosExample = function () { return (React.createElement(FocusZone, { elementType: "ul", className: "ms-FocusZoneExamples-photoList" }, PHOTOS.map(function (photo, index) { return (React.createElement("li", { key: index, className: "ms-FocusZoneExamples-photoCell", "aria-posinset": index + 1, "aria-setsize": PHOTOS.length, "aria-label": "Photo", "data-is-focusable": true, onClick: log }, React.createElement(Image, { src: photo.url, width: photo.width, height: photo.height }))); }))); }; //# sourceMappingURL=FocusZone.Photos.Example.js.map