@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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import cx from 'classnames';
|
|
7
|
-
import { useIntersection, useMergedRefs, WithCSSTransition, } from '../utils/index.js';
|
|
7
|
+
import { Box, useIntersection, useMergedRefs, WithCSSTransition, } from '../utils/index.js';
|
|
8
8
|
import { TableCell } from './TableCell.js';
|
|
9
9
|
/**
|
|
10
10
|
* Memoization is needed to avoid unnecessary re-renders of all rows when additional data is added when lazy-loading.
|
|
@@ -13,16 +13,13 @@ import { TableCell } from './TableCell.js';
|
|
|
13
13
|
* When adding new features check whether it changes state that affects row. If it does then add equality check to `React.memo`.
|
|
14
14
|
*/
|
|
15
15
|
export const TableRow = (props) => {
|
|
16
|
-
var _a;
|
|
17
16
|
const { row, rowProps, isLast, onRowInViewport, onBottomReached, intersectionMargin, onClick, subComponent, isDisabled, tableHasSubRows, tableInstance, expanderCell, bodyRef, tableRowRef, density, } = props;
|
|
18
17
|
const onIntersect = React.useCallback(() => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
isLast && ((_b = onBottomReached.current) === null || _b === void 0 ? void 0 : _b.call(onBottomReached));
|
|
18
|
+
onRowInViewport.current?.(row.original);
|
|
19
|
+
isLast && onBottomReached.current?.();
|
|
22
20
|
}, [isLast, onBottomReached, onRowInViewport, row.original]);
|
|
23
21
|
const intersectionRoot = React.useMemo(() => {
|
|
24
|
-
|
|
25
|
-
const isTableBodyScrollable = ((_a = bodyRef === null || bodyRef === void 0 ? void 0 : bodyRef.scrollHeight) !== null && _a !== void 0 ? _a : 0) > ((_b = bodyRef === null || bodyRef === void 0 ? void 0 : bodyRef.offsetHeight) !== null && _b !== void 0 ? _b : 0);
|
|
22
|
+
const isTableBodyScrollable = (bodyRef?.scrollHeight ?? 0) > (bodyRef?.offsetHeight ?? 0);
|
|
26
23
|
// If table body is scrollable, make it the intersection root
|
|
27
24
|
if (isTableBodyScrollable) {
|
|
28
25
|
return bodyRef;
|
|
@@ -34,7 +31,7 @@ export const TableRow = (props) => {
|
|
|
34
31
|
rootMargin: `${intersectionMargin}px`,
|
|
35
32
|
root: intersectionRoot,
|
|
36
33
|
});
|
|
37
|
-
const userRowProps =
|
|
34
|
+
const userRowProps = rowProps?.(row) ?? {};
|
|
38
35
|
const { status, isLoading, ...restUserRowProps } = userRowProps;
|
|
39
36
|
const mergedProps = {
|
|
40
37
|
...row.getRowProps({ style: { flex: `0 0 auto`, minWidth: '100%' } }),
|
|
@@ -43,7 +40,7 @@ export const TableRow = (props) => {
|
|
|
43
40
|
className: cx('iui-table-row', {
|
|
44
41
|
'iui-table-row-expanded': row.isExpanded && subComponent,
|
|
45
42
|
'iui-loading': isLoading,
|
|
46
|
-
}, userRowProps
|
|
43
|
+
}, userRowProps?.className),
|
|
47
44
|
'aria-selected': row.isSelected || undefined,
|
|
48
45
|
'aria-disabled': isDisabled || undefined,
|
|
49
46
|
'data-iui-status': status,
|
|
@@ -51,52 +48,48 @@ export const TableRow = (props) => {
|
|
|
51
48
|
};
|
|
52
49
|
const refs = useMergedRefs(intersectionRef, mergedProps.ref, tableRowRef);
|
|
53
50
|
return (React.createElement(React.Fragment, null,
|
|
54
|
-
React.createElement(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
onClick === null || onClick === void 0 ? void 0 : onClick(event, row);
|
|
51
|
+
React.createElement(Box, { ...mergedProps, ref: refs, onClick: (event) => {
|
|
52
|
+
mergedProps?.onClick?.(event);
|
|
53
|
+
onClick?.(event, row);
|
|
58
54
|
} }, row.cells.map((cell, index) => {
|
|
59
55
|
return (React.createElement(TableCell, { key: cell.getCellProps().key, cell: cell, cellIndex: index, isDisabled: isDisabled, tableHasSubRows: tableHasSubRows, tableInstance: tableInstance, expanderCell: expanderCell, density: density }));
|
|
60
56
|
})),
|
|
61
57
|
subComponent && (React.createElement(WithCSSTransition, { in: row.isExpanded },
|
|
62
|
-
React.createElement(
|
|
58
|
+
React.createElement(Box, { className: cx('iui-table-row', 'iui-table-expanded-content'), "aria-disabled": isDisabled }, subComponent(row))))));
|
|
63
59
|
};
|
|
64
60
|
const hasAnySelectedSubRow = (row, selectedRowIds) => {
|
|
65
|
-
if (selectedRowIds
|
|
61
|
+
if (selectedRowIds?.[row.id]) {
|
|
66
62
|
return true;
|
|
67
63
|
}
|
|
68
64
|
return row.subRows.some((subRow) => hasAnySelectedSubRow(subRow, selectedRowIds));
|
|
69
65
|
};
|
|
70
|
-
export const TableRowMemoized = React.memo(TableRow, (prevProp, nextProp) =>
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
nextProp.state.sticky.isScrolledToRight &&
|
|
101
|
-
prevProp.density === nextProp.density;
|
|
102
|
-
});
|
|
66
|
+
export const TableRowMemoized = React.memo(TableRow, (prevProp, nextProp) => prevProp.isLast === nextProp.isLast &&
|
|
67
|
+
prevProp.state.hiddenColumns?.length ===
|
|
68
|
+
nextProp.state.hiddenColumns?.length &&
|
|
69
|
+
!!prevProp.state.hiddenColumns?.every((column, index) => nextProp.state.hiddenColumns?.[index] === column) &&
|
|
70
|
+
prevProp.onRowInViewport === nextProp.onRowInViewport &&
|
|
71
|
+
prevProp.onBottomReached === nextProp.onBottomReached &&
|
|
72
|
+
prevProp.onClick === nextProp.onClick &&
|
|
73
|
+
prevProp.row.original === nextProp.row.original &&
|
|
74
|
+
prevProp.state.selectedRowIds?.[prevProp.row.id] ===
|
|
75
|
+
nextProp.state.selectedRowIds?.[nextProp.row.id] &&
|
|
76
|
+
// Check if sub-rows selection has changed and whether to show indeterminate state or not
|
|
77
|
+
prevProp.row.subRows.some((subRow) => hasAnySelectedSubRow(subRow, prevProp.state.selectedRowIds)) ===
|
|
78
|
+
nextProp.row.subRows.some((subRow) => hasAnySelectedSubRow(subRow, nextProp.state.selectedRowIds)) &&
|
|
79
|
+
prevProp.state.expanded?.[prevProp.row.id] ===
|
|
80
|
+
nextProp.state.expanded?.[nextProp.row.id] &&
|
|
81
|
+
prevProp.subComponent === nextProp.subComponent &&
|
|
82
|
+
prevProp.row.cells.every((cell, index) => nextProp.row.cells[index].column === cell.column) &&
|
|
83
|
+
prevProp.isDisabled === nextProp.isDisabled &&
|
|
84
|
+
prevProp.rowProps === nextProp.rowProps &&
|
|
85
|
+
prevProp.expanderCell === nextProp.expanderCell &&
|
|
86
|
+
prevProp.tableHasSubRows === nextProp.tableHasSubRows &&
|
|
87
|
+
prevProp.bodyRef === nextProp.bodyRef &&
|
|
88
|
+
prevProp.state.columnOrder === nextProp.state.columnOrder &&
|
|
89
|
+
!nextProp.state.columnResizing.isResizingColumn &&
|
|
90
|
+
prevProp.state.isTableResizing === nextProp.state.isTableResizing &&
|
|
91
|
+
prevProp.state.sticky.isScrolledToLeft ===
|
|
92
|
+
nextProp.state.sticky.isScrolledToLeft &&
|
|
93
|
+
prevProp.state.sticky.isScrolledToRight ===
|
|
94
|
+
nextProp.state.sticky.isScrolledToRight &&
|
|
95
|
+
prevProp.density === nextProp.density);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const onExpandHandler = (newState, instance, onExpand) => {
|
|
2
|
-
if (!
|
|
3
|
-
onExpand
|
|
2
|
+
if (!instance?.preFilteredFlatRows.length) {
|
|
3
|
+
onExpand?.([], newState);
|
|
4
4
|
return;
|
|
5
5
|
}
|
|
6
6
|
const expandedData = [];
|
|
@@ -9,5 +9,5 @@ export const onExpandHandler = (newState, instance, onExpand) => {
|
|
|
9
9
|
expandedData.push(row.original);
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
onExpand
|
|
12
|
+
onExpand?.(expandedData, newState);
|
|
13
13
|
};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
export const onFilterHandler = (newState, action, previousState, currentFilter, instance) => {
|
|
2
2
|
const previousFilter = previousState.filters.find((f) => f.id === action.columnId);
|
|
3
|
-
if (
|
|
3
|
+
if (previousFilter?.value != action.filterValue) {
|
|
4
4
|
const filters = newState.filters.map((f) => {
|
|
5
|
-
|
|
6
|
-
const column = instance === null || instance === void 0 ? void 0 : instance.allColumns.find((c) => c.id === f.id);
|
|
5
|
+
const column = instance?.allColumns.find((c) => c.id === f.id);
|
|
7
6
|
return {
|
|
8
7
|
id: f.id,
|
|
9
8
|
value: f.value,
|
|
10
|
-
fieldType:
|
|
11
|
-
filterType:
|
|
9
|
+
fieldType: column?.fieldType ?? 'text',
|
|
10
|
+
filterType: column?.filter ?? 'text',
|
|
12
11
|
};
|
|
13
12
|
});
|
|
14
13
|
return filters;
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* - Validation: Ensures that any disabled/unselectable row/subrow is not selected
|
|
5
5
|
*/
|
|
6
6
|
const onSelectHandler = (newState, instance, onSelect, isRowDisabled) => {
|
|
7
|
-
if (!
|
|
8
|
-
onSelect
|
|
7
|
+
if (!instance?.rows.length) {
|
|
8
|
+
onSelect?.([], newState);
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
const newSelectedRowIds = {};
|
|
12
12
|
const handleRow = (row) => {
|
|
13
|
-
if (isRowDisabled
|
|
13
|
+
if (isRowDisabled?.(row.original)) {
|
|
14
14
|
return false;
|
|
15
15
|
}
|
|
16
16
|
let isAllSubSelected = true;
|
|
@@ -33,7 +33,7 @@ const onSelectHandler = (newState, instance, onSelect, isRowDisabled) => {
|
|
|
33
33
|
instance.initialRows.forEach((row) => handleRow(row));
|
|
34
34
|
const selectedData = getSelectedData(newSelectedRowIds, instance);
|
|
35
35
|
newState.selectedRowIds = newSelectedRowIds;
|
|
36
|
-
onSelect
|
|
36
|
+
onSelect?.(selectedData, newState);
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
39
39
|
* Handles selection when toggling a row (Ctrl click or checkbox click)
|
|
@@ -48,7 +48,7 @@ export const onToggleHandler = (newState, action, instance, onSelect, isRowDisab
|
|
|
48
48
|
*/
|
|
49
49
|
export const onSingleSelectHandler = (state, action, instance, onSelect, isRowDisabled) => {
|
|
50
50
|
const selectedRowIds = { [action.id]: true };
|
|
51
|
-
if (instance
|
|
51
|
+
if (instance?.selectSubRows) {
|
|
52
52
|
const handleRow = (row) => {
|
|
53
53
|
selectedRowIds[row.id] = true;
|
|
54
54
|
row.subRows.forEach((r) => handleRow(r));
|
|
@@ -111,6 +111,6 @@ const getSelectedData = (selectedRowIds, instance) => {
|
|
|
111
111
|
}
|
|
112
112
|
row.initialSubRows.forEach((subRow) => setSelectedData(subRow));
|
|
113
113
|
};
|
|
114
|
-
instance
|
|
114
|
+
instance?.initialRows.forEach((row) => setSelectedData(row));
|
|
115
115
|
return selectedData;
|
|
116
116
|
};
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import cx from 'classnames';
|
|
7
|
+
import { Box } from '../../utils/index.js';
|
|
7
8
|
/**
|
|
8
9
|
* Default cell.
|
|
9
10
|
* It should be passed to `cellRenderer`.
|
|
@@ -19,9 +20,9 @@ export const DefaultCell = (props) => {
|
|
|
19
20
|
// Omitting `cellProps`
|
|
20
21
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
21
22
|
const { cellElementProps: { className: cellElementClassName, style: cellElementStyle, ...cellElementProps }, children, startIcon, endIcon, cellProps, isDisabled, className, style, status, ...rest } = props;
|
|
22
|
-
return (React.createElement(
|
|
23
|
-
startIcon && (React.createElement(
|
|
23
|
+
return (React.createElement(Box, { ...cellElementProps, ...rest, className: cx(cellElementClassName, className), "aria-disabled": isDisabled?.(cellProps.row.original) || undefined, "data-iui-status": status, style: { ...cellElementStyle, ...style } },
|
|
24
|
+
startIcon && (React.createElement(Box, { className: 'iui-table-cell-start-icon' }, startIcon)),
|
|
24
25
|
children,
|
|
25
|
-
endIcon && React.createElement(
|
|
26
|
+
endIcon && React.createElement(Box, { className: 'iui-table-cell-end-icon' }, endIcon)));
|
|
26
27
|
};
|
|
27
28
|
export default DefaultCell;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import { getRandomValue } from '../../utils/index.js';
|
|
6
|
+
import { Box, getRandomValue } from '../../utils/index.js';
|
|
7
7
|
/**
|
|
8
8
|
* Editable cell.
|
|
9
9
|
* It should be passed to `cellRenderer`.
|
|
@@ -26,41 +26,35 @@ export const EditableCell = (props) => {
|
|
|
26
26
|
}, [cellProps.value]);
|
|
27
27
|
const [key, setKey] = React.useState(getRandomValue(10));
|
|
28
28
|
const [isDirty, setIsDirty] = React.useState(false);
|
|
29
|
-
return (React.createElement(
|
|
30
|
-
var _a;
|
|
29
|
+
return (React.createElement(Box, { ...cellElementProps, contentEditable: true, suppressContentEditableWarning: true, key: key, ...rest, onInput: (e) => {
|
|
31
30
|
setValue(sanitizeString(e.target.innerText));
|
|
32
31
|
setIsDirty(true);
|
|
33
|
-
|
|
32
|
+
props.onInput?.(e);
|
|
34
33
|
}, onBlur: (e) => {
|
|
35
|
-
var _a;
|
|
36
34
|
if (isDirty) {
|
|
37
35
|
onCellEdit(cellProps.column.id, value, cellProps.row.original);
|
|
38
36
|
}
|
|
39
|
-
|
|
37
|
+
props.onBlur?.(e);
|
|
40
38
|
// Prevents error when text is cleared.
|
|
41
39
|
// New key makes React to reattach with the DOM so it won't complain about deleted text node.
|
|
42
40
|
setKey(getRandomValue(10));
|
|
43
41
|
}, onKeyDown: (e) => {
|
|
44
|
-
var _a;
|
|
45
42
|
// Prevents from adding HTML elements (div, br) inside a cell on Enter press
|
|
46
43
|
if (e.key === 'Enter') {
|
|
47
44
|
e.preventDefault();
|
|
48
45
|
}
|
|
49
|
-
|
|
46
|
+
props.onKeyDown?.(e);
|
|
50
47
|
}, onPaste: (e) => {
|
|
51
|
-
var _a;
|
|
52
48
|
e.preventDefault();
|
|
53
49
|
document.execCommand('inserttext', false, sanitizeString(e.clipboardData.getData('text/plain')));
|
|
54
|
-
|
|
50
|
+
props.onPaste?.(e);
|
|
55
51
|
}, onDrop: (e) => {
|
|
56
|
-
var _a;
|
|
57
52
|
// Prevents from drag'n'dropping into a cell because it will add unwanted HTML elements
|
|
58
53
|
e.preventDefault();
|
|
59
|
-
|
|
54
|
+
props.onDrop?.(e);
|
|
60
55
|
}, onClick: (e) => {
|
|
61
|
-
var _a;
|
|
62
56
|
e.stopPropagation();
|
|
63
|
-
|
|
57
|
+
props.onClick?.(e);
|
|
64
58
|
} }, children));
|
|
65
59
|
};
|
|
66
60
|
export default EditableCell;
|
|
@@ -71,8 +71,7 @@ export const ActionColumn = ({ columnManager = false, } = {}) => {
|
|
|
71
71
|
// and table is scrolled to the very left which means our visibility dropdown menu is not visible.
|
|
72
72
|
// So for better UX we need to scroll to that dropdown menu.
|
|
73
73
|
queueMicrotask(() => {
|
|
74
|
-
|
|
75
|
-
(_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView();
|
|
74
|
+
buttonRef.current?.scrollIntoView();
|
|
76
75
|
});
|
|
77
76
|
};
|
|
78
77
|
return (React.createElement(MenuItem, { key: column.id, startIcon: React.createElement(Checkbox, { checked: checked, disabled: column.disableToggleVisibility, onClick: (e) => e.stopPropagation(), onChange: onClick, "aria-labelledby": `iui-column-${column.id}` }), onClick: onClick, disabled: column.disableToggleVisibility },
|
|
@@ -82,13 +81,11 @@ export const ActionColumn = ({ columnManager = false, } = {}) => {
|
|
|
82
81
|
? columnManager.dropdownMenuProps
|
|
83
82
|
: {};
|
|
84
83
|
return (React.createElement(DropdownMenu, { ...dropdownMenuProps, menuItems: headerCheckBoxes, onHide: (i) => {
|
|
85
|
-
var _a;
|
|
86
84
|
setIsOpen(false);
|
|
87
|
-
|
|
85
|
+
dropdownMenuProps.onHide?.(i);
|
|
88
86
|
}, onShow: (i) => {
|
|
89
|
-
var _a;
|
|
90
87
|
setIsOpen(true);
|
|
91
|
-
|
|
88
|
+
dropdownMenuProps.onShow?.(i);
|
|
92
89
|
}, className: cx('iui-scroll', dropdownMenuProps.className) },
|
|
93
90
|
React.createElement(IconButton, { styleType: 'borderless', isActive: isOpen, ref: buttonRef },
|
|
94
91
|
React.createElement(SvgColumnManager, null))));
|
|
@@ -44,16 +44,16 @@ export const ExpanderColumn = (props = {}) => {
|
|
|
44
44
|
cellClassName: 'iui-slot',
|
|
45
45
|
Cell: (props) => {
|
|
46
46
|
const { row } = props;
|
|
47
|
-
if (!
|
|
47
|
+
if (!subComponent?.(row)) {
|
|
48
48
|
return null;
|
|
49
49
|
}
|
|
50
50
|
else {
|
|
51
51
|
return (React.createElement(IconButton, { className: 'iui-table-row-expander', styleType: 'borderless', size: 'small', onClick: (e) => {
|
|
52
52
|
e.stopPropagation();
|
|
53
53
|
row.toggleRowExpanded();
|
|
54
|
-
}, disabled: isDisabled
|
|
54
|
+
}, disabled: isDisabled?.(props.row.original) }, React.createElement(SvgChevronRight, null)));
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
|
-
cellRenderer: (props) => (React.createElement(DefaultCell, { ...props, isDisabled: (rowData) => !!
|
|
57
|
+
cellRenderer: (props) => (React.createElement(DefaultCell, { ...props, isDisabled: (rowData) => !!isDisabled?.(rowData) })),
|
|
58
58
|
};
|
|
59
59
|
};
|
|
@@ -32,14 +32,14 @@ export const SelectionColumn = (props = {}) => {
|
|
|
32
32
|
columnClassName: 'iui-slot',
|
|
33
33
|
cellClassName: 'iui-slot',
|
|
34
34
|
Header: ({ getToggleAllRowsSelectedProps, toggleAllRowsSelected, rows, initialRows, state, }) => {
|
|
35
|
-
const disabled = rows.every((row) => isDisabled
|
|
36
|
-
const checked = initialRows.every((row) => state.selectedRowIds[row.id] ||
|
|
35
|
+
const disabled = rows.every((row) => isDisabled?.(row.original));
|
|
36
|
+
const checked = initialRows.every((row) => state.selectedRowIds[row.id] || isDisabled?.(row.original));
|
|
37
37
|
const indeterminate = !checked && Object.keys(state.selectedRowIds).length > 0;
|
|
38
38
|
return (React.createElement(Checkbox, { ...getToggleAllRowsSelectedProps(), style: {}, title: '' // Removes default title that comes from react-table
|
|
39
39
|
, checked: checked && !disabled, indeterminate: indeterminate, disabled: disabled, onChange: () => toggleAllRowsSelected(!rows.some((row) => row.isSelected)) }));
|
|
40
40
|
},
|
|
41
41
|
Cell: ({ row }) => (React.createElement(Checkbox, { ...row.getToggleRowSelectedProps(), style: {}, title: '' // Removes default title that comes from react-table
|
|
42
|
-
, disabled: isDisabled
|
|
43
|
-
cellRenderer: (props) => (React.createElement(DefaultCell, { ...props, isDisabled: (rowData) => !!
|
|
42
|
+
, disabled: isDisabled?.(row.original), onClick: (e) => e.stopPropagation() })),
|
|
43
|
+
cellRenderer: (props) => (React.createElement(DefaultCell, { ...props, isDisabled: (rowData) => !!isDisabled?.(rowData) })),
|
|
44
44
|
};
|
|
45
45
|
};
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import cx from 'classnames';
|
|
7
|
-
import '
|
|
8
|
-
import { useGlobals } from '../../utils/index.js';
|
|
7
|
+
import { Box, useGlobals } from '../../utils/index.js';
|
|
9
8
|
/**
|
|
10
9
|
* Filter wrapper that should be used when creating custom filters.
|
|
11
10
|
* @example
|
|
@@ -23,7 +22,7 @@ import { useGlobals } from '../../utils/index.js';
|
|
|
23
22
|
export const BaseFilter = (props) => {
|
|
24
23
|
const { children, className, style, id } = props;
|
|
25
24
|
useGlobals();
|
|
26
|
-
return (React.createElement(
|
|
25
|
+
return (React.createElement(Box, { className: cx('iui-table-column-filter', className), style: style,
|
|
27
26
|
// Prevents from triggering sort
|
|
28
27
|
onClick: (e) => {
|
|
29
28
|
e.stopPropagation();
|
|
@@ -27,10 +27,9 @@ const DatePickerInput = (props) => {
|
|
|
27
27
|
const [isVisible, setIsVisible] = React.useState(false);
|
|
28
28
|
const close = React.useCallback(() => setIsVisible(false), []);
|
|
29
29
|
const onDateSelected = React.useCallback((date) => {
|
|
30
|
-
var _a;
|
|
31
30
|
onChange(date);
|
|
32
31
|
close();
|
|
33
|
-
|
|
32
|
+
buttonRef.current?.focus();
|
|
34
33
|
}, [close, onChange]);
|
|
35
34
|
const onInputChange = React.useCallback((event) => {
|
|
36
35
|
const value = event.target.value;
|
|
@@ -44,8 +43,7 @@ const DatePickerInput = (props) => {
|
|
|
44
43
|
}
|
|
45
44
|
}, [onChange, parseInput]);
|
|
46
45
|
return (React.createElement(Popover, { content: React.createElement(DatePicker, { date: date, onChange: onDateSelected, setFocus: true, isDateDisabled: isDateDisabled }), placement: 'bottom', visible: isVisible, onClickOutside: (_, e) => {
|
|
47
|
-
|
|
48
|
-
if (!((_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
|
|
46
|
+
if (!buttonRef.current?.contains(e.target)) {
|
|
49
47
|
close();
|
|
50
48
|
}
|
|
51
49
|
}, 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;
|
|
@@ -6,7 +6,6 @@ import * as React from 'react';
|
|
|
6
6
|
import { useGlobals } from '../../../utils/index.js';
|
|
7
7
|
import { FilterButtonBar } from '../FilterButtonBar.js';
|
|
8
8
|
import { BaseFilter } from '../BaseFilter.js';
|
|
9
|
-
import '@itwin/itwinui-css/css/table.css';
|
|
10
9
|
import DatePickerInput from './DatePickerInput.js';
|
|
11
10
|
const defaultStrings = {
|
|
12
11
|
from: 'From',
|
|
@@ -28,11 +27,10 @@ const defaultParseInput = (text) => {
|
|
|
28
27
|
return new Date('');
|
|
29
28
|
};
|
|
30
29
|
export const DateRangeFilter = (props) => {
|
|
31
|
-
var _a, _b, _c, _d;
|
|
32
30
|
const { column, translatedLabels, setFilter, clearFilter, formatDate = defaultFormatDate, parseInput = defaultParseInput, placeholder = 'MMM dd, yyyy', } = props;
|
|
33
31
|
useGlobals();
|
|
34
32
|
const translatedStrings = { ...defaultStrings, ...translatedLabels };
|
|
35
|
-
const [from, setFrom] = React.useState(
|
|
33
|
+
const [from, setFrom] = React.useState(column.filterValue?.[0] ? new Date(column.filterValue?.[0]) : undefined);
|
|
36
34
|
const onFromChange = React.useCallback((date) => {
|
|
37
35
|
setFrom((prevDate) => {
|
|
38
36
|
if (prevDate || !date) {
|
|
@@ -41,7 +39,7 @@ export const DateRangeFilter = (props) => {
|
|
|
41
39
|
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0, 0);
|
|
42
40
|
});
|
|
43
41
|
}, []);
|
|
44
|
-
const [to, setTo] = React.useState(
|
|
42
|
+
const [to, setTo] = React.useState(column.filterValue?.[1] ? new Date(column.filterValue?.[1]) : undefined);
|
|
45
43
|
const onToChange = React.useCallback((date) => {
|
|
46
44
|
setTo((prevDate) => {
|
|
47
45
|
if (prevDate || !date) {
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import cx from 'classnames';
|
|
7
|
-
import '
|
|
8
|
-
import { useGlobals } from '../../utils/index.js';
|
|
7
|
+
import { Box, useGlobals } from '../../utils/index.js';
|
|
9
8
|
import { Button } from '../../Buttons/index.js';
|
|
10
9
|
const defaultStrings = {
|
|
11
10
|
filter: 'Filter',
|
|
@@ -20,7 +19,7 @@ export const FilterButtonBar = (props) => {
|
|
|
20
19
|
const { children, setFilter, clearFilter, translatedLabels, className, style, id, } = props;
|
|
21
20
|
const translatedStrings = { ...defaultStrings, ...translatedLabels };
|
|
22
21
|
useGlobals();
|
|
23
|
-
return (React.createElement(
|
|
22
|
+
return (React.createElement(Box, { className: cx('iui-button-bar', className), style: style, id: id },
|
|
24
23
|
children,
|
|
25
24
|
React.createElement(Button, { styleType: 'high-visibility', onClick: setFilter }, translatedStrings.filter),
|
|
26
25
|
React.createElement(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>;
|
|
@@ -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/table.css';
|
|
8
7
|
import { useGlobals, Popover, SvgFilterHollow, SvgFilter, } from '../../utils/index.js';
|
|
9
8
|
import { IconButton } from '../../Buttons/index.js';
|
|
10
9
|
/**
|
|
@@ -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;
|
|
@@ -6,19 +6,17 @@ import * as React from 'react';
|
|
|
6
6
|
import { useGlobals } from '../../../utils/index.js';
|
|
7
7
|
import { FilterButtonBar } from '../FilterButtonBar.js';
|
|
8
8
|
import { BaseFilter } from '../BaseFilter.js';
|
|
9
|
-
import '@itwin/itwinui-css/css/table.css';
|
|
10
9
|
import { LabeledInput } from '../../../LabeledInput/index.js';
|
|
11
10
|
const defaultStrings = {
|
|
12
11
|
from: 'From',
|
|
13
12
|
to: 'To',
|
|
14
13
|
};
|
|
15
14
|
export const NumberRangeFilter = (props) => {
|
|
16
|
-
var _a, _b, _c, _d;
|
|
17
15
|
const { column, translatedLabels, setFilter, clearFilter } = props;
|
|
18
16
|
useGlobals();
|
|
19
17
|
const translatedStrings = { ...defaultStrings, ...translatedLabels };
|
|
20
|
-
const [from, setFrom] = React.useState(
|
|
21
|
-
const [to, setTo] = React.useState(
|
|
18
|
+
const [from, setFrom] = React.useState(column.filterValue?.[0] ?? '');
|
|
19
|
+
const [to, setTo] = React.useState(column.filterValue?.[1] ?? '');
|
|
22
20
|
const parseInputValue = (value) => {
|
|
23
21
|
return !value || isNaN(Number(value)) ? undefined : Number(value);
|
|
24
22
|
};
|
|
@@ -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> & {
|
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import '@itwin/itwinui-css/css/table.css';
|
|
7
6
|
import { useGlobals } from '../../../utils/index.js';
|
|
8
7
|
import { Input } from '../../../Input/index.js';
|
|
9
8
|
import { FilterButtonBar } from '../FilterButtonBar.js';
|
|
10
9
|
import { BaseFilter } from '../BaseFilter.js';
|
|
11
10
|
export const TextFilter = (props) => {
|
|
12
|
-
var _a;
|
|
13
11
|
const { column, translatedLabels, setFilter, clearFilter } = props;
|
|
14
12
|
useGlobals();
|
|
15
|
-
const [text, setText] = React.useState(
|
|
13
|
+
const [text, setText] = React.useState(column.filterValue ?? '');
|
|
16
14
|
const onKeyDown = (event) => {
|
|
17
15
|
if (event.altKey) {
|
|
18
16
|
return;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { actions, makePropGetter, useGetLatest } from 'react-table';
|
|
2
|
+
import styles from '../../../styles.js';
|
|
2
3
|
const REORDER_ACTIONS = {
|
|
3
4
|
columnDragStart: 'columnDragStart',
|
|
4
5
|
columnDragEnd: 'columnDragEnd',
|
|
@@ -20,13 +21,13 @@ const defaultGetDragAndDropProps = (isEnabled) => (props, { instance, header, })
|
|
|
20
21
|
};
|
|
21
22
|
const setOnDragColumnStyle = (event, position) => {
|
|
22
23
|
const columnElement = event.currentTarget;
|
|
23
|
-
columnElement.classList.remove('iui-table-reorder-column-right');
|
|
24
|
-
columnElement.classList.remove('iui-table-reorder-column-left');
|
|
24
|
+
columnElement.classList.remove(styles['iui-table-reorder-column-right']);
|
|
25
|
+
columnElement.classList.remove(styles['iui-table-reorder-column-left']);
|
|
25
26
|
if (position === 'left') {
|
|
26
|
-
columnElement.classList.add('iui-table-reorder-column-left');
|
|
27
|
+
columnElement.classList.add(styles['iui-table-reorder-column-left']);
|
|
27
28
|
}
|
|
28
29
|
else if (position === 'right') {
|
|
29
|
-
columnElement.classList.add('iui-table-reorder-column-right');
|
|
30
|
+
columnElement.classList.add(styles['iui-table-reorder-column-right']);
|
|
30
31
|
}
|
|
31
32
|
};
|
|
32
33
|
const reorderColumns = (tableColumns, srcIndex, dstIndex) => {
|