@itwin/itwinui-react 2.0.0-dev.2 → 2.0.0-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -1
- package/cjs/core/Alert/Alert.js +8 -30
- package/cjs/core/Avatar/Avatar.js +10 -33
- package/cjs/core/AvatarGroup/AvatarGroup.js +18 -43
- package/cjs/core/Backdrop/Backdrop.js +6 -28
- package/cjs/core/Badge/Badge.js +13 -31
- package/cjs/core/Breadcrumbs/Breadcrumbs.js +14 -40
- package/cjs/core/ButtonGroup/ButtonGroup.js +10 -32
- package/cjs/core/Buttons/Button/Button.js +6 -28
- package/cjs/core/Buttons/DropdownButton/DropdownButton.js +14 -36
- package/cjs/core/Buttons/IconButton/IconButton.js +6 -28
- package/cjs/core/Buttons/IdeasButton/IdeasButton.js +6 -28
- package/cjs/core/Buttons/SplitButton/SplitButton.js +14 -36
- package/cjs/core/Carousel/Carousel.js +38 -63
- package/cjs/core/Carousel/CarouselContext.js +1 -1
- package/cjs/core/Carousel/CarouselDot.js +6 -28
- package/cjs/core/Carousel/CarouselDotsList.js +33 -60
- package/cjs/core/Carousel/CarouselNavigation.js +22 -44
- package/cjs/core/Carousel/CarouselSlide.js +12 -34
- package/cjs/core/Carousel/CarouselSlider.js +26 -51
- package/cjs/core/Checkbox/Checkbox.js +18 -42
- package/cjs/core/ColorPicker/ColorBuilder.js +51 -73
- package/cjs/core/ColorPicker/ColorInputPanel.js +64 -88
- package/cjs/core/ColorPicker/ColorPalette.js +26 -50
- package/cjs/core/ColorPicker/ColorPicker.js +25 -49
- package/cjs/core/ColorPicker/ColorPickerContext.js +3 -3
- package/cjs/core/ColorPicker/ColorSwatch.js +13 -34
- package/cjs/core/ComboBox/ComboBox.js +67 -93
- package/cjs/core/ComboBox/ComboBoxDropdown.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxDropdown.js +13 -36
- package/cjs/core/ComboBox/ComboBoxEndIcon.js +12 -34
- package/cjs/core/ComboBox/ComboBoxInput.js +28 -50
- package/cjs/core/ComboBox/ComboBoxInputContainer.js +9 -31
- package/cjs/core/ComboBox/ComboBoxMenu.js +35 -60
- package/cjs/core/ComboBox/ComboBoxMenuItem.js +11 -33
- package/cjs/core/ComboBox/helpers.js +11 -19
- package/cjs/core/DatePicker/DatePicker.js +87 -111
- package/cjs/core/Dialog/Dialog.js +28 -48
- package/cjs/core/Dialog/DialogBackdrop.js +16 -35
- package/cjs/core/Dialog/DialogButtonBar.js +6 -28
- package/cjs/core/Dialog/DialogContent.js +6 -28
- package/cjs/core/Dialog/DialogContext.js +2 -2
- package/cjs/core/Dialog/DialogDragContext.js +6 -15
- package/cjs/core/Dialog/DialogMain.js +52 -59
- package/cjs/core/Dialog/DialogTitleBar.js +14 -36
- package/cjs/core/Dialog/DialogTitleBarTitle.js +6 -28
- package/cjs/core/DropdownMenu/DropdownMenu.js +14 -36
- package/cjs/core/ExpandableBlock/ExpandableBlock.js +12 -34
- package/cjs/core/Fieldset/Fieldset.js +9 -33
- package/cjs/core/FileUpload/FileUpload.js +13 -35
- package/cjs/core/FileUpload/FileUploadTemplate.js +4 -4
- package/cjs/core/Footer/Footer.js +21 -49
- package/cjs/core/Footer/FooterItem.js +6 -28
- package/cjs/core/Footer/FooterList.js +6 -28
- package/cjs/core/Footer/FooterSeparator.js +6 -28
- package/cjs/core/Header/Header.js +10 -32
- package/cjs/core/Header/HeaderBasicButton.js +6 -28
- package/cjs/core/Header/HeaderBreadcrumbs.js +9 -39
- package/cjs/core/Header/HeaderButton.js +22 -36
- package/cjs/core/Header/HeaderDropdownButton.js +14 -36
- package/cjs/core/Header/HeaderLogo.js +7 -29
- package/cjs/core/Header/HeaderSplitButton.js +13 -35
- package/cjs/core/InformationPanel/InformationPanel.js +15 -37
- package/cjs/core/InformationPanel/InformationPanelBody.js +6 -28
- package/cjs/core/InformationPanel/InformationPanelContent.js +6 -28
- package/cjs/core/InformationPanel/InformationPanelHeader.js +7 -29
- package/cjs/core/InformationPanel/InformationPanelWrapper.js +6 -28
- package/cjs/core/Input/Input.js +9 -31
- package/cjs/core/InputGroup/InputGroup.js +6 -28
- package/cjs/core/Label/Label.js +7 -29
- package/cjs/core/LabeledInput/LabeledInput.js +7 -29
- package/cjs/core/LabeledSelect/LabeledSelect.js +7 -29
- package/cjs/core/LabeledTextarea/LabeledTextarea.js +7 -29
- package/cjs/core/Menu/Menu.js +18 -40
- package/cjs/core/Menu/MenuDivider.js +6 -28
- package/cjs/core/Menu/MenuExtraContent.js +6 -28
- package/cjs/core/Menu/MenuItem.js +17 -39
- package/cjs/core/Menu/MenuItemSkeleton.js +11 -30
- package/cjs/core/Modal/Modal.js +12 -30
- package/cjs/core/Modal/ModalButtonBar.js +1 -1
- package/cjs/core/Modal/ModalContent.js +1 -1
- package/cjs/core/{ErrorPage → NonIdealState}/ErrorPage.d.ts +5 -1
- package/cjs/core/NonIdealState/ErrorPage.js +144 -0
- package/cjs/core/NonIdealState/NonIdealState.d.ts +46 -0
- package/cjs/core/NonIdealState/NonIdealState.js +32 -0
- package/{esm/core/ErrorPage → cjs/core/NonIdealState}/index.d.ts +3 -1
- package/cjs/core/{ErrorPage → NonIdealState}/index.js +4 -2
- package/cjs/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +11 -34
- package/cjs/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +13 -37
- package/cjs/core/Radio/Radio.js +10 -33
- package/cjs/core/RadioTiles/RadioTile.js +9 -31
- package/cjs/core/RadioTiles/RadioTileGroup.js +6 -28
- package/cjs/core/Select/Select.js +59 -72
- package/cjs/core/Select/SelectTag.js +6 -28
- package/cjs/core/SideNavigation/SideNavigation.js +14 -40
- package/cjs/core/SideNavigation/SidenavButton.js +8 -30
- package/cjs/core/SideNavigation/SidenavSubmenu.js +6 -28
- package/cjs/core/SideNavigation/SidenavSubmenuHeader.js +6 -28
- package/cjs/core/SkipToContentLink/SkipToContentLink.js +6 -28
- package/cjs/core/Slider/Slider.js +68 -96
- package/cjs/core/Slider/Thumb.js +20 -39
- package/cjs/core/Slider/Track.js +24 -44
- package/cjs/core/StatusMessage/StatusMessage.js +6 -7
- package/cjs/core/Stepper/Stepper.js +10 -34
- package/cjs/core/Stepper/StepperStep.js +15 -34
- package/cjs/core/Stepper/Wizard.js +6 -28
- package/cjs/core/Stepper/WorkflowDiagram.js +6 -28
- package/cjs/core/Stepper/WorkflowDiagramStep.js +6 -28
- package/cjs/core/Surface/Surface.js +11 -30
- package/cjs/core/Table/SubRowExpander.js +6 -6
- package/cjs/core/Table/Table.d.ts +19 -24
- package/cjs/core/Table/Table.js +189 -195
- package/cjs/core/Table/TableCell.js +29 -30
- package/cjs/core/Table/TablePaginator.js +52 -83
- package/cjs/core/Table/TableRowMemoized.d.ts +6 -10
- package/cjs/core/Table/TableRowMemoized.js +36 -60
- package/cjs/core/Table/actionHandlers/expandHandler.js +3 -3
- package/cjs/core/Table/actionHandlers/filterHandler.js +4 -4
- package/cjs/core/Table/actionHandlers/resizeHandler.js +13 -15
- package/cjs/core/Table/actionHandlers/selectHandler.js +35 -40
- package/cjs/core/Table/cells/DefaultCell.js +5 -27
- package/cjs/core/Table/cells/EditableCell.js +16 -40
- package/cjs/core/Table/columns/actionColumn.js +44 -62
- package/cjs/core/Table/columns/expanderColumn.d.ts +2 -5
- package/cjs/core/Table/columns/expanderColumn.js +12 -27
- package/cjs/core/Table/columns/selectionColumn.d.ts +2 -5
- package/cjs/core/Table/columns/selectionColumn.js +16 -37
- package/cjs/core/Table/filters/BaseFilter.js +6 -6
- package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +19 -41
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +20 -31
- package/cjs/core/Table/filters/FilterButtonBar.js +8 -19
- package/cjs/core/Table/filters/FilterToggle.js +15 -37
- package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +16 -29
- package/cjs/core/Table/filters/TextFilter/TextFilter.js +11 -11
- package/cjs/core/Table/filters/customFilterFunctions.js +11 -13
- package/cjs/core/Table/filters/defaultFilterFunctions.js +62 -64
- package/cjs/core/Table/filters/tableFilters.js +7 -18
- package/cjs/core/Table/hooks/useColumnDragAndDrop.js +41 -53
- package/cjs/core/Table/hooks/useExpanderCell.js +17 -33
- package/cjs/core/Table/hooks/useResizeColumns.js +197 -205
- package/cjs/core/Table/hooks/useScrollToRow.js +11 -12
- package/cjs/core/Table/hooks/useSelectionCell.js +7 -18
- package/cjs/core/Table/hooks/useStickyColumns.js +28 -33
- package/cjs/core/Table/hooks/useSubRowFiltering.js +37 -57
- package/cjs/core/Table/hooks/useSubRowSelection.js +10 -12
- package/cjs/core/Table/utils.js +15 -26
- package/cjs/core/Tabs/Tab.js +6 -28
- package/cjs/core/Tabs/Tabs.js +45 -67
- package/cjs/core/Tag/Tag.js +8 -30
- package/cjs/core/Tag/TagContainer.js +9 -32
- package/cjs/core/Textarea/Textarea.js +9 -31
- package/cjs/core/ThemeProvider/ThemeProvider.d.ts +1 -0
- package/cjs/core/ThemeProvider/ThemeProvider.js +16 -37
- package/cjs/core/Tile/Tile.js +29 -58
- package/cjs/core/TimePicker/TimePicker.js +59 -97
- package/cjs/core/Toast/Toast.js +45 -65
- package/cjs/core/Toast/ToastWrapper.js +13 -24
- package/cjs/core/Toast/Toaster.js +87 -137
- package/cjs/core/Toast/index.js +2 -2
- package/cjs/core/ToggleSwitch/ToggleSwitch.js +10 -32
- package/cjs/core/Tooltip/Tooltip.js +6 -28
- package/cjs/core/Tree/Tree.js +58 -80
- package/cjs/core/Tree/TreeContext.js +3 -3
- package/cjs/core/Tree/TreeNode.js +21 -43
- package/cjs/core/Tree/TreeNodeExpander.js +7 -29
- package/cjs/core/Typography/Anchor/Anchor.js +5 -28
- package/cjs/core/Typography/Blockquote/Blockquote.js +6 -28
- package/cjs/core/Typography/Body/Body.js +7 -29
- package/cjs/core/Typography/Code/Code.js +6 -28
- package/cjs/core/Typography/Headline/Headline.js +6 -28
- package/cjs/core/Typography/Kbd/Kbd.js +6 -28
- package/cjs/core/Typography/Leading/Leading.js +6 -28
- package/cjs/core/Typography/Small/Small.js +6 -28
- package/cjs/core/Typography/Subheading/Subheading.js +6 -28
- package/cjs/core/Typography/Text/Text.js +11 -34
- package/cjs/core/Typography/Title/Title.js +6 -28
- package/cjs/core/index.d.ts +2 -2
- package/cjs/core/index.js +6 -5
- package/cjs/core/utils/color/ColorValue.js +146 -156
- package/cjs/core/utils/components/FocusTrap.js +14 -14
- package/cjs/core/utils/components/InputContainer.js +12 -36
- package/cjs/core/utils/components/MiddleTextTruncation.js +15 -31
- package/cjs/core/utils/components/Popover.d.ts +1 -1
- package/cjs/core/utils/components/Popover.js +57 -60
- package/cjs/core/utils/components/Resizer.js +51 -51
- package/cjs/core/utils/components/VirtualScroll.js +72 -89
- package/cjs/core/utils/components/VisuallyHidden.js +6 -28
- package/cjs/core/utils/components/WithCSSTransition.d.ts +2 -2
- package/cjs/core/utils/components/WithCSSTransition.js +18 -40
- package/cjs/core/utils/functions/colors.js +7 -7
- package/cjs/core/utils/functions/dom.js +7 -8
- package/cjs/core/utils/functions/focusable.js +11 -15
- package/cjs/core/utils/functions/numbers.js +5 -6
- package/cjs/core/utils/functions/styles.js +3 -3
- package/cjs/core/utils/hooks/useContainerWidth.js +9 -13
- package/cjs/core/utils/hooks/useDragAndDrop.js +32 -33
- package/cjs/core/utils/hooks/useEventListener.js +7 -7
- package/cjs/core/utils/hooks/useIntersection.js +9 -12
- package/cjs/core/utils/hooks/useIsomorphicLayoutEffect.js +1 -1
- package/cjs/core/utils/hooks/useLatestRef.js +4 -4
- package/cjs/core/utils/hooks/useMediaQuery.js +9 -12
- package/cjs/core/utils/hooks/useMergedRefs.js +6 -23
- package/cjs/core/utils/hooks/useOverflow.js +26 -33
- package/cjs/core/utils/hooks/useResizeObserver.js +6 -9
- package/cjs/core/utils/hooks/useSafeContext.js +4 -4
- package/cjs/core/utils/hooks/useTheme.js +18 -20
- package/cjs/core/utils/icons/StatusIconMap.js +9 -20
- package/cjs/core/utils/icons/SvgCalendar.js +3 -14
- package/cjs/core/utils/icons/SvgCaretDownSmall.js +3 -14
- package/cjs/core/utils/icons/SvgCaretRightSmall.js +3 -14
- package/cjs/core/utils/icons/SvgCaretUpSmall.js +3 -14
- package/cjs/core/utils/icons/SvgCheckmark.js +3 -14
- package/cjs/core/utils/icons/SvgCheckmarkSmall.js +3 -14
- package/cjs/core/utils/icons/SvgChevronLeft.js +3 -14
- package/cjs/core/utils/icons/SvgChevronLeftDouble.js +3 -14
- package/cjs/core/utils/icons/SvgChevronRight.js +3 -14
- package/cjs/core/utils/icons/SvgChevronRightDouble.js +3 -14
- package/cjs/core/utils/icons/SvgClose.js +3 -14
- package/cjs/core/utils/icons/SvgCloseSmall.js +3 -14
- package/cjs/core/utils/icons/SvgColumnManager.js +3 -14
- package/cjs/core/utils/icons/SvgFilter.js +3 -14
- package/cjs/core/utils/icons/SvgFilterHollow.js +3 -14
- package/cjs/core/utils/icons/SvgImportantSmall.js +3 -14
- package/cjs/core/utils/icons/SvgInfoCircular.js +3 -14
- package/cjs/core/utils/icons/SvgMore.js +3 -14
- package/cjs/core/utils/icons/SvgMoreVertical.js +3 -14
- package/cjs/core/utils/icons/SvgNew.js +3 -14
- package/cjs/core/utils/icons/SvgSmileyHappy.js +3 -14
- package/cjs/core/utils/icons/SvgSortDown.js +3 -14
- package/cjs/core/utils/icons/SvgSortUp.js +3 -14
- package/cjs/core/utils/icons/SvgStatusError.js +3 -14
- package/cjs/core/utils/icons/SvgStatusSuccess.js +3 -14
- package/cjs/core/utils/icons/SvgStatusWarning.js +3 -14
- package/cjs/core/utils/icons/SvgSwap.js +3 -14
- package/cjs/core/utils/icons/SvgUpload.js +3 -14
- package/cjs/types/react-table-config.d.ts +6 -2
- package/esm/core/Alert/Alert.js +5 -27
- package/esm/core/Avatar/Avatar.js +9 -32
- package/esm/core/AvatarGroup/AvatarGroup.js +16 -41
- package/esm/core/Backdrop/Backdrop.js +3 -25
- package/esm/core/Badge/Badge.js +10 -28
- package/esm/core/Breadcrumbs/Breadcrumbs.js +11 -37
- package/esm/core/ButtonGroup/ButtonGroup.js +7 -29
- package/esm/core/Buttons/Button/Button.js +3 -25
- package/esm/core/Buttons/DropdownButton/DropdownButton.js +9 -31
- package/esm/core/Buttons/IconButton/IconButton.js +3 -25
- package/esm/core/Buttons/IdeasButton/IdeasButton.js +3 -25
- package/esm/core/Buttons/SplitButton/SplitButton.js +8 -30
- package/esm/core/Carousel/Carousel.js +29 -54
- package/esm/core/Carousel/CarouselContext.js +1 -1
- package/esm/core/Carousel/CarouselDot.js +4 -26
- package/esm/core/Carousel/CarouselDotsList.js +28 -55
- package/esm/core/Carousel/CarouselNavigation.js +16 -38
- package/esm/core/Carousel/CarouselSlide.js +8 -30
- package/esm/core/Carousel/CarouselSlider.js +22 -47
- package/esm/core/Checkbox/Checkbox.js +14 -38
- package/esm/core/ColorPicker/ColorBuilder.js +46 -68
- package/esm/core/ColorPicker/ColorInputPanel.js +58 -82
- package/esm/core/ColorPicker/ColorPalette.js +20 -44
- package/esm/core/ColorPicker/ColorPicker.js +21 -45
- package/esm/core/ColorPicker/ColorPickerContext.js +3 -3
- package/esm/core/ColorPicker/ColorSwatch.js +9 -30
- package/esm/core/ComboBox/ComboBox.js +55 -81
- package/esm/core/ComboBox/ComboBoxDropdown.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxDropdown.js +10 -33
- package/esm/core/ComboBox/ComboBoxEndIcon.js +8 -30
- package/esm/core/ComboBox/ComboBoxInput.js +24 -46
- package/esm/core/ComboBox/ComboBoxInputContainer.js +5 -27
- package/esm/core/ComboBox/ComboBoxMenu.js +29 -54
- package/esm/core/ComboBox/ComboBoxMenuItem.js +7 -29
- package/esm/core/ComboBox/helpers.js +13 -21
- package/esm/core/DatePicker/DatePicker.js +82 -106
- package/esm/core/Dialog/Dialog.js +19 -39
- package/esm/core/Dialog/DialogBackdrop.js +11 -30
- package/esm/core/Dialog/DialogButtonBar.js +3 -25
- package/esm/core/Dialog/DialogContent.js +3 -25
- package/esm/core/Dialog/DialogContext.js +2 -2
- package/esm/core/Dialog/DialogDragContext.js +6 -15
- package/esm/core/Dialog/DialogMain.js +45 -52
- package/esm/core/Dialog/DialogTitleBar.js +7 -29
- package/esm/core/Dialog/DialogTitleBarTitle.js +3 -25
- package/esm/core/DropdownMenu/DropdownMenu.js +11 -33
- package/esm/core/ExpandableBlock/ExpandableBlock.js +9 -31
- package/esm/core/Fieldset/Fieldset.js +6 -30
- package/esm/core/FileUpload/FileUpload.js +10 -32
- package/esm/core/FileUpload/FileUploadTemplate.js +2 -2
- package/esm/core/Footer/Footer.js +16 -44
- package/esm/core/Footer/FooterItem.js +3 -25
- package/esm/core/Footer/FooterList.js +3 -25
- package/esm/core/Footer/FooterSeparator.js +3 -25
- package/esm/core/Header/Header.js +5 -27
- package/esm/core/Header/HeaderBasicButton.js +3 -25
- package/esm/core/Header/HeaderBreadcrumbs.js +7 -37
- package/esm/core/Header/HeaderButton.js +16 -30
- package/esm/core/Header/HeaderDropdownButton.js +9 -31
- package/esm/core/Header/HeaderLogo.js +4 -26
- package/esm/core/Header/HeaderSplitButton.js +8 -30
- package/esm/core/InformationPanel/InformationPanel.js +12 -34
- package/esm/core/InformationPanel/InformationPanelBody.js +3 -25
- package/esm/core/InformationPanel/InformationPanelContent.js +3 -25
- package/esm/core/InformationPanel/InformationPanelHeader.js +3 -25
- package/esm/core/InformationPanel/InformationPanelWrapper.js +3 -25
- package/esm/core/Input/Input.js +6 -28
- package/esm/core/InputGroup/InputGroup.js +4 -26
- package/esm/core/Label/Label.js +4 -26
- package/esm/core/LabeledInput/LabeledInput.js +4 -26
- package/esm/core/LabeledSelect/LabeledSelect.js +4 -26
- package/esm/core/LabeledTextarea/LabeledTextarea.js +4 -26
- package/esm/core/Menu/Menu.js +15 -37
- package/esm/core/Menu/MenuDivider.js +3 -25
- package/esm/core/Menu/MenuExtraContent.js +3 -25
- package/esm/core/Menu/MenuItem.js +13 -35
- package/esm/core/Menu/MenuItemSkeleton.js +8 -27
- package/esm/core/Modal/Modal.js +8 -26
- package/esm/core/Modal/ModalButtonBar.js +1 -1
- package/esm/core/Modal/ModalContent.js +1 -1
- package/esm/core/{ErrorPage → NonIdealState}/ErrorPage.d.ts +5 -1
- package/esm/core/NonIdealState/ErrorPage.js +137 -0
- package/esm/core/NonIdealState/NonIdealState.d.ts +46 -0
- package/esm/core/NonIdealState/NonIdealState.js +25 -0
- package/{cjs/core/ErrorPage → esm/core/NonIdealState}/index.d.ts +3 -1
- package/esm/core/{ErrorPage → NonIdealState}/index.js +2 -1
- package/esm/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +8 -31
- package/esm/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +10 -34
- package/esm/core/Radio/Radio.js +7 -30
- package/esm/core/RadioTiles/RadioTile.js +6 -28
- package/esm/core/RadioTiles/RadioTileGroup.js +3 -25
- package/esm/core/Select/Select.js +53 -66
- package/esm/core/Select/SelectTag.js +3 -25
- package/esm/core/SideNavigation/SideNavigation.js +9 -35
- package/esm/core/SideNavigation/SidenavButton.js +4 -26
- package/esm/core/SideNavigation/SidenavSubmenu.js +3 -25
- package/esm/core/SideNavigation/SidenavSubmenuHeader.js +3 -25
- package/esm/core/SkipToContentLink/SkipToContentLink.js +3 -25
- package/esm/core/Slider/Slider.js +63 -91
- package/esm/core/Slider/Thumb.js +17 -36
- package/esm/core/Slider/Track.js +23 -43
- package/esm/core/StatusMessage/StatusMessage.js +3 -4
- package/esm/core/Stepper/Stepper.js +7 -31
- package/esm/core/Stepper/StepperStep.js +12 -31
- package/esm/core/Stepper/Wizard.js +3 -25
- package/esm/core/Stepper/WorkflowDiagram.js +3 -25
- package/esm/core/Stepper/WorkflowDiagramStep.js +3 -25
- package/esm/core/Surface/Surface.js +8 -27
- package/esm/core/Table/SubRowExpander.js +3 -3
- package/esm/core/Table/Table.d.ts +19 -24
- package/esm/core/Table/Table.js +177 -183
- package/esm/core/Table/TableCell.js +23 -24
- package/esm/core/Table/TablePaginator.js +46 -77
- package/esm/core/Table/TableRowMemoized.d.ts +6 -10
- package/esm/core/Table/TableRowMemoized.js +32 -56
- package/esm/core/Table/actionHandlers/expandHandler.js +3 -3
- package/esm/core/Table/actionHandlers/filterHandler.js +4 -4
- package/esm/core/Table/actionHandlers/resizeHandler.js +13 -15
- package/esm/core/Table/actionHandlers/selectHandler.js +35 -40
- package/esm/core/Table/cells/DefaultCell.js +3 -25
- package/esm/core/Table/cells/EditableCell.js +14 -38
- package/esm/core/Table/columns/actionColumn.js +34 -52
- package/esm/core/Table/columns/expanderColumn.d.ts +2 -5
- package/esm/core/Table/columns/expanderColumn.js +9 -24
- package/esm/core/Table/columns/selectionColumn.d.ts +2 -5
- package/esm/core/Table/columns/selectionColumn.js +14 -35
- package/esm/core/Table/filters/BaseFilter.js +3 -3
- package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +14 -36
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +15 -26
- package/esm/core/Table/filters/FilterButtonBar.js +4 -15
- package/esm/core/Table/filters/FilterToggle.js +11 -33
- package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +11 -24
- package/esm/core/Table/filters/TextFilter/TextFilter.js +6 -6
- package/esm/core/Table/filters/customFilterFunctions.js +12 -14
- package/esm/core/Table/filters/defaultFilterFunctions.js +63 -65
- package/esm/core/Table/filters/tableFilters.js +4 -15
- package/esm/core/Table/hooks/useColumnDragAndDrop.js +40 -52
- package/esm/core/Table/hooks/useExpanderCell.js +15 -31
- package/esm/core/Table/hooks/useResizeColumns.js +196 -204
- package/esm/core/Table/hooks/useScrollToRow.js +10 -11
- package/esm/core/Table/hooks/useSelectionCell.js +6 -17
- package/esm/core/Table/hooks/useStickyColumns.js +27 -32
- package/esm/core/Table/hooks/useSubRowFiltering.js +35 -55
- package/esm/core/Table/hooks/useSubRowSelection.js +9 -11
- package/esm/core/Table/utils.js +15 -26
- package/esm/core/Tabs/Tab.js +3 -25
- package/esm/core/Tabs/Tabs.js +41 -63
- package/esm/core/Tag/Tag.js +4 -26
- package/esm/core/Tag/TagContainer.js +6 -29
- package/esm/core/Textarea/Textarea.js +6 -28
- package/esm/core/ThemeProvider/ThemeProvider.d.ts +1 -0
- package/esm/core/ThemeProvider/ThemeProvider.js +15 -36
- package/esm/core/Tile/Tile.js +23 -52
- package/esm/core/TimePicker/TimePicker.js +56 -94
- package/esm/core/Toast/Toast.js +41 -61
- package/esm/core/Toast/ToastWrapper.js +10 -21
- package/esm/core/Toast/Toaster.js +83 -134
- package/esm/core/Toast/index.js +1 -1
- package/esm/core/ToggleSwitch/ToggleSwitch.js +7 -29
- package/esm/core/Tooltip/Tooltip.js +3 -25
- package/esm/core/Tree/Tree.js +54 -76
- package/esm/core/Tree/TreeContext.js +3 -3
- package/esm/core/Tree/TreeNode.js +16 -38
- package/esm/core/Tree/TreeNodeExpander.js +3 -25
- package/esm/core/Typography/Anchor/Anchor.js +2 -25
- package/esm/core/Typography/Blockquote/Blockquote.js +3 -25
- package/esm/core/Typography/Body/Body.js +4 -26
- package/esm/core/Typography/Code/Code.js +3 -25
- package/esm/core/Typography/Headline/Headline.js +3 -25
- package/esm/core/Typography/Kbd/Kbd.js +4 -26
- package/esm/core/Typography/Leading/Leading.js +3 -25
- package/esm/core/Typography/Small/Small.js +3 -25
- package/esm/core/Typography/Subheading/Subheading.js +3 -25
- package/esm/core/Typography/Text/Text.js +8 -31
- package/esm/core/Typography/Title/Title.js +3 -25
- package/esm/core/index.d.ts +2 -2
- package/esm/core/index.js +1 -1
- package/esm/core/utils/color/ColorValue.js +145 -156
- package/esm/core/utils/components/FocusTrap.js +11 -11
- package/esm/core/utils/components/InputContainer.js +10 -34
- package/esm/core/utils/components/MiddleTextTruncation.js +13 -29
- package/esm/core/utils/components/Popover.d.ts +1 -1
- package/esm/core/utils/components/Popover.js +54 -57
- package/esm/core/utils/components/Resizer.js +49 -49
- package/esm/core/utils/components/VirtualScroll.js +69 -86
- package/esm/core/utils/components/VisuallyHidden.js +3 -25
- package/esm/core/utils/components/WithCSSTransition.d.ts +2 -2
- package/esm/core/utils/components/WithCSSTransition.js +16 -38
- package/esm/core/utils/functions/colors.js +8 -8
- package/esm/core/utils/functions/dom.js +7 -8
- package/esm/core/utils/functions/focusable.js +11 -15
- package/esm/core/utils/functions/numbers.js +5 -6
- package/esm/core/utils/functions/styles.js +3 -3
- package/esm/core/utils/hooks/useContainerWidth.js +6 -10
- package/esm/core/utils/hooks/useDragAndDrop.js +28 -29
- package/esm/core/utils/hooks/useEventListener.js +6 -6
- package/esm/core/utils/hooks/useIntersection.js +7 -10
- package/esm/core/utils/hooks/useIsomorphicLayoutEffect.js +1 -1
- package/esm/core/utils/hooks/useLatestRef.js +3 -3
- package/esm/core/utils/hooks/useMediaQuery.js +6 -9
- package/esm/core/utils/hooks/useMergedRefs.js +5 -22
- package/esm/core/utils/hooks/useOverflow.js +23 -30
- package/esm/core/utils/hooks/useResizeObserver.js +4 -7
- package/esm/core/utils/hooks/useSafeContext.js +3 -3
- package/esm/core/utils/hooks/useTheme.js +14 -16
- package/esm/core/utils/icons/StatusIconMap.js +5 -16
- package/esm/core/utils/icons/SvgCalendar.js +2 -13
- package/esm/core/utils/icons/SvgCaretDownSmall.js +2 -13
- package/esm/core/utils/icons/SvgCaretRightSmall.js +2 -13
- package/esm/core/utils/icons/SvgCaretUpSmall.js +2 -13
- package/esm/core/utils/icons/SvgCheckmark.js +2 -13
- package/esm/core/utils/icons/SvgCheckmarkSmall.js +2 -13
- package/esm/core/utils/icons/SvgChevronLeft.js +2 -13
- package/esm/core/utils/icons/SvgChevronLeftDouble.js +2 -13
- package/esm/core/utils/icons/SvgChevronRight.js +2 -13
- package/esm/core/utils/icons/SvgChevronRightDouble.js +2 -13
- package/esm/core/utils/icons/SvgClose.js +2 -13
- package/esm/core/utils/icons/SvgCloseSmall.js +2 -13
- package/esm/core/utils/icons/SvgColumnManager.js +2 -13
- package/esm/core/utils/icons/SvgFilter.js +2 -13
- package/esm/core/utils/icons/SvgFilterHollow.js +2 -13
- package/esm/core/utils/icons/SvgImportantSmall.js +2 -13
- package/esm/core/utils/icons/SvgInfoCircular.js +2 -13
- package/esm/core/utils/icons/SvgMore.js +2 -13
- package/esm/core/utils/icons/SvgMoreVertical.js +2 -13
- package/esm/core/utils/icons/SvgNew.js +2 -13
- package/esm/core/utils/icons/SvgSmileyHappy.js +2 -13
- package/esm/core/utils/icons/SvgSortDown.js +2 -13
- package/esm/core/utils/icons/SvgSortUp.js +2 -13
- package/esm/core/utils/icons/SvgStatusError.js +2 -13
- package/esm/core/utils/icons/SvgStatusSuccess.js +2 -13
- package/esm/core/utils/icons/SvgStatusWarning.js +2 -13
- package/esm/core/utils/icons/SvgSwap.js +2 -13
- package/esm/core/utils/icons/SvgUpload.js +2 -13
- package/esm/types/react-table-config.d.ts +6 -2
- package/package.json +4 -4
- package/cjs/core/ErrorPage/ErrorPage.js +0 -168
- package/esm/core/ErrorPage/ErrorPage.js +0 -161
|
@@ -1,33 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.onShiftSelectHandler = exports.onSingleSelectHandler = exports.onSelectHandler = void 0;
|
|
15
4
|
/**
|
|
16
5
|
* Handles selection when clicked on a checkbox.
|
|
17
6
|
*/
|
|
18
|
-
|
|
7
|
+
const onSelectHandler = (newState, instance, onSelect, isRowDisabled) => {
|
|
19
8
|
if (!(instance === null || instance === void 0 ? void 0 : instance.rows.length)) {
|
|
20
9
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect([], newState);
|
|
21
10
|
return;
|
|
22
11
|
}
|
|
23
|
-
|
|
24
|
-
|
|
12
|
+
const newSelectedRowIds = {};
|
|
13
|
+
const handleRow = (row) => {
|
|
25
14
|
if (isRowDisabled === null || isRowDisabled === void 0 ? void 0 : isRowDisabled(row.original)) {
|
|
26
15
|
return false;
|
|
27
16
|
}
|
|
28
|
-
|
|
29
|
-
row.initialSubRows.forEach(
|
|
30
|
-
|
|
17
|
+
let isAllSubSelected = true;
|
|
18
|
+
row.initialSubRows.forEach((subRow) => {
|
|
19
|
+
const result = handleRow(subRow);
|
|
31
20
|
if (!result) {
|
|
32
21
|
isAllSubSelected = false;
|
|
33
22
|
}
|
|
@@ -42,8 +31,8 @@ var onSelectHandler = function (newState, instance, onSelect, isRowDisabled) {
|
|
|
42
31
|
}
|
|
43
32
|
return !!newSelectedRowIds[row.id];
|
|
44
33
|
};
|
|
45
|
-
instance.initialRows.forEach(
|
|
46
|
-
|
|
34
|
+
instance.initialRows.forEach((row) => handleRow(row));
|
|
35
|
+
const selectedData = getSelectedData(newSelectedRowIds, instance);
|
|
47
36
|
newState.selectedRowIds = newSelectedRowIds;
|
|
48
37
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectedData, newState);
|
|
49
38
|
};
|
|
@@ -51,17 +40,20 @@ exports.onSelectHandler = onSelectHandler;
|
|
|
51
40
|
/**
|
|
52
41
|
* Handles selection when clicked on a row.
|
|
53
42
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
var selectedRowIds = (_a = {}, _a[action.id] = true, _a);
|
|
43
|
+
const onSingleSelectHandler = (state, action, instance, onSelect, isRowDisabled) => {
|
|
44
|
+
const selectedRowIds = { [action.id]: true };
|
|
57
45
|
if (instance === null || instance === void 0 ? void 0 : instance.selectSubRows) {
|
|
58
|
-
|
|
46
|
+
const handleRow = (row) => {
|
|
59
47
|
selectedRowIds[row.id] = true;
|
|
60
|
-
row.subRows.forEach(
|
|
48
|
+
row.subRows.forEach((r) => handleRow(r));
|
|
61
49
|
};
|
|
62
|
-
|
|
50
|
+
handleRow(instance.rowsById[action.id]);
|
|
63
51
|
}
|
|
64
|
-
|
|
52
|
+
const newState = {
|
|
53
|
+
...state,
|
|
54
|
+
lastSelectedRowId: action.id,
|
|
55
|
+
selectedRowIds,
|
|
56
|
+
};
|
|
65
57
|
// Passing to `onSelectHandler` to handle filtered sub-rows
|
|
66
58
|
(0, exports.onSelectHandler)(newState, instance, onSelect, isRowDisabled);
|
|
67
59
|
return newState;
|
|
@@ -70,44 +62,47 @@ exports.onSingleSelectHandler = onSingleSelectHandler;
|
|
|
70
62
|
/**
|
|
71
63
|
* Handles selection when clicked on a row while shift key is pressed.
|
|
72
64
|
*/
|
|
73
|
-
|
|
65
|
+
const onShiftSelectHandler = (state, action, instance, onSelect, isRowDisabled) => {
|
|
74
66
|
if (instance == null) {
|
|
75
67
|
return state;
|
|
76
68
|
}
|
|
77
|
-
|
|
78
|
-
|
|
69
|
+
let startIndex = Math.max(0, instance.flatRows.findIndex((row) => row.id === state.lastSelectedRowId));
|
|
70
|
+
let endIndex = Math.max(0, instance.flatRows.findIndex((row) => row.id === action.id));
|
|
79
71
|
if (startIndex > endIndex) {
|
|
80
|
-
|
|
72
|
+
const temp = startIndex;
|
|
81
73
|
startIndex = endIndex;
|
|
82
74
|
endIndex = temp;
|
|
83
75
|
}
|
|
84
|
-
|
|
76
|
+
const selectedRowIds = {};
|
|
85
77
|
// 1. Select all rows between start and end
|
|
86
78
|
instance.flatRows
|
|
87
79
|
.slice(startIndex, endIndex + 1)
|
|
88
|
-
.forEach(
|
|
80
|
+
.forEach((r) => (selectedRowIds[r.id] = true));
|
|
89
81
|
// 2. Select all children of the last row (endIndex)
|
|
90
82
|
// Since lastRow's children come after endIndex + 1 (not selected in step 1)
|
|
91
|
-
|
|
83
|
+
const handleRow = (row) => {
|
|
92
84
|
selectedRowIds[row.id] = true;
|
|
93
|
-
row.subRows.forEach(
|
|
85
|
+
row.subRows.forEach((r) => handleRow(r));
|
|
94
86
|
};
|
|
95
87
|
handleRow(instance.flatRows[endIndex]);
|
|
96
|
-
|
|
88
|
+
const newState = {
|
|
89
|
+
...state,
|
|
90
|
+
selectedRowIds,
|
|
91
|
+
};
|
|
97
92
|
// 3.1 Deselect all selected disabled rows and their children
|
|
98
93
|
// 3.2 Convert all partially selected rows marked with tick mark to horizontal line
|
|
99
94
|
(0, exports.onSelectHandler)(newState, instance, onSelect, isRowDisabled);
|
|
100
95
|
return newState;
|
|
101
96
|
};
|
|
102
97
|
exports.onShiftSelectHandler = onShiftSelectHandler;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+
const getSelectedData = (selectedRowIds, instance) => {
|
|
99
|
+
const selectedData = [];
|
|
100
|
+
const setSelectedData = (row) => {
|
|
106
101
|
if (selectedRowIds[row.id]) {
|
|
107
102
|
selectedData.push(row.original);
|
|
108
103
|
}
|
|
109
|
-
row.initialSubRows.forEach(
|
|
104
|
+
row.initialSubRows.forEach((subRow) => setSelectedData(subRow));
|
|
110
105
|
};
|
|
111
|
-
instance === null || instance === void 0 ? void 0 : instance.initialRows.forEach(
|
|
106
|
+
instance === null || instance === void 0 ? void 0 : instance.initialRows.forEach((row) => setSelectedData(row));
|
|
112
107
|
return selectedData;
|
|
113
108
|
};
|
|
@@ -1,26 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
4
|
};
|
|
@@ -30,8 +8,8 @@ exports.DefaultCell = void 0;
|
|
|
30
8
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
31
9
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
32
10
|
*--------------------------------------------------------------------------------------------*/
|
|
33
|
-
|
|
34
|
-
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
35
13
|
/**
|
|
36
14
|
* Default cell.
|
|
37
15
|
* It should be passed to `cellRenderer`.
|
|
@@ -43,11 +21,11 @@ var classnames_1 = __importDefault(require("classnames"));
|
|
|
43
21
|
* cellRenderer: (props) => <DefaultCell {...props} />,
|
|
44
22
|
* }
|
|
45
23
|
*/
|
|
46
|
-
|
|
24
|
+
const DefaultCell = (props) => {
|
|
47
25
|
// Omitting `cellProps`
|
|
48
26
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
49
|
-
|
|
50
|
-
return (react_1.default.createElement("div",
|
|
27
|
+
const { cellElementProps: { className: cellElementClassName, style: cellElementStyle, ...cellElementProps }, children, startIcon, endIcon, cellProps, isDisabled, className, style, status, ...rest } = props;
|
|
28
|
+
return (react_1.default.createElement("div", { ...cellElementProps, ...rest, className: (0, classnames_1.default)(cellElementClassName, className), "aria-disabled": (isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled(cellProps.row.original)) || undefined, "data-iui-status": status, style: { ...cellElementStyle, ...style } },
|
|
51
29
|
startIcon && (react_1.default.createElement("div", { className: 'iui-table-cell-start-icon' }, startIcon)),
|
|
52
30
|
children,
|
|
53
31
|
endIcon && react_1.default.createElement("div", { className: 'iui-table-cell-end-icon' }, endIcon)));
|
|
@@ -1,26 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
4
|
};
|
|
@@ -30,8 +8,8 @@ exports.EditableCell = void 0;
|
|
|
30
8
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
31
9
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
32
10
|
*--------------------------------------------------------------------------------------------*/
|
|
33
|
-
|
|
34
|
-
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const utils_1 = require("../../utils");
|
|
35
13
|
/**
|
|
36
14
|
* Editable cell.
|
|
37
15
|
* It should be passed to `cellRenderer`.
|
|
@@ -42,26 +20,24 @@ var utils_1 = require("../../utils");
|
|
|
42
20
|
* cellRenderer: (props) => <EditableCell {...props} onCellEdit={onCellEditHandler} />,
|
|
43
21
|
* }
|
|
44
22
|
*/
|
|
45
|
-
|
|
46
|
-
|
|
23
|
+
const EditableCell = (props) => {
|
|
24
|
+
const { cellElementProps, cellProps, onCellEdit, children, isDisabled, ...rest } = props;
|
|
47
25
|
isDisabled; // To omit and prevent eslint error.
|
|
48
|
-
|
|
26
|
+
const sanitizeString = (text) => {
|
|
49
27
|
return text.replace(/(\r\n|\n|\r)+/gm, ' ');
|
|
50
28
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}), value = _a[0], setValue = _a[1];
|
|
54
|
-
react_1.default.useEffect(function () {
|
|
29
|
+
const [value, setValue] = react_1.default.useState(() => sanitizeString(cellProps.value));
|
|
30
|
+
react_1.default.useEffect(() => {
|
|
55
31
|
setValue(sanitizeString(cellProps.value));
|
|
56
32
|
}, [cellProps.value]);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return (react_1.default.createElement("div",
|
|
33
|
+
const [key, setKey] = react_1.default.useState((0, utils_1.getRandomValue)(10));
|
|
34
|
+
const [isDirty, setIsDirty] = react_1.default.useState(false);
|
|
35
|
+
return (react_1.default.createElement("div", { ...cellElementProps, contentEditable: true, suppressContentEditableWarning: true, key: key, ...rest, onInput: (e) => {
|
|
60
36
|
var _a;
|
|
61
37
|
setValue(sanitizeString(e.target.innerText));
|
|
62
38
|
setIsDirty(true);
|
|
63
39
|
(_a = props.onInput) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
64
|
-
}, onBlur:
|
|
40
|
+
}, onBlur: (e) => {
|
|
65
41
|
var _a;
|
|
66
42
|
if (isDirty) {
|
|
67
43
|
onCellEdit(cellProps.column.id, value, cellProps.row.original);
|
|
@@ -70,28 +46,28 @@ var EditableCell = function (props) {
|
|
|
70
46
|
// Prevents error when text is cleared.
|
|
71
47
|
// New key makes React to reattach with the DOM so it won't complain about deleted text node.
|
|
72
48
|
setKey((0, utils_1.getRandomValue)(10));
|
|
73
|
-
}, onKeyDown:
|
|
49
|
+
}, onKeyDown: (e) => {
|
|
74
50
|
var _a;
|
|
75
51
|
// Prevents from adding HTML elements (div, br) inside a cell on Enter press
|
|
76
52
|
if (e.key === 'Enter') {
|
|
77
53
|
e.preventDefault();
|
|
78
54
|
}
|
|
79
55
|
(_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
80
|
-
}, onPaste:
|
|
56
|
+
}, onPaste: (e) => {
|
|
81
57
|
var _a;
|
|
82
58
|
e.preventDefault();
|
|
83
59
|
document.execCommand('inserttext', false, sanitizeString(e.clipboardData.getData('text/plain')));
|
|
84
60
|
(_a = props.onPaste) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
85
|
-
}, onDrop:
|
|
61
|
+
}, onDrop: (e) => {
|
|
86
62
|
var _a;
|
|
87
63
|
// Prevents from drag'n'dropping into a cell because it will add unwanted HTML elements
|
|
88
64
|
e.preventDefault();
|
|
89
65
|
(_a = props.onDrop) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
90
|
-
}, onClick:
|
|
66
|
+
}, onClick: (e) => {
|
|
91
67
|
var _a;
|
|
92
68
|
e.stopPropagation();
|
|
93
69
|
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
94
|
-
} }
|
|
70
|
+
} }, children));
|
|
95
71
|
};
|
|
96
72
|
exports.EditableCell = EditableCell;
|
|
97
73
|
exports.default = exports.EditableCell;
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
@@ -19,17 +8,17 @@ exports.ActionColumn = void 0;
|
|
|
19
8
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
20
9
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
21
10
|
*--------------------------------------------------------------------------------------------*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const Checkbox_1 = require("../../Checkbox");
|
|
13
|
+
const utils_1 = require("../../utils");
|
|
14
|
+
const DropdownMenu_1 = require("../../DropdownMenu");
|
|
15
|
+
const IconButton_1 = require("../../Buttons/IconButton");
|
|
16
|
+
const Menu_1 = require("../../Menu");
|
|
17
|
+
const Table_1 = require("../Table");
|
|
18
|
+
const selectionColumn_1 = require("./selectionColumn");
|
|
19
|
+
const expanderColumn_1 = require("./expanderColumn");
|
|
20
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
21
|
+
const ACTION_CELL_ID = 'iui-table-action';
|
|
33
22
|
/**
|
|
34
23
|
* Action column that adds column manager to the Table header.
|
|
35
24
|
* It is recommended to add this column to the end of the Table
|
|
@@ -49,8 +38,7 @@ var ACTION_CELL_ID = 'iui-table-action';
|
|
|
49
38
|
* ),
|
|
50
39
|
* },
|
|
51
40
|
*/
|
|
52
|
-
|
|
53
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.columnManager, columnManager = _c === void 0 ? false : _c;
|
|
41
|
+
const ActionColumn = ({ columnManager = false, } = {}) => {
|
|
54
42
|
return {
|
|
55
43
|
id: ACTION_CELL_ID,
|
|
56
44
|
disableResizing: true,
|
|
@@ -61,59 +49,53 @@ var ActionColumn = function (_a) {
|
|
|
61
49
|
columnClassName: 'iui-slot',
|
|
62
50
|
cellClassName: 'iui-slot',
|
|
63
51
|
disableReordering: true,
|
|
64
|
-
Header:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var buttonRef = react_1.default.useRef(null);
|
|
52
|
+
Header: ({ allColumns, dispatch, state }) => {
|
|
53
|
+
const [isOpen, setIsOpen] = react_1.default.useState(false);
|
|
54
|
+
const buttonRef = react_1.default.useRef(null);
|
|
68
55
|
if (!columnManager) {
|
|
69
56
|
return null;
|
|
70
57
|
}
|
|
71
|
-
|
|
58
|
+
const defaultColumnIds = [
|
|
72
59
|
selectionColumn_1.SELECTION_CELL_ID,
|
|
73
60
|
expanderColumn_1.EXPANDER_CELL_ID,
|
|
74
61
|
ACTION_CELL_ID,
|
|
75
62
|
];
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
return (react_1.default.createElement(Menu_1.MenuItem, { key: column.id, icon: react_1.default.createElement(Checkbox_1.Checkbox, { checked: checked, disabled: column.disableToggleVisibility, onClick: function (e) { return e.stopPropagation(); }, onChange: onClick, "aria-labelledby": "iui-column-".concat(column.id) }), onClick: onClick, disabled: column.disableToggleVisibility },
|
|
102
|
-
react_1.default.createElement("div", { id: "iui-column-".concat(column.id) }, column.render('Header'))));
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
|
-
var dropdownMenuProps = typeof columnManager !== 'boolean'
|
|
63
|
+
const headerCheckBoxes = () => allColumns
|
|
64
|
+
//Filters out any default columns made such as selection and expansion
|
|
65
|
+
.filter(({ id }) => !defaultColumnIds.includes(id))
|
|
66
|
+
.map((column) => {
|
|
67
|
+
const { checked } = column.getToggleHiddenProps();
|
|
68
|
+
const onClick = () => {
|
|
69
|
+
column.toggleHidden(checked);
|
|
70
|
+
// If no column was resized then leave table resize handling to the flexbox
|
|
71
|
+
if (Object.keys(state.columnResizing.columnWidths).length === 0) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
// Triggers an update to resize the widths of all visible columns
|
|
75
|
+
dispatch({ type: Table_1.tableResizeStartAction });
|
|
76
|
+
// If some columns were resized and some columns visibility was enabled, then horizontal scrollbar appears
|
|
77
|
+
// and table is scrolled to the very left which means our visibility dropdown menu is not visible.
|
|
78
|
+
// So for better UX we need to scroll to that dropdown menu.
|
|
79
|
+
queueMicrotask(() => {
|
|
80
|
+
var _a;
|
|
81
|
+
(_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView();
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
return (react_1.default.createElement(Menu_1.MenuItem, { key: column.id, icon: react_1.default.createElement(Checkbox_1.Checkbox, { checked: checked, disabled: column.disableToggleVisibility, onClick: (e) => e.stopPropagation(), onChange: onClick, "aria-labelledby": `iui-column-${column.id}` }), onClick: onClick, disabled: column.disableToggleVisibility },
|
|
85
|
+
react_1.default.createElement("div", { id: `iui-column-${column.id}` }, column.render('Header'))));
|
|
86
|
+
});
|
|
87
|
+
const dropdownMenuProps = typeof columnManager !== 'boolean'
|
|
106
88
|
? columnManager.dropdownMenuProps
|
|
107
89
|
: {};
|
|
108
|
-
return (react_1.default.createElement(DropdownMenu_1.DropdownMenu,
|
|
90
|
+
return (react_1.default.createElement(DropdownMenu_1.DropdownMenu, { ...dropdownMenuProps, menuItems: headerCheckBoxes, onHide: (i) => {
|
|
109
91
|
var _a;
|
|
110
92
|
setIsOpen(false);
|
|
111
93
|
(_a = dropdownMenuProps.onHide) === null || _a === void 0 ? void 0 : _a.call(dropdownMenuProps, i);
|
|
112
|
-
}, onShow:
|
|
94
|
+
}, onShow: (i) => {
|
|
113
95
|
var _a;
|
|
114
96
|
setIsOpen(true);
|
|
115
97
|
(_a = dropdownMenuProps.onShow) === null || _a === void 0 ? void 0 : _a.call(dropdownMenuProps, i);
|
|
116
|
-
}, className: (0, classnames_1.default)('iui-scroll', dropdownMenuProps.className) }
|
|
98
|
+
}, className: (0, classnames_1.default)('iui-scroll', dropdownMenuProps.className) },
|
|
117
99
|
react_1.default.createElement(IconButton_1.IconButton, { styleType: 'borderless', isActive: isOpen, ref: buttonRef },
|
|
118
100
|
react_1.default.createElement(utils_1.SvgColumnManager, null))));
|
|
119
101
|
},
|
|
@@ -20,11 +20,8 @@ export declare const EXPANDER_CELL_ID = "iui-table-expander";
|
|
|
20
20
|
* return rowData.name === 'Name2';
|
|
21
21
|
* }, []);
|
|
22
22
|
* const columns = useMemo(() => [
|
|
23
|
-
*
|
|
24
|
-
* columns
|
|
25
|
-
* ExpanderColumn({ subComponent, isDisabled: isExpanderDisabled }),
|
|
26
|
-
* // Rest of your columns
|
|
27
|
-
* ],
|
|
23
|
+
* ExpanderColumn({ subComponent, isDisabled: isExpanderDisabled }),
|
|
24
|
+
* // Rest of your columns
|
|
28
25
|
* ], [isExpanderDisabled, subComponent]);
|
|
29
26
|
*/
|
|
30
27
|
export declare const ExpanderColumn: <T extends Record<string, unknown>>(props?: {
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
@@ -19,10 +8,10 @@ exports.ExpanderColumn = exports.EXPANDER_CELL_ID = void 0;
|
|
|
19
8
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
20
9
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
21
10
|
*--------------------------------------------------------------------------------------------*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const utils_1 = require("../../utils");
|
|
13
|
+
const Buttons_1 = require("../../Buttons");
|
|
14
|
+
const cells_1 = require("../cells");
|
|
26
15
|
exports.EXPANDER_CELL_ID = 'iui-table-expander';
|
|
27
16
|
/**
|
|
28
17
|
* Expander column that adds sub-content expander column to the Table.
|
|
@@ -43,16 +32,12 @@ exports.EXPANDER_CELL_ID = 'iui-table-expander';
|
|
|
43
32
|
* return rowData.name === 'Name2';
|
|
44
33
|
* }, []);
|
|
45
34
|
* const columns = useMemo(() => [
|
|
46
|
-
*
|
|
47
|
-
* columns
|
|
48
|
-
* ExpanderColumn({ subComponent, isDisabled: isExpanderDisabled }),
|
|
49
|
-
* // Rest of your columns
|
|
50
|
-
* ],
|
|
35
|
+
* ExpanderColumn({ subComponent, isDisabled: isExpanderDisabled }),
|
|
36
|
+
* // Rest of your columns
|
|
51
37
|
* ], [isExpanderDisabled, subComponent]);
|
|
52
38
|
*/
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
var subComponent = props.subComponent, isDisabled = props.isDisabled;
|
|
39
|
+
const ExpanderColumn = (props = {}) => {
|
|
40
|
+
const { subComponent, isDisabled } = props;
|
|
56
41
|
return {
|
|
57
42
|
id: exports.EXPANDER_CELL_ID,
|
|
58
43
|
disableResizing: true,
|
|
@@ -63,19 +48,19 @@ var ExpanderColumn = function (props) {
|
|
|
63
48
|
maxWidth: 48,
|
|
64
49
|
columnClassName: 'iui-slot',
|
|
65
50
|
cellClassName: 'iui-slot',
|
|
66
|
-
Cell:
|
|
67
|
-
|
|
51
|
+
Cell: (props) => {
|
|
52
|
+
const { row } = props;
|
|
68
53
|
if (!(subComponent === null || subComponent === void 0 ? void 0 : subComponent(row))) {
|
|
69
54
|
return null;
|
|
70
55
|
}
|
|
71
56
|
else {
|
|
72
|
-
return (react_1.default.createElement(Buttons_1.IconButton, { className: 'iui-table-row-expander', styleType: 'borderless', size: 'small', onClick:
|
|
57
|
+
return (react_1.default.createElement(Buttons_1.IconButton, { className: 'iui-table-row-expander', styleType: 'borderless', size: 'small', onClick: (e) => {
|
|
73
58
|
e.stopPropagation();
|
|
74
59
|
row.toggleRowExpanded();
|
|
75
60
|
}, disabled: isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled(props.row.original) }, react_1.default.createElement(utils_1.SvgChevronRight, null)));
|
|
76
61
|
}
|
|
77
62
|
},
|
|
78
|
-
cellRenderer:
|
|
63
|
+
cellRenderer: (props) => (react_1.default.createElement(cells_1.DefaultCell, { ...props, isDisabled: (rowData) => !!(isDisabled === null || isDisabled === void 0 ? void 0 : isDisabled(rowData)) })),
|
|
79
64
|
};
|
|
80
65
|
};
|
|
81
66
|
exports.ExpanderColumn = ExpanderColumn;
|
|
@@ -9,11 +9,8 @@ export declare const SELECTION_CELL_ID = "iui-table-checkbox-selector";
|
|
|
9
9
|
* return rowData.name === 'Name1';
|
|
10
10
|
* }, []);
|
|
11
11
|
* const columns = useMemo(() => [
|
|
12
|
-
*
|
|
13
|
-
* columns
|
|
14
|
-
* SelectionColumn({ isDisabled: isCheckboxDisabled }),
|
|
15
|
-
* // Rest of your columns
|
|
16
|
-
* ],
|
|
12
|
+
* SelectionColumn({ isDisabled: isCheckboxDisabled }),
|
|
13
|
+
* // Rest of your columns
|
|
17
14
|
* ], [isCheckboxDisabled]);
|
|
18
15
|
*/
|
|
19
16
|
export declare const SelectionColumn: <T extends Record<string, unknown>>(props?: {
|