@coreui/react-pro 5.12.0 → 5.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/components/accordion/CAccordion.d.ts +0 -6
- package/dist/cjs/components/accordion/CAccordion.js +3 -4
- package/dist/cjs/components/accordion/CAccordion.js.map +1 -1
- package/dist/cjs/components/accordion/CAccordionBody.js +2 -2
- package/dist/cjs/components/accordion/CAccordionBody.js.map +1 -1
- package/dist/cjs/components/accordion/CAccordionButton.js +2 -2
- package/dist/cjs/components/accordion/CAccordionButton.js.map +1 -1
- package/dist/cjs/components/accordion/CAccordionContext.d.ts +6 -0
- package/dist/cjs/components/accordion/CAccordionContext.js +8 -0
- package/dist/cjs/components/accordion/CAccordionContext.js.map +1 -0
- package/dist/cjs/components/accordion/CAccordionItem.d.ts +0 -6
- package/dist/cjs/components/accordion/CAccordionItem.js +6 -6
- package/dist/cjs/components/accordion/CAccordionItem.js.map +1 -1
- package/dist/cjs/components/accordion/CAccordionItemContext.d.ts +6 -0
- package/dist/cjs/components/accordion/CAccordionItemContext.js +8 -0
- package/dist/cjs/components/accordion/CAccordionItemContext.js.map +1 -0
- package/dist/cjs/components/alert/CAlert.js.map +1 -1
- package/dist/cjs/components/alert/CAlertHeading.js.map +1 -1
- package/dist/cjs/components/backdrop/CBackdrop.js.map +1 -1
- package/dist/cjs/components/badge/CBadge.js.map +1 -1
- package/dist/cjs/components/button/CButton.js.map +1 -1
- package/dist/cjs/components/calendar/CCalendar.js +53 -38
- package/dist/cjs/components/calendar/CCalendar.js.map +1 -1
- package/dist/cjs/components/calendar/CCalendarNavigation.js.map +1 -1
- package/dist/cjs/components/calendar/CCalendarPanel.js.map +1 -1
- package/dist/cjs/components/calendar/utils.d.ts +8 -0
- package/dist/cjs/components/calendar/utils.js +16 -0
- package/dist/cjs/components/calendar/utils.js.map +1 -1
- package/dist/cjs/components/card/CCardHeader.js.map +1 -1
- package/dist/cjs/components/card/CCardSubtitle.js.map +1 -1
- package/dist/cjs/components/card/CCardText.js.map +1 -1
- package/dist/cjs/components/card/CCardTitle.js.map +1 -1
- package/dist/cjs/components/carousel/CCarousel.d.ts +0 -5
- package/dist/cjs/components/carousel/CCarousel.js +2 -3
- package/dist/cjs/components/carousel/CCarousel.js.map +1 -1
- package/dist/cjs/components/carousel/CCarouselContext.d.ts +5 -0
- package/dist/cjs/components/carousel/CCarouselContext.js +8 -0
- package/dist/cjs/components/carousel/CCarouselContext.js.map +1 -0
- package/dist/cjs/components/carousel/CCarouselItem.js +3 -3
- package/dist/cjs/components/carousel/CCarouselItem.js.map +1 -1
- package/dist/cjs/components/date-picker/CDatePicker.js.map +1 -1
- package/dist/cjs/components/date-range-picker/CDateRangePicker.js +53 -33
- package/dist/cjs/components/date-range-picker/CDateRangePicker.js.map +1 -1
- package/dist/cjs/components/dropdown/CDropdown.d.ts +1 -9
- package/dist/cjs/components/dropdown/CDropdown.js +26 -18
- package/dist/cjs/components/dropdown/CDropdown.js.map +1 -1
- package/dist/cjs/components/dropdown/CDropdownContext.d.ts +15 -0
- package/dist/cjs/components/dropdown/CDropdownContext.js +8 -0
- package/dist/cjs/components/dropdown/CDropdownContext.js.map +1 -0
- package/dist/cjs/components/dropdown/CDropdownHeader.js.map +1 -1
- package/dist/cjs/components/dropdown/CDropdownItem.js.map +1 -1
- package/dist/cjs/components/dropdown/CDropdownItemPlain.js.map +1 -1
- package/dist/cjs/components/dropdown/CDropdownMenu.js +2 -2
- package/dist/cjs/components/dropdown/CDropdownMenu.js.map +1 -1
- package/dist/cjs/components/dropdown/CDropdownToggle.js +2 -2
- package/dist/cjs/components/dropdown/CDropdownToggle.js.map +1 -1
- package/dist/cjs/components/form/CFormCheck.js.map +1 -1
- package/dist/cjs/components/form/CFormFeedback.js.map +1 -1
- package/dist/cjs/components/form/CFormInput.js.map +1 -1
- package/dist/cjs/components/form/CFormLabel.js.map +1 -1
- package/dist/cjs/components/form/CFormText.js.map +1 -1
- package/dist/cjs/components/form/CInputGroupText.js.map +1 -1
- package/dist/cjs/components/header/CHeaderBrand.js.map +1 -1
- package/dist/cjs/components/header/CHeaderNav.js.map +1 -1
- package/dist/cjs/components/header/CHeaderToggler.js.map +1 -1
- package/dist/cjs/components/index.d.ts +2 -0
- package/dist/cjs/components/link/CLink.js.map +1 -1
- package/dist/cjs/components/list-group/CListGroup.js.map +1 -1
- package/dist/cjs/components/list-group/CListGroupItem.js.map +1 -1
- package/dist/cjs/components/loading-button/CLoadingButton.js.map +1 -1
- package/dist/cjs/components/modal/CModal.d.ts +0 -6
- package/dist/cjs/components/modal/CModal.js +2 -3
- package/dist/cjs/components/modal/CModal.js.map +1 -1
- package/dist/cjs/components/modal/CModalContext.d.ts +5 -0
- package/dist/cjs/components/modal/CModalContext.js +8 -0
- package/dist/cjs/components/modal/CModalContext.js.map +1 -0
- package/dist/cjs/components/modal/CModalHeader.js +2 -2
- package/dist/cjs/components/modal/CModalHeader.js.map +1 -1
- package/dist/cjs/components/modal/CModalTitle.js.map +1 -1
- package/dist/cjs/components/multi-select/CMultiSelect.d.ts +6 -0
- package/dist/cjs/components/multi-select/CMultiSelect.js +21 -4
- package/dist/cjs/components/multi-select/CMultiSelect.js.map +1 -1
- package/dist/cjs/components/multi-select/CMultiSelectNativeSelect.js.map +1 -1
- package/dist/cjs/components/multi-select/CMultiSelectOptions.js.map +1 -1
- package/dist/cjs/components/multi-select/CMultiSelectSelection.js.map +1 -1
- package/dist/cjs/components/nav/CNav.js.map +1 -1
- package/dist/cjs/components/nav/CNavGroup.js +2 -2
- package/dist/cjs/components/nav/CNavGroup.js.map +1 -1
- package/dist/cjs/components/nav/CNavGroupItems.js.map +1 -1
- package/dist/cjs/components/nav/CNavItem.js.map +1 -1
- package/dist/cjs/components/nav/CNavLink.js +2 -2
- package/dist/cjs/components/nav/CNavLink.js.map +1 -1
- package/dist/cjs/components/nav/CNavTitle.js.map +1 -1
- package/dist/cjs/components/navbar/CNavbar.js.map +1 -1
- package/dist/cjs/components/navbar/CNavbarBrand.js.map +1 -1
- package/dist/cjs/components/navbar/CNavbarNav.js.map +1 -1
- package/dist/cjs/components/navbar/CNavbarToggler.js.map +1 -1
- package/dist/cjs/components/offcanvas/COffcanvas.js.map +1 -1
- package/dist/cjs/components/offcanvas/COffcanvasTitle.js.map +1 -1
- package/dist/cjs/components/pagination/CPaginationItem.js.map +1 -1
- package/dist/cjs/components/password-input/CPasswordInput.d.ts +43 -0
- package/dist/cjs/components/password-input/CPasswordInput.js +37 -0
- package/dist/cjs/components/password-input/CPasswordInput.js.map +1 -0
- package/dist/cjs/components/password-input/index.d.ts +2 -0
- package/dist/cjs/components/picker/CPicker.js.map +1 -1
- package/dist/cjs/components/placeholder/CPlaceholder.js.map +1 -1
- package/dist/cjs/components/popover/CPopover.js.map +1 -1
- package/dist/cjs/components/progress/CProgress.js +2 -2
- package/dist/cjs/components/progress/CProgress.js.map +1 -1
- package/dist/cjs/components/progress/CProgressBar.d.ts +1 -1
- package/dist/cjs/components/progress/CProgressBar.js +3 -3
- package/dist/cjs/components/progress/CProgressBar.js.map +1 -1
- package/dist/cjs/components/progress/CProgressStacked.d.ts +0 -4
- package/dist/cjs/components/progress/CProgressStacked.js +2 -3
- package/dist/cjs/components/progress/CProgressStacked.js.map +1 -1
- package/dist/cjs/components/progress/CProgressStackedContext.d.ts +4 -0
- package/dist/cjs/components/progress/CProgressStackedContext.js +8 -0
- package/dist/cjs/components/progress/CProgressStackedContext.js.map +1 -0
- package/dist/cjs/components/range-slider/CRangeSlider.js.map +1 -1
- package/dist/cjs/components/rating/CRating.js.map +1 -1
- package/dist/cjs/components/sidebar/CSidebar.js.map +1 -1
- package/dist/cjs/components/sidebar/CSidebarBrand.js.map +1 -1
- package/dist/cjs/components/sidebar/CSidebarNav.d.ts +1 -7
- package/dist/cjs/components/sidebar/CSidebarNav.js +15 -14
- package/dist/cjs/components/sidebar/CSidebarNav.js.map +1 -1
- package/dist/cjs/components/sidebar/CSidebarNavContext.d.ts +5 -0
- package/dist/cjs/components/sidebar/CSidebarNavContext.js +8 -0
- package/dist/cjs/components/sidebar/CSidebarNavContext.js.map +1 -0
- package/dist/cjs/components/smart-pagination/CSmartPagination.js.map +1 -1
- package/dist/cjs/components/smart-table/CSmartTable.js.map +1 -1
- package/dist/cjs/components/smart-table/CSmartTableBody.js.map +1 -1
- package/dist/cjs/components/smart-table/CSmartTableHead.js.map +1 -1
- package/dist/cjs/components/smart-table/utils.js.map +1 -1
- package/dist/cjs/components/spinner/CSpinner.js.map +1 -1
- package/dist/cjs/components/stepper/CStepper.d.ts +84 -0
- package/dist/cjs/components/stepper/CStepper.js +201 -0
- package/dist/cjs/components/stepper/CStepper.js.map +1 -0
- package/dist/cjs/components/stepper/index.d.ts +2 -0
- package/dist/cjs/components/stepper/types.d.ts +17 -0
- package/dist/cjs/components/tabs/CTab.js +2 -2
- package/dist/cjs/components/tabs/CTab.js.map +1 -1
- package/dist/cjs/components/tabs/CTabList.js.map +1 -1
- package/dist/cjs/components/tabs/CTabPane.js +1 -1
- package/dist/cjs/components/tabs/CTabPane.js.map +1 -1
- package/dist/cjs/components/tabs/CTabPanel.js +3 -3
- package/dist/cjs/components/tabs/CTabPanel.js.map +1 -1
- package/dist/cjs/components/tabs/CTabs.d.ts +29 -9
- package/dist/cjs/components/tabs/CTabs.js +14 -9
- package/dist/cjs/components/tabs/CTabs.js.map +1 -1
- package/dist/cjs/components/tabs/CTabsContext.d.ts +6 -0
- package/dist/cjs/components/tabs/CTabsContext.js +8 -0
- package/dist/cjs/components/tabs/CTabsContext.js.map +1 -0
- package/dist/cjs/components/time-picker/CTimePicker.js +13 -7
- package/dist/cjs/components/time-picker/CTimePicker.js.map +1 -1
- package/dist/cjs/components/time-picker/CTimePickerRollCol.js.map +1 -1
- package/dist/cjs/components/time-picker/utils.d.ts +10 -0
- package/dist/cjs/components/time-picker/utils.js +25 -9
- package/dist/cjs/components/time-picker/utils.js.map +1 -1
- package/dist/cjs/components/toast/CToast.d.ts +0 -6
- package/dist/cjs/components/toast/CToast.js +5 -9
- package/dist/cjs/components/toast/CToast.js.map +1 -1
- package/dist/cjs/components/toast/CToastClose.js +2 -2
- package/dist/cjs/components/toast/CToastClose.js.map +1 -1
- package/dist/cjs/components/toast/CToastContext.d.ts +5 -0
- package/dist/cjs/components/toast/CToastContext.js +8 -0
- package/dist/cjs/components/toast/CToastContext.js.map +1 -0
- package/dist/cjs/components/toast/CToaster.d.ts +2 -1
- package/dist/cjs/components/toast/CToaster.js +4 -2
- package/dist/cjs/components/toast/CToaster.js.map +1 -1
- package/dist/cjs/components/tooltip/CTooltip.js.map +1 -1
- package/dist/cjs/components/widgets/CWidgetStatsF.js.map +1 -1
- package/dist/cjs/hooks/useClipboard.js.map +1 -1
- package/dist/cjs/hooks/useColorModes.js.map +1 -1
- package/dist/cjs/hooks/useDebouncedCallback.js.map +1 -1
- package/dist/cjs/hooks/useDropdownWithPopper.d.ts +2 -2
- package/dist/cjs/hooks/usePopper.js +2 -2
- package/dist/cjs/hooks/usePopper.js.map +1 -1
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/node_modules/@coreui/icons-react/dist/index.esm.js.map +1 -1
- package/dist/cjs/node_modules/dom-helpers/esm/hasClass.js.map +1 -1
- package/dist/cjs/node_modules/react-device-detect/dist/lib.js +1 -1
- package/dist/cjs/node_modules/react-device-detect/dist/lib.js.map +1 -1
- package/dist/cjs/node_modules/react-transition-group/esm/CSSTransition.js +9 -9
- package/dist/cjs/node_modules/react-transition-group/esm/CSSTransition.js.map +1 -1
- package/dist/cjs/node_modules/react-transition-group/esm/Transition.js.map +1 -1
- package/dist/cjs/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/cjs/node_modules/ua-parser-js/dist/ua-parser.min.js.map +1 -1
- package/dist/cjs/utils/executeAfterTransition.js.map +1 -1
- package/dist/cjs/utils/getNextActiveElement.js.map +1 -1
- package/dist/cjs/utils/index.d.ts +1 -2
- package/dist/cjs/utils/isObjectInArray.js.map +1 -1
- package/dist/esm/components/accordion/CAccordion.d.ts +0 -6
- package/dist/esm/components/accordion/CAccordion.js +4 -4
- package/dist/esm/components/accordion/CAccordion.js.map +1 -1
- package/dist/esm/components/accordion/CAccordionBody.js +1 -1
- package/dist/esm/components/accordion/CAccordionBody.js.map +1 -1
- package/dist/esm/components/accordion/CAccordionButton.js +1 -1
- package/dist/esm/components/accordion/CAccordionContext.d.ts +6 -0
- package/dist/esm/components/accordion/CAccordionContext.js +6 -0
- package/dist/esm/components/accordion/CAccordionContext.js.map +1 -0
- package/dist/esm/components/accordion/CAccordionItem.d.ts +0 -6
- package/dist/esm/components/accordion/CAccordionItem.js +6 -5
- package/dist/esm/components/accordion/CAccordionItem.js.map +1 -1
- package/dist/esm/components/accordion/CAccordionItemContext.d.ts +6 -0
- package/dist/esm/components/accordion/CAccordionItemContext.js +6 -0
- package/dist/esm/components/accordion/CAccordionItemContext.js.map +1 -0
- package/dist/esm/components/alert/CAlert.js.map +1 -1
- package/dist/esm/components/alert/CAlertHeading.js.map +1 -1
- package/dist/esm/components/avatar/CAvatar.js +1 -1
- package/dist/esm/components/backdrop/CBackdrop.js.map +1 -1
- package/dist/esm/components/badge/CBadge.js +1 -1
- package/dist/esm/components/badge/CBadge.js.map +1 -1
- package/dist/esm/components/button/CButton.js.map +1 -1
- package/dist/esm/components/calendar/CCalendar.js +54 -39
- package/dist/esm/components/calendar/CCalendar.js.map +1 -1
- package/dist/esm/components/calendar/CCalendarNavigation.js.map +1 -1
- package/dist/esm/components/calendar/CCalendarPanel.js.map +1 -1
- package/dist/esm/components/calendar/utils.d.ts +8 -0
- package/dist/esm/components/calendar/utils.js +16 -1
- package/dist/esm/components/calendar/utils.js.map +1 -1
- package/dist/esm/components/card/CCardHeader.js.map +1 -1
- package/dist/esm/components/card/CCardSubtitle.js.map +1 -1
- package/dist/esm/components/card/CCardText.js.map +1 -1
- package/dist/esm/components/card/CCardTitle.js.map +1 -1
- package/dist/esm/components/carousel/CCarousel.d.ts +0 -5
- package/dist/esm/components/carousel/CCarousel.js +3 -3
- package/dist/esm/components/carousel/CCarousel.js.map +1 -1
- package/dist/esm/components/carousel/CCarouselContext.d.ts +5 -0
- package/dist/esm/components/carousel/CCarouselContext.js +6 -0
- package/dist/esm/components/carousel/CCarouselContext.js.map +1 -0
- package/dist/esm/components/carousel/CCarouselItem.js +2 -2
- package/dist/esm/components/carousel/CCarouselItem.js.map +1 -1
- package/dist/esm/components/date-picker/CDatePicker.js.map +1 -1
- package/dist/esm/components/date-range-picker/CDateRangePicker.js +47 -27
- package/dist/esm/components/date-range-picker/CDateRangePicker.js.map +1 -1
- package/dist/esm/components/dropdown/CDropdown.d.ts +1 -9
- package/dist/esm/components/dropdown/CDropdown.js +27 -18
- package/dist/esm/components/dropdown/CDropdown.js.map +1 -1
- package/dist/esm/components/dropdown/CDropdownContext.d.ts +15 -0
- package/dist/esm/components/dropdown/CDropdownContext.js +6 -0
- package/dist/esm/components/dropdown/CDropdownContext.js.map +1 -0
- package/dist/esm/components/dropdown/CDropdownHeader.js.map +1 -1
- package/dist/esm/components/dropdown/CDropdownItem.js.map +1 -1
- package/dist/esm/components/dropdown/CDropdownItemPlain.js.map +1 -1
- package/dist/esm/components/dropdown/CDropdownMenu.js +1 -1
- package/dist/esm/components/dropdown/CDropdownMenu.js.map +1 -1
- package/dist/esm/components/dropdown/CDropdownToggle.js +1 -1
- package/dist/esm/components/dropdown/CDropdownToggle.js.map +1 -1
- package/dist/esm/components/form/CFormCheck.js.map +1 -1
- package/dist/esm/components/form/CFormFeedback.js.map +1 -1
- package/dist/esm/components/form/CFormInput.js.map +1 -1
- package/dist/esm/components/form/CFormLabel.js.map +1 -1
- package/dist/esm/components/form/CFormText.js.map +1 -1
- package/dist/esm/components/form/CInputGroupText.js.map +1 -1
- package/dist/esm/components/header/CHeaderBrand.js.map +1 -1
- package/dist/esm/components/header/CHeaderNav.js.map +1 -1
- package/dist/esm/components/header/CHeaderToggler.js.map +1 -1
- package/dist/esm/components/index.d.ts +2 -0
- package/dist/esm/components/link/CLink.js.map +1 -1
- package/dist/esm/components/list-group/CListGroup.js.map +1 -1
- package/dist/esm/components/list-group/CListGroupItem.js.map +1 -1
- package/dist/esm/components/loading-button/CLoadingButton.js.map +1 -1
- package/dist/esm/components/modal/CModal.d.ts +0 -6
- package/dist/esm/components/modal/CModal.js +3 -3
- package/dist/esm/components/modal/CModal.js.map +1 -1
- package/dist/esm/components/modal/CModalContext.d.ts +5 -0
- package/dist/esm/components/modal/CModalContext.js +6 -0
- package/dist/esm/components/modal/CModalContext.js.map +1 -0
- package/dist/esm/components/modal/CModalHeader.js +1 -1
- package/dist/esm/components/modal/CModalHeader.js.map +1 -1
- package/dist/esm/components/modal/CModalTitle.js.map +1 -1
- package/dist/esm/components/multi-select/CMultiSelect.d.ts +6 -0
- package/dist/esm/components/multi-select/CMultiSelect.js +22 -5
- package/dist/esm/components/multi-select/CMultiSelect.js.map +1 -1
- package/dist/esm/components/multi-select/CMultiSelectNativeSelect.js.map +1 -1
- package/dist/esm/components/multi-select/CMultiSelectOptions.js.map +1 -1
- package/dist/esm/components/multi-select/CMultiSelectSelection.js.map +1 -1
- package/dist/esm/components/nav/CNav.js.map +1 -1
- package/dist/esm/components/nav/CNavGroup.js +2 -2
- package/dist/esm/components/nav/CNavGroup.js.map +1 -1
- package/dist/esm/components/nav/CNavGroupItems.js.map +1 -1
- package/dist/esm/components/nav/CNavItem.js.map +1 -1
- package/dist/esm/components/nav/CNavLink.js +2 -2
- package/dist/esm/components/nav/CNavLink.js.map +1 -1
- package/dist/esm/components/nav/CNavTitle.js.map +1 -1
- package/dist/esm/components/navbar/CNavbar.js.map +1 -1
- package/dist/esm/components/navbar/CNavbarBrand.js.map +1 -1
- package/dist/esm/components/navbar/CNavbarNav.js.map +1 -1
- package/dist/esm/components/navbar/CNavbarToggler.js.map +1 -1
- package/dist/esm/components/offcanvas/COffcanvas.js.map +1 -1
- package/dist/esm/components/offcanvas/COffcanvasTitle.js.map +1 -1
- package/dist/esm/components/pagination/CPaginationItem.js.map +1 -1
- package/dist/esm/components/password-input/CPasswordInput.d.ts +43 -0
- package/dist/esm/components/password-input/CPasswordInput.js +35 -0
- package/dist/esm/components/password-input/CPasswordInput.js.map +1 -0
- package/dist/esm/components/password-input/index.d.ts +2 -0
- package/dist/esm/components/picker/CPicker.js.map +1 -1
- package/dist/esm/components/placeholder/CPlaceholder.js.map +1 -1
- package/dist/esm/components/popover/CPopover.js +1 -1
- package/dist/esm/components/popover/CPopover.js.map +1 -1
- package/dist/esm/components/progress/CProgress.js +1 -1
- package/dist/esm/components/progress/CProgressBar.d.ts +1 -1
- package/dist/esm/components/progress/CProgressBar.js +2 -2
- package/dist/esm/components/progress/CProgressBar.js.map +1 -1
- package/dist/esm/components/progress/CProgressStacked.d.ts +0 -4
- package/dist/esm/components/progress/CProgressStacked.js +3 -3
- package/dist/esm/components/progress/CProgressStacked.js.map +1 -1
- package/dist/esm/components/progress/CProgressStackedContext.d.ts +4 -0
- package/dist/esm/components/progress/CProgressStackedContext.js +6 -0
- package/dist/esm/components/progress/CProgressStackedContext.js.map +1 -0
- package/dist/esm/components/range-slider/CRangeSlider.js.map +1 -1
- package/dist/esm/components/rating/CRating.js.map +1 -1
- package/dist/esm/components/sidebar/CSidebar.js.map +1 -1
- package/dist/esm/components/sidebar/CSidebarBrand.js.map +1 -1
- package/dist/esm/components/sidebar/CSidebarNav.d.ts +1 -7
- package/dist/esm/components/sidebar/CSidebarNav.js +17 -15
- package/dist/esm/components/sidebar/CSidebarNav.js.map +1 -1
- package/dist/esm/components/sidebar/CSidebarNavContext.d.ts +5 -0
- package/dist/esm/components/sidebar/CSidebarNavContext.js +6 -0
- package/dist/esm/components/sidebar/CSidebarNavContext.js.map +1 -0
- package/dist/esm/components/smart-pagination/CSmartPagination.js.map +1 -1
- package/dist/esm/components/smart-table/CSmartTable.js.map +1 -1
- package/dist/esm/components/smart-table/CSmartTableBody.js.map +1 -1
- package/dist/esm/components/smart-table/CSmartTableHead.js.map +1 -1
- package/dist/esm/components/smart-table/utils.js +1 -1
- package/dist/esm/components/smart-table/utils.js.map +1 -1
- package/dist/esm/components/spinner/CSpinner.js.map +1 -1
- package/dist/esm/components/stepper/CStepper.d.ts +84 -0
- package/dist/esm/components/stepper/CStepper.js +199 -0
- package/dist/esm/components/stepper/CStepper.js.map +1 -0
- package/dist/esm/components/stepper/index.d.ts +2 -0
- package/dist/esm/components/stepper/types.d.ts +17 -0
- package/dist/esm/components/tabs/CTab.js +2 -2
- package/dist/esm/components/tabs/CTab.js.map +1 -1
- package/dist/esm/components/tabs/CTabList.js.map +1 -1
- package/dist/esm/components/tabs/CTabPane.js +1 -1
- package/dist/esm/components/tabs/CTabPane.js.map +1 -1
- package/dist/esm/components/tabs/CTabPanel.js +3 -3
- package/dist/esm/components/tabs/CTabPanel.js.map +1 -1
- package/dist/esm/components/tabs/CTabs.d.ts +29 -9
- package/dist/esm/components/tabs/CTabs.js +16 -10
- package/dist/esm/components/tabs/CTabs.js.map +1 -1
- package/dist/esm/components/tabs/CTabsContext.d.ts +6 -0
- package/dist/esm/components/tabs/CTabsContext.js +6 -0
- package/dist/esm/components/tabs/CTabsContext.js.map +1 -0
- package/dist/esm/components/time-picker/CTimePicker.js +14 -8
- package/dist/esm/components/time-picker/CTimePicker.js.map +1 -1
- package/dist/esm/components/time-picker/CTimePickerRollCol.js.map +1 -1
- package/dist/esm/components/time-picker/utils.d.ts +10 -0
- package/dist/esm/components/time-picker/utils.js +25 -10
- package/dist/esm/components/time-picker/utils.js.map +1 -1
- package/dist/esm/components/toast/CToast.d.ts +0 -6
- package/dist/esm/components/toast/CToast.js +6 -9
- package/dist/esm/components/toast/CToast.js.map +1 -1
- package/dist/esm/components/toast/CToastClose.js +1 -1
- package/dist/esm/components/toast/CToastClose.js.map +1 -1
- package/dist/esm/components/toast/CToastContext.d.ts +5 -0
- package/dist/esm/components/toast/CToastContext.js +6 -0
- package/dist/esm/components/toast/CToastContext.js.map +1 -0
- package/dist/esm/components/toast/CToaster.d.ts +2 -1
- package/dist/esm/components/toast/CToaster.js +4 -2
- package/dist/esm/components/toast/CToaster.js.map +1 -1
- package/dist/esm/components/tooltip/CTooltip.js +1 -1
- package/dist/esm/components/tooltip/CTooltip.js.map +1 -1
- package/dist/esm/components/widgets/CWidgetStatsF.js.map +1 -1
- package/dist/esm/hooks/useClipboard.js.map +1 -1
- package/dist/esm/hooks/useColorModes.js.map +1 -1
- package/dist/esm/hooks/useDebouncedCallback.js.map +1 -1
- package/dist/esm/hooks/useDropdownWithPopper.d.ts +2 -2
- package/dist/esm/hooks/usePopper.js +2 -2
- package/dist/esm/hooks/usePopper.js.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/node_modules/@coreui/icons-react/dist/index.esm.js.map +1 -1
- package/dist/esm/node_modules/dom-helpers/esm/hasClass.js.map +1 -1
- package/dist/esm/node_modules/react-device-detect/dist/lib.js +1 -1
- package/dist/esm/node_modules/react-device-detect/dist/lib.js.map +1 -1
- package/dist/esm/node_modules/react-transition-group/esm/Transition.js.map +1 -1
- package/dist/esm/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/esm/node_modules/ua-parser-js/dist/ua-parser.min.js.map +1 -1
- package/dist/esm/utils/executeAfterTransition.js.map +1 -1
- package/dist/esm/utils/getNextActiveElement.js.map +1 -1
- package/dist/esm/utils/index.d.ts +1 -2
- package/dist/esm/utils/isObjectInArray.js.map +1 -1
- package/package.json +11 -11
- package/src/components/accordion/CAccordion.tsx +4 -10
- package/src/components/accordion/CAccordionBody.tsx +1 -2
- package/src/components/accordion/CAccordionButton.tsx +2 -2
- package/src/components/accordion/CAccordionContext.ts +9 -0
- package/src/components/accordion/CAccordionItem.tsx +4 -11
- package/src/components/accordion/CAccordionItemContext.ts +9 -0
- package/src/components/accordion/__tests__/CAccordion.spec.tsx +1 -1
- package/src/components/accordion/__tests__/CAccordionBody.spec.tsx +1 -1
- package/src/components/accordion/__tests__/CAccordionButton.spec.tsx +1 -1
- package/src/components/accordion/__tests__/CAccordionCollapse.spec.tsx +1 -1
- package/src/components/accordion/__tests__/CAccordionHeader.spec.tsx +1 -1
- package/src/components/accordion/__tests__/CAccordionItem.spec.tsx +1 -1
- package/src/components/alert/__tests__/CAlert.spec.tsx +39 -18
- package/src/components/alert/__tests__/CAlertHeading.spec.tsx +1 -1
- package/src/components/alert/__tests__/CAlertLink.spec.tsx +1 -1
- package/src/components/avatar/__tests__/CAvatar.spec.tsx +1 -1
- package/src/components/backdrop/__tests__/CBackdrop.spec.tsx +1 -1
- package/src/components/badge/__tests__/CBadge.spec.tsx +1 -1
- package/src/components/breadcrumb/__tests__/CBreadcrumb.spec.tsx +1 -1
- package/src/components/breadcrumb/__tests__/CBreadcrumbItem.spec.tsx +1 -1
- package/src/components/button/__tests__/CButton.spec.tsx +1 -1
- package/src/components/button-group/__tests__/CButtonGroup.spec.tsx +2 -1
- package/src/components/button-group/__tests__/CButtonToolbar.spec.tsx +2 -1
- package/src/components/calendar/CCalendar.tsx +74 -56
- package/src/components/calendar/CCalendarNavigation.tsx +2 -2
- package/src/components/calendar/CCalendarPanel.tsx +4 -4
- package/src/components/calendar/utils.ts +33 -10
- package/src/components/callout/__tests__/CCallout.spec.tsx +1 -1
- package/src/components/card/__tests__/CCard.spec.tsx +1 -1
- package/src/components/card/__tests__/CCardBody.spec.tsx +1 -1
- package/src/components/card/__tests__/CCardFooter.spec.tsx +1 -1
- package/src/components/card/__tests__/CCardGroup.spec.tsx +1 -1
- package/src/components/card/__tests__/CCardHeader.spec.tsx +1 -1
- package/src/components/card/__tests__/CCardImage.spec.tsx +1 -1
- package/src/components/card/__tests__/CCardImageOverlay.spec.tsx +1 -1
- package/src/components/card/__tests__/CCardLink.spec.tsx +1 -1
- package/src/components/card/__tests__/CCardSubtitle.spec.tsx +1 -1
- package/src/components/card/__tests__/CCardText.spec.tsx +1 -1
- package/src/components/card/__tests__/CCardTitle.spec.tsx +1 -1
- package/src/components/carousel/CCarousel.tsx +6 -12
- package/src/components/carousel/CCarouselCaption.tsx +1 -1
- package/src/components/carousel/CCarouselContext.ts +8 -0
- package/src/components/carousel/CCarouselItem.tsx +6 -4
- package/src/components/carousel/__tests__/CCarousel.spec.tsx +1 -1
- package/src/components/close-button/__tests__/CCloseButton.spec.tsx +1 -1
- package/src/components/collapse/__tests__/CCollapse.spec.tsx +26 -7
- package/src/components/date-picker/CDatePicker.tsx +1 -1
- package/src/components/date-range-picker/CDateRangePicker.tsx +37 -21
- package/src/components/dropdown/CDropdown.tsx +35 -36
- package/src/components/dropdown/CDropdownContext.ts +18 -0
- package/src/components/dropdown/CDropdownDivider.tsx +1 -1
- package/src/components/dropdown/CDropdownHeader.tsx +1 -1
- package/src/components/dropdown/CDropdownItemPlain.tsx +1 -1
- package/src/components/dropdown/CDropdownMenu.tsx +3 -3
- package/src/components/dropdown/CDropdownToggle.tsx +2 -3
- package/src/components/dropdown/__tests__/CDropdown.spec.tsx +1 -1
- package/src/components/dropdown/__tests__/CDropdownDivider.spec.tsx +1 -1
- package/src/components/dropdown/__tests__/CDropdownHeader.spec.tsx +1 -1
- package/src/components/dropdown/__tests__/CDropdownItem.spec.tsx +1 -1
- package/src/components/dropdown/__tests__/CDropdownItemPlain.spec.tsx +1 -1
- package/src/components/dropdown/__tests__/CDropdownMenu.spec.tsx +1 -1
- package/src/components/dropdown/__tests__/CDropdownToggle.spec.tsx +1 -1
- package/src/components/dropdown/__tests__/__snapshots__/CDropdown.spec.tsx.snap +0 -1
- package/src/components/dropdown/__tests__/__snapshots__/CDropdownMenu.spec.tsx.snap +0 -2
- package/src/components/footer/__tests__/CFooter.spec.tsx +1 -1
- package/src/components/form/__tests__/CForm.spec.tsx +2 -1
- package/src/components/form/__tests__/CFormCheck.spec.tsx +1 -1
- package/src/components/form/__tests__/CFormControl.spec.tsx +1 -1
- package/src/components/form/__tests__/CFormFeedback.spec.tsx +1 -1
- package/src/components/form/__tests__/CFormFloating.spec.tsx +1 -1
- package/src/components/form/__tests__/CFormInput.spec.tsx +1 -1
- package/src/components/form/__tests__/CFormLabel.spec.tsx +1 -1
- package/src/components/form/__tests__/CFormRange.spec.tsx +1 -1
- package/src/components/form/__tests__/CFormSelect.spec.tsx +1 -1
- package/src/components/form/__tests__/CFormSwitch.spec.tsx +1 -1
- package/src/components/form/__tests__/CFormText.spec.tsx +1 -1
- package/src/components/form/__tests__/CFormTextarea.spec.tsx +1 -1
- package/src/components/form/__tests__/CInputGroup.spec.tsx +1 -1
- package/src/components/form/__tests__/CInputGroupText.spec.tsx +1 -1
- package/src/components/grid/__tests__/CCol.spec.tsx +1 -1
- package/src/components/grid/__tests__/CContainer.spec.tsx +1 -1
- package/src/components/grid/__tests__/CRow.spec.tsx +1 -1
- package/src/components/header/__tests__/CHeader.spec.tsx +1 -1
- package/src/components/header/__tests__/CHeaderBrand.spec.tsx +1 -1
- package/src/components/header/__tests__/CHeaderDivider.spec.tsx +1 -1
- package/src/components/header/__tests__/CHeaderNav.spec.tsx +1 -1
- package/src/components/header/__tests__/CHeaderText.spec.tsx +1 -1
- package/src/components/header/__tests__/CHeaderToggler.spec.tsx +1 -1
- package/src/components/image/__tests__/CImage.spec.tsx +1 -1
- package/src/components/index.ts +2 -0
- package/src/components/link/__tests__/CLink.spec.tsx +1 -1
- package/src/components/list-group/__tests__/CListGroup.spec.tsx +1 -1
- package/src/components/list-group/__tests__/CListGroupItem.spec.tsx +1 -1
- package/src/components/loading-button/__tests__/CLoadingButton.spec.tsx +1 -1
- package/src/components/modal/CModal.tsx +5 -12
- package/src/components/modal/CModalContext.ts +8 -0
- package/src/components/modal/CModalHeader.tsx +1 -1
- package/src/components/modal/__tests__/CModal.spec.tsx +1 -1
- package/src/components/modal/__tests__/CModalBody.spec.tsx +1 -1
- package/src/components/modal/__tests__/CModalContent.spec.tsx +1 -1
- package/src/components/modal/__tests__/CModalDialog.spec.tsx +1 -1
- package/src/components/modal/__tests__/CModalFooter.spec.tsx +1 -1
- package/src/components/modal/__tests__/CModalHeader.spec.tsx +1 -1
- package/src/components/modal/__tests__/CModalTitle.spec.tsx +1 -1
- package/src/components/multi-select/CMultiSelect.tsx +49 -14
- package/src/components/multi-select/__tests__/CMultiSelect.spec.tsx +1 -1
- package/src/components/nav/CNavGroup.tsx +2 -2
- package/src/components/nav/CNavLink.tsx +2 -2
- package/src/components/nav/__tests__/CNav.spec.tsx +4 -11
- package/src/components/nav/__tests__/CNavGroup.spec.tsx +1 -1
- package/src/components/nav/__tests__/CNavGroupItems.spec.tsx +1 -1
- package/src/components/nav/__tests__/CNavItem.spec.tsx +1 -1
- package/src/components/nav/__tests__/CNavLink.spec.tsx +1 -1
- package/src/components/nav/__tests__/CNavTitle.spec.tsx +1 -1
- package/src/components/nav/__tests__/__snapshots__/CNav.spec.tsx.snap +0 -1
- package/src/components/navbar/__tests__/CNavbar.spec.tsx +1 -1
- package/src/components/navbar/__tests__/CNavbarBrand.spec.tsx +1 -1
- package/src/components/navbar/__tests__/CNavbarNav.spec.tsx +1 -1
- package/src/components/navbar/__tests__/CNavbarText.spec.tsx +1 -1
- package/src/components/navbar/__tests__/CNavbarToggler.spec.tsx +1 -1
- package/src/components/offcanvas/__tests__/COffcanvas.spec.tsx +44 -17
- package/src/components/offcanvas/__tests__/COffcanvasBody.spec.tsx +1 -1
- package/src/components/offcanvas/__tests__/COffcanvasHeader.spec.tsx +1 -1
- package/src/components/offcanvas/__tests__/COffcanvasTitle.spec.tsx +1 -1
- package/src/components/pagination/__tests__/CPagination.spec.tsx +1 -1
- package/src/components/pagination/__tests__/CPaginationItem.spec.tsx +1 -1
- package/src/components/password-input/CPasswordInput.tsx +172 -0
- package/src/components/password-input/index.ts +3 -0
- package/src/components/placeholder/__tests__/CPlaceholder.spec.tsx +1 -1
- package/src/components/popover/__tests__/CPopover.spec.tsx +70 -62
- package/src/components/popover/__tests__/__snapshots__/CPopover.spec.tsx.snap +0 -32
- package/src/components/progress/CProgress.tsx +1 -1
- package/src/components/progress/CProgressBar.tsx +4 -3
- package/src/components/progress/CProgressStacked.tsx +4 -8
- package/src/components/progress/CProgressStackedContext.ts +7 -0
- package/src/components/progress/__tests__/CProgress.spec.tsx +1 -1
- package/src/components/progress/__tests__/CProgressBar.spec.tsx +1 -1
- package/src/components/sidebar/CSidebarNav.tsx +27 -27
- package/src/components/sidebar/CSidebarNavContext.ts +8 -0
- package/src/components/sidebar/__tests__/CSidebar.spec.tsx +1 -1
- package/src/components/sidebar/__tests__/CSidebarBrand.spec.tsx +1 -1
- package/src/components/sidebar/__tests__/CSidebarFooter.spec.tsx +1 -1
- package/src/components/sidebar/__tests__/CSidebarHeader.spec.tsx +1 -1
- package/src/components/sidebar/__tests__/CSidebarNav.spec.tsx +1 -1
- package/src/components/sidebar/__tests__/CSidebarToggler.spec.tsx +1 -1
- package/src/components/smart-table/__tests__/CSmartTable.spec.tsx +1 -1
- package/src/components/spinner/__tests__/CSpinner.spec.tsx +1 -1
- package/src/components/stepper/CStepper.tsx +432 -0
- package/src/components/stepper/__tests__/CStepper.spec.tsx +98 -0
- package/src/components/stepper/index.ts +3 -0
- package/src/components/stepper/types.ts +20 -0
- package/src/components/table/__tests__/CTable.spec.tsx +1 -1
- package/src/components/table/__tests__/CTableBody.spec.tsx +1 -1
- package/src/components/table/__tests__/CTableCaption.spec.tsx +1 -1
- package/src/components/table/__tests__/CTableDataCell.spec.tsx +1 -1
- package/src/components/table/__tests__/CTableFoot.spec.tsx +1 -1
- package/src/components/table/__tests__/CTableHead.spec.tsx +1 -1
- package/src/components/table/__tests__/CTableHeaderCell.spec.tsx +1 -1
- package/src/components/table/__tests__/CTableRow.spec.tsx +1 -1
- package/src/components/tabs/CTab.tsx +2 -2
- package/src/components/tabs/CTabPane.tsx +1 -1
- package/src/components/tabs/CTabPanel.tsx +3 -3
- package/src/components/tabs/CTabs.tsx +54 -21
- package/src/components/tabs/CTabsContext.ts +9 -0
- package/src/components/tabs/__tests__/CTabContent.spec.tsx +16 -8
- package/src/components/tabs/__tests__/CTabPane.spec.tsx +48 -29
- package/src/components/time-picker/CTimePicker.tsx +19 -12
- package/src/components/time-picker/utils.ts +30 -14
- package/src/components/toast/CToast.tsx +9 -24
- package/src/components/toast/CToastClose.tsx +1 -2
- package/src/components/toast/CToastContext.ts +8 -0
- package/src/components/toast/CToaster.tsx +11 -7
- package/src/components/toast/__tests__/CToast.spec.tsx +32 -27
- package/src/components/toast/__tests__/CToastBody.spec.tsx +1 -1
- package/src/components/toast/__tests__/CToastHeader.spec.tsx +1 -1
- package/src/components/toast/__tests__/CToaster.spec.tsx +2 -1
- package/src/components/tooltip/__tests__/CTooltip.spec.tsx +54 -33
- package/src/components/tooltip/__tests__/__snapshots__/CTooltip.spec.tsx.snap +0 -10
- package/src/components/widgets/__tests__/CWidgetStatsA.spec.tsx +1 -1
- package/src/components/widgets/__tests__/CWidgetStatsB.spec.tsx +1 -1
- package/src/components/widgets/__tests__/CWidgetStatsC.spec.tsx +1 -1
- package/src/components/widgets/__tests__/CWidgetStatsD.spec.tsx +1 -1
- package/src/components/widgets/__tests__/CWidgetStatsE.spec.tsx +1 -1
- package/src/components/widgets/__tests__/CWidgetStatsF.spec.tsx +1 -1
- package/src/hooks/usePopper.ts +2 -2
- package/src/utils/index.ts +0 -2
- package/dist/cjs/utils/isEqual.d.ts +0 -2
- package/dist/esm/utils/isEqual.d.ts +0 -2
- package/src/components/button/__tests__/CButtonClose.spec.tsx +0 -23
- package/src/utils/isEqual.ts +0 -58
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, {
|
|
2
|
-
createContext,
|
|
3
2
|
forwardRef,
|
|
4
3
|
HTMLAttributes,
|
|
5
4
|
useEffect,
|
|
@@ -14,6 +13,7 @@ import { Transition } from 'react-transition-group'
|
|
|
14
13
|
import { CBackdrop } from '../backdrop'
|
|
15
14
|
import { CConditionalPortal } from '../conditional-portal'
|
|
16
15
|
import { CModalContent } from './CModalContent'
|
|
16
|
+
import { CModalContext } from './CModalContext'
|
|
17
17
|
import { CModalDialog } from './CModalDialog'
|
|
18
18
|
|
|
19
19
|
import { useForkedRef } from '../../hooks'
|
|
@@ -93,13 +93,6 @@ export interface CModalProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
93
93
|
visible?: boolean
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
interface ModalContextProps {
|
|
97
|
-
visible?: boolean
|
|
98
|
-
setVisible: React.Dispatch<React.SetStateAction<boolean | undefined>>
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export const CModalContext = createContext({} as ModalContextProps)
|
|
102
|
-
|
|
103
96
|
export const CModal = forwardRef<HTMLDivElement, CModalProps>(
|
|
104
97
|
(
|
|
105
98
|
{
|
|
@@ -123,7 +116,7 @@ export const CModal = forwardRef<HTMLDivElement, CModalProps>(
|
|
|
123
116
|
visible,
|
|
124
117
|
...rest
|
|
125
118
|
},
|
|
126
|
-
ref
|
|
119
|
+
ref
|
|
127
120
|
) => {
|
|
128
121
|
const activeElementRef = useRef<HTMLElement | null>(null)
|
|
129
122
|
const modalRef = useRef<HTMLDivElement>(null)
|
|
@@ -184,7 +177,7 @@ export const CModal = forwardRef<HTMLDivElement, CModalProps>(
|
|
|
184
177
|
() => {
|
|
185
178
|
focus && modalRef.current?.focus()
|
|
186
179
|
},
|
|
187
|
-
transition ? duration : 0
|
|
180
|
+
transition ? duration : 0
|
|
188
181
|
)
|
|
189
182
|
} else {
|
|
190
183
|
document.body.classList.remove('modal-open')
|
|
@@ -238,7 +231,7 @@ export const CModal = forwardRef<HTMLDivElement, CModalProps>(
|
|
|
238
231
|
fade: transition,
|
|
239
232
|
show: state === 'entered',
|
|
240
233
|
},
|
|
241
|
-
className
|
|
234
|
+
className
|
|
242
235
|
)}
|
|
243
236
|
tabIndex={-1}
|
|
244
237
|
{...(_visible
|
|
@@ -270,7 +263,7 @@ export const CModal = forwardRef<HTMLDivElement, CModalProps>(
|
|
|
270
263
|
)}
|
|
271
264
|
</>
|
|
272
265
|
)
|
|
273
|
-
}
|
|
266
|
+
}
|
|
274
267
|
)
|
|
275
268
|
|
|
276
269
|
CModal.propTypes = {
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
|
|
|
3
3
|
import classNames from 'classnames'
|
|
4
4
|
|
|
5
5
|
import { CCloseButton } from '../close-button/CCloseButton'
|
|
6
|
-
import { CModalContext } from './
|
|
6
|
+
import { CModalContext } from './CModalContext'
|
|
7
7
|
|
|
8
8
|
export interface CModalHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
9
9
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render, fireEvent, screen, waitFor } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { CModal } from '
|
|
4
|
+
import { CModal } from '../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays CModal component', async () => {
|
|
7
7
|
const { container } = render(<CModal portal={false}>Test</CModal>)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { CModalBody } from '
|
|
4
|
+
import { CModalBody } from '../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays CModalBody component', async () => {
|
|
7
7
|
const { container } = render(<CModalBody>Test</CModalBody>)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { CModalContent } from '
|
|
4
|
+
import { CModalContent } from '../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays CModalContent component', async () => {
|
|
7
7
|
const { container } = render(<CModalContent>Test</CModalContent>)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { CModalDialog } from '
|
|
4
|
+
import { CModalDialog } from '../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays CModalDialog component', async () => {
|
|
7
7
|
const { container } = render(<CModalDialog>Test</CModalDialog>)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { CModalFooter } from '
|
|
4
|
+
import { CModalFooter } from '../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays CModalFooter component', async () => {
|
|
7
7
|
const { container } = render(<CModalFooter>Test</CModalFooter>)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { CModalHeader } from '
|
|
4
|
+
import { CModalHeader } from '../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays CModalHeader component', async () => {
|
|
7
7
|
const { container } = render(<CModalHeader>Test</CModalHeader>)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { CModalTitle } from '
|
|
4
|
+
import { CModalTitle } from '../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays CModalTitle component', async () => {
|
|
7
7
|
const { container } = render(<CModalTitle>Test</CModalTitle>)
|
|
@@ -188,6 +188,12 @@ export interface CMultiSelectProps
|
|
|
188
188
|
* Size the component small or large.
|
|
189
189
|
*/
|
|
190
190
|
size?: 'sm' | 'lg'
|
|
191
|
+
/**
|
|
192
|
+
* Sets the initially selected values for the multi-select component.
|
|
193
|
+
*
|
|
194
|
+
* @since 5.13.0
|
|
195
|
+
*/
|
|
196
|
+
value?: string | number | (string | number)[]
|
|
191
197
|
/**
|
|
192
198
|
* Enable virtual scroller for the options list.
|
|
193
199
|
*
|
|
@@ -248,12 +254,13 @@ export const CMultiSelect = forwardRef<HTMLDivElement, CMultiSelectProps>(
|
|
|
248
254
|
text,
|
|
249
255
|
tooltipFeedback,
|
|
250
256
|
valid,
|
|
257
|
+
value,
|
|
251
258
|
virtualScroller,
|
|
252
259
|
visible = false,
|
|
253
260
|
visibleItems = 10,
|
|
254
261
|
...rest
|
|
255
262
|
},
|
|
256
|
-
ref
|
|
263
|
+
ref
|
|
257
264
|
) => {
|
|
258
265
|
const {
|
|
259
266
|
dropdownMenuElement,
|
|
@@ -278,18 +285,38 @@ export const CMultiSelect = forwardRef<HTMLDivElement, CMultiSelectProps>(
|
|
|
278
285
|
isExternalSearch(search)
|
|
279
286
|
? [...options, ...filterOptionsList(searchValue, userOptions)]
|
|
280
287
|
: filterOptionsList(searchValue, [...options, ...userOptions]),
|
|
281
|
-
true
|
|
288
|
+
true
|
|
282
289
|
),
|
|
283
|
-
[options, searchValue, userOptions]
|
|
290
|
+
[options, searchValue, userOptions]
|
|
284
291
|
)
|
|
285
292
|
|
|
286
|
-
const flattenedOptions = useMemo(
|
|
293
|
+
const flattenedOptions = useMemo(
|
|
294
|
+
() =>
|
|
295
|
+
flattenOptionsArray(options).map((option) => {
|
|
296
|
+
if (value && Array.isArray(value)) {
|
|
297
|
+
return {
|
|
298
|
+
...option,
|
|
299
|
+
selected: value.includes(option.value),
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
if (value === option.value) {
|
|
304
|
+
return {
|
|
305
|
+
...option,
|
|
306
|
+
selected: true,
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
return option
|
|
311
|
+
}),
|
|
312
|
+
[options, value]
|
|
313
|
+
)
|
|
287
314
|
|
|
288
315
|
const userOption = useMemo(() => {
|
|
289
316
|
if (
|
|
290
317
|
allowCreateOptions &&
|
|
291
318
|
filteredOptions.some(
|
|
292
|
-
(option) => option.label && option.label.toLowerCase() === searchValue.toLowerCase()
|
|
319
|
+
(option) => option.label && option.label.toLowerCase() === searchValue.toLowerCase()
|
|
293
320
|
)
|
|
294
321
|
) {
|
|
295
322
|
return false
|
|
@@ -305,7 +332,7 @@ export const CMultiSelect = forwardRef<HTMLDivElement, CMultiSelectProps>(
|
|
|
305
332
|
|
|
306
333
|
const _selected = flattenedOptions.filter((option: Option) => option.selected === true)
|
|
307
334
|
const deselected = flattenedOptions.filter(
|
|
308
|
-
(option: Option) => option.selected === false
|
|
335
|
+
(option: Option) => option.selected === false
|
|
309
336
|
) as Option[]
|
|
310
337
|
|
|
311
338
|
if (_selected.length > 0) {
|
|
@@ -314,7 +341,9 @@ export const CMultiSelect = forwardRef<HTMLDivElement, CMultiSelectProps>(
|
|
|
314
341
|
}, [flattenedOptions])
|
|
315
342
|
|
|
316
343
|
useEffect(() => {
|
|
317
|
-
!isInitialMount.current && onFilterChange
|
|
344
|
+
if (!isInitialMount.current && onFilterChange) {
|
|
345
|
+
onFilterChange(searchValue)
|
|
346
|
+
}
|
|
318
347
|
}, [searchValue])
|
|
319
348
|
|
|
320
349
|
useEffect(() => {
|
|
@@ -378,7 +407,7 @@ export const CMultiSelect = forwardRef<HTMLDivElement, CMultiSelectProps>(
|
|
|
378
407
|
items,
|
|
379
408
|
target,
|
|
380
409
|
event.key === 'ArrowDown',
|
|
381
|
-
!items.includes(target)
|
|
410
|
+
!items.includes(target)
|
|
382
411
|
).focus()
|
|
383
412
|
return
|
|
384
413
|
}
|
|
@@ -395,7 +424,7 @@ export const CMultiSelect = forwardRef<HTMLDivElement, CMultiSelectProps>(
|
|
|
395
424
|
setSelected([
|
|
396
425
|
...selected,
|
|
397
426
|
filteredOptions.find(
|
|
398
|
-
(option) => String(option.label).toLowerCase() === searchValue.toLowerCase()
|
|
427
|
+
(option) => String(option.label).toLowerCase() === searchValue.toLowerCase()
|
|
399
428
|
) as Option,
|
|
400
429
|
])
|
|
401
430
|
}
|
|
@@ -437,7 +466,7 @@ export const CMultiSelect = forwardRef<HTMLDivElement, CMultiSelectProps>(
|
|
|
437
466
|
items,
|
|
438
467
|
target,
|
|
439
468
|
event.key === 'ArrowDown',
|
|
440
|
-
!items.includes(target)
|
|
469
|
+
!items.includes(target)
|
|
441
470
|
).focus()
|
|
442
471
|
}
|
|
443
472
|
}
|
|
@@ -488,8 +517,8 @@ export const CMultiSelect = forwardRef<HTMLDivElement, CMultiSelectProps>(
|
|
|
488
517
|
selectOptions(
|
|
489
518
|
multiple,
|
|
490
519
|
[...flattenedOptions.filter((option: Option) => !option.disabled), ...userOptions],
|
|
491
|
-
selected
|
|
492
|
-
)
|
|
520
|
+
selected
|
|
521
|
+
)
|
|
493
522
|
)
|
|
494
523
|
}
|
|
495
524
|
|
|
@@ -534,7 +563,7 @@ export const CMultiSelect = forwardRef<HTMLDivElement, CMultiSelectProps>(
|
|
|
534
563
|
'is-valid': valid,
|
|
535
564
|
show: isOpen,
|
|
536
565
|
},
|
|
537
|
-
className
|
|
566
|
+
className
|
|
538
567
|
)}
|
|
539
568
|
onKeyDown={handleGlobalSearch}
|
|
540
569
|
aria-expanded={isOpen}
|
|
@@ -646,7 +675,7 @@ export const CMultiSelect = forwardRef<HTMLDivElement, CMultiSelectProps>(
|
|
|
646
675
|
</div>
|
|
647
676
|
</CFormControlWrapper>
|
|
648
677
|
)
|
|
649
|
-
}
|
|
678
|
+
}
|
|
650
679
|
)
|
|
651
680
|
|
|
652
681
|
CMultiSelect.propTypes = {
|
|
@@ -687,6 +716,12 @@ CMultiSelect.propTypes = {
|
|
|
687
716
|
selectionType: PropTypes.oneOf(['counter', 'tags', 'text']),
|
|
688
717
|
selectionTypeCounterText: PropTypes.string,
|
|
689
718
|
size: PropTypes.oneOf(['sm', 'lg']),
|
|
719
|
+
value: PropTypes.oneOfType([
|
|
720
|
+
PropTypes.number,
|
|
721
|
+
PropTypes.string,
|
|
722
|
+
PropTypes.arrayOf(PropTypes.number),
|
|
723
|
+
PropTypes.arrayOf(PropTypes.string),
|
|
724
|
+
]),
|
|
690
725
|
virtualScroller: PropTypes.bool,
|
|
691
726
|
visible: PropTypes.bool,
|
|
692
727
|
visibleItems: PropTypes.number,
|
|
@@ -16,7 +16,7 @@ import type { TransitionStatus } from 'react-transition-group'
|
|
|
16
16
|
|
|
17
17
|
import { PolymorphicRefForwardingComponent } from '../../helpers'
|
|
18
18
|
|
|
19
|
-
import {
|
|
19
|
+
import { CSidebarNavContext } from '../sidebar/CSidebarNavContext'
|
|
20
20
|
|
|
21
21
|
export interface CNavGroupProps extends HTMLAttributes<HTMLDivElement | HTMLLIElement> {
|
|
22
22
|
/**
|
|
@@ -62,7 +62,7 @@ export const CNavGroup: PolymorphicRefForwardingComponent<'li', CNavGroupProps>
|
|
|
62
62
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
63
63
|
const navItemsRef = useRef<any>(null)
|
|
64
64
|
|
|
65
|
-
const { visibleGroup, setVisibleGroup } = useContext(
|
|
65
|
+
const { visibleGroup, setVisibleGroup } = useContext(CSidebarNavContext)
|
|
66
66
|
|
|
67
67
|
const [_visible, setVisible] = useState(
|
|
68
68
|
Boolean(visible || (idx && visibleGroup && isInVisibleGroup(visibleGroup, idx))),
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
|
|
|
3
3
|
import classNames from 'classnames'
|
|
4
4
|
|
|
5
5
|
import { CLinkProps, CLink } from '../link/CLink'
|
|
6
|
-
import {
|
|
6
|
+
import { CSidebarNavContext } from '../sidebar/CSidebarNavContext'
|
|
7
7
|
|
|
8
8
|
import { PolymorphicRefForwardingComponent } from '../../helpers'
|
|
9
9
|
import { useForkedRef } from '../../hooks'
|
|
@@ -26,7 +26,7 @@ export const CNavLink: PolymorphicRefForwardingComponent<'a', CNavLinkProps> = f
|
|
|
26
26
|
const navLinkRef = useRef<HTMLAnchorElement>(null)
|
|
27
27
|
const forkedRef = useForkedRef(ref, navLinkRef)
|
|
28
28
|
|
|
29
|
-
const { setVisibleGroup } = useContext(
|
|
29
|
+
const { setVisibleGroup } = useContext(CSidebarNavContext)
|
|
30
30
|
|
|
31
31
|
useEffect(() => {
|
|
32
32
|
rest.active = navLinkRef.current?.classList.contains('active')
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
CNavItem,
|
|
7
|
-
CNavLink,
|
|
8
|
-
CDropdown,
|
|
9
|
-
CDropdownToggle,
|
|
10
|
-
CDropdownMenu,
|
|
11
|
-
CDropdownItem,
|
|
12
|
-
} from '../../../index'
|
|
4
|
+
import { CDropdown, CDropdownItem, CDropdownMenu, CDropdownToggle } from '../../dropdown'
|
|
5
|
+
import { CNav, CNavItem, CNavLink } from '../index'
|
|
13
6
|
|
|
14
7
|
test('loads and displays CNav component', async () => {
|
|
15
8
|
const { container } = render(<CNav>Test</CNav>)
|
|
@@ -20,7 +13,7 @@ test('CNav customize', async () => {
|
|
|
20
13
|
const { container } = render(
|
|
21
14
|
<CNav className="bazinga" as="h3" layout="justified" variant="pills">
|
|
22
15
|
Test
|
|
23
|
-
</CNav
|
|
16
|
+
</CNav>
|
|
24
17
|
)
|
|
25
18
|
expect(container).toMatchSnapshot()
|
|
26
19
|
expect(container.firstChild).toHaveClass('nav')
|
|
@@ -56,7 +49,7 @@ test('CNav example', async () => {
|
|
|
56
49
|
Disabled
|
|
57
50
|
</CNavLink>
|
|
58
51
|
</CNavItem>
|
|
59
|
-
</CNav
|
|
52
|
+
</CNav>
|
|
60
53
|
)
|
|
61
54
|
expect(container).toMatchSnapshot()
|
|
62
55
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { CNavGroup } from '
|
|
4
|
+
import { CNavGroup } from '../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays CNavGroup component', async () => {
|
|
7
7
|
const { container } = render(<CNavGroup toggler="anchorText" />)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { CNavGroupItems } from '
|
|
4
|
+
import { CNavGroupItems } from '../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays CNavGroupItems component', async () => {
|
|
7
7
|
const { container } = render(<CNavGroupItems>Test</CNavGroupItems>)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { CNavItem } from '
|
|
4
|
+
import { CNavItem } from '../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays CNavItem component', async () => {
|
|
7
7
|
const { container } = render(<CNavItem>Test</CNavItem>)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { CNavLink } from '
|
|
4
|
+
import { CNavLink } from '../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays CNavLink component', async () => {
|
|
7
7
|
const { container } = render(<CNavLink>Test</CNavLink>)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { CNavTitle } from '
|
|
4
|
+
import { CNavTitle } from '../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays CNavTitle component', async () => {
|
|
7
7
|
const { container } = render(<CNavTitle>Test</CNavTitle>)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { CNavbar } from '
|
|
4
|
+
import { CNavbar } from '../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays CNavbar component', async () => {
|
|
7
7
|
const { container } = render(<CNavbar>Test</CNavbar>)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { CNavbarBrand } from '
|
|
4
|
+
import { CNavbarBrand } from '../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays CNavbarBrand component', async () => {
|
|
7
7
|
const { container } = render(<CNavbarBrand>Test</CNavbarBrand>)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { CNavbarNav } from '
|
|
4
|
+
import { CNavbarNav } from '../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays CNavbarNav component', async () => {
|
|
7
7
|
const { container } = render(<CNavbarNav>Test</CNavbarNav>)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { CNavbarText } from '
|
|
4
|
+
import { CNavbarText } from '../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays CNavbarText component', async () => {
|
|
7
7
|
const { container } = render(<CNavbarText>Test</CNavbarText>)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { CNavbarToggler } from '
|
|
4
|
+
import { CNavbarToggler } from '../index'
|
|
5
5
|
|
|
6
6
|
test('CNavbarToggler witch children', async () => {
|
|
7
7
|
const { container } = render(<CNavbarToggler>Test</CNavbarToggler>)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
|
-
import { render, fireEvent } from '@testing-library/react'
|
|
2
|
+
import { render, fireEvent, act } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { COffcanvas } from '
|
|
4
|
+
import { COffcanvas } from '../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays COffcanvas component', async () => {
|
|
7
7
|
const { container } = render(<COffcanvas placement="top" />)
|
|
@@ -19,7 +19,7 @@ test('COffcanvas customize one', async () => {
|
|
|
19
19
|
visible={false}
|
|
20
20
|
>
|
|
21
21
|
Test
|
|
22
|
-
</COffcanvas
|
|
22
|
+
</COffcanvas>
|
|
23
23
|
)
|
|
24
24
|
expect(container).toMatchSnapshot()
|
|
25
25
|
expect(container.firstChild).toHaveClass('offcanvas')
|
|
@@ -29,7 +29,8 @@ test('COffcanvas customize one', async () => {
|
|
|
29
29
|
})
|
|
30
30
|
|
|
31
31
|
test('COffcanvas customize and event on click backdrop', async () => {
|
|
32
|
-
|
|
32
|
+
jest.useFakeTimers()
|
|
33
|
+
|
|
33
34
|
const onHide = jest.fn()
|
|
34
35
|
const { container } = render(
|
|
35
36
|
<COffcanvas
|
|
@@ -42,8 +43,9 @@ test('COffcanvas customize and event on click backdrop', async () => {
|
|
|
42
43
|
onHide={onHide}
|
|
43
44
|
>
|
|
44
45
|
Test
|
|
45
|
-
</COffcanvas
|
|
46
|
+
</COffcanvas>
|
|
46
47
|
)
|
|
48
|
+
|
|
47
49
|
expect(container).toMatchSnapshot()
|
|
48
50
|
expect(container.firstChild).toHaveClass('offcanvas')
|
|
49
51
|
expect(container.firstChild).toHaveClass('offcanvas-end')
|
|
@@ -51,18 +53,32 @@ test('COffcanvas customize and event on click backdrop', async () => {
|
|
|
51
53
|
expect(container.firstChild).toHaveClass('show')
|
|
52
54
|
expect(container.firstChild).toHaveTextContent('Test')
|
|
53
55
|
expect(onHide).toHaveBeenCalledTimes(0)
|
|
56
|
+
|
|
54
57
|
const backdrop = document.querySelector('.offcanvas-backdrop')
|
|
58
|
+
|
|
55
59
|
if (backdrop !== null) {
|
|
56
|
-
|
|
60
|
+
act(() => {
|
|
61
|
+
fireEvent.click(backdrop)
|
|
62
|
+
jest.runAllTimers()
|
|
63
|
+
})
|
|
57
64
|
}
|
|
65
|
+
|
|
58
66
|
expect(onHide).toHaveBeenCalledTimes(1)
|
|
59
67
|
expect(container.firstChild).toHaveClass('show')
|
|
60
68
|
expect(container.firstChild).toHaveClass('hiding')
|
|
61
|
-
|
|
69
|
+
|
|
70
|
+
act(() => {
|
|
71
|
+
jest.runAllTimers()
|
|
72
|
+
})
|
|
73
|
+
|
|
62
74
|
expect(container.firstChild).not.toHaveClass('show')
|
|
75
|
+
|
|
76
|
+
jest.useRealTimers()
|
|
63
77
|
})
|
|
64
78
|
|
|
65
79
|
test('COffcanvas customize and event on keypress', async () => {
|
|
80
|
+
jest.useFakeTimers()
|
|
81
|
+
|
|
66
82
|
const onHide = jest.fn()
|
|
67
83
|
const { container } = render(
|
|
68
84
|
<COffcanvas
|
|
@@ -75,28 +91,39 @@ test('COffcanvas customize and event on keypress', async () => {
|
|
|
75
91
|
onHide={onHide}
|
|
76
92
|
>
|
|
77
93
|
Test
|
|
78
|
-
</COffcanvas
|
|
94
|
+
</COffcanvas>
|
|
79
95
|
)
|
|
96
|
+
|
|
80
97
|
expect(container).toMatchSnapshot()
|
|
81
98
|
expect(container.firstChild).toHaveClass('offcanvas')
|
|
82
99
|
expect(container.firstChild).toHaveClass('offcanvas-end')
|
|
83
100
|
expect(container.firstChild).toHaveClass('bazinga')
|
|
84
101
|
expect(container.firstChild).toHaveClass('show')
|
|
85
102
|
expect(onHide).toHaveBeenCalledTimes(0)
|
|
103
|
+
|
|
86
104
|
const canvas = document.querySelector('.offcanvas')
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
105
|
+
|
|
106
|
+
if (canvas !== null) {
|
|
107
|
+
act(() => {
|
|
108
|
+
fireEvent.keyDown(canvas, {
|
|
109
|
+
key: 'Escape',
|
|
110
|
+
code: 'Escape',
|
|
111
|
+
keyCode: 27,
|
|
112
|
+
charCode: 27,
|
|
113
|
+
})
|
|
114
|
+
jest.runAllTimers()
|
|
95
115
|
})
|
|
96
116
|
}
|
|
117
|
+
|
|
97
118
|
expect(onHide).toHaveBeenCalledTimes(1)
|
|
98
119
|
expect(container.firstChild).toHaveClass('show')
|
|
99
120
|
expect(container.firstChild).toHaveClass('hiding')
|
|
100
|
-
|
|
121
|
+
|
|
122
|
+
act(() => {
|
|
123
|
+
jest.runAllTimers()
|
|
124
|
+
})
|
|
125
|
+
|
|
101
126
|
expect(container.firstChild).not.toHaveClass('show')
|
|
127
|
+
|
|
128
|
+
jest.useRealTimers()
|
|
102
129
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { COffcanvasBody } from '
|
|
4
|
+
import { COffcanvasBody } from '../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays COffcanvasBody component', async () => {
|
|
7
7
|
const { container } = render(<COffcanvasBody />)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { COffcanvasHeader } from '
|
|
4
|
+
import { COffcanvasHeader } from '../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays COffcanvasHeader component', async () => {
|
|
7
7
|
const { container } = render(<COffcanvasHeader />)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { render } from '@testing-library/react'
|
|
3
3
|
import '@testing-library/jest-dom'
|
|
4
|
-
import { COffcanvasTitle } from '
|
|
4
|
+
import { COffcanvasTitle } from '../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays COffcanvasTitle component', async () => {
|
|
7
7
|
const { container } = render(<COffcanvasTitle />)
|