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
|
@@ -33,23 +33,47 @@ var _MaskedInput = require("../MaskedInput");
|
|
|
33
33
|
|
|
34
34
|
var _utils = require("../../utils");
|
|
35
35
|
|
|
36
|
-
var _utils2 = require("
|
|
37
|
-
|
|
38
|
-
var _utils3 = require("./utils");
|
|
36
|
+
var _utils2 = require("./utils");
|
|
39
37
|
|
|
40
38
|
var _propTypes = require("./propTypes");
|
|
41
39
|
|
|
42
|
-
var
|
|
40
|
+
var _Calendar3 = require("../Calendar/Calendar");
|
|
41
|
+
|
|
42
|
+
var _excluded = ["buttonProps", "calendarProps", "defaultValue", "disabled", "dropProps", "format", "id", "icon", "inline", "inputProps", "name", "onChange", "onFocus", "plain", "reverse", "value", "messages"],
|
|
43
43
|
_excluded2 = ["icon"];
|
|
44
44
|
|
|
45
45
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
46
46
|
|
|
47
47
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
48
48
|
|
|
49
|
-
function _extends() { _extends = Object.assign
|
|
49
|
+
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); }
|
|
50
50
|
|
|
51
51
|
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; }
|
|
52
52
|
|
|
53
|
+
var getReference = function getReference(value) {
|
|
54
|
+
var adjustedDate;
|
|
55
|
+
var res;
|
|
56
|
+
if (typeof value === 'string') res = value;else if (Array.isArray(value) && Array.isArray(value[0])) res = value[0].find(function (date) {
|
|
57
|
+
return date;
|
|
58
|
+
});else if (Array.isArray(value) && value.length) {
|
|
59
|
+
res = value[0];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (res) {
|
|
63
|
+
var _res;
|
|
64
|
+
|
|
65
|
+
adjustedDate = new Date(res); // if time is not specified in ISOstring, normalize to midnight
|
|
66
|
+
|
|
67
|
+
if (((_res = res) == null ? void 0 : _res.indexOf('T')) === -1) {
|
|
68
|
+
var offset = adjustedDate.getTimezoneOffset();
|
|
69
|
+
var hour = adjustedDate.getHours();
|
|
70
|
+
adjustedDate.setHours(hour, offset);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return adjustedDate;
|
|
75
|
+
};
|
|
76
|
+
|
|
53
77
|
var DateInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, refArg) {
|
|
54
78
|
var buttonProps = _ref.buttonProps,
|
|
55
79
|
calendarProps = _ref.calendarProps,
|
|
@@ -66,6 +90,8 @@ var DateInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, refArg) {
|
|
|
66
90
|
_onChange = _ref.onChange,
|
|
67
91
|
_onFocus = _ref.onFocus,
|
|
68
92
|
plain = _ref.plain,
|
|
93
|
+
_ref$reverse = _ref.reverse,
|
|
94
|
+
reverseProp = _ref$reverse === void 0 ? false : _ref$reverse,
|
|
69
95
|
valueArg = _ref.value,
|
|
70
96
|
messages = _ref.messages,
|
|
71
97
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
@@ -93,39 +119,38 @@ var DateInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, refArg) {
|
|
|
93
119
|
value = _useFormInput[0],
|
|
94
120
|
setValue = _useFormInput[1];
|
|
95
121
|
|
|
96
|
-
var
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if (Array.isArray(value) && value.length) return (0, _utils2.getTimestamp)(value[0]); // check to see if value is not an empty string
|
|
100
|
-
// empty string should behave like undefined
|
|
122
|
+
var _useState = (0, _react.useState)((0, _Calendar3.getOutputFormat)(value)),
|
|
123
|
+
outputFormat = _useState[0],
|
|
124
|
+
setOutputFormat = _useState[1];
|
|
101
125
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
// will just rely on the UTC timestamp and don't need to normalize.
|
|
126
|
+
(0, _react.useEffect)(function () {
|
|
127
|
+
setOutputFormat(function (previousFormat) {
|
|
128
|
+
var nextFormat = (0, _Calendar3.getOutputFormat)(value); // when user types, date could become something like 07//2020
|
|
129
|
+
// and value becomes undefined. don't lose the format from the
|
|
130
|
+
// previous valid date
|
|
108
131
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
132
|
+
return previousFormat !== nextFormat ? previousFormat : nextFormat;
|
|
133
|
+
});
|
|
134
|
+
}, [value]); // keep track of timestamp from original date(s)
|
|
112
135
|
|
|
136
|
+
var _useState2 = (0, _react.useState)(getReference(value)),
|
|
137
|
+
reference = _useState2[0],
|
|
138
|
+
setReference = _useState2[1]; // do we expect multiple dates?
|
|
113
139
|
|
|
114
|
-
var normalizedDate = (0, _utils2.normalizeForTimezone)(value, timestamp, normalize); // do we expect multiple dates?
|
|
115
140
|
|
|
116
141
|
var range = Array.isArray(value) || format && format.includes('-'); // parse format and build a formal schema we can use elsewhere
|
|
117
142
|
|
|
118
143
|
var schema = (0, _react.useMemo)(function () {
|
|
119
|
-
return (0,
|
|
144
|
+
return (0, _utils2.formatToSchema)(format);
|
|
120
145
|
}, [format]); // mask is only used when a format is provided
|
|
121
146
|
|
|
122
147
|
var mask = (0, _react.useMemo)(function () {
|
|
123
|
-
return (0,
|
|
148
|
+
return (0, _utils2.schemaToMask)(schema);
|
|
124
149
|
}, [schema]); // textValue is only used when a format is provided
|
|
125
150
|
|
|
126
|
-
var
|
|
127
|
-
textValue =
|
|
128
|
-
setTextValue =
|
|
151
|
+
var _useState3 = (0, _react.useState)(schema ? (0, _utils2.valueToText)(value, schema) : undefined),
|
|
152
|
+
textValue = _useState3[0],
|
|
153
|
+
setTextValue = _useState3[1]; // Setting the icon through `inputProps` is deprecated.
|
|
129
154
|
// The `icon` prop should be used instead.
|
|
130
155
|
|
|
131
156
|
|
|
@@ -135,27 +160,32 @@ var DateInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, refArg) {
|
|
|
135
160
|
|
|
136
161
|
if (MaskedInputIcon) {
|
|
137
162
|
console.warn("Customizing the DateInput icon through inputProps is deprecated. \nUse the icon prop instead.");
|
|
138
|
-
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
var reverse = reverseProp || restOfInputProps.reverse;
|
|
166
|
+
var calendarDropdownAlign = {
|
|
167
|
+
top: 'bottom',
|
|
168
|
+
left: 'left'
|
|
169
|
+
}; // We need to distinguish between the caller changing a Form value
|
|
139
170
|
// and the user typing a date that he isn't finished with yet.
|
|
140
171
|
// To handle this, we see if we have a value and the text value
|
|
141
172
|
// associated with it doesn't align to it, then we update the text value.
|
|
142
173
|
// We compare using textToValue to avoid "06/01/2021" not
|
|
143
174
|
// matching "06/1/2021".
|
|
144
175
|
|
|
145
|
-
|
|
146
176
|
(0, _react.useEffect)(function () {
|
|
147
177
|
if (schema && value !== undefined) {
|
|
148
|
-
var nextTextValue = (0,
|
|
178
|
+
var nextTextValue = (0, _utils2.valueToText)(value, schema);
|
|
149
179
|
|
|
150
|
-
if (!(0,
|
|
180
|
+
if (!(0, _utils2.valuesAreEqual)((0, _utils2.textToValue)(textValue, schema, range, reference), (0, _utils2.textToValue)(nextTextValue, schema, range, reference)) || textValue === '' && nextTextValue !== '') {
|
|
151
181
|
setTextValue(nextTextValue);
|
|
152
182
|
}
|
|
153
183
|
}
|
|
154
|
-
}, [range, schema, textValue,
|
|
184
|
+
}, [range, schema, textValue, reference, value]); // when format and not inline, whether to show the Calendar in a Drop
|
|
155
185
|
|
|
156
|
-
var
|
|
157
|
-
open =
|
|
158
|
-
setOpen =
|
|
186
|
+
var _useState4 = (0, _react.useState)(),
|
|
187
|
+
open = _useState4[0],
|
|
188
|
+
setOpen = _useState4[1];
|
|
159
189
|
|
|
160
190
|
var openCalendar = (0, _react.useCallback)(function () {
|
|
161
191
|
setOpen(true);
|
|
@@ -176,33 +206,23 @@ var DateInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, refArg) {
|
|
|
176
206
|
ref: inline ? ref : undefined,
|
|
177
207
|
id: inline && !format ? id : undefined,
|
|
178
208
|
range: range,
|
|
179
|
-
date: range ? undefined :
|
|
209
|
+
date: range ? undefined : value // when caller initializes with empty array, dates should be undefined
|
|
180
210
|
// allowing the user to select both begin and end of the range
|
|
181
211
|
,
|
|
182
|
-
dates: range && value.length ? [
|
|
212
|
+
dates: range && value.length ? [value] : undefined // places focus on days grid when Calendar opens
|
|
183
213
|
,
|
|
184
214
|
initialFocus: open ? 'days' : undefined,
|
|
185
|
-
normalize: normalize,
|
|
186
215
|
onSelect: disabled ? undefined : function (nextValue) {
|
|
187
216
|
var normalizedValue;
|
|
188
217
|
|
|
189
218
|
if (range && Array.isArray(nextValue)) {
|
|
190
219
|
normalizedValue = nextValue[0];
|
|
191
220
|
} // clicking an edge date removes it
|
|
192
|
-
else if (range) normalizedValue = [nextValue, nextValue];else normalizedValue = nextValue;
|
|
193
|
-
// been passed in, indicating that we should stay local if the
|
|
194
|
-
// user first picks a date via the Calendar.
|
|
221
|
+
else if (range) normalizedValue = [nextValue, nextValue];else normalizedValue = nextValue;
|
|
195
222
|
|
|
196
|
-
|
|
197
|
-
var nextNormalize = normalize;
|
|
198
|
-
|
|
199
|
-
if (timestamp === undefined) {
|
|
200
|
-
nextNormalize = false;
|
|
201
|
-
setNormalize(nextNormalize);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
if (schema) setTextValue((0, _utils3.valueToText)((0, _utils2.normalizeForTimezone)(normalizedValue, undefined, nextNormalize), schema));
|
|
223
|
+
if (schema) setTextValue((0, _utils2.valueToText)(normalizedValue, schema));
|
|
205
224
|
setValue(normalizedValue);
|
|
225
|
+
setReference(getReference(nextValue));
|
|
206
226
|
if (_onChange) _onChange({
|
|
207
227
|
value: normalizedValue
|
|
208
228
|
});
|
|
@@ -214,9 +234,7 @@ var DateInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, refArg) {
|
|
|
214
234
|
}, 1);
|
|
215
235
|
}
|
|
216
236
|
}
|
|
217
|
-
},
|
|
218
|
-
timestamp: timestamp
|
|
219
|
-
})));
|
|
237
|
+
}, calendarProps));
|
|
220
238
|
|
|
221
239
|
var formContextValue = (0, _react.useMemo)(function () {
|
|
222
240
|
return {
|
|
@@ -234,10 +252,7 @@ var DateInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, refArg) {
|
|
|
234
252
|
ref: ref,
|
|
235
253
|
id: id,
|
|
236
254
|
dropProps: _extends({
|
|
237
|
-
align:
|
|
238
|
-
top: 'bottom',
|
|
239
|
-
left: 'left'
|
|
240
|
-
}
|
|
255
|
+
align: calendarDropdownAlign
|
|
241
256
|
}, dropProps),
|
|
242
257
|
dropContent: calendar,
|
|
243
258
|
icon: icon || MaskedInputIcon || /*#__PURE__*/_react["default"].createElement(_Calendar.Calendar, {
|
|
@@ -246,6 +261,19 @@ var DateInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, refArg) {
|
|
|
246
261
|
}, buttonProps));
|
|
247
262
|
}
|
|
248
263
|
|
|
264
|
+
var calendarButton = /*#__PURE__*/_react["default"].createElement(_Button.Button, {
|
|
265
|
+
onClick: open ? closeCalendar : openCalendar,
|
|
266
|
+
plain: true,
|
|
267
|
+
icon: icon || MaskedInputIcon || /*#__PURE__*/_react["default"].createElement(_Calendar.Calendar, {
|
|
268
|
+
size: iconSize
|
|
269
|
+
}),
|
|
270
|
+
margin: reverse ? {
|
|
271
|
+
left: 'small'
|
|
272
|
+
} : {
|
|
273
|
+
right: 'small'
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
|
|
249
277
|
var input = /*#__PURE__*/_react["default"].createElement(_Form.FormContext.Provider, {
|
|
250
278
|
key: "input" // don't let MaskedInput drive the Form
|
|
251
279
|
,
|
|
@@ -264,7 +292,7 @@ var DateInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, refArg) {
|
|
|
264
292
|
round: "xxsmall",
|
|
265
293
|
direction: "row",
|
|
266
294
|
fill: true
|
|
267
|
-
}, /*#__PURE__*/_react["default"].createElement(_MaskedInput.MaskedInput, _extends({
|
|
295
|
+
}, reverse && calendarButton, /*#__PURE__*/_react["default"].createElement(_MaskedInput.MaskedInput, _extends({
|
|
268
296
|
ref: ref,
|
|
269
297
|
id: id,
|
|
270
298
|
name: name,
|
|
@@ -277,27 +305,8 @@ var DateInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, refArg) {
|
|
|
277
305
|
onChange: function onChange(event) {
|
|
278
306
|
var nextTextValue = event.target.value;
|
|
279
307
|
setTextValue(nextTextValue);
|
|
280
|
-
var
|
|
281
|
-
//
|
|
282
|
-
|
|
283
|
-
if (timestamp === undefined && Date.parse(nextTextValue)) {
|
|
284
|
-
var _Date$toISOString$spl = new Date(nextTextValue).toISOString().split('T');
|
|
285
|
-
|
|
286
|
-
localTimestamp = _Date$toISOString$spl[1];
|
|
287
|
-
} // timestamp will be undefined if no defaultValue or value have
|
|
288
|
-
// been passed in, indicating that we should stay local
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
var nextNormalize = normalize;
|
|
292
|
-
|
|
293
|
-
if (timestamp === undefined) {
|
|
294
|
-
nextNormalize = false;
|
|
295
|
-
setNormalize(nextNormalize);
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
var nextValue = (0, _utils3.textToValue)(nextTextValue, schema, range, timestamp || localTimestamp, nextNormalize); // reset to original state
|
|
299
|
-
|
|
300
|
-
if (nextValue === undefined) setNormalize(true); // update value even when undefined
|
|
308
|
+
var nextValue = (0, _utils2.textToValue)(nextTextValue, schema, range, reference, outputFormat);
|
|
309
|
+
if (nextValue !== undefined) setReference(getReference(nextValue)); // update value even when undefined
|
|
301
310
|
|
|
302
311
|
setValue(nextValue);
|
|
303
312
|
|
|
@@ -317,16 +326,7 @@ var DateInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, refArg) {
|
|
|
317
326
|
}));
|
|
318
327
|
if (_onFocus) _onFocus(event);
|
|
319
328
|
}
|
|
320
|
-
})),
|
|
321
|
-
onClick: open ? closeCalendar : openCalendar,
|
|
322
|
-
plain: true,
|
|
323
|
-
icon: icon || MaskedInputIcon || /*#__PURE__*/_react["default"].createElement(_Calendar.Calendar, {
|
|
324
|
-
size: iconSize
|
|
325
|
-
}),
|
|
326
|
-
margin: {
|
|
327
|
-
right: 'small'
|
|
328
|
-
}
|
|
329
|
-
}))));
|
|
329
|
+
})), !reverse && calendarButton)));
|
|
330
330
|
|
|
331
331
|
if (inline) {
|
|
332
332
|
return /*#__PURE__*/_react["default"].createElement(_Box.Box, null, input, calendar);
|
|
@@ -341,11 +341,8 @@ var DateInput = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, refArg) {
|
|
|
341
341
|
}, /*#__PURE__*/_react["default"].createElement(_Drop.Drop, _extends({
|
|
342
342
|
overflow: "visible",
|
|
343
343
|
id: id ? id + "__drop" : undefined,
|
|
344
|
-
target:
|
|
345
|
-
align: _extends({
|
|
346
|
-
top: 'bottom',
|
|
347
|
-
left: 'left'
|
|
348
|
-
}, dropProps),
|
|
344
|
+
target: containerRef.current,
|
|
345
|
+
align: _extends({}, calendarDropdownAlign, dropProps),
|
|
349
346
|
onEsc: closeCalendar,
|
|
350
347
|
onClickOutside: function onClickOutside(_ref4) {
|
|
351
348
|
var target = _ref4.target;
|
|
@@ -19,6 +19,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
19
19
|
icon: _propTypes["default"].element,
|
|
20
20
|
id: _propTypes["default"].string,
|
|
21
21
|
inline: _propTypes["default"].bool,
|
|
22
|
+
reverse: _propTypes["default"].bool,
|
|
22
23
|
inputProps: _propTypes["default"].shape({}),
|
|
23
24
|
name: _propTypes["default"].string,
|
|
24
25
|
onChange: _propTypes["default"].func,
|
|
@@ -25,11 +25,24 @@ var Format = function Format() {
|
|
|
25
25
|
align: "center",
|
|
26
26
|
pad: "large"
|
|
27
27
|
}, /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
28
|
-
width: "medium"
|
|
28
|
+
width: "medium",
|
|
29
|
+
margin: {
|
|
30
|
+
vertical: 'small'
|
|
31
|
+
}
|
|
29
32
|
}, /*#__PURE__*/_react["default"].createElement(_grommet.DateInput, {
|
|
30
33
|
format: "m/d/yy",
|
|
31
34
|
value: value,
|
|
32
35
|
onChange: onChange
|
|
36
|
+
})), /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
|
|
37
|
+
width: "medium",
|
|
38
|
+
margin: {
|
|
39
|
+
vertical: 'small'
|
|
40
|
+
}
|
|
41
|
+
}, /*#__PURE__*/_react["default"].createElement(_grommet.DateInput, {
|
|
42
|
+
format: "m/d/yy",
|
|
43
|
+
value: value,
|
|
44
|
+
reverse: true,
|
|
45
|
+
onChange: onChange
|
|
33
46
|
})));
|
|
34
47
|
};
|
|
35
48
|
|
|
@@ -5,8 +5,17 @@ exports.valuesAreEqual = exports.valueToText = exports.textToValue = exports.sch
|
|
|
5
5
|
|
|
6
6
|
var _utils = require("../Calendar/utils");
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
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); }
|
|
9
9
|
|
|
10
|
+
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; } }
|
|
11
|
+
|
|
12
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
13
|
+
|
|
14
|
+
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); }
|
|
15
|
+
|
|
16
|
+
// Converting between Date and String types is handled via a "schema".
|
|
17
|
+
// The schema is an array of strings, split into strings with identical
|
|
18
|
+
// characters. So, 'mm/dd/yyyy' will be ['mm', '/', 'dd', '/', 'yyyyy'].
|
|
10
19
|
var formatToSchema = function formatToSchema(format) {
|
|
11
20
|
if (!format) return undefined;
|
|
12
21
|
var result = [];
|
|
@@ -79,7 +88,16 @@ var valueToText = function valueToText(value, schema) {
|
|
|
79
88
|
|
|
80
89
|
if (!value || Array.isArray(value) && !value.length) return text;
|
|
81
90
|
var dates = (Array.isArray(value) ? value : [value]).map(function (v) {
|
|
82
|
-
|
|
91
|
+
// TO DO should we extract this to a reusable function?
|
|
92
|
+
var adjustedDate = new Date(v); // if time is not specified in ISOstring, normalize to midnight
|
|
93
|
+
|
|
94
|
+
if (v.indexOf('T') === -1) {
|
|
95
|
+
var offset = adjustedDate.getTimezoneOffset();
|
|
96
|
+
var hour = adjustedDate.getHours();
|
|
97
|
+
adjustedDate.setHours(hour, offset);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return adjustedDate;
|
|
83
101
|
});
|
|
84
102
|
var dateIndex = 0;
|
|
85
103
|
var parts = {};
|
|
@@ -137,7 +155,7 @@ var pullDigits = function pullDigits(text, index) {
|
|
|
137
155
|
return text.slice(index, end);
|
|
138
156
|
};
|
|
139
157
|
|
|
140
|
-
var textToValue = function textToValue(text, schema, range,
|
|
158
|
+
var textToValue = function textToValue(text, schema, range, reference, outputFormat) {
|
|
141
159
|
if (!text) return range ? [] : undefined;
|
|
142
160
|
var result;
|
|
143
161
|
|
|
@@ -145,10 +163,17 @@ var textToValue = function textToValue(text, schema, range, timestamp, normalize
|
|
|
145
163
|
var leapYear = parts.y % 4 === 0 && parts.y % 100 !== 0 || parts.y % 400 === 0; // Do a little sanity checking on the parts first.
|
|
146
164
|
// If not valid, leave as is.
|
|
147
165
|
|
|
148
|
-
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;
|
|
149
|
-
|
|
166
|
+
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
|
|
167
|
+
|
|
168
|
+
var time = reference ? [reference.getHours(), reference.getMinutes(), reference.getSeconds(), reference.getMilliseconds()] : null;
|
|
169
|
+
|
|
170
|
+
var date = _construct(Date, [parts.y, parts.m - 1, parts.d].concat(time)).toISOString();
|
|
150
171
|
|
|
151
|
-
if (
|
|
172
|
+
if (date && outputFormat === 'no timezone') {
|
|
173
|
+
var _handleOffset$toISOSt = (0, _utils.handleOffset)(date).toISOString().split('T');
|
|
174
|
+
|
|
175
|
+
date = _handleOffset$toISOSt[0];
|
|
176
|
+
}
|
|
152
177
|
|
|
153
178
|
if (!range) {
|
|
154
179
|
if (!result) result = date;
|
|
@@ -22,7 +22,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
22
22
|
|
|
23
23
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
24
24
|
|
|
25
|
-
function _extends() { _extends = Object.assign
|
|
25
|
+
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); }
|
|
26
26
|
|
|
27
27
|
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; }
|
|
28
28
|
|
|
@@ -15,7 +15,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
17
|
|
|
18
|
-
function _extends() { _extends = Object.assign
|
|
18
|
+
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); }
|
|
19
19
|
|
|
20
20
|
var connection = function connection(fromTarget, toTarget, _temp) {
|
|
21
21
|
var _ref = _temp === void 0 ? {} : _temp,
|
|
@@ -14,7 +14,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
14
14
|
|
|
15
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
16
|
|
|
17
|
-
function _extends() { _extends = Object.assign
|
|
17
|
+
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); }
|
|
18
18
|
|
|
19
19
|
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; }
|
|
20
20
|
|
|
@@ -17,7 +17,7 @@ var _excluded = ["basis", "children", "direction", "fill", "gap", "values"];
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
19
|
|
|
20
|
-
function _extends() { _extends = Object.assign
|
|
20
|
+
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); }
|
|
21
21
|
|
|
22
22
|
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; }
|
|
23
23
|
|
|
@@ -9,7 +9,7 @@ var _generalPropTypes = require("../../utils/general-prop-types");
|
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
11
|
|
|
12
|
-
function _extends() { _extends = Object.assign
|
|
12
|
+
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); }
|
|
13
13
|
|
|
14
14
|
var PropType = {};
|
|
15
15
|
|
package/components/Drop/Drop.js
CHANGED
|
@@ -25,7 +25,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
25
25
|
|
|
26
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
27
|
|
|
28
|
-
function _extends() { _extends = Object.assign
|
|
28
|
+
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); }
|
|
29
29
|
|
|
30
30
|
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; }
|
|
31
31
|
|
|
@@ -7,6 +7,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
7
7
|
|
|
8
8
|
var _styledComponents = require("styled-components");
|
|
9
9
|
|
|
10
|
+
var _ContainerTargetContext = require("../../contexts/ContainerTargetContext");
|
|
11
|
+
|
|
10
12
|
var _FocusedContainer = require("../FocusedContainer");
|
|
11
13
|
|
|
12
14
|
var _utils = require("../../utils");
|
|
@@ -25,7 +27,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
25
27
|
|
|
26
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
29
|
|
|
28
|
-
function _extends() { _extends = Object.assign
|
|
30
|
+
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); }
|
|
29
31
|
|
|
30
32
|
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; }
|
|
31
33
|
|
|
@@ -67,6 +69,8 @@ var DropContainer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
67
69
|
trapFocus = _ref.trapFocus,
|
|
68
70
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
69
71
|
|
|
72
|
+
var containerTarget = (0, _react.useContext)(_ContainerTargetContext.ContainerTargetContext);
|
|
73
|
+
|
|
70
74
|
var theme = (0, _react.useContext)(_styledComponents.ThemeContext) || _defaultProps.defaultProps.theme;
|
|
71
75
|
|
|
72
76
|
var portalContext = (0, _react.useContext)(_utils.PortalContext) || defaultPortalContext;
|
|
@@ -278,7 +282,7 @@ var DropContainer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
278
282
|
var onClickDocument = function onClickDocument(event) {
|
|
279
283
|
// determine which portal id the target is in, if any
|
|
280
284
|
var clickedPortalId = null;
|
|
281
|
-
var node = event.target;
|
|
285
|
+
var node = containerTarget === document.body ? event.target : event == null ? void 0 : event.path[0];
|
|
282
286
|
|
|
283
287
|
while (clickedPortalId === null && node !== document) {
|
|
284
288
|
var attr = node.getAttribute('data-g-portal-id');
|
|
@@ -313,7 +317,7 @@ var DropContainer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
313
317
|
document.removeEventListener('mousedown', onClickDocument);
|
|
314
318
|
}
|
|
315
319
|
};
|
|
316
|
-
}, [align, onAlign, dropTarget, onClickOutside, portalContext, portalId, ref, responsive, restrictFocus, stretch, theme.drop]);
|
|
320
|
+
}, [align, containerTarget, onAlign, dropTarget, onClickOutside, portalContext, portalId, ref, responsive, restrictFocus, stretch, theme.drop]);
|
|
317
321
|
(0, _react.useEffect)(function () {
|
|
318
322
|
if (restrictFocus) {
|
|
319
323
|
(ref || dropRef).current.focus();
|
|
@@ -19,7 +19,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
21
|
|
|
22
|
-
function _extends() { _extends = Object.assign
|
|
22
|
+
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); }
|
|
23
23
|
|
|
24
24
|
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; }
|
|
25
25
|
|
|
@@ -9,7 +9,7 @@ var _generalPropTypes = require("../../utils/general-prop-types");
|
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
11
|
|
|
12
|
-
function _extends() { _extends = Object.assign
|
|
12
|
+
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); }
|
|
13
13
|
|
|
14
14
|
var PropType = {};
|
|
15
15
|
|