@openedx/paragon 21.12.1 → 21.12.3
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/dist/ActionRow/index.js +7 -8
- package/dist/ActionRow/index.js.map +1 -1
- package/dist/Alert/index.js +33 -25
- package/dist/Alert/index.js.map +1 -1
- package/dist/Annotation/index.js +7 -9
- package/dist/Annotation/index.js.map +1 -1
- package/dist/Avatar/index.js +5 -7
- package/dist/Avatar/index.js.map +1 -1
- package/dist/AvatarButton/index.js +10 -12
- package/dist/AvatarButton/index.js.map +1 -1
- package/dist/Badge/index.js +6 -4
- package/dist/Badge/index.js.map +1 -1
- package/dist/Breadcrumb/BreadcrumbLink.js +11 -14
- package/dist/Breadcrumb/BreadcrumbLink.js.map +1 -1
- package/dist/Breadcrumb/index.js +29 -29
- package/dist/Breadcrumb/index.js.map +1 -1
- package/dist/Bubble/index.js +11 -13
- package/dist/Bubble/index.js.map +1 -1
- package/dist/Button/deprecated/index.js +87 -66
- package/dist/Button/deprecated/index.js.map +1 -1
- package/dist/Button/index.js +10 -11
- package/dist/Button/index.js.map +1 -1
- package/dist/Card/CardBody.js +4 -6
- package/dist/Card/CardBody.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarousel.js +11 -13
- package/dist/Card/CardCarousel/CardCarousel.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselControls.js +6 -7
- package/dist/Card/CardCarousel/CardCarouselControls.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselHeader.js +9 -12
- package/dist/Card/CardCarousel/CardCarouselHeader.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselItems.js +6 -9
- package/dist/Card/CardCarousel/CardCarouselItems.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselProvider.js +27 -28
- package/dist/Card/CardCarousel/CardCarouselProvider.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselSubtitle.js +4 -6
- package/dist/Card/CardCarousel/CardCarouselSubtitle.js.map +1 -1
- package/dist/Card/CardCarousel/CardCarouselTitle.js +4 -6
- package/dist/Card/CardCarousel/CardCarouselTitle.js.map +1 -1
- package/dist/Card/CardContext.js +8 -10
- package/dist/Card/CardContext.js.map +1 -1
- package/dist/Card/CardDeck.js +19 -17
- package/dist/Card/CardDeck.js.map +1 -1
- package/dist/Card/CardDivider.js +3 -5
- package/dist/Card/CardDivider.js.map +1 -1
- package/dist/Card/CardFooter.js +15 -18
- package/dist/Card/CardFooter.js.map +1 -1
- package/dist/Card/CardGrid.js +13 -11
- package/dist/Card/CardGrid.js.map +1 -1
- package/dist/Card/CardHeader.js +17 -22
- package/dist/Card/CardHeader.js.map +1 -1
- package/dist/Card/CardImageCap.js +48 -33
- package/dist/Card/CardImageCap.js.map +1 -1
- package/dist/Card/CardSection.js +11 -14
- package/dist/Card/CardSection.js.map +1 -1
- package/dist/Card/CardStatus.js +11 -14
- package/dist/Card/CardStatus.js.map +1 -1
- package/dist/Card/index.js +18 -20
- package/dist/Card/index.js.map +1 -1
- package/dist/Carousel/index.js +17 -11
- package/dist/Carousel/index.js.map +1 -1
- package/dist/CheckBox/index.js +66 -36
- package/dist/CheckBox/index.js.map +1 -1
- package/dist/Chip/index.js +14 -16
- package/dist/Chip/index.js.map +1 -1
- package/dist/ChipCarousel/index.js +29 -30
- package/dist/ChipCarousel/index.js.map +1 -1
- package/dist/Collapsible/CollapsibleAdvanced.js +82 -62
- package/dist/Collapsible/CollapsibleAdvanced.js.map +1 -1
- package/dist/Collapsible/CollapsibleBody.js +13 -15
- package/dist/Collapsible/CollapsibleBody.js.map +1 -1
- package/dist/Collapsible/CollapsibleTrigger.js +18 -20
- package/dist/Collapsible/CollapsibleTrigger.js.map +1 -1
- package/dist/Collapsible/CollapsibleVisible.js +6 -9
- package/dist/Collapsible/CollapsibleVisible.js.map +1 -1
- package/dist/Collapsible/index.js +17 -18
- package/dist/Collapsible/index.js.map +1 -1
- package/dist/ColorPicker/index.js +58 -33
- package/dist/ColorPicker/index.js.map +1 -1
- package/dist/Container/index.js +8 -9
- package/dist/Container/index.js.map +1 -1
- package/dist/DataTable/ActionDisplay.js +8 -9
- package/dist/DataTable/ActionDisplay.js.map +1 -1
- package/dist/DataTable/BulkActions.js +23 -20
- package/dist/DataTable/BulkActions.js.map +1 -1
- package/dist/DataTable/CardView.js +46 -43
- package/dist/DataTable/CardView.js.map +1 -1
- package/dist/DataTable/CollapsibleButtonGroup.js +57 -39
- package/dist/DataTable/CollapsibleButtonGroup.js.map +1 -1
- package/dist/DataTable/DataTableContext.js +1 -1
- package/dist/DataTable/DataTableContext.js.map +1 -1
- package/dist/DataTable/DataTableLayout.js +6 -9
- package/dist/DataTable/DataTableLayout.js.map +1 -1
- package/dist/DataTable/DataViewToggle.js +25 -20
- package/dist/DataTable/DataViewToggle.js.map +1 -1
- package/dist/DataTable/DropdownFilters.js +41 -28
- package/dist/DataTable/DropdownFilters.js.map +1 -1
- package/dist/DataTable/EmptyTable.js +6 -9
- package/dist/DataTable/EmptyTable.js.map +1 -1
- package/dist/DataTable/ExpandAll.js +2 -4
- package/dist/DataTable/ExpandAll.js.map +1 -1
- package/dist/DataTable/ExpandRow.js +2 -4
- package/dist/DataTable/ExpandRow.js.map +1 -1
- package/dist/DataTable/FilterStatus.js +18 -17
- package/dist/DataTable/FilterStatus.js.map +1 -1
- package/dist/DataTable/RowStatus.js +15 -18
- package/dist/DataTable/RowStatus.js.map +1 -1
- package/dist/DataTable/SidebarFilters.js +16 -13
- package/dist/DataTable/SidebarFilters.js.map +1 -1
- package/dist/DataTable/SmartStatus.js +14 -16
- package/dist/DataTable/SmartStatus.js.map +1 -1
- package/dist/DataTable/Table.js +17 -19
- package/dist/DataTable/Table.js.map +1 -1
- package/dist/DataTable/TableActions.js +11 -13
- package/dist/DataTable/TableActions.js.map +1 -1
- package/dist/DataTable/TableCell.js +6 -10
- package/dist/DataTable/TableCell.js.map +1 -1
- package/dist/DataTable/TableControlBar.js +7 -12
- package/dist/DataTable/TableControlBar.js.map +1 -1
- package/dist/DataTable/TableFilters.js +14 -12
- package/dist/DataTable/TableFilters.js.map +1 -1
- package/dist/DataTable/TableFooter.js +5 -8
- package/dist/DataTable/TableFooter.js.map +1 -1
- package/dist/DataTable/TableHeaderCell.js +11 -15
- package/dist/DataTable/TableHeaderCell.js.map +1 -1
- package/dist/DataTable/TableHeaderRow.js +6 -4
- package/dist/DataTable/TableHeaderRow.js.map +1 -1
- package/dist/DataTable/TablePagination.js +8 -7
- package/dist/DataTable/TablePagination.js.map +1 -1
- package/dist/DataTable/TablePaginationMinimal.js +9 -8
- package/dist/DataTable/TablePaginationMinimal.js.map +1 -1
- package/dist/DataTable/TableRow.js +15 -18
- package/dist/DataTable/TableRow.js.map +1 -1
- package/dist/DataTable/_variables.scss +1 -1
- package/dist/DataTable/filters/CheckboxFilter.js +23 -22
- package/dist/DataTable/filters/CheckboxFilter.js.map +1 -1
- package/dist/DataTable/filters/DropdownFilter.js +14 -19
- package/dist/DataTable/filters/DropdownFilter.js.map +1 -1
- package/dist/DataTable/filters/MultiSelectDropdownFilter.js +19 -20
- package/dist/DataTable/filters/MultiSelectDropdownFilter.js.map +1 -1
- package/dist/DataTable/filters/TextFilter.js +10 -13
- package/dist/DataTable/filters/TextFilter.js.map +1 -1
- package/dist/DataTable/hooks.js +29 -25
- package/dist/DataTable/hooks.js.map +1 -1
- package/dist/DataTable/index.js +120 -104
- package/dist/DataTable/index.js.map +1 -1
- package/dist/DataTable/selection/BaseSelectionStatus.js +29 -31
- package/dist/DataTable/selection/BaseSelectionStatus.js.map +1 -1
- package/dist/DataTable/selection/ControlledSelect.js +13 -9
- package/dist/DataTable/selection/ControlledSelect.js.map +1 -1
- package/dist/DataTable/selection/ControlledSelectHeader.js +19 -15
- package/dist/DataTable/selection/ControlledSelectHeader.js.map +1 -1
- package/dist/DataTable/selection/ControlledSelectionStatus.js +34 -24
- package/dist/DataTable/selection/ControlledSelectionStatus.js.map +1 -1
- package/dist/DataTable/selection/SelectionStatus.js +23 -23
- package/dist/DataTable/selection/SelectionStatus.js.map +1 -1
- package/dist/DataTable/utils/getVisibleColumns.js +36 -44
- package/dist/DataTable/utils/getVisibleColumns.js.map +1 -1
- package/dist/Dropdown/deprecated/DropdownButton.js +9 -13
- package/dist/Dropdown/deprecated/DropdownButton.js.map +1 -1
- package/dist/Dropdown/deprecated/DropdownItem.js +7 -8
- package/dist/Dropdown/deprecated/DropdownItem.js.map +1 -1
- package/dist/Dropdown/deprecated/DropdownMenu.js +8 -12
- package/dist/Dropdown/deprecated/DropdownMenu.js.map +1 -1
- package/dist/Dropdown/deprecated/index.js +136 -103
- package/dist/Dropdown/deprecated/index.js.map +1 -1
- package/dist/Dropdown/index.js +32 -29
- package/dist/Dropdown/index.js.map +1 -1
- package/dist/Dropzone/DefaultContent.js +13 -13
- package/dist/Dropzone/DefaultContent.js.map +1 -1
- package/dist/Dropzone/DragError.js +1 -3
- package/dist/Dropzone/DragError.js.map +1 -1
- package/dist/Dropzone/GenericError.js +7 -7
- package/dist/Dropzone/GenericError.js.map +1 -1
- package/dist/Dropzone/UploadProgress.js +6 -8
- package/dist/Dropzone/UploadProgress.js.map +1 -1
- package/dist/Dropzone/index.js +145 -86
- package/dist/Dropzone/index.js.map +1 -1
- package/dist/Fieldset/index.js +82 -57
- package/dist/Fieldset/index.js.map +1 -1
- package/dist/Form/FormAutosuggest.js +137 -95
- package/dist/Form/FormAutosuggest.js.map +1 -1
- package/dist/Form/FormAutosuggestOption.js +4 -6
- package/dist/Form/FormAutosuggestOption.js.map +1 -1
- package/dist/Form/FormCheckbox.js +35 -42
- package/dist/Form/FormCheckbox.js.map +1 -1
- package/dist/Form/FormCheckboxSet.js +13 -16
- package/dist/Form/FormCheckboxSet.js.map +1 -1
- package/dist/Form/FormCheckboxSetContext.js +39 -34
- package/dist/Form/FormCheckboxSetContext.js.map +1 -1
- package/dist/Form/FormControl.js +41 -35
- package/dist/Form/FormControl.js.map +1 -1
- package/dist/Form/FormControlDecorator.js +3 -5
- package/dist/Form/FormControlDecorator.js.map +1 -1
- package/dist/Form/FormControlDecoratorGroup.js +8 -10
- package/dist/Form/FormControlDecoratorGroup.js.map +1 -1
- package/dist/Form/FormControlFeedback.js +12 -15
- package/dist/Form/FormControlFeedback.js.map +1 -1
- package/dist/Form/FormControlFloatingLabel.js +3 -6
- package/dist/Form/FormControlFloatingLabel.js.map +1 -1
- package/dist/Form/FormControlSet.js +8 -9
- package/dist/Form/FormControlSet.js.map +1 -1
- package/dist/Form/FormGroup.js +11 -12
- package/dist/Form/FormGroup.js.map +1 -1
- package/dist/Form/FormGroupContext.js +64 -39
- package/dist/Form/FormGroupContext.js.map +1 -1
- package/dist/Form/FormLabel.js +15 -17
- package/dist/Form/FormLabel.js.map +1 -1
- package/dist/Form/FormRadio.js +19 -22
- package/dist/Form/FormRadio.js.map +1 -1
- package/dist/Form/FormRadioSet.js +13 -16
- package/dist/Form/FormRadioSet.js.map +1 -1
- package/dist/Form/FormRadioSetContext.js +39 -34
- package/dist/Form/FormRadioSetContext.js.map +1 -1
- package/dist/Form/FormSwitch.js +16 -20
- package/dist/Form/FormSwitch.js.map +1 -1
- package/dist/Form/FormText.js +20 -29
- package/dist/Form/FormText.js.map +1 -1
- package/dist/Form/useCheckboxSetValues.js +46 -23
- package/dist/Form/useCheckboxSetValues.js.map +1 -1
- package/dist/Hyperlink/index.js +25 -25
- package/dist/Hyperlink/index.js.map +1 -1
- package/dist/Hyperlink/index.scss +2 -2
- package/dist/Icon/index.js +21 -20
- package/dist/Icon/index.js.map +1 -1
- package/dist/IconButton/index.js +30 -32
- package/dist/IconButton/index.js.map +1 -1
- package/dist/IconButtonToggle/index.js +16 -16
- package/dist/IconButtonToggle/index.js.map +1 -1
- package/dist/Input/index.js +122 -92
- package/dist/Input/index.js.map +1 -1
- package/dist/InputSelect/index.js +78 -51
- package/dist/InputSelect/index.js.map +1 -1
- package/dist/InputText/index.js +11 -9
- package/dist/InputText/index.js.map +1 -1
- package/dist/Layout/index.js +33 -29
- package/dist/Layout/index.js.map +1 -1
- package/dist/ListBox/index.js +112 -80
- package/dist/ListBox/index.js.map +1 -1
- package/dist/ListBoxOption/index.js +68 -45
- package/dist/ListBoxOption/index.js.map +1 -1
- package/dist/MailtoLink/index.js +37 -34
- package/dist/MailtoLink/index.js.map +1 -1
- package/dist/Menu/MenuItem.js +13 -14
- package/dist/Menu/MenuItem.js.map +1 -1
- package/dist/Menu/SelectMenu.js +68 -44
- package/dist/Menu/SelectMenu.js.map +1 -1
- package/dist/Menu/index.js +10 -11
- package/dist/Menu/index.js.map +1 -1
- package/dist/Modal/AlertModal.js +5 -7
- package/dist/Modal/AlertModal.js.map +1 -1
- package/dist/Modal/FullscreenModal.js +6 -8
- package/dist/Modal/FullscreenModal.js.map +1 -1
- package/dist/Modal/MarketingModal.js +8 -10
- package/dist/Modal/MarketingModal.js.map +1 -1
- package/dist/Modal/ModalCloseButton.js +13 -15
- package/dist/Modal/ModalCloseButton.js.map +1 -1
- package/dist/Modal/ModalContext.js +13 -13
- package/dist/Modal/ModalContext.js.map +1 -1
- package/dist/Modal/ModalDialog.js +22 -23
- package/dist/Modal/ModalDialog.js.map +1 -1
- package/dist/Modal/ModalDialogBody.js +22 -11
- package/dist/Modal/ModalDialogBody.js.map +1 -1
- package/dist/Modal/ModalDialogFooter.js +6 -7
- package/dist/Modal/ModalDialogFooter.js.map +1 -1
- package/dist/Modal/ModalDialogHeader.js +6 -7
- package/dist/Modal/ModalDialogHeader.js.map +1 -1
- package/dist/Modal/ModalDialogHero.js +6 -7
- package/dist/Modal/ModalDialogHero.js.map +1 -1
- package/dist/Modal/ModalDialogHeroBackground.js +8 -9
- package/dist/Modal/ModalDialogHeroBackground.js.map +1 -1
- package/dist/Modal/ModalDialogHeroContent.js +6 -7
- package/dist/Modal/ModalDialogHeroContent.js.map +1 -1
- package/dist/Modal/ModalDialogTitle.js +6 -7
- package/dist/Modal/ModalDialogTitle.js.map +1 -1
- package/dist/Modal/ModalLayer.js +11 -17
- package/dist/Modal/ModalLayer.js.map +1 -1
- package/dist/Modal/ModalPopup.js +17 -17
- package/dist/Modal/ModalPopup.js.map +1 -1
- package/dist/Modal/PopperElement.js +25 -18
- package/dist/Modal/PopperElement.js.map +1 -1
- package/dist/Modal/Portal.js +40 -18
- package/dist/Modal/Portal.js.map +1 -1
- package/dist/Modal/StandardModal.js +6 -8
- package/dist/Modal/StandardModal.js.map +1 -1
- package/dist/Modal/index.js +215 -187
- package/dist/Modal/index.js.map +1 -1
- package/dist/Nav/index.js +3 -2
- package/dist/Nav/index.js.map +1 -1
- package/dist/Navbar/index.js +7 -6
- package/dist/Navbar/index.js.map +1 -1
- package/dist/OverflowScroll/OverflowScroll.js +45 -37
- package/dist/OverflowScroll/OverflowScroll.js.map +1 -1
- package/dist/OverflowScroll/OverflowScrollContext.js +1 -1
- package/dist/OverflowScroll/OverflowScrollContext.js.map +1 -1
- package/dist/OverflowScroll/OverflowScrollItems.js +2 -4
- package/dist/OverflowScroll/OverflowScrollItems.js.map +1 -1
- package/dist/Overlay/index.js +4 -4
- package/dist/Overlay/index.js.map +1 -1
- package/dist/PageBanner/index.js +11 -13
- package/dist/PageBanner/index.js.map +1 -1
- package/dist/Pagination/index.js +331 -296
- package/dist/Pagination/index.js.map +1 -1
- package/dist/Pagination/index.scss +1 -0
- package/dist/Popover/index.js +11 -14
- package/dist/Popover/index.js.map +1 -1
- package/dist/ProductTour/Checkpoint.js +29 -22
- package/dist/ProductTour/Checkpoint.js.map +1 -1
- package/dist/ProductTour/CheckpointActionRow.js +18 -16
- package/dist/ProductTour/CheckpointActionRow.js.map +1 -1
- package/dist/ProductTour/CheckpointBody.js +2 -4
- package/dist/ProductTour/CheckpointBody.js.map +1 -1
- package/dist/ProductTour/CheckpointBreadcrumbs.js +16 -16
- package/dist/ProductTour/CheckpointBreadcrumbs.js.map +1 -1
- package/dist/ProductTour/CheckpointTitle.js +2 -4
- package/dist/ProductTour/CheckpointTitle.js.map +1 -1
- package/dist/ProductTour/index.js +66 -47
- package/dist/ProductTour/index.js.map +1 -1
- package/dist/ProgressBar/index.js +37 -35
- package/dist/ProgressBar/index.js.map +1 -1
- package/dist/RadioButtonGroup/index.js +133 -102
- package/dist/RadioButtonGroup/index.js.map +1 -1
- package/dist/Scrollable/index.js +30 -15
- package/dist/Scrollable/index.js.map +1 -1
- package/dist/SearchField/SearchFieldAdvanced.js +54 -44
- package/dist/SearchField/SearchFieldAdvanced.js.map +1 -1
- package/dist/SearchField/SearchFieldClearButton.js +7 -8
- package/dist/SearchField/SearchFieldClearButton.js.map +1 -1
- package/dist/SearchField/SearchFieldInput.js +8 -9
- package/dist/SearchField/SearchFieldInput.js.map +1 -1
- package/dist/SearchField/SearchFieldLabel.js +5 -8
- package/dist/SearchField/SearchFieldLabel.js.map +1 -1
- package/dist/SearchField/SearchFieldSubmitButton.js +12 -15
- package/dist/SearchField/SearchFieldSubmitButton.js.map +1 -1
- package/dist/SearchField/index.js +22 -22
- package/dist/SearchField/index.js.map +1 -1
- package/dist/SelectableBox/SelectableBoxSet.js +25 -26
- package/dist/SelectableBox/SelectableBoxSet.js.map +1 -1
- package/dist/SelectableBox/index.js +42 -38
- package/dist/SelectableBox/index.js.map +1 -1
- package/dist/Sheet/SheetContainer.js +38 -16
- package/dist/Sheet/SheetContainer.js.map +1 -1
- package/dist/Sheet/index.js +65 -43
- package/dist/Sheet/index.js.map +1 -1
- package/dist/Spinner/index.js +8 -9
- package/dist/Spinner/index.js.map +1 -1
- package/dist/Stack/index.js +9 -11
- package/dist/Stack/index.js.map +1 -1
- package/dist/StatefulButton/index.js +15 -17
- package/dist/StatefulButton/index.js.map +1 -1
- package/dist/StatusAlert/index.js +120 -82
- package/dist/StatusAlert/index.js.map +1 -1
- package/dist/Stepper/Stepper.js +2 -4
- package/dist/Stepper/Stepper.js.map +1 -1
- package/dist/Stepper/StepperActionRow.js +7 -10
- package/dist/Stepper/StepperActionRow.js.map +1 -1
- package/dist/Stepper/StepperContext.js +64 -32
- package/dist/Stepper/StepperContext.js.map +1 -1
- package/dist/Stepper/StepperHeader.js +23 -30
- package/dist/Stepper/StepperHeader.js.map +1 -1
- package/dist/Stepper/StepperHeaderStep.js +14 -17
- package/dist/Stepper/StepperHeaderStep.js.map +1 -1
- package/dist/Stepper/StepperStep.js +23 -24
- package/dist/Stepper/StepperStep.js.map +1 -1
- package/dist/Sticky/index.js +30 -22
- package/dist/Sticky/index.js.map +1 -1
- package/dist/Table/index.js +178 -109
- package/dist/Table/index.js.map +1 -1
- package/dist/Tabs/deprecated/index.js +99 -66
- package/dist/Tabs/deprecated/index.js.map +1 -1
- package/dist/Tabs/index.js +65 -49
- package/dist/Tabs/index.js.map +1 -1
- package/dist/TextArea/index.js +10 -8
- package/dist/TextArea/index.js.map +1 -1
- package/dist/Toast/ToastContainer.js +38 -16
- package/dist/Toast/ToastContainer.js.map +1 -1
- package/dist/Toast/index.js +33 -18
- package/dist/Toast/index.js.map +1 -1
- package/dist/Tooltip/index.js +8 -9
- package/dist/Tooltip/index.js.map +1 -1
- package/dist/TransitionReplace/DemoTransitionReplace.js +12 -3
- package/dist/TransitionReplace/DemoTransitionReplace.js.map +1 -1
- package/dist/TransitionReplace/index.js +136 -100
- package/dist/TransitionReplace/index.js.map +1 -1
- package/dist/Truncate/index.js +30 -24
- package/dist/Truncate/index.js.map +1 -1
- package/dist/ValidationFormGroup/index.js +38 -37
- package/dist/ValidationFormGroup/index.js.map +1 -1
- package/dist/ValidationMessage/index.js +76 -51
- package/dist/ValidationMessage/index.js.map +1 -1
- package/dist/asInput/index.js +251 -202
- package/dist/asInput/index.js.map +1 -1
- package/dist/hooks/useArrowKeyNavigation.js +46 -43
- package/dist/hooks/useArrowKeyNavigation.js.map +1 -1
- package/dist/hooks/useIndexOfLastVisibleChild.js +40 -26
- package/dist/hooks/useIndexOfLastVisibleChild.js.map +1 -1
- package/dist/hooks/useIsVisible.js +20 -13
- package/dist/hooks/useIsVisible.js.map +1 -1
- package/dist/hooks/useToggle.js +18 -11
- package/dist/hooks/useToggle.js.map +1 -1
- package/dist/hooks/useWindowSize.js +17 -6
- package/dist/hooks/useWindowSize.js.map +1 -1
- package/dist/paragon.css +1 -1
- package/dist/withDeprecatedProps.js +79 -58
- package/dist/withDeprecatedProps.js.map +1 -1
- package/package.json +1 -5
- package/src/Button/index.jsx +2 -2
- package/src/DataTable/_variables.scss +1 -1
- package/src/Dropzone/index.jsx +1 -1
- package/src/Hyperlink/index.scss +2 -2
- package/src/Icon/index.jsx +1 -1
- package/src/IconButton/__snapshots__/IconButton.test.jsx.snap +12 -10
- package/src/IconButton/index.jsx +1 -1
- package/src/Menu/MenuItem.jsx +2 -2
- package/src/Overlay/README.md +1 -1
- package/src/Overlay/index.jsx +1 -1
- package/src/Pagination/index.scss +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["children"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -8,17 +8,13 @@ import classNames from 'classnames';
|
|
|
8
8
|
// eslint-disable-next-line import/no-cycle
|
|
9
9
|
import { Consumer } from './index';
|
|
10
10
|
function DropdownMenu(_ref) {
|
|
11
|
-
|
|
12
|
-
children
|
|
13
|
-
} = _ref,
|
|
11
|
+
var children = _ref.children,
|
|
14
12
|
other = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
-
return /*#__PURE__*/React.createElement(Consumer, null, _ref2
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
triggerId
|
|
21
|
-
} = _ref2;
|
|
13
|
+
return /*#__PURE__*/React.createElement(Consumer, null, function (_ref2) {
|
|
14
|
+
var handleMenuKeyDown = _ref2.handleMenuKeyDown,
|
|
15
|
+
isOpen = _ref2.isOpen,
|
|
16
|
+
menuRef = _ref2.menuRef,
|
|
17
|
+
triggerId = _ref2.triggerId;
|
|
22
18
|
return (
|
|
23
19
|
/*#__PURE__*/
|
|
24
20
|
/* eslint-disable-next-line jsx-a11y/interactive-supports-focus */
|
|
@@ -30,7 +26,7 @@ function DropdownMenu(_ref) {
|
|
|
30
26
|
className: classNames('dropdown-menu', {
|
|
31
27
|
show: isOpen
|
|
32
28
|
}, other.className),
|
|
33
|
-
onKeyDown: e
|
|
29
|
+
onKeyDown: function onKeyDown(e) {
|
|
34
30
|
handleMenuKeyDown(e);
|
|
35
31
|
if (other.onKeyDown) {
|
|
36
32
|
other.onKeyDown(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.js","names":["React","PropTypes","classNames","Consumer","DropdownMenu","_ref","children","other","_objectWithoutProperties","_excluded","createElement","_ref2","handleMenuKeyDown","isOpen","menuRef","triggerId","_extends","ref","role","className","show","onKeyDown","e","propTypes","node","defaultProps","undefined"],"sources":["../../../src/Dropdown/deprecated/DropdownMenu.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n// eslint-disable-next-line import/no-cycle\nimport { Consumer } from './index';\n\nfunction DropdownMenu({ children, ...other }) {\n return (\n <Consumer>\n {({\n handleMenuKeyDown,\n isOpen,\n menuRef,\n triggerId,\n }) => (\n /* eslint-disable-next-line jsx-a11y/interactive-supports-focus */\n <div\n {...other}\n aria-labelledby={triggerId}\n aria-hidden={!isOpen}\n ref={menuRef}\n role=\"menu\"\n className={classNames(\n 'dropdown-menu',\n { show: isOpen },\n other.className,\n )}\n onKeyDown={(e) => {\n handleMenuKeyDown(e);\n if (other.onKeyDown) {\n other.onKeyDown(e);\n }\n }}\n >\n {children}\n </div>\n )}\n </Consumer>\n );\n}\n\nDropdownMenu.propTypes = {\n children: PropTypes.node,\n};\n\nDropdownMenu.defaultProps = {\n children: undefined,\n};\n\nexport default DropdownMenu;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC;AACA,SAASC,QAAQ,QAAQ,SAAS;AAElC,SAASC,YAAYA,CAAAC,IAAA,EAAyB;EAAA,
|
|
1
|
+
{"version":3,"file":"DropdownMenu.js","names":["React","PropTypes","classNames","Consumer","DropdownMenu","_ref","children","other","_objectWithoutProperties","_excluded","createElement","_ref2","handleMenuKeyDown","isOpen","menuRef","triggerId","_extends","ref","role","className","show","onKeyDown","e","propTypes","node","defaultProps","undefined"],"sources":["../../../src/Dropdown/deprecated/DropdownMenu.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n// eslint-disable-next-line import/no-cycle\nimport { Consumer } from './index';\n\nfunction DropdownMenu({ children, ...other }) {\n return (\n <Consumer>\n {({\n handleMenuKeyDown,\n isOpen,\n menuRef,\n triggerId,\n }) => (\n /* eslint-disable-next-line jsx-a11y/interactive-supports-focus */\n <div\n {...other}\n aria-labelledby={triggerId}\n aria-hidden={!isOpen}\n ref={menuRef}\n role=\"menu\"\n className={classNames(\n 'dropdown-menu',\n { show: isOpen },\n other.className,\n )}\n onKeyDown={(e) => {\n handleMenuKeyDown(e);\n if (other.onKeyDown) {\n other.onKeyDown(e);\n }\n }}\n >\n {children}\n </div>\n )}\n </Consumer>\n );\n}\n\nDropdownMenu.propTypes = {\n children: PropTypes.node,\n};\n\nDropdownMenu.defaultProps = {\n children: undefined,\n};\n\nexport default DropdownMenu;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC;AACA,SAASC,QAAQ,QAAQ,SAAS;AAElC,SAASC,YAAYA,CAAAC,IAAA,EAAyB;EAAA,IAAtBC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAKC,KAAK,GAAAC,wBAAA,CAAAH,IAAA,EAAAI,SAAA;EACxC,oBACET,KAAA,CAAAU,aAAA,CAACP,QAAQ,QACN,UAAAQ,KAAA;IAAA,IACCC,iBAAiB,GAAAD,KAAA,CAAjBC,iBAAiB;MACjBC,MAAM,GAAAF,KAAA,CAANE,MAAM;MACNC,OAAO,GAAAH,KAAA,CAAPG,OAAO;MACPC,SAAS,GAAAJ,KAAA,CAATI,SAAS;IAAA;MAAA;MAEX;MACEf,KAAA,CAAAU,aAAA,QAAAM,QAAA,KACMT,KAAK;QACT,mBAAiBQ,SAAU;QAC3B,eAAa,CAACF,MAAO;QACrBI,GAAG,EAAEH,OAAQ;QACbI,IAAI,EAAC,MAAM;QACXC,SAAS,EAAEjB,UAAU,CACnB,eAAe,EACf;UAAEkB,IAAI,EAAEP;QAAO,CAAC,EAChBN,KAAK,CAACY,SACR,CAAE;QACFE,SAAS,EAAE,SAAAA,UAACC,CAAC,EAAK;UAChBV,iBAAiB,CAACU,CAAC,CAAC;UACpB,IAAIf,KAAK,CAACc,SAAS,EAAE;YACnBd,KAAK,CAACc,SAAS,CAACC,CAAC,CAAC;UACpB;QACF;MAAE,IAEDhB,QACE;IAAC;EAAA,CAEA,CAAC;AAEf;AAEAF,YAAY,CAACmB,SAAS,GAAG;EACvBjB,QAAQ,EAAEL,SAAS,CAACuB;AACtB,CAAC;AAEDpB,YAAY,CAACqB,YAAY,GAAG;EAC1BnB,QAAQ,EAAEoB;AACZ,CAAC;AAED,eAAetB,YAAY"}
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["children"];
|
|
2
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
4
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
8
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
9
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
10
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
11
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
13
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
14
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
15
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
5
16
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return
|
|
7
|
-
function _toPrimitive(input, hint) { if (
|
|
17
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
18
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
19
|
import React from 'react';
|
|
9
20
|
import PropTypes from 'prop-types';
|
|
10
21
|
import classNames from 'classnames';
|
|
@@ -14,145 +25,167 @@ import DropdownButton from './DropdownButton';
|
|
|
14
25
|
import DropdownMenu from './DropdownMenu';
|
|
15
26
|
import DropdownItem from './DropdownItem';
|
|
16
27
|
import withDeprecatedProps, { DeprTypes } from '../../withDeprecatedProps';
|
|
17
|
-
|
|
18
|
-
Provider,
|
|
19
|
-
Consumer
|
|
20
|
-
|
|
21
|
-
|
|
28
|
+
var _React$createContext = /*#__PURE__*/React.createContext(),
|
|
29
|
+
Provider = _React$createContext.Provider,
|
|
30
|
+
Consumer = _React$createContext.Consumer;
|
|
31
|
+
var Dropdown = /*#__PURE__*/function (_React$Component) {
|
|
32
|
+
_inherits(Dropdown, _React$Component);
|
|
33
|
+
var _super = _createSuper(Dropdown);
|
|
22
34
|
// eslint-disable-next-line react/sort-comp
|
|
23
35
|
// For creating unique ids
|
|
24
36
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
37
|
+
function Dropdown(props) {
|
|
38
|
+
var _this;
|
|
39
|
+
_classCallCheck(this, Dropdown);
|
|
40
|
+
_this = _super.call(this, props);
|
|
41
|
+
_defineProperty(_assertThisInitialized(_this), "handleDocumentClick", function (e) {
|
|
42
|
+
if (_this.containerRef.current.contains(e.target) && _this.containerRef.current !== e.target) {
|
|
29
43
|
return;
|
|
30
44
|
}
|
|
31
|
-
if (
|
|
32
|
-
|
|
45
|
+
if (_this.state.open) {
|
|
46
|
+
_this.close();
|
|
33
47
|
}
|
|
34
48
|
});
|
|
35
|
-
_defineProperty(
|
|
49
|
+
_defineProperty(_assertThisInitialized(_this), "handleMenuKeyDown", function (e) {
|
|
36
50
|
switch (e.key) {
|
|
37
51
|
case 'ArrowUp':
|
|
38
52
|
e.preventDefault();
|
|
39
|
-
|
|
53
|
+
_this.focusPrevious();
|
|
40
54
|
break;
|
|
41
55
|
case 'ArrowDown':
|
|
42
56
|
e.preventDefault();
|
|
43
|
-
|
|
57
|
+
_this.focusNext();
|
|
44
58
|
break;
|
|
45
59
|
case 'Tab':
|
|
46
60
|
e.preventDefault();
|
|
47
61
|
if (e.shiftKey) {
|
|
48
|
-
|
|
62
|
+
_this.focusPrevious();
|
|
49
63
|
} else {
|
|
50
|
-
|
|
64
|
+
_this.focusNext();
|
|
51
65
|
}
|
|
52
66
|
break;
|
|
53
67
|
case 'Escape':
|
|
54
68
|
e.stopPropagation();
|
|
55
|
-
|
|
69
|
+
_this.close();
|
|
56
70
|
break;
|
|
57
71
|
default:
|
|
58
72
|
break;
|
|
59
73
|
}
|
|
60
74
|
});
|
|
61
|
-
_defineProperty(
|
|
62
|
-
if (
|
|
63
|
-
|
|
75
|
+
_defineProperty(_assertThisInitialized(_this), "toggle", function () {
|
|
76
|
+
if (_this.state.open) {
|
|
77
|
+
_this.close();
|
|
64
78
|
} else {
|
|
65
|
-
|
|
79
|
+
_this.open();
|
|
66
80
|
}
|
|
67
81
|
});
|
|
68
|
-
|
|
82
|
+
_this.state = {
|
|
69
83
|
open: false
|
|
70
84
|
};
|
|
71
85
|
|
|
72
86
|
// Used for aria labelling. Increment the id counter so the next id can be unique
|
|
73
|
-
|
|
87
|
+
_this.uniqueId = Dropdown.idCounter;
|
|
74
88
|
Dropdown.idCounter += 1;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
89
|
+
_this.triggerId = "pgn__dropdown-trigger-".concat(_this.uniqueId);
|
|
90
|
+
_this.containerRef = /*#__PURE__*/React.createRef();
|
|
91
|
+
_this.menuRef = /*#__PURE__*/React.createRef();
|
|
92
|
+
_this.buttonRef = /*#__PURE__*/React.createRef();
|
|
93
|
+
return _this;
|
|
79
94
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
95
|
+
_createClass(Dropdown, [{
|
|
96
|
+
key: "componentDidUpdate",
|
|
97
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
98
|
+
if (prevState.open !== this.state.open) {
|
|
99
|
+
if (this.state.open) {
|
|
100
|
+
this.focusFirst();
|
|
101
|
+
} else {
|
|
102
|
+
this.buttonRef.current.focus();
|
|
103
|
+
}
|
|
86
104
|
}
|
|
87
105
|
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
getFocusableElements() {
|
|
93
|
-
const selector = 'button:not([disabled]), [href]:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled])';
|
|
94
|
-
return Array.from(this.menuRef.current.querySelectorAll(selector));
|
|
95
|
-
}
|
|
96
|
-
close() {
|
|
97
|
-
document.removeEventListener('click', this.handleDocumentClick, true);
|
|
98
|
-
this.setState({
|
|
99
|
-
open: false
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
open() {
|
|
103
|
-
// adding event listener here so the user can close dropdown on click outside of the dropdown
|
|
104
|
-
document.addEventListener('click', this.handleDocumentClick, true);
|
|
105
|
-
this.setState({
|
|
106
|
-
open: true
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
focusFirst() {
|
|
110
|
-
const focusableElements = this.getFocusableElements();
|
|
111
|
-
if (focusableElements.length) {
|
|
112
|
-
focusableElements[0].focus();
|
|
106
|
+
}, {
|
|
107
|
+
key: "componentWillUnmount",
|
|
108
|
+
value: function componentWillUnmount() {
|
|
109
|
+
document.removeEventListener('click', this.handleDocumentClick, true);
|
|
113
110
|
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return;
|
|
111
|
+
}, {
|
|
112
|
+
key: "getFocusableElements",
|
|
113
|
+
value: function getFocusableElements() {
|
|
114
|
+
var selector = 'button:not([disabled]), [href]:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled])';
|
|
115
|
+
return Array.from(this.menuRef.current.querySelectorAll(selector));
|
|
119
116
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
return;
|
|
117
|
+
}, {
|
|
118
|
+
key: "close",
|
|
119
|
+
value: function close() {
|
|
120
|
+
document.removeEventListener('click', this.handleDocumentClick, true);
|
|
121
|
+
this.setState({
|
|
122
|
+
open: false
|
|
123
|
+
});
|
|
128
124
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}), /*#__PURE__*/React.createElement(Provider, {
|
|
145
|
-
value: {
|
|
146
|
-
buttonRef: this.buttonRef,
|
|
147
|
-
handleMenuKeyDown: this.handleMenuKeyDown,
|
|
148
|
-
isOpen: this.state.open,
|
|
149
|
-
menuRef: this.menuRef,
|
|
150
|
-
toggle: this.toggle,
|
|
151
|
-
triggerId: this.triggerId
|
|
125
|
+
}, {
|
|
126
|
+
key: "open",
|
|
127
|
+
value: function open() {
|
|
128
|
+
// adding event listener here so the user can close dropdown on click outside of the dropdown
|
|
129
|
+
document.addEventListener('click', this.handleDocumentClick, true);
|
|
130
|
+
this.setState({
|
|
131
|
+
open: true
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}, {
|
|
135
|
+
key: "focusFirst",
|
|
136
|
+
value: function focusFirst() {
|
|
137
|
+
var focusableElements = this.getFocusableElements();
|
|
138
|
+
if (focusableElements.length) {
|
|
139
|
+
focusableElements[0].focus();
|
|
152
140
|
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
141
|
+
}
|
|
142
|
+
}, {
|
|
143
|
+
key: "focusNext",
|
|
144
|
+
value: function focusNext() {
|
|
145
|
+
var allFocusableElements = this.getFocusableElements();
|
|
146
|
+
if (allFocusableElements.length === 0) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
var activeIndex = allFocusableElements.indexOf(document.activeElement);
|
|
150
|
+
var nextIndex = (activeIndex + 1) % allFocusableElements.length;
|
|
151
|
+
allFocusableElements[nextIndex].focus();
|
|
152
|
+
}
|
|
153
|
+
}, {
|
|
154
|
+
key: "focusPrevious",
|
|
155
|
+
value: function focusPrevious() {
|
|
156
|
+
var allFocusableElements = this.getFocusableElements();
|
|
157
|
+
if (allFocusableElements.length === 0) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
var activeIndex = allFocusableElements.indexOf(document.activeElement);
|
|
161
|
+
var previousIndex = (activeIndex - 1 + allFocusableElements.length) % allFocusableElements.length;
|
|
162
|
+
allFocusableElements[previousIndex].focus();
|
|
163
|
+
}
|
|
164
|
+
}, {
|
|
165
|
+
key: "render",
|
|
166
|
+
value: function render() {
|
|
167
|
+
var _this$props = this.props,
|
|
168
|
+
children = _this$props.children,
|
|
169
|
+
other = _objectWithoutProperties(_this$props, _excluded);
|
|
170
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, other, {
|
|
171
|
+
className: classNames('dropdown', {
|
|
172
|
+
show: this.state.open
|
|
173
|
+
}, other.className),
|
|
174
|
+
ref: this.containerRef
|
|
175
|
+
}), /*#__PURE__*/React.createElement(Provider, {
|
|
176
|
+
value: {
|
|
177
|
+
buttonRef: this.buttonRef,
|
|
178
|
+
handleMenuKeyDown: this.handleMenuKeyDown,
|
|
179
|
+
isOpen: this.state.open,
|
|
180
|
+
menuRef: this.menuRef,
|
|
181
|
+
toggle: this.toggle,
|
|
182
|
+
triggerId: this.triggerId
|
|
183
|
+
}
|
|
184
|
+
}, children));
|
|
185
|
+
}
|
|
186
|
+
}]);
|
|
187
|
+
return Dropdown;
|
|
188
|
+
}(React.Component);
|
|
156
189
|
_defineProperty(Dropdown, "idCounter", 0);
|
|
157
190
|
Dropdown.propTypes = {
|
|
158
191
|
children: PropTypes.node
|
|
@@ -160,16 +193,16 @@ Dropdown.propTypes = {
|
|
|
160
193
|
Dropdown.Item = DropdownItem;
|
|
161
194
|
Dropdown.Button = DropdownButton;
|
|
162
195
|
Dropdown.Menu = DropdownMenu;
|
|
163
|
-
|
|
196
|
+
var DropdownWithDeprecatedProps = withDeprecatedProps(Dropdown, 'Dropdown', {
|
|
164
197
|
menuItems: {
|
|
165
198
|
deprType: DeprTypes.MOVED_AND_FORMAT,
|
|
166
199
|
message: 'They should be components sent as children.',
|
|
167
200
|
newName: 'children',
|
|
168
|
-
transform: (menuItems, allProps)
|
|
201
|
+
transform: function transform(menuItems, allProps) {
|
|
169
202
|
if (!Array.isArray(menuItems)) {
|
|
170
203
|
return null;
|
|
171
204
|
}
|
|
172
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DropdownButton, null, /*#__PURE__*/React.isValidElement(allProps.iconElement) ? allProps.iconElement : null, allProps.title), /*#__PURE__*/React.createElement(DropdownMenu, null, menuItems.map((menuItem, i)
|
|
205
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DropdownButton, null, /*#__PURE__*/React.isValidElement(allProps.iconElement) ? allProps.iconElement : null, allProps.title), /*#__PURE__*/React.createElement(DropdownMenu, null, menuItems.map(function (menuItem, i) {
|
|
173
206
|
/* eslint-disable react/no-array-index-key */
|
|
174
207
|
if ( /*#__PURE__*/React.isValidElement(menuItem)) {
|
|
175
208
|
return /*#__PURE__*/React.cloneElement(menuItem, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","DropdownButton","DropdownMenu","DropdownItem","withDeprecatedProps","DeprTypes","Provider","Consumer","createContext","Dropdown","Component","constructor","props","_defineProperty","e","containerRef","current","contains","target","state","open","close","key","preventDefault","focusPrevious","focusNext","shiftKey","stopPropagation","uniqueId","idCounter","triggerId","createRef","menuRef","buttonRef","componentDidUpdate","prevProps","prevState","focusFirst","focus","componentWillUnmount","document","removeEventListener","handleDocumentClick","getFocusableElements","selector","Array","from","querySelectorAll","setState","addEventListener","focusableElements","length","allFocusableElements","activeIndex","indexOf","activeElement","nextIndex","previousIndex","render","_this$props","children","other","_objectWithoutProperties","_excluded","createElement","_extends","className","show","ref","value","handleMenuKeyDown","isOpen","toggle","propTypes","node","Item","Button","Menu","DropdownWithDeprecatedProps","menuItems","deprType","MOVED_AND_FORMAT","message","newName","transform","allProps","isArray","Fragment","isValidElement","iconElement","title","map","menuItem","i","cloneElement","href","label","REMOVED","buttonType","defaultProps"],"sources":["../../../src/Dropdown/deprecated/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n// eslint-disable-next-line import/no-cycle\nimport DropdownButton from './DropdownButton';\n// eslint-disable-next-line import/no-cycle\nimport DropdownMenu from './DropdownMenu';\nimport DropdownItem from './DropdownItem';\n\nimport withDeprecatedProps, { DeprTypes } from '../../withDeprecatedProps';\n\nconst { Provider, Consumer } = React.createContext();\n\nclass Dropdown extends React.Component {\n // eslint-disable-next-line react/sort-comp\n static idCounter = 0; // For creating unique ids\n\n constructor(props) {\n super(props);\n this.state = {\n open: false,\n };\n\n // Used for aria labelling. Increment the id counter so the next id can be unique\n this.uniqueId = Dropdown.idCounter;\n Dropdown.idCounter += 1;\n this.triggerId = `pgn__dropdown-trigger-${this.uniqueId}`;\n\n this.containerRef = React.createRef();\n this.menuRef = React.createRef();\n this.buttonRef = React.createRef();\n }\n\n componentDidUpdate(prevProps, prevState) {\n if (prevState.open !== this.state.open) {\n if (this.state.open) {\n this.focusFirst();\n } else {\n this.buttonRef.current.focus();\n }\n }\n }\n\n componentWillUnmount() {\n document.removeEventListener('click', this.handleDocumentClick, true);\n }\n\n getFocusableElements() {\n const selector = 'button:not([disabled]), [href]:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"]):not([disabled])';\n return Array.from(this.menuRef.current.querySelectorAll(selector));\n }\n\n handleDocumentClick = (e) => {\n if (this.containerRef.current.contains(e.target) && this.containerRef.current !== e.target) {\n return;\n }\n if (this.state.open) {\n this.close();\n }\n };\n\n handleMenuKeyDown = (e) => {\n switch (e.key) {\n case 'ArrowUp':\n e.preventDefault();\n this.focusPrevious();\n break;\n case 'ArrowDown':\n e.preventDefault();\n this.focusNext();\n break;\n case 'Tab':\n e.preventDefault();\n if (e.shiftKey) {\n this.focusPrevious();\n } else {\n this.focusNext();\n }\n break;\n case 'Escape':\n e.stopPropagation();\n this.close();\n break;\n default:\n break;\n }\n };\n\n toggle = () => {\n if (this.state.open) {\n this.close();\n } else {\n this.open();\n }\n };\n\n close() {\n document.removeEventListener('click', this.handleDocumentClick, true);\n this.setState({\n open: false,\n });\n }\n\n open() {\n // adding event listener here so the user can close dropdown on click outside of the dropdown\n document.addEventListener('click', this.handleDocumentClick, true);\n this.setState({\n open: true,\n });\n }\n\n focusFirst() {\n const focusableElements = this.getFocusableElements();\n if (focusableElements.length) { focusableElements[0].focus(); }\n }\n\n focusNext() {\n const allFocusableElements = this.getFocusableElements();\n if (allFocusableElements.length === 0) { return; }\n const activeIndex = allFocusableElements.indexOf(document.activeElement);\n const nextIndex = (activeIndex + 1) % allFocusableElements.length;\n allFocusableElements[nextIndex].focus();\n }\n\n focusPrevious() {\n const allFocusableElements = this.getFocusableElements();\n if (allFocusableElements.length === 0) { return; }\n const activeIndex = allFocusableElements.indexOf(document.activeElement);\n const previousIndex = ((activeIndex - 1) + allFocusableElements.length) % allFocusableElements.length;\n allFocusableElements[previousIndex].focus();\n }\n\n render() {\n const { children, ...other } = this.props;\n\n return (\n <div\n {...other}\n className={classNames(\n 'dropdown',\n { show: this.state.open },\n other.className,\n )}\n ref={this.containerRef}\n >\n <Provider\n value={{\n buttonRef: this.buttonRef,\n handleMenuKeyDown: this.handleMenuKeyDown,\n isOpen: this.state.open,\n menuRef: this.menuRef,\n toggle: this.toggle,\n triggerId: this.triggerId,\n }}\n >\n {children}\n </Provider>\n </div>\n );\n }\n}\n\nDropdown.propTypes = {\n children: PropTypes.node,\n};\n\nDropdown.Item = DropdownItem;\nDropdown.Button = DropdownButton;\nDropdown.Menu = DropdownMenu;\n\nconst DropdownWithDeprecatedProps = withDeprecatedProps(Dropdown, 'Dropdown', {\n menuItems: {\n deprType: DeprTypes.MOVED_AND_FORMAT,\n message: 'They should be components sent as children.',\n newName: 'children',\n transform: (menuItems, allProps) => {\n if (!Array.isArray(menuItems)) { return null; }\n return (\n <>\n <DropdownButton>\n {React.isValidElement(allProps.iconElement) ? allProps.iconElement : null }\n {allProps.title}\n </DropdownButton>\n <DropdownMenu>\n {menuItems.map((menuItem, i) => {\n /* eslint-disable react/no-array-index-key */\n if (React.isValidElement(menuItem)) {\n return React.cloneElement(menuItem, {\n className: 'dropdown-item',\n key: i,\n });\n }\n return <DropdownItem key={i} href={menuItem.href}>{menuItem.label}</DropdownItem>;\n /* eslint-enable react/no-array-index-key */\n })}\n </DropdownMenu>\n </>\n );\n },\n },\n title: {\n deprType: DeprTypes.REMOVED,\n message: 'It should be specified inside the Dropdown.Button component',\n },\n buttonType: {\n deprType: DeprTypes.REMOVED,\n message: 'It should be specified as a className prop',\n },\n iconElement: {\n deprType: DeprTypes.REMOVED,\n message: 'It should be specified inside the buttonContent prop.',\n },\n});\n\nDropdownWithDeprecatedProps.propTypes = Dropdown.propTypes;\nDropdownWithDeprecatedProps.defaultProps = Dropdown.defaultProps;\nDropdownWithDeprecatedProps.Item = Dropdown.Item;\nDropdownWithDeprecatedProps.Button = Dropdown.Button;\nDropdownWithDeprecatedProps.Menu = Dropdown.Menu;\n\nexport { Provider, Consumer };\nexport default DropdownWithDeprecatedProps;\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC;AACA,OAAOC,cAAc,MAAM,kBAAkB;AAC7C;AACA,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,YAAY,MAAM,gBAAgB;AAEzC,OAAOC,mBAAmB,IAAIC,SAAS,QAAQ,2BAA2B;AAE1E,MAAM;EAAEC,QAAQ;EAAEC;AAAS,CAAC,gBAAGT,KAAK,CAACU,aAAa,CAAC,CAAC;AAEpD,MAAMC,QAAQ,SAASX,KAAK,CAACY,SAAS,CAAC;EACrC;EACsB;;EAEtBC,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,8BAkCQC,CAAC,IAAK;MAC3B,IAAI,IAAI,CAACC,YAAY,CAACC,OAAO,CAACC,QAAQ,CAACH,CAAC,CAACI,MAAM,CAAC,IAAI,IAAI,CAACH,YAAY,CAACC,OAAO,KAAKF,CAAC,CAACI,MAAM,EAAE;QAC1F;MACF;MACA,IAAI,IAAI,CAACC,KAAK,CAACC,IAAI,EAAE;QACnB,IAAI,CAACC,KAAK,CAAC,CAAC;MACd;IACF,CAAC;IAAAR,eAAA,4BAEoBC,CAAC,IAAK;MACzB,QAAQA,CAAC,CAACQ,GAAG;QACX,KAAK,SAAS;UACZR,CAAC,CAACS,cAAc,C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E,aAAA,CAAC7D,YAAY;UAACmB,GAAG,EAAEuE,CAAE;UAACE,IAAI,EAAEH,QAAQ,CAACG;QAAK,GAAEH,QAAQ,CAACI,KAAoB,CAAC;QACnF;MACA,CAAC,CACW,CACd,CAAC;IAEP;EACF,CAAC;;EACDN,KAAK,EAAE;IACLV,QAAQ,EAAE3E,SAAS,CAAC4F,OAAO;IAC3Bf,OAAO,EAAE;EACX,CAAC;EACDgB,UAAU,EAAE;IACVlB,QAAQ,EAAE3E,SAAS,CAAC4F,OAAO;IAC3Bf,OAAO,EAAE;EACX,CAAC;EACDO,WAAW,EAAE;IACXT,QAAQ,EAAE3E,SAAS,CAAC4F,OAAO;IAC3Bf,OAAO,EAAE;EACX;AACF,CAAC,CAAC;AAEFJ,2BAA2B,CAACL,SAAS,GAAGhE,QAAQ,CAACgE,SAAS;AAC1DK,2BAA2B,CAACqB,YAAY,GAAG1F,QAAQ,CAAC0F,YAAY;AAChErB,2BAA2B,CAACH,IAAI,GAAGlE,QAAQ,CAACkE,IAAI;AAChDG,2BAA2B,CAACF,MAAM,GAAGnE,QAAQ,CAACmE,MAAM;AACpDE,2BAA2B,CAACD,IAAI,GAAGpE,QAAQ,CAACoE,IAAI;AAEhD,SAASvE,QAAQ,EAAEC,QAAQ;AAC3B,eAAeuE,2BAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classNames","DropdownButton","DropdownMenu","DropdownItem","withDeprecatedProps","DeprTypes","_React$createContext","createContext","Provider","Consumer","Dropdown","_React$Component","_inherits","_super","_createSuper","props","_this","_classCallCheck","call","_defineProperty","_assertThisInitialized","e","containerRef","current","contains","target","state","open","close","key","preventDefault","focusPrevious","focusNext","shiftKey","stopPropagation","uniqueId","idCounter","triggerId","concat","createRef","menuRef","buttonRef","_createClass","value","componentDidUpdate","prevProps","prevState","focusFirst","focus","componentWillUnmount","document","removeEventListener","handleDocumentClick","getFocusableElements","selector","Array","from","querySelectorAll","setState","addEventListener","focusableElements","length","allFocusableElements","activeIndex","indexOf","activeElement","nextIndex","previousIndex","render","_this$props","children","other","_objectWithoutProperties","_excluded","createElement","_extends","className","show","ref","handleMenuKeyDown","isOpen","toggle","Component","propTypes","node","Item","Button","Menu","DropdownWithDeprecatedProps","menuItems","deprType","MOVED_AND_FORMAT","message","newName","transform","allProps","isArray","Fragment","isValidElement","iconElement","title","map","menuItem","i","cloneElement","href","label","REMOVED","buttonType","defaultProps"],"sources":["../../../src/Dropdown/deprecated/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n// eslint-disable-next-line import/no-cycle\nimport DropdownButton from './DropdownButton';\n// eslint-disable-next-line import/no-cycle\nimport DropdownMenu from './DropdownMenu';\nimport DropdownItem from './DropdownItem';\n\nimport withDeprecatedProps, { DeprTypes } from '../../withDeprecatedProps';\n\nconst { Provider, Consumer } = React.createContext();\n\nclass Dropdown extends React.Component {\n // eslint-disable-next-line react/sort-comp\n static idCounter = 0; // For creating unique ids\n\n constructor(props) {\n super(props);\n this.state = {\n open: false,\n };\n\n // Used for aria labelling. Increment the id counter so the next id can be unique\n this.uniqueId = Dropdown.idCounter;\n Dropdown.idCounter += 1;\n this.triggerId = `pgn__dropdown-trigger-${this.uniqueId}`;\n\n this.containerRef = React.createRef();\n this.menuRef = React.createRef();\n this.buttonRef = React.createRef();\n }\n\n componentDidUpdate(prevProps, prevState) {\n if (prevState.open !== this.state.open) {\n if (this.state.open) {\n this.focusFirst();\n } else {\n this.buttonRef.current.focus();\n }\n }\n }\n\n componentWillUnmount() {\n document.removeEventListener('click', this.handleDocumentClick, true);\n }\n\n getFocusableElements() {\n const selector = 'button:not([disabled]), [href]:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"]):not([disabled])';\n return Array.from(this.menuRef.current.querySelectorAll(selector));\n }\n\n handleDocumentClick = (e) => {\n if (this.containerRef.current.contains(e.target) && this.containerRef.current !== e.target) {\n return;\n }\n if (this.state.open) {\n this.close();\n }\n };\n\n handleMenuKeyDown = (e) => {\n switch (e.key) {\n case 'ArrowUp':\n e.preventDefault();\n this.focusPrevious();\n break;\n case 'ArrowDown':\n e.preventDefault();\n this.focusNext();\n break;\n case 'Tab':\n e.preventDefault();\n if (e.shiftKey) {\n this.focusPrevious();\n } else {\n this.focusNext();\n }\n break;\n case 'Escape':\n e.stopPropagation();\n this.close();\n break;\n default:\n break;\n }\n };\n\n toggle = () => {\n if (this.state.open) {\n this.close();\n } else {\n this.open();\n }\n };\n\n close() {\n document.removeEventListener('click', this.handleDocumentClick, true);\n this.setState({\n open: false,\n });\n }\n\n open() {\n // adding event listener here so the user can close dropdown on click outside of the dropdown\n document.addEventListener('click', this.handleDocumentClick, true);\n this.setState({\n open: true,\n });\n }\n\n focusFirst() {\n const focusableElements = this.getFocusableElements();\n if (focusableElements.length) { focusableElements[0].focus(); }\n }\n\n focusNext() {\n const allFocusableElements = this.getFocusableElements();\n if (allFocusableElements.length === 0) { return; }\n const activeIndex = allFocusableElements.indexOf(document.activeElement);\n const nextIndex = (activeIndex + 1) % allFocusableElements.length;\n allFocusableElements[nextIndex].focus();\n }\n\n focusPrevious() {\n const allFocusableElements = this.getFocusableElements();\n if (allFocusableElements.length === 0) { return; }\n const activeIndex = allFocusableElements.indexOf(document.activeElement);\n const previousIndex = ((activeIndex - 1) + allFocusableElements.length) % allFocusableElements.length;\n allFocusableElements[previousIndex].focus();\n }\n\n render() {\n const { children, ...other } = this.props;\n\n return (\n <div\n {...other}\n className={classNames(\n 'dropdown',\n { show: this.state.open },\n other.className,\n )}\n ref={this.containerRef}\n >\n <Provider\n value={{\n buttonRef: this.buttonRef,\n handleMenuKeyDown: this.handleMenuKeyDown,\n isOpen: this.state.open,\n menuRef: this.menuRef,\n toggle: this.toggle,\n triggerId: this.triggerId,\n }}\n >\n {children}\n </Provider>\n </div>\n );\n }\n}\n\nDropdown.propTypes = {\n children: PropTypes.node,\n};\n\nDropdown.Item = DropdownItem;\nDropdown.Button = DropdownButton;\nDropdown.Menu = DropdownMenu;\n\nconst DropdownWithDeprecatedProps = withDeprecatedProps(Dropdown, 'Dropdown', {\n menuItems: {\n deprType: DeprTypes.MOVED_AND_FORMAT,\n message: 'They should be components sent as children.',\n newName: 'children',\n transform: (menuItems, allProps) => {\n if (!Array.isArray(menuItems)) { return null; }\n return (\n <>\n <DropdownButton>\n {React.isValidElement(allProps.iconElement) ? allProps.iconElement : null }\n {allProps.title}\n </DropdownButton>\n <DropdownMenu>\n {menuItems.map((menuItem, i) => {\n /* eslint-disable react/no-array-index-key */\n if (React.isValidElement(menuItem)) {\n return React.cloneElement(menuItem, {\n className: 'dropdown-item',\n key: i,\n });\n }\n return <DropdownItem key={i} href={menuItem.href}>{menuItem.label}</DropdownItem>;\n /* eslint-enable react/no-array-index-key */\n })}\n </DropdownMenu>\n </>\n );\n },\n },\n title: {\n deprType: DeprTypes.REMOVED,\n message: 'It should be specified inside the Dropdown.Button component',\n },\n buttonType: {\n deprType: DeprTypes.REMOVED,\n message: 'It should be specified as a className prop',\n },\n iconElement: {\n deprType: DeprTypes.REMOVED,\n message: 'It should be specified inside the buttonContent prop.',\n },\n});\n\nDropdownWithDeprecatedProps.propTypes = Dropdown.propTypes;\nDropdownWithDeprecatedProps.defaultProps = Dropdown.defaultProps;\nDropdownWithDeprecatedProps.Item = Dropdown.Item;\nDropdownWithDeprecatedProps.Button = Dropdown.Button;\nDropdownWithDeprecatedProps.Menu = Dropdown.Menu;\n\nexport { Provider, Consumer };\nexport default DropdownWithDeprecatedProps;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC;AACA,OAAOC,cAAc,MAAM,kBAAkB;AAC7C;AACA,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,YAAY,MAAM,gBAAgB;AAEzC,OAAOC,mBAAmB,I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,QAAQ,CAAC,EAAE;UAClC,oBAAOxG,KAAK,CAAC0G,YAAY,CAACF,QAAQ,EAAE;YAClC1B,SAAS,EAAE,eAAe;YAC1B/C,GAAG,EAAE0E;UACP,CAAC,CAAC;QACJ;QACA,oBAAOzG,KAAA,CAAA4E,aAAA,CAACvE,YAAY;UAAC0B,GAAG,EAAE0E,CAAE;UAACE,IAAI,EAAEH,QAAQ,CAACG;QAAK,GAAEH,QAAQ,CAACI,KAAoB,CAAC;QACnF;MACA,CAAC,CACW,CACd,CAAC;IAEP;EACF,CAAC;;EACDN,KAAK,EAAE;IACLV,QAAQ,EAAErF,SAAS,CAACsG,OAAO;IAC3Bf,OAAO,EAAE;EACX,CAAC;EACDgB,UAAU,EAAE;IACVlB,QAAQ,EAAErF,SAAS,CAACsG,OAAO;IAC3Bf,OAAO,EAAE;EACX,CAAC;EACDO,WAAW,EAAE;IACXT,QAAQ,EAAErF,SAAS,CAACsG,OAAO;IAC3Bf,OAAO,EAAE;EACX;AACF,CAAC,CAAC;AAEFJ,2BAA2B,CAACL,SAAS,GAAGzE,QAAQ,CAACyE,SAAS;AAC1DK,2BAA2B,CAACqB,YAAY,GAAGnG,QAAQ,CAACmG,YAAY;AAChErB,2BAA2B,CAACH,IAAI,GAAG3E,QAAQ,CAAC2E,IAAI;AAChDG,2BAA2B,CAACF,MAAM,GAAG5E,QAAQ,CAAC4E,MAAM;AACpDE,2BAA2B,CAACD,IAAI,GAAG7E,QAAQ,CAAC6E,IAAI;AAEhD,SAAS/E,QAAQ,EAAEC,QAAQ;AAC3B,eAAe+E,2BAA2B"}
|
package/dist/Dropdown/index.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["show", "autoClose", "onToggle", "variant", "className"],
|
|
2
3
|
_excluded2 = ["as", "bsPrefix"],
|
|
3
4
|
_excluded3 = ["className"];
|
|
4
5
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
8
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return
|
|
9
|
-
function _toPrimitive(input, hint) { if (
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
10
17
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
11
18
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
12
19
|
import React from 'react';
|
|
@@ -19,19 +26,20 @@ import BaseDropdownToggle from 'react-bootstrap/DropdownToggle';
|
|
|
19
26
|
import DropdownDeprecated from './deprecated';
|
|
20
27
|
import Button from '../Button';
|
|
21
28
|
import IconButton from '../IconButton';
|
|
22
|
-
|
|
29
|
+
var Dropdown = /*#__PURE__*/React.forwardRef(
|
|
23
30
|
// eslint-disable-next-line prefer-arrow-callback
|
|
24
31
|
function Dropdown(_ref, ref) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
className
|
|
31
|
-
} = _ref,
|
|
32
|
+
var show = _ref.show,
|
|
33
|
+
autoClose = _ref.autoClose,
|
|
34
|
+
onToggle = _ref.onToggle,
|
|
35
|
+
variant = _ref.variant,
|
|
36
|
+
className = _ref.className,
|
|
32
37
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
var _React$useState = React.useState(show),
|
|
39
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
40
|
+
internalShow = _React$useState2[0],
|
|
41
|
+
setInternalShow = _React$useState2[1];
|
|
42
|
+
var isClosingPermitted = function isClosingPermitted(source) {
|
|
35
43
|
// autoClose=false only permits close on button click
|
|
36
44
|
if (autoClose === false) {
|
|
37
45
|
return source === 'click';
|
|
@@ -46,25 +54,24 @@ function Dropdown(_ref, ref) {
|
|
|
46
54
|
}
|
|
47
55
|
return true;
|
|
48
56
|
};
|
|
49
|
-
|
|
57
|
+
var handleToggle = function handleToggle(isOpen, event, metadata) {
|
|
50
58
|
if (isOpen) {
|
|
51
59
|
setInternalShow(true);
|
|
52
|
-
onToggle
|
|
60
|
+
onToggle === null || onToggle === void 0 ? void 0 : onToggle(isOpen, event, metadata);
|
|
53
61
|
return;
|
|
54
62
|
}
|
|
55
|
-
|
|
56
|
-
source
|
|
57
|
-
} = _objectSpread({}, metadata);
|
|
63
|
+
var _metadata = _objectSpread({}, metadata),
|
|
64
|
+
source = _metadata.source;
|
|
58
65
|
if (event.currentTarget === document && (source !== 'keydown' || event.key === 'Escape')) {
|
|
59
66
|
source = 'rootClose';
|
|
60
67
|
}
|
|
61
68
|
if (isClosingPermitted(source)) {
|
|
62
69
|
setInternalShow(false);
|
|
63
|
-
onToggle
|
|
70
|
+
onToggle === null || onToggle === void 0 ? void 0 : onToggle(isOpen, event, metadata);
|
|
64
71
|
}
|
|
65
72
|
};
|
|
66
73
|
return /*#__PURE__*/React.createElement(BaseDropdown, _extends({
|
|
67
|
-
className: classNames('pgn__dropdown',
|
|
74
|
+
className: classNames('pgn__dropdown', "pgn__dropdown-".concat(variant), className),
|
|
68
75
|
"data-testid": "dropdown",
|
|
69
76
|
onToggle: handleToggle,
|
|
70
77
|
ref: ref,
|
|
@@ -85,17 +92,15 @@ Dropdown.defaultProps = {
|
|
|
85
92
|
show: false,
|
|
86
93
|
variant: 'light'
|
|
87
94
|
};
|
|
88
|
-
|
|
95
|
+
var DropdownToggle = /*#__PURE__*/React.forwardRef(
|
|
89
96
|
// eslint-disable-next-line prefer-arrow-callback
|
|
90
97
|
function DropdownToggle(_ref2, ref) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
bsPrefix
|
|
94
|
-
} = _ref2,
|
|
98
|
+
var as = _ref2.as,
|
|
99
|
+
bsPrefix = _ref2.bsPrefix,
|
|
95
100
|
otherProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
96
101
|
// hide arrow from the toggle if it is rendered as IconButton
|
|
97
102
|
// because it hinders the positioning of IconButton
|
|
98
|
-
|
|
103
|
+
var prefix = as === IconButton ? 'pgn__dropdown-toggle-iconbutton' : bsPrefix;
|
|
99
104
|
return /*#__PURE__*/React.createElement(BaseDropdownToggle, _extends({}, otherProps, {
|
|
100
105
|
as: as,
|
|
101
106
|
bsPrefix: prefix,
|
|
@@ -117,9 +122,7 @@ DropdownToggle.defaultProps = {
|
|
|
117
122
|
Dropdown.Item = /*#__PURE__*/React.forwardRef(
|
|
118
123
|
// eslint-disable-next-line prefer-arrow-callback
|
|
119
124
|
function DropdownItem(_ref3, ref) {
|
|
120
|
-
|
|
121
|
-
className
|
|
122
|
-
} = _ref3,
|
|
125
|
+
var className = _ref3.className,
|
|
123
126
|
otherProps = _objectWithoutProperties(_ref3, _excluded3);
|
|
124
127
|
return /*#__PURE__*/React.createElement(BaseDropdownItem, _extends({
|
|
125
128
|
className: classNames(className, 'pgn__dropdown-item'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","classNames","PropTypes","BaseDropdown","DropdownMenu","BaseDropdownItem","BaseDropdownToggle","DropdownDeprecated","Button","IconButton","Dropdown","forwardRef","_ref","ref","show","autoClose","onToggle","variant","className","rest","_objectWithoutProperties","_excluded","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","classNames","PropTypes","BaseDropdown","DropdownMenu","BaseDropdownItem","BaseDropdownToggle","DropdownDeprecated","Button","IconButton","Dropdown","forwardRef","_ref","ref","show","autoClose","onToggle","variant","className","rest","_objectWithoutProperties","_excluded","_React$useState","useState","_React$useState2","_slicedToArray","internalShow","setInternalShow","isClosingPermitted","source","handleToggle","isOpen","event","metadata","_metadata","_objectSpread","currentTarget","document","key","createElement","_extends","concat","propTypes","oneOfType","string","bool","func","oneOf","defaultProps","undefined","DropdownToggle","_ref2","as","bsPrefix","otherProps","_excluded2","prefix","elementType","id","number","isRequired","Item","DropdownItem","_ref3","_excluded3","Deprecated","Toggle","Menu","Header","Divider","default","DropdownButton","SplitButton"],"sources":["../../src/Dropdown/index.jsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport BaseDropdown from 'react-bootstrap/Dropdown';\nimport DropdownMenu from 'react-bootstrap/DropdownMenu';\nimport BaseDropdownItem from 'react-bootstrap/DropdownItem';\nimport BaseDropdownToggle from 'react-bootstrap/DropdownToggle';\nimport DropdownDeprecated from './deprecated';\nimport Button from '../Button';\nimport IconButton from '../IconButton';\n\nconst Dropdown = React.forwardRef(\n // eslint-disable-next-line prefer-arrow-callback\n function Dropdown({\n show,\n autoClose,\n onToggle,\n variant,\n className,\n ...rest\n }, ref) {\n const [internalShow, setInternalShow] = React.useState(show);\n const isClosingPermitted = (source) => {\n // autoClose=false only permits close on button click\n if (autoClose === false) {\n return source === 'click';\n }\n // autoClose=inside doesn't permit close on rootClose\n if (autoClose === 'inside') {\n return source !== 'rootClose';\n }\n // autoClose=outside doesn't permit close on select\n if (autoClose === 'outside') {\n return source !== 'select';\n }\n return true;\n };\n\n const handleToggle = (isOpen, event, metadata) => {\n if (isOpen) {\n setInternalShow(true);\n onToggle?.(isOpen, event, metadata);\n return;\n }\n let { source } = { ...metadata };\n\n if (event.currentTarget === document && (source !== 'keydown' || event.key === 'Escape')) {\n source = 'rootClose';\n }\n if (isClosingPermitted(source)) {\n setInternalShow(false);\n onToggle?.(isOpen, event, metadata);\n }\n };\n\n return (\n <BaseDropdown\n className={classNames(\n 'pgn__dropdown',\n `pgn__dropdown-${variant}`,\n className,\n )}\n data-testid=\"dropdown\"\n onToggle={handleToggle}\n ref={ref}\n show={internalShow}\n {...rest}\n />\n );\n },\n);\n\nDropdown.propTypes = {\n autoClose: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.bool,\n ]),\n className: PropTypes.string,\n onToggle: PropTypes.func,\n show: PropTypes.bool,\n variant: PropTypes.oneOf(['light', 'dark']),\n};\n\nDropdown.defaultProps = {\n autoClose: true,\n className: '',\n onToggle: undefined,\n show: false,\n variant: 'light',\n};\n\nconst DropdownToggle = React.forwardRef(\n // eslint-disable-next-line prefer-arrow-callback\n function DropdownToggle({\n as,\n bsPrefix,\n ...otherProps\n }, ref) {\n // hide arrow from the toggle if it is rendered as IconButton\n // because it hinders the positioning of IconButton\n const prefix = as === IconButton ? 'pgn__dropdown-toggle-iconbutton' : bsPrefix;\n return <BaseDropdownToggle {...otherProps} as={as} bsPrefix={prefix} ref={ref} />;\n },\n);\n\nDropdownToggle.propTypes = {\n /** Specifies the base element. */\n as: PropTypes.elementType,\n /** Overrides underlying component base CSS class name. */\n bsPrefix: PropTypes.string,\n /** An html id attribute, necessary for assistive technologies, such as screen readers. */\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n};\n\nDropdownToggle.defaultProps = {\n as: Button,\n bsPrefix: 'dropdown-toggle',\n};\n\nDropdown.Item = React.forwardRef(\n // eslint-disable-next-line prefer-arrow-callback\n function DropdownItem({ className, ...otherProps }, ref) {\n return (\n <BaseDropdownItem\n className={classNames(className, 'pgn__dropdown-item')}\n ref={ref}\n {...otherProps}\n />\n );\n },\n);\n\nDropdown.Item.propTypes = {\n className: PropTypes.string,\n};\n\nDropdown.Item.defaultProps = {\n className: undefined,\n};\n\nDropdown.Deprecated = DropdownDeprecated;\nDropdown.Toggle = DropdownToggle;\nDropdown.Menu = DropdownMenu;\nDropdown.Header = BaseDropdown.Header;\nDropdown.Divider = BaseDropdown.Divider;\n\nexport default Dropdown;\nexport { DropdownToggle };\nexport { default as DropdownButton } from 'react-bootstrap/DropdownButton';\nexport { default as SplitButton } from 'react-bootstrap/SplitButton';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,YAAY,MAAM,0BAA0B;AACnD,OAAOC,YAAY,MAAM,8BAA8B;AACvD,OAAOC,gBAAgB,MAAM,8BAA8B;AAC3D,OAAOC,kBAAkB,MAAM,gCAAgC;AAC/D,OAAOC,kBAAkB,MAAM,cAA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