UNPKG

calcite-react

Version:
90 lines (79 loc) 4.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PopperManagerStyles = exports.StyledSelectMenu = exports.StyledSelectButton = exports.StyledSelectInput = exports.StyledSelectWrapper = void 0; var _styledComponents = _interopRequireWildcard(require("styled-components")); var _commonElements = require("../utils/commonElements"); var _helpers = require("../utils/helpers"); var _CalciteThemeProvider = require("../CalciteThemeProvider"); var _Menu = _interopRequireDefault(require("../Menu")); var _MenuStyled = require("../Menu/Menu-styled"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } // Copyright 2019 Esri // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License.​ // styled-components // Utils, common elements // Calcite theme and Esri colors // Calcite components // Icons // Third party libraries var StyledSelectWrapper = _styledComponents.default.div.withConfig({ displayName: "StyledSelectWrapper", componentId: "sc-1mn2ays-0" })(["position:relative;", ";"], function (props) { return props.fullWidth && (0, _styledComponents.css)(["width:100%;"]); }); exports.StyledSelectWrapper = StyledSelectWrapper; StyledSelectWrapper.defaultProps = { theme: _CalciteThemeProvider.CalciteTheme }; var StyledSelectInput = (0, _styledComponents.default)(_commonElements.CalciteSelect).withConfig({ displayName: "StyledSelectInput", componentId: "sc-1mn2ays-1" })(["cursor:pointer;text-overflow:ellipsis;"]); exports.StyledSelectInput = StyledSelectInput; StyledSelectInput.defaultProps = { theme: _CalciteThemeProvider.CalciteTheme }; var StyledSelectButton = (0, _styledComponents.default)(_commonElements.CalciteSelect).withConfig({ displayName: "StyledSelectButton", componentId: "sc-1mn2ays-2" })(["cursor:pointer;text-align:initial;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;"]); exports.StyledSelectButton = StyledSelectButton; StyledSelectButton.defaultProps = { theme: _CalciteThemeProvider.CalciteTheme }; var StyledSelectMenu = (0, _styledComponents.default)(_Menu.default).withConfig({ displayName: "StyledSelectMenu", componentId: "sc-1mn2ays-3" })(["max-height:300px;display:none;border-bottom:none;box-shadow:", ",0 1px 0 ", ";transition:opacity ", ";z-index:2000;", ";", ";", "{-moz-padding-inline-end:", ";-moz-padding-end:", ";}iframe{border:none;}"], function (props) { return props.theme.boxShadow; }, function (props) { return props.theme.palette.lightestGray; }, (0, _helpers.transition)(), function (props) { return props.isOpen && (0, _styledComponents.css)(["display:block;"]); }, function (props) { return props.fullWidth && (0, _styledComponents.css)(["min-width:100%;"]); }, _MenuStyled.StyledMenuItem, function (props) { return props.theme.baseline; }, function (props) { return props.theme.baseline; }); exports.StyledSelectMenu = StyledSelectMenu; StyledSelectMenu.defaultProps = { theme: _CalciteThemeProvider.CalciteTheme }; var PopperManagerStyles = { width: '100%' }; exports.PopperManagerStyles = PopperManagerStyles;