UNPKG

1.97 kBJavaScriptView Raw
1var __extends = (this && this.__extends) || (function () {
2 var extendStatics = function (d, b) {
3 extendStatics = Object.setPrototypeOf ||
4 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6 return extendStatics(d, b);
7 }
8 return function (d, b) {
9 extendStatics(d, b);
10 function __() { this.constructor = d; }
11 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12 };
13})();
14var __assign = (this && this.__assign) || function () {
15 __assign = Object.assign || function(t) {
16 for (var s, i = 1, n = arguments.length; i < n; i++) {
17 s = arguments[i];
18 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
19 t[p] = s[p];
20 }
21 return t;
22 };
23 return __assign.apply(this, arguments);
24};
25import * as React from 'react';
26import ProjectedLayer from './projected-layer';
27import { getClassName } from './util/classname';
28export var defaultClassName = ['mapboxgl-popup'];
29var Popup = (function (_super) {
30 __extends(Popup, _super);
31 function Popup() {
32 return _super !== null && _super.apply(this, arguments) || this;
33 }
34 Popup.prototype.render = function () {
35 var _a = this.props, children = _a.children, className = _a.className;
36 var props = __assign({}, this.props, { children: undefined });
37 var childrenClassName = getClassName(defaultClassName, className);
38 return (React.createElement(ProjectedLayer, __assign({}, props, { type: "popup", className: childrenClassName }),
39 React.createElement("div", { className: "mapboxgl-popup-tip" }),
40 React.createElement("div", { className: "mapboxgl-popup-content" }, children)));
41 };
42 return Popup;
43}(React.Component));
44export default Popup;
45//# sourceMappingURL=popup.js.map
\No newline at end of file