@itwin/itwinui-react 2.0.0-dev.2 → 2.0.0-dev.4
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 +6 -2
- 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 +6 -2
- package/package.json +4 -4
- package/cjs/core/ErrorPage/ErrorPage.js +0 -168
- package/esm/core/ErrorPage/ErrorPage.js +0 -161
|
@@ -1,34 +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
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
24
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
25
|
-
if (ar || !(i in from)) {
|
|
26
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
27
|
-
ar[i] = from[i];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
31
|
-
};
|
|
32
1
|
/*---------------------------------------------------------------------------------------------
|
|
33
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
34
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -39,32 +8,32 @@ import { useTheme, getBoundedValue, useEventListener, } from '../utils';
|
|
|
39
8
|
import '@itwin/itwinui-css/css/slider.css';
|
|
40
9
|
import { Track } from './Track';
|
|
41
10
|
import { Thumb } from './Thumb';
|
|
42
|
-
|
|
11
|
+
const getPercentageOfRectangle = (rect, pointerX, pointerY, orientation) => {
|
|
43
12
|
if (orientation === 'horizontal') {
|
|
44
|
-
|
|
45
|
-
return (
|
|
13
|
+
const position = getBoundedValue(pointerX, rect.left, rect.right);
|
|
14
|
+
return (position - rect.left) / rect.width;
|
|
46
15
|
}
|
|
47
|
-
|
|
16
|
+
const position = getBoundedValue(pointerY, rect.top, rect.bottom);
|
|
48
17
|
return (rect.bottom - position) / rect.height;
|
|
49
18
|
};
|
|
50
|
-
|
|
19
|
+
const getClosestValueIndex = (values, pointerValue) => {
|
|
51
20
|
if (1 === values.length) {
|
|
52
21
|
return 0;
|
|
53
22
|
}
|
|
54
|
-
|
|
55
|
-
|
|
23
|
+
const distances = values.map((value) => Math.abs(value - pointerValue));
|
|
24
|
+
const smallest = Math.min(...distances);
|
|
56
25
|
return distances.indexOf(smallest);
|
|
57
26
|
};
|
|
58
|
-
|
|
27
|
+
const getDefaultTrackDisplay = (trackDisplayMode, values) => {
|
|
59
28
|
if ('auto' !== trackDisplayMode) {
|
|
60
29
|
return trackDisplayMode;
|
|
61
30
|
}
|
|
62
31
|
return values.length % 2 ? 'even-segments' : 'odd-segments';
|
|
63
32
|
};
|
|
64
|
-
|
|
33
|
+
const roundValueToClosestStep = (value, step, min) => {
|
|
65
34
|
return Math.round((value - min) / step) * step + min;
|
|
66
35
|
};
|
|
67
|
-
|
|
36
|
+
const formatNumberValue = (value, step, numDecimals) => {
|
|
68
37
|
if (Number.isInteger(step)) {
|
|
69
38
|
return value.toFixed(0);
|
|
70
39
|
}
|
|
@@ -73,12 +42,12 @@ var formatNumberValue = function (value, step, numDecimals) {
|
|
|
73
42
|
/**
|
|
74
43
|
* Focus specified thumb on Slider control
|
|
75
44
|
*/
|
|
76
|
-
|
|
45
|
+
const focusThumb = (sliderContainer, activeIndex) => {
|
|
77
46
|
var _a;
|
|
78
|
-
|
|
47
|
+
const doc = sliderContainer.ownerDocument;
|
|
79
48
|
if (!sliderContainer.contains(doc.activeElement) ||
|
|
80
49
|
Number((_a = doc.activeElement) === null || _a === void 0 ? void 0 : _a.getAttribute('data-index')) !== activeIndex) {
|
|
81
|
-
|
|
50
|
+
const thumbToFocus = sliderContainer.querySelector(`[data-index="${activeIndex}"]`);
|
|
82
51
|
thumbToFocus && thumbToFocus.focus();
|
|
83
52
|
}
|
|
84
53
|
};
|
|
@@ -90,57 +59,57 @@ var focusThumb = function (sliderContainer, activeIndex) {
|
|
|
90
59
|
* <Slider values={[10, 20, 30, 40]} min={0} max={60} setFocus
|
|
91
60
|
* thumbMode='allow-crossing' />
|
|
92
61
|
*/
|
|
93
|
-
export
|
|
62
|
+
export const Slider = React.forwardRef((props, ref) => {
|
|
94
63
|
var _a, _b;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
React.useEffect(
|
|
64
|
+
const { min = 0, max = 100, values, step = 1, setFocus = false, tooltipProps, disabled = false, tickLabels, minLabel, maxLabel, trackDisplayMode = 'auto', thumbMode = 'inhibit-crossing', onChange, onUpdate, thumbProps, className, railContainerProps, orientation = 'horizontal', ...rest } = props;
|
|
65
|
+
const [currentValues, setCurrentValues] = React.useState(values);
|
|
66
|
+
React.useEffect(() => {
|
|
98
67
|
setCurrentValues(values);
|
|
99
68
|
}, [values]);
|
|
100
|
-
|
|
101
|
-
React.useEffect(
|
|
69
|
+
const [minValueLabel, setMinValueLabel] = React.useState(() => minLabel !== null && minLabel !== void 0 ? minLabel : min.toString());
|
|
70
|
+
React.useEffect(() => {
|
|
102
71
|
setMinValueLabel(minLabel !== null && minLabel !== void 0 ? minLabel : min.toString());
|
|
103
72
|
}, [minLabel, min]);
|
|
104
|
-
|
|
105
|
-
React.useEffect(
|
|
73
|
+
const [maxValueLabel, setMaxValueLabel] = React.useState(() => maxLabel !== null && maxLabel !== void 0 ? maxLabel : max.toString());
|
|
74
|
+
React.useEffect(() => {
|
|
106
75
|
setMaxValueLabel(maxLabel !== null && maxLabel !== void 0 ? maxLabel : max.toString());
|
|
107
76
|
}, [maxLabel, max]);
|
|
108
|
-
|
|
109
|
-
React.useEffect(
|
|
77
|
+
const [trackDisplay, setTrackDisplay] = React.useState(() => getDefaultTrackDisplay(trackDisplayMode, currentValues));
|
|
78
|
+
React.useEffect(() => {
|
|
110
79
|
setTrackDisplay(getDefaultTrackDisplay(trackDisplayMode, currentValues));
|
|
111
80
|
}, [trackDisplayMode, currentValues]);
|
|
112
81
|
useTheme();
|
|
113
|
-
|
|
114
|
-
React.useEffect(
|
|
82
|
+
const containerRef = React.useRef(null);
|
|
83
|
+
React.useEffect(() => {
|
|
115
84
|
if (containerRef.current && setFocus) {
|
|
116
85
|
focusThumb(containerRef.current, 0);
|
|
117
86
|
}
|
|
118
87
|
}, [setFocus]);
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
88
|
+
const getNumDecimalPlaces = React.useMemo(() => {
|
|
89
|
+
const stepString = step.toString();
|
|
90
|
+
const decimalIndex = stepString.indexOf('.');
|
|
122
91
|
return stepString.length - (decimalIndex + 1);
|
|
123
92
|
}, [step]);
|
|
124
|
-
|
|
93
|
+
const getAllowableThumbRange = React.useCallback((index) => {
|
|
125
94
|
if (thumbMode === 'inhibit-crossing') {
|
|
126
|
-
|
|
127
|
-
|
|
95
|
+
const minVal = index === 0 ? min : currentValues[index - 1] + step;
|
|
96
|
+
const maxVal = index < currentValues.length - 1
|
|
128
97
|
? currentValues[index + 1] - step
|
|
129
98
|
: max;
|
|
130
99
|
return [minVal, maxVal];
|
|
131
100
|
}
|
|
132
101
|
return [min, max];
|
|
133
102
|
}, [max, min, step, thumbMode, currentValues]);
|
|
134
|
-
|
|
135
|
-
|
|
103
|
+
const [activeThumbIndex, setActiveThumbIndex] = React.useState(undefined);
|
|
104
|
+
const updateThumbValue = React.useCallback((event, callbackType) => {
|
|
136
105
|
if (containerRef.current && undefined !== activeThumbIndex) {
|
|
137
|
-
|
|
138
|
-
|
|
106
|
+
const percent = getPercentageOfRectangle(containerRef.current.getBoundingClientRect(), event.clientX, event.clientY, orientation);
|
|
107
|
+
let pointerValue = min + (max - min) * percent;
|
|
139
108
|
pointerValue = roundValueToClosestStep(pointerValue, step, min);
|
|
140
|
-
|
|
109
|
+
const [minVal, maxVal] = getAllowableThumbRange(activeThumbIndex);
|
|
141
110
|
pointerValue = getBoundedValue(pointerValue, minVal, maxVal);
|
|
142
111
|
if (pointerValue !== currentValues[activeThumbIndex]) {
|
|
143
|
-
|
|
112
|
+
const newValues = [...currentValues];
|
|
144
113
|
newValues[activeThumbIndex] = pointerValue;
|
|
145
114
|
setCurrentValues(newValues);
|
|
146
115
|
'onChange' === callbackType
|
|
@@ -162,7 +131,7 @@ export var Slider = React.forwardRef(function (props, ref) {
|
|
|
162
131
|
onChange,
|
|
163
132
|
orientation,
|
|
164
133
|
]);
|
|
165
|
-
|
|
134
|
+
const handlePointerMove = React.useCallback((event) => {
|
|
166
135
|
if (activeThumbIndex === undefined) {
|
|
167
136
|
return;
|
|
168
137
|
}
|
|
@@ -171,7 +140,7 @@ export var Slider = React.forwardRef(function (props, ref) {
|
|
|
171
140
|
updateThumbValue(event, 'onUpdate');
|
|
172
141
|
}, [activeThumbIndex, updateThumbValue]);
|
|
173
142
|
// function called by Thumb keyboard processing
|
|
174
|
-
|
|
143
|
+
const onThumbValueChanged = React.useCallback((index, value, keyboardReleased) => {
|
|
175
144
|
if (currentValues[index] === value && !keyboardReleased) {
|
|
176
145
|
return;
|
|
177
146
|
}
|
|
@@ -179,16 +148,16 @@ export var Slider = React.forwardRef(function (props, ref) {
|
|
|
179
148
|
onChange === null || onChange === void 0 ? void 0 : onChange(currentValues); // currentValues since key up should not change value but only stop continuous value selection
|
|
180
149
|
}
|
|
181
150
|
else {
|
|
182
|
-
|
|
151
|
+
const newValues = [...currentValues]; // newValues since key down should change value
|
|
183
152
|
newValues[index] = value;
|
|
184
153
|
onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(newValues);
|
|
185
154
|
setCurrentValues(newValues);
|
|
186
155
|
}
|
|
187
156
|
}, [currentValues, onUpdate, onChange]);
|
|
188
|
-
|
|
157
|
+
const onThumbActivated = React.useCallback((index) => {
|
|
189
158
|
setActiveThumbIndex(index);
|
|
190
159
|
}, []);
|
|
191
|
-
|
|
160
|
+
const handlePointerUp = React.useCallback((event) => {
|
|
192
161
|
if (activeThumbIndex === undefined) {
|
|
193
162
|
return;
|
|
194
163
|
}
|
|
@@ -197,18 +166,18 @@ export var Slider = React.forwardRef(function (props, ref) {
|
|
|
197
166
|
event.preventDefault();
|
|
198
167
|
event.stopPropagation();
|
|
199
168
|
}, [activeThumbIndex, updateThumbValue]);
|
|
200
|
-
|
|
169
|
+
const handlePointerDownOnSlider = React.useCallback((event) => {
|
|
201
170
|
if (containerRef.current) {
|
|
202
|
-
|
|
203
|
-
|
|
171
|
+
const percent = getPercentageOfRectangle(containerRef.current.getBoundingClientRect(), event.clientX, event.clientY, orientation);
|
|
172
|
+
let pointerValue = min + (max - min) * percent;
|
|
204
173
|
pointerValue = roundValueToClosestStep(pointerValue, step, min);
|
|
205
|
-
|
|
206
|
-
|
|
174
|
+
const closestValueIndex = getClosestValueIndex(currentValues, pointerValue);
|
|
175
|
+
const [minVal, maxVal] = getAllowableThumbRange(closestValueIndex);
|
|
207
176
|
pointerValue = getBoundedValue(pointerValue, minVal, maxVal);
|
|
208
177
|
if (pointerValue === currentValues[closestValueIndex]) {
|
|
209
178
|
return;
|
|
210
179
|
}
|
|
211
|
-
|
|
180
|
+
const newValues = [...currentValues];
|
|
212
181
|
newValues[closestValueIndex] = pointerValue;
|
|
213
182
|
setCurrentValues(newValues);
|
|
214
183
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValues);
|
|
@@ -229,33 +198,36 @@ export var Slider = React.forwardRef(function (props, ref) {
|
|
|
229
198
|
]);
|
|
230
199
|
useEventListener('pointermove', handlePointerMove, (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.ownerDocument);
|
|
231
200
|
useEventListener('pointerup', handlePointerUp, (_b = containerRef.current) === null || _b === void 0 ? void 0 : _b.ownerDocument);
|
|
232
|
-
|
|
201
|
+
const tickMarkArea = React.useMemo(() => {
|
|
233
202
|
if (!tickLabels) {
|
|
234
203
|
return null;
|
|
235
204
|
}
|
|
236
205
|
if (Array.isArray(tickLabels)) {
|
|
237
|
-
return (React.createElement("div", { className: 'iui-slider-ticks' }, tickLabels.map(
|
|
206
|
+
return (React.createElement("div", { className: 'iui-slider-ticks' }, tickLabels.map((label, index) => (React.createElement("span", { key: index, className: 'iui-slider-tick' }, label)))));
|
|
238
207
|
}
|
|
239
208
|
return tickLabels;
|
|
240
209
|
}, [tickLabels]);
|
|
241
|
-
|
|
242
|
-
|
|
210
|
+
const generateTooltipProps = React.useCallback((index, val) => {
|
|
211
|
+
const outProps = tooltipProps
|
|
243
212
|
? tooltipProps(index, val, step)
|
|
244
213
|
: {};
|
|
245
|
-
return
|
|
214
|
+
return {
|
|
215
|
+
...outProps,
|
|
216
|
+
content: outProps.content
|
|
246
217
|
? outProps.content
|
|
247
|
-
: formatNumberValue(val, step, getNumDecimalPlaces)
|
|
218
|
+
: formatNumberValue(val, step, getNumDecimalPlaces),
|
|
219
|
+
};
|
|
248
220
|
}, [getNumDecimalPlaces, step, tooltipProps]);
|
|
249
|
-
return (React.createElement("div",
|
|
221
|
+
return (React.createElement("div", { ref: ref, className: cx('iui-slider-component-container', `iui-slider-${orientation}`, { 'iui-disabled': disabled }, className), ...rest },
|
|
250
222
|
minValueLabel && (React.createElement("span", { className: 'iui-slider-min' }, minValueLabel)),
|
|
251
|
-
React.createElement("div",
|
|
223
|
+
React.createElement("div", { ref: containerRef, className: cx('iui-slider-container', {
|
|
252
224
|
'iui-grabbing': undefined !== activeThumbIndex,
|
|
253
|
-
}), onPointerDown: handlePointerDownOnSlider
|
|
225
|
+
}), onPointerDown: handlePointerDownOnSlider, ...railContainerProps },
|
|
254
226
|
React.createElement("div", { className: 'iui-slider-rail' }),
|
|
255
|
-
currentValues.map(
|
|
227
|
+
currentValues.map((thumbValue, index) => {
|
|
256
228
|
var _a;
|
|
257
|
-
|
|
258
|
-
|
|
229
|
+
const [minVal, maxVal] = getAllowableThumbRange(index);
|
|
230
|
+
const thisThumbProps = thumbProps === null || thumbProps === void 0 ? void 0 : thumbProps(index);
|
|
259
231
|
return (React.createElement(Thumb, { key: (_a = thisThumbProps === null || thisThumbProps === void 0 ? void 0 : thisThumbProps.id) !== null && _a !== void 0 ? _a : index, index: index, disabled: disabled, isActive: activeThumbIndex === index, onThumbActivated: onThumbActivated, onThumbValueChanged: onThumbValueChanged, minVal: minVal, maxVal: maxVal, value: thumbValue, tooltipProps: generateTooltipProps(index, thumbValue), thumbProps: thisThumbProps, step: step, sliderMin: min, sliderMax: max, orientation: orientation }));
|
|
260
232
|
}),
|
|
261
233
|
React.createElement(Track, { trackDisplayMode: trackDisplay, sliderMin: min, sliderMax: max, values: currentValues, orientation: orientation }),
|
package/esm/core/Slider/Thumb.js
CHANGED
|
@@ -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,10 +10,10 @@ import { Tooltip } from '../Tooltip';
|
|
|
32
10
|
* Only one Thumb can be active at a time. A Thumb is made active when the user selects
|
|
33
11
|
* it with pointer. Whenever a Thumb is active, focused, or hovered its tooltip is shown.
|
|
34
12
|
*/
|
|
35
|
-
export
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
13
|
+
export const Thumb = (props) => {
|
|
14
|
+
const { value, index, minVal, maxVal, step, sliderMin, sliderMax, isActive, onThumbActivated, onThumbValueChanged, tooltipProps, thumbProps, disabled, orientation, } = props;
|
|
15
|
+
const thumbRef = React.useRef(null);
|
|
16
|
+
const handleOnKeyboardEvent = React.useCallback((event, keyboardReleased) => {
|
|
39
17
|
if (disabled || event.altKey) {
|
|
40
18
|
return;
|
|
41
19
|
}
|
|
@@ -59,12 +37,12 @@ export var Thumb = function (props) {
|
|
|
59
37
|
}
|
|
60
38
|
event.preventDefault();
|
|
61
39
|
}, [disabled, onThumbValueChanged, index, value, step, minVal, maxVal]);
|
|
62
|
-
|
|
40
|
+
const handlePointerDownOnThumb = React.useCallback(() => {
|
|
63
41
|
!disabled && onThumbActivated(index);
|
|
64
42
|
}, [disabled, index, onThumbActivated]);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
43
|
+
const [hasFocus, setHasFocus] = React.useState(false);
|
|
44
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
45
|
+
const adjustedValue = React.useMemo(() => {
|
|
68
46
|
if (value < sliderMin) {
|
|
69
47
|
return sliderMin;
|
|
70
48
|
}
|
|
@@ -73,15 +51,18 @@ export var Thumb = function (props) {
|
|
|
73
51
|
}
|
|
74
52
|
return value;
|
|
75
53
|
}, [sliderMax, sliderMin, value]);
|
|
76
|
-
|
|
54
|
+
const lowPercent = React.useMemo(() => {
|
|
77
55
|
if (sliderMax === sliderMin) {
|
|
78
56
|
return 0;
|
|
79
57
|
}
|
|
80
58
|
return (100.0 * (adjustedValue - sliderMin)) / (sliderMax - sliderMin);
|
|
81
59
|
}, [adjustedValue, sliderMax, sliderMin]);
|
|
82
|
-
|
|
83
|
-
return (React.createElement(Tooltip,
|
|
84
|
-
React.createElement("div",
|
|
85
|
-
|
|
86
|
-
|
|
60
|
+
const { style, className, ...rest } = thumbProps || {};
|
|
61
|
+
return (React.createElement(Tooltip, { visible: isActive || hasFocus || isHovered, placement: 'top', ...tooltipProps },
|
|
62
|
+
React.createElement("div", { ...rest, "data-index": index, ref: thumbRef, style: {
|
|
63
|
+
...style,
|
|
64
|
+
...(orientation === 'horizontal'
|
|
65
|
+
? { left: `${lowPercent}%` }
|
|
66
|
+
: { bottom: `${lowPercent}%` }),
|
|
67
|
+
}, className: cx('iui-slider-thumb', { 'iui-active': isActive }, className), role: 'slider', tabIndex: disabled ? undefined : 0, "aria-valuemin": minVal, "aria-valuenow": value, "aria-valuemax": maxVal, "aria-disabled": disabled, onPointerDown: handlePointerDownOnThumb, onKeyDown: (event) => handleOnKeyboardEvent(event, false), onKeyUp: (event) => handleOnKeyboardEvent(event, true), onFocus: () => setHasFocus(true), onBlur: () => setHasFocus(false), onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false) })));
|
|
87
68
|
};
|
package/esm/core/Slider/Track.js
CHANGED
|
@@ -1,23 +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 __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.
|
|
@@ -33,17 +13,17 @@ function shouldDisplaySegment(segmentIndex, mode) {
|
|
|
33
13
|
return false;
|
|
34
14
|
}
|
|
35
15
|
function generateSegments(values, min, max) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
newValues.sort(
|
|
16
|
+
const segments = [];
|
|
17
|
+
const newValues = [...values];
|
|
18
|
+
newValues.sort((a, b) => a - b);
|
|
39
19
|
if (0 === newValues.length ||
|
|
40
20
|
newValues[0] < min ||
|
|
41
21
|
newValues[newValues.length - 1] > max ||
|
|
42
22
|
min === max) {
|
|
43
23
|
return [];
|
|
44
24
|
}
|
|
45
|
-
|
|
46
|
-
for (
|
|
25
|
+
let lastValue = min;
|
|
26
|
+
for (let i = 0; i < newValues.length; i++) {
|
|
47
27
|
segments.push({ left: lastValue, right: newValues[i] });
|
|
48
28
|
lastValue = newValues[i];
|
|
49
29
|
}
|
|
@@ -54,31 +34,31 @@ function generateSegments(values, min, max) {
|
|
|
54
34
|
* Track displays color segments above Rail. Which, if any, segments that are
|
|
55
35
|
* colorized is based on `trackDisplayMode`.
|
|
56
36
|
*/
|
|
57
|
-
export
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}), segments = _a[0], setSegments = _a[1];
|
|
62
|
-
React.useEffect(function () {
|
|
37
|
+
export const Track = (props) => {
|
|
38
|
+
const { trackDisplayMode, sliderMin, sliderMax, values, orientation } = props;
|
|
39
|
+
const [segments, setSegments] = React.useState(() => generateSegments(values, sliderMin, sliderMax));
|
|
40
|
+
React.useEffect(() => {
|
|
63
41
|
setSegments(generateSegments(values, sliderMin, sliderMax));
|
|
64
42
|
}, [values, sliderMin, sliderMax]);
|
|
65
43
|
return (React.createElement(React.Fragment, null, 'none' !== trackDisplayMode &&
|
|
66
|
-
segments.map(
|
|
67
|
-
|
|
44
|
+
segments.map((segment, index) => {
|
|
45
|
+
const lowPercent = segment.left >= sliderMin && sliderMax !== sliderMin
|
|
68
46
|
? (100.0 * (segment.left - sliderMin)) / (sliderMax - sliderMin)
|
|
69
47
|
: 0;
|
|
70
|
-
|
|
48
|
+
const highPercent = segment.right >= sliderMin && sliderMax !== sliderMin
|
|
71
49
|
? 100.0 -
|
|
72
50
|
(100.0 * (segment.right - sliderMin)) / (sliderMax - sliderMin)
|
|
73
51
|
: 100;
|
|
74
|
-
return (React.createElement(React.Fragment, { key: index }, shouldDisplaySegment(index, trackDisplayMode) ? (React.createElement("div", { className: 'iui-slider-track', style:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
52
|
+
return (React.createElement(React.Fragment, { key: index }, shouldDisplaySegment(index, trackDisplayMode) ? (React.createElement("div", { className: 'iui-slider-track', style: {
|
|
53
|
+
...(orientation === 'horizontal'
|
|
54
|
+
? {
|
|
55
|
+
left: `${lowPercent}%`,
|
|
56
|
+
right: `${highPercent}%`,
|
|
57
|
+
}
|
|
58
|
+
: {
|
|
59
|
+
top: `${highPercent}%`,
|
|
60
|
+
bottom: `${lowPercent}%`,
|
|
61
|
+
}),
|
|
62
|
+
} })) : null));
|
|
83
63
|
})));
|
|
84
64
|
};
|
|
@@ -11,12 +11,11 @@ import cx from 'classnames';
|
|
|
11
11
|
* <StatusMessage>This is the text</StatusMessage>
|
|
12
12
|
* <StatusMessage startIcon={<SvgStar />}>This is the text</StatusMessage>
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
15
|
-
var userStartIcon = _a.startIcon, children = _a.children, status = _a.status;
|
|
14
|
+
export const StatusMessage = ({ startIcon: userStartIcon, children, status, }) => {
|
|
16
15
|
useTheme();
|
|
17
|
-
|
|
16
|
+
const StartIcon = () => {
|
|
18
17
|
var _a;
|
|
19
|
-
|
|
18
|
+
const icon = userStartIcon !== null && userStartIcon !== void 0 ? userStartIcon : (status && StatusIconMap[status]());
|
|
20
19
|
if (!icon) {
|
|
21
20
|
return null;
|
|
22
21
|
}
|
|
@@ -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.
|
|
@@ -28,17 +6,15 @@ import React from 'react';
|
|
|
28
6
|
import { useTheme } from '../utils';
|
|
29
7
|
import '@itwin/itwinui-css/css/stepper.css';
|
|
30
8
|
import { StepperStep } from './StepperStep';
|
|
31
|
-
|
|
32
|
-
stepsCountLabel:
|
|
33
|
-
return "Step ".concat(currentStep, " of ").concat(totalSteps, ":");
|
|
34
|
-
},
|
|
9
|
+
const defaultStepperLocalization = {
|
|
10
|
+
stepsCountLabel: (currentStep, totalSteps) => `Step ${currentStep} of ${totalSteps}:`,
|
|
35
11
|
};
|
|
36
|
-
export
|
|
37
|
-
|
|
38
|
-
|
|
12
|
+
export const Stepper = React.forwardRef((props, ref) => {
|
|
13
|
+
const { currentStep, steps, type = 'default', localization = defaultStepperLocalization, onStepClick, ...rest } = props;
|
|
14
|
+
const boundedCurrentStep = Math.min(Math.max(0, currentStep !== null && currentStep !== void 0 ? currentStep : 0), steps.length - 1);
|
|
39
15
|
useTheme();
|
|
40
|
-
return (React.createElement("div",
|
|
41
|
-
React.createElement("ol", null, steps.map(
|
|
16
|
+
return (React.createElement("div", { className: 'iui-stepper', ref: ref, ...rest },
|
|
17
|
+
React.createElement("ol", null, steps.map((s, index) => (React.createElement(StepperStep, { key: index, index: index, title: type === 'long' ? '' : s.name, currentStepNumber: boundedCurrentStep, totalSteps: steps.length, type: type, onClick: onStepClick, description: s.description })))),
|
|
42
18
|
type === 'long' && (React.createElement("div", { className: 'iui-stepper-steps-label' },
|
|
43
19
|
React.createElement("span", { className: 'iui-stepper-steps-label-count' }, localization.stepsCountLabel(boundedCurrentStep + 1, steps.length)),
|
|
44
20
|
steps[boundedCurrentStep].name))));
|
|
@@ -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.
|
|
@@ -27,17 +5,17 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
27
5
|
import cx from 'classnames';
|
|
28
6
|
import React from 'react';
|
|
29
7
|
import { Tooltip } from '../Tooltip';
|
|
30
|
-
export
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
8
|
+
export const StepperStep = (props) => {
|
|
9
|
+
const { title, index, currentStepNumber, totalSteps, type, onClick, description, className, style, ...rest } = props;
|
|
10
|
+
const isPast = currentStepNumber > index;
|
|
11
|
+
const isActive = currentStepNumber === index;
|
|
12
|
+
const isClickable = isPast && !!onClick;
|
|
13
|
+
const onCompletedClick = () => {
|
|
36
14
|
if (isClickable) {
|
|
37
15
|
onClick === null || onClick === void 0 ? void 0 : onClick(index);
|
|
38
16
|
}
|
|
39
17
|
};
|
|
40
|
-
|
|
18
|
+
const onKeyDown = (e) => {
|
|
41
19
|
if (!isClickable) {
|
|
42
20
|
return;
|
|
43
21
|
}
|
|
@@ -45,10 +23,13 @@ export var StepperStep = function (props) {
|
|
|
45
23
|
onCompletedClick();
|
|
46
24
|
}
|
|
47
25
|
};
|
|
48
|
-
|
|
26
|
+
const stepShape = (React.createElement("li", { className: cx('iui-stepper-step', {
|
|
49
27
|
'iui-current': isActive,
|
|
50
28
|
'iui-clickable': isClickable,
|
|
51
|
-
}, className), style:
|
|
29
|
+
}, className), style: {
|
|
30
|
+
width: type === 'default' ? `${100 / totalSteps}%` : undefined,
|
|
31
|
+
...style,
|
|
32
|
+
}, onClick: onCompletedClick, onKeyDown: onKeyDown, "aria-current": isActive ? 'step' : undefined, tabIndex: isClickable ? 0 : undefined, ...rest },
|
|
52
33
|
React.createElement("div", { className: 'iui-stepper-track-content' },
|
|
53
34
|
React.createElement("span", { className: 'iui-stepper-circle' }, index + 1)),
|
|
54
35
|
type === 'default' && (React.createElement("span", { className: 'iui-stepper-step-name' }, title))));
|