UNPKG

kepler.gl

Version:

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

63 lines (55 loc) 6.75 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = SingleSelectFilterFactory; var _react = _interopRequireDefault(require("react")); var _itemSelector = _interopRequireDefault(require("../common/item-selector/item-selector")); var _styledComponents = require("../common/styled-components"); var _reactIntl = require("react-intl"); // Copyright (c) 2020 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. function SingleSelectFilterFactory() { var SingleSelectFilter = function SingleSelectFilter(_ref) { var filter = _ref.filter, setFilter = _ref.setFilter; return _react["default"].createElement(_styledComponents.SidePanelSection, null, _react["default"].createElement(_styledComponents.PanelLabel, null, _react["default"].createElement(_reactIntl.FormattedMessage, { id: 'misc.valueEquals' })), _react["default"].createElement(_itemSelector["default"], { selectedItems: filter.value, placeholder: "placeholder.selectValue", options: filter.domain, multiSelect: false, searchable: false, displayOption: function displayOption(d) { return String(d); }, getOptionValue: function getOptionValue(d) { return d; }, onChange: setFilter, inputTheme: "secondary" })); }; SingleSelectFilter.displayName = 'SingleSelectFilter'; return SingleSelectFilter; } //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL2ZpbHRlcnMvc2luZ2xlLXNlbGVjdC1maWx0ZXIuanMiXSwibmFtZXMiOlsiU2luZ2xlU2VsZWN0RmlsdGVyRmFjdG9yeSIsIlNpbmdsZVNlbGVjdEZpbHRlciIsImZpbHRlciIsInNldEZpbHRlciIsInZhbHVlIiwiZG9tYWluIiwiZCIsIlN0cmluZyIsImRpc3BsYXlOYW1lIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFvQkE7O0FBQ0E7O0FBQ0E7O0FBQ0E7O0FBdkJBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBT2UsU0FBU0EseUJBQVQsR0FBcUM7QUFDbEQsTUFBTUMsa0JBQWtCLEdBQUcsU0FBckJBLGtCQUFxQjtBQUFBLFFBQUVDLE1BQUYsUUFBRUEsTUFBRjtBQUFBLFFBQVVDLFNBQVYsUUFBVUEsU0FBVjtBQUFBLFdBQ3pCLGdDQUFDLGtDQUFELFFBQ0UsZ0NBQUMsNEJBQUQsUUFDRSxnQ0FBQywyQkFBRDtBQUFrQixNQUFBLEVBQUUsRUFBRTtBQUF0QixNQURGLENBREYsRUFJRSxnQ0FBQyx3QkFBRDtBQUNFLE1BQUEsYUFBYSxFQUFFRCxNQUFNLENBQUNFLEtBRHhCO0FBRUUsTUFBQSxXQUFXLEVBQUMseUJBRmQ7QUFHRSxNQUFBLE9BQU8sRUFBRUYsTUFBTSxDQUFDRyxNQUhsQjtBQUlFLE1BQUEsV0FBVyxFQUFFLEtBSmY7QUFLR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