@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
package/dist/Container/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
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 = ["size", "children"];
|
|
2
3
|
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; }
|
|
3
4
|
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; }
|
|
4
5
|
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; }
|
|
5
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return
|
|
6
|
-
function _toPrimitive(input, hint) { if (
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
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); }
|
|
7
8
|
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); }
|
|
8
9
|
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; }
|
|
9
10
|
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; }
|
|
@@ -11,18 +12,16 @@ import React, { forwardRef } from 'react';
|
|
|
11
12
|
import classNames from 'classnames';
|
|
12
13
|
import RBContainer from 'react-bootstrap/Container';
|
|
13
14
|
import PropTypes from 'prop-types';
|
|
14
|
-
|
|
15
|
+
var SIZE_CLASS_NAMES = {
|
|
15
16
|
xs: 'container-mw-xs',
|
|
16
17
|
sm: 'container-mw-sm',
|
|
17
18
|
md: 'container-mw-md',
|
|
18
19
|
lg: 'container-mw-lg',
|
|
19
20
|
xl: 'container-mw-xl'
|
|
20
21
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
children
|
|
25
|
-
} = _ref,
|
|
22
|
+
var Container = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
23
|
+
var size = _ref.size,
|
|
24
|
+
children = _ref.children,
|
|
26
25
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
27
26
|
return /*#__PURE__*/React.createElement(RBContainer, _extends({}, props, {
|
|
28
27
|
ref: ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","forwardRef","classNames","RBContainer","PropTypes","SIZE_CLASS_NAMES","xs","sm","md","lg","xl","Container","_ref","ref","size","children","props","_objectWithoutProperties","_excluded","createElement","_extends","className","propTypes","_objectSpread","as","elementType","node","fluid","bool","oneOf","Object","keys","bsPrefix","string","defaultProps","undefined"],"sources":["../../src/Container/index.jsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport classNames from 'classnames';\nimport RBContainer from 'react-bootstrap/Container';\nimport PropTypes from 'prop-types';\n\nconst SIZE_CLASS_NAMES = {\n xs: 'container-mw-xs',\n sm: 'container-mw-sm',\n md: 'container-mw-md',\n lg: 'container-mw-lg',\n xl: 'container-mw-xl',\n};\n\nconst Container = forwardRef(({ size, children, ...props }, ref) => (\n <RBContainer\n {...props}\n ref={ref}\n className={classNames(\n props.className,\n SIZE_CLASS_NAMES[size],\n )}\n >\n {children}\n </RBContainer>\n));\n\nContainer.propTypes = {\n ...RBContainer.propTypes,\n /** Override the base element */\n as: PropTypes.elementType,\n /** Specifies the contents of the container */\n children: PropTypes.node,\n /** Fill all available space at any breakpoint */\n fluid: PropTypes.bool,\n /** Set the maximum width for the container */\n size: PropTypes.oneOf(Object.keys(SIZE_CLASS_NAMES)),\n /** Overrides underlying component base CSS class name */\n bsPrefix: PropTypes.string,\n};\n\nContainer.defaultProps = {\n as: 'div',\n children: undefined,\n fluid: true,\n size: undefined,\n bsPrefix: 'container',\n};\n\nexport default Container;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","forwardRef","classNames","RBContainer","PropTypes","SIZE_CLASS_NAMES","xs","sm","md","lg","xl","Container","_ref","ref","size","children","props","_objectWithoutProperties","_excluded","createElement","_extends","className","propTypes","_objectSpread","as","elementType","node","fluid","bool","oneOf","Object","keys","bsPrefix","string","defaultProps","undefined"],"sources":["../../src/Container/index.jsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport classNames from 'classnames';\nimport RBContainer from 'react-bootstrap/Container';\nimport PropTypes from 'prop-types';\n\nconst SIZE_CLASS_NAMES = {\n xs: 'container-mw-xs',\n sm: 'container-mw-sm',\n md: 'container-mw-md',\n lg: 'container-mw-lg',\n xl: 'container-mw-xl',\n};\n\nconst Container = forwardRef(({ size, children, ...props }, ref) => (\n <RBContainer\n {...props}\n ref={ref}\n className={classNames(\n props.className,\n SIZE_CLASS_NAMES[size],\n )}\n >\n {children}\n </RBContainer>\n));\n\nContainer.propTypes = {\n ...RBContainer.propTypes,\n /** Override the base element */\n as: PropTypes.elementType,\n /** Specifies the contents of the container */\n children: PropTypes.node,\n /** Fill all available space at any breakpoint */\n fluid: PropTypes.bool,\n /** Set the maximum width for the container */\n size: PropTypes.oneOf(Object.keys(SIZE_CLASS_NAMES)),\n /** Overrides underlying component base CSS class name */\n bsPrefix: PropTypes.string,\n};\n\nContainer.defaultProps = {\n as: 'div',\n children: undefined,\n fluid: true,\n size: undefined,\n bsPrefix: 'container',\n};\n\nexport default Container;\n"],"mappings":";;;;;;;;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,WAAW,MAAM,2BAA2B;AACnD,OAAOC,SAAS,MAAM,YAAY;AAElC,IAAMC,gBAAgB,GAAG;EACvBC,EAAE,EAAE,iBAAiB;EACrBC,EAAE,EAAE,iBAAiB;EACrBC,EAAE,EAAE,iBAAiB;EACrBC,EAAE,EAAE,iBAAiB;EACrBC,EAAE,EAAE;AACN,CAAC;AAED,IAAMC,SAAS,gBAAGV,UAAU,CAAC,UAAAW,IAAA,EAA+BC,GAAG;EAAA,IAA/BC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IAAEC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IAAKC,KAAK,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA;EAAA,oBACtDlB,KAAA,CAAAmB,aAAA,CAAChB,WAAW,EAAAiB,QAAA,KACNJ,KAAK;IACTH,GAAG,EAAEA,GAAI;IACTQ,SAAS,EAAEnB,UAAU,CACnBc,KAAK,CAACK,SAAS,EACfhB,gBAAgB,CAACS,IAAI,CACvB;EAAE,IAEDC,QACU,CAAC;AAAA,CACf,CAAC;AAEFJ,SAAS,CAACW,SAAS,GAAAC,aAAA,CAAAA,aAAA,KACdpB,WAAW,CAACmB,SAAS;EACxB;EACAE,EAAE,EAAEpB,SAAS,CAACqB,WAAW;EACzB;EACAV,QAAQ,EAAEX,SAAS,CAACsB,IAAI;EACxB;EACAC,KAAK,EAAEvB,SAAS,CAACwB,IAAI;EACrB;EACAd,IAAI,EAAEV,SAAS,CAACyB,KAAK,CAACC,MAAM,CAACC,IAAI,CAAC1B,gBAAgB,CAAC,CAAC;EACpD;EACA2B,QAAQ,EAAE5B,SAAS,CAAC6B;AAAM,EAC3B;AAEDtB,SAAS,CAACuB,YAAY,GAAG;EACvBV,EAAE,EAAE,KAAK;EACTT,QAAQ,EAAEoB,SAAS;EACnBR,KAAK,EAAE,IAAI;EACXb,IAAI,EAAEqB,SAAS;EACfH,QAAQ,EAAE;AACZ,CAAC;AAED,eAAerB,SAAS"}
|
|
@@ -5,15 +5,14 @@ import DataTableContext from './DataTableContext';
|
|
|
5
5
|
|
|
6
6
|
// handles display logic for actions
|
|
7
7
|
function ActionDisplay() {
|
|
8
|
-
|
|
9
|
-
bulkActions,
|
|
10
|
-
tableActions,
|
|
11
|
-
selectedFlatRows
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const hasRowsSelected = selectedFlatRows?.length > 0;
|
|
8
|
+
var _useContext = useContext(DataTableContext),
|
|
9
|
+
bulkActions = _useContext.bulkActions,
|
|
10
|
+
tableActions = _useContext.tableActions,
|
|
11
|
+
selectedFlatRows = _useContext.selectedFlatRows;
|
|
12
|
+
var noBulkActions = typeof bulkActions !== 'function' && (bulkActions === null || bulkActions === void 0 ? void 0 : bulkActions.length) < 1;
|
|
13
|
+
var noTableActions = typeof tableActions !== 'function' && (tableActions === null || tableActions === void 0 ? void 0 : tableActions.length) < 1;
|
|
14
|
+
var noActionsAvailable = noBulkActions && noTableActions;
|
|
15
|
+
var hasRowsSelected = (selectedFlatRows === null || selectedFlatRows === void 0 ? void 0 : selectedFlatRows.length) > 0;
|
|
17
16
|
|
|
18
17
|
// return null if there are no actions or if there are only bulk actions and no selected rows
|
|
19
18
|
if (noActionsAvailable || noTableActions && !hasRowsSelected) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionDisplay.js","names":["React","useContext","BulkActions","TableActions","DataTableContext","ActionDisplay","bulkActions","tableActions","selectedFlatRows","noBulkActions","length","noTableActions","noActionsAvailable","hasRowsSelected","createElement"],"sources":["../../src/DataTable/ActionDisplay.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport BulkActions from './BulkActions';\nimport TableActions from './TableActions';\nimport DataTableContext from './DataTableContext';\n\n// handles display logic for actions\nfunction ActionDisplay() {\n const { bulkActions, tableActions, selectedFlatRows } = useContext(DataTableContext);\n const noBulkActions = typeof bulkActions !== 'function' && bulkActions?.length < 1;\n const noTableActions = typeof tableActions !== 'function' && tableActions?.length < 1;\n const noActionsAvailable = noBulkActions && noTableActions;\n const hasRowsSelected = selectedFlatRows?.length > 0;\n\n // return null if there are no actions or if there are only bulk actions and no selected rows\n if (noActionsAvailable || (noTableActions && !hasRowsSelected)) {\n return null;\n }\n if (!noBulkActions && hasRowsSelected) {\n return <BulkActions />;\n }\n return <TableActions />;\n}\n\nexport default ActionDisplay;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,gBAAgB,MAAM,oBAAoB;;AAEjD;AACA,SAASC,aAAaA,CAAA,EAAG;EACvB,
|
|
1
|
+
{"version":3,"file":"ActionDisplay.js","names":["React","useContext","BulkActions","TableActions","DataTableContext","ActionDisplay","_useContext","bulkActions","tableActions","selectedFlatRows","noBulkActions","length","noTableActions","noActionsAvailable","hasRowsSelected","createElement"],"sources":["../../src/DataTable/ActionDisplay.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport BulkActions from './BulkActions';\nimport TableActions from './TableActions';\nimport DataTableContext from './DataTableContext';\n\n// handles display logic for actions\nfunction ActionDisplay() {\n const { bulkActions, tableActions, selectedFlatRows } = useContext(DataTableContext);\n const noBulkActions = typeof bulkActions !== 'function' && bulkActions?.length < 1;\n const noTableActions = typeof tableActions !== 'function' && tableActions?.length < 1;\n const noActionsAvailable = noBulkActions && noTableActions;\n const hasRowsSelected = selectedFlatRows?.length > 0;\n\n // return null if there are no actions or if there are only bulk actions and no selected rows\n if (noActionsAvailable || (noTableActions && !hasRowsSelected)) {\n return null;\n }\n if (!noBulkActions && hasRowsSelected) {\n return <BulkActions />;\n }\n return <TableActions />;\n}\n\nexport default ActionDisplay;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,gBAAgB,MAAM,oBAAoB;;AAEjD;AACA,SAASC,aAAaA,CAAA,EAAG;EACvB,IAAAC,WAAA,GAAwDL,UAAU,CAACG,gBAAgB,CAAC;IAA5EG,WAAW,GAAAD,WAAA,CAAXC,WAAW;IAAEC,YAAY,GAAAF,WAAA,CAAZE,YAAY;IAAEC,gBAAgB,GAAAH,WAAA,CAAhBG,gBAAgB;EACnD,IAAMC,aAAa,GAAG,OAAOH,WAAW,KAAK,UAAU,IAAI,CAAAA,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEI,MAAM,IAAG,CAAC;EAClF,IAAMC,cAAc,GAAG,OAAOJ,YAAY,KAAK,UAAU,IAAI,CAAAA,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEG,MAAM,IAAG,CAAC;EACrF,IAAME,kBAAkB,GAAGH,aAAa,IAAIE,cAAc;EAC1D,IAAME,eAAe,GAAG,CAAAL,gBAAgB,aAAhBA,gBAAgB,uBAAhBA,gBAAgB,CAAEE,MAAM,IAAG,CAAC;;EAEpD;EACA,IAAIE,kBAAkB,IAAKD,cAAc,IAAI,CAACE,eAAgB,EAAE;IAC9D,OAAO,IAAI;EACb;EACA,IAAI,CAACJ,aAAa,IAAII,eAAe,EAAE;IACrC,oBAAOd,KAAA,CAAAe,aAAA,CAACb,WAAW,MAAE,CAAC;EACxB;EACA,oBAAOF,KAAA,CAAAe,aAAA,CAACZ,YAAY,MAAE,CAAC;AACzB;AAEA,eAAeE,aAAa"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["className"];
|
|
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
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
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."); }
|
|
5
|
+
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); }
|
|
6
|
+
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; }
|
|
7
|
+
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; } }
|
|
8
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
3
9
|
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
10
|
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; }
|
|
5
11
|
import React, { useContext } from 'react';
|
|
@@ -8,32 +14,29 @@ import classNames from 'classnames';
|
|
|
8
14
|
import DataTableContext from './DataTableContext';
|
|
9
15
|
import Actions from './CollapsibleButtonGroup';
|
|
10
16
|
function BulkActions(_ref) {
|
|
11
|
-
|
|
12
|
-
className
|
|
13
|
-
} = _ref,
|
|
17
|
+
var className = _ref.className,
|
|
14
18
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
selectedFlatRows,
|
|
25
|
-
isEntireTableSelected,
|
|
26
|
-
tableInstance
|
|
19
|
+
var tableInstance = useContext(DataTableContext);
|
|
20
|
+
var bulkActions = tableInstance.bulkActions,
|
|
21
|
+
selectedFlatRows = tableInstance.selectedFlatRows,
|
|
22
|
+
_tableInstance$contro = _slicedToArray(tableInstance.controlledTableSelections, 1),
|
|
23
|
+
isEntireTableSelected = _tableInstance$contro[0].isEntireTableSelected;
|
|
24
|
+
var args = {
|
|
25
|
+
selectedFlatRows: selectedFlatRows,
|
|
26
|
+
isEntireTableSelected: isEntireTableSelected,
|
|
27
|
+
tableInstance: tableInstance
|
|
27
28
|
};
|
|
28
29
|
if (typeof bulkActions === 'function') {
|
|
29
30
|
return /*#__PURE__*/React.createElement("div", {
|
|
30
31
|
className: classNames('pgn__bulk-actions', className)
|
|
31
32
|
}, bulkActions(args));
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
var actions = bulkActions.map(function (action) {
|
|
35
|
+
return {
|
|
36
|
+
component: action,
|
|
37
|
+
args: args
|
|
38
|
+
};
|
|
39
|
+
});
|
|
37
40
|
return /*#__PURE__*/React.createElement(Actions, _extends({
|
|
38
41
|
className: classNames('pgn__bulk-actions', className),
|
|
39
42
|
"data-testid": "bulk-actions",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulkActions.js","names":["React","useContext","PropTypes","classNames","DataTableContext","Actions","BulkActions","_ref","className","rest","_objectWithoutProperties","_excluded","tableInstance","bulkActions","selectedFlatRows","controlledTableSelections","isEntireTableSelected","args","createElement","actions","map","action","component","_extends","defaultProps","propTypes","string"],"sources":["../../src/DataTable/BulkActions.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport DataTableContext from './DataTableContext';\nimport Actions from './CollapsibleButtonGroup';\n\nfunction BulkActions({ className, ...rest }) {\n const tableInstance = useContext(DataTableContext);\n const {\n bulkActions,\n selectedFlatRows,\n controlledTableSelections: [{ isEntireTableSelected }],\n } = tableInstance;\n\n const args = {\n selectedFlatRows,\n isEntireTableSelected,\n tableInstance,\n };\n\n if (typeof bulkActions === 'function') {\n return <div className={classNames('pgn__bulk-actions', className)}>{bulkActions(args)}</div>;\n }\n\n const actions = bulkActions.map(action => ({ component: action, args }));\n\n return (\n <Actions\n className={classNames('pgn__bulk-actions', className)}\n data-testid=\"bulk-actions\"\n actions={actions}\n {...rest}\n />\n );\n}\n\nBulkActions.defaultProps = {\n className: null,\n};\n\nBulkActions.propTypes = {\n /** class names for the div wrapping the button components */\n className: PropTypes.string,\n};\n\nexport default BulkActions;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"BulkActions.js","names":["React","useContext","PropTypes","classNames","DataTableContext","Actions","BulkActions","_ref","className","rest","_objectWithoutProperties","_excluded","tableInstance","bulkActions","selectedFlatRows","_tableInstance$contro","_slicedToArray","controlledTableSelections","isEntireTableSelected","args","createElement","actions","map","action","component","_extends","defaultProps","propTypes","string"],"sources":["../../src/DataTable/BulkActions.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport DataTableContext from './DataTableContext';\nimport Actions from './CollapsibleButtonGroup';\n\nfunction BulkActions({ className, ...rest }) {\n const tableInstance = useContext(DataTableContext);\n const {\n bulkActions,\n selectedFlatRows,\n controlledTableSelections: [{ isEntireTableSelected }],\n } = tableInstance;\n\n const args = {\n selectedFlatRows,\n isEntireTableSelected,\n tableInstance,\n };\n\n if (typeof bulkActions === 'function') {\n return <div className={classNames('pgn__bulk-actions', className)}>{bulkActions(args)}</div>;\n }\n\n const actions = bulkActions.map(action => ({ component: action, args }));\n\n return (\n <Actions\n className={classNames('pgn__bulk-actions', className)}\n data-testid=\"bulk-actions\"\n actions={actions}\n {...rest}\n />\n );\n}\n\nBulkActions.defaultProps = {\n className: null,\n};\n\nBulkActions.propTypes = {\n /** class names for the div wrapping the button components */\n className: PropTypes.string,\n};\n\nexport default BulkActions;\n"],"mappings":";;;;;;;;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,OAAO,MAAM,0BAA0B;AAE9C,SAASC,WAAWA,CAAAC,IAAA,EAAyB;EAAA,IAAtBC,SAAS,GAAAD,IAAA,CAATC,SAAS;IAAKC,IAAI,GAAAC,wBAAA,CAAAH,IAAA,EAAAI,SAAA;EACvC,IAAMC,aAAa,GAAGX,UAAU,CAACG,gBAAgB,CAAC;EAClD,IACES,WAAW,GAGTD,aAAa,CAHfC,WAAW;IACXC,gBAAgB,GAEdF,aAAa,CAFfE,gBAAgB;IAAAC,qBAAA,GAAAC,cAAA,CAEdJ,aAAa,CADfK,yBAAyB;IAAKC,qBAAqB,GAAAH,qBAAA,IAArBG,qBAAqB;EAGrD,IAAMC,IAAI,GAAG;IACXL,gBAAgB,EAAhBA,gBAAgB;IAChBI,qBAAqB,EAArBA,qBAAqB;IACrBN,aAAa,EAAbA;EACF,CAAC;EAED,IAAI,OAAOC,WAAW,KAAK,UAAU,EAAE;IACrC,oBAAOb,KAAA,CAAAoB,aAAA;MAAKZ,SAAS,EAAEL,UAAU,CAAC,mBAAmB,EAAEK,SAAS;IAAE,GAAEK,WAAW,CAACM,IAAI,CAAO,CAAC;EAC9F;EAEA,IAAME,OAAO,GAAGR,WAAW,CAACS,GAAG,CAAC,UAAAC,MAAM;IAAA,OAAK;MAAEC,SAAS,EAAED,MAAM;MAAEJ,IAAI,EAAJA;IAAK,CAAC;EAAA,CAAC,CAAC;EAExE,oBACEnB,KAAA,CAAAoB,aAAA,CAACf,OAAO,EAAAoB,QAAA;IACNjB,SAAS,EAAEL,UAAU,CAAC,mBAAmB,EAAEK,SAAS,CAAE;IACtD,eAAY,cAAc;IAC1Ba,OAAO,EAAEA;EAAQ,GACbZ,IAAI,CACT,CAAC;AAEN;AAEAH,WAAW,CAACoB,YAAY,GAAG;EACzBlB,SAAS,EAAE;AACb,CAAC;AAEDF,WAAW,CAACqB,SAAS,GAAG;EACtB;EACAnB,SAAS,EAAEN,SAAS,CAAC0B;AACvB,CAAC;AAED,eAAetB,WAAW"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread 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 _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
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; }
|
|
1
7
|
import React, { useContext } from 'react';
|
|
2
8
|
import PropTypes from 'prop-types';
|
|
3
9
|
import classNames from 'classnames';
|
|
@@ -7,18 +13,14 @@ import { useRows } from './hooks';
|
|
|
7
13
|
import { selectColumn } from './utils/getVisibleColumns';
|
|
8
14
|
import Card, { CardGrid } from '../Card';
|
|
9
15
|
function CardItem(_ref) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
selectionPlacement
|
|
17
|
-
} = _ref;
|
|
16
|
+
var row = _ref.row,
|
|
17
|
+
prepareRow = _ref.prepareRow,
|
|
18
|
+
isSelectable = _ref.isSelectable,
|
|
19
|
+
SelectionComponent = _ref.SelectionComponent,
|
|
20
|
+
CardComponent = _ref.CardComponent,
|
|
21
|
+
selectionPlacement = _ref.selectionPlacement;
|
|
18
22
|
prepareRow(row);
|
|
19
|
-
|
|
20
|
-
isSelected
|
|
21
|
-
} = row;
|
|
23
|
+
var isSelected = row.isSelected;
|
|
22
24
|
if (isSelectable && SelectionComponent) {
|
|
23
25
|
return /*#__PURE__*/React.createElement("div", {
|
|
24
26
|
className: classNames('pgn__data-table__selectable-card', {
|
|
@@ -42,30 +44,27 @@ function DefaultSkeletonCardComponent() {
|
|
|
42
44
|
className: "pgn__data-table-card-view-default-skeleton-card-section"
|
|
43
45
|
}), /*#__PURE__*/React.createElement(Card.Footer, null));
|
|
44
46
|
}
|
|
45
|
-
export
|
|
47
|
+
export var DEFAULT_SKELETON_CARD_COUNT = 8;
|
|
46
48
|
function CardView(_ref2) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
SkeletonCardComponent = DefaultSkeletonCardComponent,
|
|
53
|
-
skeletonCardCount
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
manualSelectColumn,
|
|
63
|
-
isLoading
|
|
64
|
-
} = useContext(DataTableContext);
|
|
49
|
+
var columnSizes = _ref2.columnSizes,
|
|
50
|
+
CardComponent = _ref2.CardComponent,
|
|
51
|
+
className = _ref2.className,
|
|
52
|
+
selectionPlacement = _ref2.selectionPlacement,
|
|
53
|
+
_ref2$SkeletonCardCom = _ref2.SkeletonCardComponent,
|
|
54
|
+
SkeletonCardComponent = _ref2$SkeletonCardCom === void 0 ? DefaultSkeletonCardComponent : _ref2$SkeletonCardCom,
|
|
55
|
+
skeletonCardCount = _ref2.skeletonCardCount;
|
|
56
|
+
var _useRows = useRows(),
|
|
57
|
+
getTableProps = _useRows.getTableProps,
|
|
58
|
+
prepareRow = _useRows.prepareRow,
|
|
59
|
+
displayRows = _useRows.displayRows;
|
|
60
|
+
var _useContext = useContext(DataTableContext),
|
|
61
|
+
isSelectable = _useContext.isSelectable,
|
|
62
|
+
manualSelectColumn = _useContext.manualSelectColumn,
|
|
63
|
+
isLoading = _useContext.isLoading;
|
|
65
64
|
|
|
66
65
|
// use the same component for card selection that is used for row selection
|
|
67
66
|
// otherwise view switching might break if row selection uses component that supports backend filtering / sorting
|
|
68
|
-
|
|
67
|
+
var SelectionComponent = (manualSelectColumn === null || manualSelectColumn === void 0 ? void 0 : manualSelectColumn.Cell) || selectColumn.Cell;
|
|
69
68
|
if (!getTableProps) {
|
|
70
69
|
return null;
|
|
71
70
|
}
|
|
@@ -73,22 +72,26 @@ function CardView(_ref2) {
|
|
|
73
72
|
return /*#__PURE__*/React.createElement(CardGrid, {
|
|
74
73
|
className: classNames('pgn__data-table-card-view', className),
|
|
75
74
|
columnSizes: columnSizes
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
}, _toConsumableArray(new Array(skeletonCardCount)).map(function () {
|
|
76
|
+
return /*#__PURE__*/React.createElement(SkeletonCardComponent, {
|
|
77
|
+
key: uuidv4()
|
|
78
|
+
});
|
|
79
|
+
}));
|
|
79
80
|
}
|
|
80
81
|
return /*#__PURE__*/React.createElement(CardGrid, {
|
|
81
82
|
className: classNames('pgn__data-table-card-view', className),
|
|
82
83
|
columnSizes: columnSizes
|
|
83
|
-
}, displayRows.map(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
}, displayRows.map(function (row) {
|
|
85
|
+
return /*#__PURE__*/React.createElement(CardItem, {
|
|
86
|
+
key: row.id,
|
|
87
|
+
CardComponent: CardComponent,
|
|
88
|
+
SelectionComponent: SelectionComponent,
|
|
89
|
+
isSelectable: isSelectable,
|
|
90
|
+
row: row,
|
|
91
|
+
prepareRow: prepareRow,
|
|
92
|
+
selectionPlacement: selectionPlacement
|
|
93
|
+
});
|
|
94
|
+
}));
|
|
92
95
|
}
|
|
93
96
|
CardItem.defaultProps = {
|
|
94
97
|
SelectionComponent: undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardView.js","names":["React","useContext","PropTypes","classNames","v4","uuidv4","DataTableContext","useRows","selectColumn","Card","CardGrid","CardItem","_ref","row","prepareRow","isSelectable","SelectionComponent","CardComponent","selectionPlacement","isSelected","createElement","className","DefaultSkeletonCardComponent","isLoading","ImageCap","logoSkeleton","Section","Footer","DEFAULT_SKELETON_CARD_COUNT","CardView","_ref2","columnSizes","SkeletonCardComponent","skeletonCardCount","getTableProps","displayRows","manualSelectColumn","Cell","Array","map","key","id","defaultProps","undefined","propTypes","shape","getToggleRowSelectedProps","func","bool","isRequired","oneOf","xs","lg","xl","string","number","sm","md"],"sources":["../../src/DataTable/CardView.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { v4 as uuidv4 } from 'uuid';\nimport DataTableContext from './DataTableContext';\nimport { useRows } from './hooks';\nimport { selectColumn } from './utils/getVisibleColumns';\nimport Card, { CardGrid } from '../Card';\n\nfunction CardItem({\n row,\n prepareRow,\n isSelectable,\n SelectionComponent,\n CardComponent,\n selectionPlacement,\n}) {\n prepareRow(row);\n const { isSelected } = row;\n\n if (isSelectable && SelectionComponent) {\n return (\n <div className={classNames(\n 'pgn__data-table__selectable-card',\n {\n 'is-selected': isSelected,\n 'selection-right': selectionPlacement === 'right',\n 'selection-left': selectionPlacement !== 'right',\n },\n )}\n >\n <CardComponent {...row} />\n <SelectionComponent row={row} />\n </div>\n );\n }\n\n return <CardComponent {...row} />;\n}\n\nfunction DefaultSkeletonCardComponent() {\n return (\n <Card isLoading data-testid=\"default-skeleton-card-component\">\n <Card.ImageCap logoSkeleton />\n <Card.Section className=\"pgn__data-table-card-view-default-skeleton-card-section\" />\n <Card.Footer />\n </Card>\n );\n}\n\nexport const DEFAULT_SKELETON_CARD_COUNT = 8;\n\nfunction CardView({\n columnSizes,\n CardComponent,\n className,\n selectionPlacement,\n SkeletonCardComponent = DefaultSkeletonCardComponent,\n skeletonCardCount,\n}) {\n const {\n getTableProps, prepareRow, displayRows,\n } = useRows();\n const {\n isSelectable,\n manualSelectColumn,\n isLoading,\n } = useContext(DataTableContext);\n\n // use the same component for card selection that is used for row selection\n // otherwise view switching might break if row selection uses component that supports backend filtering / sorting\n const SelectionComponent = manualSelectColumn?.Cell || selectColumn.Cell;\n\n if (!getTableProps) {\n return null;\n }\n\n if (isLoading) {\n return (\n <CardGrid\n className={classNames('pgn__data-table-card-view', className)}\n columnSizes={columnSizes}\n >\n {[...new Array(skeletonCardCount)].map(() => <SkeletonCardComponent key={uuidv4()} />)}\n </CardGrid>\n );\n }\n\n return (\n <CardGrid\n className={classNames('pgn__data-table-card-view', className)}\n columnSizes={columnSizes}\n >\n {displayRows.map((row) => (\n <CardItem\n key={row.id}\n CardComponent={CardComponent}\n SelectionComponent={SelectionComponent}\n isSelectable={isSelectable}\n row={row}\n prepareRow={prepareRow}\n selectionPlacement={selectionPlacement}\n />\n ))}\n </CardGrid>\n );\n}\n\nCardItem.defaultProps = {\n SelectionComponent: undefined,\n};\n\nCardItem.propTypes = {\n row: PropTypes.shape({\n getToggleRowSelectedProps: PropTypes.func,\n isSelected: PropTypes.bool,\n }).isRequired,\n prepareRow: PropTypes.func.isRequired,\n isSelectable: PropTypes.bool.isRequired,\n CardComponent: PropTypes.func.isRequired,\n SelectionComponent: PropTypes.func,\n selectionPlacement: PropTypes.oneOf(['right', 'left']).isRequired,\n};\n\nCardView.defaultProps = {\n columnSizes: {\n xs: 12,\n lg: 6,\n xl: 4,\n },\n className: undefined,\n selectionPlacement: 'right',\n SkeletonCardComponent: undefined,\n skeletonCardCount: 8,\n};\n\nCardView.propTypes = {\n /** The class name for the CardGrid component */\n className: PropTypes.string,\n /**\n * An object containing the desired column size at each breakpoint, following a similar\n * props API as ``react-bootstrap/Col``\n */\n columnSizes: PropTypes.shape({\n xs: PropTypes.number,\n sm: PropTypes.number,\n md: PropTypes.number,\n lg: PropTypes.number,\n xl: PropTypes.number,\n }),\n /** Your card component must be individualized to your table.\n * It will be called with props from the \"row\" of data it will display */\n CardComponent: PropTypes.func.isRequired,\n /** If the Cards are selectable this prop determines from which side of the Card to show selection component. */\n selectionPlacement: PropTypes.oneOf(['left', 'right']),\n /** Overrides default skeleton card component for loading state in CardView */\n SkeletonCardComponent: PropTypes.func,\n /** Customize the number of loading skeleton cards to display in CardView */\n skeletonCardCount: PropTypes.number,\n};\n\nexport default CardView;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AACnC,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,OAAO,QAAQ,SAAS;AACjC,SAASC,YAAY,QAAQ,2BAA2B;AACxD,OAAOC,IAAI,IAAIC,QAAQ,QAAQ,SAAS;AAExC,SAASC,QAAQA,CAAAC,IAAA,EAOd;EAAA,
|
|
1
|
+
{"version":3,"file":"CardView.js","names":["React","useContext","PropTypes","classNames","v4","uuidv4","DataTableContext","useRows","selectColumn","Card","CardGrid","CardItem","_ref","row","prepareRow","isSelectable","SelectionComponent","CardComponent","selectionPlacement","isSelected","createElement","className","DefaultSkeletonCardComponent","isLoading","ImageCap","logoSkeleton","Section","Footer","DEFAULT_SKELETON_CARD_COUNT","CardView","_ref2","columnSizes","_ref2$SkeletonCardCom","SkeletonCardComponent","skeletonCardCount","_useRows","getTableProps","displayRows","_useContext","manualSelectColumn","Cell","_toConsumableArray","Array","map","key","id","defaultProps","undefined","propTypes","shape","getToggleRowSelectedProps","func","bool","isRequired","oneOf","xs","lg","xl","string","number","sm","md"],"sources":["../../src/DataTable/CardView.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { v4 as uuidv4 } from 'uuid';\nimport DataTableContext from './DataTableContext';\nimport { useRows } from './hooks';\nimport { selectColumn } from './utils/getVisibleColumns';\nimport Card, { CardGrid } from '../Card';\n\nfunction CardItem({\n row,\n prepareRow,\n isSelectable,\n SelectionComponent,\n CardComponent,\n selectionPlacement,\n}) {\n prepareRow(row);\n const { isSelected } = row;\n\n if (isSelectable && SelectionComponent) {\n return (\n <div className={classNames(\n 'pgn__data-table__selectable-card',\n {\n 'is-selected': isSelected,\n 'selection-right': selectionPlacement === 'right',\n 'selection-left': selectionPlacement !== 'right',\n },\n )}\n >\n <CardComponent {...row} />\n <SelectionComponent row={row} />\n </div>\n );\n }\n\n return <CardComponent {...row} />;\n}\n\nfunction DefaultSkeletonCardComponent() {\n return (\n <Card isLoading data-testid=\"default-skeleton-card-component\">\n <Card.ImageCap logoSkeleton />\n <Card.Section className=\"pgn__data-table-card-view-default-skeleton-card-section\" />\n <Card.Footer />\n </Card>\n );\n}\n\nexport const DEFAULT_SKELETON_CARD_COUNT = 8;\n\nfunction CardView({\n columnSizes,\n CardComponent,\n className,\n selectionPlacement,\n SkeletonCardComponent = DefaultSkeletonCardComponent,\n skeletonCardCount,\n}) {\n const {\n getTableProps, prepareRow, displayRows,\n } = useRows();\n const {\n isSelectable,\n manualSelectColumn,\n isLoading,\n } = useContext(DataTableContext);\n\n // use the same component for card selection that is used for row selection\n // otherwise view switching might break if row selection uses component that supports backend filtering / sorting\n const SelectionComponent = manualSelectColumn?.Cell || selectColumn.Cell;\n\n if (!getTableProps) {\n return null;\n }\n\n if (isLoading) {\n return (\n <CardGrid\n className={classNames('pgn__data-table-card-view', className)}\n columnSizes={columnSizes}\n >\n {[...new Array(skeletonCardCount)].map(() => <SkeletonCardComponent key={uuidv4()} />)}\n </CardGrid>\n );\n }\n\n return (\n <CardGrid\n className={classNames('pgn__data-table-card-view', className)}\n columnSizes={columnSizes}\n >\n {displayRows.map((row) => (\n <CardItem\n key={row.id}\n CardComponent={CardComponent}\n SelectionComponent={SelectionComponent}\n isSelectable={isSelectable}\n row={row}\n prepareRow={prepareRow}\n selectionPlacement={selectionPlacement}\n />\n ))}\n </CardGrid>\n );\n}\n\nCardItem.defaultProps = {\n SelectionComponent: undefined,\n};\n\nCardItem.propTypes = {\n row: PropTypes.shape({\n getToggleRowSelectedProps: PropTypes.func,\n isSelected: PropTypes.bool,\n }).isRequired,\n prepareRow: PropTypes.func.isRequired,\n isSelectable: PropTypes.bool.isRequired,\n CardComponent: PropTypes.func.isRequired,\n SelectionComponent: PropTypes.func,\n selectionPlacement: PropTypes.oneOf(['right', 'left']).isRequired,\n};\n\nCardView.defaultProps = {\n columnSizes: {\n xs: 12,\n lg: 6,\n xl: 4,\n },\n className: undefined,\n selectionPlacement: 'right',\n SkeletonCardComponent: undefined,\n skeletonCardCount: 8,\n};\n\nCardView.propTypes = {\n /** The class name for the CardGrid component */\n className: PropTypes.string,\n /**\n * An object containing the desired column size at each breakpoint, following a similar\n * props API as ``react-bootstrap/Col``\n */\n columnSizes: PropTypes.shape({\n xs: PropTypes.number,\n sm: PropTypes.number,\n md: PropTypes.number,\n lg: PropTypes.number,\n xl: PropTypes.number,\n }),\n /** Your card component must be individualized to your table.\n * It will be called with props from the \"row\" of data it will display */\n CardComponent: PropTypes.func.isRequired,\n /** If the Cards are selectable this prop determines from which side of the Card to show selection component. */\n selectionPlacement: PropTypes.oneOf(['left', 'right']),\n /** Overrides default skeleton card component for loading state in CardView */\n SkeletonCardComponent: PropTypes.func,\n /** Customize the number of loading skeleton cards to display in CardView */\n skeletonCardCount: PropTypes.number,\n};\n\nexport default CardView;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AACnC,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,OAAO,QAAQ,SAAS;AACjC,SAASC,YAAY,QAAQ,2BAA2B;AACxD,OAAOC,IAAI,IAAIC,QAAQ,QAAQ,SAAS;AAExC,SAASC,QAAQA,CAAAC,IAAA,EAOd;EAAA,IANDC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IACHC,UAAU,GAAAF,IAAA,CAAVE,UAAU;IACVC,YAAY,GAAAH,IAAA,CAAZG,YAAY;IACZC,kBAAkB,GAAAJ,IAAA,CAAlBI,kBAAkB;IAClBC,aAAa,GAAAL,IAAA,CAAbK,aAAa;IACbC,kBAAkB,GAAAN,IAAA,CAAlBM,kBAAkB;EAElBJ,UAAU,CAACD,GAAG,CAAC;EACf,IAAQM,UAAU,GAAKN,GAAG,CAAlBM,UAAU;EAElB,IAAIJ,YAAY,IAAIC,kBAAkB,EAAE;IACtC,oBACEhB,KAAA,CAAAoB,aAAA;MAAKC,SAAS,EAAElB,UAAU,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CAAC;EACF;AACF;EACE1C,aAAa,EAAEf,SAAS,CAACiD,IAAI,CAACE,UAAU;EACxC;EACAnC,kBAAkB,EAAEhB,SAAS,CAACoD,KAAK,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;EACtD;EACArB,qBAAqB,EAAE/B,SAAS,CAACiD,IAAI;EACrC;EACAjB,iBAAiB,EAAEhC,SAAS,CAACyD;AAC/B,CAAC;AAED,eAAe9B,QAAQ"}
|
|
@@ -1,10 +1,21 @@
|
|
|
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 = ["className", "actions"];
|
|
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 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; }
|
|
4
5
|
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; }
|
|
5
6
|
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 (
|
|
7
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
+
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); }
|
|
9
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
10
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
11
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
12
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
13
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
14
|
+
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."); }
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
17
|
+
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; } }
|
|
18
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
19
|
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; }
|
|
9
20
|
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; }
|
|
10
21
|
import React, { useContext, useMemo, useState } from 'react';
|
|
@@ -19,48 +30,55 @@ import breakpoints from '../utils/breakpoints';
|
|
|
19
30
|
import ModalPopup from '../Modal/ModalPopup';
|
|
20
31
|
import Stack from '../Stack';
|
|
21
32
|
import Button from '../Button';
|
|
22
|
-
export
|
|
23
|
-
export
|
|
33
|
+
export var ACTION_OVERFLOW_BUTTON_TEXT = 'More actions';
|
|
34
|
+
export var SMALL_SCREEN_ACTION_OVERFLOW_BUTTON_TEXT = 'Actions';
|
|
24
35
|
function CollapsibleButtonGroup(_ref) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
actions
|
|
28
|
-
} = _ref,
|
|
36
|
+
var className = _ref.className,
|
|
37
|
+
actions = _ref.actions,
|
|
29
38
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
39
|
+
var _useToggle = useToggle(false),
|
|
40
|
+
_useToggle2 = _slicedToArray(_useToggle, 3),
|
|
41
|
+
isOverflowMenuOpen = _useToggle2[0],
|
|
42
|
+
openOverflowMenu = _useToggle2[1],
|
|
43
|
+
closeOverflowMenu = _useToggle2[2];
|
|
44
|
+
var _useState = useState(null),
|
|
45
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
46
|
+
overflowMenuTarget = _useState2[0],
|
|
47
|
+
setOverflowMenuTarget = _useState2[1];
|
|
48
|
+
var _useContext = useContext(DataTableContext),
|
|
49
|
+
_useContext$controlle = _slicedToArray(_useContext.controlledTableSelections, 1),
|
|
50
|
+
isEntireTableSelected = _useContext$controlle[0].isEntireTableSelected,
|
|
51
|
+
selectedFlatRows = _useContext.selectedFlatRows,
|
|
52
|
+
rows = _useContext.rows;
|
|
53
|
+
var _useWindowSize = useWindowSize(),
|
|
54
|
+
width = _useWindowSize.width;
|
|
55
|
+
var selectedRows = selectedFlatRows || rows;
|
|
56
|
+
var _useMemo = useMemo(function () {
|
|
57
|
+
if (width < breakpoints.small.minWidth) {
|
|
58
|
+
// On a small screen, all actions will be in the overflow menu
|
|
59
|
+
return [[], _toConsumableArray(actions)];
|
|
60
|
+
}
|
|
61
|
+
// The first two actions will be displayed as buttons, the rest will go in an overflow menu
|
|
62
|
+
var firstTwoActions = _toConsumableArray(actions).splice(0, 2);
|
|
63
|
+
var extraActions = _toConsumableArray(actions).slice(2);
|
|
51
64
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
/* Reversing the array because to the user it makes sense to put the primary button first,
|
|
66
|
+
but we want it on the right */
|
|
67
|
+
return [firstTwoActions.reverse(), extraActions];
|
|
68
|
+
}, [actions, width]),
|
|
69
|
+
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
70
|
+
visibleActions = _useMemo2[0],
|
|
71
|
+
dropdownActions = _useMemo2[1];
|
|
56
72
|
if (!isEntireTableSelected && !selectedRows) {
|
|
57
73
|
return null;
|
|
58
74
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
75
|
+
var cloneAction = function cloneAction(action, index) {
|
|
76
|
+
return /*#__PURE__*/React.cloneElement(action.component, _objectSpread({
|
|
77
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
78
|
+
key: "".concat(action).concat(index),
|
|
79
|
+
as: Button
|
|
80
|
+
}, action.args));
|
|
81
|
+
};
|
|
64
82
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
65
83
|
className: className
|
|
66
84
|
}, rest), dropdownActions.length > 0 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconButton, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollapsibleButtonGroup.js","names":["React","useContext","useMemo","useState","PropTypes","MoreVert","useToggle","useWindowSize","DataTableContext","Icon","IconButton","breakpoints","ModalPopup","Stack","Button","ACTION_OVERFLOW_BUTTON_TEXT","SMALL_SCREEN_ACTION_OVERFLOW_BUTTON_TEXT","CollapsibleButtonGroup","_ref","className","actions","rest","_objectWithoutProperties","_excluded","isOverflowMenuOpen","openOverflowMenu","closeOverflowMenu","overflowMenuTarget","setOverflowMenuTarget","controlledTableSelections","isEntireTableSelected","selectedFlatRows","rows","
|
|
1
|
+
{"version":3,"file":"CollapsibleButtonGroup.js","names":["React","useContext","useMemo","useState","PropTypes","MoreVert","useToggle","useWindowSize","DataTableContext","Icon","IconButton","breakpoints","ModalPopup","Stack","Button","ACTION_OVERFLOW_BUTTON_TEXT","SMALL_SCREEN_ACTION_OVERFLOW_BUTTON_TEXT","CollapsibleButtonGroup","_ref","className","actions","rest","_objectWithoutProperties","_excluded","_useToggle","_useToggle2","_slicedToArray","isOverflowMenuOpen","openOverflowMenu","closeOverflowMenu","_useState","_useState2","overflowMenuTarget","setOverflowMenuTarget","_useContext","_useContext$controlle","controlledTableSelections","isEntireTableSelected","selectedFlatRows","rows","_useWindowSize","width","selectedRows","_useMemo","small","minWidth","_toConsumableArray","firstTwoActions","splice","extraActions","slice","reverse","_useMemo2","visibleActions","dropdownActions","cloneAction","action","index","cloneElement","component","_objectSpread","key","concat","as","args","createElement","_extends","length","Fragment","variant","iconAs","src","alt","id","ref","onClick","positionRef","onClose","placement","isOpen","gap","map","defaultProps","propTypes","string","arrayOf","shape","oneOfType","element","elementType","isRequired"],"sources":["../../src/DataTable/CollapsibleButtonGroup.jsx"],"sourcesContent":["import React, { useContext, useMemo, useState } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { MoreVert } from '../../icons';\nimport useToggle from '../hooks/useToggle';\nimport useWindowSize from '../hooks/useWindowSize';\nimport DataTableContext from './DataTableContext';\nimport Icon from '../Icon';\nimport IconButton from '../IconButton';\nimport breakpoints from '../utils/breakpoints';\nimport ModalPopup from '../Modal/ModalPopup';\nimport Stack from '../Stack';\nimport Button from '../Button';\n\nexport const ACTION_OVERFLOW_BUTTON_TEXT = 'More actions';\nexport const SMALL_SCREEN_ACTION_OVERFLOW_BUTTON_TEXT = 'Actions';\n\nfunction CollapsibleButtonGroup({\n className,\n actions,\n ...rest\n}) {\n const [isOverflowMenuOpen, openOverflowMenu, closeOverflowMenu] = useToggle(false);\n const [overflowMenuTarget, setOverflowMenuTarget] = useState(null);\n const {\n controlledTableSelections: [{ isEntireTableSelected }],\n selectedFlatRows,\n rows,\n } = useContext(DataTableContext);\n const { width } = useWindowSize();\n const selectedRows = selectedFlatRows || rows;\n\n const [visibleActions, dropdownActions] = useMemo(() => {\n if (width < breakpoints.small.minWidth) {\n // On a small screen, all actions will be in the overflow menu\n return [[], [...actions]];\n }\n // The first two actions will be displayed as buttons, the rest will go in an overflow menu\n const firstTwoActions = [...actions].splice(0, 2);\n const extraActions = [...actions].slice(2);\n\n /* Reversing the array because to the user it makes sense to put the primary button first,\n but we want it on the right */\n return [firstTwoActions.reverse(), extraActions];\n }, [actions, width]);\n\n if (!isEntireTableSelected && !selectedRows) {\n return null;\n }\n\n const cloneAction = (action, index) => React.cloneElement(\n action.component,\n {\n // eslint-disable-next-line react/no-array-index-key\n key: `${action}${index}`,\n as: Button, // for backwards compatibility this is needed\n ...action.args,\n },\n );\n\n return (\n <div className={className} {...rest}>\n {dropdownActions.length > 0 && (\n <>\n <IconButton\n variant=\"secondary\"\n iconAs={Icon}\n src={MoreVert}\n alt={width > breakpoints.small.minWidth\n ? ACTION_OVERFLOW_BUTTON_TEXT : SMALL_SCREEN_ACTION_OVERFLOW_BUTTON_TEXT}\n id=\"actions-dropdown\"\n ref={setOverflowMenuTarget}\n onClick={openOverflowMenu}\n />\n <ModalPopup\n positionRef={overflowMenuTarget}\n onClose={closeOverflowMenu}\n placement=\"bottom-end\"\n isOpen={isOverflowMenuOpen}\n >\n <div className=\"pgn__datatable__overflow-actions-menu\">\n <Stack gap={2}>\n {dropdownActions.map(cloneAction)}\n </Stack>\n </div>\n </ModalPopup>\n </>\n )}\n <div className=\"pgn__datatable__visible-actions\">\n {visibleActions.map(cloneAction)}\n </div>\n </div>\n );\n}\n\nCollapsibleButtonGroup.defaultProps = {\n className: null,\n};\n\nCollapsibleButtonGroup.propTypes = {\n /** Class names for the div wrapping the button components */\n className: PropTypes.string,\n /** Array of action objects, containing a component and their callback args */\n actions: PropTypes.arrayOf(PropTypes.shape({\n component: PropTypes.oneOfType([PropTypes.element, PropTypes.elementType]).isRequired,\n args: PropTypes.shape({}),\n })).isRequired,\n};\n\nexport default CollapsibleButtonGroup;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC5D,OAAOC,SAAS,MAAM,YAAY;AAElC,SAASC,QAAQ,QAAQ,aAAa;AACtC,OAAOC,SAAS,MAAM,oBAAoB;AAC1C,OAAOC,aAAa,MAAM,wBAAwB;AAClD,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,WAAW,MAAM,sBAAsB;AAC9C,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,OAAOC,KAAK,MAAM,UAAU;AAC5B,OAAOC,MAAM,MAAM,WAAW;AAE9B,OAAO,IAAMC,2BAA2B,GAAG,cAAc;AACzD,OAAO,IAAMC,wCAAwC,GAAG,SAAS;AAEjE,SAASC,sBAAsBA,CAAAC,IAAA,EAI5B;EAAA,IAHDC,SAAS,GAAAD,IAAA,CAATC,SAAS;IACTC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACJC,IAAI,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA;EAEP,IAAAC,UAAA,GAAkElB,SAAS,CAAC,KAAK,CAAC;IAAAmB,WAAA,GAAAC,cAAA,CAAAF,UAAA;IAA3EG,kBAAkB,GAAAF,WAAA;IAAEG,gBAAgB,GAAAH,WAAA;IAAEI,iBAAiB,GAAAJ,WAAA;EAC9D,IAAAK,SAAA,GAAoD3B,QAAQ,CAAC,IAAI,CAAC;IAAA4B,UAAA,GAAAL,cAAA,CAA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AACb,CAAC;AAEDF,sBAAsB,CAACkE,SAAS,GAAG;EACjC;EACAhE,SAAS,EAAEf,SAAS,CAACgF,MAAM;EAC3B;EACAhE,OAAO,EAAEhB,SAAS,CAACiF,OAAO,CAACjF,SAAS,CAACkF,KAAK,CAAC;IACzC3B,SAAS,EAAEvD,SAAS,CAACmF,SAAS,CAAC,CAACnF,SAAS,CAACoF,OAAO,EAAEpF,SAAS,CAACqF,WAAW,CAAC,CAAC,CAACC,UAAU;IACrF1B,IAAI,EAAE5D,SAAS,CAACkF,KAAK,CAAC,CAAC,CAAC;EAC1B,CAAC,CAAC,CAAC,CAACI;AACN,CAAC;AAED,eAAezE,sBAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableContext.js","names":["createContext","DataTableContext"],"sources":["../../src/DataTable/DataTableContext.jsx"],"sourcesContent":["import { createContext } from 'react';\n\nconst DataTableContext = createContext({});\n\nexport default DataTableContext;\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,OAAO;AAErC,
|
|
1
|
+
{"version":3,"file":"DataTableContext.js","names":["createContext","DataTableContext"],"sources":["../../src/DataTable/DataTableContext.jsx"],"sourcesContent":["import { createContext } from 'react';\n\nconst DataTableContext = createContext({});\n\nexport default DataTableContext;\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,OAAO;AAErC,IAAMC,gBAAgB,gBAAGD,aAAa,CAAC,CAAC,CAAC,CAAC;AAE1C,eAAeC,gBAAgB"}
|
|
@@ -4,15 +4,12 @@ import classNames from 'classnames';
|
|
|
4
4
|
import SidebarFilters from './SidebarFilters';
|
|
5
5
|
import DataTableContext from './DataTableContext';
|
|
6
6
|
function DataTableLayout(_ref) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
setFilter,
|
|
14
|
-
showFiltersInSidebar
|
|
15
|
-
} = useContext(DataTableContext);
|
|
7
|
+
var filtersTitle = _ref.filtersTitle,
|
|
8
|
+
className = _ref.className,
|
|
9
|
+
children = _ref.children;
|
|
10
|
+
var _useContext = useContext(DataTableContext),
|
|
11
|
+
setFilter = _useContext.setFilter,
|
|
12
|
+
showFiltersInSidebar = _useContext.showFiltersInSidebar;
|
|
16
13
|
return /*#__PURE__*/React.createElement("div", {
|
|
17
14
|
className: classNames('pgn__data-table-layout-wrapper', className)
|
|
18
15
|
}, showFiltersInSidebar && setFilter && /*#__PURE__*/React.createElement("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableLayout.js","names":["React","useContext","PropTypes","classNames","SidebarFilters","DataTableContext","DataTableLayout","_ref","filtersTitle","className","children","setFilter","showFiltersInSidebar","createElement","title","propTypes","string","node","isRequired","oneOfType","element","defaultProps","undefined"],"sources":["../../src/DataTable/DataTableLayout.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport SidebarFilters from './SidebarFilters';\nimport DataTableContext from './DataTableContext';\n\nfunction DataTableLayout({\n filtersTitle,\n className,\n children,\n}) {\n const { setFilter, showFiltersInSidebar } = useContext(DataTableContext);\n\n return (\n <div className={classNames('pgn__data-table-layout-wrapper', className)}>\n {(showFiltersInSidebar && setFilter) && (\n <div className=\"pgn__data-table-layout-sidebar\">\n <SidebarFilters title={filtersTitle} />\n </div>\n )}\n <div className=\"pgn__data-table-layout-main\">\n {children}\n </div>\n </div>\n );\n}\n\nDataTableLayout.propTypes = {\n /** A class name to append to the base element. */\n className: PropTypes.string,\n /** Specifies contents of the component. */\n children: PropTypes.node.isRequired,\n /** Specifies title of the component. */\n filtersTitle: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n};\n\nDataTableLayout.defaultProps = {\n className: null,\n filtersTitle: undefined,\n};\n\nexport default DataTableLayout;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,SAASC,eAAeA,CAAAC,IAAA,EAIrB;EAAA,
|
|
1
|
+
{"version":3,"file":"DataTableLayout.js","names":["React","useContext","PropTypes","classNames","SidebarFilters","DataTableContext","DataTableLayout","_ref","filtersTitle","className","children","_useContext","setFilter","showFiltersInSidebar","createElement","title","propTypes","string","node","isRequired","oneOfType","element","defaultProps","undefined"],"sources":["../../src/DataTable/DataTableLayout.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nimport SidebarFilters from './SidebarFilters';\nimport DataTableContext from './DataTableContext';\n\nfunction DataTableLayout({\n filtersTitle,\n className,\n children,\n}) {\n const { setFilter, showFiltersInSidebar } = useContext(DataTableContext);\n\n return (\n <div className={classNames('pgn__data-table-layout-wrapper', className)}>\n {(showFiltersInSidebar && setFilter) && (\n <div className=\"pgn__data-table-layout-sidebar\">\n <SidebarFilters title={filtersTitle} />\n </div>\n )}\n <div className=\"pgn__data-table-layout-main\">\n {children}\n </div>\n </div>\n );\n}\n\nDataTableLayout.propTypes = {\n /** A class name to append to the base element. */\n className: PropTypes.string,\n /** Specifies contents of the component. */\n children: PropTypes.node.isRequired,\n /** Specifies title of the component. */\n filtersTitle: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n};\n\nDataTableLayout.defaultProps = {\n className: null,\n filtersTitle: undefined,\n};\n\nexport default DataTableLayout;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,SAASC,eAAeA,CAAAC,IAAA,EAIrB;EAAA,IAHDC,YAAY,GAAAD,IAAA,CAA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