@itwin/itwinui-react 3.0.0-dev.3 → 3.0.0-dev.5
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/CHANGELOG.md +65 -0
- package/cjs/core/Alert/Alert.d.ts +5 -5
- package/cjs/core/Alert/Alert.js +72 -59
- package/cjs/core/Alert/index.js +9 -4
- package/cjs/core/Avatar/Avatar.d.ts +3 -7
- package/cjs/core/Avatar/Avatar.js +61 -49
- package/cjs/core/Avatar/index.d.ts +1 -1
- package/cjs/core/Avatar/index.js +10 -6
- package/cjs/core/AvatarGroup/AvatarGroup.d.ts +1 -5
- package/cjs/core/AvatarGroup/AvatarGroup.js +70 -58
- package/cjs/core/AvatarGroup/index.d.ts +1 -1
- package/cjs/core/AvatarGroup/index.js +10 -6
- package/cjs/core/Backdrop/Backdrop.d.ts +1 -1
- package/cjs/core/Backdrop/Backdrop.js +16 -33
- package/cjs/core/Backdrop/index.js +9 -4
- package/cjs/core/Badge/Badge.d.ts +1 -1
- package/cjs/core/Badge/Badge.js +39 -47
- package/cjs/core/Badge/index.js +9 -4
- package/cjs/core/Breadcrumbs/Breadcrumbs.d.ts +16 -24
- package/cjs/core/Breadcrumbs/Breadcrumbs.js +131 -61
- package/cjs/core/Breadcrumbs/index.js +9 -4
- package/cjs/core/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/cjs/core/ButtonGroup/ButtonGroup.js +65 -53
- package/cjs/core/ButtonGroup/index.js +9 -4
- package/cjs/core/Buttons/Button/Button.d.ts +1 -1
- package/cjs/core/Buttons/Button/Button.js +43 -36
- package/cjs/core/Buttons/Button/index.js +9 -4
- package/cjs/core/Buttons/DropdownButton/DropdownButton.d.ts +1 -1
- package/cjs/core/Buttons/DropdownButton/DropdownButton.js +61 -51
- package/cjs/core/Buttons/DropdownButton/index.js +9 -4
- package/cjs/core/Buttons/IconButton/IconButton.d.ts +1 -1
- package/cjs/core/Buttons/IconButton/IconButton.js +59 -38
- package/cjs/core/Buttons/IconButton/index.js +9 -4
- package/cjs/core/Buttons/IdeasButton/IdeasButton.d.ts +1 -1
- package/cjs/core/Buttons/IdeasButton/IdeasButton.js +20 -30
- package/cjs/core/Buttons/IdeasButton/index.js +9 -4
- package/cjs/core/Buttons/SplitButton/SplitButton.d.ts +1 -1
- package/cjs/core/Buttons/SplitButton/SplitButton.js +68 -49
- package/cjs/core/Buttons/SplitButton/index.js +9 -4
- package/cjs/core/Buttons/index.js +43 -13
- package/cjs/core/Carousel/Carousel.d.ts +3 -3
- package/cjs/core/Carousel/Carousel.js +109 -107
- package/cjs/core/Carousel/CarouselContext.js +4 -26
- package/cjs/core/Carousel/CarouselDot.d.ts +1 -1
- package/cjs/core/Carousel/CarouselDot.js +25 -37
- package/cjs/core/Carousel/CarouselDotsList.d.ts +1 -1
- package/cjs/core/Carousel/CarouselDotsList.js +129 -95
- package/cjs/core/Carousel/CarouselNavigation.d.ts +2 -2
- package/cjs/core/Carousel/CarouselNavigation.js +97 -66
- package/cjs/core/Carousel/CarouselSlide.d.ts +1 -1
- package/cjs/core/Carousel/CarouselSlide.js +39 -46
- package/cjs/core/Carousel/CarouselSlider.js +66 -71
- package/cjs/core/Carousel/index.js +9 -4
- package/cjs/core/Checkbox/Checkbox.d.ts +9 -5
- package/cjs/core/Checkbox/Checkbox.js +88 -60
- package/cjs/core/Checkbox/index.js +9 -4
- package/cjs/core/ColorPicker/ColorBuilder.js +289 -198
- package/cjs/core/ColorPicker/ColorInputPanel.d.ts +1 -1
- package/cjs/core/ColorPicker/ColorInputPanel.js +453 -282
- package/cjs/core/ColorPicker/ColorPalette.d.ts +1 -1
- package/cjs/core/ColorPicker/ColorPalette.js +124 -113
- package/cjs/core/ColorPicker/ColorPicker.d.ts +1 -6
- package/cjs/core/ColorPicker/ColorPicker.js +82 -85
- package/cjs/core/ColorPicker/ColorPickerContext.js +11 -31
- package/cjs/core/ColorPicker/ColorSwatch.d.ts +1 -1
- package/cjs/core/ColorPicker/ColorSwatch.js +30 -39
- package/cjs/core/ColorPicker/index.js +43 -13
- package/cjs/core/ComboBox/ComboBox.d.ts +6 -6
- package/cjs/core/ComboBox/ComboBox.js +393 -294
- package/cjs/core/ComboBox/ComboBoxDropdown.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxDropdown.js +39 -42
- package/cjs/core/ComboBox/ComboBoxEndIcon.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxEndIcon.js +46 -43
- package/cjs/core/ComboBox/ComboBoxInput.d.ts +2 -2
- package/cjs/core/ComboBox/ComboBoxInput.js +200 -152
- package/cjs/core/ComboBox/ComboBoxInputContainer.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxInputContainer.js +35 -34
- package/cjs/core/ComboBox/ComboBoxMenu.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxMenu.js +108 -73
- package/cjs/core/ComboBox/ComboBoxMenuItem.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxMenuItem.js +71 -42
- package/cjs/core/ComboBox/ComboBoxMultipleContainer.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxMultipleContainer.js +13 -32
- package/cjs/core/ComboBox/helpers.d.ts +2 -2
- package/cjs/core/ComboBox/helpers.js +47 -65
- package/cjs/core/ComboBox/index.js +9 -4
- package/cjs/core/DatePicker/DatePicker.d.ts +2 -2
- package/cjs/core/DatePicker/DatePicker.js +523 -357
- package/cjs/core/DatePicker/index.js +15 -5
- package/cjs/core/Dialog/Dialog.d.ts +1 -1
- package/cjs/core/Dialog/Dialog.js +72 -68
- package/cjs/core/Dialog/DialogBackdrop.d.ts +1 -1
- package/cjs/core/Dialog/DialogBackdrop.js +47 -52
- package/cjs/core/Dialog/DialogButtonBar.js +3 -3
- package/cjs/core/Dialog/DialogContent.js +3 -3
- package/cjs/core/Dialog/DialogContext.d.ts +1 -1
- package/cjs/core/Dialog/DialogContext.js +5 -27
- package/cjs/core/Dialog/DialogDragContext.d.ts +1 -1
- package/cjs/core/Dialog/DialogDragContext.js +8 -30
- package/cjs/core/Dialog/DialogMain.d.ts +1 -1
- package/cjs/core/Dialog/DialogMain.js +184 -142
- package/cjs/core/Dialog/DialogTitleBar.d.ts +1 -1
- package/cjs/core/Dialog/DialogTitleBar.js +67 -45
- package/cjs/core/Dialog/DialogTitleBarTitle.js +3 -3
- package/cjs/core/Dialog/index.js +9 -4
- package/cjs/core/DropdownMenu/DropdownMenu.d.ts +4 -4
- package/cjs/core/DropdownMenu/DropdownMenu.js +72 -50
- package/cjs/core/DropdownMenu/index.js +9 -4
- package/cjs/core/ExpandableBlock/ExpandableBlock.d.ts +77 -21
- package/cjs/core/ExpandableBlock/ExpandableBlock.js +233 -76
- package/cjs/core/ExpandableBlock/index.js +9 -4
- package/cjs/core/Fieldset/Fieldset.d.ts +1 -1
- package/cjs/core/Fieldset/Fieldset.js +25 -39
- package/cjs/core/Fieldset/index.js +9 -4
- package/cjs/core/FileUpload/FileEmptyCard.js +43 -42
- package/cjs/core/FileUpload/FileUpload.d.ts +1 -1
- package/cjs/core/FileUpload/FileUpload.js +67 -67
- package/cjs/core/FileUpload/FileUploadCard.d.ts +1 -1
- package/cjs/core/FileUpload/FileUploadCard.js +168 -108
- package/cjs/core/FileUpload/FileUploadTemplate.d.ts +1 -1
- package/cjs/core/FileUpload/FileUploadTemplate.js +51 -41
- package/cjs/core/FileUpload/index.js +35 -11
- package/cjs/core/Footer/Footer.d.ts +4 -4
- package/cjs/core/Footer/Footer.js +103 -89
- package/cjs/core/Footer/FooterItem.js +3 -3
- package/cjs/core/Footer/FooterList.js +3 -3
- package/cjs/core/Footer/FooterSeparator.js +8 -5
- package/cjs/core/Footer/index.js +15 -5
- package/cjs/core/Header/Header.d.ts +3 -22
- package/cjs/core/Header/Header.js +67 -48
- package/cjs/core/Header/HeaderBasicButton.js +37 -38
- package/cjs/core/Header/HeaderBreadcrumbs.d.ts +1 -1
- package/cjs/core/Header/HeaderBreadcrumbs.js +38 -39
- package/cjs/core/Header/HeaderButton.d.ts +1 -1
- package/cjs/core/Header/HeaderButton.js +74 -43
- package/cjs/core/Header/HeaderDropdownButton.js +49 -45
- package/cjs/core/Header/HeaderLogo.d.ts +1 -1
- package/cjs/core/Header/HeaderLogo.js +42 -36
- package/cjs/core/Header/HeaderSplitButton.js +68 -46
- package/cjs/core/Header/index.js +35 -11
- package/cjs/core/InformationPanel/InformationPanel.d.ts +1 -1
- package/cjs/core/InformationPanel/InformationPanel.js +77 -67
- package/cjs/core/InformationPanel/InformationPanelBody.js +6 -4
- package/cjs/core/InformationPanel/InformationPanelContent.d.ts +1 -1
- package/cjs/core/InformationPanel/InformationPanelContent.js +20 -33
- package/cjs/core/InformationPanel/InformationPanelHeader.d.ts +1 -1
- package/cjs/core/InformationPanel/InformationPanelHeader.js +34 -39
- package/cjs/core/InformationPanel/InformationPanelWrapper.js +6 -4
- package/cjs/core/InformationPanel/index.js +43 -13
- package/cjs/core/Input/Input.d.ts +1 -6
- package/cjs/core/Input/Input.js +16 -40
- package/cjs/core/Input/index.js +9 -4
- package/cjs/core/InputGroup/InputGroup.d.ts +1 -1
- package/cjs/core/InputGroup/InputGroup.js +46 -41
- package/cjs/core/InputGroup/index.js +9 -4
- package/cjs/core/Label/Label.d.ts +1 -1
- package/cjs/core/Label/Label.js +30 -36
- package/cjs/core/Label/index.js +9 -4
- package/cjs/core/LabeledInput/LabeledInput.d.ts +1 -1
- package/cjs/core/LabeledInput/LabeledInput.js +49 -33
- package/cjs/core/LabeledInput/index.js +9 -4
- package/cjs/core/LabeledSelect/LabeledSelect.d.ts +1 -1
- package/cjs/core/LabeledSelect/LabeledSelect.js +56 -44
- package/cjs/core/LabeledSelect/index.js +9 -4
- package/cjs/core/LabeledTextarea/LabeledTextarea.d.ts +2 -3
- package/cjs/core/LabeledTextarea/LabeledTextarea.js +49 -33
- package/cjs/core/LabeledTextarea/index.js +9 -4
- package/cjs/core/List/List.js +3 -3
- package/cjs/core/List/ListItem.d.ts +4 -4
- package/cjs/core/List/ListItem.js +55 -60
- package/cjs/core/List/index.js +16 -6
- package/cjs/core/Menu/Menu.d.ts +1 -1
- package/cjs/core/Menu/Menu.js +66 -78
- package/cjs/core/Menu/MenuDivider.js +4 -4
- package/cjs/core/Menu/MenuExtraContent.js +4 -4
- package/cjs/core/Menu/MenuItem.d.ts +1 -1
- package/cjs/core/Menu/MenuItem.js +143 -86
- package/cjs/core/Menu/MenuItemSkeleton.d.ts +1 -1
- package/cjs/core/Menu/MenuItemSkeleton.js +54 -43
- package/cjs/core/Menu/index.js +43 -13
- package/cjs/core/Modal/Modal.d.ts +1 -1
- package/cjs/core/Modal/Modal.js +38 -33
- package/cjs/core/Modal/ModalButtonBar.js +7 -4
- package/cjs/core/Modal/ModalContent.js +3 -3
- package/cjs/core/Modal/index.js +23 -8
- package/cjs/core/NonIdealState/ErrorPage.d.ts +6 -7
- package/cjs/core/NonIdealState/ErrorPage.js +187 -146
- package/cjs/core/NonIdealState/NonIdealState.d.ts +17 -1
- package/cjs/core/NonIdealState/NonIdealState.js +77 -37
- package/cjs/core/NonIdealState/index.js +16 -6
- package/cjs/core/NotificationMarker/NotificationMarker.d.ts +1 -1
- package/cjs/core/NotificationMarker/NotificationMarker.js +29 -33
- package/cjs/core/NotificationMarker/index.js +9 -4
- package/cjs/core/Overlay/Overlay.d.ts +57 -0
- package/cjs/core/Overlay/Overlay.js +96 -0
- package/cjs/core/Overlay/index.d.ts +1 -0
- package/{esm/core/ProgressIndicators/ProgressRadial → cjs/core/Overlay}/index.js +10 -2
- package/cjs/core/ProgressIndicators/{ProgressLinear/ProgressLinear.d.ts → ProgressLinear.d.ts} +6 -6
- package/cjs/core/ProgressIndicators/ProgressLinear.js +64 -0
- package/cjs/core/ProgressIndicators/{ProgressRadial/ProgressRadial.d.ts → ProgressRadial.d.ts} +4 -4
- package/cjs/core/ProgressIndicators/ProgressRadial.js +74 -0
- package/cjs/core/ProgressIndicators/index.d.ts +2 -2
- package/cjs/core/ProgressIndicators/index.js +16 -6
- package/cjs/core/Radio/Radio.d.ts +1 -6
- package/cjs/core/Radio/Radio.js +41 -42
- package/cjs/core/Radio/index.js +9 -4
- package/cjs/core/RadioTiles/RadioTile.d.ts +1 -6
- package/cjs/core/RadioTiles/RadioTile.js +46 -45
- package/cjs/core/RadioTiles/RadioTileGroup.d.ts +1 -1
- package/cjs/core/RadioTiles/RadioTileGroup.js +16 -31
- package/cjs/core/RadioTiles/index.js +16 -6
- package/cjs/core/SearchBox/SearchBox.d.ts +3 -3
- package/cjs/core/SearchBox/SearchBox.js +220 -128
- package/cjs/core/SearchBox/index.js +9 -4
- package/cjs/core/Select/Select.d.ts +5 -10
- package/cjs/core/Select/Select.js +291 -181
- package/cjs/core/Select/SelectTag.d.ts +1 -1
- package/cjs/core/Select/SelectTag.js +21 -34
- package/cjs/core/Select/SelectTagContainer.d.ts +1 -1
- package/cjs/core/Select/SelectTagContainer.js +30 -39
- package/cjs/core/Select/index.js +9 -4
- package/cjs/core/SideNavigation/SideNavigation.d.ts +1 -1
- package/cjs/core/SideNavigation/SideNavigation.js +105 -54
- package/cjs/core/SideNavigation/SidenavButton.d.ts +1 -1
- package/cjs/core/SideNavigation/SidenavButton.js +30 -33
- package/cjs/core/SideNavigation/SidenavSubmenu.js +23 -34
- package/cjs/core/SideNavigation/SidenavSubmenuHeader.d.ts +1 -1
- package/cjs/core/SideNavigation/SidenavSubmenuHeader.js +29 -35
- package/cjs/core/SideNavigation/index.js +35 -11
- package/cjs/core/SkipToContentLink/SkipToContentLink.d.ts +1 -1
- package/cjs/core/SkipToContentLink/SkipToContentLink.js +20 -33
- package/cjs/core/SkipToContentLink/index.js +9 -4
- package/cjs/core/Slider/Slider.d.ts +5 -9
- package/cjs/core/Slider/Slider.js +343 -227
- package/cjs/core/Slider/Thumb.d.ts +4 -4
- package/cjs/core/Slider/Thumb.js +111 -84
- package/cjs/core/Slider/Track.d.ts +3 -3
- package/cjs/core/Slider/Track.js +72 -76
- package/cjs/core/Slider/index.js +9 -4
- package/cjs/core/StatusMessage/StatusMessage.d.ts +2 -2
- package/cjs/core/StatusMessage/StatusMessage.js +19 -32
- package/cjs/core/StatusMessage/index.js +9 -4
- package/cjs/core/Stepper/Stepper.d.ts +3 -3
- package/cjs/core/Stepper/Stepper.js +51 -36
- package/cjs/core/Stepper/StepperStep.d.ts +1 -1
- package/cjs/core/Stepper/StepperStep.js +84 -63
- package/cjs/core/Stepper/WorkflowDiagram.d.ts +1 -1
- package/cjs/core/Stepper/WorkflowDiagram.js +25 -33
- package/cjs/core/Stepper/WorkflowDiagramStep.d.ts +3 -3
- package/cjs/core/Stepper/WorkflowDiagramStep.js +32 -36
- package/cjs/core/Stepper/index.d.ts +0 -4
- package/cjs/core/Stepper/index.js +17 -10
- package/cjs/core/Surface/Surface.d.ts +2 -2
- package/cjs/core/Surface/Surface.js +78 -70
- package/cjs/core/Surface/index.js +9 -4
- package/cjs/core/Table/SubRowExpander.d.ts +2 -2
- package/cjs/core/Table/SubRowExpander.js +35 -37
- package/cjs/core/Table/Table.d.ts +2 -2
- package/cjs/core/Table/Table.js +725 -448
- package/cjs/core/Table/TableCell.d.ts +2 -2
- package/cjs/core/Table/TableCell.js +113 -88
- package/cjs/core/Table/TablePaginator.d.ts +3 -3
- package/cjs/core/Table/TablePaginator.js +312 -159
- package/cjs/core/Table/TableRowMemoized.d.ts +4 -4
- package/cjs/core/Table/TableRowMemoized.js +137 -89
- package/cjs/core/Table/actionHandlers/expandHandler.js +12 -12
- package/cjs/core/Table/actionHandlers/filterHandler.js +25 -17
- package/cjs/core/Table/actionHandlers/index.js +56 -14
- package/cjs/core/Table/actionHandlers/resizeHandler.js +13 -13
- package/cjs/core/Table/actionHandlers/selectHandler.js +123 -96
- package/cjs/core/Table/cells/DefaultCell.d.ts +2 -2
- package/cjs/core/Table/cells/DefaultCell.js +48 -38
- package/cjs/core/Table/cells/EditableCell.d.ts +2 -2
- package/cjs/core/Table/cells/EditableCell.js +75 -68
- package/cjs/core/Table/cells/index.js +16 -6
- package/cjs/core/Table/columns/actionColumn.d.ts +3 -3
- package/cjs/core/Table/columns/actionColumn.js +106 -96
- package/cjs/core/Table/columns/expanderColumn.d.ts +2 -2
- package/cjs/core/Table/columns/expanderColumn.js +45 -54
- package/cjs/core/Table/columns/index.js +41 -11
- package/cjs/core/Table/columns/selectionColumn.d.ts +4 -4
- package/cjs/core/Table/columns/selectionColumn.js +57 -51
- package/cjs/core/Table/filters/BaseFilter.d.ts +2 -2
- package/cjs/core/Table/filters/BaseFilter.js +24 -38
- package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.d.ts +3 -2
- package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +92 -72
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +4 -4
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +118 -79
- package/cjs/core/Table/filters/FilterButtonBar.d.ts +3 -3
- package/cjs/core/Table/filters/FilterButtonBar.js +39 -41
- package/cjs/core/Table/filters/FilterToggle.d.ts +3 -3
- package/cjs/core/Table/filters/FilterToggle.js +59 -51
- package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.d.ts +4 -4
- package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +58 -52
- package/cjs/core/Table/filters/TextFilter/TextFilter.d.ts +3 -3
- package/cjs/core/Table/filters/TextFilter/TextFilter.js +40 -44
- package/cjs/core/Table/filters/customFilterFunctions.js +16 -14
- package/cjs/core/Table/filters/defaultFilterFunctions.js +86 -81
- package/cjs/core/Table/filters/index.js +35 -11
- package/cjs/core/Table/filters/tableFilters.d.ts +5 -5
- package/cjs/core/Table/filters/tableFilters.js +44 -54
- package/cjs/core/Table/filters/types.d.ts +1 -1
- package/cjs/core/Table/filters/types.js +2 -2
- package/cjs/core/Table/hooks/index.js +67 -19
- package/cjs/core/Table/hooks/useColumnDragAndDrop.js +101 -88
- package/cjs/core/Table/hooks/useExpanderCell.d.ts +1 -1
- package/cjs/core/Table/hooks/useExpanderCell.js +33 -47
- package/cjs/core/Table/hooks/useResizeColumns.js +362 -290
- package/cjs/core/Table/hooks/useScrollToRow.d.ts +2 -2
- package/cjs/core/Table/hooks/useScrollToRow.js +46 -60
- package/cjs/core/Table/hooks/useSelectionCell.js +17 -10
- package/cjs/core/Table/hooks/useStickyColumns.js +64 -62
- package/cjs/core/Table/hooks/useSubRowFiltering.js +95 -110
- package/cjs/core/Table/hooks/useSubRowSelection.js +32 -53
- package/cjs/core/Table/index.js +78 -18
- package/cjs/core/Table/utils.js +42 -40
- package/cjs/core/Tabs/Tab.d.ts +2 -2
- package/cjs/core/Tabs/Tab.js +51 -38
- package/cjs/core/Tabs/Tabs.d.ts +6 -42
- package/cjs/core/Tabs/Tabs.js +408 -364
- package/cjs/core/Tabs/index.d.ts +1 -1
- package/cjs/core/Tabs/index.js +17 -9
- package/cjs/core/Tag/Tag.d.ts +1 -1
- package/cjs/core/Tag/Tag.js +42 -40
- package/cjs/core/Tag/TagContainer.d.ts +1 -1
- package/cjs/core/Tag/TagContainer.js +23 -36
- package/cjs/core/Tag/index.js +16 -6
- package/cjs/core/Textarea/Textarea.d.ts +2 -9
- package/cjs/core/Textarea/Textarea.js +17 -41
- package/cjs/core/Textarea/index.js +9 -4
- package/cjs/core/ThemeProvider/ThemeContext.js +4 -26
- package/cjs/core/ThemeProvider/ThemeProvider.d.ts +4 -4
- package/cjs/core/ThemeProvider/ThemeProvider.js +77 -54
- package/cjs/core/ThemeProvider/index.js +9 -4
- package/cjs/core/Tile/Tile.d.ts +157 -99
- package/cjs/core/Tile/Tile.js +417 -143
- package/cjs/core/Tile/index.js +9 -4
- package/cjs/core/TimePicker/TimePicker.d.ts +3 -3
- package/cjs/core/TimePicker/TimePicker.js +458 -259
- package/cjs/core/TimePicker/index.js +9 -4
- package/cjs/core/Toast/Toast.d.ts +5 -5
- package/cjs/core/Toast/Toast.js +192 -132
- package/cjs/core/Toast/Toaster.d.ts +5 -5
- package/cjs/core/Toast/Toaster.js +103 -100
- package/cjs/core/Toast/index.js +9 -4
- package/cjs/core/ToggleSwitch/ToggleSwitch.d.ts +1 -6
- package/cjs/core/ToggleSwitch/ToggleSwitch.js +66 -53
- package/cjs/core/ToggleSwitch/index.js +9 -4
- package/cjs/core/Tooltip/Tooltip.d.ts +67 -7
- package/cjs/core/Tooltip/Tooltip.js +152 -38
- package/cjs/core/Tooltip/index.js +9 -4
- package/cjs/core/TransferList/TransferList.d.ts +6 -6
- package/cjs/core/TransferList/TransferList.js +184 -103
- package/cjs/core/TransferList/index.js +9 -4
- package/cjs/core/Tree/Tree.d.ts +5 -5
- package/cjs/core/Tree/Tree.js +205 -157
- package/cjs/core/Tree/TreeContext.d.ts +1 -1
- package/cjs/core/Tree/TreeContext.js +9 -31
- package/cjs/core/Tree/TreeNode.d.ts +2 -2
- package/cjs/core/Tree/TreeNode.js +207 -129
- package/cjs/core/Tree/TreeNodeExpander.d.ts +1 -1
- package/cjs/core/Tree/TreeNodeExpander.js +26 -37
- package/cjs/core/Tree/index.js +23 -8
- package/cjs/core/Typography/Anchor/Anchor.js +3 -3
- package/cjs/core/Typography/Anchor/index.js +9 -4
- package/cjs/core/Typography/Blockquote/Blockquote.d.ts +1 -1
- package/cjs/core/Typography/Blockquote/Blockquote.js +18 -35
- package/cjs/core/Typography/Blockquote/index.js +9 -4
- package/cjs/core/Typography/Code/Code.js +3 -3
- package/cjs/core/Typography/Code/index.js +9 -4
- package/cjs/core/Typography/Kbd/Kbd.d.ts +1 -1
- package/cjs/core/Typography/Kbd/Kbd.js +30 -46
- package/cjs/core/Typography/Kbd/index.js +15 -5
- package/cjs/core/Typography/Text/Text.d.ts +1 -1
- package/cjs/core/Typography/Text/Text.js +26 -38
- package/cjs/core/Typography/Text/index.js +9 -4
- package/cjs/core/Typography/index.js +50 -14
- package/cjs/core/index.d.ts +6 -5
- package/cjs/core/index.js +889 -184
- package/cjs/core/utils/color/ColorValue.d.ts +4 -4
- package/cjs/core/utils/color/ColorValue.js +535 -453
- package/cjs/core/utils/color/index.js +4 -17
- package/cjs/core/utils/components/AutoclearingHiddenLiveRegion.d.ts +2 -2
- package/cjs/core/utils/components/AutoclearingHiddenLiveRegion.js +20 -35
- package/cjs/core/utils/components/Box.js +3 -3
- package/cjs/core/utils/components/Divider.d.ts +1 -1
- package/cjs/core/utils/components/Divider.js +14 -33
- package/cjs/core/utils/components/Flex.d.ts +4 -4
- package/cjs/core/utils/components/Flex.js +93 -102
- package/cjs/core/utils/components/FocusTrap.d.ts +3 -3
- package/cjs/core/utils/components/FocusTrap.js +47 -60
- package/cjs/core/utils/components/Icon.d.ts +1 -1
- package/cjs/core/utils/components/Icon.js +25 -43
- package/cjs/core/utils/components/InputContainer.d.ts +2 -2
- package/cjs/core/utils/components/InputContainer.js +75 -46
- package/cjs/core/utils/components/InputFlexContainer.d.ts +1 -1
- package/cjs/core/utils/components/InputFlexContainer.js +22 -10
- package/cjs/core/utils/components/LinkAction.js +3 -3
- package/cjs/core/utils/components/MiddleTextTruncation.d.ts +2 -2
- package/cjs/core/utils/components/MiddleTextTruncation.js +32 -44
- package/cjs/core/utils/components/Popover.d.ts +3 -3
- package/cjs/core/utils/components/Popover.js +111 -135
- package/cjs/core/utils/components/Resizer.d.ts +2 -2
- package/cjs/core/utils/components/Resizer.js +246 -211
- package/cjs/core/utils/components/VirtualScroll.d.ts +2 -2
- package/cjs/core/utils/components/VirtualScroll.js +304 -245
- package/cjs/core/utils/components/VisuallyHidden.d.ts +1 -1
- package/cjs/core/utils/components/VisuallyHidden.js +14 -33
- package/cjs/core/utils/components/WithCSSTransition.d.ts +2 -2
- package/cjs/core/utils/components/WithCSSTransition.js +43 -48
- package/cjs/core/utils/components/index.js +18 -31
- package/cjs/core/utils/functions/colors.js +36 -33
- package/cjs/core/utils/functions/date.js +10 -10
- package/cjs/core/utils/functions/dom.js +24 -17
- package/cjs/core/utils/functions/focusable.js +26 -17
- package/cjs/core/utils/functions/import.d.ts +6 -0
- package/cjs/core/utils/functions/import.js +61 -0
- package/cjs/core/utils/functions/index.d.ts +1 -0
- package/cjs/core/utils/functions/index.js +11 -23
- package/cjs/core/utils/functions/numbers.js +9 -9
- package/cjs/core/utils/functions/polymorphic.d.ts +5 -3
- package/cjs/core/utils/functions/polymorphic.js +43 -55
- package/cjs/core/utils/functions/supports.js +5 -4
- package/cjs/core/utils/hooks/index.js +16 -29
- package/cjs/core/utils/hooks/useContainerWidth.js +26 -41
- package/cjs/core/utils/hooks/useDragAndDrop.js +110 -109
- package/cjs/core/utils/hooks/useEventListener.js +22 -44
- package/cjs/core/utils/hooks/useGlobals.js +34 -51
- package/cjs/core/utils/hooks/useId.js +9 -30
- package/cjs/core/utils/hooks/useIntersection.js +30 -46
- package/cjs/core/utils/hooks/useIsClient.js +9 -31
- package/cjs/core/utils/hooks/useIsomorphicLayoutEffect.js +6 -27
- package/cjs/core/utils/hooks/useLatestRef.js +9 -31
- package/cjs/core/utils/hooks/useMediaQuery.js +31 -53
- package/cjs/core/utils/hooks/useMergedRefs.js +15 -38
- package/cjs/core/utils/hooks/useOverflow.js +69 -78
- package/cjs/core/utils/hooks/useResizeObserver.js +22 -39
- package/cjs/core/utils/hooks/useSafeContext.js +9 -31
- package/cjs/core/utils/icons/StatusIconMap.d.ts +5 -5
- package/cjs/core/utils/icons/StatusIconMap.js +28 -34
- package/cjs/core/utils/icons/Svg.js +3 -3
- package/cjs/core/utils/icons/SvgCalendar.d.ts +1 -1
- package/cjs/core/utils/icons/SvgCalendar.js +12 -29
- package/cjs/core/utils/icons/SvgCaretDownSmall.d.ts +1 -1
- package/cjs/core/utils/icons/SvgCaretDownSmall.js +12 -29
- package/cjs/core/utils/icons/SvgCaretRightSmall.d.ts +1 -1
- package/cjs/core/utils/icons/SvgCaretRightSmall.js +12 -29
- package/cjs/core/utils/icons/SvgCaretUpSmall.d.ts +1 -1
- package/cjs/core/utils/icons/SvgCaretUpSmall.js +12 -29
- package/cjs/core/utils/icons/SvgCheckmark.d.ts +1 -1
- package/cjs/core/utils/icons/SvgCheckmark.js +10 -29
- package/cjs/core/utils/icons/SvgCheckmarkSmall.d.ts +1 -1
- package/cjs/core/utils/icons/SvgCheckmarkSmall.js +12 -29
- package/cjs/core/utils/icons/SvgChevronLeft.d.ts +1 -1
- package/cjs/core/utils/icons/SvgChevronLeft.js +12 -29
- package/cjs/core/utils/icons/SvgChevronLeftDouble.d.ts +1 -1
- package/cjs/core/utils/icons/SvgChevronLeftDouble.js +12 -29
- package/cjs/core/utils/icons/SvgChevronRight.d.ts +1 -1
- package/cjs/core/utils/icons/SvgChevronRight.js +12 -29
- package/cjs/core/utils/icons/SvgChevronRightDouble.d.ts +1 -1
- package/cjs/core/utils/icons/SvgChevronRightDouble.js +12 -29
- package/cjs/core/utils/icons/SvgClose.d.ts +1 -1
- package/cjs/core/utils/icons/SvgClose.js +12 -29
- package/cjs/core/utils/icons/SvgCloseSmall.d.ts +1 -1
- package/cjs/core/utils/icons/SvgCloseSmall.js +12 -29
- package/cjs/core/utils/icons/SvgColumnManager.d.ts +1 -1
- package/cjs/core/utils/icons/SvgColumnManager.js +12 -29
- package/cjs/core/utils/icons/SvgDocument.d.ts +1 -1
- package/cjs/core/utils/icons/SvgDocument.js +10 -29
- package/cjs/core/utils/icons/SvgFilter.d.ts +1 -1
- package/cjs/core/utils/icons/SvgFilter.js +10 -29
- package/cjs/core/utils/icons/SvgFilterHollow.d.ts +1 -1
- package/cjs/core/utils/icons/SvgFilterHollow.js +12 -29
- package/cjs/core/utils/icons/SvgImportantSmall.d.ts +1 -1
- package/cjs/core/utils/icons/SvgImportantSmall.js +12 -29
- package/cjs/core/utils/icons/SvgInfoCircular.d.ts +1 -1
- package/cjs/core/utils/icons/SvgInfoCircular.js +12 -29
- package/cjs/core/utils/icons/SvgMore.d.ts +1 -1
- package/cjs/core/utils/icons/SvgMore.js +12 -29
- package/cjs/core/utils/icons/SvgMoreVertical.d.ts +1 -1
- package/cjs/core/utils/icons/SvgMoreVertical.js +12 -29
- package/cjs/core/utils/icons/SvgNew.d.ts +1 -1
- package/cjs/core/utils/icons/SvgNew.js +12 -29
- package/cjs/core/utils/icons/SvgSearch.d.ts +1 -1
- package/cjs/core/utils/icons/SvgSearch.js +12 -29
- package/cjs/core/utils/icons/SvgSmileyHappy.d.ts +1 -1
- package/cjs/core/utils/icons/SvgSmileyHappy.js +12 -29
- package/cjs/core/utils/icons/SvgSortDown.d.ts +1 -1
- package/cjs/core/utils/icons/SvgSortDown.js +12 -29
- package/cjs/core/utils/icons/SvgSortUp.d.ts +1 -1
- package/cjs/core/utils/icons/SvgSortUp.js +12 -29
- package/cjs/core/utils/icons/SvgStatusError.d.ts +1 -1
- package/cjs/core/utils/icons/SvgStatusError.js +12 -29
- package/cjs/core/utils/icons/SvgStatusSuccess.d.ts +1 -1
- package/cjs/core/utils/icons/SvgStatusSuccess.js +12 -29
- package/cjs/core/utils/icons/SvgStatusWarning.d.ts +1 -1
- package/cjs/core/utils/icons/SvgStatusWarning.js +12 -29
- package/cjs/core/utils/icons/SvgSwap.d.ts +1 -1
- package/cjs/core/utils/icons/SvgSwap.js +12 -29
- package/cjs/core/utils/icons/SvgUpload.d.ts +1 -1
- package/cjs/core/utils/icons/SvgUpload.js +12 -29
- package/cjs/core/utils/icons/index.js +34 -47
- package/cjs/core/utils/index.js +10 -23
- package/cjs/core/utils/props.d.ts +2 -2
- package/cjs/core/utils/props.js +2 -2
- package/cjs/core/utils/types.d.ts +1 -1
- package/cjs/core/utils/types.js +2 -2
- package/cjs/index.js +5 -18
- package/cjs/package.json +1 -0
- package/cjs/styles.js +453 -445
- package/cjs/types/react-table-config.js +2 -2
- package/esm/core/Alert/Alert.d.ts +5 -5
- package/esm/core/Alert/Alert.js +73 -28
- package/esm/core/Avatar/Avatar.d.ts +3 -7
- package/esm/core/Avatar/Avatar.js +48 -17
- package/esm/core/Avatar/index.d.ts +1 -1
- package/esm/core/Avatar/index.js +1 -1
- package/esm/core/AvatarGroup/AvatarGroup.d.ts +1 -5
- package/esm/core/AvatarGroup/AvatarGroup.js +63 -26
- package/esm/core/AvatarGroup/index.d.ts +1 -1
- package/esm/core/AvatarGroup/index.js +1 -1
- package/esm/core/Backdrop/Backdrop.d.ts +1 -1
- package/esm/core/Backdrop/Backdrop.js +10 -2
- package/esm/core/Badge/Badge.d.ts +1 -1
- package/esm/core/Badge/Badge.js +31 -16
- package/esm/core/Breadcrumbs/Breadcrumbs.d.ts +16 -24
- package/esm/core/Breadcrumbs/Breadcrumbs.js +128 -31
- package/esm/core/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/esm/core/ButtonGroup/ButtonGroup.js +59 -22
- package/esm/core/Buttons/Button/Button.d.ts +1 -1
- package/esm/core/Buttons/Button/Button.js +37 -5
- package/esm/core/Buttons/DropdownButton/DropdownButton.d.ts +1 -1
- package/esm/core/Buttons/DropdownButton/DropdownButton.js +54 -19
- package/esm/core/Buttons/IconButton/IconButton.d.ts +1 -1
- package/esm/core/Buttons/IconButton/IconButton.js +51 -7
- package/esm/core/Buttons/IdeasButton/IdeasButton.d.ts +1 -1
- package/esm/core/Buttons/IdeasButton/IdeasButton.js +12 -2
- package/esm/core/Buttons/SplitButton/SplitButton.d.ts +1 -1
- package/esm/core/Buttons/SplitButton/SplitButton.js +59 -15
- package/esm/core/Carousel/Carousel.d.ts +3 -3
- package/esm/core/Carousel/Carousel.js +97 -70
- package/esm/core/Carousel/CarouselDot.d.ts +1 -1
- package/esm/core/Carousel/CarouselDot.js +19 -6
- package/esm/core/Carousel/CarouselDotsList.d.ts +1 -1
- package/esm/core/Carousel/CarouselDotsList.js +123 -63
- package/esm/core/Carousel/CarouselNavigation.d.ts +2 -2
- package/esm/core/Carousel/CarouselNavigation.js +85 -32
- package/esm/core/Carousel/CarouselSlide.d.ts +1 -1
- package/esm/core/Carousel/CarouselSlide.js +29 -14
- package/esm/core/Carousel/CarouselSlider.js +65 -40
- package/esm/core/Checkbox/Checkbox.d.ts +9 -5
- package/esm/core/Checkbox/Checkbox.js +78 -28
- package/esm/core/ColorPicker/ColorBuilder.js +277 -166
- package/esm/core/ColorPicker/ColorInputPanel.d.ts +1 -1
- package/esm/core/ColorPicker/ColorInputPanel.js +437 -248
- package/esm/core/ColorPicker/ColorPalette.d.ts +1 -1
- package/esm/core/ColorPicker/ColorPalette.js +115 -80
- package/esm/core/ColorPicker/ColorPicker.d.ts +1 -6
- package/esm/core/ColorPicker/ColorPicker.js +75 -54
- package/esm/core/ColorPicker/ColorPickerContext.js +7 -5
- package/esm/core/ColorPicker/ColorSwatch.d.ts +1 -1
- package/esm/core/ColorPicker/ColorSwatch.js +19 -7
- package/esm/core/ComboBox/ComboBox.d.ts +6 -6
- package/esm/core/ComboBox/ComboBox.js +385 -256
- package/esm/core/ComboBox/ComboBoxDropdown.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxDropdown.js +32 -15
- package/esm/core/ComboBox/ComboBoxEndIcon.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxEndIcon.js +39 -12
- package/esm/core/ComboBox/ComboBoxInput.d.ts +2 -2
- package/esm/core/ComboBox/ComboBoxInput.js +197 -124
- package/esm/core/ComboBox/ComboBoxInputContainer.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxInputContainer.js +20 -5
- package/esm/core/ComboBox/ComboBoxMenu.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxMenu.js +94 -38
- package/esm/core/ComboBox/ComboBoxMenuItem.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxMenuItem.js +59 -13
- package/esm/core/ComboBox/ComboBoxMultipleContainer.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxMultipleContainer.js +6 -2
- package/esm/core/ComboBox/helpers.d.ts +2 -2
- package/esm/core/ComboBox/helpers.js +38 -38
- package/esm/core/DatePicker/DatePicker.d.ts +2 -2
- package/esm/core/DatePicker/DatePicker.js +519 -325
- package/esm/core/Dialog/Dialog.d.ts +1 -1
- package/esm/core/Dialog/Dialog.js +65 -31
- package/esm/core/Dialog/DialogBackdrop.d.ts +1 -1
- package/esm/core/Dialog/DialogBackdrop.js +39 -19
- package/esm/core/Dialog/DialogContext.d.ts +1 -1
- package/esm/core/Dialog/DialogContext.js +1 -1
- package/esm/core/Dialog/DialogDragContext.d.ts +1 -1
- package/esm/core/Dialog/DialogDragContext.js +4 -4
- package/esm/core/Dialog/DialogMain.d.ts +1 -1
- package/esm/core/Dialog/DialogMain.js +178 -108
- package/esm/core/Dialog/DialogTitleBar.d.ts +1 -1
- package/esm/core/Dialog/DialogTitleBar.js +45 -10
- package/esm/core/DropdownMenu/DropdownMenu.d.ts +4 -4
- package/esm/core/DropdownMenu/DropdownMenu.js +66 -22
- package/esm/core/ExpandableBlock/ExpandableBlock.d.ts +77 -21
- package/esm/core/ExpandableBlock/ExpandableBlock.js +225 -46
- package/esm/core/Fieldset/Fieldset.d.ts +1 -1
- package/esm/core/Fieldset/Fieldset.js +19 -8
- package/esm/core/FileUpload/FileEmptyCard.js +19 -8
- package/esm/core/FileUpload/FileUpload.d.ts +1 -1
- package/esm/core/FileUpload/FileUpload.js +49 -36
- package/esm/core/FileUpload/FileUploadCard.d.ts +1 -1
- package/esm/core/FileUpload/FileUploadCard.js +154 -76
- package/esm/core/FileUpload/FileUploadTemplate.d.ts +1 -1
- package/esm/core/FileUpload/FileUploadTemplate.js +37 -9
- package/esm/core/Footer/Footer.d.ts +4 -4
- package/esm/core/Footer/Footer.js +86 -55
- package/esm/core/Footer/FooterSeparator.js +1 -1
- package/esm/core/Header/Header.d.ts +3 -22
- package/esm/core/Header/Header.js +55 -15
- package/esm/core/Header/HeaderBasicButton.js +28 -7
- package/esm/core/Header/HeaderBreadcrumbs.d.ts +1 -1
- package/esm/core/Header/HeaderBreadcrumbs.js +32 -8
- package/esm/core/Header/HeaderButton.d.ts +1 -1
- package/esm/core/Header/HeaderButton.js +60 -13
- package/esm/core/Header/HeaderDropdownButton.js +43 -13
- package/esm/core/Header/HeaderLogo.d.ts +1 -1
- package/esm/core/Header/HeaderLogo.js +36 -5
- package/esm/core/Header/HeaderSplitButton.js +57 -13
- package/esm/core/InformationPanel/InformationPanel.d.ts +1 -1
- package/esm/core/InformationPanel/InformationPanel.js +71 -36
- package/esm/core/InformationPanel/InformationPanelContent.d.ts +1 -1
- package/esm/core/InformationPanel/InformationPanelContent.js +17 -3
- package/esm/core/InformationPanel/InformationPanelHeader.d.ts +1 -1
- package/esm/core/InformationPanel/InformationPanelHeader.js +32 -8
- package/esm/core/InformationPanel/InformationPanelWrapper.js +3 -1
- package/esm/core/Input/Input.d.ts +1 -6
- package/esm/core/Input/Input.js +10 -9
- package/esm/core/InputGroup/InputGroup.d.ts +1 -1
- package/esm/core/InputGroup/InputGroup.js +37 -14
- package/esm/core/Label/Label.d.ts +1 -1
- package/esm/core/Label/Label.js +24 -5
- package/esm/core/LabeledInput/LabeledInput.d.ts +1 -1
- package/esm/core/LabeledInput/LabeledInput.js +43 -5
- package/esm/core/LabeledSelect/LabeledSelect.d.ts +1 -1
- package/esm/core/LabeledSelect/LabeledSelect.js +50 -16
- package/esm/core/LabeledTextarea/LabeledTextarea.d.ts +2 -3
- package/esm/core/LabeledTextarea/LabeledTextarea.js +43 -5
- package/esm/core/List/ListItem.d.ts +4 -4
- package/esm/core/List/ListItem.js +46 -28
- package/esm/core/Menu/Menu.d.ts +1 -1
- package/esm/core/Menu/Menu.js +58 -47
- package/esm/core/Menu/MenuDivider.js +1 -1
- package/esm/core/Menu/MenuExtraContent.js +1 -1
- package/esm/core/Menu/MenuItem.d.ts +1 -1
- package/esm/core/Menu/MenuItem.js +131 -57
- package/esm/core/Menu/MenuItemSkeleton.d.ts +1 -1
- package/esm/core/Menu/MenuItemSkeleton.js +44 -12
- package/esm/core/Modal/Modal.d.ts +1 -1
- package/esm/core/Modal/Modal.js +33 -6
- package/esm/core/NonIdealState/ErrorPage.d.ts +6 -7
- package/esm/core/NonIdealState/ErrorPage.js +177 -117
- package/esm/core/NonIdealState/NonIdealState.d.ts +17 -1
- package/esm/core/NonIdealState/NonIdealState.js +65 -6
- package/esm/core/NotificationMarker/NotificationMarker.d.ts +1 -1
- package/esm/core/NotificationMarker/NotificationMarker.js +20 -2
- package/esm/core/Overlay/Overlay.d.ts +57 -0
- package/esm/core/Overlay/Overlay.js +88 -0
- package/esm/core/Overlay/index.d.ts +1 -0
- package/esm/core/{ProgressIndicators/ProgressLinear → Overlay}/index.js +1 -2
- package/esm/core/ProgressIndicators/{ProgressLinear/ProgressLinear.d.ts → ProgressLinear.d.ts} +6 -6
- package/esm/core/ProgressIndicators/{ProgressLinear/ProgressLinear.js → ProgressLinear.js} +33 -12
- package/esm/core/ProgressIndicators/{ProgressRadial/ProgressRadial.d.ts → ProgressRadial.d.ts} +4 -4
- package/esm/core/ProgressIndicators/ProgressRadial.js +64 -0
- package/esm/core/ProgressIndicators/index.d.ts +2 -2
- package/esm/core/ProgressIndicators/index.js +2 -2
- package/esm/core/Radio/Radio.d.ts +1 -6
- package/esm/core/Radio/Radio.js +32 -11
- package/esm/core/RadioTiles/RadioTile.d.ts +1 -6
- package/esm/core/RadioTiles/RadioTile.js +32 -14
- package/esm/core/RadioTiles/RadioTileGroup.d.ts +1 -1
- package/esm/core/RadioTiles/RadioTileGroup.js +10 -3
- package/esm/core/SearchBox/SearchBox.d.ts +3 -3
- package/esm/core/SearchBox/SearchBox.js +215 -97
- package/esm/core/Select/Select.d.ts +5 -10
- package/esm/core/Select/Select.js +283 -148
- package/esm/core/Select/SelectTag.d.ts +1 -1
- package/esm/core/Select/SelectTag.js +15 -3
- package/esm/core/Select/SelectTagContainer.d.ts +1 -1
- package/esm/core/Select/SelectTagContainer.js +20 -7
- package/esm/core/SideNavigation/SideNavigation.d.ts +1 -1
- package/esm/core/SideNavigation/SideNavigation.js +94 -21
- package/esm/core/SideNavigation/SidenavButton.d.ts +1 -1
- package/esm/core/SideNavigation/SidenavButton.js +24 -2
- package/esm/core/SideNavigation/SidenavSubmenu.js +14 -3
- package/esm/core/SideNavigation/SidenavSubmenuHeader.d.ts +1 -1
- package/esm/core/SideNavigation/SidenavSubmenuHeader.js +20 -4
- package/esm/core/SkipToContentLink/SkipToContentLink.d.ts +1 -1
- package/esm/core/SkipToContentLink/SkipToContentLink.js +11 -2
- package/esm/core/Slider/Slider.d.ts +5 -9
- package/esm/core/Slider/Slider.js +319 -194
- package/esm/core/Slider/Thumb.d.ts +4 -4
- package/esm/core/Slider/Thumb.js +100 -52
- package/esm/core/Slider/Track.d.ts +3 -3
- package/esm/core/Slider/Track.js +67 -49
- package/esm/core/StatusMessage/StatusMessage.d.ts +2 -2
- package/esm/core/StatusMessage/StatusMessage.js +18 -5
- package/esm/core/Stepper/Stepper.d.ts +3 -3
- package/esm/core/Stepper/Stepper.js +45 -8
- package/esm/core/Stepper/StepperStep.d.ts +1 -1
- package/esm/core/Stepper/StepperStep.js +73 -31
- package/esm/core/Stepper/WorkflowDiagram.d.ts +1 -1
- package/esm/core/Stepper/WorkflowDiagram.js +19 -5
- package/esm/core/Stepper/WorkflowDiagramStep.d.ts +3 -3
- package/esm/core/Stepper/WorkflowDiagramStep.js +18 -4
- package/esm/core/Stepper/index.d.ts +0 -4
- package/esm/core/Stepper/index.js +0 -2
- package/esm/core/Surface/Surface.d.ts +2 -2
- package/esm/core/Surface/Surface.js +68 -39
- package/esm/core/Table/SubRowExpander.d.ts +2 -2
- package/esm/core/Table/SubRowExpander.js +29 -9
- package/esm/core/Table/Table.d.ts +2 -2
- package/esm/core/Table/Table.js +726 -411
- package/esm/core/Table/TableCell.d.ts +2 -2
- package/esm/core/Table/TableCell.js +87 -53
- package/esm/core/Table/TablePaginator.d.ts +3 -3
- package/esm/core/Table/TablePaginator.js +307 -125
- package/esm/core/Table/TableRowMemoized.d.ts +4 -4
- package/esm/core/Table/TableRowMemoized.js +129 -58
- package/esm/core/Table/actionHandlers/expandHandler.js +10 -10
- package/esm/core/Table/actionHandlers/filterHandler.js +23 -15
- package/esm/core/Table/actionHandlers/index.js +5 -1
- package/esm/core/Table/actionHandlers/resizeHandler.js +11 -11
- package/esm/core/Table/actionHandlers/selectHandler.js +117 -93
- package/esm/core/Table/cells/DefaultCell.d.ts +2 -2
- package/esm/core/Table/cells/DefaultCell.js +42 -7
- package/esm/core/Table/cells/EditableCell.d.ts +2 -2
- package/esm/core/Table/cells/EditableCell.js +70 -41
- package/esm/core/Table/columns/actionColumn.d.ts +3 -3
- package/esm/core/Table/columns/actionColumn.js +90 -58
- package/esm/core/Table/columns/expanderColumn.d.ts +2 -2
- package/esm/core/Table/columns/expanderColumn.js +38 -25
- package/esm/core/Table/columns/selectionColumn.d.ts +4 -4
- package/esm/core/Table/columns/selectionColumn.js +51 -23
- package/esm/core/Table/filters/BaseFilter.d.ts +2 -2
- package/esm/core/Table/filters/BaseFilter.js +15 -7
- package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.d.ts +3 -2
- package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +84 -42
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +4 -4
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +108 -46
- package/esm/core/Table/filters/FilterButtonBar.d.ts +3 -3
- package/esm/core/Table/filters/FilterButtonBar.js +28 -9
- package/esm/core/Table/filters/FilterToggle.d.ts +3 -3
- package/esm/core/Table/filters/FilterToggle.js +55 -20
- package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.d.ts +4 -4
- package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +50 -22
- package/esm/core/Table/filters/TextFilter/TextFilter.d.ts +3 -3
- package/esm/core/Table/filters/TextFilter/TextFilter.js +32 -14
- package/esm/core/Table/filters/customFilterFunctions.js +14 -12
- package/esm/core/Table/filters/defaultFilterFunctions.js +84 -79
- package/esm/core/Table/filters/tableFilters.d.ts +5 -5
- package/esm/core/Table/filters/tableFilters.js +34 -25
- package/esm/core/Table/filters/types.d.ts +1 -1
- package/esm/core/Table/hooks/useColumnDragAndDrop.js +88 -81
- package/esm/core/Table/hooks/useExpanderCell.d.ts +1 -1
- package/esm/core/Table/hooks/useExpanderCell.js +26 -20
- package/esm/core/Table/hooks/useResizeColumns.js +353 -287
- package/esm/core/Table/hooks/useScrollToRow.d.ts +2 -2
- package/esm/core/Table/hooks/useScrollToRow.js +42 -34
- package/esm/core/Table/hooks/useSelectionCell.js +10 -6
- package/esm/core/Table/hooks/useStickyColumns.js +61 -59
- package/esm/core/Table/hooks/useSubRowFiltering.js +90 -83
- package/esm/core/Table/hooks/useSubRowSelection.js +28 -27
- package/esm/core/Table/index.js +5 -1
- package/esm/core/Table/utils.js +40 -38
- package/esm/core/Tabs/Tab.d.ts +2 -2
- package/esm/core/Tabs/Tab.js +41 -7
- package/esm/core/Tabs/Tabs.d.ts +6 -42
- package/esm/core/Tabs/Tabs.js +391 -329
- package/esm/core/Tabs/index.d.ts +1 -1
- package/esm/core/Tabs/index.js +1 -1
- package/esm/core/Tag/Tag.d.ts +1 -1
- package/esm/core/Tag/Tag.js +35 -8
- package/esm/core/Tag/TagContainer.d.ts +1 -1
- package/esm/core/Tag/TagContainer.js +17 -5
- package/esm/core/Textarea/Textarea.d.ts +2 -9
- package/esm/core/Textarea/Textarea.js +11 -10
- package/esm/core/ThemeProvider/ThemeProvider.d.ts +4 -4
- package/esm/core/ThemeProvider/ThemeProvider.js +65 -21
- package/esm/core/Tile/Tile.d.ts +157 -99
- package/esm/core/Tile/Tile.js +397 -109
- package/esm/core/TimePicker/TimePicker.d.ts +3 -3
- package/esm/core/TimePicker/TimePicker.js +448 -228
- package/esm/core/Toast/Toast.d.ts +5 -5
- package/esm/core/Toast/Toast.js +180 -99
- package/esm/core/Toast/Toaster.d.ts +5 -5
- package/esm/core/Toast/Toaster.js +83 -67
- package/esm/core/ToggleSwitch/ToggleSwitch.d.ts +1 -6
- package/esm/core/ToggleSwitch/ToggleSwitch.js +60 -22
- package/esm/core/Tooltip/Tooltip.d.ts +67 -7
- package/esm/core/Tooltip/Tooltip.js +161 -7
- package/esm/core/TransferList/TransferList.d.ts +6 -6
- package/esm/core/TransferList/TransferList.js +163 -93
- package/esm/core/Tree/Tree.d.ts +5 -5
- package/esm/core/Tree/Tree.js +197 -125
- package/esm/core/Tree/TreeContext.d.ts +1 -1
- package/esm/core/Tree/TreeContext.js +5 -5
- package/esm/core/Tree/TreeNode.d.ts +2 -2
- package/esm/core/Tree/TreeNode.js +195 -96
- package/esm/core/Tree/TreeNodeExpander.d.ts +1 -1
- package/esm/core/Tree/TreeNodeExpander.js +16 -5
- package/esm/core/Typography/Blockquote/Blockquote.d.ts +1 -1
- package/esm/core/Typography/Blockquote/Blockquote.js +12 -4
- package/esm/core/Typography/Kbd/Kbd.d.ts +1 -1
- package/esm/core/Typography/Kbd/Kbd.js +24 -15
- package/esm/core/Typography/Text/Text.d.ts +1 -1
- package/esm/core/Typography/Text/Text.js +20 -7
- package/esm/core/index.d.ts +6 -5
- package/esm/core/index.js +82 -14
- package/esm/core/utils/color/ColorValue.d.ts +4 -4
- package/esm/core/utils/color/ColorValue.js +524 -449
- package/esm/core/utils/components/AutoclearingHiddenLiveRegion.d.ts +2 -2
- package/esm/core/utils/components/AutoclearingHiddenLiveRegion.js +11 -7
- package/esm/core/utils/components/Divider.d.ts +1 -1
- package/esm/core/utils/components/Divider.js +8 -2
- package/esm/core/utils/components/Flex.d.ts +4 -4
- package/esm/core/utils/components/Flex.js +87 -71
- package/esm/core/utils/components/FocusTrap.d.ts +3 -3
- package/esm/core/utils/components/FocusTrap.js +41 -32
- package/esm/core/utils/components/Icon.d.ts +1 -1
- package/esm/core/utils/components/Icon.js +19 -12
- package/esm/core/utils/components/InputContainer.d.ts +2 -2
- package/esm/core/utils/components/InputContainer.js +65 -15
- package/esm/core/utils/components/InputFlexContainer.d.ts +1 -1
- package/esm/core/utils/components/InputFlexContainer.js +13 -2
- package/esm/core/utils/components/MiddleTextTruncation.d.ts +2 -2
- package/esm/core/utils/components/MiddleTextTruncation.js +27 -17
- package/esm/core/utils/components/Popover.d.ts +3 -3
- package/esm/core/utils/components/Popover.js +103 -102
- package/esm/core/utils/components/Resizer.d.ts +2 -2
- package/esm/core/utils/components/Resizer.js +242 -184
- package/esm/core/utils/components/VirtualScroll.d.ts +2 -2
- package/esm/core/utils/components/VirtualScroll.js +297 -218
- package/esm/core/utils/components/VisuallyHidden.d.ts +1 -1
- package/esm/core/utils/components/VisuallyHidden.js +8 -2
- package/esm/core/utils/components/WithCSSTransition.d.ts +2 -2
- package/esm/core/utils/components/WithCSSTransition.js +38 -21
- package/esm/core/utils/functions/colors.js +30 -30
- package/esm/core/utils/functions/date.js +8 -8
- package/esm/core/utils/functions/dom.js +17 -14
- package/esm/core/utils/functions/focusable.js +24 -15
- package/esm/core/utils/functions/import.d.ts +6 -0
- package/esm/core/utils/functions/import.js +13 -0
- package/esm/core/utils/functions/index.d.ts +1 -0
- package/esm/core/utils/functions/index.js +1 -0
- package/esm/core/utils/functions/numbers.js +7 -7
- package/esm/core/utils/functions/polymorphic.d.ts +5 -3
- package/esm/core/utils/functions/polymorphic.js +32 -23
- package/esm/core/utils/functions/supports.js +2 -1
- package/esm/core/utils/hooks/useContainerWidth.js +16 -13
- package/esm/core/utils/hooks/useDragAndDrop.js +99 -80
- package/esm/core/utils/hooks/useEventListener.js +18 -18
- package/esm/core/utils/hooks/useGlobals.js +29 -24
- package/esm/core/utils/hooks/useId.js +2 -2
- package/esm/core/utils/hooks/useIntersection.js +25 -19
- package/esm/core/utils/hooks/useIsClient.js +5 -5
- package/esm/core/utils/hooks/useIsomorphicLayoutEffect.js +2 -1
- package/esm/core/utils/hooks/useLatestRef.js +5 -5
- package/esm/core/utils/hooks/useMediaQuery.js +23 -25
- package/esm/core/utils/hooks/useMergedRefs.js +11 -12
- package/esm/core/utils/hooks/useOverflow.js +62 -50
- package/esm/core/utils/hooks/useResizeObserver.js +17 -12
- package/esm/core/utils/hooks/useSafeContext.js +5 -5
- package/esm/core/utils/icons/StatusIconMap.d.ts +5 -5
- package/esm/core/utils/icons/StatusIconMap.js +8 -4
- package/esm/core/utils/icons/SvgCalendar.d.ts +1 -1
- package/esm/core/utils/icons/SvgCalendar.js +7 -2
- package/esm/core/utils/icons/SvgCaretDownSmall.d.ts +1 -1
- package/esm/core/utils/icons/SvgCaretDownSmall.js +7 -2
- package/esm/core/utils/icons/SvgCaretRightSmall.d.ts +1 -1
- package/esm/core/utils/icons/SvgCaretRightSmall.js +7 -2
- package/esm/core/utils/icons/SvgCaretUpSmall.d.ts +1 -1
- package/esm/core/utils/icons/SvgCaretUpSmall.js +7 -2
- package/esm/core/utils/icons/SvgCheckmark.d.ts +1 -1
- package/esm/core/utils/icons/SvgCheckmark.js +5 -2
- package/esm/core/utils/icons/SvgCheckmarkSmall.d.ts +1 -1
- package/esm/core/utils/icons/SvgCheckmarkSmall.js +7 -2
- package/esm/core/utils/icons/SvgChevronLeft.d.ts +1 -1
- package/esm/core/utils/icons/SvgChevronLeft.js +7 -2
- package/esm/core/utils/icons/SvgChevronLeftDouble.d.ts +1 -1
- package/esm/core/utils/icons/SvgChevronLeftDouble.js +7 -2
- package/esm/core/utils/icons/SvgChevronRight.d.ts +1 -1
- package/esm/core/utils/icons/SvgChevronRight.js +7 -2
- package/esm/core/utils/icons/SvgChevronRightDouble.d.ts +1 -1
- package/esm/core/utils/icons/SvgChevronRightDouble.js +7 -2
- package/esm/core/utils/icons/SvgClose.d.ts +1 -1
- package/esm/core/utils/icons/SvgClose.js +7 -2
- package/esm/core/utils/icons/SvgCloseSmall.d.ts +1 -1
- package/esm/core/utils/icons/SvgCloseSmall.js +7 -2
- package/esm/core/utils/icons/SvgColumnManager.d.ts +1 -1
- package/esm/core/utils/icons/SvgColumnManager.js +7 -2
- package/esm/core/utils/icons/SvgDocument.d.ts +1 -1
- package/esm/core/utils/icons/SvgDocument.js +5 -2
- package/esm/core/utils/icons/SvgFilter.d.ts +1 -1
- package/esm/core/utils/icons/SvgFilter.js +5 -2
- package/esm/core/utils/icons/SvgFilterHollow.d.ts +1 -1
- package/esm/core/utils/icons/SvgFilterHollow.js +7 -2
- package/esm/core/utils/icons/SvgImportantSmall.d.ts +1 -1
- package/esm/core/utils/icons/SvgImportantSmall.js +7 -2
- package/esm/core/utils/icons/SvgInfoCircular.d.ts +1 -1
- package/esm/core/utils/icons/SvgInfoCircular.js +7 -2
- package/esm/core/utils/icons/SvgMore.d.ts +1 -1
- package/esm/core/utils/icons/SvgMore.js +7 -2
- package/esm/core/utils/icons/SvgMoreVertical.d.ts +1 -1
- package/esm/core/utils/icons/SvgMoreVertical.js +7 -2
- package/esm/core/utils/icons/SvgNew.d.ts +1 -1
- package/esm/core/utils/icons/SvgNew.js +7 -2
- package/esm/core/utils/icons/SvgSearch.d.ts +1 -1
- package/esm/core/utils/icons/SvgSearch.js +7 -2
- package/esm/core/utils/icons/SvgSmileyHappy.d.ts +1 -1
- package/esm/core/utils/icons/SvgSmileyHappy.js +7 -2
- package/esm/core/utils/icons/SvgSortDown.d.ts +1 -1
- package/esm/core/utils/icons/SvgSortDown.js +7 -2
- package/esm/core/utils/icons/SvgSortUp.d.ts +1 -1
- package/esm/core/utils/icons/SvgSortUp.js +7 -2
- package/esm/core/utils/icons/SvgStatusError.d.ts +1 -1
- package/esm/core/utils/icons/SvgStatusError.js +7 -2
- package/esm/core/utils/icons/SvgStatusSuccess.d.ts +1 -1
- package/esm/core/utils/icons/SvgStatusSuccess.js +7 -2
- package/esm/core/utils/icons/SvgStatusWarning.d.ts +1 -1
- package/esm/core/utils/icons/SvgStatusWarning.js +7 -2
- package/esm/core/utils/icons/SvgSwap.d.ts +1 -1
- package/esm/core/utils/icons/SvgSwap.js +7 -2
- package/esm/core/utils/icons/SvgUpload.d.ts +1 -1
- package/esm/core/utils/icons/SvgUpload.js +7 -2
- package/esm/core/utils/props.d.ts +2 -2
- package/esm/core/utils/types.d.ts +1 -1
- package/esm/styles.js +453 -447
- package/package.json +34 -30
- package/styles.css +575 -598
- package/cjs/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +0 -65
- package/cjs/core/ProgressIndicators/ProgressLinear/index.d.ts +0 -3
- package/cjs/core/ProgressIndicators/ProgressLinear/index.js +0 -10
- package/cjs/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +0 -77
- package/cjs/core/ProgressIndicators/ProgressRadial/index.d.ts +0 -3
- package/cjs/core/ProgressIndicators/ProgressRadial/index.js +0 -10
- package/cjs/core/Stepper/Wizard.d.ts +0 -46
- package/cjs/core/Stepper/Wizard.js +0 -55
- package/esm/core/ProgressIndicators/ProgressLinear/index.d.ts +0 -3
- package/esm/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +0 -48
- package/esm/core/ProgressIndicators/ProgressRadial/index.d.ts +0 -3
- package/esm/core/Stepper/Wizard.d.ts +0 -46
- package/esm/core/Stepper/Wizard.js +0 -29
package/esm/core/Table/Table.js
CHANGED
|
@@ -4,15 +4,50 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import cx from 'classnames';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
actions as TableActions,
|
|
9
|
+
useFlexLayout,
|
|
10
|
+
useFilters,
|
|
11
|
+
useRowSelect,
|
|
12
|
+
useSortBy,
|
|
13
|
+
useTable,
|
|
14
|
+
useExpanded,
|
|
15
|
+
usePagination,
|
|
16
|
+
useColumnOrder,
|
|
17
|
+
useGlobalFilter,
|
|
18
|
+
} from 'react-table';
|
|
8
19
|
import { ProgressRadial } from '../ProgressIndicators/index.js';
|
|
9
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
useGlobals,
|
|
22
|
+
useResizeObserver,
|
|
23
|
+
SvgSortDown,
|
|
24
|
+
SvgSortUp,
|
|
25
|
+
useIsomorphicLayoutEffect,
|
|
26
|
+
Box,
|
|
27
|
+
} from '../utils/index.js';
|
|
10
28
|
import { getCellStyle, getStickyStyle } from './utils.js';
|
|
11
29
|
import { TableRowMemoized } from './TableRowMemoized.js';
|
|
12
30
|
import { FilterToggle } from './filters/index.js';
|
|
13
31
|
import { customFilterFunctions } from './filters/customFilterFunctions.js';
|
|
14
|
-
import {
|
|
15
|
-
|
|
32
|
+
import {
|
|
33
|
+
useExpanderCell,
|
|
34
|
+
useSelectionCell,
|
|
35
|
+
useSubRowFiltering,
|
|
36
|
+
useSubRowSelection,
|
|
37
|
+
useResizeColumns,
|
|
38
|
+
useColumnDragAndDrop,
|
|
39
|
+
useScrollToRow,
|
|
40
|
+
useStickyColumns,
|
|
41
|
+
} from './hooks/index.js';
|
|
42
|
+
import {
|
|
43
|
+
onExpandHandler,
|
|
44
|
+
onFilterHandler,
|
|
45
|
+
onToggleHandler,
|
|
46
|
+
onShiftSelectHandler,
|
|
47
|
+
onSingleSelectHandler,
|
|
48
|
+
onTableResizeEnd,
|
|
49
|
+
onTableResizeStart,
|
|
50
|
+
} from './actionHandlers/index.js';
|
|
16
51
|
import VirtualScroll from '../utils/components/VirtualScroll.js';
|
|
17
52
|
import { SELECTION_CELL_ID } from './columns/index.js';
|
|
18
53
|
const singleRowSelectedAction = 'singleRowSelected';
|
|
@@ -23,18 +58,17 @@ let didLogWarning = false;
|
|
|
23
58
|
let isDev = false;
|
|
24
59
|
// wrapping in try-catch because process might be undefined
|
|
25
60
|
try {
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
catch { }
|
|
61
|
+
isDev = process.env.NODE_ENV !== 'production';
|
|
62
|
+
} catch {}
|
|
29
63
|
const flattenColumns = (columns) => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
64
|
+
const flatColumns = [];
|
|
65
|
+
columns.forEach((column) => {
|
|
66
|
+
flatColumns.push(column);
|
|
67
|
+
if ('columns' in column) {
|
|
68
|
+
flatColumns.push(...flattenColumns(column.columns));
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
return flatColumns;
|
|
38
72
|
};
|
|
39
73
|
/**
|
|
40
74
|
* Table based on [react-table](https://react-table.tanstack.com/docs/api/overview).
|
|
@@ -74,413 +108,694 @@ const flattenColumns = (columns) => {
|
|
|
74
108
|
* />
|
|
75
109
|
*/
|
|
76
110
|
export const Table = (props) => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
111
|
+
const {
|
|
112
|
+
data,
|
|
113
|
+
columns,
|
|
114
|
+
isLoading = false,
|
|
115
|
+
emptyTableContent,
|
|
116
|
+
className,
|
|
117
|
+
style,
|
|
118
|
+
id,
|
|
119
|
+
isSelectable = false,
|
|
120
|
+
onSelect,
|
|
121
|
+
onRowClick,
|
|
122
|
+
selectionMode = 'multi',
|
|
123
|
+
isSortable = false,
|
|
124
|
+
onSort,
|
|
125
|
+
stateReducer,
|
|
126
|
+
onBottomReached,
|
|
127
|
+
onRowInViewport,
|
|
128
|
+
intersectionMargin = 300,
|
|
129
|
+
subComponent,
|
|
130
|
+
onExpand,
|
|
131
|
+
onFilter,
|
|
132
|
+
globalFilterValue,
|
|
133
|
+
emptyFilteredTableContent,
|
|
134
|
+
filterTypes: filterFunctions,
|
|
135
|
+
expanderCell,
|
|
136
|
+
isRowDisabled,
|
|
137
|
+
rowProps,
|
|
138
|
+
density = 'default',
|
|
139
|
+
selectSubRows = true,
|
|
140
|
+
getSubRows,
|
|
141
|
+
selectRowOnClick = true,
|
|
142
|
+
paginatorRenderer,
|
|
143
|
+
pageSize = 25,
|
|
144
|
+
isResizable = false,
|
|
145
|
+
columnResizeMode = 'fit',
|
|
146
|
+
styleType = 'default',
|
|
147
|
+
enableVirtualization = false,
|
|
148
|
+
enableColumnReordering = false,
|
|
149
|
+
...rest
|
|
150
|
+
} = props;
|
|
151
|
+
useGlobals();
|
|
152
|
+
const ownerDocument = React.useRef();
|
|
153
|
+
const defaultColumn = React.useMemo(
|
|
154
|
+
() => ({
|
|
155
|
+
maxWidth: 0,
|
|
156
|
+
minWidth: 0,
|
|
157
|
+
width: 0,
|
|
158
|
+
}),
|
|
159
|
+
[],
|
|
160
|
+
);
|
|
161
|
+
// useRef prevents from rerendering when one of these callbacks changes
|
|
162
|
+
const onBottomReachedRef = React.useRef(onBottomReached);
|
|
163
|
+
const onRowInViewportRef = React.useRef(onRowInViewport);
|
|
164
|
+
React.useEffect(() => {
|
|
165
|
+
onBottomReachedRef.current = onBottomReached;
|
|
166
|
+
onRowInViewportRef.current = onRowInViewport;
|
|
167
|
+
}, [onBottomReached, onRowInViewport]);
|
|
168
|
+
const hasManualSelectionColumn = React.useMemo(() => {
|
|
169
|
+
const flatColumns = flattenColumns(columns);
|
|
170
|
+
return flatColumns.some((column) => column.id === SELECTION_CELL_ID);
|
|
171
|
+
}, [columns]);
|
|
172
|
+
const disableUserSelect = React.useCallback((e) => {
|
|
173
|
+
if (e.key === 'Shift') {
|
|
174
|
+
ownerDocument.current &&
|
|
175
|
+
(ownerDocument.current.documentElement.style.userSelect = 'none');
|
|
176
|
+
}
|
|
177
|
+
}, []);
|
|
178
|
+
const enableUserSelect = React.useCallback((e) => {
|
|
179
|
+
if (e.key === 'Shift') {
|
|
180
|
+
ownerDocument.current &&
|
|
181
|
+
(ownerDocument.current.documentElement.style.userSelect = '');
|
|
182
|
+
}
|
|
183
|
+
}, []);
|
|
184
|
+
React.useEffect(() => {
|
|
185
|
+
if (!isSelectable || selectionMode !== 'multi') {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const ownerDoc = ownerDocument.current;
|
|
189
|
+
ownerDoc?.addEventListener('keydown', disableUserSelect);
|
|
190
|
+
ownerDoc?.addEventListener('keyup', enableUserSelect);
|
|
191
|
+
return () => {
|
|
192
|
+
ownerDoc?.removeEventListener('keydown', disableUserSelect);
|
|
193
|
+
ownerDoc?.removeEventListener('keyup', enableUserSelect);
|
|
194
|
+
};
|
|
195
|
+
}, [
|
|
196
|
+
isSelectable,
|
|
197
|
+
selectionMode,
|
|
198
|
+
ownerDocument,
|
|
199
|
+
disableUserSelect,
|
|
200
|
+
enableUserSelect,
|
|
201
|
+
]);
|
|
202
|
+
const previousFilter = React.useRef([]);
|
|
203
|
+
const currentFilter = React.useRef(previousFilter.current);
|
|
204
|
+
const tableStateReducer = React.useCallback(
|
|
205
|
+
(newState, action, previousState, instance) => {
|
|
206
|
+
switch (action.type) {
|
|
207
|
+
case TableActions.toggleSortBy:
|
|
208
|
+
onSort?.(newState);
|
|
209
|
+
break;
|
|
210
|
+
case TableActions.setFilter:
|
|
211
|
+
currentFilter.current = onFilterHandler(
|
|
212
|
+
newState,
|
|
213
|
+
action,
|
|
214
|
+
previousState,
|
|
215
|
+
currentFilter.current,
|
|
216
|
+
instance,
|
|
217
|
+
);
|
|
218
|
+
break;
|
|
219
|
+
case TableActions.toggleRowExpanded:
|
|
220
|
+
case TableActions.toggleAllRowsExpanded:
|
|
221
|
+
onExpandHandler(newState, instance, onExpand);
|
|
222
|
+
break;
|
|
223
|
+
case singleRowSelectedAction: {
|
|
224
|
+
newState = onSingleSelectHandler(
|
|
225
|
+
newState,
|
|
226
|
+
action,
|
|
227
|
+
instance,
|
|
228
|
+
onSelect,
|
|
229
|
+
// If it has manual selection column, then we can't check whether row is disabled
|
|
230
|
+
hasManualSelectionColumn ? undefined : isRowDisabled,
|
|
231
|
+
);
|
|
232
|
+
break;
|
|
100
233
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
234
|
+
case shiftRowSelectedAction: {
|
|
235
|
+
newState = onShiftSelectHandler(
|
|
236
|
+
newState,
|
|
237
|
+
action,
|
|
238
|
+
instance,
|
|
239
|
+
onSelect,
|
|
240
|
+
// If it has manual selection column, then we can't check whether row is disabled
|
|
241
|
+
hasManualSelectionColumn ? undefined : isRowDisabled,
|
|
242
|
+
);
|
|
243
|
+
break;
|
|
106
244
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
245
|
+
case TableActions.toggleRowSelected:
|
|
246
|
+
case TableActions.toggleAllRowsSelected:
|
|
247
|
+
case TableActions.toggleAllPageRowsSelected: {
|
|
248
|
+
onToggleHandler(
|
|
249
|
+
newState,
|
|
250
|
+
action,
|
|
251
|
+
instance,
|
|
252
|
+
onSelect,
|
|
253
|
+
// If it has manual selection column, then we can't check whether row is disabled
|
|
254
|
+
hasManualSelectionColumn ? undefined : isRowDisabled,
|
|
255
|
+
);
|
|
256
|
+
break;
|
|
111
257
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return () => {
|
|
116
|
-
ownerDoc?.removeEventListener('keydown', disableUserSelect);
|
|
117
|
-
ownerDoc?.removeEventListener('keyup', enableUserSelect);
|
|
118
|
-
};
|
|
119
|
-
}, [
|
|
120
|
-
isSelectable,
|
|
121
|
-
selectionMode,
|
|
122
|
-
ownerDocument,
|
|
123
|
-
disableUserSelect,
|
|
124
|
-
enableUserSelect,
|
|
125
|
-
]);
|
|
126
|
-
const previousFilter = React.useRef([]);
|
|
127
|
-
const currentFilter = React.useRef(previousFilter.current);
|
|
128
|
-
const tableStateReducer = React.useCallback((newState, action, previousState, instance) => {
|
|
129
|
-
switch (action.type) {
|
|
130
|
-
case TableActions.toggleSortBy:
|
|
131
|
-
onSort?.(newState);
|
|
132
|
-
break;
|
|
133
|
-
case TableActions.setFilter:
|
|
134
|
-
currentFilter.current = onFilterHandler(newState, action, previousState, currentFilter.current, instance);
|
|
135
|
-
break;
|
|
136
|
-
case TableActions.toggleRowExpanded:
|
|
137
|
-
case TableActions.toggleAllRowsExpanded:
|
|
138
|
-
onExpandHandler(newState, instance, onExpand);
|
|
139
|
-
break;
|
|
140
|
-
case singleRowSelectedAction: {
|
|
141
|
-
newState = onSingleSelectHandler(newState, action, instance, onSelect,
|
|
142
|
-
// If it has manual selection column, then we can't check whether row is disabled
|
|
143
|
-
hasManualSelectionColumn ? undefined : isRowDisabled);
|
|
144
|
-
break;
|
|
145
|
-
}
|
|
146
|
-
case shiftRowSelectedAction: {
|
|
147
|
-
newState = onShiftSelectHandler(newState, action, instance, onSelect,
|
|
148
|
-
// If it has manual selection column, then we can't check whether row is disabled
|
|
149
|
-
hasManualSelectionColumn ? undefined : isRowDisabled);
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
152
|
-
case TableActions.toggleRowSelected:
|
|
153
|
-
case TableActions.toggleAllRowsSelected:
|
|
154
|
-
case TableActions.toggleAllPageRowsSelected: {
|
|
155
|
-
onToggleHandler(newState, action, instance, onSelect,
|
|
156
|
-
// If it has manual selection column, then we can't check whether row is disabled
|
|
157
|
-
hasManualSelectionColumn ? undefined : isRowDisabled);
|
|
158
|
-
break;
|
|
159
|
-
}
|
|
160
|
-
case tableResizeStartAction: {
|
|
161
|
-
newState = onTableResizeStart(newState);
|
|
162
|
-
break;
|
|
163
|
-
}
|
|
164
|
-
case tableResizeEndAction: {
|
|
165
|
-
newState = onTableResizeEnd(newState, action);
|
|
166
|
-
break;
|
|
167
|
-
}
|
|
168
|
-
default:
|
|
169
|
-
break;
|
|
258
|
+
case tableResizeStartAction: {
|
|
259
|
+
newState = onTableResizeStart(newState);
|
|
260
|
+
break;
|
|
170
261
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}, [
|
|
175
|
-
hasManualSelectionColumn,
|
|
176
|
-
isRowDisabled,
|
|
177
|
-
onExpand,
|
|
178
|
-
onSelect,
|
|
179
|
-
onSort,
|
|
180
|
-
stateReducer,
|
|
181
|
-
]);
|
|
182
|
-
const filterTypes = React.useMemo(() => ({ ...customFilterFunctions, ...filterFunctions }), [filterFunctions]);
|
|
183
|
-
const hasAnySubRows = React.useMemo(() => {
|
|
184
|
-
return data.some((item, index) => getSubRows ? getSubRows(item, index) : item.subRows);
|
|
185
|
-
}, [data, getSubRows]);
|
|
186
|
-
const instance = useTable({
|
|
187
|
-
manualPagination: !paginatorRenderer,
|
|
188
|
-
paginateExpandedRows: false,
|
|
189
|
-
...props,
|
|
190
|
-
columns,
|
|
191
|
-
defaultColumn,
|
|
192
|
-
disableSortBy: !isSortable,
|
|
193
|
-
stateReducer: tableStateReducer,
|
|
194
|
-
filterTypes,
|
|
195
|
-
selectSubRows,
|
|
196
|
-
data,
|
|
197
|
-
getSubRows,
|
|
198
|
-
initialState: { pageSize, ...props.initialState },
|
|
199
|
-
columnResizeMode,
|
|
200
|
-
}, useFlexLayout, useResizeColumns(ownerDocument), useFilters, useSubRowFiltering(hasAnySubRows), useGlobalFilter, useSortBy, useExpanded, usePagination, useRowSelect, useSubRowSelection, useExpanderCell(subComponent, expanderCell, isRowDisabled), useSelectionCell(isSelectable, selectionMode, isRowDisabled, density), useColumnOrder, useColumnDragAndDrop(enableColumnReordering), useStickyColumns);
|
|
201
|
-
const { getTableProps, rows, headerGroups: _headerGroups, getTableBodyProps, prepareRow, state, allColumns, dispatch, page, gotoPage, setPageSize, flatHeaders, visibleColumns, setGlobalFilter, } = instance;
|
|
202
|
-
let headerGroups = _headerGroups;
|
|
203
|
-
if (columns.length === 1 && 'columns' in columns[0]) {
|
|
204
|
-
headerGroups = _headerGroups.slice(1);
|
|
205
|
-
if (isDev && !didLogWarning) {
|
|
206
|
-
console.warn(`Table's \`columns\` prop should not have a top-level \`Header\` or sub-columns. They are only allowed to be passed for backwards compatibility.\n See https://github.com/iTwin/iTwinUI/wiki/iTwinUI-react-v2-migration-guide#breaking-changes`);
|
|
207
|
-
didLogWarning = true;
|
|
262
|
+
case tableResizeEndAction: {
|
|
263
|
+
newState = onTableResizeEnd(newState, action);
|
|
264
|
+
break;
|
|
208
265
|
}
|
|
266
|
+
default:
|
|
267
|
+
break;
|
|
268
|
+
}
|
|
269
|
+
return stateReducer
|
|
270
|
+
? stateReducer(newState, action, previousState, instance)
|
|
271
|
+
: newState;
|
|
272
|
+
},
|
|
273
|
+
[
|
|
274
|
+
hasManualSelectionColumn,
|
|
275
|
+
isRowDisabled,
|
|
276
|
+
onExpand,
|
|
277
|
+
onSelect,
|
|
278
|
+
onSort,
|
|
279
|
+
stateReducer,
|
|
280
|
+
],
|
|
281
|
+
);
|
|
282
|
+
const filterTypes = React.useMemo(
|
|
283
|
+
() => ({ ...customFilterFunctions, ...filterFunctions }),
|
|
284
|
+
[filterFunctions],
|
|
285
|
+
);
|
|
286
|
+
const hasAnySubRows = React.useMemo(() => {
|
|
287
|
+
return data.some((item, index) =>
|
|
288
|
+
getSubRows ? getSubRows(item, index) : item.subRows,
|
|
289
|
+
);
|
|
290
|
+
}, [data, getSubRows]);
|
|
291
|
+
const instance = useTable(
|
|
292
|
+
{
|
|
293
|
+
manualPagination: !paginatorRenderer,
|
|
294
|
+
paginateExpandedRows: false,
|
|
295
|
+
...props,
|
|
296
|
+
columns,
|
|
297
|
+
defaultColumn,
|
|
298
|
+
disableSortBy: !isSortable,
|
|
299
|
+
stateReducer: tableStateReducer,
|
|
300
|
+
filterTypes,
|
|
301
|
+
selectSubRows,
|
|
302
|
+
data,
|
|
303
|
+
getSubRows,
|
|
304
|
+
initialState: { pageSize, ...props.initialState },
|
|
305
|
+
columnResizeMode,
|
|
306
|
+
},
|
|
307
|
+
useFlexLayout,
|
|
308
|
+
useResizeColumns(ownerDocument),
|
|
309
|
+
useFilters,
|
|
310
|
+
useSubRowFiltering(hasAnySubRows),
|
|
311
|
+
useGlobalFilter,
|
|
312
|
+
useSortBy,
|
|
313
|
+
useExpanded,
|
|
314
|
+
usePagination,
|
|
315
|
+
useRowSelect,
|
|
316
|
+
useSubRowSelection,
|
|
317
|
+
useExpanderCell(subComponent, expanderCell, isRowDisabled),
|
|
318
|
+
useSelectionCell(isSelectable, selectionMode, isRowDisabled, density),
|
|
319
|
+
useColumnOrder,
|
|
320
|
+
useColumnDragAndDrop(enableColumnReordering),
|
|
321
|
+
useStickyColumns,
|
|
322
|
+
);
|
|
323
|
+
const {
|
|
324
|
+
getTableProps,
|
|
325
|
+
rows,
|
|
326
|
+
headerGroups: _headerGroups,
|
|
327
|
+
getTableBodyProps,
|
|
328
|
+
prepareRow,
|
|
329
|
+
state,
|
|
330
|
+
allColumns,
|
|
331
|
+
dispatch,
|
|
332
|
+
page,
|
|
333
|
+
gotoPage,
|
|
334
|
+
setPageSize,
|
|
335
|
+
flatHeaders,
|
|
336
|
+
visibleColumns,
|
|
337
|
+
setGlobalFilter,
|
|
338
|
+
} = instance;
|
|
339
|
+
let headerGroups = _headerGroups;
|
|
340
|
+
if (columns.length === 1 && 'columns' in columns[0]) {
|
|
341
|
+
headerGroups = _headerGroups.slice(1);
|
|
342
|
+
if (isDev && !didLogWarning) {
|
|
343
|
+
console.warn(
|
|
344
|
+
`Table's \`columns\` prop should not have a top-level \`Header\` or sub-columns. They are only allowed to be passed for backwards compatibility.\n See https://github.com/iTwin/iTwinUI/wiki/iTwinUI-react-v2-migration-guide#breaking-changes`,
|
|
345
|
+
);
|
|
346
|
+
didLogWarning = true;
|
|
209
347
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
348
|
+
}
|
|
349
|
+
const ariaDataAttributes = Object.entries(rest).reduce(
|
|
350
|
+
(result, [key, value]) => {
|
|
351
|
+
if (key.startsWith('data-') || key.startsWith('aria-')) {
|
|
352
|
+
result[key] = value;
|
|
353
|
+
}
|
|
354
|
+
return result;
|
|
355
|
+
},
|
|
356
|
+
{},
|
|
357
|
+
);
|
|
358
|
+
const areFiltersSet =
|
|
359
|
+
allColumns.some(
|
|
360
|
+
(column) => column.filterValue != null && column.filterValue !== '',
|
|
361
|
+
) || !!globalFilterValue;
|
|
362
|
+
const showFilterButton = (column) =>
|
|
363
|
+
(data.length !== 0 || areFiltersSet) && column.canFilter && !!column.Filter;
|
|
364
|
+
const showSortButton = (column) => data.length !== 0 && column.canSort;
|
|
365
|
+
const onRowClickHandler = React.useCallback(
|
|
366
|
+
(event, row) => {
|
|
367
|
+
const isDisabled = isRowDisabled?.(row.original);
|
|
368
|
+
const ctrlPressed = event.ctrlKey || event.metaKey;
|
|
369
|
+
if (!isDisabled) {
|
|
370
|
+
onRowClick?.(event, row);
|
|
371
|
+
}
|
|
372
|
+
if (
|
|
373
|
+
isSelectable &&
|
|
374
|
+
!isDisabled &&
|
|
375
|
+
selectRowOnClick &&
|
|
376
|
+
!event.isDefaultPrevented()
|
|
377
|
+
) {
|
|
378
|
+
if (selectionMode === 'multi' && event.shiftKey) {
|
|
379
|
+
dispatch({
|
|
380
|
+
type: shiftRowSelectedAction,
|
|
381
|
+
id: row.id,
|
|
382
|
+
ctrlPressed: ctrlPressed,
|
|
383
|
+
});
|
|
384
|
+
} else if (
|
|
385
|
+
!row.isSelected &&
|
|
386
|
+
(selectionMode === 'single' || !ctrlPressed)
|
|
387
|
+
) {
|
|
388
|
+
dispatch({
|
|
389
|
+
type: singleRowSelectedAction,
|
|
390
|
+
id: row.id,
|
|
391
|
+
});
|
|
392
|
+
} else {
|
|
393
|
+
row.toggleRowSelected(!row.isSelected);
|
|
246
394
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
395
|
+
}
|
|
396
|
+
},
|
|
397
|
+
[
|
|
398
|
+
isRowDisabled,
|
|
399
|
+
isSelectable,
|
|
400
|
+
selectRowOnClick,
|
|
401
|
+
selectionMode,
|
|
402
|
+
dispatch,
|
|
403
|
+
onRowClick,
|
|
404
|
+
],
|
|
405
|
+
);
|
|
406
|
+
React.useEffect(() => {
|
|
407
|
+
setGlobalFilter(globalFilterValue);
|
|
408
|
+
}, [globalFilterValue, setGlobalFilter]);
|
|
409
|
+
React.useEffect(() => {
|
|
410
|
+
setPageSize(pageSize);
|
|
411
|
+
}, [pageSize, setPageSize]);
|
|
412
|
+
React.useEffect(() => {
|
|
413
|
+
if (previousFilter.current !== currentFilter.current) {
|
|
414
|
+
previousFilter.current = currentFilter.current;
|
|
415
|
+
onFilter?.(currentFilter.current, state, instance.filteredRows);
|
|
416
|
+
}
|
|
417
|
+
}, [state, instance.filteredRows, onFilter]);
|
|
418
|
+
const lastPassedColumns = React.useRef([]);
|
|
419
|
+
// Reset the column order whenever new columns are passed
|
|
420
|
+
// This is to avoid the old columnOrder from affecting the new columns' columnOrder
|
|
421
|
+
React.useEffect(() => {
|
|
422
|
+
// Check if columns have changed (by value)
|
|
423
|
+
if (JSON.stringify(lastPassedColumns.current) !== JSON.stringify(columns)) {
|
|
424
|
+
instance.setColumnOrder([]);
|
|
425
|
+
}
|
|
426
|
+
lastPassedColumns.current = columns;
|
|
427
|
+
}, [columns, instance]);
|
|
428
|
+
const paginatorRendererProps = React.useMemo(
|
|
429
|
+
() => ({
|
|
430
|
+
currentPage: state.pageIndex,
|
|
431
|
+
pageSize: state.pageSize,
|
|
432
|
+
totalRowsCount: rows.length,
|
|
433
|
+
size: density !== 'default' ? 'small' : 'default',
|
|
434
|
+
isLoading,
|
|
435
|
+
onPageChange: gotoPage,
|
|
436
|
+
onPageSizeChange: setPageSize,
|
|
437
|
+
totalSelectedRowsCount:
|
|
438
|
+
selectionMode === 'single' ? 0 : instance.selectedFlatRows.length, // 0 when selectionMode = 'single' since totalSelectedRowCount is for multi-selection mode only
|
|
439
|
+
}),
|
|
440
|
+
[
|
|
441
|
+
density,
|
|
442
|
+
gotoPage,
|
|
443
|
+
isLoading,
|
|
444
|
+
rows.length,
|
|
445
|
+
setPageSize,
|
|
446
|
+
state.pageIndex,
|
|
447
|
+
state.pageSize,
|
|
448
|
+
instance.selectedFlatRows,
|
|
449
|
+
selectionMode,
|
|
450
|
+
],
|
|
451
|
+
);
|
|
452
|
+
const { scrollToIndex, tableRowRef } = useScrollToRow({ ...props, page });
|
|
453
|
+
const columnRefs = React.useRef({});
|
|
454
|
+
const previousTableWidth = React.useRef(0);
|
|
455
|
+
const onTableResize = React.useCallback(
|
|
456
|
+
({ width }) => {
|
|
457
|
+
instance.tableWidth = width;
|
|
458
|
+
if (width === previousTableWidth.current) {
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
previousTableWidth.current = width;
|
|
462
|
+
// Update column widths when table was resized
|
|
463
|
+
flatHeaders.forEach((header) => {
|
|
464
|
+
if (columnRefs.current[header.id]) {
|
|
465
|
+
header.resizeWidth =
|
|
466
|
+
columnRefs.current[header.id].getBoundingClientRect().width;
|
|
274
467
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
state.pageSize,
|
|
294
|
-
instance.selectedFlatRows,
|
|
295
|
-
selectionMode,
|
|
296
|
-
]);
|
|
297
|
-
const { scrollToIndex, tableRowRef } = useScrollToRow({ ...props, page });
|
|
298
|
-
const columnRefs = React.useRef({});
|
|
299
|
-
const previousTableWidth = React.useRef(0);
|
|
300
|
-
const onTableResize = React.useCallback(({ width }) => {
|
|
301
|
-
instance.tableWidth = width;
|
|
302
|
-
if (width === previousTableWidth.current) {
|
|
303
|
-
return;
|
|
468
|
+
});
|
|
469
|
+
// If no column was resized then leave table resize handling to the flexbox
|
|
470
|
+
if (Object.keys(state.columnResizing.columnWidths).length === 0) {
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
dispatch({ type: tableResizeStartAction });
|
|
474
|
+
},
|
|
475
|
+
[dispatch, state.columnResizing.columnWidths, flatHeaders, instance],
|
|
476
|
+
);
|
|
477
|
+
const [resizeRef] = useResizeObserver(onTableResize);
|
|
478
|
+
// Flexbox handles columns resize so we take new column widths before browser repaints.
|
|
479
|
+
useIsomorphicLayoutEffect(() => {
|
|
480
|
+
if (state.isTableResizing) {
|
|
481
|
+
const newColumnWidths = {};
|
|
482
|
+
flatHeaders.forEach((column) => {
|
|
483
|
+
if (columnRefs.current[column.id]) {
|
|
484
|
+
newColumnWidths[column.id] =
|
|
485
|
+
columnRefs.current[column.id].getBoundingClientRect().width;
|
|
304
486
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
487
|
+
});
|
|
488
|
+
dispatch({ type: tableResizeEndAction, columnWidths: newColumnWidths });
|
|
489
|
+
}
|
|
490
|
+
});
|
|
491
|
+
const headerRef = React.useRef(null);
|
|
492
|
+
const bodyRef = React.useRef(null);
|
|
493
|
+
const getPreparedRow = React.useCallback(
|
|
494
|
+
(index) => {
|
|
495
|
+
const row = page[index];
|
|
496
|
+
prepareRow(row);
|
|
497
|
+
return React.createElement(TableRowMemoized, {
|
|
498
|
+
row: row,
|
|
499
|
+
rowProps: rowProps,
|
|
500
|
+
isLast: index === page.length - 1,
|
|
501
|
+
onRowInViewport: onRowInViewportRef,
|
|
502
|
+
onBottomReached: onBottomReachedRef,
|
|
503
|
+
intersectionMargin: intersectionMargin,
|
|
504
|
+
state: state,
|
|
505
|
+
key: row.getRowProps().key,
|
|
506
|
+
onClick: onRowClickHandler,
|
|
507
|
+
subComponent: subComponent,
|
|
508
|
+
isDisabled: !!isRowDisabled?.(row.original),
|
|
509
|
+
tableHasSubRows: hasAnySubRows,
|
|
510
|
+
tableInstance: instance,
|
|
511
|
+
expanderCell: expanderCell,
|
|
512
|
+
bodyRef: bodyRef.current,
|
|
513
|
+
tableRowRef: enableVirtualization ? undefined : tableRowRef(row),
|
|
514
|
+
density: density,
|
|
515
|
+
});
|
|
516
|
+
},
|
|
517
|
+
[
|
|
518
|
+
page,
|
|
519
|
+
prepareRow,
|
|
520
|
+
rowProps,
|
|
521
|
+
intersectionMargin,
|
|
522
|
+
state,
|
|
523
|
+
onRowClickHandler,
|
|
524
|
+
subComponent,
|
|
525
|
+
isRowDisabled,
|
|
526
|
+
hasAnySubRows,
|
|
527
|
+
instance,
|
|
528
|
+
expanderCell,
|
|
529
|
+
enableVirtualization,
|
|
530
|
+
tableRowRef,
|
|
531
|
+
density,
|
|
532
|
+
],
|
|
533
|
+
);
|
|
534
|
+
const virtualizedItemRenderer = React.useCallback(
|
|
535
|
+
(index) => getPreparedRow(index),
|
|
536
|
+
[getPreparedRow],
|
|
537
|
+
);
|
|
538
|
+
const updateStickyState = () => {
|
|
539
|
+
if (!bodyRef.current || flatHeaders.every((header) => !header.sticky)) {
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
if (bodyRef.current.scrollLeft !== 0) {
|
|
543
|
+
dispatch({ type: TableActions.setScrolledRight, value: true });
|
|
544
|
+
} else {
|
|
545
|
+
dispatch({ type: TableActions.setScrolledRight, value: false });
|
|
546
|
+
}
|
|
547
|
+
// If scrolled a bit to the left looking from the right side
|
|
548
|
+
if (
|
|
549
|
+
bodyRef.current.scrollLeft !==
|
|
550
|
+
bodyRef.current.scrollWidth - bodyRef.current.clientWidth
|
|
551
|
+
) {
|
|
552
|
+
dispatch({ type: TableActions.setScrolledLeft, value: true });
|
|
553
|
+
} else {
|
|
554
|
+
dispatch({ type: TableActions.setScrolledLeft, value: false });
|
|
555
|
+
}
|
|
556
|
+
};
|
|
557
|
+
React.useEffect(() => {
|
|
558
|
+
updateStickyState();
|
|
559
|
+
// Call only on init
|
|
560
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
561
|
+
}, []);
|
|
562
|
+
const isHeaderDirectClick = React.useRef(false);
|
|
563
|
+
return React.createElement(
|
|
564
|
+
React.Fragment,
|
|
565
|
+
null,
|
|
566
|
+
React.createElement(
|
|
567
|
+
Box,
|
|
568
|
+
{
|
|
569
|
+
ref: (element) => {
|
|
570
|
+
ownerDocument.current = element?.ownerDocument;
|
|
571
|
+
if (isResizable) {
|
|
572
|
+
resizeRef(element);
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
id: id,
|
|
576
|
+
...getTableProps({
|
|
577
|
+
className: cx('iui-table', className),
|
|
578
|
+
style: {
|
|
579
|
+
minWidth: 0,
|
|
580
|
+
...style,
|
|
581
|
+
},
|
|
582
|
+
}),
|
|
583
|
+
'data-iui-size': density === 'default' ? undefined : density,
|
|
584
|
+
...ariaDataAttributes,
|
|
585
|
+
},
|
|
586
|
+
headerGroups.map((headerGroup) => {
|
|
587
|
+
// There may be a better solution for this, but for now I'm filtering out the placeholder cells using header.id
|
|
588
|
+
headerGroup.headers = headerGroup.headers.filter(
|
|
589
|
+
(header) =>
|
|
590
|
+
!header.id.includes('iui-table-checkbox-selector_placeholder') &&
|
|
591
|
+
!header.id.includes('iui-table-expander_placeholder'),
|
|
592
|
+
);
|
|
593
|
+
const headerGroupProps = headerGroup.getHeaderGroupProps({
|
|
594
|
+
className: 'iui-table-row',
|
|
312
595
|
});
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
enableVirtualization,
|
|
352
|
-
tableRowRef,
|
|
353
|
-
density,
|
|
354
|
-
]);
|
|
355
|
-
const virtualizedItemRenderer = React.useCallback((index) => getPreparedRow(index), [getPreparedRow]);
|
|
356
|
-
const updateStickyState = () => {
|
|
357
|
-
if (!bodyRef.current || flatHeaders.every((header) => !header.sticky)) {
|
|
358
|
-
return;
|
|
359
|
-
}
|
|
360
|
-
if (bodyRef.current.scrollLeft !== 0) {
|
|
361
|
-
dispatch({ type: TableActions.setScrolledRight, value: true });
|
|
362
|
-
}
|
|
363
|
-
else {
|
|
364
|
-
dispatch({ type: TableActions.setScrolledRight, value: false });
|
|
365
|
-
}
|
|
366
|
-
// If scrolled a bit to the left looking from the right side
|
|
367
|
-
if (bodyRef.current.scrollLeft !==
|
|
368
|
-
bodyRef.current.scrollWidth - bodyRef.current.clientWidth) {
|
|
369
|
-
dispatch({ type: TableActions.setScrolledLeft, value: true });
|
|
370
|
-
}
|
|
371
|
-
else {
|
|
372
|
-
dispatch({ type: TableActions.setScrolledLeft, value: false });
|
|
373
|
-
}
|
|
374
|
-
};
|
|
375
|
-
React.useEffect(() => {
|
|
376
|
-
updateStickyState();
|
|
377
|
-
// Call only on init
|
|
378
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
379
|
-
}, []);
|
|
380
|
-
const isHeaderDirectClick = React.useRef(false);
|
|
381
|
-
return (React.createElement(React.Fragment, null,
|
|
382
|
-
React.createElement(Box, { ref: (element) => {
|
|
383
|
-
ownerDocument.current = element?.ownerDocument;
|
|
384
|
-
if (isResizable) {
|
|
385
|
-
resizeRef(element);
|
|
386
|
-
}
|
|
387
|
-
}, id: id, ...getTableProps({
|
|
388
|
-
className: cx('iui-table', className),
|
|
389
|
-
style: {
|
|
390
|
-
minWidth: 0,
|
|
391
|
-
...style,
|
|
392
|
-
},
|
|
393
|
-
}), "data-iui-size": density === 'default' ? undefined : density, ...ariaDataAttributes },
|
|
394
|
-
headerGroups.map((headerGroup) => {
|
|
395
|
-
// There may be a better solution for this, but for now I'm filtering out the placeholder cells using header.id
|
|
396
|
-
headerGroup.headers = headerGroup.headers.filter((header) => !header.id.includes('iui-table-checkbox-selector_placeholder') &&
|
|
397
|
-
!header.id.includes('iui-table-expander_placeholder'));
|
|
398
|
-
const headerGroupProps = headerGroup.getHeaderGroupProps({
|
|
399
|
-
className: 'iui-table-row',
|
|
596
|
+
return React.createElement(
|
|
597
|
+
Box,
|
|
598
|
+
{
|
|
599
|
+
className: 'iui-table-header-wrapper',
|
|
600
|
+
ref: headerRef,
|
|
601
|
+
onScroll: () => {
|
|
602
|
+
if (headerRef.current && bodyRef.current) {
|
|
603
|
+
bodyRef.current.scrollLeft = headerRef.current.scrollLeft;
|
|
604
|
+
updateStickyState();
|
|
605
|
+
}
|
|
606
|
+
},
|
|
607
|
+
key: headerGroupProps.key,
|
|
608
|
+
},
|
|
609
|
+
React.createElement(
|
|
610
|
+
Box,
|
|
611
|
+
{ className: 'iui-table-header' },
|
|
612
|
+
React.createElement(
|
|
613
|
+
Box,
|
|
614
|
+
{ ...headerGroupProps },
|
|
615
|
+
headerGroup.headers.map((column, index) => {
|
|
616
|
+
const { onClick, ...restSortProps } =
|
|
617
|
+
column.getSortByToggleProps();
|
|
618
|
+
const columnProps = column.getHeaderProps({
|
|
619
|
+
...restSortProps,
|
|
620
|
+
className: cx(
|
|
621
|
+
'iui-table-cell',
|
|
622
|
+
{
|
|
623
|
+
'iui-actionable': column.canSort,
|
|
624
|
+
'iui-sorted': column.isSorted,
|
|
625
|
+
'iui-table-cell-sticky': !!column.sticky,
|
|
626
|
+
},
|
|
627
|
+
column.columnClassName,
|
|
628
|
+
),
|
|
629
|
+
style: {
|
|
630
|
+
...getCellStyle(column, !!state.isTableResizing),
|
|
631
|
+
...getStickyStyle(column, visibleColumns),
|
|
632
|
+
flexWrap: 'unset',
|
|
633
|
+
},
|
|
400
634
|
});
|
|
401
|
-
return
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
635
|
+
return React.createElement(
|
|
636
|
+
Box,
|
|
637
|
+
{
|
|
638
|
+
...columnProps,
|
|
639
|
+
...column.getDragAndDropProps(),
|
|
640
|
+
key: columnProps.key,
|
|
641
|
+
title: undefined,
|
|
642
|
+
ref: (el) => {
|
|
643
|
+
if (el) {
|
|
644
|
+
columnRefs.current[column.id] = el;
|
|
645
|
+
column.resizeWidth = el.getBoundingClientRect().width;
|
|
646
|
+
}
|
|
647
|
+
},
|
|
648
|
+
onMouseDown: () => {
|
|
649
|
+
isHeaderDirectClick.current = true;
|
|
650
|
+
},
|
|
651
|
+
onClick: (e) => {
|
|
652
|
+
// Prevents from triggering sort when resizing and mouse is released in the middle of header
|
|
653
|
+
if (isHeaderDirectClick.current) {
|
|
654
|
+
onClick?.(e);
|
|
655
|
+
isHeaderDirectClick.current = false;
|
|
656
|
+
}
|
|
657
|
+
},
|
|
658
|
+
tabIndex: showSortButton(column) ? 0 : undefined,
|
|
659
|
+
onKeyDown: (e) => {
|
|
660
|
+
if (e.key == 'Enter' && showSortButton(column)) {
|
|
661
|
+
column.toggleSortBy();
|
|
662
|
+
}
|
|
663
|
+
},
|
|
664
|
+
},
|
|
665
|
+
column.render('Header'),
|
|
666
|
+
(showFilterButton(column) || showSortButton(column)) &&
|
|
667
|
+
React.createElement(
|
|
668
|
+
Box,
|
|
669
|
+
{ className: 'iui-table-header-actions-container' },
|
|
670
|
+
showFilterButton(column) &&
|
|
671
|
+
React.createElement(FilterToggle, { column: column }),
|
|
672
|
+
showSortButton(column) &&
|
|
673
|
+
React.createElement(
|
|
674
|
+
Box,
|
|
675
|
+
{ className: 'iui-table-cell-end-icon' },
|
|
676
|
+
column.isSortedDesc ||
|
|
677
|
+
(!column.isSorted && column.sortDescFirst)
|
|
678
|
+
? React.createElement(SvgSortDown, {
|
|
679
|
+
className: 'iui-table-sort',
|
|
680
|
+
'aria-hidden': true,
|
|
681
|
+
})
|
|
682
|
+
: React.createElement(SvgSortUp, {
|
|
683
|
+
className: 'iui-table-sort',
|
|
684
|
+
'aria-hidden': true,
|
|
685
|
+
}),
|
|
686
|
+
),
|
|
687
|
+
),
|
|
688
|
+
isResizable &&
|
|
689
|
+
column.isResizerVisible &&
|
|
690
|
+
(index !== headerGroup.headers.length - 1 ||
|
|
691
|
+
columnResizeMode === 'expand') &&
|
|
692
|
+
React.createElement(
|
|
693
|
+
Box,
|
|
694
|
+
{
|
|
695
|
+
...column.getResizerProps(),
|
|
696
|
+
className: 'iui-table-resizer',
|
|
697
|
+
},
|
|
698
|
+
React.createElement(Box, {
|
|
699
|
+
className: 'iui-table-resizer-bar',
|
|
700
|
+
}),
|
|
701
|
+
),
|
|
702
|
+
enableColumnReordering &&
|
|
703
|
+
!column.disableReordering &&
|
|
704
|
+
React.createElement(Box, {
|
|
705
|
+
className: 'iui-table-reorder-bar',
|
|
464
706
|
}),
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
707
|
+
column.sticky === 'left' &&
|
|
708
|
+
state.sticky.isScrolledToRight &&
|
|
709
|
+
React.createElement(Box, {
|
|
710
|
+
className: 'iui-table-cell-shadow-right',
|
|
711
|
+
}),
|
|
712
|
+
column.sticky === 'right' &&
|
|
713
|
+
state.sticky.isScrolledToLeft &&
|
|
714
|
+
React.createElement(Box, {
|
|
715
|
+
className: 'iui-table-cell-shadow-left',
|
|
716
|
+
}),
|
|
717
|
+
);
|
|
718
|
+
}),
|
|
719
|
+
),
|
|
720
|
+
),
|
|
721
|
+
);
|
|
722
|
+
}),
|
|
723
|
+
React.createElement(
|
|
724
|
+
Box,
|
|
725
|
+
{
|
|
726
|
+
...getTableBodyProps({
|
|
727
|
+
className: cx('iui-table-body', {
|
|
728
|
+
'iui-zebra-striping': styleType === 'zebra-rows',
|
|
729
|
+
}),
|
|
730
|
+
style: { outline: 0 },
|
|
731
|
+
}),
|
|
732
|
+
ref: bodyRef,
|
|
733
|
+
onScroll: () => {
|
|
734
|
+
if (headerRef.current && bodyRef.current) {
|
|
735
|
+
headerRef.current.scrollLeft = bodyRef.current.scrollLeft;
|
|
736
|
+
updateStickyState();
|
|
737
|
+
}
|
|
738
|
+
},
|
|
739
|
+
tabIndex: -1,
|
|
740
|
+
'aria-multiselectable':
|
|
741
|
+
(isSelectable && selectionMode === 'multi') || undefined,
|
|
742
|
+
},
|
|
743
|
+
data.length !== 0 &&
|
|
744
|
+
React.createElement(
|
|
745
|
+
React.Fragment,
|
|
746
|
+
null,
|
|
747
|
+
enableVirtualization
|
|
748
|
+
? React.createElement(VirtualScroll, {
|
|
749
|
+
itemsLength: page.length,
|
|
750
|
+
itemRenderer: virtualizedItemRenderer,
|
|
751
|
+
scrollToIndex: scrollToIndex,
|
|
752
|
+
})
|
|
753
|
+
: page.map((_, index) => getPreparedRow(index)),
|
|
754
|
+
),
|
|
755
|
+
isLoading &&
|
|
756
|
+
data.length === 0 &&
|
|
757
|
+
React.createElement(
|
|
758
|
+
Box,
|
|
759
|
+
{ className: 'iui-table-empty' },
|
|
760
|
+
React.createElement(ProgressRadial, { indeterminate: true }),
|
|
761
|
+
),
|
|
762
|
+
isLoading &&
|
|
763
|
+
data.length !== 0 &&
|
|
764
|
+
React.createElement(
|
|
765
|
+
Box,
|
|
766
|
+
{ className: 'iui-table-row' },
|
|
767
|
+
React.createElement(
|
|
768
|
+
Box,
|
|
769
|
+
{
|
|
770
|
+
className: 'iui-table-cell',
|
|
771
|
+
style: { justifyContent: 'center' },
|
|
772
|
+
},
|
|
773
|
+
React.createElement(ProgressRadial, {
|
|
774
|
+
indeterminate: true,
|
|
775
|
+
size: 'small',
|
|
776
|
+
style: { float: 'none', marginLeft: 0 },
|
|
777
|
+
}),
|
|
778
|
+
),
|
|
779
|
+
),
|
|
780
|
+
!isLoading &&
|
|
781
|
+
data.length === 0 &&
|
|
782
|
+
!areFiltersSet &&
|
|
783
|
+
React.createElement(
|
|
784
|
+
Box,
|
|
785
|
+
{ className: 'iui-table-empty' },
|
|
786
|
+
React.createElement('div', null, emptyTableContent),
|
|
787
|
+
),
|
|
788
|
+
!isLoading &&
|
|
789
|
+
(data.length === 0 || rows.length === 0) &&
|
|
790
|
+
areFiltersSet &&
|
|
791
|
+
React.createElement(
|
|
792
|
+
Box,
|
|
793
|
+
{ className: 'iui-table-empty' },
|
|
794
|
+
React.createElement('div', null, emptyFilteredTableContent),
|
|
795
|
+
),
|
|
796
|
+
),
|
|
797
|
+
paginatorRenderer?.(paginatorRendererProps),
|
|
798
|
+
),
|
|
799
|
+
);
|
|
485
800
|
};
|
|
486
801
|
export default Table;
|