@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
|
@@ -70,17 +70,17 @@ const ExpanderColumn = (props = {}) => {
|
|
|
70
70
|
cellClassName: 'iui-slot',
|
|
71
71
|
Cell: (props) => {
|
|
72
72
|
const { row } = props;
|
|
73
|
-
if (!
|
|
73
|
+
if (!subComponent?.(row)) {
|
|
74
74
|
return null;
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
77
|
return (React.createElement(index_js_2.IconButton, { className: 'iui-table-row-expander', styleType: 'borderless', size: 'small', onClick: (e) => {
|
|
78
78
|
e.stopPropagation();
|
|
79
79
|
row.toggleRowExpanded();
|
|
80
|
-
}, disabled: isDisabled
|
|
80
|
+
}, disabled: isDisabled?.(props.row.original) }, React.createElement(index_js_1.SvgChevronRight, null)));
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
|
-
cellRenderer: (props) => (React.createElement(index_js_3.DefaultCell, { ...props, isDisabled: (rowData) => !!
|
|
83
|
+
cellRenderer: (props) => (React.createElement(index_js_3.DefaultCell, { ...props, isDisabled: (rowData) => !!isDisabled?.(rowData) })),
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
86
|
exports.ExpanderColumn = ExpanderColumn;
|
|
@@ -58,15 +58,15 @@ const SelectionColumn = (props = {}) => {
|
|
|
58
58
|
columnClassName: 'iui-slot',
|
|
59
59
|
cellClassName: 'iui-slot',
|
|
60
60
|
Header: ({ getToggleAllRowsSelectedProps, toggleAllRowsSelected, rows, initialRows, state, }) => {
|
|
61
|
-
const disabled = rows.every((row) => isDisabled
|
|
62
|
-
const checked = initialRows.every((row) => state.selectedRowIds[row.id] ||
|
|
61
|
+
const disabled = rows.every((row) => isDisabled?.(row.original));
|
|
62
|
+
const checked = initialRows.every((row) => state.selectedRowIds[row.id] || isDisabled?.(row.original));
|
|
63
63
|
const indeterminate = !checked && Object.keys(state.selectedRowIds).length > 0;
|
|
64
64
|
return (React.createElement(index_js_1.Checkbox, { ...getToggleAllRowsSelectedProps(), style: {}, title: '' // Removes default title that comes from react-table
|
|
65
65
|
, checked: checked && !disabled, indeterminate: indeterminate, disabled: disabled, onChange: () => toggleAllRowsSelected(!rows.some((row) => row.isSelected)) }));
|
|
66
66
|
},
|
|
67
67
|
Cell: ({ row }) => (React.createElement(index_js_1.Checkbox, { ...row.getToggleRowSelectedProps(), style: {}, title: '' // Removes default title that comes from react-table
|
|
68
|
-
, disabled: isDisabled
|
|
69
|
-
cellRenderer: (props) => (React.createElement(index_js_2.DefaultCell, { ...props, isDisabled: (rowData) => !!
|
|
68
|
+
, disabled: isDisabled?.(row.original), onClick: (e) => e.stopPropagation() })),
|
|
69
|
+
cellRenderer: (props) => (React.createElement(index_js_2.DefaultCell, { ...props, isDisabled: (rowData) => !!isDisabled?.(rowData) })),
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
72
|
exports.SelectionColumn = SelectionColumn;
|
|
@@ -33,7 +33,6 @@ exports.BaseFilter = void 0;
|
|
|
33
33
|
*--------------------------------------------------------------------------------------------*/
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
35
|
const classnames_1 = __importDefault(require("classnames"));
|
|
36
|
-
require("@itwin/itwinui-css/css/table.css");
|
|
37
36
|
const index_js_1 = require("../../utils/index.js");
|
|
38
37
|
/**
|
|
39
38
|
* Filter wrapper that should be used when creating custom filters.
|
|
@@ -52,7 +51,7 @@ const index_js_1 = require("../../utils/index.js");
|
|
|
52
51
|
const BaseFilter = (props) => {
|
|
53
52
|
const { children, className, style, id } = props;
|
|
54
53
|
(0, index_js_1.useGlobals)();
|
|
55
|
-
return (React.createElement(
|
|
54
|
+
return (React.createElement(index_js_1.Box, { className: (0, classnames_1.default)('iui-table-column-filter', className), style: style,
|
|
56
55
|
// Prevents from triggering sort
|
|
57
56
|
onClick: (e) => {
|
|
58
57
|
e.stopPropagation();
|
|
@@ -52,10 +52,9 @@ const DatePickerInput = (props) => {
|
|
|
52
52
|
const [isVisible, setIsVisible] = React.useState(false);
|
|
53
53
|
const close = React.useCallback(() => setIsVisible(false), []);
|
|
54
54
|
const onDateSelected = React.useCallback((date) => {
|
|
55
|
-
var _a;
|
|
56
55
|
onChange(date);
|
|
57
56
|
close();
|
|
58
|
-
|
|
57
|
+
buttonRef.current?.focus();
|
|
59
58
|
}, [close, onChange]);
|
|
60
59
|
const onInputChange = React.useCallback((event) => {
|
|
61
60
|
const value = event.target.value;
|
|
@@ -69,8 +68,7 @@ const DatePickerInput = (props) => {
|
|
|
69
68
|
}
|
|
70
69
|
}, [onChange, parseInput]);
|
|
71
70
|
return (React.createElement(index_js_1.Popover, { content: React.createElement(index_js_3.DatePicker, { date: date, onChange: onDateSelected, setFocus: true, isDateDisabled: isDateDisabled }), placement: 'bottom', visible: isVisible, onClickOutside: (_, e) => {
|
|
72
|
-
|
|
73
|
-
if (!((_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
|
|
71
|
+
if (!buttonRef.current?.contains(e.target)) {
|
|
74
72
|
close();
|
|
75
73
|
}
|
|
76
74
|
}, appendTo: 'parent' },
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { FilterButtonBarTranslation } from '../FilterButtonBar.js';
|
|
3
3
|
import type { TableFilterProps } from '../types.js';
|
|
4
|
-
import '@itwin/itwinui-css/css/table.css';
|
|
5
4
|
export declare type DateRangeTranslation = {
|
|
6
5
|
from: string;
|
|
7
6
|
to: string;
|
|
@@ -35,7 +35,6 @@ const React = __importStar(require("react"));
|
|
|
35
35
|
const index_js_1 = require("../../../utils/index.js");
|
|
36
36
|
const FilterButtonBar_js_1 = require("../FilterButtonBar.js");
|
|
37
37
|
const BaseFilter_js_1 = require("../BaseFilter.js");
|
|
38
|
-
require("@itwin/itwinui-css/css/table.css");
|
|
39
38
|
const DatePickerInput_js_1 = __importDefault(require("./DatePickerInput.js"));
|
|
40
39
|
const defaultStrings = {
|
|
41
40
|
from: 'From',
|
|
@@ -57,11 +56,10 @@ const defaultParseInput = (text) => {
|
|
|
57
56
|
return new Date('');
|
|
58
57
|
};
|
|
59
58
|
const DateRangeFilter = (props) => {
|
|
60
|
-
var _a, _b, _c, _d;
|
|
61
59
|
const { column, translatedLabels, setFilter, clearFilter, formatDate = defaultFormatDate, parseInput = defaultParseInput, placeholder = 'MMM dd, yyyy', } = props;
|
|
62
60
|
(0, index_js_1.useGlobals)();
|
|
63
61
|
const translatedStrings = { ...defaultStrings, ...translatedLabels };
|
|
64
|
-
const [from, setFrom] = React.useState(
|
|
62
|
+
const [from, setFrom] = React.useState(column.filterValue?.[0] ? new Date(column.filterValue?.[0]) : undefined);
|
|
65
63
|
const onFromChange = React.useCallback((date) => {
|
|
66
64
|
setFrom((prevDate) => {
|
|
67
65
|
if (prevDate || !date) {
|
|
@@ -70,7 +68,7 @@ const DateRangeFilter = (props) => {
|
|
|
70
68
|
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0, 0);
|
|
71
69
|
});
|
|
72
70
|
}, []);
|
|
73
|
-
const [to, setTo] = React.useState(
|
|
71
|
+
const [to, setTo] = React.useState(column.filterValue?.[1] ? new Date(column.filterValue?.[1]) : undefined);
|
|
74
72
|
const onToChange = React.useCallback((date) => {
|
|
75
73
|
setTo((prevDate) => {
|
|
76
74
|
if (prevDate || !date) {
|
|
@@ -33,7 +33,6 @@ exports.FilterButtonBar = void 0;
|
|
|
33
33
|
*--------------------------------------------------------------------------------------------*/
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
35
|
const classnames_1 = __importDefault(require("classnames"));
|
|
36
|
-
require("@itwin/itwinui-css/css/table.css");
|
|
37
36
|
const index_js_1 = require("../../utils/index.js");
|
|
38
37
|
const index_js_2 = require("../../Buttons/index.js");
|
|
39
38
|
const defaultStrings = {
|
|
@@ -49,7 +48,7 @@ const FilterButtonBar = (props) => {
|
|
|
49
48
|
const { children, setFilter, clearFilter, translatedLabels, className, style, id, } = props;
|
|
50
49
|
const translatedStrings = { ...defaultStrings, ...translatedLabels };
|
|
51
50
|
(0, index_js_1.useGlobals)();
|
|
52
|
-
return (React.createElement(
|
|
51
|
+
return (React.createElement(index_js_1.Box, { className: (0, classnames_1.default)('iui-button-bar', className), style: style, id: id },
|
|
53
52
|
children,
|
|
54
53
|
React.createElement(index_js_2.Button, { styleType: 'high-visibility', onClick: setFilter }, translatedStrings.filter),
|
|
55
54
|
React.createElement(index_js_2.Button, { onClick: clearFilter }, translatedStrings.clear)));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { HeaderGroup } from 'react-table';
|
|
3
|
-
import '@itwin/itwinui-css/css/table.css';
|
|
4
3
|
import type { CommonProps } from '../../utils/index.js';
|
|
5
4
|
export declare type FilterToggleProps<T extends Record<string, unknown>> = {
|
|
6
5
|
column: HeaderGroup<T>;
|
|
@@ -33,7 +33,6 @@ exports.FilterToggle = void 0;
|
|
|
33
33
|
*--------------------------------------------------------------------------------------------*/
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
35
|
const classnames_1 = __importDefault(require("classnames"));
|
|
36
|
-
require("@itwin/itwinui-css/css/table.css");
|
|
37
36
|
const index_js_1 = require("../../utils/index.js");
|
|
38
37
|
const index_js_2 = require("../../Buttons/index.js");
|
|
39
38
|
/**
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { FilterButtonBarTranslation } from '../FilterButtonBar.js';
|
|
3
3
|
import type { TableFilterProps } from '../types.js';
|
|
4
|
-
import '@itwin/itwinui-css/css/table.css';
|
|
5
4
|
export declare type NumberRangeTranslation = {
|
|
6
5
|
from: string;
|
|
7
6
|
to: string;
|
|
@@ -32,19 +32,17 @@ const React = __importStar(require("react"));
|
|
|
32
32
|
const index_js_1 = require("../../../utils/index.js");
|
|
33
33
|
const FilterButtonBar_js_1 = require("../FilterButtonBar.js");
|
|
34
34
|
const BaseFilter_js_1 = require("../BaseFilter.js");
|
|
35
|
-
require("@itwin/itwinui-css/css/table.css");
|
|
36
35
|
const index_js_2 = require("../../../LabeledInput/index.js");
|
|
37
36
|
const defaultStrings = {
|
|
38
37
|
from: 'From',
|
|
39
38
|
to: 'To',
|
|
40
39
|
};
|
|
41
40
|
const NumberRangeFilter = (props) => {
|
|
42
|
-
var _a, _b, _c, _d;
|
|
43
41
|
const { column, translatedLabels, setFilter, clearFilter } = props;
|
|
44
42
|
(0, index_js_1.useGlobals)();
|
|
45
43
|
const translatedStrings = { ...defaultStrings, ...translatedLabels };
|
|
46
|
-
const [from, setFrom] = React.useState(
|
|
47
|
-
const [to, setTo] = React.useState(
|
|
44
|
+
const [from, setFrom] = React.useState(column.filterValue?.[0] ?? '');
|
|
45
|
+
const [to, setTo] = React.useState(column.filterValue?.[1] ?? '');
|
|
48
46
|
const parseInputValue = (value) => {
|
|
49
47
|
return !value || isNaN(Number(value)) ? undefined : Number(value);
|
|
50
48
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import '@itwin/itwinui-css/css/table.css';
|
|
3
2
|
import type { FilterButtonBarTranslation } from '../FilterButtonBar.js';
|
|
4
3
|
import type { TableFilterProps } from '../types.js';
|
|
5
4
|
export declare type TextFilterProps<T extends Record<string, unknown>> = TableFilterProps<T> & {
|
|
@@ -29,16 +29,14 @@ exports.TextFilter = void 0;
|
|
|
29
29
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
30
30
|
*--------------------------------------------------------------------------------------------*/
|
|
31
31
|
const React = __importStar(require("react"));
|
|
32
|
-
require("@itwin/itwinui-css/css/table.css");
|
|
33
32
|
const index_js_1 = require("../../../utils/index.js");
|
|
34
33
|
const index_js_2 = require("../../../Input/index.js");
|
|
35
34
|
const FilterButtonBar_js_1 = require("../FilterButtonBar.js");
|
|
36
35
|
const BaseFilter_js_1 = require("../BaseFilter.js");
|
|
37
36
|
const TextFilter = (props) => {
|
|
38
|
-
var _a;
|
|
39
37
|
const { column, translatedLabels, setFilter, clearFilter } = props;
|
|
40
38
|
(0, index_js_1.useGlobals)();
|
|
41
|
-
const [text, setText] = React.useState(
|
|
39
|
+
const [text, setText] = React.useState(column.filterValue ?? '');
|
|
42
40
|
const onKeyDown = (event) => {
|
|
43
41
|
if (event.altKey) {
|
|
44
42
|
return;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.useColumnDragAndDrop = void 0;
|
|
4
7
|
const react_table_1 = require("react-table");
|
|
8
|
+
const styles_js_1 = __importDefault(require("../../../styles.js"));
|
|
5
9
|
const REORDER_ACTIONS = {
|
|
6
10
|
columnDragStart: 'columnDragStart',
|
|
7
11
|
columnDragEnd: 'columnDragEnd',
|
|
@@ -24,13 +28,13 @@ const defaultGetDragAndDropProps = (isEnabled) => (props, { instance, header, })
|
|
|
24
28
|
};
|
|
25
29
|
const setOnDragColumnStyle = (event, position) => {
|
|
26
30
|
const columnElement = event.currentTarget;
|
|
27
|
-
columnElement.classList.remove('iui-table-reorder-column-right');
|
|
28
|
-
columnElement.classList.remove('iui-table-reorder-column-left');
|
|
31
|
+
columnElement.classList.remove(styles_js_1.default['iui-table-reorder-column-right']);
|
|
32
|
+
columnElement.classList.remove(styles_js_1.default['iui-table-reorder-column-left']);
|
|
29
33
|
if (position === 'left') {
|
|
30
|
-
columnElement.classList.add('iui-table-reorder-column-left');
|
|
34
|
+
columnElement.classList.add(styles_js_1.default['iui-table-reorder-column-left']);
|
|
31
35
|
}
|
|
32
36
|
else if (position === 'right') {
|
|
33
|
-
columnElement.classList.add('iui-table-reorder-column-right');
|
|
37
|
+
columnElement.classList.add(styles_js_1.default['iui-table-reorder-column-right']);
|
|
34
38
|
}
|
|
35
39
|
};
|
|
36
40
|
const reorderColumns = (tableColumns, srcIndex, dstIndex) => {
|
|
@@ -14,7 +14,6 @@ const isTouchEvent = (event) => {
|
|
|
14
14
|
const defaultGetResizerProps = (ownerDocument) => (props, { instance, header, nextHeader, }) => {
|
|
15
15
|
const { dispatch } = instance;
|
|
16
16
|
const onResizeStart = (e, header) => {
|
|
17
|
-
var _a, _b, _c;
|
|
18
17
|
// lets not respond to multiple touches (e.g. 2 or 3 fingers)
|
|
19
18
|
if (isTouchEvent(e) && e.touches && e.touches.length > 1) {
|
|
20
19
|
return;
|
|
@@ -39,10 +38,9 @@ const defaultGetResizerProps = (ownerDocument) => (props, { instance, header, ne
|
|
|
39
38
|
moveHandler: (e) => dispatchMove(e.clientX),
|
|
40
39
|
upEvent: 'mouseup',
|
|
41
40
|
upHandler: () => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
(_c = ownerDocument.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('mouseleave', handlersAndEvents.mouse.upHandler);
|
|
41
|
+
ownerDocument.current?.removeEventListener('mousemove', handlersAndEvents.mouse.moveHandler);
|
|
42
|
+
ownerDocument.current?.removeEventListener('mouseup', handlersAndEvents.mouse.upHandler);
|
|
43
|
+
ownerDocument.current?.removeEventListener('mouseleave', handlersAndEvents.mouse.upHandler);
|
|
46
44
|
dispatchEnd();
|
|
47
45
|
},
|
|
48
46
|
},
|
|
@@ -57,9 +55,8 @@ const defaultGetResizerProps = (ownerDocument) => (props, { instance, header, ne
|
|
|
57
55
|
},
|
|
58
56
|
upEvent: 'touchend',
|
|
59
57
|
upHandler: () => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
(_b = ownerDocument.current) === null || _b === void 0 ? void 0 : _b.removeEventListener(handlersAndEvents.touch.upEvent, handlersAndEvents.touch.moveHandler);
|
|
58
|
+
ownerDocument.current?.removeEventListener(handlersAndEvents.touch.moveEvent, handlersAndEvents.touch.moveHandler);
|
|
59
|
+
ownerDocument.current?.removeEventListener(handlersAndEvents.touch.upEvent, handlersAndEvents.touch.moveHandler);
|
|
63
60
|
dispatchEnd();
|
|
64
61
|
},
|
|
65
62
|
},
|
|
@@ -70,10 +67,10 @@ const defaultGetResizerProps = (ownerDocument) => (props, { instance, header, ne
|
|
|
70
67
|
const passiveIfSupported = passiveEventSupported()
|
|
71
68
|
? { passive: false }
|
|
72
69
|
: false;
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
ownerDocument.current?.addEventListener(events.moveEvent, events.moveHandler, passiveIfSupported);
|
|
71
|
+
ownerDocument.current?.addEventListener(events.upEvent, events.upHandler, passiveIfSupported);
|
|
75
72
|
if (!isTouchEvent(e)) {
|
|
76
|
-
|
|
73
|
+
ownerDocument.current?.addEventListener('mouseleave', handlersAndEvents.mouse.upHandler, passiveIfSupported);
|
|
77
74
|
}
|
|
78
75
|
dispatch({
|
|
79
76
|
type: react_table_1.actions.columnStartResizing,
|
|
@@ -157,8 +154,8 @@ const reducer = (newState, action, previousState, instance) => {
|
|
|
157
154
|
const newColumnWidths = getColumnWidths(headerIdWidths, deltaX / columnWidth);
|
|
158
155
|
const isTableWidthDecreasing = calculateTableWidth(newColumnWidths, instance.flatHeaders) <
|
|
159
156
|
instance.tableWidth;
|
|
160
|
-
const newNextColumnWidths =
|
|
161
|
-
(
|
|
157
|
+
const newNextColumnWidths = instance?.columnResizeMode === 'fit' ||
|
|
158
|
+
(instance?.columnResizeMode === 'expand' && isTableWidthDecreasing)
|
|
162
159
|
? getColumnWidths(nextHeaderIdWidths, -deltaX / nextColumnWidth)
|
|
163
160
|
: {};
|
|
164
161
|
if (!isNewColumnWidthsValid(newColumnWidths, instance.flatHeaders) ||
|
|
@@ -168,7 +165,7 @@ const reducer = (newState, action, previousState, instance) => {
|
|
|
168
165
|
}
|
|
169
166
|
// Setting `width` here because it might take several rerenders until actual column width is set.
|
|
170
167
|
// Also setting after the actual resize happened.
|
|
171
|
-
instance
|
|
168
|
+
instance?.flatHeaders.forEach((h) => {
|
|
172
169
|
if (!h.width) {
|
|
173
170
|
h.width = h.resizeWidth;
|
|
174
171
|
}
|
|
@@ -210,7 +207,7 @@ const isNewColumnWidthsValid = (columnWidths, headers) => {
|
|
|
210
207
|
return false;
|
|
211
208
|
}
|
|
212
209
|
for (const [headerId, width] of Object.entries(columnWidths)) {
|
|
213
|
-
const header = headers
|
|
210
|
+
const header = headers?.find((h) => h.id === headerId);
|
|
214
211
|
if (!header) {
|
|
215
212
|
continue;
|
|
216
213
|
}
|
|
@@ -242,7 +239,6 @@ const useInstanceBeforeDimensions = (instance) => {
|
|
|
242
239
|
const { flatHeaders, getHooks, state: { columnResizing }, columnResizeMode, } = instance;
|
|
243
240
|
const getInstance = (0, react_table_1.useGetLatest)(instance);
|
|
244
241
|
flatHeaders.forEach((header, index) => {
|
|
245
|
-
var _a;
|
|
246
242
|
const resizeWidth = columnResizing.columnWidths[header.id];
|
|
247
243
|
header.width = resizeWidth || header.width || header.originalWidth;
|
|
248
244
|
header.isResizing = columnResizing.isResizingColumn === header.id;
|
|
@@ -262,7 +258,7 @@ const useInstanceBeforeDimensions = (instance) => {
|
|
|
262
258
|
if (columnResizeMode === 'fit') {
|
|
263
259
|
header.isResizerVisible =
|
|
264
260
|
(header.canResize && !!nextResizableHeader) ||
|
|
265
|
-
(headerToResize && !!
|
|
261
|
+
(headerToResize && !!instance.flatHeaders[index + 1]?.canResize);
|
|
266
262
|
// When resize mode is `expand` show resizer on the current resizable column.
|
|
267
263
|
}
|
|
268
264
|
else {
|
|
@@ -276,8 +272,7 @@ const useInstanceBeforeDimensions = (instance) => {
|
|
|
276
272
|
});
|
|
277
273
|
};
|
|
278
274
|
const getPreviousResizableHeader = (headerColumn, instance) => {
|
|
279
|
-
|
|
280
|
-
const headersList = (((_a = headerColumn.parent) === null || _a === void 0 ? void 0 : _a.columns) || instance.flatHeaders).filter(({ isVisible }) => isVisible);
|
|
275
|
+
const headersList = (headerColumn.parent?.columns || instance.flatHeaders).filter(({ isVisible }) => isVisible);
|
|
281
276
|
const headerIndex = headersList.findIndex((h) => h.id === headerColumn.id);
|
|
282
277
|
return [...headersList]
|
|
283
278
|
.slice(0, headerIndex)
|
|
@@ -285,8 +280,7 @@ const getPreviousResizableHeader = (headerColumn, instance) => {
|
|
|
285
280
|
.find((h) => !h.disableResizing);
|
|
286
281
|
};
|
|
287
282
|
const getNextResizableHeader = (headerColumn, instance) => {
|
|
288
|
-
|
|
289
|
-
const headersList = (((_a = headerColumn.parent) === null || _a === void 0 ? void 0 : _a.columns) || instance.flatHeaders).filter(({ isVisible }) => isVisible);
|
|
283
|
+
const headersList = (headerColumn.parent?.columns || instance.flatHeaders).filter(({ isVisible }) => isVisible);
|
|
290
284
|
const headerIndex = headersList.findIndex((h) => h.id === headerColumn.id);
|
|
291
285
|
return [...headersList]
|
|
292
286
|
.slice(headerIndex + 1)
|
|
@@ -335,7 +329,7 @@ const passiveEventSupported = () => {
|
|
|
335
329
|
};
|
|
336
330
|
window.addEventListener('test', () => { }, options);
|
|
337
331
|
}
|
|
338
|
-
catch
|
|
332
|
+
catch {
|
|
339
333
|
passiveSupported = false;
|
|
340
334
|
}
|
|
341
335
|
return passiveSupported;
|
|
@@ -49,14 +49,13 @@ function useScrollToRow({ data, enableVirtualization, page, paginatorRenderer, s
|
|
|
49
49
|
// For non-virtualized tables, we need to add a ref to each row
|
|
50
50
|
// and scroll to the element
|
|
51
51
|
React.useEffect(() => {
|
|
52
|
-
var _a;
|
|
53
52
|
if (enableVirtualization ||
|
|
54
53
|
scrollToIndex === undefined ||
|
|
55
54
|
scrollToIndex === null ||
|
|
56
55
|
scrollToIndex < 0) {
|
|
57
56
|
return;
|
|
58
57
|
}
|
|
59
|
-
|
|
58
|
+
rowRefs.current[pageRef.current[scrollToIndex].id]?.scrollIntoView();
|
|
60
59
|
}, [enableVirtualization, scrollToIndex]);
|
|
61
60
|
const tableRowRef = React.useCallback((row) => {
|
|
62
61
|
return (element) => {
|
|
@@ -14,7 +14,6 @@ const useStickyColumns = (hooks) => {
|
|
|
14
14
|
};
|
|
15
15
|
exports.useStickyColumns = useStickyColumns;
|
|
16
16
|
const reducer = (newState, action) => {
|
|
17
|
-
var _a, _b;
|
|
18
17
|
if (action.type === react_table_1.actions.init) {
|
|
19
18
|
return {
|
|
20
19
|
...newState,
|
|
@@ -22,7 +21,7 @@ const reducer = (newState, action) => {
|
|
|
22
21
|
};
|
|
23
22
|
}
|
|
24
23
|
if (action.type === react_table_1.actions.setScrolledLeft &&
|
|
25
|
-
|
|
24
|
+
newState.sticky?.isScrolledToLeft !== action.value // Prevents unnecessary re-render
|
|
26
25
|
) {
|
|
27
26
|
return {
|
|
28
27
|
...newState,
|
|
@@ -33,7 +32,7 @@ const reducer = (newState, action) => {
|
|
|
33
32
|
};
|
|
34
33
|
}
|
|
35
34
|
if (action.type === react_table_1.actions.setScrolledRight &&
|
|
36
|
-
|
|
35
|
+
newState.sticky?.isScrolledToRight !== action.value // Prevents unnecessary re-render
|
|
37
36
|
) {
|
|
38
37
|
return {
|
|
39
38
|
...newState,
|
|
@@ -49,9 +48,8 @@ const useInstance = (instance) => {
|
|
|
49
48
|
const { flatHeaders } = instance;
|
|
50
49
|
// Edge case. Saving original sticky state in case sticky columns are reordered.
|
|
51
50
|
flatHeaders.forEach((header) => {
|
|
52
|
-
var _a;
|
|
53
51
|
if (!header.originalSticky) {
|
|
54
|
-
header.originalSticky =
|
|
52
|
+
header.originalSticky = header.sticky ?? 'none';
|
|
55
53
|
}
|
|
56
54
|
header.sticky =
|
|
57
55
|
header.originalSticky === 'none' ? undefined : header.originalSticky;
|
|
@@ -54,15 +54,13 @@ const useInstance = (hasAnySubRows, instance) => {
|
|
|
54
54
|
// Restore original sub-rows
|
|
55
55
|
const setSubRows = (rows) => {
|
|
56
56
|
rows.forEach((row) => {
|
|
57
|
-
|
|
58
|
-
row.subRows = (_a = row.initialSubRows) !== null && _a !== void 0 ? _a : [];
|
|
57
|
+
row.subRows = row.initialSubRows ?? [];
|
|
59
58
|
setSubRows(row.subRows);
|
|
60
59
|
});
|
|
61
60
|
};
|
|
62
61
|
setSubRows(instance.initialRows);
|
|
63
62
|
let currentlyFilteredRows = [...instance.initialRows];
|
|
64
63
|
instance.state.filters.forEach(({ id: columnId, value: filterValue }) => {
|
|
65
|
-
var _a;
|
|
66
64
|
const column = instance.allColumns.find((c) => c.id === columnId);
|
|
67
65
|
if (!column) {
|
|
68
66
|
return;
|
|
@@ -73,7 +71,7 @@ const useInstance = (hasAnySubRows, instance) => {
|
|
|
73
71
|
};
|
|
74
72
|
const filterFn = typeof column.filter === 'function'
|
|
75
73
|
? column.filter
|
|
76
|
-
: filterTypes[
|
|
74
|
+
: filterTypes[column.filter ?? 'text'];
|
|
77
75
|
currentlyFilteredRows = currentlyFilteredRows.filter((row) => handleRowFiltering(row, filterFn, columnId, filterValue));
|
|
78
76
|
});
|
|
79
77
|
const filteredRows = [];
|
package/cjs/core/Tabs/Tab.d.ts
CHANGED
package/cjs/core/Tabs/Tab.js
CHANGED
|
@@ -34,7 +34,6 @@ exports.Tab = void 0;
|
|
|
34
34
|
const classnames_1 = __importDefault(require("classnames"));
|
|
35
35
|
const React = __importStar(require("react"));
|
|
36
36
|
const index_js_1 = require("../utils/index.js");
|
|
37
|
-
require("@itwin/itwinui-css/css/tabs.css");
|
|
38
37
|
/**
|
|
39
38
|
* Individual tab component to be used in the `labels` prop of `Tabs`.
|
|
40
39
|
* @example
|
package/cjs/core/Tabs/Tabs.d.ts
CHANGED
package/cjs/core/Tabs/Tabs.js
CHANGED
|
@@ -34,8 +34,8 @@ exports.VerticalTabs = exports.HorizontalTabs = exports.Tabs = void 0;
|
|
|
34
34
|
const classnames_1 = __importDefault(require("classnames"));
|
|
35
35
|
const React = __importStar(require("react"));
|
|
36
36
|
const index_js_1 = require("../utils/index.js");
|
|
37
|
-
require("@itwin/itwinui-css/css/tabs.css");
|
|
38
37
|
const Tab_js_1 = require("./Tab.js");
|
|
38
|
+
const styles_js_1 = __importDefault(require("../../styles.js"));
|
|
39
39
|
/**
|
|
40
40
|
* Tabs organize and allow navigation between groups of content that are related and at the same level of hierarchy.
|
|
41
41
|
* @example
|
|
@@ -114,23 +114,21 @@ const Tabs = (props) => {
|
|
|
114
114
|
const [focusedIndex, setFocusedIndex] = React.useState();
|
|
115
115
|
React.useEffect(() => {
|
|
116
116
|
if (tablistRef.current && focusedIndex !== undefined) {
|
|
117
|
-
const tab = tablistRef.current.querySelectorAll('
|
|
118
|
-
tab
|
|
117
|
+
const tab = tablistRef.current.querySelectorAll(`.${styles_js_1.default['iui-tab']}`)[focusedIndex];
|
|
118
|
+
tab?.focus();
|
|
119
119
|
}
|
|
120
120
|
}, [focusedIndex]);
|
|
121
121
|
const [hasSublabel, setHasSublabel] = React.useState(false); // used for setting size
|
|
122
122
|
(0, index_js_1.useIsomorphicLayoutEffect)(() => {
|
|
123
|
-
var _a;
|
|
124
123
|
setHasSublabel(type !== 'pill' && // pill tabs should never have sublabels
|
|
125
|
-
!!
|
|
124
|
+
!!tablistRef.current?.querySelector(`.${styles_js_1.default['iui-tab-description']}`));
|
|
126
125
|
}, [type]);
|
|
127
126
|
const enableHorizontalScroll = React.useCallback((e) => {
|
|
128
|
-
var _a;
|
|
129
127
|
const ownerDoc = tablistRef.current;
|
|
130
128
|
if (ownerDoc === null) {
|
|
131
129
|
return;
|
|
132
130
|
}
|
|
133
|
-
let scrollLeft =
|
|
131
|
+
let scrollLeft = ownerDoc?.scrollLeft ?? 0;
|
|
134
132
|
if (e.deltaY > 0 || e.deltaX > 0) {
|
|
135
133
|
scrollLeft += 25;
|
|
136
134
|
}
|
|
@@ -145,12 +143,12 @@ const Tabs = (props) => {
|
|
|
145
143
|
if (ownerDoc === null) {
|
|
146
144
|
return;
|
|
147
145
|
}
|
|
148
|
-
if (!
|
|
146
|
+
if (!overflowOptions?.useOverflow || orientation === 'vertical') {
|
|
149
147
|
ownerDoc.removeEventListener('wheel', enableHorizontalScroll);
|
|
150
148
|
return;
|
|
151
149
|
}
|
|
152
150
|
ownerDoc.addEventListener('wheel', enableHorizontalScroll);
|
|
153
|
-
}, [overflowOptions
|
|
151
|
+
}, [overflowOptions?.useOverflow, orientation, enableHorizontalScroll]);
|
|
154
152
|
const isTabHidden = (activeTab, isVertical) => {
|
|
155
153
|
const ownerDoc = tablistRef.current;
|
|
156
154
|
if (ownerDoc === null) {
|
|
@@ -230,9 +228,9 @@ const Tabs = (props) => {
|
|
|
230
228
|
setTimeout(() => {
|
|
231
229
|
const ownerDoc = tablistRef.current;
|
|
232
230
|
if (ownerDoc !== null &&
|
|
233
|
-
|
|
231
|
+
overflowOptions?.useOverflow &&
|
|
234
232
|
currentActiveIndex !== undefined) {
|
|
235
|
-
const activeTab = ownerDoc.querySelectorAll('
|
|
233
|
+
const activeTab = ownerDoc.querySelectorAll(`.${styles_js_1.default['iui-tab']}`)[currentActiveIndex];
|
|
236
234
|
const isVertical = orientation === 'vertical';
|
|
237
235
|
const tabPlacement = isTabHidden(activeTab, isVertical);
|
|
238
236
|
if (tabPlacement) {
|
|
@@ -241,7 +239,7 @@ const Tabs = (props) => {
|
|
|
241
239
|
}
|
|
242
240
|
}, 50);
|
|
243
241
|
}, [
|
|
244
|
-
overflowOptions
|
|
242
|
+
overflowOptions?.useOverflow,
|
|
245
243
|
currentActiveIndex,
|
|
246
244
|
focusedIndex,
|
|
247
245
|
orientation,
|
|
@@ -277,19 +275,19 @@ const Tabs = (props) => {
|
|
|
277
275
|
}, [orientation, setScrollingPlacement]);
|
|
278
276
|
// apply correct mask when tabs list is resized
|
|
279
277
|
const [resizeRef] = (0, index_js_1.useResizeObserver)(determineScrollingPlacement);
|
|
280
|
-
resizeRef(tablistRef
|
|
278
|
+
resizeRef(tablistRef?.current);
|
|
281
279
|
// check if overflow tabs are scrolled to far edges
|
|
282
280
|
React.useEffect(() => {
|
|
283
281
|
const ownerDoc = tablistRef.current;
|
|
284
282
|
if (ownerDoc === null) {
|
|
285
283
|
return;
|
|
286
284
|
}
|
|
287
|
-
if (!
|
|
285
|
+
if (!overflowOptions?.useOverflow) {
|
|
288
286
|
ownerDoc.removeEventListener('scroll', determineScrollingPlacement);
|
|
289
287
|
return;
|
|
290
288
|
}
|
|
291
289
|
ownerDoc.addEventListener('scroll', determineScrollingPlacement);
|
|
292
|
-
}, [overflowOptions
|
|
290
|
+
}, [overflowOptions?.useOverflow, determineScrollingPlacement]);
|
|
293
291
|
const onTabClick = React.useCallback((index) => {
|
|
294
292
|
if (onTabSelected) {
|
|
295
293
|
onTabSelected(index);
|
|
@@ -305,7 +303,7 @@ const Tabs = (props) => {
|
|
|
305
303
|
const tab = labels[index];
|
|
306
304
|
return React.isValidElement(tab) && tab.props.disabled;
|
|
307
305
|
};
|
|
308
|
-
let newIndex = focusedIndex
|
|
306
|
+
let newIndex = focusedIndex ?? currentActiveIndex;
|
|
309
307
|
/** focus next tab if delta is +1, previous tab if -1 */
|
|
310
308
|
const focusTab = (delta = +1) => {
|
|
311
309
|
do {
|
|
@@ -368,9 +366,8 @@ const Tabs = (props) => {
|
|
|
368
366
|
'aria-selected': index === currentActiveIndex,
|
|
369
367
|
tabIndex: index === currentActiveIndex ? 0 : -1,
|
|
370
368
|
onClick: (args) => {
|
|
371
|
-
var _a, _b;
|
|
372
369
|
onClick();
|
|
373
|
-
|
|
370
|
+
label.props.onClick?.(args);
|
|
374
371
|
},
|
|
375
372
|
}))));
|
|
376
373
|
}, [currentActiveIndex, onTabClick]);
|
|
@@ -380,7 +377,7 @@ const Tabs = (props) => {
|
|
|
380
377
|
'iui-animated': type !== 'default' && isClient,
|
|
381
378
|
'iui-not-animated': type !== 'default' && !isClient,
|
|
382
379
|
'iui-large': hasSublabel,
|
|
383
|
-
}, tabsClassName), "data-iui-overflow": overflowOptions
|
|
380
|
+
}, tabsClassName), "data-iui-overflow": overflowOptions?.useOverflow, "data-iui-scroll-placement": scrollingPlacement, role: 'tablist', ref: refs, onKeyDown: onKeyDown, ...rest }, labels.map((label, index) => createTab(label, index))),
|
|
384
381
|
actions && (React.createElement(index_js_1.Box, { className: 'iui-tabs-actions-wrapper' },
|
|
385
382
|
React.createElement(index_js_1.Box, { className: 'iui-tabs-actions' }, actions))),
|
|
386
383
|
children && (React.createElement(index_js_1.Box, { className: (0, classnames_1.default)('iui-tabs-content', contentClassName), role: 'tabpanel' }, children))));
|
package/cjs/core/Tag/Tag.d.ts
CHANGED
package/cjs/core/Tag/Tag.js
CHANGED
|
@@ -34,7 +34,6 @@ exports.Tag = void 0;
|
|
|
34
34
|
const classnames_1 = __importDefault(require("classnames"));
|
|
35
35
|
const React = __importStar(require("react"));
|
|
36
36
|
const index_js_1 = require("../utils/index.js");
|
|
37
|
-
require("@itwin/itwinui-css/css/tag.css");
|
|
38
37
|
const index_js_2 = require("../Buttons/index.js");
|
|
39
38
|
/**
|
|
40
39
|
* Tag for showing categories, filters etc.
|