UNPKG

kepler.gl

Version:

kepler.gl is a webgl based application to visualize large scale location data in the browser

150 lines (149 loc) 26.2 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _typeof = require("@babel/runtime/helpers/typeof"); Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = NotificationItemFactory; 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 _icons = require("../common/icons"); var _reactMarkdown = _interopRequireDefault(require("react-markdown")); var _constants = require("@kepler.gl/constants"); var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6; // 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 NotificationItemContentBlock = _styledComponents["default"].div.attrs({ className: 'notification-item--content-block' })(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: block;\n position: relative;\n width: ", "px;\n margin-left: auto;\n"])), function (props) { return props.theme.notificationPanelItemWidth * (1 + Number(props.isExpanded)); }); var NotificationItemContent = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n color: #fff;\n display: flex;\n flex-direction: row;\n width: ", "px;\n height: ", "px;\n font-size: 11px;\n margin-bottom: 1rem;\n padding: 1em;\n border-radius: 4px;\n box-shadow: ", ";\n cursor: pointer;\n"])), function (props) { return props.theme.notificationColors[props.type] || '#000'; }, function (props) { return props.theme.notificationPanelItemWidth * (1 + Number(props.isExpanded)); }, function (props) { return props.theme.notificationPanelItemHeight * (1 + Number(props.isExpanded)); }, function (props) { return props.theme.boxShadow; }); var DeleteIcon = (0, _styledComponents["default"])(_icons.Delete)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n cursor: pointer;\n width: 13px;\n height: 13px;\n"]))); var NotificationCounter = _styledComponents["default"].div.attrs({ className: 'notification-item--counter' })(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n font-size: 11px;\n font-weight: bold;\n text-align: center;\n left: -4px;\n bottom: -4px;\n border-radius: 50%;\n width: 20px;\n height: 20px;\n background-color: #ffffff;\n border: 1px solid ", ";\n color: ", ";\n box-shadow: ", ";\n"])), function (props) { return props.theme.notificationColors[props.type] || '#000'; }, function (props) { return props.theme.notificationColors[props.type] || '#000'; }, function (props) { return props.theme.boxShadow; }); var NotificationMessage = _styledComponents["default"].div.attrs({ className: 'notification-item--message' })(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n flex-grow: 2;\n width: ", "px;\n margin: 0 1em;\n overflow: ", ";\n padding-right: ", ";\n\n p {\n margin-top: 0;\n a {\n color: #fff;\n text-decoration: underline;\n }\n }\n"])), function (props) { return props.theme.notificationPanelItemWidth; }, function (props) { return props.isExpanded ? 'auto' : 'hidden'; }, function (props) { return props.isExpanded ? '1em' : 0; }); var NotificationIcon = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n svg {\n vertical-align: text-top;\n }\n"]))); var icons = { info: /*#__PURE__*/_react["default"].createElement(_icons.Info, { "data-testid": _constants.dataTestIds.infoIcon }), warning: /*#__PURE__*/_react["default"].createElement(_icons.Warning, { "data-testid": _constants.dataTestIds.warningIcon }), error: /*#__PURE__*/_react["default"].createElement(_icons.Warning, { "data-testid": _constants.dataTestIds.errorIcon }), success: /*#__PURE__*/_react["default"].createElement(_icons.Checkmark, { "data-testid": _constants.dataTestIds.successIcon }) }; var LinkRenderer = function LinkRenderer(props) { return /*#__PURE__*/_react["default"].createElement("a", { href: props.href, target: "_blank", rel: "noopener noreferrer" }, props.children); }; function NotificationItemFactory() { return /*#__PURE__*/function (_Component) { function NotificationItem() { var _this; (0, _classCallCheck2["default"])(this, NotificationItem); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _callSuper(this, NotificationItem, [].concat(args)); (0, _defineProperty2["default"])(_this, "state", { isExpanded: false }); return _this; } (0, _inherits2["default"])(NotificationItem, _Component); return (0, _createClass2["default"])(NotificationItem, [{ key: "componentDidMount", value: function componentDidMount() { if (this.props.isExpanded) { this.setState({ isExpanded: true }); } } }, { key: "render", value: function render() { var _this2 = this; var _this$props = this.props, notification = _this$props.notification, removeNotification = _this$props.removeNotification; var isExpanded = this.state.isExpanded; return /*#__PURE__*/_react["default"].createElement(NotificationItemContentBlock, { isExpanded: isExpanded, theme: this.props.theme }, (notification.count || 0) > 1 ? /*#__PURE__*/_react["default"].createElement(NotificationCounter, { type: notification.type, theme: this.props.theme }, notification.count) : null, /*#__PURE__*/_react["default"].createElement(NotificationItemContent, { className: "notification-item", type: notification.type, isExpanded: isExpanded, onClick: function onClick() { return _this2.setState({ isExpanded: !isExpanded }); } }, /*#__PURE__*/_react["default"].createElement(NotificationIcon, { className: "notification-item--icon" }, icons[notification.type]), /*#__PURE__*/_react["default"].createElement(NotificationMessage, { isExpanded: isExpanded, theme: this.props.theme }, /*#__PURE__*/_react["default"].createElement(_reactMarkdown["default"], { components: { a: LinkRenderer } }, notification.message)), typeof removeNotification === 'function' ? /*#__PURE__*/_react["default"].createElement("div", { className: "notification-item--action" }, /*#__PURE__*/_react["default"].createElement(DeleteIcon, { height: "10px", onClick: function onClick() { return removeNotification(notification.id); } })) : null)); } }]); }(_react.Component); } //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfcmVhY3QiLCJfaW50ZXJvcFJlcXVpcmVXaWxkY2FyZCIsInJlcXVpcmUiLCJfc3R5bGVkQ29tcG9uZW50cyIsIl9pbnRlcm9wUmVxdWlyZURlZmF1bHQiLCJfaWNvbnMiLCJfcmVhY3RNYXJrZG93biIsIl9jb25zdGFudHMiLCJfdGVtcGxhdGVPYmplY3QiLCJfdGVtcGxhdGVPYmplY3QyIiwiX3RlbXBsYXRlT2JqZWN0MyIsIl90ZW1wbGF0ZU9iamVjdDQiLCJfdGVtcGxhdGVPYmplY3Q1IiwiX3RlbXBsYXRlT2JqZWN0NiIsIl9nZXRSZXF1aXJlV2lsZGNhcmRDYWNoZSIsImUiLCJXZWFrTWFwIiwiciIsInQiLCJfX2VzTW9kdWxlIiwiX3R5c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