@itwin/itwinui-react 3.0.0-dev.0 → 3.0.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/README.md +28 -22
- package/cjs/core/Alert/Alert.d.ts +47 -29
- package/cjs/core/Alert/Alert.js +73 -22
- package/cjs/core/Avatar/Avatar.d.ts +0 -1
- package/cjs/core/Avatar/Avatar.js +1 -2
- package/cjs/core/AvatarGroup/AvatarGroup.d.ts +0 -1
- package/cjs/core/AvatarGroup/AvatarGroup.js +1 -2
- package/cjs/core/Backdrop/Backdrop.d.ts +0 -1
- package/cjs/core/Backdrop/Backdrop.js +0 -1
- package/cjs/core/Badge/Badge.d.ts +0 -1
- package/cjs/core/Badge/Badge.js +0 -1
- package/cjs/core/Breadcrumbs/Breadcrumbs.d.ts +0 -1
- package/cjs/core/Breadcrumbs/Breadcrumbs.js +2 -4
- package/cjs/core/ButtonGroup/ButtonGroup.d.ts +0 -1
- package/cjs/core/ButtonGroup/ButtonGroup.js +1 -5
- package/cjs/core/Buttons/Button/Button.d.ts +0 -1
- package/cjs/core/Buttons/Button/Button.js +0 -1
- package/cjs/core/Buttons/DropdownButton/DropdownButton.d.ts +0 -1
- package/cjs/core/Buttons/DropdownButton/DropdownButton.js +3 -6
- package/cjs/core/Buttons/IconButton/IconButton.d.ts +0 -2
- package/cjs/core/Buttons/IconButton/IconButton.js +0 -2
- package/cjs/core/Buttons/SplitButton/SplitButton.d.ts +0 -1
- package/cjs/core/Buttons/SplitButton/SplitButton.js +0 -1
- package/cjs/core/Carousel/Carousel.d.ts +2 -3
- package/cjs/core/Carousel/Carousel.js +3 -6
- package/cjs/core/Carousel/CarouselDotsList.d.ts +0 -1
- package/cjs/core/Carousel/CarouselDotsList.js +8 -11
- package/cjs/core/Carousel/CarouselNavigation.d.ts +2 -2
- package/cjs/core/Carousel/CarouselNavigation.js +3 -5
- package/cjs/core/Carousel/CarouselSlider.js +10 -15
- package/cjs/core/Checkbox/Checkbox.d.ts +0 -1
- package/cjs/core/Checkbox/Checkbox.js +0 -1
- package/cjs/core/ColorPicker/ColorBuilder.d.ts +0 -1
- package/cjs/core/ColorPicker/ColorBuilder.js +7 -11
- package/cjs/core/ColorPicker/ColorInputPanel.d.ts +0 -1
- package/cjs/core/ColorPicker/ColorInputPanel.js +12 -16
- package/cjs/core/ColorPicker/ColorPalette.d.ts +0 -1
- package/cjs/core/ColorPicker/ColorPalette.js +4 -7
- package/cjs/core/ColorPicker/ColorPicker.d.ts +0 -1
- package/cjs/core/ColorPicker/ColorPicker.js +3 -4
- package/cjs/core/ColorPicker/ColorSwatch.d.ts +0 -1
- package/cjs/core/ColorPicker/ColorSwatch.js +0 -1
- package/cjs/core/ComboBox/ComboBox.d.ts +0 -1
- package/cjs/core/ComboBox/ComboBox.js +25 -33
- package/cjs/core/ComboBox/ComboBoxDropdown.js +1 -2
- package/cjs/core/ComboBox/ComboBoxEndIcon.js +1 -1
- package/cjs/core/ComboBox/ComboBoxInput.js +21 -20
- package/cjs/core/ComboBox/ComboBoxMenu.js +3 -4
- package/cjs/core/ComboBox/ComboBoxMenuItem.js +2 -2
- package/cjs/core/ComboBox/helpers.js +4 -5
- package/cjs/core/DatePicker/DatePicker.d.ts +0 -1
- package/cjs/core/DatePicker/DatePicker.js +32 -33
- package/cjs/core/Dialog/Dialog.d.ts +0 -1
- package/cjs/core/Dialog/Dialog.js +12 -5
- package/cjs/core/Dialog/DialogBackdrop.js +1 -1
- package/cjs/core/Dialog/DialogButtonBar.d.ts +0 -1
- package/cjs/core/Dialog/DialogButtonBar.js +0 -1
- package/cjs/core/Dialog/DialogContent.d.ts +0 -1
- package/cjs/core/Dialog/DialogContent.js +0 -1
- package/cjs/core/Dialog/DialogContext.d.ts +15 -0
- package/cjs/core/Dialog/DialogMain.d.ts +0 -1
- package/cjs/core/Dialog/DialogMain.js +18 -25
- package/cjs/core/Dialog/DialogTitleBar.d.ts +0 -1
- package/cjs/core/Dialog/DialogTitleBar.js +0 -1
- package/cjs/core/Dialog/DialogTitleBarTitle.d.ts +0 -1
- package/cjs/core/Dialog/DialogTitleBarTitle.js +0 -1
- package/cjs/core/DropdownMenu/DropdownMenu.js +6 -8
- package/cjs/core/ExpandableBlock/ExpandableBlock.d.ts +5 -1
- package/cjs/core/ExpandableBlock/ExpandableBlock.js +8 -6
- package/cjs/core/Fieldset/Fieldset.d.ts +0 -1
- package/cjs/core/Fieldset/Fieldset.js +0 -1
- package/cjs/core/FileUpload/FileEmptyCard.js +1 -1
- package/cjs/core/FileUpload/FileUpload.d.ts +0 -1
- package/cjs/core/FileUpload/FileUpload.js +3 -7
- package/cjs/core/FileUpload/FileUploadCard.d.ts +0 -1
- package/cjs/core/FileUpload/FileUploadCard.js +10 -12
- package/cjs/core/FileUpload/FileUploadTemplate.d.ts +0 -1
- package/cjs/core/FileUpload/FileUploadTemplate.js +0 -1
- package/cjs/core/Footer/Footer.d.ts +0 -1
- package/cjs/core/Footer/Footer.js +0 -1
- package/cjs/core/Footer/FooterItem.d.ts +0 -1
- package/cjs/core/Footer/FooterItem.js +0 -1
- package/cjs/core/Footer/FooterList.d.ts +0 -1
- package/cjs/core/Footer/FooterList.js +0 -1
- package/cjs/core/Footer/FooterSeparator.d.ts +0 -1
- package/cjs/core/Footer/FooterSeparator.js +0 -1
- package/cjs/core/Header/Header.d.ts +0 -1
- package/cjs/core/Header/Header.js +0 -1
- package/cjs/core/Header/HeaderBreadcrumbs.d.ts +0 -1
- package/cjs/core/Header/HeaderBreadcrumbs.js +0 -1
- package/cjs/core/Header/HeaderButton.d.ts +0 -1
- package/cjs/core/Header/HeaderButton.js +0 -1
- package/cjs/core/Header/HeaderLogo.d.ts +0 -1
- package/cjs/core/Header/HeaderLogo.js +0 -1
- package/cjs/core/InformationPanel/InformationPanel.d.ts +0 -1
- package/cjs/core/InformationPanel/InformationPanel.js +1 -5
- package/cjs/core/InformationPanel/InformationPanelBody.d.ts +0 -1
- package/cjs/core/InformationPanel/InformationPanelBody.js +0 -1
- package/cjs/core/InformationPanel/InformationPanelContent.d.ts +0 -1
- package/cjs/core/InformationPanel/InformationPanelContent.js +0 -1
- package/cjs/core/InformationPanel/InformationPanelHeader.d.ts +0 -1
- package/cjs/core/InformationPanel/InformationPanelHeader.js +0 -1
- package/cjs/core/InformationPanel/InformationPanelWrapper.d.ts +0 -1
- package/cjs/core/InformationPanel/InformationPanelWrapper.js +0 -1
- package/cjs/core/Input/Input.d.ts +0 -1
- package/cjs/core/Input/Input.js +0 -1
- package/cjs/core/InputGroup/InputGroup.d.ts +0 -1
- package/cjs/core/InputGroup/InputGroup.js +0 -1
- package/cjs/core/Label/Label.d.ts +0 -1
- package/cjs/core/Label/Label.js +0 -1
- package/cjs/core/LabeledInput/LabeledInput.d.ts +0 -1
- package/cjs/core/LabeledInput/LabeledInput.js +1 -2
- package/cjs/core/LabeledSelect/LabeledSelect.d.ts +0 -1
- package/cjs/core/LabeledSelect/LabeledSelect.js +0 -1
- package/cjs/core/LabeledTextarea/LabeledTextarea.d.ts +0 -1
- package/cjs/core/LabeledTextarea/LabeledTextarea.js +1 -2
- package/cjs/core/List/List.d.ts +0 -1
- package/cjs/core/List/List.js +0 -1
- package/cjs/core/List/ListItem.d.ts +0 -1
- package/cjs/core/List/ListItem.js +0 -1
- package/cjs/core/Menu/Menu.d.ts +0 -1
- package/cjs/core/Menu/Menu.js +3 -5
- package/cjs/core/Menu/MenuDivider.d.ts +0 -1
- package/cjs/core/Menu/MenuDivider.js +0 -1
- package/cjs/core/Menu/MenuExtraContent.d.ts +0 -1
- package/cjs/core/Menu/MenuExtraContent.js +0 -1
- package/cjs/core/Menu/MenuItem.d.ts +0 -1
- package/cjs/core/Menu/MenuItem.js +8 -12
- package/cjs/core/Menu/MenuItemSkeleton.d.ts +0 -1
- package/cjs/core/Menu/MenuItemSkeleton.js +0 -1
- package/cjs/core/Modal/Modal.d.ts +8 -10
- package/cjs/core/Modal/Modal.js +7 -18
- package/cjs/core/NonIdealState/NonIdealState.d.ts +0 -1
- package/cjs/core/NonIdealState/NonIdealState.js +0 -1
- package/cjs/core/NotificationMarker/NotificationMarker.d.ts +0 -1
- package/cjs/core/NotificationMarker/NotificationMarker.js +0 -1
- package/cjs/core/ProgressIndicators/ProgressLinear/ProgressLinear.d.ts +0 -1
- package/cjs/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +0 -1
- package/cjs/core/ProgressIndicators/ProgressRadial/ProgressRadial.d.ts +0 -1
- package/cjs/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +0 -1
- package/cjs/core/Radio/Radio.d.ts +0 -1
- package/cjs/core/Radio/Radio.js +0 -1
- package/cjs/core/RadioTiles/RadioTile.d.ts +0 -1
- package/cjs/core/RadioTiles/RadioTile.js +0 -1
- package/cjs/core/RadioTiles/RadioTileGroup.d.ts +0 -1
- package/cjs/core/RadioTiles/RadioTileGroup.js +0 -1
- package/cjs/core/SearchBox/SearchBox.d.ts +0 -1
- package/cjs/core/SearchBox/SearchBox.js +12 -13
- package/cjs/core/Select/Select.d.ts +0 -1
- package/cjs/core/Select/Select.js +12 -18
- package/cjs/core/Select/SelectTag.d.ts +0 -1
- package/cjs/core/Select/SelectTag.js +0 -1
- package/cjs/core/SideNavigation/SideNavigation.d.ts +0 -1
- package/cjs/core/SideNavigation/SideNavigation.js +2 -3
- package/cjs/core/SideNavigation/SidenavButton.d.ts +0 -1
- package/cjs/core/SideNavigation/SidenavButton.js +0 -1
- package/cjs/core/SideNavigation/SidenavSubmenu.d.ts +0 -1
- package/cjs/core/SideNavigation/SidenavSubmenu.js +0 -1
- package/cjs/core/SideNavigation/SidenavSubmenuHeader.d.ts +0 -1
- package/cjs/core/SideNavigation/SidenavSubmenuHeader.js +0 -1
- package/cjs/core/SkipToContentLink/SkipToContentLink.d.ts +0 -1
- package/cjs/core/SkipToContentLink/SkipToContentLink.js +0 -1
- package/cjs/core/Slider/Slider.d.ts +0 -1
- package/cjs/core/Slider/Slider.js +16 -20
- package/cjs/core/Slider/Thumb.js +1 -1
- package/cjs/core/Slider/Track.js +2 -1
- package/cjs/core/StatusMessage/StatusMessage.js +1 -1
- package/cjs/core/Stepper/Stepper.d.ts +0 -1
- package/cjs/core/Stepper/Stepper.js +1 -2
- package/cjs/core/Stepper/StepperStep.js +1 -1
- package/cjs/core/Stepper/WorkflowDiagram.d.ts +0 -1
- package/cjs/core/Stepper/WorkflowDiagram.js +0 -1
- package/cjs/core/Surface/Surface.d.ts +0 -1
- package/cjs/core/Surface/Surface.js +0 -1
- package/cjs/core/Table/Table.d.ts +0 -1
- package/cjs/core/Table/Table.js +33 -34
- package/cjs/core/Table/TableCell.js +3 -2
- package/cjs/core/Table/TablePaginator.d.ts +0 -1
- package/cjs/core/Table/TablePaginator.js +10 -12
- package/cjs/core/Table/TableRowMemoized.js +40 -47
- package/cjs/core/Table/actionHandlers/expandHandler.js +3 -3
- package/cjs/core/Table/actionHandlers/filterHandler.js +4 -5
- package/cjs/core/Table/actionHandlers/selectHandler.js +6 -6
- package/cjs/core/Table/cells/DefaultCell.js +4 -3
- package/cjs/core/Table/cells/EditableCell.js +7 -13
- package/cjs/core/Table/columns/actionColumn.js +3 -6
- package/cjs/core/Table/columns/expanderColumn.js +3 -3
- package/cjs/core/Table/columns/selectionColumn.js +4 -4
- package/cjs/core/Table/filters/BaseFilter.d.ts +0 -1
- package/cjs/core/Table/filters/BaseFilter.js +1 -2
- package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +2 -4
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +0 -1
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -4
- package/cjs/core/Table/filters/FilterButtonBar.d.ts +0 -1
- package/cjs/core/Table/filters/FilterButtonBar.js +1 -2
- package/cjs/core/Table/filters/FilterToggle.d.ts +0 -1
- package/cjs/core/Table/filters/FilterToggle.js +0 -1
- package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.d.ts +0 -1
- package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +2 -4
- package/cjs/core/Table/filters/TextFilter/TextFilter.d.ts +0 -1
- package/cjs/core/Table/filters/TextFilter/TextFilter.js +1 -3
- package/cjs/core/Table/hooks/useColumnDragAndDrop.js +8 -4
- package/cjs/core/Table/hooks/useResizeColumns.js +16 -22
- package/cjs/core/Table/hooks/useScrollToRow.js +1 -2
- package/cjs/core/Table/hooks/useStickyColumns.js +3 -5
- package/cjs/core/Table/hooks/useSubRowFiltering.js +2 -4
- package/cjs/core/Tabs/Tab.d.ts +0 -1
- package/cjs/core/Tabs/Tab.js +0 -1
- package/cjs/core/Tabs/Tabs.d.ts +0 -1
- package/cjs/core/Tabs/Tabs.js +16 -19
- package/cjs/core/Tag/Tag.d.ts +0 -1
- package/cjs/core/Tag/Tag.js +0 -1
- package/cjs/core/Tag/TagContainer.d.ts +0 -1
- package/cjs/core/Tag/TagContainer.js +0 -1
- package/cjs/core/Textarea/Textarea.d.ts +0 -1
- package/cjs/core/Textarea/Textarea.js +0 -1
- package/cjs/core/ThemeProvider/ThemeContext.d.ts +1 -1
- package/cjs/core/ThemeProvider/ThemeProvider.d.ts +2 -5
- package/cjs/core/ThemeProvider/ThemeProvider.js +11 -15
- package/cjs/core/Tile/Tile.d.ts +0 -1
- package/cjs/core/Tile/Tile.js +3 -7
- package/cjs/core/TimePicker/TimePicker.d.ts +0 -1
- package/cjs/core/TimePicker/TimePicker.js +13 -14
- package/cjs/core/Toast/Toast.d.ts +0 -1
- package/cjs/core/Toast/Toast.js +2 -4
- package/cjs/core/Toast/ToastWrapper.d.ts +0 -1
- package/cjs/core/Toast/ToastWrapper.js +0 -1
- package/cjs/core/Toast/Toaster.js +6 -11
- package/cjs/core/ToggleSwitch/ToggleSwitch.d.ts +0 -1
- package/cjs/core/ToggleSwitch/ToggleSwitch.js +1 -3
- package/cjs/core/Tooltip/Tooltip.d.ts +0 -1
- package/cjs/core/Tooltip/Tooltip.js +0 -1
- package/cjs/core/TransferList/TransferList.d.ts +69 -0
- package/cjs/core/TransferList/TransferList.js +147 -0
- package/cjs/core/TransferList/index.d.ts +3 -0
- package/cjs/core/TransferList/index.js +10 -0
- package/cjs/core/Tree/Tree.d.ts +0 -1
- package/cjs/core/Tree/Tree.js +9 -14
- package/cjs/core/Tree/TreeNode.d.ts +0 -1
- package/cjs/core/Tree/TreeNode.js +9 -11
- package/cjs/core/Tree/TreeNodeExpander.d.ts +0 -1
- package/cjs/core/Tree/TreeNodeExpander.js +0 -1
- package/cjs/core/Typography/Anchor/Anchor.d.ts +0 -1
- package/cjs/core/Typography/Anchor/Anchor.js +0 -1
- package/cjs/core/Typography/Blockquote/Blockquote.d.ts +0 -1
- package/cjs/core/Typography/Blockquote/Blockquote.js +0 -1
- package/cjs/core/Typography/Code/Code.d.ts +0 -1
- package/cjs/core/Typography/Code/Code.js +0 -1
- package/cjs/core/Typography/Kbd/Kbd.d.ts +0 -1
- package/cjs/core/Typography/Kbd/Kbd.js +0 -1
- package/cjs/core/Typography/Text/Text.d.ts +0 -1
- package/cjs/core/Typography/Text/Text.js +0 -1
- package/cjs/core/index.d.ts +1 -0
- package/cjs/core/index.js +118 -116
- package/cjs/core/utils/color/ColorValue.js +9 -15
- package/cjs/core/utils/components/AutoclearingHiddenLiveRegion.js +2 -3
- package/cjs/core/utils/components/Divider.d.ts +0 -1
- package/cjs/core/utils/components/Divider.js +0 -1
- package/cjs/core/utils/components/Flex.d.ts +0 -1
- package/cjs/core/utils/components/Flex.js +0 -1
- package/cjs/core/utils/components/FocusTrap.js +4 -4
- package/cjs/core/utils/components/Icon.d.ts +0 -1
- package/cjs/core/utils/components/Icon.js +0 -1
- package/cjs/core/utils/components/InputContainer.d.ts +0 -1
- package/cjs/core/utils/components/InputContainer.js +0 -1
- package/cjs/core/utils/components/InputFlexContainer.d.ts +0 -1
- package/cjs/core/utils/components/InputFlexContainer.js +0 -1
- package/cjs/core/utils/components/LinkAction.d.ts +0 -1
- package/cjs/core/utils/components/LinkAction.js +0 -1
- package/cjs/core/utils/components/MiddleTextTruncation.js +1 -2
- package/cjs/core/utils/components/Popover.d.ts +0 -1
- package/cjs/core/utils/components/Popover.js +5 -9
- package/cjs/core/utils/components/Resizer.js +7 -6
- package/cjs/core/utils/components/VirtualScroll.js +14 -21
- package/cjs/core/utils/components/VisuallyHidden.d.ts +0 -1
- package/cjs/core/utils/components/VisuallyHidden.js +0 -1
- package/cjs/core/utils/functions/dom.d.ts +6 -0
- package/cjs/core/utils/functions/dom.js +24 -6
- package/cjs/core/utils/functions/index.d.ts +0 -1
- package/cjs/core/utils/functions/index.js +0 -1
- package/cjs/core/utils/functions/polymorphic.js +9 -1
- package/cjs/core/utils/functions/supports.js +1 -1
- package/cjs/core/utils/hooks/index.d.ts +0 -1
- package/cjs/core/utils/hooks/index.js +0 -1
- package/cjs/core/utils/hooks/useContainerWidth.js +1 -1
- package/cjs/core/utils/hooks/useDragAndDrop.js +8 -10
- package/cjs/core/utils/hooks/useEventListener.js +1 -1
- package/cjs/core/utils/hooks/useGlobals.d.ts +9 -4
- package/cjs/core/utils/hooks/useGlobals.js +6 -6
- package/cjs/core/utils/hooks/useId.js +1 -2
- package/cjs/core/utils/hooks/useIntersection.js +2 -3
- package/cjs/core/utils/hooks/useMediaQuery.js +6 -8
- package/cjs/core/utils/hooks/useOverflow.js +1 -2
- package/cjs/core/utils/hooks/useResizeObserver.js +3 -4
- package/cjs/styles.d.ts +5 -0
- package/cjs/styles.js +450 -0
- package/esm/core/Alert/Alert.d.ts +47 -29
- package/esm/core/Alert/Alert.js +74 -23
- package/esm/core/Avatar/Avatar.d.ts +0 -1
- package/esm/core/Avatar/Avatar.js +1 -2
- package/esm/core/AvatarGroup/AvatarGroup.d.ts +0 -1
- package/esm/core/AvatarGroup/AvatarGroup.js +1 -2
- package/esm/core/Backdrop/Backdrop.d.ts +0 -1
- package/esm/core/Backdrop/Backdrop.js +0 -1
- package/esm/core/Badge/Badge.d.ts +0 -1
- package/esm/core/Badge/Badge.js +0 -1
- package/esm/core/Breadcrumbs/Breadcrumbs.d.ts +0 -1
- package/esm/core/Breadcrumbs/Breadcrumbs.js +2 -4
- package/esm/core/ButtonGroup/ButtonGroup.d.ts +0 -1
- package/esm/core/ButtonGroup/ButtonGroup.js +1 -5
- package/esm/core/Buttons/Button/Button.d.ts +0 -1
- package/esm/core/Buttons/Button/Button.js +0 -1
- package/esm/core/Buttons/DropdownButton/DropdownButton.d.ts +0 -1
- package/esm/core/Buttons/DropdownButton/DropdownButton.js +3 -6
- package/esm/core/Buttons/IconButton/IconButton.d.ts +0 -2
- package/esm/core/Buttons/IconButton/IconButton.js +0 -2
- package/esm/core/Buttons/SplitButton/SplitButton.d.ts +0 -1
- package/esm/core/Buttons/SplitButton/SplitButton.js +0 -1
- package/esm/core/Carousel/Carousel.d.ts +2 -3
- package/esm/core/Carousel/Carousel.js +3 -6
- package/esm/core/Carousel/CarouselDotsList.d.ts +0 -1
- package/esm/core/Carousel/CarouselDotsList.js +8 -11
- package/esm/core/Carousel/CarouselNavigation.d.ts +2 -2
- package/esm/core/Carousel/CarouselNavigation.js +3 -5
- package/esm/core/Carousel/CarouselSlider.js +10 -15
- package/esm/core/Checkbox/Checkbox.d.ts +0 -1
- package/esm/core/Checkbox/Checkbox.js +0 -1
- package/esm/core/ColorPicker/ColorBuilder.d.ts +0 -1
- package/esm/core/ColorPicker/ColorBuilder.js +7 -11
- package/esm/core/ColorPicker/ColorInputPanel.d.ts +0 -1
- package/esm/core/ColorPicker/ColorInputPanel.js +12 -16
- package/esm/core/ColorPicker/ColorPalette.d.ts +0 -1
- package/esm/core/ColorPicker/ColorPalette.js +4 -7
- package/esm/core/ColorPicker/ColorPicker.d.ts +0 -1
- package/esm/core/ColorPicker/ColorPicker.js +3 -4
- package/esm/core/ColorPicker/ColorSwatch.d.ts +0 -1
- package/esm/core/ColorPicker/ColorSwatch.js +0 -1
- package/esm/core/ComboBox/ComboBox.d.ts +0 -1
- package/esm/core/ComboBox/ComboBox.js +25 -33
- package/esm/core/ComboBox/ComboBoxDropdown.js +1 -2
- package/esm/core/ComboBox/ComboBoxEndIcon.js +1 -1
- package/esm/core/ComboBox/ComboBoxInput.js +21 -20
- package/esm/core/ComboBox/ComboBoxMenu.js +3 -4
- package/esm/core/ComboBox/ComboBoxMenuItem.js +2 -2
- package/esm/core/ComboBox/helpers.js +4 -5
- package/esm/core/DatePicker/DatePicker.d.ts +0 -1
- package/esm/core/DatePicker/DatePicker.js +32 -33
- package/esm/core/Dialog/Dialog.d.ts +0 -1
- package/esm/core/Dialog/Dialog.js +13 -6
- package/esm/core/Dialog/DialogBackdrop.js +1 -1
- package/esm/core/Dialog/DialogButtonBar.d.ts +0 -1
- package/esm/core/Dialog/DialogButtonBar.js +0 -1
- package/esm/core/Dialog/DialogContent.d.ts +0 -1
- package/esm/core/Dialog/DialogContent.js +0 -1
- package/esm/core/Dialog/DialogContext.d.ts +15 -0
- package/esm/core/Dialog/DialogMain.d.ts +0 -1
- package/esm/core/Dialog/DialogMain.js +18 -25
- package/esm/core/Dialog/DialogTitleBar.d.ts +0 -1
- package/esm/core/Dialog/DialogTitleBar.js +0 -1
- package/esm/core/Dialog/DialogTitleBarTitle.d.ts +0 -1
- package/esm/core/Dialog/DialogTitleBarTitle.js +0 -1
- package/esm/core/DropdownMenu/DropdownMenu.js +6 -8
- package/esm/core/ExpandableBlock/ExpandableBlock.d.ts +5 -1
- package/esm/core/ExpandableBlock/ExpandableBlock.js +8 -6
- package/esm/core/Fieldset/Fieldset.d.ts +0 -1
- package/esm/core/Fieldset/Fieldset.js +0 -1
- package/esm/core/FileUpload/FileEmptyCard.js +1 -1
- package/esm/core/FileUpload/FileUpload.d.ts +0 -1
- package/esm/core/FileUpload/FileUpload.js +3 -7
- package/esm/core/FileUpload/FileUploadCard.d.ts +0 -1
- package/esm/core/FileUpload/FileUploadCard.js +10 -12
- package/esm/core/FileUpload/FileUploadTemplate.d.ts +0 -1
- package/esm/core/FileUpload/FileUploadTemplate.js +0 -1
- package/esm/core/Footer/Footer.d.ts +0 -1
- package/esm/core/Footer/Footer.js +0 -1
- package/esm/core/Footer/FooterItem.d.ts +0 -1
- package/esm/core/Footer/FooterItem.js +0 -1
- package/esm/core/Footer/FooterList.d.ts +0 -1
- package/esm/core/Footer/FooterList.js +0 -1
- package/esm/core/Footer/FooterSeparator.d.ts +0 -1
- package/esm/core/Footer/FooterSeparator.js +0 -1
- package/esm/core/Header/Header.d.ts +0 -1
- package/esm/core/Header/Header.js +0 -1
- package/esm/core/Header/HeaderBreadcrumbs.d.ts +0 -1
- package/esm/core/Header/HeaderBreadcrumbs.js +0 -1
- package/esm/core/Header/HeaderButton.d.ts +0 -1
- package/esm/core/Header/HeaderButton.js +0 -1
- package/esm/core/Header/HeaderLogo.d.ts +0 -1
- package/esm/core/Header/HeaderLogo.js +0 -1
- package/esm/core/InformationPanel/InformationPanel.d.ts +0 -1
- package/esm/core/InformationPanel/InformationPanel.js +1 -5
- package/esm/core/InformationPanel/InformationPanelBody.d.ts +0 -1
- package/esm/core/InformationPanel/InformationPanelBody.js +0 -1
- package/esm/core/InformationPanel/InformationPanelContent.d.ts +0 -1
- package/esm/core/InformationPanel/InformationPanelContent.js +0 -1
- package/esm/core/InformationPanel/InformationPanelHeader.d.ts +0 -1
- package/esm/core/InformationPanel/InformationPanelHeader.js +0 -1
- package/esm/core/InformationPanel/InformationPanelWrapper.d.ts +0 -1
- package/esm/core/InformationPanel/InformationPanelWrapper.js +0 -1
- package/esm/core/Input/Input.d.ts +0 -1
- package/esm/core/Input/Input.js +0 -1
- package/esm/core/InputGroup/InputGroup.d.ts +0 -1
- package/esm/core/InputGroup/InputGroup.js +0 -1
- package/esm/core/Label/Label.d.ts +0 -1
- package/esm/core/Label/Label.js +0 -1
- package/esm/core/LabeledInput/LabeledInput.d.ts +0 -1
- package/esm/core/LabeledInput/LabeledInput.js +1 -2
- package/esm/core/LabeledSelect/LabeledSelect.d.ts +0 -1
- package/esm/core/LabeledSelect/LabeledSelect.js +0 -1
- package/esm/core/LabeledTextarea/LabeledTextarea.d.ts +0 -1
- package/esm/core/LabeledTextarea/LabeledTextarea.js +1 -2
- package/esm/core/List/List.d.ts +0 -1
- package/esm/core/List/List.js +0 -1
- package/esm/core/List/ListItem.d.ts +0 -1
- package/esm/core/List/ListItem.js +0 -1
- package/esm/core/Menu/Menu.d.ts +0 -1
- package/esm/core/Menu/Menu.js +3 -5
- package/esm/core/Menu/MenuDivider.d.ts +0 -1
- package/esm/core/Menu/MenuDivider.js +0 -1
- package/esm/core/Menu/MenuExtraContent.d.ts +0 -1
- package/esm/core/Menu/MenuExtraContent.js +0 -1
- package/esm/core/Menu/MenuItem.d.ts +0 -1
- package/esm/core/Menu/MenuItem.js +8 -12
- package/esm/core/Menu/MenuItemSkeleton.d.ts +0 -1
- package/esm/core/Menu/MenuItemSkeleton.js +0 -1
- package/esm/core/Modal/Modal.d.ts +8 -10
- package/esm/core/Modal/Modal.js +3 -11
- package/esm/core/NonIdealState/NonIdealState.d.ts +0 -1
- package/esm/core/NonIdealState/NonIdealState.js +0 -1
- package/esm/core/NotificationMarker/NotificationMarker.d.ts +0 -1
- package/esm/core/NotificationMarker/NotificationMarker.js +0 -1
- package/esm/core/ProgressIndicators/ProgressLinear/ProgressLinear.d.ts +0 -1
- package/esm/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +0 -1
- package/esm/core/ProgressIndicators/ProgressRadial/ProgressRadial.d.ts +0 -1
- package/esm/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +0 -1
- package/esm/core/Radio/Radio.d.ts +0 -1
- package/esm/core/Radio/Radio.js +0 -1
- package/esm/core/RadioTiles/RadioTile.d.ts +0 -1
- package/esm/core/RadioTiles/RadioTile.js +0 -1
- package/esm/core/RadioTiles/RadioTileGroup.d.ts +0 -1
- package/esm/core/RadioTiles/RadioTileGroup.js +0 -1
- package/esm/core/SearchBox/SearchBox.d.ts +0 -1
- package/esm/core/SearchBox/SearchBox.js +12 -13
- package/esm/core/Select/Select.d.ts +0 -1
- package/esm/core/Select/Select.js +12 -18
- package/esm/core/Select/SelectTag.d.ts +0 -1
- package/esm/core/Select/SelectTag.js +0 -1
- package/esm/core/SideNavigation/SideNavigation.d.ts +0 -1
- package/esm/core/SideNavigation/SideNavigation.js +2 -3
- package/esm/core/SideNavigation/SidenavButton.d.ts +0 -1
- package/esm/core/SideNavigation/SidenavButton.js +0 -1
- package/esm/core/SideNavigation/SidenavSubmenu.d.ts +0 -1
- package/esm/core/SideNavigation/SidenavSubmenu.js +0 -1
- package/esm/core/SideNavigation/SidenavSubmenuHeader.d.ts +0 -1
- package/esm/core/SideNavigation/SidenavSubmenuHeader.js +0 -1
- package/esm/core/SkipToContentLink/SkipToContentLink.d.ts +0 -1
- package/esm/core/SkipToContentLink/SkipToContentLink.js +0 -1
- package/esm/core/Slider/Slider.d.ts +0 -1
- package/esm/core/Slider/Slider.js +16 -20
- package/esm/core/Slider/Thumb.js +1 -1
- package/esm/core/Slider/Track.js +2 -1
- package/esm/core/StatusMessage/StatusMessage.js +1 -1
- package/esm/core/Stepper/Stepper.d.ts +0 -1
- package/esm/core/Stepper/Stepper.js +1 -2
- package/esm/core/Stepper/StepperStep.js +1 -1
- package/esm/core/Stepper/WorkflowDiagram.d.ts +0 -1
- package/esm/core/Stepper/WorkflowDiagram.js +0 -1
- package/esm/core/Surface/Surface.d.ts +0 -1
- package/esm/core/Surface/Surface.js +0 -1
- package/esm/core/Table/Table.d.ts +0 -1
- package/esm/core/Table/Table.js +34 -35
- package/esm/core/Table/TableCell.js +3 -2
- package/esm/core/Table/TablePaginator.d.ts +0 -1
- package/esm/core/Table/TablePaginator.js +11 -13
- package/esm/core/Table/TableRowMemoized.js +41 -48
- package/esm/core/Table/actionHandlers/expandHandler.js +3 -3
- package/esm/core/Table/actionHandlers/filterHandler.js +4 -5
- package/esm/core/Table/actionHandlers/selectHandler.js +6 -6
- package/esm/core/Table/cells/DefaultCell.js +4 -3
- package/esm/core/Table/cells/EditableCell.js +8 -14
- package/esm/core/Table/columns/actionColumn.js +3 -6
- package/esm/core/Table/columns/expanderColumn.js +3 -3
- package/esm/core/Table/columns/selectionColumn.js +4 -4
- package/esm/core/Table/filters/BaseFilter.d.ts +0 -1
- package/esm/core/Table/filters/BaseFilter.js +2 -3
- package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +2 -4
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +0 -1
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -4
- package/esm/core/Table/filters/FilterButtonBar.d.ts +0 -1
- package/esm/core/Table/filters/FilterButtonBar.js +2 -3
- package/esm/core/Table/filters/FilterToggle.d.ts +0 -1
- package/esm/core/Table/filters/FilterToggle.js +0 -1
- package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.d.ts +0 -1
- package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +2 -4
- package/esm/core/Table/filters/TextFilter/TextFilter.d.ts +0 -1
- package/esm/core/Table/filters/TextFilter/TextFilter.js +1 -3
- package/esm/core/Table/hooks/useColumnDragAndDrop.js +5 -4
- package/esm/core/Table/hooks/useResizeColumns.js +16 -22
- package/esm/core/Table/hooks/useScrollToRow.js +1 -2
- package/esm/core/Table/hooks/useStickyColumns.js +3 -5
- package/esm/core/Table/hooks/useSubRowFiltering.js +2 -4
- package/esm/core/Tabs/Tab.d.ts +0 -1
- package/esm/core/Tabs/Tab.js +0 -1
- package/esm/core/Tabs/Tabs.d.ts +0 -1
- package/esm/core/Tabs/Tabs.js +16 -19
- package/esm/core/Tag/Tag.d.ts +0 -1
- package/esm/core/Tag/Tag.js +0 -1
- package/esm/core/Tag/TagContainer.d.ts +0 -1
- package/esm/core/Tag/TagContainer.js +0 -1
- package/esm/core/Textarea/Textarea.d.ts +0 -1
- package/esm/core/Textarea/Textarea.js +0 -1
- package/esm/core/ThemeProvider/ThemeContext.d.ts +1 -1
- package/esm/core/ThemeProvider/ThemeProvider.d.ts +2 -5
- package/esm/core/ThemeProvider/ThemeProvider.js +12 -16
- package/esm/core/Tile/Tile.d.ts +0 -1
- package/esm/core/Tile/Tile.js +3 -7
- package/esm/core/TimePicker/TimePicker.d.ts +0 -1
- package/esm/core/TimePicker/TimePicker.js +13 -14
- package/esm/core/Toast/Toast.d.ts +0 -1
- package/esm/core/Toast/Toast.js +2 -4
- package/esm/core/Toast/ToastWrapper.d.ts +0 -1
- package/esm/core/Toast/ToastWrapper.js +0 -1
- package/esm/core/Toast/Toaster.js +6 -11
- package/esm/core/ToggleSwitch/ToggleSwitch.d.ts +0 -1
- package/esm/core/ToggleSwitch/ToggleSwitch.js +1 -3
- package/esm/core/Tooltip/Tooltip.d.ts +0 -1
- package/esm/core/Tooltip/Tooltip.js +0 -1
- package/esm/core/TransferList/TransferList.d.ts +69 -0
- package/esm/core/TransferList/TransferList.js +141 -0
- package/esm/core/TransferList/index.d.ts +3 -0
- package/esm/core/TransferList/index.js +6 -0
- package/esm/core/Tree/Tree.d.ts +0 -1
- package/esm/core/Tree/Tree.js +9 -14
- package/esm/core/Tree/TreeNode.d.ts +0 -1
- package/esm/core/Tree/TreeNode.js +9 -11
- package/esm/core/Tree/TreeNodeExpander.d.ts +0 -1
- package/esm/core/Tree/TreeNodeExpander.js +0 -1
- package/esm/core/Typography/Anchor/Anchor.d.ts +0 -1
- package/esm/core/Typography/Anchor/Anchor.js +0 -1
- package/esm/core/Typography/Blockquote/Blockquote.d.ts +0 -1
- package/esm/core/Typography/Blockquote/Blockquote.js +0 -1
- package/esm/core/Typography/Code/Code.d.ts +0 -1
- package/esm/core/Typography/Code/Code.js +0 -1
- package/esm/core/Typography/Kbd/Kbd.d.ts +0 -1
- package/esm/core/Typography/Kbd/Kbd.js +0 -1
- package/esm/core/Typography/Text/Text.d.ts +0 -1
- package/esm/core/Typography/Text/Text.js +0 -1
- package/esm/core/index.d.ts +1 -0
- package/esm/core/index.js +1 -0
- package/esm/core/utils/color/ColorValue.js +9 -15
- package/esm/core/utils/components/AutoclearingHiddenLiveRegion.js +2 -3
- package/esm/core/utils/components/Divider.d.ts +0 -1
- package/esm/core/utils/components/Divider.js +0 -1
- package/esm/core/utils/components/Flex.d.ts +0 -1
- package/esm/core/utils/components/Flex.js +0 -1
- package/esm/core/utils/components/FocusTrap.js +4 -4
- package/esm/core/utils/components/Icon.d.ts +0 -1
- package/esm/core/utils/components/Icon.js +0 -1
- package/esm/core/utils/components/InputContainer.d.ts +0 -1
- package/esm/core/utils/components/InputContainer.js +0 -1
- package/esm/core/utils/components/InputFlexContainer.d.ts +0 -1
- package/esm/core/utils/components/InputFlexContainer.js +0 -1
- package/esm/core/utils/components/LinkAction.d.ts +0 -1
- package/esm/core/utils/components/LinkAction.js +0 -1
- package/esm/core/utils/components/MiddleTextTruncation.js +1 -2
- package/esm/core/utils/components/Popover.d.ts +0 -1
- package/esm/core/utils/components/Popover.js +5 -9
- package/esm/core/utils/components/Resizer.js +7 -6
- package/esm/core/utils/components/VirtualScroll.js +14 -21
- package/esm/core/utils/components/VisuallyHidden.d.ts +0 -1
- package/esm/core/utils/components/VisuallyHidden.js +0 -1
- package/esm/core/utils/functions/dom.d.ts +6 -0
- package/esm/core/utils/functions/dom.js +19 -5
- package/esm/core/utils/functions/index.d.ts +0 -1
- package/esm/core/utils/functions/index.js +0 -1
- package/esm/core/utils/functions/polymorphic.js +9 -1
- package/esm/core/utils/functions/supports.js +1 -1
- package/esm/core/utils/hooks/index.d.ts +0 -1
- package/esm/core/utils/hooks/index.js +0 -1
- package/esm/core/utils/hooks/useContainerWidth.js +1 -1
- package/esm/core/utils/hooks/useDragAndDrop.js +8 -10
- package/esm/core/utils/hooks/useEventListener.js +1 -1
- package/esm/core/utils/hooks/useGlobals.d.ts +9 -4
- package/esm/core/utils/hooks/useGlobals.js +6 -6
- package/esm/core/utils/hooks/useId.js +1 -2
- package/esm/core/utils/hooks/useIntersection.js +2 -3
- package/esm/core/utils/hooks/useMediaQuery.js +6 -8
- package/esm/core/utils/hooks/useOverflow.js +1 -2
- package/esm/core/utils/hooks/useResizeObserver.js +3 -4
- package/esm/styles.d.ts +5 -0
- package/esm/styles.js +451 -0
- package/package.json +14 -11
- package/styles.css +1940 -0
- package/cjs/core/utils/functions/styles.d.ts +0 -6
- package/cjs/core/utils/functions/styles.js +0 -21
- package/cjs/core/utils/hooks/useIsThemeAlreadySet.d.ts +0 -7
- package/cjs/core/utils/hooks/useIsThemeAlreadySet.js +0 -54
- package/esm/core/utils/functions/styles.d.ts +0 -6
- package/esm/core/utils/functions/styles.js +0 -17
- package/esm/core/utils/hooks/useIsThemeAlreadySet.d.ts +0 -7
- package/esm/core/utils/hooks/useIsThemeAlreadySet.js +0 -27
|
@@ -6,7 +6,6 @@ import * as React from 'react';
|
|
|
6
6
|
import cx from 'classnames';
|
|
7
7
|
import { SvgChevronRight } from '../utils/index.js';
|
|
8
8
|
import { IconButton } from '../Buttons/IconButton/index.js';
|
|
9
|
-
import '@itwin/itwinui-css/css/tree.css';
|
|
10
9
|
export const TreeNodeExpander = React.forwardRef((props, ref) => {
|
|
11
10
|
const { isExpanded, ...rest } = props;
|
|
12
11
|
return (React.createElement(IconButton, { styleType: 'borderless', size: 'small', "aria-label": isExpanded ? 'Collapse' : 'Expand', ref: ref, ...rest },
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { polymorphic } from '../../utils/index.js';
|
|
6
|
-
import '@itwin/itwinui-css/css/anchor.css';
|
|
7
6
|
/**
|
|
8
7
|
* A consistently styled anchor component.
|
|
9
8
|
*
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { polymorphic } from '../../utils/index.js';
|
|
6
|
-
import '@itwin/itwinui-css/css/code.css';
|
|
7
6
|
/**
|
|
8
7
|
* Inline code element.
|
|
9
8
|
* @example
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import cx from 'classnames';
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { Box } from '../../utils/index.js';
|
|
8
|
-
import '@itwin/itwinui-css/css/text.css';
|
|
9
8
|
/**
|
|
10
9
|
* Polymorphic typography component to render any kind of text as any kind of element.
|
|
11
10
|
* Users should decide which element to render based on the context of their app. Link to heading levels docs: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements#accessibility_concerns
|
package/esm/core/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export { Footer, defaultFooterElements } from './Footer/index.js';
|
|
|
22
22
|
export type { FooterElement, TitleTranslations } from './Footer/index.js';
|
|
23
23
|
export { Header, HeaderBreadcrumbs, HeaderButton, HeaderLogo, } from './Header/index.js';
|
|
24
24
|
export { List, ListItem } from './List/index.js';
|
|
25
|
+
export { TransferList } from './TransferList/index.js';
|
|
25
26
|
export { VerticalTabs, Tabs, Tab, HorizontalTabs } from './Tabs/index.js';
|
|
26
27
|
export { InformationPanel, InformationPanelWrapper, InformationPanelHeader, InformationPanelBody, InformationPanelContent, } from './InformationPanel/index.js';
|
|
27
28
|
export { Input } from './Input/index.js';
|
package/esm/core/index.js
CHANGED
|
@@ -24,6 +24,7 @@ export { FileUpload, FileUploadTemplate, FileUploadCard, FileEmptyCard, } from '
|
|
|
24
24
|
export { Footer, defaultFooterElements } from './Footer/index.js';
|
|
25
25
|
export { Header, HeaderBreadcrumbs, HeaderButton, HeaderLogo, } from './Header/index.js';
|
|
26
26
|
export { List, ListItem } from './List/index.js';
|
|
27
|
+
export { TransferList } from './TransferList/index.js';
|
|
27
28
|
export { VerticalTabs, Tabs, Tab, HorizontalTabs } from './Tabs/index.js';
|
|
28
29
|
export { InformationPanel, InformationPanelWrapper, InformationPanelHeader, InformationPanelBody, InformationPanelContent, } from './InformationPanel/index.js';
|
|
29
30
|
export { Input } from './Input/index.js';
|
|
@@ -110,27 +110,24 @@ export class ColorValue {
|
|
|
110
110
|
* This allows component builders to know if they received bad input from user.
|
|
111
111
|
*/
|
|
112
112
|
static fromString(val, defaultColorIfNotParsed) {
|
|
113
|
-
const [tbgr, hue] = this.computeTbgrFromString(val, defaultColorIfNotParsed
|
|
113
|
+
const [tbgr, hue] = this.computeTbgrFromString(val, defaultColorIfNotParsed?.toTbgr());
|
|
114
114
|
return new ColorValue(tbgr, hue);
|
|
115
115
|
}
|
|
116
116
|
/** Create a ColorValue from hue, saturation, lightness values. */
|
|
117
117
|
static fromHSL(hsl) {
|
|
118
|
-
|
|
119
|
-
const alpha = (_a = hsl.a) !== null && _a !== void 0 ? _a : 1;
|
|
118
|
+
const alpha = hsl.a ?? 1;
|
|
120
119
|
return new ColorValue(this.computeTbgrFromHSL(hsl.h / 360, hsl.s / 100, hsl.l / 100, Math.round((1 - alpha) * 255)), hsl.h);
|
|
121
120
|
}
|
|
122
121
|
/** Create a ColorValue from an RgbColor */
|
|
123
122
|
static fromRGB(rgb) {
|
|
124
|
-
|
|
125
|
-
const alpha = (_a = rgb.a) !== null && _a !== void 0 ? _a : 1;
|
|
123
|
+
const alpha = rgb.a ?? 1;
|
|
126
124
|
return ColorValue.fromRgbt(rgb.r, rgb.g, rgb.b, Math.round((1 - alpha) * 255));
|
|
127
125
|
}
|
|
128
126
|
/**
|
|
129
127
|
* Create a ColorValue from an HsvColor
|
|
130
128
|
*/
|
|
131
129
|
static fromHSV(hsv) {
|
|
132
|
-
|
|
133
|
-
const alpha = (_a = hsv.a) !== null && _a !== void 0 ? _a : 1;
|
|
130
|
+
const alpha = hsv.a ?? 1;
|
|
134
131
|
const transparency = Math.round((1 - alpha) * 255);
|
|
135
132
|
// Check for simple case first.
|
|
136
133
|
if (!hsv.s || hsv.h === -1) {
|
|
@@ -481,33 +478,30 @@ export class ColorValue {
|
|
|
481
478
|
}
|
|
482
479
|
/** Convert the 0xTTBBGGRR color to a string of the form "rgba(r,g,b,a)" where the color components are specified in decimal and the alpha component is a fraction. */
|
|
483
480
|
toRgbString(includeAlpha) {
|
|
484
|
-
var _a;
|
|
485
481
|
const rgb = this.toRgbColor();
|
|
486
482
|
const rgbString = `${rgb.r}, ${rgb.g}, ${rgb.b}`;
|
|
487
483
|
if (includeAlpha) {
|
|
488
|
-
const alpha =
|
|
484
|
+
const alpha = rgb.a ?? 1;
|
|
489
485
|
return `rgba(${rgbString}, ${ColorValue.getFormattedColorNumber(alpha, 2)})`;
|
|
490
486
|
}
|
|
491
487
|
return `rgb(${rgbString})`;
|
|
492
488
|
}
|
|
493
489
|
/** Convert this ColorValue to a string in the form "hsl(h,s,l) or hsla(h,s,l,a)" - i.e hsl(120,50%,50%). */
|
|
494
490
|
toHslString(includeAlpha) {
|
|
495
|
-
var _a, _b;
|
|
496
491
|
const hsl = this.toHslColor();
|
|
497
|
-
const hslString = `${ColorValue.getFormattedColorNumber(
|
|
492
|
+
const hslString = `${ColorValue.getFormattedColorNumber(this._hue ?? hsl.h)}, ${ColorValue.getFormattedColorNumber(hsl.s)}%, ${ColorValue.getFormattedColorNumber(hsl.l)}%`;
|
|
498
493
|
if (includeAlpha) {
|
|
499
|
-
const alpha =
|
|
494
|
+
const alpha = hsl.a ?? 1;
|
|
500
495
|
return `hsla(${hslString}, ${ColorValue.getFormattedColorNumber(alpha, 2)})`;
|
|
501
496
|
}
|
|
502
497
|
return `hsl(${hslString})`;
|
|
503
498
|
}
|
|
504
499
|
/** Convert this ColorValue to a string in the form "hsv(h,s,v) or hsva(h,s,v,a)" - i.e hsv(120,50%,50%). */
|
|
505
500
|
toHsvString(includeAlpha) {
|
|
506
|
-
var _a, _b;
|
|
507
501
|
const hsv = this.toHsvColor();
|
|
508
|
-
const hsvString = `${
|
|
502
|
+
const hsvString = `${this._hue ?? hsv.h}, ${hsv.s}%, ${hsv.v}%`;
|
|
509
503
|
if (includeAlpha) {
|
|
510
|
-
const alpha =
|
|
504
|
+
const alpha = hsv.a ?? 1;
|
|
511
505
|
return `hsva(${hsvString}, ${ColorValue.getFormattedColorNumber(alpha, 2)})`;
|
|
512
506
|
}
|
|
513
507
|
return `hsv(${hsvString})`;
|
|
@@ -16,10 +16,9 @@ import { getWindow } from '../functions/index.js';
|
|
|
16
16
|
export const AutoclearingHiddenLiveRegion = ({ text = '' }) => {
|
|
17
17
|
const [maybeText, setMaybeText] = React.useState(text);
|
|
18
18
|
React.useEffect(() => {
|
|
19
|
-
var _a;
|
|
20
19
|
setMaybeText(text);
|
|
21
|
-
const timeout =
|
|
22
|
-
return () =>
|
|
20
|
+
const timeout = getWindow()?.setTimeout(() => setMaybeText(''), 5000);
|
|
21
|
+
return () => void getWindow()?.clearTimeout(timeout);
|
|
23
22
|
}, [text]);
|
|
24
23
|
return (React.createElement(VisuallyHidden, { as: 'div', "aria-live": 'polite', "aria-atomic": 'true' }, maybeText));
|
|
25
24
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { AnyString } from '../types.js';
|
|
3
3
|
import type { PolymorphicForwardRefComponent } from '../props.js';
|
|
4
|
-
import '@itwin/itwinui-css/css/utils.css';
|
|
5
4
|
declare const sizeTokens: readonly ["3xs", "2xs", "xs", "s", "m", "l", "xl", "2xl", "3xl"];
|
|
6
5
|
/**
|
|
7
6
|
* String literal shorthands that correspond to the size tokens in [itwinui-variables](https://github.com/iTwin/iTwinUI/blob/main/packages/itwinui-variables/src/sizes.scss).
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import cx from 'classnames';
|
|
7
|
-
import '@itwin/itwinui-css/css/utils.css';
|
|
8
7
|
import { Box } from './Box.js';
|
|
9
8
|
const sizeTokens = [
|
|
10
9
|
'3xs',
|
|
@@ -21,19 +21,19 @@ export const FocusTrap = (props) => {
|
|
|
21
21
|
const onFirstFocus = (event) => {
|
|
22
22
|
const [firstElement, lastElement] = getFirstLastFocusables();
|
|
23
23
|
if (event.relatedTarget === firstElement) {
|
|
24
|
-
lastElement
|
|
24
|
+
lastElement?.focus();
|
|
25
25
|
}
|
|
26
26
|
else {
|
|
27
|
-
firstElement
|
|
27
|
+
firstElement?.focus();
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
const onLastFocus = (event) => {
|
|
31
31
|
const [firstElement, lastElement] = getFirstLastFocusables();
|
|
32
32
|
if (event.relatedTarget === lastElement) {
|
|
33
|
-
firstElement
|
|
33
|
+
firstElement?.focus();
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
|
-
lastElement
|
|
36
|
+
lastElement?.focus();
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
return (React.createElement(React.Fragment, null,
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import cx from 'classnames';
|
|
7
|
-
import '@itwin/itwinui-css/css/utils.css';
|
|
8
7
|
import { Box } from './Box.js';
|
|
9
8
|
const getSizeValue = (size) => {
|
|
10
9
|
switch (size) {
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import cx from 'classnames';
|
|
7
|
-
import '@itwin/itwinui-css/css/utils.css';
|
|
8
7
|
import { Box } from './Box.js';
|
|
9
8
|
/**
|
|
10
9
|
* Input container to wrap inputs with label, and add optional message and icon.
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import cx from 'classnames';
|
|
7
|
-
import '@itwin/itwinui-css/css/input-container.css';
|
|
8
7
|
import { Box } from './Box.js';
|
|
9
8
|
/**
|
|
10
9
|
* Utility component for input container with display flex abilities.
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import '@itwin/itwinui-css/css/utils.css';
|
|
6
5
|
import { polymorphic } from '../functions/polymorphic.js';
|
|
7
6
|
/**
|
|
8
7
|
* Polymorphic link action component.
|
|
@@ -22,7 +22,6 @@ const ELLIPSIS_CHAR = '…';
|
|
|
22
22
|
* />
|
|
23
23
|
*/
|
|
24
24
|
export const MiddleTextTruncation = (props) => {
|
|
25
|
-
var _a;
|
|
26
25
|
const { text, endCharsCount = 6, textRenderer, style, ...rest } = props;
|
|
27
26
|
const [ref, visibleCount] = useOverflow(text);
|
|
28
27
|
const truncatedText = React.useMemo(() => {
|
|
@@ -39,6 +38,6 @@ export const MiddleTextTruncation = (props) => {
|
|
|
39
38
|
flexGrow: 1,
|
|
40
39
|
whiteSpace: 'nowrap',
|
|
41
40
|
...style,
|
|
42
|
-
}, ref: ref, ...rest },
|
|
41
|
+
}, ref: ref, ...rest }, textRenderer?.(truncatedText, text) ?? truncatedText));
|
|
43
42
|
};
|
|
44
43
|
export default MiddleTextTruncation;
|
|
@@ -2,7 +2,6 @@ import * as React from 'react';
|
|
|
2
2
|
import type { TippyProps } from '@tippyjs/react';
|
|
3
3
|
import type { Placement, Instance } from 'tippy.js';
|
|
4
4
|
export declare type PopoverInstance = Instance;
|
|
5
|
-
import '@itwin/itwinui-css/css/utils.css';
|
|
6
5
|
export declare type PopoverProps = {
|
|
7
6
|
/**
|
|
8
7
|
* Controlled flag for whether the popover is visible.
|
|
@@ -6,7 +6,6 @@ import * as React from 'react';
|
|
|
6
6
|
import cx from 'classnames';
|
|
7
7
|
import Tippy from '@tippyjs/react';
|
|
8
8
|
import { useMergedRefs, useIsClient } from '../hooks/index.js';
|
|
9
|
-
import '@itwin/itwinui-css/css/utils.css';
|
|
10
9
|
import { ThemeContext } from '../../ThemeProvider/ThemeContext.js';
|
|
11
10
|
/**
|
|
12
11
|
* Wrapper around [tippy.js](https://atomiks.github.io/tippyjs)
|
|
@@ -14,7 +13,6 @@ import { ThemeContext } from '../../ThemeProvider/ThemeContext.js';
|
|
|
14
13
|
* @private
|
|
15
14
|
*/
|
|
16
15
|
export const Popover = React.forwardRef((props, ref) => {
|
|
17
|
-
var _a;
|
|
18
16
|
const [mounted, setMounted] = React.useState(false);
|
|
19
17
|
const themeInfo = React.useContext(ThemeContext);
|
|
20
18
|
const isDomAvailable = useIsClient();
|
|
@@ -31,15 +29,14 @@ export const Popover = React.forwardRef((props, ref) => {
|
|
|
31
29
|
const removeTabIndex = {
|
|
32
30
|
fn: () => ({
|
|
33
31
|
onCreate: (instance) => {
|
|
34
|
-
|
|
35
|
-
(_a = instance.popper.firstElementChild) === null || _a === void 0 ? void 0 : _a.removeAttribute('tabindex');
|
|
32
|
+
instance.popper.firstElementChild?.removeAttribute('tabindex');
|
|
36
33
|
},
|
|
37
34
|
}),
|
|
38
35
|
};
|
|
39
36
|
const computedProps = {
|
|
40
37
|
allowHTML: true,
|
|
41
38
|
animation: false,
|
|
42
|
-
appendTo: (el) =>
|
|
39
|
+
appendTo: (el) => themeInfo?.portalContainerRef?.current || el.ownerDocument.body,
|
|
43
40
|
arrow: false,
|
|
44
41
|
duration: 0,
|
|
45
42
|
interactive: true,
|
|
@@ -64,7 +61,7 @@ export const Popover = React.forwardRef((props, ref) => {
|
|
|
64
61
|
modifiers: [
|
|
65
62
|
{ name: 'flip' },
|
|
66
63
|
{ name: 'preventOverflow', options: { padding: 0 } },
|
|
67
|
-
...(
|
|
64
|
+
...(props.popperOptions?.modifiers || []),
|
|
68
65
|
],
|
|
69
66
|
},
|
|
70
67
|
};
|
|
@@ -79,9 +76,8 @@ export const Popover = React.forwardRef((props, ref) => {
|
|
|
79
76
|
const clonedContent = React.isValidElement(props.content)
|
|
80
77
|
? React.cloneElement(props.content, {
|
|
81
78
|
onClick: (e) => {
|
|
82
|
-
var _a, _b;
|
|
83
79
|
e.stopPropagation();
|
|
84
|
-
|
|
80
|
+
props.content.props.onClick?.(e);
|
|
85
81
|
},
|
|
86
82
|
})
|
|
87
83
|
: props.content;
|
|
@@ -98,7 +94,7 @@ export const hideOnEscOrTab = {
|
|
|
98
94
|
/** @returns true if none of the children are tabbable */
|
|
99
95
|
const shouldHideOnTab = () => {
|
|
100
96
|
const descendents = Array.from(instance.popper.querySelectorAll('*'));
|
|
101
|
-
return !descendents.some((el) =>
|
|
97
|
+
return !descendents.some((el) => el?.tabIndex >= 0);
|
|
102
98
|
};
|
|
103
99
|
const onKeyDown = (event) => {
|
|
104
100
|
if (event.altKey) {
|
|
@@ -38,17 +38,18 @@ export const Resizer = (props) => {
|
|
|
38
38
|
const originalUserSelect = ownerDocument.body.style.userSelect;
|
|
39
39
|
ownerDocument.body.style.userSelect = 'none';
|
|
40
40
|
const onResizePointerMove = (event) => {
|
|
41
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
42
41
|
if (!elementRef.current) {
|
|
43
42
|
return;
|
|
44
43
|
}
|
|
45
44
|
if (!isResizing.current) {
|
|
46
45
|
isResizing.current = true;
|
|
47
|
-
onResizeStart
|
|
46
|
+
onResizeStart?.();
|
|
48
47
|
}
|
|
49
|
-
const containerRect =
|
|
50
|
-
const clientX = getBoundedValue(event.clientX,
|
|
51
|
-
const clientY = getBoundedValue(event.clientY,
|
|
48
|
+
const containerRect = containerRef?.current?.getBoundingClientRect();
|
|
49
|
+
const clientX = getBoundedValue(event.clientX, containerRect?.left ?? 0, containerRect?.right ?? ownerDocument.documentElement.clientWidth ?? 0);
|
|
50
|
+
const clientY = getBoundedValue(event.clientY, containerRect?.top ?? 0, containerRect?.bottom ??
|
|
51
|
+
ownerDocument.documentElement.clientHeight ??
|
|
52
|
+
0);
|
|
52
53
|
const diffX = initialPointerX - clientX;
|
|
53
54
|
const diffY = initialPointerY - clientY;
|
|
54
55
|
switch (resizer) {
|
|
@@ -129,7 +130,7 @@ export const Resizer = (props) => {
|
|
|
129
130
|
if (elementRef.current) {
|
|
130
131
|
ownerDocument.body.style.userSelect = originalUserSelect;
|
|
131
132
|
isResizing.current = false;
|
|
132
|
-
onResizeEnd
|
|
133
|
+
onResizeEnd?.({
|
|
133
134
|
width,
|
|
134
135
|
height,
|
|
135
136
|
transform: `translate(${translateX}px, ${translateY}px)`,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
var _a;
|
|
2
1
|
/*---------------------------------------------------------------------------------------------
|
|
3
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -6,7 +5,7 @@ var _a;
|
|
|
6
5
|
import * as React from 'react';
|
|
7
6
|
import * as ReactDOM from 'react-dom';
|
|
8
7
|
import { mergeRefs, useResizeObserver, useIsomorphicLayoutEffect, } from '../hooks/index.js';
|
|
9
|
-
const unstable_batchedUpdates =
|
|
8
|
+
const unstable_batchedUpdates = ReactDOM.unstable_batchedUpdates ?? ((cb) => void cb());
|
|
10
9
|
const getScrollableParent = (element, ownerDocument = document) => {
|
|
11
10
|
if (!element || element === ownerDocument.body) {
|
|
12
11
|
return ownerDocument.body;
|
|
@@ -23,8 +22,7 @@ const getElementStyle = (element, prop) => {
|
|
|
23
22
|
return getComputedStyle(element, null).getPropertyValue(prop);
|
|
24
23
|
};
|
|
25
24
|
const getElementHeight = (element) => {
|
|
26
|
-
|
|
27
|
-
return (_a = element === null || element === void 0 ? void 0 : element.getBoundingClientRect().height) !== null && _a !== void 0 ? _a : 0;
|
|
25
|
+
return element?.getBoundingClientRect().height ?? 0;
|
|
28
26
|
};
|
|
29
27
|
const getElementHeightWithMargins = (element) => {
|
|
30
28
|
if (!element) {
|
|
@@ -109,10 +107,8 @@ export const useVirtualization = (props) => {
|
|
|
109
107
|
// Used to mark when scroll container has height (updated by resize observer)
|
|
110
108
|
// because before that calculations are not right
|
|
111
109
|
const [isMounted, setIsMounted] = React.useState(false);
|
|
112
|
-
const getScrollableContainer = () =>
|
|
113
|
-
|
|
114
|
-
return (_a = scrollContainer.current) !== null && _a !== void 0 ? _a : (_b = parentRef.current) === null || _b === void 0 ? void 0 : _b.ownerDocument.scrollingElement;
|
|
115
|
-
};
|
|
110
|
+
const getScrollableContainer = () => scrollContainer.current ??
|
|
111
|
+
parentRef.current?.ownerDocument.scrollingElement;
|
|
116
112
|
const visibleChildren = React.useMemo(() => {
|
|
117
113
|
const arr = [];
|
|
118
114
|
const endIndex = Math.min(itemsLength, startNode + visibleNodeCount + bufferSize * 2);
|
|
@@ -122,18 +118,18 @@ export const useVirtualization = (props) => {
|
|
|
122
118
|
return arr;
|
|
123
119
|
}, [itemsLength, itemRenderer, bufferSize, startNode, visibleNodeCount]);
|
|
124
120
|
const updateChildHeight = React.useCallback(() => {
|
|
125
|
-
var _a, _b, _c, _d, _e, _f;
|
|
126
121
|
if (!parentRef.current || !visibleChildren.length) {
|
|
127
122
|
return;
|
|
128
123
|
}
|
|
129
124
|
const firstChild = parentRef.current.children.item(0);
|
|
130
125
|
const secondChild = parentRef.current.children.item(1);
|
|
131
126
|
const lastChild = parentRef.current.children.item(parentRef.current.children.length - 1);
|
|
132
|
-
const firstChildHeight = Number(
|
|
127
|
+
const firstChildHeight = Number(getElementHeightWithMargins(firstChild)?.toFixed(2) ?? 0);
|
|
133
128
|
childHeight.current = {
|
|
134
129
|
first: firstChildHeight,
|
|
135
|
-
middle: Number(
|
|
136
|
-
|
|
130
|
+
middle: Number(getElementHeightWithMargins(secondChild)?.toFixed(2) ??
|
|
131
|
+
firstChildHeight),
|
|
132
|
+
last: Number(getElementHeightWithMargins(lastChild)?.toFixed(2) ?? firstChildHeight),
|
|
137
133
|
};
|
|
138
134
|
}, [visibleChildren.length]);
|
|
139
135
|
const onResize = React.useCallback(({ height }) => {
|
|
@@ -151,14 +147,13 @@ export const useVirtualization = (props) => {
|
|
|
151
147
|
// Find scrollable parent
|
|
152
148
|
// Needed only on init
|
|
153
149
|
useIsomorphicLayoutEffect(() => {
|
|
154
|
-
|
|
155
|
-
const scrollableParent = getScrollableParent(parentRef.current, (_a = parentRef.current) === null || _a === void 0 ? void 0 : _a.ownerDocument);
|
|
150
|
+
const scrollableParent = getScrollableParent(parentRef.current, parentRef.current?.ownerDocument);
|
|
156
151
|
scrollContainer.current = scrollableParent;
|
|
157
152
|
resizeRef(scrollableParent);
|
|
158
153
|
}, [resizeRef]);
|
|
159
154
|
// Stop watching resize, when virtual scroll is unmounted
|
|
160
155
|
useIsomorphicLayoutEffect(() => {
|
|
161
|
-
return () => resizeObserver
|
|
156
|
+
return () => resizeObserver?.disconnect();
|
|
162
157
|
}, [resizeObserver]);
|
|
163
158
|
// Get child height when children available
|
|
164
159
|
useIsomorphicLayoutEffect(() => updateChildHeight(), [updateChildHeight]);
|
|
@@ -185,23 +180,21 @@ export const useVirtualization = (props) => {
|
|
|
185
180
|
updateVirtualScroll();
|
|
186
181
|
}, [updateVirtualScroll]);
|
|
187
182
|
const removeScrollListener = React.useCallback(() => {
|
|
188
|
-
var _a, _b;
|
|
189
183
|
if (!onScrollRef.current) {
|
|
190
184
|
return;
|
|
191
185
|
}
|
|
192
186
|
!scrollContainer.current ||
|
|
193
|
-
scrollContainer.current ===
|
|
194
|
-
?
|
|
187
|
+
scrollContainer.current === parentRef.current?.ownerDocument.body
|
|
188
|
+
? parentRef.current?.ownerDocument.removeEventListener('scroll', onScrollRef.current)
|
|
195
189
|
: scrollContainer.current.removeEventListener('scroll', onScrollRef.current);
|
|
196
190
|
}, []);
|
|
197
191
|
// Add event listener to the scrollable container.
|
|
198
192
|
useIsomorphicLayoutEffect(() => {
|
|
199
|
-
var _a, _b;
|
|
200
193
|
removeScrollListener();
|
|
201
194
|
onScrollRef.current = onScroll;
|
|
202
195
|
if (!scrollContainer.current ||
|
|
203
|
-
scrollContainer.current ===
|
|
204
|
-
|
|
196
|
+
scrollContainer.current === parentRef.current?.ownerDocument.body) {
|
|
197
|
+
parentRef.current?.ownerDocument.addEventListener('scroll', onScroll);
|
|
205
198
|
}
|
|
206
199
|
else {
|
|
207
200
|
scrollContainer.current.addEventListener('scroll', onScroll);
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import cx from 'classnames';
|
|
7
|
-
import '@itwin/itwinui-css/css/utils.css';
|
|
8
7
|
import { Box } from './Box.js';
|
|
9
8
|
/**
|
|
10
9
|
* Hides content visually but keeps it still accessible to screen readers
|
|
@@ -22,3 +22,9 @@ export declare const getWindow: () => (Window & typeof globalThis) | undefined;
|
|
|
22
22
|
* `defaultPrevented` is respected for each callback.
|
|
23
23
|
*/
|
|
24
24
|
export declare const mergeEventHandlers: <E extends import("react").SyntheticEvent<Element, Event>>(...callbacks: (((event: E) => void) | undefined)[]) => (event: E) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Returns translate values as an array of a given element.
|
|
27
|
+
* @param element HTML element you want to get translate value of
|
|
28
|
+
* @returns Translate values in pixels in an array `[translateX, translateY]`
|
|
29
|
+
*/
|
|
30
|
+
export declare const getTranslateValues: (element: HTMLElement | null | undefined) => number[];
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import styles from '../../../styles.js';
|
|
5
6
|
/**
|
|
6
7
|
* Get the container as a child of body, or create one if it doesn't exist.
|
|
7
8
|
* Mostly used for dynamic components like Modal or Toast.
|
|
@@ -10,12 +11,12 @@
|
|
|
10
11
|
* @param ownerDocument Can be changed if the container should be in a different document (e.g. in popup).
|
|
11
12
|
*/
|
|
12
13
|
export const getContainer = (containerId, ownerDocument = getDocument()) => {
|
|
13
|
-
|
|
14
|
-
let container = (_a = ownerDocument === null || ownerDocument === void 0 ? void 0 : ownerDocument.getElementById(containerId)) !== null && _a !== void 0 ? _a : undefined;
|
|
14
|
+
let container = ownerDocument?.getElementById(containerId) ?? undefined;
|
|
15
15
|
if (container == null && !!ownerDocument) {
|
|
16
16
|
container = ownerDocument.createElement('div');
|
|
17
17
|
container.setAttribute('id', containerId);
|
|
18
|
-
const root =
|
|
18
|
+
const root = ownerDocument.querySelector(`.${styles['iui-root']}`) ??
|
|
19
|
+
ownerDocument.body;
|
|
19
20
|
root.appendChild(container);
|
|
20
21
|
}
|
|
21
22
|
return container;
|
|
@@ -40,9 +41,22 @@ export const getWindow = () => {
|
|
|
40
41
|
*/
|
|
41
42
|
export const mergeEventHandlers = (...callbacks) => (event) => {
|
|
42
43
|
for (const cb of callbacks) {
|
|
43
|
-
cb
|
|
44
|
-
if (event
|
|
44
|
+
cb?.(event);
|
|
45
|
+
if (event?.defaultPrevented) {
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
};
|
|
50
|
+
/**
|
|
51
|
+
* Returns translate values as an array of a given element.
|
|
52
|
+
* @param element HTML element you want to get translate value of
|
|
53
|
+
* @returns Translate values in pixels in an array `[translateX, translateY]`
|
|
54
|
+
*/
|
|
55
|
+
export const getTranslateValues = (element) => {
|
|
56
|
+
if (!element) {
|
|
57
|
+
return [];
|
|
58
|
+
}
|
|
59
|
+
const transformValue = getComputedStyle(element).getPropertyValue('transform');
|
|
60
|
+
const matrix = new DOMMatrix(transformValue);
|
|
61
|
+
return [matrix.m41, matrix.m42];
|
|
62
|
+
};
|