grommet 2.23.0 → 2.25.1
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/all/stories/AllComponents.js +2 -7
- package/components/Accordion/Accordion.js +1 -1
- package/components/Accordion/propTypes.js +1 -1
- package/components/Accordion/stories/CustomThemed/Custom.js +3 -2
- package/components/AccordionPanel/AccordionPanel.js +2 -1
- package/components/Anchor/Anchor.js +3 -4
- package/components/Anchor/propTypes.js +1 -1
- package/components/Avatar/Avatar.js +1 -1
- package/components/Box/Box.js +1 -1
- package/components/Box/StyledBox.js +1 -1
- package/components/Box/propTypes.js +1 -1
- package/components/Button/Button.js +1 -1
- package/components/Button/propTypes.js +2 -2
- package/components/Button/stories/Basic.js +1 -1
- package/components/Button/stories/Fill.js +1 -1
- package/components/Button/stories/Kind.js +1 -1
- package/components/Calendar/Calendar.js +233 -293
- package/components/Calendar/index.d.ts +2 -2
- package/components/Calendar/propTypes.js +1 -1
- package/components/Calendar/stories/ShowAdjacentDays.js +1 -1
- package/components/Calendar/utils.js +16 -129
- package/components/Card/Card.js +1 -1
- package/components/Card/stories/CustomThemed/Clickable.js +1 -1
- package/components/Card/stories/CustomThemed/RichFooter.js +1 -1
- package/components/Card/stories/CustomThemed/Themed.js +1 -1
- package/components/CardBody/CardBody.js +1 -1
- package/components/CardFooter/CardFooter.js +1 -1
- package/components/CardHeader/CardHeader.js +1 -1
- package/components/Carousel/Carousel.js +1 -1
- package/components/Carousel/propTypes.js +1 -1
- package/components/Carousel/stories/CustomThemed/Custom.js +1 -1
- package/components/Chart/Chart.js +1 -1
- package/components/Chart/calcs.js +44 -27
- package/components/Chart/index.d.ts +28 -2
- package/components/Chart/propTypes.js +1 -1
- package/components/Chart/stories/Rich.js +1 -1
- package/components/Chart/stories/Scan.js +11 -9
- package/components/Chart/stories/Window.js +1 -1
- package/components/Chart/stories/data.js +16 -17
- package/components/CheckBox/CheckBox.js +4 -3
- package/components/CheckBox/stories/CustomThemed/Custom.js +1 -1
- package/components/CheckBox/stories/CustomThemed/CustomToggle.js +1 -1
- package/components/CheckBox/stories/NoLabel.js +1 -1
- package/components/CheckBox/stories/Simple.js +1 -1
- package/components/CheckBoxGroup/CheckBoxGroup.js +1 -1
- package/components/CheckBoxGroup/index.d.ts +1 -3
- package/components/Clock/Analog.js +1 -1
- package/components/Clock/Clock.js +1 -1
- package/components/Clock/Digital.js +1 -1
- package/components/Clock/propTypes.js +1 -1
- package/components/Collapsible/stories/Nested.js +1 -1
- package/components/Collapsible/stories/Simple.js +1 -1
- package/components/DataChart/DataChart.js +11 -42
- package/components/DataChart/Detail.js +18 -11
- package/components/DataChart/Legend.js +1 -1
- package/components/DataChart/Swatch.js +64 -23
- package/components/DataChart/XAxis.js +1 -1
- package/components/DataChart/YGuide.js +1 -1
- package/components/DataChart/propTypes.js +1 -1
- package/components/DataChart/stories/Legend.js +6 -2
- package/components/DataChart/stories/Pad.js +54 -0
- package/components/DataChart/utils.js +11 -1
- package/components/DataTable/Body.js +11 -5
- package/components/DataTable/Cell.js +1 -1
- package/components/DataTable/DataTable.js +1 -1
- package/components/DataTable/ExpanderCell.js +1 -1
- package/components/DataTable/Footer.js +1 -1
- package/components/DataTable/GroupedBody.js +1 -1
- package/components/DataTable/Header.js +1 -1
- package/components/DataTable/Resizer.js +1 -1
- package/components/DataTable/Sorter.js +1 -1
- package/components/DataTable/propTypes.js +1 -1
- package/components/DataTable/stories/Controlled.js +1 -1
- package/components/DataTable/stories/ControlledGrouped.js +1 -1
- package/components/DataTable/stories/CustomThemed/Fill.js +1 -1
- package/components/DataTable/stories/GroupedOnSelect.js +1 -1
- package/components/DataTable/stories/OnUpdate.js +1 -1
- package/components/DataTable/stories/Served.js +1 -1
- package/components/DataTable/stories/Sort.js +1 -1
- package/components/DataTable/stories/SpaceX.js +6 -4
- package/components/DataTable/stories/SpaceXUngrouped.js +4 -2
- package/components/DataTable/stories/Tunable.js +1 -1
- package/components/DataTable/stories/data.js +1 -1
- package/components/DataTable/stories/rowDetails.js +1 -1
- package/components/DateInput/DateInput.js +89 -92
- package/components/DateInput/index.d.ts +1 -0
- package/components/DateInput/propTypes.js +1 -0
- package/components/DateInput/stories/Format.js +14 -1
- package/components/DateInput/utils.js +31 -6
- package/components/Diagram/Diagram.js +1 -1
- package/components/Diagram/stories/Animated.js +1 -1
- package/components/Diagram/stories/Progressing.js +1 -1
- package/components/Distribution/Distribution.js +1 -1
- package/components/Distribution/propTypes.js +1 -1
- package/components/Drop/Drop.js +1 -1
- package/components/Drop/DropContainer.js +7 -3
- package/components/DropButton/DropButton.js +1 -1
- package/components/DropButton/propTypes.js +1 -1
- package/components/FileInput/FileInput.js +28 -9
- package/components/FileInput/StyledFileInput.js +1 -1
- package/components/FileInput/index.d.ts +6 -1
- package/components/FileInput/stories/Multiple.js +1 -0
- package/components/FocusedContainer.js +1 -1
- package/components/Footer/Footer.js +1 -1
- package/components/Footer/stories/DoubleFooter.js +1 -1
- package/components/Footer/stories/Sitemap.js +1 -1
- package/components/Form/Form.js +7 -2
- package/components/Form/stories/ArrayOfFormFields.js +1 -1
- package/components/Form/stories/CustomThemed/FieldSpacingOptions.js +1 -1
- package/components/Form/stories/HelpAndError.js +1 -1
- package/components/FormField/FormField.js +26 -29
- package/components/Grid/Grid.js +5 -3
- package/components/Grid/README.md +0 -2
- package/components/Grid/index.d.ts +9 -3
- package/components/Grid/propTypes.js +1 -1
- package/components/Grid/stories/CustomThemed/Responsive.js +1 -1
- package/components/Grid/stories/typescript/App.tsx +42 -48
- package/components/Grommet/Grommet.js +1 -1
- package/components/Header/Header.js +1 -1
- package/components/Heading/Heading.js +1 -1
- package/components/Heading/propTypes.js +1 -1
- package/components/Image/Image.js +5 -3
- package/components/Image/propTypes.js +1 -1
- package/components/InfiniteScroll/stories/Basics.js +1 -1
- package/components/InfiniteScroll/stories/ClassChildren.js +1 -1
- package/components/InfiniteScroll/stories/Marker.js +1 -1
- package/components/InfiniteScroll/stories/Show.js +1 -1
- package/components/InfiniteScroll/stories/ShowAfter.js +1 -1
- package/components/InfiniteScroll/stories/ShowBefore.js +1 -1
- package/components/Layer/Layer.js +2 -2
- package/components/Layer/LayerContainer.js +7 -3
- package/components/List/List.js +104 -41
- package/components/List/index.d.ts +3 -1
- package/components/List/propTypes.js +4 -2
- package/components/List/stories/Disabled.js +33 -0
- package/components/Main/Main.js +1 -1
- package/components/Markdown/Markdown.js +1 -1
- package/components/MaskedInput/MaskedInput.js +37 -28
- package/components/Menu/Menu.js +105 -61
- package/components/Menu/index.d.ts +2 -2
- package/components/Menu/propTypes.js +2 -2
- package/components/Menu/stories/Grouped.js +52 -0
- package/components/Meter/Bar.js +1 -1
- package/components/Meter/Circle.js +5 -3
- package/components/Meter/Meter.js +1 -1
- package/components/Meter/propTypes.js +1 -1
- package/components/NameValueList/NameValueList.js +1 -1
- package/components/NameValuePair/NameValuePair.js +1 -1
- package/components/Nav/Nav.js +1 -1
- package/components/Nav/stories/CustomThemed/JustifySidebar.js +1 -1
- package/components/Nav/stories/Sidebar.js +1 -1
- package/components/Notification/Notification.js +18 -9
- package/components/Notification/index.d.ts +2 -1
- package/components/Notification/propTypes.js +2 -1
- package/components/Page/Page.js +1 -1
- package/components/PageContent/PageContent.js +1 -1
- package/components/PageHeader/PageHeader.js +80 -0
- package/components/PageHeader/index.d.ts +26 -0
- package/components/PageHeader/index.js +8 -0
- package/components/PageHeader/propTypes.js +30 -0
- package/components/PageHeader/stories/Custom.js +47 -0
- package/components/PageHeader/stories/MultipleActions.js +79 -0
- package/components/PageHeader/stories/Responsive.js +37 -0
- package/components/PageHeader/stories/Simple.js +36 -0
- package/components/Pagination/PageControl.js +1 -1
- package/components/Pagination/Pagination.js +1 -1
- package/components/Pagination/propTypes.js +1 -1
- package/components/Paragraph/Paragraph.js +1 -1
- package/components/Paragraph/StyledParagraph.js +7 -1
- package/components/Paragraph/index.d.ts +1 -0
- package/components/Paragraph/propTypes.js +2 -1
- package/components/Paragraph/stories/MaxLines.js +37 -0
- package/components/RadioButton/RadioButton.js +1 -1
- package/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/components/RadioButtonGroup/index.d.ts +2 -1
- package/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.js +1 -1
- package/components/RadioButtonGroup/stories/Disabled.js +1 -1
- package/components/RangeInput/RangeInput.js +1 -1
- package/components/RangeSelector/EdgeControl.js +1 -1
- package/components/RangeSelector/RangeSelector.js +1 -1
- package/components/RangeSelector/stories/CustomThemed/Custom.js +1 -1
- package/components/RangeSelector/stories/CustomThemed/CustomEdgeControl.js +1 -1
- package/components/RangeSelector/stories/Step.js +1 -1
- package/components/RangeSelector/stories/Vertical.js +1 -1
- package/components/RoutedAnchor/RoutedAnchor.js +2 -2
- package/components/RoutedButton/RoutedButton.js +2 -2
- package/components/Select/Select.js +11 -32
- package/components/Select/SelectContainer.js +34 -37
- package/components/Select/propTypes.js +1 -1
- package/components/Select/stories/components/SearchBorderBox.js +1 -1
- package/components/Select/stories/components/SearchInput.js +1 -1
- package/components/Sidebar/Sidebar.js +1 -1
- package/components/Sidebar/stories/Labels.js +1 -1
- package/components/SkipLink/SkipLink.js +1 -1
- package/components/SkipLinkTarget/SkipLinkTarget.js +1 -1
- package/components/Spinner/Spinner.js +1 -1
- package/components/Stack/Stack.js +1 -1
- package/components/Stack/propTypes.js +1 -1
- package/components/Tab/StyledTab.js +2 -2
- package/components/Tab/Tab.js +35 -17
- package/components/Table/StyledTable.js +1 -1
- package/components/Table/propTypes.js +1 -1
- package/components/TableBody/TableBody.js +1 -1
- package/components/TableCell/TableCell.js +1 -1
- package/components/TableFooter/TableFooter.js +1 -1
- package/components/TableHeader/TableHeader.js +1 -1
- package/components/TableRow/TableRow.js +1 -1
- package/components/Tabs/Tabs.js +233 -11
- package/components/Tabs/propTypes.js +1 -1
- package/components/Tabs/stories/Responsive.js +18 -0
- package/components/Tag/Tag.js +1 -1
- package/components/Tag/propTypes.js +1 -1
- package/components/Text/Text.js +1 -1
- package/components/Text/propTypes.js +1 -1
- package/components/TextArea/TextArea.js +1 -1
- package/components/TextArea/stories/NonResizable.js +1 -1
- package/components/TextArea/stories/Simple.js +1 -1
- package/components/TextInput/TextInput.js +33 -4
- package/components/TextInput/stories/DefaultSuggestion.js +1 -0
- package/components/TextInput/stories/InsideFormField.js +1 -1
- package/components/TextInput/stories/Suggestions.js +1 -0
- package/components/TextInput/stories/WithTags.js +1 -1
- package/components/Tip/Tip.js +22 -29
- package/components/Video/StyledVideo.js +2 -2
- package/components/Video/Video.js +101 -47
- package/components/Video/index.d.ts +1 -0
- package/components/Video/propTypes.js +2 -2
- package/components/Video/stories/typescript/ControlsBelow.tsx +6 -2
- package/components/WorldMap/WorldMap.js +1 -1
- package/components/WorldMap/propTypes.js +1 -1
- package/components/WorldMap/stories/Places.js +1 -1
- package/components/index.d.ts +1 -0
- package/components/index.js +8 -0
- package/contexts/AnnounceContext/stories/Assertive.js +1 -1
- package/contexts/ResponsiveContext/stories/ResponsiveGrid.js +1 -1
- package/es6/all/stories/AllComponents.js +2 -7
- package/es6/components/Accordion/Accordion.js +1 -1
- package/es6/components/Accordion/propTypes.js +1 -1
- package/es6/components/Accordion/stories/CustomThemed/Custom.js +3 -2
- package/es6/components/AccordionPanel/AccordionPanel.js +2 -1
- package/es6/components/Anchor/Anchor.js +3 -4
- package/es6/components/Anchor/propTypes.js +1 -1
- package/es6/components/Avatar/Avatar.js +1 -1
- package/es6/components/Box/Box.js +1 -1
- package/es6/components/Box/StyledBox.js +1 -1
- package/es6/components/Box/propTypes.js +1 -1
- package/es6/components/Button/Button.js +1 -1
- package/es6/components/Button/propTypes.js +2 -2
- package/es6/components/Button/stories/Basic.js +1 -1
- package/es6/components/Button/stories/Fill.js +1 -1
- package/es6/components/Button/stories/Kind.js +1 -1
- package/es6/components/Calendar/Calendar.js +231 -293
- package/es6/components/Calendar/index.d.ts +2 -2
- package/es6/components/Calendar/propTypes.js +1 -1
- package/es6/components/Calendar/stories/ShowAdjacentDays.js +1 -1
- package/es6/components/Calendar/utils.js +13 -114
- package/es6/components/Card/Card.js +1 -1
- package/es6/components/Card/stories/CustomThemed/Clickable.js +1 -1
- package/es6/components/Card/stories/CustomThemed/RichFooter.js +1 -1
- package/es6/components/Card/stories/CustomThemed/Themed.js +1 -1
- package/es6/components/CardBody/CardBody.js +1 -1
- package/es6/components/CardFooter/CardFooter.js +1 -1
- package/es6/components/CardHeader/CardHeader.js +1 -1
- package/es6/components/Carousel/Carousel.js +1 -1
- package/es6/components/Carousel/propTypes.js +1 -1
- package/es6/components/Carousel/stories/CustomThemed/Custom.js +1 -1
- package/es6/components/Chart/Chart.js +1 -1
- package/es6/components/Chart/calcs.js +44 -27
- package/es6/components/Chart/index.d.ts +28 -2
- package/es6/components/Chart/propTypes.js +1 -1
- package/es6/components/Chart/stories/Rich.js +1 -1
- package/es6/components/Chart/stories/Scan.js +10 -9
- package/es6/components/Chart/stories/Window.js +1 -1
- package/es6/components/Chart/stories/data.js +16 -17
- package/es6/components/CheckBox/CheckBox.js +4 -3
- package/es6/components/CheckBox/stories/CustomThemed/Custom.js +1 -1
- package/es6/components/CheckBox/stories/CustomThemed/CustomToggle.js +1 -1
- package/es6/components/CheckBox/stories/NoLabel.js +1 -1
- package/es6/components/CheckBox/stories/Simple.js +1 -1
- package/es6/components/CheckBoxGroup/CheckBoxGroup.js +1 -1
- package/es6/components/CheckBoxGroup/index.d.ts +1 -3
- package/es6/components/Clock/Analog.js +1 -1
- package/es6/components/Clock/Clock.js +1 -1
- package/es6/components/Clock/Digital.js +1 -1
- package/es6/components/Clock/propTypes.js +1 -1
- package/es6/components/Collapsible/stories/Nested.js +1 -1
- package/es6/components/Collapsible/stories/Simple.js +1 -1
- package/es6/components/DataChart/DataChart.js +13 -44
- package/es6/components/DataChart/Detail.js +20 -10
- package/es6/components/DataChart/Legend.js +1 -1
- package/es6/components/DataChart/Swatch.js +64 -23
- package/es6/components/DataChart/XAxis.js +1 -1
- package/es6/components/DataChart/YGuide.js +1 -1
- package/es6/components/DataChart/propTypes.js +1 -1
- package/es6/components/DataChart/stories/Legend.js +6 -2
- package/es6/components/DataChart/stories/Pad.js +42 -0
- package/es6/components/DataChart/utils.js +7 -0
- package/es6/components/DataTable/Body.js +10 -5
- package/es6/components/DataTable/Cell.js +1 -1
- package/es6/components/DataTable/DataTable.js +1 -1
- package/es6/components/DataTable/ExpanderCell.js +1 -1
- package/es6/components/DataTable/Footer.js +1 -1
- package/es6/components/DataTable/GroupedBody.js +1 -1
- package/es6/components/DataTable/Header.js +1 -1
- package/es6/components/DataTable/Resizer.js +1 -1
- package/es6/components/DataTable/Sorter.js +1 -1
- package/es6/components/DataTable/propTypes.js +1 -1
- package/es6/components/DataTable/stories/Controlled.js +1 -1
- package/es6/components/DataTable/stories/ControlledGrouped.js +1 -1
- package/es6/components/DataTable/stories/CustomThemed/Fill.js +1 -1
- package/es6/components/DataTable/stories/GroupedOnSelect.js +1 -1
- package/es6/components/DataTable/stories/OnUpdate.js +1 -1
- package/es6/components/DataTable/stories/Served.js +1 -1
- package/es6/components/DataTable/stories/Sort.js +1 -1
- package/es6/components/DataTable/stories/SpaceX.js +6 -4
- package/es6/components/DataTable/stories/SpaceXUngrouped.js +4 -2
- package/es6/components/DataTable/stories/Tunable.js +1 -1
- package/es6/components/DataTable/stories/data.js +1 -1
- package/es6/components/DataTable/stories/rowDetails.js +1 -1
- package/es6/components/DateInput/DateInput.js +85 -88
- package/es6/components/DateInput/index.d.ts +1 -0
- package/es6/components/DateInput/propTypes.js +1 -0
- package/es6/components/DateInput/stories/Format.js +14 -1
- package/es6/components/DateInput/utils.js +30 -8
- package/es6/components/Diagram/Diagram.js +1 -1
- package/es6/components/Diagram/stories/Animated.js +1 -1
- package/es6/components/Diagram/stories/Progressing.js +1 -1
- package/es6/components/Distribution/Distribution.js +1 -1
- package/es6/components/Distribution/propTypes.js +1 -1
- package/es6/components/Drop/Drop.js +1 -1
- package/es6/components/Drop/DropContainer.js +5 -3
- package/es6/components/DropButton/DropButton.js +1 -1
- package/es6/components/DropButton/propTypes.js +1 -1
- package/es6/components/FileInput/FileInput.js +28 -9
- package/es6/components/FileInput/StyledFileInput.js +1 -1
- package/es6/components/FileInput/index.d.ts +6 -1
- package/es6/components/FileInput/stories/Multiple.js +1 -0
- package/es6/components/FocusedContainer.js +1 -1
- package/es6/components/Footer/Footer.js +1 -1
- package/es6/components/Footer/stories/DoubleFooter.js +1 -1
- package/es6/components/Footer/stories/Sitemap.js +1 -1
- package/es6/components/Form/Form.js +7 -2
- package/es6/components/Form/stories/ArrayOfFormFields.js +1 -1
- package/es6/components/Form/stories/CustomThemed/FieldSpacingOptions.js +1 -1
- package/es6/components/Form/stories/HelpAndError.js +1 -1
- package/es6/components/FormField/FormField.js +26 -30
- package/es6/components/Grid/Grid.js +5 -3
- package/es6/components/Grid/README.md +0 -2
- package/es6/components/Grid/index.d.ts +9 -3
- package/es6/components/Grid/propTypes.js +1 -1
- package/es6/components/Grid/stories/CustomThemed/Responsive.js +1 -1
- package/es6/components/Grid/stories/typescript/App.tsx +42 -48
- package/es6/components/Grommet/Grommet.js +1 -1
- package/es6/components/Header/Header.js +1 -1
- package/es6/components/Heading/Heading.js +1 -1
- package/es6/components/Heading/propTypes.js +1 -1
- package/es6/components/Image/Image.js +5 -3
- package/es6/components/Image/propTypes.js +1 -1
- package/es6/components/InfiniteScroll/stories/Basics.js +1 -1
- package/es6/components/InfiniteScroll/stories/ClassChildren.js +1 -1
- package/es6/components/InfiniteScroll/stories/Marker.js +1 -1
- package/es6/components/InfiniteScroll/stories/Show.js +1 -1
- package/es6/components/InfiniteScroll/stories/ShowAfter.js +1 -1
- package/es6/components/InfiniteScroll/stories/ShowBefore.js +1 -1
- package/es6/components/Layer/Layer.js +2 -2
- package/es6/components/Layer/LayerContainer.js +5 -3
- package/es6/components/List/List.js +105 -42
- package/es6/components/List/index.d.ts +3 -1
- package/es6/components/List/propTypes.js +4 -2
- package/es6/components/List/stories/Disabled.js +20 -0
- package/es6/components/Main/Main.js +1 -1
- package/es6/components/Markdown/Markdown.js +1 -1
- package/es6/components/MaskedInput/MaskedInput.js +38 -29
- package/es6/components/Menu/Menu.js +106 -61
- package/es6/components/Menu/index.d.ts +2 -2
- package/es6/components/Menu/propTypes.js +2 -2
- package/es6/components/Menu/stories/Grouped.js +40 -0
- package/es6/components/Meter/Bar.js +1 -1
- package/es6/components/Meter/Circle.js +5 -3
- package/es6/components/Meter/Meter.js +1 -1
- package/es6/components/Meter/propTypes.js +1 -1
- package/es6/components/NameValueList/NameValueList.js +1 -1
- package/es6/components/NameValuePair/NameValuePair.js +1 -1
- package/es6/components/Nav/Nav.js +1 -1
- package/es6/components/Nav/stories/CustomThemed/JustifySidebar.js +1 -1
- package/es6/components/Nav/stories/Sidebar.js +1 -1
- package/es6/components/Notification/Notification.js +18 -9
- package/es6/components/Notification/index.d.ts +2 -1
- package/es6/components/Notification/propTypes.js +2 -1
- package/es6/components/Page/Page.js +1 -1
- package/es6/components/PageContent/PageContent.js +1 -1
- package/es6/components/PageHeader/PageHeader.js +63 -0
- package/es6/components/PageHeader/index.d.ts +26 -0
- package/es6/components/PageHeader/index.js +1 -0
- package/es6/components/PageHeader/propTypes.js +19 -0
- package/es6/components/PageHeader/stories/Custom.js +32 -0
- package/es6/components/PageHeader/stories/MultipleActions.js +63 -0
- package/es6/components/PageHeader/stories/Responsive.js +25 -0
- package/es6/components/PageHeader/stories/Simple.js +24 -0
- package/es6/components/Pagination/PageControl.js +1 -1
- package/es6/components/Pagination/Pagination.js +1 -1
- package/es6/components/Pagination/propTypes.js +1 -1
- package/es6/components/Paragraph/Paragraph.js +1 -1
- package/es6/components/Paragraph/StyledParagraph.js +8 -1
- package/es6/components/Paragraph/index.d.ts +1 -0
- package/es6/components/Paragraph/propTypes.js +2 -1
- package/es6/components/Paragraph/stories/MaxLines.js +24 -0
- package/es6/components/RadioButton/RadioButton.js +1 -1
- package/es6/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/es6/components/RadioButtonGroup/index.d.ts +2 -1
- package/es6/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.js +1 -1
- package/es6/components/RadioButtonGroup/stories/Disabled.js +1 -1
- package/es6/components/RangeInput/RangeInput.js +1 -1
- package/es6/components/RangeSelector/EdgeControl.js +1 -1
- package/es6/components/RangeSelector/RangeSelector.js +1 -1
- package/es6/components/RangeSelector/stories/CustomThemed/Custom.js +1 -1
- package/es6/components/RangeSelector/stories/CustomThemed/CustomEdgeControl.js +1 -1
- package/es6/components/RangeSelector/stories/Step.js +1 -1
- package/es6/components/RangeSelector/stories/Vertical.js +1 -1
- package/es6/components/RoutedAnchor/RoutedAnchor.js +2 -2
- package/es6/components/RoutedButton/RoutedButton.js +2 -2
- package/es6/components/Select/Select.js +12 -33
- package/es6/components/Select/SelectContainer.js +35 -38
- package/es6/components/Select/propTypes.js +1 -1
- package/es6/components/Select/stories/components/SearchBorderBox.js +1 -1
- package/es6/components/Select/stories/components/SearchInput.js +1 -1
- package/es6/components/Sidebar/Sidebar.js +1 -1
- package/es6/components/Sidebar/stories/Labels.js +1 -1
- package/es6/components/SkipLink/SkipLink.js +1 -1
- package/es6/components/SkipLinkTarget/SkipLinkTarget.js +1 -1
- package/es6/components/Spinner/Spinner.js +1 -1
- package/es6/components/Stack/Stack.js +1 -1
- package/es6/components/Stack/propTypes.js +1 -1
- package/es6/components/Tab/StyledTab.js +2 -2
- package/es6/components/Tab/Tab.js +35 -18
- package/es6/components/Table/StyledTable.js +1 -1
- package/es6/components/Table/propTypes.js +1 -1
- package/es6/components/TableBody/TableBody.js +1 -1
- package/es6/components/TableCell/TableCell.js +1 -1
- package/es6/components/TableFooter/TableFooter.js +1 -1
- package/es6/components/TableHeader/TableHeader.js +1 -1
- package/es6/components/TableRow/TableRow.js +1 -1
- package/es6/components/Tabs/Tabs.js +229 -12
- package/es6/components/Tabs/propTypes.js +1 -1
- package/es6/components/Tabs/stories/Responsive.js +18 -0
- package/es6/components/Tag/Tag.js +1 -1
- package/es6/components/Tag/propTypes.js +1 -1
- package/es6/components/Text/Text.js +1 -1
- package/es6/components/Text/propTypes.js +1 -1
- package/es6/components/TextArea/TextArea.js +1 -1
- package/es6/components/TextArea/stories/NonResizable.js +1 -1
- package/es6/components/TextArea/stories/Simple.js +1 -1
- package/es6/components/TextInput/TextInput.js +33 -4
- package/es6/components/TextInput/stories/DefaultSuggestion.js +1 -0
- package/es6/components/TextInput/stories/InsideFormField.js +1 -1
- package/es6/components/TextInput/stories/Suggestions.js +1 -0
- package/es6/components/TextInput/stories/WithTags.js +1 -1
- package/es6/components/Tip/Tip.js +22 -29
- package/es6/components/Video/StyledVideo.js +2 -2
- package/es6/components/Video/Video.js +100 -47
- package/es6/components/Video/index.d.ts +1 -0
- package/es6/components/Video/propTypes.js +2 -2
- package/es6/components/Video/stories/typescript/ControlsBelow.tsx +6 -2
- package/es6/components/WorldMap/WorldMap.js +1 -1
- package/es6/components/WorldMap/propTypes.js +1 -1
- package/es6/components/WorldMap/stories/Places.js +1 -1
- package/es6/components/index.d.ts +1 -0
- package/es6/components/index.js +1 -0
- package/es6/contexts/AnnounceContext/stories/Assertive.js +1 -1
- package/es6/contexts/ResponsiveContext/stories/ResponsiveGrid.js +1 -1
- package/es6/index.d.ts +1 -0
- package/es6/languages/default.json +4 -1
- package/es6/themes/base.d.ts +74 -34
- package/es6/themes/base.js +99 -3
- package/es6/utils/index.js +2 -1
- package/es6/utils/object.js +1 -1
- package/es6/utils/pagination.js +1 -1
- package/es6/utils/use-keyboard.js +25 -0
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/index.d.ts +1 -0
- package/languages/default.json +4 -1
- package/package.json +65 -59
- package/themes/base.d.ts +74 -34
- package/themes/base.js +100 -3
- package/utils/index.js +8 -0
- package/utils/object.js +1 -1
- package/utils/pagination.js +1 -1
- package/utils/use-keyboard.js +34 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React, { useContext } from 'react';
|
|
4
4
|
import styled, { ThemeContext } from 'styled-components';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { genericProps } from '../../utils/general-prop-types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Box, DataTable, CheckBox } from 'grommet'; // Source code for the data can be found here
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
4
|
import { DataTable } from 'grommet'; // Source code for the data can be found here
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Grommet, Box, DataTable } from 'grommet';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Box, DataTable } from 'grommet'; // Source code for the data can be found here
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
/* eslint-disable no-param-reassign */
|
|
4
4
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Box, DataTable } from 'grommet'; // Source code for the data can be found here
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Box, DataTable } from 'grommet';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
2
|
+
|
|
1
3
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
2
4
|
|
|
3
5
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
@@ -127,9 +129,9 @@ export var SpaceX = function SpaceX() {
|
|
|
127
129
|
}, [groups]);
|
|
128
130
|
useEffect(function () {
|
|
129
131
|
var fetchData = /*#__PURE__*/function () {
|
|
130
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/
|
|
132
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
131
133
|
var query;
|
|
132
|
-
return
|
|
134
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
133
135
|
while (1) {
|
|
134
136
|
switch (_context.prev = _context.next) {
|
|
135
137
|
case 0:
|
|
@@ -169,11 +171,11 @@ export var SpaceX = function SpaceX() {
|
|
|
169
171
|
}, []);
|
|
170
172
|
useEffect(function () {
|
|
171
173
|
var fetchData = /*#__PURE__*/function () {
|
|
172
|
-
var _ref6 = _asyncToGenerator( /*#__PURE__*/
|
|
174
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
173
175
|
var _sort;
|
|
174
176
|
|
|
175
177
|
var query;
|
|
176
|
-
return
|
|
178
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
177
179
|
while (1) {
|
|
178
180
|
switch (_context2.prev = _context2.next) {
|
|
179
181
|
case 0:
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
2
|
+
|
|
1
3
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
2
4
|
|
|
3
5
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
@@ -66,11 +68,11 @@ export var SpaceXUngrouped = function SpaceXUngrouped() {
|
|
|
66
68
|
|
|
67
69
|
useEffect(function () {
|
|
68
70
|
var fetchData = /*#__PURE__*/function () {
|
|
69
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/
|
|
71
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
70
72
|
var _sort;
|
|
71
73
|
|
|
72
74
|
var query;
|
|
73
|
-
return
|
|
75
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
74
76
|
while (1) {
|
|
75
77
|
switch (_context.prev = _context.next) {
|
|
76
78
|
case 0:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Box, DataTable } from 'grommet'; // Source code for the data can be found here
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Box, Meter, Text, Tip } from 'grommet';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Box, DataTable, CheckBox } from 'grommet'; // Source code for the data can be found here
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var _excluded = ["buttonProps", "calendarProps", "defaultValue", "disabled", "dropProps", "format", "id", "icon", "inline", "inputProps", "name", "onChange", "onFocus", "plain", "value", "messages"],
|
|
1
|
+
var _excluded = ["buttonProps", "calendarProps", "defaultValue", "disabled", "dropProps", "format", "id", "icon", "inline", "inputProps", "name", "onChange", "onFocus", "plain", "reverse", "value", "messages"],
|
|
2
2
|
_excluded2 = ["icon"];
|
|
3
3
|
|
|
4
|
-
function _extends() { _extends = Object.assign
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
5
|
|
|
6
6
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
7
7
|
|
|
@@ -20,9 +20,34 @@ import { FormContext } from '../Form';
|
|
|
20
20
|
import { Keyboard } from '../Keyboard';
|
|
21
21
|
import { MaskedInput } from '../MaskedInput';
|
|
22
22
|
import { useForwardedRef } from '../../utils';
|
|
23
|
-
import { getTimestamp, normalizeForTimezone } from '../Calendar/utils';
|
|
24
23
|
import { formatToSchema, schemaToMask, valuesAreEqual, valueToText, textToValue } from './utils';
|
|
25
24
|
import { DateInputPropTypes } from './propTypes';
|
|
25
|
+
import { getOutputFormat } from '../Calendar/Calendar';
|
|
26
|
+
|
|
27
|
+
var getReference = function getReference(value) {
|
|
28
|
+
var adjustedDate;
|
|
29
|
+
var res;
|
|
30
|
+
if (typeof value === 'string') res = value;else if (Array.isArray(value) && Array.isArray(value[0])) res = value[0].find(function (date) {
|
|
31
|
+
return date;
|
|
32
|
+
});else if (Array.isArray(value) && value.length) {
|
|
33
|
+
res = value[0];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (res) {
|
|
37
|
+
var _res;
|
|
38
|
+
|
|
39
|
+
adjustedDate = new Date(res); // if time is not specified in ISOstring, normalize to midnight
|
|
40
|
+
|
|
41
|
+
if (((_res = res) == null ? void 0 : _res.indexOf('T')) === -1) {
|
|
42
|
+
var offset = adjustedDate.getTimezoneOffset();
|
|
43
|
+
var hour = adjustedDate.getHours();
|
|
44
|
+
adjustedDate.setHours(hour, offset);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return adjustedDate;
|
|
49
|
+
};
|
|
50
|
+
|
|
26
51
|
var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
27
52
|
var buttonProps = _ref.buttonProps,
|
|
28
53
|
calendarProps = _ref.calendarProps,
|
|
@@ -39,6 +64,8 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
39
64
|
_onChange = _ref.onChange,
|
|
40
65
|
_onFocus = _ref.onFocus,
|
|
41
66
|
plain = _ref.plain,
|
|
67
|
+
_ref$reverse = _ref.reverse,
|
|
68
|
+
reverseProp = _ref$reverse === void 0 ? false : _ref$reverse,
|
|
42
69
|
valueArg = _ref.value,
|
|
43
70
|
messages = _ref.messages,
|
|
44
71
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
@@ -65,25 +92,24 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
65
92
|
value = _useFormInput[0],
|
|
66
93
|
setValue = _useFormInput[1];
|
|
67
94
|
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (Array.isArray(value) && value.length) return getTimestamp(value[0]); // check to see if value is not an empty string
|
|
72
|
-
// empty string should behave like undefined
|
|
95
|
+
var _useState = useState(getOutputFormat(value)),
|
|
96
|
+
outputFormat = _useState[0],
|
|
97
|
+
setOutputFormat = _useState[1];
|
|
73
98
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
// will just rely on the UTC timestamp and don't need to normalize.
|
|
99
|
+
useEffect(function () {
|
|
100
|
+
setOutputFormat(function (previousFormat) {
|
|
101
|
+
var nextFormat = getOutputFormat(value); // when user types, date could become something like 07//2020
|
|
102
|
+
// and value becomes undefined. don't lose the format from the
|
|
103
|
+
// previous valid date
|
|
80
104
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
105
|
+
return previousFormat !== nextFormat ? previousFormat : nextFormat;
|
|
106
|
+
});
|
|
107
|
+
}, [value]); // keep track of timestamp from original date(s)
|
|
84
108
|
|
|
109
|
+
var _useState2 = useState(getReference(value)),
|
|
110
|
+
reference = _useState2[0],
|
|
111
|
+
setReference = _useState2[1]; // do we expect multiple dates?
|
|
85
112
|
|
|
86
|
-
var normalizedDate = normalizeForTimezone(value, timestamp, normalize); // do we expect multiple dates?
|
|
87
113
|
|
|
88
114
|
var range = Array.isArray(value) || format && format.includes('-'); // parse format and build a formal schema we can use elsewhere
|
|
89
115
|
|
|
@@ -95,9 +121,9 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
95
121
|
return schemaToMask(schema);
|
|
96
122
|
}, [schema]); // textValue is only used when a format is provided
|
|
97
123
|
|
|
98
|
-
var
|
|
99
|
-
textValue =
|
|
100
|
-
setTextValue =
|
|
124
|
+
var _useState3 = useState(schema ? valueToText(value, schema) : undefined),
|
|
125
|
+
textValue = _useState3[0],
|
|
126
|
+
setTextValue = _useState3[1]; // Setting the icon through `inputProps` is deprecated.
|
|
101
127
|
// The `icon` prop should be used instead.
|
|
102
128
|
|
|
103
129
|
|
|
@@ -107,27 +133,32 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
107
133
|
|
|
108
134
|
if (MaskedInputIcon) {
|
|
109
135
|
console.warn("Customizing the DateInput icon through inputProps is deprecated. \nUse the icon prop instead.");
|
|
110
|
-
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
var reverse = reverseProp || restOfInputProps.reverse;
|
|
139
|
+
var calendarDropdownAlign = {
|
|
140
|
+
top: 'bottom',
|
|
141
|
+
left: 'left'
|
|
142
|
+
}; // We need to distinguish between the caller changing a Form value
|
|
111
143
|
// and the user typing a date that he isn't finished with yet.
|
|
112
144
|
// To handle this, we see if we have a value and the text value
|
|
113
145
|
// associated with it doesn't align to it, then we update the text value.
|
|
114
146
|
// We compare using textToValue to avoid "06/01/2021" not
|
|
115
147
|
// matching "06/1/2021".
|
|
116
148
|
|
|
117
|
-
|
|
118
149
|
useEffect(function () {
|
|
119
150
|
if (schema && value !== undefined) {
|
|
120
|
-
var nextTextValue = valueToText(
|
|
151
|
+
var nextTextValue = valueToText(value, schema);
|
|
121
152
|
|
|
122
|
-
if (!valuesAreEqual(textToValue(textValue, schema, range,
|
|
153
|
+
if (!valuesAreEqual(textToValue(textValue, schema, range, reference), textToValue(nextTextValue, schema, range, reference)) || textValue === '' && nextTextValue !== '') {
|
|
123
154
|
setTextValue(nextTextValue);
|
|
124
155
|
}
|
|
125
156
|
}
|
|
126
|
-
}, [range, schema, textValue,
|
|
157
|
+
}, [range, schema, textValue, reference, value]); // when format and not inline, whether to show the Calendar in a Drop
|
|
127
158
|
|
|
128
|
-
var
|
|
129
|
-
open =
|
|
130
|
-
setOpen =
|
|
159
|
+
var _useState4 = useState(),
|
|
160
|
+
open = _useState4[0],
|
|
161
|
+
setOpen = _useState4[1];
|
|
131
162
|
|
|
132
163
|
var openCalendar = useCallback(function () {
|
|
133
164
|
setOpen(true);
|
|
@@ -147,33 +178,23 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
147
178
|
ref: inline ? ref : undefined,
|
|
148
179
|
id: inline && !format ? id : undefined,
|
|
149
180
|
range: range,
|
|
150
|
-
date: range ? undefined :
|
|
181
|
+
date: range ? undefined : value // when caller initializes with empty array, dates should be undefined
|
|
151
182
|
// allowing the user to select both begin and end of the range
|
|
152
183
|
,
|
|
153
|
-
dates: range && value.length ? [
|
|
184
|
+
dates: range && value.length ? [value] : undefined // places focus on days grid when Calendar opens
|
|
154
185
|
,
|
|
155
186
|
initialFocus: open ? 'days' : undefined,
|
|
156
|
-
normalize: normalize,
|
|
157
187
|
onSelect: disabled ? undefined : function (nextValue) {
|
|
158
188
|
var normalizedValue;
|
|
159
189
|
|
|
160
190
|
if (range && Array.isArray(nextValue)) {
|
|
161
191
|
normalizedValue = nextValue[0];
|
|
162
192
|
} // clicking an edge date removes it
|
|
163
|
-
else if (range) normalizedValue = [nextValue, nextValue];else normalizedValue = nextValue;
|
|
164
|
-
// been passed in, indicating that we should stay local if the
|
|
165
|
-
// user first picks a date via the Calendar.
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
var nextNormalize = normalize;
|
|
169
|
-
|
|
170
|
-
if (timestamp === undefined) {
|
|
171
|
-
nextNormalize = false;
|
|
172
|
-
setNormalize(nextNormalize);
|
|
173
|
-
}
|
|
193
|
+
else if (range) normalizedValue = [nextValue, nextValue];else normalizedValue = nextValue;
|
|
174
194
|
|
|
175
|
-
if (schema) setTextValue(valueToText(
|
|
195
|
+
if (schema) setTextValue(valueToText(normalizedValue, schema));
|
|
176
196
|
setValue(normalizedValue);
|
|
197
|
+
setReference(getReference(nextValue));
|
|
177
198
|
if (_onChange) _onChange({
|
|
178
199
|
value: normalizedValue
|
|
179
200
|
});
|
|
@@ -185,9 +206,7 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
185
206
|
}, 1);
|
|
186
207
|
}
|
|
187
208
|
}
|
|
188
|
-
},
|
|
189
|
-
timestamp: timestamp
|
|
190
|
-
})));
|
|
209
|
+
}, calendarProps));
|
|
191
210
|
var formContextValue = useMemo(function () {
|
|
192
211
|
return {
|
|
193
212
|
useFormInput: function useFormInput(_ref3) {
|
|
@@ -204,10 +223,7 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
204
223
|
ref: ref,
|
|
205
224
|
id: id,
|
|
206
225
|
dropProps: _extends({
|
|
207
|
-
align:
|
|
208
|
-
top: 'bottom',
|
|
209
|
-
left: 'left'
|
|
210
|
-
}
|
|
226
|
+
align: calendarDropdownAlign
|
|
211
227
|
}, dropProps),
|
|
212
228
|
dropContent: calendar,
|
|
213
229
|
icon: icon || MaskedInputIcon || /*#__PURE__*/React.createElement(CalendarIcon, {
|
|
@@ -216,6 +232,18 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
216
232
|
}, buttonProps));
|
|
217
233
|
}
|
|
218
234
|
|
|
235
|
+
var calendarButton = /*#__PURE__*/React.createElement(Button, {
|
|
236
|
+
onClick: open ? closeCalendar : openCalendar,
|
|
237
|
+
plain: true,
|
|
238
|
+
icon: icon || MaskedInputIcon || /*#__PURE__*/React.createElement(CalendarIcon, {
|
|
239
|
+
size: iconSize
|
|
240
|
+
}),
|
|
241
|
+
margin: reverse ? {
|
|
242
|
+
left: 'small'
|
|
243
|
+
} : {
|
|
244
|
+
right: 'small'
|
|
245
|
+
}
|
|
246
|
+
});
|
|
219
247
|
var input = /*#__PURE__*/React.createElement(FormContext.Provider, {
|
|
220
248
|
key: "input" // don't let MaskedInput drive the Form
|
|
221
249
|
,
|
|
@@ -234,7 +262,7 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
234
262
|
round: "xxsmall",
|
|
235
263
|
direction: "row",
|
|
236
264
|
fill: true
|
|
237
|
-
}, /*#__PURE__*/React.createElement(MaskedInput, _extends({
|
|
265
|
+
}, reverse && calendarButton, /*#__PURE__*/React.createElement(MaskedInput, _extends({
|
|
238
266
|
ref: ref,
|
|
239
267
|
id: id,
|
|
240
268
|
name: name,
|
|
@@ -247,27 +275,8 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
247
275
|
onChange: function onChange(event) {
|
|
248
276
|
var nextTextValue = event.target.value;
|
|
249
277
|
setTextValue(nextTextValue);
|
|
250
|
-
var
|
|
251
|
-
//
|
|
252
|
-
|
|
253
|
-
if (timestamp === undefined && Date.parse(nextTextValue)) {
|
|
254
|
-
var _Date$toISOString$spl = new Date(nextTextValue).toISOString().split('T');
|
|
255
|
-
|
|
256
|
-
localTimestamp = _Date$toISOString$spl[1];
|
|
257
|
-
} // timestamp will be undefined if no defaultValue or value have
|
|
258
|
-
// been passed in, indicating that we should stay local
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
var nextNormalize = normalize;
|
|
262
|
-
|
|
263
|
-
if (timestamp === undefined) {
|
|
264
|
-
nextNormalize = false;
|
|
265
|
-
setNormalize(nextNormalize);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
var nextValue = textToValue(nextTextValue, schema, range, timestamp || localTimestamp, nextNormalize); // reset to original state
|
|
269
|
-
|
|
270
|
-
if (nextValue === undefined) setNormalize(true); // update value even when undefined
|
|
278
|
+
var nextValue = textToValue(nextTextValue, schema, range, reference, outputFormat);
|
|
279
|
+
if (nextValue !== undefined) setReference(getReference(nextValue)); // update value even when undefined
|
|
271
280
|
|
|
272
281
|
setValue(nextValue);
|
|
273
282
|
|
|
@@ -287,16 +296,7 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
287
296
|
}));
|
|
288
297
|
if (_onFocus) _onFocus(event);
|
|
289
298
|
}
|
|
290
|
-
})),
|
|
291
|
-
onClick: open ? closeCalendar : openCalendar,
|
|
292
|
-
plain: true,
|
|
293
|
-
icon: icon || MaskedInputIcon || /*#__PURE__*/React.createElement(CalendarIcon, {
|
|
294
|
-
size: iconSize
|
|
295
|
-
}),
|
|
296
|
-
margin: {
|
|
297
|
-
right: 'small'
|
|
298
|
-
}
|
|
299
|
-
}))));
|
|
299
|
+
})), !reverse && calendarButton)));
|
|
300
300
|
|
|
301
301
|
if (inline) {
|
|
302
302
|
return /*#__PURE__*/React.createElement(Box, null, input, calendar);
|
|
@@ -311,11 +311,8 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
311
311
|
}, /*#__PURE__*/React.createElement(Drop, _extends({
|
|
312
312
|
overflow: "visible",
|
|
313
313
|
id: id ? id + "__drop" : undefined,
|
|
314
|
-
target:
|
|
315
|
-
align: _extends({
|
|
316
|
-
top: 'bottom',
|
|
317
|
-
left: 'left'
|
|
318
|
-
}, dropProps),
|
|
314
|
+
target: containerRef.current,
|
|
315
|
+
align: _extends({}, calendarDropdownAlign, dropProps),
|
|
319
316
|
onEsc: closeCalendar,
|
|
320
317
|
onClickOutside: function onClickOutside(_ref4) {
|
|
321
318
|
var target = _ref4.target;
|
|
@@ -16,11 +16,24 @@ export var Format = function Format() {
|
|
|
16
16
|
align: "center",
|
|
17
17
|
pad: "large"
|
|
18
18
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
19
|
-
width: "medium"
|
|
19
|
+
width: "medium",
|
|
20
|
+
margin: {
|
|
21
|
+
vertical: 'small'
|
|
22
|
+
}
|
|
20
23
|
}, /*#__PURE__*/React.createElement(DateInput, {
|
|
21
24
|
format: "m/d/yy",
|
|
22
25
|
value: value,
|
|
23
26
|
onChange: onChange
|
|
27
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
28
|
+
width: "medium",
|
|
29
|
+
margin: {
|
|
30
|
+
vertical: 'small'
|
|
31
|
+
}
|
|
32
|
+
}, /*#__PURE__*/React.createElement(DateInput, {
|
|
33
|
+
format: "m/d/yy",
|
|
34
|
+
value: value,
|
|
35
|
+
reverse: true,
|
|
36
|
+
onChange: onChange
|
|
24
37
|
})));
|
|
25
38
|
};
|
|
26
39
|
export default {
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
4
|
+
|
|
5
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
6
|
+
|
|
7
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
8
|
+
|
|
9
|
+
import { handleOffset } from '../Calendar/utils'; // Converting between Date and String types is handled via a "schema".
|
|
4
10
|
// The schema is an array of strings, split into strings with identical
|
|
5
11
|
// characters. So, 'mm/dd/yyyy' will be ['mm', '/', 'dd', '/', 'yyyyy'].
|
|
6
|
-
|
|
12
|
+
|
|
7
13
|
export var formatToSchema = function formatToSchema(format) {
|
|
8
14
|
if (!format) return undefined;
|
|
9
15
|
var result = [];
|
|
@@ -70,7 +76,16 @@ export var valueToText = function valueToText(value, schema) {
|
|
|
70
76
|
|
|
71
77
|
if (!value || Array.isArray(value) && !value.length) return text;
|
|
72
78
|
var dates = (Array.isArray(value) ? value : [value]).map(function (v) {
|
|
73
|
-
|
|
79
|
+
// TO DO should we extract this to a reusable function?
|
|
80
|
+
var adjustedDate = new Date(v); // if time is not specified in ISOstring, normalize to midnight
|
|
81
|
+
|
|
82
|
+
if (v.indexOf('T') === -1) {
|
|
83
|
+
var offset = adjustedDate.getTimezoneOffset();
|
|
84
|
+
var hour = adjustedDate.getHours();
|
|
85
|
+
adjustedDate.setHours(hour, offset);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return adjustedDate;
|
|
74
89
|
});
|
|
75
90
|
var dateIndex = 0;
|
|
76
91
|
var parts = {};
|
|
@@ -126,7 +141,7 @@ var pullDigits = function pullDigits(text, index) {
|
|
|
126
141
|
return text.slice(index, end);
|
|
127
142
|
};
|
|
128
143
|
|
|
129
|
-
export var textToValue = function textToValue(text, schema, range,
|
|
144
|
+
export var textToValue = function textToValue(text, schema, range, reference, outputFormat) {
|
|
130
145
|
if (!text) return range ? [] : undefined;
|
|
131
146
|
var result;
|
|
132
147
|
|
|
@@ -134,10 +149,17 @@ export var textToValue = function textToValue(text, schema, range, timestamp, no
|
|
|
134
149
|
var leapYear = parts.y % 4 === 0 && parts.y % 100 !== 0 || parts.y % 400 === 0; // Do a little sanity checking on the parts first.
|
|
135
150
|
// If not valid, leave as is.
|
|
136
151
|
|
|
137
|
-
if (!parts.m || !parts.d || !parts.y || parts.y.length < 4 || parts.m.length > 2 || parts.d.length > 2 || parts.m > 12 || parts.d > 31 || (parts.m === "02" || parts.m === "2") && parts.d > (leapYear ? 29 : 28)) return parts;
|
|
138
|
-
|
|
152
|
+
if (!parts.m || !parts.d || !parts.y || parts.y.length < 4 || parts.m.length > 2 || parts.d.length > 2 || parts.m > 12 || parts.d > 31 || (parts.m === "02" || parts.m === "2") && parts.d > (leapYear ? 29 : 28)) return parts; // use time info from reference date
|
|
153
|
+
|
|
154
|
+
var time = reference ? [reference.getHours(), reference.getMinutes(), reference.getSeconds(), reference.getMilliseconds()] : null;
|
|
155
|
+
|
|
156
|
+
var date = _construct(Date, [parts.y, parts.m - 1, parts.d].concat(time)).toISOString();
|
|
139
157
|
|
|
140
|
-
if (
|
|
158
|
+
if (date && outputFormat === 'no timezone') {
|
|
159
|
+
var _handleOffset$toISOSt = handleOffset(date).toISOString().split('T');
|
|
160
|
+
|
|
161
|
+
date = _handleOffset$toISOSt[0];
|
|
162
|
+
}
|
|
141
163
|
|
|
142
164
|
if (!range) {
|
|
143
165
|
if (!result) result = date;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _excluded = ["connections"],
|
|
2
2
|
_excluded2 = ["anchor", "animation", "color", "offset", "round", "thickness", "type"];
|
|
3
3
|
|
|
4
|
-
function _extends() { _extends = Object.assign
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
5
|
|
|
6
6
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
7
7
|
|