terriajs
Version:
Geospatial data visualization platform.
26 lines • 913 B
JavaScript
import { createElement } from "react";
import { TooltipWithButtonLauncher } from "../Generic/TooltipWrapper";
import CustomComponent from "./CustomComponent";
/**
* A `<terriatooltip>` custom component, taking a title and content
* around its child components. It has the following attributes:
*
* * `title` - (Required) The text to use as the "tooltip launcher"
*/
export default class TerriaTooltipCustomComponent extends CustomComponent {
get name() {
return "terriatooltip";
}
get attributes() {
return ["title"];
}
processNode(_context, node, children) {
/* eslint-disable-next-line react/no-children-prop */
return createElement(TooltipWithButtonLauncher, {
dismissOnLeave: true,
launcherComponent: () => node.attribs?.title,
children: () => children
});
}
}
//# sourceMappingURL=TerriaTooltip.js.map