@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,168 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
// Other controls
|
|
3
|
+
import { Hint } from './elements/Hint';
|
|
4
|
+
import { Label } from './elements/Label';
|
|
5
|
+
import { BoxWrapper } from './elements/BoxWrapper';
|
|
6
|
+
import { Validation } from './Validation';
|
|
7
|
+
import { SimpleWrapper } from './elements/SimpleWrapper';
|
|
8
|
+
import { useForm } from './context/useForm';
|
|
9
|
+
/**
|
|
10
|
+
* A `Form.Field` wraps a form control. It serves several purposes.
|
|
11
|
+
*
|
|
12
|
+
* * First, the Field automatically adds `name`, `onChange`, `value` and
|
|
13
|
+
* `error` props to the control it contains. The `onChange` prop is supplied by
|
|
14
|
+
* the `Form` content so that the developer does not need to add it.
|
|
15
|
+
*
|
|
16
|
+
* * Second, the Field performs validation when it is mounted, whenever its
|
|
17
|
+
* control's value changes, and when it is unmounted. Validation results are
|
|
18
|
+
* sent directly to the parent `Form` (a form context is used for this -- a
|
|
19
|
+
* Field must reside inside a form).
|
|
20
|
+
*
|
|
21
|
+
* #### Uncontrolled fields
|
|
22
|
+
* Note that Fields can be used outside of `Form`. These are known as _uncontrolled_.
|
|
23
|
+
* In this case, the Field can still benefit from a label, hint, and validation
|
|
24
|
+
* (since Field keeps an internal value), but `onChange` must be provided by
|
|
25
|
+
* the developer.
|
|
26
|
+
*
|
|
27
|
+
* #### Validations
|
|
28
|
+
* A Form.Field may add any number of validation `rules`, e.g. `required=`.
|
|
29
|
+
* Rules include `required`, `isInt`, `minLength` etc. When a
|
|
30
|
+
* field is first mounted, it is _pristine_. Even when its content is invalid,
|
|
31
|
+
* it will not show any validation error. When the user edits the field, it
|
|
32
|
+
* will no longer be pristine and any errors will appear. The parent Form also
|
|
33
|
+
* provides a `dirty` prop to the Field. When the Form is dirty, so are its
|
|
34
|
+
* fields, and any validation errors are shown, pristine or not.
|
|
35
|
+
*
|
|
36
|
+
* For dark backgrounds, fields may set their contrast prop to true to use
|
|
37
|
+
* lighter error colors.
|
|
38
|
+
*
|
|
39
|
+
* Fields have a `label` and a `hint`. Both are optional. These elements are
|
|
40
|
+
* displayed in different ways based on the field's `wrapper`. Unwrapped Fields
|
|
41
|
+
* do not display label or hint. Other wrappers are `simple` and `box`.
|
|
42
|
+
*/
|
|
43
|
+
var Field = function (props) {
|
|
44
|
+
var form = useForm();
|
|
45
|
+
var ghost = props.ghost || (form && form.ghost);
|
|
46
|
+
var _a = React.useState(true), pristine = _a[0], setPristine = _a[1];
|
|
47
|
+
// Current validation. onValidate is only called when validation state changes.
|
|
48
|
+
// Perform validation immediately:
|
|
49
|
+
var _b = React.useState(Validation.getValidation(props.value, props.rules)), validation = _b[0], setValidation = _b[1];
|
|
50
|
+
// Current field value:
|
|
51
|
+
var _c = React.useState(props.value), value = _c[0], setValue = _c[1];
|
|
52
|
+
var handleChange = function (value) {
|
|
53
|
+
// Set state to NOT pristine.
|
|
54
|
+
setPristine(false);
|
|
55
|
+
setValue(value);
|
|
56
|
+
if (form) {
|
|
57
|
+
form.onChange(props.name, value, !!props.forceupdate);
|
|
58
|
+
}
|
|
59
|
+
else if (props.onChange) {
|
|
60
|
+
props.onChange(value, !!props.forceupdate);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
// Send initial validation on to parent form
|
|
64
|
+
React.useEffect(function () {
|
|
65
|
+
if (form)
|
|
66
|
+
form.onValidate(props.name, validation == null);
|
|
67
|
+
// When field is unmounted, tell parent form that it is valid.
|
|
68
|
+
// Otherwise invalid fields remain in the form's validation state.
|
|
69
|
+
return function () {
|
|
70
|
+
if (form)
|
|
71
|
+
form.onValidate(props.name, true);
|
|
72
|
+
};
|
|
73
|
+
}, []);
|
|
74
|
+
React.useEffect(function () {
|
|
75
|
+
// Set default messages for validation rules.
|
|
76
|
+
var rules = props.rules;
|
|
77
|
+
if (!rules)
|
|
78
|
+
return;
|
|
79
|
+
if (rules.required && !rules.required.message)
|
|
80
|
+
rules.required.message = "This field is required.";
|
|
81
|
+
if (rules.isInt && !rules.isInt.message)
|
|
82
|
+
rules.isInt.message = "Value must be a whole number.";
|
|
83
|
+
if (rules.isFloat && !rules.isFloat.message)
|
|
84
|
+
rules.isFloat.message = "Value must be a valid number.";
|
|
85
|
+
if (rules.min && !rules.min.message)
|
|
86
|
+
rules.min.message = "Value must be at least ".concat(rules.min.value, ".");
|
|
87
|
+
if (rules.max && !rules.max.message)
|
|
88
|
+
rules.max.message = "Value must be at most ".concat(rules.max.value, ".");
|
|
89
|
+
if (rules.between && !rules.between.message)
|
|
90
|
+
rules.between.message = "Value must be between ".concat(rules.between.min, " and ").concat(rules.between.max, ".");
|
|
91
|
+
if (rules.lengthBetween && !rules.lengthBetween.message)
|
|
92
|
+
rules.lengthBetween.message = "Length must be between ".concat(rules.lengthBetween.min, " and ").concat(rules.lengthBetween.max, " characters.");
|
|
93
|
+
if (rules.minLength && !rules.minLength.message)
|
|
94
|
+
rules.minLength.message = "Length must be at least ".concat(rules.minLength.length, " characters.");
|
|
95
|
+
if (rules.maxLength && !rules.maxLength.message)
|
|
96
|
+
rules.maxLength.message = "Length must be at most ".concat(rules.maxLength.length, " characters.");
|
|
97
|
+
if (rules.pattern && !rules.pattern.message)
|
|
98
|
+
rules.pattern.message = "Value does not match expected pattern.";
|
|
99
|
+
if (rules.noPattern && !rules.noPattern.message)
|
|
100
|
+
rules.noPattern.message = "Value does not match expected pattern.";
|
|
101
|
+
if (rules.email && !rules.email.message)
|
|
102
|
+
rules.email.message = "Value must be a valid email address.";
|
|
103
|
+
if (rules.nofuture && !rules.nofuture.message)
|
|
104
|
+
rules.nofuture.message = "Date must not be in the future.";
|
|
105
|
+
if (rules.before && !rules.before.message)
|
|
106
|
+
rules.before.message = "Date must be before ".concat(rules.before.date, ".");
|
|
107
|
+
if (rules.after && !rules.after.message)
|
|
108
|
+
rules.after.message = "Date must be before ".concat(rules.after.date, ".");
|
|
109
|
+
}, [props.rules]);
|
|
110
|
+
//
|
|
111
|
+
// Perform validation when field value changes.
|
|
112
|
+
//
|
|
113
|
+
React.useEffect(function () {
|
|
114
|
+
// Perform validation on field.
|
|
115
|
+
var newValidation = Validation.getValidation(value, props.rules);
|
|
116
|
+
// Only notify parent if validation has changed since last validation.
|
|
117
|
+
if (validation !== newValidation) {
|
|
118
|
+
setValidation(newValidation);
|
|
119
|
+
if (form)
|
|
120
|
+
form.onValidate(props.name, newValidation == null);
|
|
121
|
+
}
|
|
122
|
+
}, [value]);
|
|
123
|
+
// Update local value when value prop changes.
|
|
124
|
+
React.useEffect(function () {
|
|
125
|
+
setValue(props.value);
|
|
126
|
+
}, [props.value]);
|
|
127
|
+
//
|
|
128
|
+
// Get field control.
|
|
129
|
+
//
|
|
130
|
+
var getControl = function (hasError, transparent) {
|
|
131
|
+
return React.cloneElement(props.control, {
|
|
132
|
+
name: props.name,
|
|
133
|
+
onChange: handleChange,
|
|
134
|
+
value: props.value, // Changed from just "value", since that breaks TiptapEditor.
|
|
135
|
+
checked: props.value,
|
|
136
|
+
error: hasError,
|
|
137
|
+
disabled: props.disabled,
|
|
138
|
+
transparent: transparent,
|
|
139
|
+
ghost: ghost,
|
|
140
|
+
// If wrapped, set control to fluid. Otherwise use control's fluid setting:
|
|
141
|
+
fluid: props.wrapper ? true : props.control.fluid
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
var getLabel = function () {
|
|
145
|
+
return props.label &&
|
|
146
|
+
React.createElement(Label, { required: !!props.rules && !!props.rules.required, asterisk: props.asterisk, disabled: props.disabled }, props.label);
|
|
147
|
+
};
|
|
148
|
+
var getHintOrError = function () {
|
|
149
|
+
if (hasError && validation)
|
|
150
|
+
return React.createElement(Hint, { ghost: ghost, error: true }, validation);
|
|
151
|
+
if (props.hint)
|
|
152
|
+
return React.createElement(Hint, { optional: !props.rules || !props.rules.required, ghost: ghost }, props.hint);
|
|
153
|
+
return null;
|
|
154
|
+
};
|
|
155
|
+
var dirty = form ? form.dirty : !pristine;
|
|
156
|
+
var hasError = (!pristine || dirty) && validation != null;
|
|
157
|
+
switch (props.wrapper) {
|
|
158
|
+
case 'simple':
|
|
159
|
+
return (React.createElement(SimpleWrapper, { disabled: props.disabled, weight: props.weight, error: hasError, ghost: ghost, label: getLabel(), hint: getHintOrError() }, getControl(hasError)));
|
|
160
|
+
case 'box':
|
|
161
|
+
return (React.createElement(BoxWrapper, { disabled: props.disabled, weight: props.weight, error: hasError, ghost: ghost, label: getLabel(), hint: getHintOrError() }, getControl(hasError, true)));
|
|
162
|
+
default:
|
|
163
|
+
// A field with no wrapper is just a control. It does benefit from validation.
|
|
164
|
+
return getControl(hasError);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
Field.displayName = "Form.Field";
|
|
168
|
+
export { Field };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
/**
|
|
4
|
+
* @ignore
|
|
5
|
+
*/
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
data: any;
|
|
8
|
+
/**
|
|
9
|
+
* Called whenever form data changes.
|
|
10
|
+
*/
|
|
11
|
+
onChange: (data: any, forceupdate: boolean) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Called whenever a field validates. Returns validation state for whole form.
|
|
14
|
+
*/
|
|
15
|
+
onValidate: (valid: boolean) => void;
|
|
16
|
+
/**
|
|
17
|
+
* When a form is dirty, it shows all validation errors, even
|
|
18
|
+
* on pristine fields.
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
dirty?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* If set, ghost state will be applied to all `Field` elements in the form.
|
|
24
|
+
*/
|
|
25
|
+
ghost?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The `Form` element must be used to wrap all forms. All controls inside a
|
|
29
|
+
* form must be wrapped in `Form.Field` elements.
|
|
30
|
+
*
|
|
31
|
+
* The data that must be shown in the form is provided through the `data` prop,
|
|
32
|
+
* which should be an object.
|
|
33
|
+
*
|
|
34
|
+
* `Form` uses a context to set `onChange` and `onValidate` handlers on all
|
|
35
|
+
* `Form.Field` elements inside the form, whatever their nesting depth. When
|
|
36
|
+
* form data is changed, `onChange` is triggered with the new form content.
|
|
37
|
+
*
|
|
38
|
+
* The `Form.Field` element keeps its own state so that updates to the form are
|
|
39
|
+
* reflected without changing the form's `data` prop. This way, should a caller
|
|
40
|
+
* of `Form` choose to, they may update the form data only when required (such
|
|
41
|
+
* as when setting the `dirty` flag), which avoid rerendering all form elements
|
|
42
|
+
* on every interaction.
|
|
43
|
+
*/
|
|
44
|
+
declare const Form: {
|
|
45
|
+
(props: IProps): React.JSX.Element;
|
|
46
|
+
Field: {
|
|
47
|
+
(props: import("./Field").IProps): React.JSX.Element;
|
|
48
|
+
displayName: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export { Form, IProps };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
// Other controls
|
|
3
|
+
import { Field } from './Field';
|
|
4
|
+
import { FormContext } from './context/FormContext';
|
|
5
|
+
/**
|
|
6
|
+
* The `Form` element must be used to wrap all forms. All controls inside a
|
|
7
|
+
* form must be wrapped in `Form.Field` elements.
|
|
8
|
+
*
|
|
9
|
+
* The data that must be shown in the form is provided through the `data` prop,
|
|
10
|
+
* which should be an object.
|
|
11
|
+
*
|
|
12
|
+
* `Form` uses a context to set `onChange` and `onValidate` handlers on all
|
|
13
|
+
* `Form.Field` elements inside the form, whatever their nesting depth. When
|
|
14
|
+
* form data is changed, `onChange` is triggered with the new form content.
|
|
15
|
+
*
|
|
16
|
+
* The `Form.Field` element keeps its own state so that updates to the form are
|
|
17
|
+
* reflected without changing the form's `data` prop. This way, should a caller
|
|
18
|
+
* of `Form` choose to, they may update the form data only when required (such
|
|
19
|
+
* as when setting the `dirty` flag), which avoid rerendering all form elements
|
|
20
|
+
* on every interaction.
|
|
21
|
+
*/
|
|
22
|
+
var Form = function (props) {
|
|
23
|
+
// Build a form-wide validation object, with
|
|
24
|
+
// an entry for each field.
|
|
25
|
+
var validations = React.useRef(new Map());
|
|
26
|
+
// Form is assumed to be valid on the outset. When fields are mounted, they'll
|
|
27
|
+
// run their own validations and notify this form. The validation state may
|
|
28
|
+
// change then.
|
|
29
|
+
var _a = React.useState(true), valid = _a[0], setValid = _a[1];
|
|
30
|
+
var handleChange = function (name, value, forceupdate) {
|
|
31
|
+
// Break up field name into fields:
|
|
32
|
+
// E.g. if name is "investigators[0].name"
|
|
33
|
+
var fields = name.split('.');
|
|
34
|
+
// .. fields will be:
|
|
35
|
+
// * field[0] = "investigators[0]"
|
|
36
|
+
// * fields[1] = "name"
|
|
37
|
+
// Start off at the main data object:
|
|
38
|
+
var current = {};
|
|
39
|
+
// Loop through fields:
|
|
40
|
+
fields.forEach(function (field) {
|
|
41
|
+
// If field has brackets, then set current to
|
|
42
|
+
// object that the array index points to:
|
|
43
|
+
var bracketIdx = field.indexOf('[');
|
|
44
|
+
if (bracketIdx != -1) {
|
|
45
|
+
var fieldName = field.substring(0, bracketIdx);
|
|
46
|
+
var index = parseInt(field.substring(bracketIdx + 1, field.length - 1));
|
|
47
|
+
current = current[fieldName][index];
|
|
48
|
+
}
|
|
49
|
+
// If there are no brackets (which would be the
|
|
50
|
+
// case for the last field) then assign the new
|
|
51
|
+
// value to current.
|
|
52
|
+
else {
|
|
53
|
+
current[field] = value;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
// Inform parent of data change:
|
|
57
|
+
props.onChange(current, forceupdate);
|
|
58
|
+
};
|
|
59
|
+
var handleValidate = function (name, _valid) {
|
|
60
|
+
validations.current.set(name, _valid);
|
|
61
|
+
var isValid = true;
|
|
62
|
+
validations.current.forEach(function (x) {
|
|
63
|
+
isValid = isValid && x;
|
|
64
|
+
});
|
|
65
|
+
// Parent component is only notified if validation state changes,
|
|
66
|
+
// in order to avoid an infinite loop of updates.
|
|
67
|
+
if (isValid !== valid) {
|
|
68
|
+
setValid(isValid);
|
|
69
|
+
props.onValidate(isValid);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
// Test code to show currently-focused element:
|
|
73
|
+
/*
|
|
74
|
+
const showActive = () => {
|
|
75
|
+
console.log(document.activeElement);
|
|
76
|
+
setTimeout(() => {
|
|
77
|
+
showActive();
|
|
78
|
+
}, 1000);
|
|
79
|
+
}
|
|
80
|
+
setTimeout(() => { showActive(); }, 1000); */
|
|
81
|
+
return (React.createElement(FormContext.Provider, { value: {
|
|
82
|
+
onChange: handleChange,
|
|
83
|
+
onValidate: handleValidate,
|
|
84
|
+
dirty: props.dirty,
|
|
85
|
+
ghost: props.ghost
|
|
86
|
+
} }, props.children));
|
|
87
|
+
};
|
|
88
|
+
Form.Field = Field;
|
|
89
|
+
export { Form };
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
interface IValidation {
|
|
2
|
+
/**
|
|
3
|
+
* Validation message. Can be JSX.
|
|
4
|
+
*/
|
|
5
|
+
message?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
interface IFloatValidation extends IValidation {
|
|
8
|
+
/**
|
|
9
|
+
* Optional floating point separator.
|
|
10
|
+
* @default .
|
|
11
|
+
*/
|
|
12
|
+
separator?: string;
|
|
13
|
+
}
|
|
14
|
+
interface IValueValidation extends IValidation {
|
|
15
|
+
/**
|
|
16
|
+
* Value to check against.
|
|
17
|
+
*/
|
|
18
|
+
value: number;
|
|
19
|
+
}
|
|
20
|
+
interface IBetweenValidation extends IValidation {
|
|
21
|
+
/**
|
|
22
|
+
* Minimum value.
|
|
23
|
+
*/
|
|
24
|
+
min: number;
|
|
25
|
+
/**
|
|
26
|
+
* Maximum value.
|
|
27
|
+
*/
|
|
28
|
+
max: number;
|
|
29
|
+
}
|
|
30
|
+
interface ILengthValidation extends IValidation {
|
|
31
|
+
/**
|
|
32
|
+
* Length value to check against.
|
|
33
|
+
*/
|
|
34
|
+
length: number;
|
|
35
|
+
}
|
|
36
|
+
interface IPatternValidation extends IValidation {
|
|
37
|
+
/**
|
|
38
|
+
* Regular expression pattern to check (as a string).
|
|
39
|
+
*/
|
|
40
|
+
pattern: string;
|
|
41
|
+
}
|
|
42
|
+
interface IDateValidation extends IValidation {
|
|
43
|
+
date: string;
|
|
44
|
+
}
|
|
45
|
+
interface IValidationProps {
|
|
46
|
+
/**
|
|
47
|
+
* Required validation. Field must be filled out.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* <Field ... required={{message: "Required field"}}>
|
|
51
|
+
*/
|
|
52
|
+
required?: IValidation;
|
|
53
|
+
/**
|
|
54
|
+
* Integer validation.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* <Field ... isInt={{message: "Must be an integer value"}}>
|
|
58
|
+
*/
|
|
59
|
+
isInt?: IValidation;
|
|
60
|
+
/**
|
|
61
|
+
* Float validation.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* <Field ... isFloat={{message: "Must be a float value"}}>
|
|
65
|
+
*/
|
|
66
|
+
isFloat?: IFloatValidation;
|
|
67
|
+
/**
|
|
68
|
+
* Minimum number value validation.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* <Field ... min={{value:3, message: "Must be at least 3."}}>
|
|
72
|
+
*/
|
|
73
|
+
min?: IValueValidation;
|
|
74
|
+
/**
|
|
75
|
+
* Maximum number value validation.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* <Field ... max={{value:100, message: "Must be at most 100."}}>
|
|
79
|
+
*/
|
|
80
|
+
max?: IValueValidation;
|
|
81
|
+
/**
|
|
82
|
+
* Between numbers valdation.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* <Field ... between={{min:3, max:25, message: "Must be 3..25 inclusive"}}>
|
|
86
|
+
*/
|
|
87
|
+
between?: IBetweenValidation;
|
|
88
|
+
/**
|
|
89
|
+
* String length range validation.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* <Field ... lengthBetween={{min: 3, max: 25; message: "Must be 3..25 characters."}}>
|
|
93
|
+
*/
|
|
94
|
+
lengthBetween?: IBetweenValidation;
|
|
95
|
+
/**
|
|
96
|
+
* String length minimum validation.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* <Field ... minLength={{length: 3, message: "Must be at least 3 characters."}}>
|
|
100
|
+
*/
|
|
101
|
+
minLength?: ILengthValidation;
|
|
102
|
+
/**
|
|
103
|
+
* String length maximum validation.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* <Field ... maxLength={{length: 25, message: "Must be no more than 25 characters."}}>
|
|
107
|
+
*/
|
|
108
|
+
maxLength?: ILengthValidation;
|
|
109
|
+
/**
|
|
110
|
+
* Pattern validation.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* <Field ... pattern={{pattern: "a+", message: "Must have pattern a+"}}>
|
|
114
|
+
*/
|
|
115
|
+
pattern?: IPatternValidation;
|
|
116
|
+
/**
|
|
117
|
+
* Negative pattern validation.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* <Field ... noPattern={{pattern: "a+", message: "Must NOT have pattern a+"}}>
|
|
121
|
+
*/
|
|
122
|
+
noPattern?: IPatternValidation;
|
|
123
|
+
/**
|
|
124
|
+
* Email validation.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* <Field ... email={{message: "Must be a valid email address."}}>
|
|
128
|
+
*/
|
|
129
|
+
email?: IValidation;
|
|
130
|
+
/**
|
|
131
|
+
* Date validation: cannot be future date.
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* <Field ... nofuture={{message: "Date must not be in the future."}}>
|
|
135
|
+
*/
|
|
136
|
+
nofuture?: IValidation;
|
|
137
|
+
/**
|
|
138
|
+
* Date validation: date must be before or equal to specified date.
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* <Field ... before={{day: "2004-01-01", message: "Date must not be before 2004-01-01."}}>
|
|
142
|
+
*/
|
|
143
|
+
before?: IDateValidation;
|
|
144
|
+
/**
|
|
145
|
+
* Date validation: date must be after or equal to specified date.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* <Field ... after={{day: "2004-01-01", message: "Date must not be after 2004-01-01."}}>
|
|
149
|
+
*/
|
|
150
|
+
after?: IDateValidation;
|
|
151
|
+
}
|
|
152
|
+
declare class Validation {
|
|
153
|
+
/**
|
|
154
|
+
* Verify that field has a value.
|
|
155
|
+
*/
|
|
156
|
+
private static validateRequired;
|
|
157
|
+
/**
|
|
158
|
+
* Verify that value is an integer number.
|
|
159
|
+
*/
|
|
160
|
+
private static validateInt;
|
|
161
|
+
private static validateFloat;
|
|
162
|
+
/**
|
|
163
|
+
* Verify that value has a minimum numerical value.
|
|
164
|
+
*/
|
|
165
|
+
private static validateMin;
|
|
166
|
+
/**
|
|
167
|
+
* Verify that value has a maximum numerical value.
|
|
168
|
+
*/
|
|
169
|
+
private static validateMax;
|
|
170
|
+
/**
|
|
171
|
+
* Verify that value falls in a numerical range (inclusive).
|
|
172
|
+
*/
|
|
173
|
+
private static validateBetween;
|
|
174
|
+
/**
|
|
175
|
+
* Verify that value is a string of minimum length.
|
|
176
|
+
*/
|
|
177
|
+
private static validateMinLength;
|
|
178
|
+
/**
|
|
179
|
+
* Verify that value is a string of maximum length.
|
|
180
|
+
*/
|
|
181
|
+
private static validateMaxLength;
|
|
182
|
+
/**
|
|
183
|
+
* Verify that value is a string of length between minimum and maximum.
|
|
184
|
+
*/
|
|
185
|
+
private static validateLengthBetween;
|
|
186
|
+
/**
|
|
187
|
+
* Verify that value satisfies a pattern.
|
|
188
|
+
*/
|
|
189
|
+
private static validatePattern;
|
|
190
|
+
/**
|
|
191
|
+
* Verify that value does not satisfy a pattern.
|
|
192
|
+
*/
|
|
193
|
+
private static validateNotPattern;
|
|
194
|
+
/**
|
|
195
|
+
* Verify that values is a valid email address.
|
|
196
|
+
*/
|
|
197
|
+
private static validateEmail;
|
|
198
|
+
/**
|
|
199
|
+
* Verify that value is before today.
|
|
200
|
+
*/
|
|
201
|
+
private static validateNofuture;
|
|
202
|
+
/**
|
|
203
|
+
* Verify that value is before date.
|
|
204
|
+
*/
|
|
205
|
+
private static validateBefore;
|
|
206
|
+
/**
|
|
207
|
+
* Verify that value is after date.
|
|
208
|
+
*/
|
|
209
|
+
private static validateAfter;
|
|
210
|
+
static getValidation: (value: any, rules: IValidationProps) => React.ReactNode;
|
|
211
|
+
}
|
|
212
|
+
export { IValidationProps, Validation };
|