@itwin/core-react 3.7.15 → 3.7.17
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 +11 -1
- package/lib/cjs/core-react/autosuggest/AutoSuggest.d.ts +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/badge/Badge.d.ts +1 -1
- package/lib/cjs/core-react/badge/Badge.d.ts.map +1 -1
- package/lib/cjs/core-react/badge/Badge.js.map +1 -1
- package/lib/cjs/core-react/badge/BetaBadge.d.ts +2 -2
- package/lib/cjs/core-react/badge/BetaBadge.d.ts.map +1 -1
- package/lib/cjs/core-react/badge/NewBadge.d.ts +2 -2
- package/lib/cjs/core-react/badge/NewBadge.d.ts.map +1 -1
- package/lib/cjs/core-react/base/Centered.d.ts +2 -2
- package/lib/cjs/core-react/base/Centered.d.ts.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/DivWithOutsideClick.d.ts +2 -2
- package/lib/cjs/core-react/base/FillCentered.d.ts +2 -2
- package/lib/cjs/core-react/base/FillCentered.d.ts.map +1 -1
- package/lib/cjs/core-react/base/FlexWrapContainer.d.ts +2 -2
- package/lib/cjs/core-react/base/FlexWrapContainer.d.ts.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/ScrollView.d.ts +2 -2
- package/lib/cjs/core-react/base/ScrollView.d.ts.map +1 -1
- package/lib/cjs/core-react/button/Button.d.ts +1 -1
- package/lib/cjs/core-react/button/UnderlinedButton.d.ts +1 -1
- package/lib/cjs/core-react/button/UnderlinedButton.d.ts.map +1 -1
- package/lib/cjs/core-react/checkbox/Checkbox.d.ts +1 -1
- package/lib/cjs/core-react/checklistbox/CheckListBox.d.ts +3 -3
- package/lib/cjs/core-react/checklistbox/CheckListBox.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.d.ts +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 +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuDivider.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuDivider.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.d.ts +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 +2 -2
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.js +3 -1
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/PopupContextMenu.d.ts +1 -1
- package/lib/cjs/core-react/contextmenu/PopupContextMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.d.ts +3 -3
- package/lib/cjs/core-react/dialog/Dialog.d.ts.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.js.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.d.ts +2 -2
- package/lib/cjs/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
- package/lib/cjs/core-react/expandable/ExpandableBlock.d.ts +2 -2
- package/lib/cjs/core-react/expandable/ExpandableBlock.d.ts.map +1 -1
- package/lib/cjs/core-react/expandable/ExpandableBlock.js.map +1 -1
- package/lib/cjs/core-react/expandable/ExpandableList.d.ts +1 -1
- package/lib/cjs/core-react/expandable/ExpandableList.d.ts.map +1 -1
- package/lib/cjs/core-react/expandable/ExpandableList.js.map +1 -1
- package/lib/cjs/core-react/focustrap/FocusTrap.d.ts +1 -1
- package/lib/cjs/core-react/focustrap/FocusTrap.d.ts.map +1 -1
- package/lib/cjs/core-react/form/Field.d.ts +1 -1
- package/lib/cjs/core-react/form/Form.d.ts +1 -1
- package/lib/cjs/core-react/hocs/withIsPressed.d.ts +2 -2
- package/lib/cjs/core-react/hocs/withOnOutsideClick.d.ts +2 -2
- package/lib/cjs/core-react/hocs/withTimeout.d.ts +2 -2
- package/lib/cjs/core-react/icons/IconComponent.d.ts +1 -1
- package/lib/cjs/core-react/icons/IconComponent.d.ts.map +1 -1
- package/lib/cjs/core-react/icons/SvgPath.d.ts +1 -1
- package/lib/cjs/core-react/icons/SvgSprite.d.ts +1 -1
- package/lib/cjs/core-react/icons/WebFontIcon.d.ts +1 -1
- package/lib/cjs/core-react/icons/WebFontIcon.d.ts.map +1 -1
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.d.ts +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 +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 +1 -1
- package/lib/cjs/core-react/inputs/InputLabel.d.ts.map +1 -1
- package/lib/cjs/core-react/inputs/InputLabel.js.map +1 -1
- package/lib/cjs/core-react/inputs/LabeledInput.d.ts +2 -2
- package/lib/cjs/core-react/inputs/LabeledInput.d.ts.map +1 -1
- package/lib/cjs/core-react/inputs/LabeledTextarea.d.ts +2 -2
- package/lib/cjs/core-react/inputs/LabeledTextarea.d.ts.map +1 -1
- package/lib/cjs/core-react/inputs/Textarea.d.ts +1 -1
- package/lib/cjs/core-react/inputs/Textarea.d.ts.map +1 -1
- package/lib/cjs/core-react/inputs/Textarea.js.map +1 -1
- package/lib/cjs/core-react/inputs/iconinput/IconInput.d.ts +1 -1
- package/lib/cjs/core-react/inputs/iconinput/IconInput.d.ts.map +1 -1
- package/lib/cjs/core-react/inputs/iconinput/IconInput.js.map +1 -1
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts +1 -1
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.js.map +1 -1
- package/lib/cjs/core-react/listbox/Listbox.d.ts +2 -2
- package/lib/cjs/core-react/listbox/Listbox.d.ts.map +1 -1
- package/lib/cjs/core-react/loading/LoadingBar.d.ts +1 -1
- package/lib/cjs/core-react/loading/LoadingPrompt.d.ts +1 -1
- package/lib/cjs/core-react/loading/LoadingSpinner.d.ts +1 -1
- package/lib/cjs/core-react/loading/LoadingStatus.d.ts +1 -1
- package/lib/cjs/core-react/loading/Spinner.d.ts +1 -1
- package/lib/cjs/core-react/messagebox/MessageBox.d.ts +3 -3
- package/lib/cjs/core-react/messagebox/MessageBox.d.ts.map +1 -1
- package/lib/cjs/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/cjs/core-react/notification/MessageRenderer.d.ts +2 -2
- package/lib/cjs/core-react/notification/MessageRenderer.d.ts.map +1 -1
- package/lib/cjs/core-react/progress-indicators/ProgressBar.d.ts +2 -2
- package/lib/cjs/core-react/progress-indicators/ProgressBar.d.ts.map +1 -1
- package/lib/cjs/core-react/progress-indicators/ProgressSpinner.d.ts +1 -1
- package/lib/cjs/core-react/progress-indicators/ProgressSpinner.d.ts.map +1 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.d.ts +2 -2
- package/lib/cjs/core-react/radialmenu/RadialMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/cjs/core-react/radio/Radio.d.ts +1 -1
- package/lib/cjs/core-react/radio/Radio.d.ts.map +1 -1
- package/lib/cjs/core-react/radio/Radio.js.map +1 -1
- package/lib/cjs/core-react/select/LabeledSelect.d.ts +1 -1
- package/lib/cjs/core-react/select/LabeledSelect.d.ts.map +1 -1
- package/lib/cjs/core-react/select/LabeledSelect.js.map +1 -1
- package/lib/cjs/core-react/select/LabeledThemedSelect.d.ts +2 -2
- package/lib/cjs/core-react/select/LabeledThemedSelect.d.ts.map +1 -1
- package/lib/cjs/core-react/select/Select.d.ts +1 -1
- package/lib/cjs/core-react/select/Select.d.ts.map +1 -1
- package/lib/cjs/core-react/select/Select.js.map +1 -1
- package/lib/cjs/core-react/select/ThemedSelect.d.ts +1 -1
- package/lib/cjs/core-react/select/ThemedSelect.d.ts.map +1 -1
- package/lib/cjs/core-react/settings/SettingsContainer.d.ts +2 -2
- package/lib/cjs/core-react/settings/SettingsContainer.d.ts.map +1 -1
- package/lib/cjs/core-react/settings/SettingsManager.d.ts +3 -3
- package/lib/cjs/core-react/settings/SettingsManager.d.ts.map +1 -1
- package/lib/cjs/core-react/settings/SettingsManager.js.map +1 -1
- package/lib/cjs/core-react/slider/Slider.d.ts +1 -1
- package/lib/cjs/core-react/slider/Slider.d.ts.map +1 -1
- package/lib/cjs/core-react/splitbutton/SplitButton.d.ts +1 -1
- package/lib/cjs/core-react/splitbutton/SplitButton.d.ts.map +1 -1
- package/lib/cjs/core-react/splitbutton/SplitButton.js.map +1 -1
- package/lib/cjs/core-react/tabs/HorizontalTabs.d.ts +2 -2
- package/lib/cjs/core-react/tabs/HorizontalTabs.d.ts.map +1 -1
- package/lib/cjs/core-react/tabs/Tabs.d.ts +4 -4
- package/lib/cjs/core-react/tabs/Tabs.d.ts.map +1 -1
- package/lib/cjs/core-react/tabs/Tabs.js.map +1 -1
- package/lib/cjs/core-react/tabs/VerticalTabs.d.ts +2 -2
- package/lib/cjs/core-react/tabs/VerticalTabs.d.ts.map +1 -1
- package/lib/cjs/core-react/text/BlockText.d.ts +2 -2
- package/lib/cjs/core-react/text/BlockText.d.ts.map +1 -1
- package/lib/cjs/core-react/text/BodyText.d.ts +2 -2
- package/lib/cjs/core-react/text/BodyText.d.ts.map +1 -1
- package/lib/cjs/core-react/text/DisabledText.d.ts +5 -2
- package/lib/cjs/core-react/text/DisabledText.d.ts.map +1 -1
- package/lib/cjs/core-react/text/FilteredText.d.ts +1 -1
- package/lib/cjs/core-react/text/FilteredText.d.ts.map +1 -1
- package/lib/cjs/core-react/text/Headline.d.ts +2 -2
- package/lib/cjs/core-react/text/Headline.d.ts.map +1 -1
- package/lib/cjs/core-react/text/LeadingText.d.ts +2 -2
- package/lib/cjs/core-react/text/LeadingText.d.ts.map +1 -1
- package/lib/cjs/core-react/text/LeadingText2.d.ts +2 -2
- package/lib/cjs/core-react/text/LeadingText2.d.ts.map +1 -1
- package/lib/cjs/core-react/text/MutedText.d.ts +2 -2
- package/lib/cjs/core-react/text/MutedText.d.ts.map +1 -1
- package/lib/cjs/core-react/text/SmallText.d.ts +2 -2
- package/lib/cjs/core-react/text/SmallText.d.ts.map +1 -1
- package/lib/cjs/core-react/text/StyledText.d.ts +2 -2
- package/lib/cjs/core-react/text/StyledText.d.ts.map +1 -1
- package/lib/cjs/core-react/text/Subheading.d.ts +2 -2
- package/lib/cjs/core-react/text/Subheading.d.ts.map +1 -1
- package/lib/cjs/core-react/text/Subheading2.d.ts +2 -2
- package/lib/cjs/core-react/text/Subheading2.d.ts.map +1 -1
- package/lib/cjs/core-react/text/Title.d.ts +2 -2
- package/lib/cjs/core-react/text/Title.d.ts.map +1 -1
- package/lib/cjs/core-react/text/Title2.d.ts +2 -2
- package/lib/cjs/core-react/text/Title2.d.ts.map +1 -1
- package/lib/cjs/core-react/tiles/FeaturedTile.d.ts +2 -2
- package/lib/cjs/core-react/tiles/FeaturedTile.d.ts.map +1 -1
- package/lib/cjs/core-react/tiles/MinimalFeaturedTile.d.ts +2 -2
- package/lib/cjs/core-react/tiles/MinimalFeaturedTile.d.ts.map +1 -1
- package/lib/cjs/core-react/tiles/MinimalTile.d.ts +2 -2
- package/lib/cjs/core-react/tiles/MinimalTile.d.ts.map +1 -1
- package/lib/cjs/core-react/tiles/Tile.d.ts +1 -1
- package/lib/cjs/core-react/tiles/Tile.d.ts.map +1 -1
- package/lib/cjs/core-react/tiles/Tile.js.map +1 -1
- package/lib/cjs/core-react/toggle/LabeledToggle.d.ts +1 -1
- package/lib/cjs/core-react/toggle/LabeledToggle.d.ts.map +1 -1
- package/lib/cjs/core-react/toggle/LabeledToggle.js.map +1 -1
- package/lib/cjs/core-react/toggle/Toggle.d.ts +1 -1
- package/lib/cjs/core-react/toggle/Toggle.d.ts.map +1 -1
- package/lib/cjs/core-react/toggle/Toggle.js +3 -1
- package/lib/cjs/core-react/toggle/Toggle.js.map +1 -1
- package/lib/cjs/core-react/tooltip/Tooltip.d.ts +1 -1
- package/lib/cjs/core-react/tooltip/Tooltip.d.ts.map +1 -1
- package/lib/cjs/core-react/tree/Branch.d.ts +1 -1
- package/lib/cjs/core-react/tree/ExpansionToggle.d.ts +1 -1
- package/lib/cjs/core-react/tree/Node.d.ts +1 -1
- package/lib/cjs/core-react/tree/Placeholder.d.ts +1 -1
- package/lib/cjs/core-react/tree/Tree.d.ts +1 -1
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.d.ts +3 -3
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/esm/core-react/autosuggest/AutoSuggest.d.ts +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/badge/Badge.d.ts +1 -1
- package/lib/esm/core-react/badge/Badge.d.ts.map +1 -1
- package/lib/esm/core-react/badge/Badge.js.map +1 -1
- package/lib/esm/core-react/badge/BetaBadge.d.ts +2 -2
- package/lib/esm/core-react/badge/BetaBadge.d.ts.map +1 -1
- package/lib/esm/core-react/badge/NewBadge.d.ts +2 -2
- package/lib/esm/core-react/badge/NewBadge.d.ts.map +1 -1
- package/lib/esm/core-react/base/Centered.d.ts +2 -2
- package/lib/esm/core-react/base/Centered.d.ts.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/DivWithOutsideClick.d.ts +2 -2
- package/lib/esm/core-react/base/FillCentered.d.ts +2 -2
- package/lib/esm/core-react/base/FillCentered.d.ts.map +1 -1
- package/lib/esm/core-react/base/FlexWrapContainer.d.ts +2 -2
- package/lib/esm/core-react/base/FlexWrapContainer.d.ts.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/ScrollView.d.ts +2 -2
- package/lib/esm/core-react/base/ScrollView.d.ts.map +1 -1
- package/lib/esm/core-react/button/Button.d.ts +1 -1
- package/lib/esm/core-react/button/UnderlinedButton.d.ts +1 -1
- package/lib/esm/core-react/button/UnderlinedButton.d.ts.map +1 -1
- package/lib/esm/core-react/checkbox/Checkbox.d.ts +1 -1
- package/lib/esm/core-react/checklistbox/CheckListBox.d.ts +3 -3
- package/lib/esm/core-react/checklistbox/CheckListBox.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.d.ts +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 +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuDivider.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuDivider.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuItem.d.ts +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 +2 -2
- package/lib/esm/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextSubMenu.js +3 -1
- package/lib/esm/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/PopupContextMenu.d.ts +1 -1
- package/lib/esm/core-react/contextmenu/PopupContextMenu.d.ts.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.d.ts +3 -3
- package/lib/esm/core-react/dialog/Dialog.d.ts.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.js.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.d.ts +2 -2
- package/lib/esm/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
- package/lib/esm/core-react/expandable/ExpandableBlock.d.ts +2 -2
- package/lib/esm/core-react/expandable/ExpandableBlock.d.ts.map +1 -1
- package/lib/esm/core-react/expandable/ExpandableBlock.js.map +1 -1
- package/lib/esm/core-react/expandable/ExpandableList.d.ts +1 -1
- package/lib/esm/core-react/expandable/ExpandableList.d.ts.map +1 -1
- package/lib/esm/core-react/expandable/ExpandableList.js.map +1 -1
- package/lib/esm/core-react/focustrap/FocusTrap.d.ts +1 -1
- package/lib/esm/core-react/focustrap/FocusTrap.d.ts.map +1 -1
- package/lib/esm/core-react/form/Field.d.ts +1 -1
- package/lib/esm/core-react/form/Form.d.ts +1 -1
- package/lib/esm/core-react/hocs/withIsPressed.d.ts +2 -2
- package/lib/esm/core-react/hocs/withOnOutsideClick.d.ts +2 -2
- package/lib/esm/core-react/hocs/withTimeout.d.ts +2 -2
- package/lib/esm/core-react/icons/IconComponent.d.ts +1 -1
- package/lib/esm/core-react/icons/IconComponent.d.ts.map +1 -1
- package/lib/esm/core-react/icons/SvgPath.d.ts +1 -1
- package/lib/esm/core-react/icons/SvgSprite.d.ts +1 -1
- package/lib/esm/core-react/icons/WebFontIcon.d.ts +1 -1
- package/lib/esm/core-react/icons/WebFontIcon.d.ts.map +1 -1
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.d.ts +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 +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 +1 -1
- package/lib/esm/core-react/inputs/InputLabel.d.ts.map +1 -1
- package/lib/esm/core-react/inputs/InputLabel.js.map +1 -1
- package/lib/esm/core-react/inputs/LabeledInput.d.ts +2 -2
- package/lib/esm/core-react/inputs/LabeledInput.d.ts.map +1 -1
- package/lib/esm/core-react/inputs/LabeledTextarea.d.ts +2 -2
- package/lib/esm/core-react/inputs/LabeledTextarea.d.ts.map +1 -1
- package/lib/esm/core-react/inputs/Textarea.d.ts +1 -1
- package/lib/esm/core-react/inputs/Textarea.d.ts.map +1 -1
- package/lib/esm/core-react/inputs/Textarea.js.map +1 -1
- package/lib/esm/core-react/inputs/iconinput/IconInput.d.ts +1 -1
- package/lib/esm/core-react/inputs/iconinput/IconInput.d.ts.map +1 -1
- package/lib/esm/core-react/inputs/iconinput/IconInput.js.map +1 -1
- package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts +1 -1
- package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
- package/lib/esm/core-react/inputs/numberinput/NumberInput.js.map +1 -1
- package/lib/esm/core-react/listbox/Listbox.d.ts +2 -2
- package/lib/esm/core-react/listbox/Listbox.d.ts.map +1 -1
- package/lib/esm/core-react/loading/LoadingBar.d.ts +1 -1
- package/lib/esm/core-react/loading/LoadingPrompt.d.ts +1 -1
- package/lib/esm/core-react/loading/LoadingSpinner.d.ts +1 -1
- package/lib/esm/core-react/loading/LoadingStatus.d.ts +1 -1
- package/lib/esm/core-react/loading/Spinner.d.ts +1 -1
- package/lib/esm/core-react/messagebox/MessageBox.d.ts +3 -3
- package/lib/esm/core-react/messagebox/MessageBox.d.ts.map +1 -1
- package/lib/esm/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/esm/core-react/notification/MessageRenderer.d.ts +2 -2
- package/lib/esm/core-react/notification/MessageRenderer.d.ts.map +1 -1
- package/lib/esm/core-react/progress-indicators/ProgressBar.d.ts +2 -2
- package/lib/esm/core-react/progress-indicators/ProgressBar.d.ts.map +1 -1
- package/lib/esm/core-react/progress-indicators/ProgressSpinner.d.ts +1 -1
- package/lib/esm/core-react/progress-indicators/ProgressSpinner.d.ts.map +1 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.d.ts +2 -2
- package/lib/esm/core-react/radialmenu/RadialMenu.d.ts.map +1 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/esm/core-react/radio/Radio.d.ts +1 -1
- package/lib/esm/core-react/radio/Radio.d.ts.map +1 -1
- package/lib/esm/core-react/radio/Radio.js.map +1 -1
- package/lib/esm/core-react/select/LabeledSelect.d.ts +1 -1
- package/lib/esm/core-react/select/LabeledSelect.d.ts.map +1 -1
- package/lib/esm/core-react/select/LabeledSelect.js.map +1 -1
- package/lib/esm/core-react/select/LabeledThemedSelect.d.ts +2 -2
- package/lib/esm/core-react/select/LabeledThemedSelect.d.ts.map +1 -1
- package/lib/esm/core-react/select/Select.d.ts +1 -1
- package/lib/esm/core-react/select/Select.d.ts.map +1 -1
- package/lib/esm/core-react/select/Select.js.map +1 -1
- package/lib/esm/core-react/select/ThemedSelect.d.ts +1 -1
- package/lib/esm/core-react/select/ThemedSelect.d.ts.map +1 -1
- package/lib/esm/core-react/settings/SettingsContainer.d.ts +2 -2
- package/lib/esm/core-react/settings/SettingsContainer.d.ts.map +1 -1
- package/lib/esm/core-react/settings/SettingsManager.d.ts +3 -3
- package/lib/esm/core-react/settings/SettingsManager.d.ts.map +1 -1
- package/lib/esm/core-react/settings/SettingsManager.js.map +1 -1
- package/lib/esm/core-react/slider/Slider.d.ts +1 -1
- package/lib/esm/core-react/slider/Slider.d.ts.map +1 -1
- package/lib/esm/core-react/splitbutton/SplitButton.d.ts +1 -1
- package/lib/esm/core-react/splitbutton/SplitButton.d.ts.map +1 -1
- package/lib/esm/core-react/splitbutton/SplitButton.js.map +1 -1
- package/lib/esm/core-react/tabs/HorizontalTabs.d.ts +2 -2
- package/lib/esm/core-react/tabs/HorizontalTabs.d.ts.map +1 -1
- package/lib/esm/core-react/tabs/Tabs.d.ts +4 -4
- package/lib/esm/core-react/tabs/Tabs.d.ts.map +1 -1
- package/lib/esm/core-react/tabs/Tabs.js.map +1 -1
- package/lib/esm/core-react/tabs/VerticalTabs.d.ts +2 -2
- package/lib/esm/core-react/tabs/VerticalTabs.d.ts.map +1 -1
- package/lib/esm/core-react/text/BlockText.d.ts +2 -2
- package/lib/esm/core-react/text/BlockText.d.ts.map +1 -1
- package/lib/esm/core-react/text/BodyText.d.ts +2 -2
- package/lib/esm/core-react/text/BodyText.d.ts.map +1 -1
- package/lib/esm/core-react/text/DisabledText.d.ts +5 -2
- package/lib/esm/core-react/text/DisabledText.d.ts.map +1 -1
- package/lib/esm/core-react/text/FilteredText.d.ts +1 -1
- package/lib/esm/core-react/text/FilteredText.d.ts.map +1 -1
- package/lib/esm/core-react/text/Headline.d.ts +2 -2
- package/lib/esm/core-react/text/Headline.d.ts.map +1 -1
- package/lib/esm/core-react/text/LeadingText.d.ts +2 -2
- package/lib/esm/core-react/text/LeadingText.d.ts.map +1 -1
- package/lib/esm/core-react/text/LeadingText2.d.ts +2 -2
- package/lib/esm/core-react/text/LeadingText2.d.ts.map +1 -1
- package/lib/esm/core-react/text/MutedText.d.ts +2 -2
- package/lib/esm/core-react/text/MutedText.d.ts.map +1 -1
- package/lib/esm/core-react/text/SmallText.d.ts +2 -2
- package/lib/esm/core-react/text/SmallText.d.ts.map +1 -1
- package/lib/esm/core-react/text/StyledText.d.ts +2 -2
- package/lib/esm/core-react/text/StyledText.d.ts.map +1 -1
- package/lib/esm/core-react/text/Subheading.d.ts +2 -2
- package/lib/esm/core-react/text/Subheading.d.ts.map +1 -1
- package/lib/esm/core-react/text/Subheading2.d.ts +2 -2
- package/lib/esm/core-react/text/Subheading2.d.ts.map +1 -1
- package/lib/esm/core-react/text/Title.d.ts +2 -2
- package/lib/esm/core-react/text/Title.d.ts.map +1 -1
- package/lib/esm/core-react/text/Title2.d.ts +2 -2
- package/lib/esm/core-react/text/Title2.d.ts.map +1 -1
- package/lib/esm/core-react/tiles/FeaturedTile.d.ts +2 -2
- package/lib/esm/core-react/tiles/FeaturedTile.d.ts.map +1 -1
- package/lib/esm/core-react/tiles/MinimalFeaturedTile.d.ts +2 -2
- package/lib/esm/core-react/tiles/MinimalFeaturedTile.d.ts.map +1 -1
- package/lib/esm/core-react/tiles/MinimalTile.d.ts +2 -2
- package/lib/esm/core-react/tiles/MinimalTile.d.ts.map +1 -1
- package/lib/esm/core-react/tiles/Tile.d.ts +1 -1
- package/lib/esm/core-react/tiles/Tile.d.ts.map +1 -1
- package/lib/esm/core-react/tiles/Tile.js.map +1 -1
- package/lib/esm/core-react/toggle/LabeledToggle.d.ts +1 -1
- package/lib/esm/core-react/toggle/LabeledToggle.d.ts.map +1 -1
- package/lib/esm/core-react/toggle/LabeledToggle.js.map +1 -1
- package/lib/esm/core-react/toggle/Toggle.d.ts +1 -1
- package/lib/esm/core-react/toggle/Toggle.d.ts.map +1 -1
- package/lib/esm/core-react/toggle/Toggle.js +3 -1
- package/lib/esm/core-react/toggle/Toggle.js.map +1 -1
- package/lib/esm/core-react/tooltip/Tooltip.d.ts +1 -1
- package/lib/esm/core-react/tooltip/Tooltip.d.ts.map +1 -1
- package/lib/esm/core-react/tree/Branch.d.ts +1 -1
- package/lib/esm/core-react/tree/ExpansionToggle.d.ts +1 -1
- package/lib/esm/core-react/tree/Node.d.ts +1 -1
- package/lib/esm/core-react/tree/Placeholder.d.ts +1 -1
- package/lib/esm/core-react/tree/Tree.d.ts +1 -1
- package/lib/esm/core-react/utils/hooks/useResizeObserver.d.ts +3 -3
- package/lib/esm/core-react/utils/hooks/useResizeObserver.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabeledToggle.d.ts","sourceRoot":"","sources":["../../../../src/core-react/toggle/LabeledToggle.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAE9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAgB,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEvE;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qCAAqC;IACrC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAClC;AAED;;;GAGG;AACH,qBAAa,aAAc,SAAQ,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC;IACxD,MAAM,IAAI,GAAG,CAAC,OAAO;
|
|
1
|
+
{"version":3,"file":"LabeledToggle.d.ts","sourceRoot":"","sources":["../../../../src/core-react/toggle/LabeledToggle.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAE9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAgB,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEvE;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qCAAqC;IACrC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAClC;AAED;;;GAGG;AACH,qBAAa,aAAc,SAAQ,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC;IACxD,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO;CAgB5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabeledToggle.js","sourceRoot":"","sources":["../../../../src/core-react/toggle/LabeledToggle.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gCAA8B;AAC9B,2CAAoC;AACpC,+BAA+B;AAC/B,wDAAuE;AAevE;;;GAGG;AACH,MAAa,aAAc,SAAQ,KAAK,CAAC,aAAiC;IACxD,MAAM;QACpB,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAEzE,OAAO,CACL,+BAAO,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,IAAA,oBAAU,EACnD,4BAA4B,EAC5B,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,iBAAiB,EACxC,IAAI,CAAC,KAAK,CAAC,SAAS,CACrB;YACC,oBAAC,4BAAY,IAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,KAAM,KAAK,GAAI;YAC9D,KAAK;gBACJ,6BAAK,SAAS,EAAE,IAAA,oBAAU,EAAC,cAAc,EAAE,cAAc,CAAC,IAAG,KAAK,CAAO,CAErE,CACT,CAAC;IACJ,CAAC;CACF;AAjBD,sCAiBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Toggle\r\n */\r\n\r\nimport \"./LabeledToggle.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { ToggleSwitch, ToggleSwitchProps } from \"@itwin/itwinui-react\";\r\n\r\n/** Properties for [[LabeledToggle]]\r\n * @public\r\n * @deprecated in 3.0. Use ToggleSwitchProps from itwinui-react instead\r\n */\r\nexport interface LabeledToggleProps extends ToggleSwitchProps {\r\n /** Text that will be shown next to the Toggle. */\r\n label?: string;\r\n /** Custom CSS class name for the label */\r\n labelClassName?: string;\r\n /** Custom CSS Style for the label */\r\n labelStyle?: React.CSSProperties;\r\n}\r\n\r\n/** Toggle component with a Label to the right\r\n * @public\r\n * @deprecated in 3.0. Use ToggleSwitch from itwinui-react with `labelPosition=\"right\"` instead\r\n */\r\nexport class LabeledToggle extends React.PureComponent<LabeledToggleProps> { // eslint-disable-line deprecation/deprecation\r\n public override render(): JSX.Element {\r\n const { label, labelClassName, className, style, ...props } = this.props;\r\n\r\n return (\r\n <label style={this.props.style} className={classnames(\r\n \"core-inputs-labeled-toggle\",\r\n this.props.disabled && \"uicore-disabled\",\r\n this.props.className,\r\n )}>\r\n <ToggleSwitch className={className} style={style} {...props} />\r\n {label &&\r\n <div className={classnames(\"uicore-label\", labelClassName)}>{label}</div>\r\n }\r\n </label>\r\n );\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"LabeledToggle.js","sourceRoot":"","sources":["../../../../src/core-react/toggle/LabeledToggle.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gCAA8B;AAC9B,2CAAoC;AACpC,+BAA+B;AAC/B,wDAAuE;AAevE;;;GAGG;AACH,MAAa,aAAc,SAAQ,KAAK,CAAC,aAAiC;IACxD,MAAM;QACpB,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAEzE,OAAO,CACL,+BAAO,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,IAAA,oBAAU,EACnD,4BAA4B,EAC5B,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,iBAAiB,EACxC,IAAI,CAAC,KAAK,CAAC,SAAS,CACrB;YACC,oBAAC,4BAAY,IAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,KAAM,KAAK,GAAI;YAC9D,KAAK;gBACJ,6BAAK,SAAS,EAAE,IAAA,oBAAU,EAAC,cAAc,EAAE,cAAc,CAAC,IAAG,KAAK,CAAO,CAErE,CACT,CAAC;IACJ,CAAC;CACF;AAjBD,sCAiBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Toggle\r\n */\r\n\r\nimport \"./LabeledToggle.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { ToggleSwitch, ToggleSwitchProps } from \"@itwin/itwinui-react\";\r\n\r\n/** Properties for [[LabeledToggle]]\r\n * @public\r\n * @deprecated in 3.0. Use ToggleSwitchProps from itwinui-react instead\r\n */\r\nexport interface LabeledToggleProps extends ToggleSwitchProps {\r\n /** Text that will be shown next to the Toggle. */\r\n label?: string;\r\n /** Custom CSS class name for the label */\r\n labelClassName?: string;\r\n /** Custom CSS Style for the label */\r\n labelStyle?: React.CSSProperties;\r\n}\r\n\r\n/** Toggle component with a Label to the right\r\n * @public\r\n * @deprecated in 3.0. Use ToggleSwitch from itwinui-react with `labelPosition=\"right\"` instead\r\n */\r\nexport class LabeledToggle extends React.PureComponent<LabeledToggleProps> { // eslint-disable-line deprecation/deprecation\r\n public override render(): React.JSX.Element {\r\n const { label, labelClassName, className, style, ...props } = this.props;\r\n\r\n return (\r\n <label style={this.props.style} className={classnames(\r\n \"core-inputs-labeled-toggle\",\r\n this.props.disabled && \"uicore-disabled\",\r\n this.props.className,\r\n )}>\r\n <ToggleSwitch className={className} style={style} {...props} />\r\n {label &&\r\n <div className={classnames(\"uicore-label\", labelClassName)}>{label}</div>\r\n }\r\n </label>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -48,5 +48,5 @@ export interface ToggleProps extends CommonProps {
|
|
|
48
48
|
* @public
|
|
49
49
|
* @deprecated in 3.0. Use ToggleSwitch in itwinui-react instead
|
|
50
50
|
*/
|
|
51
|
-
export declare const Toggle: (props: ToggleProps) => JSX.Element | null;
|
|
51
|
+
export declare const Toggle: (props: ToggleProps) => React.JSX.Element | null;
|
|
52
52
|
//# sourceMappingURL=Toggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toggle.d.ts","sourceRoot":"","sources":["../../../../src/core-react/toggle/Toggle.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,eAAe,CAAC;AAEvB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C;;;GAGG;AACH,oBAAY,gBAAgB;IAC1B,iCAAiC;IACjC,OAAO,IAAA;IACP,sBAAsB;IACtB,IAAI,IAAA;CACL;AAED;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,WAAW;IAC9C,kEAAkE;IAClE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uEAAuE;IACvE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,6DAA6D;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wEAAwE;IACxE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;sFACkF;IAClF,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,uDAAuD;IACvD,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,GAAG,CAAC;IACrC,mDAAmD;IACnD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,GAAG,CAAC;IAC1C,yCAAyC;IACzC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,0DAA0D;IAC1D,QAAQ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;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAuB,CAAC"}
|
|
@@ -90,7 +90,9 @@ function ForwardRefToggle(props, ref) {
|
|
|
90
90
|
left: padding,
|
|
91
91
|
};
|
|
92
92
|
const handleClassName = (0, classnames_1.default)("core-toggle-handle", toggling && "core-toggling");
|
|
93
|
-
return (
|
|
93
|
+
return (
|
|
94
|
+
// eslint-disable-next-line jsx-a11y/label-has-associated-control
|
|
95
|
+
React.createElement("label", { ref: setHeightFromRef, style: toggleStyle, className: toggleClassName, onBlur: handleBlur },
|
|
94
96
|
React.createElement("input", { type: "checkbox", ref: refs, className: "core-toggle-input", checked: checked, disabled: props.disabled, onChange: handleChange, onBlur: handleCheckboxBlur, title: props.title }),
|
|
95
97
|
React.createElement("span", { className: "core-toggle-background" }),
|
|
96
98
|
React.createElement("span", { className: checkmarkClassName }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toggle.js","sourceRoot":"","sources":["../../../../src/core-react/toggle/Toggle.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,yBAAuB;AACvB,2CAAoC;AACpC,+BAA+B;AAE/B,oDAAiD;AAEjD;;;GAGG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,iCAAiC;IACjC,6DAAO,CAAA;IACP,sBAAsB;IACtB,uDAAI,CAAA;AACN,CAAC,EALW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAK3B;AAgCD,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CAAmC,8CAA8C;AACxH,SAAS,gBAAgB,CAAC,KAAK,EAAE,GAAG;IAClC,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAmB,IAAI,CAAC,CAAC;IAC1D,MAAM,IAAI,GAAG,IAAA,iBAAO,EAAC,YAAY,EAAE,GAAG,CAAC,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GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,UAAU;QAC9F,+BAAO,IAAI,EAAC,UAAU,EAAC,GAAG,EAAE,IAAI,EAAE,SAAS,EAAC,mBAAmB,EAC7D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAC1C,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAClD,KAAK,EAAE,KAAK,CAAC,KAAK,GAAI;QACxB,8BAAM,SAAS,EAAC,wBAAwB,GAAG;QAC3C,8BAAM,SAAS,EAAE,kBAAkB,GAAI;QACvC,8BAAM,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,iBAAiB,GAAI,CACxD,CACT,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;;;GAIG;AACU,QAAA,MAAM,GAA+C,gBAAgB,CAAC,CAAG,8CAA8C","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Toggle\r\n */\r\n\r\nimport \"./Toggle.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { useRefs } from \"../utils/hooks/useRefs\";\r\n\r\n/** Toggle display types\r\n * @public\r\n * @deprecated in 3.0. Use ToggleSwitch from @itwin/itwinui-react and its standard theming.\r\n */\r\nexport enum ToggleButtonType {\r\n /** Primary (green) background */\r\n Primary,\r\n /** Blue background */\r\n Blue,\r\n}\r\n\r\n/** Properties for [[Toggle]] component\r\n * @public\r\n * @deprecated in 3.0. Use ToggleSwitchProps in itwinui-react instead\r\n */\r\nexport interface ToggleProps extends CommonProps {\r\n /** Indicates whether the Toggle is disabled (default is false) */\r\n disabled?: boolean;\r\n /** Indicates whether the Toggle is \"on\" or \"off\" (default is false) */\r\n isOn?: boolean;\r\n /** Show the toggle rounded or square (rounded is default) */\r\n rounded?: boolean;\r\n /** Show a check mark icon when the toggle is \"on\" (false is default) */\r\n showCheckmark?: boolean;\r\n /** Button type, either Primary or Blue (Blue is default).\r\n * @deprecated in 3.0. Use icon in ToggleSwitch props from @itwin/itwinui-react */\r\n buttonType?: ToggleButtonType; // eslint-disable-line deprecation/deprecation\r\n /** Function called when the toggle state is changed */\r\n onChange?: (checked: boolean) => any;\r\n /** Function called when the toggle loses focus */\r\n onBlur?: (event: React.FocusEvent) => any;\r\n /** Use larger size (default is false) */\r\n large?: boolean;\r\n /** Indicates whether to set focus to the input element */\r\n setFocus?: boolean;\r\n /** Tooltip text */\r\n title?: string;\r\n /** Provides ability to return reference to HTMLInputElement */\r\n ref?: React.Ref<HTMLInputElement>;\r\n}\r\n\r\nconst ForwardRefToggle = React.forwardRef<HTMLInputElement, ToggleProps>( // eslint-disable-line deprecation/deprecation\r\n function ForwardRefToggle(props, ref) {\r\n const inputElement = React.useRef<HTMLInputElement>(null);\r\n const refs = useRefs(inputElement, ref); // combine ref needed for target with the forwardRef needed by the Parent when parent is a Type Editor.\r\n const padding = 2;\r\n const defaultHeight = props.large ? 32 : 21;\r\n const [height, setHeight] = React.useState(defaultHeight);\r\n const [width, setWidth] = React.useState(defaultHeight * 2);\r\n const [checked, setChecked] = React.useState(props.isOn ? true : false);\r\n const [toggling, setToggling] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n if (props.setFocus && inputElement.current)\r\n inputElement.current.focus();\r\n }, [props]);\r\n\r\n React.useEffect(() => {\r\n setChecked(props.isOn ? true : false);\r\n }, [props.isOn]);\r\n\r\n const handleChange = React.useCallback(() => {\r\n const newChecked = !checked;\r\n\r\n setToggling(true);\r\n setChecked(newChecked);\r\n\r\n // istanbul ignore else\r\n if (props.onChange)\r\n props.onChange(newChecked);\r\n\r\n setTimeout(() => {\r\n // istanbul ignore else\r\n if (inputElement.current)\r\n setToggling(false);\r\n }, 250);\r\n }, [props, checked]);\r\n\r\n const handleBlur = React.useCallback((event: React.FocusEvent) => {\r\n // istanbul ignore else\r\n if (props.onBlur)\r\n props.onBlur(event);\r\n }, [props]);\r\n\r\n const handleCheckboxBlur = React.useCallback((event: React.FocusEvent) => {\r\n event.stopPropagation();\r\n }, []);\r\n\r\n const setHeightFromRef = React.useCallback((el: HTMLLabelElement | null) => {\r\n if (el !== null) {\r\n // istanbul ignore next\r\n if (el.clientHeight > 0 && el.clientWidth > 0) {\r\n setHeight(el.clientHeight);\r\n setWidth(el.clientWidth);\r\n }\r\n }\r\n }, []);\r\n\r\n const getOffset = (): number => {\r\n return (checked) ? width - height : 0;\r\n };\r\n\r\n /** Default props */\r\n const rounded = props.rounded !== undefined ? props.rounded : true;\r\n const showCheckmark = props.showCheckmark !== undefined ? props.showCheckmark : false;\r\n const buttonType = props.buttonType !== undefined ? props.buttonType : ToggleButtonType.Blue; // eslint-disable-line deprecation/deprecation\r\n\r\n const halfHeight = height / 2;\r\n const checkmarkClassName = classnames(\r\n \"core-toggle-checkmark\",\r\n \"icon\", \"icon-checkmark\",\r\n showCheckmark && \"core-visible\",\r\n toggling && \"core-toggling\",\r\n );\r\n const toggleStyle: React.CSSProperties = { borderRadius: rounded ? halfHeight : 3, fontSize: halfHeight, ...props.style };\r\n const toggleClassName = classnames(\r\n \"core-toggle\",\r\n buttonType === ToggleButtonType.Primary && \"core-toggle-primary\", // eslint-disable-line deprecation/deprecation\r\n props.large && \"core-toggle-large\",\r\n rounded && \"core-toggle-rounded\",\r\n props.disabled && \"uicore-disabled\",\r\n props.className);\r\n const toggleHandleStyle: React.CSSProperties = {\r\n width: height - (padding * 2),\r\n transform: `translateX(${getOffset()}px)`,\r\n top: padding,\r\n bottom: padding,\r\n left: padding,\r\n };\r\n const handleClassName = classnames(\r\n \"core-toggle-handle\",\r\n toggling && \"core-toggling\",\r\n );\r\n\r\n return (\r\n <label ref={setHeightFromRef} style={toggleStyle} className={toggleClassName} onBlur={handleBlur}>\r\n <input type=\"checkbox\" ref={refs} className=\"core-toggle-input\"\r\n checked={checked} disabled={props.disabled}\r\n onChange={handleChange} onBlur={handleCheckboxBlur}\r\n title={props.title} />\r\n <span className=\"core-toggle-background\" />\r\n <span className={checkmarkClassName} />\r\n <span className={handleClassName} style={toggleHandleStyle} />\r\n </label>\r\n );\r\n }\r\n);\r\n\r\n/**\r\n * Toggle React component to show an \"on\" or \"off\" state\r\n * @public\r\n * @deprecated in 3.0. Use ToggleSwitch in itwinui-react instead\r\n */\r\nexport const Toggle: (props: ToggleProps) => JSX.Element | null = ForwardRefToggle; // eslint-disable-line deprecation/deprecation\r\n"]}
|
|
1
|
+
{"version":3,"file":"Toggle.js","sourceRoot":"","sources":["../../../../src/core-react/toggle/Toggle.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,yBAAuB;AACvB,2CAAoC;AACpC,+BAA+B;AAE/B,oDAAiD;AAEjD;;;GAGG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,iCAAiC;IACjC,6DAAO,CAAA;IACP,sBAAsB;IACtB,uDAAI,CAAA;AACN,CAAC,EALW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAK3B;AAgCD,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CAAmC,8CAA8C;AACxH,SAAS,gBAAgB,CAAC,KAAK,EAAE,GAAG;IAClC,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAmB,IAAI,CAAC,CAAC;IAC1D,MAAM,IAAI,GAAG,IAAA,iBAAO,EAAC,YAAY,EAAE,GAAG,CAAC,CAAC,CAAE,uGAAuG;IACjJ,MAAM,OAAO,GAAG,CAAC,CAAC;IAClB,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5C,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG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,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAC1C,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAClD,KAAK,EAAE,KAAK,CAAC,KAAK,GAAI;QACxB,8BAAM,SAAS,EAAC,wBAAwB,GAAG;QAC3C,8BAAM,SAAS,EAAE,kBAAkB,GAAI;QACvC,8BAAM,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,iBAAiB,GAAI,CACxD,CACT,CAAC;AACJ,CAAC,CACF,CAAC;AAEF;;;;GAIG;AACU,QAAA,MAAM,GAAqD,gBAAgB,CAAC,CAAG,8CAA8C","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Toggle\r\n */\r\n\r\nimport \"./Toggle.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { useRefs } from \"../utils/hooks/useRefs\";\r\n\r\n/** Toggle display types\r\n * @public\r\n * @deprecated in 3.0. Use ToggleSwitch from @itwin/itwinui-react and its standard theming.\r\n */\r\nexport enum ToggleButtonType {\r\n /** Primary (green) background */\r\n Primary,\r\n /** Blue background */\r\n Blue,\r\n}\r\n\r\n/** Properties for [[Toggle]] component\r\n * @public\r\n * @deprecated in 3.0. Use ToggleSwitchProps in itwinui-react instead\r\n */\r\nexport interface ToggleProps extends CommonProps {\r\n /** Indicates whether the Toggle is disabled (default is false) */\r\n disabled?: boolean;\r\n /** Indicates whether the Toggle is \"on\" or \"off\" (default is false) */\r\n isOn?: boolean;\r\n /** Show the toggle rounded or square (rounded is default) */\r\n rounded?: boolean;\r\n /** Show a check mark icon when the toggle is \"on\" (false is default) */\r\n showCheckmark?: boolean;\r\n /** Button type, either Primary or Blue (Blue is default).\r\n * @deprecated in 3.0. Use icon in ToggleSwitch props from @itwin/itwinui-react */\r\n buttonType?: ToggleButtonType; // eslint-disable-line deprecation/deprecation\r\n /** Function called when the toggle state is changed */\r\n onChange?: (checked: boolean) => any;\r\n /** Function called when the toggle loses focus */\r\n onBlur?: (event: React.FocusEvent) => any;\r\n /** Use larger size (default is false) */\r\n large?: boolean;\r\n /** Indicates whether to set focus to the input element */\r\n setFocus?: boolean;\r\n /** Tooltip text */\r\n title?: string;\r\n /** Provides ability to return reference to HTMLInputElement */\r\n ref?: React.Ref<HTMLInputElement>;\r\n}\r\n\r\nconst ForwardRefToggle = React.forwardRef<HTMLInputElement, ToggleProps>( // eslint-disable-line deprecation/deprecation\r\n function ForwardRefToggle(props, ref) {\r\n const inputElement = React.useRef<HTMLInputElement>(null);\r\n const refs = useRefs(inputElement, ref); // combine ref needed for target with the forwardRef needed by the Parent when parent is a Type Editor.\r\n const padding = 2;\r\n const defaultHeight = props.large ? 32 : 21;\r\n const [height, setHeight] = React.useState(defaultHeight);\r\n const [width, setWidth] = React.useState(defaultHeight * 2);\r\n const [checked, setChecked] = React.useState(props.isOn ? true : false);\r\n const [toggling, setToggling] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n if (props.setFocus && inputElement.current)\r\n inputElement.current.focus();\r\n }, [props]);\r\n\r\n React.useEffect(() => {\r\n setChecked(props.isOn ? true : false);\r\n }, [props.isOn]);\r\n\r\n const handleChange = React.useCallback(() => {\r\n const newChecked = !checked;\r\n\r\n setToggling(true);\r\n setChecked(newChecked);\r\n\r\n // istanbul ignore else\r\n if (props.onChange)\r\n props.onChange(newChecked);\r\n\r\n setTimeout(() => {\r\n // istanbul ignore else\r\n if (inputElement.current)\r\n setToggling(false);\r\n }, 250);\r\n }, [props, checked]);\r\n\r\n const handleBlur = React.useCallback((event: React.FocusEvent) => {\r\n // istanbul ignore else\r\n if (props.onBlur)\r\n props.onBlur(event);\r\n }, [props]);\r\n\r\n const handleCheckboxBlur = React.useCallback((event: React.FocusEvent) => {\r\n event.stopPropagation();\r\n }, []);\r\n\r\n const setHeightFromRef = React.useCallback((el: HTMLLabelElement | null) => {\r\n if (el !== null) {\r\n // istanbul ignore next\r\n if (el.clientHeight > 0 && el.clientWidth > 0) {\r\n setHeight(el.clientHeight);\r\n setWidth(el.clientWidth);\r\n }\r\n }\r\n }, []);\r\n\r\n const getOffset = (): number => {\r\n return (checked) ? width - height : 0;\r\n };\r\n\r\n /** Default props */\r\n const rounded = props.rounded !== undefined ? props.rounded : true;\r\n const showCheckmark = props.showCheckmark !== undefined ? props.showCheckmark : false;\r\n const buttonType = props.buttonType !== undefined ? props.buttonType : ToggleButtonType.Blue; // eslint-disable-line deprecation/deprecation\r\n\r\n const halfHeight = height / 2;\r\n const checkmarkClassName = classnames(\r\n \"core-toggle-checkmark\",\r\n \"icon\", \"icon-checkmark\",\r\n showCheckmark && \"core-visible\",\r\n toggling && \"core-toggling\",\r\n );\r\n const toggleStyle: React.CSSProperties = { borderRadius: rounded ? halfHeight : 3, fontSize: halfHeight, ...props.style };\r\n const toggleClassName = classnames(\r\n \"core-toggle\",\r\n buttonType === ToggleButtonType.Primary && \"core-toggle-primary\", // eslint-disable-line deprecation/deprecation\r\n props.large && \"core-toggle-large\",\r\n rounded && \"core-toggle-rounded\",\r\n props.disabled && \"uicore-disabled\",\r\n props.className);\r\n const toggleHandleStyle: React.CSSProperties = {\r\n width: height - (padding * 2),\r\n transform: `translateX(${getOffset()}px)`,\r\n top: padding,\r\n bottom: padding,\r\n left: padding,\r\n };\r\n const handleClassName = classnames(\r\n \"core-toggle-handle\",\r\n toggling && \"core-toggling\",\r\n );\r\n\r\n return (\r\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\r\n <label ref={setHeightFromRef} style={toggleStyle} className={toggleClassName} onBlur={handleBlur}>\r\n <input type=\"checkbox\" ref={refs} className=\"core-toggle-input\"\r\n checked={checked} disabled={props.disabled}\r\n onChange={handleChange} onBlur={handleCheckboxBlur}\r\n title={props.title} />\r\n <span className=\"core-toggle-background\" />\r\n <span className={checkmarkClassName} />\r\n <span className={handleClassName} style={toggleHandleStyle} />\r\n </label>\r\n );\r\n }\r\n);\r\n\r\n/**\r\n * Toggle React component to show an \"on\" or \"off\" state\r\n * @public\r\n * @deprecated in 3.0. Use ToggleSwitch in itwinui-react instead\r\n */\r\nexport const Toggle: (props: ToggleProps) => React.JSX.Element | null = ForwardRefToggle; // eslint-disable-line deprecation/deprecation\r\n"]}
|
|
@@ -28,7 +28,7 @@ export interface TooltipProps extends CommonProps {
|
|
|
28
28
|
* @beta
|
|
29
29
|
* @deprecated in 3.0. Use Tooltip in itwinui-react instead
|
|
30
30
|
*/
|
|
31
|
-
export declare function Tooltip(props: TooltipProps): JSX.Element;
|
|
31
|
+
export declare function Tooltip(props: TooltipProps): React.JSX.Element;
|
|
32
32
|
/** @internal */
|
|
33
33
|
export declare function placementToPosition(placement: TooltipPlacement | undefined): RelativePosition;
|
|
34
34
|
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../src/core-react/tooltip/Tooltip.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,gBAAgB,CAAC;AAExB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;GAGG;AACH,oBAAY,gBAAgB,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C,uBAAuB;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,mCAAmC;IACnC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,kDAAkD;IAClD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sDAAsD;IACtD,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../src/core-react/tooltip/Tooltip.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,gBAAgB,CAAC;AAExB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;GAGG;AACH,oBAAY,gBAAgB,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C,uBAAuB;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,mCAAmC;IACnC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,kDAAkD;IAClD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sDAAsD;IACtD,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,qBAgC1C;AAED,gBAAgB;AAChB,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,gBAAgB,GAAG,SAAS,GAAG,gBAAgB,CAY7F"}
|
|
@@ -16,6 +16,6 @@ export interface ExpansionToggleProps extends CommonProps {
|
|
|
16
16
|
* @public
|
|
17
17
|
*/
|
|
18
18
|
export declare class ExpansionToggle extends React.PureComponent<ExpansionToggleProps> {
|
|
19
|
-
render(): JSX.Element;
|
|
19
|
+
render(): React.JSX.Element;
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=ExpansionToggle.d.ts.map
|
|
@@ -70,7 +70,7 @@ export interface TreeNodeProps extends CommonProps {
|
|
|
70
70
|
*/
|
|
71
71
|
export declare class TreeNode extends React.Component<TreeNodeProps> {
|
|
72
72
|
constructor(props: TreeNodeProps);
|
|
73
|
-
render(): JSX.Element;
|
|
73
|
+
render(): React.JSX.Element;
|
|
74
74
|
private createSubComponentTestId;
|
|
75
75
|
private _onCheckboxChange;
|
|
76
76
|
private _onCheckboxClick;
|
|
@@ -18,6 +18,6 @@ export interface TreeNodePlaceholderProps extends CommonProps {
|
|
|
18
18
|
* @public
|
|
19
19
|
*/
|
|
20
20
|
export declare class TreeNodePlaceholder extends React.PureComponent<TreeNodePlaceholderProps> {
|
|
21
|
-
render(): JSX.Element;
|
|
21
|
+
render(): React.JSX.Element;
|
|
22
22
|
}
|
|
23
23
|
//# sourceMappingURL=Placeholder.d.ts.map
|
|
@@ -24,6 +24,6 @@ export declare class Tree extends React.PureComponent<TreeProps> {
|
|
|
24
24
|
scrollToElement(element: Element): void;
|
|
25
25
|
getElementsByClassName(className: string): Element[];
|
|
26
26
|
setFocusByClassName(selector: string): boolean;
|
|
27
|
-
render(): JSX.Element;
|
|
27
|
+
render(): React.JSX.Element;
|
|
28
28
|
}
|
|
29
29
|
//# sourceMappingURL=Tree.d.ts.map
|
|
@@ -25,8 +25,8 @@ export interface RenderPropsArgs {
|
|
|
25
25
|
*/
|
|
26
26
|
export declare function ElementResizeObserver({ watchedElement, render }: {
|
|
27
27
|
watchedElement: HTMLElement | null;
|
|
28
|
-
render: (props: RenderPropsArgs) => JSX.Element;
|
|
29
|
-
}): JSX.Element;
|
|
28
|
+
render: (props: RenderPropsArgs) => React.JSX.Element;
|
|
29
|
+
}): React.JSX.Element;
|
|
30
30
|
/** ResizableContainerObserver is a component that provides the functionality similar to the ReactResizeDetector option that call a function when
|
|
31
31
|
* the observed element is resized. This implementation properly handles observing element in pop-out/child windows. If children nodes are defined then
|
|
32
32
|
* the div added by the component is considered the container whose size will be observed. If no children are provided then the component will report
|
|
@@ -36,5 +36,5 @@ export declare function ElementResizeObserver({ watchedElement, render }: {
|
|
|
36
36
|
export declare function ResizableContainerObserver({ onResize, children }: {
|
|
37
37
|
onResize: (width: number, height: number) => void;
|
|
38
38
|
children?: React.ReactNode;
|
|
39
|
-
}): JSX.Element;
|
|
39
|
+
}): React.JSX.Element;
|
|
40
40
|
//# sourceMappingURL=useResizeObserver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResizeObserver.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useResizeObserver.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;IAEI;AACJ,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,sCAiFtG;AAED;;;;IAII;AACJ,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,WAAW,GAAG,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,0BAgF1H;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE;IAAE,cAAc,EAAE,WAAW,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,GAAG,CAAC,OAAO,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"useResizeObserver.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useResizeObserver.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;IAEI;AACJ,wBAAgB,iBAA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AC,CAAC;IAEf,uBAAuB,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;IACzD,MAAM,KAAK,GAAwB,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAEzG,OAAO,CACL,6BAAK,GAAG,EAAE,YAAY,EAAE,SAAS,EAAC,4BAA4B,EAAC,KAAK,EAAE,KAAK,IACxE,WAAW,IAAI,QAAQ,CACpB,CACP,CAAC;AACJ,CAAC;AA7BD,gEA6BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\nimport * as React from \"react\";\r\nimport { ResizeObserver } from \"./ResizeObserverPolyfill\";\r\nimport { useRefEffect } from \"./useRefEffect\";\r\nimport { useRefs } from \"./useRefs\";\r\n\r\n/** Uses ResizeObserver API to notify about element bound changes.\r\n * @internal\r\n */\r\nexport function useResizeObserver<T extends Element>(onResize?: (width: number, height: number) => void) {\r\n const [bounds, setBounds] = React.useState({ width: 0, height: 0 });\r\n const resizeObserver = React.useRef<ResizeObserver | null>(null);\r\n const rafRef = React.useRef(0); // set to non-zero when requestAnimationFrame processing is active\r\n const isMountedRef = React.useRef(false);\r\n const owningWindowRef = React.useRef<any>(null);\r\n\r\n // istanbul ignore next\r\n const resizeObserverCleanup = () => {\r\n if (rafRef.current)\r\n owningWindowRef.current.cancelAnimationFrame(rafRef.current);\r\n\r\n resizeObserver.current?.disconnect();\r\n resizeObserver.current = null;\r\n };\r\n\r\n React.useEffect(() => {\r\n isMountedRef.current = true;\r\n return () => {\r\n isMountedRef.current = false;\r\n if (rafRef.current)\r\n owningWindowRef.current.cancelAnimationFrame(rafRef.current);\r\n owningWindowRef.current?.removeEventListener(\"beforeunload\", resizeObserverCleanup);\r\n };\r\n }, []);\r\n\r\n const processResize = React.useCallback((target: HTMLElement) => {\r\n const newBounds = target.getBoundingClientRect();\r\n // istanbul ignore else\r\n if (isMountedRef.current && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {\r\n setBounds(newBounds);\r\n onResize && onResize(newBounds.width, newBounds.height);\r\n }\r\n }, [onResize, bounds.height, bounds.width]);\r\n\r\n const handleResize = React.useCallback((entries: any[]) => {\r\n // istanbul ignore if\r\n if (!isMountedRef.current || !Array.isArray(entries) || 0 === entries.length) {\r\n return;\r\n }\r\n const target = entries[0].target as HTMLElement;\r\n // istanbul ignore next\r\n owningWindowRef.current && owningWindowRef.current.removeEventListener(\"beforeunload\", resizeObserverCleanup);\r\n\r\n owningWindowRef.current = target.ownerDocument.defaultView;\r\n // istanbul ignore else\r\n if (owningWindowRef.current) {\r\n owningWindowRef.current.addEventListener(\"unload\", resizeObserverCleanup);\r\n\r\n // using requestAnimationFrame to stop the \"ResizeObserver loop completed with undelivered notifications.\" and\r\n // \"ResizeObserver loop limit exceeded\" messages reported to window.onError\r\n rafRef.current = owningWindowRef.current.requestAnimationFrame(() => processResize(target));\r\n }\r\n }, [processResize]);\r\n\r\n const observerRef = useRefEffect((instance: T | null) => {\r\n resizeObserver.current = new ResizeObserver(handleResize);\r\n if (instance) {\r\n resizeObserver.current.observe(instance);\r\n const newBounds = instance.getBoundingClientRect();\r\n onResize && onResize(newBounds.width, newBounds.height);\r\n setBounds(newBounds);\r\n }\r\n\r\n return () => {\r\n instance && ( /* istanbul ignore next */resizeObserver.current?.unobserve(instance));\r\n resizeObserver.current = null;\r\n };\r\n }, [handleResize, onResize]);\r\n\r\n const handleRef = React.useCallback((instance: Element | null) => {\r\n const newBounds = instance && instance.getBoundingClientRect();\r\n // istanbul ignore if\r\n if (newBounds && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {\r\n setBounds(newBounds);\r\n onResize && onResize(newBounds.width, newBounds.height);\r\n }\r\n }, [bounds.height, bounds.width, onResize]);\r\n\r\n const ref = useRefs(handleRef, observerRef);\r\n return ref;\r\n}\r\n\r\n/** React hook that uses ResizeObserver API to notify about element bound changes. Note: to work similar to ReactResizeDetector\r\n * width and height are initialized as undefined and only set during after mount if bounds are non-zero. This implementation properly\r\n * handles observing element in pop-out/child windows.\r\n * @internal\r\n */\r\nexport function useLayoutResizeObserver(inElement: HTMLElement | null, onResize?: (width?: number, height?: number) => void) {\r\n const inBoundingRect = inElement?.getBoundingClientRect();\r\n const [bounds, setBounds] = React.useState<{ width?: number, height?: number }>({ width: inBoundingRect?.width, height: inBoundingRect?.height });\r\n const [watchedElement, setWatchedElement] = React.useState(inElement);\r\n const resizeObserver = React.useRef<ResizeObserver | null>(null);\r\n const rafRef = React.useRef(0); // set to non-zero when requestAnimationFrame processing is active\r\n const isMountedRef = React.useRef(false);\r\n const owningWindowRef = React.useRef<any>(null);\r\n\r\n // istanbul ignore next\r\n const resizeObserverCleanup = () => {\r\n if (rafRef.current)\r\n owningWindowRef.current.cancelAnimationFrame(rafRef.current);\r\n\r\n resizeObserver.current?.disconnect();\r\n resizeObserver.current = null;\r\n };\r\n\r\n React.useEffect(() => {\r\n isMountedRef.current = true;\r\n setWatchedElement(inElement);\r\n\r\n // istanbul ignore next\r\n if (inElement) {\r\n const newBounds = inElement.getBoundingClientRect();\r\n onResize && onResize(newBounds.width, newBounds.height);\r\n setBounds(newBounds);\r\n }\r\n\r\n return () => {\r\n isMountedRef.current = false;\r\n (rafRef.current && owningWindowRef.current) && owningWindowRef.current.cancelAnimationFrame(rafRef.current);\r\n owningWindowRef.current && owningWindowRef.current.removeEventListener(\"beforeunload\", resizeObserverCleanup);\r\n };\r\n }, [onResize, inElement]);\r\n\r\n const processResize = React.useCallback((target: HTMLElement) => {\r\n const newBounds = target.getBoundingClientRect();\r\n // istanbul ignore next\r\n if (isMountedRef.current && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {\r\n onResize && onResize(newBounds.width, newBounds.height);\r\n setBounds(newBounds);\r\n }\r\n }, [bounds.height, bounds.width, onResize]);\r\n\r\n const handleResize = React.useCallback((entries: any[]) => {\r\n // istanbul ignore next\r\n if (!isMountedRef.current || !Array.isArray(entries) || 0 === entries.length) {\r\n return;\r\n }\r\n const target = entries[0].target as HTMLElement;\r\n // istanbul ignore next\r\n if (owningWindowRef.current)\r\n owningWindowRef.current.removeEventListener(\"beforeunload\", resizeObserverCleanup);\r\n\r\n owningWindowRef.current = target.ownerDocument.defaultView;\r\n // istanbul ignore else\r\n if (owningWindowRef.current) {\r\n owningWindowRef.current.addEventListener(\"unload\", resizeObserverCleanup);\r\n\r\n // using requestAnimationFrame to stop the \"ResizeObserver loop completed with undelivered notifications.\" and\r\n // \"ResizeObserver loop limit exceeded\" messages reported to window.onError\r\n rafRef.current = owningWindowRef.current.requestAnimationFrame(() => processResize(target));\r\n }\r\n }, [processResize]);\r\n\r\n React.useLayoutEffect(() => {\r\n if (!watchedElement) {\r\n return;\r\n }\r\n resizeObserver.current = new ResizeObserver(handleResize);\r\n resizeObserver.current.observe(watchedElement);\r\n return () => {\r\n // istanbul ignore next\r\n resizeObserver.current?.disconnect();\r\n resizeObserver.current = null;\r\n };\r\n }, [handleResize, watchedElement]);\r\n\r\n return [bounds.width, bounds.height];\r\n}\r\n\r\n/** Prop the ElementResizeObserver sends to the render function.\r\n * @public\r\n */\r\nexport interface RenderPropsArgs {\r\n width?: number;\r\n height?: number;\r\n}\r\n\r\n/** ElementResizeObserver provides functionality similar to ReactResizeDetector when a render function is specified. This implementation properly handles\r\n * observing element in pop-out/child windows.\r\n * @public\r\n */\r\nexport function ElementResizeObserver({ watchedElement, render }: { watchedElement: HTMLElement | null, render: (props: RenderPropsArgs) => JSX.Element }) {\r\n const [width, height] = useLayoutResizeObserver(watchedElement);\r\n return render({ width, height });\r\n}\r\n\r\n/** ResizableContainerObserver is a component that provides the functionality similar to the ReactResizeDetector option that call a function when\r\n * the observed element is resized. This implementation properly handles observing element in pop-out/child windows. If children nodes are defined then\r\n * the div added by the component is considered the container whose size will be observed. If no children are provided then the component will report\r\n * size changes from its parent container.\r\n * @public\r\n */\r\nexport function ResizableContainerObserver({ onResize, children }: { onResize: (width: number, height: number) => void, children?: React.ReactNode }) {\r\n const containerRef = React.useRef<HTMLDivElement>(null); // set to non-zero when requestAnimationFrame processing is active\r\n const [containerElement, setContainerElement] = React.useState<HTMLElement | null>(null);\r\n const isMountedRef = React.useRef(false);\r\n const hasChildren = React.Children.count(children) !== 0;\r\n\r\n // if no children are specified then monitor size of parent element.\r\n React.useEffect(() => {\r\n // istanbul ignore next\r\n if (!isMountedRef.current && containerRef.current) {\r\n isMountedRef.current = true;\r\n const hasParent = !!containerRef.current.parentElement;\r\n setContainerElement(hasChildren && hasParent ? containerRef.current : containerRef.current.parentElement);\r\n }\r\n }, [hasChildren]);\r\n\r\n const processResize = React.useCallback((width?: number, height?: number) => {\r\n // istanbul ignore next\r\n onResize(width ?? 0, height ?? 0);\r\n }, [onResize]);\r\n\r\n useLayoutResizeObserver(containerElement, processResize);\r\n const style: React.CSSProperties = hasChildren ? { width: \"100%\", height: \"100%\" } : { display: \"none\" };\r\n\r\n return (\r\n <div ref={containerRef} className=\"uicore-resizable-container\" style={style}>\r\n {hasChildren && children}\r\n </div>\r\n );\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"useResizeObserver.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useResizeObserver.tsx"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,+BAA+B;AAC/B,qEAA0D;AAC1D,iDAA8C;AAC9C,uCAAoC;AAEpC;;IAEI;AACJ,SAAgB,iBAAiB,CAAoB,QAAkD;IACrG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;IACpE,MAAM,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CAAC;IACzD,MAAM,KAAK,GAAwB,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAEzG,OAAO,CACL,6BAAK,GAAG,EAAE,YAAY,EAAE,SAAS,EAAC,4BAA4B,EAAC,KAAK,EAAE,KAAK,IACxE,WAAW,IAAI,QAAQ,CACpB,CACP,CAAC;AACJ,CAAC;AA7BD,gEA6BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\nimport * as React from \"react\";\r\nimport { ResizeObserver } from \"./ResizeObserverPolyfill\";\r\nimport { useRefEffect } from \"./useRefEffect\";\r\nimport { useRefs } from \"./useRefs\";\r\n\r\n/** Uses ResizeObserver API to notify about element bound changes.\r\n * @internal\r\n */\r\nexport function useResizeObserver<T extends Element>(onResize?: (width: number, height: number) => void) {\r\n const [bounds, setBounds] = React.useState({ width: 0, height: 0 });\r\n const resizeObserver = React.useRef<ResizeObserver | null>(null);\r\n const rafRef = React.useRef(0); // set to non-zero when requestAnimationFrame processing is active\r\n const isMountedRef = React.useRef(false);\r\n const owningWindowRef = React.useRef<any>(null);\r\n\r\n // istanbul ignore next\r\n const resizeObserverCleanup = () => {\r\n if (rafRef.current)\r\n owningWindowRef.current.cancelAnimationFrame(rafRef.current);\r\n\r\n resizeObserver.current?.disconnect();\r\n resizeObserver.current = null;\r\n };\r\n\r\n React.useEffect(() => {\r\n isMountedRef.current = true;\r\n return () => {\r\n isMountedRef.current = false;\r\n if (rafRef.current)\r\n owningWindowRef.current.cancelAnimationFrame(rafRef.current);\r\n owningWindowRef.current?.removeEventListener(\"beforeunload\", resizeObserverCleanup);\r\n };\r\n }, []);\r\n\r\n const processResize = React.useCallback((target: HTMLElement) => {\r\n const newBounds = target.getBoundingClientRect();\r\n // istanbul ignore else\r\n if (isMountedRef.current && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {\r\n setBounds(newBounds);\r\n onResize && onResize(newBounds.width, newBounds.height);\r\n }\r\n }, [onResize, bounds.height, bounds.width]);\r\n\r\n const handleResize = React.useCallback((entries: any[]) => {\r\n // istanbul ignore if\r\n if (!isMountedRef.current || !Array.isArray(entries) || 0 === entries.length) {\r\n return;\r\n }\r\n const target = entries[0].target as HTMLElement;\r\n // istanbul ignore next\r\n owningWindowRef.current && owningWindowRef.current.removeEventListener(\"beforeunload\", resizeObserverCleanup);\r\n\r\n owningWindowRef.current = target.ownerDocument.defaultView;\r\n // istanbul ignore else\r\n if (owningWindowRef.current) {\r\n owningWindowRef.current.addEventListener(\"unload\", resizeObserverCleanup);\r\n\r\n // using requestAnimationFrame to stop the \"ResizeObserver loop completed with undelivered notifications.\" and\r\n // \"ResizeObserver loop limit exceeded\" messages reported to window.onError\r\n rafRef.current = owningWindowRef.current.requestAnimationFrame(() => processResize(target));\r\n }\r\n }, [processResize]);\r\n\r\n const observerRef = useRefEffect((instance: T | null) => {\r\n resizeObserver.current = new ResizeObserver(handleResize);\r\n if (instance) {\r\n resizeObserver.current.observe(instance);\r\n const newBounds = instance.getBoundingClientRect();\r\n onResize && onResize(newBounds.width, newBounds.height);\r\n setBounds(newBounds);\r\n }\r\n\r\n return () => {\r\n instance && ( /* istanbul ignore next */resizeObserver.current?.unobserve(instance));\r\n resizeObserver.current = null;\r\n };\r\n }, [handleResize, onResize]);\r\n\r\n const handleRef = React.useCallback((instance: Element | null) => {\r\n const newBounds = instance && instance.getBoundingClientRect();\r\n // istanbul ignore if\r\n if (newBounds && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {\r\n setBounds(newBounds);\r\n onResize && onResize(newBounds.width, newBounds.height);\r\n }\r\n }, [bounds.height, bounds.width, onResize]);\r\n\r\n const ref = useRefs(handleRef, observerRef);\r\n return ref;\r\n}\r\n\r\n/** React hook that uses ResizeObserver API to notify about element bound changes. Note: to work similar to ReactResizeDetector\r\n * width and height are initialized as undefined and only set during after mount if bounds are non-zero. This implementation properly\r\n * handles observing element in pop-out/child windows.\r\n * @internal\r\n */\r\nexport function useLayoutResizeObserver(inElement: HTMLElement | null, onResize?: (width?: number, height?: number) => void) {\r\n const inBoundingRect = inElement?.getBoundingClientRect();\r\n const [bounds, setBounds] = React.useState<{ width?: number, height?: number }>({ width: inBoundingRect?.width, height: inBoundingRect?.height });\r\n const [watchedElement, setWatchedElement] = React.useState(inElement);\r\n const resizeObserver = React.useRef<ResizeObserver | null>(null);\r\n const rafRef = React.useRef(0); // set to non-zero when requestAnimationFrame processing is active\r\n const isMountedRef = React.useRef(false);\r\n const owningWindowRef = React.useRef<any>(null);\r\n\r\n // istanbul ignore next\r\n const resizeObserverCleanup = () => {\r\n if (rafRef.current)\r\n owningWindowRef.current.cancelAnimationFrame(rafRef.current);\r\n\r\n resizeObserver.current?.disconnect();\r\n resizeObserver.current = null;\r\n };\r\n\r\n React.useEffect(() => {\r\n isMountedRef.current = true;\r\n setWatchedElement(inElement);\r\n\r\n // istanbul ignore next\r\n if (inElement) {\r\n const newBounds = inElement.getBoundingClientRect();\r\n onResize && onResize(newBounds.width, newBounds.height);\r\n setBounds(newBounds);\r\n }\r\n\r\n return () => {\r\n isMountedRef.current = false;\r\n (rafRef.current && owningWindowRef.current) && owningWindowRef.current.cancelAnimationFrame(rafRef.current);\r\n owningWindowRef.current && owningWindowRef.current.removeEventListener(\"beforeunload\", resizeObserverCleanup);\r\n };\r\n }, [onResize, inElement]);\r\n\r\n const processResize = React.useCallback((target: HTMLElement) => {\r\n const newBounds = target.getBoundingClientRect();\r\n // istanbul ignore next\r\n if (isMountedRef.current && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {\r\n onResize && onResize(newBounds.width, newBounds.height);\r\n setBounds(newBounds);\r\n }\r\n }, [bounds.height, bounds.width, onResize]);\r\n\r\n const handleResize = React.useCallback((entries: any[]) => {\r\n // istanbul ignore next\r\n if (!isMountedRef.current || !Array.isArray(entries) || 0 === entries.length) {\r\n return;\r\n }\r\n const target = entries[0].target as HTMLElement;\r\n // istanbul ignore next\r\n if (owningWindowRef.current)\r\n owningWindowRef.current.removeEventListener(\"beforeunload\", resizeObserverCleanup);\r\n\r\n owningWindowRef.current = target.ownerDocument.defaultView;\r\n // istanbul ignore else\r\n if (owningWindowRef.current) {\r\n owningWindowRef.current.addEventListener(\"unload\", resizeObserverCleanup);\r\n\r\n // using requestAnimationFrame to stop the \"ResizeObserver loop completed with undelivered notifications.\" and\r\n // \"ResizeObserver loop limit exceeded\" messages reported to window.onError\r\n rafRef.current = owningWindowRef.current.requestAnimationFrame(() => processResize(target));\r\n }\r\n }, [processResize]);\r\n\r\n React.useLayoutEffect(() => {\r\n if (!watchedElement) {\r\n return;\r\n }\r\n resizeObserver.current = new ResizeObserver(handleResize);\r\n resizeObserver.current.observe(watchedElement);\r\n return () => {\r\n // istanbul ignore next\r\n resizeObserver.current?.disconnect();\r\n resizeObserver.current = null;\r\n };\r\n }, [handleResize, watchedElement]);\r\n\r\n return [bounds.width, bounds.height];\r\n}\r\n\r\n/** Prop the ElementResizeObserver sends to the render function.\r\n * @public\r\n */\r\nexport interface RenderPropsArgs {\r\n width?: number;\r\n height?: number;\r\n}\r\n\r\n/** ElementResizeObserver provides functionality similar to ReactResizeDetector when a render function is specified. This implementation properly handles\r\n * observing element in pop-out/child windows.\r\n * @public\r\n */\r\nexport function ElementResizeObserver({ watchedElement, render }: { watchedElement: HTMLElement | null, render: (props: RenderPropsArgs) => React.JSX.Element }) {\r\n const [width, height] = useLayoutResizeObserver(watchedElement);\r\n return render({ width, height });\r\n}\r\n\r\n/** ResizableContainerObserver is a component that provides the functionality similar to the ReactResizeDetector option that call a function when\r\n * the observed element is resized. This implementation properly handles observing element in pop-out/child windows. If children nodes are defined then\r\n * the div added by the component is considered the container whose size will be observed. If no children are provided then the component will report\r\n * size changes from its parent container.\r\n * @public\r\n */\r\nexport function ResizableContainerObserver({ onResize, children }: { onResize: (width: number, height: number) => void, children?: React.ReactNode }) {\r\n const containerRef = React.useRef<HTMLDivElement>(null); // set to non-zero when requestAnimationFrame processing is active\r\n const [containerElement, setContainerElement] = React.useState<HTMLElement | null>(null);\r\n const isMountedRef = React.useRef(false);\r\n const hasChildren = React.Children.count(children) !== 0;\r\n\r\n // if no children are specified then monitor size of parent element.\r\n React.useEffect(() => {\r\n // istanbul ignore next\r\n if (!isMountedRef.current && containerRef.current) {\r\n isMountedRef.current = true;\r\n const hasParent = !!containerRef.current.parentElement;\r\n setContainerElement(hasChildren && hasParent ? containerRef.current : containerRef.current.parentElement);\r\n }\r\n }, [hasChildren]);\r\n\r\n const processResize = React.useCallback((width?: number, height?: number) => {\r\n // istanbul ignore next\r\n onResize(width ?? 0, height ?? 0);\r\n }, [onResize]);\r\n\r\n useLayoutResizeObserver(containerElement, processResize);\r\n const style: React.CSSProperties = hasChildren ? { width: \"100%\", height: \"100%\" } : { display: \"none\" };\r\n\r\n return (\r\n <div ref={containerRef} className=\"uicore-resizable-container\" style={style}>\r\n {hasChildren && children}\r\n </div>\r\n );\r\n}\r\n"]}
|
|
@@ -91,7 +91,7 @@ export declare class AutoSuggest extends React.PureComponent<AutoSuggestProps, A
|
|
|
91
91
|
private getLabel;
|
|
92
92
|
private _handleKeyDown;
|
|
93
93
|
private _theme;
|
|
94
|
-
render(): JSX.Element;
|
|
94
|
+
render(): React.JSX.Element;
|
|
95
95
|
}
|
|
96
96
|
export {};
|
|
97
97
|
//# sourceMappingURL=AutoSuggest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoSuggest.d.ts","sourceRoot":"","sources":["../../../../src/core-react/autosuggest/AutoSuggest.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,KAAK,MAA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C,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;QAEjE,MAAM,UAAU,GAAiD;YAC/D,GAAG,KAAK;YACR,KAAK,EAAE,UAAU;YACjB,QAAQ,EAAE,IAAI,CAAC,SAAS;YACxB,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,WAAW,EAAE,gBAAgB;YAC7B,SAAS,EAAE,QAAQ;SACpB,CAAC;QAEF,OAAO;QACL,2EAA2E;QAC3E,mEAAmE;QACnE,6BAAK,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,cAAc;YAC3F,oBAAC,gBAAgB,IACf,KAAK,EAAE,IAAI,CAAC,MAAM,EAClB,WAAW,EAAE,WAAW,EACxB,2BAA2B,EAAE,IAAI,CAAC,4BAA4B,EAC9D,2BAA2B,EAAE,IAAI,CAAC,4BAA4B,EAC9D,kBAAkB,EAAE,IAAI,CAAC,mBAAmB,EAC5C,gBAAgB,EAAE,IAAI,CAAC,iBAAiB,EACxC,UAAU,EAAE,UAAU,EACtB,oBAAoB,EAAE,IAAI,CAAC,qBAAqB,EAChD,uBAAuB,EAAE,uBAAuB,EAChD,oBAAoB,EAAE,oBAAoB,EAC1C,0BAA0B,EAAE,0BAA0B,GACtD,CACE,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module AutoSuggest\r\n */\r\n\r\nimport \"./AutoSuggest.scss\";\r\nimport * as React from \"react\";\r\nimport * as ReactAutosuggest from \"react-autosuggest\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { SpecialKey } from \"@itwin/appui-abstract\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { UiCore } from \"../UiCore\";\r\n\r\n/** Data for the [[AutoSuggest]] options\r\n * @public\r\n */\r\nexport interface AutoSuggestData {\r\n /** Value of [[AutoSuggest]] option. */\r\n value: string;\r\n /** Label of [[AutoSuggest]] option. This is shown in the dropdown. */\r\n label: string;\r\n}\r\n\r\n/** Prototype for function returning AutoSuggestData\r\n * @public\r\n */\r\nexport type GetAutoSuggestDataFunc = (value: string) => AutoSuggestData[];\r\n\r\n/** Prototype for async function returning AutoSuggestData\r\n * @public\r\n */\r\nexport type AsyncGetAutoSuggestDataFunc = (value: string) => Promise<AutoSuggestData[]>;\r\n\r\n/** Properties for the [[AutoSuggest]] component.\r\n * @public\r\n */\r\nexport interface AutoSuggestProps extends React.InputHTMLAttributes<HTMLInputElement>, CommonProps {\r\n /** Optional input value override. */\r\n value?: string;\r\n /** Options for dropdown. */\r\n options?: AutoSuggestData[] | GetAutoSuggestDataFunc;\r\n /** Asynchronously calculate suggestions for any given input value. */\r\n getSuggestions?: AsyncGetAutoSuggestDataFunc;\r\n /** Gets a label associated with a given value */\r\n getLabel?: (value: string | undefined) => string;\r\n /** Handler for when suggested selected. */\r\n onSuggestionSelected: (selected: AutoSuggestData) => void;\r\n /** Handler for Enter key. */\r\n onPressEnter?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\r\n /** Handler for Escape key. */\r\n onPressEscape?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\r\n /** Handler for Tab key. */\r\n onPressTab?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\r\n /** Handler for input receiving focus. */\r\n onInputFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;\r\n /** Called every time you need to clear suggestions. */\r\n onSuggestionsClearRequested?: () => void;\r\n /** Indicates whether to set focus to the input element */\r\n setFocus?: boolean;\r\n\r\n /** Use it only if you need to customize the rendering of the input.\r\n * @internal\r\n */\r\n renderInputComponent?: any; // ReactAutosuggest.RenderInputComponent<AutoSuggestData>; NOTE: changed to \"any\" because build was failing with RenderInputComponent is not generic?\r\n /** Use it if you want to customize things inside the suggestions container beyond rendering the suggestions themselves.\r\n * @internal\r\n */\r\n renderSuggestionsContainer?: ReactAutosuggest.RenderSuggestionsContainer;\r\n\r\n /** @internal */\r\n alwaysRenderSuggestions?: boolean;\r\n}\r\n\r\n/** @internal */\r\ninterface AutoSuggestState {\r\n inputValue: string;\r\n suggestions: AutoSuggestData[];\r\n}\r\n\r\n/** Auto Suggest React component. Uses the react-autosuggest component internally.\r\n * @public\r\n */\r\nexport class AutoSuggest extends React.PureComponent<AutoSuggestProps, AutoSuggestState> {\r\n private _isMounted = false;\r\n\r\n constructor(props: AutoSuggestProps) {\r\n super(props);\r\n\r\n // Autosuggest is a controlled component.\r\n // This means that you need to provide an input value\r\n // and an onChange handler that updates this value (see below).\r\n // Suggestions also need to be provided to the Autosuggest,\r\n // and they are initially empty because the Autosuggest is closed.\r\n this.state = {\r\n inputValue: this.getLabel(props.value),\r\n suggestions: [],\r\n };\r\n }\r\n\r\n /** @internal */\r\n public override componentDidMount() {\r\n this._isMounted = true;\r\n }\r\n\r\n /** @internal */\r\n public override componentWillUnmount() {\r\n this._isMounted = false;\r\n }\r\n\r\n public override componentDidUpdate(prevProps: AutoSuggestProps) {\r\n if (this.props.value !== prevProps.value || this.props.options !== prevProps.options) {\r\n this.setState((_prevState, props) => ({\r\n inputValue: this.getLabel(props.value),\r\n }));\r\n }\r\n }\r\n\r\n private _onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n let newValue = \"\";\r\n\r\n if (e.target.tagName === \"LI\" && e.target.textContent)\r\n newValue = e.target.textContent;\r\n else if (e.target.value)\r\n newValue = e.target.value;\r\n\r\n this.setState({\r\n inputValue: newValue,\r\n });\r\n };\r\n\r\n private _onFocus = (e: React.FocusEvent<HTMLInputElement>) => {\r\n // istanbul ignore else\r\n if (this.props.onInputFocus)\r\n this.props.onInputFocus(e);\r\n };\r\n\r\n /** Autosuggest will call this function every time you need to update suggestions. */\r\n private _onSuggestionsFetchRequested = async (request: ReactAutosuggest.SuggestionsFetchRequestedParams): Promise<void> => {\r\n const value = request.value;\r\n const suggestions = await this._getSuggestions(value);\r\n\r\n if (this._isMounted)\r\n this.setState({ suggestions });\r\n };\r\n\r\n /** Autosuggest will call this function every time you need to clear suggestions. */\r\n private _onSuggestionsClearRequested = () => {\r\n this.setState({ suggestions: [] });\r\n this.props.onSuggestionsClearRequested && this.props.onSuggestionsClearRequested();\r\n };\r\n\r\n private _onSuggestionSelected = (_event: React.FormEvent<any>, data: ReactAutosuggest.SuggestionSelectedEventData<AutoSuggestData>): void => {\r\n this.props.onSuggestionSelected(data.suggestion);\r\n };\r\n\r\n /** Teach Autosuggest how to calculate suggestions for any given input value. */\r\n private _getSuggestions = async (value: string): Promise<AutoSuggestData[]> => {\r\n if (typeof this.props.options === \"function\")\r\n return Promise.resolve(this.props.options(value));\r\n\r\n if (this.props.getSuggestions)\r\n return this.props.getSuggestions(value);\r\n\r\n if (this.props.options === undefined) {\r\n Logger.logError(UiCore.loggerCategory(this), `props.options or props.getSuggestions should be provided`);\r\n return Promise.resolve([]);\r\n }\r\n\r\n const inputValue = value.trim().toLowerCase();\r\n const inputLength = inputValue.length;\r\n\r\n return Promise.resolve(\r\n inputLength === 0 ?\r\n /* istanbul ignore next */[] :\r\n this.props.options.filter((data: AutoSuggestData) => {\r\n return data.label.toLowerCase().includes(inputValue) || data.value.toLowerCase().includes(inputValue);\r\n })\r\n );\r\n };\r\n\r\n /** When suggestion is clicked, Autosuggest needs to populate the input based on the clicked suggestion. */\r\n private _getSuggestionValue = (suggestion: AutoSuggestData) => suggestion.label;\r\n\r\n /** Render each suggestion. */\r\n private _renderSuggestion = (suggestion: AutoSuggestData) => (\r\n <span>\r\n {suggestion.label}\r\n </span>\r\n );\r\n\r\n private getLabel(value: string | undefined): string {\r\n let label = \"\";\r\n\r\n if (this.props.getLabel) {\r\n label = this.props.getLabel(value);\r\n } else if (this.props.options instanceof Array) {\r\n const entry = this.props.options.find((data: AutoSuggestData) => data.value === value);\r\n if (entry)\r\n label = entry.label;\r\n } else {\r\n Logger.logError(UiCore.loggerCategory(this), `props.getLabel should be provided when props.options is a function`);\r\n }\r\n\r\n return label;\r\n }\r\n\r\n private _handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\r\n switch (e.key) {\r\n case SpecialKey.Enter:\r\n // istanbul ignore else\r\n if (this.props.onPressEnter)\r\n this.props.onPressEnter(e);\r\n break;\r\n case SpecialKey.Escape:\r\n // istanbul ignore else\r\n if (this.props.onPressEscape)\r\n this.props.onPressEscape(e);\r\n break;\r\n case SpecialKey.Tab:\r\n // istanbul ignore else\r\n if (this.props.onPressTab)\r\n this.props.onPressTab(e);\r\n break;\r\n }\r\n };\r\n\r\n private _theme = {\r\n container: \"uicore-autosuggest__container\",\r\n containerOpen: \"uicore-autosuggest__container--open\",\r\n input: \"uicore-autosuggest__input\",\r\n inputOpen: \"uicore-autosuggest__input--open\",\r\n inputFocused: \"uicore-autosuggest__input--focused\",\r\n suggestionsContainer: \"uicore-autosuggest__suggestions-container\",\r\n suggestionsContainerOpen: \"uicore-autosuggest__suggestions-container--open\",\r\n suggestionsList: \"uicore-autosuggest__suggestions-list\",\r\n suggestion: \"uicore-autosuggest__suggestion\",\r\n suggestionFirst: \"uicore-autosuggest__suggestion--first\",\r\n suggestionHighlighted: \"uicore-autosuggest__suggestion--highlighted\",\r\n sectionContainer: \"uicore-autosuggest__section-container\",\r\n sectionContainerFirst: \"uicore-autosuggest__section-container--first\",\r\n sectionTitle: \"uicore-autosuggest__section-title\",\r\n };\r\n\r\n public override render(): JSX.Element {\r\n const { inputValue, suggestions } = this.state;\r\n const { value, onChange, placeholder, options, onSuggestionSelected, setFocus, alwaysRenderSuggestions, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n onPressEnter, onPressEscape, onPressTab, onInputFocus, getLabel, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n getSuggestions, // eslint-disable-line deprecation/deprecation, @typescript-eslint/no-unused-vars\r\n renderInputComponent, renderSuggestionsContainer, onSuggestionsClearRequested, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n ...props } = this.props;\r\n const inputPlaceholder = (!inputValue) ? placeholder : undefined;\r\n\r\n const inputProps: ReactAutosuggest.InputProps<AutoSuggestData> = {\r\n ...props,\r\n value: inputValue,\r\n onChange: this._onChange,\r\n onFocus: this._onFocus,\r\n placeholder: inputPlaceholder,\r\n autoFocus: setFocus,\r\n };\r\n\r\n return (\r\n // The onKeyDown event handler is only being used to capture bubbled events\r\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\r\n <div className={this.props.className} style={this.props.style} onKeyDown={this._handleKeyDown}>\r\n <ReactAutosuggest\r\n theme={this._theme}\r\n suggestions={suggestions}\r\n onSuggestionsFetchRequested={this._onSuggestionsFetchRequested}\r\n onSuggestionsClearRequested={this._onSuggestionsClearRequested}\r\n getSuggestionValue={this._getSuggestionValue}\r\n renderSuggestion={this._renderSuggestion}\r\n inputProps={inputProps}\r\n onSuggestionSelected={this._onSuggestionSelected}\r\n alwaysRenderSuggestions={alwaysRenderSuggestions}\r\n renderInputComponent={renderInputComponent}\r\n renderSuggestionsContainer={renderSuggestionsContainer}\r\n />\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"AutoSuggest.js","sourceRoot":"","sources":["../../../../src/core-react/autosuggest/AutoSuggest.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAoEnC;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,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,gBAAgB,EAAE,IAAI,CAAC,iBAAiB,EACxC,UAAU,EAAE,UAAU,EACtB,oBAAoB,EAAE,IAAI,CAAC,qBAAqB,EAChD,uBAAuB,EAAE,uBAAuB,EAChD,oBAAoB,EAAE,oBAAoB,EAC1C,0BAA0B,EAAE,0BAA0B,GACtD,CACE,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module AutoSuggest\r\n */\r\n\r\nimport \"./AutoSuggest.scss\";\r\nimport * as React from \"react\";\r\nimport * as ReactAutosuggest from \"react-autosuggest\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { SpecialKey } from \"@itwin/appui-abstract\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { UiCore } from \"../UiCore\";\r\n\r\n/** Data for the [[AutoSuggest]] options\r\n * @public\r\n */\r\nexport interface AutoSuggestData {\r\n /** Value of [[AutoSuggest]] option. */\r\n value: string;\r\n /** Label of [[AutoSuggest]] option. This is shown in the dropdown. */\r\n label: string;\r\n}\r\n\r\n/** Prototype for function returning AutoSuggestData\r\n * @public\r\n */\r\nexport type GetAutoSuggestDataFunc = (value: string) => AutoSuggestData[];\r\n\r\n/** Prototype for async function returning AutoSuggestData\r\n * @public\r\n */\r\nexport type AsyncGetAutoSuggestDataFunc = (value: string) => Promise<AutoSuggestData[]>;\r\n\r\n/** Properties for the [[AutoSuggest]] component.\r\n * @public\r\n */\r\nexport interface AutoSuggestProps extends React.InputHTMLAttributes<HTMLInputElement>, CommonProps {\r\n /** Optional input value override. */\r\n value?: string;\r\n /** Options for dropdown. */\r\n options?: AutoSuggestData[] | GetAutoSuggestDataFunc;\r\n /** Asynchronously calculate suggestions for any given input value. */\r\n getSuggestions?: AsyncGetAutoSuggestDataFunc;\r\n /** Gets a label associated with a given value */\r\n getLabel?: (value: string | undefined) => string;\r\n /** Handler for when suggested selected. */\r\n onSuggestionSelected: (selected: AutoSuggestData) => void;\r\n /** Handler for Enter key. */\r\n onPressEnter?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\r\n /** Handler for Escape key. */\r\n onPressEscape?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\r\n /** Handler for Tab key. */\r\n onPressTab?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\r\n /** Handler for input receiving focus. */\r\n onInputFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;\r\n /** Called every time you need to clear suggestions. */\r\n onSuggestionsClearRequested?: () => void;\r\n /** Indicates whether to set focus to the input element */\r\n setFocus?: boolean;\r\n\r\n /** Use it only if you need to customize the rendering of the input.\r\n * @internal\r\n */\r\n renderInputComponent?: any; // ReactAutosuggest.RenderInputComponent<AutoSuggestData>; NOTE: changed to \"any\" because build was failing with RenderInputComponent is not generic?\r\n /** Use it if you want to customize things inside the suggestions container beyond rendering the suggestions themselves.\r\n * @internal\r\n */\r\n renderSuggestionsContainer?: ReactAutosuggest.RenderSuggestionsContainer;\r\n\r\n /** @internal */\r\n alwaysRenderSuggestions?: boolean;\r\n}\r\n\r\n/** @internal */\r\ninterface AutoSuggestState {\r\n inputValue: string;\r\n suggestions: AutoSuggestData[];\r\n}\r\n\r\n/** Auto Suggest React component. Uses the react-autosuggest component internally.\r\n * @public\r\n */\r\nexport class AutoSuggest extends React.PureComponent<AutoSuggestProps, AutoSuggestState> {\r\n private _isMounted = false;\r\n\r\n constructor(props: AutoSuggestProps) {\r\n super(props);\r\n\r\n // Autosuggest is a controlled component.\r\n // This means that you need to provide an input value\r\n // and an onChange handler that updates this value (see below).\r\n // Suggestions also need to be provided to the Autosuggest,\r\n // and they are initially empty because the Autosuggest is closed.\r\n this.state = {\r\n inputValue: this.getLabel(props.value),\r\n suggestions: [],\r\n };\r\n }\r\n\r\n /** @internal */\r\n public override componentDidMount() {\r\n this._isMounted = true;\r\n }\r\n\r\n /** @internal */\r\n public override componentWillUnmount() {\r\n this._isMounted = false;\r\n }\r\n\r\n public override componentDidUpdate(prevProps: AutoSuggestProps) {\r\n if (this.props.value !== prevProps.value || this.props.options !== prevProps.options) {\r\n this.setState((_prevState, props) => ({\r\n inputValue: this.getLabel(props.value),\r\n }));\r\n }\r\n }\r\n\r\n private _onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n let newValue = \"\";\r\n\r\n if (e.target.tagName === \"LI\" && e.target.textContent)\r\n newValue = e.target.textContent;\r\n else if (e.target.value)\r\n newValue = e.target.value;\r\n\r\n this.setState({\r\n inputValue: newValue,\r\n });\r\n };\r\n\r\n private _onFocus = (e: React.FocusEvent<HTMLInputElement>) => {\r\n // istanbul ignore else\r\n if (this.props.onInputFocus)\r\n this.props.onInputFocus(e);\r\n };\r\n\r\n /** Autosuggest will call this function every time you need to update suggestions. */\r\n private _onSuggestionsFetchRequested = async (request: ReactAutosuggest.SuggestionsFetchRequestedParams): Promise<void> => {\r\n const value = request.value;\r\n const suggestions = await this._getSuggestions(value);\r\n\r\n if (this._isMounted)\r\n this.setState({ suggestions });\r\n };\r\n\r\n /** Autosuggest will call this function every time you need to clear suggestions. */\r\n private _onSuggestionsClearRequested = () => {\r\n this.setState({ suggestions: [] });\r\n this.props.onSuggestionsClearRequested && this.props.onSuggestionsClearRequested();\r\n };\r\n\r\n private _onSuggestionSelected = (_event: React.FormEvent<any>, data: ReactAutosuggest.SuggestionSelectedEventData<AutoSuggestData>): void => {\r\n this.props.onSuggestionSelected(data.suggestion);\r\n };\r\n\r\n /** Teach Autosuggest how to calculate suggestions for any given input value. */\r\n private _getSuggestions = async (value: string): Promise<AutoSuggestData[]> => {\r\n if (typeof this.props.options === \"function\")\r\n return Promise.resolve(this.props.options(value));\r\n\r\n if (this.props.getSuggestions)\r\n return this.props.getSuggestions(value);\r\n\r\n if (this.props.options === undefined) {\r\n Logger.logError(UiCore.loggerCategory(this), `props.options or props.getSuggestions should be provided`);\r\n return Promise.resolve([]);\r\n }\r\n\r\n const inputValue = value.trim().toLowerCase();\r\n const inputLength = inputValue.length;\r\n\r\n return Promise.resolve(\r\n inputLength === 0 ?\r\n /* istanbul ignore next */[] :\r\n this.props.options.filter((data: AutoSuggestData) => {\r\n return data.label.toLowerCase().includes(inputValue) || data.value.toLowerCase().includes(inputValue);\r\n })\r\n );\r\n };\r\n\r\n /** When suggestion is clicked, Autosuggest needs to populate the input based on the clicked suggestion. */\r\n private _getSuggestionValue = (suggestion: AutoSuggestData) => suggestion.label;\r\n\r\n /** Render each suggestion. */\r\n private _renderSuggestion = (suggestion: AutoSuggestData) => (\r\n <span>\r\n {suggestion.label}\r\n </span>\r\n );\r\n\r\n private getLabel(value: string | undefined): string {\r\n let label = \"\";\r\n\r\n if (this.props.getLabel) {\r\n label = this.props.getLabel(value);\r\n } else if (this.props.options instanceof Array) {\r\n const entry = this.props.options.find((data: AutoSuggestData) => data.value === value);\r\n if (entry)\r\n label = entry.label;\r\n } else {\r\n Logger.logError(UiCore.loggerCategory(this), `props.getLabel should be provided when props.options is a function`);\r\n }\r\n\r\n return label;\r\n }\r\n\r\n private _handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\r\n switch (e.key) {\r\n case SpecialKey.Enter:\r\n // istanbul ignore else\r\n if (this.props.onPressEnter)\r\n this.props.onPressEnter(e);\r\n break;\r\n case SpecialKey.Escape:\r\n // istanbul ignore else\r\n if (this.props.onPressEscape)\r\n this.props.onPressEscape(e);\r\n break;\r\n case SpecialKey.Tab:\r\n // istanbul ignore else\r\n if (this.props.onPressTab)\r\n this.props.onPressTab(e);\r\n break;\r\n }\r\n };\r\n\r\n private _theme = {\r\n container: \"uicore-autosuggest__container\",\r\n containerOpen: \"uicore-autosuggest__container--open\",\r\n input: \"uicore-autosuggest__input\",\r\n inputOpen: \"uicore-autosuggest__input--open\",\r\n inputFocused: \"uicore-autosuggest__input--focused\",\r\n suggestionsContainer: \"uicore-autosuggest__suggestions-container\",\r\n suggestionsContainerOpen: \"uicore-autosuggest__suggestions-container--open\",\r\n suggestionsList: \"uicore-autosuggest__suggestions-list\",\r\n suggestion: \"uicore-autosuggest__suggestion\",\r\n suggestionFirst: \"uicore-autosuggest__suggestion--first\",\r\n suggestionHighlighted: \"uicore-autosuggest__suggestion--highlighted\",\r\n sectionContainer: \"uicore-autosuggest__section-container\",\r\n sectionContainerFirst: \"uicore-autosuggest__section-container--first\",\r\n sectionTitle: \"uicore-autosuggest__section-title\",\r\n };\r\n\r\n public override render(): React.JSX.Element {\r\n const { inputValue, suggestions } = this.state;\r\n const { value, onChange, placeholder, options, onSuggestionSelected, setFocus, alwaysRenderSuggestions, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n onPressEnter, onPressEscape, onPressTab, onInputFocus, getLabel, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n getSuggestions, // eslint-disable-line deprecation/deprecation, @typescript-eslint/no-unused-vars\r\n renderInputComponent, renderSuggestionsContainer, onSuggestionsClearRequested, // eslint-disable-line @typescript-eslint/no-unused-vars\r\n ...props } = this.props;\r\n const inputPlaceholder = (!inputValue) ? placeholder : undefined;\r\n\r\n const inputProps: ReactAutosuggest.InputProps<AutoSuggestData> = {\r\n ...props,\r\n value: inputValue,\r\n onChange: this._onChange,\r\n onFocus: this._onFocus,\r\n placeholder: inputPlaceholder,\r\n autoFocus: setFocus,\r\n };\r\n\r\n return (\r\n // The onKeyDown event handler is only being used to capture bubbled events\r\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\r\n <div className={this.props.className} style={this.props.style} onKeyDown={this._handleKeyDown}>\r\n <ReactAutosuggest\r\n theme={this._theme}\r\n suggestions={suggestions}\r\n onSuggestionsFetchRequested={this._onSuggestionsFetchRequested}\r\n onSuggestionsClearRequested={this._onSuggestionsClearRequested}\r\n getSuggestionValue={this._getSuggestionValue}\r\n renderSuggestion={this._renderSuggestion}\r\n inputProps={inputProps}\r\n onSuggestionSelected={this._onSuggestionSelected}\r\n alwaysRenderSuggestions={alwaysRenderSuggestions}\r\n renderInputComponent={renderInputComponent}\r\n renderSuggestionsContainer={renderSuggestionsContainer}\r\n />\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../../src/core-react/badge/Badge.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,cAAc,CAAC;AAEtB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAI7C;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,WAAW;IAC7C,GAAG,EAAE,GAAG,CAAC;CACV;AAED;;GAEG;AACH,qBAAa,KAAM,SAAQ,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC;IACxC,MAAM,IAAI,GAAG,CAAC,OAAO;
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../../src/core-react/badge/Badge.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,cAAc,CAAC;AAEtB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAI7C;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,WAAW;IAC7C,GAAG,EAAE,GAAG,CAAC;CACV;AAED;;GAEG;AACH,qBAAa,KAAM,SAAQ,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC;IACxC,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO;CAQ5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../../src/core-react/badge/Badge.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,cAAc,CAAC;AACtB,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAS9C;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,KAAK,CAAC,aAAyB;IACxC,MAAM;QACpB,MAAM,QAAQ,GAAG,iBAAiB,CAAC,0BAA0B,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9E,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YACrF,oBAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,CACxB,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\nimport \"./Badge.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { IconSpecUtilities } from \"@itwin/appui-abstract\";\r\nimport { Icon } from \"../icons/IconComponent\";\r\n\r\n/** Properties for the [[Badge]] React component\r\n * @internal\r\n */\r\nexport interface BadgeProps extends CommonProps {\r\n svg: any;\r\n}\r\n\r\n/** Beta Badge React component\r\n * @internal\r\n */\r\nexport class Badge extends React.PureComponent<BadgeProps> {\r\n public override render(): JSX.Element {\r\n const iconSpec = IconSpecUtilities.createWebComponentIconSpec(this.props.svg);\r\n return (\r\n <div className={classnames(\"core-badge\", this.props.className)} style={this.props.style}>\r\n <Icon iconSpec={iconSpec} />\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../../src/core-react/badge/Badge.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,cAAc,CAAC;AACtB,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAS9C;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,KAAK,CAAC,aAAyB;IACxC,MAAM;QACpB,MAAM,QAAQ,GAAG,iBAAiB,CAAC,0BAA0B,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9E,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YACrF,oBAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,CACxB,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\nimport \"./Badge.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { IconSpecUtilities } from \"@itwin/appui-abstract\";\r\nimport { Icon } from \"../icons/IconComponent\";\r\n\r\n/** Properties for the [[Badge]] React component\r\n * @internal\r\n */\r\nexport interface BadgeProps extends CommonProps {\r\n svg: any;\r\n}\r\n\r\n/** Beta Badge React component\r\n * @internal\r\n */\r\nexport class Badge extends React.PureComponent<BadgeProps> {\r\n public override render(): React.JSX.Element {\r\n const iconSpec = IconSpecUtilities.createWebComponentIconSpec(this.props.svg);\r\n return (\r\n <div className={classnames(\"core-badge\", this.props.className)} style={this.props.style}>\r\n <Icon iconSpec={iconSpec} />\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Utilities
|
|
3
3
|
*/
|
|
4
|
-
/// <reference types="react" />
|
|
5
4
|
import "./BetaBadge.scss";
|
|
5
|
+
import * as React from "react";
|
|
6
6
|
import { CommonProps } from "../utils/Props";
|
|
7
7
|
/** Beta Badge React component
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
|
-
export declare function BetaBadge(props: CommonProps): JSX.Element;
|
|
10
|
+
export declare function BetaBadge(props: CommonProps): React.JSX.Element;
|
|
11
11
|
//# sourceMappingURL=BetaBadge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BetaBadge.d.ts","sourceRoot":"","sources":["../../../../src/core-react/badge/BetaBadge.tsx"],"names":[],"mappings":"AAIA;;GAEG
|
|
1
|
+
{"version":3,"file":"BetaBadge.d.ts","sourceRoot":"","sources":["../../../../src/core-react/badge/BetaBadge.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,kBAAkB,CAAC;AAE1B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAI7C;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,qBAS3C"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Utilities
|
|
3
3
|
*/
|
|
4
|
-
/// <reference types="react" />
|
|
5
4
|
import "./NewBadge.scss";
|
|
5
|
+
import * as React from "react";
|
|
6
6
|
import { CommonProps } from "../utils/Props";
|
|
7
7
|
/** New Badge React component
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
|
-
export declare function NewBadge(props: CommonProps): JSX.Element;
|
|
10
|
+
export declare function NewBadge(props: CommonProps): React.JSX.Element;
|
|
11
11
|
//# sourceMappingURL=NewBadge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewBadge.d.ts","sourceRoot":"","sources":["../../../../src/core-react/badge/NewBadge.tsx"],"names":[],"mappings":"AAIA;;GAEG
|
|
1
|
+
{"version":3,"file":"NewBadge.d.ts","sourceRoot":"","sources":["../../../../src/core-react/badge/NewBadge.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,iBAAiB,CAAC;AAEzB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAI7C;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,WAAW,qBAG1C"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Base
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
import * as React from "react";
|
|
5
5
|
import { CommonDivProps } from "../utils/Props";
|
|
6
6
|
/** Centered React functional component.
|
|
7
7
|
* Displays content centered vertically and horizontally.
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
10
|
-
export declare function Centered(props: CommonDivProps): JSX.Element;
|
|
10
|
+
export declare function Centered(props: CommonDivProps): React.JSX.Element;
|
|
11
11
|
//# sourceMappingURL=Centered.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Centered.d.ts","sourceRoot":"","sources":["../../../../src/core-react/base/Centered.tsx"],"names":[],"mappings":"AAIA;;GAEG
|
|
1
|
+
{"version":3,"file":"Centered.d.ts","sourceRoot":"","sources":["../../../../src/core-react/base/Centered.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,cAAc,qBAE7C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Base
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
import * as React from "react";
|
|
5
5
|
import { CommonDivProps } from "../utils/Props";
|
|
6
6
|
/** Properties for the [[Div]] component
|
|
7
7
|
* @public
|
|
@@ -13,5 +13,5 @@ export interface DivProps extends CommonDivProps {
|
|
|
13
13
|
/** Base div element React component
|
|
14
14
|
* @public
|
|
15
15
|
*/
|
|
16
|
-
export declare function Div(props: DivProps): JSX.Element;
|
|
16
|
+
export declare function Div(props: DivProps): React.JSX.Element;
|
|
17
17
|
//# sourceMappingURL=Div.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Div.d.ts","sourceRoot":"","sources":["../../../../src/core-react/base/Div.tsx"],"names":[],"mappings":"AAIA;;GAEG
|
|
1
|
+
{"version":3,"file":"Div.d.ts","sourceRoot":"","sources":["../../../../src/core-react/base/Div.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,QAAS,SAAQ,cAAc;IAC9C,0BAA0B;IAC1B,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,QAAQ,qBAQlC"}
|
|
@@ -19,7 +19,7 @@ export declare const DivWithOutsideClick: {
|
|
|
19
19
|
getParentDocument(): Document;
|
|
20
20
|
componentDidMount(): void;
|
|
21
21
|
componentWillUnmount(): void;
|
|
22
|
-
render(): JSX.Element;
|
|
22
|
+
render(): React.JSX.Element;
|
|
23
23
|
context: any;
|
|
24
24
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<CommonDivProps & import("../hocs/withOnOutsideClick").WithOnOutsideClickProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
25
25
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
@@ -53,7 +53,7 @@ export declare const DivWithOutsideClick: {
|
|
|
53
53
|
getParentDocument(): Document;
|
|
54
54
|
componentDidMount(): void;
|
|
55
55
|
componentWillUnmount(): void;
|
|
56
|
-
render(): JSX.Element;
|
|
56
|
+
render(): React.JSX.Element;
|
|
57
57
|
context: any;
|
|
58
58
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<CommonDivProps & import("../hocs/withOnOutsideClick").WithOnOutsideClickProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
59
59
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Base
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
import * as React from "react";
|
|
5
5
|
import { CommonDivProps } from "../utils/Props";
|
|
6
6
|
/** Full height & width and centered React functional component.
|
|
7
7
|
* Displays content centered vertically and horizontally and has a height and width of 100%.
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
10
|
-
export declare function FillCentered(props: CommonDivProps): JSX.Element;
|
|
10
|
+
export declare function FillCentered(props: CommonDivProps): React.JSX.Element;
|
|
11
11
|
//# sourceMappingURL=FillCentered.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FillCentered.d.ts","sourceRoot":"","sources":["../../../../src/core-react/base/FillCentered.tsx"],"names":[],"mappings":"AAIA;;GAEG
|
|
1
|
+
{"version":3,"file":"FillCentered.d.ts","sourceRoot":"","sources":["../../../../src/core-react/base/FillCentered.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,qBAEjD"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Base
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
import * as React from "react";
|
|
5
5
|
import { CommonDivProps } from "../utils/Props";
|
|
6
6
|
/** Flex Wrap Container React functional component.
|
|
7
7
|
* Wraps content onto multiple lines and
|
|
8
8
|
* has the 'display: flex' and 'flex-wrap: wrap' CSS properties.
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
|
-
export declare function FlexWrapContainer(props: CommonDivProps): JSX.Element;
|
|
11
|
+
export declare function FlexWrapContainer(props: CommonDivProps): React.JSX.Element;
|
|
12
12
|
//# sourceMappingURL=FlexWrapContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlexWrapContainer.d.ts","sourceRoot":"","sources":["../../../../src/core-react/base/FlexWrapContainer.tsx"],"names":[],"mappings":"AAIA;;GAEG
|
|
1
|
+
{"version":3,"file":"FlexWrapContainer.d.ts","sourceRoot":"","sources":["../../../../src/core-react/base/FlexWrapContainer.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,qBAEtD"}
|