@itwin/itwinui-react 2.0.0-dev.2 → 2.0.0-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +1 -1
- 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 +1 -1
- package/package.json +3 -3
- package/cjs/core/ErrorPage/ErrorPage.js +0 -168
- package/esm/core/ErrorPage/ErrorPage.js +0 -161
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
-
if (ar || !(i in from)) {
|
|
15
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
-
ar[i] = from[i];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
-
};
|
|
21
1
|
/*---------------------------------------------------------------------------------------------
|
|
22
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
23
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -25,31 +5,46 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
25
5
|
import { actions, } from 'react-table';
|
|
26
6
|
actions.setScrolledLeft = 'setScrolledLeft';
|
|
27
7
|
actions.setScrolledRight = 'setScrolledRight';
|
|
28
|
-
export
|
|
8
|
+
export const useStickyColumns = (hooks) => {
|
|
29
9
|
hooks.stateReducers.push(reducer);
|
|
30
10
|
hooks.useInstance.push(useInstance);
|
|
31
11
|
};
|
|
32
|
-
|
|
12
|
+
const reducer = (newState, action) => {
|
|
33
13
|
var _a, _b;
|
|
34
14
|
if (action.type === actions.init) {
|
|
35
|
-
return
|
|
15
|
+
return {
|
|
16
|
+
...newState,
|
|
17
|
+
sticky: {},
|
|
18
|
+
};
|
|
36
19
|
}
|
|
37
20
|
if (action.type === actions.setScrolledLeft &&
|
|
38
21
|
((_a = newState.sticky) === null || _a === void 0 ? void 0 : _a.isScrolledToLeft) !== action.value // Prevents unnecessary re-render
|
|
39
22
|
) {
|
|
40
|
-
return
|
|
23
|
+
return {
|
|
24
|
+
...newState,
|
|
25
|
+
sticky: {
|
|
26
|
+
...newState.sticky,
|
|
27
|
+
isScrolledToLeft: action.value,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
41
30
|
}
|
|
42
31
|
if (action.type === actions.setScrolledRight &&
|
|
43
32
|
((_b = newState.sticky) === null || _b === void 0 ? void 0 : _b.isScrolledToRight) !== action.value // Prevents unnecessary re-render
|
|
44
33
|
) {
|
|
45
|
-
return
|
|
34
|
+
return {
|
|
35
|
+
...newState,
|
|
36
|
+
sticky: {
|
|
37
|
+
...newState.sticky,
|
|
38
|
+
isScrolledToRight: action.value,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
46
41
|
}
|
|
47
42
|
return newState;
|
|
48
43
|
};
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
const useInstance = (instance) => {
|
|
45
|
+
const { flatHeaders } = instance;
|
|
51
46
|
// Edge case. Saving original sticky state in case sticky columns are reordered.
|
|
52
|
-
flatHeaders.forEach(
|
|
47
|
+
flatHeaders.forEach((header) => {
|
|
53
48
|
var _a;
|
|
54
49
|
if (!header.originalSticky) {
|
|
55
50
|
header.originalSticky = (_a = header.sticky) !== null && _a !== void 0 ? _a : 'none';
|
|
@@ -58,8 +53,8 @@ var useInstance = function (instance) {
|
|
|
58
53
|
header.originalSticky === 'none' ? undefined : header.originalSticky;
|
|
59
54
|
});
|
|
60
55
|
// If there is a column that is sticked to the left, make every column prior to that sticky too.
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
let hasLeftStickyColumn = false;
|
|
57
|
+
[...flatHeaders].reverse().forEach((header) => {
|
|
63
58
|
if (header.sticky === 'left') {
|
|
64
59
|
hasLeftStickyColumn = true;
|
|
65
60
|
}
|
|
@@ -68,8 +63,8 @@ var useInstance = function (instance) {
|
|
|
68
63
|
}
|
|
69
64
|
});
|
|
70
65
|
// If there is a column that is sticked to the right, make every column after to that sticky too.
|
|
71
|
-
|
|
72
|
-
flatHeaders.forEach(
|
|
66
|
+
let hasRightStickyColumn = false;
|
|
67
|
+
flatHeaders.forEach((header) => {
|
|
73
68
|
if (header.sticky === 'right') {
|
|
74
69
|
hasRightStickyColumn = true;
|
|
75
70
|
}
|
|
@@ -1,38 +1,18 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
-
if (ar || !(i in from)) {
|
|
15
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
-
ar[i] = from[i];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
-
};
|
|
21
1
|
/*---------------------------------------------------------------------------------------------
|
|
22
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
23
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
24
4
|
*--------------------------------------------------------------------------------------------*/
|
|
25
5
|
import React from 'react';
|
|
26
6
|
import { defaultFilterFunctions } from '../filters/defaultFilterFunctions';
|
|
27
|
-
export
|
|
7
|
+
export const useSubRowFiltering = (hasAnySubRows) => (hooks) => {
|
|
28
8
|
hooks.useInstance.push(useInstance.bind({}, hasAnySubRows));
|
|
29
|
-
};
|
|
30
|
-
|
|
9
|
+
};
|
|
10
|
+
const useInstance = (hasAnySubRows, instance) => {
|
|
31
11
|
// There is a bug in react-table that filtered out sub-rows won't be shown after clearing the filter.
|
|
32
12
|
// Therefore saving original sub-rows separately.
|
|
33
13
|
// Related issue: https://github.com/tannerlinsley/react-table/issues/2928
|
|
34
|
-
|
|
35
|
-
rows.forEach(
|
|
14
|
+
const setInitialSubRows = (rows) => {
|
|
15
|
+
rows.forEach((row) => {
|
|
36
16
|
if (!row.initialSubRows) {
|
|
37
17
|
row.initialSubRows = row.subRows;
|
|
38
18
|
}
|
|
@@ -40,71 +20,71 @@ var useInstance = function (hasAnySubRows, instance) {
|
|
|
40
20
|
});
|
|
41
21
|
};
|
|
42
22
|
setInitialSubRows(instance.initialRows);
|
|
43
|
-
|
|
23
|
+
const { filteredRows = instance.filteredRows, filteredFlatRows = instance.filteredFlatRows, filteredRowsById = instance.filteredRowsById, } = React.useMemo(() => {
|
|
44
24
|
if (!hasAnySubRows) {
|
|
45
25
|
return {};
|
|
46
26
|
}
|
|
47
27
|
// Restore original sub-rows
|
|
48
|
-
|
|
49
|
-
rows.forEach(
|
|
28
|
+
const setSubRows = (rows) => {
|
|
29
|
+
rows.forEach((row) => {
|
|
50
30
|
var _a;
|
|
51
31
|
row.subRows = (_a = row.initialSubRows) !== null && _a !== void 0 ? _a : [];
|
|
52
32
|
setSubRows(row.subRows);
|
|
53
33
|
});
|
|
54
34
|
};
|
|
55
35
|
setSubRows(instance.initialRows);
|
|
56
|
-
|
|
57
|
-
instance.state.filters.forEach(
|
|
58
|
-
var
|
|
59
|
-
|
|
60
|
-
var column = instance.allColumns.find(function (c) { return c.id === columnId; });
|
|
36
|
+
let currentlyFilteredRows = [...instance.initialRows];
|
|
37
|
+
instance.state.filters.forEach(({ id: columnId, value: filterValue }) => {
|
|
38
|
+
var _a;
|
|
39
|
+
const column = instance.allColumns.find((c) => c.id === columnId);
|
|
61
40
|
if (!column) {
|
|
62
41
|
return;
|
|
63
42
|
}
|
|
64
|
-
|
|
65
|
-
|
|
43
|
+
const filterTypes = {
|
|
44
|
+
...defaultFilterFunctions,
|
|
45
|
+
...instance.filterTypes,
|
|
46
|
+
};
|
|
47
|
+
const filterFn = typeof column.filter === 'function'
|
|
66
48
|
? column.filter
|
|
67
|
-
: filterTypes[(
|
|
68
|
-
currentlyFilteredRows = currentlyFilteredRows.filter(
|
|
69
|
-
return handleRowFiltering(row, filterFn, columnId, filterValue);
|
|
70
|
-
});
|
|
49
|
+
: filterTypes[(_a = column.filter) !== null && _a !== void 0 ? _a : 'text'];
|
|
50
|
+
currentlyFilteredRows = currentlyFilteredRows.filter((row) => handleRowFiltering(row, filterFn, columnId, filterValue));
|
|
71
51
|
});
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
52
|
+
const filteredRows = [];
|
|
53
|
+
const filteredFlatRows = [];
|
|
54
|
+
const filteredRowsById = {};
|
|
75
55
|
// Setting rows here helps to keep them ordered.
|
|
76
|
-
|
|
56
|
+
const populateRows = (row) => {
|
|
77
57
|
if (row.depth === 0) {
|
|
78
58
|
filteredRows.push(row);
|
|
79
59
|
}
|
|
80
60
|
filteredFlatRows.push(row);
|
|
81
61
|
filteredRowsById[row.id] = row;
|
|
82
62
|
if (row.subRows.length) {
|
|
83
|
-
row.subRows.forEach(
|
|
63
|
+
row.subRows.forEach((r) => populateRows(r));
|
|
84
64
|
}
|
|
85
65
|
};
|
|
86
|
-
currentlyFilteredRows.forEach(
|
|
87
|
-
return { filteredRows
|
|
66
|
+
currentlyFilteredRows.forEach((row) => populateRows(row));
|
|
67
|
+
return { filteredRows, filteredFlatRows, filteredRowsById };
|
|
88
68
|
}, [
|
|
89
69
|
instance.allColumns,
|
|
90
70
|
instance.filterTypes,
|
|
91
71
|
instance.initialRows,
|
|
92
72
|
instance.state.filters,
|
|
93
73
|
hasAnySubRows,
|
|
94
|
-
])
|
|
74
|
+
]);
|
|
95
75
|
Object.assign(instance, {
|
|
96
|
-
filteredRows
|
|
97
|
-
filteredFlatRows
|
|
98
|
-
filteredRowsById
|
|
76
|
+
filteredRows,
|
|
77
|
+
filteredFlatRows,
|
|
78
|
+
filteredRowsById,
|
|
99
79
|
rows: filteredRows,
|
|
100
80
|
flatRows: filteredFlatRows,
|
|
101
81
|
rowsById: filteredRowsById,
|
|
102
82
|
});
|
|
103
83
|
};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
row.subRows = row.initialSubRows.filter(
|
|
107
|
-
|
|
84
|
+
const handleRowFiltering = (row, filterFn, columnId, filterValue) => {
|
|
85
|
+
let hasFilteredSubRows = false;
|
|
86
|
+
row.subRows = row.initialSubRows.filter((subRow) => {
|
|
87
|
+
const result = handleRowFiltering(subRow, filterFn, columnId, filterValue);
|
|
108
88
|
if (result) {
|
|
109
89
|
hasFilteredSubRows = true;
|
|
110
90
|
}
|
|
@@ -115,6 +95,6 @@ var handleRowFiltering = function (row, filterFn, columnId, filterValue) {
|
|
|
115
95
|
if (hasFilteredSubRows) {
|
|
116
96
|
return true;
|
|
117
97
|
}
|
|
118
|
-
|
|
98
|
+
const result = filterFn([row], [columnId], filterValue);
|
|
119
99
|
return !!result.length;
|
|
120
100
|
};
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import React from 'react';
|
|
6
|
-
export
|
|
6
|
+
export const useSubRowSelection = (hooks) => {
|
|
7
7
|
hooks.useInstance.push(useInstance);
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
row.subRows.forEach(
|
|
9
|
+
const useInstance = (instance) => {
|
|
10
|
+
const selectedFlatRows = React.useMemo(() => {
|
|
11
|
+
const selectedFlatRows = [];
|
|
12
|
+
const setSelectionState = (row, selectedRowIds) => {
|
|
13
|
+
let isSomeSubRowsSelected = false;
|
|
14
|
+
row.subRows.forEach((subRow) => {
|
|
15
15
|
setSelectionState(subRow, selectedRowIds);
|
|
16
16
|
if (subRow.isSelected || subRow.isSomeSelected) {
|
|
17
17
|
isSomeSubRowsSelected = true;
|
|
@@ -27,12 +27,10 @@ var useInstance = function (instance) {
|
|
|
27
27
|
row.isSomeSelected = isSomeSubRowsSelected;
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
instance.rows.forEach(
|
|
31
|
-
return setSelectionState(row, instance.state.selectedRowIds);
|
|
32
|
-
});
|
|
30
|
+
instance.rows.forEach((row) => setSelectionState(row, instance.state.selectedRowIds));
|
|
33
31
|
return selectedFlatRows;
|
|
34
32
|
}, [instance.rows, instance.state.selectedRowIds]);
|
|
35
33
|
Object.assign(instance, {
|
|
36
|
-
selectedFlatRows
|
|
34
|
+
selectedFlatRows,
|
|
37
35
|
});
|
|
38
36
|
};
|
package/esm/core/Table/utils.js
CHANGED
|
@@ -1,56 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
-
ar[i] = from[i];
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
-
};
|
|
10
|
-
export var getCellStyle = function (column, isTableResizing) {
|
|
11
|
-
var style = {};
|
|
12
|
-
style.flex = "1 1 145px";
|
|
1
|
+
export const getCellStyle = (column, isTableResizing) => {
|
|
2
|
+
const style = {};
|
|
3
|
+
style.flex = `1 1 145px`;
|
|
13
4
|
if (column.width) {
|
|
14
|
-
|
|
5
|
+
const width = typeof column.width === 'string' ? column.width : `${column.width}px`;
|
|
15
6
|
style.width = width;
|
|
16
7
|
// This allows flexbox to handle the width of the column on table resize
|
|
17
8
|
if (isTableResizing && column.canResize) {
|
|
18
|
-
style.flex =
|
|
9
|
+
style.flex = `${Number(column.width)} ${Number(column.width)} ${width}`;
|
|
19
10
|
}
|
|
20
11
|
else {
|
|
21
|
-
style.flex =
|
|
12
|
+
style.flex = `0 0 ${width}`;
|
|
22
13
|
}
|
|
23
14
|
}
|
|
24
15
|
if (column.maxWidth) {
|
|
25
|
-
style.maxWidth =
|
|
16
|
+
style.maxWidth = `${column.maxWidth}px`;
|
|
26
17
|
}
|
|
27
18
|
if (column.minWidth) {
|
|
28
|
-
style.minWidth =
|
|
19
|
+
style.minWidth = `${column.minWidth}px`;
|
|
29
20
|
}
|
|
30
21
|
return style;
|
|
31
22
|
};
|
|
32
|
-
export
|
|
23
|
+
export const getStickyStyle = (column, columnList) => {
|
|
33
24
|
if (!column.sticky) {
|
|
34
25
|
return {};
|
|
35
26
|
}
|
|
36
|
-
|
|
37
|
-
for (
|
|
38
|
-
var col = columnList_1[_i];
|
|
27
|
+
let left = 0;
|
|
28
|
+
for (const col of columnList) {
|
|
39
29
|
if (col.id === column.id) {
|
|
40
30
|
break;
|
|
41
31
|
}
|
|
42
32
|
left += Number(col.width || col.resizeWidth || 0);
|
|
43
33
|
}
|
|
44
|
-
|
|
45
|
-
for (
|
|
46
|
-
var col = _b[_a];
|
|
34
|
+
let right = 0;
|
|
35
|
+
for (const col of [...columnList].reverse()) {
|
|
47
36
|
if (col.id === column.id) {
|
|
48
37
|
break;
|
|
49
38
|
}
|
|
50
39
|
right += Number(col.width || col.resizeWidth || 0);
|
|
51
40
|
}
|
|
52
41
|
return {
|
|
53
|
-
'--iui-table-sticky-left': column.sticky === 'left' ?
|
|
54
|
-
'--iui-table-sticky-right': column.sticky === 'right' ?
|
|
42
|
+
'--iui-table-sticky-left': column.sticky === 'left' ? `${left}px` : undefined,
|
|
43
|
+
'--iui-table-sticky-right': column.sticky === 'right' ? `${right}px` : undefined,
|
|
55
44
|
};
|
|
56
45
|
};
|
package/esm/core/Tabs/Tab.js
CHANGED
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
1
|
/*---------------------------------------------------------------------------------------------
|
|
24
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
25
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -36,10 +14,10 @@ import '@itwin/itwinui-css/css/tabs.css';
|
|
|
36
14
|
* <Tab label='Label 2' startIcon={<SvgPlaceholder />} />,
|
|
37
15
|
* ];
|
|
38
16
|
*/
|
|
39
|
-
export
|
|
40
|
-
|
|
17
|
+
export const Tab = (props) => {
|
|
18
|
+
const { label, sublabel, startIcon, children, className, ...rest } = props;
|
|
41
19
|
useTheme();
|
|
42
|
-
return (React.createElement("button",
|
|
20
|
+
return (React.createElement("button", { className: cx('iui-tab', className), role: 'tab', tabIndex: -1, ...rest },
|
|
43
21
|
startIcon &&
|
|
44
22
|
React.cloneElement(startIcon, {
|
|
45
23
|
className: 'iui-tab-icon',
|
package/esm/core/Tabs/Tabs.js
CHANGED
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
1
|
/*---------------------------------------------------------------------------------------------
|
|
24
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
25
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -56,69 +34,69 @@ import { Tab } from './Tab';
|
|
|
56
34
|
* ];
|
|
57
35
|
* <Tabs labels={tabsWithIcons} type='pill' />
|
|
58
36
|
*/
|
|
59
|
-
export
|
|
60
|
-
|
|
37
|
+
export const Tabs = (props) => {
|
|
38
|
+
const { labels, activeIndex, onTabSelected, focusActivationMode = 'auto', type = 'default', color = 'blue', orientation = 'horizontal', tabsClassName, contentClassName, wrapperClassName, children, ...rest } = props;
|
|
61
39
|
useTheme();
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}), currentActiveIndex = _f[0], setCurrentActiveIndex = _f[1];
|
|
70
|
-
React.useLayoutEffect(function () {
|
|
40
|
+
const tablistRef = React.useRef(null);
|
|
41
|
+
const [tablistSizeRef, tabsWidth] = useContainerWidth(type !== 'default');
|
|
42
|
+
const refs = useMergedRefs(tablistRef, tablistSizeRef);
|
|
43
|
+
const [currentActiveIndex, setCurrentActiveIndex] = React.useState(() => activeIndex != null
|
|
44
|
+
? getBoundedValue(activeIndex, 0, labels.length - 1)
|
|
45
|
+
: 0);
|
|
46
|
+
React.useLayoutEffect(() => {
|
|
71
47
|
if (activeIndex != null && currentActiveIndex !== activeIndex) {
|
|
72
48
|
setCurrentActiveIndex(getBoundedValue(activeIndex, 0, labels.length - 1));
|
|
73
49
|
}
|
|
74
50
|
}, [activeIndex, currentActiveIndex, labels.length]);
|
|
75
51
|
// CSS custom properties to place the active stripe
|
|
76
|
-
|
|
77
|
-
React.useLayoutEffect(
|
|
52
|
+
const [stripeProperties, setStripeProperties] = React.useState({});
|
|
53
|
+
React.useLayoutEffect(() => {
|
|
78
54
|
if (type !== 'default' && tablistRef.current != undefined) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
setStripeProperties(
|
|
82
|
-
'
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
'
|
|
87
|
-
|
|
55
|
+
const activeTab = tablistRef.current.children[currentActiveIndex];
|
|
56
|
+
const activeTabRect = activeTab.getBoundingClientRect();
|
|
57
|
+
setStripeProperties({
|
|
58
|
+
...(orientation === 'horizontal' && {
|
|
59
|
+
'--stripe-width': `${activeTabRect.width}px`,
|
|
60
|
+
'--stripe-left': `${activeTab.offsetLeft}px`,
|
|
61
|
+
}),
|
|
62
|
+
...(orientation === 'vertical' && {
|
|
63
|
+
'--stripe-height': `${activeTabRect.height}px`,
|
|
64
|
+
'--stripe-top': `${activeTab.offsetTop}px`,
|
|
65
|
+
}),
|
|
66
|
+
});
|
|
88
67
|
}
|
|
89
68
|
}, [currentActiveIndex, type, orientation, tabsWidth]);
|
|
90
|
-
|
|
91
|
-
React.useEffect(
|
|
69
|
+
const [focusedIndex, setFocusedIndex] = React.useState();
|
|
70
|
+
React.useEffect(() => {
|
|
92
71
|
if (tablistRef.current && focusedIndex !== undefined) {
|
|
93
|
-
|
|
72
|
+
const tab = tablistRef.current.querySelectorAll('.iui-tab')[focusedIndex];
|
|
94
73
|
tab === null || tab === void 0 ? void 0 : tab.focus();
|
|
95
74
|
}
|
|
96
75
|
}, [focusedIndex]);
|
|
97
|
-
|
|
98
|
-
React.useLayoutEffect(
|
|
76
|
+
const [hasSublabel, setHasSublabel] = React.useState(false); // used for setting size
|
|
77
|
+
React.useLayoutEffect(() => {
|
|
99
78
|
var _a;
|
|
100
79
|
setHasSublabel(type !== 'pill' && // pill tabs should never have sublabels
|
|
101
80
|
!!((_a = tablistRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('.iui-tab-description')));
|
|
102
81
|
}, [type]);
|
|
103
|
-
|
|
82
|
+
const onTabClick = (index) => {
|
|
104
83
|
if (onTabSelected) {
|
|
105
84
|
onTabSelected(index);
|
|
106
85
|
}
|
|
107
86
|
setCurrentActiveIndex(index);
|
|
108
87
|
};
|
|
109
|
-
|
|
88
|
+
const onKeyDown = (event) => {
|
|
110
89
|
// alt + arrow keys are used by browser / assistive technologies
|
|
111
90
|
if (event.altKey) {
|
|
112
91
|
return;
|
|
113
92
|
}
|
|
114
|
-
|
|
115
|
-
|
|
93
|
+
const isTabDisabled = (index) => {
|
|
94
|
+
const tab = labels[index];
|
|
116
95
|
return React.isValidElement(tab) && tab.props.disabled;
|
|
117
96
|
};
|
|
118
|
-
|
|
97
|
+
let newIndex = focusedIndex !== null && focusedIndex !== void 0 ? focusedIndex : currentActiveIndex;
|
|
119
98
|
/** focus next tab if delta is +1, previous tab if -1 */
|
|
120
|
-
|
|
121
|
-
if (delta === void 0) { delta = +1; }
|
|
99
|
+
const focusTab = (delta = +1) => {
|
|
122
100
|
do {
|
|
123
101
|
newIndex = (newIndex + delta + labels.length) % labels.length;
|
|
124
102
|
} while (isTabDisabled(newIndex) && newIndex !== focusedIndex);
|
|
@@ -167,13 +145,13 @@ export var Tabs = function (props) {
|
|
|
167
145
|
break;
|
|
168
146
|
}
|
|
169
147
|
};
|
|
170
|
-
return (React.createElement("div", { className: cx('iui-tabs-wrapper',
|
|
171
|
-
React.createElement("ul",
|
|
148
|
+
return (React.createElement("div", { className: cx('iui-tabs-wrapper', `iui-${orientation}`, wrapperClassName), style: stripeProperties },
|
|
149
|
+
React.createElement("ul", { className: cx('iui-tabs', `iui-${type}`, {
|
|
172
150
|
'iui-green': color === 'green',
|
|
173
151
|
'iui-animated': type !== 'default',
|
|
174
152
|
'iui-large': hasSublabel,
|
|
175
|
-
}, tabsClassName), role: 'tablist', ref: refs, onKeyDown: onKeyDown
|
|
176
|
-
|
|
153
|
+
}, tabsClassName), role: 'tablist', ref: refs, onKeyDown: onKeyDown, ...rest }, labels.map((label, index) => {
|
|
154
|
+
const onClick = () => {
|
|
177
155
|
setFocusedIndex(index);
|
|
178
156
|
onTabClick(index);
|
|
179
157
|
};
|
|
@@ -185,7 +163,7 @@ export var Tabs = function (props) {
|
|
|
185
163
|
}),
|
|
186
164
|
'aria-selected': index === currentActiveIndex,
|
|
187
165
|
tabIndex: index === currentActiveIndex ? 0 : -1,
|
|
188
|
-
onClick:
|
|
166
|
+
onClick: (args) => {
|
|
189
167
|
var _a, _b;
|
|
190
168
|
onClick();
|
|
191
169
|
(_b = (_a = label.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, args);
|
|
@@ -206,7 +184,7 @@ export var Tabs = function (props) {
|
|
|
206
184
|
* ];
|
|
207
185
|
* <HorizontalTabs labels={tabs} activeIndex={1}>Tabpanel content</HorizontalTabs>
|
|
208
186
|
*/
|
|
209
|
-
export
|
|
187
|
+
export const HorizontalTabs = (props) => (React.createElement(Tabs, { orientation: 'horizontal', ...props }));
|
|
210
188
|
/**
|
|
211
189
|
* @deprecated Since v2, directly use `Tabs` with `orientation: 'vertical'`
|
|
212
190
|
*
|
|
@@ -219,5 +197,5 @@ export var HorizontalTabs = function (props) { return (React.createElement(Tabs,
|
|
|
219
197
|
* ];
|
|
220
198
|
* <VerticalTabs labels={tabs} activeIndex={1}>Tabpanel content</VerticalTabs>
|
|
221
199
|
*/
|
|
222
|
-
export
|
|
200
|
+
export const VerticalTabs = (props) => (React.createElement(Tabs, { orientation: 'vertical', ...props }));
|
|
223
201
|
export default Tabs;
|
package/esm/core/Tag/Tag.js
CHANGED
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
1
|
/*---------------------------------------------------------------------------------------------
|
|
24
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
25
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -35,13 +13,13 @@ import { IconButton } from '../Buttons';
|
|
|
35
13
|
* <Tag onRemove={() => alert('Closed a tag!')}>I'm a tag</Tag>
|
|
36
14
|
* <Tag variant='basic'>Basic tag</Tag>
|
|
37
15
|
*/
|
|
38
|
-
export
|
|
39
|
-
|
|
16
|
+
export const Tag = (props) => {
|
|
17
|
+
const { className, variant = 'default', children, onRemove, ...rest } = props;
|
|
40
18
|
useTheme();
|
|
41
|
-
return (React.createElement("span",
|
|
19
|
+
return (React.createElement("span", { className: cx({
|
|
42
20
|
'iui-tag-basic': variant === 'basic',
|
|
43
21
|
'iui-tag': variant === 'default',
|
|
44
|
-
}, className)
|
|
22
|
+
}, className), ...rest },
|
|
45
23
|
variant === 'default' ? (React.createElement("span", { className: 'iui-tag-label' }, children)) : (children),
|
|
46
24
|
onRemove && (React.createElement(IconButton, { styleType: 'borderless', size: 'small', onClick: onRemove, "aria-label": 'Delete tag', className: 'iui-tag-button' },
|
|
47
25
|
React.createElement(SvgCloseSmall, { "aria-hidden": true })))));
|