@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,22 +0,0 @@
|
|
|
1
|
-
var _excluded = ["label"];
|
|
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
|
-
import CheckableInput from "../CheckboxInput/CheckableInput";
|
|
7
|
-
/**
|
|
8
|
-
* This is a [React](https://reactjs.org/) component for the Vanilla [Radio input](https://docs.vanillaframework.io/base/forms#radio-button).
|
|
9
|
-
*
|
|
10
|
-
* Use radio buttons to select one of the given set of options.
|
|
11
|
-
*/
|
|
12
|
-
var RadioInput = _ref => {
|
|
13
|
-
var {
|
|
14
|
-
label
|
|
15
|
-
} = _ref,
|
|
16
|
-
radioProps = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
-
return /*#__PURE__*/React.createElement(CheckableInput, _extends({
|
|
18
|
-
inputType: "radio",
|
|
19
|
-
label: label
|
|
20
|
-
}, radioProps));
|
|
21
|
-
};
|
|
22
|
-
export default RadioInput;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./RadioInput";
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
var _excluded = ["children", "className"];
|
|
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 a [React](https://reactjs.org/) component for use within the Vanilla [Grid](https://docs.vanillaframework.io/patterns/grid/).
|
|
9
|
-
*
|
|
10
|
-
* Vanilla has a responsive grid using a combination of rows and columns.
|
|
11
|
-
*/
|
|
12
|
-
var Row = _ref => {
|
|
13
|
-
var {
|
|
14
|
-
children,
|
|
15
|
-
className
|
|
16
|
-
} = _ref,
|
|
17
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
19
|
-
className: classNames(className, "row")
|
|
20
|
-
}, props), children);
|
|
21
|
-
};
|
|
22
|
-
export default Row;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Row";
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import _pt from "prop-types";
|
|
2
|
-
import React, { useEffect, useRef, useState } from "react";
|
|
3
|
-
import Chip from "../../Chip";
|
|
4
|
-
import { overflowingChipsCount, isChipInArray } from "../utils";
|
|
5
|
-
import { highlightSubString } from "../../../utils";
|
|
6
|
-
var FilterPanelSection = _ref => {
|
|
7
|
-
var {
|
|
8
|
-
data,
|
|
9
|
-
searchData,
|
|
10
|
-
searchTerm = "",
|
|
11
|
-
sectionHidden,
|
|
12
|
-
toggleSelected
|
|
13
|
-
} = _ref;
|
|
14
|
-
var {
|
|
15
|
-
chips,
|
|
16
|
-
heading
|
|
17
|
-
} = data;
|
|
18
|
-
var [overflowCounter, setOverflowCounter] = useState(0);
|
|
19
|
-
var [expanded, setExpanded] = useState(false);
|
|
20
|
-
var chipWrapper = useRef(null);
|
|
21
|
-
var handleChipClick = chip => {
|
|
22
|
-
toggleSelected(chip);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
// If the offsetTop is more than double height of a single chip, consider it
|
|
26
|
-
// overflowing
|
|
27
|
-
var updateFlowCount = function updateFlowCount() {
|
|
28
|
-
var _chipWrapper$current;
|
|
29
|
-
var chips = chipWrapper === null || chipWrapper === void 0 || (_chipWrapper$current = chipWrapper.current) === null || _chipWrapper$current === void 0 ? void 0 : _chipWrapper$current.querySelectorAll(".p-chip");
|
|
30
|
-
var overflowCount = overflowingChipsCount(chips, 2);
|
|
31
|
-
setOverflowCounter(overflowCount);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
// Check if search term characters matches any characters in panel heading
|
|
35
|
-
var searchTermInHeading = highlightSubString(heading, searchTerm).match;
|
|
36
|
-
|
|
37
|
-
// Serialise chip values into string so it can be interrogated with subString
|
|
38
|
-
var chipValues = [];
|
|
39
|
-
Object.entries(chips).forEach(chipValue => {
|
|
40
|
-
chipValues.push(chipValue[1].value);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
// Search chips for character match with search term
|
|
44
|
-
var searchTermInChips = highlightSubString(chipValues.toString(), searchTerm).match;
|
|
45
|
-
var panelSectionVisible = searchTermInHeading || searchTermInChips || searchTerm === "";
|
|
46
|
-
|
|
47
|
-
// Update overflow count when component is resized
|
|
48
|
-
useEffect(() => {
|
|
49
|
-
var resizeObserverSupported = typeof ResizeObserver !== "undefined";
|
|
50
|
-
var wrapper = chipWrapper === null || chipWrapper === void 0 ? void 0 : chipWrapper.current;
|
|
51
|
-
var wrapperWidthObserver;
|
|
52
|
-
if (resizeObserverSupported && panelSectionVisible) {
|
|
53
|
-
wrapperWidthObserver = new ResizeObserver(() => {
|
|
54
|
-
updateFlowCount();
|
|
55
|
-
});
|
|
56
|
-
wrapperWidthObserver.observe(wrapper);
|
|
57
|
-
} else {
|
|
58
|
-
updateFlowCount();
|
|
59
|
-
}
|
|
60
|
-
return () => {
|
|
61
|
-
var _wrapperWidthObserver;
|
|
62
|
-
resizeObserverSupported && ((_wrapperWidthObserver = wrapperWidthObserver) === null || _wrapperWidthObserver === void 0 ? void 0 : _wrapperWidthObserver.disconnect());
|
|
63
|
-
};
|
|
64
|
-
}, [panelSectionVisible]);
|
|
65
|
-
|
|
66
|
-
// When overflow counter is clicked, all chips are shown
|
|
67
|
-
var showAllChips = () => {
|
|
68
|
-
setExpanded(true);
|
|
69
|
-
};
|
|
70
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, panelSectionVisible && /*#__PURE__*/React.createElement("div", {
|
|
71
|
-
className: "p-filter-panel-section"
|
|
72
|
-
}, heading && chips.length > 0 && /*#__PURE__*/React.createElement("h3", {
|
|
73
|
-
className: "p-filter-panel-section__heading",
|
|
74
|
-
dangerouslySetInnerHTML: {
|
|
75
|
-
__html: highlightSubString(heading, searchTerm).text
|
|
76
|
-
}
|
|
77
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
78
|
-
className: "p-filter-panel-section__chips",
|
|
79
|
-
"aria-expanded": expanded,
|
|
80
|
-
ref: chipWrapper
|
|
81
|
-
}, chips === null || chips === void 0 ? void 0 : chips.map(chip => {
|
|
82
|
-
// If search term has been added to input, only matching chips
|
|
83
|
-
// should display
|
|
84
|
-
var searchTermInChip = highlightSubString(chip.value, searchTerm).match;
|
|
85
|
-
var chipVisible = searchTermInChip || searchTerm === "" || highlightSubString(heading, searchTerm).match;
|
|
86
|
-
return chipVisible && !sectionHidden && /*#__PURE__*/React.createElement(Chip, {
|
|
87
|
-
key: "".concat(chip.lead, "+").concat(chip.value),
|
|
88
|
-
lead: chip.lead,
|
|
89
|
-
value: chip.value,
|
|
90
|
-
selected: isChipInArray(chip, searchData),
|
|
91
|
-
subString: searchTerm,
|
|
92
|
-
onClick: () => handleChipClick(chip)
|
|
93
|
-
});
|
|
94
|
-
}), overflowCounter > 0 && !expanded && /*#__PURE__*/React.createElement("span", {
|
|
95
|
-
className: "p-filter-panel-section__counter",
|
|
96
|
-
onClick: showAllChips,
|
|
97
|
-
onKeyPress: showAllChips,
|
|
98
|
-
tabIndex: 0
|
|
99
|
-
}, "+", overflowCounter))));
|
|
100
|
-
};
|
|
101
|
-
FilterPanelSection.propTypes = {
|
|
102
|
-
searchData: _pt.array.isRequired,
|
|
103
|
-
searchTerm: _pt.string.isRequired,
|
|
104
|
-
sectionHidden: _pt.bool,
|
|
105
|
-
toggleSelected: _pt.func.isRequired
|
|
106
|
-
};
|
|
107
|
-
export default FilterPanelSection;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./FilterPanelSection";
|
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
import _pt from "prop-types";
|
|
2
|
-
var _excluded = ["existingSearchData", "filterPanelData", "returnSearchData", "onPanelToggle", "onExpandChange"];
|
|
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 React, { useState, useEffect, useRef } from "react";
|
|
7
|
-
import FilterPanelSection from "./FilterPanelSection";
|
|
8
|
-
import Chip from "../Chip";
|
|
9
|
-
import { overflowingChipsCount, isChipInArray } from "./utils";
|
|
10
|
-
import { useOnEscapePressed, useWindowFitment } from "../../hooks";
|
|
11
|
-
export var Label = /*#__PURE__*/function (Label) {
|
|
12
|
-
Label["AddFilter"] = "Add filter";
|
|
13
|
-
Label["Clear"] = "Clear input";
|
|
14
|
-
Label["SearchAndFilter"] = "Search and filter";
|
|
15
|
-
return Label;
|
|
16
|
-
}({});
|
|
17
|
-
/**
|
|
18
|
-
* This component allows searching and filtering of large datasets.
|
|
19
|
-
*/
|
|
20
|
-
var SearchAndFilter = _ref => {
|
|
21
|
-
var {
|
|
22
|
-
existingSearchData = [],
|
|
23
|
-
filterPanelData,
|
|
24
|
-
returnSearchData,
|
|
25
|
-
onPanelToggle = () => {},
|
|
26
|
-
onExpandChange = () => {}
|
|
27
|
-
} = _ref,
|
|
28
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
-
var [searchData, setSearchData] = useState(existingSearchData);
|
|
30
|
-
var [searchTerm, setSearchTerm] = useState("");
|
|
31
|
-
var [filterPanelHidden, setFilterPanelHidden] = useState(true);
|
|
32
|
-
var [searchBoxExpanded, setSearchBoxExpanded] = useState(false);
|
|
33
|
-
var [overflowSearchTermCounter, setOverflowSearchTermCounter] = useState(0);
|
|
34
|
-
var [searchContainerActive, setSearchContainerActive] = useState(false);
|
|
35
|
-
var [maxHeight, setMaxHeight] = useState();
|
|
36
|
-
var searchAndFilterRef = useRef(null);
|
|
37
|
-
var searchContainerRef = useRef(null);
|
|
38
|
-
var searchBoxRef = useRef(null);
|
|
39
|
-
var panel = useRef();
|
|
40
|
-
|
|
41
|
-
// Call onPanelToggle when the filterPanelHidden state changes
|
|
42
|
-
useEffect(onPanelToggle, [onPanelToggle, filterPanelHidden]);
|
|
43
|
-
|
|
44
|
-
// Call onExpandChange when the search box is expanded or collapsed
|
|
45
|
-
useEffect(onExpandChange, [onExpandChange, searchBoxExpanded]);
|
|
46
|
-
|
|
47
|
-
// Return searchData to parent component
|
|
48
|
-
useEffect(() => {
|
|
49
|
-
var mounted = true;
|
|
50
|
-
returnSearchData && mounted && returnSearchData(searchData);
|
|
51
|
-
return () => {
|
|
52
|
-
mounted = false;
|
|
53
|
-
};
|
|
54
|
-
}, [searchData, returnSearchData]);
|
|
55
|
-
var searchOnChange = searchTerm => {
|
|
56
|
-
setSearchTerm(searchTerm);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
// Hide manual input form field when search container is inactive
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
var searchContainerClickCheck = e => {
|
|
62
|
-
var _e$target;
|
|
63
|
-
var clickInContainer = ((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.closest(".p-search-and-filter")) !== null;
|
|
64
|
-
setSearchContainerActive(clickInContainer);
|
|
65
|
-
};
|
|
66
|
-
document.addEventListener("click", searchContainerClickCheck);
|
|
67
|
-
return () => {
|
|
68
|
-
document.removeEventListener("click", searchContainerClickCheck);
|
|
69
|
-
};
|
|
70
|
-
}, [searchContainerActive]);
|
|
71
|
-
var closePanel = () => {
|
|
72
|
-
setFilterPanelHidden(true);
|
|
73
|
-
};
|
|
74
|
-
useOnEscapePressed(() => closePanel());
|
|
75
|
-
|
|
76
|
-
// This useEffect sets up listeners so the panel will close if user clicks
|
|
77
|
-
// anywhere else on the page or hits the escape key
|
|
78
|
-
useEffect(() => {
|
|
79
|
-
var mouseDown = e => {
|
|
80
|
-
var _searchAndFilterRef$c;
|
|
81
|
-
// Check if click is outside of filter panel
|
|
82
|
-
if (!(searchAndFilterRef !== null && searchAndFilterRef !== void 0 && (_searchAndFilterRef$c = searchAndFilterRef.current) !== null && _searchAndFilterRef$c !== void 0 && _searchAndFilterRef$c.contains(e.target))) {
|
|
83
|
-
// If so, close the panel
|
|
84
|
-
closePanel();
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
// Add listener on document to capture click events
|
|
89
|
-
document.addEventListener("mousedown", mouseDown);
|
|
90
|
-
// return function to be called when unmounted
|
|
91
|
-
return () => {
|
|
92
|
-
document.removeEventListener("mousedown", mouseDown);
|
|
93
|
-
};
|
|
94
|
-
}, []);
|
|
95
|
-
|
|
96
|
-
// Add passed chip to the searchData array
|
|
97
|
-
var toggleSelected = chip => {
|
|
98
|
-
var currentSelected = [...searchData];
|
|
99
|
-
if (!isChipInArray(chip, currentSelected)) {
|
|
100
|
-
currentSelected.push(chip);
|
|
101
|
-
setSearchData(currentSelected);
|
|
102
|
-
setSearchTerm("");
|
|
103
|
-
} else {
|
|
104
|
-
var updatedCurrentSelected = currentSelected.filter(currentSelectedChip => {
|
|
105
|
-
return currentSelectedChip.value !== chip.value;
|
|
106
|
-
});
|
|
107
|
-
setSearchData(updatedCurrentSelected);
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
// Remove passed chip from the searchData array
|
|
112
|
-
var removeFromSelected = chip => {
|
|
113
|
-
if (searchData.includes(chip)) {
|
|
114
|
-
var updatedSelected = searchData.filter(searchDataChip => searchDataChip !== chip);
|
|
115
|
-
setSearchData(updatedSelected);
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
// When overflow chips are shown, clicking anywhere outside search area
|
|
120
|
-
// or clicking on a chip should hide them again
|
|
121
|
-
useEffect(() => {
|
|
122
|
-
var hideOverflowChips = e => {
|
|
123
|
-
if (!e.target.closest(".p-search-and-filter") && e.target.className !== "p-icon--close") {
|
|
124
|
-
setSearchBoxExpanded(false);
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
document.addEventListener("click", e => {
|
|
128
|
-
hideOverflowChips(e);
|
|
129
|
-
});
|
|
130
|
-
return () => {
|
|
131
|
-
document.removeEventListener("click", e => {
|
|
132
|
-
hideOverflowChips(e);
|
|
133
|
-
});
|
|
134
|
-
};
|
|
135
|
-
}, []);
|
|
136
|
-
var handleSubmit = () => {
|
|
137
|
-
if (searchTerm.trim() !== "") {
|
|
138
|
-
toggleSelected({
|
|
139
|
-
value: searchTerm,
|
|
140
|
-
quoteValue: true
|
|
141
|
-
});
|
|
142
|
-
setSearchTerm("");
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
// If the offsetTop is more than double height of a single chip, consider it
|
|
147
|
-
// overflowing
|
|
148
|
-
var updateFlowCount = function updateFlowCount() {
|
|
149
|
-
var _searchContainerRef$c;
|
|
150
|
-
var chips = searchContainerRef === null || searchContainerRef === void 0 || (_searchContainerRef$c = searchContainerRef.current) === null || _searchContainerRef$c === void 0 ? void 0 : _searchContainerRef$c.querySelectorAll(".p-chip");
|
|
151
|
-
var overflowCount = overflowingChipsCount(chips, 1);
|
|
152
|
-
setOverflowSearchTermCounter(overflowCount);
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
// Watch for container resize and recalculate overflow count accordingly
|
|
156
|
-
useEffect(() => {
|
|
157
|
-
var resizeObserverSupported = typeof ResizeObserver !== "undefined";
|
|
158
|
-
var wrapper = searchContainerRef.current;
|
|
159
|
-
var wrapperWidthObserver;
|
|
160
|
-
if (resizeObserverSupported && wrapper) {
|
|
161
|
-
wrapperWidthObserver = new ResizeObserver(() => {
|
|
162
|
-
updateFlowCount();
|
|
163
|
-
});
|
|
164
|
-
wrapperWidthObserver.observe(wrapper);
|
|
165
|
-
} else {
|
|
166
|
-
updateFlowCount();
|
|
167
|
-
}
|
|
168
|
-
return () => {
|
|
169
|
-
var _wrapperWidthObserver;
|
|
170
|
-
resizeObserverSupported && ((_wrapperWidthObserver = wrapperWidthObserver) === null || _wrapperWidthObserver === void 0 ? void 0 : _wrapperWidthObserver.disconnect());
|
|
171
|
-
};
|
|
172
|
-
}, [searchData]);
|
|
173
|
-
useWindowFitment(panel.current, searchAndFilterRef.current, fitsWindow => setMaxHeight(fitsWindow.fromBottom.spaceBelow - 16), 0, !filterPanelHidden);
|
|
174
|
-
|
|
175
|
-
// Add search prompt value to search on Enter key
|
|
176
|
-
var searchPromptKeyDown = e => {
|
|
177
|
-
if (e.key === "Enter") {
|
|
178
|
-
handleSubmit();
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
var searchBox = searchBoxRef.current;
|
|
182
|
-
var searchContainer = searchContainerRef.current;
|
|
183
|
-
if (!searchBoxExpanded && searchBox && searchContainer && overflowSearchTermCounter === 0) {
|
|
184
|
-
if (searchBox.offsetTop > searchContainer.offsetHeight) {
|
|
185
|
-
setSearchBoxExpanded(true);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// If chips or input field contains values, clear 'em out
|
|
190
|
-
var clearAllSearchTerms = () => {
|
|
191
|
-
setSearchTerm("");
|
|
192
|
-
};
|
|
193
|
-
var placeholder = searchData.length ? Label.AddFilter : Label.SearchAndFilter;
|
|
194
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
195
|
-
className: "p-search-and-filter",
|
|
196
|
-
ref: searchAndFilterRef,
|
|
197
|
-
onClick: () => filterPanelHidden && setFilterPanelHidden(false)
|
|
198
|
-
}, props), /*#__PURE__*/React.createElement("div", {
|
|
199
|
-
className: "p-search-and-filter__search-container",
|
|
200
|
-
"aria-expanded": searchBoxExpanded,
|
|
201
|
-
"data-active": searchContainerActive || searchData.length === 0,
|
|
202
|
-
"data-empty": searchData.length <= 0,
|
|
203
|
-
ref: searchContainerRef
|
|
204
|
-
}, searchTerm !== "" && /*#__PURE__*/React.createElement("button", {
|
|
205
|
-
"aria-label": Label.Clear,
|
|
206
|
-
className: "p-search-and-filter__clear",
|
|
207
|
-
onClick: () => clearAllSearchTerms()
|
|
208
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
209
|
-
className: "p-icon--close"
|
|
210
|
-
})), Object.values(searchData).map(chip => {
|
|
211
|
-
return /*#__PURE__*/React.createElement(Chip, {
|
|
212
|
-
lead: chip.lead,
|
|
213
|
-
value: chip.value,
|
|
214
|
-
key: "search-".concat(chip.lead, "+").concat(chip.value),
|
|
215
|
-
onDismiss: event => {
|
|
216
|
-
// Prevent filter chip dismissals from bubbling up and triggering the parent onClick handler
|
|
217
|
-
event.stopPropagation();
|
|
218
|
-
removeFromSelected(chip);
|
|
219
|
-
},
|
|
220
|
-
selected: true,
|
|
221
|
-
quoteValue: chip.quoteValue
|
|
222
|
-
});
|
|
223
|
-
}), /*#__PURE__*/React.createElement("form", {
|
|
224
|
-
className: "p-search-and-filter__box",
|
|
225
|
-
onSubmit: e => {
|
|
226
|
-
e.preventDefault();
|
|
227
|
-
handleSubmit();
|
|
228
|
-
},
|
|
229
|
-
"data-overflowing": searchBoxExpanded,
|
|
230
|
-
ref: searchBoxRef
|
|
231
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
232
|
-
className: "u-off-screen",
|
|
233
|
-
htmlFor: "search-and-filter-input"
|
|
234
|
-
}, searchData.length ? Label.AddFilter : Label.SearchAndFilter), /*#__PURE__*/React.createElement("input", {
|
|
235
|
-
autoComplete: "off",
|
|
236
|
-
className: "p-search-and-filter__input",
|
|
237
|
-
id: "search-and-filter-input",
|
|
238
|
-
name: "search",
|
|
239
|
-
onChange: e => searchOnChange(e.target.value),
|
|
240
|
-
placeholder: placeholder,
|
|
241
|
-
type: "search",
|
|
242
|
-
value: searchTerm
|
|
243
|
-
}), /*#__PURE__*/React.createElement("button", {
|
|
244
|
-
className: "u-off-screen",
|
|
245
|
-
type: "submit"
|
|
246
|
-
}, "Search")), overflowSearchTermCounter > 0 && /*#__PURE__*/React.createElement("span", {
|
|
247
|
-
className: "p-search-and-filter__selected-count",
|
|
248
|
-
onClick: () => setSearchBoxExpanded(true),
|
|
249
|
-
onKeyDown: () => setSearchBoxExpanded(true),
|
|
250
|
-
role: "button",
|
|
251
|
-
tabIndex: 0
|
|
252
|
-
}, "+", overflowSearchTermCounter)), (filterPanelData.length > 0 || searchTerm.length > 0) && /*#__PURE__*/React.createElement("div", {
|
|
253
|
-
className: "p-search-and-filter__panel",
|
|
254
|
-
"aria-hidden": filterPanelHidden,
|
|
255
|
-
ref: panel,
|
|
256
|
-
style: {
|
|
257
|
-
maxHeight,
|
|
258
|
-
minHeight: "5rem",
|
|
259
|
-
overflowX: "auto"
|
|
260
|
-
}
|
|
261
|
-
}, /*#__PURE__*/React.createElement("div", null, searchTerm.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
262
|
-
className: "p-search-and-filter__search-prompt",
|
|
263
|
-
onClick: () => handleSubmit(),
|
|
264
|
-
onKeyDown: e => searchPromptKeyDown(e),
|
|
265
|
-
role: "button",
|
|
266
|
-
tabIndex: 0
|
|
267
|
-
}, "Search for", " ", /*#__PURE__*/React.createElement("span", {
|
|
268
|
-
className: "p-search-and-filter__search-query"
|
|
269
|
-
}, searchTerm), "..."), filterPanelData.map(filterPanelSectionData => {
|
|
270
|
-
return /*#__PURE__*/React.createElement(FilterPanelSection, {
|
|
271
|
-
key: filterPanelSectionData.id,
|
|
272
|
-
data: filterPanelSectionData,
|
|
273
|
-
toggleSelected: toggleSelected,
|
|
274
|
-
searchData: searchData,
|
|
275
|
-
searchTerm: searchTerm
|
|
276
|
-
});
|
|
277
|
-
}))));
|
|
278
|
-
};
|
|
279
|
-
SearchAndFilter.propTypes = {
|
|
280
|
-
existingSearchData: _pt.array,
|
|
281
|
-
filterPanelData: _pt.array.isRequired,
|
|
282
|
-
returnSearchData: _pt.func.isRequired,
|
|
283
|
-
onPanelToggle: _pt.func,
|
|
284
|
-
onExpandChange: _pt.func
|
|
285
|
-
};
|
|
286
|
-
export default SearchAndFilter;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./SearchAndFilter";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Return number of overflowing chips given a row threshold
|
|
3
|
-
* @param {array} chips - An array of chips
|
|
4
|
-
* @param {Integer} overflowRowLimit - Number of rows to show before counting
|
|
5
|
-
* overflow
|
|
6
|
-
*/
|
|
7
|
-
export var overflowingChipsCount = (chips, overflowRowLimit) => {
|
|
8
|
-
var overflowChips = 0;
|
|
9
|
-
if (chips) {
|
|
10
|
-
chips.forEach(chip => {
|
|
11
|
-
if (chip.offsetTop > chip.offsetHeight * overflowRowLimit) overflowChips++;
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
return overflowChips;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Check if supplied chip object already exists in searchData prop
|
|
19
|
-
* @param {Object} chip - A chip object {lead: 'foo', value: 'bar'}
|
|
20
|
-
* @param {Array} existingArr - An array of chip objects
|
|
21
|
-
*/
|
|
22
|
-
export var isChipInArray = (chip, existingArr) => existingArr === null || existingArr === void 0 ? void 0 : existingArr.some(searchDataItem => searchDataItem.lead === chip.lead && searchDataItem.value === chip.value);
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
var _excluded = ["autocomplete", "className", "disabled", "externallyControlled", "onChange", "onSearch", "onClear", "placeholder", "shouldBlurOnSearch", "shouldRefocusAfterReset", "value"];
|
|
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, { useRef } from "react";
|
|
7
|
-
import Icon from "../Icon";
|
|
8
|
-
export var Label = /*#__PURE__*/function (Label) {
|
|
9
|
-
Label["Clear"] = "Clear search field";
|
|
10
|
-
Label["Search"] = "Search";
|
|
11
|
-
return Label;
|
|
12
|
-
}({});
|
|
13
|
-
/**
|
|
14
|
-
* This is a [React](https://reactjs.org/) component for the Vanilla [SearchBox](https://docs.vanillaframework.io/patterns/search-box/).
|
|
15
|
-
*
|
|
16
|
-
* Search boxes enable search functionality on a page and are typically used in a navigation bar. SearchBox elements should be wrapped within a form element that handles its own submit action.
|
|
17
|
-
*/
|
|
18
|
-
var SearchBox = /*#__PURE__*/React.forwardRef((_ref, forwardedRef) => {
|
|
19
|
-
var {
|
|
20
|
-
autocomplete = "on",
|
|
21
|
-
className,
|
|
22
|
-
disabled,
|
|
23
|
-
externallyControlled,
|
|
24
|
-
onChange: _onChange,
|
|
25
|
-
onSearch,
|
|
26
|
-
onClear,
|
|
27
|
-
placeholder = "Search",
|
|
28
|
-
shouldBlurOnSearch = true,
|
|
29
|
-
shouldRefocusAfterReset,
|
|
30
|
-
value
|
|
31
|
-
} = _ref,
|
|
32
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
-
var internalRef = useRef();
|
|
34
|
-
var resetInput = () => {
|
|
35
|
-
_onChange === null || _onChange === void 0 || _onChange("");
|
|
36
|
-
onClear === null || onClear === void 0 || onClear();
|
|
37
|
-
if (internalRef.current) {
|
|
38
|
-
internalRef.current.value = "";
|
|
39
|
-
if (shouldRefocusAfterReset) internalRef.current.focus();
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
var triggerSearch = () => {
|
|
43
|
-
onSearch === null || onSearch === void 0 || onSearch(externallyControlled ? value : internalRef.current.value);
|
|
44
|
-
};
|
|
45
|
-
var onKeyDown = e => {
|
|
46
|
-
if (e.key === "Enter" && internalRef.current.checkValidity()) {
|
|
47
|
-
if (shouldBlurOnSearch) {
|
|
48
|
-
internalRef.current.blur();
|
|
49
|
-
}
|
|
50
|
-
triggerSearch();
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
54
|
-
className: classNames("p-search-box", className)
|
|
55
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
56
|
-
className: "u-off-screen",
|
|
57
|
-
htmlFor: "search"
|
|
58
|
-
}, placeholder || "Search"), /*#__PURE__*/React.createElement("input", _extends({
|
|
59
|
-
autoComplete: autocomplete,
|
|
60
|
-
className: "p-search-box__input",
|
|
61
|
-
disabled: disabled,
|
|
62
|
-
id: "search",
|
|
63
|
-
name: "search",
|
|
64
|
-
onChange: evt => _onChange === null || _onChange === void 0 ? void 0 : _onChange(evt.target.value),
|
|
65
|
-
onKeyDown: onKeyDown,
|
|
66
|
-
placeholder: placeholder,
|
|
67
|
-
ref: input => {
|
|
68
|
-
internalRef.current = input;
|
|
69
|
-
// Handle both function and object refs.
|
|
70
|
-
if (typeof forwardedRef === "function") {
|
|
71
|
-
forwardedRef(input);
|
|
72
|
-
} else if (forwardedRef) {
|
|
73
|
-
forwardedRef.current = input;
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
type: "search",
|
|
77
|
-
defaultValue: externallyControlled ? undefined : value,
|
|
78
|
-
value: externallyControlled ? value : undefined
|
|
79
|
-
}, props)), value && /*#__PURE__*/React.createElement("button", {
|
|
80
|
-
className: "p-search-box__reset",
|
|
81
|
-
disabled: disabled,
|
|
82
|
-
onClick: resetInput,
|
|
83
|
-
type: "reset"
|
|
84
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
85
|
-
name: "close"
|
|
86
|
-
}, Label.Clear)), /*#__PURE__*/React.createElement("button", {
|
|
87
|
-
className: "p-search-box__button",
|
|
88
|
-
disabled: disabled,
|
|
89
|
-
onClick: triggerSearch
|
|
90
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
91
|
-
name: "search"
|
|
92
|
-
}, Label.Search)));
|
|
93
|
-
});
|
|
94
|
-
SearchBox.displayName = "SearchBox";
|
|
95
|
-
export default SearchBox;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./SearchBox";
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
var _excluded = ["label", "value"],
|
|
2
|
-
_excluded2 = ["caution", "className", "error", "help", "id", "label", "labelClassName", "onChange", "options", "required", "stacked", "success", "takeFocus", "wrapperClassName"];
|
|
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 classNames from "classnames";
|
|
7
|
-
import React, { useEffect, useId, useRef } from "react";
|
|
8
|
-
import Field from "../Field";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The props for the Select component.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
var generateOptions = options => options === null || options === void 0 ? void 0 : options.map(_ref => {
|
|
15
|
-
var {
|
|
16
|
-
label,
|
|
17
|
-
value
|
|
18
|
-
} = _ref,
|
|
19
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
-
return /*#__PURE__*/React.createElement("option", _extends({
|
|
21
|
-
value: value,
|
|
22
|
-
key: "".concat(value) || label
|
|
23
|
-
}, props), label);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* This is a [React](https://reactjs.org/) component for the Vanilla [Select](https://docs.vanillaframework.io/base/forms/#select).
|
|
28
|
-
*
|
|
29
|
-
* Use the Select component to create a drop-down list.
|
|
30
|
-
*/
|
|
31
|
-
var Select = _ref2 => {
|
|
32
|
-
var {
|
|
33
|
-
caution,
|
|
34
|
-
className,
|
|
35
|
-
error,
|
|
36
|
-
help,
|
|
37
|
-
id,
|
|
38
|
-
label,
|
|
39
|
-
labelClassName,
|
|
40
|
-
onChange: _onChange,
|
|
41
|
-
options,
|
|
42
|
-
required,
|
|
43
|
-
stacked,
|
|
44
|
-
success,
|
|
45
|
-
takeFocus,
|
|
46
|
-
wrapperClassName
|
|
47
|
-
} = _ref2,
|
|
48
|
-
selectProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
49
|
-
var selectRef = useRef(null);
|
|
50
|
-
var validationId = useId();
|
|
51
|
-
var defaultSelectId = useId();
|
|
52
|
-
var selectId = id || defaultSelectId;
|
|
53
|
-
var helpId = useId();
|
|
54
|
-
var hasError = !!error;
|
|
55
|
-
useEffect(() => {
|
|
56
|
-
if (takeFocus) {
|
|
57
|
-
selectRef.current.focus();
|
|
58
|
-
}
|
|
59
|
-
}, [takeFocus]);
|
|
60
|
-
return /*#__PURE__*/React.createElement(Field, {
|
|
61
|
-
caution: caution,
|
|
62
|
-
className: wrapperClassName,
|
|
63
|
-
error: error,
|
|
64
|
-
forId: selectId,
|
|
65
|
-
help: help,
|
|
66
|
-
helpId: helpId,
|
|
67
|
-
isSelect: true,
|
|
68
|
-
label: label,
|
|
69
|
-
labelClassName: labelClassName,
|
|
70
|
-
required: required,
|
|
71
|
-
stacked: stacked,
|
|
72
|
-
success: success,
|
|
73
|
-
validationId: validationId
|
|
74
|
-
}, /*#__PURE__*/React.createElement("select", _extends({
|
|
75
|
-
"aria-describedby": [help ? helpId : null, success ? validationId : null].filter(Boolean).join(" "),
|
|
76
|
-
"aria-errormessage": hasError ? validationId : null,
|
|
77
|
-
"aria-invalid": hasError,
|
|
78
|
-
className: classNames("p-form-validation__input", className),
|
|
79
|
-
id: selectId,
|
|
80
|
-
onChange: evt => _onChange && _onChange(evt),
|
|
81
|
-
ref: selectRef
|
|
82
|
-
}, selectProps), generateOptions(options)));
|
|
83
|
-
};
|
|
84
|
-
export default Select;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Select";
|