@openedx/paragon 21.12.1 → 21.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/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/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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableRow.js","names":["React","useContext","PropTypes","classNames","TableCell","DataTableContext","TableRow","_ref","row","getRowProps","cells","id","isSelected","isExpanded","renderRowSubComponent","visibleColumns","createElement","Fragment","className","map","cell","_extends","key","column","Header","colSpan","length","propTypes","shape","func","isRequired","arrayOf","string","bool"],"sources":["../../src/DataTable/TableRow.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport TableCell from './TableCell';\nimport DataTableContext from './DataTableContext';\n\nfunction TableRow({ row }) {\n const {\n getRowProps, cells, id, isSelected, isExpanded,\n } = row;\n const { renderRowSubComponent, visibleColumns } = useContext(DataTableContext);\n\n return (\n <>\n <tr {...getRowProps({\n className: classNames({\n 'pgn__data-table-row': true,\n 'is-selected': isSelected,\n }),\n })}\n >\n {cells.map(cell => <TableCell {...cell} key={`${cell.column.Header}${id}`} />)}\n </tr>\n {isExpanded && renderRowSubComponent ? (\n <tr>\n <td colSpan={visibleColumns.length}>\n {renderRowSubComponent({ row })}\n </td>\n </tr>\n ) : null}\n </>\n );\n}\n\nTableRow.propTypes = {\n /** Row data that is received from `react-table` API. */\n row: PropTypes.shape({\n /** props to include on the tr tag (must include id) */\n getRowProps: PropTypes.func.isRequired,\n /** cells in the row */\n cells: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n /** row id */\n id: PropTypes.string.isRequired,\n /** indicates if row has been selected */\n isSelected: PropTypes.bool,\n /** Indicates if row has been expanded. */\n isExpanded: PropTypes.bool,\n }).isRequired,\n};\n\nexport default TableRow;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,SAAS,MAAM,aAAa;AACnC,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,SAASC,QAAQA,CAAAC,IAAA,EAAU;EAAA,
|
|
1
|
+
{"version":3,"file":"TableRow.js","names":["React","useContext","PropTypes","classNames","TableCell","DataTableContext","TableRow","_ref","row","getRowProps","cells","id","isSelected","isExpanded","_useContext","renderRowSubComponent","visibleColumns","createElement","Fragment","className","map","cell","_extends","key","concat","column","Header","colSpan","length","propTypes","shape","func","isRequired","arrayOf","string","bool"],"sources":["../../src/DataTable/TableRow.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport TableCell from './TableCell';\nimport DataTableContext from './DataTableContext';\n\nfunction TableRow({ row }) {\n const {\n getRowProps, cells, id, isSelected, isExpanded,\n } = row;\n const { renderRowSubComponent, visibleColumns } = useContext(DataTableContext);\n\n return (\n <>\n <tr {...getRowProps({\n className: classNames({\n 'pgn__data-table-row': true,\n 'is-selected': isSelected,\n }),\n })}\n >\n {cells.map(cell => <TableCell {...cell} key={`${cell.column.Header}${id}`} />)}\n </tr>\n {isExpanded && renderRowSubComponent ? (\n <tr>\n <td colSpan={visibleColumns.length}>\n {renderRowSubComponent({ row })}\n </td>\n </tr>\n ) : null}\n </>\n );\n}\n\nTableRow.propTypes = {\n /** Row data that is received from `react-table` API. */\n row: PropTypes.shape({\n /** props to include on the tr tag (must include id) */\n getRowProps: PropTypes.func.isRequired,\n /** cells in the row */\n cells: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n /** row id */\n id: PropTypes.string.isRequired,\n /** indicates if row has been selected */\n isSelected: PropTypes.bool,\n /** Indicates if row has been expanded. */\n isExpanded: PropTypes.bool,\n }).isRequired,\n};\n\nexport default TableRow;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,SAAS,MAAM,aAAa;AACnC,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,SAASC,QAAQA,CAAAC,IAAA,EAAU;EAAA,IAAPC,GAAG,GAAAD,IAAA,CAAHC,GAAG;EACrB,IACEC,WAAW,GACTD,GAAG,CADLC,WAAW;IAAEC,KAAK,GAChBF,GAAG,CADQE,KAAK;IAAEC,EAAE,GACpBH,GAAG,CADeG,EAAE;IAAEC,UAAU,GAChCJ,GAAG,CADmBI,UAAU;IAAEC,UAAU,GAC5CL,GAAG,CAD+BK,UAAU;EAEhD,IAAAC,WAAA,GAAkDb,UAAU,CAACI,gBAAgB,CAAC;IAAtEU,qBAAqB,GAAAD,WAAA,CAArBC,qBAAqB;IAAEC,cAAc,GAAAF,WAAA,CAAdE,cAAc;EAE7C,oBACEhB,KAAA,CAAAiB,aAAA,CAAAjB,KAAA,CAAAkB,QAAA,qBACElB,KAAA,CAAAiB,aAAA,OAAQR,WAAW,CAAC;IAClBU,SAAS,EAAEhB,UAAU,CAAC;MACpB,qBAAqB,EAAE,IAAI;MAC3B,aAAa,EAAES;IACjB,CAAC;EACH,CAAC,CAAC,EAECF,KAAK,CAACU,GAAG,CAAC,UAAAC,IAAI;IAAA,oBAAIrB,KAAA,CAAAiB,aAAA,CAACb,SAAS,EAAAkB,QAAA,KAAKD,IAAI;MAAEE,GAAG,KAAAC,MAAA,CAAKH,IAAI,CAACI,MAAM,CAACC,MAAM,EAAAF,MAAA,CAAGb,EAAE;IAAG,EAAE,CAAC;EAAA,EAC3E,CAAC,EACJE,UAAU,IAAIE,qBAAqB,gBAClCf,KAAA,CAAAiB,aAAA,0BACEjB,KAAA,CAAAiB,aAAA;IAAIU,OAAO,EAAEX,cAAc,CAACY;EAAO,GAChCb,qBAAqB,CAAC;IAAEP,GAAG,EAAHA;EAAI,CAAC,CAC5B,CACF,CAAC,GACH,IACJ,CAAC;AAEP;AAEAF,QAAQ,CAACuB,SAAS,GAAG;EACnB;EACArB,GAAG,EAAEN,SAAS,CAAC4B,KAAK,CAAC;IACnB;IACArB,WAAW,EAAEP,SAAS,CAAC6B,IAAI,CAACC,UAAU;IACtC;IACAtB,KAAK,EAAER,SAAS,CAAC+B,OAAO,CAAC/B,SAAS,CAAC4B,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAACE,UAAU;IACxD;IACArB,EAAE,EAAET,SAAS,CAACgC,MAAM,CAACF,UAAU;IAC/B;IACApB,UAAU,EAAEV,SAAS,CAACiC,IAAI;IAC1B;IACAtB,UAAU,EAAEX,SAAS,CAACiC;EACxB,CAAC,CAAC,CAACH;AACL,CAAC;AAED,eAAe1B,QAAQ"}
|
|
@@ -5,27 +5,28 @@ import Badge from '../../Badge';
|
|
|
5
5
|
import Stack from '../../Stack';
|
|
6
6
|
import { newId } from '../../utils';
|
|
7
7
|
function CheckboxFilter(_ref) {
|
|
8
|
-
|
|
9
|
-
column
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
getHeaderProps
|
|
15
|
-
}
|
|
16
|
-
} = _ref;
|
|
8
|
+
var _ref$column = _ref.column,
|
|
9
|
+
filterValue = _ref$column.filterValue,
|
|
10
|
+
setFilter = _ref$column.setFilter,
|
|
11
|
+
Header = _ref$column.Header,
|
|
12
|
+
filterChoices = _ref$column.filterChoices,
|
|
13
|
+
getHeaderProps = _ref$column.getHeaderProps;
|
|
17
14
|
// creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
var ariaLabel = useRef(newId("checkbox-filter-label-".concat(getHeaderProps().key, "-")));
|
|
16
|
+
var checkedBoxes = filterValue || [];
|
|
17
|
+
var changeCheckbox = function changeCheckbox(value) {
|
|
21
18
|
if (checkedBoxes.includes(value)) {
|
|
22
|
-
|
|
19
|
+
var newCheckedBoxes = checkedBoxes.filter(function (val) {
|
|
20
|
+
return val !== value;
|
|
21
|
+
});
|
|
23
22
|
return setFilter(newCheckedBoxes);
|
|
24
23
|
}
|
|
25
24
|
checkedBoxes.push(value);
|
|
26
25
|
return setFilter(checkedBoxes);
|
|
27
26
|
};
|
|
28
|
-
|
|
27
|
+
var headerBasedId = useMemo(function () {
|
|
28
|
+
return "checkbox-filter-check-".concat(getHeaderProps().key, "-");
|
|
29
|
+
}, [getHeaderProps]);
|
|
29
30
|
return /*#__PURE__*/React.createElement(Form.Group, {
|
|
30
31
|
role: "group",
|
|
31
32
|
"aria-labelledby": ariaLabel.current
|
|
@@ -34,17 +35,17 @@ function CheckboxFilter(_ref) {
|
|
|
34
35
|
className: "pgn__checkbox-filter-label"
|
|
35
36
|
}, Header), /*#__PURE__*/React.createElement(Form.CheckboxSet, {
|
|
36
37
|
name: Header
|
|
37
|
-
}, filterChoices.map(_ref2
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
value
|
|
42
|
-
} = _ref2;
|
|
38
|
+
}, filterChoices.map(function (_ref2) {
|
|
39
|
+
var name = _ref2.name,
|
|
40
|
+
number = _ref2.number,
|
|
41
|
+
value = _ref2.value;
|
|
43
42
|
return /*#__PURE__*/React.createElement(Form.Checkbox, {
|
|
44
|
-
key:
|
|
43
|
+
key: "".concat(headerBasedId).concat(name),
|
|
45
44
|
value: name,
|
|
46
45
|
checked: checkedBoxes.includes(value),
|
|
47
|
-
onChange: ()
|
|
46
|
+
onChange: function onChange() {
|
|
47
|
+
return changeCheckbox(value);
|
|
48
|
+
},
|
|
48
49
|
"aria-label": name
|
|
49
50
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
50
51
|
direction: "horizontal",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxFilter.js","names":["React","useRef","useMemo","PropTypes","Form","FormLabel","Badge","Stack","newId","CheckboxFilter","_ref","column","filterValue","setFilter","Header","filterChoices","getHeaderProps","ariaLabel","key","checkedBoxes","changeCheckbox","value","includes","newCheckedBoxes","filter","val","push","headerBasedId","createElement","Group","role","current","id","className","CheckboxSet","name","map","_ref2","number","Checkbox","checked","onChange","direction","gap","undefined","variant","propTypes","shape","func","isRequired","oneOfType","elementType","node","arrayOf","string"],"sources":["../../../src/DataTable/filters/CheckboxFilter.jsx"],"sourcesContent":["import React, { useRef, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport Form, { FormLabel } from '../../Form';\nimport Badge from '../../Badge';\nimport Stack from '../../Stack';\nimport { newId } from '../../utils';\n\nfunction CheckboxFilter({\n column: {\n filterValue, setFilter, Header, filterChoices, getHeaderProps,\n },\n}) {\n // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom\n const ariaLabel = useRef(newId(`checkbox-filter-label-${getHeaderProps().key}-`));\n\n const checkedBoxes = filterValue || [];\n const changeCheckbox = (value) => {\n if (checkedBoxes.includes(value)) {\n const newCheckedBoxes = checkedBoxes.filter((val) => val !== value);\n return setFilter(newCheckedBoxes);\n }\n checkedBoxes.push(value);\n return setFilter(checkedBoxes);\n };\n const headerBasedId = useMemo(() => `checkbox-filter-check-${getHeaderProps().key}-`, [getHeaderProps]);\n\n return (\n <Form.Group role=\"group\" aria-labelledby={ariaLabel.current}>\n <FormLabel id={ariaLabel.current} className=\"pgn__checkbox-filter-label\">{Header}</FormLabel>\n <Form.CheckboxSet name={Header}>\n {filterChoices.map(({ name, number, value }) => (\n <Form.Checkbox\n key={`${headerBasedId}${name}`}\n value={name}\n checked={checkedBoxes.includes(value)}\n onChange={() => changeCheckbox(value)}\n aria-label={name}\n >\n <Stack direction=\"horizontal\" gap={2}>\n {name} {number !== undefined && <Badge variant=\"light\">{number}</Badge>}\n </Stack>\n </Form.Checkbox>\n ))}\n </Form.CheckboxSet>\n </Form.Group>\n );\n}\n\nCheckboxFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `filterChoices`: Specifies array of choices.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n *\n * `filterValue`: Value for the filter input.\n */\n column: PropTypes.shape({\n setFilter: PropTypes.func.isRequired,\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n number: PropTypes.number,\n })).isRequired,\n getHeaderProps: PropTypes.func.isRequired,\n filterValue: PropTypes.arrayOf(PropTypes.string),\n }).isRequired,\n};\n\nexport default CheckboxFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,OAAO,QAAQ,OAAO;AAC9C,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,IAAIC,SAAS,QAAQ,YAAY;AAC5C,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,KAAK,MAAM,aAAa;AAC/B,SAASC,KAAK,QAAQ,aAAa;AAEnC,SAASC,cAAcA,CAAAC,IAAA,EAIpB;EAAA,
|
|
1
|
+
{"version":3,"file":"CheckboxFilter.js","names":["React","useRef","useMemo","PropTypes","Form","FormLabel","Badge","Stack","newId","CheckboxFilter","_ref","_ref$column","column","filterValue","setFilter","Header","filterChoices","getHeaderProps","ariaLabel","concat","key","checkedBoxes","changeCheckbox","value","includes","newCheckedBoxes","filter","val","push","headerBasedId","createElement","Group","role","current","id","className","CheckboxSet","name","map","_ref2","number","Checkbox","checked","onChange","direction","gap","undefined","variant","propTypes","shape","func","isRequired","oneOfType","elementType","node","arrayOf","string"],"sources":["../../../src/DataTable/filters/CheckboxFilter.jsx"],"sourcesContent":["import React, { useRef, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport Form, { FormLabel } from '../../Form';\nimport Badge from '../../Badge';\nimport Stack from '../../Stack';\nimport { newId } from '../../utils';\n\nfunction CheckboxFilter({\n column: {\n filterValue, setFilter, Header, filterChoices, getHeaderProps,\n },\n}) {\n // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom\n const ariaLabel = useRef(newId(`checkbox-filter-label-${getHeaderProps().key}-`));\n\n const checkedBoxes = filterValue || [];\n const changeCheckbox = (value) => {\n if (checkedBoxes.includes(value)) {\n const newCheckedBoxes = checkedBoxes.filter((val) => val !== value);\n return setFilter(newCheckedBoxes);\n }\n checkedBoxes.push(value);\n return setFilter(checkedBoxes);\n };\n const headerBasedId = useMemo(() => `checkbox-filter-check-${getHeaderProps().key}-`, [getHeaderProps]);\n\n return (\n <Form.Group role=\"group\" aria-labelledby={ariaLabel.current}>\n <FormLabel id={ariaLabel.current} className=\"pgn__checkbox-filter-label\">{Header}</FormLabel>\n <Form.CheckboxSet name={Header}>\n {filterChoices.map(({ name, number, value }) => (\n <Form.Checkbox\n key={`${headerBasedId}${name}`}\n value={name}\n checked={checkedBoxes.includes(value)}\n onChange={() => changeCheckbox(value)}\n aria-label={name}\n >\n <Stack direction=\"horizontal\" gap={2}>\n {name} {number !== undefined && <Badge variant=\"light\">{number}</Badge>}\n </Stack>\n </Form.Checkbox>\n ))}\n </Form.CheckboxSet>\n </Form.Group>\n );\n}\n\nCheckboxFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `filterChoices`: Specifies array of choices.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n *\n * `filterValue`: Value for the filter input.\n */\n column: PropTypes.shape({\n setFilter: PropTypes.func.isRequired,\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n number: PropTypes.number,\n })).isRequired,\n getHeaderProps: PropTypes.func.isRequired,\n filterValue: PropTypes.arrayOf(PropTypes.string),\n }).isRequired,\n};\n\nexport default CheckboxFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,OAAO,QAAQ,OAAO;AAC9C,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,IAAIC,SAAS,QAAQ,YAAY;AAC5C,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,KAAK,MAAM,aAAa;AAC/B,SAASC,KAAK,QAAQ,aAAa;AAEnC,SAASC,cAAcA,CAAAC,IAAA,EAIpB;EAAA,IAAAC,WAAA,GAAAD,IAAA,CAHDE,MAAM;IACJC,WAAW,GAAAF,WAAA,CAAXE,WAAW;IAAEC,SAAS,GAAAH,WAAA,CAATG,SAAS;IAAEC,MAAM,GAAAJ,WAAA,CAANI,MAAM;IAAEC,aAAa,GAAAL,WAAA,CAAbK,aAAa;IAAEC,cAAc,GAAAN,WAAA,CAAdM,cAAc;EAG/D;EACA,IAAMC,SAAS,GAAGjB,MAAM,CAACO,KAAK,0BAAAW,MAAA,CAA0BF,cAAc,CAAC,CAAC,CAACG,GAAG,MAAG,CAAC,CAAC;EAEjF,IAAMC,YAAY,GAAGR,WAAW,IAAI,EAAE;EACtC,IAAMS,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,KAAK,EAAK;IAChC,IAAIF,YAAY,CAACG,QAAQ,CAACD,KAAK,CAAC,EAAE;MAChC,IAAME,eAAe,GAAGJ,YAAY,CAACK,MAAM,CAAC,UAACC,GAAG;QAAA,OAAKA,GAAG,KAAKJ,KAAK;MAAA,EAAC;MACnE,OAAOT,SAAS,CAACW,eAAe,CAAC;IACnC;IACAJ,YAAY,CAACO,IAAI,CAACL,KAAK,CAAC;IACxB,OAAOT,SAAS,CAACO,YAAY,CAAC;EA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CAAC;EAAA,CACjB,CACe,CACR,CAAC;AAEjB;AAEA/B,cAAc,CAACuC,SAAS,GAAG;EACzB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEpC,MAAM,EAAET,SAAS,CAAC8C,KAAK,CAAC;IACtBnC,SAAS,EAAEX,SAAS,CAAC+C,IAAI,CAACC,UAAU;IACpCpC,MAAM,EAAEZ,SAAS,CAACiD,SAAS,CAAC,CAACjD,SAAS,CAACkD,WAAW,EAAElD,SAAS,CAACmD,IAAI,CAAC,CAAC,CAACH,UAAU;IAC/EnC,aAAa,EAAEb,SAAS,CAACoD,OAAO,CAACpD,SAAS,CAAC8C,KAAK,CAAC;MAC/CZ,IAAI,EAAElC,SAAS,CAACqD,MAAM,CAACL,UAAU;MACjC5B,KAAK,EAAEpB,SAAS,CAACiD,SAAS,CAAC,CAACjD,SAAS,CAACqD,MAAM,EAAErD,SAAS,CAACqC,MAAM,CAAC,CAAC;MAChEA,MAAM,EAAErC,SAAS,CAACqC;IACpB,CAAC,CAAC,CAAC,CAACW,UAAU;IACdlC,cAAc,EAAEd,SAAS,CAAC+C,IAAI,CAACC,UAAU;IACzCtC,WAAW,EAAEV,SAAS,CAACoD,OAAO,CAACpD,SAAS,CAACqD,MAAM;EACjD,CAAC,CAAC,CAACL;AACL,CAAC;AAED,eAAe1C,cAAc"}
|
|
@@ -2,19 +2,16 @@ import React, { useRef } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import Form from '../../Form';
|
|
4
4
|
import { newId } from '../../utils';
|
|
5
|
-
|
|
5
|
+
var DEFAULT_VALUE = '';
|
|
6
6
|
function DropdownFilter(_ref) {
|
|
7
|
-
|
|
8
|
-
column
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
getHeaderProps
|
|
13
|
-
}
|
|
14
|
-
} = _ref;
|
|
7
|
+
var _ref$column = _ref.column,
|
|
8
|
+
setFilter = _ref$column.setFilter,
|
|
9
|
+
Header = _ref$column.Header,
|
|
10
|
+
filterChoices = _ref$column.filterChoices,
|
|
11
|
+
getHeaderProps = _ref$column.getHeaderProps;
|
|
15
12
|
// creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
var ariaLabel = useRef(newId("dropdown-filter-label-".concat(getHeaderProps().key, "-")));
|
|
14
|
+
var onChange = function onChange(e) {
|
|
18
15
|
if (e.target.value === DEFAULT_VALUE) {
|
|
19
16
|
// setting undefined resets the filter
|
|
20
17
|
return setFilter(undefined);
|
|
@@ -26,21 +23,19 @@ function DropdownFilter(_ref) {
|
|
|
26
23
|
className: "sr-only"
|
|
27
24
|
}, Header), /*#__PURE__*/React.createElement(Form.Control, {
|
|
28
25
|
as: "select",
|
|
29
|
-
default: DEFAULT_VALUE,
|
|
26
|
+
"default": DEFAULT_VALUE,
|
|
30
27
|
onChange: onChange,
|
|
31
28
|
"aria-labelledby": ariaLabel.current
|
|
32
29
|
}, /*#__PURE__*/React.createElement("option", {
|
|
33
30
|
value: DEFAULT_VALUE
|
|
34
|
-
}, Header), filterChoices.map(_ref2
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
value
|
|
39
|
-
} = _ref2;
|
|
31
|
+
}, Header), filterChoices.map(function (_ref2) {
|
|
32
|
+
var name = _ref2.name,
|
|
33
|
+
number = _ref2.number,
|
|
34
|
+
value = _ref2.value;
|
|
40
35
|
return /*#__PURE__*/React.createElement("option", {
|
|
41
36
|
key: value,
|
|
42
37
|
value: value
|
|
43
|
-
}, name, " ", number &&
|
|
38
|
+
}, name, " ", number && "(".concat(number, ")"));
|
|
44
39
|
})));
|
|
45
40
|
}
|
|
46
41
|
DropdownFilter.propTypes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownFilter.js","names":["React","useRef","PropTypes","Form","newId","DEFAULT_VALUE","DropdownFilter","_ref","column","setFilter","Header","filterChoices","getHeaderProps","ariaLabel","key","onChange","e","target","value","undefined","createElement","Group","Label","id","current","className","Control","as","
|
|
1
|
+
{"version":3,"file":"DropdownFilter.js","names":["React","useRef","PropTypes","Form","newId","DEFAULT_VALUE","DropdownFilter","_ref","_ref$column","column","setFilter","Header","filterChoices","getHeaderProps","ariaLabel","concat","key","onChange","e","target","value","undefined","createElement","Group","Label","id","current","className","Control","as","map","_ref2","name","number","propTypes","shape","func","isRequired","oneOfType","elementType","node","arrayOf","string"],"sources":["../../../src/DataTable/filters/DropdownFilter.jsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Form from '../../Form';\nimport { newId } from '../../utils';\n\nconst DEFAULT_VALUE = '';\n\nfunction DropdownFilter({\n column: {\n setFilter, Header, filterChoices, getHeaderProps,\n },\n}) {\n // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom\n const ariaLabel = useRef(newId(`dropdown-filter-label-${getHeaderProps().key}-`));\n const onChange = (e) => {\n if (e.target.value === DEFAULT_VALUE) {\n // setting undefined resets the filter\n return setFilter(undefined);\n }\n return setFilter(e.target.value);\n };\n\n return (\n <Form.Group>\n <Form.Label id={ariaLabel.current} className=\"sr-only\">{Header}</Form.Label>\n <Form.Control\n as=\"select\"\n default={DEFAULT_VALUE}\n onChange={onChange}\n aria-labelledby={ariaLabel.current}\n >\n <option value={DEFAULT_VALUE}>{Header}</option>\n {filterChoices.map(({ name, number, value }) => (<option key={value} value={value}>{name} {number && `(${number})`}</option>))}\n </Form.Control>\n </Form.Group>\n );\n}\n\nDropdownFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `filterChoices`: Specifies array of choices.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n */\n column: PropTypes.shape({\n setFilter: PropTypes.func.isRequired,\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n number: PropTypes.number,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n })).isRequired,\n getHeaderProps: PropTypes.func.isRequired,\n }).isRequired,\n};\n\nexport default DropdownFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,MAAM,YAAY;AAC7B,SAASC,KAAK,QAAQ,aAAa;AAEnC,IAAMC,aAAa,GAAG,EAAE;AAExB,SAASC,cAAcA,CAAAC,IAAA,EAIpB;EAAA,IAAAC,WAAA,GAAAD,IAAA,CAHDE,MAAM;IACJC,SAAS,GAAAF,WAAA,CAATE,SAAS;IAAEC,MAAM,GAAAH,WAAA,CAANG,MAAM;IAAEC,aAAa,GAAAJ,WAAA,CAAbI,aAAa;IAAEC,cAAc,GAAAL,WAAA,CAAdK,cAAc;EAGlD;EACA,IAAMC,SAAS,GAAGb,MAAM,CAACG,KAAK,0BAAAW,MAAA,CAA0BF,cAAc,CAAC,CAAC,CAACG,GAAG,MAAG,CAAC,CAAC;EACjF,IAAMC,QAAQ,GAAG,SAAXA,QAAQA,CAAIC,CAAC,EAAK;IACtB,IAAIA,CAAC,CAACC,MAAM,CAACC,KAAK,KAAKf,aAAa,EAAE;MACpC;MACA,OAAOK,SAAS,CAACW,SAAS,CAAC;IAC7B;IACA,OAAOX,SAAS,CAACQ,CAAC,CAACC,MAAM,CAACC,KAAK,CAAC;EAClC,CAAC;EAED,oBACEpB,KAAA,CAAAsB,aAAA,CAACnB,IAAI,CAACoB,KAAK,qBACTvB,KAAA,CAAAsB,aAAA,CAACnB,IAAI,CAACqB,KAAK;IAACC,EAAE,EAAEX,SAAS,CAACY,OAAQ;IAACC,SAAS,EAAC;EAAS,GAAEhB,MAAmB,CAAC,eAC5EX,KAAA,CAAAsB,aAAA,CAACnB,IAAI,CAACyB,OAAO;IACXC,EAAE,EAAC,Q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AC,CAACA;AACL,CAAC;AAED,eAAe/B,cAAc"}
|
|
@@ -6,21 +6,20 @@ import { DropdownButton } from '../../Dropdown';
|
|
|
6
6
|
import { newId } from '../../utils';
|
|
7
7
|
import Form from '../../Form';
|
|
8
8
|
function MultiSelectDropdownFilter(_ref) {
|
|
9
|
-
|
|
10
|
-
column
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
filterValue
|
|
16
|
-
}
|
|
17
|
-
} = _ref;
|
|
9
|
+
var _ref$column = _ref.column,
|
|
10
|
+
setFilter = _ref$column.setFilter,
|
|
11
|
+
Header = _ref$column.Header,
|
|
12
|
+
filterChoices = _ref$column.filterChoices,
|
|
13
|
+
getHeaderProps = _ref$column.getHeaderProps,
|
|
14
|
+
filterValue = _ref$column.filterValue;
|
|
18
15
|
// creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
var ariaLabel = useRef(newId("multi-dropdown-filter-label-".concat(getHeaderProps().key, "-")));
|
|
17
|
+
var checkedBoxes = filterValue || [];
|
|
18
|
+
var changeCheckbox = function changeCheckbox(value) {
|
|
22
19
|
if (checkedBoxes.includes(value)) {
|
|
23
|
-
|
|
20
|
+
var newCheckedBoxes = checkedBoxes.filter(function (val) {
|
|
21
|
+
return val !== value;
|
|
22
|
+
});
|
|
24
23
|
return setFilter(newCheckedBoxes);
|
|
25
24
|
}
|
|
26
25
|
checkedBoxes.push(value);
|
|
@@ -34,17 +33,17 @@ function MultiSelectDropdownFilter(_ref) {
|
|
|
34
33
|
className: "pgn__dropdown-filter-checkbox-group",
|
|
35
34
|
name: Header,
|
|
36
35
|
"aria-label": Header
|
|
37
|
-
}, filterChoices.map(_ref2
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
value
|
|
42
|
-
} = _ref2;
|
|
36
|
+
}, filterChoices.map(function (_ref2) {
|
|
37
|
+
var name = _ref2.name,
|
|
38
|
+
number = _ref2.number,
|
|
39
|
+
value = _ref2.value;
|
|
43
40
|
return /*#__PURE__*/React.createElement(Form.Checkbox, {
|
|
44
41
|
key: name,
|
|
45
42
|
value: name,
|
|
46
43
|
checked: checkedBoxes.includes(value),
|
|
47
|
-
onChange: ()
|
|
44
|
+
onChange: function onChange() {
|
|
45
|
+
return changeCheckbox(value);
|
|
46
|
+
},
|
|
48
47
|
"aria-label": name
|
|
49
48
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
50
49
|
direction: "horizontal",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelectDropdownFilter.js","names":["React","useRef","PropTypes","Badge","Stack","DropdownButton","newId","Form","MultiSelectDropdownFilter","_ref","column","setFilter","Header","filterChoices","getHeaderProps","filterValue","ariaLabel","key","checkedBoxes","changeCheckbox","value","includes","newCheckedBoxes","filter","val","push","createElement","variant","id","current","title","CheckboxSet","className","name","map","_ref2","number","Checkbox","checked","onChange","direction","gap","propTypes","shape","func","isRequired","oneOfType","elementType","node","arrayOf","string"],"sources":["../../../src/DataTable/filters/MultiSelectDropdownFilter.jsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Badge from '../../Badge';\nimport Stack from '../../Stack';\nimport { DropdownButton } from '../../Dropdown';\nimport { newId } from '../../utils';\nimport Form from '../../Form';\n\nfunction MultiSelectDropdownFilter({\n column: {\n setFilter, Header, filterChoices, getHeaderProps, filterValue,\n },\n}) {\n // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom\n const ariaLabel = useRef(newId(`multi-dropdown-filter-label-${getHeaderProps().key}-`));\n const checkedBoxes = filterValue || [];\n const changeCheckbox = (value) => {\n if (checkedBoxes.includes(value)) {\n const newCheckedBoxes = checkedBoxes.filter((val) => val !== value);\n return setFilter(newCheckedBoxes);\n }\n checkedBoxes.push(value);\n return setFilter(checkedBoxes);\n };\n\n return (\n <DropdownButton variant=\"outline-primary\" id={ariaLabel.current} title={Header}>\n <Form.CheckboxSet\n className=\"pgn__dropdown-filter-checkbox-group\"\n name={Header}\n aria-label={Header}\n >\n {filterChoices.map(({ name, number, value }) => (\n <Form.Checkbox\n key={name}\n value={name}\n checked={checkedBoxes.includes(value)}\n onChange={() => changeCheckbox(value)}\n aria-label={name}\n >\n <Stack direction=\"horizontal\" gap={2}>\n {name} {number && <Badge variant=\"light\">{number}</Badge>}\n </Stack>\n </Form.Checkbox>\n ))}\n </Form.CheckboxSet>\n </DropdownButton>\n );\n}\n\nMultiSelectDropdownFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `filterChoices`: Specifies array of choices.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n *\n * `filterValue`: Value for the filter input.\n */\n column: PropTypes.shape({\n /** Function to set the filter value */\n setFilter: PropTypes.func.isRequired,\n /** Column header used for labels and placeholders */\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n /** Names and values for the select options */\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n number: PropTypes.number,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n })).isRequired,\n /** Generates a key unique to the column being filtered */\n getHeaderProps: PropTypes.func.isRequired,\n filterValue: PropTypes.arrayOf(PropTypes.string),\n }).isRequired,\n};\n\nexport default MultiSelectDropdownFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,KAAK,MAAM,aAAa;AAC/B,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,KAAK,QAAQ,aAAa;AACnC,OAAOC,IAAI,MAAM,YAAY;AAE7B,SAASC,yBAAyBA,CAAAC,IAAA,EAI/B;EAAA,
|
|
1
|
+
{"version":3,"file":"MultiSelectDropdownFilter.js","names":["React","useRef","PropTypes","Badge","Stack","DropdownButton","newId","Form","MultiSelectDropdownFilter","_ref","_ref$column","column","setFilter","Header","filterChoices","getHeaderProps","filterValue","ariaLabel","concat","key","checkedBoxes","changeCheckbox","value","includes","newCheckedBoxes","filter","val","push","createElement","variant","id","current","title","CheckboxSet","className","name","map","_ref2","number","Checkbox","checked","onChange","direction","gap","propTypes","shape","func","isRequired","oneOfType","elementType","node","arrayOf","string"],"sources":["../../../src/DataTable/filters/MultiSelectDropdownFilter.jsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Badge from '../../Badge';\nimport Stack from '../../Stack';\nimport { DropdownButton } from '../../Dropdown';\nimport { newId } from '../../utils';\nimport Form from '../../Form';\n\nfunction MultiSelectDropdownFilter({\n column: {\n setFilter, Header, filterChoices, getHeaderProps, filterValue,\n },\n}) {\n // creates a unique label that does not change on re-render in case there are multiple checkbox filters in the dom\n const ariaLabel = useRef(newId(`multi-dropdown-filter-label-${getHeaderProps().key}-`));\n const checkedBoxes = filterValue || [];\n const changeCheckbox = (value) => {\n if (checkedBoxes.includes(value)) {\n const newCheckedBoxes = checkedBoxes.filter((val) => val !== value);\n return setFilter(newCheckedBoxes);\n }\n checkedBoxes.push(value);\n return setFilter(checkedBoxes);\n };\n\n return (\n <DropdownButton variant=\"outline-primary\" id={ariaLabel.current} title={Header}>\n <Form.CheckboxSet\n className=\"pgn__dropdown-filter-checkbox-group\"\n name={Header}\n aria-label={Header}\n >\n {filterChoices.map(({ name, number, value }) => (\n <Form.Checkbox\n key={name}\n value={name}\n checked={checkedBoxes.includes(value)}\n onChange={() => changeCheckbox(value)}\n aria-label={name}\n >\n <Stack direction=\"horizontal\" gap={2}>\n {name} {number && <Badge variant=\"light\">{number}</Badge>}\n </Stack>\n </Form.Checkbox>\n ))}\n </Form.CheckboxSet>\n </DropdownButton>\n );\n}\n\nMultiSelectDropdownFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `filterChoices`: Specifies array of choices.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n *\n * `filterValue`: Value for the filter input.\n */\n column: PropTypes.shape({\n /** Function to set the filter value */\n setFilter: PropTypes.func.isRequired,\n /** Column header used for labels and placeholders */\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n /** Names and values for the select options */\n filterChoices: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n number: PropTypes.number,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n })).isRequired,\n /** Generates a key unique to the column being filtered */\n getHeaderProps: PropTypes.func.isRequired,\n filterValue: PropTypes.arrayOf(PropTypes.string),\n }).isRequired,\n};\n\nexport default MultiSelectDropdownFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,KAAK,MAAM,aAAa;AAC/B,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,KAAK,QAAQ,aAAa;AACnC,OAAOC,IAAI,MAAM,YAAY;AAE7B,SAASC,yBAAyBA,CAAAC,IAAA,EAI/B;EAAA,IAAAC,WAAA,GAAAD,IAAA,CAHDE,MAAM;IACJC,SAAS,GAAAF,WAAA,CAATE,SAAS;IAAEC,MAAM,GAAAH,WAAA,CAANG,MAAM;IAAEC,aAAa,GAAAJ,WAAA,CAAbI,aAAa;IAAEC,cAAc,GAAAL,WAAA,CAAdK,cAAc;IAAEC,WAAW,GAAAN,WAAA,CAAXM,WAAW;EAG/D;EACA,IAAMC,SAAS,GAAGhB,MAAM,CAACK,KAAK,gCAAAY,MAAA,CAAgCH,cAAc,CAAC,CAAC,CAACI,GAAG,MAAG,CAAC,CAAC;EACvF,IAAMC,YAAY,GAAGJ,WAA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AItC,KAAA,CAAA4B,aAAA,CAACzB,KAAK;MAAC0B,OAAO,EAAC;IAAO,GAAES,MAAc,CACnD,CACM,CAAC;EAAA,CACjB,CACe,CACJ,CAAC;AAErB;AAEA9B,yBAAyB,CAACoC,SAAS,GAAG;EACpC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEjC,MAAM,EAAET,SAAS,CAAC2C,KAAK,CAAC;IACtB;IACAjC,SAAS,EAAEV,SAAS,CAAC4C,IAAI,CAACC,UAAU;IACpC;IACAlC,MAAM,EAAEX,SAAS,CAAC8C,SAAS,CAAC,CAAC9C,SAAS,CAAC+C,WAAW,EAAE/C,SAAS,CAACgD,IAAI,CAAC,CAAC,CAACH,UAAU;IAC/E;IACAjC,aAAa,EAAEZ,SAAS,CAACiD,OAAO,CAACjD,SAAS,CAAC2C,KAAK,CAAC;MAC/CV,IAAI,EAAEjC,SAAS,CAACkD,MAAM,CAACL,UAAU;MACjCT,MAAM,EAAEpC,SAAS,CAACoC,MAAM;MACxBhB,KAAK,EAAEpB,SAAS,CAAC8C,SAAS,CAAC,CAAC9C,SAAS,CAACkD,MAAM,EAAElD,SAAS,CAACoC,MAAM,CAAC,CAAC,CAACS;IACnE,CAAC,CAAC,CAAC,CAACA,UAAU;IACd;IACAhC,cAAc,EAAEb,SAAS,CAAC4C,IAAI,CAACC,UAAU;IACzC/B,WAAW,EAAEd,SAAS,CAACiD,OAAO,CAACjD,SAAS,CAACkD,MAAM;EACjD,CAAC,CAAC,CAACL;AACL,CAAC;AAED,eAAevC,yBAAyB"}
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import Form, { FormLabel } from '../../Form';
|
|
4
4
|
import Input from '../../Input';
|
|
5
5
|
import { newId } from '../../utils';
|
|
6
|
-
|
|
6
|
+
var formatHeaderForLabel = function formatHeaderForLabel(header) {
|
|
7
7
|
if (typeof header === 'function') {
|
|
8
8
|
return header();
|
|
9
9
|
}
|
|
@@ -13,17 +13,14 @@ const formatHeaderForLabel = header => {
|
|
|
13
13
|
return header;
|
|
14
14
|
};
|
|
15
15
|
function TextFilter(_ref) {
|
|
16
|
-
|
|
17
|
-
column
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const ariaLabel = useRef(newId(`text-filter-label-${getHeaderProps().key}-`));
|
|
25
|
-
const formattedHeader = formatHeaderForLabel(Header);
|
|
26
|
-
const inputText = /*#__PURE__*/React.isValidElement(formattedHeader) ? formattedHeader : `Search ${formattedHeader}`;
|
|
16
|
+
var _ref$column = _ref.column,
|
|
17
|
+
filterValue = _ref$column.filterValue,
|
|
18
|
+
setFilter = _ref$column.setFilter,
|
|
19
|
+
Header = _ref$column.Header,
|
|
20
|
+
getHeaderProps = _ref$column.getHeaderProps;
|
|
21
|
+
var ariaLabel = useRef(newId("text-filter-label-".concat(getHeaderProps().key, "-")));
|
|
22
|
+
var formattedHeader = formatHeaderForLabel(Header);
|
|
23
|
+
var inputText = /*#__PURE__*/React.isValidElement(formattedHeader) ? formattedHeader : "Search ".concat(formattedHeader);
|
|
27
24
|
return /*#__PURE__*/React.createElement(Form.Group, null, /*#__PURE__*/React.createElement(FormLabel, {
|
|
28
25
|
id: ariaLabel.current,
|
|
29
26
|
className: "sr-only"
|
|
@@ -31,7 +28,7 @@ function TextFilter(_ref) {
|
|
|
31
28
|
"aria-labelledby": ariaLabel.current,
|
|
32
29
|
value: filterValue || '',
|
|
33
30
|
type: "text",
|
|
34
|
-
onChange: e
|
|
31
|
+
onChange: function onChange(e) {
|
|
35
32
|
setFilter(e.target.value || undefined); // Set undefined to remove the filter entirely
|
|
36
33
|
},
|
|
37
34
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextFilter.js","names":["React","useRef","PropTypes","Form","FormLabel","Input","newId","formatHeaderForLabel","header","toLowerCase","TextFilter","_ref","column","filterValue","setFilter","Header","getHeaderProps","ariaLabel","key","formattedHeader","inputText","isValidElement","createElement","Group","id","current","className","value","type","onChange","e","target","undefined","placeholder","propTypes","shape","func","isRequired","oneOfType","elementType","node","string"],"sources":["../../../src/DataTable/filters/TextFilter.jsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Form, { FormLabel } from '../../Form';\nimport Input from '../../Input';\nimport { newId } from '../../utils';\n\nconst formatHeaderForLabel = (header) => {\n if (typeof header === 'function') {\n return header();\n }\n if (typeof header === 'string') {\n return header.toLowerCase();\n }\n return header;\n};\n\nfunction TextFilter({\n column: {\n filterValue, setFilter, Header, getHeaderProps,\n },\n}) {\n const ariaLabel = useRef(newId(`text-filter-label-${getHeaderProps().key}-`));\n const formattedHeader = formatHeaderForLabel(Header);\n const inputText = React.isValidElement(formattedHeader) ? formattedHeader : `Search ${formattedHeader}`;\n return (\n <Form.Group>\n <FormLabel id={ariaLabel.current} className=\"sr-only\">{inputText}</FormLabel>\n <Input\n aria-labelledby={ariaLabel.current}\n value={filterValue || ''}\n type=\"text\"\n onChange={e => {\n setFilter(e.target.value || undefined); // Set undefined to remove the filter entirely\n }}\n placeholder={inputText}\n />\n </Form.Group>\n );\n}\n\nTextFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n *\n * `filterValue`: Value for the filter input.\n */\n column: PropTypes.shape({\n setFilter: PropTypes.func.isRequired,\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n getHeaderProps: PropTypes.func.isRequired,\n filterValue: PropTypes.string,\n }).isRequired,\n};\n\nexport default TextFilter;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,IAAI,IAAIC,SAAS,QAAQ,YAAY;AAC5C,OAAOC,KAAK,MAAM,aAAa;AAC/B,SAASC,KAAK,QAAQ,aAAa;AAEnC,
|
|
1
|
+
{"version":3,"file":"TextFilter.js","names":["React","useRef","PropTypes","Form","FormLabel","Input","newId","formatHeaderForLabel","header","toLowerCase","TextFilter","_ref","_ref$column","column","filterValue","setFilter","Header","getHeaderProps","ariaLabel","concat","key","formattedHeader","inputText","isValidElement","createElement","Group","id","current","className","value","type","onChange","e","target","undefined","placeholder","propTypes","shape","func","isRequired","oneOfType","elementType","node","string"],"sources":["../../../src/DataTable/filters/TextFilter.jsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Form, { FormLabel } from '../../Form';\nimport Input from '../../Input';\nimport { newId } from '../../utils';\n\nconst formatHeaderForLabel = (header) => {\n if (typeof header === 'function') {\n return header();\n }\n if (typeof header === 'string') {\n return header.toLowerCase();\n }\n return header;\n};\n\nfunction TextFilter({\n column: {\n filterValue, setFilter, Header, getHeaderProps,\n },\n}) {\n const ariaLabel = useRef(newId(`text-filter-label-${getHeaderProps().key}-`));\n const formattedHeader = formatHeaderForLabel(Header);\n const inputText = React.isValidElement(formattedHeader) ? formattedHeader : `Search ${formattedHeader}`;\n return (\n <Form.Group>\n <FormLabel id={ariaLabel.current} className=\"sr-only\">{inputText}</FormLabel>\n <Input\n aria-labelledby={ariaLabel.current}\n value={filterValue || ''}\n type=\"text\"\n onChange={e => {\n setFilter(e.target.value || undefined); // Set undefined to remove the filter entirely\n }}\n placeholder={inputText}\n />\n </Form.Group>\n );\n}\n\nTextFilter.propTypes = {\n /**\n * Specifies a column object.\n *\n * `setFilter`: Function to set the filter value.\n *\n * `Header`: Column header used for labels and placeholders.\n *\n * `getHeaderProps`: Generates a key unique to the column being filtered.\n *\n * `filterValue`: Value for the filter input.\n */\n column: PropTypes.shape({\n setFilter: PropTypes.func.isRequired,\n Header: PropTypes.oneOfType([PropTypes.elementType, PropTypes.node]).isRequired,\n getHeaderProps: PropTypes.func.isRequired,\n filterValue: PropTypes.string,\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AAwB,aAAA,CAACnB,KAAK;IACJ,mBAAiBa,SAAS,CAACS,OAAQ;IACnCE,KAAK,EAAEf,WAAW,IAAI,EAAG;IACzBgB,IAAI,EAAC,MAAM;IACXC,QAAQ,EAAE,SAAAA,SAAAC,CAAC,EAAI;MACbjB,SAAS,CAACiB,CAAC,CAACC,MAAM,CAACJ,KAAK,IAAIK,SAAS,CAAC,CAAC,CAAC;IAC1C,CAAE;;IACFC,WAAW,EAAEb;EAAU,CACxB,CACS,CAAC;AAEjB;AAEAZ,UAAU,CAAC0B,SAAS,GAAG;EACrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEvB,MAAM,EAAEX,SAAS,CAACmC,KAAK,CAAC;IACtBtB,SAAS,EAAEb,SAAS,CAACoC,IAAI,CAACC,UAAU;IACpCvB,MAAM,EAAEd,SAAS,CAACsC,SAAS,CAAC,CAACtC,SAAS,CAACuC,WAAW,EAAEvC,SAAS,CAACwC,IAAI,CAAC,CAAC,CAACH,UAAU;IAC/EtB,cAAc,EAAEf,SAAS,CAACoC,IAAI,CAACC,UAAU;IACzCzB,WAAW,EAAEZ,SAAS,CAACyC;EACzB,CAAC,CAAC,CAACJ;AACL,CAAC;AAED,eAAe7B,UAAU"}
|
package/dist/DataTable/hooks.js
CHANGED
|
@@ -1,22 +1,27 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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); }
|
|
4
|
+
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; }
|
|
5
|
+
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; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
1
7
|
import { useContext } from 'react';
|
|
2
8
|
import DataTableContext from './DataTableContext';
|
|
3
9
|
import { clearSelectionAction } from './selection/data/actions';
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
getTableProps,
|
|
7
|
-
prepareRow,
|
|
8
|
-
page,
|
|
9
|
-
rows,
|
|
10
|
-
headerGroups,
|
|
11
|
-
getTableBodyProps
|
|
12
|
-
|
|
13
|
-
const displayRows = page || rows;
|
|
10
|
+
export var useRows = function useRows() {
|
|
11
|
+
var _useContext = useContext(DataTableContext),
|
|
12
|
+
getTableProps = _useContext.getTableProps,
|
|
13
|
+
prepareRow = _useContext.prepareRow,
|
|
14
|
+
page = _useContext.page,
|
|
15
|
+
rows = _useContext.rows,
|
|
16
|
+
headerGroups = _useContext.headerGroups,
|
|
17
|
+
getTableBodyProps = _useContext.getTableBodyProps;
|
|
18
|
+
var displayRows = page || rows;
|
|
14
19
|
return {
|
|
15
|
-
getTableProps,
|
|
16
|
-
prepareRow,
|
|
17
|
-
displayRows,
|
|
18
|
-
headerGroups,
|
|
19
|
-
getTableBodyProps
|
|
20
|
+
getTableProps: getTableProps,
|
|
21
|
+
prepareRow: prepareRow,
|
|
22
|
+
displayRows: displayRows,
|
|
23
|
+
headerGroups: headerGroups,
|
|
24
|
+
getTableBodyProps: getTableBodyProps
|
|
20
25
|
};
|
|
21
26
|
};
|
|
22
27
|
|
|
@@ -26,15 +31,14 @@ export const useRows = () => {
|
|
|
26
31
|
* @param {Array} controlledTableSelections Selection Object and dispatch function
|
|
27
32
|
* @returns
|
|
28
33
|
*/
|
|
29
|
-
export
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const clearSelection = () => {
|
|
34
|
+
export var useSelectionActions = function useSelectionActions(_ref, controlledTableSelections) {
|
|
35
|
+
var toggleAllRowsSelected = _ref.toggleAllRowsSelected;
|
|
36
|
+
var _controlledTableSelec = _slicedToArray(controlledTableSelections, 2),
|
|
37
|
+
_controlledTableSelec2 = _controlledTableSelec[0],
|
|
38
|
+
selectedRows = _controlledTableSelec2.selectedRows,
|
|
39
|
+
isEntireTableSelected = _controlledTableSelec2.isEntireTableSelected,
|
|
40
|
+
dispatch = _controlledTableSelec[1];
|
|
41
|
+
var clearSelection = function clearSelection() {
|
|
38
42
|
// if using controlled selection component DataTable.ControlledSelectionStatus
|
|
39
43
|
if (selectedRows.length > 0 || isEntireTableSelected) {
|
|
40
44
|
dispatch(clearSelectionAction());
|
|
@@ -43,7 +47,7 @@ export const useSelectionActions = (_ref, controlledTableSelections) => {
|
|
|
43
47
|
}
|
|
44
48
|
};
|
|
45
49
|
return {
|
|
46
|
-
clearSelection
|
|
50
|
+
clearSelection: clearSelection
|
|
47
51
|
};
|
|
48
52
|
};
|
|
49
53
|
//# sourceMappingURL=hooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","names":["useContext","DataTableContext","clearSelectionAction","useRows","getTableProps","prepareRow","page","rows","headerGroups","getTableBodyProps","displayRows","useSelectionActions","_ref","controlledTableSelections","toggleAllRowsSelected","selectedRows","isEntireTableSelected","dispatch","clearSelection","length"],"sources":["../../src/DataTable/hooks.jsx"],"sourcesContent":["import { useContext } from 'react';\nimport DataTableContext from './DataTableContext';\nimport { clearSelectionAction } from './selection/data/actions';\n\nexport const useRows = () => {\n const {\n getTableProps, prepareRow, page, rows, headerGroups, getTableBodyProps,\n } = useContext(DataTableContext);\n\n const displayRows = page || rows;\n\n return {\n getTableProps, prepareRow, displayRows, headerGroups, getTableBodyProps,\n };\n};\n\n/**\n * Hook that provides selection state functionality\n * @param {Object} param0 Table instance\n * @param {Array} controlledTableSelections Selection Object and dispatch function\n * @returns\n */\nexport const useSelectionActions = (\n { toggleAllRowsSelected },\n controlledTableSelections,\n) => {\n const [{ selectedRows, isEntireTableSelected }, dispatch] = controlledTableSelections;\n\n const clearSelection = () => {\n // if using controlled selection component DataTable.ControlledSelectionStatus\n if (selectedRows.length > 0 || isEntireTableSelected) {\n dispatch(clearSelectionAction());\n } else {\n toggleAllRowsSelected(false);\n }\n };\n\n return {\n clearSelection,\n };\n};\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,oBAAoB,QAAQ,0BAA0B;AAE/D,OAAO,
|
|
1
|
+
{"version":3,"file":"hooks.js","names":["useContext","DataTableContext","clearSelectionAction","useRows","_useContext","getTableProps","prepareRow","page","rows","headerGroups","getTableBodyProps","displayRows","useSelectionActions","_ref","controlledTableSelections","toggleAllRowsSelected","_controlledTableSelec","_slicedToArray","_controlledTableSelec2","selectedRows","isEntireTableSelected","dispatch","clearSelection","length"],"sources":["../../src/DataTable/hooks.jsx"],"sourcesContent":["import { useContext } from 'react';\nimport DataTableContext from './DataTableContext';\nimport { clearSelectionAction } from './selection/data/actions';\n\nexport const useRows = () => {\n const {\n getTableProps, prepareRow, page, rows, headerGroups, getTableBodyProps,\n } = useContext(DataTableContext);\n\n const displayRows = page || rows;\n\n return {\n getTableProps, prepareRow, displayRows, headerGroups, getTableBodyProps,\n };\n};\n\n/**\n * Hook that provides selection state functionality\n * @param {Object} param0 Table instance\n * @param {Array} controlledTableSelections Selection Object and dispatch function\n * @returns\n */\nexport const useSelectionActions = (\n { toggleAllRowsSelected },\n controlledTableSelections,\n) => {\n const [{ selectedRows, isEntireTableSelected }, dispatch] = controlledTableSelections;\n\n const clearSelection = () => {\n // if using controlled selection component DataTable.ControlledSelectionStatus\n if (selectedRows.length > 0 || isEntireTableSelected) {\n dispatch(clearSelectionAction());\n } else {\n toggleAllRowsSelected(false);\n }\n };\n\n return {\n clearSelection,\n };\n};\n"],"mappings":";;;;;;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,oBAAoB,QAAQ,0BAA0B;AAE/D,OAAO,IAAMC,OAAO,GAAG,SAAVA,OAAOA,CAAA,EAAS;EAC3B,IAAAC,WAAA,GAEIJ,UAAU,CAACC,gBAAgB,CAAC;IAD9BI,aAAa,GAAAD,WAAA,CAAbC,aAAa;IAAEC,UAAU,GAAAF,WAAA,CAAVE,UAAU;IAAEC,IAAI,GAAAH,WAAA,CAAJG,IAAI;IAAEC,IAAI,GAAAJ,WAAA,CAAJI,IAAI;IAAEC,YAAY,GAAAL,WAAA,CAAZK,YAAY;IAAEC,iBAAiB,GAAAN,WAAA,CAAjBM,iBAAiB;EAGxE,IAAMC,WAAW,GAAGJ,IAAI,IAAIC,IAAI;EAEhC,OAAO;IACLH,aAAa,EAAbA,aAAa;IAAEC,UAAU,EAAVA,UAAU;IAAEK,WAAW,EAAXA,WAAW;IAAEF,YAAY,EAAZA,YAAY;IAAEC,iBAAiB,EAAjBA;EACxD,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAME,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAA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