@itwin/core-react 4.14.1 → 4.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -1
- package/lib/cjs/core-react/UiCore.d.ts +1 -1
- package/lib/cjs/core-react/UiCore.js +1 -1
- package/lib/cjs/core-react/UiCore.js.map +1 -1
- package/lib/cjs/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
- package/lib/cjs/core-react/autosuggest/AutoSuggest.js.map +1 -1
- package/lib/cjs/core-react/base/Centered.d.ts +1 -1
- package/lib/cjs/core-react/base/Centered.d.ts.map +1 -1
- package/lib/cjs/core-react/base/Centered.js +2 -1
- package/lib/cjs/core-react/base/Centered.js.map +1 -1
- package/lib/cjs/core-react/base/Div.d.ts +2 -2
- package/lib/cjs/core-react/base/Div.d.ts.map +1 -1
- package/lib/cjs/core-react/base/Div.js +1 -1
- package/lib/cjs/core-react/base/Div.js.map +1 -1
- package/lib/cjs/core-react/base/DivWithOutsideClick.d.ts +1 -1
- package/lib/cjs/core-react/base/DivWithOutsideClick.d.ts.map +1 -1
- package/lib/cjs/core-react/base/DivWithOutsideClick.js +4 -2
- package/lib/cjs/core-react/base/DivWithOutsideClick.js.map +1 -1
- package/lib/cjs/core-react/base/FillCentered.d.ts +1 -1
- package/lib/cjs/core-react/base/FillCentered.d.ts.map +1 -1
- package/lib/cjs/core-react/base/FillCentered.js +2 -1
- package/lib/cjs/core-react/base/FillCentered.js.map +1 -1
- package/lib/cjs/core-react/base/FlexWrapContainer.d.ts +1 -1
- package/lib/cjs/core-react/base/FlexWrapContainer.d.ts.map +1 -1
- package/lib/cjs/core-react/base/FlexWrapContainer.js +2 -1
- package/lib/cjs/core-react/base/FlexWrapContainer.js.map +1 -1
- package/lib/cjs/core-react/base/Gap.d.ts +2 -2
- package/lib/cjs/core-react/base/Gap.d.ts.map +1 -1
- package/lib/cjs/core-react/base/Gap.js +1 -1
- package/lib/cjs/core-react/base/Gap.js.map +1 -1
- package/lib/cjs/core-react/base/ScrollView.d.ts +1 -1
- package/lib/cjs/core-react/base/ScrollView.d.ts.map +1 -1
- package/lib/cjs/core-react/base/ScrollView.js +2 -1
- package/lib/cjs/core-react/base/ScrollView.js.map +1 -1
- package/lib/cjs/core-react/button/UnderlinedButton.d.ts +2 -2
- package/lib/cjs/core-react/button/UnderlinedButton.js +1 -1
- package/lib/cjs/core-react/button/UnderlinedButton.js.map +1 -1
- package/lib/cjs/core-react/checklistbox/CheckListBox.d.ts +4 -4
- package/lib/cjs/core-react/checklistbox/CheckListBox.d.ts.map +1 -1
- package/lib/cjs/core-react/checklistbox/CheckListBox.js +3 -3
- package/lib/cjs/core-react/checklistbox/CheckListBox.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuDivider.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuDivider.js +1 -0
- package/lib/cjs/core-react/contextmenu/ContextMenuDivider.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/PopupContextMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/PopupContextMenu.js +3 -1
- package/lib/cjs/core-react/contextmenu/PopupContextMenu.js.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.d.ts +4 -5
- package/lib/cjs/core-react/dialog/Dialog.d.ts.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.js +3 -3
- package/lib/cjs/core-react/dialog/Dialog.js.map +1 -1
- package/lib/cjs/core-react/dialog/GlobalDialog.d.ts +3 -3
- package/lib/cjs/core-react/dialog/GlobalDialog.js +1 -1
- package/lib/cjs/core-react/dialog/GlobalDialog.js.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.d.ts +3 -3
- package/lib/cjs/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.js +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/cjs/core-react/enums/Alignment.d.ts +2 -0
- package/lib/cjs/core-react/enums/Alignment.d.ts.map +1 -1
- package/lib/cjs/core-react/enums/Alignment.js +2 -0
- package/lib/cjs/core-react/enums/Alignment.js.map +1 -1
- package/lib/cjs/core-react/enums/CheckBoxState.d.ts +1 -0
- package/lib/cjs/core-react/enums/CheckBoxState.d.ts.map +1 -1
- package/lib/cjs/core-react/enums/CheckBoxState.js.map +1 -1
- package/lib/cjs/core-react/enums/SortDirection.d.ts +1 -0
- package/lib/cjs/core-react/enums/SortDirection.d.ts.map +1 -1
- package/lib/cjs/core-react/enums/SortDirection.js +1 -0
- package/lib/cjs/core-react/enums/SortDirection.js.map +1 -1
- package/lib/cjs/core-react/expandable/ExpandableList.d.ts +2 -2
- package/lib/cjs/core-react/expandable/ExpandableList.d.ts.map +1 -1
- package/lib/cjs/core-react/expandable/ExpandableList.js +1 -1
- package/lib/cjs/core-react/expandable/ExpandableList.js.map +1 -1
- package/lib/cjs/core-react/hocs/withIsPressed.d.ts +2 -0
- package/lib/cjs/core-react/hocs/withIsPressed.d.ts.map +1 -1
- package/lib/cjs/core-react/hocs/withIsPressed.js +1 -0
- package/lib/cjs/core-react/hocs/withIsPressed.js.map +1 -1
- package/lib/cjs/core-react/hocs/withOnOutsideClick.d.ts +2 -0
- package/lib/cjs/core-react/hocs/withOnOutsideClick.d.ts.map +1 -1
- package/lib/cjs/core-react/hocs/withOnOutsideClick.js +1 -0
- package/lib/cjs/core-react/hocs/withOnOutsideClick.js.map +1 -1
- package/lib/cjs/core-react/hocs/withTimeout.d.ts +2 -0
- package/lib/cjs/core-react/hocs/withTimeout.d.ts.map +1 -1
- package/lib/cjs/core-react/hocs/withTimeout.js +4 -1
- package/lib/cjs/core-react/hocs/withTimeout.js.map +1 -1
- package/lib/cjs/core-react/icons/IconComponent.d.ts.map +1 -1
- package/lib/cjs/core-react/icons/IconComponent.js.map +1 -1
- package/lib/cjs/core-react/icons/SvgPath.d.ts +2 -0
- package/lib/cjs/core-react/icons/SvgPath.d.ts.map +1 -1
- package/lib/cjs/core-react/icons/SvgPath.js +2 -0
- package/lib/cjs/core-react/icons/SvgPath.js.map +1 -1
- package/lib/cjs/core-react/icons/WebFontIcon.d.ts +2 -0
- package/lib/cjs/core-react/icons/WebFontIcon.d.ts.map +1 -1
- package/lib/cjs/core-react/icons/WebFontIcon.js +2 -0
- package/lib/cjs/core-react/icons/WebFontIcon.js.map +1 -1
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.d.ts +2 -2
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.d.ts.map +1 -1
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js +1 -1
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
- package/lib/cjs/core-react/inputs/Input.d.ts.map +1 -1
- package/lib/cjs/core-react/inputs/Input.js.map +1 -1
- package/lib/cjs/core-react/inputs/InputLabel.d.ts +2 -2
- package/lib/cjs/core-react/inputs/InputLabel.d.ts.map +1 -1
- package/lib/cjs/core-react/inputs/InputLabel.js +1 -1
- package/lib/cjs/core-react/inputs/InputLabel.js.map +1 -1
- package/lib/cjs/core-react/inputs/InputStatus.d.ts +1 -1
- package/lib/cjs/core-react/inputs/InputStatus.js +1 -1
- package/lib/cjs/core-react/inputs/InputStatus.js.map +1 -1
- package/lib/cjs/core-react/inputs/LabeledComponentProps.d.ts +2 -2
- package/lib/cjs/core-react/inputs/LabeledComponentProps.js.map +1 -1
- package/lib/cjs/core-react/inputs/iconinput/IconInput.d.ts +2 -2
- package/lib/cjs/core-react/inputs/iconinput/IconInput.js +1 -1
- package/lib/cjs/core-react/inputs/iconinput/IconInput.js.map +1 -1
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts +3 -3
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.js +1 -1
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.js.map +1 -1
- package/lib/cjs/core-react/listbox/Listbox.d.ts +7 -7
- package/lib/cjs/core-react/listbox/Listbox.js +3 -3
- package/lib/cjs/core-react/listbox/Listbox.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingBar.d.ts +2 -2
- package/lib/cjs/core-react/loading/LoadingBar.js +1 -1
- package/lib/cjs/core-react/loading/LoadingBar.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingPrompt.d.ts +2 -2
- package/lib/cjs/core-react/loading/LoadingPrompt.js +1 -1
- package/lib/cjs/core-react/loading/LoadingPrompt.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingSpinner.d.ts +3 -3
- package/lib/cjs/core-react/loading/LoadingSpinner.js +1 -1
- package/lib/cjs/core-react/loading/LoadingSpinner.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingStatus.d.ts +2 -2
- package/lib/cjs/core-react/loading/LoadingStatus.js +1 -1
- package/lib/cjs/core-react/loading/LoadingStatus.js.map +1 -1
- package/lib/cjs/core-react/messagebox/MessageBox.d.ts +5 -1
- package/lib/cjs/core-react/messagebox/MessageBox.d.ts.map +1 -1
- package/lib/cjs/core-react/messagebox/MessageBox.js +8 -1
- package/lib/cjs/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/cjs/core-react/notification/MessageRenderer.d.ts +2 -0
- package/lib/cjs/core-react/notification/MessageRenderer.d.ts.map +1 -1
- package/lib/cjs/core-react/notification/MessageRenderer.js +2 -0
- package/lib/cjs/core-react/notification/MessageRenderer.js.map +1 -1
- package/lib/cjs/core-react/notification/MessageType.d.ts +2 -0
- package/lib/cjs/core-react/notification/MessageType.d.ts.map +1 -1
- package/lib/cjs/core-react/notification/MessageType.js.map +1 -1
- package/lib/cjs/core-react/popup/Popup.d.ts +6 -1
- package/lib/cjs/core-react/popup/Popup.d.ts.map +1 -1
- package/lib/cjs/core-react/popup/Popup.js +9 -2
- package/lib/cjs/core-react/popup/Popup.js.map +1 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.d.ts +4 -4
- package/lib/cjs/core-react/radialmenu/RadialMenu.js +2 -2
- package/lib/cjs/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/cjs/core-react/searchbox/SearchBox.d.ts +2 -2
- package/lib/cjs/core-react/searchbox/SearchBox.js +1 -1
- package/lib/cjs/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/cjs/core-react/settings/SettingsManager.d.ts +8 -8
- package/lib/cjs/core-react/settings/SettingsManager.js +4 -4
- package/lib/cjs/core-react/settings/SettingsManager.js.map +1 -1
- package/lib/cjs/core-react/tabs/Tabs.d.ts +4 -4
- package/lib/cjs/core-react/tabs/Tabs.js +1 -1
- package/lib/cjs/core-react/tabs/Tabs.js.map +1 -1
- package/lib/cjs/core-react/tabs/VerticalTabs.d.ts +1 -1
- package/lib/cjs/core-react/tabs/VerticalTabs.js +1 -1
- package/lib/cjs/core-react/tabs/VerticalTabs.js.map +1 -1
- package/lib/cjs/core-react/text/BlockText.d.ts +1 -1
- package/lib/cjs/core-react/text/BlockText.js +1 -1
- package/lib/cjs/core-react/text/BlockText.js.map +1 -1
- package/lib/cjs/core-react/text/BodyText.d.ts +1 -1
- package/lib/cjs/core-react/text/BodyText.js +1 -1
- package/lib/cjs/core-react/text/BodyText.js.map +1 -1
- package/lib/cjs/core-react/text/DisabledText.d.ts +1 -1
- package/lib/cjs/core-react/text/DisabledText.js +1 -1
- package/lib/cjs/core-react/text/DisabledText.js.map +1 -1
- package/lib/cjs/core-react/text/FilteredText.d.ts +2 -0
- package/lib/cjs/core-react/text/FilteredText.d.ts.map +1 -1
- package/lib/cjs/core-react/text/FilteredText.js +2 -0
- package/lib/cjs/core-react/text/FilteredText.js.map +1 -1
- package/lib/cjs/core-react/text/MutedText.d.ts +1 -1
- package/lib/cjs/core-react/text/MutedText.js +1 -1
- package/lib/cjs/core-react/text/MutedText.js.map +1 -1
- package/lib/cjs/core-react/text/StyledText.d.ts +2 -2
- package/lib/cjs/core-react/text/StyledText.js +1 -1
- package/lib/cjs/core-react/text/StyledText.js.map +1 -1
- package/lib/cjs/core-react/text/TextProps.d.ts +1 -1
- package/lib/cjs/core-react/text/TextProps.js.map +1 -1
- package/lib/cjs/core-react/tree/Branch.d.ts +2 -0
- package/lib/cjs/core-react/tree/Branch.d.ts.map +1 -1
- package/lib/cjs/core-react/tree/Branch.js +2 -0
- package/lib/cjs/core-react/tree/Branch.js.map +1 -1
- package/lib/cjs/core-react/tree/ExpansionToggle.d.ts +2 -0
- package/lib/cjs/core-react/tree/ExpansionToggle.d.ts.map +1 -1
- package/lib/cjs/core-react/tree/ExpansionToggle.js +2 -0
- package/lib/cjs/core-react/tree/ExpansionToggle.js.map +1 -1
- package/lib/cjs/core-react/tree/Node.d.ts +3 -3
- package/lib/cjs/core-react/tree/Node.d.ts.map +1 -1
- package/lib/cjs/core-react/tree/Node.js +6 -1
- package/lib/cjs/core-react/tree/Node.js.map +1 -1
- package/lib/cjs/core-react/tree/Placeholder.d.ts +2 -0
- package/lib/cjs/core-react/tree/Placeholder.d.ts.map +1 -1
- package/lib/cjs/core-react/tree/Placeholder.js +2 -0
- package/lib/cjs/core-react/tree/Placeholder.js.map +1 -1
- package/lib/cjs/core-react/tree/Tree.d.ts +2 -0
- package/lib/cjs/core-react/tree/Tree.d.ts.map +1 -1
- package/lib/cjs/core-react/tree/Tree.js +2 -0
- package/lib/cjs/core-react/tree/Tree.js.map +1 -1
- package/lib/cjs/core-react/utils/IconHelper.d.ts +1 -0
- package/lib/cjs/core-react/utils/IconHelper.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/IconHelper.js +2 -0
- package/lib/cjs/core-react/utils/IconHelper.js.map +1 -1
- package/lib/cjs/core-react/utils/Props.d.ts +5 -1
- package/lib/cjs/core-react/utils/Props.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/Props.js.map +1 -1
- package/lib/cjs/core-react/utils/ScrollPositionMaintainer.d.ts +1 -0
- package/lib/cjs/core-react/utils/ScrollPositionMaintainer.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/ScrollPositionMaintainer.js +3 -0
- package/lib/cjs/core-react/utils/ScrollPositionMaintainer.js.map +1 -1
- package/lib/cjs/core-react/utils/Timer.d.ts +2 -0
- package/lib/cjs/core-react/utils/Timer.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/Timer.js +2 -0
- package/lib/cjs/core-react/utils/Timer.js.map +1 -1
- package/lib/cjs/core-react/utils/getCssVariable.d.ts +2 -0
- package/lib/cjs/core-react/utils/getCssVariable.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/getCssVariable.js +3 -0
- package/lib/cjs/core-react/utils/getCssVariable.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js +1 -0
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useDisposable.d.ts +1 -0
- package/lib/cjs/core-react/utils/hooks/useDisposable.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useDisposable.js +1 -0
- package/lib/cjs/core-react/utils/hooks/useDisposable.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useEffectSkipFirst.d.ts +1 -0
- package/lib/cjs/core-react/utils/hooks/useEffectSkipFirst.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useEffectSkipFirst.js +1 -0
- package/lib/cjs/core-react/utils/hooks/useEffectSkipFirst.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useInterval.d.ts +1 -0
- package/lib/cjs/core-react/utils/hooks/useInterval.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useInterval.js +1 -0
- package/lib/cjs/core-react/utils/hooks/useInterval.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useOnOutsideClick.d.ts +5 -1
- package/lib/cjs/core-react/utils/hooks/useOnOutsideClick.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useOnOutsideClick.js +1 -0
- package/lib/cjs/core-react/utils/hooks/useOnOutsideClick.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.d.ts +2 -0
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js +2 -0
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/cjs/core-react/utils/typeUtils.d.ts +1 -0
- package/lib/cjs/core-react/utils/typeUtils.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/typeUtils.js.map +1 -1
- package/lib/cjs/core-react.d.ts +0 -1
- package/lib/cjs/core-react.d.ts.map +1 -1
- package/lib/cjs/core-react.js +2 -1
- package/lib/cjs/core-react.js.map +1 -1
- package/lib/esm/core-react/UiCore.d.ts +1 -1
- package/lib/esm/core-react/UiCore.js +1 -1
- package/lib/esm/core-react/UiCore.js.map +1 -1
- package/lib/esm/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
- package/lib/esm/core-react/autosuggest/AutoSuggest.js.map +1 -1
- package/lib/esm/core-react/base/Centered.d.ts +1 -1
- package/lib/esm/core-react/base/Centered.d.ts.map +1 -1
- package/lib/esm/core-react/base/Centered.js +2 -1
- package/lib/esm/core-react/base/Centered.js.map +1 -1
- package/lib/esm/core-react/base/Div.d.ts +2 -2
- package/lib/esm/core-react/base/Div.d.ts.map +1 -1
- package/lib/esm/core-react/base/Div.js +1 -1
- package/lib/esm/core-react/base/Div.js.map +1 -1
- package/lib/esm/core-react/base/DivWithOutsideClick.d.ts +1 -1
- package/lib/esm/core-react/base/DivWithOutsideClick.d.ts.map +1 -1
- package/lib/esm/core-react/base/DivWithOutsideClick.js +4 -2
- package/lib/esm/core-react/base/DivWithOutsideClick.js.map +1 -1
- package/lib/esm/core-react/base/FillCentered.d.ts +1 -1
- package/lib/esm/core-react/base/FillCentered.d.ts.map +1 -1
- package/lib/esm/core-react/base/FillCentered.js +2 -1
- package/lib/esm/core-react/base/FillCentered.js.map +1 -1
- package/lib/esm/core-react/base/FlexWrapContainer.d.ts +1 -1
- package/lib/esm/core-react/base/FlexWrapContainer.d.ts.map +1 -1
- package/lib/esm/core-react/base/FlexWrapContainer.js +2 -1
- package/lib/esm/core-react/base/FlexWrapContainer.js.map +1 -1
- package/lib/esm/core-react/base/Gap.d.ts +2 -2
- package/lib/esm/core-react/base/Gap.d.ts.map +1 -1
- package/lib/esm/core-react/base/Gap.js +1 -1
- package/lib/esm/core-react/base/Gap.js.map +1 -1
- package/lib/esm/core-react/base/ScrollView.d.ts +1 -1
- package/lib/esm/core-react/base/ScrollView.d.ts.map +1 -1
- package/lib/esm/core-react/base/ScrollView.js +2 -1
- package/lib/esm/core-react/base/ScrollView.js.map +1 -1
- package/lib/esm/core-react/button/UnderlinedButton.d.ts +2 -2
- package/lib/esm/core-react/button/UnderlinedButton.js +1 -1
- package/lib/esm/core-react/button/UnderlinedButton.js.map +1 -1
- package/lib/esm/core-react/checklistbox/CheckListBox.d.ts +4 -4
- package/lib/esm/core-react/checklistbox/CheckListBox.d.ts.map +1 -1
- package/lib/esm/core-react/checklistbox/CheckListBox.js +3 -3
- package/lib/esm/core-react/checklistbox/CheckListBox.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuDivider.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuDivider.js +1 -0
- package/lib/esm/core-react/contextmenu/ContextMenuDivider.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuItem.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/PopupContextMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/PopupContextMenu.js +3 -1
- package/lib/esm/core-react/contextmenu/PopupContextMenu.js.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.d.ts +4 -5
- package/lib/esm/core-react/dialog/Dialog.d.ts.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.js +3 -3
- package/lib/esm/core-react/dialog/Dialog.js.map +1 -1
- package/lib/esm/core-react/dialog/GlobalDialog.d.ts +3 -3
- package/lib/esm/core-react/dialog/GlobalDialog.js +1 -1
- package/lib/esm/core-react/dialog/GlobalDialog.js.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.d.ts +3 -3
- package/lib/esm/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.js +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/esm/core-react/enums/Alignment.d.ts +2 -0
- package/lib/esm/core-react/enums/Alignment.d.ts.map +1 -1
- package/lib/esm/core-react/enums/Alignment.js +2 -0
- package/lib/esm/core-react/enums/Alignment.js.map +1 -1
- package/lib/esm/core-react/enums/CheckBoxState.d.ts +1 -0
- package/lib/esm/core-react/enums/CheckBoxState.d.ts.map +1 -1
- package/lib/esm/core-react/enums/CheckBoxState.js.map +1 -1
- package/lib/esm/core-react/enums/SortDirection.d.ts +1 -0
- package/lib/esm/core-react/enums/SortDirection.d.ts.map +1 -1
- package/lib/esm/core-react/enums/SortDirection.js +1 -0
- package/lib/esm/core-react/enums/SortDirection.js.map +1 -1
- package/lib/esm/core-react/expandable/ExpandableList.d.ts +2 -2
- package/lib/esm/core-react/expandable/ExpandableList.d.ts.map +1 -1
- package/lib/esm/core-react/expandable/ExpandableList.js +1 -1
- package/lib/esm/core-react/expandable/ExpandableList.js.map +1 -1
- package/lib/esm/core-react/hocs/withIsPressed.d.ts +2 -0
- package/lib/esm/core-react/hocs/withIsPressed.d.ts.map +1 -1
- package/lib/esm/core-react/hocs/withIsPressed.js +1 -0
- package/lib/esm/core-react/hocs/withIsPressed.js.map +1 -1
- package/lib/esm/core-react/hocs/withOnOutsideClick.d.ts +2 -0
- package/lib/esm/core-react/hocs/withOnOutsideClick.d.ts.map +1 -1
- package/lib/esm/core-react/hocs/withOnOutsideClick.js +1 -0
- package/lib/esm/core-react/hocs/withOnOutsideClick.js.map +1 -1
- package/lib/esm/core-react/hocs/withTimeout.d.ts +2 -0
- package/lib/esm/core-react/hocs/withTimeout.d.ts.map +1 -1
- package/lib/esm/core-react/hocs/withTimeout.js +4 -1
- package/lib/esm/core-react/hocs/withTimeout.js.map +1 -1
- package/lib/esm/core-react/icons/IconComponent.d.ts.map +1 -1
- package/lib/esm/core-react/icons/IconComponent.js.map +1 -1
- package/lib/esm/core-react/icons/SvgPath.d.ts +2 -0
- package/lib/esm/core-react/icons/SvgPath.d.ts.map +1 -1
- package/lib/esm/core-react/icons/SvgPath.js +2 -0
- package/lib/esm/core-react/icons/SvgPath.js.map +1 -1
- package/lib/esm/core-react/icons/WebFontIcon.d.ts +2 -0
- package/lib/esm/core-react/icons/WebFontIcon.d.ts.map +1 -1
- package/lib/esm/core-react/icons/WebFontIcon.js +2 -0
- package/lib/esm/core-react/icons/WebFontIcon.js.map +1 -1
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.d.ts +2 -2
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.d.ts.map +1 -1
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js +1 -1
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
- package/lib/esm/core-react/inputs/Input.d.ts.map +1 -1
- package/lib/esm/core-react/inputs/Input.js.map +1 -1
- package/lib/esm/core-react/inputs/InputLabel.d.ts +2 -2
- package/lib/esm/core-react/inputs/InputLabel.d.ts.map +1 -1
- package/lib/esm/core-react/inputs/InputLabel.js +1 -1
- package/lib/esm/core-react/inputs/InputLabel.js.map +1 -1
- package/lib/esm/core-react/inputs/InputStatus.d.ts +1 -1
- package/lib/esm/core-react/inputs/InputStatus.js +1 -1
- package/lib/esm/core-react/inputs/InputStatus.js.map +1 -1
- package/lib/esm/core-react/inputs/LabeledComponentProps.d.ts +2 -2
- package/lib/esm/core-react/inputs/LabeledComponentProps.js.map +1 -1
- package/lib/esm/core-react/inputs/iconinput/IconInput.d.ts +2 -2
- package/lib/esm/core-react/inputs/iconinput/IconInput.js +1 -1
- package/lib/esm/core-react/inputs/iconinput/IconInput.js.map +1 -1
- package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts +3 -3
- package/lib/esm/core-react/inputs/numberinput/NumberInput.js +1 -1
- package/lib/esm/core-react/inputs/numberinput/NumberInput.js.map +1 -1
- package/lib/esm/core-react/listbox/Listbox.d.ts +7 -7
- package/lib/esm/core-react/listbox/Listbox.js +3 -3
- package/lib/esm/core-react/listbox/Listbox.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingBar.d.ts +2 -2
- package/lib/esm/core-react/loading/LoadingBar.js +1 -1
- package/lib/esm/core-react/loading/LoadingBar.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingPrompt.d.ts +2 -2
- package/lib/esm/core-react/loading/LoadingPrompt.js +1 -1
- package/lib/esm/core-react/loading/LoadingPrompt.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingSpinner.d.ts +3 -3
- package/lib/esm/core-react/loading/LoadingSpinner.js +1 -1
- package/lib/esm/core-react/loading/LoadingSpinner.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingStatus.d.ts +2 -2
- package/lib/esm/core-react/loading/LoadingStatus.js +1 -1
- package/lib/esm/core-react/loading/LoadingStatus.js.map +1 -1
- package/lib/esm/core-react/messagebox/MessageBox.d.ts +5 -1
- package/lib/esm/core-react/messagebox/MessageBox.d.ts.map +1 -1
- package/lib/esm/core-react/messagebox/MessageBox.js +8 -1
- package/lib/esm/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/esm/core-react/notification/MessageRenderer.d.ts +2 -0
- package/lib/esm/core-react/notification/MessageRenderer.d.ts.map +1 -1
- package/lib/esm/core-react/notification/MessageRenderer.js +2 -0
- package/lib/esm/core-react/notification/MessageRenderer.js.map +1 -1
- package/lib/esm/core-react/notification/MessageType.d.ts +2 -0
- package/lib/esm/core-react/notification/MessageType.d.ts.map +1 -1
- package/lib/esm/core-react/notification/MessageType.js.map +1 -1
- package/lib/esm/core-react/popup/Popup.d.ts +6 -1
- package/lib/esm/core-react/popup/Popup.d.ts.map +1 -1
- package/lib/esm/core-react/popup/Popup.js +9 -2
- package/lib/esm/core-react/popup/Popup.js.map +1 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.d.ts +4 -4
- package/lib/esm/core-react/radialmenu/RadialMenu.js +2 -2
- package/lib/esm/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/esm/core-react/searchbox/SearchBox.d.ts +2 -2
- package/lib/esm/core-react/searchbox/SearchBox.js +1 -1
- package/lib/esm/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/esm/core-react/settings/SettingsManager.d.ts +8 -8
- package/lib/esm/core-react/settings/SettingsManager.js +4 -4
- package/lib/esm/core-react/settings/SettingsManager.js.map +1 -1
- package/lib/esm/core-react/tabs/Tabs.d.ts +4 -4
- package/lib/esm/core-react/tabs/Tabs.js +1 -1
- package/lib/esm/core-react/tabs/Tabs.js.map +1 -1
- package/lib/esm/core-react/tabs/VerticalTabs.d.ts +1 -1
- package/lib/esm/core-react/tabs/VerticalTabs.js +1 -1
- package/lib/esm/core-react/tabs/VerticalTabs.js.map +1 -1
- package/lib/esm/core-react/text/BlockText.d.ts +1 -1
- package/lib/esm/core-react/text/BlockText.js +1 -1
- package/lib/esm/core-react/text/BlockText.js.map +1 -1
- package/lib/esm/core-react/text/BodyText.d.ts +1 -1
- package/lib/esm/core-react/text/BodyText.js +1 -1
- package/lib/esm/core-react/text/BodyText.js.map +1 -1
- package/lib/esm/core-react/text/DisabledText.d.ts +1 -1
- package/lib/esm/core-react/text/DisabledText.js +1 -1
- package/lib/esm/core-react/text/DisabledText.js.map +1 -1
- package/lib/esm/core-react/text/FilteredText.d.ts +2 -0
- package/lib/esm/core-react/text/FilteredText.d.ts.map +1 -1
- package/lib/esm/core-react/text/FilteredText.js +2 -0
- package/lib/esm/core-react/text/FilteredText.js.map +1 -1
- package/lib/esm/core-react/text/MutedText.d.ts +1 -1
- package/lib/esm/core-react/text/MutedText.js +1 -1
- package/lib/esm/core-react/text/MutedText.js.map +1 -1
- package/lib/esm/core-react/text/StyledText.d.ts +2 -2
- package/lib/esm/core-react/text/StyledText.js +1 -1
- package/lib/esm/core-react/text/StyledText.js.map +1 -1
- package/lib/esm/core-react/text/TextProps.d.ts +1 -1
- package/lib/esm/core-react/text/TextProps.js.map +1 -1
- package/lib/esm/core-react/tree/Branch.d.ts +2 -0
- package/lib/esm/core-react/tree/Branch.d.ts.map +1 -1
- package/lib/esm/core-react/tree/Branch.js +2 -0
- package/lib/esm/core-react/tree/Branch.js.map +1 -1
- package/lib/esm/core-react/tree/ExpansionToggle.d.ts +2 -0
- package/lib/esm/core-react/tree/ExpansionToggle.d.ts.map +1 -1
- package/lib/esm/core-react/tree/ExpansionToggle.js +2 -0
- package/lib/esm/core-react/tree/ExpansionToggle.js.map +1 -1
- package/lib/esm/core-react/tree/Node.d.ts +3 -3
- package/lib/esm/core-react/tree/Node.d.ts.map +1 -1
- package/lib/esm/core-react/tree/Node.js +6 -1
- package/lib/esm/core-react/tree/Node.js.map +1 -1
- package/lib/esm/core-react/tree/Placeholder.d.ts +2 -0
- package/lib/esm/core-react/tree/Placeholder.d.ts.map +1 -1
- package/lib/esm/core-react/tree/Placeholder.js +2 -0
- package/lib/esm/core-react/tree/Placeholder.js.map +1 -1
- package/lib/esm/core-react/tree/Tree.d.ts +2 -0
- package/lib/esm/core-react/tree/Tree.d.ts.map +1 -1
- package/lib/esm/core-react/tree/Tree.js +2 -0
- package/lib/esm/core-react/tree/Tree.js.map +1 -1
- package/lib/esm/core-react/utils/IconHelper.d.ts +1 -0
- package/lib/esm/core-react/utils/IconHelper.d.ts.map +1 -1
- package/lib/esm/core-react/utils/IconHelper.js +2 -0
- package/lib/esm/core-react/utils/IconHelper.js.map +1 -1
- package/lib/esm/core-react/utils/Props.d.ts +5 -1
- package/lib/esm/core-react/utils/Props.d.ts.map +1 -1
- package/lib/esm/core-react/utils/Props.js.map +1 -1
- package/lib/esm/core-react/utils/ScrollPositionMaintainer.d.ts +1 -0
- package/lib/esm/core-react/utils/ScrollPositionMaintainer.d.ts.map +1 -1
- package/lib/esm/core-react/utils/ScrollPositionMaintainer.js +3 -0
- package/lib/esm/core-react/utils/ScrollPositionMaintainer.js.map +1 -1
- package/lib/esm/core-react/utils/Timer.d.ts +2 -0
- package/lib/esm/core-react/utils/Timer.d.ts.map +1 -1
- package/lib/esm/core-react/utils/Timer.js +2 -0
- package/lib/esm/core-react/utils/Timer.js.map +1 -1
- package/lib/esm/core-react/utils/getCssVariable.d.ts +2 -0
- package/lib/esm/core-react/utils/getCssVariable.d.ts.map +1 -1
- package/lib/esm/core-react/utils/getCssVariable.js +3 -0
- package/lib/esm/core-react/utils/getCssVariable.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js +1 -0
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useDisposable.d.ts +1 -0
- package/lib/esm/core-react/utils/hooks/useDisposable.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useDisposable.js +1 -0
- package/lib/esm/core-react/utils/hooks/useDisposable.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useEffectSkipFirst.d.ts +1 -0
- package/lib/esm/core-react/utils/hooks/useEffectSkipFirst.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useEffectSkipFirst.js +1 -0
- package/lib/esm/core-react/utils/hooks/useEffectSkipFirst.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useInterval.d.ts +1 -0
- package/lib/esm/core-react/utils/hooks/useInterval.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useInterval.js +1 -0
- package/lib/esm/core-react/utils/hooks/useInterval.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useOnOutsideClick.d.ts +5 -1
- package/lib/esm/core-react/utils/hooks/useOnOutsideClick.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useOnOutsideClick.js +1 -0
- package/lib/esm/core-react/utils/hooks/useOnOutsideClick.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useResizeObserver.d.ts +2 -0
- package/lib/esm/core-react/utils/hooks/useResizeObserver.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js +2 -0
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/esm/core-react/utils/typeUtils.d.ts +1 -0
- package/lib/esm/core-react/utils/typeUtils.d.ts.map +1 -1
- package/lib/esm/core-react/utils/typeUtils.js.map +1 -1
- package/lib/esm/core-react.d.ts +0 -1
- package/lib/esm/core-react.d.ts.map +1 -1
- package/lib/esm/core-react.js +2 -1
- package/lib/esm/core-react.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.js","sourceRoot":"","sources":["../../../../../src/core-react/inputs/numberinput/NumberInput.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAA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B,MAAM,EAAE,UAAU,EAClB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,UAAU,CAAC,YAAY,EAAE,SAAS,CAAC,KAC1C,UAAU,GACd;QACF,6BACE,SAAS,EAAE,UAAU,CACnB,qCAAqC,EACrC,gBAAgB,IAAI,+BAA+B,CACpD;YAGD,6BACE,SAAS,EAAC,sDAAsD,EAChE,QAAQ,EAAE,CAAC,CAAC,EACZ,OAAO,EAAE,aAAa,EACtB,IAAI,EAAC,cAAc;gBAEnB,oBAAC,IAAI,IAAC,QAAQ,EAAE,OAAO,GAAI,CACvB;YAEN,6BACE,SAAS,EAAC,wDAAwD,EAClE,QAAQ,EAAE,CAAC,CAAC,EACZ,OAAO,EAAE,eAAe,EACxB,IAAI,EAAC,cAAc;gBAEnB,oBAAC,IAAI,IAAC,QAAQ,EAAE,SAAS,GAAI,CACzB,CACF,CACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAGD,qBAAqB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Inputs\n */\n\nimport \"./NumberInput.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Key } from \"ts-key-enum\";\nimport { Input } from \"@itwin/itwinui-react\";\nimport { Icon } from \"../../icons/IconComponent\";\nimport {\n SvgCaretDown,\n SvgCaretDownSmall,\n SvgCaretUp,\n SvgCaretUpSmall,\n} from \"@itwin/itwinui-icons-react\";\n\ntype InputProps = React.ComponentPropsWithoutRef<typeof Input>;\n\n/** Step function prototype for [[NumberInput]] component\n * @public\n * @deprecated in 4.12.x. Interface used in a deprecated component {@link NumberInput}.\n */\nexport type StepFunctionProp =\n | number\n | ((direction: string) => number | undefined);\n\n/** Properties for the [[NumberInput]] component\n * @public\n * @deprecated in 4.12.x. Props of deprecated component {@link NumberInput}.\n */\nexport interface NumberInputProps\n extends Omit<InputProps, \"min\" | \"max\" | \"step\" | \"onChange\"> {\n /** Numeric value, set to `undefined` to show placeholder text */\n value?: number;\n /** CSS class name for the NumberInput component container div */\n containerClassName?: string;\n /** Style for component container div. */\n containerStyle?: React.CSSProperties;\n /** number or function\tNumber.MIN_SAFE_INTEGER */\n min?: number;\n /** number or function\tdefaults to Number.MAX_SAFE_INTEGER */\n max?: number;\n /** increment step value used while incrementing or decrementing (up/down buttons or arrow keys) defaults to 1. */\n // eslint-disable-next-line deprecation/deprecation\n step?: StepFunctionProp;\n /** number of decimal places, defaults to 0 */\n precision?: number;\n /** function parseFloat */\n parse?: (value: string) => number | null | undefined;\n /** function optional formatting function that takes the number value and the internal formatted value in case function just adds prefix or suffix. */\n format?: (num: number | null | undefined, formattedValue: string) => string;\n /** Set to true to \"snap\" to the closest step value while incrementing or decrementing (up/down buttons or arrow keys). */\n snap?: boolean;\n /** Function to call when value is changed. */\n onChange?: (value: number | undefined, stringValue: string) => void;\n /** if true up/down buttons are shown larger and side by side */\n showTouchButtons?: boolean;\n /** Provides ability to return reference to HTMLInputElement */\n ref?: React.Ref<HTMLInputElement>;\n /**\n * Makes this component behave as controlled component.\n * @internal\n */\n isControlled?: boolean;\n}\n\nconst ForwardRefNumberInput = React.forwardRef<\n HTMLInputElement,\n // eslint-disable-next-line deprecation/deprecation\n NumberInputProps\n>(function ForwardRefNumberInput(props, ref) {\n const {\n containerClassName,\n className,\n value,\n min,\n max,\n precision,\n format,\n parse,\n onChange,\n onBlur,\n onKeyDown,\n step,\n snap,\n showTouchButtons,\n containerStyle,\n isControlled,\n ...otherProps\n } = props;\n const currentValueRef = React.useRef(value);\n\n /**\n * Used internally to parse the argument x to it's numeric representation.\n * If the argument cannot be converted to finite number returns 0; If a\n * \"precision\" prop is specified uses it round the number with that\n * precision (no fixed precision here because the return value is float, not\n * string).\n */\n const parseInternal = React.useCallback(\n (x: string) => {\n let n: number | undefined | null;\n\n if (parse) n = parse(x);\n if (undefined === n || null === n) {\n n = parseFloat(x);\n if (isNaN(n) || !isFinite(n)) {\n n = 0;\n }\n }\n\n const localPrecision = undefined === precision ? 10 : precision;\n const q = Math.pow(10, localPrecision);\n const localMin = undefined === min ? Number.MIN_SAFE_INTEGER : min;\n const localMax = undefined === max ? Number.MAX_SAFE_INTEGER : max;\n n = Math.min(Math.max(n, localMin), localMax);\n n = Math.round(n * q) / q;\n\n return n;\n },\n [parse, precision, min, max]\n );\n\n /**\n * This is used internally to format a number to its display representation.\n * It will invoke the format function if one is provided.\n */\n const formatInternal = React.useCallback(\n (num: number | undefined | null) => {\n const localPrecision =\n undefined === precision || null === precision ? 0 : precision;\n const str =\n undefined === num || null === num ? \"\" : num.toFixed(localPrecision);\n\n if (format) return format(num, str);\n\n return str;\n },\n [format, precision]\n );\n\n const [formattedValue, setFormattedValue] = React.useState(() =>\n formatInternal(value)\n );\n\n // See if new initialValue props have changed since component mounted\n React.useEffect(() => {\n currentValueRef.current = value;\n const currentFormattedValue = formatInternal(currentValueRef.current);\n setFormattedValue(currentFormattedValue);\n }, [formatInternal, value]);\n\n const handleChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const newVal = event.currentTarget.value;\n setFormattedValue(newVal);\n isControlled && onChange && onChange(parseInternal(newVal), newVal);\n },\n [isControlled, onChange, parseInternal]\n );\n\n const updateValue = React.useCallback(\n (newVal: number) => {\n const newFormattedVal = formatInternal(newVal);\n onChange && onChange(newVal, newFormattedVal);\n setFormattedValue(newFormattedVal);\n },\n [onChange, formatInternal]\n );\n\n const updateValueFromString = React.useCallback(\n (strValue: string) => {\n const newVal = parseInternal(strValue);\n updateValue(newVal);\n },\n [parseInternal, updateValue]\n );\n\n const handleBlur = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n const newVal = parseInternal(event.target.value);\n onBlur && onBlur(event);\n updateValue(newVal);\n },\n [parseInternal, updateValue, onBlur]\n );\n\n const getIncrementValue = React.useCallback(\n (increment: boolean) => {\n if (typeof step === \"function\") {\n const stepVal = step(increment ? \"up\" : \"down\");\n return stepVal ? stepVal : 1;\n }\n\n return !step ? 1 : step;\n },\n [step]\n );\n\n /**\n * The internal method that actually sets the new value on the input\n */\n const applyStep = React.useCallback(\n (increment: boolean) => {\n const incrementValue = getIncrementValue(increment);\n\n let num =\n parseInternal(formattedValue) +\n (increment ? incrementValue : -incrementValue);\n if (snap) {\n num = Math.round(num / incrementValue) * incrementValue;\n }\n\n const localMin = undefined === min ? Number.MIN_SAFE_INTEGER : min;\n const localMax = undefined === max ? Number.MAX_SAFE_INTEGER : max;\n num = Math.min(Math.max(num, localMin), localMax);\n\n updateValue(num);\n },\n [\n formattedValue,\n getIncrementValue,\n max,\n min,\n parseInternal,\n snap,\n updateValue,\n ]\n );\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === Key.Enter.valueOf()) {\n updateValueFromString(event.currentTarget.value);\n event.preventDefault();\n event.stopPropagation();\n } else if (event.key === Key.Escape.valueOf()) {\n setFormattedValue(formatInternal(currentValueRef.current));\n event.preventDefault();\n } else if (event.key === Key.ArrowDown.valueOf()) {\n applyStep(false);\n event.preventDefault();\n event.stopPropagation();\n } else if (event.key === Key.ArrowUp.valueOf()) {\n applyStep(true);\n event.preventDefault();\n event.stopPropagation();\n }\n onKeyDown && onKeyDown(event);\n },\n [applyStep, formatInternal, updateValueFromString, onKeyDown]\n );\n\n const handleDownClick = React.useCallback(\n (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n applyStep(false);\n event.preventDefault();\n },\n [applyStep]\n );\n\n const handleUpClick = React.useCallback(\n (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n applyStep(true);\n event.preventDefault();\n },\n [applyStep]\n );\n\n const handleFocus = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n event.currentTarget.select();\n },\n []\n );\n\n const isDisabled = !!otherProps.disabled;\n const containerClasses = classnames(\n \"core-number-input-container\",\n containerClassName,\n showTouchButtons && \"core-number-buttons-for-touch\",\n isDisabled && \"core-number-input-disabled\"\n );\n\n const caretUp = showTouchButtons ? <SvgCaretUp /> : <SvgCaretUpSmall />;\n const caretDown = showTouchButtons ? <SvgCaretDown /> : <SvgCaretDownSmall />;\n\n return (\n <div className={containerClasses} style={containerStyle}>\n <Input\n ref={ref}\n value={formattedValue}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n onBlur={handleBlur}\n size=\"small\"\n className={classnames(\"core-input\", className)}\n {...otherProps}\n />\n <div\n className={classnames(\n \"core-number-input-buttons-container\",\n showTouchButtons && \"core-number-buttons-for-touch\"\n )}\n >\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n className=\"core-number-input-button core-number-input-button-up\"\n tabIndex={-1}\n onClick={handleUpClick}\n role=\"presentation\"\n >\n <Icon iconSpec={caretUp} />\n </div>\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n className=\"core-number-input-button core-number-input-button-down\"\n tabIndex={-1}\n onClick={handleDownClick}\n role=\"presentation\"\n >\n <Icon iconSpec={caretDown} />\n </div>\n </div>\n </div>\n );\n});\n\n/** Input component for numbers with up and down buttons to increment and decrement the value.\n * @public\n * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/input iTwinUI input} instead.\n */\nexport const NumberInput: (\n // eslint-disable-next-line deprecation/deprecation\n props: NumberInputProps\n) => React.ReactNode = ForwardRefNumberInput;\n"]}
|
|
1
|
+
{"version":3,"file":"NumberInput.js","sourceRoot":"","sources":["../../../../../src/core-react/inputs/numberinput/NumberInput.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,K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EACtB,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,UAAU,EAClB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,UAAU,CAAC,YAAY,EAAE,SAAS,CAAC,KAC1C,UAAU,GACd;QACF,6BACE,SAAS,EAAE,UAAU,CACnB,qCAAqC,EACrC,gBAAgB,IAAI,+BAA+B,CACpD;YAGD,6BACE,SAAS,EAAC,sDAAsD,EAChE,QAAQ,EAAE,CAAC,CAAC,EACZ,OAAO,EAAE,aAAa,EACtB,IAAI,EAAC,cAAc;gBAEnB,oBAAC,IAAI,IAAC,QAAQ,EAAE,OAAO,GAAI,CACvB;YAEN,6BACE,SAAS,EAAC,wDAAwD,EAClE,QAAQ,EAAE,CAAC,CAAC,EACZ,OAAO,EAAE,eAAe,EACxB,IAAI,EAAC,cAAc;gBAEnB,oBAAC,IAAI,IAAC,QAAQ,EAAE,SAAS,GAAI,CACzB,CACF,CACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAGD,qBAAqB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Inputs\n */\n\nimport \"./NumberInput.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Key } from \"ts-key-enum\";\nimport { Input } from \"@itwin/itwinui-react\";\nimport { Icon } from \"../../icons/IconComponent\";\nimport {\n SvgCaretDown,\n SvgCaretDownSmall,\n SvgCaretUp,\n SvgCaretUpSmall,\n} from \"@itwin/itwinui-icons-react\";\n\ntype InputProps = React.ComponentPropsWithoutRef<typeof Input>;\n\n/** Step function prototype for [[NumberInput]] component\n * @public\n * @deprecated in 4.12.0. Interface used in a deprecated component {@link NumberInput}.\n */\nexport type StepFunctionProp =\n | number\n | ((direction: string) => number | undefined);\n\n/** Properties for the [[NumberInput]] component\n * @public\n * @deprecated in 4.12.0. Props of deprecated component {@link NumberInput}.\n */\nexport interface NumberInputProps\n extends Omit<InputProps, \"min\" | \"max\" | \"step\" | \"onChange\"> {\n /** Numeric value, set to `undefined` to show placeholder text */\n value?: number;\n /** CSS class name for the NumberInput component container div */\n containerClassName?: string;\n /** Style for component container div. */\n containerStyle?: React.CSSProperties;\n /** number or function\tNumber.MIN_SAFE_INTEGER */\n min?: number;\n /** number or function\tdefaults to Number.MAX_SAFE_INTEGER */\n max?: number;\n /** increment step value used while incrementing or decrementing (up/down buttons or arrow keys) defaults to 1. */\n // eslint-disable-next-line deprecation/deprecation\n step?: StepFunctionProp;\n /** number of decimal places, defaults to 0 */\n precision?: number;\n /** function parseFloat */\n parse?: (value: string) => number | null | undefined;\n /** function optional formatting function that takes the number value and the internal formatted value in case function just adds prefix or suffix. */\n format?: (num: number | null | undefined, formattedValue: string) => string;\n /** Set to true to \"snap\" to the closest step value while incrementing or decrementing (up/down buttons or arrow keys). */\n snap?: boolean;\n /** Function to call when value is changed. */\n onChange?: (value: number | undefined, stringValue: string) => void;\n /** if true up/down buttons are shown larger and side by side */\n showTouchButtons?: boolean;\n /** Provides ability to return reference to HTMLInputElement */\n ref?: React.Ref<HTMLInputElement>;\n /**\n * Makes this component behave as controlled component.\n * @internal\n */\n isControlled?: boolean;\n}\n\nconst ForwardRefNumberInput = React.forwardRef<\n HTMLInputElement,\n // eslint-disable-next-line deprecation/deprecation\n NumberInputProps\n>(function ForwardRefNumberInput(props, ref) {\n const {\n containerClassName,\n className,\n value,\n min,\n max,\n precision,\n format,\n parse,\n onChange,\n onBlur,\n onKeyDown,\n step,\n snap,\n showTouchButtons,\n containerStyle,\n isControlled,\n ...otherProps\n } = props;\n const currentValueRef = React.useRef(value);\n\n /**\n * Used internally to parse the argument x to it's numeric representation.\n * If the argument cannot be converted to finite number returns 0; If a\n * \"precision\" prop is specified uses it round the number with that\n * precision (no fixed precision here because the return value is float, not\n * string).\n */\n const parseInternal = React.useCallback(\n (x: string) => {\n let n: number | undefined | null;\n\n if (parse) n = parse(x);\n if (undefined === n || null === n) {\n n = parseFloat(x);\n if (isNaN(n) || !isFinite(n)) {\n n = 0;\n }\n }\n\n const localPrecision = undefined === precision ? 10 : precision;\n const q = Math.pow(10, localPrecision);\n const localMin = undefined === min ? Number.MIN_SAFE_INTEGER : min;\n const localMax = undefined === max ? Number.MAX_SAFE_INTEGER : max;\n n = Math.min(Math.max(n, localMin), localMax);\n n = Math.round(n * q) / q;\n\n return n;\n },\n [parse, precision, min, max]\n );\n\n /**\n * This is used internally to format a number to its display representation.\n * It will invoke the format function if one is provided.\n */\n const formatInternal = React.useCallback(\n (num: number | undefined | null) => {\n const localPrecision =\n undefined === precision || null === precision ? 0 : precision;\n const str =\n undefined === num || null === num ? \"\" : num.toFixed(localPrecision);\n\n if (format) return format(num, str);\n\n return str;\n },\n [format, precision]\n );\n\n const [formattedValue, setFormattedValue] = React.useState(() =>\n formatInternal(value)\n );\n\n // See if new initialValue props have changed since component mounted\n React.useEffect(() => {\n currentValueRef.current = value;\n const currentFormattedValue = formatInternal(currentValueRef.current);\n setFormattedValue(currentFormattedValue);\n }, [formatInternal, value]);\n\n const handleChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const newVal = event.currentTarget.value;\n setFormattedValue(newVal);\n isControlled && onChange && onChange(parseInternal(newVal), newVal);\n },\n [isControlled, onChange, parseInternal]\n );\n\n const updateValue = React.useCallback(\n (newVal: number) => {\n const newFormattedVal = formatInternal(newVal);\n onChange && onChange(newVal, newFormattedVal);\n setFormattedValue(newFormattedVal);\n },\n [onChange, formatInternal]\n );\n\n const updateValueFromString = React.useCallback(\n (strValue: string) => {\n const newVal = parseInternal(strValue);\n updateValue(newVal);\n },\n [parseInternal, updateValue]\n );\n\n const handleBlur = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n const newVal = parseInternal(event.target.value);\n onBlur && onBlur(event);\n updateValue(newVal);\n },\n [parseInternal, updateValue, onBlur]\n );\n\n const getIncrementValue = React.useCallback(\n (increment: boolean) => {\n if (typeof step === \"function\") {\n const stepVal = step(increment ? \"up\" : \"down\");\n return stepVal ? stepVal : 1;\n }\n\n return !step ? 1 : step;\n },\n [step]\n );\n\n /**\n * The internal method that actually sets the new value on the input\n */\n const applyStep = React.useCallback(\n (increment: boolean) => {\n const incrementValue = getIncrementValue(increment);\n\n let num =\n parseInternal(formattedValue) +\n (increment ? incrementValue : -incrementValue);\n if (snap) {\n num = Math.round(num / incrementValue) * incrementValue;\n }\n\n const localMin = undefined === min ? Number.MIN_SAFE_INTEGER : min;\n const localMax = undefined === max ? Number.MAX_SAFE_INTEGER : max;\n num = Math.min(Math.max(num, localMin), localMax);\n\n updateValue(num);\n },\n [\n formattedValue,\n getIncrementValue,\n max,\n min,\n parseInternal,\n snap,\n updateValue,\n ]\n );\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === Key.Enter.valueOf()) {\n updateValueFromString(event.currentTarget.value);\n event.preventDefault();\n event.stopPropagation();\n } else if (event.key === Key.Escape.valueOf()) {\n setFormattedValue(formatInternal(currentValueRef.current));\n event.preventDefault();\n } else if (event.key === Key.ArrowDown.valueOf()) {\n applyStep(false);\n event.preventDefault();\n event.stopPropagation();\n } else if (event.key === Key.ArrowUp.valueOf()) {\n applyStep(true);\n event.preventDefault();\n event.stopPropagation();\n }\n onKeyDown && onKeyDown(event);\n },\n [applyStep, formatInternal, updateValueFromString, onKeyDown]\n );\n\n const handleDownClick = React.useCallback(\n (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n applyStep(false);\n event.preventDefault();\n },\n [applyStep]\n );\n\n const handleUpClick = React.useCallback(\n (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n applyStep(true);\n event.preventDefault();\n },\n [applyStep]\n );\n\n const handleFocus = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n event.currentTarget.select();\n },\n []\n );\n\n const isDisabled = !!otherProps.disabled;\n const containerClasses = classnames(\n \"core-number-input-container\",\n containerClassName,\n showTouchButtons && \"core-number-buttons-for-touch\",\n isDisabled && \"core-number-input-disabled\"\n );\n\n const caretUp = showTouchButtons ? <SvgCaretUp /> : <SvgCaretUpSmall />;\n const caretDown = showTouchButtons ? <SvgCaretDown /> : <SvgCaretDownSmall />;\n\n return (\n <div className={containerClasses} style={containerStyle}>\n <Input\n ref={ref}\n value={formattedValue}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n onBlur={handleBlur}\n size=\"small\"\n className={classnames(\"core-input\", className)}\n {...otherProps}\n />\n <div\n className={classnames(\n \"core-number-input-buttons-container\",\n showTouchButtons && \"core-number-buttons-for-touch\"\n )}\n >\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n className=\"core-number-input-button core-number-input-button-up\"\n tabIndex={-1}\n onClick={handleUpClick}\n role=\"presentation\"\n >\n <Icon iconSpec={caretUp} />\n </div>\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n className=\"core-number-input-button core-number-input-button-down\"\n tabIndex={-1}\n onClick={handleDownClick}\n role=\"presentation\"\n >\n <Icon iconSpec={caretDown} />\n </div>\n </div>\n </div>\n );\n});\n\n/** Input component for numbers with up and down buttons to increment and decrement the value.\n * @public\n * @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/input iTwinUI input} instead.\n */\nexport const NumberInput: (\n // eslint-disable-next-line deprecation/deprecation\n props: NumberInputProps\n) => React.ReactNode = ForwardRefNumberInput;\n"]}
|
|
@@ -3,12 +3,12 @@ import "./Listbox.scss";
|
|
|
3
3
|
/** Ideas borrowed from https://reacttraining.com/reach-ui/listbox */
|
|
4
4
|
/** `Listbox` value.
|
|
5
5
|
* @alpha
|
|
6
|
-
* @deprecated in 4.12.
|
|
6
|
+
* @deprecated in 4.12.0. Value used in a deprecated component {@link Listbox}.
|
|
7
7
|
*/
|
|
8
8
|
export type ListboxValue = string;
|
|
9
9
|
/** `Listbox` Props.
|
|
10
10
|
* @alpha
|
|
11
|
-
* @deprecated in 4.12.
|
|
11
|
+
* @deprecated in 4.12.0. Props of deprecated component {@link Listbox}.
|
|
12
12
|
*/
|
|
13
13
|
export interface ListboxProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement> {
|
|
14
14
|
id?: string;
|
|
@@ -19,7 +19,7 @@ export interface ListboxProps extends React.DetailedHTMLProps<React.HTMLAttribut
|
|
|
19
19
|
}
|
|
20
20
|
/** `ListboxItem` Props.
|
|
21
21
|
* @alpha
|
|
22
|
-
* @deprecated in 4.12.
|
|
22
|
+
* @deprecated in 4.12.0. Props of deprecated component {@link ListboxItem}.
|
|
23
23
|
*/
|
|
24
24
|
export interface ListboxItemProps extends React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement> {
|
|
25
25
|
/** The unique item's value. */
|
|
@@ -29,7 +29,7 @@ export interface ListboxItemProps extends React.DetailedHTMLProps<React.LiHTMLAt
|
|
|
29
29
|
}
|
|
30
30
|
/** `Listbox` Context.
|
|
31
31
|
* @alpha
|
|
32
|
-
* @deprecated in 4.12.
|
|
32
|
+
* @deprecated in 4.12.0. Props of deprecated context {@link ListboxContext}.
|
|
33
33
|
*/
|
|
34
34
|
export interface ListboxContextProps {
|
|
35
35
|
listboxId?: string;
|
|
@@ -40,17 +40,17 @@ export interface ListboxContextProps {
|
|
|
40
40
|
}
|
|
41
41
|
/** Context set up by listbox for use by `ListboxItems` .
|
|
42
42
|
* @alpha
|
|
43
|
-
* @deprecated in 4.12.
|
|
43
|
+
* @deprecated in 4.12.0. Context of deprecated component {@link Listbox}.
|
|
44
44
|
*/
|
|
45
45
|
export declare const ListboxContext: React.Context<ListboxContextProps>;
|
|
46
46
|
/** Single select `Listbox` component
|
|
47
47
|
* @alpha
|
|
48
|
-
* @deprecated in 4.12.
|
|
48
|
+
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/list iTwinUI list} instead.
|
|
49
49
|
*/
|
|
50
50
|
export declare function Listbox(props: ListboxProps): React.JSX.Element;
|
|
51
51
|
/** `ListboxItem` component.
|
|
52
52
|
* @alpha
|
|
53
|
-
* @deprecated in 4.12.
|
|
53
|
+
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/list iTwinUI list} instead.
|
|
54
54
|
*/
|
|
55
55
|
export declare function ListboxItem(props: ListboxItemProps): React.JSX.Element;
|
|
56
56
|
//# sourceMappingURL=Listbox.d.ts.map
|
|
@@ -9,7 +9,7 @@ import "./Listbox.scss";
|
|
|
9
9
|
import { Guid } from "@itwin/core-bentley";
|
|
10
10
|
/** Context set up by listbox for use by `ListboxItems` .
|
|
11
11
|
* @alpha
|
|
12
|
-
* @deprecated in 4.12.
|
|
12
|
+
* @deprecated in 4.12.0. Context of deprecated component {@link Listbox}.
|
|
13
13
|
*/
|
|
14
14
|
export const ListboxContext = React.createContext({
|
|
15
15
|
onListboxValueChange: (_newValue) => { },
|
|
@@ -66,7 +66,7 @@ function processKeyboardNavigation(optionValues, itemIndex, key) {
|
|
|
66
66
|
}
|
|
67
67
|
/** Single select `Listbox` component
|
|
68
68
|
* @alpha
|
|
69
|
-
* @deprecated in 4.12.
|
|
69
|
+
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/list iTwinUI list} instead.
|
|
70
70
|
*/
|
|
71
71
|
export function Listbox(props) {
|
|
72
72
|
const { ariaLabel, ariaLabelledBy, id, children, selectedValue, className, onListboxValueChange, onKeyDown, ...otherProps } = props;
|
|
@@ -182,7 +182,7 @@ export function Listbox(props) {
|
|
|
182
182
|
}
|
|
183
183
|
/** `ListboxItem` component.
|
|
184
184
|
* @alpha
|
|
185
|
-
* @deprecated in 4.12.
|
|
185
|
+
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/list iTwinUI list} instead.
|
|
186
186
|
*/
|
|
187
187
|
export function ListboxItem(props) {
|
|
188
188
|
const { children, value, className, disabled, ...otherProps } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Listbox.js","sourceRoot":"","sources":["../../../../src/core-react/listbox/Listbox.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AA6D3C;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,aAAa,CAAsB;IACrE,oBAAoB,EAAE,CAAC,SAAmC,EAAE,EAAE,GAAE,CAAC;CAClE,CAAC,CAAC;AAEH,SAAS,MAAM,CAAC,GAAG,IAA+C;IAChE,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,mBAAmB,CAAC,UAA2B;IACtD,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC;SACtC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;SAChE,GAAG,CACF,CAAC,UAAU,EAAE,EAAE,CACZ,UAAiC,CAAC,KAAyB,CAC/D,CAAC;AACN,CAAC;AAED,SAAS,yBAAyB,CAChC,YAAgC,EAChC,SAAiB,EACjB,GAAW;IAEX,IAAI,YAAY,GAAG,KAAK,CAAC;IACzB,IAAI,QAAQ,GAAG,SAAS,IAAI,CAAC,CAAC,C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AAQ,GAAG,UAAU,KAAK,KAAK,CAAC;IAEtC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAC3B,GAAG,EAAE,CAAC,UAAU,CAAC,mBAAmB,EAAE,QAAQ,IAAI,SAAS,EAAE,SAAS,CAAC,EACvE,CAAC,SAAS,EAAE,QAAQ,CAAC,CACtB,CAAC;IACF,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAgB,IAAI,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,YAAY,KAAK,KAAK,CAAC;IAE1C,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CACnC,CAAC,KAAkD,EAAE,EAAE;QACrD,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,EAAE,OAAO,EAAE,KAAK,CAAC;QAC1D,IAAI,SAAS,KAAK,aAAa,EAAE,CAAC;YAChC,oBAAoB,CAAC,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACrD,CAAC;IACH,CAAC,EACD,CAAC,oBAAoB,CAAC,CACvB,CAAC;IAEF,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACvC,OAAO,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAClC,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;IAEvB,OAAO;IACL,iEAAiE;IACjE,6CAIiB,UAAU,mBAIV,QAAQ,IAAI,SAAS;QACpC,uEAAuE;QACvE,sCAAsC;QACtC,wDAAwD;QACxD,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,OAAO,KACd,UAAU,EACd,GAAG,EAAE,OAAO,EACZ,EAAE,EAAE,SAAS,EAAE,gBAEH,KAAK,EACjB,OAAO,EAAE,WAAW,IAEnB,QAAQ,CACN,CACN,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport { Key } from \"ts-key-enum\";\n\nimport \"./Listbox.scss\";\nimport { Guid } from \"@itwin/core-bentley\";\n\n/** Ideas borrowed from https://reacttraining.com/reach-ui/listbox */\n\n/* eslint-disable deprecation/deprecation */\n\n/** `Listbox` value.\n * @alpha\n * @deprecated in 4.12.x. Value used in a deprecated component {@link Listbox}.\n */\nexport type ListboxValue = string;\n\n/** `Listbox` Props.\n * @alpha\n * @deprecated in 4.12.x. Props of deprecated component {@link Listbox}.\n */\nexport interface ListboxProps\n extends React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLUListElement>,\n HTMLUListElement\n > {\n id?: string;\n selectedValue?: ListboxValue;\n ariaLabel?: any;\n ariaLabelledBy?: any;\n onListboxValueChange?: (\n newValue: ListboxValue,\n isControlOrCommandPressed?: boolean\n ) => void;\n}\n\n/** `ListboxItem` Props.\n * @alpha\n * @deprecated in 4.12.x. Props of deprecated component {@link ListboxItem}.\n */\nexport interface ListboxItemProps\n extends React.DetailedHTMLProps<\n React.LiHTMLAttributes<HTMLLIElement>,\n HTMLLIElement\n > {\n /** The unique item's value. */\n value: ListboxValue;\n /** set if item is disabled. */\n disabled?: boolean;\n}\n\n/** `Listbox` Context.\n * @alpha\n * @deprecated in 4.12.x. Props of deprecated context {@link ListboxContext}.\n */\nexport interface ListboxContextProps {\n listboxId?: string;\n listboxValue?: ListboxValue;\n focusValue?: ListboxValue;\n onListboxValueChange: (\n newValue: ListboxValue,\n isControlOrCommandPressed?: boolean\n ) => void;\n listboxRef?: React.RefObject<HTMLUListElement>;\n}\n\n/** Context set up by listbox for use by `ListboxItems` .\n * @alpha\n * @deprecated in 4.12.x. Context of deprecated component {@link Listbox}.\n */\nexport const ListboxContext = React.createContext<ListboxContextProps>({\n onListboxValueChange: (_newValue: ListboxValue | undefined) => {},\n});\n\nfunction makeId(...args: Array<string | number | null | undefined>) {\n return args.filter((val) => val != null).join(\"--\");\n}\n\nfunction getOptionValueArray(childNodes: React.ReactNode): ListboxItemProps[] {\n return React.Children.toArray(childNodes)\n .filter((node) => React.isValidElement(node) && node.props.value)\n .map(\n (optionNode) =>\n (optionNode as React.ReactElement).props as ListboxItemProps\n );\n}\n\nfunction processKeyboardNavigation(\n optionValues: ListboxItemProps[],\n itemIndex: number,\n key: string\n): [number, boolean] {\n let keyProcessed = false;\n let newIndex = itemIndex >= 0 ? itemIndex : 0;\n\n // Note: In aria example Page Up/Down just moves up or down by one item. See https://www.w3.org/TR/wai-aria-practices-1.1/examples/listbox/js/listbox.js\n if (key === Key.ArrowDown.valueOf() || key === Key.PageDown.valueOf()) {\n for (let i = itemIndex + 1; i < optionValues.length; i++) {\n if (!optionValues[i].disabled) {\n newIndex = i;\n break;\n }\n }\n keyProcessed = true;\n } else if (key === Key.ArrowUp.valueOf() || key === Key.PageUp.valueOf()) {\n for (let i = itemIndex - 1; i >= 0; i--) {\n if (!optionValues[i].disabled) {\n newIndex = i;\n break;\n }\n }\n keyProcessed = true;\n } else if (key === Key.Home.valueOf()) {\n for (let i = 0; i < optionValues.length; i++) {\n if (!optionValues[i].disabled) {\n newIndex = i;\n break;\n }\n }\n keyProcessed = true;\n } else if (key === Key.End.valueOf()) {\n for (let i = optionValues.length - 1; i >= 0; i--) {\n if (!optionValues[i].disabled) {\n newIndex = i;\n break;\n }\n }\n keyProcessed = true;\n }\n return [newIndex, keyProcessed];\n}\n\n/** Single select `Listbox` component\n * @alpha\n * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/list iTwinUI list} instead.\n */\nexport function Listbox(props: ListboxProps) {\n const {\n ariaLabel,\n ariaLabelledBy,\n id,\n children,\n selectedValue,\n className,\n onListboxValueChange,\n onKeyDown,\n ...otherProps\n } = props;\n const listRef = React.useRef<HTMLUListElement>(null);\n const [listId] = React.useState(() => {\n return id ?? Guid.createValue();\n });\n const optionValues = React.useMemo(\n () => getOptionValueArray(children),\n [children]\n );\n const classes = React.useMemo(\n () => classnames(\"core-listbox\", className),\n [className]\n );\n const [currentValue, setCurrentValue] = React.useState<\n ListboxValue | undefined\n >(selectedValue);\n const [focusValue, setFocusValue] = React.useState<ListboxValue | undefined>(\n currentValue\n );\n\n React.useEffect(() => {\n setCurrentValue(selectedValue);\n setFocusValue(selectedValue);\n }, [selectedValue]);\n\n const scrollTopRef = React.useRef(0);\n const handleValueChange = React.useCallback(\n (newValue: ListboxValue, isControlOrCommandPressed?: boolean) => {\n if (newValue !== currentValue) {\n setCurrentValue(newValue);\n setFocusValue(newValue);\n if (onListboxValueChange)\n onListboxValueChange(newValue, isControlOrCommandPressed);\n }\n },\n [setCurrentValue, currentValue, onListboxValueChange]\n );\n\n const focusOption = React.useCallback(\n (itemIndex: number) => {\n if (itemIndex >= 0 && itemIndex < optionValues.length) {\n const newSelection = optionValues[itemIndex];\n const listElement = listRef.current as HTMLUListElement;\n const optionToFocus = listElement.querySelector<HTMLLIElement>(\n `li[data-value=\"${newSelection.value}\"]`\n );\n if (optionToFocus && listElement) {\n let newScrollTop = listElement.scrollTop;\n\n if (listElement.scrollHeight > listElement.clientHeight) {\n const scrollBottom =\n listElement.clientHeight + listElement.scrollTop;\n const elementBottom =\n optionToFocus.offsetTop + optionToFocus.offsetHeight;\n if (elementBottom > scrollBottom) {\n newScrollTop = elementBottom - listElement.clientHeight;\n } else if (optionToFocus.offsetTop < listElement.scrollTop) {\n newScrollTop = optionToFocus.offsetTop;\n }\n scrollTopRef.current = newScrollTop;\n }\n setFocusValue(newSelection.value);\n }\n }\n },\n [optionValues]\n );\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLUListElement>) => {\n if (optionValues.length < 1) return;\n\n const itemIndex =\n undefined === focusValue\n ? -1\n : optionValues.findIndex(\n (optionValue) => optionValue.value === focusValue\n );\n\n if (event.key === \" \") {\n event.preventDefault();\n if (focusValue)\n handleValueChange(\n focusValue,\n event.getModifierState(\"Control\") || event.getModifierState(\"Meta\")\n ); // Control or Command\n return;\n } else {\n const [newItemIndex, keyProcessed] = processKeyboardNavigation(\n optionValues,\n itemIndex,\n event.key\n );\n if (keyProcessed) {\n event.preventDefault();\n focusOption(newItemIndex);\n return;\n }\n }\n\n if (onKeyDown) onKeyDown(event);\n },\n [focusValue, optionValues, focusOption, onKeyDown, handleValueChange]\n );\n\n const isInitialMount = React.useRef(true);\n\n React.useEffect(() => {\n const list = listRef.current as HTMLUListElement;\n\n if (isInitialMount.current) {\n isInitialMount.current = false;\n\n if (undefined !== focusValue) {\n const itemIndex = optionValues.findIndex(\n (optionValue) => optionValue.value === focusValue\n );\n focusOption(itemIndex);\n }\n } else {\n list.scrollTop = scrollTopRef.current;\n }\n }, [focusValue, focusOption, optionValues]);\n\n const handleOnScroll = React.useCallback(\n (_event: React.UIEvent<HTMLUListElement, UIEvent>) => {\n if (listRef.current) scrollTopRef.current = listRef.current.scrollTop;\n },\n []\n );\n\n const handleOnFocus = React.useCallback(\n (_event: React.FocusEvent<HTMLUListElement>) => {\n if (!focusValue || 0 === focusValue.length) {\n if (currentValue) {\n setFocusValue(currentValue);\n } else {\n if (optionValues.length > 0) setFocusValue(optionValues[0].value);\n }\n }\n },\n [currentValue, focusValue, optionValues]\n );\n\n return (\n <ul\n className={classes}\n // If the listbox is not part of another widget, then it has a visible\n // label referenced by `aria-labelledby` on the element with role\n // `listbox`.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox\n // If an `aria-label` is passed, we should skip `aria-labelledby` to\n // avoid confusion.\n aria-labelledby={ariaLabel ? undefined : ariaLabelledBy}\n aria-label={ariaLabel}\n // An element that contains or owns all the listbox options has role\n // listbox.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox\n role=\"listbox\"\n // https://www.w3.org/TR/wai-aria-practices-1.2/examples/listbox/listbox-collapsible.html\n tabIndex={0}\n // https://www.w3.org/TR/wai-aria-practices-1.2/examples/listbox/listbox-scrollable.html\n aria-activedescendant={makeId(currentValue, listId)}\n {...otherProps}\n ref={listRef}\n id={listId}\n onKeyDown={handleKeyDown}\n onScroll={handleOnScroll}\n data-value={currentValue}\n data-focusvalue={focusValue}\n onFocus={handleOnFocus}\n >\n <ListboxContext.Provider\n value={{\n listboxValue: currentValue,\n focusValue,\n listboxId: listId,\n onListboxValueChange: handleValueChange,\n listboxRef: listRef,\n }}\n >\n {children}\n </ListboxContext.Provider>\n </ul>\n );\n}\n\n/** `ListboxItem` component.\n * @alpha\n * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/list iTwinUI list} instead.\n */\nexport function ListboxItem(props: ListboxItemProps) {\n const { children, value, className, disabled, ...otherProps } = props;\n\n const { listboxValue, focusValue, listboxId, onListboxValueChange } =\n React.useContext(ListboxContext);\n\n const hasFocus = focusValue === value;\n\n const classes = React.useMemo(\n () => classnames(\"core-listbox-item\", hasFocus && \"focused\", className),\n [className, hasFocus]\n );\n const itemRef = React.useRef<HTMLLIElement>(null);\n const isSelected = listboxValue === value;\n\n const handleClick = React.useCallback(\n (event: React.MouseEvent<HTMLLIElement, MouseEvent>) => {\n event.preventDefault();\n const selectedValue = event.currentTarget?.dataset?.value;\n if (undefined !== selectedValue) {\n onListboxValueChange(selectedValue, event.ctrlKey);\n }\n },\n [onListboxValueChange]\n );\n\n const getItemId = React.useCallback(() => {\n return makeId(value, listboxId);\n }, [listboxId, value]);\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\n <li\n // In a single-select listbox, the selected option has `aria-selected`\n // set to `true`.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox\n aria-selected={isSelected}\n // Applicable to all host language elements regardless of whether a\n // `role` is applied.\n // https://www.w3.org/WAI/PF/aria/states_and_properties#global_states_header\n aria-disabled={disabled || undefined}\n // Each option in the listbox has role `option` and is a DOM descendant\n // of the element with role `listbox`.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox\n role=\"option\"\n className={classes}\n {...otherProps}\n ref={itemRef}\n id={getItemId()}\n // used for css styling\n data-value={value}\n onClick={handleClick}\n >\n {children}\n </li>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Listbox.js","sourceRoot":"","sources":["../../../../src/core-react/listbox/Listbox.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AA6D3C;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,aAAa,CAAsB;IACrE,oBAAoB,EAAE,CAAC,SAAmC,EAAE,EAAE,GAAE,CAAC;CAClE,CAAC,CAAC;AAEH,SAAS,MAAM,CAAC,GAAG,IAA+C;IAChE,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,mBAAmB,CAAC,UAA2B;IACtD,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC;SACtC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;SAChE,GAAG,CACF,CAAC,UAAU,EAAE,EAAE,CACZ,UAAiC,CAAC,KAAyB,CAC/D,CAAC;AACN,CAAC;AAED,SAAS,yBAAyB,CAChC,YAAgC,EAChC,SAAiB,EACjB,GAAW;IAEX,IAAI,YAAY,GAAG,KAAK,CAAC;IACzB,IAAI,QAAQ,GAAG,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAE9C,wJAA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G,KAAK,CAAC,OAAO,CAC3B,GAAG,EAAE,CAAC,UAAU,CAAC,mBAAmB,EAAE,QAAQ,IAAI,SAAS,EAAE,SAAS,CAAC,EACvE,CAAC,SAAS,EAAE,QAAQ,CAAC,CACtB,CAAC;IACF,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAgB,IAAI,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,YAAY,KAAK,KAAK,CAAC;IAE1C,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CACnC,CAAC,KAAkD,EAAE,EAAE;QACrD,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,EAAE,OAAO,EAAE,KAAK,CAAC;QAC1D,IAAI,SAAS,KAAK,aAAa,EAAE,CAAC;YAChC,oBAAoB,CAAC,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACrD,CAAC;IACH,CAAC,EACD,CAAC,oBAAoB,CAAC,CACvB,CAAC;IAEF,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACvC,OAAO,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAClC,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;IAEvB,OAAO;IACL,iEAAiE;IACjE,6CAIiB,UAAU,mBAIV,QAAQ,IAAI,SAAS;QACpC,uEAAuE;QACvE,sCAAsC;QACtC,wDAAwD;QACxD,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,OAAO,KACd,UAAU,EACd,GAAG,EAAE,OAAO,EACZ,EAAE,EAAE,SAAS,EAAE,gBAEH,KAAK,EACjB,OAAO,EAAE,WAAW,IAEnB,QAAQ,CACN,CACN,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport { Key } from \"ts-key-enum\";\n\nimport \"./Listbox.scss\";\nimport { Guid } from \"@itwin/core-bentley\";\n\n/** Ideas borrowed from https://reacttraining.com/reach-ui/listbox */\n\n/* eslint-disable deprecation/deprecation */\n\n/** `Listbox` value.\n * @alpha\n * @deprecated in 4.12.0. Value used in a deprecated component {@link Listbox}.\n */\nexport type ListboxValue = string;\n\n/** `Listbox` Props.\n * @alpha\n * @deprecated in 4.12.0. Props of deprecated component {@link Listbox}.\n */\nexport interface ListboxProps\n extends React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLUListElement>,\n HTMLUListElement\n > {\n id?: string;\n selectedValue?: ListboxValue;\n ariaLabel?: any;\n ariaLabelledBy?: any;\n onListboxValueChange?: (\n newValue: ListboxValue,\n isControlOrCommandPressed?: boolean\n ) => void;\n}\n\n/** `ListboxItem` Props.\n * @alpha\n * @deprecated in 4.12.0. Props of deprecated component {@link ListboxItem}.\n */\nexport interface ListboxItemProps\n extends React.DetailedHTMLProps<\n React.LiHTMLAttributes<HTMLLIElement>,\n HTMLLIElement\n > {\n /** The unique item's value. */\n value: ListboxValue;\n /** set if item is disabled. */\n disabled?: boolean;\n}\n\n/** `Listbox` Context.\n * @alpha\n * @deprecated in 4.12.0. Props of deprecated context {@link ListboxContext}.\n */\nexport interface ListboxContextProps {\n listboxId?: string;\n listboxValue?: ListboxValue;\n focusValue?: ListboxValue;\n onListboxValueChange: (\n newValue: ListboxValue,\n isControlOrCommandPressed?: boolean\n ) => void;\n listboxRef?: React.RefObject<HTMLUListElement>;\n}\n\n/** Context set up by listbox for use by `ListboxItems` .\n * @alpha\n * @deprecated in 4.12.0. Context of deprecated component {@link Listbox}.\n */\nexport const ListboxContext = React.createContext<ListboxContextProps>({\n onListboxValueChange: (_newValue: ListboxValue | undefined) => {},\n});\n\nfunction makeId(...args: Array<string | number | null | undefined>) {\n return args.filter((val) => val != null).join(\"--\");\n}\n\nfunction getOptionValueArray(childNodes: React.ReactNode): ListboxItemProps[] {\n return React.Children.toArray(childNodes)\n .filter((node) => React.isValidElement(node) && node.props.value)\n .map(\n (optionNode) =>\n (optionNode as React.ReactElement).props as ListboxItemProps\n );\n}\n\nfunction processKeyboardNavigation(\n optionValues: ListboxItemProps[],\n itemIndex: number,\n key: string\n): [number, boolean] {\n let keyProcessed = false;\n let newIndex = itemIndex >= 0 ? itemIndex : 0;\n\n // Note: In aria example Page Up/Down just moves up or down by one item. See https://www.w3.org/TR/wai-aria-practices-1.1/examples/listbox/js/listbox.js\n if (key === Key.ArrowDown.valueOf() || key === Key.PageDown.valueOf()) {\n for (let i = itemIndex + 1; i < optionValues.length; i++) {\n if (!optionValues[i].disabled) {\n newIndex = i;\n break;\n }\n }\n keyProcessed = true;\n } else if (key === Key.ArrowUp.valueOf() || key === Key.PageUp.valueOf()) {\n for (let i = itemIndex - 1; i >= 0; i--) {\n if (!optionValues[i].disabled) {\n newIndex = i;\n break;\n }\n }\n keyProcessed = true;\n } else if (key === Key.Home.valueOf()) {\n for (let i = 0; i < optionValues.length; i++) {\n if (!optionValues[i].disabled) {\n newIndex = i;\n break;\n }\n }\n keyProcessed = true;\n } else if (key === Key.End.valueOf()) {\n for (let i = optionValues.length - 1; i >= 0; i--) {\n if (!optionValues[i].disabled) {\n newIndex = i;\n break;\n }\n }\n keyProcessed = true;\n }\n return [newIndex, keyProcessed];\n}\n\n/** Single select `Listbox` component\n * @alpha\n * @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/list iTwinUI list} instead.\n */\nexport function Listbox(props: ListboxProps) {\n const {\n ariaLabel,\n ariaLabelledBy,\n id,\n children,\n selectedValue,\n className,\n onListboxValueChange,\n onKeyDown,\n ...otherProps\n } = props;\n const listRef = React.useRef<HTMLUListElement>(null);\n const [listId] = React.useState(() => {\n return id ?? Guid.createValue();\n });\n const optionValues = React.useMemo(\n () => getOptionValueArray(children),\n [children]\n );\n const classes = React.useMemo(\n () => classnames(\"core-listbox\", className),\n [className]\n );\n const [currentValue, setCurrentValue] = React.useState<\n ListboxValue | undefined\n >(selectedValue);\n const [focusValue, setFocusValue] = React.useState<ListboxValue | undefined>(\n currentValue\n );\n\n React.useEffect(() => {\n setCurrentValue(selectedValue);\n setFocusValue(selectedValue);\n }, [selectedValue]);\n\n const scrollTopRef = React.useRef(0);\n const handleValueChange = React.useCallback(\n (newValue: ListboxValue, isControlOrCommandPressed?: boolean) => {\n if (newValue !== currentValue) {\n setCurrentValue(newValue);\n setFocusValue(newValue);\n if (onListboxValueChange)\n onListboxValueChange(newValue, isControlOrCommandPressed);\n }\n },\n [setCurrentValue, currentValue, onListboxValueChange]\n );\n\n const focusOption = React.useCallback(\n (itemIndex: number) => {\n if (itemIndex >= 0 && itemIndex < optionValues.length) {\n const newSelection = optionValues[itemIndex];\n const listElement = listRef.current as HTMLUListElement;\n const optionToFocus = listElement.querySelector<HTMLLIElement>(\n `li[data-value=\"${newSelection.value}\"]`\n );\n if (optionToFocus && listElement) {\n let newScrollTop = listElement.scrollTop;\n\n if (listElement.scrollHeight > listElement.clientHeight) {\n const scrollBottom =\n listElement.clientHeight + listElement.scrollTop;\n const elementBottom =\n optionToFocus.offsetTop + optionToFocus.offsetHeight;\n if (elementBottom > scrollBottom) {\n newScrollTop = elementBottom - listElement.clientHeight;\n } else if (optionToFocus.offsetTop < listElement.scrollTop) {\n newScrollTop = optionToFocus.offsetTop;\n }\n scrollTopRef.current = newScrollTop;\n }\n setFocusValue(newSelection.value);\n }\n }\n },\n [optionValues]\n );\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLUListElement>) => {\n if (optionValues.length < 1) return;\n\n const itemIndex =\n undefined === focusValue\n ? -1\n : optionValues.findIndex(\n (optionValue) => optionValue.value === focusValue\n );\n\n if (event.key === \" \") {\n event.preventDefault();\n if (focusValue)\n handleValueChange(\n focusValue,\n event.getModifierState(\"Control\") || event.getModifierState(\"Meta\")\n ); // Control or Command\n return;\n } else {\n const [newItemIndex, keyProcessed] = processKeyboardNavigation(\n optionValues,\n itemIndex,\n event.key\n );\n if (keyProcessed) {\n event.preventDefault();\n focusOption(newItemIndex);\n return;\n }\n }\n\n if (onKeyDown) onKeyDown(event);\n },\n [focusValue, optionValues, focusOption, onKeyDown, handleValueChange]\n );\n\n const isInitialMount = React.useRef(true);\n\n React.useEffect(() => {\n const list = listRef.current as HTMLUListElement;\n\n if (isInitialMount.current) {\n isInitialMount.current = false;\n\n if (undefined !== focusValue) {\n const itemIndex = optionValues.findIndex(\n (optionValue) => optionValue.value === focusValue\n );\n focusOption(itemIndex);\n }\n } else {\n list.scrollTop = scrollTopRef.current;\n }\n }, [focusValue, focusOption, optionValues]);\n\n const handleOnScroll = React.useCallback(\n (_event: React.UIEvent<HTMLUListElement, UIEvent>) => {\n if (listRef.current) scrollTopRef.current = listRef.current.scrollTop;\n },\n []\n );\n\n const handleOnFocus = React.useCallback(\n (_event: React.FocusEvent<HTMLUListElement>) => {\n if (!focusValue || 0 === focusValue.length) {\n if (currentValue) {\n setFocusValue(currentValue);\n } else {\n if (optionValues.length > 0) setFocusValue(optionValues[0].value);\n }\n }\n },\n [currentValue, focusValue, optionValues]\n );\n\n return (\n <ul\n className={classes}\n // If the listbox is not part of another widget, then it has a visible\n // label referenced by `aria-labelledby` on the element with role\n // `listbox`.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox\n // If an `aria-label` is passed, we should skip `aria-labelledby` to\n // avoid confusion.\n aria-labelledby={ariaLabel ? undefined : ariaLabelledBy}\n aria-label={ariaLabel}\n // An element that contains or owns all the listbox options has role\n // listbox.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox\n role=\"listbox\"\n // https://www.w3.org/TR/wai-aria-practices-1.2/examples/listbox/listbox-collapsible.html\n tabIndex={0}\n // https://www.w3.org/TR/wai-aria-practices-1.2/examples/listbox/listbox-scrollable.html\n aria-activedescendant={makeId(currentValue, listId)}\n {...otherProps}\n ref={listRef}\n id={listId}\n onKeyDown={handleKeyDown}\n onScroll={handleOnScroll}\n data-value={currentValue}\n data-focusvalue={focusValue}\n onFocus={handleOnFocus}\n >\n <ListboxContext.Provider\n value={{\n listboxValue: currentValue,\n focusValue,\n listboxId: listId,\n onListboxValueChange: handleValueChange,\n listboxRef: listRef,\n }}\n >\n {children}\n </ListboxContext.Provider>\n </ul>\n );\n}\n\n/** `ListboxItem` component.\n * @alpha\n * @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/list iTwinUI list} instead.\n */\nexport function ListboxItem(props: ListboxItemProps) {\n const { children, value, className, disabled, ...otherProps } = props;\n\n const { listboxValue, focusValue, listboxId, onListboxValueChange } =\n React.useContext(ListboxContext);\n\n const hasFocus = focusValue === value;\n\n const classes = React.useMemo(\n () => classnames(\"core-listbox-item\", hasFocus && \"focused\", className),\n [className, hasFocus]\n );\n const itemRef = React.useRef<HTMLLIElement>(null);\n const isSelected = listboxValue === value;\n\n const handleClick = React.useCallback(\n (event: React.MouseEvent<HTMLLIElement, MouseEvent>) => {\n event.preventDefault();\n const selectedValue = event.currentTarget?.dataset?.value;\n if (undefined !== selectedValue) {\n onListboxValueChange(selectedValue, event.ctrlKey);\n }\n },\n [onListboxValueChange]\n );\n\n const getItemId = React.useCallback(() => {\n return makeId(value, listboxId);\n }, [listboxId, value]);\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\n <li\n // In a single-select listbox, the selected option has `aria-selected`\n // set to `true`.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox\n aria-selected={isSelected}\n // Applicable to all host language elements regardless of whether a\n // `role` is applied.\n // https://www.w3.org/WAI/PF/aria/states_and_properties#global_states_header\n aria-disabled={disabled || undefined}\n // Each option in the listbox has role `option` and is a DOM descendant\n // of the element with role `listbox`.\n // https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox\n role=\"option\"\n className={classes}\n {...otherProps}\n ref={itemRef}\n id={getItemId()}\n // used for css styling\n data-value={value}\n onClick={handleClick}\n >\n {children}\n </li>\n );\n}\n"]}
|
|
@@ -6,7 +6,7 @@ import * as React from "react";
|
|
|
6
6
|
import type { CommonProps } from "../utils/Props";
|
|
7
7
|
/** Properties for [[LoadingBar]] component
|
|
8
8
|
* @public
|
|
9
|
-
* @deprecated in 4.12.
|
|
9
|
+
* @deprecated in 4.12.0. Props of deprecated component {@link LoadingBar}.
|
|
10
10
|
*/
|
|
11
11
|
export interface LoadingBarProps extends CommonProps {
|
|
12
12
|
/** Percent */
|
|
@@ -18,7 +18,7 @@ export interface LoadingBarProps extends CommonProps {
|
|
|
18
18
|
}
|
|
19
19
|
/** A loading bar with optional percentage text.
|
|
20
20
|
* @public
|
|
21
|
-
* @deprecated in 4.12.
|
|
21
|
+
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/progressindicator#progress-linear iTwinUI progress indicator} instead.
|
|
22
22
|
*/
|
|
23
23
|
export declare class LoadingBar extends React.PureComponent<LoadingBarProps> {
|
|
24
24
|
static defaultProps: Partial<LoadingBarProps>;
|
|
@@ -10,7 +10,7 @@ import classnames from "classnames";
|
|
|
10
10
|
import * as React from "react";
|
|
11
11
|
/** A loading bar with optional percentage text.
|
|
12
12
|
* @public
|
|
13
|
-
* @deprecated in 4.12.
|
|
13
|
+
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/progressindicator#progress-linear iTwinUI progress indicator} instead.
|
|
14
14
|
*/
|
|
15
15
|
export class LoadingBar extends React.PureComponent {
|
|
16
16
|
render() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingBar.js","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingBar.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B;;;GAGG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK,CAAC,aAA8B;IAKlD,MAAM;QACpB,MAAM,OAAO,GAAG,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QACzD,MAAM,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACnE,OAAO,CACL,6BAAK,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YACrD,6BAAK,SAAS,EAAC,cAAc,EAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE;gBACnE,6BAAK,SAAS,EAAC,MAAM,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,GAAI,CAC/C;YACL,IAAI,CAAC,KAAK,CAAC,cAAc,IAAI,CAC5B,8BAAM,SAAS,EAAC,SAAS,IAAE,OAAO,CAAQ,CAC3C,CACG,CACP,CAAC;IACJ,CAAC;;AAjBa,uBAAY,GAA6B;IACrD,SAAS,EAAE,CAAC;CACb,CAAC;AAkBJ;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACnC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC3B,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Loading\n */\n\nimport \"./LoadingBar.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Properties for [[LoadingBar]] component\n * @public\n * @deprecated in 4.12.
|
|
1
|
+
{"version":3,"file":"LoadingBar.js","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingBar.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B;;;GAGG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK,CAAC,aAA8B;IAKlD,MAAM;QACpB,MAAM,OAAO,GAAG,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QACzD,MAAM,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACnE,OAAO,CACL,6BAAK,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YACrD,6BAAK,SAAS,EAAC,cAAc,EAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE;gBACnE,6BAAK,SAAS,EAAC,MAAM,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,GAAI,CAC/C;YACL,IAAI,CAAC,KAAK,CAAC,cAAc,IAAI,CAC5B,8BAAM,SAAS,EAAC,SAAS,IAAE,OAAO,CAAQ,CAC3C,CACG,CACP,CAAC;IACJ,CAAC;;AAjBa,uBAAY,GAA6B;IACrD,SAAS,EAAE,CAAC;CACb,CAAC;AAkBJ;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACnC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC3B,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Loading\n */\n\nimport \"./LoadingBar.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Properties for [[LoadingBar]] component\n * @public\n * @deprecated in 4.12.0. Props of deprecated component {@link LoadingBar}.\n */\nexport interface LoadingBarProps extends CommonProps {\n /** Percent */\n percent: number;\n /** Show percentage (optional) */\n showPercentage?: boolean;\n /** Height (in pixels) of the loading bar */\n barHeight: number;\n}\n\n/** A loading bar with optional percentage text.\n * @public\n * @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/progressindicator#progress-linear iTwinUI progress indicator} instead.\n */\nexport class LoadingBar extends React.PureComponent<LoadingBarProps> {\n public static defaultProps: Partial<LoadingBarProps> = {\n barHeight: 4,\n };\n\n public override render() {\n const percent = `${percentInRange(this.props.percent)}%`;\n const containerClass = classnames(this.props.className, \"core-lb\");\n return (\n <div className={containerClass} style={this.props.style}>\n <div className=\"lb-container\" style={{ height: this.props.barHeight }}>\n <div className=\"fill\" style={{ width: percent }} />\n </div>\n {this.props.showPercentage && (\n <span className=\"percent\">{percent}</span>\n )}\n </div>\n );\n }\n}\n\n/** Sanity check to keep percentage between 0 & 100\n * @internal\n */\nexport function percentInRange(percent: number): number {\n let value = Math.min(percent, 100);\n value = Math.max(value, 0);\n return value;\n}\n"]}
|
|
@@ -6,7 +6,7 @@ import * as React from "react";
|
|
|
6
6
|
import type { CommonProps } from "../utils/Props";
|
|
7
7
|
/** Properties for [[LoadingPrompt]] component
|
|
8
8
|
* @public
|
|
9
|
-
* @deprecated in 4.12.
|
|
9
|
+
* @deprecated in 4.12.0. Props of deprecated component {@link LoadingPrompt}.
|
|
10
10
|
*/
|
|
11
11
|
export interface LoadingPromptProps extends CommonProps {
|
|
12
12
|
/** Title */
|
|
@@ -32,7 +32,7 @@ export interface LoadingPromptProps extends CommonProps {
|
|
|
32
32
|
}
|
|
33
33
|
/** A component to display during loading that optionally shows percentage, status text and a cancel button.
|
|
34
34
|
* @public
|
|
35
|
-
* @deprecated in 4.12.
|
|
35
|
+
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/progressindicator iTwinUI progress indicator} instead.
|
|
36
36
|
*/
|
|
37
37
|
export declare class LoadingPrompt extends React.PureComponent<LoadingPromptProps> {
|
|
38
38
|
static defaultProps: Partial<LoadingPromptProps>;
|
|
@@ -14,7 +14,7 @@ import { LoadingSpinner } from "./LoadingSpinner";
|
|
|
14
14
|
import { LoadingStatus } from "./LoadingStatus";
|
|
15
15
|
/** A component to display during loading that optionally shows percentage, status text and a cancel button.
|
|
16
16
|
* @public
|
|
17
|
-
* @deprecated in 4.12.
|
|
17
|
+
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/progressindicator iTwinUI progress indicator} instead.
|
|
18
18
|
*/
|
|
19
19
|
export class LoadingPrompt extends React.PureComponent {
|
|
20
20
|
render() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingPrompt.js","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingPrompt.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAgChD;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK,CAAC,aAAiC;IAWxD,MAAM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ApDa,0BAAY,GAAgC;IACxD,cAAc,EAAE,KAAK;IACrB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,KAAK;IACjB,aAAa,EAAE,KAAK;IACpB,oBAAoB,EAAE,KAAK;IAC3B,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,EAAE;CACX,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Loading\n */\n\nimport \"./LoadingPrompt.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Button, ProgressLinear } from \"@itwin/itwinui-react\";\nimport { LoadingBar } from \"./LoadingBar\";\nimport { LoadingSpinner } from \"./LoadingSpinner\";\nimport { LoadingStatus } from \"./LoadingStatus\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Properties for [[LoadingPrompt]] component\n * @public\n * @deprecated in 4.12.
|
|
1
|
+
{"version":3,"file":"LoadingPrompt.js","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingPrompt.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAgChD;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK,CAAC,aAAiC;IAWxD,MAAM;QACpB,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,aA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AU,EAAE,KAAK;IACjB,UAAU,EAAE,KAAK;IACjB,aAAa,EAAE,KAAK;IACpB,oBAAoB,EAAE,KAAK;IAC3B,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,EAAE;CACX,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Loading\n */\n\nimport \"./LoadingPrompt.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Button, ProgressLinear } from \"@itwin/itwinui-react\";\nimport { LoadingBar } from \"./LoadingBar\";\nimport { LoadingSpinner } from \"./LoadingSpinner\";\nimport { LoadingStatus } from \"./LoadingStatus\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Properties for [[LoadingPrompt]] component\n * @public\n * @deprecated in 4.12.0. Props of deprecated component {@link LoadingPrompt}.\n */\nexport interface LoadingPromptProps extends CommonProps {\n /** Title */\n title: string;\n /** Message displayed below the title (optional) */\n message?: string;\n /** Determine if a percentage bar is displayed (isDeterminate=true), otherwise a loading spinner or indeterminate progress bar is shown. */\n isDeterminate: boolean;\n /** Show current status and percentage. Default is false (not shown) */\n showStatus: boolean;\n /** Show cancel button. Default is false (not shown) */\n showCancel: boolean;\n /** Current loading status text (optional). Only shown if showStatus=true and isDeterminate=true */\n status: string;\n /** Current percentage. Only used if isDeterminate=true */\n percent: number;\n /** Show percentage at the end of the loading bar (optional). Only shown if isDeterminate=true and showStatus=false */\n showPercentage: boolean;\n /** Show indeterminate progress bar instead of loading spinner */\n showIndeterminateBar: boolean;\n /** Function called when Cancel button is clicked. */\n onCancel?: () => void;\n}\n\n/** A component to display during loading that optionally shows percentage, status text and a cancel button.\n * @public\n * @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/progressindicator iTwinUI progress indicator} instead.\n */\nexport class LoadingPrompt extends React.PureComponent<LoadingPromptProps> {\n public static defaultProps: Partial<LoadingPromptProps> = {\n showPercentage: false,\n showStatus: false,\n showCancel: false,\n isDeterminate: false,\n showIndeterminateBar: false,\n percent: 0,\n status: \"\",\n };\n\n public override render() {\n const isDeterminate = this.props.isDeterminate;\n\n return (\n <div\n className={classnames(\"core-loadingprompt\", this.props.className)}\n style={this.props.style}\n >\n <span className=\"title\">{this.props.title}</span>\n {this.props.message && (\n <span className=\"message\">{this.props.message}</span>\n )}\n {isDeterminate && (\n <LoadingBar\n style={{ width: \"100%\" }}\n percent={this.props.percent}\n showPercentage={this.props.showPercentage}\n />\n )}\n {isDeterminate && this.props.showStatus && (\n <LoadingStatus\n style={{ marginTop: \".5em\", width: \"100%\", fontSize: \".75em\" }}\n percent={this.props.percent}\n message={this.props.status}\n />\n )}\n {!isDeterminate &&\n (this.props.showIndeterminateBar ? (\n <ProgressLinear indeterminate />\n ) : (\n <LoadingSpinner />\n ))}\n {this.props.showCancel && (\n <Button\n className=\"loading-prompt-cancel\"\n onClick={this.props.onCancel}\n >\n Cancel\n </Button>\n )}\n </div>\n );\n }\n}\n"]}
|
|
@@ -7,12 +7,12 @@ import { ProgressRadial } from "@itwin/itwinui-react";
|
|
|
7
7
|
type ProgressRadialProps = React.ComponentPropsWithoutRef<typeof ProgressRadial>;
|
|
8
8
|
/** Type for ProgressRadialProps.size
|
|
9
9
|
* @public
|
|
10
|
-
* @deprecated in 4.12.
|
|
10
|
+
* @deprecated in 4.12.0. Type used in a deprecated component {@link LoadingSpinner}.
|
|
11
11
|
*/
|
|
12
12
|
export type RadialSizeType = ProgressRadialProps["size"];
|
|
13
13
|
/** Properties for [[LoadingSpinner]] component
|
|
14
14
|
* @public
|
|
15
|
-
* @deprecated in 4.12.
|
|
15
|
+
* @deprecated in 4.12.0. Props of deprecated component {@link LoadingSpinner}.
|
|
16
16
|
*/
|
|
17
17
|
export interface LoadingSpinnerProps extends Omit<ProgressRadialProps, "size"> {
|
|
18
18
|
/** Message (text) displayed */
|
|
@@ -27,7 +27,7 @@ export interface LoadingSpinnerProps extends Omit<ProgressRadialProps, "size"> {
|
|
|
27
27
|
}
|
|
28
28
|
/** A loading spinner component that optionally shows a text message.
|
|
29
29
|
* @public
|
|
30
|
-
* @deprecated in 4.12.
|
|
30
|
+
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/progressindicator#progress-radial iTwinUI progress indicator} instead.
|
|
31
31
|
*/
|
|
32
32
|
export declare class LoadingSpinner extends React.PureComponent<LoadingSpinnerProps> {
|
|
33
33
|
static defaultProps: Partial<LoadingSpinnerProps>;
|
|
@@ -10,7 +10,7 @@ import * as React from "react";
|
|
|
10
10
|
import { ProgressRadial } from "@itwin/itwinui-react";
|
|
11
11
|
/** A loading spinner component that optionally shows a text message.
|
|
12
12
|
* @public
|
|
13
|
-
* @deprecated in 4.12.
|
|
13
|
+
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/progressindicator#progress-radial iTwinUI progress indicator} instead.
|
|
14
14
|
*/
|
|
15
15
|
export class LoadingSpinner extends React.PureComponent {
|
|
16
16
|
render() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingSpinner.js","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingSpinner.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AA8BtD;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK,CAAC,aAAkC;IAK1D,MAAM;QACpB,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC5D,OAAO,CACL,6BAAK,SAAS,EAAC,SAAS;YACrB,OAAO,IAAI,YAAY,IAAI,CAC1B,8BAAM,SAAS,EAAC,gBAAgB,IAAE,OAAO,CAAQ,CAClD;YACD,oBAAC,cAAc,IAAC,IAAI,EAAE,IAAI,KAAM,IAAI,EAAE,aAAa,SAAG;YACrD,OAAO,IAAI,CAAC,YAAY,IAAI,CAC3B,8BAAM,SAAS,EAAC,mBAAmB,IAAE,OAAO,CAAQ,CACrD,CACG,CACP,CAAC;IACJ,CAAC;;AAjBa,2BAAY,GAAiC;IACzD,YAAY,EAAE,KAAK;CACpB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Loading\n */\n\nimport \"./LoadingSpinner.scss\";\nimport * as React from \"react\";\nimport { ProgressRadial } from \"@itwin/itwinui-react\";\n\n/* eslint-disable deprecation/deprecation */\n\ntype ProgressRadialProps = React.ComponentPropsWithoutRef<\n typeof ProgressRadial\n>;\n\n/** Type for ProgressRadialProps.size\n * @public\n * @deprecated in 4.12.
|
|
1
|
+
{"version":3,"file":"LoadingSpinner.js","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingSpinner.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AA8BtD;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK,CAAC,aAAkC;IAK1D,MAAM;QACpB,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC5D,OAAO,CACL,6BAAK,SAAS,EAAC,SAAS;YACrB,OAAO,IAAI,YAAY,IAAI,CAC1B,8BAAM,SAAS,EAAC,gBAAgB,IAAE,OAAO,CAAQ,CAClD;YACD,oBAAC,cAAc,IAAC,IAAI,EAAE,IAAI,KAAM,IAAI,EAAE,aAAa,SAAG;YACrD,OAAO,IAAI,CAAC,YAAY,IAAI,CAC3B,8BAAM,SAAS,EAAC,mBAAmB,IAAE,OAAO,CAAQ,CACrD,CACG,CACP,CAAC;IACJ,CAAC;;AAjBa,2BAAY,GAAiC;IACzD,YAAY,EAAE,KAAK;CACpB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Loading\n */\n\nimport \"./LoadingSpinner.scss\";\nimport * as React from \"react\";\nimport { ProgressRadial } from \"@itwin/itwinui-react\";\n\n/* eslint-disable deprecation/deprecation */\n\ntype ProgressRadialProps = React.ComponentPropsWithoutRef<\n typeof ProgressRadial\n>;\n\n/** Type for ProgressRadialProps.size\n * @public\n * @deprecated in 4.12.0. Type used in a deprecated component {@link LoadingSpinner}.\n */\nexport type RadialSizeType = ProgressRadialProps[\"size\"];\n\n/** Properties for [[LoadingSpinner]] component\n * @public\n * @deprecated in 4.12.0. Props of deprecated component {@link LoadingSpinner}.\n */\nexport interface LoadingSpinnerProps extends Omit<ProgressRadialProps, \"size\"> {\n /** Message (text) displayed */\n message?: string;\n /** Position the message above or below the spinner (defaults to bottom) */\n messageOnTop?: boolean;\n /**\n * Size of the progress indicator. Defaults to medium size.\n * @default ''\n */\n size?: RadialSizeType;\n}\n\n/** A loading spinner component that optionally shows a text message.\n * @public\n * @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/progressindicator#progress-radial iTwinUI progress indicator} instead.\n */\nexport class LoadingSpinner extends React.PureComponent<LoadingSpinnerProps> {\n public static defaultProps: Partial<LoadingSpinnerProps> = {\n messageOnTop: false,\n };\n\n public override render() {\n const { message, messageOnTop, size, ...rest } = this.props;\n return (\n <div className=\"core-ls\">\n {message && messageOnTop && (\n <span className=\"ls-message-top\">{message}</span>\n )}\n <ProgressRadial size={size} {...rest} indeterminate />\n {message && !messageOnTop && (\n <span className=\"ls-message-bottom\">{message}</span>\n )}\n </div>\n );\n }\n}\n"]}
|
|
@@ -6,7 +6,7 @@ import * as React from "react";
|
|
|
6
6
|
import type { CommonProps } from "../utils/Props";
|
|
7
7
|
/** Properties for [[LoadingStatus]] component
|
|
8
8
|
* @public
|
|
9
|
-
* @deprecated in 4.12.
|
|
9
|
+
* @deprecated in 4.12.0. Props of deprecated component {@link LoadingStatus}.
|
|
10
10
|
*/
|
|
11
11
|
export interface LoadingStatusProps extends CommonProps {
|
|
12
12
|
/** Message (text) displayed */
|
|
@@ -16,7 +16,7 @@ export interface LoadingStatusProps extends CommonProps {
|
|
|
16
16
|
}
|
|
17
17
|
/** A loading indicator that shows status text along with the percentage.
|
|
18
18
|
* @public
|
|
19
|
-
* @deprecated in 4.12.
|
|
19
|
+
* @deprecated in 4.12.0. Use labeled {@link https://itwinui.bentley.com/docs/progressindicator iTwinUI progress indicator} instead.
|
|
20
20
|
*/
|
|
21
21
|
export declare class LoadingStatus extends React.PureComponent<LoadingStatusProps> {
|
|
22
22
|
static defaultProps: Partial<LoadingStatusProps>;
|
|
@@ -10,7 +10,7 @@ import classnames from "classnames";
|
|
|
10
10
|
import * as React from "react";
|
|
11
11
|
/** A loading indicator that shows status text along with the percentage.
|
|
12
12
|
* @public
|
|
13
|
-
* @deprecated in 4.12.
|
|
13
|
+
* @deprecated in 4.12.0. Use labeled {@link https://itwinui.bentley.com/docs/progressindicator iTwinUI progress indicator} instead.
|
|
14
14
|
*/
|
|
15
15
|
export class LoadingStatus extends React.PureComponent {
|
|
16
16
|
// sanity check to keep percentage between 0 & 100
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingStatus.js","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingStatus.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK,CAAC,aAAiC;IAMxE,kDAAkD;IAC1C,OAAO,CAAC,OAAe;QAC7B,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACnC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IAEe,MAAM;QACpB,MAAM,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QACvD,MAAM,cAAc,GAAG,UAAU,CAC/B,IAAI,CAAC,KAAK,CAAC,SAAS,EACpB,0BAA0B,CAC3B,CAAC;QACF,OAAO,CACL,6BAAK,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YACrD,8BAAM,SAAS,EAAC,wBAAwB,IAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAQ;YACpE,8BAAM,SAAS,EAAC,wBAAwB,IAAE,OAAO,CAAQ,CACrD,CACP,CAAC;IACJ,CAAC;;AAxBa,0BAAY,GAAgC;IACxD,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,CAAC;CACX,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Loading\n */\n\nimport \"./LoadingStatus.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Properties for [[LoadingStatus]] component\n * @public\n * @deprecated in 4.12.
|
|
1
|
+
{"version":3,"file":"LoadingStatus.js","sourceRoot":"","sources":["../../../../src/core-react/loading/LoadingStatus.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK,CAAC,aAAiC;IAMxE,kDAAkD;IAC1C,OAAO,CAAC,OAAe;QAC7B,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACnC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IAEe,MAAM;QACpB,MAAM,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QACvD,MAAM,cAAc,GAAG,UAAU,CAC/B,IAAI,CAAC,KAAK,CAAC,SAAS,EACpB,0BAA0B,CAC3B,CAAC;QACF,OAAO,CACL,6BAAK,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YACrD,8BAAM,SAAS,EAAC,wBAAwB,IAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAQ;YACpE,8BAAM,SAAS,EAAC,wBAAwB,IAAE,OAAO,CAAQ,CACrD,CACP,CAAC;IACJ,CAAC;;AAxBa,0BAAY,GAAgC;IACxD,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,CAAC;CACX,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Loading\n */\n\nimport \"./LoadingStatus.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Properties for [[LoadingStatus]] component\n * @public\n * @deprecated in 4.12.0. Props of deprecated component {@link LoadingStatus}.\n */\nexport interface LoadingStatusProps extends CommonProps {\n /** Message (text) displayed */\n message: string;\n /** Percent displayed (as text) */\n percent: number;\n}\n\n/** A loading indicator that shows status text along with the percentage.\n * @public\n * @deprecated in 4.12.0. Use labeled {@link https://itwinui.bentley.com/docs/progressindicator iTwinUI progress indicator} instead.\n */\nexport class LoadingStatus extends React.PureComponent<LoadingStatusProps> {\n public static defaultProps: Partial<LoadingStatusProps> = {\n message: \"\",\n percent: 0,\n };\n\n // sanity check to keep percentage between 0 & 100\n private inRange(percent: number): number {\n let value = Math.min(percent, 100);\n value = Math.max(value, 0);\n return value;\n }\n\n public override render() {\n const percent = `${this.inRange(this.props.percent)}%`;\n const containerClass = classnames(\n this.props.className,\n \"loading-status-container\"\n );\n return (\n <div className={containerClass} style={this.props.style}>\n <span className=\"loading-status-message\">{this.props.message}</span>\n <span className=\"loading-status-percent\">{percent}</span>\n </div>\n );\n }\n}\n"]}
|
|
@@ -9,6 +9,7 @@ import type { CommonProps } from "../utils/Props";
|
|
|
9
9
|
import type { IconSpec } from "../icons/IconComponent";
|
|
10
10
|
/** Properties for the [[MessageBox]] component
|
|
11
11
|
* @public
|
|
12
|
+
* @deprecated in 4.15.0. Props of deprecated {@link MessageBox} component.
|
|
12
13
|
*/
|
|
13
14
|
export interface MessageBoxProps extends CommonProps {
|
|
14
15
|
/** Severity of MessageBox */
|
|
@@ -48,6 +49,7 @@ export interface MessageBoxProps extends CommonProps {
|
|
|
48
49
|
}
|
|
49
50
|
/** Message Box React component.
|
|
50
51
|
* @public
|
|
52
|
+
* @deprecated in 4.15.0. Use {@link https://itwinui.bentley.com/docs/dialog iTwinUI Dialog} instead.
|
|
51
53
|
*/
|
|
52
54
|
export declare class MessageBox extends React.PureComponent<MessageBoxProps> {
|
|
53
55
|
static defaultProps: Partial<MessageBoxProps>;
|
|
@@ -55,6 +57,7 @@ export declare class MessageBox extends React.PureComponent<MessageBoxProps> {
|
|
|
55
57
|
}
|
|
56
58
|
/** Properties for the [[MessageContainer]] component
|
|
57
59
|
* @public
|
|
60
|
+
* @deprecated in 4.15.0. Props of deprecated {@link MessageContainer} component.
|
|
58
61
|
*/
|
|
59
62
|
export interface MessageContainerProps extends CommonProps {
|
|
60
63
|
severity: MessageSeverity;
|
|
@@ -63,6 +66,7 @@ export interface MessageContainerProps extends CommonProps {
|
|
|
63
66
|
}
|
|
64
67
|
/** Message Container React component.
|
|
65
68
|
* @public
|
|
69
|
+
* @deprecated in 4.15.0. Use {@link https://itwinui.bentley.com/docs/dialog iTwinUI Dialog} instead.
|
|
66
70
|
*/
|
|
67
71
|
export declare class MessageContainer extends React.PureComponent<MessageContainerProps> {
|
|
68
72
|
/** Returns the class name corresponding to the MessageSeverity.
|
|
@@ -72,7 +76,7 @@ export declare class MessageContainer extends React.PureComponent<MessageContain
|
|
|
72
76
|
/** Returns the class name associated with the WebFont icon corresponding to the MessageSeverity.
|
|
73
77
|
* @param severity MessageSeverity
|
|
74
78
|
* @param hollow Should the icon be hollow
|
|
75
|
-
* @deprecated in 4.0. Hollow parameter ignored, WebFont is not returned, only the color.
|
|
79
|
+
* @deprecated in 4.0.0. Hollow parameter ignored, WebFont is not returned, only the color.
|
|
76
80
|
*/
|
|
77
81
|
static getIconClassName(severity: MessageSeverity, hollow?: boolean): string;
|
|
78
82
|
/** Returns the React icon corresponding to the MessageSeverity.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageBox.d.ts","sourceRoot":"","sources":["../../../../src/core-react/messagebox/MessageBox.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAE3B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA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AG,MAAM,CAAC;IACzB,wDAAwD;IACxD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uCAAuC;IACvC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,sBAAsB;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;GAGG;AAEH,qBAAa,UAAW,SAAQ,KAAK,CAAC,aAAa,CAAC,eAAe,CAAC;IAElE,OAAc,YAAY,EAAE,OAAO,CAAC,eAAe,CAAC,CAKlD;IAEc,MAAM,IAAI,KAAK,CAAC,YAAY;CAyB7C;AAED;;;GAGG;AAEH,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACxD,QAAQ,EAAE,eAAe,CAAC;IAC1B,sBAAsB;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;GAGG;AAEH,qBAAa,gBAAiB,SAAQ,KAAK,CAAC,aAAa,CAAC,qBAAqB,CAAC;IAC9E;;OAEG;WACW,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM;IACjE;;;;OAIG;WACW,gBAAgB,CAC5B,QAAQ,EAAE,eAAe,EAEzB,MAAM,CAAC,EAAE,OAAO,GACf,MAAM;IAmCT;;;;OAIG;WAGW,OAAO,CAAC,QAAQ,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ;IA4B5D,MAAM,IAAI,KAAK,CAAC,YAAY;CA2B7C"}
|
|
@@ -14,7 +14,9 @@ import { Icon } from "../icons/IconComponent";
|
|
|
14
14
|
import { Dialog } from "../dialog/Dialog";
|
|
15
15
|
/** Message Box React component.
|
|
16
16
|
* @public
|
|
17
|
+
* @deprecated in 4.15.0. Use {@link https://itwinui.bentley.com/docs/dialog iTwinUI Dialog} instead.
|
|
17
18
|
*/
|
|
19
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
18
20
|
export class MessageBox extends React.PureComponent {
|
|
19
21
|
render() {
|
|
20
22
|
return (
|
|
@@ -23,6 +25,7 @@ export class MessageBox extends React.PureComponent {
|
|
|
23
25
|
React.createElement(MessageContainer, { severity: this.props.severity, className: this.props.contentClassName, style: this.props.contentStyle }, this.props.children)));
|
|
24
26
|
}
|
|
25
27
|
}
|
|
28
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
26
29
|
MessageBox.defaultProps = {
|
|
27
30
|
minWidth: 400,
|
|
28
31
|
minHeight: 400,
|
|
@@ -31,7 +34,9 @@ MessageBox.defaultProps = {
|
|
|
31
34
|
};
|
|
32
35
|
/** Message Container React component.
|
|
33
36
|
* @public
|
|
37
|
+
* @deprecated in 4.15.0. Use {@link https://itwinui.bentley.com/docs/dialog iTwinUI Dialog} instead.
|
|
34
38
|
*/
|
|
39
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
35
40
|
export class MessageContainer extends React.PureComponent {
|
|
36
41
|
static getIconClassName(severity, _hollow) {
|
|
37
42
|
let iconClassName = "";
|
|
@@ -94,7 +99,9 @@ export class MessageContainer extends React.PureComponent {
|
|
|
94
99
|
return iconSpec;
|
|
95
100
|
}
|
|
96
101
|
render() {
|
|
97
|
-
const iconClassName = classnames("icon", "core-message-box-icon", MessageContainer.getIconClassName(this.props.severity)
|
|
102
|
+
const iconClassName = classnames("icon", "core-message-box-icon", MessageContainer.getIconClassName(this.props.severity) // eslint-disable-line deprecation/deprecation
|
|
103
|
+
);
|
|
104
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
98
105
|
const iconSpec = MessageContainer.getIcon(this.props.severity);
|
|
99
106
|
return (React.createElement("div", { className: "core-message-box-container" },
|
|
100
107
|
React.createElement("div", { className: iconClassName },
|