@itwin/core-react 4.15.5 → 4.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -1
- package/lib/cjs/core-react/UiCore.d.ts +1 -0
- package/lib/cjs/core-react/UiCore.d.ts.map +1 -1
- package/lib/cjs/core-react/UiCore.js +2 -0
- package/lib/cjs/core-react/UiCore.js.map +1 -1
- package/lib/cjs/core-react/autosuggest/AutoSuggest.d.ts +5 -3
- package/lib/cjs/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
- package/lib/cjs/core-react/autosuggest/AutoSuggest.js +1 -2
- package/lib/cjs/core-react/autosuggest/AutoSuggest.js.map +1 -1
- package/lib/cjs/core-react/badge/Badge.d.ts +3 -2
- package/lib/cjs/core-react/badge/Badge.d.ts.map +1 -1
- package/lib/cjs/core-react/badge/Badge.js +5 -2
- package/lib/cjs/core-react/badge/Badge.js.map +1 -1
- package/lib/cjs/core-react/badge/BadgeType.d.ts +6 -0
- package/lib/cjs/core-react/badge/BadgeType.d.ts.map +1 -1
- package/lib/cjs/core-react/badge/BadgeType.js +2 -1
- package/lib/cjs/core-react/badge/BadgeType.js.map +1 -1
- package/lib/cjs/core-react/badge/DeprecatedBadge.d.ts +10 -0
- package/lib/cjs/core-react/badge/DeprecatedBadge.d.ts.map +1 -0
- package/lib/cjs/core-react/badge/DeprecatedBadge.js +29 -0
- package/lib/cjs/core-react/badge/DeprecatedBadge.js.map +1 -0
- package/lib/cjs/core-react/badge/DeprecatedBadge.scss +11 -0
- package/lib/cjs/core-react/badge/NewBadge.scss +4 -0
- package/lib/cjs/core-react/badge/TechnicalPreviewBadge.js +2 -2
- package/lib/cjs/core-react/badge/TechnicalPreviewBadge.js.map +1 -1
- package/lib/cjs/core-react/badge/TechnicalPreviewBadge.scss +4 -0
- package/lib/cjs/core-react/colorthemes.scss +0 -8
- package/lib/cjs/core-react/contextmenu/ContextMenu.d.ts +3 -6
- package/lib/cjs/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.js +2 -4
- package/lib/cjs/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.scss +5 -6
- package/lib/cjs/core-react/contextmenu/ContextMenuDirection.d.ts +1 -3
- package/lib/cjs/core-react/contextmenu/ContextMenuDirection.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuDirection.js +1 -7
- package/lib/cjs/core-react/contextmenu/ContextMenuDirection.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuDivider.d.ts +2 -2
- package/lib/cjs/core-react/contextmenu/ContextMenuDivider.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuDivider.js +3 -3
- package/lib/cjs/core-react/contextmenu/ContextMenuDivider.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.d.ts +8 -6
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.js +6 -7
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.d.ts +3 -4
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.js +6 -5
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.d.ts +2 -1
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js +1 -0
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/PopupContextMenu.d.ts +2 -0
- package/lib/cjs/core-react/contextmenu/PopupContextMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/PopupContextMenu.js +2 -3
- package/lib/cjs/core-react/contextmenu/PopupContextMenu.js.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.js +0 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/cjs/core-react/enums/CheckBoxState.d.ts +1 -0
- package/lib/cjs/core-react/enums/CheckBoxState.d.ts.map +1 -1
- package/lib/cjs/core-react/enums/CheckBoxState.js +1 -0
- package/lib/cjs/core-react/enums/CheckBoxState.js.map +1 -1
- package/lib/cjs/core-react/enums/Orientation.d.ts +1 -0
- package/lib/cjs/core-react/enums/Orientation.d.ts.map +1 -1
- package/lib/cjs/core-react/enums/Orientation.js +1 -0
- package/lib/cjs/core-react/enums/Orientation.js.map +1 -1
- package/lib/cjs/core-react/enums/TimeFormat.d.ts +1 -0
- package/lib/cjs/core-react/enums/TimeFormat.d.ts.map +1 -1
- package/lib/cjs/core-react/enums/TimeFormat.js +1 -0
- package/lib/cjs/core-react/enums/TimeFormat.js.map +1 -1
- package/lib/cjs/core-react/focus/ItemKeyboardNavigator.d.ts.map +1 -1
- package/lib/cjs/core-react/focus/ItemKeyboardNavigator.js.map +1 -1
- package/lib/cjs/core-react/focustrap/FocusTrap.js +1 -1
- package/lib/cjs/core-react/focustrap/FocusTrap.js.map +1 -1
- package/lib/cjs/core-react/hocs/withOnOutsideClick.d.ts +0 -2
- package/lib/cjs/core-react/hocs/withOnOutsideClick.d.ts.map +1 -1
- package/lib/cjs/core-react/hocs/withOnOutsideClick.js +0 -1
- package/lib/cjs/core-react/hocs/withOnOutsideClick.js.map +1 -1
- package/lib/cjs/core-react/icons/ConditionalIconItem.d.ts +1 -0
- package/lib/cjs/core-react/icons/ConditionalIconItem.d.ts.map +1 -1
- package/lib/cjs/core-react/icons/ConditionalIconItem.js +2 -0
- package/lib/cjs/core-react/icons/ConditionalIconItem.js.map +1 -1
- package/lib/cjs/core-react/icons/IconComponent.d.ts +3 -0
- package/lib/cjs/core-react/icons/IconComponent.d.ts.map +1 -1
- package/lib/cjs/core-react/icons/IconComponent.js +1 -0
- package/lib/cjs/core-react/icons/IconComponent.js.map +1 -1
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.d.ts +0 -1
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.d.ts.map +1 -1
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js +0 -2
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
- package/lib/cjs/core-react/inputs/InputLabel.d.ts.map +1 -1
- package/lib/cjs/core-react/inputs/InputLabel.js +1 -8
- package/lib/cjs/core-react/inputs/InputLabel.js.map +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/l10n/LocalizationProvider.d.ts +1 -0
- package/lib/cjs/core-react/l10n/LocalizationProvider.d.ts.map +1 -1
- package/lib/cjs/core-react/l10n/LocalizationProvider.js +1 -0
- package/lib/cjs/core-react/l10n/LocalizationProvider.js.map +1 -1
- package/lib/cjs/core-react/l10n/useTranslation.d.ts.map +1 -1
- package/lib/cjs/core-react/l10n/useTranslation.js +1 -1
- package/lib/cjs/core-react/l10n/useTranslation.js.map +1 -1
- package/lib/cjs/core-react/listbox/Listbox.d.ts +10 -7
- package/lib/cjs/core-react/listbox/Listbox.d.ts.map +1 -1
- package/lib/cjs/core-react/listbox/Listbox.js +6 -3
- package/lib/cjs/core-react/listbox/Listbox.js.map +1 -1
- package/lib/cjs/core-react/messagebox/MessageBox.d.ts.map +1 -1
- package/lib/cjs/core-react/messagebox/MessageBox.js +2 -9
- package/lib/cjs/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.d.ts +0 -2
- package/lib/cjs/core-react/radialmenu/RadialMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.js +0 -2
- package/lib/cjs/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.scss +3 -3
- package/lib/cjs/core-react/searchbox/SearchBox.d.ts +0 -2
- package/lib/cjs/core-react/searchbox/SearchBox.d.ts.map +1 -1
- package/lib/cjs/core-react/searchbox/SearchBox.js +0 -2
- package/lib/cjs/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/cjs/core-react/settings/SettingsContainer.d.ts +7 -3
- package/lib/cjs/core-react/settings/SettingsContainer.d.ts.map +1 -1
- package/lib/cjs/core-react/settings/SettingsContainer.js +14 -19
- package/lib/cjs/core-react/settings/SettingsContainer.js.map +1 -1
- package/lib/cjs/core-react/settings/SettingsManager.d.ts +3 -1
- package/lib/cjs/core-react/settings/SettingsManager.d.ts.map +1 -1
- package/lib/cjs/core-react/settings/SettingsManager.js +6 -10
- package/lib/cjs/core-react/settings/SettingsManager.js.map +1 -1
- package/lib/cjs/core-react/tabs/Tabs.d.ts +0 -3
- package/lib/cjs/core-react/tabs/Tabs.d.ts.map +1 -1
- package/lib/cjs/core-react/tabs/Tabs.js +0 -4
- package/lib/cjs/core-react/tabs/Tabs.js.map +1 -1
- package/lib/cjs/core-react/tree/ExpansionToggle.d.ts.map +1 -1
- package/lib/cjs/core-react/tree/ExpansionToggle.js +0 -1
- package/lib/cjs/core-react/tree/ExpansionToggle.js.map +1 -1
- package/lib/cjs/core-react/tree/Node.d.ts +2 -0
- package/lib/cjs/core-react/tree/Node.d.ts.map +1 -1
- package/lib/cjs/core-react/tree/Node.js +1 -5
- package/lib/cjs/core-react/tree/Node.js.map +1 -1
- package/lib/cjs/core-react/uistate/LocalStateStorage.d.ts +2 -2
- package/lib/cjs/core-react/uistate/LocalStateStorage.d.ts.map +1 -1
- package/lib/cjs/core-react/uistate/LocalStateStorage.js +3 -4
- package/lib/cjs/core-react/uistate/LocalStateStorage.js.map +1 -1
- package/lib/cjs/core-react/uistate/UiStateEntry.d.ts +1 -0
- package/lib/cjs/core-react/uistate/UiStateEntry.d.ts.map +1 -1
- package/lib/cjs/core-react/uistate/UiStateEntry.js +2 -0
- package/lib/cjs/core-react/uistate/UiStateEntry.js.map +1 -1
- package/lib/cjs/core-react/uistate/UiStateStorage.d.ts +3 -0
- package/lib/cjs/core-react/uistate/UiStateStorage.d.ts.map +1 -1
- package/lib/cjs/core-react/uistate/UiStateStorage.js +1 -0
- package/lib/cjs/core-react/uistate/UiStateStorage.js.map +1 -1
- package/lib/cjs/core-react/utils/IconWebComponent.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/IconWebComponent.js +1 -3
- package/lib/cjs/core-react/utils/IconWebComponent.js.map +1 -1
- package/lib/cjs/core-react/utils/ListenerType.d.ts +15 -0
- package/lib/cjs/core-react/utils/ListenerType.d.ts.map +1 -0
- package/lib/cjs/core-react/utils/ListenerType.js +3 -0
- package/lib/cjs/core-react/utils/ListenerType.js.map +1 -0
- package/lib/cjs/core-react/utils/Rectangle.d.ts +1 -0
- package/lib/cjs/core-react/utils/Rectangle.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/Rectangle.js.map +1 -1
- package/lib/cjs/core-react/utils/Size.d.ts +1 -0
- package/lib/cjs/core-react/utils/Size.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/Size.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.d.ts +1 -0
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js +1 -0
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.d.ts +3 -2
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js +2 -1
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/cjs/core-react.d.ts +5 -0
- package/lib/cjs/core-react.d.ts.map +1 -1
- package/lib/cjs/core-react.js +10 -6
- package/lib/cjs/core-react.js.map +1 -1
- package/lib/esm/core-react/UiCore.d.ts +1 -0
- package/lib/esm/core-react/UiCore.d.ts.map +1 -1
- package/lib/esm/core-react/UiCore.js +2 -0
- package/lib/esm/core-react/UiCore.js.map +1 -1
- package/lib/esm/core-react/autosuggest/AutoSuggest.d.ts +5 -3
- package/lib/esm/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
- package/lib/esm/core-react/autosuggest/AutoSuggest.js +1 -2
- package/lib/esm/core-react/autosuggest/AutoSuggest.js.map +1 -1
- package/lib/esm/core-react/badge/Badge.d.ts +3 -2
- package/lib/esm/core-react/badge/Badge.d.ts.map +1 -1
- package/lib/esm/core-react/badge/Badge.js +5 -2
- package/lib/esm/core-react/badge/Badge.js.map +1 -1
- package/lib/esm/core-react/badge/BadgeType.d.ts +6 -0
- package/lib/esm/core-react/badge/BadgeType.d.ts.map +1 -1
- package/lib/esm/core-react/badge/BadgeType.js +2 -1
- package/lib/esm/core-react/badge/BadgeType.js.map +1 -1
- package/lib/esm/core-react/badge/DeprecatedBadge.d.ts +10 -0
- package/lib/esm/core-react/badge/DeprecatedBadge.d.ts.map +1 -0
- package/lib/esm/core-react/badge/DeprecatedBadge.js +25 -0
- package/lib/esm/core-react/badge/DeprecatedBadge.js.map +1 -0
- package/lib/esm/core-react/badge/DeprecatedBadge.scss +11 -0
- package/lib/esm/core-react/badge/NewBadge.scss +4 -0
- package/lib/esm/core-react/badge/TechnicalPreviewBadge.js +2 -2
- package/lib/esm/core-react/badge/TechnicalPreviewBadge.js.map +1 -1
- package/lib/esm/core-react/badge/TechnicalPreviewBadge.scss +4 -0
- package/lib/esm/core-react/colorthemes.scss +0 -8
- package/lib/esm/core-react/contextmenu/ContextMenu.d.ts +3 -6
- package/lib/esm/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.js +2 -4
- package/lib/esm/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.scss +5 -6
- package/lib/esm/core-react/contextmenu/ContextMenuDirection.d.ts +1 -3
- package/lib/esm/core-react/contextmenu/ContextMenuDirection.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuDirection.js +1 -7
- package/lib/esm/core-react/contextmenu/ContextMenuDirection.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuDivider.d.ts +2 -2
- package/lib/esm/core-react/contextmenu/ContextMenuDivider.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuDivider.js +3 -3
- package/lib/esm/core-react/contextmenu/ContextMenuDivider.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuItem.d.ts +8 -6
- package/lib/esm/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuItem.js +6 -7
- package/lib/esm/core-react/contextmenu/ContextMenuItem.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextSubMenu.d.ts +3 -4
- package/lib/esm/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextSubMenu.js +6 -5
- package/lib/esm/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.d.ts +2 -1
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.js +1 -0
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/PopupContextMenu.d.ts +2 -0
- package/lib/esm/core-react/contextmenu/PopupContextMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/PopupContextMenu.js +2 -3
- package/lib/esm/core-react/contextmenu/PopupContextMenu.js.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.js +0 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/esm/core-react/enums/CheckBoxState.d.ts +1 -0
- package/lib/esm/core-react/enums/CheckBoxState.d.ts.map +1 -1
- package/lib/esm/core-react/enums/CheckBoxState.js +1 -0
- package/lib/esm/core-react/enums/CheckBoxState.js.map +1 -1
- package/lib/esm/core-react/enums/Orientation.d.ts +1 -0
- package/lib/esm/core-react/enums/Orientation.d.ts.map +1 -1
- package/lib/esm/core-react/enums/Orientation.js +1 -0
- package/lib/esm/core-react/enums/Orientation.js.map +1 -1
- package/lib/esm/core-react/enums/TimeFormat.d.ts +1 -0
- package/lib/esm/core-react/enums/TimeFormat.d.ts.map +1 -1
- package/lib/esm/core-react/enums/TimeFormat.js +1 -0
- package/lib/esm/core-react/enums/TimeFormat.js.map +1 -1
- package/lib/esm/core-react/focus/ItemKeyboardNavigator.d.ts.map +1 -1
- package/lib/esm/core-react/focus/ItemKeyboardNavigator.js.map +1 -1
- package/lib/esm/core-react/focustrap/FocusTrap.js +1 -1
- package/lib/esm/core-react/focustrap/FocusTrap.js.map +1 -1
- package/lib/esm/core-react/hocs/withOnOutsideClick.d.ts +0 -2
- package/lib/esm/core-react/hocs/withOnOutsideClick.d.ts.map +1 -1
- package/lib/esm/core-react/hocs/withOnOutsideClick.js +0 -1
- package/lib/esm/core-react/hocs/withOnOutsideClick.js.map +1 -1
- package/lib/esm/core-react/icons/ConditionalIconItem.d.ts +1 -0
- package/lib/esm/core-react/icons/ConditionalIconItem.d.ts.map +1 -1
- package/lib/esm/core-react/icons/ConditionalIconItem.js +2 -0
- package/lib/esm/core-react/icons/ConditionalIconItem.js.map +1 -1
- package/lib/esm/core-react/icons/IconComponent.d.ts +3 -0
- package/lib/esm/core-react/icons/IconComponent.d.ts.map +1 -1
- package/lib/esm/core-react/icons/IconComponent.js +1 -0
- package/lib/esm/core-react/icons/IconComponent.js.map +1 -1
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.d.ts +0 -1
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.d.ts.map +1 -1
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js +0 -2
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
- package/lib/esm/core-react/inputs/InputLabel.d.ts.map +1 -1
- package/lib/esm/core-react/inputs/InputLabel.js +1 -8
- package/lib/esm/core-react/inputs/InputLabel.js.map +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/l10n/LocalizationProvider.d.ts +1 -0
- package/lib/esm/core-react/l10n/LocalizationProvider.d.ts.map +1 -1
- package/lib/esm/core-react/l10n/LocalizationProvider.js +1 -0
- package/lib/esm/core-react/l10n/LocalizationProvider.js.map +1 -1
- package/lib/esm/core-react/l10n/useTranslation.d.ts.map +1 -1
- package/lib/esm/core-react/l10n/useTranslation.js +1 -1
- package/lib/esm/core-react/l10n/useTranslation.js.map +1 -1
- package/lib/esm/core-react/listbox/Listbox.d.ts +10 -7
- package/lib/esm/core-react/listbox/Listbox.d.ts.map +1 -1
- package/lib/esm/core-react/listbox/Listbox.js +6 -3
- package/lib/esm/core-react/listbox/Listbox.js.map +1 -1
- package/lib/esm/core-react/messagebox/MessageBox.d.ts.map +1 -1
- package/lib/esm/core-react/messagebox/MessageBox.js +2 -9
- package/lib/esm/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.d.ts +0 -2
- package/lib/esm/core-react/radialmenu/RadialMenu.d.ts.map +1 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.js +0 -2
- package/lib/esm/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.scss +3 -3
- package/lib/esm/core-react/searchbox/SearchBox.d.ts +0 -2
- package/lib/esm/core-react/searchbox/SearchBox.d.ts.map +1 -1
- package/lib/esm/core-react/searchbox/SearchBox.js +0 -2
- package/lib/esm/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/esm/core-react/settings/SettingsContainer.d.ts +7 -3
- package/lib/esm/core-react/settings/SettingsContainer.d.ts.map +1 -1
- package/lib/esm/core-react/settings/SettingsContainer.js +14 -19
- package/lib/esm/core-react/settings/SettingsContainer.js.map +1 -1
- package/lib/esm/core-react/settings/SettingsManager.d.ts +3 -1
- package/lib/esm/core-react/settings/SettingsManager.d.ts.map +1 -1
- package/lib/esm/core-react/settings/SettingsManager.js +6 -10
- package/lib/esm/core-react/settings/SettingsManager.js.map +1 -1
- package/lib/esm/core-react/tabs/Tabs.d.ts +0 -3
- package/lib/esm/core-react/tabs/Tabs.d.ts.map +1 -1
- package/lib/esm/core-react/tabs/Tabs.js +0 -4
- package/lib/esm/core-react/tabs/Tabs.js.map +1 -1
- package/lib/esm/core-react/tree/ExpansionToggle.d.ts.map +1 -1
- package/lib/esm/core-react/tree/ExpansionToggle.js +0 -1
- package/lib/esm/core-react/tree/ExpansionToggle.js.map +1 -1
- package/lib/esm/core-react/tree/Node.d.ts +2 -0
- package/lib/esm/core-react/tree/Node.d.ts.map +1 -1
- package/lib/esm/core-react/tree/Node.js +1 -5
- package/lib/esm/core-react/tree/Node.js.map +1 -1
- package/lib/esm/core-react/uistate/LocalStateStorage.d.ts +2 -2
- package/lib/esm/core-react/uistate/LocalStateStorage.d.ts.map +1 -1
- package/lib/esm/core-react/uistate/LocalStateStorage.js +3 -4
- package/lib/esm/core-react/uistate/LocalStateStorage.js.map +1 -1
- package/lib/esm/core-react/uistate/UiStateEntry.d.ts +1 -0
- package/lib/esm/core-react/uistate/UiStateEntry.d.ts.map +1 -1
- package/lib/esm/core-react/uistate/UiStateEntry.js +2 -0
- package/lib/esm/core-react/uistate/UiStateEntry.js.map +1 -1
- package/lib/esm/core-react/uistate/UiStateStorage.d.ts +3 -0
- package/lib/esm/core-react/uistate/UiStateStorage.d.ts.map +1 -1
- package/lib/esm/core-react/uistate/UiStateStorage.js +1 -0
- package/lib/esm/core-react/uistate/UiStateStorage.js.map +1 -1
- package/lib/esm/core-react/utils/IconWebComponent.d.ts.map +1 -1
- package/lib/esm/core-react/utils/IconWebComponent.js +1 -3
- package/lib/esm/core-react/utils/IconWebComponent.js.map +1 -1
- package/lib/esm/core-react/utils/ListenerType.d.ts +15 -0
- package/lib/esm/core-react/utils/ListenerType.d.ts.map +1 -0
- package/lib/esm/core-react/utils/ListenerType.js +2 -0
- package/lib/esm/core-react/utils/ListenerType.js.map +1 -0
- package/lib/esm/core-react/utils/Rectangle.d.ts +1 -0
- package/lib/esm/core-react/utils/Rectangle.d.ts.map +1 -1
- package/lib/esm/core-react/utils/Rectangle.js.map +1 -1
- package/lib/esm/core-react/utils/Size.d.ts +1 -0
- package/lib/esm/core-react/utils/Size.d.ts.map +1 -1
- package/lib/esm/core-react/utils/Size.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.d.ts +1 -0
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js +1 -0
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useResizeObserver.d.ts +3 -2
- package/lib/esm/core-react/utils/hooks/useResizeObserver.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js +2 -1
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/esm/core-react.d.ts +5 -0
- package/lib/esm/core-react.d.ts.map +1 -1
- package/lib/esm/core-react.js +6 -2
- package/lib/esm/core-react.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* @module UiStateStorage
|
|
3
3
|
*/
|
|
4
4
|
import type { UiStateStorage, UiStateStorageResult } from "./UiStateStorage";
|
|
5
|
-
/**
|
|
6
|
-
* Implementation of [[UiStateStorage]] using Window.localStorage.
|
|
5
|
+
/** Implementation of [[UiStateStorage]] using Window.localStorage.
|
|
7
6
|
* @public
|
|
7
|
+
* @deprecated in 4.16.0. Use {@link @itwin/appui-react#LocalStateStorage} instead.
|
|
8
8
|
*/
|
|
9
9
|
export declare class LocalStateStorage implements UiStateStorage {
|
|
10
10
|
w: Window;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalStateStorage.d.ts","sourceRoot":"","sources":["../../../../src/core-react/uistate/LocalStateStorage.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"LocalStateStorage.d.ts","sourceRoot":"","sources":["../../../../src/core-react/uistate/LocalStateStorage.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAK7E;;;GAGG;AACH,qBAAa,iBAAkB,YAAW,cAAc;IACnC,CAAC,EAAE,MAAM;gBAAT,CAAC,GAAE,MAAe;IAExB,UAAU,CACrB,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,oBAAoB,CAAC;IAYnB,WAAW,CACtB,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,GAAG,GACX,OAAO,CAAC,oBAAoB,CAAC;IAQnB,UAAU,CACrB,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,OAAO,CAAC;IAON,aAAa,CACxB,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,oBAAoB,CAAC;CAOjC"}
|
|
@@ -6,11 +6,10 @@
|
|
|
6
6
|
* @module UiStateStorage
|
|
7
7
|
*/
|
|
8
8
|
import { UiStateStorageStatus } from "./UiStateStorage";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Implementation of [[UiStateStorage]] using Window.localStorage.
|
|
9
|
+
/* eslint-disable deprecation/deprecation */
|
|
10
|
+
/** Implementation of [[UiStateStorage]] using Window.localStorage.
|
|
13
11
|
* @public
|
|
12
|
+
* @deprecated in 4.16.0. Use {@link @itwin/appui-react#LocalStateStorage} instead.
|
|
14
13
|
*/
|
|
15
14
|
export class LocalStateStorage {
|
|
16
15
|
constructor(w = window) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalStateStorage.js","sourceRoot":"","sources":["../../../../src/core-react/uistate/LocalStateStorage.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,
|
|
1
|
+
{"version":3,"file":"LocalStateStorage.js","sourceRoot":"","sources":["../../../../src/core-react/uistate/LocalStateStorage.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,4CAA4C;AAE5C;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IAC5B,YAAmB,IAAY,MAAM;QAAlB,MAAC,GAAD,CAAC,CAAiB;IAAG,CAAC;IAElC,KAAK,CAAC,UAAU,CACrB,gBAAwB,EACxB,WAAmB;QAEnB,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CACzC,GAAG,gBAAgB,IAAI,WAAW,EAAE,CACrC,CAAC;QACF,IAAI,OAAO,KAAK,IAAI;YAClB,OAAO;gBACL,MAAM,EAAE,oBAAoB,CAAC,OAAO;gBACpC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;aAC7B,CAAC;;YACC,OAAO,EAAE,MAAM,EAAE,oBAAoB,CAAC,QAAQ,EAAE,CAAC;IACxD,CAAC;IAEM,KAAK,CAAC,WAAW,CACtB,gBAAwB,EACxB,WAAmB,EACnB,OAAY;QAEZ,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CACzB,GAAG,gBAAgB,IAAI,WAAW,EAAE,EACpC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CACxB,CAAC;QACF,OAAO,EAAE,MAAM,EAAE,oBAAoB,CAAC,OAAO,EAAE,CAAC;IAClD,CAAC;IAEM,KAAK,CAAC,UAAU,CACrB,gBAAwB,EACxB,WAAmB;QAEnB,MAAM,IAAI,GAAG,GAAG,gBAAgB,IAAI,WAAW,EAAE,CAAC;QAClD,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClD,IAAI,OAAO,KAAK,IAAI;YAAE,OAAO,KAAK,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,aAAa,CACxB,gBAAwB,EACxB,WAAmB;QAEnB,MAAM,IAAI,GAAG,GAAG,gBAAgB,IAAI,WAAW,EAAE,CAAC;QAClD,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClD,IAAI,OAAO,KAAK,IAAI;YAAE,OAAO,EAAE,MAAM,EAAE,oBAAoB,CAAC,QAAQ,EAAE,CAAC;QACvE,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACrC,OAAO,EAAE,MAAM,EAAE,oBAAoB,CAAC,OAAO,EAAE,CAAC;IAClD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module UiStateStorage\n */\n\nimport type { UiStateStorage, UiStateStorageResult } from \"./UiStateStorage\";\nimport { UiStateStorageStatus } from \"./UiStateStorage\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Implementation of [[UiStateStorage]] using Window.localStorage.\n * @public\n * @deprecated in 4.16.0. Use {@link @itwin/appui-react#LocalStateStorage} instead.\n */\nexport class LocalStateStorage implements UiStateStorage {\n constructor(public w: Window = window) {}\n\n public async getSetting(\n settingNamespace: string,\n settingName: string\n ): Promise<UiStateStorageResult> {\n const setting = this.w.localStorage.getItem(\n `${settingNamespace}.${settingName}`\n );\n if (setting !== null)\n return {\n status: UiStateStorageStatus.Success,\n setting: JSON.parse(setting),\n };\n else return { status: UiStateStorageStatus.NotFound };\n }\n\n public async saveSetting(\n settingNamespace: string,\n settingName: string,\n setting: any\n ): Promise<UiStateStorageResult> {\n this.w.localStorage.setItem(\n `${settingNamespace}.${settingName}`,\n JSON.stringify(setting)\n );\n return { status: UiStateStorageStatus.Success };\n }\n\n public async hasSetting(\n settingNamespace: string,\n settingName: string\n ): Promise<boolean> {\n const name = `${settingNamespace}.${settingName}`;\n const setting = this.w.localStorage.getItem(name);\n if (setting === null) return false;\n return true;\n }\n\n public async deleteSetting(\n settingNamespace: string,\n settingName: string\n ): Promise<UiStateStorageResult> {\n const name = `${settingNamespace}.${settingName}`;\n const setting = this.w.localStorage.getItem(name);\n if (setting === null) return { status: UiStateStorageStatus.NotFound };\n this.w.localStorage.removeItem(name);\n return { status: UiStateStorageStatus.Success };\n }\n}\n"]}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import type { UiStateStorage, UiStateStorageResult } from "./UiStateStorage";
|
|
5
5
|
/** A single UI State entry that is identified by namespace and setting name.
|
|
6
6
|
* @public
|
|
7
|
+
* @deprecated in 4.16.0. Use {@link UiStateStorage} APIs instead.
|
|
7
8
|
*/
|
|
8
9
|
export declare class UiStateEntry<T> {
|
|
9
10
|
settingNamespace: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiStateEntry.d.ts","sourceRoot":"","sources":["../../../../src/core-react/uistate/UiStateEntry.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"UiStateEntry.d.ts","sourceRoot":"","sources":["../../../../src/core-react/uistate/UiStateEntry.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAK7E;;;GAGG;AACH,qBAAa,YAAY,CAAC,CAAC;IAShB,gBAAgB,EAAE,MAAM;IACxB,WAAW,EAAE,MAAM;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,OAAM,CAAC,KAAK,IAAI;IAC3B,YAAY,CAAC;IAZtB;;;;;;OAMG;gBAEM,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,CAAC,EACjB,UAAU,CAAC,OAAM,CAAC,KAAK,IAAI,aAAA,EAC3B,YAAY,CAAC,eAAG;IAGzB,+CAA+C;IAClC,UAAU,CACrB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,oBAAoB,CAAC;IAIhC,6EAA6E;IAChE,WAAW,CACtB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,oBAAoB,CAAC;IAQhC,8CAA8C;IACjC,aAAa,CACxB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,oBAAoB,CAAC;IAIhC,iGAAiG;IACpF,uBAAuB,CAClC,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,oBAAoB,CAAC;CAcjC"}
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
* @module UiStateStorage
|
|
7
7
|
*/
|
|
8
8
|
import { UiStateStorageStatus } from "./UiStateStorage";
|
|
9
|
+
/* eslint-disable deprecation/deprecation */
|
|
9
10
|
/** A single UI State entry that is identified by namespace and setting name.
|
|
10
11
|
* @public
|
|
12
|
+
* @deprecated in 4.16.0. Use {@link UiStateStorage} APIs instead.
|
|
11
13
|
*/
|
|
12
14
|
export class UiStateEntry {
|
|
13
15
|
/** Constructor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiStateEntry.js","sourceRoot":"","sources":["../../../../src/core-react/uistate/UiStateEntry.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD
|
|
1
|
+
{"version":3,"file":"UiStateEntry.js","sourceRoot":"","sources":["../../../../src/core-react/uistate/UiStateEntry.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,4CAA4C;AAE5C;;;GAGG;AACH,MAAM,OAAO,YAAY;IACvB;;;;;;OAMG;IACH,YACS,gBAAwB,EACxB,WAAmB,EACnB,QAAiB,EACjB,UAA2B,EAC3B,YAAgB;QAJhB,qBAAgB,GAAhB,gBAAgB,CAAQ;QACxB,gBAAW,GAAX,WAAW,CAAQ;QACnB,aAAQ,GAAR,QAAQ,CAAS;QACjB,eAAU,GAAV,UAAU,CAAiB;QAC3B,iBAAY,GAAZ,YAAY,CAAI;IACtB,CAAC;IAEJ,+CAA+C;IACxC,KAAK,CAAC,UAAU,CACrB,OAAuB;QAEvB,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACrE,CAAC;IAED,6EAA6E;IACtE,KAAK,CAAC,WAAW,CACtB,OAAuB;QAEvB,OAAO,OAAO,CAAC,WAAW,CACxB,IAAI,CAAC,gBAAgB,EACrB,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,QAAQ,EAAE,CAChB,CAAC;IACJ,CAAC;IAED,8CAA8C;IACvC,KAAK,CAAC,aAAa,CACxB,OAAuB;QAEvB,OAAO,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACxE,CAAC;IAED,iGAAiG;IAC1F,KAAK,CAAC,uBAAuB,CAClC,OAAuB;QAEvB,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YAC9C,IAAI,MAAM,CAAC,MAAM,KAAK,oBAAoB,CAAC,OAAO,EAAE,CAAC;gBACnD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAClC,CAAC;iBAAM,IAAI,SAAS,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC;gBAC3C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBACnC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC;gBACnC,MAAM,CAAC,MAAM,GAAG,oBAAoB,CAAC,OAAO,CAAC;YAC/C,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAAC;IACxD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module UiStateStorage\n */\n\nimport type { UiStateStorage, UiStateStorageResult } from \"./UiStateStorage\";\nimport { UiStateStorageStatus } from \"./UiStateStorage\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** A single UI State entry that is identified by namespace and setting name.\n * @public\n * @deprecated in 4.16.0. Use {@link UiStateStorage} APIs instead.\n */\nexport class UiStateEntry<T> {\n /** Constructor\n * @param settingNamespace Namespace for the setting, passed to UiStateStorage.\n * @param settingName Name for the setting, passed to UiStateStorage.\n * @param getValue Function for getting the value from the application.\n * @param applyValue Function for applying the setting value to the application.\n * @param defaultValue Optional default value if not already stored.\n */\n public constructor(\n public settingNamespace: string,\n public settingName: string,\n public getValue: () => T,\n public applyValue?: (v: T) => void,\n public defaultValue?: T\n ) {}\n\n /** Gets the setting from [[UiStateStorage]] */\n public async getSetting(\n storage: UiStateStorage\n ): Promise<UiStateStorageResult> {\n return storage.getSetting(this.settingNamespace, this.settingName);\n }\n\n /** Saves the setting value from the `getValue` function to UiStateStorage */\n public async saveSetting(\n storage: UiStateStorage\n ): Promise<UiStateStorageResult> {\n return storage.saveSetting(\n this.settingNamespace,\n this.settingName,\n this.getValue()\n );\n }\n\n /** Deletes the setting from UiStateStorage */\n public async deleteSetting(\n storage: UiStateStorage\n ): Promise<UiStateStorageResult> {\n return storage.deleteSetting(this.settingNamespace, this.settingName);\n }\n\n /** Gets the setting from UiStateStorage and applies the value using the `applyValue` function */\n public async getSettingAndApplyValue(\n storage: UiStateStorage\n ): Promise<UiStateStorageResult> {\n if (this.applyValue) {\n const result = await this.getSetting(storage);\n if (result.status === UiStateStorageStatus.Success) {\n this.applyValue(result.setting);\n } else if (undefined !== this.defaultValue) {\n this.applyValue(this.defaultValue);\n result.setting = this.defaultValue;\n result.status = UiStateStorageStatus.Success;\n }\n return result;\n }\n return { status: UiStateStorageStatus.Uninitialized };\n }\n}\n"]}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/** Interface for getting, saving and deleting settings.
|
|
5
5
|
* @public
|
|
6
|
+
* @deprecated in 4.16.0. Use {@link @itwin/appui-react#UiStateStorage} instead.
|
|
6
7
|
*/
|
|
7
8
|
export interface UiStateStorage {
|
|
8
9
|
getSetting(settingNamespace: string, settingName: string): Promise<UiStateStorageResult>;
|
|
@@ -11,6 +12,7 @@ export interface UiStateStorage {
|
|
|
11
12
|
}
|
|
12
13
|
/** Enum for [[UiStateStorage]] status.
|
|
13
14
|
* @public
|
|
15
|
+
* @deprecated in 4.16.0. Use {@link @itwin/appui-react#UiStateStorageStatus} instead.
|
|
14
16
|
*/
|
|
15
17
|
export declare enum UiStateStorageStatus {
|
|
16
18
|
Success = 0,
|
|
@@ -21,6 +23,7 @@ export declare enum UiStateStorageStatus {
|
|
|
21
23
|
}
|
|
22
24
|
/** Interface for result of accessing UI state setting in [[UiStateStorage]].
|
|
23
25
|
* @public
|
|
26
|
+
* @deprecated in 4.16.0. Use {@link @itwin/appui-react#UiStateStorageResult} instead.
|
|
24
27
|
*/
|
|
25
28
|
export interface UiStateStorageResult {
|
|
26
29
|
status: UiStateStorageStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiStateStorage.d.ts","sourceRoot":"","sources":["../../../../src/core-react/uistate/UiStateStorage.ts"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"UiStateStorage.d.ts","sourceRoot":"","sources":["../../../../src/core-react/uistate/UiStateStorage.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,CACR,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACjC,WAAW,CACT,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,GAAG,GACX,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACjC,aAAa,CACX,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,oBAAY,oBAAoB;IAC9B,OAAO,IAAI;IACX,QAAQ,IAAI;IACZ,YAAY,IAAI;IAChB,aAAa,IAAI;IACjB,kBAAkB,IAAI;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,OAAO,CAAC,EAAE,GAAG,CAAC;CACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiStateStorage.js","sourceRoot":"","sources":["../../../../src/core-react/uistate/UiStateStorage.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;
|
|
1
|
+
{"version":3,"file":"UiStateStorage.js","sourceRoot":"","sources":["../../../../src/core-react/uistate/UiStateStorage.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAwBH;;;GAGG;AACH,MAAM,CAAN,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC9B,qEAAW,CAAA;IACX,uEAAY,CAAA;IACZ,+EAAgB,CAAA;IAChB,iFAAiB,CAAA;IACjB,2FAAsB,CAAA;AACxB,CAAC,EANW,oBAAoB,KAApB,oBAAoB,QAM/B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module UiStateStorage\n */\n\n/* eslint-disable deprecation/deprecation */\n\n/** Interface for getting, saving and deleting settings.\n * @public\n * @deprecated in 4.16.0. Use {@link @itwin/appui-react#UiStateStorage} instead.\n */\nexport interface UiStateStorage {\n getSetting(\n settingNamespace: string,\n settingName: string\n ): Promise<UiStateStorageResult>;\n saveSetting(\n settingNamespace: string,\n settingName: string,\n setting: any\n ): Promise<UiStateStorageResult>;\n deleteSetting(\n settingNamespace: string,\n settingName: string\n ): Promise<UiStateStorageResult>;\n}\n\n/** Enum for [[UiStateStorage]] status.\n * @public\n * @deprecated in 4.16.0. Use {@link @itwin/appui-react#UiStateStorageStatus} instead.\n */\nexport enum UiStateStorageStatus {\n Success = 0,\n NotFound = 1,\n UnknownError = 2,\n Uninitialized = 3,\n AuthorizationError = 4,\n}\n\n/** Interface for result of accessing UI state setting in [[UiStateStorage]].\n * @public\n * @deprecated in 4.16.0. Use {@link @itwin/appui-react#UiStateStorageResult} instead.\n */\nexport interface UiStateStorageResult {\n status: UiStateStorageStatus;\n setting?: any;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconWebComponent.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/IconWebComponent.ts"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"IconWebComponent.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/IconWebComponent.ts"],"names":[],"mappings":"AAIA;;GAEG;AA+FH;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;YACjC,iBAAiB;YAKjB,OAAO;CAetB;AAED,gBAAgB;AAChB,wBAAgB,wBAAwB,SAGvC"}
|
|
@@ -10,6 +10,7 @@ import { Logger } from "@itwin/core-bentley";
|
|
|
10
10
|
import { UiCore } from "../UiCore";
|
|
11
11
|
import DOMPurify, * as DOMPurifyNS from "dompurify";
|
|
12
12
|
import { reuseOrCreatePromise } from "./reuseOrCreatePromise";
|
|
13
|
+
/* eslint-disable deprecation/deprecation */
|
|
13
14
|
/**
|
|
14
15
|
* "getSvg" list
|
|
15
16
|
* (if multiple icon require the same thing,
|
|
@@ -46,7 +47,6 @@ function parseSvgFromDataUri(src, element) {
|
|
|
46
47
|
const parsedSvg = new window.DOMParser().parseFromString(sanitizedSvg, "text/xml");
|
|
47
48
|
const errorNode = parsedSvg.querySelector("parsererror");
|
|
48
49
|
if (errorNode || "svg" !== parsedSvg.documentElement.nodeName.toLowerCase()) {
|
|
49
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
50
50
|
throw new UiError(UiCore.loggerCategory(element), "Unable to load icon.");
|
|
51
51
|
}
|
|
52
52
|
return parsedSvg.documentElement;
|
|
@@ -62,12 +62,10 @@ async function fetchSvg(src, element) {
|
|
|
62
62
|
Logger.logError(UiCore.loggerCategory(element), "Unable to load icon.");
|
|
63
63
|
});
|
|
64
64
|
if (!response || !response.ok) {
|
|
65
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
66
65
|
throw new UiError(UiCore.loggerCategory(element), "Unable to load icon.");
|
|
67
66
|
}
|
|
68
67
|
const str = await response.text();
|
|
69
68
|
if (str === undefined) {
|
|
70
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
71
69
|
throw new UiError(UiCore.loggerCategory(element), "Unable to load icon.");
|
|
72
70
|
}
|
|
73
71
|
const data = new window.DOMParser().parseFromString(str, "text/xml");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconWebComponent.js","sourceRoot":"","sources":["../../../../src/core-react/utils/IconWebComponent.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,SAAS,EAAE,KAAK,WAAW,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;GAIG;AACH,MAAM,KAAK,GAAG,IAAI,GAAG,EAAwB,CAAC;AAE9C;;;;;GAKG;AACH,SAAS,mBAAmB,CAAC,GAAW,EAAE,OAAY;IACpD,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEpC,IACE,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC;QACxB,2BAA2B,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC;QAClD,CAAC,2BAA2B,KAAK,YAAY,CAAC,CAAC,CAAC;YAC9C,oBAAoB,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC,EAC3C,CAAC;QACD,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,sBAAsB,CAAC,CAAC;QACxE,OAAO;IACT,CAAC;IAED,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,2BAA2B,KAAK,YAAY,CAAC,CAA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QACrB,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,CAAC;IAEO,KAAK,CAAC,OAAO;QACnB,qDAAqD;QACrD,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM;YAAE,OAAO;QACnC,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAC3C,IAAI,CAAC,GAAG;YAAE,OAAO;QAEjB,MAAM,GAAG,GAAG,MAAM,oBAAoB,CACpC,GAAG,EACH,KAAK,IAAI,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,EAC7B,KAAK,CACN,CAAC;QACF,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;YACnC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;CACF;AAED,gBAAgB;AAChB,MAAM,UAAU,wBAAwB;IACtC,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,SAAS;QACvD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;AACjE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n\nimport { UiError } from \"@itwin/appui-abstract\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { UiCore } from \"../UiCore\";\nimport DOMPurify, * as DOMPurifyNS from \"dompurify\";\nimport { reuseOrCreatePromise } from \"./reuseOrCreatePromise\";\n\n/* eslint-disable deprecation/deprecation */\n\n/**\n * \"getSvg\" list\n * (if multiple icon require the same thing,\n * only do the fetch once, and have all icon use the same result)\n */\nconst cache = new Map<string, Promise<any>>();\n\n/**\n * Parse 'data:' uri to retrieve the Svg component within it.\n * @param src data:image/svg+xml;base64 or data:image/svg+xml\n * @param element Element for logging purpose.\n * @returns HTMLElement (svg)\n */\nfunction parseSvgFromDataUri(src: string, element: any) {\n const dataUriParts = src.split(\",\");\n\n if (\n (dataUriParts.length !== 2 &&\n \"data:image/svg+xml;base64\" === dataUriParts[0]) ||\n (\"data:image/svg+xml;base64\" !== dataUriParts[0] &&\n \"data:image/svg+xml\" !== dataUriParts[0])\n ) {\n Logger.logError(UiCore.loggerCategory(element), \"Unable to load icon.\");\n return;\n }\n\n let rawSvg = \"\";\n if (\"data:image/svg+xml;base64\" === dataUriParts[0]) {\n rawSvg = window.atob(dataUriParts[1]);\n } else {\n // `,` is valid character in data when not in base64, rebuild the data correctly\n rawSvg = decodeURIComponent(dataUriParts.slice(1).join(\",\"));\n }\n\n // the esm build of dompurify has a default import but the cjs build does not\n // if there is a default export, use it (likely esm), otherwise use the namespace\n const sanitizer = DOMPurify ?? DOMPurifyNS;\n const sanitizedSvg = sanitizer.sanitize(rawSvg);\n\n const parsedSvg = new window.DOMParser().parseFromString(\n sanitizedSvg,\n \"text/xml\"\n );\n const errorNode = parsedSvg.querySelector(\"parsererror\");\n if (errorNode || \"svg\" !== parsedSvg.documentElement.nodeName.toLowerCase()) {\n throw new UiError(UiCore.loggerCategory(element), \"Unable to load icon.\");\n }\n\n return parsedSvg.documentElement;\n}\n\n/**\n * Fetch the src from the network and return the SVG element.\n * @param src URL representing a .svg file\n * @param element Element for logging purpose\n * @returns HTMLElement (svg)\n */\nasync function fetchSvg(src: string, element: any) {\n const response = await fetch(src).catch((_error) => {\n Logger.logError(UiCore.loggerCategory(element), \"Unable to load icon.\");\n });\n if (!response || !response.ok) {\n throw new UiError(UiCore.loggerCategory(element), \"Unable to load icon.\");\n }\n const str = await response.text();\n if (str === undefined) {\n throw new UiError(UiCore.loggerCategory(element), \"Unable to load icon.\");\n }\n const data = new window.DOMParser().parseFromString(str, \"text/xml\");\n return data.documentElement;\n}\n\n/**\n * Get the svg (fetch and parse for url, or decode and parse for data: url)\n * @param src URL of the content to download/parse\n * @param element Element for logging purpose.\n * @returns HTMLElement (svg)\n */\nasync function getSvg(src: string, element: any) {\n if (src.startsWith(\"data:\")) {\n return parseSvgFromDataUri(src, element);\n }\n return fetchSvg(src, element);\n}\n\n/** IconWebComponent loads icon from an svg path\n * @internal\n */\nexport class IconWebComponent extends HTMLElement {\n private async connectedCallback() {\n await this.loadSvg();\n this.dispatchEvent(new CustomEvent(\"load\"));\n }\n\n private async loadSvg() {\n // if svg was already appended don't request it again\n if (this.childNodes.length) return;\n const src = this.getAttribute(\"src\") || \"\";\n if (!src) return;\n\n const svg = await reuseOrCreatePromise(\n src,\n async () => getSvg(src, this),\n cache\n );\n if (svg && !this.childNodes.length) {\n this.append(svg.cloneNode(true));\n }\n }\n}\n\n/** @internal */\nexport function registerIconWebComponent() {\n if (window.customElements.get(\"svg-loader\") === undefined)\n window.customElements.define(\"svg-loader\", IconWebComponent);\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Utilities
|
|
3
|
+
*/
|
|
4
|
+
import type { Listener } from "@itwin/core-bentley";
|
|
5
|
+
/**
|
|
6
|
+
* Retrieves the type of the callback function for an event type like `BeEvent`.
|
|
7
|
+
* @note `ListenerType` is available in `@itwin/core-bentley@^4.8.0`
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export type ListenerType<TEvent extends {
|
|
11
|
+
addListener(listener: Listener): () => void;
|
|
12
|
+
}> = TEvent extends {
|
|
13
|
+
addListener(listener: infer TListener): () => void;
|
|
14
|
+
} ? TListener : never;
|
|
15
|
+
//# sourceMappingURL=ListenerType.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListenerType.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/ListenerType.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,MAAM,YAAY,CACtB,MAAM,SAAS;IACb,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,IAAI,CAAC;CAC7C,IACC,MAAM,SAAS;IACjB,WAAW,CAAC,QAAQ,EAAE,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC;CACpD,GACG,SAAS,GACT,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListenerType.js","sourceRoot":"","sources":["../../../../src/core-react/utils/ListenerType.ts"],"names":[],"mappings":"","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\nimport type { Listener } from \"@itwin/core-bentley\";\n\n/**\n * Retrieves the type of the callback function for an event type like `BeEvent`.\n * @note `ListenerType` is available in `@itwin/core-bentley@^4.8.0`\n * @internal\n */\nexport type ListenerType<\n TEvent extends {\n addListener(listener: Listener): () => void;\n }\n> = TEvent extends {\n addListener(listener: infer TListener): () => void;\n}\n ? TListener\n : never;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rectangle.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/Rectangle.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"Rectangle.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/Rect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YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,EAAE,IAAI,CAAC,GAAG;SACd,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n\nimport { Point } from \"./Point\";\nimport type { PointProps } from \"./PointProps\";\nimport type { SizeProps } from \"./Size\";\nimport { Size } from \"./Size\";\nimport { UiGeometry } from \"./UiGeometry\";\n\n/** Describes 2d bounds.\n * @public\n */\nexport interface RectangleProps {\n readonly left: number;\n readonly top: number;\n readonly right: number;\n readonly bottom: number;\n}\n\n/** Available corners of [[Rectangle]].\n * @internal\n */\nexport enum Corner {\n TopLeft,\n TopRight,\n BottomRight,\n BottomLeft,\n}\n\n/** Describes and provides methods to work with 2d bounds.\n * @internal\n */\nexport class Rectangle implements RectangleProps {\n /** Creates rectangle from [[RectangleProps]]. */\n public static create(props: RectangleProps): Rectangle {\n return new Rectangle(props.left, props.top, props.right, props.bottom);\n }\n\n /** Creates rectangle from [[SizeProps]]. */\n public static createFromSize(size: SizeProps): Rectangle {\n return new Rectangle(0, 0, size.width, size.height);\n }\n\n /** Create a rectangle with 2 pairs of xy candidates. Theses are compared and shuffled as needed for the rectangle. */\n public static createXYXY(\n xA: number,\n yA: number,\n xB: number,\n yB: number\n ): Rectangle {\n return new Rectangle(\n Math.min(xA, xB),\n Math.min(yA, yB),\n Math.max(xA, xB),\n Math.max(yA, yB)\n );\n }\n\n /** Creates rectangle with specified bounds. */\n public constructor(\n public readonly left = 0,\n public readonly top = 0,\n public readonly right = 0,\n public readonly bottom = 0\n ) {}\n\n /** @returns Size of this rectangle. */\n public getSize(): Size {\n const width = this.getWidth();\n const height = this.getHeight();\n return new Size(width, height);\n }\n\n /** @returns Width of this rectangle. */\n public getWidth(): number {\n return this.right - this.left;\n }\n\n /** @returns Height of this rectangle. */\n public getHeight(): number {\n return this.bottom - this.top;\n }\n\n /** @returns Position of specified corner. */\n public getCorner(corner: Corner): Point {\n switch (corner) {\n case Corner.TopLeft: {\n return this.topLeft();\n }\n case Corner.TopRight: {\n return new Point(this.right, this.top);\n }\n case Corner.BottomLeft: {\n return new Point(this.left, this.bottom);\n }\n case Corner.BottomRight: {\n return new Point(this.right, this.bottom);\n }\n }\n }\n\n /**\n * Inset the bounds of this rectangle.\n * @note Negative arguments will increase the size of rectangle.\n * @returns New [[Rectangle]] with modified bounds.\n */\n public inset(\n left: number,\n top: number,\n right: number,\n bottom: number\n ): Rectangle {\n return new Rectangle(\n this.left + left,\n this.top + top,\n this.right - right,\n this.bottom - bottom\n );\n }\n\n /**\n * Offsets the rectangle along the X and Y axes.\n * @returns New [[Rectangle]] with modified position.\n */\n public offset(offset: PointProps): Rectangle {\n return new Rectangle(\n this.left + offset.x,\n this.top + offset.y,\n this.right + offset.x,\n this.bottom + offset.y\n );\n }\n\n /**\n * Offsets the rectangle along the X axis.\n * @returns New [[Rectangle]] with modified position along X axis.\n */\n public offsetX(offset: number): Rectangle {\n return new Rectangle(\n this.left + offset,\n this.top,\n this.right + offset,\n this.bottom\n );\n }\n\n /**\n * Offsets the rectangle along the Y axis.\n * @returns New [[Rectangle]] with modified position along Y axis.\n */\n public offsetY(offset: number): Rectangle {\n return new Rectangle(\n this.left,\n this.top + offset,\n this.right,\n this.bottom + offset\n );\n }\n\n /**\n * Moves the top left corner of rectangle to specified point.\n * @returns New [[Rectangle]] with modified position.\n */\n public setPosition(position: PointProps): Rectangle {\n return new Rectangle(\n position.x,\n position.y,\n position.x + this.getWidth(),\n position.y + this.getHeight()\n );\n }\n\n /**\n * Sets the height of the rectangle.\n * @note Only [[Edge.Bottom]] is subject to change.\n * @returns New [[Rectangle]] with modified height.\n */\n public setHeight(height: number): Rectangle {\n return new Rectangle(this.left, this.top, this.right, this.top + height);\n }\n\n /**\n * Sets the width of the rectangle.\n * @note Only [[Edge.Right]] is subject to change.\n * @returns New [[Rectangle]] with modified width.\n */\n public setWidth(width: number): Rectangle {\n return new Rectangle(this.left, this.top, this.left + width, this.bottom);\n }\n\n /**\n * Sets the height and width of the rectangle.\n * @note Only [[Edge.Bottom]] and [[Edge.Right]] are subjects to change.\n * @returns New [[Rectangle]] with modified height.\n */\n public setSize(size: SizeProps): Rectangle {\n return new Rectangle(\n this.left,\n this.top,\n this.left + size.width,\n this.top + size.height\n );\n }\n\n /** Checks if bounds of two rectangles match. */\n public equals(other: RectangleProps): boolean {\n if (\n this.left === other.left &&\n this.top === other.top &&\n this.right === other.right &&\n this.bottom === other.bottom\n )\n return true;\n\n return false;\n }\n\n /**\n * Checks if point is within bounds of the rectangle.\n * @note Inclusive.\n */\n public containsPoint(point: PointProps): boolean {\n return (\n point.x >= this.left &&\n point.x <= this.right &&\n point.y >= this.top &&\n point.y <= this.bottom\n );\n }\n\n /**\n * Checks if a point given as x,y is within the rectangle.\n * @note Inclusive.\n */\n public containsXY(x: number, y: number): boolean {\n return this.containsPoint({ x, y });\n }\n\n /**\n * @returns true if this rectangle contains other rectangle.\n * @note Inclusive.\n */\n public contains(other: RectangleProps): boolean {\n return (\n other.left >= this.left &&\n other.right <= this.right &&\n other.top >= this.top &&\n other.bottom <= this.bottom\n );\n }\n\n /** @returns New [[Rectangle]] which is contained in other rectangle. */\n public containIn(other: RectangleProps): Rectangle {\n let contained: Rectangle = this.containVerticallyIn(other);\n contained = contained.containHorizontallyIn(other);\n return contained;\n }\n\n /** @returns New [[Rectangle]] which is vertically contained in other rectangle. */\n public containVerticallyIn(other: RectangleProps): Rectangle {\n const contained = this.offsetY(Math.min(other.bottom - this.bottom, 0));\n return contained.offsetY(Math.max(other.top - contained.top, 0));\n }\n\n /** @returns New [[Rectangle]] which is horizontally contained in other rectangle. */\n public containHorizontallyIn(other: RectangleProps): Rectangle {\n const contained = this.offsetX(Math.min(other.right - this.right, 0));\n return contained.offsetX(Math.max(other.left - contained.left, 0));\n }\n\n /** @returns [[Corner.TopLeft]] position of this rectangle. */\n public topLeft(): Point {\n return new Point(this.left, this.top);\n }\n\n /** @returns Center point position of this rectangle. */\n public center(): Point {\n const x = this.left + (this.right - this.left) / 2;\n const y = this.top + (this.bottom - this.top) / 2;\n return new Point(x, y);\n }\n\n /** @returns true if this rectangle intersects other rectangle. */\n public intersects(other: RectangleProps): boolean {\n return (\n this.left < other.right &&\n this.right > other.left &&\n this.top < other.bottom &&\n this.bottom > other.top\n );\n }\n\n /**\n * Merges outer edges of this and other rectangles.\n * @returns New [[Rectangle]] with merged bounds.\n */\n public outerMergeWith(other: RectangleProps): Rectangle {\n const left = Math.min(this.left, other.left);\n const top = Math.min(this.top, other.top);\n const right = Math.max(this.right, other.right);\n const bottom = Math.max(this.bottom, other.bottom);\n return new Rectangle(left, top, right, bottom);\n }\n\n /**\n * Vertically divides this rectangle into specified number of equal height segments.\n * @returns Vertical rectangle segment.\n */\n public getVerticalSegmentBounds(\n segmentId: number,\n numberOfSegments: number\n ): Rectangle {\n const segmentHeight = this.getHeight() / numberOfSegments;\n\n const top = segmentId * segmentHeight;\n return this.inset(0, top, 0, 0).setHeight(segmentHeight);\n }\n\n /**\n * Horizontally divides this rectangle into specified number of equal width segments.\n * @returns Horizontal rectangle segment.\n */\n public getHorizontalSegmentBounds(\n segmentId: number,\n numberOfSegments: number\n ): Rectangle {\n const segmentWidth = this.getWidth() / numberOfSegments;\n\n const left = segmentId * segmentWidth;\n return this.inset(left, 0, 0, 0).setWidth(segmentWidth);\n }\n\n /**\n * Calculates the shortest distance between this rectangle and a given point.\n * @returns The shortest distance to a point.\n */\n public getShortestDistanceToPoint(point: PointProps): number {\n let shortestDistance = 0;\n\n if (point.x < this.left) {\n if (point.y < this.top)\n shortestDistance = UiGeometry.hypotenuseXY(\n this.left - point.x,\n this.top - point.y\n );\n else if (point.y <= this.bottom) shortestDistance = this.left - point.x;\n else\n shortestDistance = UiGeometry.hypotenuseXY(\n this.left - point.x,\n this.bottom - point.y\n );\n } else if (point.x <= this.right) {\n if (point.y < this.top) shortestDistance = this.top - point.y;\n else if (point.y <= this.bottom) shortestDistance = 0;\n else shortestDistance = point.y - this.bottom;\n } else {\n if (point.y < this.top)\n shortestDistance = UiGeometry.hypotenuseXY(\n this.right - point.x,\n this.top - point.y\n );\n else if (point.y <= this.bottom) shortestDistance = point.x - this.right;\n else\n shortestDistance = UiGeometry.hypotenuseXY(\n this.right - point.x,\n this.bottom - point.y\n );\n }\n\n return shortestDistance;\n }\n\n /** @returns [[RectangleProps]] object for this rectangle. */\n public toProps(): RectangleProps {\n return {\n bottom: this.bottom,\n left: this.left,\n right: this.right,\n top: this.top,\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Rectangle.js","sourceRoot":"","sources":["../../../../src/core-react/utils/Rectangle.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAe1C;;GAEG;AACH,MAAM,CAAN,IAAY,MAKX;AALD,WAAY,MAAM;IAChB,yCAAO,CAAA;IACP,2CAAQ,CAAA;IACR,iDAAW,CAAA;IACX,+CAAU,CAAA;AACZ,CAAC,EALW,MAAM,KAAN,MAAM,QAKjB;AAED;;GAEG;AACH,MAAM,OAAO,SAAS;IACpB,iDAAiD;IAC1C,MAAM,CAAC,MAAM,CAAC,KAAqB;QACxC,OAAO,IAAI,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzE,CAAC;IAED,4CAA4C;IACrC,MAAM,CAAC,cAAc,CAAC,IAAe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AU,CAAC,YAAY,CACxC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,EACpB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CACtB,CAAC;QACN,CAAC;QAED,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,6DAA6D;IACtD,OAAO;QACZ,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,EAAE,IAAI,CAAC,GAAG;SACd,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n\nimport { Point } from \"./Point\";\nimport type { PointProps } from \"./PointProps\";\nimport type { SizeProps } from \"./Size\";\nimport { Size } from \"./Size\";\nimport { UiGeometry } from \"./UiGeometry\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Describes 2d bounds.\n * @public\n * @deprecated in 4.16.0. Use {@link @itwin/appui-react#RectangleProps} instead.\n */\nexport interface RectangleProps {\n readonly left: number;\n readonly top: number;\n readonly right: number;\n readonly bottom: number;\n}\n\n/** Available corners of [[Rectangle]].\n * @internal\n */\nexport enum Corner {\n TopLeft,\n TopRight,\n BottomRight,\n BottomLeft,\n}\n\n/** Describes and provides methods to work with 2d bounds.\n * @internal\n */\nexport class Rectangle implements RectangleProps {\n /** Creates rectangle from [[RectangleProps]]. */\n public static create(props: RectangleProps): Rectangle {\n return new Rectangle(props.left, props.top, props.right, props.bottom);\n }\n\n /** Creates rectangle from [[SizeProps]]. */\n public static createFromSize(size: SizeProps): Rectangle {\n return new Rectangle(0, 0, size.width, size.height);\n }\n\n /** Create a rectangle with 2 pairs of xy candidates. Theses are compared and shuffled as needed for the rectangle. */\n public static createXYXY(\n xA: number,\n yA: number,\n xB: number,\n yB: number\n ): Rectangle {\n return new Rectangle(\n Math.min(xA, xB),\n Math.min(yA, yB),\n Math.max(xA, xB),\n Math.max(yA, yB)\n );\n }\n\n /** Creates rectangle with specified bounds. */\n public constructor(\n public readonly left = 0,\n public readonly top = 0,\n public readonly right = 0,\n public readonly bottom = 0\n ) {}\n\n /** @returns Size of this rectangle. */\n public getSize(): Size {\n const width = this.getWidth();\n const height = this.getHeight();\n return new Size(width, height);\n }\n\n /** @returns Width of this rectangle. */\n public getWidth(): number {\n return this.right - this.left;\n }\n\n /** @returns Height of this rectangle. */\n public getHeight(): number {\n return this.bottom - this.top;\n }\n\n /** @returns Position of specified corner. */\n public getCorner(corner: Corner): Point {\n switch (corner) {\n case Corner.TopLeft: {\n return this.topLeft();\n }\n case Corner.TopRight: {\n return new Point(this.right, this.top);\n }\n case Corner.BottomLeft: {\n return new Point(this.left, this.bottom);\n }\n case Corner.BottomRight: {\n return new Point(this.right, this.bottom);\n }\n }\n }\n\n /**\n * Inset the bounds of this rectangle.\n * @note Negative arguments will increase the size of rectangle.\n * @returns New [[Rectangle]] with modified bounds.\n */\n public inset(\n left: number,\n top: number,\n right: number,\n bottom: number\n ): Rectangle {\n return new Rectangle(\n this.left + left,\n this.top + top,\n this.right - right,\n this.bottom - bottom\n );\n }\n\n /**\n * Offsets the rectangle along the X and Y axes.\n * @returns New [[Rectangle]] with modified position.\n */\n public offset(offset: PointProps): Rectangle {\n return new Rectangle(\n this.left + offset.x,\n this.top + offset.y,\n this.right + offset.x,\n this.bottom + offset.y\n );\n }\n\n /**\n * Offsets the rectangle along the X axis.\n * @returns New [[Rectangle]] with modified position along X axis.\n */\n public offsetX(offset: number): Rectangle {\n return new Rectangle(\n this.left + offset,\n this.top,\n this.right + offset,\n this.bottom\n );\n }\n\n /**\n * Offsets the rectangle along the Y axis.\n * @returns New [[Rectangle]] with modified position along Y axis.\n */\n public offsetY(offset: number): Rectangle {\n return new Rectangle(\n this.left,\n this.top + offset,\n this.right,\n this.bottom + offset\n );\n }\n\n /**\n * Moves the top left corner of rectangle to specified point.\n * @returns New [[Rectangle]] with modified position.\n */\n public setPosition(position: PointProps): Rectangle {\n return new Rectangle(\n position.x,\n position.y,\n position.x + this.getWidth(),\n position.y + this.getHeight()\n );\n }\n\n /**\n * Sets the height of the rectangle.\n * @note Only [[Edge.Bottom]] is subject to change.\n * @returns New [[Rectangle]] with modified height.\n */\n public setHeight(height: number): Rectangle {\n return new Rectangle(this.left, this.top, this.right, this.top + height);\n }\n\n /**\n * Sets the width of the rectangle.\n * @note Only [[Edge.Right]] is subject to change.\n * @returns New [[Rectangle]] with modified width.\n */\n public setWidth(width: number): Rectangle {\n return new Rectangle(this.left, this.top, this.left + width, this.bottom);\n }\n\n /**\n * Sets the height and width of the rectangle.\n * @note Only [[Edge.Bottom]] and [[Edge.Right]] are subjects to change.\n * @returns New [[Rectangle]] with modified height.\n */\n public setSize(size: SizeProps): Rectangle {\n return new Rectangle(\n this.left,\n this.top,\n this.left + size.width,\n this.top + size.height\n );\n }\n\n /** Checks if bounds of two rectangles match. */\n public equals(other: RectangleProps): boolean {\n if (\n this.left === other.left &&\n this.top === other.top &&\n this.right === other.right &&\n this.bottom === other.bottom\n )\n return true;\n\n return false;\n }\n\n /**\n * Checks if point is within bounds of the rectangle.\n * @note Inclusive.\n */\n public containsPoint(point: PointProps): boolean {\n return (\n point.x >= this.left &&\n point.x <= this.right &&\n point.y >= this.top &&\n point.y <= this.bottom\n );\n }\n\n /**\n * Checks if a point given as x,y is within the rectangle.\n * @note Inclusive.\n */\n public containsXY(x: number, y: number): boolean {\n return this.containsPoint({ x, y });\n }\n\n /**\n * @returns true if this rectangle contains other rectangle.\n * @note Inclusive.\n */\n public contains(other: RectangleProps): boolean {\n return (\n other.left >= this.left &&\n other.right <= this.right &&\n other.top >= this.top &&\n other.bottom <= this.bottom\n );\n }\n\n /** @returns New [[Rectangle]] which is contained in other rectangle. */\n public containIn(other: RectangleProps): Rectangle {\n let contained: Rectangle = this.containVerticallyIn(other);\n contained = contained.containHorizontallyIn(other);\n return contained;\n }\n\n /** @returns New [[Rectangle]] which is vertically contained in other rectangle. */\n public containVerticallyIn(other: RectangleProps): Rectangle {\n const contained = this.offsetY(Math.min(other.bottom - this.bottom, 0));\n return contained.offsetY(Math.max(other.top - contained.top, 0));\n }\n\n /** @returns New [[Rectangle]] which is horizontally contained in other rectangle. */\n public containHorizontallyIn(other: RectangleProps): Rectangle {\n const contained = this.offsetX(Math.min(other.right - this.right, 0));\n return contained.offsetX(Math.max(other.left - contained.left, 0));\n }\n\n /** @returns [[Corner.TopLeft]] position of this rectangle. */\n public topLeft(): Point {\n return new Point(this.left, this.top);\n }\n\n /** @returns Center point position of this rectangle. */\n public center(): Point {\n const x = this.left + (this.right - this.left) / 2;\n const y = this.top + (this.bottom - this.top) / 2;\n return new Point(x, y);\n }\n\n /** @returns true if this rectangle intersects other rectangle. */\n public intersects(other: RectangleProps): boolean {\n return (\n this.left < other.right &&\n this.right > other.left &&\n this.top < other.bottom &&\n this.bottom > other.top\n );\n }\n\n /**\n * Merges outer edges of this and other rectangles.\n * @returns New [[Rectangle]] with merged bounds.\n */\n public outerMergeWith(other: RectangleProps): Rectangle {\n const left = Math.min(this.left, other.left);\n const top = Math.min(this.top, other.top);\n const right = Math.max(this.right, other.right);\n const bottom = Math.max(this.bottom, other.bottom);\n return new Rectangle(left, top, right, bottom);\n }\n\n /**\n * Vertically divides this rectangle into specified number of equal height segments.\n * @returns Vertical rectangle segment.\n */\n public getVerticalSegmentBounds(\n segmentId: number,\n numberOfSegments: number\n ): Rectangle {\n const segmentHeight = this.getHeight() / numberOfSegments;\n\n const top = segmentId * segmentHeight;\n return this.inset(0, top, 0, 0).setHeight(segmentHeight);\n }\n\n /**\n * Horizontally divides this rectangle into specified number of equal width segments.\n * @returns Horizontal rectangle segment.\n */\n public getHorizontalSegmentBounds(\n segmentId: number,\n numberOfSegments: number\n ): Rectangle {\n const segmentWidth = this.getWidth() / numberOfSegments;\n\n const left = segmentId * segmentWidth;\n return this.inset(left, 0, 0, 0).setWidth(segmentWidth);\n }\n\n /**\n * Calculates the shortest distance between this rectangle and a given point.\n * @returns The shortest distance to a point.\n */\n public getShortestDistanceToPoint(point: PointProps): number {\n let shortestDistance = 0;\n\n if (point.x < this.left) {\n if (point.y < this.top)\n shortestDistance = UiGeometry.hypotenuseXY(\n this.left - point.x,\n this.top - point.y\n );\n else if (point.y <= this.bottom) shortestDistance = this.left - point.x;\n else\n shortestDistance = UiGeometry.hypotenuseXY(\n this.left - point.x,\n this.bottom - point.y\n );\n } else if (point.x <= this.right) {\n if (point.y < this.top) shortestDistance = this.top - point.y;\n else if (point.y <= this.bottom) shortestDistance = 0;\n else shortestDistance = point.y - this.bottom;\n } else {\n if (point.y < this.top)\n shortestDistance = UiGeometry.hypotenuseXY(\n this.right - point.x,\n this.top - point.y\n );\n else if (point.y <= this.bottom) shortestDistance = point.x - this.right;\n else\n shortestDistance = UiGeometry.hypotenuseXY(\n this.right - point.x,\n this.bottom - point.y\n );\n }\n\n return shortestDistance;\n }\n\n /** @returns [[RectangleProps]] object for this rectangle. */\n public toProps(): RectangleProps {\n return {\n bottom: this.bottom,\n left: this.left,\n right: this.right,\n top: this.top,\n };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Size.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/Size.ts"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"Size.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/Size.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,qBAAa,IAAK,YAAW,SAAS;aAOD,KAAK;aAAsB,MAAM;IANpE,yCAAyC;WAC3B,MAAM,CAAC,IAAI,EAAE,SAAS;IAIpC,gDAAgD;gBACb,KAAK,SAAI,EAAkB,MAAM,SAAI;IAExE,mDAAmD;IAC5C,MAAM,CAAC,KAAK,EAAE,SAAS;CAI/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Size.js","sourceRoot":"","sources":["../../../../src/core-react/utils/Size.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;
|
|
1
|
+
{"version":3,"file":"Size.js","sourceRoot":"","sources":["../../../../src/core-react/utils/Size.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAaH;;GAEG;AACH,MAAM,OAAO,IAAI;IACf,yCAAyC;IAClC,MAAM,CAAC,MAAM,CAAC,IAAe;QAClC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED,gDAAgD;IAChD,YAAmC,QAAQ,CAAC,EAAkB,SAAS,CAAC;QAArC,UAAK,GAAL,KAAK,CAAI;QAAkB,WAAM,GAAN,MAAM,CAAI;IAAG,CAAC;IAE5E,mDAAmD;IAC5C,MAAM,CAAC,KAAgB;QAC5B,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QAC5E,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n\n/* eslint-disable deprecation/deprecation */\n\n/** Describes 2d dimensions.\n * @public\n * @deprecated in 4.16.0. Use {@link @itwin/appui-react#SizeProps} instead.\n */\nexport interface SizeProps {\n readonly width: number;\n readonly height: number;\n}\n\n/** Describes and provides methods to work with 2d dimensions.\n * @internal\n */\nexport class Size implements SizeProps {\n /** Creates a size from [[SizeProps]]. */\n public static create(size: SizeProps) {\n return new Size(size.width, size.height);\n }\n\n /** Creates a size with specified dimensions. */\n public constructor(public readonly width = 0, public readonly height = 0) {}\n\n /** Checks if dimensions of two sizes are equal. */\n public equals(other: SizeProps) {\n if (this.width === other.width && this.height === other.height) return true;\n return false;\n }\n}\n"]}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/** Hook that will show a popup window
|
|
5
5
|
* @public
|
|
6
|
+
* @deprecated in 4.16.0. Without a replacement, use a custom solution instead.
|
|
6
7
|
*/
|
|
7
8
|
export declare function useCrossOriginPopup(visible: boolean, url: string | undefined, title: string, width: number, height: number, onClose: () => void): void;
|
|
8
9
|
//# sourceMappingURL=useCrossOriginPopup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCrossOriginPopup.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useCrossOriginPopup.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAKH
|
|
1
|
+
{"version":3,"file":"useCrossOriginPopup.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useCrossOriginPopup.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAKH;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,IAAI,QAuGpB"}
|
|
@@ -9,6 +9,7 @@ import * as React from "react";
|
|
|
9
9
|
import { useInterval } from "./useInterval";
|
|
10
10
|
/** Hook that will show a popup window
|
|
11
11
|
* @public
|
|
12
|
+
* @deprecated in 4.16.0. Without a replacement, use a custom solution instead.
|
|
12
13
|
*/
|
|
13
14
|
export function useCrossOriginPopup(visible, url, title, width, height, onClose) {
|
|
14
15
|
const [checkPopupAliveDelay, setCheckPopupAliveDelay] = React.useState();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCrossOriginPopup.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useCrossOriginPopup.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C
|
|
1
|
+
{"version":3,"file":"useCrossOriginPopup.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useCrossOriginPopup.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CACjC,OAAgB,EAChB,GAAuB,EACvB,KAAa,EACb,KAAa,EACb,MAAc,EACd,OAAmB;IAEnB,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAAG,KAAK,CAAC,QAAQ,EAEnE,CAAC;IAEJ,gHAAgH;IAChH,oCAAoC;IACpC,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,EAAU,CAAC;IAC3C,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACnC,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvC,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvC,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAE3C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,Q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OAAO,IAAI,WAAW,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAClD,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YAE5B,iBAAiB,EAAE,CAAC;QACtB,CAAC;IACH,CAAC,EAAE,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAC;AACnC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n\nimport * as React from \"react\";\nimport { useInterval } from \"./useInterval\";\n\n/** Hook that will show a popup window\n * @public\n * @deprecated in 4.16.0. Without a replacement, use a custom solution instead.\n */\nexport function useCrossOriginPopup(\n visible: boolean,\n url: string | undefined,\n title: string,\n width: number,\n height: number,\n onClose: () => void\n) {\n const [checkPopupAliveDelay, setCheckPopupAliveDelay] = React.useState<\n number | undefined\n >();\n\n // ONLY re-render the popup when visibility changes, any other changes get deferred until next visibility change\n // hence the massive use of 'useRef'\n const popupWindow = React.useRef<Window>();\n const savedUrl = React.useRef(url);\n const savedTitle = React.useRef(title);\n const savedWidth = React.useRef(width);\n const savedHeight = React.useRef(height);\n const savedOnClose = React.useRef(onClose);\n\n React.useEffect(() => {\n savedUrl.current = url;\n }, [url]);\n React.useEffect(() => {\n savedTitle.current = title;\n }, [title]);\n React.useEffect(() => {\n savedWidth.current = width;\n }, [width]);\n React.useEffect(() => {\n savedHeight.current = height;\n }, [height]);\n React.useEffect(() => {\n savedOnClose.current = onClose;\n }, [onClose]);\n\n // Cleanup method after a popup closure. Also calls the OnClose callback.\n const handleClosedPopup = React.useCallback(() => {\n savedOnClose.current();\n setCheckPopupAliveDelay(undefined);\n popupWindow.current = undefined;\n }, []);\n\n const closePopup = React.useCallback(() => {\n if (popupWindow.current !== undefined) {\n popupWindow.current.close(); // Manually close the popup\n handleClosedPopup();\n }\n }, [handleClosedPopup]);\n\n const checkPopupClosed = React.useCallback(() => {\n if (popupWindow.current?.closed) {\n // Popup has been closed by end-user, inform our host and cleanup\n handleClosedPopup();\n }\n }, [handleClosedPopup]);\n\n // Close popup when parent window get closed\n React.useEffect(() => {\n window.onbeforeunload = (_event) => {\n closePopup();\n };\n return () => {\n window.onbeforeunload = null;\n };\n }, [closePopup]);\n\n // Whenever the hook is unloaded, make sure the underlying popup get closed.\n // Note: An interval is used to check if popup was closed by user: because we access\n // a cross domain resource inside the popup, we don't have access to popup window events.\n // As a workaround, we periodically check if popup is still alive.\n // Reference: https://stackoverflow.com/questions/9388380/capture-the-close-event-of-popup-window-in-javascript/48240128#48240128\n React.useEffect(() => {\n return () => {\n closePopup();\n };\n }, [closePopup]);\n\n // Timer that checks if popup was closed by end-user\n // eslint-disable-next-line deprecation/deprecation\n useInterval(checkPopupClosed, checkPopupAliveDelay);\n\n // ==> Main render effect\n // Monitors visibility changes and open/close the popup accordingly.\n React.useEffect(() => {\n // If visible and a popup window is not already open, open a new popup window\n if (visible && popupWindow.current === undefined) {\n const popup = window.open(\n savedUrl.current,\n savedTitle.current,\n `width=${savedWidth.current},height=${savedHeight.current}`\n );\n if (popup) {\n popup.focus();\n popupWindow.current = popup;\n\n // Start and interval that will check if popup got closed by user\n setCheckPopupAliveDelay(1000);\n }\n }\n\n // If not visible but a previous popup window is still open, close it.\n if (!visible && popupWindow.current !== undefined) {\n popupWindow.current.close();\n\n handleClosedPopup();\n }\n }, [handleClosedPopup, visible]);\n}\n"]}
|
|
@@ -13,7 +13,8 @@ export declare function useResizeObserver<T extends Element>(onResize?: (width:
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function useLayoutResizeObserver(inElement: HTMLElement | null, onResize?: (width?: number, height?: number) => void): (number | undefined)[];
|
|
15
15
|
/** Prop the ElementResizeObserver sends to the render function.
|
|
16
|
-
*
|
|
16
|
+
* @public
|
|
17
|
+
* @deprecated in 4.16.0. Interface used in a deprecated component {@link ElementResizeObserver}.
|
|
17
18
|
*/
|
|
18
19
|
export interface RenderPropsArgs {
|
|
19
20
|
width?: number;
|
|
@@ -21,7 +22,7 @@ export interface RenderPropsArgs {
|
|
|
21
22
|
}
|
|
22
23
|
/** ElementResizeObserver provides functionality similar to ReactResizeDetector when a render function is specified. This implementation properly handles
|
|
23
24
|
* observing element in pop-out/child windows.
|
|
24
|
-
*
|
|
25
|
+
* @public
|
|
25
26
|
* @deprecated in 4.15.0. Used internally.
|
|
26
27
|
*/
|
|
27
28
|
export declare function ElementResizeObserver({ watchedElement, render, }: {
|
|
@@ -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;
|
|
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;AAO/B;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,OAAO,EACjD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,sCAiHnD;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,WAAW,GAAG,IAAI,EAC7B,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,0BAyGrD;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,cAAc,EACd,MAAM,GACP,EAAE;IACD,cAAc,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,MAAM,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,KAAK,CAAC,YAAY,CAAC;CACxD,sEAGA;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,qBAyCA"}
|
|
@@ -9,6 +9,7 @@ import * as React from "react";
|
|
|
9
9
|
import { getResizeObserver } from "./ResizeObserverPolyfill";
|
|
10
10
|
import { useRefEffect } from "./useRefEffect";
|
|
11
11
|
import { useRefs } from "./useRefs";
|
|
12
|
+
/* eslint-disable deprecation/deprecation */
|
|
12
13
|
/** Uses ResizeObserver API to notify about element bound changes.
|
|
13
14
|
* @internal
|
|
14
15
|
*/
|
|
@@ -162,7 +163,7 @@ export function useLayoutResizeObserver(inElement, onResize) {
|
|
|
162
163
|
}
|
|
163
164
|
/** ElementResizeObserver provides functionality similar to ReactResizeDetector when a render function is specified. This implementation properly handles
|
|
164
165
|
* observing element in pop-out/child windows.
|
|
165
|
-
*
|
|
166
|
+
* @public
|
|
166
167
|
* @deprecated in 4.15.0. Used internally.
|
|
167
168
|
*/
|
|
168
169
|
export function ElementResizeObserver({ watchedElement, render, }) {
|