@itwin/itwinui-react 2.0.0-dev.2 → 2.0.0-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -1
- package/cjs/core/Alert/Alert.js +8 -30
- package/cjs/core/Avatar/Avatar.js +10 -33
- package/cjs/core/AvatarGroup/AvatarGroup.js +18 -43
- package/cjs/core/Backdrop/Backdrop.js +6 -28
- package/cjs/core/Badge/Badge.js +13 -31
- package/cjs/core/Breadcrumbs/Breadcrumbs.js +14 -40
- package/cjs/core/ButtonGroup/ButtonGroup.js +10 -32
- package/cjs/core/Buttons/Button/Button.js +6 -28
- package/cjs/core/Buttons/DropdownButton/DropdownButton.js +14 -36
- package/cjs/core/Buttons/IconButton/IconButton.js +6 -28
- package/cjs/core/Buttons/IdeasButton/IdeasButton.js +6 -28
- package/cjs/core/Buttons/SplitButton/SplitButton.js +14 -36
- package/cjs/core/Carousel/Carousel.js +38 -63
- package/cjs/core/Carousel/CarouselContext.js +1 -1
- package/cjs/core/Carousel/CarouselDot.js +6 -28
- package/cjs/core/Carousel/CarouselDotsList.js +33 -60
- package/cjs/core/Carousel/CarouselNavigation.js +22 -44
- package/cjs/core/Carousel/CarouselSlide.js +12 -34
- package/cjs/core/Carousel/CarouselSlider.js +26 -51
- package/cjs/core/Checkbox/Checkbox.js +18 -42
- package/cjs/core/ColorPicker/ColorBuilder.js +51 -73
- package/cjs/core/ColorPicker/ColorInputPanel.js +64 -88
- package/cjs/core/ColorPicker/ColorPalette.js +26 -50
- package/cjs/core/ColorPicker/ColorPicker.js +25 -49
- package/cjs/core/ColorPicker/ColorPickerContext.js +3 -3
- package/cjs/core/ColorPicker/ColorSwatch.js +13 -34
- package/cjs/core/ComboBox/ComboBox.js +67 -93
- package/cjs/core/ComboBox/ComboBoxDropdown.d.ts +1 -1
- package/cjs/core/ComboBox/ComboBoxDropdown.js +13 -36
- package/cjs/core/ComboBox/ComboBoxEndIcon.js +12 -34
- package/cjs/core/ComboBox/ComboBoxInput.js +28 -50
- package/cjs/core/ComboBox/ComboBoxInputContainer.js +9 -31
- package/cjs/core/ComboBox/ComboBoxMenu.js +35 -60
- package/cjs/core/ComboBox/ComboBoxMenuItem.js +11 -33
- package/cjs/core/ComboBox/helpers.js +11 -19
- package/cjs/core/DatePicker/DatePicker.js +87 -111
- package/cjs/core/Dialog/Dialog.js +28 -48
- package/cjs/core/Dialog/DialogBackdrop.js +16 -35
- package/cjs/core/Dialog/DialogButtonBar.js +6 -28
- package/cjs/core/Dialog/DialogContent.js +6 -28
- package/cjs/core/Dialog/DialogContext.js +2 -2
- package/cjs/core/Dialog/DialogDragContext.js +6 -15
- package/cjs/core/Dialog/DialogMain.js +52 -59
- package/cjs/core/Dialog/DialogTitleBar.js +14 -36
- package/cjs/core/Dialog/DialogTitleBarTitle.js +6 -28
- package/cjs/core/DropdownMenu/DropdownMenu.js +14 -36
- package/cjs/core/ExpandableBlock/ExpandableBlock.js +12 -34
- package/cjs/core/Fieldset/Fieldset.js +9 -33
- package/cjs/core/FileUpload/FileUpload.js +13 -35
- package/cjs/core/FileUpload/FileUploadTemplate.js +4 -4
- package/cjs/core/Footer/Footer.js +21 -49
- package/cjs/core/Footer/FooterItem.js +6 -28
- package/cjs/core/Footer/FooterList.js +6 -28
- package/cjs/core/Footer/FooterSeparator.js +6 -28
- package/cjs/core/Header/Header.js +10 -32
- package/cjs/core/Header/HeaderBasicButton.js +6 -28
- package/cjs/core/Header/HeaderBreadcrumbs.js +9 -39
- package/cjs/core/Header/HeaderButton.js +22 -36
- package/cjs/core/Header/HeaderDropdownButton.js +14 -36
- package/cjs/core/Header/HeaderLogo.js +7 -29
- package/cjs/core/Header/HeaderSplitButton.js +13 -35
- package/cjs/core/InformationPanel/InformationPanel.js +15 -37
- package/cjs/core/InformationPanel/InformationPanelBody.js +6 -28
- package/cjs/core/InformationPanel/InformationPanelContent.js +6 -28
- package/cjs/core/InformationPanel/InformationPanelHeader.js +7 -29
- package/cjs/core/InformationPanel/InformationPanelWrapper.js +6 -28
- package/cjs/core/Input/Input.js +9 -31
- package/cjs/core/InputGroup/InputGroup.js +6 -28
- package/cjs/core/Label/Label.js +7 -29
- package/cjs/core/LabeledInput/LabeledInput.js +7 -29
- package/cjs/core/LabeledSelect/LabeledSelect.js +7 -29
- package/cjs/core/LabeledTextarea/LabeledTextarea.js +7 -29
- package/cjs/core/Menu/Menu.js +18 -40
- package/cjs/core/Menu/MenuDivider.js +6 -28
- package/cjs/core/Menu/MenuExtraContent.js +6 -28
- package/cjs/core/Menu/MenuItem.js +17 -39
- package/cjs/core/Menu/MenuItemSkeleton.js +11 -30
- package/cjs/core/Modal/Modal.js +12 -30
- package/cjs/core/Modal/ModalButtonBar.js +1 -1
- package/cjs/core/Modal/ModalContent.js +1 -1
- package/cjs/core/{ErrorPage → NonIdealState}/ErrorPage.d.ts +5 -1
- package/cjs/core/NonIdealState/ErrorPage.js +144 -0
- package/cjs/core/NonIdealState/NonIdealState.d.ts +46 -0
- package/cjs/core/NonIdealState/NonIdealState.js +32 -0
- package/{esm/core/ErrorPage → cjs/core/NonIdealState}/index.d.ts +3 -1
- package/cjs/core/{ErrorPage → NonIdealState}/index.js +4 -2
- package/cjs/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +11 -34
- package/cjs/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +13 -37
- package/cjs/core/Radio/Radio.js +10 -33
- package/cjs/core/RadioTiles/RadioTile.js +9 -31
- package/cjs/core/RadioTiles/RadioTileGroup.js +6 -28
- package/cjs/core/Select/Select.js +59 -72
- package/cjs/core/Select/SelectTag.js +6 -28
- package/cjs/core/SideNavigation/SideNavigation.js +14 -40
- package/cjs/core/SideNavigation/SidenavButton.js +8 -30
- package/cjs/core/SideNavigation/SidenavSubmenu.js +6 -28
- package/cjs/core/SideNavigation/SidenavSubmenuHeader.js +6 -28
- package/cjs/core/SkipToContentLink/SkipToContentLink.js +6 -28
- package/cjs/core/Slider/Slider.js +68 -96
- package/cjs/core/Slider/Thumb.js +20 -39
- package/cjs/core/Slider/Track.js +24 -44
- package/cjs/core/StatusMessage/StatusMessage.js +6 -7
- package/cjs/core/Stepper/Stepper.js +10 -34
- package/cjs/core/Stepper/StepperStep.js +15 -34
- package/cjs/core/Stepper/Wizard.js +6 -28
- package/cjs/core/Stepper/WorkflowDiagram.js +6 -28
- package/cjs/core/Stepper/WorkflowDiagramStep.js +6 -28
- package/cjs/core/Surface/Surface.js +11 -30
- package/cjs/core/Table/SubRowExpander.js +6 -6
- package/cjs/core/Table/Table.d.ts +19 -24
- package/cjs/core/Table/Table.js +189 -195
- package/cjs/core/Table/TableCell.js +29 -30
- package/cjs/core/Table/TablePaginator.js +52 -83
- package/cjs/core/Table/TableRowMemoized.d.ts +6 -10
- package/cjs/core/Table/TableRowMemoized.js +36 -60
- package/cjs/core/Table/actionHandlers/expandHandler.js +3 -3
- package/cjs/core/Table/actionHandlers/filterHandler.js +4 -4
- package/cjs/core/Table/actionHandlers/resizeHandler.js +13 -15
- package/cjs/core/Table/actionHandlers/selectHandler.js +35 -40
- package/cjs/core/Table/cells/DefaultCell.js +5 -27
- package/cjs/core/Table/cells/EditableCell.js +16 -40
- package/cjs/core/Table/columns/actionColumn.js +44 -62
- package/cjs/core/Table/columns/expanderColumn.d.ts +2 -5
- package/cjs/core/Table/columns/expanderColumn.js +12 -27
- package/cjs/core/Table/columns/selectionColumn.d.ts +2 -5
- package/cjs/core/Table/columns/selectionColumn.js +16 -37
- package/cjs/core/Table/filters/BaseFilter.js +6 -6
- package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +19 -41
- package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +20 -31
- package/cjs/core/Table/filters/FilterButtonBar.js +8 -19
- package/cjs/core/Table/filters/FilterToggle.js +15 -37
- package/cjs/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +16 -29
- package/cjs/core/Table/filters/TextFilter/TextFilter.js +11 -11
- package/cjs/core/Table/filters/customFilterFunctions.js +11 -13
- package/cjs/core/Table/filters/defaultFilterFunctions.js +62 -64
- package/cjs/core/Table/filters/tableFilters.js +7 -18
- package/cjs/core/Table/hooks/useColumnDragAndDrop.js +41 -53
- package/cjs/core/Table/hooks/useExpanderCell.js +17 -33
- package/cjs/core/Table/hooks/useResizeColumns.js +197 -205
- package/cjs/core/Table/hooks/useScrollToRow.js +11 -12
- package/cjs/core/Table/hooks/useSelectionCell.js +7 -18
- package/cjs/core/Table/hooks/useStickyColumns.js +28 -33
- package/cjs/core/Table/hooks/useSubRowFiltering.js +37 -57
- package/cjs/core/Table/hooks/useSubRowSelection.js +10 -12
- package/cjs/core/Table/utils.js +15 -26
- package/cjs/core/Tabs/Tab.js +6 -28
- package/cjs/core/Tabs/Tabs.js +45 -67
- package/cjs/core/Tag/Tag.js +8 -30
- package/cjs/core/Tag/TagContainer.js +9 -32
- package/cjs/core/Textarea/Textarea.js +9 -31
- package/cjs/core/ThemeProvider/ThemeProvider.d.ts +1 -0
- package/cjs/core/ThemeProvider/ThemeProvider.js +16 -37
- package/cjs/core/Tile/Tile.js +29 -58
- package/cjs/core/TimePicker/TimePicker.js +59 -97
- package/cjs/core/Toast/Toast.js +45 -65
- package/cjs/core/Toast/ToastWrapper.js +13 -24
- package/cjs/core/Toast/Toaster.js +87 -137
- package/cjs/core/Toast/index.js +2 -2
- package/cjs/core/ToggleSwitch/ToggleSwitch.js +10 -32
- package/cjs/core/Tooltip/Tooltip.js +6 -28
- package/cjs/core/Tree/Tree.js +58 -80
- package/cjs/core/Tree/TreeContext.js +3 -3
- package/cjs/core/Tree/TreeNode.js +21 -43
- package/cjs/core/Tree/TreeNodeExpander.js +7 -29
- package/cjs/core/Typography/Anchor/Anchor.js +5 -28
- package/cjs/core/Typography/Blockquote/Blockquote.js +6 -28
- package/cjs/core/Typography/Body/Body.js +7 -29
- package/cjs/core/Typography/Code/Code.js +6 -28
- package/cjs/core/Typography/Headline/Headline.js +6 -28
- package/cjs/core/Typography/Kbd/Kbd.js +6 -28
- package/cjs/core/Typography/Leading/Leading.js +6 -28
- package/cjs/core/Typography/Small/Small.js +6 -28
- package/cjs/core/Typography/Subheading/Subheading.js +6 -28
- package/cjs/core/Typography/Text/Text.js +11 -34
- package/cjs/core/Typography/Title/Title.js +6 -28
- package/cjs/core/index.d.ts +2 -2
- package/cjs/core/index.js +6 -5
- package/cjs/core/utils/color/ColorValue.js +146 -156
- package/cjs/core/utils/components/FocusTrap.js +14 -14
- package/cjs/core/utils/components/InputContainer.js +12 -36
- package/cjs/core/utils/components/MiddleTextTruncation.js +15 -31
- package/cjs/core/utils/components/Popover.d.ts +1 -1
- package/cjs/core/utils/components/Popover.js +57 -60
- package/cjs/core/utils/components/Resizer.js +51 -51
- package/cjs/core/utils/components/VirtualScroll.js +72 -89
- package/cjs/core/utils/components/VisuallyHidden.js +6 -28
- package/cjs/core/utils/components/WithCSSTransition.d.ts +2 -2
- package/cjs/core/utils/components/WithCSSTransition.js +18 -40
- package/cjs/core/utils/functions/colors.js +7 -7
- package/cjs/core/utils/functions/dom.js +7 -8
- package/cjs/core/utils/functions/focusable.js +11 -15
- package/cjs/core/utils/functions/numbers.js +5 -6
- package/cjs/core/utils/functions/styles.js +3 -3
- package/cjs/core/utils/hooks/useContainerWidth.js +9 -13
- package/cjs/core/utils/hooks/useDragAndDrop.js +32 -33
- package/cjs/core/utils/hooks/useEventListener.js +7 -7
- package/cjs/core/utils/hooks/useIntersection.js +9 -12
- package/cjs/core/utils/hooks/useIsomorphicLayoutEffect.js +1 -1
- package/cjs/core/utils/hooks/useLatestRef.js +4 -4
- package/cjs/core/utils/hooks/useMediaQuery.js +9 -12
- package/cjs/core/utils/hooks/useMergedRefs.js +6 -23
- package/cjs/core/utils/hooks/useOverflow.js +26 -33
- package/cjs/core/utils/hooks/useResizeObserver.js +6 -9
- package/cjs/core/utils/hooks/useSafeContext.js +4 -4
- package/cjs/core/utils/hooks/useTheme.js +18 -20
- package/cjs/core/utils/icons/StatusIconMap.js +9 -20
- package/cjs/core/utils/icons/SvgCalendar.js +3 -14
- package/cjs/core/utils/icons/SvgCaretDownSmall.js +3 -14
- package/cjs/core/utils/icons/SvgCaretRightSmall.js +3 -14
- package/cjs/core/utils/icons/SvgCaretUpSmall.js +3 -14
- package/cjs/core/utils/icons/SvgCheckmark.js +3 -14
- package/cjs/core/utils/icons/SvgCheckmarkSmall.js +3 -14
- package/cjs/core/utils/icons/SvgChevronLeft.js +3 -14
- package/cjs/core/utils/icons/SvgChevronLeftDouble.js +3 -14
- package/cjs/core/utils/icons/SvgChevronRight.js +3 -14
- package/cjs/core/utils/icons/SvgChevronRightDouble.js +3 -14
- package/cjs/core/utils/icons/SvgClose.js +3 -14
- package/cjs/core/utils/icons/SvgCloseSmall.js +3 -14
- package/cjs/core/utils/icons/SvgColumnManager.js +3 -14
- package/cjs/core/utils/icons/SvgFilter.js +3 -14
- package/cjs/core/utils/icons/SvgFilterHollow.js +3 -14
- package/cjs/core/utils/icons/SvgImportantSmall.js +3 -14
- package/cjs/core/utils/icons/SvgInfoCircular.js +3 -14
- package/cjs/core/utils/icons/SvgMore.js +3 -14
- package/cjs/core/utils/icons/SvgMoreVertical.js +3 -14
- package/cjs/core/utils/icons/SvgNew.js +3 -14
- package/cjs/core/utils/icons/SvgSmileyHappy.js +3 -14
- package/cjs/core/utils/icons/SvgSortDown.js +3 -14
- package/cjs/core/utils/icons/SvgSortUp.js +3 -14
- package/cjs/core/utils/icons/SvgStatusError.js +3 -14
- package/cjs/core/utils/icons/SvgStatusSuccess.js +3 -14
- package/cjs/core/utils/icons/SvgStatusWarning.js +3 -14
- package/cjs/core/utils/icons/SvgSwap.js +3 -14
- package/cjs/core/utils/icons/SvgUpload.js +3 -14
- package/cjs/types/react-table-config.d.ts +1 -1
- package/esm/core/Alert/Alert.js +5 -27
- package/esm/core/Avatar/Avatar.js +9 -32
- package/esm/core/AvatarGroup/AvatarGroup.js +16 -41
- package/esm/core/Backdrop/Backdrop.js +3 -25
- package/esm/core/Badge/Badge.js +10 -28
- package/esm/core/Breadcrumbs/Breadcrumbs.js +11 -37
- package/esm/core/ButtonGroup/ButtonGroup.js +7 -29
- package/esm/core/Buttons/Button/Button.js +3 -25
- package/esm/core/Buttons/DropdownButton/DropdownButton.js +9 -31
- package/esm/core/Buttons/IconButton/IconButton.js +3 -25
- package/esm/core/Buttons/IdeasButton/IdeasButton.js +3 -25
- package/esm/core/Buttons/SplitButton/SplitButton.js +8 -30
- package/esm/core/Carousel/Carousel.js +29 -54
- package/esm/core/Carousel/CarouselContext.js +1 -1
- package/esm/core/Carousel/CarouselDot.js +4 -26
- package/esm/core/Carousel/CarouselDotsList.js +28 -55
- package/esm/core/Carousel/CarouselNavigation.js +16 -38
- package/esm/core/Carousel/CarouselSlide.js +8 -30
- package/esm/core/Carousel/CarouselSlider.js +22 -47
- package/esm/core/Checkbox/Checkbox.js +14 -38
- package/esm/core/ColorPicker/ColorBuilder.js +46 -68
- package/esm/core/ColorPicker/ColorInputPanel.js +58 -82
- package/esm/core/ColorPicker/ColorPalette.js +20 -44
- package/esm/core/ColorPicker/ColorPicker.js +21 -45
- package/esm/core/ColorPicker/ColorPickerContext.js +3 -3
- package/esm/core/ColorPicker/ColorSwatch.js +9 -30
- package/esm/core/ComboBox/ComboBox.js +55 -81
- package/esm/core/ComboBox/ComboBoxDropdown.d.ts +1 -1
- package/esm/core/ComboBox/ComboBoxDropdown.js +10 -33
- package/esm/core/ComboBox/ComboBoxEndIcon.js +8 -30
- package/esm/core/ComboBox/ComboBoxInput.js +24 -46
- package/esm/core/ComboBox/ComboBoxInputContainer.js +5 -27
- package/esm/core/ComboBox/ComboBoxMenu.js +29 -54
- package/esm/core/ComboBox/ComboBoxMenuItem.js +7 -29
- package/esm/core/ComboBox/helpers.js +13 -21
- package/esm/core/DatePicker/DatePicker.js +82 -106
- package/esm/core/Dialog/Dialog.js +19 -39
- package/esm/core/Dialog/DialogBackdrop.js +11 -30
- package/esm/core/Dialog/DialogButtonBar.js +3 -25
- package/esm/core/Dialog/DialogContent.js +3 -25
- package/esm/core/Dialog/DialogContext.js +2 -2
- package/esm/core/Dialog/DialogDragContext.js +6 -15
- package/esm/core/Dialog/DialogMain.js +45 -52
- package/esm/core/Dialog/DialogTitleBar.js +7 -29
- package/esm/core/Dialog/DialogTitleBarTitle.js +3 -25
- package/esm/core/DropdownMenu/DropdownMenu.js +11 -33
- package/esm/core/ExpandableBlock/ExpandableBlock.js +9 -31
- package/esm/core/Fieldset/Fieldset.js +6 -30
- package/esm/core/FileUpload/FileUpload.js +10 -32
- package/esm/core/FileUpload/FileUploadTemplate.js +2 -2
- package/esm/core/Footer/Footer.js +16 -44
- package/esm/core/Footer/FooterItem.js +3 -25
- package/esm/core/Footer/FooterList.js +3 -25
- package/esm/core/Footer/FooterSeparator.js +3 -25
- package/esm/core/Header/Header.js +5 -27
- package/esm/core/Header/HeaderBasicButton.js +3 -25
- package/esm/core/Header/HeaderBreadcrumbs.js +7 -37
- package/esm/core/Header/HeaderButton.js +16 -30
- package/esm/core/Header/HeaderDropdownButton.js +9 -31
- package/esm/core/Header/HeaderLogo.js +4 -26
- package/esm/core/Header/HeaderSplitButton.js +8 -30
- package/esm/core/InformationPanel/InformationPanel.js +12 -34
- package/esm/core/InformationPanel/InformationPanelBody.js +3 -25
- package/esm/core/InformationPanel/InformationPanelContent.js +3 -25
- package/esm/core/InformationPanel/InformationPanelHeader.js +3 -25
- package/esm/core/InformationPanel/InformationPanelWrapper.js +3 -25
- package/esm/core/Input/Input.js +6 -28
- package/esm/core/InputGroup/InputGroup.js +4 -26
- package/esm/core/Label/Label.js +4 -26
- package/esm/core/LabeledInput/LabeledInput.js +4 -26
- package/esm/core/LabeledSelect/LabeledSelect.js +4 -26
- package/esm/core/LabeledTextarea/LabeledTextarea.js +4 -26
- package/esm/core/Menu/Menu.js +15 -37
- package/esm/core/Menu/MenuDivider.js +3 -25
- package/esm/core/Menu/MenuExtraContent.js +3 -25
- package/esm/core/Menu/MenuItem.js +13 -35
- package/esm/core/Menu/MenuItemSkeleton.js +8 -27
- package/esm/core/Modal/Modal.js +8 -26
- package/esm/core/Modal/ModalButtonBar.js +1 -1
- package/esm/core/Modal/ModalContent.js +1 -1
- package/esm/core/{ErrorPage → NonIdealState}/ErrorPage.d.ts +5 -1
- package/esm/core/NonIdealState/ErrorPage.js +137 -0
- package/esm/core/NonIdealState/NonIdealState.d.ts +46 -0
- package/esm/core/NonIdealState/NonIdealState.js +25 -0
- package/{cjs/core/ErrorPage → esm/core/NonIdealState}/index.d.ts +3 -1
- package/esm/core/{ErrorPage → NonIdealState}/index.js +2 -1
- package/esm/core/ProgressIndicators/ProgressLinear/ProgressLinear.js +8 -31
- package/esm/core/ProgressIndicators/ProgressRadial/ProgressRadial.js +10 -34
- package/esm/core/Radio/Radio.js +7 -30
- package/esm/core/RadioTiles/RadioTile.js +6 -28
- package/esm/core/RadioTiles/RadioTileGroup.js +3 -25
- package/esm/core/Select/Select.js +53 -66
- package/esm/core/Select/SelectTag.js +3 -25
- package/esm/core/SideNavigation/SideNavigation.js +9 -35
- package/esm/core/SideNavigation/SidenavButton.js +4 -26
- package/esm/core/SideNavigation/SidenavSubmenu.js +3 -25
- package/esm/core/SideNavigation/SidenavSubmenuHeader.js +3 -25
- package/esm/core/SkipToContentLink/SkipToContentLink.js +3 -25
- package/esm/core/Slider/Slider.js +63 -91
- package/esm/core/Slider/Thumb.js +17 -36
- package/esm/core/Slider/Track.js +23 -43
- package/esm/core/StatusMessage/StatusMessage.js +3 -4
- package/esm/core/Stepper/Stepper.js +7 -31
- package/esm/core/Stepper/StepperStep.js +12 -31
- package/esm/core/Stepper/Wizard.js +3 -25
- package/esm/core/Stepper/WorkflowDiagram.js +3 -25
- package/esm/core/Stepper/WorkflowDiagramStep.js +3 -25
- package/esm/core/Surface/Surface.js +8 -27
- package/esm/core/Table/SubRowExpander.js +3 -3
- package/esm/core/Table/Table.d.ts +19 -24
- package/esm/core/Table/Table.js +177 -183
- package/esm/core/Table/TableCell.js +23 -24
- package/esm/core/Table/TablePaginator.js +46 -77
- package/esm/core/Table/TableRowMemoized.d.ts +6 -10
- package/esm/core/Table/TableRowMemoized.js +32 -56
- package/esm/core/Table/actionHandlers/expandHandler.js +3 -3
- package/esm/core/Table/actionHandlers/filterHandler.js +4 -4
- package/esm/core/Table/actionHandlers/resizeHandler.js +13 -15
- package/esm/core/Table/actionHandlers/selectHandler.js +35 -40
- package/esm/core/Table/cells/DefaultCell.js +3 -25
- package/esm/core/Table/cells/EditableCell.js +14 -38
- package/esm/core/Table/columns/actionColumn.js +34 -52
- package/esm/core/Table/columns/expanderColumn.d.ts +2 -5
- package/esm/core/Table/columns/expanderColumn.js +9 -24
- package/esm/core/Table/columns/selectionColumn.d.ts +2 -5
- package/esm/core/Table/columns/selectionColumn.js +14 -35
- package/esm/core/Table/filters/BaseFilter.js +3 -3
- package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +14 -36
- package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +15 -26
- package/esm/core/Table/filters/FilterButtonBar.js +4 -15
- package/esm/core/Table/filters/FilterToggle.js +11 -33
- package/esm/core/Table/filters/NumberRangeFilter/NumberRangeFilter.js +11 -24
- package/esm/core/Table/filters/TextFilter/TextFilter.js +6 -6
- package/esm/core/Table/filters/customFilterFunctions.js +12 -14
- package/esm/core/Table/filters/defaultFilterFunctions.js +63 -65
- package/esm/core/Table/filters/tableFilters.js +4 -15
- package/esm/core/Table/hooks/useColumnDragAndDrop.js +40 -52
- package/esm/core/Table/hooks/useExpanderCell.js +15 -31
- package/esm/core/Table/hooks/useResizeColumns.js +196 -204
- package/esm/core/Table/hooks/useScrollToRow.js +10 -11
- package/esm/core/Table/hooks/useSelectionCell.js +6 -17
- package/esm/core/Table/hooks/useStickyColumns.js +27 -32
- package/esm/core/Table/hooks/useSubRowFiltering.js +35 -55
- package/esm/core/Table/hooks/useSubRowSelection.js +9 -11
- package/esm/core/Table/utils.js +15 -26
- package/esm/core/Tabs/Tab.js +3 -25
- package/esm/core/Tabs/Tabs.js +41 -63
- package/esm/core/Tag/Tag.js +4 -26
- package/esm/core/Tag/TagContainer.js +6 -29
- package/esm/core/Textarea/Textarea.js +6 -28
- package/esm/core/ThemeProvider/ThemeProvider.d.ts +1 -0
- package/esm/core/ThemeProvider/ThemeProvider.js +15 -36
- package/esm/core/Tile/Tile.js +23 -52
- package/esm/core/TimePicker/TimePicker.js +56 -94
- package/esm/core/Toast/Toast.js +41 -61
- package/esm/core/Toast/ToastWrapper.js +10 -21
- package/esm/core/Toast/Toaster.js +83 -134
- package/esm/core/Toast/index.js +1 -1
- package/esm/core/ToggleSwitch/ToggleSwitch.js +7 -29
- package/esm/core/Tooltip/Tooltip.js +3 -25
- package/esm/core/Tree/Tree.js +54 -76
- package/esm/core/Tree/TreeContext.js +3 -3
- package/esm/core/Tree/TreeNode.js +16 -38
- package/esm/core/Tree/TreeNodeExpander.js +3 -25
- package/esm/core/Typography/Anchor/Anchor.js +2 -25
- package/esm/core/Typography/Blockquote/Blockquote.js +3 -25
- package/esm/core/Typography/Body/Body.js +4 -26
- package/esm/core/Typography/Code/Code.js +3 -25
- package/esm/core/Typography/Headline/Headline.js +3 -25
- package/esm/core/Typography/Kbd/Kbd.js +4 -26
- package/esm/core/Typography/Leading/Leading.js +3 -25
- package/esm/core/Typography/Small/Small.js +3 -25
- package/esm/core/Typography/Subheading/Subheading.js +3 -25
- package/esm/core/Typography/Text/Text.js +8 -31
- package/esm/core/Typography/Title/Title.js +3 -25
- package/esm/core/index.d.ts +2 -2
- package/esm/core/index.js +1 -1
- package/esm/core/utils/color/ColorValue.js +145 -156
- package/esm/core/utils/components/FocusTrap.js +11 -11
- package/esm/core/utils/components/InputContainer.js +10 -34
- package/esm/core/utils/components/MiddleTextTruncation.js +13 -29
- package/esm/core/utils/components/Popover.d.ts +1 -1
- package/esm/core/utils/components/Popover.js +54 -57
- package/esm/core/utils/components/Resizer.js +49 -49
- package/esm/core/utils/components/VirtualScroll.js +69 -86
- package/esm/core/utils/components/VisuallyHidden.js +3 -25
- package/esm/core/utils/components/WithCSSTransition.d.ts +2 -2
- package/esm/core/utils/components/WithCSSTransition.js +16 -38
- package/esm/core/utils/functions/colors.js +8 -8
- package/esm/core/utils/functions/dom.js +7 -8
- package/esm/core/utils/functions/focusable.js +11 -15
- package/esm/core/utils/functions/numbers.js +5 -6
- package/esm/core/utils/functions/styles.js +3 -3
- package/esm/core/utils/hooks/useContainerWidth.js +6 -10
- package/esm/core/utils/hooks/useDragAndDrop.js +28 -29
- package/esm/core/utils/hooks/useEventListener.js +6 -6
- package/esm/core/utils/hooks/useIntersection.js +7 -10
- package/esm/core/utils/hooks/useIsomorphicLayoutEffect.js +1 -1
- package/esm/core/utils/hooks/useLatestRef.js +3 -3
- package/esm/core/utils/hooks/useMediaQuery.js +6 -9
- package/esm/core/utils/hooks/useMergedRefs.js +5 -22
- package/esm/core/utils/hooks/useOverflow.js +23 -30
- package/esm/core/utils/hooks/useResizeObserver.js +4 -7
- package/esm/core/utils/hooks/useSafeContext.js +3 -3
- package/esm/core/utils/hooks/useTheme.js +14 -16
- package/esm/core/utils/icons/StatusIconMap.js +5 -16
- package/esm/core/utils/icons/SvgCalendar.js +2 -13
- package/esm/core/utils/icons/SvgCaretDownSmall.js +2 -13
- package/esm/core/utils/icons/SvgCaretRightSmall.js +2 -13
- package/esm/core/utils/icons/SvgCaretUpSmall.js +2 -13
- package/esm/core/utils/icons/SvgCheckmark.js +2 -13
- package/esm/core/utils/icons/SvgCheckmarkSmall.js +2 -13
- package/esm/core/utils/icons/SvgChevronLeft.js +2 -13
- package/esm/core/utils/icons/SvgChevronLeftDouble.js +2 -13
- package/esm/core/utils/icons/SvgChevronRight.js +2 -13
- package/esm/core/utils/icons/SvgChevronRightDouble.js +2 -13
- package/esm/core/utils/icons/SvgClose.js +2 -13
- package/esm/core/utils/icons/SvgCloseSmall.js +2 -13
- package/esm/core/utils/icons/SvgColumnManager.js +2 -13
- package/esm/core/utils/icons/SvgFilter.js +2 -13
- package/esm/core/utils/icons/SvgFilterHollow.js +2 -13
- package/esm/core/utils/icons/SvgImportantSmall.js +2 -13
- package/esm/core/utils/icons/SvgInfoCircular.js +2 -13
- package/esm/core/utils/icons/SvgMore.js +2 -13
- package/esm/core/utils/icons/SvgMoreVertical.js +2 -13
- package/esm/core/utils/icons/SvgNew.js +2 -13
- package/esm/core/utils/icons/SvgSmileyHappy.js +2 -13
- package/esm/core/utils/icons/SvgSortDown.js +2 -13
- package/esm/core/utils/icons/SvgSortUp.js +2 -13
- package/esm/core/utils/icons/SvgStatusError.js +2 -13
- package/esm/core/utils/icons/SvgStatusSuccess.js +2 -13
- package/esm/core/utils/icons/SvgStatusWarning.js +2 -13
- package/esm/core/utils/icons/SvgSwap.js +2 -13
- package/esm/core/utils/icons/SvgUpload.js +2 -13
- package/esm/types/react-table-config.d.ts +1 -1
- package/package.json +3 -3
- package/cjs/core/ErrorPage/ErrorPage.js +0 -168
- package/esm/core/ErrorPage/ErrorPage.js +0 -161
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
1
|
/*---------------------------------------------------------------------------------------------
|
|
24
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
25
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -32,24 +10,24 @@ import { IconButton } from '../../Buttons';
|
|
|
32
10
|
/**
|
|
33
11
|
* Handles showing filter icon and opening filter component.
|
|
34
12
|
*/
|
|
35
|
-
export
|
|
36
|
-
|
|
13
|
+
export const FilterToggle = (props) => {
|
|
14
|
+
const { column, className, ...rest } = props;
|
|
37
15
|
useTheme();
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
16
|
+
const [isVisible, setIsVisible] = React.useState(false);
|
|
17
|
+
const close = React.useCallback(() => setIsVisible(false), []);
|
|
18
|
+
const setFilter = React.useCallback((filterValue) => {
|
|
41
19
|
column.setFilter(filterValue);
|
|
42
20
|
close();
|
|
43
21
|
}, [close, column]);
|
|
44
|
-
|
|
22
|
+
const clearFilter = React.useCallback(() => {
|
|
45
23
|
column.setFilter(undefined);
|
|
46
24
|
close();
|
|
47
25
|
}, [close, column]);
|
|
48
|
-
|
|
49
|
-
return (React.createElement(React.Fragment, null, column.canFilter && column.Filter && (React.createElement(Popover, { content: column.render('Filter', { close
|
|
50
|
-
React.createElement(IconButton,
|
|
51
|
-
setIsVisible(
|
|
26
|
+
const isColumnFiltered = column.filterValue != null && column.filterValue !== '';
|
|
27
|
+
return (React.createElement(React.Fragment, null, column.canFilter && column.Filter && (React.createElement(Popover, { content: column.render('Filter', { close, setFilter, clearFilter }), placement: 'bottom-start', visible: isVisible, onClickOutside: close },
|
|
28
|
+
React.createElement(IconButton, { styleType: 'borderless', isActive: isVisible || isColumnFiltered, className: cx('iui-table-filter-button', className), onClick: (e) => {
|
|
29
|
+
setIsVisible((v) => !v);
|
|
52
30
|
// Prevents from triggering sort
|
|
53
31
|
e.stopPropagation();
|
|
54
|
-
}
|
|
32
|
+
}, ...rest }, isColumnFiltered ? React.createElement(SvgFilter, null) : React.createElement(SvgFilterHollow, null))))));
|
|
55
33
|
};
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
/*---------------------------------------------------------------------------------------------
|
|
13
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
14
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -19,29 +8,27 @@ import { FilterButtonBar, } from '../FilterButtonBar';
|
|
|
19
8
|
import { BaseFilter } from '../BaseFilter';
|
|
20
9
|
import '@itwin/itwinui-css/css/table.css';
|
|
21
10
|
import { LabeledInput } from '../../../LabeledInput';
|
|
22
|
-
|
|
11
|
+
const defaultStrings = {
|
|
23
12
|
from: 'From',
|
|
24
13
|
to: 'To',
|
|
25
14
|
};
|
|
26
|
-
export
|
|
15
|
+
export const NumberRangeFilter = (props) => {
|
|
27
16
|
var _a, _b, _c, _d;
|
|
28
|
-
|
|
17
|
+
const { column, translatedLabels, setFilter, clearFilter } = props;
|
|
29
18
|
useTheme();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
const translatedStrings = { ...defaultStrings, ...translatedLabels };
|
|
20
|
+
const [from, setFrom] = React.useState((_b = (_a = column.filterValue) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : '');
|
|
21
|
+
const [to, setTo] = React.useState((_d = (_c = column.filterValue) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : '');
|
|
22
|
+
const parseInputValue = (value) => {
|
|
34
23
|
return !value || isNaN(Number(value)) ? undefined : Number(value);
|
|
35
24
|
};
|
|
36
|
-
|
|
25
|
+
const onKeyDown = (event) => {
|
|
37
26
|
if (event.key === 'Enter') {
|
|
38
27
|
setFilter([parseInputValue(from), parseInputValue(to)]);
|
|
39
28
|
}
|
|
40
29
|
};
|
|
41
30
|
return (React.createElement(BaseFilter, null,
|
|
42
|
-
React.createElement(LabeledInput, { label: translatedStrings.from, value: from, onChange:
|
|
43
|
-
React.createElement(LabeledInput, { label: translatedStrings.to, value: to, onChange:
|
|
44
|
-
React.createElement(FilterButtonBar, { setFilter:
|
|
45
|
-
return setFilter([parseInputValue(from), parseInputValue(to)]);
|
|
46
|
-
}, clearFilter: clearFilter, translatedLabels: translatedLabels })));
|
|
31
|
+
React.createElement(LabeledInput, { label: translatedStrings.from, value: from, onChange: (e) => setFrom(e.target.value), onKeyDown: onKeyDown, type: 'number', displayStyle: 'inline', setFocus: true }),
|
|
32
|
+
React.createElement(LabeledInput, { label: translatedStrings.to, value: to, onChange: (e) => setTo(e.target.value), type: 'number', displayStyle: 'inline', onKeyDown: onKeyDown }),
|
|
33
|
+
React.createElement(FilterButtonBar, { setFilter: () => setFilter([parseInputValue(from), parseInputValue(to)]), clearFilter: clearFilter, translatedLabels: translatedLabels })));
|
|
47
34
|
};
|
|
@@ -8,17 +8,17 @@ import { useTheme } from '../../../utils';
|
|
|
8
8
|
import { Input } from '../../../Input';
|
|
9
9
|
import { FilterButtonBar, } from '../FilterButtonBar';
|
|
10
10
|
import { BaseFilter } from '../BaseFilter';
|
|
11
|
-
export
|
|
11
|
+
export const TextFilter = (props) => {
|
|
12
12
|
var _a;
|
|
13
|
-
|
|
13
|
+
const { column, translatedLabels, setFilter, clearFilter } = props;
|
|
14
14
|
useTheme();
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const [text, setText] = React.useState((_a = column.filterValue) !== null && _a !== void 0 ? _a : '');
|
|
16
|
+
const onKeyDown = (event) => {
|
|
17
17
|
if (event.key === 'Enter') {
|
|
18
18
|
setFilter(text);
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
return (React.createElement(BaseFilter, null,
|
|
22
|
-
React.createElement(Input, { value: text, onChange:
|
|
23
|
-
React.createElement(FilterButtonBar, { setFilter:
|
|
22
|
+
React.createElement(Input, { value: text, onChange: (e) => setText(e.target.value), onKeyDown: onKeyDown, setFocus: true }),
|
|
23
|
+
React.createElement(FilterButtonBar, { setFilter: () => setFilter(text), clearFilter: clearFilter, translatedLabels: translatedLabels })));
|
|
24
24
|
};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
return !!date && !isNaN(date.valueOf());
|
|
3
|
-
};
|
|
1
|
+
const isValidDate = (date) => !!date && !isNaN(date.valueOf());
|
|
4
2
|
/**
|
|
5
3
|
* Filters dates.
|
|
6
4
|
* @param rows Table rows
|
|
@@ -8,14 +6,14 @@ var isValidDate = function (date) {
|
|
|
8
6
|
* @param filterValue Filter value
|
|
9
7
|
* @returns Filtered rows
|
|
10
8
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return rows.filter(
|
|
17
|
-
return ids.some(
|
|
18
|
-
|
|
9
|
+
const betweenDate = (rows, ids, filterValue) => {
|
|
10
|
+
const [min, max] = filterValue || [];
|
|
11
|
+
const MAX_DATE_VALUE = 8640000000000000;
|
|
12
|
+
const minValue = (isValidDate(min) ? min : new Date(-MAX_DATE_VALUE));
|
|
13
|
+
const maxValue = (isValidDate(max) ? max : new Date(MAX_DATE_VALUE));
|
|
14
|
+
return rows.filter((row) => {
|
|
15
|
+
return ids.some((id) => {
|
|
16
|
+
const rowValue = row.values[id];
|
|
19
17
|
return (rowValue.valueOf() >= minValue.valueOf() &&
|
|
20
18
|
rowValue.valueOf() <= maxValue.valueOf());
|
|
21
19
|
});
|
|
@@ -24,9 +22,9 @@ var betweenDate = function (rows, ids, filterValue) {
|
|
|
24
22
|
/**
|
|
25
23
|
* Filter is not being set if filter value is invalid.
|
|
26
24
|
*/
|
|
27
|
-
betweenDate.autoRemove =
|
|
25
|
+
betweenDate.autoRemove = (val) => {
|
|
28
26
|
return !val || (!isValidDate(val[0]) && !isValidDate(val[1]));
|
|
29
27
|
};
|
|
30
|
-
export
|
|
31
|
-
betweenDate
|
|
28
|
+
export const customFilterFunctions = {
|
|
29
|
+
betweenDate,
|
|
32
30
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
rows = rows.filter(
|
|
3
|
-
return ids.some(
|
|
4
|
-
|
|
1
|
+
const text = (rows, ids, filterValue) => {
|
|
2
|
+
rows = rows.filter((row) => {
|
|
3
|
+
return ids.some((id) => {
|
|
4
|
+
const rowValue = row.values[id];
|
|
5
5
|
return String(rowValue)
|
|
6
6
|
.toLowerCase()
|
|
7
7
|
.includes(String(filterValue).toLowerCase());
|
|
@@ -9,114 +9,112 @@ var text = function (rows, ids, filterValue) {
|
|
|
9
9
|
});
|
|
10
10
|
return rows;
|
|
11
11
|
};
|
|
12
|
-
text.autoRemove =
|
|
13
|
-
|
|
14
|
-
return rows.filter(
|
|
15
|
-
return ids.some(
|
|
16
|
-
|
|
12
|
+
text.autoRemove = (val) => !val;
|
|
13
|
+
const exactText = (rows, ids, filterValue) => {
|
|
14
|
+
return rows.filter((row) => {
|
|
15
|
+
return ids.some((id) => {
|
|
16
|
+
const rowValue = row.values[id];
|
|
17
17
|
return rowValue !== undefined
|
|
18
18
|
? String(rowValue).toLowerCase() === String(filterValue).toLowerCase()
|
|
19
19
|
: true;
|
|
20
20
|
});
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
|
-
exactText.autoRemove =
|
|
24
|
-
|
|
25
|
-
return rows.filter(
|
|
26
|
-
return ids.some(
|
|
27
|
-
|
|
23
|
+
exactText.autoRemove = (val) => !val;
|
|
24
|
+
const exactTextCase = (rows, ids, filterValue) => {
|
|
25
|
+
return rows.filter((row) => {
|
|
26
|
+
return ids.some((id) => {
|
|
27
|
+
const rowValue = row.values[id];
|
|
28
28
|
return rowValue !== undefined
|
|
29
29
|
? String(rowValue) === String(filterValue)
|
|
30
30
|
: true;
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
|
-
exactTextCase.autoRemove =
|
|
35
|
-
|
|
36
|
-
return rows.filter(
|
|
37
|
-
return ids.some(
|
|
38
|
-
|
|
34
|
+
exactTextCase.autoRemove = (val) => !val;
|
|
35
|
+
const includes = (rows, ids, filterValue) => {
|
|
36
|
+
return rows.filter((row) => {
|
|
37
|
+
return ids.some((id) => {
|
|
38
|
+
const rowValue = row.values[id];
|
|
39
39
|
return rowValue.includes(filterValue);
|
|
40
40
|
});
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
|
-
includes.autoRemove =
|
|
44
|
-
|
|
45
|
-
return rows.filter(
|
|
46
|
-
return ids.some(
|
|
47
|
-
|
|
43
|
+
includes.autoRemove = (val) => !val || !val.length;
|
|
44
|
+
const includesAll = (rows, ids, filterValue) => {
|
|
45
|
+
return rows.filter((row) => {
|
|
46
|
+
return ids.some((id) => {
|
|
47
|
+
const rowValue = row.values[id];
|
|
48
48
|
return (rowValue &&
|
|
49
49
|
rowValue.length &&
|
|
50
|
-
filterValue.every(
|
|
50
|
+
filterValue.every((val) => rowValue.includes(val)));
|
|
51
51
|
});
|
|
52
52
|
});
|
|
53
53
|
};
|
|
54
|
-
includesAll.autoRemove =
|
|
55
|
-
|
|
56
|
-
return rows.filter(
|
|
57
|
-
return ids.some(
|
|
58
|
-
|
|
54
|
+
includesAll.autoRemove = (val) => !val || !val.length;
|
|
55
|
+
const includesSome = (rows, ids, filterValue) => {
|
|
56
|
+
return rows.filter((row) => {
|
|
57
|
+
return ids.some((id) => {
|
|
58
|
+
const rowValue = row.values[id];
|
|
59
59
|
return (rowValue &&
|
|
60
60
|
rowValue.length &&
|
|
61
|
-
filterValue.some(
|
|
61
|
+
filterValue.some((val) => rowValue.includes(val)));
|
|
62
62
|
});
|
|
63
63
|
});
|
|
64
64
|
};
|
|
65
|
-
includesSome.autoRemove =
|
|
66
|
-
|
|
67
|
-
return rows.filter(
|
|
68
|
-
return ids.some(
|
|
69
|
-
|
|
65
|
+
includesSome.autoRemove = (val) => !val || !val.length;
|
|
66
|
+
const includesValue = (rows, ids, filterValue) => {
|
|
67
|
+
return rows.filter((row) => {
|
|
68
|
+
return ids.some((id) => {
|
|
69
|
+
const rowValue = row.values[id];
|
|
70
70
|
return filterValue.includes(rowValue);
|
|
71
71
|
});
|
|
72
72
|
});
|
|
73
73
|
};
|
|
74
|
-
includesValue.autoRemove =
|
|
75
|
-
|
|
76
|
-
return rows.filter(
|
|
77
|
-
return ids.some(
|
|
78
|
-
|
|
74
|
+
includesValue.autoRemove = (val) => !val || !val.length;
|
|
75
|
+
const exact = (rows, ids, filterValue) => {
|
|
76
|
+
return rows.filter((row) => {
|
|
77
|
+
return ids.some((id) => {
|
|
78
|
+
const rowValue = row.values[id];
|
|
79
79
|
return rowValue === filterValue;
|
|
80
80
|
});
|
|
81
81
|
});
|
|
82
82
|
};
|
|
83
|
-
exact.autoRemove =
|
|
84
|
-
|
|
85
|
-
return rows.filter(
|
|
86
|
-
return ids.some(
|
|
87
|
-
|
|
83
|
+
exact.autoRemove = (val) => typeof val === 'undefined';
|
|
84
|
+
const equals = (rows, ids, filterValue) => {
|
|
85
|
+
return rows.filter((row) => {
|
|
86
|
+
return ids.some((id) => {
|
|
87
|
+
const rowValue = row.values[id];
|
|
88
88
|
// eslint-disable-next-line eqeqeq
|
|
89
89
|
return rowValue == filterValue;
|
|
90
90
|
});
|
|
91
91
|
});
|
|
92
92
|
};
|
|
93
|
-
equals.autoRemove =
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
equals.autoRemove = (val) => val == null;
|
|
94
|
+
const between = (rows, ids, filterValue) => {
|
|
95
|
+
let [min, max] = filterValue || [];
|
|
96
96
|
min = typeof min === 'number' ? min : -Infinity;
|
|
97
97
|
max = typeof max === 'number' ? max : Infinity;
|
|
98
98
|
if (min > max) {
|
|
99
|
-
|
|
99
|
+
const temp = min;
|
|
100
100
|
min = max;
|
|
101
101
|
max = temp;
|
|
102
102
|
}
|
|
103
|
-
return rows.filter(
|
|
104
|
-
return ids.some(
|
|
105
|
-
|
|
103
|
+
return rows.filter((row) => {
|
|
104
|
+
return ids.some((id) => {
|
|
105
|
+
const rowValue = row.values[id];
|
|
106
106
|
return rowValue >= min && rowValue <= max;
|
|
107
107
|
});
|
|
108
108
|
});
|
|
109
109
|
};
|
|
110
|
-
between.autoRemove =
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
includesValue: includesValue,
|
|
121
|
-
between: between,
|
|
110
|
+
between.autoRemove = (val) => !val || (typeof val[0] !== 'number' && typeof val[1] !== 'number');
|
|
111
|
+
export const defaultFilterFunctions = {
|
|
112
|
+
text,
|
|
113
|
+
exactText,
|
|
114
|
+
exactTextCase,
|
|
115
|
+
includes,
|
|
116
|
+
includesAll,
|
|
117
|
+
includesSome,
|
|
118
|
+
includesValue,
|
|
119
|
+
between,
|
|
122
120
|
};
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
/*---------------------------------------------------------------------------------------------
|
|
13
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
14
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -17,12 +6,12 @@ import React from 'react';
|
|
|
17
6
|
import { DateRangeFilter, } from './DateRangeFilter/DateRangeFilter';
|
|
18
7
|
import { NumberRangeFilter, } from './NumberRangeFilter/NumberRangeFilter';
|
|
19
8
|
import { TextFilter } from './TextFilter/TextFilter';
|
|
20
|
-
export
|
|
9
|
+
export const tableFilters = {
|
|
21
10
|
/**
|
|
22
11
|
* Basic filter with a single input field.
|
|
23
12
|
* @param translatedLabels Translated filter labels.
|
|
24
13
|
*/
|
|
25
|
-
TextFilter:
|
|
14
|
+
TextFilter: (translatedLabels) => (props) => React.createElement(TextFilter, { ...props, translatedLabels: translatedLabels }),
|
|
26
15
|
/**
|
|
27
16
|
* Date range filter.
|
|
28
17
|
*
|
|
@@ -33,7 +22,7 @@ export var tableFilters = {
|
|
|
33
22
|
* If your data is different type e.g. `string`, you can use `accessor` property in column description:
|
|
34
23
|
* `accessor: (rowData) => new Date(rowData.date)`.
|
|
35
24
|
*/
|
|
36
|
-
DateRangeFilter:
|
|
25
|
+
DateRangeFilter: (options) => (props) => React.createElement(DateRangeFilter, { ...props, ...options }),
|
|
37
26
|
/**
|
|
38
27
|
* Number range filter.
|
|
39
28
|
*
|
|
@@ -42,5 +31,5 @@ export var tableFilters = {
|
|
|
42
31
|
* `accessor: (rowData) => Number(rowData.numberProp)`.
|
|
43
32
|
* @param translatedLabels Translated filter labels.
|
|
44
33
|
*/
|
|
45
|
-
NumberRangeFilter:
|
|
34
|
+
NumberRangeFilter: (translatedLabels) => (props) => React.createElement(NumberRangeFilter, { ...props, translatedLabels: translatedLabels }),
|
|
46
35
|
};
|
|
@@ -1,46 +1,25 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
-
if (ar || !(i in from)) {
|
|
15
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
-
ar[i] = from[i];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
-
};
|
|
21
1
|
import { actions, makePropGetter, useGetLatest, } from 'react-table';
|
|
22
|
-
|
|
2
|
+
const REORDER_ACTIONS = {
|
|
23
3
|
columnDragStart: 'columnDragStart',
|
|
24
4
|
columnDragEnd: 'columnDragEnd',
|
|
25
5
|
};
|
|
26
|
-
export
|
|
6
|
+
export const useColumnDragAndDrop = (isEnabled) => (hooks) => {
|
|
27
7
|
hooks.getDragAndDropProps = [defaultGetDragAndDropProps(isEnabled)];
|
|
28
8
|
hooks.stateReducers.push(reducer);
|
|
29
9
|
hooks.useInstance.push(useInstance);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
var instance = _a.instance, header = _a.header;
|
|
10
|
+
};
|
|
11
|
+
const defaultGetDragAndDropProps = (isEnabled) => (props, { instance, header, }) => {
|
|
33
12
|
if (!isEnabled || header.disableReordering) {
|
|
34
13
|
return props;
|
|
35
14
|
}
|
|
36
|
-
|
|
15
|
+
const onDragStart = () => {
|
|
37
16
|
instance.dispatch({
|
|
38
17
|
type: REORDER_ACTIONS.columnDragStart,
|
|
39
18
|
columnIndex: instance.flatHeaders.indexOf(header),
|
|
40
19
|
});
|
|
41
20
|
};
|
|
42
|
-
|
|
43
|
-
|
|
21
|
+
const setOnDragColumnStyle = (event, position) => {
|
|
22
|
+
const columnElement = event.currentTarget;
|
|
44
23
|
columnElement.classList.remove('iui-table-reorder-column-right');
|
|
45
24
|
columnElement.classList.remove('iui-table-reorder-column-left');
|
|
46
25
|
if (position === 'left') {
|
|
@@ -50,28 +29,28 @@ var defaultGetDragAndDropProps = function (isEnabled) { return function (props,
|
|
|
50
29
|
columnElement.classList.add('iui-table-reorder-column-right');
|
|
51
30
|
}
|
|
52
31
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
32
|
+
const reorderColumns = (tableColumns, srcIndex, dstIndex) => {
|
|
33
|
+
const newTableColumns = [...tableColumns];
|
|
34
|
+
const [removed] = newTableColumns.splice(srcIndex, 1);
|
|
56
35
|
newTableColumns.splice(dstIndex, 0, removed);
|
|
57
36
|
return newTableColumns;
|
|
58
37
|
};
|
|
59
|
-
|
|
38
|
+
const onDragOver = (event) => {
|
|
60
39
|
event.preventDefault();
|
|
61
|
-
|
|
40
|
+
const headerIndex = instance.flatHeaders.indexOf(header);
|
|
62
41
|
if (instance.state.columnReorderStartIndex !== headerIndex) {
|
|
63
42
|
setOnDragColumnStyle(event, instance.state.columnReorderStartIndex > headerIndex ? 'left' : 'right');
|
|
64
43
|
}
|
|
65
44
|
};
|
|
66
|
-
|
|
45
|
+
const onDragLeave = (event) => {
|
|
67
46
|
setOnDragColumnStyle(event);
|
|
68
47
|
};
|
|
69
|
-
|
|
48
|
+
const onDrop = (event) => {
|
|
70
49
|
event.preventDefault();
|
|
71
50
|
setOnDragColumnStyle(event);
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
51
|
+
const columnIds = instance.flatHeaders.map((x) => x.id);
|
|
52
|
+
const srcIndex = instance.state.columnReorderStartIndex;
|
|
53
|
+
const dstIndex = columnIds.findIndex((x) => x === header.id);
|
|
75
54
|
if (srcIndex === dstIndex || srcIndex === -1 || dstIndex === -1) {
|
|
76
55
|
return;
|
|
77
56
|
}
|
|
@@ -85,32 +64,41 @@ var defaultGetDragAndDropProps = function (isEnabled) { return function (props,
|
|
|
85
64
|
props,
|
|
86
65
|
{
|
|
87
66
|
draggable: true,
|
|
88
|
-
onDragStart
|
|
89
|
-
onDragOver
|
|
90
|
-
onDragLeave
|
|
91
|
-
onDrop
|
|
67
|
+
onDragStart,
|
|
68
|
+
onDragOver,
|
|
69
|
+
onDragLeave,
|
|
70
|
+
onDrop,
|
|
92
71
|
},
|
|
93
72
|
];
|
|
94
|
-
};
|
|
95
|
-
|
|
73
|
+
};
|
|
74
|
+
const reducer = (newState, action) => {
|
|
96
75
|
switch (action.type) {
|
|
97
76
|
case actions.init:
|
|
98
|
-
return
|
|
77
|
+
return {
|
|
78
|
+
...newState,
|
|
79
|
+
columnReorderStartIndex: -1,
|
|
80
|
+
};
|
|
99
81
|
case REORDER_ACTIONS.columnDragStart:
|
|
100
|
-
return
|
|
82
|
+
return {
|
|
83
|
+
...newState,
|
|
84
|
+
columnReorderStartIndex: action.columnIndex,
|
|
85
|
+
};
|
|
101
86
|
case REORDER_ACTIONS.columnDragEnd:
|
|
102
|
-
return
|
|
87
|
+
return {
|
|
88
|
+
...newState,
|
|
89
|
+
columnReorderStartIndex: -1,
|
|
90
|
+
};
|
|
103
91
|
default:
|
|
104
92
|
return newState;
|
|
105
93
|
}
|
|
106
94
|
};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
flatHeaders.forEach(
|
|
95
|
+
const useInstance = (instance) => {
|
|
96
|
+
const { flatHeaders, getHooks } = instance;
|
|
97
|
+
const getInstance = useGetLatest(instance);
|
|
98
|
+
flatHeaders.forEach((header) => {
|
|
111
99
|
header.getDragAndDropProps = makePropGetter(getHooks().getDragAndDropProps, {
|
|
112
100
|
instance: getInstance(),
|
|
113
|
-
header
|
|
101
|
+
header,
|
|
114
102
|
});
|
|
115
103
|
});
|
|
116
104
|
};
|
|
@@ -1,46 +1,30 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
-
if (ar || !(i in from)) {
|
|
15
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
-
ar[i] = from[i];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
-
};
|
|
21
1
|
/*---------------------------------------------------------------------------------------------
|
|
22
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
23
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
24
4
|
*--------------------------------------------------------------------------------------------*/
|
|
25
5
|
import React from 'react';
|
|
26
6
|
import { ExpanderColumn, EXPANDER_CELL_ID } from '../columns';
|
|
27
|
-
export
|
|
7
|
+
export const useExpanderCell = (subComponent, expanderCell, isRowDisabled) => (hooks) => {
|
|
28
8
|
if (!subComponent) {
|
|
29
9
|
return;
|
|
30
10
|
}
|
|
31
|
-
hooks.allColumns.push(
|
|
32
|
-
|
|
11
|
+
hooks.allColumns.push((columns) => {
|
|
12
|
+
const hasExpanderColumn = columns.find((c) => c.id === EXPANDER_CELL_ID);
|
|
33
13
|
if (hasExpanderColumn) {
|
|
34
14
|
return columns;
|
|
35
15
|
}
|
|
36
|
-
|
|
37
|
-
subComponent
|
|
16
|
+
const expanderColumn = ExpanderColumn({
|
|
17
|
+
subComponent,
|
|
38
18
|
isDisabled: isRowDisabled,
|
|
39
19
|
});
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
20
|
+
return [
|
|
21
|
+
{
|
|
22
|
+
...expanderColumn,
|
|
23
|
+
Cell: expanderCell
|
|
24
|
+
? (cellProps) => React.createElement(React.Fragment, null, expanderCell(cellProps))
|
|
25
|
+
: expanderColumn.Cell,
|
|
26
|
+
},
|
|
27
|
+
...columns,
|
|
28
|
+
];
|
|
45
29
|
});
|
|
46
|
-
};
|
|
30
|
+
};
|