@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,73 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
/** @ignore */
|
|
4
|
+
className?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Input name for use in forms.
|
|
7
|
+
*/
|
|
8
|
+
name?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Current input value.
|
|
11
|
+
*/
|
|
12
|
+
value?: string | null;
|
|
13
|
+
/**
|
|
14
|
+
* Marks input as disabled. Disabled inputs cannot be interacted with.
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Removes input border and makes background transparent. This is useful
|
|
20
|
+
* for placing an input in a `Field`.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
transparent?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* A DateInput can be in a ghost state, where content is being loaded.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
ghost?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* A fluid Input takes up all available horizontal space available to it.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
fluid?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* An input can show an error state.
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
error?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* If set, Input's value can be cleared.
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
clearable?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* If set, date pickers do not allow picking future dates (beyond today).
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
nofuture?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* The `DateInput` opening direction can be either fixed
|
|
51
|
+
* (`up` or `down`), or depend on the nearest scrolling parent: if the input
|
|
52
|
+
* is in the top half of the visible section of the parent, then it opens
|
|
53
|
+
* downward, and vice-versa. If this property is not set, then the opening
|
|
54
|
+
* direction is determined from the input position in the viewport.
|
|
55
|
+
* @default none
|
|
56
|
+
*/
|
|
57
|
+
direction?: 'none' | 'up' | 'down' | 'parent';
|
|
58
|
+
/**
|
|
59
|
+
* Removes tabIndex from this input.
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
noTabIndex?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Listeners are notified whenever the user interacts with the Input.
|
|
65
|
+
*/
|
|
66
|
+
onChange?: (value: any) => void;
|
|
67
|
+
/**
|
|
68
|
+
* Listeners are notified when the Input receives focus.
|
|
69
|
+
*/
|
|
70
|
+
onFocus?: () => void;
|
|
71
|
+
}
|
|
72
|
+
declare const DateInput: ({ direction, noTabIndex, disabled, transparent, fluid, error, clearable, nofuture, ...props }: IProps) => React.JSX.Element;
|
|
73
|
+
export { DateInput, IProps };
|
|
@@ -0,0 +1,143 @@
|
|
|
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 { Selector } from './Selector';
|
|
30
|
+
import { Body } from './Body';
|
|
31
|
+
import { parseISO } from 'date-fns';
|
|
32
|
+
var DateInputBase = function (props) {
|
|
33
|
+
var wrapperRef = React.useRef(null);
|
|
34
|
+
// Parse str into Date.
|
|
35
|
+
// If parsing fails, return fallback value.
|
|
36
|
+
var parseDate = function (str, def) {
|
|
37
|
+
if (str == null)
|
|
38
|
+
return def;
|
|
39
|
+
var date = parseISO(props.value);
|
|
40
|
+
if (isNaN(date.getDate()))
|
|
41
|
+
return def;
|
|
42
|
+
return date;
|
|
43
|
+
};
|
|
44
|
+
var _a = React.useState(function () { return parseDate(props.value, null); }), value = _a[0], setValue = _a[1];
|
|
45
|
+
var _b = React.useState(false), open = _b[0], setOpen = _b[1];
|
|
46
|
+
var _c = React.useState(false), upwards = _c[0], setUpwards = _c[1];
|
|
47
|
+
// Add (and remove) document-wide event listener for mousedown.
|
|
48
|
+
React.useEffect(function () {
|
|
49
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
50
|
+
return function () { return document.removeEventListener('mousedown', handleClickOutside); };
|
|
51
|
+
}, []);
|
|
52
|
+
//
|
|
53
|
+
// Handle document-wide mousedown event by closing the Selector.
|
|
54
|
+
// (This only happens if there actually is a Selector).
|
|
55
|
+
//
|
|
56
|
+
var handleClickOutside = function (e) {
|
|
57
|
+
var elem = e.target;
|
|
58
|
+
if (wrapperRef.current && !wrapperRef.current.contains(elem)) {
|
|
59
|
+
setOpen(false);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var findScrollingParentRecursive = function (node) {
|
|
63
|
+
var overflowY = window.getComputedStyle(node).overflowY;
|
|
64
|
+
if (overflowY == 'scroll' || overflowY == 'auto')
|
|
65
|
+
return node;
|
|
66
|
+
if (node.parentElement)
|
|
67
|
+
return findScrollingParentRecursive(node.parentElement);
|
|
68
|
+
return null;
|
|
69
|
+
};
|
|
70
|
+
// Return my nearest parent that's scrolling (frames are not supported). If
|
|
71
|
+
// no parent is found, null is returned.
|
|
72
|
+
var findScrollingParent = function () {
|
|
73
|
+
return findScrollingParentRecursive(wrapperRef.current.parentElement);
|
|
74
|
+
};
|
|
75
|
+
// Returns true if the input is in the lower half of its scrolling parent.
|
|
76
|
+
// (if direction === parent), or in the lower half of the viewport if no
|
|
77
|
+
// scrolling parent is found.
|
|
78
|
+
var isInLowerViewport = function () {
|
|
79
|
+
var scrollingParent = findScrollingParent();
|
|
80
|
+
if (scrollingParent == null || props.direction !== 'parent') {
|
|
81
|
+
return wrapperRef.current.getBoundingClientRect().top > window.innerHeight / 2;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
var myY = wrapperRef.current.getBoundingClientRect().top;
|
|
85
|
+
var containerY = scrollingParent.getBoundingClientRect().top;
|
|
86
|
+
var containerHeight = scrollingParent.getBoundingClientRect().height;
|
|
87
|
+
var offset = myY - containerY;
|
|
88
|
+
return offset > containerHeight / 2;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
// Open the dropdown.
|
|
92
|
+
var doOpen = function () {
|
|
93
|
+
// Is the Dropdown below the middle of the viewport?
|
|
94
|
+
var below = isInLowerViewport();
|
|
95
|
+
// Set opening direction.
|
|
96
|
+
if (props.direction === 'down')
|
|
97
|
+
setUpwards(false);
|
|
98
|
+
else if (props.direction === 'up')
|
|
99
|
+
setUpwards(true);
|
|
100
|
+
else
|
|
101
|
+
setUpwards(below);
|
|
102
|
+
setOpen(true);
|
|
103
|
+
};
|
|
104
|
+
var handleChange = function (newValue) {
|
|
105
|
+
setValue(newValue);
|
|
106
|
+
if (props.onChange)
|
|
107
|
+
props.onChange(newValue);
|
|
108
|
+
};
|
|
109
|
+
var handleToggle = function () {
|
|
110
|
+
if (!open) {
|
|
111
|
+
doOpen();
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
setOpen(false);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
var handleSelect = function (newValue) {
|
|
118
|
+
setValue(newValue);
|
|
119
|
+
if (props.onChange)
|
|
120
|
+
props.onChange(newValue);
|
|
121
|
+
setOpen(false);
|
|
122
|
+
};
|
|
123
|
+
var handleKeyDown = function (e) {
|
|
124
|
+
if (props.disabled)
|
|
125
|
+
return;
|
|
126
|
+
if (props.ghost)
|
|
127
|
+
return;
|
|
128
|
+
if (e.key == ' ' && !open)
|
|
129
|
+
doOpen();
|
|
130
|
+
if (e.key == 'Escape' && open)
|
|
131
|
+
setOpen(false);
|
|
132
|
+
};
|
|
133
|
+
return (React.createElement("div", { tabIndex: -1, className: props.className, onKeyDown: handleKeyDown, ref: wrapperRef },
|
|
134
|
+
React.createElement(Selector, { value: value, disabled: props.disabled, ghost: props.ghost, transparent: props.transparent, error: props.error, clearable: props.clearable, noTabIndex: props.noTabIndex, onChange: handleChange, onClear: (!props.disabled && props.clearable && value != null) ? function () { return handleChange(null); } : null, onCalendar: handleToggle }),
|
|
135
|
+
React.createElement(Body, { ref: null, value: value, upwards: upwards, open: open, transparent: props.transparent, nofuture: props.nofuture, onSelect: handleSelect })));
|
|
136
|
+
};
|
|
137
|
+
var DateInputStyled = styled(DateInputBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n // DateInput has a minimum width.\n width: 250px;\n // A fluid DateInput occupies full horizontal width.\n ", " \n"], ["\n position: relative;\n // DateInput has a minimum width.\n width: 250px;\n // A fluid DateInput occupies full horizontal width.\n ", " \n"])), function (p) { return p.fluid && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["width: 100%;"], ["width: 100%;"]))); });
|
|
138
|
+
var DateInput = function (_a) {
|
|
139
|
+
var _b = _a.direction, direction = _b === void 0 ? 'none' : _b, _c = _a.noTabIndex, noTabIndex = _c === void 0 ? false : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.transparent, transparent = _e === void 0 ? false : _e, _f = _a.fluid, fluid = _f === void 0 ? false : _f, _g = _a.error, error = _g === void 0 ? false : _g, _h = _a.clearable, clearable = _h === void 0 ? false : _h, _j = _a.nofuture, nofuture = _j === void 0 ? false : _j, props = __rest(_a, ["direction", "noTabIndex", "disabled", "transparent", "fluid", "error", "clearable", "nofuture"]);
|
|
140
|
+
return React.createElement(DateInputStyled, __assign({ direction: direction, noTabIndex: noTabIndex, disabled: disabled, transparent: transparent, fluid: fluid, error: error, clearable: clearable, nofuture: nofuture }, props));
|
|
141
|
+
};
|
|
142
|
+
export { DateInput };
|
|
143
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
/** @ignore */
|
|
4
|
+
className?: string;
|
|
5
|
+
/**
|
|
6
|
+
* If set, this day not belong to the current month.
|
|
7
|
+
*/
|
|
8
|
+
grey: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Is this the currently selected day?
|
|
11
|
+
*/
|
|
12
|
+
selected: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Is this today?
|
|
15
|
+
*/
|
|
16
|
+
today: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Day number, e.g. `17`.
|
|
19
|
+
*/
|
|
20
|
+
day: number;
|
|
21
|
+
/**
|
|
22
|
+
* Triggered when Day is clicked. If this property is not set,
|
|
23
|
+
* then the Day will have no hover circle.
|
|
24
|
+
*/
|
|
25
|
+
onClick?: () => void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A `Day` is a day on the calendar. It is rendered with
|
|
29
|
+
* a selection circle, unless it has no `onClick` trigger set.
|
|
30
|
+
*/
|
|
31
|
+
declare const Day: (props: IProps) => React.JSX.Element;
|
|
32
|
+
export { Day };
|
|
@@ -0,0 +1,33 @@
|
|
|
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, { css } from 'styled-components';
|
|
18
|
+
var DayBase = function (props) {
|
|
19
|
+
return React.createElement("div", { className: props.className, onClick: props.onClick }, props.day);
|
|
20
|
+
};
|
|
21
|
+
var DayStyled = styled(DayBase)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n // Position & size:\n position: relative;\n box-sizing: border-box;\n width: 40px;\n height: 40px;\n z-index: 0; // for selection circle at z=-1\n\n // Appearance:\n cursor: ", ";\n background-color: ", ";\n color: ", ";\n user-select: none;\n outline: none;\n font: ", ";\n\n // Content:\n display: flex;\n align-items: center;\n justify-content: center; \n\n // Unclickable days have no pointer events.\n pointer-events: ", ";\n\n // Circle (only applies to clickable dates):\n &:before {\n content: '';\n z-index: -1;\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n border-radius: 50%;\n opacity: 0;\n } \n\n // Grey dates do not belong to the current month.\n ", "\n\n // Highlight today's date and selected date.\n ", "\n // Selection circles only appear for \n ", "\n ", " \n\n // Hover:\n &:hover {\n color: ", ";\n &:before {\n background-color: ", ";\n opacity: 1;\n }\n }\n"], ["\n // Position & size:\n position: relative;\n box-sizing: border-box;\n width: 40px;\n height: 40px;\n z-index: 0; // for selection circle at z=-1\n\n // Appearance:\n cursor: ", ";\n background-color: ", ";\n color: ", ";\n user-select: none;\n outline: none;\n font: ", ";\n\n // Content:\n display: flex;\n align-items: center;\n justify-content: center; \n\n // Unclickable days have no pointer events.\n pointer-events: ", ";\n\n // Circle (only applies to clickable dates):\n &:before {\n content: '';\n z-index: -1;\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n border-radius: 50%;\n opacity: 0;\n } \n\n // Grey dates do not belong to the current month.\n ", "\n\n // Highlight today's date and selected date.\n ", "\n // Selection circles only appear for \n ", "\n ", " \n\n // Hover:\n &:hover {\n color: ", ";\n &:before {\n background-color: ", ";\n opacity: 1;\n }\n }\n"
|
|
22
|
+
/**
|
|
23
|
+
* A `Day` is a day on the calendar. It is rendered with
|
|
24
|
+
* a selection circle, unless it has no `onClick` trigger set.
|
|
25
|
+
*/
|
|
26
|
+
])), function (p) { return p.onClick ? 'pointer' : 'auto'; }, function (p) { return p.theme.colors.neutral[100]; }, function (p) { return p.theme.colors.primary[3]; }, function (p) { return p.theme.font.labelSmall; }, function (p) { return p.onClick ? 'all' : 'none'; }, function (p) { return p.grey && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["color: ", ";"], ["color: ", ";"])), function (p) { return p.theme.colors.neutral[80]; }); }, function (p) { return (p.today || p.selected) && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-weight: 700;\n "], ["\n font-weight: 700;\n "]))); }, function (p) { return p.today && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n &:before {\n opacity: 1;\n background-color: ", ";\n }\n "], ["\n &:before {\n opacity: 1;\n background-color: ", ";\n }\n "])), p.theme.colors.neutral[95]); }, function (p) { return p.selected && css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n &:before {\n opacity: 1;\n background-color: ", ";\n }\n "], ["\n &:before {\n opacity: 1;\n background-color: ", ";\n }\n "])), p.theme.colors.neutral[80]); }, function (p) { return p.theme.colors.neutral[100]; }, function (p) { return p.theme.colors.primary[1]; });
|
|
27
|
+
/**
|
|
28
|
+
* A `Day` is a day on the calendar. It is rendered with
|
|
29
|
+
* a selection circle, unless it has no `onClick` trigger set.
|
|
30
|
+
*/
|
|
31
|
+
var Day = function (props) { return React.createElement(DayStyled, __assign({}, props)); };
|
|
32
|
+
export { Day };
|
|
33
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
/** @ignore */
|
|
4
|
+
className?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Current value, e.g. `2000`
|
|
7
|
+
*/
|
|
8
|
+
value: number;
|
|
9
|
+
/**
|
|
10
|
+
* Minimum allowed value, e.g. `1900`
|
|
11
|
+
*/
|
|
12
|
+
min: number;
|
|
13
|
+
/**
|
|
14
|
+
* Maximum allowed value, e.g. `2100`
|
|
15
|
+
*/
|
|
16
|
+
max: number;
|
|
17
|
+
/**
|
|
18
|
+
* Triggered when an item is clicked.
|
|
19
|
+
*/
|
|
20
|
+
onClick: (value: number) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Shows an infinitely scrolling list of sequential numbers.
|
|
24
|
+
*/
|
|
25
|
+
declare const InfiniteList: (props: IProps) => React.JSX.Element;
|
|
26
|
+
export { InfiniteList };
|
|
@@ -0,0 +1,87 @@
|
|
|
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, { css } from 'styled-components';
|
|
18
|
+
// Number of elements above and below the middle element:
|
|
19
|
+
var RANGE = 20;
|
|
20
|
+
var InfiniteListBase = function (props) {
|
|
21
|
+
var listRef = React.useRef(null);
|
|
22
|
+
var initialElementRef = React.useRef(null);
|
|
23
|
+
var observer = React.useRef(null);
|
|
24
|
+
var offset = React.useRef(props.value);
|
|
25
|
+
var makeValues = function (from) {
|
|
26
|
+
if (from < props.min + RANGE)
|
|
27
|
+
from = props.min + RANGE;
|
|
28
|
+
if (from > props.max - RANGE)
|
|
29
|
+
from = props.max - RANGE;
|
|
30
|
+
return Array.from(Array(RANGE * 2 + 1).keys()).map(function (n) { return n + from - RANGE; });
|
|
31
|
+
};
|
|
32
|
+
// Create an initial list of start-10...start+10:
|
|
33
|
+
var _a = React.useState(function () { return makeValues(props.value); }), values = _a[0], setValues = _a[1];
|
|
34
|
+
React.useEffect(function () {
|
|
35
|
+
initialElementRef.current.scrollIntoView({ behavior: 'instant', block: 'center' });
|
|
36
|
+
observer.current = new IntersectionObserver(intersect, { root: listRef.current, rootMargin: '0px', threshold: 0.5 });
|
|
37
|
+
}, []);
|
|
38
|
+
var intersect = function (entries, observer) {
|
|
39
|
+
if (entries.length > 0 && entries[0].isIntersecting) {
|
|
40
|
+
// Is this the first element in the list?
|
|
41
|
+
var isFirst = listRef.current.firstChild == entries[0].target;
|
|
42
|
+
if (isFirst) {
|
|
43
|
+
// Calculate new values (this takes `min` into account):
|
|
44
|
+
var newValues = makeValues(offset.current - RANGE);
|
|
45
|
+
// If values have changed, then we replace the list:
|
|
46
|
+
if (newValues[RANGE] != offset.current) {
|
|
47
|
+
setValues(newValues);
|
|
48
|
+
offset.current -= RANGE;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Is this the last element in the list?
|
|
52
|
+
var isLast = listRef.current.lastChild == entries[0].target;
|
|
53
|
+
if (isLast) {
|
|
54
|
+
// Calculate new values (this takes `max` into account):
|
|
55
|
+
var newValues = makeValues(offset.current + RANGE);
|
|
56
|
+
// If values have changed, then we replace the list:
|
|
57
|
+
if (newValues[RANGE] != offset.current) {
|
|
58
|
+
setValues(newValues);
|
|
59
|
+
offset.current += RANGE;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
React.useEffect(function () {
|
|
65
|
+
// If values have changed, then start observing new top and bottom element:
|
|
66
|
+
if (observer.current) {
|
|
67
|
+
observer.current.disconnect();
|
|
68
|
+
observer.current.observe(listRef.current.children[0]);
|
|
69
|
+
observer.current.observe(listRef.current.children[RANGE * 2]);
|
|
70
|
+
}
|
|
71
|
+
}, [values]);
|
|
72
|
+
return (React.createElement("div", { className: props.className, ref: listRef }, values.map(function (n) {
|
|
73
|
+
return React.createElement(Item, { className: n.toString(), key: n, "$active": props.value === n, ref: n == props.value ? initialElementRef : null, onClick: function () { return props.onClick(n); } }, n);
|
|
74
|
+
})));
|
|
75
|
+
};
|
|
76
|
+
var Item = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject([" \n height: 42px;\n padding-left: 28px;\n padding-right: 28px;\n display: flex;\n align-items: center;\n cursor: pointer;\n font: ", ";\n &:hover {\n background-color: ", ";\n } \n ", "\n &:active {\n background-color: rgb(from ", " r g b / 65%) !important;\n color: ", ";\n }\n"], [" \n height: 42px;\n padding-left: 28px;\n padding-right: 28px;\n display: flex;\n align-items: center;\n cursor: pointer;\n font: ", ";\n &:hover {\n background-color: ", ";\n } \n ", "\n &:active {\n background-color: rgb(from ", " r g b / 65%) !important;\n color: ", ";\n }\n"])), function (p) { return p.theme.font.bodyMedium; }, function (p) { return p.theme.colors.neutral[80]; }, function (p) { return p.$active && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: rgb(from ", " r g b / 45%) !important;\n color: ", ";\n "], ["\n background-color: rgb(from ", " r g b / 45%) !important;\n color: ", ";\n "])), function (p) { return p.theme.colors.primary[2]; }, function (p) { return p.theme.colors.neutral[100]; }); }, function (p) { return p.theme.colors.primary[2]; }, function (p) { return p.theme.colors.neutral[100]; });
|
|
77
|
+
var InfiniteListStyled = styled(InfiniteListBase)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n z-index: 1;\n top: 64px;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ", ";\n user-select: none;\n overflow-y: scroll;\n"], ["\n position: absolute;\n z-index: 1;\n top: 64px;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ", ";\n user-select: none;\n overflow-y: scroll;\n"
|
|
78
|
+
/**
|
|
79
|
+
* Shows an infinitely scrolling list of sequential numbers.
|
|
80
|
+
*/
|
|
81
|
+
])), function (p) { return p.theme.colors.neutral[100]; });
|
|
82
|
+
/**
|
|
83
|
+
* Shows an infinitely scrolling list of sequential numbers.
|
|
84
|
+
*/
|
|
85
|
+
var InfiniteList = function (props) { return React.createElement(InfiniteListStyled, __assign({}, props)); };
|
|
86
|
+
export { InfiniteList };
|
|
87
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
/** @ignore */
|
|
4
|
+
className?: string;
|
|
5
|
+
value: string;
|
|
6
|
+
onPrev: () => void;
|
|
7
|
+
onNext: () => void;
|
|
8
|
+
onOpen: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare const Nav: 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>>;
|
|
11
|
+
export { Nav };
|
|
@@ -0,0 +1,24 @@
|
|
|
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 from 'styled-components';
|
|
7
|
+
import { SVG } from '../../svg';
|
|
8
|
+
var NavBase = function (props) {
|
|
9
|
+
return (React.createElement("div", { className: props.className },
|
|
10
|
+
React.createElement(Button, { style: { rotate: "90deg" }, onClick: function (e) { e.stopPropagation(); props.onPrev(); } },
|
|
11
|
+
React.createElement("use", { xlinkHref: SVG.Icons.Caret })),
|
|
12
|
+
React.createElement(Selection, { onClick: function (e) { e.stopPropagation(); props.onOpen(); } },
|
|
13
|
+
props.value,
|
|
14
|
+
React.createElement(Caret, null,
|
|
15
|
+
React.createElement("use", { xlinkHref: SVG.Icons.Caret }))),
|
|
16
|
+
React.createElement(Button, { style: { rotate: "-90deg" }, onClick: function (e) { e.stopPropagation(); props.onNext(); } },
|
|
17
|
+
React.createElement("use", { xlinkHref: SVG.Icons.Caret }))));
|
|
18
|
+
};
|
|
19
|
+
var Selection = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 60px;\n text-align: center;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 4px;\n cursor: pointer;\n"], ["\n width: 60px;\n text-align: center;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 4px;\n cursor: pointer;\n"])));
|
|
20
|
+
var Button = styled.svg(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n box-sizing: border-box;\n fill: ", ";\n width: 40px;\n height: 40px;\n padding: 8px;\n cursor: pointer;\n"], ["\n box-sizing: border-box;\n fill: ", ";\n width: 40px;\n height: 40px;\n padding: 8px;\n cursor: pointer;\n"])), function (p) { return p.theme.colors.primary[1]; });
|
|
21
|
+
var Caret = styled.svg(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n fill: ", ";\n width: 12px;\n height: 12px; \n"], ["\n fill: ", ";\n width: 12px;\n height: 12px; \n"])), function (p) { return p.theme.colors.neutral[10]; });
|
|
22
|
+
var Nav = styled(NavBase)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n user-select: none;\n"], ["\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n user-select: none;\n"])));
|
|
23
|
+
export { Nav };
|
|
24
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
/** Current date. */
|
|
5
|
+
date: Date;
|
|
6
|
+
onPrevYear: () => void;
|
|
7
|
+
onNextYear: () => void;
|
|
8
|
+
onPrevMonth: () => void;
|
|
9
|
+
onNextMonth: () => void;
|
|
10
|
+
/** Fired when a month is selected. */
|
|
11
|
+
onMonth: (month: number) => void;
|
|
12
|
+
/** Fired when a year is selected. */
|
|
13
|
+
onYear: (year: number) => void;
|
|
14
|
+
}
|
|
15
|
+
declare const Navbar: 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 { Navbar };
|
|
@@ -0,0 +1,33 @@
|
|
|
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 from 'styled-components';
|
|
7
|
+
import { Nav } from './Nav';
|
|
8
|
+
import { SimpleList } from './SimpleList';
|
|
9
|
+
import { InfiniteList } from './InfiniteList';
|
|
10
|
+
var NavbarBase = function (props) {
|
|
11
|
+
var _a = React.useState(null), mode = _a[0], setMode = _a[1];
|
|
12
|
+
// Listen for document-wide keypress.
|
|
13
|
+
React.useEffect(function () {
|
|
14
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
15
|
+
return function () { return document.removeEventListener('keydown', handleKeyDown); };
|
|
16
|
+
});
|
|
17
|
+
// Close nav if ESC is pressed.
|
|
18
|
+
var handleKeyDown = function (e) {
|
|
19
|
+
if (e.key == 'Escape' && mode != null) {
|
|
20
|
+
setMode(null);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
return (React.createElement("div", { className: props.className },
|
|
24
|
+
React.createElement(NavGroup, null,
|
|
25
|
+
React.createElement(Nav, { value: props.date.toLocaleString(undefined, { month: 'short' }), onPrev: props.onPrevMonth, onNext: props.onNextMonth, onOpen: function () { return setMode('month'); } }),
|
|
26
|
+
React.createElement(Nav, { value: props.date.getFullYear().toString(), onPrev: props.onPrevYear, onNext: props.onNextYear, onOpen: function () { return setMode('year'); } })),
|
|
27
|
+
mode == 'month' && React.createElement(SimpleList, { value: props.date.getMonth(), items: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], onClick: function (index) { setMode(null); props.onMonth(index); } }),
|
|
28
|
+
mode == 'year' && React.createElement(InfiniteList, { value: props.date.getFullYear(), min: 1900, max: 2100, onClick: function (index) { setMode(null); props.onYear(index); } })));
|
|
29
|
+
};
|
|
30
|
+
var NavGroup = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n height: 48px;\n padding-top: 16px;\n font: ", ";\n"], ["\n display: flex;\n height: 48px;\n padding-top: 16px;\n font: ", ";\n"])), function (p) { return p.theme.font.labelSmall; });
|
|
31
|
+
var Navbar = styled(NavbarBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 64px;\n"], ["\n height: 64px;\n"])));
|
|
32
|
+
export { Navbar };
|
|
33
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
/** @ignore */
|
|
4
|
+
className?: string;
|
|
5
|
+
width: number;
|
|
6
|
+
maxLength: number;
|
|
7
|
+
placeholder: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
value: string;
|
|
10
|
+
onChange: (value: string) => void;
|
|
11
|
+
onBlur?: () => void;
|
|
12
|
+
}
|
|
13
|
+
declare const NumericInput: React.ForwardRefExoticComponent<IProps & React.RefAttributes<HTMLInputElement>>;
|
|
14
|
+
export { NumericInput };
|
|
@@ -0,0 +1,48 @@
|
|
|
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 NumericInputBase = React.forwardRef(function (props, ref) {
|
|
19
|
+
var handleKeyDown = function (e) {
|
|
20
|
+
if (['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(e.key))
|
|
21
|
+
return;
|
|
22
|
+
if (e.key == 'Backspace')
|
|
23
|
+
return;
|
|
24
|
+
if (e.key == 'Delete')
|
|
25
|
+
return;
|
|
26
|
+
if (e.key == 'Tab')
|
|
27
|
+
return;
|
|
28
|
+
if (e.key == 'ArrowLeft')
|
|
29
|
+
return;
|
|
30
|
+
if (e.key == 'ArrowRight')
|
|
31
|
+
return;
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
};
|
|
34
|
+
var handleChange = function (e) {
|
|
35
|
+
if (props.onChange) {
|
|
36
|
+
props.onChange(e.target.value);
|
|
37
|
+
}
|
|
38
|
+
if (e.target.value.length >= props.maxLength) {
|
|
39
|
+
if (props.onBlur)
|
|
40
|
+
props.onBlur();
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
return (React.createElement("input", { className: props.className, ref: ref, type: 'text', tabIndex: 0, value: props.value, onChange: handleChange, disabled: props.disabled, maxLength: props.maxLength, placeholder: props.placeholder, onKeyDown: handleKeyDown }));
|
|
44
|
+
});
|
|
45
|
+
var NumericInputStyled = styled(NumericInputBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n box-sizing: border-box;\n background-clip: padding-box; // Clip background color inside border.\n background-color: transparent;\n border: none;\n text-align: center;\n padding: 0;\n margin: 0;\n outline: none;\n width: ", "px;\n\n // Define colors for selected text.\n &::selection {\n background-color: ", ";\n color: ", ";\n }\n // Define colors for placeholder text.\n &::placeholder {\n color: rgb(from ", " r g b / 50%);\n opacity: 1 !important; /* Firefox applies opacity */\n } \n // Focus:\n &:focus {\n &::placeholder {\n color: rgb(from ", " r g b / 30%);\n }\n } \n // Make sure HTML5 validation does not show up.\n &:valid {\n box-shadow: none;\n }\n &:invalid {\n box-shadow: none;\n } \n // Turn off number spinners.\n &[type=number]::-webkit-inner-spin-button, \n &[type=number]::-webkit-outer-spin-button { \n -webkit-appearance: none; /* Webkit (Chrome) */\n margin: 0; \n } \n &[type=number] {\n appearance:textfield;\n -moz-appearance:textfield; /* Firefox */\n } \n"], ["\n box-sizing: border-box;\n background-clip: padding-box; // Clip background color inside border.\n background-color: transparent;\n border: none;\n text-align: center;\n padding: 0;\n margin: 0;\n outline: none;\n width: ", "px;\n\n // Define colors for selected text.\n &::selection {\n background-color: ", ";\n color: ", ";\n }\n // Define colors for placeholder text.\n &::placeholder {\n color: rgb(from ", " r g b / 50%);\n opacity: 1 !important; /* Firefox applies opacity */\n } \n // Focus:\n &:focus {\n &::placeholder {\n color: rgb(from ", " r g b / 30%);\n }\n } \n // Make sure HTML5 validation does not show up.\n &:valid {\n box-shadow: none;\n }\n &:invalid {\n box-shadow: none;\n } \n // Turn off number spinners.\n &[type=number]::-webkit-inner-spin-button, \n &[type=number]::-webkit-outer-spin-button { \n -webkit-appearance: none; /* Webkit (Chrome) */\n margin: 0; \n } \n &[type=number] {\n appearance:textfield;\n -moz-appearance:textfield; /* Firefox */\n } \n"])), function (p) { return p.width; }, function (p) { return p.theme.colors.primary[2]; }, function (p) { return p.theme.colors.neutral[100]; }, function (p) { return p.theme.colors.primary[3]; }, function (p) { return p.theme.colors.primary[3]; });
|
|
46
|
+
var NumericInput = React.forwardRef(function (props, ref) { return React.createElement(NumericInputStyled, __assign({ ref: ref }, props)); });
|
|
47
|
+
export { NumericInput };
|
|
48
|
+
var templateObject_1;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
/** @ignore */
|
|
4
|
+
className?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Current input value.
|
|
7
|
+
*/
|
|
8
|
+
value: Date;
|
|
9
|
+
/**
|
|
10
|
+
* Marks input as disabled. Disabled inputs cannot be interacted with.
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Removes input border and makes background transparent. This is useful
|
|
16
|
+
* for placing an input in a `Field`.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
transparent?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Is DateInput ghosted?
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
ghost?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* An input can show an error state.
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
error?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* If set, Input's value can be cleared.
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
clearable?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Removes tabIndex from this input.
|
|
37
|
+
*/
|
|
38
|
+
noTabIndex?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Listeners are notified whenever the user interacts with the Input.
|
|
41
|
+
*/
|
|
42
|
+
onChange?: (value: Date) => void;
|
|
43
|
+
onClear?: () => void;
|
|
44
|
+
onCalendar: () => void;
|
|
45
|
+
}
|
|
46
|
+
declare const Selector: (props: IProps) => React.JSX.Element;
|
|
47
|
+
export { Selector };
|