UNPKG

kepler.gl

Version:

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

55 lines (54 loc) 8.26 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.PanelTabFactory = PanelTabFactory; exports["default"] = exports.StyledPanelTab = void 0; var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")); var _react = _interopRequireDefault(require("react")); var _styledComponents = _interopRequireDefault(require("styled-components")); var _styledComponents2 = require("../common/styled-components"); var _localization = require("@kepler.gl/localization"); var _templateObject; // SPDX-License-Identifier: MIT // Copyright contributors to the kepler.gl project var StyledPanelTab = exports.StyledPanelTab = _styledComponents["default"].div.attrs({ className: 'side-panel__tab' })(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n align-items: flex-end;\n border-bottom-style: solid;\n border-bottom-width: 2px;\n border-bottom-color: ", ";\n color: ", ";\n display: flex;\n justify-content: center;\n margin-right: ", "px;\n padding-bottom: ", "px;\n width: ", ";\n\n &:hover {\n cursor: pointer;\n color: ", ";\n }\n"])), function (props) { return props.active ? props.theme.panelToggleBorderColor : 'transparent'; }, function (props) { return props.active ? props.theme.subtextColorActive : props.theme.panelTabColor; }, function (props) { return props.theme.panelToggleMarginRight; }, function (props) { return props.theme.panelToggleBottomPadding; }, function (props) { return props.theme.panelTabWidth; }, function (props) { return props.theme.textColorHl; }); function PanelTabFactory() { var PanelTab = function PanelTab(_ref) { var isActive = _ref.isActive, onClick = _ref.onClick, panel = _ref.panel; return /*#__PURE__*/_react["default"].createElement(StyledPanelTab, { "data-tip": true, "data-for": "".concat(panel.id, "-nav"), active: isActive, onClick: onClick }, /*#__PURE__*/_react["default"].createElement(panel.iconComponent, { height: "20px" }), /*#__PURE__*/_react["default"].createElement(_styledComponents2.Tooltip, { id: "".concat(panel.id, "-nav"), effect: "solid", delayShow: 500, place: "bottom" }, /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement(_localization.FormattedMessage, { id: panel.label || panel.id })))); }; return PanelTab; } var _default = exports["default"] = PanelTabFactory; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfcmVhY3QiLCJfaW50ZXJvcFJlcXVpcmVEZWZhdWx0IiwicmVxdWlyZSIsIl9zdHlsZWRDb21wb25lbnRzIiwiX3N0eWxlZENvbXBvbmVudHMyIiwiX2xvY2FsaXphdGlvbiIsIl90ZW1wbGF0ZU9iamVjdCIsIlN0eWxlZFBhbmVsVGFiIiwiZXhwb3J0cyIsInN0eWxlZCIsImRpdiIsImF0dHJzIiwiY2xhc3NOYW1lIiwiX3RhZ2dlZFRlbXBsYXRlTGl0ZXJhbDIiLCJwcm9wcyIsImFjdGl2ZSIsInRoZW1lIiwicGFuZWxUb2dnbGVCb3JkZXJDb2xvciIsInN1YnRleHRDb2xvckFjdGl2ZSIsInBhbmVsVGFiQ29sb3IiLCJwYW5lbFRvZ2dsZU1hcmdpblJpZ2h0IiwicGFuZWxUb2dnbGVCb3R0b21QYWRkaW5nIiwicGFuZWxUYWJXaWR0aCIsInRleHRDb2xvckhsIiwiUGFuZWxUYWJGYWN0b3J5IiwiUGFuZWxUYWIiLCJfcmVmIiwiaXNBY3RpdmUiLCJvbkNsaWNrIiwicGFuZWwiLCJjcmVhdGVFbGVtZW50IiwiY29uY2F0IiwiaWQiLCJpY29uQ29tcG9uZW50IiwiaGVpZ2h0IiwiVG9vbHRpcCIsImVmZmVjdCIsImRlbGF5U2hvdyIsInBsYWNlIiwiRm9ybWF0dGVkTWVzc2FnZSIsImxhYmVsIiwiX2RlZmF1bHQiXSwic291cmNlcyI6WyIuLi8uLi9zcmMvc2lkZS1wYW5lbC9wYW5lbC10YWIudHN4Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBNSVRcbi8vIENvcHlyaWdodCBjb250cmlidXR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