@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,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,24 +8,22 @@ exports.InputContainer = 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
|
* Input container to wrap inputs with label, and add optional message and icon.
|
|
37
15
|
* @private
|
|
38
16
|
*/
|
|
39
|
-
|
|
17
|
+
const InputContainer = (props) => {
|
|
40
18
|
var _a;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
_a['iui-with-message'] = (!!message || !!icon || !!statusMessage) && !isLabelInline,
|
|
50
|
-
_a), className), style: style }, rest),
|
|
19
|
+
const { as: Element = 'div', label, disabled, required, status, message, icon, isLabelInline, isIconInline, children, className, style, statusMessage, ...rest } = props;
|
|
20
|
+
return (react_1.default.createElement(Element, { className: (0, classnames_1.default)('iui-input-container', {
|
|
21
|
+
'iui-disabled': disabled,
|
|
22
|
+
[`iui-${status}`]: !!status,
|
|
23
|
+
'iui-inline-label': isLabelInline,
|
|
24
|
+
'iui-inline-icon': isIconInline,
|
|
25
|
+
'iui-with-message': (!!message || !!icon || !!statusMessage) && !isLabelInline,
|
|
26
|
+
}, className), style: style, ...rest },
|
|
51
27
|
label && (react_1.default.createElement("div", { className: (0, classnames_1.default)('iui-label', {
|
|
52
28
|
'iui-required': required,
|
|
53
29
|
}) }, label)),
|
|
@@ -55,7 +31,7 @@ var InputContainer = function (props) {
|
|
|
55
31
|
statusMessage ? (statusMessage) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
56
32
|
icon &&
|
|
57
33
|
react_1.default.cloneElement(icon, {
|
|
58
|
-
className: (0, classnames_1.default)('iui-input-icon', (
|
|
34
|
+
className: (0, classnames_1.default)('iui-input-icon', (_a = icon.props) === null || _a === void 0 ? void 0 : _a.className),
|
|
59
35
|
}),
|
|
60
36
|
message && !isLabelInline && (react_1.default.createElement("div", { className: 'iui-message' }, message))))));
|
|
61
37
|
};
|
|
@@ -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,9 +8,9 @@ exports.MiddleTextTruncation = 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
|
-
|
|
35
|
-
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const useOverflow_1 = require("../hooks/useOverflow");
|
|
13
|
+
const ELLIPSIS_CHAR = '…';
|
|
36
14
|
/**
|
|
37
15
|
* Truncates text with the ellipsis in the middle,
|
|
38
16
|
* leaving defined number of chars at the end.
|
|
@@ -49,19 +27,25 @@ var ELLIPSIS_CHAR = '…';
|
|
|
49
27
|
* )}
|
|
50
28
|
* />
|
|
51
29
|
*/
|
|
52
|
-
|
|
30
|
+
const MiddleTextTruncation = (props) => {
|
|
53
31
|
var _a;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
32
|
+
const { text, endCharsCount = 6, textRenderer, style, ...rest } = props;
|
|
33
|
+
const [ref, visibleCount] = (0, useOverflow_1.useOverflow)(text);
|
|
34
|
+
const truncatedText = react_1.default.useMemo(() => {
|
|
57
35
|
if (visibleCount < text.length) {
|
|
58
|
-
return
|
|
36
|
+
return `${text.substring(0, visibleCount - endCharsCount - ELLIPSIS_CHAR.length)}${ELLIPSIS_CHAR}${text.substring(text.length - endCharsCount)}`;
|
|
59
37
|
}
|
|
60
38
|
else {
|
|
61
39
|
return text;
|
|
62
40
|
}
|
|
63
41
|
}, [endCharsCount, text, visibleCount]);
|
|
64
|
-
return (react_1.default.createElement("span",
|
|
42
|
+
return (react_1.default.createElement("span", { style: {
|
|
43
|
+
display: 'flex',
|
|
44
|
+
minWidth: 0,
|
|
45
|
+
flexGrow: 1,
|
|
46
|
+
whiteSpace: 'nowrap',
|
|
47
|
+
...style,
|
|
48
|
+
}, ref: ref, ...rest }, (_a = textRenderer === null || textRenderer === void 0 ? void 0 : textRenderer(truncatedText, text)) !== null && _a !== void 0 ? _a : truncatedText));
|
|
65
49
|
};
|
|
66
50
|
exports.MiddleTextTruncation = MiddleTextTruncation;
|
|
67
51
|
exports.default = exports.MiddleTextTruncation;
|
|
@@ -26,7 +26,7 @@ export declare type PopoverProps = {
|
|
|
26
26
|
* with pre-configured props and plugins (e.g. lazy mounting, focus, etc).
|
|
27
27
|
* @private
|
|
28
28
|
*/
|
|
29
|
-
export declare const Popover: React.ForwardRefExoticComponent<Pick<PopoverProps, "disabled" | "theme" | "className" | "role" | "children" | "
|
|
29
|
+
export declare const Popover: React.ForwardRefExoticComponent<Pick<PopoverProps, "disabled" | "theme" | "className" | "role" | "children" | "placement" | "trigger" | "visible" | "content" | "render" | "animateFill" | "appendTo" | "aria" | "delay" | "duration" | "followCursor" | "getReferenceClientRect" | "hideOnClick" | "ignoreAttributes" | "inlinePositioning" | "interactive" | "interactiveBorder" | "interactiveDebounce" | "moveTransition" | "offset" | "plugins" | "popperOptions" | "showOnCreate" | "sticky" | "touch" | "triggerTarget" | "onAfterUpdate" | "onBeforeUpdate" | "onCreate" | "onDestroy" | "onHidden" | "onHide" | "onMount" | "onShow" | "onShown" | "onTrigger" | "onUntrigger" | "onClickOutside" | "allowHTML" | "animation" | "arrow" | "inertia" | "maxWidth" | "zIndex" | "singleton" | "reference"> & React.RefAttributes<unknown>>;
|
|
30
30
|
/**
|
|
31
31
|
* Plugin to hide Popover when either Esc key is pressed,
|
|
32
32
|
* or when the content inside is not tabbable and Tab key is pressed.
|
|
@@ -3,87 +3,84 @@
|
|
|
3
3
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
18
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
19
|
-
if (ar || !(i in from)) {
|
|
20
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
21
|
-
ar[i] = from[i];
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
25
|
-
};
|
|
26
6
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
7
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
8
|
};
|
|
29
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
10
|
exports.hideOnEscOrTab = exports.Popover = void 0;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
13
|
+
const react_2 = __importDefault(require("@tippyjs/react"));
|
|
14
|
+
const useMergedRefs_1 = require("../hooks/useMergedRefs");
|
|
35
15
|
require("@itwin/itwinui-css/css/utils.css");
|
|
16
|
+
const ThemeProvider_1 = require("../../ThemeProvider/ThemeProvider");
|
|
36
17
|
/**
|
|
37
18
|
* Wrapper around [tippy.js](https://atomiks.github.io/tippyjs)
|
|
38
19
|
* with pre-configured props and plugins (e.g. lazy mounting, focus, etc).
|
|
39
20
|
* @private
|
|
40
21
|
*/
|
|
41
|
-
exports.Popover = react_1.default.forwardRef(
|
|
22
|
+
exports.Popover = react_1.default.forwardRef((props, ref) => {
|
|
42
23
|
var _a;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
24
|
+
const [mounted, setMounted] = react_1.default.useState(false);
|
|
25
|
+
const themeInfo = react_1.default.useContext(ThemeProvider_1.ThemeContext);
|
|
26
|
+
const tippyRef = react_1.default.useRef(null);
|
|
27
|
+
const refs = (0, useMergedRefs_1.useMergedRefs)(tippyRef, ref);
|
|
46
28
|
// Plugin to allow lazy mounting. See https://github.com/atomiks/tippyjs-react#lazy-mounting
|
|
47
|
-
|
|
48
|
-
fn:
|
|
49
|
-
onShow:
|
|
50
|
-
onHidden:
|
|
51
|
-
})
|
|
29
|
+
const lazyLoad = {
|
|
30
|
+
fn: () => ({
|
|
31
|
+
onShow: () => setMounted(true),
|
|
32
|
+
onHidden: () => setMounted(false),
|
|
33
|
+
}),
|
|
52
34
|
};
|
|
53
35
|
// Plugin to remove tabindex from tippy, to prevent focus ring from unintentionally showing.
|
|
54
|
-
|
|
55
|
-
fn:
|
|
56
|
-
onCreate:
|
|
36
|
+
const removeTabIndex = {
|
|
37
|
+
fn: () => ({
|
|
38
|
+
onCreate: (instance) => {
|
|
57
39
|
var _a;
|
|
58
40
|
(_a = instance.popper.firstElementChild) === null || _a === void 0 ? void 0 : _a.removeAttribute('tabindex');
|
|
59
41
|
},
|
|
60
|
-
})
|
|
42
|
+
}),
|
|
61
43
|
};
|
|
62
|
-
|
|
44
|
+
const computedProps = {
|
|
45
|
+
allowHTML: true,
|
|
46
|
+
animation: false,
|
|
47
|
+
appendTo: (el) => (themeInfo === null || themeInfo === void 0 ? void 0 : themeInfo.rootRef.current) || el.ownerDocument.body,
|
|
48
|
+
arrow: false,
|
|
49
|
+
duration: 0,
|
|
50
|
+
interactive: true,
|
|
51
|
+
role: undefined,
|
|
52
|
+
offset: [0, 0],
|
|
53
|
+
maxWidth: '',
|
|
54
|
+
zIndex: 99999,
|
|
55
|
+
...props,
|
|
56
|
+
className: (0, classnames_1.default)('iui-popover', props.className),
|
|
57
|
+
plugins: [
|
|
63
58
|
lazyLoad,
|
|
64
59
|
removeTabIndex,
|
|
65
|
-
exports.hideOnEscOrTab
|
|
66
|
-
|
|
60
|
+
exports.hideOnEscOrTab,
|
|
61
|
+
...(props.plugins || []),
|
|
62
|
+
],
|
|
63
|
+
popperOptions: {
|
|
64
|
+
strategy: 'fixed',
|
|
65
|
+
...props.popperOptions,
|
|
66
|
+
modifiers: [
|
|
67
67
|
{ name: 'flip' },
|
|
68
|
-
{ name: 'preventOverflow', options: { padding: 0 } }
|
|
69
|
-
|
|
68
|
+
{ name: 'preventOverflow', options: { padding: 0 } },
|
|
69
|
+
...(((_a = props.popperOptions) === null || _a === void 0 ? void 0 : _a.modifiers) || []),
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
};
|
|
70
73
|
if (props.render) {
|
|
71
|
-
|
|
72
|
-
computedProps.render =
|
|
73
|
-
var args = [];
|
|
74
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
75
|
-
args[_i] = arguments[_i];
|
|
76
|
-
}
|
|
77
|
-
return (mounted ? render_1.apply(void 0, args) : '');
|
|
78
|
-
};
|
|
74
|
+
const render = props.render;
|
|
75
|
+
computedProps.render = (...args) => (mounted ? render(...args) : '');
|
|
79
76
|
}
|
|
80
77
|
else {
|
|
81
78
|
// Fixing issue where elements below Popover gets click events.
|
|
82
79
|
// Tippy uses react Portal, which propagates events by react tree, not dom tree.
|
|
83
80
|
// Read more: https://reactjs.org/docs/portals.html#event-bubbling-through-portals
|
|
84
|
-
|
|
81
|
+
const clonedContent = react_1.default.isValidElement(props.content)
|
|
85
82
|
? react_1.default.cloneElement(props.content, {
|
|
86
|
-
onClick:
|
|
83
|
+
onClick: (e) => {
|
|
87
84
|
var _a, _b;
|
|
88
85
|
e.stopPropagation();
|
|
89
86
|
(_b = (_a = props.content.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
@@ -92,20 +89,20 @@ exports.Popover = react_1.default.forwardRef(function (props, ref) {
|
|
|
92
89
|
: props.content;
|
|
93
90
|
computedProps.content = mounted ? clonedContent : '';
|
|
94
91
|
}
|
|
95
|
-
return react_1.default.createElement(react_2.default,
|
|
92
|
+
return react_1.default.createElement(react_2.default, { ...computedProps, ref: refs });
|
|
96
93
|
});
|
|
97
94
|
/**
|
|
98
95
|
* Plugin to hide Popover when either Esc key is pressed,
|
|
99
96
|
* or when the content inside is not tabbable and Tab key is pressed.
|
|
100
97
|
*/
|
|
101
98
|
exports.hideOnEscOrTab = {
|
|
102
|
-
fn
|
|
99
|
+
fn(instance) {
|
|
103
100
|
/** @returns true if none of the children are tabbable */
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
return !descendents.some(
|
|
101
|
+
const shouldHideOnTab = () => {
|
|
102
|
+
const descendents = Array.from(instance.popper.querySelectorAll('*'));
|
|
103
|
+
return !descendents.some((el) => (el === null || el === void 0 ? void 0 : el.tabIndex) >= 0);
|
|
107
104
|
};
|
|
108
|
-
|
|
105
|
+
const onKeyDown = (event) => {
|
|
109
106
|
switch (event.key) {
|
|
110
107
|
case 'Escape':
|
|
111
108
|
instance.hide();
|
|
@@ -119,10 +116,10 @@ exports.hideOnEscOrTab = {
|
|
|
119
116
|
}
|
|
120
117
|
};
|
|
121
118
|
return {
|
|
122
|
-
onShow
|
|
119
|
+
onShow() {
|
|
123
120
|
instance.popper.addEventListener('keydown', onKeyDown);
|
|
124
121
|
},
|
|
125
|
-
onHide
|
|
122
|
+
onHide() {
|
|
126
123
|
instance.popper.removeEventListener('keydown', onKeyDown);
|
|
127
124
|
},
|
|
128
125
|
};
|
|
@@ -8,8 +8,8 @@ exports.Resizer = void 0;
|
|
|
8
8
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
9
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
10
|
*--------------------------------------------------------------------------------------------*/
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const react_1 = __importDefault(require("react"));
|
|
12
|
+
const functions_1 = require("../functions");
|
|
13
13
|
/**
|
|
14
14
|
* Component that allows to resize parent element.
|
|
15
15
|
* Parent must have `position: relative`.
|
|
@@ -22,27 +22,27 @@ var functions_1 = require("../functions");
|
|
|
22
22
|
* </div>
|
|
23
23
|
* );
|
|
24
24
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
const Resizer = (props) => {
|
|
26
|
+
const { elementRef, containerRef, onResizeStart, onResizeEnd } = props;
|
|
27
|
+
const isResizing = react_1.default.useRef(false);
|
|
28
|
+
const onResizePointerDown = (event) => {
|
|
29
29
|
if (!elementRef.current || event.button !== 0) {
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
const initialPointerX = event.clientX;
|
|
33
|
+
const initialPointerY = event.clientY;
|
|
34
|
+
const [initialTranslateX, initialTranslateY] = (0, functions_1.getTranslateValues)(elementRef.current);
|
|
35
|
+
const { width: initialWidth, height: initialHeight, } = elementRef.current.getBoundingClientRect();
|
|
36
|
+
let width = `${initialWidth}px`;
|
|
37
|
+
let height = `${initialHeight}px`;
|
|
38
|
+
let translateX = initialTranslateX;
|
|
39
|
+
let translateY = initialTranslateY;
|
|
40
|
+
const minWidth = parseFloat(getComputedStyle(elementRef.current).minWidth);
|
|
41
|
+
const minHeight = parseFloat(getComputedStyle(elementRef.current).minHeight);
|
|
42
|
+
const resizer = event.currentTarget.dataset.iuiResizer;
|
|
43
|
+
const originalUserSelect = elementRef.current.ownerDocument.body.style.userSelect;
|
|
44
44
|
elementRef.current.ownerDocument.body.style.userSelect = 'none';
|
|
45
|
-
|
|
45
|
+
const onResizePointerMove = (event) => {
|
|
46
46
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
47
47
|
if (!elementRef.current) {
|
|
48
48
|
return;
|
|
@@ -51,77 +51,77 @@ var Resizer = function (props) {
|
|
|
51
51
|
isResizing.current = true;
|
|
52
52
|
onResizeStart === null || onResizeStart === void 0 ? void 0 : onResizeStart();
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
const containerRect = (_a = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
55
|
+
const clientX = (0, functions_1.getBoundedValue)(event.clientX, (_b = containerRect === null || containerRect === void 0 ? void 0 : containerRect.left) !== null && _b !== void 0 ? _b : 0, (_d = (_c = containerRect === null || containerRect === void 0 ? void 0 : containerRect.right) !== null && _c !== void 0 ? _c : elementRef.current.ownerDocument.documentElement.clientWidth) !== null && _d !== void 0 ? _d : 0);
|
|
56
|
+
const clientY = (0, functions_1.getBoundedValue)(event.clientY, (_e = containerRect === null || containerRect === void 0 ? void 0 : containerRect.top) !== null && _e !== void 0 ? _e : 0, (_g = (_f = containerRect === null || containerRect === void 0 ? void 0 : containerRect.bottom) !== null && _f !== void 0 ? _f : elementRef.current.ownerDocument.documentElement.clientHeight) !== null && _g !== void 0 ? _g : 0);
|
|
57
|
+
const diffX = initialPointerX - clientX;
|
|
58
|
+
const diffY = initialPointerY - clientY;
|
|
59
59
|
switch (resizer) {
|
|
60
60
|
case 'top-left': {
|
|
61
|
-
|
|
61
|
+
const newHeight = initialHeight + diffY;
|
|
62
62
|
if (newHeight >= minHeight) {
|
|
63
|
-
height = elementRef.current.style.height =
|
|
63
|
+
height = elementRef.current.style.height = `${newHeight}px`;
|
|
64
64
|
translateY = initialTranslateY - diffY;
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
const newWidth = initialWidth + diffX;
|
|
67
67
|
if (newWidth >= minWidth) {
|
|
68
|
-
width = elementRef.current.style.width =
|
|
68
|
+
width = elementRef.current.style.width = `${newWidth}px`;
|
|
69
69
|
translateX = initialTranslateX - diffX;
|
|
70
70
|
}
|
|
71
|
-
elementRef.current.style.transform =
|
|
71
|
+
elementRef.current.style.transform = `translate(${translateX}px, ${translateY}px)`;
|
|
72
72
|
break;
|
|
73
73
|
}
|
|
74
74
|
case 'top': {
|
|
75
|
-
|
|
75
|
+
const newHeight = initialHeight + diffY;
|
|
76
76
|
if (newHeight < minHeight) {
|
|
77
77
|
break;
|
|
78
78
|
}
|
|
79
|
-
height = elementRef.current.style.height =
|
|
79
|
+
height = elementRef.current.style.height = `${newHeight}px`;
|
|
80
80
|
translateY = initialTranslateY - diffY;
|
|
81
|
-
elementRef.current.style.transform =
|
|
81
|
+
elementRef.current.style.transform = `translate(${translateX}px, ${translateY}px)`;
|
|
82
82
|
break;
|
|
83
83
|
}
|
|
84
84
|
case 'top-right': {
|
|
85
|
-
|
|
85
|
+
const newHeight = initialHeight + diffY;
|
|
86
86
|
if (newHeight >= minHeight) {
|
|
87
|
-
height = elementRef.current.style.height =
|
|
87
|
+
height = elementRef.current.style.height = `${newHeight}px`;
|
|
88
88
|
translateY = initialTranslateY - diffY;
|
|
89
89
|
}
|
|
90
|
-
width = elementRef.current.style.width =
|
|
91
|
-
elementRef.current.style.transform =
|
|
90
|
+
width = elementRef.current.style.width = `${initialWidth - diffX}px`;
|
|
91
|
+
elementRef.current.style.transform = `translate(${translateX}px, ${translateY}px)`;
|
|
92
92
|
break;
|
|
93
93
|
}
|
|
94
94
|
case 'right': {
|
|
95
|
-
width = elementRef.current.style.width =
|
|
95
|
+
width = elementRef.current.style.width = `${initialWidth - diffX}px`;
|
|
96
96
|
break;
|
|
97
97
|
}
|
|
98
98
|
case 'bottom-right': {
|
|
99
|
-
width = elementRef.current.style.width =
|
|
100
|
-
height = elementRef.current.style.height =
|
|
99
|
+
width = elementRef.current.style.width = `${initialWidth - diffX}px`;
|
|
100
|
+
height = elementRef.current.style.height = `${initialHeight - diffY}px`;
|
|
101
101
|
break;
|
|
102
102
|
}
|
|
103
103
|
case 'bottom': {
|
|
104
|
-
height = elementRef.current.style.height =
|
|
104
|
+
height = elementRef.current.style.height = `${initialHeight - diffY}px`;
|
|
105
105
|
break;
|
|
106
106
|
}
|
|
107
107
|
case 'bottom-left': {
|
|
108
|
-
|
|
108
|
+
const newWidth = initialWidth + diffX;
|
|
109
109
|
if (newWidth >= minWidth) {
|
|
110
|
-
width = elementRef.current.style.width =
|
|
110
|
+
width = elementRef.current.style.width = `${newWidth}px`;
|
|
111
111
|
translateX = initialTranslateX - diffX;
|
|
112
112
|
}
|
|
113
|
-
height = elementRef.current.style.height =
|
|
114
|
-
elementRef.current.style.transform =
|
|
113
|
+
height = elementRef.current.style.height = `${initialHeight - diffY}px`;
|
|
114
|
+
elementRef.current.style.transform = `translate(${translateX}px, ${translateY}px)`;
|
|
115
115
|
break;
|
|
116
116
|
}
|
|
117
117
|
case 'left': {
|
|
118
|
-
|
|
118
|
+
const newWidth = initialWidth + diffX;
|
|
119
119
|
if (newWidth < minWidth) {
|
|
120
120
|
break;
|
|
121
121
|
}
|
|
122
|
-
width = elementRef.current.style.width =
|
|
122
|
+
width = elementRef.current.style.width = `${newWidth}px`;
|
|
123
123
|
translateX = initialTranslateX - diffX;
|
|
124
|
-
elementRef.current.style.transform =
|
|
124
|
+
elementRef.current.style.transform = `translate(${translateX}px, ${translateY}px)`;
|
|
125
125
|
break;
|
|
126
126
|
}
|
|
127
127
|
default:
|
|
@@ -129,15 +129,15 @@ var Resizer = function (props) {
|
|
|
129
129
|
}
|
|
130
130
|
};
|
|
131
131
|
elementRef.current.ownerDocument.addEventListener('pointermove', onResizePointerMove);
|
|
132
|
-
elementRef.current.ownerDocument.addEventListener('pointerup',
|
|
132
|
+
elementRef.current.ownerDocument.addEventListener('pointerup', () => {
|
|
133
133
|
document.removeEventListener('pointermove', onResizePointerMove);
|
|
134
134
|
if (elementRef.current) {
|
|
135
135
|
elementRef.current.ownerDocument.body.style.userSelect = originalUserSelect;
|
|
136
136
|
isResizing.current = false;
|
|
137
137
|
onResizeEnd === null || onResizeEnd === void 0 ? void 0 : onResizeEnd({
|
|
138
|
-
width
|
|
139
|
-
height
|
|
140
|
-
transform:
|
|
138
|
+
width,
|
|
139
|
+
height,
|
|
140
|
+
transform: `translate(${translateX}px, ${translateY}px)`,
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
}, { once: true });
|