UNPKG

calcite-react

Version:
145 lines (129 loc) 6.88 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PopperStyle = exports.ManagerStyle = exports.StyledSearchIconContainer = exports.StyledClearIconContainer = exports.StyledShortcutCharacter = exports.StyledSearch = exports.StyledSearchInputWrapper = exports.StyledSearchContainer = void 0; var _styledComponents = _interopRequireWildcard(require("styled-components")); var _helpers = require("../utils/helpers"); var _commonElements = require("../utils/commonElements"); var _CalciteThemeProvider = require("../CalciteThemeProvider"); 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 StyledClearIconContainer = _styledComponents.default.div.withConfig({ displayName: "StyledClearIconContainer", componentId: "sc-1pd0iuk-0" })(["display:none;position:absolute;right:", ";bottom:auto;margin-top:2px;opacity:0.5;cursor:pointer;html[dir='rtl'] &{right:auto;left:", ";}&:hover{opacity:0.8;}"], function (props) { return (0, _helpers.unitCalc)(props.theme.baseline, 4, '/'); }, function (props) { return (0, _helpers.unitCalc)(props.theme.baseline, 4, '/'); }); exports.StyledClearIconContainer = StyledClearIconContainer; StyledClearIconContainer.defaultProps = { theme: _CalciteThemeProvider.CalciteTheme }; var StyledSearchIconContainer = _styledComponents.default.span.withConfig({ displayName: "StyledSearchIconContainer", componentId: "sc-1pd0iuk-1" })(["position:absolute;bottom:auto;left:0.5em;margin-top:2px;color:", ";z-index:1;pointer-events:none;line-height:0;html[dir='rtl'] &{left:auto;right:0.5em;}"], function (props) { return props.theme.palette.darkerGray; }); exports.StyledSearchIconContainer = StyledSearchIconContainer; StyledSearchIconContainer.defaultProps = { theme: _CalciteThemeProvider.CalciteTheme }; var StyledShortcutCharacter = _styledComponents.default.div.withConfig({ displayName: "StyledShortcutCharacter", componentId: "sc-1pd0iuk-2" })(["position:absolute;right:", ";bottom:auto;margin-top:2px;border:1px solid ", ";display:flex;align-items:center;justify-content:center;width:18px;height:18px;color:", ";border-radius:1px;html[dir='rtl'] &{right:auto;left:", ";}"], function (props) { return (0, _helpers.unitCalc)(props.theme.baseline, 4, '/'); }, function (props) { return props.theme.palette.lighterGray; }, function (props) { return props.theme.palette.lightGray; }, function (props) { return (0, _helpers.unitCalc)(props.theme.baseline, 4, '/'); }); exports.StyledShortcutCharacter = StyledShortcutCharacter; StyledShortcutCharacter.defaultProps = { theme: _CalciteThemeProvider.CalciteTheme }; var StyledSearchContainer = _styledComponents.default.div.withConfig({ displayName: "StyledSearchContainer", componentId: "sc-1pd0iuk-3" })(["display:inline-flex;align-items:center;position:relative;", ";", "{", ";}", "{", ";}&:hover{", "{display:inherit;}}&:active,&:focus,&:focus-within{", "{display:none;}}"], function (props) { return props.fullWidth && (0, _styledComponents.css)(["width:100%;"]); }, StyledSearchIconContainer, function (props) { return props.minimal && (0, _styledComponents.css)(["bottom:auto;left:0.1rem;margin-top:0;html[dir='rtl'] &{left:auto;right:0.1rem;}"]); }, StyledClearIconContainer, function (props) { return props.minimal && (0, _styledComponents.css)(["bottom:auto;margin-top:0;"]); }, StyledClearIconContainer, StyledShortcutCharacter); exports.StyledSearchContainer = StyledSearchContainer; StyledSearchContainer.defaultProps = { theme: _CalciteThemeProvider.CalciteTheme }; var StyledSearchInputWrapper = _styledComponents.default.div.withConfig({ displayName: "StyledSearchInputWrapper", componentId: "sc-1pd0iuk-4" })(["position:relative;flex:1 0 50px;"]); exports.StyledSearchInputWrapper = StyledSearchInputWrapper; StyledSearchInputWrapper.defaultProps = { theme: _CalciteThemeProvider.CalciteTheme }; var StyledSearch = (0, _styledComponents.default)(_commonElements.CalciteInput).withConfig({ displayName: "StyledSearch", componentId: "sc-1pd0iuk-5" })(["padding-right:", ";background:transparent;&::-ms-clear{display:none;}html[dir='rtl'] &{padding-right:", ";padding-left:", ";}", ";", ";", ";"], function (props) { return props.theme.baseline; }, function (props) { return (0, _helpers.unitCalc)(props.theme.baseline, 5, '/'); }, function (props) { return props.theme.baseline; }, function (props) { return props.searchIcon && (0, _styledComponents.css)(["padding-left:", ";html[dir='rtl'] &{padding-left:", ";padding-right:", ";}"], function (props) { return (0, _helpers.unitCalc)(props.theme.baseline, 1.2, '*'); }, function (props) { return props.theme.baseline; }, function (props) { return (0, _helpers.unitCalc)(props.theme.baseline, 1.2, '*'); }); }, function (props) { return props.minimal && (0, _styledComponents.css)(["height:2.35rem;border-bottom:2px solid ", ";", ";&:focus{box-shadow:none;border-bottom-color:", ";}"], function (props) { return props.theme.palette.lighterGray; }, (0, _helpers.fontSize)(0), function (props) { return props.theme.palette.blue; }); }, function (props) { return props.selectableListFilter && (0, _styledComponents.css)(["margin:0;width:100%;border-color:", ";box-shadow:none;&:focus{background-color:", ";}"], function (props) { return props.theme.palette.lighterGray; }, function (props) { return props.theme.palette.white; }); }); exports.StyledSearch = StyledSearch; StyledSearch.defaultProps = { theme: _CalciteThemeProvider.CalciteTheme }; var ManagerStyle = { width: '100%' }; exports.ManagerStyle = ManagerStyle; var PopperStyle = { transition: "opacity ".concat((0, _helpers.transition)()), zIndex: 2000 }; exports.PopperStyle = PopperStyle;