@longline/aqua-ui 1.0.117 → 1.0.119

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,6 +34,11 @@ interface IGeocoderProps extends IMapControlProps {
34
34
  * @default true
35
35
  */
36
36
  proximityIP?: boolean;
37
+ /**
38
+ * If set, `Geocoder` will open upwards.
39
+ * @default false
40
+ */
41
+ upwards?: boolean;
37
42
  }
38
43
  /**
39
44
  * The `Geocoder` control displays an input box. Typing into it sends requests
@@ -45,5 +50,5 @@ interface IGeocoderProps extends IMapControlProps {
45
50
  *
46
51
  * Mapbox geocoding playground: https://docs.mapbox.com/playground/geocoding/
47
52
  */
48
- declare const Geocoder: ({ width, searchIcon, placeholder, pointZoom, proximityIP, ...props }: IGeocoderProps) => React.JSX.Element;
53
+ declare const Geocoder: ({ width, searchIcon, placeholder, pointZoom, proximityIP, upwards, ...props }: IGeocoderProps) => React.JSX.Element;
49
54
  export { Geocoder, IGeocoderProps };
@@ -58,8 +58,10 @@ var GeocoderBase = function (props) {
58
58
  // Call mapbox geocoder API, and store results in state.
59
59
  //
60
60
  var lookup = function (q) {
61
- if (q == "")
61
+ if (q == "") {
62
+ clear();
62
63
  return;
64
+ }
63
65
  var options = {
64
66
  proximityIP: props.proximityIP
65
67
  };
@@ -90,12 +92,6 @@ var GeocoderBase = function (props) {
90
92
  }
91
93
  };
92
94
  var handleChange = function (newq) {
93
- // When clearing, we want immediate result:
94
- if (newq == "") {
95
- clear();
96
- return;
97
- }
98
- // Non-clearing needs a debounce.
99
95
  setQ(newq);
100
96
  lookupDebounced(newq);
101
97
  };
@@ -145,7 +141,7 @@ var GeocoderBase = function (props) {
145
141
  return (React.createElement(MapControl, { x: props.x, y: props.y },
146
142
  React.createElement("div", { className: props.className, onKeyDown: function (e) { return handleKeyDown(e); }, ref: wrapperRef },
147
143
  React.createElement(GeocoderSelector, { placeholder: props.placeholder, searchIcon: props.searchIcon, value: q, onChange: handleChange }),
148
- features.length > 0 && React.createElement(GeocoderList, null, features.map(function (f, idx) {
144
+ features.length > 0 && React.createElement(GeocoderList, { upwards: props.upwards }, features.map(function (f, idx) {
149
145
  return React.createElement(GeocoderEntry, { key: idx, feature: f, selected: idx == selectedIndex, onClick: function () { return handleClick(f); } });
150
146
  })))));
151
147
  };
@@ -172,8 +168,8 @@ var GeocoderStyled = styled(GeocoderBase)(templateObject_1 || (templateObject_1
172
168
  * Mapbox geocoding playground: https://docs.mapbox.com/playground/geocoding/
173
169
  */
174
170
  var Geocoder = function (_a) {
175
- var _b = _a.width, width = _b === void 0 ? 300 : _b, _c = _a.searchIcon, searchIcon = _c === void 0 ? false : _c, _d = _a.placeholder, placeholder = _d === void 0 ? "Type to search places" : _d, _e = _a.pointZoom, pointZoom = _e === void 0 ? 15 : _e, _f = _a.proximityIP, proximityIP = _f === void 0 ? true : _f, props = __rest(_a, ["width", "searchIcon", "placeholder", "pointZoom", "proximityIP"]);
176
- return React.createElement(GeocoderStyled, __assign({ width: width, searchIcon: searchIcon, placeholder: placeholder, pointZoom: pointZoom, proximityIP: proximityIP }, props));
171
+ var _b = _a.width, width = _b === void 0 ? 300 : _b, _c = _a.searchIcon, searchIcon = _c === void 0 ? false : _c, _d = _a.placeholder, placeholder = _d === void 0 ? "Type to search places" : _d, _e = _a.pointZoom, pointZoom = _e === void 0 ? 15 : _e, _f = _a.proximityIP, proximityIP = _f === void 0 ? true : _f, _g = _a.upwards, upwards = _g === void 0 ? false : _g, props = __rest(_a, ["width", "searchIcon", "placeholder", "pointZoom", "proximityIP", "upwards"]);
172
+ return React.createElement(GeocoderStyled, __assign({ width: width, searchIcon: searchIcon, placeholder: placeholder, pointZoom: pointZoom, proximityIP: proximityIP, upwards: upwards }, props));
177
173
  };
178
174
  export { Geocoder };
179
175
  var templateObject_1;
@@ -5,6 +5,10 @@ interface IProps {
5
5
  className?: string;
6
6
  /** @ignore */
7
7
  children?: React.ReactNode;
8
+ /**
9
+ * If set, `Geocoder` will open upwards.
10
+ */
11
+ upwards: boolean;
8
12
  }
9
13
  declare const GeocoderList: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<IProps, never>> & string & Omit<(props: IProps) => React.JSX.Element, keyof React.Component<any, {}, any>>;
10
14
  export { GeocoderList };
@@ -4,7 +4,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
4
4
  };
5
5
  /** @module @ignore */
6
6
  import * as React from 'react';
7
- import styled from 'styled-components';
7
+ import styled, { css } from 'styled-components';
8
8
  import { List } from '../../../containers/List';
9
9
  /**
10
10
  * Animated list of fixed-height items.
@@ -13,6 +13,6 @@ var GeocoderListBase = function (props) {
13
13
  return React.createElement("div", { className: props.className },
14
14
  React.createElement(List, { tall: true, maxItems: 5, contract: true }, props.children));
15
15
  };
16
- var GeocoderList = styled(GeocoderListBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n width: 100%;\n left: 0;\n top: 42px;\n"], ["\n position: absolute;\n width: 100%;\n left: 0;\n top: 42px;\n"])));
16
+ var GeocoderList = styled(GeocoderListBase)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n width: 100%;\n left: 0;\n ", "\n ", "\n \n"], ["\n position: absolute;\n width: 100%;\n left: 0;\n ", "\n ", "\n \n"])), function (p) { return !p.upwards && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n top: 42px;\n "], ["\n top: 42px;\n "]))); }, function (p) { return p.upwards && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n bottom: 42px;\n "], ["\n bottom: 42px;\n "]))); });
17
17
  export { GeocoderList };
18
- var templateObject_1;
18
+ var templateObject_1, templateObject_2, templateObject_3;
@@ -73,8 +73,7 @@ var FilterBase = function (props) {
73
73
  };
74
74
  return (React.createElement("div", { className: props.className },
75
75
  React.createElement(FilterButton, { ref: buttonRef, active: props.active, open: open, onClick: toggleOpen }),
76
- createPortal(React.createElement(Pane, __assign({ "$open": open, "$width": props.width, style: styles.popper }, attributes.popper, { ref: paneRef }),
77
- React.createElement(GlassPane, { padded: true, bordered: true }, props.children)), document.body)));
76
+ createPortal(React.createElement(Pane, __assign({ "$open": open, "$width": props.width, style: styles.popper }, attributes.popper, { ref: paneRef }), open && React.createElement(GlassPane, { padded: true, bordered: true }, props.children)), document.body)));
78
77
  };
79
78
  var Pane = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: ", ";\n width: ", "px;\n z-index: 2500;\n"], ["\n display: ", ";\n width: ", "px;\n z-index: 2500;\n"
80
79
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longline/aqua-ui",
3
- "version": "1.0.117",
3
+ "version": "1.0.119",
4
4
  "description": "AquaUI",
5
5
  "author": "Alexander van Oostenrijk / Longline Environment",
6
6
  "license": "Commercial",