kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
212 lines (175 loc) • 21.8 kB
JavaScript
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = exports.DragHandle = exports.defaultProps = void 0;
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _classnames = _interopRequireDefault(require("classnames"));
var _styledComponents = _interopRequireDefault(require("styled-components"));
var _reactSortableHoc = require("react-sortable-hoc");
var _panelHeaderAction = _interopRequireDefault(require("../panel-header-action"));
var _icons = require("../../common/icons");
var _styledComponents2 = require("../../common/styled-components");
var _reactIntl = require("react-intl");
function _templateObject5() {
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n opacity: 0;\n z-index: 1000;\n\n :hover {\n cursor: move;\n opacity: 1;\n color: ", ";\n }\n"]);
_templateObject5 = function _templateObject5() {
return data;
};
return data;
}
function _templateObject4() {
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: 4px;\n\n .layer__title__type {\n color: ", ";\n font-size: 10px;\n line-height: 12px;\n letter-spacing: 0.37px;\n text-transform: capitalize;\n }\n"]);
_templateObject4 = function _templateObject4() {
return data;
};
return data;
}
function _templateObject3() {
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n"]);
_templateObject3 = function _templateObject3() {
return data;
};
return data;
}
function _templateObject2() {
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n color: ", ";\n"]);
_templateObject2 = function _templateObject2() {
return data;
};
return data;
}
function _templateObject() {
var data = (0, _taggedTemplateLiteral2["default"])(["\n .layer__remove-layer {\n opacity: 0;\n }\n :hover {\n cursor: pointer;\n background-color: ", ";\n\n .layer__drag-handle {\n opacity: 1;\n }\n\n .layer__remove-layer {\n opacity: 1;\n }\n }\n"]);
_templateObject = function _templateObject() {
return data;
};
return data;
}
var propTypes = {
// required
layerId: _propTypes["default"].string.isRequired,
isVisible: _propTypes["default"].bool.isRequired,
onToggleVisibility: _propTypes["default"].func.isRequired,
onUpdateLayerLabel: _propTypes["default"].func.isRequired,
onToggleEnableConfig: _propTypes["default"].func.isRequired,
onRemoveLayer: _propTypes["default"].func.isRequired,
isConfigActive: _propTypes["default"].bool.isRequired,
// optional
showRemoveLayer: _propTypes["default"].bool,
label: _propTypes["default"].string,
layerType: _propTypes["default"].string,
isDragNDropEnabled: _propTypes["default"].bool,
labelRCGColorValues: _propTypes["default"].arrayOf(_propTypes["default"].number)
};
var defaultProps = {
isDragNDropEnabled: true,
showRemoveLayer: true
};
exports.defaultProps = defaultProps;
var StyledLayerPanelHeader = (0, _styledComponents["default"])(_styledComponents2.StyledPanelHeader)(_templateObject(), function (props) {
return props.theme.panelBackgroundHover;
});
var HeaderLabelSection = _styledComponents["default"].div(_templateObject2(), function (props) {
return props.theme.textColor;
});
var HeaderActionSection = _styledComponents["default"].div(_templateObject3());
var LayerTitleSection = _styledComponents["default"].div(_templateObject4(), function (props) {
return props.theme.subtextColor;
});
var StyledDragHandle = _styledComponents["default"].div(_templateObject5(), function (props) {
return props.theme.textColorHl;
});
var DragHandle = (0, _reactSortableHoc.sortableHandle)(function (_ref) {
var className = _ref.className,
children = _ref.children;
return _react["default"].createElement(StyledDragHandle, {
className: className
}, children);
});
exports.DragHandle = DragHandle;
var LayerLabelEditor = function LayerLabelEditor(_ref2) {
var layerId = _ref2.layerId,
label = _ref2.label,
onEdit = _ref2.onEdit;
return _react["default"].createElement(_styledComponents2.InlineInput, {
type: "text",
className: "layer__title__editor",
value: label,
onClick: function onClick(e) {
e.stopPropagation();
},
onChange: onEdit,
id: "".concat(layerId, ":input-layer-label")
});
};
function LayerPanelHeaderFactory() {
var LayerPanelHeader = function LayerPanelHeader(_ref3) {
var isConfigActive = _ref3.isConfigActive,
isDragNDropEnabled = _ref3.isDragNDropEnabled,
isVisible = _ref3.isVisible,
label = _ref3.label,
layerId = _ref3.layerId,
layerType = _ref3.layerType,
labelRCGColorValues = _ref3.labelRCGColorValues,
onToggleVisibility = _ref3.onToggleVisibility,
onUpdateLayerLabel = _ref3.onUpdateLayerLabel,
onToggleEnableConfig = _ref3.onToggleEnableConfig,
onRemoveLayer = _ref3.onRemoveLayer,
showRemoveLayer = _ref3.showRemoveLayer;
return _react["default"].createElement(StyledLayerPanelHeader, {
className: (0, _classnames["default"])('layer-panel__header', {
'sort--handle': !isConfigActive
}),
active: isConfigActive,
labelRCGColorValues: labelRCGColorValues,
onClick: onToggleEnableConfig
}, _react["default"].createElement(HeaderLabelSection, {
className: "layer-panel__header__content"
}, isDragNDropEnabled && _react["default"].createElement(DragHandle, {
className: "layer__drag-handle"
}, _react["default"].createElement(_icons.VertDots, {
height: "20px"
})), _react["default"].createElement(LayerTitleSection, {
className: "layer__title"
}, _react["default"].createElement("div", null, _react["default"].createElement(LayerLabelEditor, {
layerId: layerId,
label: label,
onEdit: onUpdateLayerLabel
}), _react["default"].createElement("div", {
className: "layer__title__type"
}, layerType && _react["default"].createElement(_reactIntl.FormattedMessage, {
id: "layer.type.".concat(layerType.toLowerCase())
}))))), _react["default"].createElement(HeaderActionSection, {
className: "layer-panel__header__actions"
}, showRemoveLayer ? _react["default"].createElement(_panelHeaderAction["default"], {
className: "layer__remove-layer",
id: layerId,
tooltip: 'tooltip.removeLayer',
onClick: onRemoveLayer,
tooltipType: "error",
IconComponent: _icons.Trash
}) : null, _react["default"].createElement(_panelHeaderAction["default"], {
className: "layer__visibility-toggle",
id: layerId,
tooltip: isVisible ? 'tooltip.hideLayer' : 'tooltip.showLayer',
onClick: onToggleVisibility,
IconComponent: isVisible ? _icons.EyeSeen : _icons.EyeUnseen
}), _react["default"].createElement(_panelHeaderAction["default"], {
className: "layer__enable-config",
id: layerId,
tooltip: 'tooltip.layerSettings',
onClick: onToggleEnableConfig,
IconComponent: _icons.ArrowDown
})));
};
LayerPanelHeader.propTypes = propTypes;
LayerPanelHeader.defaultProps = defaultProps;
return LayerPanelHeader;
}
var _default = LayerPanelHeaderFactory;
exports["default"] = _default;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL3NpZGUtcGFuZWwvbGF5ZXItcGFuZWwvbGF5ZXItcGFuZWwtaGVhZGVyLmpzIl0sIm5hbWVzIjpbInByb3BUeXBlcyIsImxheWVySWQiLCJQcm9wVHlwZXMiLCJzdHJpbmciLCJpc1JlcXVpcmVkIiwiaXNWaXNpYmxlIiwiYm9vbCIsIm9uVG9nZ2xlVmlzaWJpbGl0eSIsImZ1bmMiLCJvblVwZGF0ZUxheWVyTGFiZWwiLCJvblRvZ2dsZUVuYWJsZUNvbmZpZyIsIm9uUmVtb3ZlTGF5ZXIiLCJpc0NvbmZpZ0FjdGl2ZSIsInNob3dSZW1vdmVMYXllciIsImxhYmVsIiwibGF5ZXJUeXBlIiwiaXNEcmFnTkRyb3BFbmFibGVkIiwibGFiZWxSQ0dDb2xvclZhbHVlcyIsImFycmF5T2YiLCJudW1iZXIiLCJkZWZhdWx0UHJvcHMiLCJTdHlsZWRMYXllclBhbmVsSGVhZGVyIiwiU3R5bGVkUGFuZWxIZWFkZXIiLCJwcm9wcyIsInRoZW1lIiwicGFuZWxCYWNrZ3JvdW5kSG92ZXIiLCJIZWFkZXJMYWJlbFNlY3Rpb24iLCJzdHlsZWQiLCJkaXYiLCJ0ZXh0Q29sb3IiLCJIZWFkZXJBY3Rpb25TZWN0aW9uIiwiTGF5ZXJUaXRsZVNlY3Rpb24iLCJzdWJ0ZXh0Q29sb3IiLCJTdHlsZWREcmFnSGFuZGxlIiwidGV4dENvbG9ySGwiLCJEcmFnSGFuZGxlIiwiY2xhc3NOYW1lIiwiY2hpbGRyZW4iLCJMYXllckxhYmVsRWRpdG9yIiwib25FZGl0IiwiZSIsInN0b3BQ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ICAgICAgY2xhc3NOYW1lPXtjbGFzc25hbWVzKCdsYXllci1wYW5lbF9faGVhZGVyJywge1xuICAgICAgICAnc29ydC0taGFuZGxlJzogIWlzQ29uZmlnQWN0aXZlXG4gICAgICB9KX1cbiAgICAgIGFjdGl2ZT17aXNDb25maWdBY3RpdmV9XG4gICAgICBsYWJlbFJDR0NvbG9yVmFsdWVzPXtsYWJlbFJDR0NvbG9yVmFsdWVzfVxuICAgICAgb25DbGljaz17b25Ub2dnbGVFbmFibGVDb25maWd9XG4gICAgPlxuICAgICAgPEhlYWRlckxhYmVsU2VjdGlvbiBjbGFzc05hbWU9XCJsYXllci1wYW5lbF9faGVhZGVyX19jb250ZW50XCI+XG4gICAgICAgIHtpc0RyYWdORHJvcEVuYWJsZWQgJiYgKFxuICAgICAgICAgIDxEcmFnSGFuZGxlIGNsYXNzTmFtZT1cImxheWVyX19kcmFnLWhhbmRsZVwiPlxuICAgICAgICAgICAgPFZlcnREb3RzIGhlaWdodD1cIjIwcHhcIiAvPlxuICAgICAgICAgIDwvRHJhZ0hhbmRsZT5cbiAgICAgICAgKX1cbiAgICAgICAgPExheWVyVGl0bGVTZWN0aW9uIGNsYXNzTmFtZT1cImxheWVyX190aXRsZVwiPlxuICAgICAgICAgIDxkaXY+XG4gICAgICAgICAgICA8TGF5ZXJMYWJlbEVkaXRvciBsYXllcklkPXtsYXllcklkfSBsYWJlbD17bGFiZWx9IG9uRWRpdD17b25VcGRhdGVMYXllckxhYmVsfSAvPlxuICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJsYXllcl9fdGl0bGVfX3R5cGVcIj5cbiAgICAgICAgICAgICAge2xheWVyVHlwZSAmJiA8Rm9ybWF0dGVkTWVzc2FnZSBpZD17YGxheWVyLnR5cGUuJHtsYXllclR5cGUudG9Mb3dlckNhc2UoKX1gfSAvPn1cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICA8L0xheWVyVGl0bGVTZWN0aW9uPlxuICAgICAgPC9IZWFkZXJMYWJlbFNlY3Rpb24+XG4gICAgICA8SGVhZGVyQWN0aW9uU2VjdGlvbiBjbGFzc05hbWU9XCJsYXllci1wYW5lbF9faGVhZGVyX19hY3Rpb25zXCI+XG4gICAgICAgIHtzaG93UmVtb3ZlTGF5ZXIgPyAoXG4gICAgICAgICAgPFBhbmVsSGVhZGVyQWN0aW9uXG4gICAgICAgICAgICBjbGFzc05hbWU9XCJsYXllcl9fcmVtb3ZlLWxheWVyXCJcbiAgICAgICAgICAgIGlkPXtsYXllcklkfVxuICAgICAgICAgICAgdG9vbHRpcD17J3Rvb2x0aXAucmVtb3ZlTGF5ZXInfVxuICAgICAgICAgICAgb25DbGljaz17b25SZW1vdmVMYXllcn1cbiAgICAgICAgICAgIHRvb2x0aXBUeXBlPVwiZXJyb3JcIlxuICAgICAgICAgICAgSWNvbkNvbXBvbmVudD17VHJhc2h9XG4gICAgICAgICAgLz5cbiAgICAgICAgKSA6IG51bGx9XG4gICAgICAgIDxQYW5lbEhlYWRlckFjdGlvblxuICAgICAgICAgIGNsYXNzTmFtZT1cImxheWVyX192aXNpYmlsaXR5LXRvZ2dsZVwiXG4gICAgICAgICAgaWQ9e2xheWVySWR9XG4gICAgICAgICAgdG9vbHRpcD17aXNWaXNpYmxlID8gJ3Rvb2x0aXAuaGlkZUxheWVyJyA6ICd0b29sdGlwLnNob3dMYXllcid9XG4gICAgICAgICAgb25DbGljaz17b25Ub2dnbGVWaXNpYmlsaXR5fVxuICAgICAgICAgIEljb25Db21wb25lbnQ9e2lzVmlzaWJsZSA/IEV5ZVNlZW4gOiBFeWVVbnNlZW59XG4gICAgICAgIC8+XG4gICAgICAgIDxQYW5lbEhlYWRlckFjdGlvblxuICAgICAgICAgIGNsYXNzTmFtZT1cImxheWVyX19lbmFibGUtY29uZmlnXCJcbiAgICAgICAgICBpZD17bGF5ZXJJZH1cbiAgICAgICAgICB0b29sdGlwPXsndG9vbHRpcC5sYXllclNldHRpbmdz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