@canonical/react-components 1.3.1 → 1.3.2
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/package.json +7 -10
- package/dist-esm/components/Accordion/Accordion.js +0 -52
- package/dist-esm/components/Accordion/AccordionSection/AccordionSection.js +0 -47
- package/dist-esm/components/Accordion/AccordionSection/index.js +0 -1
- package/dist-esm/components/Accordion/index.js +0 -1
- package/dist-esm/components/ActionButton/ActionButton.js +0 -106
- package/dist-esm/components/ActionButton/index.js +0 -1
- package/dist-esm/components/ApplicationLayout/AppAside/AppAside.js +0 -29
- package/dist-esm/components/ApplicationLayout/AppAside/index.js +0 -1
- package/dist-esm/components/ApplicationLayout/AppMain/AppMain.js +0 -21
- package/dist-esm/components/ApplicationLayout/AppMain/index.js +0 -1
- package/dist-esm/components/ApplicationLayout/AppNavigation/AppNavigation.js +0 -31
- package/dist-esm/components/ApplicationLayout/AppNavigation/index.js +0 -1
- package/dist-esm/components/ApplicationLayout/AppNavigationBar/AppNavigationBar.js +0 -24
- package/dist-esm/components/ApplicationLayout/AppNavigationBar/index.js +0 -1
- package/dist-esm/components/ApplicationLayout/AppStatus/AppStatus.js +0 -21
- package/dist-esm/components/ApplicationLayout/AppStatus/index.js +0 -1
- package/dist-esm/components/ApplicationLayout/Application/Application.js +0 -22
- package/dist-esm/components/ApplicationLayout/Application/index.js +0 -1
- package/dist-esm/components/ApplicationLayout/ApplicationLayout.js +0 -113
- package/dist-esm/components/ApplicationLayout/index.js +0 -7
- package/dist-esm/components/ArticlePagination/ArticlePagination.js +0 -39
- package/dist-esm/components/ArticlePagination/index.js +0 -1
- package/dist-esm/components/Badge/Badge.js +0 -64
- package/dist-esm/components/Badge/index.js +0 -1
- package/dist-esm/components/Button/Button.js +0 -55
- package/dist-esm/components/Button/index.js +0 -1
- package/dist-esm/components/Card/Card.js +0 -45
- package/dist-esm/components/Card/index.js +0 -1
- package/dist-esm/components/CheckboxInput/CheckableInput/CheckableInput.js +0 -35
- package/dist-esm/components/CheckboxInput/CheckableInput/index.js +0 -1
- package/dist-esm/components/CheckboxInput/CheckboxInput.js +0 -24
- package/dist-esm/components/CheckboxInput/index.js +0 -1
- package/dist-esm/components/Chip/Chip.js +0 -81
- package/dist-esm/components/Chip/index.js +0 -1
- package/dist-esm/components/Code/Code.js +0 -49
- package/dist-esm/components/Code/index.js +0 -1
- package/dist-esm/components/CodeSnippet/CodeSnippet.js +0 -28
- package/dist-esm/components/CodeSnippet/CodeSnippetBlock.js +0 -64
- package/dist-esm/components/CodeSnippet/CodeSnippetDropdown.js +0 -27
- package/dist-esm/components/CodeSnippet/index.js +0 -2
- package/dist-esm/components/Col/Col.js +0 -38
- package/dist-esm/components/Col/index.js +0 -1
- package/dist-esm/components/ConfirmationButton/ConfirmationButton.js +0 -63
- package/dist-esm/components/ConfirmationButton/index.js +0 -1
- package/dist-esm/components/ConfirmationModal/ConfirmationModal.js +0 -47
- package/dist-esm/components/ConfirmationModal/index.js +0 -1
- package/dist-esm/components/ContextualMenu/ContextualMenu.js +0 -215
- package/dist-esm/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.js +0 -249
- package/dist-esm/components/ContextualMenu/ContextualMenuDropdown/index.js +0 -1
- package/dist-esm/components/ContextualMenu/index.js +0 -1
- package/dist-esm/components/EmptyState/EmptyState.js +0 -28
- package/dist-esm/components/EmptyState/index.js +0 -1
- package/dist-esm/components/Field/Field.js +0 -126
- package/dist-esm/components/Field/index.js +0 -1
- package/dist-esm/components/Form/Form.js +0 -28
- package/dist-esm/components/Form/index.js +0 -1
- package/dist-esm/components/FormikField/FormikField.js +0 -33
- package/dist-esm/components/FormikField/index.js +0 -1
- package/dist-esm/components/Icon/Icon.js +0 -61
- package/dist-esm/components/Icon/index.js +0 -1
- package/dist-esm/components/Input/Input.js +0 -103
- package/dist-esm/components/Input/index.js +0 -1
- package/dist-esm/components/Label/Label.js +0 -27
- package/dist-esm/components/Label/index.js +0 -1
- package/dist-esm/components/Link/Link.js +0 -37
- package/dist-esm/components/Link/index.js +0 -1
- package/dist-esm/components/List/List.js +0 -110
- package/dist-esm/components/List/index.js +0 -1
- package/dist-esm/components/Loader/Loader.js +0 -14
- package/dist-esm/components/Loader/index.js +0 -1
- package/dist-esm/components/LoginPageLayout/LoginPageLayout.js +0 -63
- package/dist-esm/components/LoginPageLayout/index.js +0 -1
- package/dist-esm/components/MainTable/MainTable.js +0 -211
- package/dist-esm/components/MainTable/index.js +0 -1
- package/dist-esm/components/Modal/Modal.js +0 -135
- package/dist-esm/components/Modal/index.js +0 -1
- package/dist-esm/components/ModularTable/ModularTable.js +0 -166
- package/dist-esm/components/ModularTable/index.js +0 -1
- package/dist-esm/components/MultiSelect/FadeInDown/FadeInDown.js +0 -25
- package/dist-esm/components/MultiSelect/FadeInDown/index.js +0 -1
- package/dist-esm/components/MultiSelect/MultiSelect.js +0 -308
- package/dist-esm/components/MultiSelect/index.js +0 -1
- package/dist-esm/components/Navigation/Navigation.js +0 -215
- package/dist-esm/components/Navigation/NavigationLink/NavigationLink.js +0 -58
- package/dist-esm/components/Navigation/NavigationLink/index.js +0 -1
- package/dist-esm/components/Navigation/NavigationMenu/NavigationMenu.js +0 -57
- package/dist-esm/components/Navigation/NavigationMenu/index.js +0 -1
- package/dist-esm/components/Navigation/index.js +0 -1
- package/dist-esm/components/Navigation/types.js +0 -1
- package/dist-esm/components/Notification/Notification.js +0 -119
- package/dist-esm/components/Notification/index.js +0 -1
- package/dist-esm/components/NotificationProvider/NotificationProvider.js +0 -83
- package/dist-esm/components/NotificationProvider/index.js +0 -2
- package/dist-esm/components/NotificationProvider/messageBuilder.js +0 -31
- package/dist-esm/components/NotificationProvider/types.js +0 -1
- package/dist-esm/components/Pagination/Pagination.js +0 -173
- package/dist-esm/components/Pagination/PaginationButton/PaginationButton.js +0 -31
- package/dist-esm/components/Pagination/PaginationButton/index.js +0 -1
- package/dist-esm/components/Pagination/PaginationItem/PaginationItem.js +0 -20
- package/dist-esm/components/Pagination/PaginationItem/index.js +0 -1
- package/dist-esm/components/Pagination/index.js +0 -1
- package/dist-esm/components/Panel/Panel.js +0 -89
- package/dist-esm/components/Panel/index.js +0 -1
- package/dist-esm/components/PasswordToggle/PasswordToggle.js +0 -90
- package/dist-esm/components/PasswordToggle/index.js +0 -1
- package/dist-esm/components/RadioInput/RadioInput.js +0 -22
- package/dist-esm/components/RadioInput/index.js +0 -1
- package/dist-esm/components/Row/Row.js +0 -22
- package/dist-esm/components/Row/index.js +0 -1
- package/dist-esm/components/SearchAndFilter/FilterPanelSection/FilterPanelSection.js +0 -107
- package/dist-esm/components/SearchAndFilter/FilterPanelSection/index.js +0 -1
- package/dist-esm/components/SearchAndFilter/SearchAndFilter.js +0 -286
- package/dist-esm/components/SearchAndFilter/index.js +0 -1
- package/dist-esm/components/SearchAndFilter/types.js +0 -1
- package/dist-esm/components/SearchAndFilter/utils.js +0 -22
- package/dist-esm/components/SearchBox/SearchBox.js +0 -95
- package/dist-esm/components/SearchBox/index.js +0 -1
- package/dist-esm/components/Select/Select.js +0 -84
- package/dist-esm/components/Select/index.js +0 -1
- package/dist-esm/components/SideNavigation/SideNavigation.js +0 -89
- package/dist-esm/components/SideNavigation/SideNavigationBase/SideNavigationBase.js +0 -31
- package/dist-esm/components/SideNavigation/SideNavigationBase/index.js +0 -1
- package/dist-esm/components/SideNavigation/SideNavigationItem/SideNavigationItem.js +0 -32
- package/dist-esm/components/SideNavigation/SideNavigationItem/index.js +0 -1
- package/dist-esm/components/SideNavigation/SideNavigationLink/SideNavigationLink.js +0 -25
- package/dist-esm/components/SideNavigation/SideNavigationLink/index.js +0 -1
- package/dist-esm/components/SideNavigation/SideNavigationText/SideNavigationText.js +0 -20
- package/dist-esm/components/SideNavigation/SideNavigationText/index.js +0 -1
- package/dist-esm/components/SideNavigation/index.js +0 -4
- package/dist-esm/components/Slider/Slider.js +0 -83
- package/dist-esm/components/Slider/index.js +0 -1
- package/dist-esm/components/Spinner/Spinner.js +0 -36
- package/dist-esm/components/Spinner/index.js +0 -1
- package/dist-esm/components/StatusLabel/StatusLabel.js +0 -36
- package/dist-esm/components/StatusLabel/index.js +0 -1
- package/dist-esm/components/Strip/Strip.js +0 -50
- package/dist-esm/components/Strip/index.js +0 -1
- package/dist-esm/components/SummaryButton/SummaryButton.js +0 -28
- package/dist-esm/components/SummaryButton/index.js +0 -1
- package/dist-esm/components/Switch/Switch.js +0 -28
- package/dist-esm/components/Switch/index.js +0 -1
- package/dist-esm/components/Table/Table.js +0 -23
- package/dist-esm/components/Table/index.js +0 -1
- package/dist-esm/components/TableCell/TableCell.js +0 -26
- package/dist-esm/components/TableCell/index.js +0 -1
- package/dist-esm/components/TableHeader/TableHeader.js +0 -17
- package/dist-esm/components/TableHeader/index.js +0 -1
- package/dist-esm/components/TablePagination/TablePagination.js +0 -104
- package/dist-esm/components/TablePagination/TablePaginationControls/TablePaginationControls.js +0 -120
- package/dist-esm/components/TablePagination/TablePaginationControls/index.js +0 -1
- package/dist-esm/components/TablePagination/index.js +0 -1
- package/dist-esm/components/TablePagination/utils.js +0 -67
- package/dist-esm/components/TableRow/TableRow.js +0 -15
- package/dist-esm/components/TableRow/index.js +0 -1
- package/dist-esm/components/Tabs/Tabs.js +0 -42
- package/dist-esm/components/Tabs/index.js +0 -1
- package/dist-esm/components/Textarea/Textarea.js +0 -115
- package/dist-esm/components/Textarea/index.js +0 -1
- package/dist-esm/components/Tooltip/Tooltip.js +0 -245
- package/dist-esm/components/Tooltip/index.js +0 -1
- package/dist-esm/enums.js +0 -8
- package/dist-esm/hooks/index.js +0 -8
- package/dist-esm/hooks/useId.js +0 -13
- package/dist-esm/hooks/useListener.js +0 -51
- package/dist-esm/hooks/useOnClickOutside.js +0 -38
- package/dist-esm/hooks/useOnEscapePressed.js +0 -25
- package/dist-esm/hooks/usePagination.js +0 -45
- package/dist-esm/hooks/usePrevious.js +0 -16
- package/dist-esm/hooks/useThrottle.js +0 -49
- package/dist-esm/hooks/useWindowFitment.js +0 -109
- package/dist-esm/index.js +0 -69
- package/dist-esm/types/index.js +0 -1
- package/dist-esm/types/react-table-config.d.js +0 -1
- package/dist-esm/utils.js +0 -41
- /package/{dist-types → dist}/components/Accordion/Accordion.d.ts +0 -0
- /package/{dist-types → dist}/components/Accordion/AccordionSection/AccordionSection.d.ts +0 -0
- /package/{dist-types → dist}/components/Accordion/AccordionSection/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Accordion/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ActionButton/ActionButton.d.ts +0 -0
- /package/{dist-types → dist}/components/ActionButton/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/AppAside/AppAside.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/AppAside/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/AppMain/AppMain.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/AppMain/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/AppNavigation/AppNavigation.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/AppNavigation/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/AppNavigationBar/AppNavigationBar.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/AppNavigationBar/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/AppStatus/AppStatus.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/AppStatus/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/Application/Application.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/Application/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/ApplicationLayout.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ArticlePagination/ArticlePagination.d.ts +0 -0
- /package/{dist-types → dist}/components/ArticlePagination/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Badge/Badge.d.ts +0 -0
- /package/{dist-types → dist}/components/Badge/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Button/Button.d.ts +0 -0
- /package/{dist-types → dist}/components/Button/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Card/Card.d.ts +0 -0
- /package/{dist-types → dist}/components/Card/index.d.ts +0 -0
- /package/{dist-types → dist}/components/CheckboxInput/CheckableInput/CheckableInput.d.ts +0 -0
- /package/{dist-types → dist}/components/CheckboxInput/CheckableInput/index.d.ts +0 -0
- /package/{dist-types → dist}/components/CheckboxInput/CheckboxInput.d.ts +0 -0
- /package/{dist-types → dist}/components/CheckboxInput/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Chip/Chip.d.ts +0 -0
- /package/{dist-types → dist}/components/Chip/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Code/Code.d.ts +0 -0
- /package/{dist-types → dist}/components/Code/index.d.ts +0 -0
- /package/{dist-types → dist}/components/CodeSnippet/CodeSnippet.d.ts +0 -0
- /package/{dist-types → dist}/components/CodeSnippet/CodeSnippetBlock.d.ts +0 -0
- /package/{dist-types → dist}/components/CodeSnippet/CodeSnippetDropdown.d.ts +0 -0
- /package/{dist-types → dist}/components/CodeSnippet/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Col/Col.d.ts +0 -0
- /package/{dist-types → dist}/components/Col/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ConfirmationButton/ConfirmationButton.d.ts +0 -0
- /package/{dist-types → dist}/components/ConfirmationButton/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ConfirmationModal/ConfirmationModal.d.ts +0 -0
- /package/{dist-types → dist}/components/ConfirmationModal/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ContextualMenu/ContextualMenu.d.ts +0 -0
- /package/{dist-types → dist}/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.d.ts +0 -0
- /package/{dist-types → dist}/components/ContextualMenu/ContextualMenuDropdown/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ContextualMenu/index.d.ts +0 -0
- /package/{dist-types → dist}/components/EmptyState/EmptyState.d.ts +0 -0
- /package/{dist-types → dist}/components/EmptyState/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Field/Field.d.ts +0 -0
- /package/{dist-types → dist}/components/Field/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Form/Form.d.ts +0 -0
- /package/{dist-types → dist}/components/Form/index.d.ts +0 -0
- /package/{dist-types → dist}/components/FormikField/FormikField.d.ts +0 -0
- /package/{dist-types → dist}/components/FormikField/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Icon/Icon.d.ts +0 -0
- /package/{dist-types → dist}/components/Icon/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Input/Input.d.ts +0 -0
- /package/{dist-types → dist}/components/Input/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Label/Label.d.ts +0 -0
- /package/{dist-types → dist}/components/Label/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Link/Link.d.ts +0 -0
- /package/{dist-types → dist}/components/Link/index.d.ts +0 -0
- /package/{dist-types → dist}/components/List/List.d.ts +0 -0
- /package/{dist-types → dist}/components/List/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Loader/Loader.d.ts +0 -0
- /package/{dist-types → dist}/components/Loader/index.d.ts +0 -0
- /package/{dist-types → dist}/components/LoginPageLayout/LoginPageLayout.d.ts +0 -0
- /package/{dist-types → dist}/components/LoginPageLayout/index.d.ts +0 -0
- /package/{dist-types → dist}/components/MainTable/MainTable.d.ts +0 -0
- /package/{dist-types → dist}/components/MainTable/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Modal/Modal.d.ts +0 -0
- /package/{dist-types → dist}/components/Modal/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ModularTable/ModularTable.d.ts +0 -0
- /package/{dist-types → dist}/components/ModularTable/index.d.ts +0 -0
- /package/{dist-types → dist}/components/MultiSelect/FadeInDown/FadeInDown.d.ts +0 -0
- /package/{dist-types → dist}/components/MultiSelect/FadeInDown/index.d.ts +0 -0
- /package/{dist-types → dist}/components/MultiSelect/MultiSelect.d.ts +0 -0
- /package/{dist-types → dist}/components/MultiSelect/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Navigation/Navigation.d.ts +0 -0
- /package/{dist-types → dist}/components/Navigation/NavigationLink/NavigationLink.d.ts +0 -0
- /package/{dist-types → dist}/components/Navigation/NavigationLink/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Navigation/NavigationMenu/NavigationMenu.d.ts +0 -0
- /package/{dist-types → dist}/components/Navigation/NavigationMenu/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Navigation/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Navigation/types.d.ts +0 -0
- /package/{dist-types → dist}/components/Notification/Notification.d.ts +0 -0
- /package/{dist-types → dist}/components/Notification/index.d.ts +0 -0
- /package/{dist-types → dist}/components/NotificationProvider/NotificationProvider.d.ts +0 -0
- /package/{dist-types → dist}/components/NotificationProvider/index.d.ts +0 -0
- /package/{dist-types → dist}/components/NotificationProvider/messageBuilder.d.ts +0 -0
- /package/{dist-types → dist}/components/NotificationProvider/types.d.ts +0 -0
- /package/{dist-types → dist}/components/Pagination/Pagination.d.ts +0 -0
- /package/{dist-types → dist}/components/Pagination/PaginationButton/PaginationButton.d.ts +0 -0
- /package/{dist-types → dist}/components/Pagination/PaginationButton/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Pagination/PaginationItem/PaginationItem.d.ts +0 -0
- /package/{dist-types → dist}/components/Pagination/PaginationItem/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Pagination/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Panel/Panel.d.ts +0 -0
- /package/{dist-types → dist}/components/Panel/index.d.ts +0 -0
- /package/{dist-types → dist}/components/PasswordToggle/PasswordToggle.d.ts +0 -0
- /package/{dist-types → dist}/components/PasswordToggle/index.d.ts +0 -0
- /package/{dist-types → dist}/components/RadioInput/RadioInput.d.ts +0 -0
- /package/{dist-types → dist}/components/RadioInput/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Row/Row.d.ts +0 -0
- /package/{dist-types → dist}/components/Row/index.d.ts +0 -0
- /package/{dist-types → dist}/components/SearchAndFilter/FilterPanelSection/FilterPanelSection.d.ts +0 -0
- /package/{dist-types → dist}/components/SearchAndFilter/FilterPanelSection/index.d.ts +0 -0
- /package/{dist-types → dist}/components/SearchAndFilter/SearchAndFilter.d.ts +0 -0
- /package/{dist-types → dist}/components/SearchAndFilter/index.d.ts +0 -0
- /package/{dist-types → dist}/components/SearchAndFilter/types.d.ts +0 -0
- /package/{dist-types → dist}/components/SearchAndFilter/utils.d.ts +0 -0
- /package/{dist-types → dist}/components/SearchBox/SearchBox.d.ts +0 -0
- /package/{dist-types → dist}/components/SearchBox/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Select/Select.d.ts +0 -0
- /package/{dist-types → dist}/components/Select/index.d.ts +0 -0
- /package/{dist-types → dist}/components/SideNavigation/SideNavigation.d.ts +0 -0
- /package/{dist-types → dist}/components/SideNavigation/SideNavigationBase/SideNavigationBase.d.ts +0 -0
- /package/{dist-types → dist}/components/SideNavigation/SideNavigationBase/index.d.ts +0 -0
- /package/{dist-types → dist}/components/SideNavigation/SideNavigationItem/SideNavigationItem.d.ts +0 -0
- /package/{dist-types → dist}/components/SideNavigation/SideNavigationItem/index.d.ts +0 -0
- /package/{dist-types → dist}/components/SideNavigation/SideNavigationLink/SideNavigationLink.d.ts +0 -0
- /package/{dist-types → dist}/components/SideNavigation/SideNavigationLink/index.d.ts +0 -0
- /package/{dist-types → dist}/components/SideNavigation/SideNavigationText/SideNavigationText.d.ts +0 -0
- /package/{dist-types → dist}/components/SideNavigation/SideNavigationText/index.d.ts +0 -0
- /package/{dist-types → dist}/components/SideNavigation/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Slider/Slider.d.ts +0 -0
- /package/{dist-types → dist}/components/Slider/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Spinner/Spinner.d.ts +0 -0
- /package/{dist-types → dist}/components/Spinner/index.d.ts +0 -0
- /package/{dist-types → dist}/components/StatusLabel/StatusLabel.d.ts +0 -0
- /package/{dist-types → dist}/components/StatusLabel/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Strip/Strip.d.ts +0 -0
- /package/{dist-types → dist}/components/Strip/index.d.ts +0 -0
- /package/{dist-types → dist}/components/SummaryButton/SummaryButton.d.ts +0 -0
- /package/{dist-types → dist}/components/SummaryButton/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Switch/Switch.d.ts +0 -0
- /package/{dist-types → dist}/components/Switch/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Table/Table.d.ts +0 -0
- /package/{dist-types → dist}/components/Table/index.d.ts +0 -0
- /package/{dist-types → dist}/components/TableCell/TableCell.d.ts +0 -0
- /package/{dist-types → dist}/components/TableCell/index.d.ts +0 -0
- /package/{dist-types → dist}/components/TableHeader/TableHeader.d.ts +0 -0
- /package/{dist-types → dist}/components/TableHeader/index.d.ts +0 -0
- /package/{dist-types → dist}/components/TablePagination/TablePagination.d.ts +0 -0
- /package/{dist-types → dist}/components/TablePagination/TablePaginationControls/TablePaginationControls.d.ts +0 -0
- /package/{dist-types → dist}/components/TablePagination/TablePaginationControls/index.d.ts +0 -0
- /package/{dist-types → dist}/components/TablePagination/index.d.ts +0 -0
- /package/{dist-types → dist}/components/TablePagination/utils.d.ts +0 -0
- /package/{dist-types → dist}/components/TableRow/TableRow.d.ts +0 -0
- /package/{dist-types → dist}/components/TableRow/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Tabs/Tabs.d.ts +0 -0
- /package/{dist-types → dist}/components/Tabs/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Textarea/Textarea.d.ts +0 -0
- /package/{dist-types → dist}/components/Textarea/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Tooltip/Tooltip.d.ts +0 -0
- /package/{dist-types → dist}/components/Tooltip/index.d.ts +0 -0
- /package/{dist-types → dist}/enums.d.ts +0 -0
- /package/{dist-types → dist}/hooks/index.d.ts +0 -0
- /package/{dist-types → dist}/hooks/useId.d.ts +0 -0
- /package/{dist-types → dist}/hooks/useListener.d.ts +0 -0
- /package/{dist-types → dist}/hooks/useOnClickOutside.d.ts +0 -0
- /package/{dist-types → dist}/hooks/useOnEscapePressed.d.ts +0 -0
- /package/{dist-types → dist}/hooks/usePagination.d.ts +0 -0
- /package/{dist-types → dist}/hooks/usePrevious.d.ts +0 -0
- /package/{dist-types → dist}/hooks/useThrottle.d.ts +0 -0
- /package/{dist-types → dist}/hooks/useWindowFitment.d.ts +0 -0
- /package/{dist-types → dist}/index.d.ts +0 -0
- /package/{dist-types → dist}/types/index.d.ts +0 -0
- /package/{dist-types → dist}/utils.d.ts +0 -0
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
var _excluded = ["data", "dataForwardProp", "itemName", "className", "description", "pageLimits", "position", "externallyControlled", "children"];
|
|
2
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
5
|
-
import React, { useState } from "react";
|
|
6
|
-
import "./TablePagination.scss";
|
|
7
|
-
import TablePaginationControls from "./TablePaginationControls";
|
|
8
|
-
import { DEFAULT_PAGE_LIMITS, generatePagingOptions, renderChildren } from "./utils";
|
|
9
|
-
import { usePagination } from "../../hooks";
|
|
10
|
-
/**
|
|
11
|
-
This is an HOC [React](https://reactjs.org/) component for applying pagination to direct children components. This component is un-opinionated about
|
|
12
|
-
the structure of the input data and can be used with any child component that displays a list of data. However, the styling and behaviour of this component were designed
|
|
13
|
-
to work nicely with the `MainTable` component. To use this component, simply wrap a child component with it and provide the data that you want
|
|
14
|
-
to paginate to the `data` prop. This component will then pass the paged data to all <b>direct</b> child components via a child prop specified by `dataForwardProp`.
|
|
15
|
-
The component may be externally controlled, see following sections for detailed explanation.
|
|
16
|
-
|
|
17
|
-
#### Externally controlled pagination
|
|
18
|
-
|
|
19
|
-
For externally controlled mode, you will be responsible for the pagination logic and therefore the component will be purely presentational.
|
|
20
|
-
The pagination behaviour is controlled outside of this component. Note the data injection to child components is essentially a passthrough in this case.
|
|
21
|
-
To enable externally controlled mode for this component, set the `externallyControlled` prop to `true`. From there, it is your responsibility
|
|
22
|
-
to ensure that the following props `totalItems`, `currentPage`, `pageSize`, `onPageChange` and `onPageSizeChange` are set properly.
|
|
23
|
-
You can refer to the props table below on how to set these props.
|
|
24
|
-
|
|
25
|
-
#### Un-controlled pagination
|
|
26
|
-
|
|
27
|
-
In this mode, the component assumes that the input data is not paginated. The component will implement the pagination logic and apply it to the input data
|
|
28
|
-
then inject the paged data into direct child components. This is the default mode of operations for the component where `externallyControlled` prop is set
|
|
29
|
-
to `false`.
|
|
30
|
-
*/
|
|
31
|
-
var TablePagination = props => {
|
|
32
|
-
var {
|
|
33
|
-
data,
|
|
34
|
-
dataForwardProp = "rows",
|
|
35
|
-
itemName = "item",
|
|
36
|
-
className,
|
|
37
|
-
description,
|
|
38
|
-
pageLimits = DEFAULT_PAGE_LIMITS,
|
|
39
|
-
position = "above",
|
|
40
|
-
externallyControlled,
|
|
41
|
-
children
|
|
42
|
-
} = props,
|
|
43
|
-
divProps = _objectWithoutProperties(props, _excluded);
|
|
44
|
-
|
|
45
|
-
// Safety check to ensure pageSize is a valid option in
|
|
46
|
-
// pageLimits if the component is externally controlled
|
|
47
|
-
if (externallyControlled) {
|
|
48
|
-
var pageSizeFound = false;
|
|
49
|
-
for (var limit of pageLimits) {
|
|
50
|
-
if (limit === Number(props.pageSize)) {
|
|
51
|
-
pageSizeFound = true;
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (!pageSizeFound) {
|
|
56
|
-
throw new Error("pageSize must be a valid option in pageLimits, pageLimits is set to [".concat(pageLimits, "]"));
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
var [internalPageSize, setInternalPageSize] = useState(() => {
|
|
60
|
-
return generatePagingOptions(pageLimits)[0].value;
|
|
61
|
-
});
|
|
62
|
-
var {
|
|
63
|
-
paginate,
|
|
64
|
-
currentPage: internalCurrentPage,
|
|
65
|
-
pageData: internalData
|
|
66
|
-
} = usePagination(externallyControlled ? [] : data, {
|
|
67
|
-
itemsPerPage: internalPageSize,
|
|
68
|
-
autoResetPage: true
|
|
69
|
-
});
|
|
70
|
-
var controlData = externallyControlled ? data : internalData;
|
|
71
|
-
var controlPageSize = externallyControlled ? props.pageSize : internalPageSize;
|
|
72
|
-
var controlTotalItems = externallyControlled ? props.totalItems : data.length;
|
|
73
|
-
var controlCurrentPage = externallyControlled ? props.currentPage : internalCurrentPage;
|
|
74
|
-
var handlePageChange = page => {
|
|
75
|
-
if (externallyControlled) {
|
|
76
|
-
props.onPageChange(page);
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
paginate(page);
|
|
80
|
-
};
|
|
81
|
-
var handlePageSizeChange = pageSize => {
|
|
82
|
-
if (externallyControlled) {
|
|
83
|
-
props.onPageSizeChange(pageSize);
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
paginate(1);
|
|
87
|
-
setInternalPageSize(pageSize);
|
|
88
|
-
};
|
|
89
|
-
var clonedChildren = renderChildren(children, dataForwardProp, controlData);
|
|
90
|
-
var controls = /*#__PURE__*/React.createElement(TablePaginationControls, _extends({}, divProps, {
|
|
91
|
-
visibleCount: controlData.length,
|
|
92
|
-
className: className,
|
|
93
|
-
itemName: itemName,
|
|
94
|
-
description: description,
|
|
95
|
-
pageLimits: pageLimits,
|
|
96
|
-
totalItems: controlTotalItems,
|
|
97
|
-
currentPage: controlCurrentPage,
|
|
98
|
-
pageSize: controlPageSize,
|
|
99
|
-
onPageChange: handlePageChange,
|
|
100
|
-
onPageSizeChange: handlePageSizeChange
|
|
101
|
-
}));
|
|
102
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, position === "above" && controls, clonedChildren, position === "below" && controls);
|
|
103
|
-
};
|
|
104
|
-
export default TablePagination;
|
package/dist-esm/components/TablePagination/TablePaginationControls/TablePaginationControls.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import _pt from "prop-types";
|
|
2
|
-
var _excluded = ["className", "currentPage", "description", "displayDescription", "onInputPageChange", "itemName", "nextButtonProps", "onNextPage", "onPageChange", "onPageSizeChange", "onPreviousPage", "pageLimits", "pageSize", "previousButtonProps", "showPageInput", "totalItems", "visibleCount"];
|
|
3
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
5
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
6
|
-
import Button from "../../Button";
|
|
7
|
-
import Icon from "../../Icon";
|
|
8
|
-
import Input from "../../Input";
|
|
9
|
-
import Select from "../../Select";
|
|
10
|
-
import React from "react";
|
|
11
|
-
import classnames from "classnames";
|
|
12
|
-
import { generatePagingOptions, getDescription, useFigureSmallScreen } from "../utils";
|
|
13
|
-
export var Label = /*#__PURE__*/function (Label) {
|
|
14
|
-
Label["NEXT_PAGE"] = "Next page";
|
|
15
|
-
Label["PREVIOUS_PAGE"] = "Previous page";
|
|
16
|
-
Label["PAGE_NUMBER"] = "Page number";
|
|
17
|
-
return Label;
|
|
18
|
-
}({});
|
|
19
|
-
var TablePaginationControls = _ref => {
|
|
20
|
-
var {
|
|
21
|
-
className,
|
|
22
|
-
currentPage,
|
|
23
|
-
description,
|
|
24
|
-
displayDescription = true,
|
|
25
|
-
onInputPageChange,
|
|
26
|
-
itemName,
|
|
27
|
-
nextButtonProps,
|
|
28
|
-
onNextPage,
|
|
29
|
-
onPageChange,
|
|
30
|
-
onPageSizeChange,
|
|
31
|
-
onPreviousPage,
|
|
32
|
-
pageLimits,
|
|
33
|
-
pageSize,
|
|
34
|
-
previousButtonProps,
|
|
35
|
-
showPageInput = true,
|
|
36
|
-
totalItems,
|
|
37
|
-
visibleCount
|
|
38
|
-
} = _ref,
|
|
39
|
-
divProps = _objectWithoutProperties(_ref, _excluded);
|
|
40
|
-
var isSmallScreen = useFigureSmallScreen();
|
|
41
|
-
var totalPages = totalItems ? Math.ceil(totalItems / pageSize) : null;
|
|
42
|
-
var descriptionDisplay = getDescription({
|
|
43
|
-
description,
|
|
44
|
-
visibleCount,
|
|
45
|
-
isSmallScreen,
|
|
46
|
-
totalItems,
|
|
47
|
-
itemName
|
|
48
|
-
});
|
|
49
|
-
var handleDecrementPage = currentPage => {
|
|
50
|
-
if (currentPage > 1) {
|
|
51
|
-
onPageChange === null || onPageChange === void 0 || onPageChange(currentPage - 1);
|
|
52
|
-
}
|
|
53
|
-
onPreviousPage === null || onPreviousPage === void 0 || onPreviousPage(typeof currentPage === "number" ? currentPage - 1 : null);
|
|
54
|
-
};
|
|
55
|
-
var handleIncrementPage = (currentPage, totalPages) => {
|
|
56
|
-
if (currentPage < totalPages) {
|
|
57
|
-
onPageChange === null || onPageChange === void 0 || onPageChange(currentPage + 1);
|
|
58
|
-
}
|
|
59
|
-
onNextPage === null || onNextPage === void 0 || onNextPage(typeof currentPage === "number" ? currentPage + 1 : null);
|
|
60
|
-
};
|
|
61
|
-
var handleInputPageChange = e => {
|
|
62
|
-
var newPage = Math.min(totalPages, Math.max(1, parseInt(e.target.value)));
|
|
63
|
-
onPageChange === null || onPageChange === void 0 || onPageChange(newPage);
|
|
64
|
-
onInputPageChange === null || onInputPageChange === void 0 || onInputPageChange(Number(e.target.value));
|
|
65
|
-
};
|
|
66
|
-
var handlePageSizeChange = e => {
|
|
67
|
-
onPageSizeChange(parseInt(e.target.value));
|
|
68
|
-
};
|
|
69
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
70
|
-
className: classnames("pagination", className)
|
|
71
|
-
}, divProps, {
|
|
72
|
-
role: "navigation"
|
|
73
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
74
|
-
className: "description",
|
|
75
|
-
id: "pagination-description"
|
|
76
|
-
}, displayDescription ? descriptionDisplay : null), /*#__PURE__*/React.createElement(Button, _extends({
|
|
77
|
-
"aria-label": Label.PREVIOUS_PAGE,
|
|
78
|
-
className: "back",
|
|
79
|
-
appearance: "base",
|
|
80
|
-
hasIcon: true,
|
|
81
|
-
disabled: currentPage === 1,
|
|
82
|
-
onClick: () => handleDecrementPage(currentPage)
|
|
83
|
-
}, previousButtonProps), previousButtonProps !== null && previousButtonProps !== void 0 && previousButtonProps.children ? previousButtonProps.children : /*#__PURE__*/React.createElement(Icon, {
|
|
84
|
-
name: "chevron-down"
|
|
85
|
-
})), showPageInput ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Input, {
|
|
86
|
-
id: "paginationPageInput",
|
|
87
|
-
label: Label.PAGE_NUMBER,
|
|
88
|
-
labelClassName: "u-off-screen",
|
|
89
|
-
className: "u-no-margin--bottom pagination-input",
|
|
90
|
-
onChange: handleInputPageChange,
|
|
91
|
-
value: currentPage,
|
|
92
|
-
type: "number"
|
|
93
|
-
}), " ") : null, typeof totalPages === "number" ? "of ".concat(totalPages) : null, /*#__PURE__*/React.createElement(Button, _extends({
|
|
94
|
-
"aria-label": Label.NEXT_PAGE,
|
|
95
|
-
className: "next",
|
|
96
|
-
appearance: "base",
|
|
97
|
-
hasIcon: true,
|
|
98
|
-
disabled: currentPage === totalPages,
|
|
99
|
-
onClick: () => handleIncrementPage(currentPage, totalPages)
|
|
100
|
-
}, nextButtonProps), /*#__PURE__*/React.createElement(Icon, {
|
|
101
|
-
name: "chevron-down"
|
|
102
|
-
})), /*#__PURE__*/React.createElement(Select, {
|
|
103
|
-
className: "u-no-margin--bottom",
|
|
104
|
-
label: "Items per page",
|
|
105
|
-
labelClassName: "u-off-screen",
|
|
106
|
-
id: "itemsPerPage",
|
|
107
|
-
options: generatePagingOptions(pageLimits),
|
|
108
|
-
onChange: handlePageSizeChange,
|
|
109
|
-
value: pageSize
|
|
110
|
-
}));
|
|
111
|
-
};
|
|
112
|
-
TablePaginationControls.propTypes = {
|
|
113
|
-
displayDescription: _pt.bool,
|
|
114
|
-
onInputPageChange: _pt.func,
|
|
115
|
-
onNextPage: _pt.func,
|
|
116
|
-
onPreviousPage: _pt.func,
|
|
117
|
-
visibleCount: _pt.number,
|
|
118
|
-
showPageInput: _pt.bool
|
|
119
|
-
};
|
|
120
|
-
export default TablePaginationControls;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./TablePaginationControls";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./TablePagination";
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { Children, cloneElement, useEffect, useState } from "react";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Determine if we are working with a small screen.
|
|
5
|
-
* 'small screen' in this case is relative to the width of the description div
|
|
6
|
-
*/
|
|
7
|
-
export var figureSmallScreen = () => {
|
|
8
|
-
var descriptionElement = document.getElementById("pagination-description");
|
|
9
|
-
if (!descriptionElement) {
|
|
10
|
-
return true;
|
|
11
|
-
}
|
|
12
|
-
return descriptionElement.getBoundingClientRect().width < 230;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Iterate direct react child components and override the value of the prop specified by @param dataForwardProp
|
|
17
|
-
* for those child components.
|
|
18
|
-
* @param children - react node children to iterate
|
|
19
|
-
* @param dataForwardProp - the name of the prop from the children components to override
|
|
20
|
-
* @param data - actual data to be passed to the prop specified by @param dataForwardProp
|
|
21
|
-
*/
|
|
22
|
-
export var renderChildren = (children, dataForwardProp, data) => {
|
|
23
|
-
return Children.map(children, child => {
|
|
24
|
-
return /*#__PURE__*/cloneElement(child, {
|
|
25
|
-
[dataForwardProp]: data
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
export var DEFAULT_PAGE_LIMITS = [50, 100, 200];
|
|
30
|
-
export var generatePagingOptions = pageLimits => {
|
|
31
|
-
return pageLimits.map(limit => ({
|
|
32
|
-
value: limit,
|
|
33
|
-
label: "".concat(limit, "/page")
|
|
34
|
-
}));
|
|
35
|
-
};
|
|
36
|
-
export var getDescription = _ref => {
|
|
37
|
-
var {
|
|
38
|
-
description,
|
|
39
|
-
isSmallScreen,
|
|
40
|
-
totalItems,
|
|
41
|
-
itemName,
|
|
42
|
-
visibleCount
|
|
43
|
-
} = _ref;
|
|
44
|
-
if (description) {
|
|
45
|
-
return description;
|
|
46
|
-
}
|
|
47
|
-
if (isSmallScreen) {
|
|
48
|
-
return "".concat(visibleCount, " out of ").concat(totalItems);
|
|
49
|
-
}
|
|
50
|
-
if (visibleCount === totalItems && visibleCount > 1) {
|
|
51
|
-
return "Showing all ".concat(totalItems, " ").concat(itemName, "s");
|
|
52
|
-
}
|
|
53
|
-
return "Showing ".concat(visibleCount, " out of ").concat(totalItems, " ").concat(itemName).concat(totalItems !== 1 ? "s" : "");
|
|
54
|
-
};
|
|
55
|
-
export var useFigureSmallScreen = () => {
|
|
56
|
-
var [isSmallScreen, setSmallScreen] = useState(false);
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
var handleResize = () => {
|
|
59
|
-
setSmallScreen(figureSmallScreen());
|
|
60
|
-
};
|
|
61
|
-
window.addEventListener("resize", handleResize);
|
|
62
|
-
return () => {
|
|
63
|
-
window.removeEventListener("resize", handleResize);
|
|
64
|
-
};
|
|
65
|
-
}, []);
|
|
66
|
-
return isSmallScreen;
|
|
67
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var _excluded = ["children"];
|
|
2
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
5
|
-
import React from "react";
|
|
6
|
-
var TableRow = _ref => {
|
|
7
|
-
var {
|
|
8
|
-
children
|
|
9
|
-
} = _ref,
|
|
10
|
-
trProps = _objectWithoutProperties(_ref, _excluded);
|
|
11
|
-
return /*#__PURE__*/React.createElement("tr", _extends({
|
|
12
|
-
role: "row"
|
|
13
|
-
}, trProps), children);
|
|
14
|
-
};
|
|
15
|
-
export default TableRow;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./TableRow";
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
var _excluded = ["active", "className", "component", "label", "listItemClassName"];
|
|
2
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
5
|
-
import classNames from "classnames";
|
|
6
|
-
import React from "react";
|
|
7
|
-
/**
|
|
8
|
-
* This is the [React](https://reactjs.org/) component for Vanilla [Tabs](https://vanillaframework.io/docs/patterns/tabs).
|
|
9
|
-
Tabs organise and allow navigation between groups of content that are related and at the same level
|
|
10
|
-
of hierarchy.
|
|
11
|
-
*/
|
|
12
|
-
var Tabs = _ref => {
|
|
13
|
-
var {
|
|
14
|
-
className,
|
|
15
|
-
links,
|
|
16
|
-
listClassName
|
|
17
|
-
} = _ref;
|
|
18
|
-
return /*#__PURE__*/React.createElement("nav", {
|
|
19
|
-
className: classNames("p-tabs", className)
|
|
20
|
-
}, /*#__PURE__*/React.createElement("ul", {
|
|
21
|
-
className: classNames("p-tabs__list", listClassName)
|
|
22
|
-
}, links.map((link, i) => {
|
|
23
|
-
var {
|
|
24
|
-
active,
|
|
25
|
-
className,
|
|
26
|
-
component,
|
|
27
|
-
label,
|
|
28
|
-
listItemClassName
|
|
29
|
-
} = link,
|
|
30
|
-
rest = _objectWithoutProperties(link, _excluded);
|
|
31
|
-
var Component = component || "a";
|
|
32
|
-
return /*#__PURE__*/React.createElement("li", {
|
|
33
|
-
className: classNames("p-tabs__item", listItemClassName),
|
|
34
|
-
key: i
|
|
35
|
-
}, /*#__PURE__*/React.createElement(Component, _extends({
|
|
36
|
-
"aria-selected": active,
|
|
37
|
-
className: classNames("p-tabs__link", className),
|
|
38
|
-
"data-testid": "tab-link-".concat(label)
|
|
39
|
-
}, rest), label));
|
|
40
|
-
})));
|
|
41
|
-
};
|
|
42
|
-
export default Tabs;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Tabs";
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
var _excluded = ["caution", "className", "error", "grow", "help", "id", "label", "labelClassName", "onKeyUp", "onControlEnter", "required", "stacked", "style", "success", "takeFocus", "wrapperClassName"];
|
|
2
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
7
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
9
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
10
|
-
import classNames from "classnames";
|
|
11
|
-
import React, { useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
12
|
-
import Field from "../Field";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* The props for the Textarea component.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* This is a [React](https://reactjs.org/) component for the Vanilla [Textarea](https://docs.vanillaframework.io/base/forms/#textarea).
|
|
20
|
-
*
|
|
21
|
-
* The Textarea component defines a multi-line text input control.
|
|
22
|
-
*/
|
|
23
|
-
var Textarea = _ref => {
|
|
24
|
-
var _props$value;
|
|
25
|
-
var {
|
|
26
|
-
caution,
|
|
27
|
-
className,
|
|
28
|
-
error,
|
|
29
|
-
grow = false,
|
|
30
|
-
help,
|
|
31
|
-
id,
|
|
32
|
-
label,
|
|
33
|
-
labelClassName,
|
|
34
|
-
onKeyUp: _onKeyUp,
|
|
35
|
-
onControlEnter,
|
|
36
|
-
required,
|
|
37
|
-
stacked,
|
|
38
|
-
style,
|
|
39
|
-
success,
|
|
40
|
-
takeFocus = false,
|
|
41
|
-
wrapperClassName
|
|
42
|
-
} = _ref,
|
|
43
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
44
|
-
var textareaRef = useRef(null);
|
|
45
|
-
var validationId = useId();
|
|
46
|
-
var helpId = useId();
|
|
47
|
-
var hasError = !!error;
|
|
48
|
-
var [innerValue, setInnervalue] = useState(props.defaultValue);
|
|
49
|
-
var defaultTextAreaId = useId();
|
|
50
|
-
var textAreaId = id || defaultTextAreaId;
|
|
51
|
-
var handleKeyDown = useCallback(event => {
|
|
52
|
-
if (event.key === "Enter" && (event.ctrlKey || event.metaKey) && document.activeElement === textareaRef.current) {
|
|
53
|
-
onControlEnter();
|
|
54
|
-
}
|
|
55
|
-
}, [onControlEnter]);
|
|
56
|
-
useEffect(() => {
|
|
57
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
58
|
-
return () => {
|
|
59
|
-
document.removeEventListener("keydown", handleKeyDown);
|
|
60
|
-
};
|
|
61
|
-
}, [handleKeyDown]);
|
|
62
|
-
useEffect(() => {
|
|
63
|
-
if (takeFocus) {
|
|
64
|
-
textareaRef.current.focus();
|
|
65
|
-
}
|
|
66
|
-
}, [takeFocus]);
|
|
67
|
-
useLayoutEffect(() => {
|
|
68
|
-
if (grow) {
|
|
69
|
-
var textArea = textareaRef.current;
|
|
70
|
-
if (textArea) {
|
|
71
|
-
textArea.style.height = "0px";
|
|
72
|
-
var scrollHeight = textArea.scrollHeight;
|
|
73
|
-
textArea.style.height = "".concat(scrollHeight, "px");
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}, [textareaRef, grow, innerValue, props.value]);
|
|
77
|
-
return /*#__PURE__*/React.createElement(Field, {
|
|
78
|
-
caution: caution,
|
|
79
|
-
className: wrapperClassName,
|
|
80
|
-
error: error,
|
|
81
|
-
forId: textAreaId,
|
|
82
|
-
help: help,
|
|
83
|
-
helpId: helpId,
|
|
84
|
-
label: label,
|
|
85
|
-
labelClassName: labelClassName,
|
|
86
|
-
required: required,
|
|
87
|
-
stacked: stacked,
|
|
88
|
-
success: success,
|
|
89
|
-
validationId: validationId
|
|
90
|
-
}, /*#__PURE__*/React.createElement("textarea", _extends({
|
|
91
|
-
"aria-describedby": [help ? helpId : null, success ? validationId : null].filter(Boolean).join(" "),
|
|
92
|
-
"aria-errormessage": hasError ? validationId : null,
|
|
93
|
-
"aria-invalid": hasError,
|
|
94
|
-
className: classNames("p-form-validation__input", className),
|
|
95
|
-
id: textAreaId,
|
|
96
|
-
onKeyUp: evt => {
|
|
97
|
-
_onKeyUp && _onKeyUp(evt);
|
|
98
|
-
},
|
|
99
|
-
onChange: evt => {
|
|
100
|
-
if (!props.value) {
|
|
101
|
-
setInnervalue(evt.target.value);
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
ref: textareaRef,
|
|
105
|
-
style: grow && _objectSpread({
|
|
106
|
-
minHeight: "5rem",
|
|
107
|
-
resize: "none",
|
|
108
|
-
overflow: "hidden",
|
|
109
|
-
boxSizing: "border-box"
|
|
110
|
-
}, style) || style
|
|
111
|
-
}, props, {
|
|
112
|
-
value: (_props$value = props.value) !== null && _props$value !== void 0 ? _props$value : innerValue
|
|
113
|
-
})));
|
|
114
|
-
};
|
|
115
|
-
export default Textarea;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Textarea";
|