@longline/aqua-ui 1.0.339 → 1.0.340
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.
- package/containers/Anchor/Anchor.d.ts +5 -0
- package/containers/Anchor/Anchor.js +20 -8
- package/containers/Dock/Dock.d.ts +5 -0
- package/containers/Dock/Dock.js +1 -1
- package/containers/Dock/Dockable.d.ts +5 -0
- package/containers/Dock/Dockable.js +20 -12
- package/containers/DragBar/DragBar.d.ts +5 -0
- package/containers/DragBar/DragBar.js +16 -5
- package/containers/Form/Field.d.ts +0 -3
- package/containers/Form/Field.js +3 -6
- package/containers/Form/Form.js +5 -36
- package/containers/Form/Validation.d.ts +1 -1
- package/containers/Form/Validation.js +6 -6
- package/containers/Form/context/FormContext.d.ts +1 -2
- package/containers/Form/context/useForm.d.ts +1 -1
- package/containers/Form/elements/BoxWrapper.js +2 -0
- package/containers/GlassPane/GlassPane.d.ts +7 -2
- package/containers/GlassPane/GlassPane.js +3 -3
- package/containers/InfoBox/InfoBox.d.ts +5 -0
- package/containers/InfoBox/InfoBox.js +1 -1
- package/containers/List/List.d.ts +5 -0
- package/containers/List/List.js +1 -1
- package/containers/List/ListCell.d.ts +5 -0
- package/containers/List/ListCell.js +1 -1
- package/containers/List/ListRow.d.ts +7 -2
- package/containers/List/ListRow.js +1 -1
- package/containers/Message/Error.d.ts +2 -0
- package/containers/Message/Error.js +1 -1
- package/containers/Message/Message.d.ts +5 -0
- package/containers/Message/Message.js +1 -1
- package/containers/Message/NoData.d.ts +2 -0
- package/containers/Message/NoData.js +1 -1
- package/containers/Message/NoFilteredData.d.ts +2 -0
- package/containers/Message/NoFilteredData.js +1 -1
- package/containers/Openable/Openable.d.ts +5 -0
- package/containers/Openable/Openable.js +8 -8
- package/containers/PublicRoute/PublicRoute.d.ts +9 -1
- package/containers/PublicRoute/PublicRoute.js +3 -7
- package/containers/Tabs/Pane.d.ts +5 -0
- package/containers/Tabs/Pane.js +3 -3
- package/containers/Tabs/Tabs.d.ts +5 -0
- package/containers/Tabs/Tabs.js +3 -3
- package/controls/Chip/Chip.d.ts +15 -3
- package/controls/Chip/Chip.js +7 -6
- package/controls/CircularProgress/CircularProgress.d.ts +11 -0
- package/controls/CircularProgress/CircularProgress.js +19 -11
- package/controls/Dropzone/Dropzone.d.ts +11 -1
- package/controls/Dropzone/Dropzone.js +18 -7
- package/controls/Fab/Fab.d.ts +14 -6
- package/controls/Fab/Fab.js +7 -20
- package/controls/Ghost/Ghost.js +3 -3
- package/controls/Gradient/Gradient.d.ts +5 -0
- package/controls/Gradient/Gradient.js +7 -4
- package/controls/Histogram/Histogram.d.ts +8 -2
- package/controls/Histogram/Histogram.js +9 -9
- package/controls/Histogram/HistogramBar.d.ts +2 -2
- package/controls/Icon/Icon.d.ts +10 -4
- package/controls/Icon/Icon.js +23 -6
- package/controls/Key/Key.d.ts +5 -0
- package/controls/Key/Key.js +2 -5
- package/controls/LinearChart/LinearChart.d.ts +9 -0
- package/controls/LinearChart/LinearChart.js +11 -6
- package/controls/ListButton/ListButton.d.ts +46 -3
- package/controls/ListButton/ListButton.js +70 -9
- package/controls/ListView/ColumnsManager/ColumnDraggable.js +11 -5
- package/controls/ListView/ColumnsManager/SourceColumns.js +1 -1
- package/controls/ListView/IListViewProps.d.ts +9 -2
- package/controls/ListView/ListView.js +13 -12
- package/controls/ListView/defaults.d.ts +3 -0
- package/controls/ListView/defaults.js +6 -0
- package/controls/ListView/elements/Body.d.ts +1 -1
- package/controls/ListView/elements/Body.js +23 -12
- package/controls/ListView/elements/Ghost.js +3 -2
- package/controls/ListView/elements/Header.js +3 -2
- package/controls/ListView/elements/HeaderCell.js +3 -3
- package/controls/ListView/elements/Table.js +16 -10
- package/controls/Mouse/Mouse.d.ts +6 -4
- package/controls/Mouse/Mouse.js +15 -8
- package/controls/PrimaryButton/PrimaryButton.d.ts +9 -3
- package/controls/PrimaryButton/PrimaryButton.js +5 -5
- package/controls/Progress/Progress.d.ts +9 -0
- package/controls/Progress/Progress.js +12 -8
- package/controls/SecondaryButton/SecondaryButton.d.ts +8 -3
- package/controls/SecondaryButton/SecondaryButton.js +1 -1
- package/controls/SpeechRecognizer/EditorRegistry.js +1 -2
- package/controls/SpeechRecognizer/SpeechRecognizer.d.ts +9 -1
- package/controls/SpeechRecognizer/SpeechRecognizer.js +16 -9
- package/controls/TabBar/TabBar.d.ts +5 -0
- package/controls/TabBar/TabBar.js +14 -6
- package/controls/TabBar/Underliner.js +1 -1
- package/controls/TertiaryButton/TertiaryButton.d.ts +9 -3
- package/controls/TertiaryButton/TertiaryButton.js +5 -3
- package/controls/ToggleButton/ToggleButton.d.ts +8 -2
- package/controls/ToggleButton/ToggleButton.js +1 -1
- package/controls/View/View.d.ts +5 -0
- package/controls/View/View.js +1 -1
- package/formatters/CountryFormatter/CountryFormatter.d.ts +3 -2
- package/formatters/CountryFormatter/CountryUtil.d.ts +3 -3
- package/formatters/DateTimeFormatter/DateTimeFormatter.d.ts +11 -10
- package/formatters/DateTimeFormatter/elements/Custom.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/DistanceDate.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/LongDate.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/LongDateTime.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/LongTime.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/Month.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/ShortDate.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/ShortDateTime.d.ts +1 -1
- package/formatters/DateTimeFormatter/elements/ShortTime.d.ts +1 -1
- package/formatters/DivisionFormatter/DivisionFormatter.d.ts +2 -2
- package/formatters/DivisionFormatter/DivisionFormatter.js +1 -1
- package/formatters/DivisionFormatter/DivisionUtil.d.ts +1 -1
- package/formatters/DivisionFormatter/DivisionUtil.js +5 -3
- package/formatters/FilesizeFormatter/FilesizeFormatter.d.ts +3 -3
- package/formatters/GIS/CoordinateFormatter.d.ts +2 -2
- package/formatters/GIS/LatitudeFormatter.d.ts +2 -2
- package/formatters/GIS/LongitudeFormatter.d.ts +2 -2
- package/formatters/HumanFormatter/HumanFormatter.d.ts +3 -3
- package/formatters/NumberFormatter/NumberFormatter.d.ts +3 -3
- package/formatters/PhoneFormatter/PhoneFormatter.d.ts +3 -3
- package/formatters/StringFormatter/StringFormatter.d.ts +3 -3
- package/formatters/StringFormatter/StringFormatter.js +1 -4
- package/helper/DMS.d.ts +1 -1
- package/helper/DMS.js +2 -2
- package/hooks/useOutsideClose/useOutsideClose.js +20 -11
- package/hooks/useSpeechAIRecorder/useSpeechAIRecorder.js +10 -7
- package/index.js +1 -0
- package/inputs/DateInput/Body.d.ts +2 -2
- package/inputs/DateInput/Body.js +11 -7
- package/inputs/DateInput/Calendar.d.ts +1 -1
- package/inputs/DateInput/Calendar.js +3 -5
- package/inputs/DateInput/DateInput.d.ts +11 -3
- package/inputs/DateInput/DateInput.js +11 -3
- package/inputs/DateInput/Day.d.ts +1 -1
- package/inputs/DateInput/InfiniteList.js +6 -3
- package/inputs/DateInput/Navbar.js +3 -2
- package/inputs/DateInput/NumericInput.js +3 -0
- package/inputs/DateInput/Selector.d.ts +1 -1
- package/inputs/DateInput/Selector.js +9 -6
- package/inputs/Dropdown/Body.d.ts +2 -2
- package/inputs/Dropdown/Column.d.ts +1 -1
- package/inputs/Dropdown/Dropdown.d.ts +5 -0
- package/inputs/Dropdown/Dropdown.js +36 -63
- package/inputs/Dropdown/Pill.js +1 -1
- package/inputs/Dropdown/Selection.js +1 -1
- package/inputs/Editor/Editor.d.ts +5 -0
- package/inputs/Editor/Editor.js +16 -6
- package/inputs/Editor/buttons/SpeechAIButton.js +2 -0
- package/inputs/Editor/buttons/TextAIButton.d.ts +0 -13
- package/inputs/Editor/buttons/TextAIButton.js +30 -14
- package/inputs/Editor/buttons/TextAIMenu.js +1 -1
- package/inputs/Editor/menu/MenuBar.d.ts +1 -1
- package/inputs/Editor/menu/MenuBar.js +1 -1
- package/inputs/Editor/menu/MenuButton.js +1 -1
- package/inputs/Input/Clear.js +1 -1
- package/inputs/Input/Input.d.ts +5 -0
- package/inputs/Input/Input.js +8 -6
- package/inputs/Input/InputWrapper.d.ts +2 -0
- package/inputs/Input/InputWrapper.js +1 -1
- package/inputs/Input/Reveal.js +1 -1
- package/inputs/MonthRange/Body.d.ts +1 -1
- package/inputs/MonthRange/Calendar.d.ts +2 -2
- package/inputs/MonthRange/Calendar.js +6 -9
- package/inputs/MonthRange/MonthRange.d.ts +7 -1
- package/inputs/MonthRange/MonthRange.js +14 -6
- package/inputs/MonthRange/Selector.d.ts +1 -1
- package/inputs/MonthRange/Selector.js +12 -11
- package/inputs/PhoneInput/PhoneInput.d.ts +5 -0
- package/inputs/PhoneInput/PhoneInput.js +2 -2
- package/inputs/Selector/Selector.d.ts +5 -0
- package/inputs/Selector/Selector.js +4 -1
- package/inputs/Slider/Slider.d.ts +75 -22
- package/inputs/Slider/Slider.js +104 -22
- package/inputs/Textarea/Textarea.d.ts +5 -5
- package/inputs/Textarea/Textarea.js +3 -2
- package/map/Map/Map.d.ts +2 -2
- package/map/Map/Map.js +20 -14
- package/map/PositionsManager/PositionBox.js +7 -3
- package/map/PositionsManager/PositionsManager.js +33 -13
- package/map/controls/CompassButton/CompassButton.js +1 -1
- package/map/controls/FullscreenButton/FullscreenButton.js +1 -1
- package/map/controls/Geocoder/Geocoder.js +28 -14
- package/map/controls/Geocoder/GeocoderApi.js +2 -0
- package/map/controls/Geocoder/GeocoderSelector.js +1 -1
- package/map/controls/Graticule/Graticule.js +1 -5
- package/map/controls/MapLoader/MapLoader.js +1 -1
- package/map/controls/ScaleControl/ScaleControl.js +1 -1
- package/map/controls/ZoomInButton/ZoomInButton.js +1 -1
- package/map/controls/ZoomOutButton/ZoomOutButton.d.ts +1 -1
- package/map/controls/ZoomOutButton/ZoomOutButton.js +2 -2
- package/map/controls/base/MapButton/MapButton.d.ts +8 -2
- package/map/controls/base/MapButton/MapButton.js +11 -2
- package/map/controls/base/MapControl/MapControl.d.ts +5 -0
- package/map/controls/base/MapControl/MapControl.js +10 -7
- package/map/layers/ClusterLayer/ClusterLayer.d.ts +1 -1
- package/map/layers/ClusterLayer/ClusterLayer.js +7 -3
- package/map/layers/HtmlMarkerLayer/HtmlMarkerLayer.js +8 -4
- package/map/layers/IdwBlendLayer/IdwBlendLayer.js +9 -4
- package/map/layers/IdwLayer/IdwLayer.d.ts +2 -1
- package/map/layers/IdwLayer/IdwLayer.js +271 -215
- package/map/layers/InterpolationLayer/ContoursFragmentShader.d.ts +1 -1
- package/map/layers/InterpolationLayer/ContoursFragmentShader.js +1 -1
- package/map/layers/InterpolationLayer/InterpolationLayer.d.ts +4 -3
- package/map/layers/InterpolationLayer/InterpolationLayer.js +362 -275
- package/map/layers/ParticlesLayer/ParticlesLayer.d.ts +8 -7
- package/map/layers/ParticlesLayer/ParticlesLayer.js +528 -404
- package/map/markers/ClusterMarker/ClusterMarker.d.ts +6 -1
- package/map/markers/ClusterMarker/ClusterMarker.js +15 -6
- package/map/markers/RiskMarker/RiskMarker.d.ts +5 -1
- package/map/markers/RiskMarker/RiskMarker.js +4 -4
- package/modules/CountryDropdown/CountryDropdown.js +10 -1
- package/modules/Filter/Filter.d.ts +5 -0
- package/modules/Filter/Filter.js +10 -6
- package/modules/Globe/Globe.d.ts +5 -0
- package/modules/Globe/Globe.js +4 -4
- package/modules/MainMenu/Item.d.ts +9 -2
- package/modules/MainMenu/Item.js +8 -5
- package/modules/MainMenu/MainMenu.d.ts +5 -0
- package/modules/MainMenu/MainMenu.js +1 -1
- package/modules/ParticleGlobe/GL.d.ts +1 -1
- package/modules/ParticleGlobe/ParticleGlobe.d.ts +5 -0
- package/modules/ParticleGlobe/ParticleGlobe.js +69 -40
- package/modules/Public/Public.d.ts +5 -0
- package/modules/Public/Public.js +3 -3
- package/package.json +1 -1
- package/services/Auth/Auth.js +13 -7
- package/services/Auth/AuthContext.js +9 -1
- package/services/Dialog/Dialog.d.ts +7 -2
- package/services/Dialog/Dialog.js +7 -6
- package/services/Dialog/DialogWindow.d.ts +3 -1
- package/services/Dialog/DialogWindow.js +1 -1
- package/services/Dialog/XhrDialog.d.ts +1 -1
- package/services/Toast/Toast.js +5 -3
- package/services/Toast/ToastContainer.js +3 -1
- package/services/Toast/ToastContext.d.ts +1 -1
- package/services/Toast/ToastProvider.js +2 -0
- package/map/layers/HtmlMarkerLayer/HtmlMarkerLayer copy.d.ts +0 -35
- package/map/layers/HtmlMarkerLayer/HtmlMarkerLayer copy.js +0 -176
- package/modules/Root/Content.d.ts +0 -16
- package/modules/Root/Content.js +0 -25
- package/modules/Root/Overlay.d.ts +0 -23
- package/modules/Root/Overlay.js +0 -33
- package/modules/Root/Root.d.ts +0 -10
- package/modules/Root/Root.js +0 -46
- package/modules/Root/Shader.d.ts +0 -15
- package/modules/Root/Shader.js +0 -24
- package/modules/Root/Sidebar.d.ts +0 -13
- package/modules/Root/Sidebar.js +0 -24
- package/modules/Root/index.d.ts +0 -1
- package/modules/Root/index.js +0 -1
- package/modules/Root/stories/SampleContent.d.ts +0 -7
- package/modules/Root/stories/SampleContent.js +0 -44
|
@@ -31,7 +31,12 @@ interface IClusterMarkerProps {
|
|
|
31
31
|
/**
|
|
32
32
|
* Fired when the marker is clicked.
|
|
33
33
|
*/
|
|
34
|
-
onClick?: () => void;
|
|
34
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Optional inline styles applied to the outer element, merged after (and so
|
|
37
|
+
* overriding) the computed size.
|
|
38
|
+
*/
|
|
39
|
+
style?: React.CSSProperties;
|
|
35
40
|
}
|
|
36
41
|
/**
|
|
37
42
|
* A `ClusterMarker` may be used with an `HtmlMarkerLayer`, or as a component on its own.
|
|
@@ -27,7 +27,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
27
27
|
import * as React from 'react';
|
|
28
28
|
import styled from 'styled-components';
|
|
29
29
|
import { HumanFormatter } from '../../../formatters/HumanFormatter';
|
|
30
|
+
// Default prop values, referenced both by the ClusterMarkerBase fallbacks and
|
|
31
|
+
// the ClusterMarker wrapper below.
|
|
32
|
+
var DEFAULT_RADIUS = 24;
|
|
33
|
+
var DEFAULT_VALUE = 0;
|
|
30
34
|
var ClusterMarkerBase = function (props) {
|
|
35
|
+
var _a, _b, _c;
|
|
31
36
|
/**
|
|
32
37
|
* Create a <path> for a donut segment.
|
|
33
38
|
* @param start Start angle (0-1)
|
|
@@ -61,16 +66,20 @@ var ClusterMarkerBase = function (props) {
|
|
|
61
66
|
return Colors[idx % 5];
|
|
62
67
|
};
|
|
63
68
|
var renderValueRings = function () {
|
|
69
|
+
var _a;
|
|
64
70
|
var value = 0;
|
|
71
|
+
if (!props.ringValues)
|
|
72
|
+
return null;
|
|
73
|
+
var radius = (_a = props.radius) !== null && _a !== void 0 ? _a : DEFAULT_RADIUS;
|
|
65
74
|
// Calculate total value of ringfields:
|
|
66
75
|
var totalValue = props.ringValues.reduce(function (acc, f) { return f + acc; }, 0);
|
|
67
76
|
// Prevent div0:
|
|
68
|
-
if (totalValue
|
|
77
|
+
if (totalValue === 0)
|
|
69
78
|
return null;
|
|
70
79
|
var rings = [];
|
|
71
80
|
props.ringValues.forEach(function (ringValue, idx) {
|
|
72
81
|
var relativeValue = ringValue / totalValue;
|
|
73
|
-
rings.push(donutSegment(idx, value, value + relativeValue,
|
|
82
|
+
rings.push(donutSegment(idx, value, value + relativeValue, radius, radius - 4, getRingColor(idx)));
|
|
74
83
|
value += relativeValue;
|
|
75
84
|
});
|
|
76
85
|
return rings;
|
|
@@ -78,14 +87,14 @@ var ClusterMarkerBase = function (props) {
|
|
|
78
87
|
var handleClick = function (e) {
|
|
79
88
|
e.stopPropagation();
|
|
80
89
|
if (props.onClick)
|
|
81
|
-
props.onClick();
|
|
90
|
+
props.onClick(e);
|
|
82
91
|
};
|
|
83
92
|
// Radius is passed in as inline style, to avoid generating 1000s of styled-component classes.
|
|
84
|
-
return (React.createElement("div", { className: props.className, style: { width: "".concat(props.radius * 2, "px"), height: "".concat(props.radius * 2, "px") }, onClick: handleClick },
|
|
93
|
+
return (React.createElement("div", { className: props.className, style: __assign({ width: "".concat(((_a = props.radius) !== null && _a !== void 0 ? _a : DEFAULT_RADIUS) * 2, "px"), height: "".concat(((_b = props.radius) !== null && _b !== void 0 ? _b : DEFAULT_RADIUS) * 2, "px") }, props.style), onClick: handleClick },
|
|
85
94
|
props.ringValues &&
|
|
86
95
|
React.createElement("svg", null, renderValueRings()),
|
|
87
96
|
React.createElement("span", null,
|
|
88
|
-
React.createElement(HumanFormatter, { value: props.value, decimals: props.decimals }))));
|
|
97
|
+
React.createElement(HumanFormatter, { value: (_c = props.value) !== null && _c !== void 0 ? _c : DEFAULT_VALUE, decimals: props.decimals }))));
|
|
89
98
|
};
|
|
90
99
|
var ClusterMarkerStyled = styled(ClusterMarkerBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n // Position and size:\n position: relative;\n box-sizing: border-box;\n\n // Appearance:\n border-radius: 50%;\n background-color: rgb(255 255 255 / 100%);\n box-shadow: \n 0 0 0 6px rgb(255 255 255 / 44%), // outer ring small\n 0 0 0 12px rgb(255 255 255 / 20%), // outer ring big\n inset 0px 0 0px 4px #fff, // inner white ring\n inset 0px 7px 3px 0px rgba(0, 0, 0, 0.25); // inner dropshadow\n cursor: ", ";\n outline: none;\n user-select: none;\n\n & > svg {\n position: absolute;\n left: 50%;\n top: 50%;\n width: 100%;\n height: 100%;\n margin-left: -50%;\n margin-top: -50%;\n }\n\n & > span {\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n // Content:\n display: flex;\n justify-content: center;\n align-items: center;\n color: #3C698A;\n font: normal 700 12px/12px \"Roboto Condensed\";\n }\n"], ["\n // Position and size:\n position: relative;\n box-sizing: border-box;\n\n // Appearance:\n border-radius: 50%;\n background-color: rgb(255 255 255 / 100%);\n box-shadow: \n 0 0 0 6px rgb(255 255 255 / 44%), // outer ring small\n 0 0 0 12px rgb(255 255 255 / 20%), // outer ring big\n inset 0px 0 0px 4px #fff, // inner white ring\n inset 0px 7px 3px 0px rgba(0, 0, 0, 0.25); // inner dropshadow\n cursor: ", ";\n outline: none;\n user-select: none;\n\n & > svg {\n position: absolute;\n left: 50%;\n top: 50%;\n width: 100%;\n height: 100%;\n margin-left: -50%;\n margin-top: -50%;\n }\n\n & > span {\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n // Content:\n display: flex;\n justify-content: center;\n align-items: center;\n color: #3C698A;\n font: normal 700 12px/12px \"Roboto Condensed\";\n }\n"
|
|
91
100
|
/**
|
|
@@ -98,7 +107,7 @@ var ClusterMarkerStyled = styled(ClusterMarkerBase)(templateObject_1 || (templat
|
|
|
98
107
|
*
|
|
99
108
|
*/
|
|
100
109
|
var ClusterMarker = function (_a) {
|
|
101
|
-
var _b = _a.radius, radius = _b === void 0 ?
|
|
110
|
+
var _b = _a.radius, radius = _b === void 0 ? DEFAULT_RADIUS : _b, _c = _a.relativeSize, relativeSize = _c === void 0 ? 0 : _c, _d = _a.value, value = _d === void 0 ? DEFAULT_VALUE : _d, _e = _a.decimals, decimals = _e === void 0 ? 0 : _e, props = __rest(_a, ["radius", "relativeSize", "value", "decimals"]);
|
|
102
111
|
var step = Math.log10(Math.max(1, value));
|
|
103
112
|
var r = radius + step * relativeSize;
|
|
104
113
|
return React.createElement(ClusterMarkerStyled, __assign({ radius: r, value: value, decimals: decimals }, props));
|
|
@@ -5,7 +5,7 @@ interface IRiskMarkerProps {
|
|
|
5
5
|
/**
|
|
6
6
|
* Fired when marker is clicked.
|
|
7
7
|
*/
|
|
8
|
-
onClick?: () => void;
|
|
8
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
9
9
|
/** Is the marker currently selected? */
|
|
10
10
|
active?: boolean;
|
|
11
11
|
/** Are there actions pending? */
|
|
@@ -14,6 +14,10 @@ interface IRiskMarkerProps {
|
|
|
14
14
|
value?: number;
|
|
15
15
|
/** Risk color */
|
|
16
16
|
color?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Optional inline styles applied to the outer element.
|
|
19
|
+
*/
|
|
20
|
+
style?: React.CSSProperties;
|
|
17
21
|
}
|
|
18
22
|
/**
|
|
19
23
|
* A `RiskMarker` may be used in combination with `HtmlMarkerLayer`, or as
|
|
@@ -16,14 +16,14 @@ var __assign = (this && this.__assign) || function () {
|
|
|
16
16
|
import * as React from 'react';
|
|
17
17
|
import styled from 'styled-components';
|
|
18
18
|
var RiskMarkerBase = function (props) {
|
|
19
|
+
var _a;
|
|
19
20
|
var handleClick = function (e) {
|
|
20
21
|
e.stopPropagation();
|
|
21
22
|
if (props.onClick) {
|
|
22
|
-
props.onClick();
|
|
23
|
+
props.onClick(e);
|
|
23
24
|
}
|
|
24
25
|
};
|
|
25
|
-
|
|
26
|
-
return (React.createElement("div", { className: "".concat(props.className, " ").concat(props.value > 0 ? 'audited ' : 'unaudited ', " ").concat(props.actioned ? 'actioned ' : '', " ").concat(props.active ? 'active ' : ''), style: { width: "".concat(size, "px"), height: "".concat(size, "px") }, onClick: handleClick },
|
|
26
|
+
return (React.createElement("div", { className: "".concat(props.className, " ").concat(((_a = props.value) !== null && _a !== void 0 ? _a : 0) > 0 ? 'audited ' : 'unaudited ', " ").concat(props.actioned ? 'actioned ' : '', " ").concat(props.active ? 'active ' : ''), style: props.style, onClick: handleClick },
|
|
27
27
|
React.createElement("span", null, props.value),
|
|
28
28
|
React.createElement("svg", { viewBox: "0 0 60 60" },
|
|
29
29
|
React.createElement("path", { className: "background", fill: "#808080", fillOpacity: "0.7", d: "M19.0156 38.625C22.0352 35.6761 23.5975 38.9978 29.8862 38.9978C36.1437 38.9978 37.7209 35.8054 40.9297 38.6875C44.667 34.9361 50.4414 33.5238 50.4414 27.781C50.4414 16.3436 41.2634 7.07178 29.9414 7.07178C18.6195 7.07178 9.44141 16.3436 9.44141 27.781C9.44141 33.5662 15.2294 34.8675 19.0156 38.625Z" }),
|
|
@@ -37,7 +37,7 @@ var RiskMarkerBase = function (props) {
|
|
|
37
37
|
React.createElement("path", { className: "no-action", fill: props.color, d: "M42.3623 11.1596C42.366 11.1624 42.3702 11.1646 42.374 11.1673C42.0952 10.9667 41.8147 10.7682 41.5257 10.5811C41.526 10.5812 41.5255 10.5811 41.5257 10.5811C41.524 10.5874 41.5205 10.5932 41.5185 10.5995C38.2075 8.45041 34.2622 7.17529 30.0006 7.17529C25.7501 7.17529 21.815 8.44472 18.5087 10.5835L18.5072 10.5811C12.7877 14.2844 8.97314 20.6539 8.97314 27.9018C8.97314 33.595 11.3058 38.7493 15.0775 42.4946L19.0258 38.6037C16.2649 35.8544 14.557 32.0755 14.557 27.9018C14.557 22.7029 17.2828 18.0472 21.3201 15.3016C23.7952 13.6421 26.7811 12.6672 30.0005 12.6672C33.2389 12.6672 36.2422 13.6518 38.7257 15.3292C38.722 15.3333 38.719 15.338 38.715 15.342C42.7762 18.0838 45.443 22.6843 45.443 27.9018C45.443 32.1043 43.7145 35.9088 40.9199 38.6627L44.8682 42.5537C48.6733 38.8039 51.027 33.6237 51.027 27.9017C51.0272 21.0153 47.6086 14.9265 42.3623 11.1596Z" }),
|
|
38
38
|
React.createElement("path", { className: "action", fill: "#fff", d: "M30 13.9319C33.017 13.9319 35.4628 11.5697 35.4628 8.65588C35.4628 5.74203 33.017 3.37988 30 3.37988C26.983 3.37988 24.5374 5.74203 24.5374 8.65588C24.5374 11.5697 26.983 13.9319 30 13.9319Z" }))));
|
|
39
39
|
};
|
|
40
|
-
var RiskMarkerBaseStyled = styled(RiskMarkerBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n // Position and size:\n position: relative;\n box-sizing: border-box;\n width:
|
|
40
|
+
var RiskMarkerBaseStyled = styled(RiskMarkerBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n // Position and size:\n position: relative;\n box-sizing: border-box;\n width: 80px;\n height: 80px;\n // Translate icon so that pin is exactly at center of lat/lng.\n transform: translateX(0.5px) translateY(-34px);\n\n & > svg {\n width: 100%;\n height: 100%;\n } \n\n & > span {\n position: absolute;\n display: block;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n z-index: 2;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 16px;\n font-weight: bold;\n color: #476988;\n pointer-events: none; // Don't capture SVG's mouse events\n margin-bottom: 5px;\n }\n\n & > svg {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n z-index: 1;\n cursor: pointer;\n filter: drop-shadow(0px 0px 5px rgb(0 0 0 / 0.8));\n }\n\n // By default, all first-level paths/g in marker are hidden.\n & > svg > * { visibility: hidden; }\n \n // Unhide and color parts based on marker class.\n &.unaudited {\n .farm { visibility: visible; }\n .arrow { visibility: visible; }\n &:hover {\n .farm-stroke { visibility: visible; fill: #888; }\n }\n }\n\n &.audited {\n .farm { visibility: visible; fill: #fff; }\n .arrow { visibility: visible; fill: #fff; }\n .no-action { visibility: visible; }\n .background { visibility: visible; }\n &:hover {\n .background { fill: #fff; }\n }\n }\n\n &.actioned {\n .no-action { visibility: hidden; }\n .audit { visibility: visible; }\n .action { visibility: visible; }\n .action-shadow { visibility: visible; }\n }\n\n &.active {\n span {\n color: #fff;\n }\n .farm { fill: #273C44; }\n .farm-stroke { visibility: visible; fill: #fff; }\n .background { fill: #808080; }\n &:hover {\n .background { fill: #808080; }\n }\n }\n"], ["\n // Position and size:\n position: relative;\n box-sizing: border-box;\n width: 80px;\n height: 80px;\n // Translate icon so that pin is exactly at center of lat/lng.\n transform: translateX(0.5px) translateY(-34px);\n\n & > svg {\n width: 100%;\n height: 100%;\n } \n\n & > span {\n position: absolute;\n display: block;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n z-index: 2;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 16px;\n font-weight: bold;\n color: #476988;\n pointer-events: none; // Don't capture SVG's mouse events\n margin-bottom: 5px;\n }\n\n & > svg {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n z-index: 1;\n cursor: pointer;\n filter: drop-shadow(0px 0px 5px rgb(0 0 0 / 0.8));\n }\n\n // By default, all first-level paths/g in marker are hidden.\n & > svg > * { visibility: hidden; }\n \n // Unhide and color parts based on marker class.\n &.unaudited {\n .farm { visibility: visible; }\n .arrow { visibility: visible; }\n &:hover {\n .farm-stroke { visibility: visible; fill: #888; }\n }\n }\n\n &.audited {\n .farm { visibility: visible; fill: #fff; }\n .arrow { visibility: visible; fill: #fff; }\n .no-action { visibility: visible; }\n .background { visibility: visible; }\n &:hover {\n .background { fill: #fff; }\n }\n }\n\n &.actioned {\n .no-action { visibility: hidden; }\n .audit { visibility: visible; }\n .action { visibility: visible; }\n .action-shadow { visibility: visible; }\n }\n\n &.active {\n span {\n color: #fff;\n }\n .farm { fill: #273C44; }\n .farm-stroke { visibility: visible; fill: #fff; }\n .background { fill: #808080; }\n &:hover {\n .background { fill: #808080; }\n }\n }\n"
|
|
41
41
|
/**
|
|
42
42
|
* A `RiskMarker` may be used in combination with `HtmlMarkerLayer`, or as
|
|
43
43
|
* component on its own.
|
|
@@ -9,6 +9,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
+
if (ar || !(i in from)) {
|
|
15
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
+
ar[i] = from[i];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
+
};
|
|
12
21
|
import * as React from 'react';
|
|
13
22
|
import { Dropdown } from '../../inputs/Dropdown';
|
|
14
23
|
import { Countries } from '../../formatters/CountryFormatter/Countries';
|
|
@@ -27,7 +36,7 @@ var CountryDropdown = function (props) {
|
|
|
27
36
|
var _a = React.useState(null), q = _a[0], setQ = _a[1];
|
|
28
37
|
var localizedNames = getCountries(props.locale);
|
|
29
38
|
var sortedKeys = React.useMemo(function () {
|
|
30
|
-
return countryKeys.sort(function (a, b) { return localizedNames[a].localeCompare(localizedNames[b]); });
|
|
39
|
+
return __spreadArray([], countryKeys, true).sort(function (a, b) { return localizedNames[a].localeCompare(localizedNames[b]); });
|
|
31
40
|
}, [localizedNames]);
|
|
32
41
|
var data = sortedKeys
|
|
33
42
|
.filter(function (c) { return !props.countries || props.countries.includes(c.toUpperCase()); })
|
|
@@ -12,6 +12,11 @@ interface IFilterProps extends ITestable {
|
|
|
12
12
|
* @default 250
|
|
13
13
|
*/
|
|
14
14
|
width?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
17
|
+
* of the default styling.
|
|
18
|
+
*/
|
|
19
|
+
style?: React.CSSProperties;
|
|
15
20
|
}
|
|
16
21
|
/**
|
|
17
22
|
* A `Filter` is a combination of a filter button and a panel. The panel is
|
package/modules/Filter/Filter.js
CHANGED
|
@@ -32,10 +32,14 @@ import { ToggleButton } from '../../controls/ToggleButton';
|
|
|
32
32
|
import { GlassPane } from '../../containers/GlassPane';
|
|
33
33
|
import { useOutsideClose } from '../../hooks/useOutsideClose';
|
|
34
34
|
import { SVG } from '../../svg';
|
|
35
|
+
// Default prop value, referenced both by the FilterBase fallback and the
|
|
36
|
+
// Filter wrapper below.
|
|
37
|
+
var DEFAULT_WIDTH = 250;
|
|
35
38
|
var FilterBase = function (props) {
|
|
39
|
+
var _a;
|
|
36
40
|
var buttonRef = React.useRef(null);
|
|
37
41
|
var paneRef = React.useRef(null);
|
|
38
|
-
var
|
|
42
|
+
var _b = React.useState(false), open = _b[0], setOpen = _b[1];
|
|
39
43
|
useOutsideClose({
|
|
40
44
|
open: open,
|
|
41
45
|
refs: [paneRef, buttonRef],
|
|
@@ -43,7 +47,7 @@ var FilterBase = function (props) {
|
|
|
43
47
|
escapeToClose: true,
|
|
44
48
|
blurToClose: false
|
|
45
49
|
});
|
|
46
|
-
var
|
|
50
|
+
var _c = usePopper(buttonRef.current, paneRef.current, {
|
|
47
51
|
placement: 'bottom-end',
|
|
48
52
|
modifiers: [
|
|
49
53
|
{
|
|
@@ -53,16 +57,16 @@ var FilterBase = function (props) {
|
|
|
53
57
|
},
|
|
54
58
|
}
|
|
55
59
|
]
|
|
56
|
-
}), styles =
|
|
60
|
+
}), styles = _c.styles, attributes = _c.attributes, update = _c.update;
|
|
57
61
|
var toggleOpen = function () {
|
|
58
62
|
setOpen(!open);
|
|
59
63
|
// Update popper.
|
|
60
64
|
if (update)
|
|
61
65
|
update();
|
|
62
66
|
};
|
|
63
|
-
return (React.createElement("div", { "data-testid": props['data-testid'] || "Filter", className: props.className },
|
|
67
|
+
return (React.createElement("div", { "data-testid": props['data-testid'] || "Filter", className: props.className, style: props.style },
|
|
64
68
|
React.createElement(ToggleButton, { url: SVG.Icons.Filter, ref: buttonRef, active: props.active, open: open, onClick: toggleOpen }),
|
|
65
|
-
createPortal(React.createElement(Pane, __assign({ "data-
|
|
69
|
+
createPortal(React.createElement(Pane, __assign({ "data-testid": "Filter.Pane", "$open": open, "$width": (_a = props.width) !== null && _a !== void 0 ? _a : DEFAULT_WIDTH, style: styles.popper }, attributes.popper, { ref: paneRef }), open && React.createElement(GlassPane, { padded: true, bordered: true }, props.children)), document.body)));
|
|
66
70
|
};
|
|
67
71
|
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"
|
|
68
72
|
/**
|
|
@@ -77,7 +81,7 @@ var Pane = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObje
|
|
|
77
81
|
* be clipped.
|
|
78
82
|
*/
|
|
79
83
|
var Filter = function (_a) {
|
|
80
|
-
var _b = _a.width, width = _b === void 0 ?
|
|
84
|
+
var _b = _a.width, width = _b === void 0 ? DEFAULT_WIDTH : _b, props = __rest(_a, ["width"]);
|
|
81
85
|
return React.createElement(FilterBase, __assign({ width: width }, props));
|
|
82
86
|
};
|
|
83
87
|
Filter.displayName = "Filter";
|
package/modules/Globe/Globe.d.ts
CHANGED
|
@@ -2,6 +2,11 @@ import * as React from 'react';
|
|
|
2
2
|
interface IGlobeProps {
|
|
3
3
|
/** @ignore */
|
|
4
4
|
className?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
7
|
+
* of the default styling.
|
|
8
|
+
*/
|
|
9
|
+
style?: React.CSSProperties;
|
|
5
10
|
}
|
|
6
11
|
declare const Globe: {
|
|
7
12
|
(props: IGlobeProps): React.JSX.Element;
|
package/modules/Globe/Globe.js
CHANGED
|
@@ -76,7 +76,6 @@ var GlobeBase = function (props) {
|
|
|
76
76
|
gl.bindBuffer(gl.ARRAY_BUFFER, buffer.current);
|
|
77
77
|
var positions = getFibonacciSpherePoints(NUM_POINTS, 1.0, false);
|
|
78
78
|
numPoints.current = positions.length / 3;
|
|
79
|
-
console.log("Total points after water subtraction", numPoints.current);
|
|
80
79
|
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW);
|
|
81
80
|
};
|
|
82
81
|
var draw = function (gl) {
|
|
@@ -129,10 +128,11 @@ var GlobeBase = function (props) {
|
|
|
129
128
|
createBuffer(gl.current);
|
|
130
129
|
animationID.current = window.requestAnimationFrame(animate);
|
|
131
130
|
return function () {
|
|
132
|
-
|
|
131
|
+
if (animationID.current !== null)
|
|
132
|
+
window.cancelAnimationFrame(animationID.current);
|
|
133
133
|
};
|
|
134
|
-
});
|
|
135
|
-
return (React.createElement("canvas", { className: props.className, ref: canvasRef, width: "1024", height: "768" }));
|
|
134
|
+
}, []);
|
|
135
|
+
return (React.createElement("canvas", { className: props.className, style: props.style, ref: canvasRef, width: "1024", height: "768" }));
|
|
136
136
|
};
|
|
137
137
|
var GlobeStyled = styled(GlobeBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n background-color: transparent;\n"], ["\n width: 100%;\n height: 100%;\n background-color: transparent;\n"])));
|
|
138
138
|
var Globe = function (props) { return React.createElement(GlobeStyled, __assign({}, props)); };
|
|
@@ -32,9 +32,16 @@ interface IProps extends ITestable {
|
|
|
32
32
|
*/
|
|
33
33
|
disabled?: boolean;
|
|
34
34
|
/**
|
|
35
|
-
* If set, this callback
|
|
35
|
+
* If set, this callback is triggered when the item is clicked. Receives the
|
|
36
|
+
* mouse event. The Item itself is presentational (not keyboard-focusable);
|
|
37
|
+
* for keyboard access, wrap it in a focusable element such as a link.
|
|
36
38
|
*/
|
|
37
|
-
onClick?: () => void;
|
|
39
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
42
|
+
* of the default styling.
|
|
43
|
+
*/
|
|
44
|
+
style?: React.CSSProperties;
|
|
38
45
|
}
|
|
39
46
|
declare const Item: {
|
|
40
47
|
({ active, secondary, noExpand, disabled, ...props }: IProps): React.JSX.Element;
|
package/modules/MainMenu/Item.js
CHANGED
|
@@ -32,15 +32,16 @@ var BUTTON_SIZE = 50;
|
|
|
32
32
|
// The width x height of an icon inside the button.
|
|
33
33
|
var ICON_SIZE = 26;
|
|
34
34
|
var ItemBase = function (props) {
|
|
35
|
-
var _a;
|
|
36
35
|
// The <Content> element contains the actual menu text. The width of this
|
|
37
36
|
// element depends on the length of the text. It is this width that must
|
|
38
37
|
// be used for the animation.
|
|
39
|
-
var content = React.useRef();
|
|
40
|
-
var
|
|
38
|
+
var content = React.useRef(null);
|
|
39
|
+
var _a = useSpring(function () { return ({
|
|
41
40
|
from: { maxWidth: BUTTON_SIZE }
|
|
42
|
-
}); }), springs =
|
|
41
|
+
}); }), springs = _a[0], api = _a[1];
|
|
43
42
|
var handleMouseEnter = function () {
|
|
43
|
+
if (!content.current)
|
|
44
|
+
return;
|
|
44
45
|
api.start({
|
|
45
46
|
from: {
|
|
46
47
|
maxWidth: BUTTON_SIZE,
|
|
@@ -58,6 +59,8 @@ var ItemBase = function (props) {
|
|
|
58
59
|
});
|
|
59
60
|
};
|
|
60
61
|
var handleMouseLeave = function () {
|
|
62
|
+
if (!content.current)
|
|
63
|
+
return;
|
|
61
64
|
api.start({
|
|
62
65
|
from: {
|
|
63
66
|
maxWidth: content.current.scrollWidth + 24 + 13,
|
|
@@ -74,7 +77,7 @@ var ItemBase = function (props) {
|
|
|
74
77
|
}
|
|
75
78
|
});
|
|
76
79
|
};
|
|
77
|
-
return (React.createElement("div", { "data-testid": props['data-testid'] || "MainMenu.Item", tabIndex: -1, className: props.className, onMouseEnter: !props.noExpand ? handleMouseEnter :
|
|
80
|
+
return (React.createElement("div", { "data-testid": props['data-testid'] || "MainMenu.Item", tabIndex: -1, className: props.className, style: props.style, onMouseEnter: !props.noExpand ? handleMouseEnter : undefined, onMouseLeave: !props.noExpand ? handleMouseLeave : undefined, onClick: props.onClick },
|
|
78
81
|
React.createElement(Animatable, { style: __assign({}, springs) },
|
|
79
82
|
React.createElement(Content, { ref: content },
|
|
80
83
|
React.createElement(Svg, null,
|
|
@@ -5,6 +5,11 @@ interface IMainMenuProps extends ITestable {
|
|
|
5
5
|
className?: string;
|
|
6
6
|
/** @ignore */
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
10
|
+
* of the default styling.
|
|
11
|
+
*/
|
|
12
|
+
style?: React.CSSProperties;
|
|
8
13
|
}
|
|
9
14
|
/**
|
|
10
15
|
* A `MainMenu` is always positioned on the left side of its container, and
|
|
@@ -48,7 +48,7 @@ var MainMenuBase = function (props) {
|
|
|
48
48
|
primaryItems.push(child);
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
|
-
return (React.createElement("div", { "data-testid": props['data-testid'] || "MainMenu", className: props.className },
|
|
51
|
+
return (React.createElement("div", { "data-testid": props['data-testid'] || "MainMenu", className: props.className, style: props.style, role: "navigation", "aria-label": "Main menu" },
|
|
52
52
|
React.createElement(Top, { "data-testid": "MainMenu.Top" }, primaryItems),
|
|
53
53
|
React.createElement(Bottom, { "data-testid": "MainMenu.Bottom" }, secondaryItems)));
|
|
54
54
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare class GL {
|
|
2
2
|
static createProgram: (gl: WebGLRenderingContext, vertexSource: string, fragmentSource: string) => WebGLProgram;
|
|
3
|
-
static createRGBATexture: (gl: WebGLRenderingContext, size: number, content: Uint8Array, interpolated: boolean) => WebGLTexture;
|
|
3
|
+
static createRGBATexture: (gl: WebGLRenderingContext, size: number, content: Uint8Array | null, interpolated: boolean) => WebGLTexture;
|
|
4
4
|
static createImageTexture: (gl: WebGLRenderingContext, image: HTMLImageElement, interpolation: boolean) => WebGLTexture;
|
|
5
5
|
static createFrameBuffer: (gl: WebGLRenderingContext, texture: WebGLTexture) => WebGLFramebuffer;
|
|
6
6
|
}
|
|
@@ -86,6 +86,11 @@ interface IParticleGlobeProps {
|
|
|
86
86
|
* @default false
|
|
87
87
|
*/
|
|
88
88
|
responsive?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Optional inline styles applied to the outer element, for one-off overrides
|
|
91
|
+
* of the default styling.
|
|
92
|
+
*/
|
|
93
|
+
style?: React.CSSProperties;
|
|
89
94
|
}
|
|
90
95
|
declare const ParticleGlobe: {
|
|
91
96
|
({ numParticles, globe, trails, pointSize, angleX, angleY, deltaX, deltaY, outlines, minLifetime, maxLifetime, glow, landmass, brightness, speedFactor, responsive, gradientStops, ...props }: IParticleGlobeProps): React.JSX.Element;
|