office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
29 lines • 1.67 kB
JavaScript
import * as tslib_1 from "tslib";
import * as React from 'react';
import { DefaultButton } from 'office-ui-fabric-react/lib/Button';
import { TooltipHost, TooltipDelay, DirectionalHint } from 'office-ui-fabric-react/lib/Tooltip';
import { getId } from 'office-ui-fabric-react/lib/Utilities';
var TooltipCustomExample = /** @class */ (function (_super) {
tslib_1.__extends(TooltipCustomExample, _super);
function TooltipCustomExample() {
var _this = _super !== null && _super.apply(this, arguments) || this;
// Use getId() to ensure that the ID is unique on the page.
// (It's also okay to use a plain string without getId() and manually ensure uniqueness.)
_this._hostId = getId('tooltipHost');
return _this;
}
TooltipCustomExample.prototype.render = function () {
return (React.createElement(TooltipHost, { calloutProps: { gapSpace: 20 }, tooltipProps: {
onRenderContent: function () {
return (React.createElement("div", null,
React.createElement("ul", { style: { margin: 0, padding: 0 } },
React.createElement("li", null, "1. One"),
React.createElement("li", null, "2. Two"))));
}
}, delay: TooltipDelay.zero, id: this._hostId, directionalHint: DirectionalHint.bottomCenter },
React.createElement(DefaultButton, { "aria-labelledby": this._hostId, text: "Hover Over Me" })));
};
return TooltipCustomExample;
}(React.Component));
export { TooltipCustomExample };
//# sourceMappingURL=Tooltip.Custom.Example.js.map