kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
153 lines (150 loc) • 24.1 kB
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
var _react = _interopRequireWildcard(require("react"));
var _styledComponents = _interopRequireWildcard(require("styled-components"));
var _classnames = _interopRequireDefault(require("classnames"));
var _momentTimezone = _interopRequireDefault(require("moment-timezone"));
var _itemSelector = _interopRequireDefault(require("../common/item-selector/item-selector"));
var _styledComponents2 = require("../common/styled-components");
var _dropdownList = require("../common/item-selector/dropdown-list");
var _templateObject, _templateObject2, _templateObject3, _templateObject4; // 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; }
var HEADER_ITEM_ID = 'HEADER_ITEM_ID';
var StyledEffectTimeSelector = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n .item-selector {\n background-color: transparent;\n }\n .item-selector .item-selector__dropdown {\n padding: 0px;\n width: 110px;\n height: 30px;\n }\n border: 1px solid ", ";\n border-radius: 4px;\n &:hover {\n border: 1px solid ", ";\n }\n .active {\n border: 1px solid ", ";\n border-radius: 4px 4px 0px 0px;\n }\n"])), function (props) {
return props.theme.inputBgd;
}, function (props) {
return props.theme.inputBgdHover;
}, function (props) {
return props.theme.activeColor;
});
var StyledLabel = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-size: ", ";\n height: 13px;\n display: flex;\n align-items: center;\n"])), function (props) {
return props.theme.effectPanelTextMain;
}, function (props) {
return props.theme.inputFontSize;
});
var DropdownListWrapper = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n ", ";\n background-color: ", ";\n display: flex;\n flex-wrap: wrap;\n padding: 0px;\n max-height: 160px;\n border-radius: 0px 0px 4px 4px;\n"])), function (props) {
return props.theme.dropdownList;
}, function (props) {
return props.theme.inputBgdHover;
});
var StyledDropdownListItem = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n padding: 10px 5px 9px 10px;\n width: 100%;\n &:hover {\n background-color: ", ";\n cursor: pointer;\n }\n"])), function (props) {
return props.theme.effectPanelElementColorSelected;
});
// Generate time options for the dropdown with 30 min intervals.
var timeOptions = function () {
var m = (0, _momentTimezone["default"])().utcOffset(0);
m.set({
hour: 12,
minute: 0,
second: 0,
millisecond: 0
});
var out = [];
for (var i = 0; i < 48; i++) {
out.push({
name: m.format('hh:mm A'),
id: m.format('HH:mm')
});
m.add(30, 'minutes');
}
return out;
}();
var getDisplayOption = function getDisplayOption(op) {
return op.name;
};
var getOptionValue = function getOptionValue(op) {
return op.id;
};
/**
* A component to render TimePicker as the header for the dropdown component.
*/
var EffectTimeListItem = function EffectTimeListItem(_ref) {
var value = _ref.value;
if ((value === null || value === void 0 ? void 0 : value.id) === HEADER_ITEM_ID) {
return /*#__PURE__*/_react["default"].createElement(_styledComponents2.StyledTimePicker, {
value: value.value,
onChange: value.onChange,
onClick: value.onClick,
disableClock: true,
format: 'hh:mm a'
});
}
return /*#__PURE__*/_react["default"].createElement(StyledLabel, null, value.name);
};
var EffectTimeDropdownList = function EffectTimeDropdownList(_ref2) {
var onOptionSelected = _ref2.onOptionSelected,
options = _ref2.options,
selectionIndex = _ref2.selectionIndex,
customListItemComponent = _ref2.customListItemComponent;
var onSelectOption = (0, _react.useCallback)(function (e, value) {
e.preventDefault();
onOptionSelected(value);
}, [onOptionSelected]);
var ListItemComponent = customListItemComponent;
return /*#__PURE__*/_react["default"].createElement(DropdownListWrapper, {
className: _dropdownList.classList.list
}, options.map(function (value, i) {
return /*#__PURE__*/_react["default"].createElement(StyledDropdownListItem, {
className: (0, _classnames["default"])('effect-type-selector__item', {
hover: selectionIndex === i
}),
key: "".concat(value.id, "_").concat(i),
onMouseDown: function onMouseDown(e) {
return onSelectOption(e, value);
},
onClick: function onClick(e) {
return onSelectOption(e, value);
}
}, /*#__PURE__*/_react["default"].createElement(ListItemComponent, {
value: value
}));
}));
};
EffectTimeSelectorFactory.deps = [];
function EffectTimeSelectorFactory() {
var EffectTimeSelector = function EffectTimeSelector(_ref3) {
var value = _ref3.value,
onChange = _ref3.onChange;
// Selected item is rendered as TimePicker in EffectTimeListItem
var selectedItems = (0, _react.useMemo)(function () {
return [{
id: HEADER_ITEM_ID,
value: value,
onChange: onChange,
onClick: function onClick(e) {
var _e$target;
// DatePicker is used as custom header.
// Don't open the dropdown when the user is editing time values directly.
var name = e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.name;
if (name === 'hour12' || name === 'minute' || name === 'amPm') {
e.stopPropagation();
}
}
}];
}, [value, onChange]);
return /*#__PURE__*/_react["default"].createElement(StyledEffectTimeSelector, null, /*#__PURE__*/_react["default"].createElement(_itemSelector["default"], {
selectedItems: selectedItems,
options: timeOptions,
multiSelect: false,
searchable: false,
placeholder: "",
filterOption: "name",
onChange: onChange,
getOptionValue: getOptionValue,
displayOption: getDisplayOption,
DropDownLineItemRenderComponent: EffectTimeListItem,
DropDownRenderComponent: EffectTimeDropdownList
}));
};
return (0, _styledComponents.withTheme)(EffectTimeSelector);
}
var _default = exports["default"] = EffectTimeSelectorFactory;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfcmVhY3QiLCJfaW50ZXJvcFJlcXVpcmVXaWxkY2FyZCIsInJlcXVpcmUiLCJfc3R5bGVkQ29tcG9uZW50cyIsIl9jbGFzc25hbWVzIiwiX2ludGVyb3BSZXF1aXJlRGVmYXVsdCIsIl9tb21lbnRUaW1lem9uZSIsIl9pdGVtU2VsZWN0b3IiLCJfc3R5bGVkQ29tcG9uZW50czIiLCJfZHJvcGRvd25MaXN0IiwiX3RlbXBsYXRlT2JqZWN0IiwiX3RlbXBsYXRlT2JqZWN0MiIsIl90ZW1wbGF0ZU9iamVjdDMiLCJfdGVtcGxhdGVPYmplY3Q0IiwiX2dldFJlcXVpcmVXaWxkY2FyZENhY2hlIiwiZSIsIldlYWtNYXAiLCJyIiwidCIsIl9fZXNNb2R1bGUiLCJfdHlwZW9mIiwiaGFzIiwiZ2V0IiwibiIsIl9fcHJvdG9fXyIsImEiLCJPYmplY3QiLCJkZWZpbmVQcm9wZXJ0eSIsImdldE93blByb3BlcnR5RGVzY3JpcHRvciIsInUiLCJoYXNPd25Qcm9wZXJ0eSIsImNhbGwiLCJpIiwic2V0IiwiSEVBREVSX0lURU1fSUQiLCJTdHlsZWRFZmZlY3RUaW1lU2VsZWN0b3IiLCJzdHlsZWQiLCJkaXYiLCJfdGFnZ2VkVGVtcGxhdGVMaXRlcmFsMiIsInByb3BzIiwidGhlbWUiLCJpbnB1dEJnZCIsImlucHV0QmdkSG92ZXIiLCJhY3RpdmVDb2xvciIsIlN0eWxlZExhYmVsIiwiZWZmZWN0UGFuZWxUZXh0TWFpbiIsImlucHV0Rm9udFNpemUiLCJEcm9wZG93bkxpc3RXcmFwcGVyIiwiZHJvcGRvd25MaXN0IiwiU3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