@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,105 @@
|
|
|
1
|
+
interface IListViewProps {
|
|
2
|
+
/**
|
|
3
|
+
* Array of data to show in the table
|
|
4
|
+
*/
|
|
5
|
+
data: any[];
|
|
6
|
+
/**
|
|
7
|
+
* Does this `ListView` use the `dark` style?
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
10
|
+
dark?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* If set, rows will have a hover effect.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
hover?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* If set, rows will be striped.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
striped?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* If set, a grid is drawn.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
grid?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Active record, if any. This record will be highlighted. If an `infoBox`
|
|
28
|
+
* is set, it will be shown by the active record, but not shown when there
|
|
29
|
+
* is no active record.
|
|
30
|
+
*/
|
|
31
|
+
active?: any;
|
|
32
|
+
/**
|
|
33
|
+
* If set, show a total at the bottom of the table.
|
|
34
|
+
*/
|
|
35
|
+
total?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Singular unit used in total, e.g. "user". Also see `plural`.
|
|
38
|
+
*/
|
|
39
|
+
singular?: React.ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* Plural unit used in total, e.g. "users". Also see `singular`.
|
|
42
|
+
*/
|
|
43
|
+
plural?: React.ReactNode;
|
|
44
|
+
/**
|
|
45
|
+
* If a component is provided, then it is shown next to the active item,
|
|
46
|
+
* and will scroll with the table (but not leave the screen). If the active
|
|
47
|
+
* item is null, then the aux component is not shown.
|
|
48
|
+
*/
|
|
49
|
+
aux?: React.ReactElement<{
|
|
50
|
+
value: any;
|
|
51
|
+
}>;
|
|
52
|
+
/**
|
|
53
|
+
* Component to show when there is no data (`data` is `null` or `data` is `[]`).
|
|
54
|
+
* The component is placed under the header, and the component is responsable
|
|
55
|
+
* for any styling.
|
|
56
|
+
* If not set, a default component is shown.
|
|
57
|
+
* If set to `false`, no component is shown at all.
|
|
58
|
+
*/
|
|
59
|
+
noData?: React.ReactNode | false;
|
|
60
|
+
/**
|
|
61
|
+
* If set, `narrow` mode is active and columns will be vertically oriented.
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
64
|
+
narrow?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* If set, a small shadow shown is under the table header.
|
|
67
|
+
* @default false
|
|
68
|
+
*/
|
|
69
|
+
shadow?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* If set, `ListView` is in ghost mode.
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
74
|
+
ghost?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* If set, then the `ListView` allows editing of its columns.
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
79
|
+
columnsEditable?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Optionally provides a function that returns a decorative element for each row.
|
|
82
|
+
* @param item Row data
|
|
83
|
+
* The function must return a `ReactNode`. It is expected to use absolute positioning
|
|
84
|
+
* to place the decorator.
|
|
85
|
+
*/
|
|
86
|
+
decorator?: (item: any) => React.ReactNode;
|
|
87
|
+
/**
|
|
88
|
+
* Fired when a row is clicked.
|
|
89
|
+
* @param item Clicked item
|
|
90
|
+
*/
|
|
91
|
+
onClick?: (item: any) => void;
|
|
92
|
+
/**
|
|
93
|
+
* Fired when a row is double-clicked.
|
|
94
|
+
* @param item Clicked item
|
|
95
|
+
*/
|
|
96
|
+
onDoubleClick?: (item: any) => void;
|
|
97
|
+
/**
|
|
98
|
+
* If this callback is provided, items can be checked or unchecked. Items must have
|
|
99
|
+
* a key `checked` when they're checked. If `item` is true, then all items must be checked.
|
|
100
|
+
* If `item` is false, the all items must be unchecked.
|
|
101
|
+
* @param item Item to toggle.
|
|
102
|
+
*/
|
|
103
|
+
onCheck?: (idx: number | boolean) => void;
|
|
104
|
+
}
|
|
105
|
+
export { IListViewProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IColumnProps } from './Column';
|
|
3
|
+
import { IListViewProps } from './IListViewProps';
|
|
4
|
+
interface IProps extends IListViewProps {
|
|
5
|
+
/**
|
|
6
|
+
* Column specifications. These are a set of `Column` children,
|
|
7
|
+
* each of which set a column name, width, sort key and sort direction, and
|
|
8
|
+
* cell content alignment. The content of a Column is a function which
|
|
9
|
+
* is given a data row and returns formatted cell content.
|
|
10
|
+
*/
|
|
11
|
+
children?: React.ReactElement<IColumnProps> | React.ReactElement<IColumnProps>[];
|
|
12
|
+
}
|
|
13
|
+
declare const ListView: {
|
|
14
|
+
({ dark, hover, striped, grid, total, singular, plural, narrow, shadow, ghost, columnsEditable, ...props }: IProps): React.JSX.Element;
|
|
15
|
+
Column: {
|
|
16
|
+
(_: IColumnProps): null;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export { ListView };
|
|
@@ -0,0 +1,97 @@
|
|
|
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
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
24
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
25
|
+
if (ar || !(i in from)) {
|
|
26
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
27
|
+
ar[i] = from[i];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
31
|
+
};
|
|
32
|
+
import * as React from 'react';
|
|
33
|
+
import { Column } from './Column';
|
|
34
|
+
import { Table } from './Table';
|
|
35
|
+
import { sortItems } from './sortItems';
|
|
36
|
+
import { Ghost } from './Ghost';
|
|
37
|
+
var ListViewBase = function (props) {
|
|
38
|
+
var _a, _b;
|
|
39
|
+
var children = props.children, otherProps = __rest(props, ["children"]);
|
|
40
|
+
var _c = React.useState(false), columnsMode = _c[0], setColumnsMode = _c[1];
|
|
41
|
+
var originalColumns = React.Children.toArray(children).map(function (c) {
|
|
42
|
+
return c.props;
|
|
43
|
+
});
|
|
44
|
+
var _d = React.useState(originalColumns), columns = _d[0], setColumns = _d[1];
|
|
45
|
+
// Find default sort column:
|
|
46
|
+
var sortColumn = (_a = columns.find(function (c) { return c.defaultSort; })) !== null && _a !== void 0 ? _a : columns[0];
|
|
47
|
+
var _e = React.useState(sortColumn.sort), sort = _e[0], setSort = _e[1];
|
|
48
|
+
var _f = React.useState((_b = sortColumn.reverse) !== null && _b !== void 0 ? _b : false), reverse = _f[0], setReverse = _f[1];
|
|
49
|
+
var _g = React.useState(sortItems(props.data, sort, reverse)), data = _g[0], setData = _g[1];
|
|
50
|
+
React.useEffect(function () {
|
|
51
|
+
setData(sortItems(data, sort, reverse));
|
|
52
|
+
}, [props.data, sort, reverse]);
|
|
53
|
+
// Change sort:
|
|
54
|
+
var handleSort = function (column) {
|
|
55
|
+
var _a;
|
|
56
|
+
if (sort === column.sort) {
|
|
57
|
+
setReverse(!reverse);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
setSort(column.sort);
|
|
61
|
+
setReverse((_a = column.reverse) !== null && _a !== void 0 ? _a : false);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var handleCheck = function (index) {
|
|
65
|
+
if (!props.onCheck)
|
|
66
|
+
return;
|
|
67
|
+
var newData = data.map(function (d, idx) {
|
|
68
|
+
if (index === true)
|
|
69
|
+
return __assign(__assign({}, d), { checked: true });
|
|
70
|
+
if (index === false)
|
|
71
|
+
return __assign(__assign({}, d), { checked: false });
|
|
72
|
+
return __assign(__assign({}, d), { checked: index === idx ? !d.checked : !!d.checked });
|
|
73
|
+
});
|
|
74
|
+
setData(newData);
|
|
75
|
+
props.onCheck(index);
|
|
76
|
+
};
|
|
77
|
+
var handleColumns = function () {
|
|
78
|
+
setColumnsMode(true);
|
|
79
|
+
};
|
|
80
|
+
var handleChangeColumns = function (newColumns) {
|
|
81
|
+
setColumns(newColumns);
|
|
82
|
+
};
|
|
83
|
+
var handleResetColumns = function () {
|
|
84
|
+
setColumns(__spreadArray([], originalColumns, true));
|
|
85
|
+
};
|
|
86
|
+
if (props.ghost) {
|
|
87
|
+
return React.createElement(Ghost, __assign({}, otherProps, { columns: columns }));
|
|
88
|
+
}
|
|
89
|
+
return (React.createElement(Table, __assign({}, otherProps, { data: data, columns: columns, sort: sort, reverse: reverse, onSortClick: handleSort, columnsMode: columnsMode, onOpenColumns: handleColumns, onCheck: props.onCheck ? handleCheck : null, onChangeColumns: handleChangeColumns, onCloseColumns: function () { return setColumnsMode(false); }, onResetColumns: handleResetColumns })));
|
|
90
|
+
};
|
|
91
|
+
// Wrapper for default values:
|
|
92
|
+
var ListView = function (_a) {
|
|
93
|
+
var _b = _a.dark, dark = _b === void 0 ? false : _b, _c = _a.hover, hover = _c === void 0 ? false : _c, _d = _a.striped, striped = _d === void 0 ? false : _d, _e = _a.grid, grid = _e === void 0 ? false : _e, _f = _a.total, total = _f === void 0 ? false : _f, _g = _a.singular, singular = _g === void 0 ? "record" : _g, _h = _a.plural, plural = _h === void 0 ? "records" : _h, _j = _a.narrow, narrow = _j === void 0 ? false : _j, _k = _a.shadow, shadow = _k === void 0 ? false : _k, _l = _a.ghost, ghost = _l === void 0 ? false : _l, _m = _a.columnsEditable, columnsEditable = _m === void 0 ? false : _m, props = __rest(_a, ["dark", "hover", "striped", "grid", "total", "singular", "plural", "narrow", "shadow", "ghost", "columnsEditable"]);
|
|
94
|
+
return React.createElement(ListViewBase, __assign({ dark: dark, hover: hover, striped: striped, grid: grid, total: total, singular: singular, plural: plural, narrow: narrow, shadow: shadow, ghost: ghost, columnsEditable: columnsEditable }, props));
|
|
95
|
+
};
|
|
96
|
+
ListView.Column = Column;
|
|
97
|
+
export { ListView };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
/** @ignore */
|
|
4
|
+
className?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Component to show when there is no data (data is `null` or data is `[]`).
|
|
7
|
+
* The component is placed under the header, and the component is responsible
|
|
8
|
+
* for any styling.
|
|
9
|
+
* If not set, a default component is shown.
|
|
10
|
+
* If set to `false`, no component is shown at all.
|
|
11
|
+
*/
|
|
12
|
+
component: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Dark mode?
|
|
15
|
+
*/
|
|
16
|
+
dark?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const NoData: (props: IProps) => React.JSX.Element;
|
|
19
|
+
export { NoData, IProps };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
import * as React from 'react';
|
|
17
|
+
import styled from 'styled-components';
|
|
18
|
+
var NoDataBase = function (props) {
|
|
19
|
+
// Render nothing if component === false.
|
|
20
|
+
if (props.component === false)
|
|
21
|
+
return null;
|
|
22
|
+
return (React.createElement("div", { className: props.className },
|
|
23
|
+
props.component && props.component,
|
|
24
|
+
!props.component && React.createElement(DefaultMessage, null, "Your query returned no data. Your filter might be too restrictive.")));
|
|
25
|
+
};
|
|
26
|
+
var DefaultMessage = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n"], ["\n"])));
|
|
27
|
+
var NoDataStyled = styled(NoDataBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n top: 64px;\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: center;\n ", " {\n margin: 0 16px 0 16px;\n color: ", ";\n user-select: none;\n padding: 8px 16px 8px 16px;\n border-radius: ", "px;\n background: ", ";\n }\n"], ["\n position: absolute;\n top: 64px;\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: center;\n ", " {\n margin: 0 16px 0 16px;\n color: ", ";\n user-select: none;\n padding: 8px 16px 8px 16px;\n border-radius: ", "px;\n background: ", ";\n }\n"])), DefaultMessage, function (p) { return p.theme.colors.neutral[100]; }, function (p) { return p.theme.radius.normal; }, function (p) { return p.dark ? p.theme.colors.neutral[10] : p.theme.colors.neutral[10]; });
|
|
28
|
+
var NoData = function (props) { return React.createElement(NoDataStyled, __assign({}, props)); };
|
|
29
|
+
export { NoData };
|
|
30
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
/** @ignore */
|
|
4
|
+
className?: string;
|
|
5
|
+
/** Is corresponding column currently sorted? */
|
|
6
|
+
active?: boolean;
|
|
7
|
+
/** If set, sort button is reversed (Z-A). */
|
|
8
|
+
reverse?: boolean;
|
|
9
|
+
dark?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The SortButton displays a caret that rotates and lights up depending on
|
|
13
|
+
* its active/reverse props.
|
|
14
|
+
*/
|
|
15
|
+
declare const SortButton: 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 { SortButton };
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
import * as React from 'react';
|
|
6
|
+
import styled, { keyframes } from 'styled-components';
|
|
7
|
+
var SortButtonBase = function (props) {
|
|
8
|
+
return (React.createElement("div", { className: props.className },
|
|
9
|
+
React.createElement("svg", { viewBox: "0 0 100 100" },
|
|
10
|
+
React.createElement("path", { className: "bottom", d: "M9.5,77.9h81c4.3,0,8.1,3.3,8.1,7.2v6.1c0,3.9-3.8,7.2-8.1,7.2h-81c-4.3,0-8.1-3.3-8.1-7.2\r\n v-6.1C1.4,81.2,5.2,77.9,9.5,77.9z" }),
|
|
11
|
+
React.createElement("path", { className: "middle", d: "M9.5,39.5h52.9c4.3,0,8.1,3.3,8.1,7.2v6.1c0,3.9-3.8,7.2-8.1,7.2H9.5c-4.3,0-8.1-3.3-8.1-7.2\r\n v-6.1C1.4,42.9,5.2,39.5,9.5,39.5z" }),
|
|
12
|
+
React.createElement("path", { className: "top", d: "M10,1.1h24.8c4.9,0,8.6,3.3,8.6,7.2v6.1c0,3.9-3.8,7.2-8.6,7.2H10c-4.9,0-8.6-3.3-8.6-7.2V8.4\r\n C1.4,3.9,5.2,1.1,10,1.1z" }))));
|
|
13
|
+
};
|
|
14
|
+
var SortIconAnimation = keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n 0% {\n opacity: 1;\n }\n 40% {\n opacity: 0;\n }\n 60% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n"], ["\n 0% {\n opacity: 1;\n }\n 40% {\n opacity: 0;\n }\n 60% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n"
|
|
15
|
+
/**
|
|
16
|
+
* The SortButton displays a caret that rotates and lights up depending on
|
|
17
|
+
* its active/reverse props.
|
|
18
|
+
*/
|
|
19
|
+
])));
|
|
20
|
+
/**
|
|
21
|
+
* The SortButton displays a caret that rotates and lights up depending on
|
|
22
|
+
* its active/reverse props.
|
|
23
|
+
*/
|
|
24
|
+
var SortButton = styled(SortButtonBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n // Position\n position: relative;\n display: flex; // Needed for SVG to be centered in div.\n width: 12px;\n height: 12px;\n\n // Appearance\n transition: opacity ease-in-out 150ms,\n transform ease-in-out 150ms;\n transform: scaleY(", ");\n opacity: ", ";\n\n svg {\n transition: fill ease-in-out 150ms;\n fill: ", ";\n path.top, path.middle, path.bottom {\n transform-origin: 0 0;\n animation-name: ", ";\n // Animation duration is set by parent TableHeaderCell.\n animation-duration: 0;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n }\n path.middle {\n animation-delay: 0.25s;\n }\n path.bottom {\n animation-delay: 0.5s;\n } \n }\n"], ["\n // Position\n position: relative;\n display: flex; // Needed for SVG to be centered in div.\n width: 12px;\n height: 12px;\n\n // Appearance\n transition: opacity ease-in-out 150ms,\n transform ease-in-out 150ms;\n transform: scaleY(", ");\n opacity: ", ";\n\n svg {\n transition: fill ease-in-out 150ms;\n fill: ", ";\n path.top, path.middle, path.bottom {\n transform-origin: 0 0;\n animation-name: ", ";\n // Animation duration is set by parent TableHeaderCell.\n animation-duration: 0;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n }\n path.middle {\n animation-delay: 0.25s;\n }\n path.bottom {\n animation-delay: 0.5s;\n } \n }\n"])), function (p) { return p.reverse ? -1 : 1; }, function (p) { return p.active ? 1 : 0; }, function (p) { return p.dark ? p.theme.colors.primary[1] : p.theme.colors.neutral[10]; }, SortIconAnimation);
|
|
25
|
+
export { SortButton };
|
|
26
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IListViewProps } from './IListViewProps';
|
|
3
|
+
import { IColumnProps } from './Column';
|
|
4
|
+
interface IProps extends IListViewProps {
|
|
5
|
+
/** @ignore */
|
|
6
|
+
className?: string;
|
|
7
|
+
columns: IColumnProps[];
|
|
8
|
+
sort: string;
|
|
9
|
+
reverse: boolean;
|
|
10
|
+
onSortClick: (column: IColumnProps) => void;
|
|
11
|
+
columnsMode: boolean;
|
|
12
|
+
onOpenColumns: () => void;
|
|
13
|
+
onChangeColumns: (columns: IColumnProps[]) => void;
|
|
14
|
+
onCloseColumns: () => void;
|
|
15
|
+
onResetColumns: () => void;
|
|
16
|
+
}
|
|
17
|
+
declare const Table: (props: IProps) => React.JSX.Element;
|
|
18
|
+
export { Table };
|
|
@@ -0,0 +1,99 @@
|
|
|
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, { css } from 'styled-components';
|
|
29
|
+
import { Header } from './Header';
|
|
30
|
+
import { Body } from './Body';
|
|
31
|
+
import { darken } from '../../helper/darken';
|
|
32
|
+
import { Total } from './Total';
|
|
33
|
+
import { NoData } from './NoData';
|
|
34
|
+
import { ColumnsManager } from './ColumnsManager/ColumnsManager';
|
|
35
|
+
import { Anchor } from '../../containers/Anchor';
|
|
36
|
+
var TABLE_ROW_HEIGHT = 48;
|
|
37
|
+
var TableBase = function (_a) {
|
|
38
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
39
|
+
var scrollPos = React.useRef(0);
|
|
40
|
+
var wrapperRef = React.useRef(null);
|
|
41
|
+
var innerRef = React.useRef(null);
|
|
42
|
+
var auxRef = React.useRef(null);
|
|
43
|
+
var activeColumns = props.columns.filter(function (c) { return c.active; });
|
|
44
|
+
var setAuxPosition = function (offset) {
|
|
45
|
+
if (wrapperRef.current == null || auxRef.current == null || props.active == null)
|
|
46
|
+
return;
|
|
47
|
+
if (!offset) {
|
|
48
|
+
offset = scrollPos.current;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
scrollPos.current = offset;
|
|
52
|
+
}
|
|
53
|
+
var pos = props.data.indexOf(props.active);
|
|
54
|
+
var ROWHEIGHT = TABLE_ROW_HEIGHT;
|
|
55
|
+
var HEADERHEIGHT = TABLE_ROW_HEIGHT;
|
|
56
|
+
var top = Math.min(wrapperRef.current.clientHeight - auxRef.current.clientHeight - 16, Math.max(HEADERHEIGHT, -offset + HEADERHEIGHT + pos * ROWHEIGHT)) + "px";
|
|
57
|
+
auxRef.current.style.top = top;
|
|
58
|
+
};
|
|
59
|
+
React.useEffect(function () { setAuxPosition(); }, [props.active]);
|
|
60
|
+
var handleScroll = function () {
|
|
61
|
+
if (innerRef.current == null)
|
|
62
|
+
return;
|
|
63
|
+
setAuxPosition(innerRef.current.scrollTop);
|
|
64
|
+
};
|
|
65
|
+
return (React.createElement(Wrapper, { "$dark": props.dark, ref: wrapperRef },
|
|
66
|
+
props.columnsMode &&
|
|
67
|
+
React.createElement(Anchor, { right: "32px", top: "64px" },
|
|
68
|
+
React.createElement(ColumnsManager, { columns: props.columns, onChange: props.onChangeColumns, onClose: props.onCloseColumns, onReset: props.onResetColumns })),
|
|
69
|
+
(props.data == null || props.data.length == 0) &&
|
|
70
|
+
React.createElement(NoData, { dark: props.dark, component: props.noData }),
|
|
71
|
+
React.createElement(AuxHolder, { ref: auxRef, style: { visibility: (props.active && props.aux && props.data.includes(props.active)) ? 'visible' : 'hidden' } }, (props.active && props.aux && props.data.includes(props.active)) && React.cloneElement(props.aux, { value: props.active })),
|
|
72
|
+
React.createElement(Inner, { onScroll: handleScroll, ref: innerRef },
|
|
73
|
+
React.createElement("table", { className: className },
|
|
74
|
+
React.createElement(Header, __assign({}, props, { columns: activeColumns, onOpenColumns: props.onOpenColumns })),
|
|
75
|
+
React.createElement(Body, __assign({}, props, { columns: activeColumns })))),
|
|
76
|
+
props.total && React.createElement(Total, { value: props.data.length, singular: props.singular, plural: props.plural })));
|
|
77
|
+
};
|
|
78
|
+
var AuxHolder = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n // The AuxHolder is 16px right of the table. Its \"top\" position will\n // be set by the table scroll handler.\n left: calc(100% + 16px);\n z-index: 1;\n"], ["\n position: absolute;\n // The AuxHolder is 16px right of the table. Its \"top\" position will\n // be set by the table scroll handler.\n left: calc(100% + 16px);\n z-index: 1;\n"])));
|
|
79
|
+
var Wrapper = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n // Size and position. A table fills its container.\n position: relative;\n width: 100%;\n height: 100%;\n background-color: ", ";\n"], ["\n // Size and position. A table fills its container.\n position: relative;\n width: 100%;\n height: 100%;\n background-color: ", ";\n"])), function (p) { return p.$dark ? p.theme.colors.primary[3] : p.theme.colors.neutral[100]; });
|
|
80
|
+
var Inner = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n overflow-y: auto;\n"], ["\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n overflow-y: auto;\n"])));
|
|
81
|
+
var TableStyled = styled(TableBase)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n position: absolute;\n box-sizing: border-box;\n left: 0;\n top: 0;\n width: 100%;\n border-collapse: collapse; \n table-layout: fixed; \n\n // Grid:\n display: grid;\n grid-auto-rows: ", "px;\n\n // Convert column widths a string suitable for grid template:\n grid-template-columns: ", ";\n\n // Appearance:\n font: ", ";\n color: ", ";\n background-color: ", ";\n\n // <thead>, <tbody> and <tr> must not participate in CSS grid:\n tr, tbody, thead { display: contents; }\n\n // <tr>,<th>,<td> must be styled here, once, because otherwise \n // styled-components would create too many classes.\n tr {\n position: relative;\n }\n tr.clickable {\n cursor: pointer;\n }\n\n // Optional row hover effect:\n ", "\n\n // Striped rows:\n ", "\n\n // General styles for both TD and TH:\n th, td {\n position: relative;\n box-sizing: border-box;\n white-space: nowrap;\n text-align: left;\n user-select: none;\n outline: none;\n padding-left: 16px;\n padding-right: 16px; \n\n // th, td use flexbox to vertical-align content:\n display: flex;\n align-items: center;\n justify-content: left;\n\n // Underline.\n &:after {\n content: '';\n position: absolute;\n left: 0;\n bottom: 0;\n right: 0;\n height: 1px;\n transition: background-color ", "ms ease-in-out;\n } \n }\n\n th {\n // Position and size:\n position: sticky;\n top: 0;\n z-index: 100;\n gap: 8px;\n justify-content: space-between;\n // Appearance\n background: ", ";\n &.sort {\n background: ", ";\n }\n &:after { \n background-color: ", "; \n }\n // Header shadow:\n ", "\n }\n // td bottom border color:\n td {\n &:after {\n background-color: ", ";\n } \n }\n // Active row TDs:\n tr.active td {\n background-color: ", ";\n }\n // Last column has double right margin:\n td:last-child {\n padding-right: 32px;\n }\n // Last row has no bottom border:\n tr:last-child td {\n &:after {\n visibility: hidden;\n } \n }\n // Spans in td/th are ellipsized:\n td > span, th > span {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n\n // Grid:\n ", "\n\n // If onColumns is present, remove last column header's hover underline:\n // Also remove last gridline.\n ", "\n\n // Change styles for table to be vertically oriented:\n ", "\n"], ["\n position: absolute;\n box-sizing: border-box;\n left: 0;\n top: 0;\n width: 100%;\n border-collapse: collapse; \n table-layout: fixed; \n\n // Grid:\n display: grid;\n grid-auto-rows: ", "px;\n\n // Convert column widths a string suitable for grid template:\n grid-template-columns: ", ";\n\n // Appearance:\n font: ", ";\n color: ", ";\n background-color: ", ";\n\n // <thead>, <tbody> and <tr> must not participate in CSS grid:\n tr, tbody, thead { display: contents; }\n\n // <tr>,<th>,<td> must be styled here, once, because otherwise \n // styled-components would create too many classes.\n tr {\n position: relative;\n }\n tr.clickable {\n cursor: pointer;\n }\n\n // Optional row hover effect:\n ", "\n\n // Striped rows:\n ", "\n\n // General styles for both TD and TH:\n th, td {\n position: relative;\n box-sizing: border-box;\n white-space: nowrap;\n text-align: left;\n user-select: none;\n outline: none;\n padding-left: 16px;\n padding-right: 16px; \n\n // th, td use flexbox to vertical-align content:\n display: flex;\n align-items: center;\n justify-content: left;\n\n // Underline.\n &:after {\n content: '';\n position: absolute;\n left: 0;\n bottom: 0;\n right: 0;\n height: 1px;\n transition: background-color ", "ms ease-in-out;\n } \n }\n\n th {\n // Position and size:\n position: sticky;\n top: 0;\n z-index: 100;\n gap: 8px;\n justify-content: space-between;\n // Appearance\n background: ", ";\n &.sort {\n background: ", ";\n }\n &:after { \n background-color: ", "; \n }\n // Header shadow:\n ", "\n }\n // td bottom border color:\n td {\n &:after {\n background-color: ", ";\n } \n }\n // Active row TDs:\n tr.active td {\n background-color: ", ";\n }\n // Last column has double right margin:\n td:last-child {\n padding-right: 32px;\n }\n // Last row has no bottom border:\n tr:last-child td {\n &:after {\n visibility: hidden;\n } \n }\n // Spans in td/th are ellipsized:\n td > span, th > span {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n\n // Grid:\n ", "\n\n // If onColumns is present, remove last column header's hover underline:\n // Also remove last gridline.\n ", "\n\n // Change styles for table to be vertically oriented:\n ", "\n"])), TABLE_ROW_HEIGHT, function (p) {
|
|
82
|
+
// Prefix a check column?
|
|
83
|
+
return (p.onCheck ? ['48px'] : []).concat(
|
|
84
|
+
// Actual columns:
|
|
85
|
+
p.columns.filter(function (c) { return c.active; }).map(function (col) {
|
|
86
|
+
var _a;
|
|
87
|
+
var width = (_a = col.width) !== null && _a !== void 0 ? _a : 1;
|
|
88
|
+
// Numeric width?
|
|
89
|
+
if (typeof width === 'number' && !isNaN(width))
|
|
90
|
+
return "minmax(0, ".concat(width, "fr)");
|
|
91
|
+
return "minmax(0, ".concat(width, ")");
|
|
92
|
+
}))
|
|
93
|
+
// Postfix an columns management column?
|
|
94
|
+
.concat(p.columnsEditable ? ['48px'] : [])
|
|
95
|
+
.join(" ");
|
|
96
|
+
}, function (p) { return p.theme.font.bodyMedium; }, function (p) { return p.dark ? p.theme.colors.neutral[100] : p.theme.colors.neutral[10]; }, function (p) { return p.dark ? p.theme.colors.primary[3] : p.theme.colors.neutral[100]; }, function (p) { return p.hover && css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n tr:hover td { background-color: ", "; }\n "], ["\n tr:hover td { background-color: ", "; }\n "])), p.dark ? p.theme.colors.primary[4] : p.theme.colors.neutral[95]); }, function (p) { return p.striped && css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n tr:nth-child(2n+2) td {\n background-color: ", ";\n }\n "], ["\n tr:nth-child(2n+2) td {\n background-color: ", ";\n }\n "])), darken(0.02, p.dark ? p.theme.colors.primary[3] : p.theme.colors.neutral[100])); }, function (p) { return p.theme.animation.duration; }, function (p) { return p.dark ? p.theme.colors.primary[5] : p.theme.colors.neutral[100]; }, function (p) { return p.dark ? p.theme.colors.neutral[10] : p.theme.colors.neutral[95]; }, function (p) { return p.dark ? p.theme.colors.primary[2] : p.theme.colors.neutral[80]; }, function (p) { return p.shadow && css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n &:before {\n position: absolute;\n pointer-events: none;\n content: '';\n z-index: 1;\n top: calc(100%);\n left: 0;\n right: 0;\n height: 8px;\n background: linear-gradient(rgba(0,0,0,0.1), transparent);\n }\n "], ["\n &:before {\n position: absolute;\n pointer-events: none;\n content: '';\n z-index: 1;\n top: calc(100%);\n left: 0;\n right: 0;\n height: 8px;\n background: linear-gradient(rgba(0,0,0,0.1), transparent);\n }\n "]))); }, function (p) { return p.dark ? p.theme.colors.primary[2] : p.theme.colors.neutral[80]; }, function (p) { return p.theme.colors.primary[1]; }, function (p) { return p.grid && css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n td:not(:last-child), th:not(:last-child) {\n border-right: dashed 1px ", ";\n }\n "], ["\n td:not(:last-child), th:not(:last-child) {\n border-right: dashed 1px ", ";\n }\n "])), p.dark ? p.theme.colors.primary[2] : p.theme.colors.neutral[80]); }, function (p) { return p.columnsEditable && css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n th:last-child {\n &:hover {\n &:after { \n background-color: ", ";\n }\n }\n }\n th:nth-last-child(2), td:nth-last-child(2) {\n border-right: none;\n }\n "], ["\n th:last-child {\n &:hover {\n &:after { \n background-color: ", ";\n }\n }\n }\n th:nth-last-child(2), td:nth-last-child(2) {\n border-right: none;\n }\n "])), function (p) { return p.theme.colors.primary[2]; }); }, function (p) { return p.narrow && css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n grid-template-columns: 1fr;\n tr th {\n display: none;\n } \n th, td:not(:last-child) {\n &:after {\n visibility: hidden;\n }\n }\n td {\n flex-direction: column;\n align-items: start;\n justify-content: center;\n }\n td span.label {\n font: ", ";\n }\n td:last-child {\n padding-right: 16px;\n }\n "], ["\n grid-template-columns: 1fr;\n tr th {\n display: none;\n } \n th, td:not(:last-child) {\n &:after {\n visibility: hidden;\n }\n }\n td {\n flex-direction: column;\n align-items: start;\n justify-content: center;\n }\n td span.label {\n font: ", ";\n }\n td:last-child {\n padding-right: 16px;\n }\n "])), function (p) { return p.theme.font.labelSmall; }); });
|
|
97
|
+
var Table = function (props) { return React.createElement(TableStyled, __assign({}, props)); };
|
|
98
|
+
export { Table };
|
|
99
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
import * as React from 'react';
|
|
17
|
+
import styled from 'styled-components';
|
|
18
|
+
import { Number } from '../../formatters/Number';
|
|
19
|
+
var TotalBase = function (props) {
|
|
20
|
+
return React.createElement("div", { className: props.className },
|
|
21
|
+
React.createElement(Number, { value: props.value, decimals: 0 }),
|
|
22
|
+
" ",
|
|
23
|
+
props.value == 1 ? props.singular : props.plural);
|
|
24
|
+
};
|
|
25
|
+
var TotalStyled = styled(TotalBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n // Position:\n position: absolute;\n z-index: 1;\n left: 8px;\n bottom: 8px;\n\n // Behavior:\n user-select: none;\n pointer-events: none;\n\n // Appearance:\n font: ", ";\n border-radius: ", "px;\n background: ", ";\n color: ", ";\n padding: 5px 8px;\n"], ["\n // Position:\n position: absolute;\n z-index: 1;\n left: 8px;\n bottom: 8px;\n\n // Behavior:\n user-select: none;\n pointer-events: none;\n\n // Appearance:\n font: ", ";\n border-radius: ", "px;\n background: ", ";\n color: ", ";\n padding: 5px 8px;\n"])), function (p) { return p.theme.font.labelSmall; }, function (p) { return p.theme.radius.normal; }, function (p) { return p.theme.colors.neutral[10]; }, function (p) { return p.theme.colors.neutral[100]; });
|
|
26
|
+
var Total = function (props) { return React.createElement(TotalStyled, __assign({}, props)); };
|
|
27
|
+
export { Total };
|
|
28
|
+
var templateObject_1;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sort function. By default, this sorts items by comparing the "sort" field.
|
|
3
|
+
* However, a custom value retrieval function can be provided.
|
|
4
|
+
*/
|
|
5
|
+
declare const sortItems: (items: any[], sort: string, reverse: boolean, onSortValue?: (item: any, key: string) => any) => any[];
|
|
6
|
+
export { sortItems };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Sort function. By default, this sorts items by comparing the "sort" field.
|
|
12
|
+
* However, a custom value retrieval function can be provided.
|
|
13
|
+
*/
|
|
14
|
+
var sortItems = function (items, sort, reverse, onSortValue) {
|
|
15
|
+
var newItems = __spreadArray([], items, true);
|
|
16
|
+
newItems.sort(function (a, b) {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
if (a == null || b == null)
|
|
19
|
+
return 0;
|
|
20
|
+
var vA = (_a = (onSortValue ? onSortValue(a, sort) : a[sort])) !== null && _a !== void 0 ? _a : "";
|
|
21
|
+
var vB = (_b = (onSortValue ? onSortValue(b, sort) : b[sort])) !== null && _b !== void 0 ? _b : "";
|
|
22
|
+
// Trim strings, because leading spaces will throw sort off.
|
|
23
|
+
if (typeof vA === 'string')
|
|
24
|
+
vA = vA.trim();
|
|
25
|
+
if (typeof vB === 'string')
|
|
26
|
+
vB = vB.trim();
|
|
27
|
+
if (vA.localeCompare)
|
|
28
|
+
return vA.localeCompare(vB);
|
|
29
|
+
return vA - vB;
|
|
30
|
+
});
|
|
31
|
+
if (reverse)
|
|
32
|
+
newItems.reverse();
|
|
33
|
+
return newItems;
|
|
34
|
+
};
|
|
35
|
+
export { sortItems };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
/** @ignore */
|
|
4
|
+
className?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Is left button depressed?
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
left?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Is right button depressed?
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
right?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Is mouse wheel highlighted?
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
wheel?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Optional mouse color. Defaults to theme color.
|
|
22
|
+
*/
|
|
23
|
+
color?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Optional accent color (for the mouse wheel). Defaults to theme color.
|
|
26
|
+
*/
|
|
27
|
+
accent?: string;
|
|
28
|
+
/**
|
|
29
|
+
* If set, the `Mouse` is rendered at the specified `size` (in pixels).
|
|
30
|
+
*/
|
|
31
|
+
size?: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* `Mouse` renders an SVG with a mouse image, optionally with its
|
|
35
|
+
* `left`, `right` or `wheel` buttons pressed.
|
|
36
|
+
*/
|
|
37
|
+
declare const Mouse: ({ left, right, wheel, ...props }: IProps) => React.JSX.Element;
|
|
38
|
+
export { Mouse };
|
|
@@ -0,0 +1,51 @@
|
|
|
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, { css } from 'styled-components';
|
|
29
|
+
var MouseBase = function (props) {
|
|
30
|
+
return (React.createElement("svg", { className: props.className, viewBox: "3 0 22 29", xmlns: "http://www.w3.org/2000/svg" },
|
|
31
|
+
React.createElement("path", { d: "M14 1.75623C8.69307 1.75623 4.375 6.07429 4.375 11.3812V18.3812C4.375 23.6882 8.69307 28.0062 14 28.0062C19.3069 28.0062 23.625 23.6882 23.625 18.3812V11.3812C23.625 6.07429 19.3069 1.75623 14 1.75623ZM21.875 11.3812V12.2562H16.625V10.5062C16.625 9.36653 15.8911 8.40403 14.875 8.04199V3.55756C18.806 3.99506 21.875 7.33546 21.875 11.3812ZM14 9.63123C14.4834 9.63123 14.875 10.0239 14.875 10.5062V13.1312C14.875 13.6136 14.4834 14.0062 14 14.0062C13.5166 14.0062 13.125 13.6136 13.125 13.1312V10.5062C13.125 10.0239 13.5166 9.63123 14 9.63123ZM6.125 11.3812C6.125 7.33546 9.19403 3.99389 13.125 3.55779V8.04223C12.1089 8.40427 11.375 9.36677 11.375 10.5065V12.2565H6.125V11.3812ZM14 26.2562C9.65767 26.2562 6.125 22.7236 6.125 18.3812V14.0062H11.5358C11.8978 15.0223 12.8603 15.7562 14 15.7562C15.1397 15.7562 16.1022 15.0223 16.4642 14.0062H21.875V18.3812C21.875 22.7236 18.3423 26.2562 14 26.2562Z", fill: props.color }),
|
|
32
|
+
props.left && React.createElement("path", { className: "left", d: "M13.125 3.55798C9.19403 3.99408 6.125 7.33565 6.125 11.3814V12.2567H11.375V10.5067C11.375 9.36696 12.1089 8.40446 13.125 8.04242V3.55798Z" }),
|
|
33
|
+
props.right && React.createElement("path", { className: "right", d: "M21.875 12.2562V11.3812C21.875 7.33539 18.806 3.995 14.875 3.5575V8.04193C15.8911 8.40397 16.625 9.36647 16.625 10.5062V12.2562H21.875Z" }),
|
|
34
|
+
props.wheel && React.createElement("path", { className: "wheel", d: "M15.875 10.5062C15.875 9.47241 15.0365 8.63123 14 8.63123C12.9635 8.63123 12.125 9.47241 12.125 10.5062V13.1312C12.125 14.165 12.9635 15.0062 14 15.0062C15.0365 15.0062 15.875 14.165 15.875 13.1312V10.5062Z" })));
|
|
35
|
+
};
|
|
36
|
+
var MouseStyled = styled(MouseBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n max-height: 100px;\n fill: ", ";\n .left { fill: ", "; }\n .right { fill: ", "; }\n .wheel { fill: ", "; }\n"], ["\n ", "\n max-height: 100px;\n fill: ", ";\n .left { fill: ", "; }\n .right { fill: ", "; }\n .wheel { fill: ", "; }\n"
|
|
37
|
+
/**
|
|
38
|
+
* `Mouse` renders an SVG with a mouse image, optionally with its
|
|
39
|
+
* `left`, `right` or `wheel` buttons pressed.
|
|
40
|
+
*/
|
|
41
|
+
])), function (p) { return p.size && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: ", "px;\n "], ["\n height: ", "px;\n "])), p.size); }, function (p) { var _a; return (_a = p.color) !== null && _a !== void 0 ? _a : p.theme.colors.neutral[100]; }, function (p) { var _a; return (_a = p.color) !== null && _a !== void 0 ? _a : p.theme.colors.neutral[100]; }, function (p) { var _a; return (_a = p.color) !== null && _a !== void 0 ? _a : p.theme.colors.neutral[100]; }, function (p) { var _a; return (_a = p.accent) !== null && _a !== void 0 ? _a : p.theme.colors.primary[1]; });
|
|
42
|
+
/**
|
|
43
|
+
* `Mouse` renders an SVG with a mouse image, optionally with its
|
|
44
|
+
* `left`, `right` or `wheel` buttons pressed.
|
|
45
|
+
*/
|
|
46
|
+
var Mouse = function (_a) {
|
|
47
|
+
var _b = _a.left, left = _b === void 0 ? false : _b, _c = _a.right, right = _c === void 0 ? false : _c, _d = _a.wheel, wheel = _d === void 0 ? false : _d, props = __rest(_a, ["left", "right", "wheel"]);
|
|
48
|
+
return React.createElement(MouseStyled, __assign({ left: left, right: right, wheel: wheel }, props));
|
|
49
|
+
};
|
|
50
|
+
export { Mouse };
|
|
51
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Mouse';
|