grommet 2.47.0 → 2.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/all/stories/AllComponents.stories.js +1 -2
- package/components/Accordion/Accordion.js +1 -2
- package/components/Accordion/stories/CustomHeader.stories.js +1 -2
- package/components/AccordionPanel/AccordionPanel.js +1 -2
- package/components/Anchor/Anchor.js +5 -6
- package/components/Anchor/StyledAnchor.js +1 -2
- package/components/Avatar/Avatar.js +1 -2
- package/components/Box/Box.js +6 -3
- package/components/Box/ResponsiveContainerProvider.js +1 -2
- package/components/Box/StyledBox.js +4 -3
- package/components/Box/stories/ResponsiveContainer.stories.js +1 -2
- package/components/Button/Badge.js +1 -2
- package/components/Button/BusyAnimation.js +1 -2
- package/components/Button/Button.js +1 -2
- package/components/Button/StyledButton.js +4 -3
- package/components/Button/StyledButtonKind.js +4 -3
- package/components/Button/index.d.ts +1 -1
- package/components/Button/propTypes.js +1 -1
- package/components/Button/stories/Busy.stories.js +1 -2
- package/components/Calendar/Calendar.js +152 -130
- package/components/Calendar/StyledCalendar.js +34 -37
- package/components/Calendar/stories/ActiveDate.stories.js +1 -2
- package/components/Calendar/stories/CustomDay.stories.js +1 -2
- package/components/Calendar/stories/CustomHeader.stories.js +1 -2
- package/components/Calendar/stories/CustomThemed/CustomSizeHeading.stories.js +1 -2
- package/components/Calendar/stories/Dual.stories.js +1 -4
- package/components/Calendar/stories/HeaderLevel.stories.js +1 -2
- package/components/Calendar/stories/Multiple.stories.js +1 -2
- package/components/Calendar/stories/ShowAdjacentDays.stories.js +2 -3
- package/components/Calendar/stories/Simple.stories.js +1 -2
- package/components/Card/Card.js +1 -2
- package/components/Cards/Cards.js +1 -2
- package/components/Carousel/Carousel.js +1 -2
- package/components/Carousel/CarouselChild.js +1 -2
- package/components/Carousel/StyledCarousel.js +1 -2
- package/components/Chart/Chart.js +4 -5
- package/components/Chart/StyledChart.js +1 -2
- package/components/Chart/stories/Rich.stories.js +1 -2
- package/components/Chart/stories/Scan.stories.js +1 -2
- package/components/Chart/stories/Window.stories.js +1 -2
- package/components/Chart/stories/Zoom.stories.js +1 -2
- package/components/CheckBox/CheckBox.js +1 -2
- package/components/CheckBox/StyledCheckBox.js +1 -2
- package/components/CheckBox/stories/CustomThemed/Custom.stories.js +1 -2
- package/components/CheckBox/stories/CustomThemed/CustomToggle.stories.js +1 -2
- package/components/CheckBox/stories/Indeterminate.stories.js +1 -2
- package/components/CheckBox/stories/NoLabel.stories.js +1 -2
- package/components/CheckBox/stories/Simple.stories.js +1 -2
- package/components/CheckBox/stories/WithStickyDiv.stories.js +1 -2
- package/components/CheckBoxGroup/CheckBoxGroup.js +15 -4
- package/components/CheckBoxGroup/stories/Children.stories.js +1 -2
- package/components/CheckBoxGroup/stories/InitialValues.stories.js +1 -2
- package/components/Clock/Analog.js +1 -2
- package/components/Clock/Clock.js +1 -2
- package/components/Clock/Digital.js +1 -2
- package/components/Clock/StyledClock.js +1 -2
- package/components/Collapsible/Collapsible.js +1 -2
- package/components/Data/Data.js +1 -2
- package/components/Data/DataForm.js +1 -2
- package/components/Data/index.d.ts +3 -0
- package/components/Data/propTypes.js +4 -1
- package/components/Data/stories/Infinite.stories.js +2 -3
- package/components/Data/stories/Inline.stories.js +1 -2
- package/components/Data/stories/OnSelect.stories.js +2 -3
- package/components/Data/stories/SpaceX.stories.js +2 -3
- package/components/Data/stories/StarWars.stories.js +13 -39
- package/components/DataChart/DataChart.js +4 -5
- package/components/DataChart/Detail.js +1 -2
- package/components/DataChart/Legend.js +1 -2
- package/components/DataChart/XAxis.js +1 -2
- package/components/DataChart/XGuide.js +1 -2
- package/components/DataChart/YAxis.js +1 -2
- package/components/DataChart/YGuide.js +1 -2
- package/components/DataChart/stories/Prediction.stories.js +1 -2
- package/components/DataClearFilters/DataClearFilters.js +1 -2
- package/components/DataClearFilters/stories/Simple.stories.js +1 -2
- package/components/DataFilter/DataFilter.js +5 -3
- package/components/DataFilters/DataFilters.js +1 -2
- package/components/DataSearch/DataSearch.js +1 -2
- package/components/DataSort/DataSort.js +3 -3
- package/components/DataSummary/DataSummary.js +1 -2
- package/components/DataTable/Body.js +106 -35
- package/components/DataTable/Cell.js +1 -2
- package/components/DataTable/DataTable.js +49 -16
- package/components/DataTable/ExpanderCell.js +55 -7
- package/components/DataTable/Footer.js +1 -2
- package/components/DataTable/GroupedBody.js +12 -5
- package/components/DataTable/Header.js +83 -32
- package/components/DataTable/PlaceholderBody.js +1 -2
- package/components/DataTable/Resizer.js +164 -47
- package/components/DataTable/Searcher.js +36 -7
- package/components/DataTable/StyledDataTable.js +2 -3
- package/components/DataTable/index.d.ts +19 -0
- package/components/DataTable/propTypes.js +19 -0
- package/components/DataTable/stories/ControlledGrouped.stories.js +5 -2
- package/components/DataTable/stories/Grouped.stories.js +7 -1
- package/components/DataTable/stories/GroupedOnSelect.stories.js +7 -1
- package/components/DataTable/stories/OnUpdate.stories.js +4 -2
- package/components/DataTable/stories/SpaceX.stories.js +9 -3
- package/components/DataTable/stories/SpaceXUngrouped.stories.js +2 -3
- package/components/DataTable/stories/Styled.stories.js +5 -1
- package/components/DataTable/stories/rowDetails.stories.js +19 -43
- package/components/DataTableColumns/DataTableColumns.js +15 -2
- package/components/DataTableGroupBy/DataTableGroupBy.js +1 -2
- package/components/DataView/DataView.js +1 -2
- package/components/DateInput/DateInput.js +13 -13
- package/components/DateInput/stories/FormatInline.stories.js +1 -2
- package/components/Diagram/Diagram.js +1 -2
- package/components/Diagram/StyledDiagram.js +1 -2
- package/components/Diagram/stories/Animated.stories.js +1 -2
- package/components/Diagram/stories/Progressing.stories.js +1 -2
- package/components/Drop/Drop.js +1 -2
- package/components/Drop/DropContainer.js +1 -2
- package/components/Drop/StyledDrop.js +1 -2
- package/components/Drop/stories/CustomThemed/Lazy.stories.js +1 -2
- package/components/Drop/stories/CustomThemed/Themed.stories.js +1 -2
- package/components/Drop/stories/Inline.stories.js +1 -2
- package/components/Drop/stories/Meter.stories.js +1 -2
- package/components/Drop/stories/Multiple.stories.js +1 -2
- package/components/Drop/stories/Overflow.stories.js +1 -2
- package/components/Drop/stories/Plain.stories.js +1 -2
- package/components/Drop/stories/Progressive.stories.js +1 -2
- package/components/Drop/stories/Simple.stories.js +1 -2
- package/components/Drop/stories/Styled.stories.js +1 -2
- package/components/DropButton/DropButton.js +1 -2
- package/components/FileInput/FileInput.js +38 -6
- package/components/FileInput/index.d.ts +10 -1
- package/components/FileInput/propTypes.js +11 -0
- package/components/FocusedContainer.js +1 -2
- package/components/Form/Form.js +11 -12
- package/components/Form/FormContext.js +1 -2
- package/components/Form/stories/ArrayOfFormFields.stories.js +1 -2
- package/components/Form/stories/Controlled.stories.js +2 -2
- package/components/Form/stories/ControlledInput.stories.js +2 -2
- package/components/Form/stories/ControlledInputLazy.stories.js +2 -2
- package/components/Form/stories/ControlledLazy.stories.js +2 -2
- package/components/Form/stories/CustomThemed/Custom.stories.js +1 -0
- package/components/Form/stories/CustomThemed/FieldBorderPosition.stories.js +1 -2
- package/components/Form/stories/CustomThemed/FieldCustomStates.stories.js +1 -2
- package/components/Form/stories/DynamicFields.stories.js +1 -2
- package/components/Form/stories/FieldStates.stories.js +1 -2
- package/components/Form/stories/FieldWithChildren.stories.js +2 -0
- package/components/Form/stories/SolicitedFeedback.stories.js +1 -2
- package/components/Form/stories/Uncontrolled.stories.js +1 -0
- package/components/Form/stories/UnsolicitedFeedback.stories.js +1 -2
- package/components/Form/stories/ValidateOnBlur.stories.js +1 -1
- package/components/Form/stories/ValidateOnChange.stories.js +1 -2
- package/components/Form/stories/ValidateOnMount.stories.js +1 -2
- package/components/Form/stories/typescript/TypedForm.stories.tsx +7 -1
- package/components/FormField/FormField.js +23 -3
- package/components/FormField/stories/Simple.stories.js +1 -2
- package/components/Grid/Grid.js +1 -2
- package/components/Grid/StyledGrid.js +1 -2
- package/components/Grid/stories/ResponsiveCards.stories.js +1 -2
- package/components/Grommet/Grommet.js +1 -2
- package/components/Grommet/StyledGrommet.js +1 -2
- package/components/Grommet/index.d.ts +30 -0
- package/components/Grommet/propTypes.js +31 -1
- package/components/Header/Header.js +1 -2
- package/components/Header/stories/Sticky.stories.js +1 -2
- package/components/Heading/Heading.js +1 -2
- package/components/Heading/HeadingSkeleton.js +1 -2
- package/components/Heading/StyledHeading.js +1 -2
- package/components/Image/Image.js +1 -2
- package/components/Image/StyledImage.js +1 -2
- package/components/InfiniteScroll/InfiniteScroll.js +1 -2
- package/components/Layer/Layer.js +37 -13
- package/components/Layer/LayerContainer.js +19 -17
- package/components/Layer/StyledLayer.js +1 -2
- package/components/Layer/stories/Form.stories.js +1 -1
- package/components/List/List.js +135 -146
- package/components/List/index.d.ts +3 -0
- package/components/List/propTypes.js +3 -0
- package/components/List/stories/Order.stories.js +1 -2
- package/components/List/stories/Pinned.stories.js +1 -2
- package/components/Markdown/Markdown.js +1 -2
- package/components/MaskedInput/MaskedInput.js +1 -2
- package/components/Menu/Menu.js +1 -2
- package/components/Meter/Bar.js +1 -2
- package/components/Meter/Circle.js +1 -2
- package/components/Meter/Meter.js +1 -2
- package/components/Meter/StyledMeter.js +1 -2
- package/components/Meter/stories/Circle.stories.js +1 -2
- package/components/Meter/stories/VerticalBarMultiple.stories.js +1 -2
- package/components/NameValueList/NameValueList.js +1 -2
- package/components/NameValuePair/NameValuePair.js +1 -2
- package/components/Nav/stories/CustomThemed/JustifySidebar.stories.js +1 -2
- package/components/Nav/stories/Sidebar.stories.js +1 -2
- package/components/Notification/Notification.js +21 -6
- package/components/Notification/index.d.ts +3 -0
- package/components/Notification/propTypes.js +3 -0
- package/components/Notification/stories/Global.stories.js +1 -2
- package/components/Notification/stories/Title.stories.js +1 -2
- package/components/Notification/stories/TitleAndMessage.stories.js +1 -2
- package/components/Page/Page.js +1 -2
- package/components/Page/stories/PageNotificaton.stories.js +1 -2
- package/components/PageContent/PageContent.js +1 -2
- package/components/PageHeader/PageHeader.js +1 -2
- package/components/PageHeader/stories/MultipleActions.stories.js +1 -2
- package/components/Pagination/Pagination.js +1 -2
- package/components/Pagination/PaginationStep.js +1 -2
- package/components/Pagination/PaginationSummary.js +1 -2
- package/components/Pagination/stories/Grid.stories.js +1 -2
- package/components/Paragraph/Paragraph.js +1 -2
- package/components/Paragraph/ParagraphSkeleton.js +1 -2
- package/components/Paragraph/StyledParagraph.js +1 -2
- package/components/RadioButton/RadioButton.js +1 -2
- package/components/RadioButton/StyledRadioButton.js +3 -4
- package/components/RadioButtonGroup/RadioButtonGroup.js +17 -7
- package/components/RadioButtonGroup/stories/Children.stories.js +1 -2
- package/components/RadioButtonGroup/stories/CustomThemed/CustomTheme.stories.js +1 -2
- package/components/RadioButtonGroup/stories/Disabled.stories.js +1 -2
- package/components/RangeInput/RangeInput.js +2 -3
- package/components/RangeInput/StyledRangeInput.js +1 -2
- package/components/RangeInput/stories/CustomThemed/Bounds.stories.js +1 -2
- package/components/RangeSelector/EdgeControl.js +56 -13
- package/components/RangeSelector/RangeSelector.js +12 -25
- package/components/RangeSelector/stories/Basic.stories.js +1 -2
- package/components/RangeSelector/stories/CustomThemed/Custom.stories.js +1 -2
- package/components/RangeSelector/stories/CustomThemed/CustomEdgeControl.stories.js +1 -2
- package/components/RangeSelector/stories/Label.stories.js +1 -2
- package/components/RangeSelector/stories/Simple.stories.js +1 -2
- package/components/RangeSelector/stories/Step.stories.js +1 -2
- package/components/RangeSelector/stories/Thin.stories.js +1 -2
- package/components/RangeSelector/stories/Vertical.stories.js +1 -2
- package/components/RoutedAnchor/RoutedAnchor.js +1 -2
- package/components/RoutedButton/RoutedButton.js +1 -2
- package/components/Select/DefaultSelectTextInput.js +1 -2
- package/components/Select/Select.js +17 -4
- package/components/Select/SelectContainer.js +33 -10
- package/components/Select/stories/ChildrenRender.stories.js +1 -2
- package/components/Select/stories/Clear.stories.js +1 -2
- package/components/Select/stories/Controlled.stories.js +1 -2
- package/components/Select/stories/CustomThemed/CustomSearch.stories.js +1 -2
- package/components/Select/stories/Disabled.stories.js +1 -2
- package/components/Select/stories/InsideFormField.stories.js +1 -2
- package/components/Select/stories/Multiple.stories.js +1 -2
- package/components/Select/stories/ObjectOptions.stories.js +1 -2
- package/components/Select/stories/Search.stories.js +1 -2
- package/components/Select/stories/Simple.stories.js +1 -2
- package/components/Select/stories/ValueLabel.stories.js +1 -2
- package/components/Select/stories/components/SearchBorderBox.js +1 -2
- package/components/Select/stories/components/SearchInput.js +1 -2
- package/components/Select/utils.js +13 -4
- package/components/SelectMultiple/SelectMultiple.js +32 -19
- package/components/SelectMultiple/SelectMultipleContainer.js +26 -17
- package/components/SelectMultiple/SelectMultipleValue.js +1 -2
- package/components/SelectMultiple/SelectionSummary.js +1 -2
- package/components/SelectMultiple/stories/CustomMessages.stories.js +1 -2
- package/components/SelectMultiple/stories/Default.stories.js +1 -2
- package/components/SelectMultiple/stories/Disabled.stories.js +1 -2
- package/components/SelectMultiple/stories/FormField.stories.js +1 -2
- package/components/SelectMultiple/stories/Help.stories.js +1 -2
- package/components/SelectMultiple/stories/Limited.stories.js +1 -2
- package/components/SelectMultiple/stories/ObjectOptions.stories.js +1 -2
- package/components/SelectMultiple/stories/ShowSelectedInline.stories.js +1 -2
- package/components/Skeleton/Skeleton.js +6 -3
- package/components/Skeleton/SkeletonContext.js +1 -2
- package/components/Skeleton/stories/CustomThemed/Custom.stories.js +1 -4
- package/components/Skeleton/stories/GridContainer.stories.js +1 -2
- package/components/Skeleton/stories/Simple.stories.js +0 -1
- package/components/SkipLink/SkipLink.js +1 -2
- package/components/SkipLinks/SkipLinks.js +1 -2
- package/components/Spinner/Spinner.js +1 -2
- package/components/Spinner/stories/Animation.stories.js +1 -2
- package/components/Spinner/stories/Announced.stories.js +1 -2
- package/components/Stack/Stack.js +1 -2
- package/components/Stack/StyledStack.js +1 -2
- package/components/StarRating/StarRating.js +1 -2
- package/components/Tab/StyledTab.js +1 -2
- package/components/Tab/Tab.js +1 -2
- package/components/Table/StyledTable.js +1 -2
- package/components/Table/Table.js +1 -2
- package/components/Table/stories/InfiniteScrollInTable.stories.js +1 -2
- package/components/TableBody/TableBody.js +1 -2
- package/components/TableCell/TableCell.js +21 -5
- package/components/TableFooter/TableFooter.js +1 -2
- package/components/TableHeader/TableHeader.js +1 -2
- package/components/TableRow/TableRow.js +1 -2
- package/components/Tabs/StyledTabs.js +1 -2
- package/components/Tabs/Tabs.js +1 -2
- package/components/Tabs/stories/CustomThemed/States.stories.js +1 -2
- package/components/Tabs/stories/Responsive.stories.js +1 -2
- package/components/Tag/Tag.js +1 -2
- package/components/Text/StyledText.js +1 -2
- package/components/Text/Text.js +1 -2
- package/components/Text/TextSkeleton.js +1 -2
- package/components/TextArea/StyledTextArea.js +1 -2
- package/components/TextArea/TextArea.js +1 -2
- package/components/TextArea/stories/CustomThemed/Themed.stories.js +1 -2
- package/components/TextArea/stories/InsideFormField.stories.js +1 -2
- package/components/TextArea/stories/NonResizable.stories.js +1 -2
- package/components/TextArea/stories/Simple.stories.js +1 -2
- package/components/TextInput/CopyButton.js +3 -1
- package/components/TextInput/StyledTextInput.js +1 -2
- package/components/TextInput/TextInput.js +5 -3
- package/components/TextInput/stories/InsideFormField.stories.js +1 -2
- package/components/Tip/Tip.js +1 -2
- package/components/Tip/stories/HeaderActions.stories.js +1 -2
- package/components/ToggleGroup/ToggleGroup.js +1 -2
- package/components/ToggleGroup/stories/Controlled.stories.js +1 -2
- package/components/Toolbar/Toolbar.js +1 -2
- package/components/Video/StyledVideo.js +1 -2
- package/components/Video/Video.js +13 -14
- package/components/WorldMap/WorldMap.js +1 -2
- package/contexts/AnalyticsContext/AnalyticsContext.js +1 -2
- package/contexts/AnnounceContext/AnnounceContext.js +28 -5
- package/contexts/AnnounceContext/stories/Polite.stories.js +1 -2
- package/contexts/RootsContext.js +1 -2
- package/contexts/ThemeContext/stories/ThemeContextExtend.stories.js +1 -2
- package/es6/components/Anchor/Anchor.js +4 -4
- package/es6/components/Box/Box.js +5 -1
- package/es6/components/Box/StyledBox.js +4 -2
- package/es6/components/Button/StyledButton.js +3 -1
- package/es6/components/Button/StyledButtonKind.js +3 -1
- package/es6/components/Button/index.d.ts +1 -1
- package/es6/components/Button/propTypes.js +1 -1
- package/es6/components/Calendar/Calendar.js +151 -128
- package/es6/components/Calendar/StyledCalendar.js +34 -36
- package/es6/components/Calendar/stories/Dual.stories.js +0 -2
- package/es6/components/Calendar/stories/ShowAdjacentDays.stories.js +1 -1
- package/es6/components/Chart/Chart.js +3 -3
- package/es6/components/CheckBoxGroup/CheckBoxGroup.js +14 -2
- package/es6/components/Data/index.d.ts +3 -0
- package/es6/components/Data/propTypes.js +4 -1
- package/es6/components/Data/stories/Infinite.stories.js +1 -1
- package/es6/components/Data/stories/OnSelect.stories.js +1 -1
- package/es6/components/Data/stories/SpaceX.stories.js +1 -1
- package/es6/components/Data/stories/StarWars.stories.js +13 -38
- package/es6/components/DataChart/DataChart.js +3 -3
- package/es6/components/DataFilter/DataFilter.js +4 -1
- package/es6/components/DataSort/DataSort.js +2 -1
- package/es6/components/DataTable/Body.js +106 -33
- package/es6/components/DataTable/DataTable.js +48 -14
- package/es6/components/DataTable/ExpanderCell.js +54 -6
- package/es6/components/DataTable/GroupedBody.js +11 -3
- package/es6/components/DataTable/Header.js +82 -30
- package/es6/components/DataTable/Resizer.js +165 -46
- package/es6/components/DataTable/Searcher.js +36 -6
- package/es6/components/DataTable/StyledDataTable.js +1 -1
- package/es6/components/DataTable/index.d.ts +19 -0
- package/es6/components/DataTable/propTypes.js +19 -0
- package/es6/components/DataTable/stories/ControlledGrouped.stories.js +4 -0
- package/es6/components/DataTable/stories/Grouped.stories.js +7 -1
- package/es6/components/DataTable/stories/GroupedOnSelect.stories.js +7 -1
- package/es6/components/DataTable/stories/OnUpdate.stories.js +3 -0
- package/es6/components/DataTable/stories/SpaceX.stories.js +8 -1
- package/es6/components/DataTable/stories/SpaceXUngrouped.stories.js +1 -1
- package/es6/components/DataTable/stories/Styled.stories.js +5 -1
- package/es6/components/DataTable/stories/rowDetails.stories.js +19 -42
- package/es6/components/DataTableColumns/DataTableColumns.js +14 -0
- package/es6/components/DateInput/DateInput.js +13 -12
- package/es6/components/FileInput/FileInput.js +37 -4
- package/es6/components/FileInput/index.d.ts +10 -1
- package/es6/components/FileInput/propTypes.js +11 -0
- package/es6/components/Form/Form.js +10 -10
- package/es6/components/Form/stories/Controlled.stories.js +1 -0
- package/es6/components/Form/stories/ControlledInput.stories.js +1 -0
- package/es6/components/Form/stories/ControlledInputLazy.stories.js +1 -0
- package/es6/components/Form/stories/ControlledLazy.stories.js +1 -0
- package/es6/components/Form/stories/CustomThemed/Custom.stories.js +1 -0
- package/es6/components/Form/stories/FieldWithChildren.stories.js +2 -0
- package/es6/components/Form/stories/Uncontrolled.stories.js +1 -0
- package/es6/components/Form/stories/ValidateOnBlur.stories.js +1 -1
- package/es6/components/Form/stories/typescript/TypedForm.stories.tsx +7 -1
- package/es6/components/FormField/FormField.js +22 -1
- package/es6/components/Grommet/index.d.ts +30 -0
- package/es6/components/Grommet/propTypes.js +31 -1
- package/es6/components/Layer/Layer.js +37 -12
- package/es6/components/Layer/LayerContainer.js +20 -16
- package/es6/components/Layer/stories/Form.stories.js +1 -1
- package/es6/components/List/List.js +136 -146
- package/es6/components/List/index.d.ts +3 -0
- package/es6/components/List/propTypes.js +3 -0
- package/es6/components/Notification/Notification.js +22 -5
- package/es6/components/Notification/index.d.ts +3 -0
- package/es6/components/Notification/propTypes.js +3 -0
- package/es6/components/RadioButton/StyledRadioButton.js +2 -2
- package/es6/components/RadioButtonGroup/RadioButtonGroup.js +16 -5
- package/es6/components/RangeInput/RangeInput.js +1 -1
- package/es6/components/RangeSelector/EdgeControl.js +57 -12
- package/es6/components/RangeSelector/RangeSelector.js +11 -23
- package/es6/components/Select/Select.js +17 -3
- package/es6/components/Select/SelectContainer.js +32 -8
- package/es6/components/Select/utils.js +11 -1
- package/es6/components/SelectMultiple/SelectMultiple.js +32 -18
- package/es6/components/SelectMultiple/SelectMultipleContainer.js +25 -15
- package/es6/components/Skeleton/Skeleton.js +5 -1
- package/es6/components/Skeleton/stories/CustomThemed/Custom.stories.js +0 -2
- package/es6/components/Skeleton/stories/Simple.stories.js +0 -1
- package/es6/components/TableCell/TableCell.js +20 -3
- package/es6/components/TextInput/CopyButton.js +3 -1
- package/es6/components/TextInput/TextInput.js +4 -1
- package/es6/components/Video/Video.js +12 -12
- package/es6/contexts/AnnounceContext/AnnounceContext.js +28 -5
- package/es6/languages/default.json +33 -3
- package/es6/themes/base.d.ts +20 -0
- package/es6/themes/base.js +22 -8
- package/es6/utils/styles.js +53 -45
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/languages/default.json +33 -3
- package/package.json +32 -32
- package/themes/base.d.ts +20 -0
- package/themes/base.js +22 -8
- package/utils/styles.js +53 -45
- package/utils/useId.js +1 -2
|
@@ -4,6 +4,9 @@ import { Box, DataTable } from 'grommet';
|
|
|
4
4
|
// Source code for the data can be found here
|
|
5
5
|
// https://github.com/grommet/grommet/blob/master/src/js/components/DataTable/stories/data.js
|
|
6
6
|
import { groupColumns, DATA } from './data';
|
|
7
|
+
var expandLabel = function expandLabel(row) {
|
|
8
|
+
return row == null ? void 0 : row.location;
|
|
9
|
+
};
|
|
7
10
|
export var GroupedDataTable = function GroupedDataTable() {
|
|
8
11
|
return (
|
|
9
12
|
/*#__PURE__*/
|
|
@@ -15,7 +18,10 @@ export var GroupedDataTable = function GroupedDataTable() {
|
|
|
15
18
|
}, /*#__PURE__*/React.createElement(DataTable, {
|
|
16
19
|
columns: groupColumns,
|
|
17
20
|
data: DATA,
|
|
18
|
-
groupBy:
|
|
21
|
+
groupBy: {
|
|
22
|
+
property: 'location',
|
|
23
|
+
expandLabel: expandLabel
|
|
24
|
+
},
|
|
19
25
|
sortable: true
|
|
20
26
|
}))
|
|
21
27
|
// </Grommet>
|
|
@@ -10,6 +10,9 @@ groupColumns[0] = _extends({}, groupColumns[1]);
|
|
|
10
10
|
groupColumns[1] = _extends({}, first);
|
|
11
11
|
groupColumns[0].footer = groupColumns[1].footer;
|
|
12
12
|
delete groupColumns[1].footer;
|
|
13
|
+
var expandLabel = function expandLabel(row) {
|
|
14
|
+
return (row == null ? void 0 : row.location) + " location";
|
|
15
|
+
};
|
|
13
16
|
export var GroupedOnSelectDataTable = function GroupedOnSelectDataTable() {
|
|
14
17
|
return (
|
|
15
18
|
/*#__PURE__*/
|
|
@@ -21,7 +24,10 @@ export var GroupedOnSelectDataTable = function GroupedOnSelectDataTable() {
|
|
|
21
24
|
}, /*#__PURE__*/React.createElement(DataTable, {
|
|
22
25
|
columns: groupColumns,
|
|
23
26
|
data: DATA,
|
|
24
|
-
groupBy:
|
|
27
|
+
groupBy: {
|
|
28
|
+
property: 'location',
|
|
29
|
+
expandLabel: expandLabel
|
|
30
|
+
},
|
|
25
31
|
onSelect: function onSelect() {},
|
|
26
32
|
sortable: true
|
|
27
33
|
}))
|
|
@@ -260,6 +260,9 @@ export var OnUpdateDataTable = function OnUpdateDataTable() {
|
|
|
260
260
|
return {
|
|
261
261
|
expandable: expandable,
|
|
262
262
|
expand: expand,
|
|
263
|
+
expandLabel: function expandLabel(row) {
|
|
264
|
+
return row.location + " location";
|
|
265
|
+
},
|
|
263
266
|
select: groupSelected,
|
|
264
267
|
property: 'location',
|
|
265
268
|
onSelect: onGroupSelect
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/
|
|
1
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return r; }; var t, r = {}, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag"; function c(t, r, e, n) { return Object.defineProperty(t, r, { value: e, enumerable: !n, configurable: !n, writable: !n }); } try { c({}, ""); } catch (t) { c = function c(t, r, e) { return t[r] = e; }; } function h(r, e, n, o) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype); return c(a, "_invoke", function (r, e, n) { var o = 1; return function (i, a) { if (3 === o) throw Error("Generator is already running"); if (4 === o) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var u = n.delegate; if (u) { var c = d(u, n); if (c) { if (c === f) continue; return c; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (1 === o) throw o = 4, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = 3; var h = s(r, e, n); if ("normal" === h.type) { if (o = n.done ? 4 : 2, h.arg === f) continue; return { value: h.arg, done: n.done }; } "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg); } }; }(r, n, new Context(o || [])), !0), a; } function s(t, r, e) { try { return { type: "normal", arg: t.call(r, e) }; } catch (t) { return { type: "throw", arg: t }; } } r.wrap = h; var f = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var l = {}; c(l, i, function () { return this; }); var p = Object.getPrototypeOf, y = p && p(p(x([]))); y && y !== e && n.call(y, i) && (l = y); var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l); function g(t) { ["next", "throw", "return"].forEach(function (r) { c(t, r, function (t) { return this._invoke(r, t); }); }); } function AsyncIterator(t, r) { function e(o, i, a, u) { var c = s(t[o], t, i); if ("throw" !== c.type) { var h = c.arg, f = h.value; return f && "object" == typeof f && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) { e("next", t, a, u); }, function (t) { e("throw", t, a, u); }) : r.resolve(f).then(function (t) { h.value = t, a(h); }, function (t) { return e("throw", t, a, u); }); } u(c.arg); } var o; c(this, "_invoke", function (t, n) { function i() { return new r(function (r, o) { e(t, n, r, o); }); } return o = o ? o.then(i, i) : i(); }, !0); } function d(r, e) { var n = e.method, o = r.i[n]; if (o === t) return e.delegate = null, "throw" === n && r.i["return"] && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f; var i = s(o, r.i, e.arg); if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f; var a = i.arg; return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f); } function w(t) { this.tryEntries.push(t); } function m(r) { var e = r[4] || {}; e.type = "normal", e.arg = t, r[4] = e; } function Context(t) { this.tryEntries = [[-1]], t.forEach(w, this), this.reset(!0); } function x(r) { if (null != r) { var e = r[i]; if (e) return e.call(r); if ("function" == typeof r.next) return r; if (!isNaN(r.length)) { var o = -1, a = function e() { for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e; return e.value = t, e.done = !0, e; }; return a.next = a; } } throw new TypeError(typeof r + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, "GeneratorFunction"), r.isGeneratorFunction = function (t) { var r = "function" == typeof t && t.constructor; return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name)); }, r.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t; }, r.awrap = function (t) { return { __await: t }; }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () { return this; }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(h(t, e, n, o), i); return r.isGeneratorFunction(e) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, g(v), c(v, u, "Generator"), c(v, i, function () { return this; }), c(v, "toString", function () { return "[object Generator]"; }), r.keys = function (t) { var r = Object(t), e = []; for (var n in r) e.unshift(n); return function t() { for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t; return t.done = !0, t; }; }, r.values = x, Context.prototype = { constructor: Context, reset: function reset(r) { if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0][4]; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(r) { if (this.done) throw r; var e = this; function n(t) { a.type = "throw", a.arg = r, e.next = t; } for (var o = e.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i[4], u = this.prev, c = i[1], h = i[2]; if (-1 === i[0]) return n("end"), !1; if (!c && !h) throw Error("try statement without catch or finally"); if (null != i[0] && i[0] <= u) { if (u < c) return this.method = "next", this.arg = t, n(c), !0; if (u < h) return n(h), !1; } } }, abrupt: function abrupt(t, r) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) { var o = n; break; } } o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null); var i = o ? o[4] : {}; return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i); }, complete: function complete(t, r) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f; }, finish: function finish(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[2] === t) return this.complete(e[4], e[3]), m(e), f; } }, "catch": function _catch(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[0] === t) { var n = e[4]; if ("throw" === n.type) { var o = n.arg; m(e); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(r, e, n) { return this.delegate = { i: x(r), r: e, n: n }, "next" === this.method && (this.arg = t), f; } }, r; }
|
|
2
2
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
3
3
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
4
4
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
@@ -112,6 +112,12 @@ export var SpaceX = function SpaceX() {
|
|
|
112
112
|
return id;
|
|
113
113
|
});
|
|
114
114
|
}, [groups]);
|
|
115
|
+
var expandLabel = function expandLabel(row) {
|
|
116
|
+
if (row && row.name) {
|
|
117
|
+
return row.name;
|
|
118
|
+
}
|
|
119
|
+
return undefined;
|
|
120
|
+
};
|
|
115
121
|
useEffect(function () {
|
|
116
122
|
var fetchData = /*#__PURE__*/function () {
|
|
117
123
|
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
@@ -233,6 +239,7 @@ export var SpaceX = function SpaceX() {
|
|
|
233
239
|
groupBy: {
|
|
234
240
|
expandable: expandable,
|
|
235
241
|
expand: expanded,
|
|
242
|
+
expandLabel: expandLabel,
|
|
236
243
|
property: 'rocketId'
|
|
237
244
|
},
|
|
238
245
|
onUpdate: function onUpdate(opts) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/
|
|
1
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return r; }; var t, r = {}, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag"; function c(t, r, e, n) { return Object.defineProperty(t, r, { value: e, enumerable: !n, configurable: !n, writable: !n }); } try { c({}, ""); } catch (t) { c = function c(t, r, e) { return t[r] = e; }; } function h(r, e, n, o) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype); return c(a, "_invoke", function (r, e, n) { var o = 1; return function (i, a) { if (3 === o) throw Error("Generator is already running"); if (4 === o) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var u = n.delegate; if (u) { var c = d(u, n); if (c) { if (c === f) continue; return c; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (1 === o) throw o = 4, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = 3; var h = s(r, e, n); if ("normal" === h.type) { if (o = n.done ? 4 : 2, h.arg === f) continue; return { value: h.arg, done: n.done }; } "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg); } }; }(r, n, new Context(o || [])), !0), a; } function s(t, r, e) { try { return { type: "normal", arg: t.call(r, e) }; } catch (t) { return { type: "throw", arg: t }; } } r.wrap = h; var f = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var l = {}; c(l, i, function () { return this; }); var p = Object.getPrototypeOf, y = p && p(p(x([]))); y && y !== e && n.call(y, i) && (l = y); var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l); function g(t) { ["next", "throw", "return"].forEach(function (r) { c(t, r, function (t) { return this._invoke(r, t); }); }); } function AsyncIterator(t, r) { function e(o, i, a, u) { var c = s(t[o], t, i); if ("throw" !== c.type) { var h = c.arg, f = h.value; return f && "object" == typeof f && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) { e("next", t, a, u); }, function (t) { e("throw", t, a, u); }) : r.resolve(f).then(function (t) { h.value = t, a(h); }, function (t) { return e("throw", t, a, u); }); } u(c.arg); } var o; c(this, "_invoke", function (t, n) { function i() { return new r(function (r, o) { e(t, n, r, o); }); } return o = o ? o.then(i, i) : i(); }, !0); } function d(r, e) { var n = e.method, o = r.i[n]; if (o === t) return e.delegate = null, "throw" === n && r.i["return"] && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f; var i = s(o, r.i, e.arg); if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f; var a = i.arg; return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f); } function w(t) { this.tryEntries.push(t); } function m(r) { var e = r[4] || {}; e.type = "normal", e.arg = t, r[4] = e; } function Context(t) { this.tryEntries = [[-1]], t.forEach(w, this), this.reset(!0); } function x(r) { if (null != r) { var e = r[i]; if (e) return e.call(r); if ("function" == typeof r.next) return r; if (!isNaN(r.length)) { var o = -1, a = function e() { for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e; return e.value = t, e.done = !0, e; }; return a.next = a; } } throw new TypeError(typeof r + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, "GeneratorFunction"), r.isGeneratorFunction = function (t) { var r = "function" == typeof t && t.constructor; return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name)); }, r.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t; }, r.awrap = function (t) { return { __await: t }; }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () { return this; }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(h(t, e, n, o), i); return r.isGeneratorFunction(e) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, g(v), c(v, u, "Generator"), c(v, i, function () { return this; }), c(v, "toString", function () { return "[object Generator]"; }), r.keys = function (t) { var r = Object(t), e = []; for (var n in r) e.unshift(n); return function t() { for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t; return t.done = !0, t; }; }, r.values = x, Context.prototype = { constructor: Context, reset: function reset(r) { if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0][4]; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(r) { if (this.done) throw r; var e = this; function n(t) { a.type = "throw", a.arg = r, e.next = t; } for (var o = e.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i[4], u = this.prev, c = i[1], h = i[2]; if (-1 === i[0]) return n("end"), !1; if (!c && !h) throw Error("try statement without catch or finally"); if (null != i[0] && i[0] <= u) { if (u < c) return this.method = "next", this.arg = t, n(c), !0; if (u < h) return n(h), !1; } } }, abrupt: function abrupt(t, r) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) { var o = n; break; } } o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null); var i = o ? o[4] : {}; return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i); }, complete: function complete(t, r) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f; }, finish: function finish(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[2] === t) return this.complete(e[4], e[3]), m(e), f; } }, "catch": function _catch(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[0] === t) { var n = e[4]; if ("throw" === n.type) { var o = n.arg; m(e); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(r, e, n) { return this.delegate = { i: x(r), r: e, n: n }, "next" === this.method && (this.arg = t), f; } }, r; }
|
|
2
2
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
3
3
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
4
4
|
import React, { useEffect, useState } from 'react';
|
|
@@ -5,6 +5,9 @@ import { Box, DataTable } from 'grommet';
|
|
|
5
5
|
// https://github.com/grommet/grommet/blob/master/src/js/components/DataTable/stories/data.js
|
|
6
6
|
import { groupColumns, DATA } from './data';
|
|
7
7
|
export var StyledDataTable = function StyledDataTable() {
|
|
8
|
+
var expandLabel = function expandLabel(row) {
|
|
9
|
+
return row.location;
|
|
10
|
+
};
|
|
8
11
|
return (
|
|
9
12
|
/*#__PURE__*/
|
|
10
13
|
// Uncomment <Grommet> lines when using outside of storybook
|
|
@@ -36,7 +39,8 @@ export var StyledDataTable = function StyledDataTable() {
|
|
|
36
39
|
},
|
|
37
40
|
groupBy: {
|
|
38
41
|
property: 'location',
|
|
39
|
-
expand: ['Palo Alto']
|
|
42
|
+
expand: ['Palo Alto'],
|
|
43
|
+
expandLabel: expandLabel
|
|
40
44
|
},
|
|
41
45
|
rowProps: {
|
|
42
46
|
Eric: {
|
|
@@ -1,44 +1,36 @@
|
|
|
1
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/
|
|
1
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return r; }; var t, r = {}, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag"; function c(t, r, e, n) { return Object.defineProperty(t, r, { value: e, enumerable: !n, configurable: !n, writable: !n }); } try { c({}, ""); } catch (t) { c = function c(t, r, e) { return t[r] = e; }; } function h(r, e, n, o) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype); return c(a, "_invoke", function (r, e, n) { var o = 1; return function (i, a) { if (3 === o) throw Error("Generator is already running"); if (4 === o) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var u = n.delegate; if (u) { var c = d(u, n); if (c) { if (c === f) continue; return c; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (1 === o) throw o = 4, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = 3; var h = s(r, e, n); if ("normal" === h.type) { if (o = n.done ? 4 : 2, h.arg === f) continue; return { value: h.arg, done: n.done }; } "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg); } }; }(r, n, new Context(o || [])), !0), a; } function s(t, r, e) { try { return { type: "normal", arg: t.call(r, e) }; } catch (t) { return { type: "throw", arg: t }; } } r.wrap = h; var f = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var l = {}; c(l, i, function () { return this; }); var p = Object.getPrototypeOf, y = p && p(p(x([]))); y && y !== e && n.call(y, i) && (l = y); var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l); function g(t) { ["next", "throw", "return"].forEach(function (r) { c(t, r, function (t) { return this._invoke(r, t); }); }); } function AsyncIterator(t, r) { function e(o, i, a, u) { var c = s(t[o], t, i); if ("throw" !== c.type) { var h = c.arg, f = h.value; return f && "object" == typeof f && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) { e("next", t, a, u); }, function (t) { e("throw", t, a, u); }) : r.resolve(f).then(function (t) { h.value = t, a(h); }, function (t) { return e("throw", t, a, u); }); } u(c.arg); } var o; c(this, "_invoke", function (t, n) { function i() { return new r(function (r, o) { e(t, n, r, o); }); } return o = o ? o.then(i, i) : i(); }, !0); } function d(r, e) { var n = e.method, o = r.i[n]; if (o === t) return e.delegate = null, "throw" === n && r.i["return"] && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f; var i = s(o, r.i, e.arg); if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f; var a = i.arg; return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f); } function w(t) { this.tryEntries.push(t); } function m(r) { var e = r[4] || {}; e.type = "normal", e.arg = t, r[4] = e; } function Context(t) { this.tryEntries = [[-1]], t.forEach(w, this), this.reset(!0); } function x(r) { if (null != r) { var e = r[i]; if (e) return e.call(r); if ("function" == typeof r.next) return r; if (!isNaN(r.length)) { var o = -1, a = function e() { for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e; return e.value = t, e.done = !0, e; }; return a.next = a; } } throw new TypeError(typeof r + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, "GeneratorFunction"), r.isGeneratorFunction = function (t) { var r = "function" == typeof t && t.constructor; return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name)); }, r.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t; }, r.awrap = function (t) { return { __await: t }; }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () { return this; }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(h(t, e, n, o), i); return r.isGeneratorFunction(e) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, g(v), c(v, u, "Generator"), c(v, i, function () { return this; }), c(v, "toString", function () { return "[object Generator]"; }), r.keys = function (t) { var r = Object(t), e = []; for (var n in r) e.unshift(n); return function t() { for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t; return t.done = !0, t; }; }, r.values = x, Context.prototype = { constructor: Context, reset: function reset(r) { if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0][4]; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(r) { if (this.done) throw r; var e = this; function n(t) { a.type = "throw", a.arg = r, e.next = t; } for (var o = e.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i[4], u = this.prev, c = i[1], h = i[2]; if (-1 === i[0]) return n("end"), !1; if (!c && !h) throw Error("try statement without catch or finally"); if (null != i[0] && i[0] <= u) { if (u < c) return this.method = "next", this.arg = t, n(c), !0; if (u < h) return n(h), !1; } } }, abrupt: function abrupt(t, r) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) { var o = n; break; } } o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null); var i = o ? o[4] : {}; return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i); }, complete: function complete(t, r) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f; }, finish: function finish(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[2] === t) return this.complete(e[4], e[3]), m(e), f; } }, "catch": function _catch(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[0] === t) { var n = e[4]; if ("throw" === n.type) { var o = n.arg; m(e); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(r, e, n) { return this.delegate = { i: x(r), r: e, n: n }, "next" === this.method && (this.arg = t), f; } }, r; }
|
|
2
2
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
3
3
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
4
|
-
import React, { useEffect, useMemo,
|
|
4
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
5
5
|
import { Box, Data, DataTable, NameValueList, NameValuePair, Pagination, Text } from 'grommet';
|
|
6
6
|
|
|
7
|
-
// Uses the StarWars API for starships, see https://swapi.
|
|
8
|
-
|
|
9
|
-
var step = 10; // default for https://swapi.dev
|
|
7
|
+
// Uses the StarWars API for starships, see https://swapi.info
|
|
10
8
|
|
|
11
9
|
var fetchData = /*#__PURE__*/function () {
|
|
12
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(
|
|
13
|
-
var
|
|
10
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
11
|
+
var url;
|
|
14
12
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
15
13
|
while (1) switch (_context.prev = _context.next) {
|
|
16
14
|
case 0:
|
|
17
|
-
|
|
18
|
-
if (view.search) params.search = view.search;
|
|
19
|
-
if (view.page) params.page = view.page;
|
|
20
|
-
url = "https://swapi.dev/api/starships?" + Object.keys(params).map(function (k) {
|
|
21
|
-
return k + "=" + params[k];
|
|
22
|
-
}).join('&');
|
|
15
|
+
url = "https://swapi.info/api/starships";
|
|
23
16
|
return _context.abrupt("return", fetch(url, {
|
|
24
17
|
method: 'GET',
|
|
25
18
|
headers: {
|
|
26
19
|
'Content-Type': 'application/json'
|
|
27
|
-
}
|
|
28
|
-
signal: signal
|
|
20
|
+
}
|
|
29
21
|
}).then(function (response) {
|
|
30
22
|
return response.json();
|
|
31
23
|
})["catch"](function (err) {
|
|
32
24
|
if (err.name !== 'AbortError') throw err;
|
|
33
25
|
return {};
|
|
34
26
|
}));
|
|
35
|
-
case
|
|
27
|
+
case 2:
|
|
36
28
|
case "end":
|
|
37
29
|
return _context.stop();
|
|
38
30
|
}
|
|
39
31
|
}, _callee);
|
|
40
32
|
}));
|
|
41
|
-
return function fetchData(
|
|
33
|
+
return function fetchData() {
|
|
42
34
|
return _ref.apply(this, arguments);
|
|
43
35
|
};
|
|
44
36
|
}();
|
|
@@ -97,38 +89,23 @@ export var RowDetails = function RowDetails() {
|
|
|
97
89
|
var _useState2 = useState(0),
|
|
98
90
|
total = _useState2[0],
|
|
99
91
|
setTotal = _useState2[1];
|
|
100
|
-
var _useState3 = useState(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}),
|
|
104
|
-
view = _useState3[0],
|
|
105
|
-
setView = _useState3[1];
|
|
106
|
-
var abortRef = useRef();
|
|
107
|
-
var _useState4 = useState(['Y-wing']),
|
|
108
|
-
expand = _useState4[0],
|
|
109
|
-
setExpand = _useState4[1];
|
|
92
|
+
var _useState3 = useState(['Y-wing']),
|
|
93
|
+
expand = _useState3[0],
|
|
94
|
+
setExpand = _useState3[1];
|
|
110
95
|
useEffect(function () {
|
|
111
|
-
|
|
112
|
-
// This API is a bit slow, abort any uncompleted requests.
|
|
113
|
-
abortRef == null || (_abortRef$current = abortRef.current) == null || _abortRef$current.abort();
|
|
114
|
-
abortRef.current = new AbortController();
|
|
115
|
-
fetchData(view, abortRef.current.signal).then(function (_ref3) {
|
|
116
|
-
var count = _ref3.count,
|
|
117
|
-
results = _ref3.results;
|
|
96
|
+
fetchData().then(function (results) {
|
|
118
97
|
if (results) {
|
|
119
98
|
// The API doesn't provide a non-filtered total, so we rely on the
|
|
120
99
|
// first call having no filtering telling us the total.
|
|
121
100
|
setTotal(function (prevTotal) {
|
|
122
|
-
return Math.max(prevTotal,
|
|
101
|
+
return Math.max(prevTotal, results.length);
|
|
123
102
|
});
|
|
124
103
|
setResult({
|
|
125
|
-
data: results
|
|
126
|
-
filteredTotal: count
|
|
104
|
+
data: results
|
|
127
105
|
});
|
|
128
|
-
abortRef.current = undefined;
|
|
129
106
|
}
|
|
130
107
|
});
|
|
131
|
-
}, [
|
|
108
|
+
}, []);
|
|
132
109
|
var rowDetails = useMemo(function () {
|
|
133
110
|
return {
|
|
134
111
|
render: function render(row) {
|
|
@@ -137,6 +114,9 @@ export var RowDetails = function RowDetails() {
|
|
|
137
114
|
});
|
|
138
115
|
},
|
|
139
116
|
expand: expand,
|
|
117
|
+
expandLabel: function expandLabel(row) {
|
|
118
|
+
return "details for " + row.name;
|
|
119
|
+
},
|
|
140
120
|
onExpand: function onExpand(nextExpand /* , datum */) {
|
|
141
121
|
return setExpand(nextExpand);
|
|
142
122
|
}
|
|
@@ -153,9 +133,6 @@ export var RowDetails = function RowDetails() {
|
|
|
153
133
|
}, /*#__PURE__*/React.createElement(Data, {
|
|
154
134
|
data: result.data,
|
|
155
135
|
total: total,
|
|
156
|
-
filteredTotal: result.filteredTotal,
|
|
157
|
-
view: view,
|
|
158
|
-
onView: setView,
|
|
159
136
|
toolbar: "search"
|
|
160
137
|
}, /*#__PURE__*/React.createElement(DataTable, {
|
|
161
138
|
columns: [{
|
|
@@ -136,6 +136,10 @@ var Content = function Content(_ref) {
|
|
|
136
136
|
title: format({
|
|
137
137
|
id: 'dataTableColumns.select',
|
|
138
138
|
messages: messages == null ? void 0 : messages.dataTableColumns
|
|
139
|
+
}),
|
|
140
|
+
"aria-label": format({
|
|
141
|
+
id: 'dataTableColumns.selectAria',
|
|
142
|
+
messages: messages == null ? void 0 : messages.dataTableColumns
|
|
139
143
|
})
|
|
140
144
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
141
145
|
pad: {
|
|
@@ -164,6 +168,10 @@ var Content = function Content(_ref) {
|
|
|
164
168
|
}
|
|
165
169
|
}))), /*#__PURE__*/React.createElement(Tab, {
|
|
166
170
|
id: dataId + "--order-columns-tab",
|
|
171
|
+
"aria-label": format({
|
|
172
|
+
id: 'dataTableColumns.orderAria',
|
|
173
|
+
messages: messages == null ? void 0 : messages.dataTableColumns
|
|
174
|
+
}),
|
|
167
175
|
title: format({
|
|
168
176
|
id: 'dataTableColumns.order',
|
|
169
177
|
messages: messages == null ? void 0 : messages.dataTableColumns
|
|
@@ -182,6 +190,12 @@ var Content = function Content(_ref) {
|
|
|
182
190
|
return o.property === v;
|
|
183
191
|
}) || v;
|
|
184
192
|
}),
|
|
193
|
+
messages: {
|
|
194
|
+
pinned: format({
|
|
195
|
+
id: 'dataTableColumns.pinned',
|
|
196
|
+
messages: messages == null ? void 0 : messages.dataTableColumns
|
|
197
|
+
})
|
|
198
|
+
},
|
|
185
199
|
onOrder: function onOrder(nextData) {
|
|
186
200
|
return setValue(optionsToValue(nextData));
|
|
187
201
|
},
|
|
@@ -15,7 +15,7 @@ import { DropButton } from '../DropButton';
|
|
|
15
15
|
import { FormContext } from '../Form';
|
|
16
16
|
import { Keyboard } from '../Keyboard';
|
|
17
17
|
import { MaskedInput } from '../MaskedInput';
|
|
18
|
-
import { useForwardedRef, setHoursWithOffset, disabledStyle } from '../../utils';
|
|
18
|
+
import { useForwardedRef, setHoursWithOffset, disabledStyle, useKeyboard } from '../../utils';
|
|
19
19
|
import { readOnlyStyle } from '../../utils/readOnly';
|
|
20
20
|
import { formatToSchema, schemaToMask, valuesAreEqual, valueToText, textToValue, validateBounds } from './utils';
|
|
21
21
|
import { DateInputPropTypes } from './propTypes';
|
|
@@ -91,6 +91,7 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
91
91
|
}),
|
|
92
92
|
value = _useFormInput[0],
|
|
93
93
|
setValue = _useFormInput[1];
|
|
94
|
+
var usingKeyboard = useKeyboard();
|
|
94
95
|
var _useState = useState(getOutputFormat(value)),
|
|
95
96
|
outputFormat = _useState[0],
|
|
96
97
|
setOutputFormat = _useState[1];
|
|
@@ -199,12 +200,18 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
199
200
|
}));
|
|
200
201
|
}, [announce, formatMessage, messages]);
|
|
201
202
|
var closeCalendar = useCallback(function () {
|
|
203
|
+
if (usingKeyboard && !inline && ref != null && ref.current) {
|
|
204
|
+
setTimeout(function () {
|
|
205
|
+
var _ref$current2;
|
|
206
|
+
ref == null || (_ref$current2 = ref.current) == null || _ref$current2.focus();
|
|
207
|
+
}, 0);
|
|
208
|
+
}
|
|
202
209
|
setOpen(false);
|
|
203
210
|
announce(formatMessage({
|
|
204
211
|
id: 'dateInput.exitCalendar',
|
|
205
212
|
messages: messages
|
|
206
213
|
}));
|
|
207
|
-
}, [announce, formatMessage, messages]);
|
|
214
|
+
}, [announce, formatMessage, messages, usingKeyboard, ref, inline]);
|
|
208
215
|
var dates = useMemo(function () {
|
|
209
216
|
return range && value != null && value.length ? [value] : undefined;
|
|
210
217
|
}, [range, value]);
|
|
@@ -234,10 +241,6 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
234
241
|
});
|
|
235
242
|
if (open && !range) {
|
|
236
243
|
closeCalendar();
|
|
237
|
-
setTimeout(function () {
|
|
238
|
-
var _ref$current2;
|
|
239
|
-
return (_ref$current2 = ref.current) == null ? void 0 : _ref$current2.focus();
|
|
240
|
-
}, 1);
|
|
241
244
|
}
|
|
242
245
|
}
|
|
243
246
|
}, calendarProps));
|
|
@@ -273,6 +276,7 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
273
276
|
if (tip === readOnlyCopyValidation) setTip(readOnlyCopyPrompt);
|
|
274
277
|
};
|
|
275
278
|
var DateInputButton = readOnlyCopy ? /*#__PURE__*/React.createElement(CopyButton, {
|
|
279
|
+
disabled: disabled,
|
|
276
280
|
onBlurCopy: onBlurCopy,
|
|
277
281
|
onClickCopy: onClickCopy,
|
|
278
282
|
readOnlyCopyPrompt: readOnlyCopyPrompt,
|
|
@@ -280,6 +284,7 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
280
284
|
value: value
|
|
281
285
|
}) : /*#__PURE__*/React.createElement(Button, {
|
|
282
286
|
onClick: open ? closeCalendar : openCalendar,
|
|
287
|
+
disabled: disabled,
|
|
283
288
|
plain: true,
|
|
284
289
|
icon: icon || MaskedInputIcon || /*#__PURE__*/React.createElement(CalendarIcon, {
|
|
285
290
|
size: iconSize
|
|
@@ -358,12 +363,8 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
358
363
|
return /*#__PURE__*/React.createElement(Box, null, input, calendar);
|
|
359
364
|
}
|
|
360
365
|
if (open && !readOnly) {
|
|
361
|
-
return [input, /*#__PURE__*/React.createElement(
|
|
366
|
+
return [input, /*#__PURE__*/React.createElement(Drop, _extends({
|
|
362
367
|
key: "drop",
|
|
363
|
-
onEsc: function onEsc() {
|
|
364
|
-
return ref.current.focus();
|
|
365
|
-
}
|
|
366
|
-
}, /*#__PURE__*/React.createElement(Drop, _extends({
|
|
367
368
|
overflow: "visible",
|
|
368
369
|
id: id ? id + "__drop" : undefined,
|
|
369
370
|
target: containerRef.current,
|
|
@@ -375,7 +376,7 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
375
376
|
closeCalendar();
|
|
376
377
|
}
|
|
377
378
|
}
|
|
378
|
-
}, dropProps), calendar)
|
|
379
|
+
}, dropProps), calendar)];
|
|
379
380
|
}
|
|
380
381
|
return input;
|
|
381
382
|
});
|