@longline/aqua-ui 1.0.338 → 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 +25 -0
- package/formatters/PhoneFormatter/PhoneFormatter.js +34 -0
- package/formatters/PhoneFormatter/index.d.ts +1 -0
- package/formatters/PhoneFormatter/index.js +1 -0
- 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/helper/phoneNumber.d.ts +31 -0
- package/helper/phoneNumber.js +142 -0
- 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 +97 -0
- package/inputs/PhoneInput/PhoneInput.js +113 -0
- package/inputs/PhoneInput/index.d.ts +2 -0
- package/inputs/PhoneInput/index.js +1 -0
- 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
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import * as React from 'react';
|
|
24
|
-
import * as ReactDOM from 'react-dom/client';
|
|
25
|
-
import { Layer, useMap } from 'react-map-gl/mapbox';
|
|
26
|
-
import { Marker } from 'mapbox-gl';
|
|
27
|
-
/**
|
|
28
|
-
* The `HtmlMarkerLayer` manages HTML markers on a map. HTML markers are far slower
|
|
29
|
-
* than OpenGL layers, but much more flexible: with SVG, any shape of marker can
|
|
30
|
-
* be designed, and the markers can easily be made responsive to hover.
|
|
31
|
-
*
|
|
32
|
-
* The `HtmlMarkerLayer` keeps an internal cache, creating and rendering markers only
|
|
33
|
-
* when they are visible in the map viewport. This is a suitable solution for clusters
|
|
34
|
-
* (where by definition there are never very many icons in the viewport), or when
|
|
35
|
-
* there are simply not _that_ many markers: up to a few hundred in the viewport is the
|
|
36
|
-
* upper limit.
|
|
37
|
-
*
|
|
38
|
-
* The `HtmlMarkerLayer` must be placed inside a GeoJSON `Source`. In that source,
|
|
39
|
-
* each feature must have a unique ID (passed to this layer as the `idField`), which
|
|
40
|
-
* is used to tell features apart. When features are refreshed, it is imported that
|
|
41
|
-
* they all get new IDs so that old markers get removed correctly.
|
|
42
|
-
*
|
|
43
|
-
* The `HtmlMarkerLayer` component takes a _function child_. This function accepts
|
|
44
|
-
* a `props` object, which will be the properties from each GeoJSON feature for which
|
|
45
|
-
* a marker is rendered.
|
|
46
|
-
*
|
|
47
|
-
* The `minZoom` and `maxZoom` properties can be used to make markers appear only
|
|
48
|
-
* within a range of zoom levels.
|
|
49
|
-
*
|
|
50
|
-
* ```tsx
|
|
51
|
-
* // featureCollection has a property "id" with unique values
|
|
52
|
-
* <Source id="mysource" type="geojson" data={featureCollection}>
|
|
53
|
-
* <HtmlMarkerLayer sourceId="mysource" idField="id">
|
|
54
|
-
* {(markerProps) => <MyMarkerComponent color="gold" radius={45} {...markerProps}/>
|
|
55
|
-
* </HtmlMarkerLayer>
|
|
56
|
-
* </Source>
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
var HtmlMarkerLayerBase = function (props) {
|
|
60
|
-
var map = useMap().current;
|
|
61
|
-
// Can't call props.children directly from map render event handler.
|
|
62
|
-
// Make a ref copy:
|
|
63
|
-
var children = React.useRef(props.children);
|
|
64
|
-
var markers = React.useRef({});
|
|
65
|
-
var markersOnScreen = React.useRef({});
|
|
66
|
-
var minZoom = React.useRef(props.minZoom);
|
|
67
|
-
var maxZoom = React.useRef(props.maxZoom);
|
|
68
|
-
// Add render event to map, and remove it when this component
|
|
69
|
-
// is unmounted. Whenever the map renders, we must refresh
|
|
70
|
-
// all markers.
|
|
71
|
-
React.useEffect(function () {
|
|
72
|
-
map.on('render', updateMarkers);
|
|
73
|
-
return function () { map.off('render', updateMarkers); };
|
|
74
|
-
}, []);
|
|
75
|
-
// If the child function changes, then update the children ref copy.
|
|
76
|
-
// Also clear map and repaint it, because child component props may
|
|
77
|
-
// have changed.
|
|
78
|
-
React.useEffect(function () {
|
|
79
|
-
minZoom.current = props.minZoom;
|
|
80
|
-
maxZoom.current = props.maxZoom;
|
|
81
|
-
children.current = props.children;
|
|
82
|
-
for (var id in markersOnScreen.current) {
|
|
83
|
-
markersOnScreen.current[id].remove();
|
|
84
|
-
}
|
|
85
|
-
markers.current = {};
|
|
86
|
-
markersOnScreen.current = {};
|
|
87
|
-
map.triggerRepaint();
|
|
88
|
-
}, [props.children, props.minZoom, props.maxZoom]);
|
|
89
|
-
// When component is unmounted, remove all its markers from the map.
|
|
90
|
-
React.useEffect(function () {
|
|
91
|
-
return function () {
|
|
92
|
-
for (var id in markersOnScreen.current) {
|
|
93
|
-
markersOnScreen.current[id].remove();
|
|
94
|
-
}
|
|
95
|
-
map.triggerRepaint();
|
|
96
|
-
};
|
|
97
|
-
}, []);
|
|
98
|
-
//
|
|
99
|
-
// Given a native or React component and props, turn it into an
|
|
100
|
-
// HTML element. Return this element.
|
|
101
|
-
//
|
|
102
|
-
var createHtmlElementFromReactNode = function (latlngfeatureProps) {
|
|
103
|
-
// Don't render anything if there is no child.
|
|
104
|
-
if (!children.current)
|
|
105
|
-
return null;
|
|
106
|
-
// Get the first child.
|
|
107
|
-
var elem = children.current(latlngfeatureProps);
|
|
108
|
-
// Render child.
|
|
109
|
-
var el = document.createElement('div');
|
|
110
|
-
var root = ReactDOM.createRoot(el);
|
|
111
|
-
root.render(elem);
|
|
112
|
-
return el;
|
|
113
|
-
};
|
|
114
|
-
//
|
|
115
|
-
// Calculate which markers are offscreen, and remove them.
|
|
116
|
-
// Add new markers for markers which are now onscreen.
|
|
117
|
-
var updateMarkers = function () {
|
|
118
|
-
// Only run after GeoJSON is loaded:
|
|
119
|
-
if (!map.getSource(props.sourceId))
|
|
120
|
-
return;
|
|
121
|
-
if (!map.isSourceLoaded(props.sourceId))
|
|
122
|
-
return;
|
|
123
|
-
// Retrieve all features that are currently rendered on a visible map tile,
|
|
124
|
-
// thus excluding everything that's off-screen, for speed. The use of
|
|
125
|
-
// querySourceFeatures requires that at least one Layer exists, which is
|
|
126
|
-
// why we have a layer that renders only invisible circles.
|
|
127
|
-
// querySourceFeatures often results duplicates due to buffering.
|
|
128
|
-
// Remove these duplicates by looking at each feature's unique ID.
|
|
129
|
-
var seen = {};
|
|
130
|
-
var features = (map.getZoom() < minZoom.current || map.getZoom() > maxZoom.current) ? [] : map.querySourceFeatures(props.sourceId).filter(function (f) {
|
|
131
|
-
var id = f.properties[props.idField];
|
|
132
|
-
return seen.hasOwnProperty(id) ? false : (seen[id] = true);
|
|
133
|
-
});
|
|
134
|
-
// For every marker on the screen, create an HTML marker (if we didn't yet),
|
|
135
|
-
// and add it to the map if it's not there already
|
|
136
|
-
var newMarkers = {};
|
|
137
|
-
for (var _i = 0, features_1 = features; _i < features_1.length; _i++) {
|
|
138
|
-
var feature = features_1[_i];
|
|
139
|
-
var coords = feature.geometry.coordinates;
|
|
140
|
-
var fprops = feature.properties;
|
|
141
|
-
var id = fprops[props.idField];
|
|
142
|
-
// Do not render makers without an ID field:
|
|
143
|
-
if (!id)
|
|
144
|
-
continue;
|
|
145
|
-
// Is there a marker for this feature?
|
|
146
|
-
var marker = markers.current[id];
|
|
147
|
-
// If not, create one:
|
|
148
|
-
if (!marker) {
|
|
149
|
-
var el = createHtmlElementFromReactNode(__assign({ longitude: coords[0], latitude: coords[1] }, fprops));
|
|
150
|
-
marker = markers.current[id] = new Marker({
|
|
151
|
-
element: el
|
|
152
|
-
});
|
|
153
|
-
marker.setLngLat(coords);
|
|
154
|
-
}
|
|
155
|
-
newMarkers[id] = marker;
|
|
156
|
-
if (!markersOnScreen.current[id])
|
|
157
|
-
marker.addTo(map.getMap());
|
|
158
|
-
}
|
|
159
|
-
// for every marker we've added previously, remove those
|
|
160
|
-
// that are no longer visible:
|
|
161
|
-
for (var id in markersOnScreen.current) {
|
|
162
|
-
if (!newMarkers[id])
|
|
163
|
-
markersOnScreen.current[id].remove();
|
|
164
|
-
}
|
|
165
|
-
markersOnScreen.current = newMarkers;
|
|
166
|
-
};
|
|
167
|
-
// querySourceFeatures will only work if we have a layer, even
|
|
168
|
-
// though it's empty.
|
|
169
|
-
return (React.createElement(Layer, { source: props.sourceId, type: "circle", paint: { "circle-radius": 0 } }));
|
|
170
|
-
};
|
|
171
|
-
var HtmlMarkerLayer = function (_a) {
|
|
172
|
-
var _b = _a.minZoom, minZoom = _b === void 0 ? 0 : _b, _c = _a.maxZoom, maxZoom = _c === void 0 ? 99 : _c, props = __rest(_a, ["minZoom", "maxZoom"]);
|
|
173
|
-
return React.createElement(HtmlMarkerLayerBase, __assign({ minZoom: minZoom, maxZoom: maxZoom }, props));
|
|
174
|
-
};
|
|
175
|
-
HtmlMarkerLayer.displayName = 'HtmlMarkerLayer';
|
|
176
|
-
export { HtmlMarkerLayer };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
interface IProps {
|
|
3
|
-
/** @ignore */
|
|
4
|
-
className?: string;
|
|
5
|
-
/** @ignore */
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
/**
|
|
8
|
-
* Is this the currently-active content?
|
|
9
|
-
*/
|
|
10
|
-
active?: boolean;
|
|
11
|
-
}
|
|
12
|
-
declare const Content: {
|
|
13
|
-
(props: IProps): React.JSX.Element;
|
|
14
|
-
displayName: string;
|
|
15
|
-
};
|
|
16
|
-
export { Content, IProps };
|
package/modules/Root/Content.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
import * as React from 'react';
|
|
17
|
-
import styled from 'styled-components';
|
|
18
|
-
var ContentBase = function (props) {
|
|
19
|
-
return (React.createElement("div", { "data-testid": "Root.Content", className: props.className }, props.children));
|
|
20
|
-
};
|
|
21
|
-
var ContentStyled = styled(ContentBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n width: 100%;\n height: 100%;\n background: red;\n visibility: ", ";\n"], ["\n position: relative;\n width: 100%;\n height: 100%;\n background: red;\n visibility: ", ";\n"])), function (p) { return p.active ? 'visible' : 'hidden'; });
|
|
22
|
-
var Content = function (props) { return React.createElement(ContentStyled, __assign({}, props)); };
|
|
23
|
-
Content.displayName = "Overlay.Content";
|
|
24
|
-
export { Content };
|
|
25
|
-
var templateObject_1;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
interface IProps {
|
|
3
|
-
/** @ignore */
|
|
4
|
-
className?: string;
|
|
5
|
-
/** @ignore */
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
/**
|
|
8
|
-
* Is the `Overlay` currently open?
|
|
9
|
-
*/
|
|
10
|
-
open?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Fired when Overlay wants to close.
|
|
13
|
-
*/
|
|
14
|
-
onClose: () => void;
|
|
15
|
-
}
|
|
16
|
-
declare const Overlay: {
|
|
17
|
-
(props: IProps): React.JSX.Element;
|
|
18
|
-
Content: {
|
|
19
|
-
(props: import("./Content").IProps): React.JSX.Element;
|
|
20
|
-
displayName: string;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export { Overlay };
|
package/modules/Root/Overlay.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
import * as React from 'react';
|
|
17
|
-
import styled from 'styled-components';
|
|
18
|
-
import { Shader } from './Shader';
|
|
19
|
-
import { Sidebar } from './Sidebar';
|
|
20
|
-
import { Content } from './Content';
|
|
21
|
-
var OverlayBase = function (props) {
|
|
22
|
-
var handleShaderClick = function () {
|
|
23
|
-
props.onClose();
|
|
24
|
-
};
|
|
25
|
-
return (React.createElement("div", { "data-testid": "Root.Overlay", className: props.className },
|
|
26
|
-
React.createElement(Sidebar, { open: props.open }, props.children),
|
|
27
|
-
React.createElement(Shader, { active: props.open, onClick: handleShaderClick })));
|
|
28
|
-
};
|
|
29
|
-
var OverlayStyled = styled(OverlayBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n // Position and size:\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n pointer-events: none !important;\n"], ["\n // Position and size:\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n pointer-events: none !important;\n"])));
|
|
30
|
-
var Overlay = function (props) { return React.createElement(OverlayStyled, __assign({}, props)); };
|
|
31
|
-
Overlay.Content = Content;
|
|
32
|
-
export { Overlay };
|
|
33
|
-
var templateObject_1;
|
package/modules/Root/Root.d.ts
DELETED
package/modules/Root/Root.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
import * as React from 'react';
|
|
17
|
-
import styled from 'styled-components';
|
|
18
|
-
import { Outlet, useMatches, useNavigate } from 'react-router-dom';
|
|
19
|
-
import { MainMenu } from '../MainMenu';
|
|
20
|
-
import { SVG } from '../../svg';
|
|
21
|
-
import { Overlay } from './Overlay';
|
|
22
|
-
import { Map } from '../../map/Map';
|
|
23
|
-
var RootBase = function (props) {
|
|
24
|
-
var navigate = useNavigate();
|
|
25
|
-
var m = useMatches();
|
|
26
|
-
return (React.createElement("div", { "data-testid": "Root", className: props.className },
|
|
27
|
-
React.createElement(MainMenu, null,
|
|
28
|
-
React.createElement(MainMenu.Item, { icon: SVG.Menu.MapMarker, onClick: function () { return navigate(""); } }, "Map"),
|
|
29
|
-
React.createElement(MainMenu.Item, { icon: SVG.Menu.Company, onClick: function () { return navigate("company"); } }, "Company"),
|
|
30
|
-
React.createElement(MainMenu.Item, { icon: SVG.Menu.Standards, onClick: function () { return navigate("farms"); } }, "Farms"),
|
|
31
|
-
React.createElement(MainMenu.Item, { icon: SVG.Menu.Account, onClick: function () { return navigate("page1"); } }, "Page 1"),
|
|
32
|
-
React.createElement(MainMenu.Item, { icon: SVG.Menu.Signout, onClick: function () { return navigate("page2"); } }, "Page 2")),
|
|
33
|
-
React.createElement(Overlay, { open: m.length == 3 && m[2].pathname != "/", onClose: function () { return navigate("/"); } }, m.length == 3 && React.createElement(Outlet, null)),
|
|
34
|
-
React.createElement(Content, { "data-testid": "Root.Content" },
|
|
35
|
-
React.createElement(Map, { token: "pk.eyJ1IjoibG9uZ2xpbmVlbnZpcm9ubWVudCIsImEiOiJjbDdldTJhMmYwM3VlM3lvMW5mcTFyOWlnIn0.LzghnMQjPdtw795xN-BCWg", style: "mapbox://styles/longlineenvironment/clm8wahno013a01pb5c0u3k22" }),
|
|
36
|
-
m.length == 2 &&
|
|
37
|
-
React.createElement(Page, { "data-testid": "Root.Page" },
|
|
38
|
-
React.createElement(Outlet, null)))));
|
|
39
|
-
};
|
|
40
|
-
var Content = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 80px;\n right: 0;\n bottom: 0;\n"], ["\n position: absolute;\n top: 0;\n left: 80px;\n right: 0;\n bottom: 0;\n"])));
|
|
41
|
-
var Page = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: grey;\n color: white;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: grey;\n color: white;\n"])));
|
|
42
|
-
var RootStyled = styled(RootBase)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n background-color: #333;\n"], ["\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n background-color: #333;\n"])));
|
|
43
|
-
var Root = function (props) { return React.createElement(RootStyled, __assign({}, props)); };
|
|
44
|
-
Root.displayName = 'Root';
|
|
45
|
-
export { Root };
|
|
46
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
package/modules/Root/Shader.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
interface IProps {
|
|
3
|
-
/** @ignore */
|
|
4
|
-
className?: string;
|
|
5
|
-
/**
|
|
6
|
-
* Is shader currently active?
|
|
7
|
-
*/
|
|
8
|
-
active?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Fired when Shader is clicked.
|
|
11
|
-
*/
|
|
12
|
-
onClick: () => void;
|
|
13
|
-
}
|
|
14
|
-
declare const Shader: (props: IProps) => React.JSX.Element;
|
|
15
|
-
export { Shader };
|
package/modules/Root/Shader.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
import * as React from 'react';
|
|
17
|
-
import styled from 'styled-components';
|
|
18
|
-
var ShaderBase = function (props) {
|
|
19
|
-
return (React.createElement("div", { "data-testid": "Root.Shader", className: props.className, onClick: props.onClick }));
|
|
20
|
-
};
|
|
21
|
-
var ShaderStyled = styled(ShaderBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n // Position and size:\n position: absolute;\n z-index: 1;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n\n // Behavior:\n pointer-events: ", ";\n cursor: ", ";\n\n // Appearance:\n transition: opacity ", "ms ease-in-out;\n opacity: ", ";\n background-color: rgba(0,0,0,0.5);\n"], ["\n // Position and size:\n position: absolute;\n z-index: 1;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n\n // Behavior:\n pointer-events: ", ";\n cursor: ", ";\n\n // Appearance:\n transition: opacity ", "ms ease-in-out;\n opacity: ", ";\n background-color: rgba(0,0,0,0.5);\n"])), function (p) { return p.active ? 'all' : 'none'; }, function (p) { return p.active ? 'pointer' : 'auto'; }, function (p) { return p.theme.animation.duration * 2; }, function (p) { return p.active ? 1 : 0; });
|
|
22
|
-
var Shader = function (props) { return React.createElement(ShaderStyled, __assign({}, props)); };
|
|
23
|
-
export { Shader };
|
|
24
|
-
var templateObject_1;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
interface IProps {
|
|
3
|
-
/** @ignore */
|
|
4
|
-
className?: string;
|
|
5
|
-
/** @ignore */
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
/**
|
|
8
|
-
* Is the overlay currently open?
|
|
9
|
-
*/
|
|
10
|
-
open?: boolean;
|
|
11
|
-
}
|
|
12
|
-
declare const Sidebar: (props: IProps) => React.JSX.Element;
|
|
13
|
-
export { Sidebar };
|
package/modules/Root/Sidebar.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
import * as React from 'react';
|
|
17
|
-
import styled from 'styled-components';
|
|
18
|
-
var SidebarBase = function (props) {
|
|
19
|
-
return React.createElement("div", { "data-testid": "Root.Sidebar", className: props.className }, props.children);
|
|
20
|
-
};
|
|
21
|
-
var SidebarStyled = styled(SidebarBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n // Position and size:\n position: absolute;\n z-index: 2;\n left: ", ";\n top: 0;\n width: 250px;\n bottom: 0;\n transition: left ", "ms ease-in-out;\n pointer-events: all;\n\n // Appearance:\n background: ", ";\n"], ["\n // Position and size:\n position: absolute;\n z-index: 2;\n left: ", ";\n top: 0;\n width: 250px;\n bottom: 0;\n transition: left ", "ms ease-in-out;\n pointer-events: all;\n\n // Appearance:\n background: ", ";\n"])), function (p) { return p.open ? 0 : '-350px'; }, function (p) { return p.theme.animation.duration * 2; }, function (p) { return p.theme.colors.primary[3]; });
|
|
22
|
-
var Sidebar = function (props) { return React.createElement(SidebarStyled, __assign({}, props)); };
|
|
23
|
-
export { Sidebar };
|
|
24
|
-
var templateObject_1;
|
package/modules/Root/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Root';
|
package/modules/Root/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Root';
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
import * as React from 'react';
|
|
17
|
-
import styled from 'styled-components';
|
|
18
|
-
var SampleContentBase = function (props) {
|
|
19
|
-
return (React.createElement("div", { className: props.className },
|
|
20
|
-
props.children,
|
|
21
|
-
React.createElement(Scroller, null,
|
|
22
|
-
React.createElement("div", null, "A"),
|
|
23
|
-
React.createElement("div", null, "B"),
|
|
24
|
-
React.createElement("div", null, "C"),
|
|
25
|
-
React.createElement("div", null, "D"),
|
|
26
|
-
React.createElement("div", null, "E"),
|
|
27
|
-
React.createElement("div", null, "F"),
|
|
28
|
-
React.createElement("div", null, "G"),
|
|
29
|
-
React.createElement("div", null, "H"),
|
|
30
|
-
React.createElement("div", null, "I"),
|
|
31
|
-
React.createElement("div", null, "J"),
|
|
32
|
-
React.createElement("div", null, "K"),
|
|
33
|
-
React.createElement("div", null, "L"),
|
|
34
|
-
React.createElement("div", null, "M"),
|
|
35
|
-
React.createElement("div", null, "N"),
|
|
36
|
-
React.createElement("div", null, "O"),
|
|
37
|
-
React.createElement("div", null, "P"),
|
|
38
|
-
React.createElement("div", null, "Q"))));
|
|
39
|
-
};
|
|
40
|
-
var Scroller = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex: 1;\n overflow-y: scroll;\n border: solid 1px #fff;\n & > div {\n height: 48px;\n }\n"], ["\n flex: 1;\n overflow-y: scroll;\n border: solid 1px #fff;\n & > div {\n height: 48px;\n }\n"])));
|
|
41
|
-
var SampleContentStyled = styled(SampleContentBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n height: 100%;\n \n"], ["\n display: flex;\n flex-direction: column;\n height: 100%;\n \n"])));
|
|
42
|
-
var SampleContent = function (props) { return React.createElement(SampleContentStyled, __assign({}, props)); };
|
|
43
|
-
export { SampleContent };
|
|
44
|
-
var templateObject_1, templateObject_2;
|