kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
61 lines (60 loc) • 12.4 kB
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = NotificationPanelFactory;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
var _react = _interopRequireWildcard(require("react"));
var _styledComponents = _interopRequireDefault(require("styled-components"));
var _notificationItem = _interopRequireDefault(require("./notification-panel/notification-item"));
var _constants = require("@kepler.gl/constants");
var _templateObject; // SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
var NotificationPanelContent = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n background: transparent;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n padding: 4px;\n overflow-y: auto;\n overflow-x: hidden;\n position: absolute;\n top: 1em;\n right: 1em;\n z-index: 10000;\n box-sizing: border-box;\n"])));
NotificationPanelFactory.deps = [_notificationItem["default"]];
function NotificationPanelFactory(NotificationItem) {
var NotificationPanelUnmemoized = /*#__PURE__*/function (_Component) {
function NotificationPanelUnmemoized() {
(0, _classCallCheck2["default"])(this, NotificationPanelUnmemoized);
return _callSuper(this, NotificationPanelUnmemoized, arguments);
}
(0, _inherits2["default"])(NotificationPanelUnmemoized, _Component);
return (0, _createClass2["default"])(NotificationPanelUnmemoized, [{
key: "render",
value: function render() {
var _this = this;
var globalNotifications = this.props.notifications.filter(function (n) {
return n.topic === _constants.DEFAULT_NOTIFICATION_TOPICS.global;
});
return /*#__PURE__*/_react["default"].createElement(NotificationPanelContent, {
className: "notification-panel",
style: {
display: globalNotifications.length ? 'block' : 'none'
}
}, globalNotifications.map(function (n) {
return /*#__PURE__*/_react["default"].createElement(NotificationItem, {
key: n.id,
notification: n,
removeNotification: _this.props.removeNotification
});
}));
}
}]);
}(_react.Component);
(0, _defineProperty2["default"])(NotificationPanelUnmemoized, "displayName", 'NotificationPanel');
var NotificationPanel = /*#__PURE__*/_react["default"].memo(NotificationPanelUnmemoized);
return NotificationPanel;
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfcmVhY3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