@longline/aqua-ui 1.0.0
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/README.md +7 -0
- package/Types.d.ts +6 -0
- package/Types.js +5 -0
- package/containers/Anchor/Anchor.d.ts +63 -0
- package/containers/Anchor/Anchor.js +113 -0
- package/containers/Anchor/index.d.ts +1 -0
- package/containers/Anchor/index.js +1 -0
- package/containers/Dock/Dock.d.ts +45 -0
- package/containers/Dock/Dock.js +61 -0
- package/containers/Dock/Dockable.d.ts +60 -0
- package/containers/Dock/Dockable.js +98 -0
- package/containers/Dock/index.d.ts +2 -0
- package/containers/Dock/index.js +2 -0
- package/containers/Form/Field.d.ts +104 -0
- package/containers/Form/Field.js +168 -0
- package/containers/Form/Form.d.ts +51 -0
- package/containers/Form/Form.js +89 -0
- package/containers/Form/Validation.d.ts +212 -0
- package/containers/Form/Validation.js +232 -0
- package/containers/Form/context/FormContext.d.ts +10 -0
- package/containers/Form/context/FormContext.js +3 -0
- package/containers/Form/context/useForm.d.ts +5 -0
- package/containers/Form/context/useForm.js +9 -0
- package/containers/Form/elements/BoxWrapper.d.ts +15 -0
- package/containers/Form/elements/BoxWrapper.js +35 -0
- package/containers/Form/elements/Hint.d.ts +21 -0
- package/containers/Form/elements/Hint.js +15 -0
- package/containers/Form/elements/Label.d.ts +22 -0
- package/containers/Form/elements/Label.js +15 -0
- package/containers/Form/elements/SimpleWrapper.d.ts +15 -0
- package/containers/Form/elements/SimpleWrapper.js +17 -0
- package/containers/GlassPane/GlassPane.d.ts +36 -0
- package/containers/GlassPane/GlassPane.js +66 -0
- package/containers/GlassPane/index.d.ts +1 -0
- package/containers/GlassPane/index.js +1 -0
- package/containers/InfoBox/InfoBox.d.ts +34 -0
- package/containers/InfoBox/InfoBox.js +45 -0
- package/containers/InfoBox/elements/Content.d.ts +23 -0
- package/containers/InfoBox/elements/Content.js +37 -0
- package/containers/InfoBox/elements/Footer.d.ts +9 -0
- package/containers/InfoBox/elements/Footer.js +24 -0
- package/containers/InfoBox/elements/Header.d.ts +9 -0
- package/containers/InfoBox/elements/Header.js +24 -0
- package/containers/List/List.d.ts +45 -0
- package/containers/List/List.js +47 -0
- package/containers/List/ListCell.d.ts +13 -0
- package/containers/List/ListCell.js +24 -0
- package/containers/List/ListRow.d.ts +15 -0
- package/containers/List/ListRow.js +24 -0
- package/containers/List/index.d.ts +3 -0
- package/containers/List/index.js +3 -0
- package/containers/Tabs/Pane.d.ts +29 -0
- package/containers/Tabs/Pane.js +45 -0
- package/containers/Tabs/Tabs.d.ts +66 -0
- package/containers/Tabs/Tabs.js +144 -0
- package/controls/Chip/Chip.d.ts +35 -0
- package/controls/Chip/Chip.js +83 -0
- package/controls/Fab/Fab.d.ts +73 -0
- package/controls/Fab/Fab.js +94 -0
- package/controls/Icon/Icon.d.ts +98 -0
- package/controls/Icon/Icon.js +79 -0
- package/controls/Icon/index.d.ts +1 -0
- package/controls/Icon/index.js +1 -0
- package/controls/Key/Key.d.ts +22 -0
- package/controls/Key/Key.js +74 -0
- package/controls/Key/index.d.ts +1 -0
- package/controls/Key/index.js +1 -0
- package/controls/LinearChart/LinearChart.d.ts +31 -0
- package/controls/LinearChart/LinearChart.js +58 -0
- package/controls/ListView/Body.d.ts +8 -0
- package/controls/ListView/Body.js +24 -0
- package/controls/ListView/Column.d.ts +55 -0
- package/controls/ListView/Column.js +8 -0
- package/controls/ListView/ColumnsManager/ColumnDraggable.d.ts +11 -0
- package/controls/ListView/ColumnsManager/ColumnDraggable.js +83 -0
- package/controls/ListView/ColumnsManager/ColumnsManager.d.ts +12 -0
- package/controls/ListView/ColumnsManager/ColumnsManager.js +63 -0
- package/controls/ListView/ColumnsManager/OrderColumns.d.ts +11 -0
- package/controls/ListView/ColumnsManager/OrderColumns.js +62 -0
- package/controls/ListView/ColumnsManager/SourceColumns.d.ts +10 -0
- package/controls/ListView/ColumnsManager/SourceColumns.js +45 -0
- package/controls/ListView/Ghost.d.ts +9 -0
- package/controls/ListView/Ghost.js +52 -0
- package/controls/ListView/Header.d.ts +12 -0
- package/controls/ListView/Header.js +35 -0
- package/controls/ListView/HeaderButton.d.ts +8 -0
- package/controls/ListView/HeaderButton.js +8 -0
- package/controls/ListView/HeaderCell.d.ts +20 -0
- package/controls/ListView/HeaderCell.js +47 -0
- package/controls/ListView/IListViewProps.d.ts +105 -0
- package/controls/ListView/IListViewProps.js +1 -0
- package/controls/ListView/ListView.d.ts +20 -0
- package/controls/ListView/ListView.js +97 -0
- package/controls/ListView/NoData.d.ts +19 -0
- package/controls/ListView/NoData.js +30 -0
- package/controls/ListView/SortButton.d.ts +16 -0
- package/controls/ListView/SortButton.js +26 -0
- package/controls/ListView/Table.d.ts +18 -0
- package/controls/ListView/Table.js +99 -0
- package/controls/ListView/Total.d.ts +9 -0
- package/controls/ListView/Total.js +28 -0
- package/controls/ListView/sortItems.d.ts +6 -0
- package/controls/ListView/sortItems.js +35 -0
- package/controls/Mouse/Mouse.d.ts +38 -0
- package/controls/Mouse/Mouse.js +51 -0
- package/controls/Mouse/index.d.ts +1 -0
- package/controls/Mouse/index.js +1 -0
- package/controls/PrimaryButton/PrimaryButton.d.ts +63 -0
- package/controls/PrimaryButton/PrimaryButton.js +83 -0
- package/controls/PrimaryButton/index.d.ts +1 -0
- package/controls/PrimaryButton/index.js +1 -0
- package/controls/Progress/Progress.d.ts +35 -0
- package/controls/Progress/Progress.js +49 -0
- package/controls/SecondaryButton/SecondaryButton.d.ts +58 -0
- package/controls/SecondaryButton/SecondaryButton.js +73 -0
- package/controls/SecondaryButton/index.d.ts +1 -0
- package/controls/SecondaryButton/index.js +1 -0
- package/controls/TabBar/Tab.d.ts +21 -0
- package/controls/TabBar/Tab.js +25 -0
- package/controls/TabBar/TabBar.d.ts +34 -0
- package/controls/TabBar/TabBar.js +134 -0
- package/controls/TabBar/Underliner.d.ts +7 -0
- package/controls/TabBar/Underliner.js +27 -0
- package/controls/TabBar/index.d.ts +1 -0
- package/controls/TabBar/index.js +1 -0
- package/controls/TertiaryButton/TertiaryButton.d.ts +28 -0
- package/controls/TertiaryButton/TertiaryButton.js +65 -0
- package/controls/TertiaryButton/index.d.ts +1 -0
- package/controls/TertiaryButton/index.js +1 -0
- package/controls/View/View.d.ts +35 -0
- package/controls/View/View.js +58 -0
- package/formatters/Date/DateTime.d.ts +45 -0
- package/formatters/Date/DateTime.js +64 -0
- package/formatters/Date/elements/Custom.d.ts +18 -0
- package/formatters/Date/elements/Custom.js +22 -0
- package/formatters/Date/elements/Distance.d.ts +24 -0
- package/formatters/Date/elements/Distance.js +45 -0
- package/formatters/Date/elements/LongDate.d.ts +17 -0
- package/formatters/Date/elements/LongDate.js +11 -0
- package/formatters/Date/elements/LongDateTime.d.ts +14 -0
- package/formatters/Date/elements/LongDateTime.js +10 -0
- package/formatters/Date/elements/LongTime.d.ts +14 -0
- package/formatters/Date/elements/LongTime.js +10 -0
- package/formatters/Date/elements/ShortDate.d.ts +14 -0
- package/formatters/Date/elements/ShortDate.js +10 -0
- package/formatters/Date/elements/ShortDateTime.d.ts +14 -0
- package/formatters/Date/elements/ShortDateTime.js +10 -0
- package/formatters/Date/elements/ShortTime.d.ts +18 -0
- package/formatters/Date/elements/ShortTime.js +10 -0
- package/formatters/Date/elements/toDate.d.ts +2 -0
- package/formatters/Date/elements/toDate.js +13 -0
- package/formatters/Filesize/Filesize.d.ts +29 -0
- package/formatters/Filesize/Filesize.js +54 -0
- package/formatters/GIS/Latitude.d.ts +23 -0
- package/formatters/GIS/Latitude.js +13 -0
- package/formatters/GIS/Longitude.d.ts +23 -0
- package/formatters/GIS/Longitude.js +13 -0
- package/formatters/GIS/index.d.ts +2 -0
- package/formatters/GIS/index.js +2 -0
- package/formatters/GIS/toDMS.d.ts +2 -0
- package/formatters/GIS/toDMS.js +16 -0
- package/formatters/Highlight/Highlight.d.ts +22 -0
- package/formatters/Highlight/Highlight.js +32 -0
- package/formatters/Highlight/index.d.ts +1 -0
- package/formatters/Highlight/index.js +1 -0
- package/formatters/Human/Human.d.ts +18 -0
- package/formatters/Human/Human.js +34 -0
- package/formatters/Human/index.d.ts +1 -0
- package/formatters/Human/index.js +1 -0
- package/formatters/Number/Number.d.ts +24 -0
- package/formatters/Number/Number.js +36 -0
- package/formatters/Number/index.d.ts +1 -0
- package/formatters/Number/index.js +1 -0
- package/helper/DMS.d.ts +22 -0
- package/helper/DMS.js +46 -0
- package/helper/HslColor.d.ts +11 -0
- package/helper/HslColor.js +47 -0
- package/helper/RgbColor.d.ts +43 -0
- package/helper/RgbColor.js +162 -0
- package/helper/SizeHelper.d.ts +10 -0
- package/helper/SizeHelper.js +56 -0
- package/helper/darken.d.ts +8 -0
- package/helper/darken.js +18 -0
- package/helper/guard.d.ts +5 -0
- package/helper/guard.js +7 -0
- package/helper/lighten.d.ts +8 -0
- package/helper/lighten.js +11 -0
- package/helper/nameToHex.d.ts +6 -0
- package/helper/nameToHex.js +163 -0
- package/inputs/DateInput/Body.d.ts +34 -0
- package/inputs/DateInput/Body.js +50 -0
- package/inputs/DateInput/Calendar.d.ts +15 -0
- package/inputs/DateInput/Calendar.js +60 -0
- package/inputs/DateInput/DateInput.d.ts +73 -0
- package/inputs/DateInput/DateInput.js +143 -0
- package/inputs/DateInput/Day.d.ts +32 -0
- package/inputs/DateInput/Day.js +33 -0
- package/inputs/DateInput/InfiniteList.d.ts +26 -0
- package/inputs/DateInput/InfiniteList.js +87 -0
- package/inputs/DateInput/Nav.d.ts +11 -0
- package/inputs/DateInput/Nav.js +24 -0
- package/inputs/DateInput/Navbar.d.ts +16 -0
- package/inputs/DateInput/Navbar.js +33 -0
- package/inputs/DateInput/NumericInput.d.ts +14 -0
- package/inputs/DateInput/NumericInput.js +48 -0
- package/inputs/DateInput/Selector.d.ts +47 -0
- package/inputs/DateInput/Selector.js +55 -0
- package/inputs/DateInput/SimpleList.d.ts +19 -0
- package/inputs/DateInput/SimpleList.js +31 -0
- package/inputs/Dropdown/Body.d.ts +25 -0
- package/inputs/Dropdown/Body.js +14 -0
- package/inputs/Dropdown/Column.d.ts +21 -0
- package/inputs/Dropdown/Column.js +6 -0
- package/inputs/Dropdown/Dropdown.d.ts +136 -0
- package/inputs/Dropdown/Dropdown.js +446 -0
- package/inputs/Dropdown/Selection.d.ts +11 -0
- package/inputs/Dropdown/Selection.js +23 -0
- package/inputs/Dropdown/Selector.d.ts +29 -0
- package/inputs/Dropdown/Selector.js +16 -0
- package/inputs/Editor/Editor.d.ts +45 -0
- package/inputs/Editor/Editor.js +60 -0
- package/inputs/Editor/buttons/BoldButton.d.ts +7 -0
- package/inputs/Editor/buttons/BoldButton.js +7 -0
- package/inputs/Editor/buttons/BulletListButton.d.ts +7 -0
- package/inputs/Editor/buttons/BulletListButton.js +7 -0
- package/inputs/Editor/buttons/CodeBlockButton.d.ts +7 -0
- package/inputs/Editor/buttons/CodeBlockButton.js +7 -0
- package/inputs/Editor/buttons/CodeButton.d.ts +7 -0
- package/inputs/Editor/buttons/CodeButton.js +7 -0
- package/inputs/Editor/buttons/ItalicButton.d.ts +7 -0
- package/inputs/Editor/buttons/ItalicButton.js +7 -0
- package/inputs/Editor/buttons/OrderedListButton.d.ts +7 -0
- package/inputs/Editor/buttons/OrderedListButton.js +7 -0
- package/inputs/Editor/buttons/StrikethroughButton.d.ts +7 -0
- package/inputs/Editor/buttons/StrikethroughButton.js +7 -0
- package/inputs/Editor/menu/MenuBar.d.ts +9 -0
- package/inputs/Editor/menu/MenuBar.js +44 -0
- package/inputs/Editor/menu/MenuButton.d.ts +35 -0
- package/inputs/Editor/menu/MenuButton.js +34 -0
- package/inputs/Editor/menu/MenuSeparator.d.ts +7 -0
- package/inputs/Editor/menu/MenuSeparator.js +24 -0
- package/inputs/Input/Clear.d.ts +7 -0
- package/inputs/Input/Clear.js +14 -0
- package/inputs/Input/Input.d.ts +133 -0
- package/inputs/Input/Input.js +64 -0
- package/inputs/Input/InputWrapper.d.ts +23 -0
- package/inputs/Input/InputWrapper.js +57 -0
- package/inputs/Input/index.d.ts +1 -0
- package/inputs/Input/index.js +1 -0
- package/inputs/Selector/ISelectorProps.d.ts +29 -0
- package/inputs/Selector/ISelectorProps.js +1 -0
- package/inputs/Selector/Selector.d.ts +29 -0
- package/inputs/Selector/Selector.js +77 -0
- package/inputs/Selector/index.d.ts +1 -0
- package/inputs/Selector/index.js +1 -0
- package/inputs/Selector/widgets/Checkbox.d.ts +6 -0
- package/inputs/Selector/widgets/Checkbox.js +29 -0
- package/inputs/Selector/widgets/Toggle.d.ts +6 -0
- package/inputs/Selector/widgets/Toggle.js +24 -0
- package/inputs/Slider/Slider.d.ts +63 -0
- package/inputs/Slider/Slider.js +198 -0
- package/inputs/Textarea/Textarea.d.ts +79 -0
- package/inputs/Textarea/Textarea.js +65 -0
- package/main.js +32 -0
- package/map/Map/Map.d.ts +47 -0
- package/map/Map/Map.js +221 -0
- package/map/Map/index.d.ts +1 -0
- package/map/Map/index.js +1 -0
- package/map/PositionsManager/PositionBox.d.ts +14 -0
- package/map/PositionsManager/PositionBox.js +86 -0
- package/map/PositionsManager/PositionsManager.d.ts +27 -0
- package/map/PositionsManager/PositionsManager.js +99 -0
- package/map/controls/CompassButton/CompassButton.d.ts +33 -0
- package/map/controls/CompassButton/CompassButton.js +88 -0
- package/map/controls/FullscreenButton/FullscreenButton.d.ts +21 -0
- package/map/controls/FullscreenButton/FullscreenButton.js +62 -0
- package/map/controls/Geocoder/Geocoder.d.ts +49 -0
- package/map/controls/Geocoder/Geocoder.js +179 -0
- package/map/controls/Geocoder/GeocoderApi.d.ts +59 -0
- package/map/controls/Geocoder/GeocoderApi.js +68 -0
- package/map/controls/Geocoder/GeocoderEntry.d.ts +15 -0
- package/map/controls/Geocoder/GeocoderEntry.js +18 -0
- package/map/controls/Geocoder/GeocoderList.d.ts +10 -0
- package/map/controls/Geocoder/GeocoderList.js +18 -0
- package/map/controls/Geocoder/GeocoderSelector.d.ts +16 -0
- package/map/controls/Geocoder/GeocoderSelector.js +25 -0
- package/map/controls/Graticule/Graticule.d.ts +35 -0
- package/map/controls/Graticule/Graticule.js +142 -0
- package/map/controls/MapLoader/MapLoader.d.ts +33 -0
- package/map/controls/MapLoader/MapLoader.js +73 -0
- package/map/controls/ScaleControl/ScaleControl.d.ts +24 -0
- package/map/controls/ScaleControl/ScaleControl.js +107 -0
- package/map/controls/ZoomInButton/ZoomInButton.d.ts +19 -0
- package/map/controls/ZoomInButton/ZoomInButton.js +56 -0
- package/map/controls/ZoomOutButton/ZoomOutButton.d.ts +19 -0
- package/map/controls/ZoomOutButton/ZoomOutButton.js +56 -0
- package/map/controls/base/MapButton/Hint.d.ts +17 -0
- package/map/controls/base/MapButton/Hint.js +34 -0
- package/map/controls/base/MapButton/MapButton.d.ts +46 -0
- package/map/controls/base/MapButton/MapButton.js +71 -0
- package/map/controls/base/MapButton/index.d.ts +1 -0
- package/map/controls/base/MapButton/index.js +1 -0
- package/map/controls/base/MapButtonGroup/MapButtonGroup.d.ts +17 -0
- package/map/controls/base/MapButtonGroup/MapButtonGroup.js +24 -0
- package/map/controls/base/MapControl/MapControl.d.ts +36 -0
- package/map/controls/base/MapControl/MapControl.js +77 -0
- package/map/controls/base/MapControl/index.d.ts +1 -0
- package/map/controls/base/MapControl/index.js +1 -0
- package/map/layers/ClusterLayer/ClusterLayer.d.ts +79 -0
- package/map/layers/ClusterLayer/ClusterLayer.js +118 -0
- package/map/layers/HtmlMarkerLayer/HtmlMarkerLayer.d.ts +51 -0
- package/map/layers/HtmlMarkerLayer/HtmlMarkerLayer.js +151 -0
- package/map/layers/InterpolationLayer/ContoursFragmentShader.d.ts +2 -0
- package/map/layers/InterpolationLayer/ContoursFragmentShader.js +2 -0
- package/map/layers/InterpolationLayer/ContoursVertexShader.d.ts +2 -0
- package/map/layers/InterpolationLayer/ContoursVertexShader.js +2 -0
- package/map/layers/InterpolationLayer/IGradientStop.d.ts +5 -0
- package/map/layers/InterpolationLayer/IGradientStop.js +1 -0
- package/map/layers/InterpolationLayer/InterpolationLayer.d.ts +35 -0
- package/map/layers/InterpolationLayer/InterpolationLayer.js +256 -0
- package/map/layers/InterpolationLayer/LevelsFragmentShader.d.ts +2 -0
- package/map/layers/InterpolationLayer/LevelsFragmentShader.js +2 -0
- package/map/layers/InterpolationLayer/LevelsVertexShader.d.ts +2 -0
- package/map/layers/InterpolationLayer/LevelsVertexShader.js +2 -0
- package/map/layers/ParticlesLayer/ParticlesFragmentShader.d.ts +2 -0
- package/map/layers/ParticlesLayer/ParticlesFragmentShader.js +2 -0
- package/map/layers/ParticlesLayer/ParticlesLayer.d.ts +40 -0
- package/map/layers/ParticlesLayer/ParticlesLayer.js +337 -0
- package/map/layers/ParticlesLayer/ParticlesVertexShader.d.ts +2 -0
- package/map/layers/ParticlesLayer/ParticlesVertexShader.js +2 -0
- package/map/layers/ParticlesLayer/UVFragmentShader.d.ts +2 -0
- package/map/layers/ParticlesLayer/UVFragmentShader.js +2 -0
- package/map/layers/ParticlesLayer/UVVertexShader.d.ts +2 -0
- package/map/layers/ParticlesLayer/UVVertexShader.js +2 -0
- package/map/markers/ClusterMarker/ClusterMarker.d.ts +36 -0
- package/map/markers/ClusterMarker/ClusterMarker.js +99 -0
- package/map/markers/ClusterMarker/index.d.ts +1 -0
- package/map/markers/ClusterMarker/index.js +1 -0
- package/map/markers/RiskMarker/RiskMarker.d.ts +22 -0
- package/map/markers/RiskMarker/RiskMarker.js +61 -0
- package/modules/MainMenu/Item.d.ts +42 -0
- package/modules/MainMenu/Item.js +94 -0
- package/modules/MainMenu/MainMenu.d.ts +20 -0
- package/modules/MainMenu/MainMenu.js +41 -0
- package/modules/MainMenu/index.d.ts +1 -0
- package/modules/MainMenu/index.js +1 -0
- package/modules/Root/Content.d.ts +16 -0
- package/modules/Root/Content.js +25 -0
- package/modules/Root/Overlay.d.ts +23 -0
- package/modules/Root/Overlay.js +33 -0
- package/modules/Root/Root.d.ts +7 -0
- package/modules/Root/Root.js +45 -0
- package/modules/Root/Shader.d.ts +15 -0
- package/modules/Root/Shader.js +24 -0
- package/modules/Root/Sidebar.d.ts +13 -0
- package/modules/Root/Sidebar.js +24 -0
- package/modules/Root/stories/SampleContent.d.ts +7 -0
- package/modules/Root/stories/SampleContent.js +44 -0
- package/package.json +64 -0
- package/services/Dialog/AlertDialog.d.ts +31 -0
- package/services/Dialog/AlertDialog.js +29 -0
- package/services/Dialog/ConfirmDialog.d.ts +34 -0
- package/services/Dialog/ConfirmDialog.js +30 -0
- package/services/Dialog/Dialog.d.ts +91 -0
- package/services/Dialog/Dialog.js +92 -0
- package/services/Dialog/DialogBackground.d.ts +7 -0
- package/services/Dialog/DialogBackground.js +12 -0
- package/services/Dialog/DialogContent.d.ts +25 -0
- package/services/Dialog/DialogContent.js +38 -0
- package/services/Dialog/DialogFooter.d.ts +24 -0
- package/services/Dialog/DialogFooter.js +50 -0
- package/services/Dialog/DialogHeader.d.ts +18 -0
- package/services/Dialog/DialogHeader.js +36 -0
- package/services/Dialog/DialogWindow.d.ts +13 -0
- package/services/Dialog/DialogWindow.js +12 -0
- package/services/Dialog/XhrDialog.d.ts +34 -0
- package/services/Dialog/XhrDialog.js +321 -0
- package/services/Toast/IToastMessage.d.ts +10 -0
- package/services/Toast/IToastMessage.js +1 -0
- package/services/Toast/IToastProps.d.ts +23 -0
- package/services/Toast/IToastProps.js +1 -0
- package/services/Toast/Toast.d.ts +21 -0
- package/services/Toast/Toast.js +79 -0
- package/services/Toast/ToastContainer.d.ts +40 -0
- package/services/Toast/ToastContainer.js +65 -0
- package/services/Toast/ToastContext.d.ts +22 -0
- package/services/Toast/ToastContext.js +7 -0
- package/services/Toast/ToastProvider.d.ts +19 -0
- package/services/Toast/ToastProvider.js +67 -0
- package/services/Toast/index.d.ts +2 -0
- package/services/Toast/index.js +2 -0
- package/services/Toast/useToast.d.ts +5 -0
- package/services/Toast/useToast.js +9 -0
- package/spritemap.svg +1 -0
- package/styles/NormalTheme.d.ts +3 -0
- package/styles/NormalTheme.js +65 -0
- package/styles/StyleBase.d.ts +2 -0
- package/styles/StyleBase.js +8 -0
- package/styles/StyleReset.d.ts +2 -0
- package/styles/StyleReset.js +8 -0
- package/svg/editor/index.d.ts +10 -0
- package/svg/editor/index.js +11 -0
- package/svg/file/index.d.ts +5 -0
- package/svg/file/index.js +6 -0
- package/svg/icons/index.d.ts +36 -0
- package/svg/icons/index.js +37 -0
- package/svg/index.d.ts +11 -0
- package/svg/index.js +5 -0
- package/svg/menu/index.d.ts +8 -0
- package/svg/menu/index.js +9 -0
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
+
var t = {};
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
+
t[p] = s[p];
|
|
20
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
+
t[p[i]] = s[p[i]];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
import * as React from 'react';
|
|
28
|
+
import { useMap } from 'react-map-gl';
|
|
29
|
+
import styled, { css } from 'styled-components';
|
|
30
|
+
import { MapButton } from '../base/MapButton';
|
|
31
|
+
import { useViewState } from '../../Map';
|
|
32
|
+
import { Mouse } from '../../../controls/Mouse';
|
|
33
|
+
import { Key } from '../../../controls/Key';
|
|
34
|
+
var CompassButtonBase = function (p) {
|
|
35
|
+
var viewState = useViewState();
|
|
36
|
+
var map = useMap().current;
|
|
37
|
+
return (React.createElement(MapButton, __assign({ onClick: function () { map.rotateTo(0); map.resetNorthPitch(); } }, p),
|
|
38
|
+
React.createElement("div", { style: { transform: "rotateX(".concat(p.visualizePitch ? viewState.pitch : 0, "deg)") } },
|
|
39
|
+
React.createElement("svg", { style: { transform: "rotateZ(".concat(-viewState.bearing, "deg)") }, xmlns: "http://www.w3.org/2000/svg", x: "0px", y: "0px", viewBox: "0 0 1000 1000" },
|
|
40
|
+
React.createElement("polygon", { className: "tip", points: "100,1000 500,0 900,1000 500,700 " }),
|
|
41
|
+
React.createElement("polygon", { className: "arrow", points: "500,0 423,192.6 500,351.6 577,192.6 " })))));
|
|
42
|
+
};
|
|
43
|
+
var CompassButtonStyled = styled(CompassButtonBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n /* Add custom tip color if specified. */\n ", "\n"], ["\n /* Add custom tip color if specified. */\n ", "\n"
|
|
44
|
+
/**
|
|
45
|
+
* The `CompassButton` shows a bearing arrow which points to the north.
|
|
46
|
+
* It optionally tilts the arrow to reflect the current pitch.
|
|
47
|
+
*
|
|
48
|
+
* The current map ViewState must be passed to this control, which is done
|
|
49
|
+
* automatically when the control is hosted inside a `Map` instance. The ViewState
|
|
50
|
+
* is then passed down through a context and can be accessed using `useViewState`.
|
|
51
|
+
*
|
|
52
|
+
* A default _hint_ is provided, but can be overridden using `hint`. The hint can
|
|
53
|
+
* be removed entirely by setting `hint={null}`.
|
|
54
|
+
*
|
|
55
|
+
* ```tsx
|
|
56
|
+
* <CompassButton
|
|
57
|
+
* x={40} y={50} visualizePitch contrastTip
|
|
58
|
+
* />
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
])), function (p) { return p.contrastTip && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n svg polygon.arrow {\n fill: ", ";\n }"], ["\n svg polygon.arrow {\n fill: ", ";\n }"])), typeof p.contrastTip === "string" ? p.contrastTip : "red"); });
|
|
62
|
+
/**
|
|
63
|
+
* The `CompassButton` shows a bearing arrow which points to the north.
|
|
64
|
+
* It optionally tilts the arrow to reflect the current pitch.
|
|
65
|
+
*
|
|
66
|
+
* The current map ViewState must be passed to this control, which is done
|
|
67
|
+
* automatically when the control is hosted inside a `Map` instance. The ViewState
|
|
68
|
+
* is then passed down through a context and can be accessed using `useViewState`.
|
|
69
|
+
*
|
|
70
|
+
* A default _hint_ is provided, but can be overridden using `hint`. The hint can
|
|
71
|
+
* be removed entirely by setting `hint={null}`.
|
|
72
|
+
*
|
|
73
|
+
* ```tsx
|
|
74
|
+
* <CompassButton
|
|
75
|
+
* x={40} y={50} visualizePitch contrastTip
|
|
76
|
+
* />
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
var CompassButton = function (_a) {
|
|
80
|
+
var _b = _a.hint, hint = _b === void 0 ? React.createElement(React.Fragment, null,
|
|
81
|
+
React.createElement(Key, { value: "Ctrl" }),
|
|
82
|
+
" + ",
|
|
83
|
+
React.createElement(Mouse, { size: 16, left: true }),
|
|
84
|
+
" Adjust pitch/bearing") : _b, props = __rest(_a, ["hint"]);
|
|
85
|
+
return React.createElement(CompassButtonStyled, __assign({ hint: hint }, props));
|
|
86
|
+
};
|
|
87
|
+
export { CompassButton };
|
|
88
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IMapButtonProps } from '../base/MapButton';
|
|
3
|
+
interface IProps {
|
|
4
|
+
/**
|
|
5
|
+
* (Optional) Container that should be made fullscreen. If omitted, this
|
|
6
|
+
* will be the map's direct container.
|
|
7
|
+
*/
|
|
8
|
+
container?: HTMLDivElement;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The `FullscreenButton` toggles the map full-screen when clicked.
|
|
12
|
+
*
|
|
13
|
+
* A default _hint_ is provided, but can be overridden using `hint`. The hint can
|
|
14
|
+
* be removed entirely by setting `hint={null}`.
|
|
15
|
+
*
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <FullscreenButton x={40} y={50}/>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
declare const FullscreenButton: ({ hint, ...props }: IMapButtonProps & IProps) => React.JSX.Element;
|
|
21
|
+
export { FullscreenButton, IProps };
|
|
@@ -0,0 +1,62 @@
|
|
|
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 { useMap } from 'react-map-gl';
|
|
25
|
+
import { MapButton } from '../base/MapButton';
|
|
26
|
+
/**
|
|
27
|
+
* The `FullscreenButton` toggles the map full-screen when clicked.
|
|
28
|
+
*
|
|
29
|
+
* A default _hint_ is provided, but can be overridden using `hint`. The hint can
|
|
30
|
+
* be removed entirely by setting `hint={null}`.
|
|
31
|
+
*
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <FullscreenButton x={40} y={50}/>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
var FullscreenButton = function (_a) {
|
|
37
|
+
var _b = _a.hint, hint = _b === void 0 ? React.createElement(React.Fragment, null, "Toggle fullscreen map") : _b, props = __rest(_a, ["hint"]);
|
|
38
|
+
var map = useMap().current;
|
|
39
|
+
//
|
|
40
|
+
// Does the browser offer full screen support?
|
|
41
|
+
var checkFullscreenSupport = function () {
|
|
42
|
+
return !!(window.document.fullscreenEnabled ||
|
|
43
|
+
window.document.webkitFullscreenEnabled);
|
|
44
|
+
};
|
|
45
|
+
var toggle = function () {
|
|
46
|
+
if (document.fullscreenElement === null) {
|
|
47
|
+
if (props.container) {
|
|
48
|
+
props.container.requestFullscreen();
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
map.getContainer().requestFullscreen();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
window.document.exitFullscreen();
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
return (React.createElement(MapButton, __assign({ disabled: !checkFullscreenSupport(), onClick: toggle, hint: hint }, props),
|
|
59
|
+
React.createElement("svg", { width: "100", height: "100", viewBox: "0 0 448 512", xmlns: "http://www.w3.org/2000/svg" },
|
|
60
|
+
React.createElement("path", { d: "M32 32C14.3 32 0 46.3 0 64v96c0 17.7 14.3 32 32 32s32-14.3 32-32V96h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H32zM64 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7 14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H64V352zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32h64v64c0 17.7 14.3 32 32 32s32-14.3 32-32V64c0-17.7-14.3-32-32-32H320zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v64H320c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32V352z" }))));
|
|
61
|
+
};
|
|
62
|
+
export { FullscreenButton };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IMapControlProps } from '../base/MapControl';
|
|
3
|
+
interface IGeocoderProps extends IMapControlProps {
|
|
4
|
+
/** @ignore */
|
|
5
|
+
className?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Mapbox access token.
|
|
8
|
+
*/
|
|
9
|
+
access_token: string;
|
|
10
|
+
/**
|
|
11
|
+
* Optional control width, in pixels.
|
|
12
|
+
* @default 300
|
|
13
|
+
*/
|
|
14
|
+
width?: number;
|
|
15
|
+
/**
|
|
16
|
+
* If set, shows a static search icon.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
searchIcon?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Optional placeholder for input box.
|
|
22
|
+
* @default "Type to search places"
|
|
23
|
+
*/
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
/**
|
|
26
|
+
* For point features with no bounding box, this is the zoom level that
|
|
27
|
+
* the map will fly to.
|
|
28
|
+
* When a feature has a bounding box, the map will fit the bounding box.
|
|
29
|
+
* @default 15
|
|
30
|
+
*/
|
|
31
|
+
pointZoom?: number;
|
|
32
|
+
/**
|
|
33
|
+
* If set, bias will be given to results around the user's IP address.
|
|
34
|
+
* @default true
|
|
35
|
+
*/
|
|
36
|
+
proximityIP?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The `Geocoder` control displays an input box. Typing into it sends requests
|
|
40
|
+
* to Mapbox for geocoding (with a debounce), and a list of matches appears.
|
|
41
|
+
* Clicking a match has the map fly to the selection location. The control
|
|
42
|
+
* must be provided with a map `access_token` to work.
|
|
43
|
+
*
|
|
44
|
+
* The input box can be placed using the `x` and `y` props.
|
|
45
|
+
*
|
|
46
|
+
* Mapbox geocoding playground: https://docs.mapbox.com/playground/geocoding/
|
|
47
|
+
*/
|
|
48
|
+
declare const Geocoder: ({ width, searchIcon, placeholder, pointZoom, proximityIP, ...props }: IGeocoderProps) => React.JSX.Element;
|
|
49
|
+
export { Geocoder, IGeocoderProps };
|
|
@@ -0,0 +1,179 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
+
var t = {};
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
+
t[p] = s[p];
|
|
20
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
+
t[p[i]] = s[p[i]];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
import * as React from 'react';
|
|
28
|
+
import styled from 'styled-components';
|
|
29
|
+
import { useMap } from 'react-map-gl';
|
|
30
|
+
import { GeocoderApi } from './GeocoderApi';
|
|
31
|
+
import { GeocoderEntry } from './GeocoderEntry';
|
|
32
|
+
import { GeocoderList } from './GeocoderList';
|
|
33
|
+
import { GeocoderSelector } from './GeocoderSelector';
|
|
34
|
+
import { MapControl } from '../base/MapControl';
|
|
35
|
+
var GeocoderBase = function (props) {
|
|
36
|
+
var wrapperRef = React.useRef(null);
|
|
37
|
+
var map = useMap().current;
|
|
38
|
+
// Timer is used for debouncing requests:
|
|
39
|
+
var _a = React.useState(null), timer = _a[0], setTimer = _a[1];
|
|
40
|
+
// Current query:
|
|
41
|
+
var _b = React.useState(""), q = _b[0], setQ = _b[1];
|
|
42
|
+
// Currently retrieved features:
|
|
43
|
+
var _c = React.useState([]), features = _c[0], setFeatures = _c[1];
|
|
44
|
+
// Offset of currently-selected feature (0-based):
|
|
45
|
+
var _d = React.useState(-1), selectedIndex = _d[0], setSelectedIndex = _d[1];
|
|
46
|
+
//
|
|
47
|
+
// Clear the control, removing any items.
|
|
48
|
+
// Focus on input.
|
|
49
|
+
//
|
|
50
|
+
var clear = function () {
|
|
51
|
+
setQ("");
|
|
52
|
+
setFeatures([]);
|
|
53
|
+
setSelectedIndex(-1);
|
|
54
|
+
if (wrapperRef)
|
|
55
|
+
wrapperRef.current.querySelector('input').focus();
|
|
56
|
+
};
|
|
57
|
+
//
|
|
58
|
+
// Call mapbox geocoder API, and store results in state.
|
|
59
|
+
//
|
|
60
|
+
var lookup = function (q) {
|
|
61
|
+
if (q == "")
|
|
62
|
+
return;
|
|
63
|
+
var options = {
|
|
64
|
+
proximityIP: props.proximityIP
|
|
65
|
+
};
|
|
66
|
+
GeocoderApi.lookup(q, props.access_token, options)
|
|
67
|
+
.then(function (res) {
|
|
68
|
+
setFeatures(res);
|
|
69
|
+
if (res.length > 0)
|
|
70
|
+
setSelectedIndex(0);
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
//
|
|
74
|
+
// Debounce calls to lookup by 350ms.
|
|
75
|
+
//
|
|
76
|
+
var lookupDebounced = function (q) {
|
|
77
|
+
if (timer != null) {
|
|
78
|
+
window.clearTimeout(timer);
|
|
79
|
+
setTimer(null);
|
|
80
|
+
}
|
|
81
|
+
setTimer(window.setTimeout(function () { return lookup(q); }, 350));
|
|
82
|
+
};
|
|
83
|
+
//
|
|
84
|
+
// Handle document-wide mousedown event by closing the list.
|
|
85
|
+
//
|
|
86
|
+
var handleClickOutside = function () {
|
|
87
|
+
var elem = event.target;
|
|
88
|
+
if (wrapperRef && !wrapperRef.current.contains(elem)) {
|
|
89
|
+
clear();
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
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
|
+
setQ(newq);
|
|
100
|
+
lookupDebounced(newq);
|
|
101
|
+
};
|
|
102
|
+
var handleClick = function (feature) {
|
|
103
|
+
if (feature.properties.bbox) {
|
|
104
|
+
map.fitBounds(feature.properties.bbox);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
map.flyTo({
|
|
108
|
+
center: { lng: feature.properties.coordinates.longitude, lat: feature.properties.coordinates.latitude },
|
|
109
|
+
zoom: props.pointZoom
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
clear();
|
|
113
|
+
};
|
|
114
|
+
var handleKeyDown = function (e) {
|
|
115
|
+
switch (e.code) {
|
|
116
|
+
case 'ArrowDown':
|
|
117
|
+
case 'Numpad2':
|
|
118
|
+
e.preventDefault();
|
|
119
|
+
setSelectedIndex(Math.min(selectedIndex + 1, features.length - 1));
|
|
120
|
+
break;
|
|
121
|
+
case 'ArrowUp':
|
|
122
|
+
case 'Numpad8':
|
|
123
|
+
e.preventDefault();
|
|
124
|
+
setSelectedIndex(Math.max(selectedIndex - 1, 0));
|
|
125
|
+
break;
|
|
126
|
+
case 'Enter':
|
|
127
|
+
case 'NumpadEnter':
|
|
128
|
+
e.preventDefault();
|
|
129
|
+
handleClick(features[selectedIndex]);
|
|
130
|
+
break;
|
|
131
|
+
case 'Escape':
|
|
132
|
+
e.preventDefault();
|
|
133
|
+
clear();
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
React.useEffect(function () {
|
|
138
|
+
// Listen for document-wide mousedown event when control mounts.
|
|
139
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
140
|
+
// Clean up document-wide mousedown event when control unmounts.
|
|
141
|
+
return function () {
|
|
142
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
143
|
+
};
|
|
144
|
+
});
|
|
145
|
+
return (React.createElement(MapControl, { x: props.x, y: props.y },
|
|
146
|
+
React.createElement("div", { className: props.className, onKeyDown: function (e) { return handleKeyDown(e); }, ref: wrapperRef },
|
|
147
|
+
React.createElement(GeocoderSelector, { placeholder: props.placeholder, searchIcon: props.searchIcon, value: q, onChange: handleChange }),
|
|
148
|
+
React.createElement(GeocoderList, null, features.map(function (f, idx) {
|
|
149
|
+
return React.createElement(GeocoderEntry, { key: idx, feature: f, selected: idx == selectedIndex, onClick: function () { return handleClick(f); } });
|
|
150
|
+
})))));
|
|
151
|
+
};
|
|
152
|
+
var GeocoderStyled = styled(GeocoderBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: ", "px;\n pointer-events: all !important;\n"], ["\n width: ", "px;\n pointer-events: all !important;\n"
|
|
153
|
+
/**
|
|
154
|
+
* The `Geocoder` control displays an input box. Typing into it sends requests
|
|
155
|
+
* to Mapbox for geocoding (with a debounce), and a list of matches appears.
|
|
156
|
+
* Clicking a match has the map fly to the selection location. The control
|
|
157
|
+
* must be provided with a map `access_token` to work.
|
|
158
|
+
*
|
|
159
|
+
* The input box can be placed using the `x` and `y` props.
|
|
160
|
+
*
|
|
161
|
+
* Mapbox geocoding playground: https://docs.mapbox.com/playground/geocoding/
|
|
162
|
+
*/
|
|
163
|
+
])), function (p) { return p.width; });
|
|
164
|
+
/**
|
|
165
|
+
* The `Geocoder` control displays an input box. Typing into it sends requests
|
|
166
|
+
* to Mapbox for geocoding (with a debounce), and a list of matches appears.
|
|
167
|
+
* Clicking a match has the map fly to the selection location. The control
|
|
168
|
+
* must be provided with a map `access_token` to work.
|
|
169
|
+
*
|
|
170
|
+
* The input box can be placed using the `x` and `y` props.
|
|
171
|
+
*
|
|
172
|
+
* Mapbox geocoding playground: https://docs.mapbox.com/playground/geocoding/
|
|
173
|
+
*/
|
|
174
|
+
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));
|
|
177
|
+
};
|
|
178
|
+
export { Geocoder };
|
|
179
|
+
var templateObject_1;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** @module @ignore */
|
|
2
|
+
interface IGeocoderFeature {
|
|
3
|
+
type: string;
|
|
4
|
+
id: string;
|
|
5
|
+
geometry: {
|
|
6
|
+
type: string;
|
|
7
|
+
coordinates: number[];
|
|
8
|
+
};
|
|
9
|
+
properties: {
|
|
10
|
+
mapbox_id: string;
|
|
11
|
+
feature_type: string;
|
|
12
|
+
full_address: string;
|
|
13
|
+
name: string;
|
|
14
|
+
name_preferred: string;
|
|
15
|
+
coordinates: {
|
|
16
|
+
longitude: number;
|
|
17
|
+
latitude: number;
|
|
18
|
+
};
|
|
19
|
+
place_formatted: string;
|
|
20
|
+
bbox: [number, number, number, number];
|
|
21
|
+
context: {
|
|
22
|
+
postcode: {
|
|
23
|
+
mapbox_id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
};
|
|
26
|
+
place: {
|
|
27
|
+
mapbox_id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
wikidate_id: string;
|
|
30
|
+
};
|
|
31
|
+
region: {
|
|
32
|
+
mapbox_id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
wikidate_id: string;
|
|
35
|
+
region_code: string;
|
|
36
|
+
region_code_full: string;
|
|
37
|
+
};
|
|
38
|
+
country: {
|
|
39
|
+
mapbox_id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
wikidata_id: string;
|
|
42
|
+
country_code: string;
|
|
43
|
+
country_code_alpha_3: string;
|
|
44
|
+
};
|
|
45
|
+
neighborhood: {
|
|
46
|
+
mapbox_id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
interface IGeocoderOptions {
|
|
53
|
+
proximityIP?: boolean;
|
|
54
|
+
country?: string;
|
|
55
|
+
}
|
|
56
|
+
declare class GeocoderApi {
|
|
57
|
+
static lookup(q: string, mapkey: string, options: IGeocoderOptions): Promise<IGeocoderFeature[]>;
|
|
58
|
+
}
|
|
59
|
+
export { GeocoderApi, IGeocoderFeature };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var GeocoderApi = /** @class */ (function () {
|
|
38
|
+
function GeocoderApi() {
|
|
39
|
+
}
|
|
40
|
+
GeocoderApi.lookup = function (q, mapkey, options) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
42
|
+
var url, res, json;
|
|
43
|
+
return __generator(this, function (_a) {
|
|
44
|
+
switch (_a.label) {
|
|
45
|
+
case 0:
|
|
46
|
+
url = new URL("https://api.mapbox.com/search/geocode/v6/forward");
|
|
47
|
+
url.searchParams.append("q", q);
|
|
48
|
+
url.searchParams.append("access_token", mapkey);
|
|
49
|
+
if (options.country)
|
|
50
|
+
url.searchParams.append("country", options.country);
|
|
51
|
+
if (options.proximityIP)
|
|
52
|
+
url.searchParams.append("proximity", "ip");
|
|
53
|
+
return [4 /*yield*/, fetch(url, {
|
|
54
|
+
method: 'GET',
|
|
55
|
+
})];
|
|
56
|
+
case 1:
|
|
57
|
+
res = _a.sent();
|
|
58
|
+
return [4 /*yield*/, res.json()];
|
|
59
|
+
case 2:
|
|
60
|
+
json = _a.sent();
|
|
61
|
+
return [2 /*return*/, json.features];
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
return GeocoderApi;
|
|
67
|
+
}());
|
|
68
|
+
export { GeocoderApi };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @module @ignore */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { IGeocoderFeature } from './GeocoderApi';
|
|
4
|
+
interface IProps {
|
|
5
|
+
/** @ignore */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** Feature to show in this entry. */
|
|
8
|
+
feature: IGeocoderFeature;
|
|
9
|
+
/** Fired when entry is clicked. */
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
/** Is entry currently keyboard-selected? */
|
|
12
|
+
selected?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const GeocoderEntry: (props: IProps) => React.JSX.Element;
|
|
15
|
+
export { GeocoderEntry };
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
/** @module @ignore */
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { ListRow } from '../../../containers/List';
|
|
9
|
+
var GeocoderEntry = function (props) {
|
|
10
|
+
return React.createElement(ListRow, { onClick: props.onClick, active: props.selected },
|
|
11
|
+
React.createElement("div", { style: { width: '100%' } },
|
|
12
|
+
React.createElement(ResultText, null, props.feature.properties.name_preferred),
|
|
13
|
+
React.createElement(ResultPlace, null, props.feature.properties.full_address)));
|
|
14
|
+
};
|
|
15
|
+
var ResultText = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n user-select: none;\n font: ", ";\n"], ["\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n user-select: none;\n font: ", ";\n"])), function (p) { return p.theme.font.bodyMedium; });
|
|
16
|
+
var ResultPlace = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n user-select: none;\n font: ", ";\n"], ["\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n user-select: none;\n font: ", ";\n"])), function (p) { return p.theme.font.bodySmall; });
|
|
17
|
+
export { GeocoderEntry };
|
|
18
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @module @ignore */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface IProps {
|
|
4
|
+
/** @ignore */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** @ignore */
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
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
|
+
export { GeocoderList };
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
/** @module @ignore */
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { List } from '../../../containers/List';
|
|
9
|
+
/**
|
|
10
|
+
* Animated list of fixed-height items.
|
|
11
|
+
*/
|
|
12
|
+
var GeocoderListBase = function (props) {
|
|
13
|
+
return React.createElement("div", { className: props.className },
|
|
14
|
+
React.createElement(List, { tall: true, maxItems: 5, contract: true }, props.children));
|
|
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"])));
|
|
17
|
+
export { GeocoderList };
|
|
18
|
+
var templateObject_1;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @module @ignore */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface IProps {
|
|
4
|
+
/** @ignore */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Current value of input. */
|
|
7
|
+
value: string;
|
|
8
|
+
/** Show a static search icon? */
|
|
9
|
+
searchIcon: boolean;
|
|
10
|
+
/** Placeholder. */
|
|
11
|
+
placeholder: string;
|
|
12
|
+
/** Fired when input value changes. */
|
|
13
|
+
onChange: (q: string) => void;
|
|
14
|
+
}
|
|
15
|
+
declare const GeocoderSelector: 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>>;
|
|
16
|
+
export { GeocoderSelector };
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
/** @module @ignore */
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import styled, { useTheme } from 'styled-components';
|
|
8
|
+
import { Icon } from '../../../controls/Icon';
|
|
9
|
+
import { SVG } from '../../../svg';
|
|
10
|
+
var GeocoderSelectorBase = function (props) {
|
|
11
|
+
var theme = useTheme();
|
|
12
|
+
//
|
|
13
|
+
// Receive value from ChangeEvent and send it on.
|
|
14
|
+
//
|
|
15
|
+
var handleChange = function (e) {
|
|
16
|
+
props.onChange(e.target.value);
|
|
17
|
+
};
|
|
18
|
+
return (React.createElement("div", { className: props.className },
|
|
19
|
+
props.searchIcon &&
|
|
20
|
+
React.createElement(Icon, { url: SVG.Icons.Search, color: theme.colors.neutral[50] }),
|
|
21
|
+
React.createElement("input", { placeholder: props.placeholder, value: props.value, onChange: handleChange })));
|
|
22
|
+
};
|
|
23
|
+
var GeocoderSelector = styled(GeocoderSelectorBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n height: 34px;\n padding-left: 8px;\n padding-right: 8px;\n\n // Content: \n display: flex;\n align-items: center;\n gap: 4px;\n\n // Appearance:\n background-color: ", ";\n box-sizing: border-box;\n border-radius: ", "px;\n border: none;\n\n // Hover:\n &:hover {\n outline: solid 2px ", ";\n }\n\n // Focus:\n :focus-within > & {\n outline: solid 2px ", ";\n &::placeholder {\n color: rgb(from ", " r g b / 30%);\n }\n }\n \n input {\n width: 100%;\n box-sizing: border-box;\n z-index: 0;\n text-align: left;\n border: none;\n outline: none;\n background-color: transparent;\n color: ", ";\n \n // Define colors for placeholder text.\n &::placeholder {\n color: rgb(from ", " r g b / 50%);\n opacity: 1 !important; /* Firefox applies opacity */\n }\n\n // Define colors for selected text.\n &::selection {\n background-color: ", ";\n color: ", ";\n }\n\n /* Define colors for selected text. */\n &::selection {\n background-color: rgba(100,100,100,.4);\n color: ", ";\n }\n\n /* Make sure HTML5 validation does not show up. */\n &:valid {\n box-shadow: none;\n }\n &:invalid {\n box-shadow: none;\n }\n\n /* Turn off number spinners. */\n &[type=number]::-webkit-inner-spin-button, \n &[type=number]::-webkit-outer-spin-button { \n -webkit-appearance: none; /* Webkit (Chrome) */\n margin: 0; \n } \n &[type=number] {\n -moz-appearance: textfield; /* Firefox */\n appearance: textfield;\n }\n }\n"], ["\n position: relative;\n height: 34px;\n padding-left: 8px;\n padding-right: 8px;\n\n // Content: \n display: flex;\n align-items: center;\n gap: 4px;\n\n // Appearance:\n background-color: ", ";\n box-sizing: border-box;\n border-radius: ", "px;\n border: none;\n\n // Hover:\n &:hover {\n outline: solid 2px ", ";\n }\n\n // Focus:\n :focus-within > & {\n outline: solid 2px ", ";\n &::placeholder {\n color: rgb(from ", " r g b / 30%);\n }\n }\n \n input {\n width: 100%;\n box-sizing: border-box;\n z-index: 0;\n text-align: left;\n border: none;\n outline: none;\n background-color: transparent;\n color: ", ";\n \n // Define colors for placeholder text.\n &::placeholder {\n color: rgb(from ", " r g b / 50%);\n opacity: 1 !important; /* Firefox applies opacity */\n }\n\n // Define colors for selected text.\n &::selection {\n background-color: ", ";\n color: ", ";\n }\n\n /* Define colors for selected text. */\n &::selection {\n background-color: rgba(100,100,100,.4);\n color: ", ";\n }\n\n /* Make sure HTML5 validation does not show up. */\n &:valid {\n box-shadow: none;\n }\n &:invalid {\n box-shadow: none;\n }\n\n /* Turn off number spinners. */\n &[type=number]::-webkit-inner-spin-button, \n &[type=number]::-webkit-outer-spin-button { \n -webkit-appearance: none; /* Webkit (Chrome) */\n margin: 0; \n } \n &[type=number] {\n -moz-appearance: textfield; /* Firefox */\n appearance: textfield;\n }\n }\n"])), function (p) { return p.theme.colors.neutral[100]; }, function (p) { return p.theme.radius.normal; }, function (p) { return p.theme.colors.primary[2]; }, function (p) { return p.theme.colors.primary[1]; }, function (p) { return p.theme.colors.primary[3]; }, function (p) { return p.theme.colors.primary[3]; }, function (p) { return p.theme.colors.primary[3]; }, function (p) { return p.theme.colors.primary[2]; }, function (p) { return p.theme.colors.neutral[100]; }, function (p) { return p.theme.fontColor; });
|
|
24
|
+
export { GeocoderSelector };
|
|
25
|
+
var templateObject_1;
|