@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,54 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import * as React from 'react';
|
|
13
|
+
/**
|
|
14
|
+
* Filesize takes a `value` prop (in bytes) and renders a human-readable filesize
|
|
15
|
+
* string. If provided with a string, `Filesize` will convert it to a number
|
|
16
|
+
* first.
|
|
17
|
+
*
|
|
18
|
+
* E.g. `10000` => `10.0 kB`
|
|
19
|
+
*
|
|
20
|
+
* The `unit` type can optionally be specified, either `si` (International
|
|
21
|
+
* System of Units, where 1 kilobyte is 1,000 byes), or `binary (where 1
|
|
22
|
+
* kilobyte equals 1,024 bytes).
|
|
23
|
+
*
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <Filesize value={10000} unit='binary'/>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
var Filesize = function (_a) {
|
|
29
|
+
var _b = _a.unit, unit = _b === void 0 ? "si" : _b, props = __rest(_a, ["unit"]);
|
|
30
|
+
/**
|
|
31
|
+
* Convert bytes to size string (kB, MB, GB etc.)
|
|
32
|
+
*/
|
|
33
|
+
var humanFileSize = function (bytes, unit) {
|
|
34
|
+
var thresh = unit == 'si' ? 1000 : 1024;
|
|
35
|
+
if (Math.abs(bytes) < thresh) {
|
|
36
|
+
return bytes + ' B';
|
|
37
|
+
}
|
|
38
|
+
var units = unit == 'si'
|
|
39
|
+
? ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
|
40
|
+
: ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];
|
|
41
|
+
var u = -1;
|
|
42
|
+
do {
|
|
43
|
+
bytes /= thresh;
|
|
44
|
+
++u;
|
|
45
|
+
} while (Math.abs(bytes) >= thresh && u < units.length - 1);
|
|
46
|
+
return bytes.toFixed(2) + ' ' + units[u];
|
|
47
|
+
};
|
|
48
|
+
if (props.value == null)
|
|
49
|
+
return null;
|
|
50
|
+
// Make sure value is a number.
|
|
51
|
+
var val = (typeof props.value === 'string') ? parseFloat(props.value) : props.value;
|
|
52
|
+
return (React.createElement(React.Fragment, null, humanFileSize(val, unit)));
|
|
53
|
+
};
|
|
54
|
+
export { Filesize };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
/**
|
|
4
|
+
* Value to format.
|
|
5
|
+
*/
|
|
6
|
+
value: number | string;
|
|
7
|
+
/**
|
|
8
|
+
* String to show if formatting fails.
|
|
9
|
+
* @default "(no coordinates)"
|
|
10
|
+
*/
|
|
11
|
+
default?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Formats a fractional latitude value as degrees, minutes and seconds (as a string).
|
|
15
|
+
* If provided with a string, `Longitude` will convert it to a number first.
|
|
16
|
+
*
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <Latitude value={34.2216}/>
|
|
19
|
+
* <Latitude value={34.2216} default="Bad latitude"/>
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
declare const Latitude: (props: IProps) => React.JSX.Element;
|
|
23
|
+
export { Latitude, IProps as ILatitudeProps };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { toDMS } from "./toDMS";
|
|
3
|
+
/**
|
|
4
|
+
* Formats a fractional latitude value as degrees, minutes and seconds (as a string).
|
|
5
|
+
* If provided with a string, `Longitude` will convert it to a number first.
|
|
6
|
+
*
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <Latitude value={34.2216}/>
|
|
9
|
+
* <Latitude value={34.2216} default="Bad latitude"/>
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
var Latitude = function (props) { return React.createElement(React.Fragment, null, toDMS(props.value, props.default, 90, "N", "S")); };
|
|
13
|
+
export { Latitude };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
/**
|
|
4
|
+
* Value to format.
|
|
5
|
+
*/
|
|
6
|
+
value: number | string;
|
|
7
|
+
/**
|
|
8
|
+
* String to show if formatting fails.
|
|
9
|
+
* @default "(no coordinates)"
|
|
10
|
+
*/
|
|
11
|
+
default?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Formats a fractional longitude value as degrees, minutes and seconds (as a string).
|
|
15
|
+
* If provided with a string, `Longitude` will convert it to a number first.
|
|
16
|
+
*
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <Longitude value={34.2216}/>
|
|
19
|
+
* <Longitude value={34.2216} default="Bad longitude"/>
|
|
20
|
+
* ```*
|
|
21
|
+
*/
|
|
22
|
+
declare const Longitude: (props: IProps) => React.JSX.Element;
|
|
23
|
+
export { Longitude, IProps as ILongitudeProps };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { toDMS } from "./toDMS";
|
|
3
|
+
/**
|
|
4
|
+
* Formats a fractional longitude value as degrees, minutes and seconds (as a string).
|
|
5
|
+
* If provided with a string, `Longitude` will convert it to a number first.
|
|
6
|
+
*
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <Longitude value={34.2216}/>
|
|
9
|
+
* <Longitude value={34.2216} default="Bad longitude"/>
|
|
10
|
+
* ```*
|
|
11
|
+
*/
|
|
12
|
+
var Longitude = function (props) { return React.createElement(React.Fragment, null, toDMS(props.value, props.default, 180, "E", "W")); };
|
|
13
|
+
export { Longitude };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DMS } from '../../helper/DMS';
|
|
2
|
+
function toDMS(value, defaultStr, max, positive, negative) {
|
|
3
|
+
// Convert value to number if it is a string:
|
|
4
|
+
value = typeof value == 'number' ? value : parseFloat(value);
|
|
5
|
+
if (isNaN(value) || value < -max || value > max)
|
|
6
|
+
return defaultStr ? defaultStr : "(no coordinates)";
|
|
7
|
+
var _a = DMS.toDMS(value), d = _a[0], m = _a[1], s = _a[2];
|
|
8
|
+
var ms = m.toString();
|
|
9
|
+
if (ms.length < 2)
|
|
10
|
+
ms = "0" + ms;
|
|
11
|
+
var ss = s.toFixed(0);
|
|
12
|
+
if (ss.length < 2)
|
|
13
|
+
ss = "0" + ss;
|
|
14
|
+
return "".concat(d, "\u00B0 ").concat(ms, "\u2032 ").concat(ss, "\u2033 ").concat(d >= 0 ? positive : negative);
|
|
15
|
+
}
|
|
16
|
+
export { toDMS };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
/** @ignore */
|
|
4
|
+
className?: string;
|
|
5
|
+
value: string;
|
|
6
|
+
/**
|
|
7
|
+
* String to search for. Only the first occurrence is highlighted.
|
|
8
|
+
* Matching is case-insensitive.
|
|
9
|
+
*/
|
|
10
|
+
q: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Given an input string and a search query, `Highlight` highlights the first
|
|
14
|
+
* occurrence (if any) of the search query and returns a styled string (as a
|
|
15
|
+
* `ReactNode`). String matching is case-insensitive.
|
|
16
|
+
*
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <Highlight value="Hello, world" q="hello"/>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare const Highlight: (props: IProps) => string | React.JSX.Element;
|
|
22
|
+
export { Highlight };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useTheme } from 'styled-components';
|
|
3
|
+
/**
|
|
4
|
+
* Given an input string and a search query, `Highlight` highlights the first
|
|
5
|
+
* occurrence (if any) of the search query and returns a styled string (as a
|
|
6
|
+
* `ReactNode`). String matching is case-insensitive.
|
|
7
|
+
*
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <Highlight value="Hello, world" q="hello"/>
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
var Highlight = function (props) {
|
|
13
|
+
var theme = useTheme();
|
|
14
|
+
// Is there a search string? If not, do not highlight.
|
|
15
|
+
if (!props.q)
|
|
16
|
+
return props.value;
|
|
17
|
+
if (!props.value)
|
|
18
|
+
return props.value;
|
|
19
|
+
// Does q occur inside input string? If not, do not highlight.
|
|
20
|
+
var pos = props.value.toLowerCase().indexOf(props.q.toLowerCase());
|
|
21
|
+
if (pos == -1)
|
|
22
|
+
return props.value;
|
|
23
|
+
// Styling is done with inline styles so as not to generate too many styled-components classes.
|
|
24
|
+
var left = props.value.substring(0, pos);
|
|
25
|
+
var match = props.value.substring(pos, pos + props.q.length);
|
|
26
|
+
var right = props.value.substring(pos + props.q.length);
|
|
27
|
+
return React.createElement(React.Fragment, null,
|
|
28
|
+
left,
|
|
29
|
+
React.createElement("span", { style: { backgroundColor: theme.colors.accent } }, match),
|
|
30
|
+
right);
|
|
31
|
+
};
|
|
32
|
+
export { Highlight };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Highlight } from './Highlight';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Highlight } from './Highlight';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
/**
|
|
4
|
+
* Input value
|
|
5
|
+
*/
|
|
6
|
+
value: number | string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* `Human` takes a `value` prop and formats it in a human-readable way.
|
|
10
|
+
*
|
|
11
|
+
* E.g. `10000` => `10K`
|
|
12
|
+
*
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <Human value={150000}/>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
declare const Human: (props: IProps) => React.JSX.Element;
|
|
18
|
+
export { Human, IProps };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* `Human` takes a `value` prop and formats it in a human-readable way.
|
|
4
|
+
*
|
|
5
|
+
* E.g. `10000` => `10K`
|
|
6
|
+
*
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <Human value={150000}/>
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
var Human = function (props) {
|
|
12
|
+
/**
|
|
13
|
+
* Convert number to size string (K, M, G etc.)
|
|
14
|
+
*/
|
|
15
|
+
var humanSize = function (value) {
|
|
16
|
+
var thresh = 1000;
|
|
17
|
+
if (Math.abs(value) < thresh) {
|
|
18
|
+
return value.toFixed(0);
|
|
19
|
+
}
|
|
20
|
+
var units = ['K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
|
|
21
|
+
var u = -1;
|
|
22
|
+
do {
|
|
23
|
+
value /= thresh;
|
|
24
|
+
++u;
|
|
25
|
+
} while (Math.abs(value) >= thresh && u < units.length - 1);
|
|
26
|
+
return (+value).toFixed(2) + units[u];
|
|
27
|
+
};
|
|
28
|
+
if (props.value == null)
|
|
29
|
+
return null;
|
|
30
|
+
// Make sure value is a number.
|
|
31
|
+
var val = (typeof props.value === 'string') ? parseFloat(props.value) : props.value;
|
|
32
|
+
return React.createElement(React.Fragment, null, humanSize(val));
|
|
33
|
+
};
|
|
34
|
+
export { Human };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Human';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Human';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
/**
|
|
4
|
+
* Value to format. This can be a string or a number.
|
|
5
|
+
*/
|
|
6
|
+
value: number | string;
|
|
7
|
+
/**
|
|
8
|
+
* Number of fractional digits.
|
|
9
|
+
* @default 2
|
|
10
|
+
*/
|
|
11
|
+
decimals?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* `Number` formats a number with thousands separators and optional
|
|
15
|
+
* fractional digits. If provided with a string, `Number` will convert
|
|
16
|
+
* it to a float first. By default, two decimals are printed.
|
|
17
|
+
*
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <Number value={35100.20}/>
|
|
20
|
+
* <Number value={35100.20} decimals={0}/>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
declare const Number: ({ decimals, ...props }: IProps) => React.JSX.Element;
|
|
24
|
+
export { Number, IProps };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import * as React from 'react';
|
|
13
|
+
/**
|
|
14
|
+
* `Number` formats a number with thousands separators and optional
|
|
15
|
+
* fractional digits. If provided with a string, `Number` will convert
|
|
16
|
+
* it to a float first. By default, two decimals are printed.
|
|
17
|
+
*
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <Number value={35100.20}/>
|
|
20
|
+
* <Number value={35100.20} decimals={0}/>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
var Number = function (_a) {
|
|
24
|
+
var _b = _a.decimals, decimals = _b === void 0 ? 2 : _b, props = __rest(_a, ["decimals"]);
|
|
25
|
+
if (props.value == null)
|
|
26
|
+
return null;
|
|
27
|
+
// Make sure value is a number.
|
|
28
|
+
var val = (typeof props.value === 'string') ? parseFloat(props.value) : props.value;
|
|
29
|
+
// Format number with requested fraction digits:
|
|
30
|
+
return React.createElement(React.Fragment, null, val.toLocaleString(undefined, {
|
|
31
|
+
useGrouping: true,
|
|
32
|
+
minimumFractionDigits: decimals,
|
|
33
|
+
maximumFractionDigits: decimals
|
|
34
|
+
}));
|
|
35
|
+
};
|
|
36
|
+
export { Number };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Number';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Number';
|
package/helper/DMS.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Degrees-Minutes-Seconds conversion helpers.
|
|
3
|
+
*/
|
|
4
|
+
declare class DMS {
|
|
5
|
+
/**
|
|
6
|
+
* Convert a decimal latitude or longitude value to degrees,
|
|
7
|
+
* minutes, and seconds.
|
|
8
|
+
*
|
|
9
|
+
* @param value Value to convert
|
|
10
|
+
* @returns An array with degrees, minutes, seconds.
|
|
11
|
+
*/
|
|
12
|
+
static toDMS: (value: number) => number[];
|
|
13
|
+
/**
|
|
14
|
+
* Convert degrees, minutes and seconds to a float value.
|
|
15
|
+
* @param d Degrees
|
|
16
|
+
* @param m Minutes
|
|
17
|
+
* @param s Seconds
|
|
18
|
+
* @returns Float representation
|
|
19
|
+
*/
|
|
20
|
+
static toFloat: (d: number, m: number, s: number) => number;
|
|
21
|
+
}
|
|
22
|
+
export { DMS };
|
package/helper/DMS.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Degrees-Minutes-Seconds conversion helpers.
|
|
3
|
+
*/
|
|
4
|
+
var DMS = /** @class */ (function () {
|
|
5
|
+
function DMS() {
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Convert a decimal latitude or longitude value to degrees,
|
|
9
|
+
* minutes, and seconds.
|
|
10
|
+
*
|
|
11
|
+
* @param value Value to convert
|
|
12
|
+
* @returns An array with degrees, minutes, seconds.
|
|
13
|
+
*/
|
|
14
|
+
DMS.toDMS = function (value) {
|
|
15
|
+
value = parseFloat(value);
|
|
16
|
+
if (isNaN(value))
|
|
17
|
+
value = 0;
|
|
18
|
+
value = Math.abs(value);
|
|
19
|
+
var degrees = Math.trunc(value);
|
|
20
|
+
var seconds = (value - degrees) * 3600;
|
|
21
|
+
// Seconds are multiplied by 10,000, rounded, then divided again to avoid float errors.
|
|
22
|
+
var minutes = Math.trunc(Math.round((seconds / 60) * 10000) / 10000);
|
|
23
|
+
seconds = Math.round(seconds) % 60;
|
|
24
|
+
return [degrees, minutes, seconds];
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Convert degrees, minutes and seconds to a float value.
|
|
28
|
+
* @param d Degrees
|
|
29
|
+
* @param m Minutes
|
|
30
|
+
* @param s Seconds
|
|
31
|
+
* @returns Float representation
|
|
32
|
+
*/
|
|
33
|
+
DMS.toFloat = function (d, m, s) {
|
|
34
|
+
if (m < 0)
|
|
35
|
+
m = 0;
|
|
36
|
+
if (m > 59)
|
|
37
|
+
m = 59;
|
|
38
|
+
if (s < 0)
|
|
39
|
+
s = 0;
|
|
40
|
+
if (s > 59)
|
|
41
|
+
s = 59;
|
|
42
|
+
return d + m / 60 + s / 3600;
|
|
43
|
+
};
|
|
44
|
+
return DMS;
|
|
45
|
+
}());
|
|
46
|
+
export { DMS };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RgbColor } from './RgbColor';
|
|
2
|
+
declare class HslColor {
|
|
3
|
+
hue: number;
|
|
4
|
+
saturation: number;
|
|
5
|
+
lightness: number;
|
|
6
|
+
alpha: number;
|
|
7
|
+
constructor(hue: number, saturation: number, lightness: number, alpha?: number);
|
|
8
|
+
static FromRgb(color: RgbColor): HslColor;
|
|
9
|
+
toString(): string;
|
|
10
|
+
}
|
|
11
|
+
export { HslColor };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var HslColor = /** @class */ (function () {
|
|
2
|
+
function HslColor(hue, saturation, lightness, alpha) {
|
|
3
|
+
this.hue = hue;
|
|
4
|
+
this.saturation = saturation;
|
|
5
|
+
this.lightness = lightness;
|
|
6
|
+
this.alpha = alpha || 1;
|
|
7
|
+
}
|
|
8
|
+
HslColor.FromRgb = function (color) {
|
|
9
|
+
var red = color.red / 255;
|
|
10
|
+
var green = color.green / 255;
|
|
11
|
+
var blue = color.blue / 255;
|
|
12
|
+
var max = Math.max(red, green, blue);
|
|
13
|
+
var min = Math.min(red, green, blue);
|
|
14
|
+
var lightness = (max + min) / 2;
|
|
15
|
+
if (max === min) {
|
|
16
|
+
// achromatic
|
|
17
|
+
return new HslColor(0, 0, lightness, color.alpha);
|
|
18
|
+
}
|
|
19
|
+
var hue;
|
|
20
|
+
var delta = max - min;
|
|
21
|
+
var saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);
|
|
22
|
+
switch (max) {
|
|
23
|
+
case red:
|
|
24
|
+
hue = (green - blue) / delta + (green < blue ? 6 : 0);
|
|
25
|
+
break;
|
|
26
|
+
case green:
|
|
27
|
+
hue = (blue - red) / delta + 2;
|
|
28
|
+
break;
|
|
29
|
+
default:
|
|
30
|
+
// blue case
|
|
31
|
+
hue = (red - green) / delta + 4;
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
hue *= 60;
|
|
35
|
+
return new HslColor(hue, saturation, lightness, color.alpha);
|
|
36
|
+
};
|
|
37
|
+
HslColor.prototype.toString = function () {
|
|
38
|
+
if (this.alpha === 1) {
|
|
39
|
+
return "hsl(".concat(this.hue, ", ").concat(Math.round(this.saturation * 100), "%, ").concat(Math.round(this.lightness * 100), "%)");
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
return "hsla(".concat(this.hue, ", ").concat(Math.round(this.saturation * 100), "%, ").concat(Math.round(this.lightness * 100), "%, ").concat(this.alpha, ")");
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
return HslColor;
|
|
46
|
+
}());
|
|
47
|
+
export { HslColor };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { HslColor } from './HslColor';
|
|
2
|
+
/**
|
|
3
|
+
* `RgbColor` encapsulates an RGB color, optionally with an alpha component.
|
|
4
|
+
* It offers parsing from and to a HTML color string.
|
|
5
|
+
*/
|
|
6
|
+
declare class RgbColor {
|
|
7
|
+
red: number;
|
|
8
|
+
blue: number;
|
|
9
|
+
green: number;
|
|
10
|
+
alpha: number;
|
|
11
|
+
/** Construct an RgbColor instance.
|
|
12
|
+
* If alpha is not provided, it is assumed to be 1 (opaque).
|
|
13
|
+
*/
|
|
14
|
+
constructor(red: number, green: number, blue: number, alpha?: number);
|
|
15
|
+
/** Parses a color string into an RgbColor instance.
|
|
16
|
+
* Color strings may be:
|
|
17
|
+
*
|
|
18
|
+
* SteelBlue (and friends)
|
|
19
|
+
* #RRGGBB
|
|
20
|
+
* #RRGGBBAA
|
|
21
|
+
* #RGB
|
|
22
|
+
* #RGBA
|
|
23
|
+
* rgb(r,g,b)
|
|
24
|
+
* rgba(r,g,b,a)
|
|
25
|
+
* hsl(h,s,l)
|
|
26
|
+
* hsla(h,s,l,a)
|
|
27
|
+
*/
|
|
28
|
+
static FromString(color: string): RgbColor;
|
|
29
|
+
/**
|
|
30
|
+
* Convert a HslColor instance to an RgbColor instance.
|
|
31
|
+
*/
|
|
32
|
+
static FromHsl(color: HslColor): RgbColor;
|
|
33
|
+
private toHex;
|
|
34
|
+
/**
|
|
35
|
+
* Reduces hex values if possible e.g. #ff8866 to #f86
|
|
36
|
+
*/
|
|
37
|
+
private reduceHexValue;
|
|
38
|
+
/**
|
|
39
|
+
* Return string representation of this RgbColor instance.
|
|
40
|
+
*/
|
|
41
|
+
toString(): string;
|
|
42
|
+
}
|
|
43
|
+
export { RgbColor };
|