@itwin/core-react 4.1.0 → 4.2.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 +1621 -1609
- package/ContributeGuidelines.md +99 -99
- package/LICENSE.md +9 -9
- package/README.md +11 -11
- package/lib/cjs/core-react/UiCore.d.ts.map +1 -1
- package/lib/cjs/core-react/UiCore.js +9 -5
- package/lib/cjs/core-react/UiCore.js.map +1 -1
- package/lib/cjs/core-react/_geometry.scss +70 -70
- package/lib/cjs/core-react/_helpers.scss +52 -51
- package/lib/cjs/core-react/_math.scss +13 -13
- package/lib/cjs/core-react/_scrollbar.scss +55 -51
- package/lib/cjs/core-react/_typography.scss +44 -44
- package/lib/cjs/core-react/_z-index.scss +47 -65
- 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 +14 -15
- package/lib/cjs/core-react/autosuggest/AutoSuggest.js.map +1 -1
- package/lib/cjs/core-react/autosuggest/AutoSuggest.scss +79 -79
- 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 +3 -3
- package/lib/cjs/core-react/badge/Badge.js.map +1 -1
- package/lib/cjs/core-react/badge/Badge.scss +13 -13
- package/lib/cjs/core-react/badge/BadgeUtilities.d.ts.map +1 -1
- package/lib/cjs/core-react/badge/BadgeUtilities.js +3 -3
- package/lib/cjs/core-react/badge/BadgeUtilities.js.map +1 -1
- package/lib/cjs/core-react/badge/BetaBadge.d.ts.map +1 -1
- package/lib/cjs/core-react/badge/BetaBadge.js +3 -3
- package/lib/cjs/core-react/badge/BetaBadge.js.map +1 -1
- package/lib/cjs/core-react/badge/NewBadge.d.ts.map +1 -1
- package/lib/cjs/core-react/badge/NewBadge.js +4 -4
- package/lib/cjs/core-react/badge/NewBadge.js.map +1 -1
- package/lib/cjs/core-react/badge/NewBadge.scss +9 -9
- package/lib/cjs/core-react/base/Centered.js +3 -3
- package/lib/cjs/core-react/base/Centered.js.map +1 -1
- package/lib/cjs/core-react/base/Div.d.ts.map +1 -1
- package/lib/cjs/core-react/base/Div.js +3 -3
- package/lib/cjs/core-react/base/Div.js.map +1 -1
- package/lib/cjs/core-react/base/DivWithOutsideClick.d.ts.map +1 -1
- package/lib/cjs/core-react/base/DivWithOutsideClick.js +4 -4
- package/lib/cjs/core-react/base/DivWithOutsideClick.js.map +1 -1
- package/lib/cjs/core-react/base/FillCentered.js +3 -3
- package/lib/cjs/core-react/base/FillCentered.js.map +1 -1
- package/lib/cjs/core-react/base/FlexWrapContainer.js +3 -3
- package/lib/cjs/core-react/base/FlexWrapContainer.js.map +1 -1
- package/lib/cjs/core-react/base/Gap.d.ts.map +1 -1
- package/lib/cjs/core-react/base/Gap.js +5 -5
- package/lib/cjs/core-react/base/Gap.js.map +1 -1
- package/lib/cjs/core-react/base/PointerEvents.js +3 -3
- package/lib/cjs/core-react/base/PointerEvents.js.map +1 -1
- package/lib/cjs/core-react/base/ScrollView.js +3 -3
- package/lib/cjs/core-react/base/ScrollView.js.map +1 -1
- package/lib/cjs/core-react/base/base.scss +42 -42
- package/lib/cjs/core-react/base/classes.scss +27 -13
- package/lib/cjs/core-react/base/index.scss +5 -5
- package/lib/cjs/core-react/button/UnderlinedButton.d.ts.map +1 -1
- package/lib/cjs/core-react/button/UnderlinedButton.js +3 -3
- package/lib/cjs/core-react/button/UnderlinedButton.js.map +1 -1
- package/lib/cjs/core-react/button/UnderlinedButton.scss +32 -33
- package/lib/cjs/core-react/checklistbox/CheckListBox.d.ts.map +1 -1
- package/lib/cjs/core-react/checklistbox/CheckListBox.js +4 -4
- package/lib/cjs/core-react/checklistbox/CheckListBox.js.map +1 -1
- package/lib/cjs/core-react/checklistbox/CheckListBox.scss +22 -22
- package/lib/cjs/core-react/classes.scss +11 -11
- package/lib/cjs/core-react/colorthemes.scss +61 -61
- package/lib/cjs/core-react/colorvariables.scss +131 -131
- package/lib/cjs/core-react/contextmenu/ContextMenu.d.ts +7 -7
- package/lib/cjs/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.js +43 -25
- package/lib/cjs/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.scss +236 -236
- package/lib/cjs/core-react/contextmenu/ContextMenuDirection.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuDirection.js +3 -3
- package/lib/cjs/core-react/contextmenu/ContextMenuDirection.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 +3 -3
- 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 +16 -12
- 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 +37 -15
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js +14 -12
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/PopupContextMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/PopupContextMenu.js +3 -3
- package/lib/cjs/core-react/contextmenu/PopupContextMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/TildeFinder.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/TildeFinder.js +15 -7
- package/lib/cjs/core-react/contextmenu/TildeFinder.js.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.d.ts +6 -5
- package/lib/cjs/core-react/dialog/Dialog.d.ts.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.js +95 -88
- package/lib/cjs/core-react/dialog/Dialog.js.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.scss +245 -245
- package/lib/cjs/core-react/dialog/GlobalDialog.d.ts.map +1 -1
- package/lib/cjs/core-react/dialog/GlobalDialog.js +11 -8
- package/lib/cjs/core-react/dialog/GlobalDialog.js.map +1 -1
- package/lib/cjs/core-react/dialog/SimpleDialog.d.ts +68 -0
- package/lib/cjs/core-react/dialog/SimpleDialog.d.ts.map +1 -0
- package/lib/cjs/core-react/dialog/SimpleDialog.js +51 -0
- package/lib/cjs/core-react/dialog/SimpleDialog.js.map +1 -0
- package/lib/cjs/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.js +16 -10
- package/lib/cjs/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.scss +94 -85
- package/lib/cjs/core-react/enums/Alignment.js +3 -3
- package/lib/cjs/core-react/enums/Alignment.js.map +1 -1
- package/lib/cjs/core-react/enums/CheckBoxState.js +3 -3
- package/lib/cjs/core-react/enums/CheckBoxState.js.map +1 -1
- package/lib/cjs/core-react/enums/Orientation.js +3 -3
- package/lib/cjs/core-react/enums/Orientation.js.map +1 -1
- package/lib/cjs/core-react/enums/SortDirection.js +3 -3
- package/lib/cjs/core-react/enums/SortDirection.js.map +1 -1
- package/lib/cjs/core-react/enums/TimeFormat.js +3 -3
- package/lib/cjs/core-react/enums/TimeFormat.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 +8 -5
- package/lib/cjs/core-react/expandable/ExpandableList.js.map +1 -1
- package/lib/cjs/core-react/expandable/ExpandableList.scss +9 -9
- package/lib/cjs/core-react/expandable/classes.scss +9 -7
- package/lib/cjs/core-react/expandable/index.scss +5 -5
- package/lib/cjs/core-react/expandable/list.scss +35 -35
- package/lib/cjs/core-react/focus/ItemKeyboardNavigator.d.ts.map +1 -1
- package/lib/cjs/core-react/focus/ItemKeyboardNavigator.js +38 -15
- package/lib/cjs/core-react/focus/ItemKeyboardNavigator.js.map +1 -1
- package/lib/cjs/core-react/focustrap/FocusTrap.d.ts.map +1 -1
- package/lib/cjs/core-react/focustrap/FocusTrap.js +33 -16
- package/lib/cjs/core-react/focustrap/FocusTrap.js.map +1 -1
- package/lib/cjs/core-react/hocs/withIsPressed.d.ts.map +1 -1
- package/lib/cjs/core-react/hocs/withIsPressed.js +4 -7
- package/lib/cjs/core-react/hocs/withIsPressed.js.map +1 -1
- package/lib/cjs/core-react/hocs/withOnOutsideClick.d.ts.map +1 -1
- package/lib/cjs/core-react/hocs/withOnOutsideClick.js +17 -13
- package/lib/cjs/core-react/hocs/withOnOutsideClick.js.map +1 -1
- package/lib/cjs/core-react/hocs/withTimeout.d.ts.map +1 -1
- package/lib/cjs/core-react/hocs/withTimeout.js +6 -8
- package/lib/cjs/core-react/hocs/withTimeout.js.map +1 -1
- package/lib/cjs/core-react/icons/ConditionalIconItem.d.ts +5 -1
- package/lib/cjs/core-react/icons/ConditionalIconItem.d.ts.map +1 -1
- package/lib/cjs/core-react/icons/ConditionalIconItem.js +26 -9
- package/lib/cjs/core-react/icons/ConditionalIconItem.js.map +1 -1
- 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/IconComponent.js +21 -11
- package/lib/cjs/core-react/icons/IconComponent.js.map +1 -1
- package/lib/cjs/core-react/icons/IconComponent.scss +19 -20
- package/lib/cjs/core-react/icons/SvgPath.d.ts.map +1 -1
- package/lib/cjs/core-react/icons/SvgPath.js +4 -4
- package/lib/cjs/core-react/icons/SvgPath.js.map +1 -1
- package/lib/cjs/core-react/icons/SvgPath.scss +15 -15
- package/lib/cjs/core-react/icons/WebFontIcon.js +3 -3
- package/lib/cjs/core-react/icons/WebFontIcon.js.map +1 -1
- package/lib/cjs/core-react/icons/WebFontIcon.scss +17 -17
- package/lib/cjs/core-react/icons/classes.scss +18 -10
- package/lib/cjs/core-react/icons/index.scss +6 -6
- package/lib/cjs/core-react/icons/mixins.scss +25 -25
- package/lib/cjs/core-react/icons/variables.scss +12 -12
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.d.ts.map +1 -1
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js +6 -4
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.scss +54 -54
- package/lib/cjs/core-react/index.scss +21 -21
- 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 +6 -7
- 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 +10 -13
- package/lib/cjs/core-react/inputs/InputLabel.js.map +1 -1
- package/lib/cjs/core-react/inputs/InputStatus.js +3 -3
- package/lib/cjs/core-react/inputs/InputStatus.js.map +1 -1
- package/lib/cjs/core-react/inputs/LabeledComponentProps.js +3 -3
- package/lib/cjs/core-react/inputs/LabeledComponentProps.js.map +1 -1
- package/lib/cjs/core-react/inputs/classes.scss +12 -8
- 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 +3 -4
- package/lib/cjs/core-react/inputs/iconinput/IconInput.js.map +1 -1
- package/lib/cjs/core-react/inputs/iconinput/IconInput.scss +34 -35
- package/lib/cjs/core-react/inputs/index.scss +9 -9
- package/lib/cjs/core-react/inputs/input-label.scss +90 -90
- package/lib/cjs/core-react/inputs/input.scss +58 -58
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts +2 -2
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.js +25 -16
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.js.map +1 -1
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.scss +88 -88
- package/lib/cjs/core-react/inputs/variables.scss +38 -38
- package/lib/cjs/core-react/layout-variables.scss +15 -17
- 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/listbox/Listbox.js +20 -14
- package/lib/cjs/core-react/listbox/Listbox.js.map +1 -1
- package/lib/cjs/core-react/listbox/Listbox.scss +54 -54
- package/lib/cjs/core-react/loading/LoadingBar.d.ts.map +1 -1
- package/lib/cjs/core-react/loading/LoadingBar.js +4 -4
- package/lib/cjs/core-react/loading/LoadingBar.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingBar.scss +29 -29
- package/lib/cjs/core-react/loading/LoadingPrompt.d.ts.map +1 -1
- package/lib/cjs/core-react/loading/LoadingPrompt.js +9 -9
- package/lib/cjs/core-react/loading/LoadingPrompt.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingPrompt.scss +33 -33
- package/lib/cjs/core-react/loading/LoadingSpinner.d.ts +3 -3
- package/lib/cjs/core-react/loading/LoadingSpinner.d.ts.map +1 -1
- package/lib/cjs/core-react/loading/LoadingSpinner.js +5 -5
- package/lib/cjs/core-react/loading/LoadingSpinner.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingSpinner.scss +26 -26
- package/lib/cjs/core-react/loading/LoadingStatus.d.ts.map +1 -1
- package/lib/cjs/core-react/loading/LoadingStatus.js +3 -3
- package/lib/cjs/core-react/loading/LoadingStatus.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingStatus.scss +20 -20
- package/lib/cjs/core-react/loading/index.scss +5 -5
- package/lib/cjs/core-react/loading/mixins.scss +57 -57
- 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 +5 -5
- package/lib/cjs/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/cjs/core-react/messagebox/MessageBox.scss +56 -56
- package/lib/cjs/core-react/notification/MessageRenderer.d.ts.map +1 -1
- package/lib/cjs/core-react/notification/MessageRenderer.js +19 -13
- package/lib/cjs/core-react/notification/MessageRenderer.js.map +1 -1
- package/lib/cjs/core-react/notification/MessageType.d.ts.map +1 -1
- package/lib/cjs/core-react/notification/MessageType.js +3 -3
- package/lib/cjs/core-react/notification/MessageType.js.map +1 -1
- package/lib/cjs/core-react/popup/Popup.d.ts.map +1 -1
- package/lib/cjs/core-react/popup/Popup.js +50 -31
- package/lib/cjs/core-react/popup/Popup.js.map +1 -1
- package/lib/cjs/core-react/popup/Popup.scss +240 -240
- package/lib/cjs/core-react/radialmenu/Annulus.d.ts.map +1 -1
- package/lib/cjs/core-react/radialmenu/Annulus.js +4 -4
- package/lib/cjs/core-react/radialmenu/Annulus.js.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 +26 -11
- package/lib/cjs/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.scss +55 -55
- package/lib/cjs/core-react/searchbox/SearchBox.d.ts.map +1 -1
- package/lib/cjs/core-react/searchbox/SearchBox.js +17 -7
- package/lib/cjs/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/cjs/core-react/searchbox/SearchBox.scss +47 -47
- package/lib/cjs/core-react/settings/SettingsContainer.d.ts +1 -1
- package/lib/cjs/core-react/settings/SettingsContainer.d.ts.map +1 -1
- package/lib/cjs/core-react/settings/SettingsContainer.js +54 -19
- package/lib/cjs/core-react/settings/SettingsContainer.js.map +1 -1
- package/lib/cjs/core-react/settings/SettingsContainer.scss +68 -68
- 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 +7 -8
- package/lib/cjs/core-react/settings/SettingsManager.js.map +1 -1
- package/lib/cjs/core-react/style/baseline.scss +11 -11
- package/lib/cjs/core-react/style/breakpoints.scss +59 -41
- package/lib/cjs/core-react/style/colors.scss +77 -77
- package/lib/cjs/core-react/style/index.scss +10 -10
- package/lib/cjs/core-react/style/mixins.scss +23 -27
- package/lib/cjs/core-react/style/opacity.scss +16 -16
- package/lib/cjs/core-react/style/themecolors.scss +133 -123
- 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 +13 -11
- package/lib/cjs/core-react/tabs/Tabs.js.map +1 -1
- package/lib/cjs/core-react/tabs/VerticalTabs.d.ts.map +1 -1
- package/lib/cjs/core-react/tabs/VerticalTabs.js +3 -3
- package/lib/cjs/core-react/tabs/VerticalTabs.js.map +1 -1
- package/lib/cjs/core-react/tabs/classes.scss +9 -7
- package/lib/cjs/core-react/tabs/index.scss +5 -5
- package/lib/cjs/core-react/tabs/tabs.scss +96 -96
- package/lib/cjs/core-react/tabs/vertical.scss +51 -51
- package/lib/cjs/core-react/text/BlockText.js +4 -4
- package/lib/cjs/core-react/text/BlockText.js.map +1 -1
- package/lib/cjs/core-react/text/BodyText.js +4 -4
- package/lib/cjs/core-react/text/BodyText.js.map +1 -1
- package/lib/cjs/core-react/text/DisabledText.js +4 -4
- package/lib/cjs/core-react/text/DisabledText.js.map +1 -1
- package/lib/cjs/core-react/text/FilteredText.d.ts.map +1 -1
- package/lib/cjs/core-react/text/FilteredText.js +5 -5
- package/lib/cjs/core-react/text/FilteredText.js.map +1 -1
- package/lib/cjs/core-react/text/FilteredText.scss +10 -10
- package/lib/cjs/core-react/text/MutedText.js +4 -4
- package/lib/cjs/core-react/text/MutedText.js.map +1 -1
- package/lib/cjs/core-react/text/StyledText.js +3 -3
- package/lib/cjs/core-react/text/StyledText.js.map +1 -1
- package/lib/cjs/core-react/text/TextProps.d.ts.map +1 -1
- package/lib/cjs/core-react/text/TextProps.js +3 -3
- package/lib/cjs/core-react/text/TextProps.js.map +1 -1
- package/lib/cjs/core-react/text/block.scss +15 -15
- package/lib/cjs/core-react/text/body.scss +13 -13
- package/lib/cjs/core-react/text/classes.scss +18 -10
- package/lib/cjs/core-react/text/disabled.scss +9 -10
- package/lib/cjs/core-react/text/index.scss +10 -10
- package/lib/cjs/core-react/text/mixins.scss +24 -24
- package/lib/cjs/core-react/text/muted.scss +9 -10
- package/lib/cjs/core-react/tree/Branch.d.ts.map +1 -1
- package/lib/cjs/core-react/tree/Branch.js +3 -3
- package/lib/cjs/core-react/tree/Branch.js.map +1 -1
- package/lib/cjs/core-react/tree/Branch.scss +13 -13
- package/lib/cjs/core-react/tree/ExpansionToggle.d.ts.map +1 -1
- package/lib/cjs/core-react/tree/ExpansionToggle.js +3 -3
- package/lib/cjs/core-react/tree/ExpansionToggle.js.map +1 -1
- package/lib/cjs/core-react/tree/ExpansionToggle.scss +32 -32
- package/lib/cjs/core-react/tree/Node.d.ts.map +1 -1
- package/lib/cjs/core-react/tree/Node.js +12 -10
- package/lib/cjs/core-react/tree/Node.js.map +1 -1
- package/lib/cjs/core-react/tree/Node.scss +68 -68
- package/lib/cjs/core-react/tree/Placeholder.js +5 -5
- package/lib/cjs/core-react/tree/Placeholder.js.map +1 -1
- package/lib/cjs/core-react/tree/Placeholder.scss +17 -17
- package/lib/cjs/core-react/tree/Tree.d.ts.map +1 -1
- package/lib/cjs/core-react/tree/Tree.js +20 -11
- package/lib/cjs/core-react/tree/Tree.js.map +1 -1
- package/lib/cjs/core-react/tree/Tree.scss +21 -21
- package/lib/cjs/core-react/uistate/LocalStateStorage.d.ts.map +1 -1
- package/lib/cjs/core-react/uistate/LocalStateStorage.js +7 -4
- package/lib/cjs/core-react/uistate/LocalStateStorage.js.map +1 -1
- package/lib/cjs/core-react/uistate/UiStateEntry.d.ts.map +1 -1
- package/lib/cjs/core-react/uistate/UiStateEntry.js +3 -3
- package/lib/cjs/core-react/uistate/UiStateEntry.js.map +1 -1
- package/lib/cjs/core-react/uistate/UiStateStorage.d.ts.map +1 -1
- package/lib/cjs/core-react/uistate/UiStateStorage.js +3 -3
- package/lib/cjs/core-react/uistate/UiStateStorage.js.map +1 -1
- package/lib/cjs/core-react/utils/IconHelper.d.ts +3 -1
- package/lib/cjs/core-react/utils/IconHelper.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/IconHelper.js +35 -6
- package/lib/cjs/core-react/utils/IconHelper.js.map +1 -1
- package/lib/cjs/core-react/utils/IconWebComponent.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/IconWebComponent.js +71 -41
- package/lib/cjs/core-react/utils/IconWebComponent.js.map +1 -1
- package/lib/cjs/core-react/utils/Point.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/Point.js +3 -3
- package/lib/cjs/core-react/utils/Point.js.map +1 -1
- package/lib/cjs/core-react/utils/Props.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/Props.js +3 -3
- package/lib/cjs/core-react/utils/Props.js.map +1 -1
- package/lib/cjs/core-react/utils/Rectangle.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/Rectangle.js +15 -7
- package/lib/cjs/core-react/utils/Rectangle.js.map +1 -1
- package/lib/cjs/core-react/utils/ScrollPositionMaintainer.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/ScrollPositionMaintainer.js +4 -2
- package/lib/cjs/core-react/utils/ScrollPositionMaintainer.js.map +1 -1
- package/lib/cjs/core-react/utils/Size.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/Size.js +4 -5
- package/lib/cjs/core-react/utils/Size.js.map +1 -1
- package/lib/cjs/core-react/utils/Timer.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/Timer.js +3 -3
- package/lib/cjs/core-react/utils/Timer.js.map +1 -1
- package/lib/cjs/core-react/utils/UiGeometry.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/UiGeometry.js +9 -5
- package/lib/cjs/core-react/utils/UiGeometry.js.map +1 -1
- package/lib/cjs/core-react/utils/flattenChildren.js +3 -3
- package/lib/cjs/core-react/utils/flattenChildren.js.map +1 -1
- package/lib/cjs/core-react/utils/getBestBWContrastColor.js +5 -5
- package/lib/cjs/core-react/utils/getBestBWContrastColor.js.map +1 -1
- package/lib/cjs/core-react/utils/getCssVariable.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/getCssVariable.js +4 -4
- package/lib/cjs/core-react/utils/getCssVariable.js.map +1 -1
- package/lib/cjs/core-react/utils/getDisplayName.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/getDisplayName.js +3 -3
- package/lib/cjs/core-react/utils/getDisplayName.js.map +1 -1
- package/lib/cjs/core-react/utils/getUserColor.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/getUserColor.js +5 -4
- package/lib/cjs/core-react/utils/getUserColor.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.js +4 -4
- package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js +22 -11
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useDisposable.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useDisposable.js +3 -3
- package/lib/cjs/core-react/utils/hooks/useDisposable.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useEffectSkipFirst.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useEffectSkipFirst.js +3 -3
- package/lib/cjs/core-react/utils/hooks/useEffectSkipFirst.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useEventListener.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useEventListener.js +3 -3
- package/lib/cjs/core-react/utils/hooks/useEventListener.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useInterval.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useInterval.js +6 -4
- package/lib/cjs/core-react/utils/hooks/useInterval.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useLifecycleLogging.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useLifecycleLogging.js +7 -4
- package/lib/cjs/core-react/utils/hooks/useLifecycleLogging.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useOnOutsideClick.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useOnOutsideClick.js +15 -6
- package/lib/cjs/core-react/utils/hooks/useOnOutsideClick.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useProximityToMouse.js +3 -3
- package/lib/cjs/core-react/utils/hooks/useProximityToMouse.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useRefEffect.d.ts +1 -1
- package/lib/cjs/core-react/utils/hooks/useRefEffect.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useRefEffect.js +3 -3
- package/lib/cjs/core-react/utils/hooks/useRefEffect.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useRefState.js +3 -3
- package/lib/cjs/core-react/utils/hooks/useRefState.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useRefs.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useRefs.js +8 -6
- package/lib/cjs/core-react/utils/hooks/useRefs.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.d.ts +8 -8
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js +43 -32
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useTargeted.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useTargeted.js +7 -4
- package/lib/cjs/core-react/utils/hooks/useTargeted.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useThrottledFn.js +3 -3
- package/lib/cjs/core-react/utils/hooks/useThrottledFn.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useWidgetOpacityContext.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useWidgetOpacityContext.js +3 -4
- package/lib/cjs/core-react/utils/hooks/useWidgetOpacityContext.js.map +1 -1
- package/lib/cjs/core-react/utils/isPromiseLike.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/isPromiseLike.js +6 -4
- package/lib/cjs/core-react/utils/isPromiseLike.js.map +1 -1
- package/lib/cjs/core-react/utils/reuseOrCreatePromise.d.ts +14 -0
- package/lib/cjs/core-react/utils/reuseOrCreatePromise.d.ts.map +1 -0
- package/lib/cjs/core-react/utils/reuseOrCreatePromise.js +33 -0
- package/lib/cjs/core-react/utils/reuseOrCreatePromise.js.map +1 -0
- package/lib/cjs/core-react/utils/shallowDiffers.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/shallowDiffers.js +3 -3
- package/lib/cjs/core-react/utils/shallowDiffers.js.map +1 -1
- package/lib/cjs/core-react/utils/typeUtils.js +3 -3
- package/lib/cjs/core-react/utils/typeUtils.js.map +1 -1
- package/lib/cjs/core-react.d.ts +3 -3
- package/lib/cjs/core-react.d.ts.map +1 -1
- package/lib/cjs/core-react.js +3 -3
- package/lib/cjs/core-react.js.map +1 -1
- package/lib/esm/core-react/UiCore.d.ts.map +1 -1
- package/lib/esm/core-react/UiCore.js +9 -5
- package/lib/esm/core-react/UiCore.js.map +1 -1
- package/lib/esm/core-react/_geometry.scss +70 -70
- package/lib/esm/core-react/_helpers.scss +52 -51
- package/lib/esm/core-react/_math.scss +13 -13
- package/lib/esm/core-react/_scrollbar.scss +55 -51
- package/lib/esm/core-react/_typography.scss +44 -44
- package/lib/esm/core-react/_z-index.scss +47 -65
- 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 +14 -15
- package/lib/esm/core-react/autosuggest/AutoSuggest.js.map +1 -1
- package/lib/esm/core-react/autosuggest/AutoSuggest.scss +79 -79
- 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 +3 -3
- package/lib/esm/core-react/badge/Badge.js.map +1 -1
- package/lib/esm/core-react/badge/Badge.scss +13 -13
- package/lib/esm/core-react/badge/BadgeUtilities.d.ts.map +1 -1
- package/lib/esm/core-react/badge/BadgeUtilities.js +3 -3
- package/lib/esm/core-react/badge/BadgeUtilities.js.map +1 -1
- package/lib/esm/core-react/badge/BetaBadge.d.ts.map +1 -1
- package/lib/esm/core-react/badge/BetaBadge.js +3 -3
- package/lib/esm/core-react/badge/BetaBadge.js.map +1 -1
- package/lib/esm/core-react/badge/NewBadge.d.ts.map +1 -1
- package/lib/esm/core-react/badge/NewBadge.js +4 -4
- package/lib/esm/core-react/badge/NewBadge.js.map +1 -1
- package/lib/esm/core-react/badge/NewBadge.scss +9 -9
- package/lib/esm/core-react/base/Centered.js +3 -3
- package/lib/esm/core-react/base/Centered.js.map +1 -1
- package/lib/esm/core-react/base/Div.d.ts.map +1 -1
- package/lib/esm/core-react/base/Div.js +3 -3
- package/lib/esm/core-react/base/Div.js.map +1 -1
- package/lib/esm/core-react/base/DivWithOutsideClick.d.ts.map +1 -1
- package/lib/esm/core-react/base/DivWithOutsideClick.js +4 -4
- package/lib/esm/core-react/base/DivWithOutsideClick.js.map +1 -1
- package/lib/esm/core-react/base/FillCentered.js +3 -3
- package/lib/esm/core-react/base/FillCentered.js.map +1 -1
- package/lib/esm/core-react/base/FlexWrapContainer.js +3 -3
- package/lib/esm/core-react/base/FlexWrapContainer.js.map +1 -1
- package/lib/esm/core-react/base/Gap.d.ts.map +1 -1
- package/lib/esm/core-react/base/Gap.js +5 -5
- package/lib/esm/core-react/base/Gap.js.map +1 -1
- package/lib/esm/core-react/base/PointerEvents.js +3 -3
- package/lib/esm/core-react/base/PointerEvents.js.map +1 -1
- package/lib/esm/core-react/base/ScrollView.js +3 -3
- package/lib/esm/core-react/base/ScrollView.js.map +1 -1
- package/lib/esm/core-react/base/base.scss +42 -42
- package/lib/esm/core-react/base/classes.scss +27 -13
- package/lib/esm/core-react/base/index.scss +5 -5
- package/lib/esm/core-react/button/UnderlinedButton.d.ts.map +1 -1
- package/lib/esm/core-react/button/UnderlinedButton.js +3 -3
- package/lib/esm/core-react/button/UnderlinedButton.js.map +1 -1
- package/lib/esm/core-react/button/UnderlinedButton.scss +32 -33
- package/lib/esm/core-react/checklistbox/CheckListBox.d.ts.map +1 -1
- package/lib/esm/core-react/checklistbox/CheckListBox.js +4 -4
- package/lib/esm/core-react/checklistbox/CheckListBox.js.map +1 -1
- package/lib/esm/core-react/checklistbox/CheckListBox.scss +22 -22
- package/lib/esm/core-react/classes.scss +11 -11
- package/lib/esm/core-react/colorthemes.scss +61 -61
- package/lib/esm/core-react/colorvariables.scss +131 -131
- package/lib/esm/core-react/contextmenu/ContextMenu.d.ts +7 -7
- package/lib/esm/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.js +43 -25
- package/lib/esm/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.scss +236 -236
- package/lib/esm/core-react/contextmenu/ContextMenuDirection.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuDirection.js +3 -3
- package/lib/esm/core-react/contextmenu/ContextMenuDirection.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 +3 -3
- 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 +16 -12
- 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 +37 -15
- package/lib/esm/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.js +14 -12
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/PopupContextMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/PopupContextMenu.js +3 -3
- package/lib/esm/core-react/contextmenu/PopupContextMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/TildeFinder.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/TildeFinder.js +15 -7
- package/lib/esm/core-react/contextmenu/TildeFinder.js.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.d.ts +6 -5
- package/lib/esm/core-react/dialog/Dialog.d.ts.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.js +95 -88
- package/lib/esm/core-react/dialog/Dialog.js.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.scss +245 -245
- package/lib/esm/core-react/dialog/GlobalDialog.d.ts.map +1 -1
- package/lib/esm/core-react/dialog/GlobalDialog.js +11 -8
- package/lib/esm/core-react/dialog/GlobalDialog.js.map +1 -1
- package/lib/esm/core-react/dialog/SimpleDialog.d.ts +68 -0
- package/lib/esm/core-react/dialog/SimpleDialog.d.ts.map +1 -0
- package/lib/esm/core-react/dialog/SimpleDialog.js +47 -0
- package/lib/esm/core-react/dialog/SimpleDialog.js.map +1 -0
- package/lib/esm/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.js +16 -10
- package/lib/esm/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.scss +94 -85
- package/lib/esm/core-react/enums/Alignment.js +3 -3
- package/lib/esm/core-react/enums/Alignment.js.map +1 -1
- package/lib/esm/core-react/enums/CheckBoxState.js +3 -3
- package/lib/esm/core-react/enums/CheckBoxState.js.map +1 -1
- package/lib/esm/core-react/enums/Orientation.js +3 -3
- package/lib/esm/core-react/enums/Orientation.js.map +1 -1
- package/lib/esm/core-react/enums/SortDirection.js +3 -3
- package/lib/esm/core-react/enums/SortDirection.js.map +1 -1
- package/lib/esm/core-react/enums/TimeFormat.js +3 -3
- package/lib/esm/core-react/enums/TimeFormat.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 +8 -5
- package/lib/esm/core-react/expandable/ExpandableList.js.map +1 -1
- package/lib/esm/core-react/expandable/ExpandableList.scss +9 -9
- package/lib/esm/core-react/expandable/classes.scss +9 -7
- package/lib/esm/core-react/expandable/index.scss +5 -5
- package/lib/esm/core-react/expandable/list.scss +35 -35
- package/lib/esm/core-react/focus/ItemKeyboardNavigator.d.ts.map +1 -1
- package/lib/esm/core-react/focus/ItemKeyboardNavigator.js +38 -15
- package/lib/esm/core-react/focus/ItemKeyboardNavigator.js.map +1 -1
- package/lib/esm/core-react/focustrap/FocusTrap.d.ts.map +1 -1
- package/lib/esm/core-react/focustrap/FocusTrap.js +33 -16
- package/lib/esm/core-react/focustrap/FocusTrap.js.map +1 -1
- package/lib/esm/core-react/hocs/withIsPressed.d.ts.map +1 -1
- package/lib/esm/core-react/hocs/withIsPressed.js +4 -7
- package/lib/esm/core-react/hocs/withIsPressed.js.map +1 -1
- package/lib/esm/core-react/hocs/withOnOutsideClick.d.ts.map +1 -1
- package/lib/esm/core-react/hocs/withOnOutsideClick.js +17 -13
- package/lib/esm/core-react/hocs/withOnOutsideClick.js.map +1 -1
- package/lib/esm/core-react/hocs/withTimeout.d.ts.map +1 -1
- package/lib/esm/core-react/hocs/withTimeout.js +6 -8
- package/lib/esm/core-react/hocs/withTimeout.js.map +1 -1
- package/lib/esm/core-react/icons/ConditionalIconItem.d.ts +5 -1
- package/lib/esm/core-react/icons/ConditionalIconItem.d.ts.map +1 -1
- package/lib/esm/core-react/icons/ConditionalIconItem.js +26 -9
- package/lib/esm/core-react/icons/ConditionalIconItem.js.map +1 -1
- 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/IconComponent.js +22 -12
- package/lib/esm/core-react/icons/IconComponent.js.map +1 -1
- package/lib/esm/core-react/icons/IconComponent.scss +19 -20
- package/lib/esm/core-react/icons/SvgPath.d.ts.map +1 -1
- package/lib/esm/core-react/icons/SvgPath.js +4 -4
- package/lib/esm/core-react/icons/SvgPath.js.map +1 -1
- package/lib/esm/core-react/icons/SvgPath.scss +15 -15
- package/lib/esm/core-react/icons/WebFontIcon.js +3 -3
- package/lib/esm/core-react/icons/WebFontIcon.js.map +1 -1
- package/lib/esm/core-react/icons/WebFontIcon.scss +17 -17
- package/lib/esm/core-react/icons/classes.scss +18 -10
- package/lib/esm/core-react/icons/index.scss +6 -6
- package/lib/esm/core-react/icons/mixins.scss +25 -25
- package/lib/esm/core-react/icons/variables.scss +12 -12
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.d.ts.map +1 -1
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js +6 -4
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.scss +54 -54
- package/lib/esm/core-react/index.scss +21 -21
- 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 +6 -7
- 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 +11 -14
- package/lib/esm/core-react/inputs/InputLabel.js.map +1 -1
- package/lib/esm/core-react/inputs/InputStatus.js +3 -3
- package/lib/esm/core-react/inputs/InputStatus.js.map +1 -1
- package/lib/esm/core-react/inputs/LabeledComponentProps.js +3 -3
- package/lib/esm/core-react/inputs/LabeledComponentProps.js.map +1 -1
- package/lib/esm/core-react/inputs/classes.scss +12 -8
- 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 +3 -4
- package/lib/esm/core-react/inputs/iconinput/IconInput.js.map +1 -1
- package/lib/esm/core-react/inputs/iconinput/IconInput.scss +34 -35
- package/lib/esm/core-react/inputs/index.scss +9 -9
- package/lib/esm/core-react/inputs/input-label.scss +90 -90
- package/lib/esm/core-react/inputs/input.scss +58 -58
- package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts +2 -2
- package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
- package/lib/esm/core-react/inputs/numberinput/NumberInput.js +26 -17
- package/lib/esm/core-react/inputs/numberinput/NumberInput.js.map +1 -1
- package/lib/esm/core-react/inputs/numberinput/NumberInput.scss +88 -88
- package/lib/esm/core-react/inputs/variables.scss +38 -38
- package/lib/esm/core-react/layout-variables.scss +15 -17
- 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/listbox/Listbox.js +20 -14
- package/lib/esm/core-react/listbox/Listbox.js.map +1 -1
- package/lib/esm/core-react/listbox/Listbox.scss +54 -54
- package/lib/esm/core-react/loading/LoadingBar.d.ts.map +1 -1
- package/lib/esm/core-react/loading/LoadingBar.js +4 -4
- package/lib/esm/core-react/loading/LoadingBar.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingBar.scss +29 -29
- package/lib/esm/core-react/loading/LoadingPrompt.d.ts.map +1 -1
- package/lib/esm/core-react/loading/LoadingPrompt.js +9 -9
- package/lib/esm/core-react/loading/LoadingPrompt.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingPrompt.scss +33 -33
- package/lib/esm/core-react/loading/LoadingSpinner.d.ts +3 -3
- package/lib/esm/core-react/loading/LoadingSpinner.d.ts.map +1 -1
- package/lib/esm/core-react/loading/LoadingSpinner.js +5 -5
- package/lib/esm/core-react/loading/LoadingSpinner.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingSpinner.scss +26 -26
- package/lib/esm/core-react/loading/LoadingStatus.d.ts.map +1 -1
- package/lib/esm/core-react/loading/LoadingStatus.js +3 -3
- package/lib/esm/core-react/loading/LoadingStatus.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingStatus.scss +20 -20
- package/lib/esm/core-react/loading/index.scss +5 -5
- package/lib/esm/core-react/loading/mixins.scss +57 -57
- 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 +6 -6
- package/lib/esm/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/esm/core-react/messagebox/MessageBox.scss +56 -56
- package/lib/esm/core-react/notification/MessageRenderer.d.ts.map +1 -1
- package/lib/esm/core-react/notification/MessageRenderer.js +19 -13
- package/lib/esm/core-react/notification/MessageRenderer.js.map +1 -1
- package/lib/esm/core-react/notification/MessageType.d.ts.map +1 -1
- package/lib/esm/core-react/notification/MessageType.js +3 -3
- package/lib/esm/core-react/notification/MessageType.js.map +1 -1
- package/lib/esm/core-react/popup/Popup.d.ts.map +1 -1
- package/lib/esm/core-react/popup/Popup.js +50 -31
- package/lib/esm/core-react/popup/Popup.js.map +1 -1
- package/lib/esm/core-react/popup/Popup.scss +240 -240
- package/lib/esm/core-react/radialmenu/Annulus.d.ts.map +1 -1
- package/lib/esm/core-react/radialmenu/Annulus.js +4 -4
- package/lib/esm/core-react/radialmenu/Annulus.js.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 +26 -11
- package/lib/esm/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.scss +55 -55
- package/lib/esm/core-react/searchbox/SearchBox.d.ts.map +1 -1
- package/lib/esm/core-react/searchbox/SearchBox.js +17 -7
- package/lib/esm/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/esm/core-react/searchbox/SearchBox.scss +47 -47
- package/lib/esm/core-react/settings/SettingsContainer.d.ts +1 -1
- package/lib/esm/core-react/settings/SettingsContainer.d.ts.map +1 -1
- package/lib/esm/core-react/settings/SettingsContainer.js +54 -19
- package/lib/esm/core-react/settings/SettingsContainer.js.map +1 -1
- package/lib/esm/core-react/settings/SettingsContainer.scss +68 -68
- 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 +7 -8
- package/lib/esm/core-react/settings/SettingsManager.js.map +1 -1
- package/lib/esm/core-react/style/baseline.scss +11 -11
- package/lib/esm/core-react/style/breakpoints.scss +59 -41
- package/lib/esm/core-react/style/colors.scss +77 -77
- package/lib/esm/core-react/style/index.scss +10 -10
- package/lib/esm/core-react/style/mixins.scss +23 -27
- package/lib/esm/core-react/style/opacity.scss +16 -16
- package/lib/esm/core-react/style/themecolors.scss +133 -123
- 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 +13 -11
- package/lib/esm/core-react/tabs/Tabs.js.map +1 -1
- package/lib/esm/core-react/tabs/VerticalTabs.d.ts.map +1 -1
- package/lib/esm/core-react/tabs/VerticalTabs.js +3 -3
- package/lib/esm/core-react/tabs/VerticalTabs.js.map +1 -1
- package/lib/esm/core-react/tabs/classes.scss +9 -7
- package/lib/esm/core-react/tabs/index.scss +5 -5
- package/lib/esm/core-react/tabs/tabs.scss +96 -96
- package/lib/esm/core-react/tabs/vertical.scss +51 -51
- package/lib/esm/core-react/text/BlockText.js +4 -4
- package/lib/esm/core-react/text/BlockText.js.map +1 -1
- package/lib/esm/core-react/text/BodyText.js +4 -4
- package/lib/esm/core-react/text/BodyText.js.map +1 -1
- package/lib/esm/core-react/text/DisabledText.js +4 -4
- package/lib/esm/core-react/text/DisabledText.js.map +1 -1
- package/lib/esm/core-react/text/FilteredText.d.ts.map +1 -1
- package/lib/esm/core-react/text/FilteredText.js +5 -5
- package/lib/esm/core-react/text/FilteredText.js.map +1 -1
- package/lib/esm/core-react/text/FilteredText.scss +10 -10
- package/lib/esm/core-react/text/MutedText.js +4 -4
- package/lib/esm/core-react/text/MutedText.js.map +1 -1
- package/lib/esm/core-react/text/StyledText.js +3 -3
- package/lib/esm/core-react/text/StyledText.js.map +1 -1
- package/lib/esm/core-react/text/TextProps.d.ts.map +1 -1
- package/lib/esm/core-react/text/TextProps.js +3 -3
- package/lib/esm/core-react/text/TextProps.js.map +1 -1
- package/lib/esm/core-react/text/block.scss +15 -15
- package/lib/esm/core-react/text/body.scss +13 -13
- package/lib/esm/core-react/text/classes.scss +18 -10
- package/lib/esm/core-react/text/disabled.scss +9 -10
- package/lib/esm/core-react/text/index.scss +10 -10
- package/lib/esm/core-react/text/mixins.scss +24 -24
- package/lib/esm/core-react/text/muted.scss +9 -10
- package/lib/esm/core-react/tree/Branch.d.ts.map +1 -1
- package/lib/esm/core-react/tree/Branch.js +3 -3
- package/lib/esm/core-react/tree/Branch.js.map +1 -1
- package/lib/esm/core-react/tree/Branch.scss +13 -13
- package/lib/esm/core-react/tree/ExpansionToggle.d.ts.map +1 -1
- package/lib/esm/core-react/tree/ExpansionToggle.js +3 -3
- package/lib/esm/core-react/tree/ExpansionToggle.js.map +1 -1
- package/lib/esm/core-react/tree/ExpansionToggle.scss +32 -32
- package/lib/esm/core-react/tree/Node.d.ts.map +1 -1
- package/lib/esm/core-react/tree/Node.js +12 -10
- package/lib/esm/core-react/tree/Node.js.map +1 -1
- package/lib/esm/core-react/tree/Node.scss +68 -68
- package/lib/esm/core-react/tree/Placeholder.js +5 -5
- package/lib/esm/core-react/tree/Placeholder.js.map +1 -1
- package/lib/esm/core-react/tree/Placeholder.scss +17 -17
- package/lib/esm/core-react/tree/Tree.d.ts.map +1 -1
- package/lib/esm/core-react/tree/Tree.js +20 -11
- package/lib/esm/core-react/tree/Tree.js.map +1 -1
- package/lib/esm/core-react/tree/Tree.scss +21 -21
- package/lib/esm/core-react/uistate/LocalStateStorage.d.ts.map +1 -1
- package/lib/esm/core-react/uistate/LocalStateStorage.js +7 -4
- package/lib/esm/core-react/uistate/LocalStateStorage.js.map +1 -1
- package/lib/esm/core-react/uistate/UiStateEntry.d.ts.map +1 -1
- package/lib/esm/core-react/uistate/UiStateEntry.js +3 -3
- package/lib/esm/core-react/uistate/UiStateEntry.js.map +1 -1
- package/lib/esm/core-react/uistate/UiStateStorage.d.ts.map +1 -1
- package/lib/esm/core-react/uistate/UiStateStorage.js +3 -3
- package/lib/esm/core-react/uistate/UiStateStorage.js.map +1 -1
- package/lib/esm/core-react/utils/IconHelper.d.ts +3 -1
- package/lib/esm/core-react/utils/IconHelper.d.ts.map +1 -1
- package/lib/esm/core-react/utils/IconHelper.js +35 -6
- package/lib/esm/core-react/utils/IconHelper.js.map +1 -1
- package/lib/esm/core-react/utils/IconWebComponent.d.ts.map +1 -1
- package/lib/esm/core-react/utils/IconWebComponent.js +71 -41
- package/lib/esm/core-react/utils/IconWebComponent.js.map +1 -1
- package/lib/esm/core-react/utils/Point.d.ts.map +1 -1
- package/lib/esm/core-react/utils/Point.js +3 -3
- package/lib/esm/core-react/utils/Point.js.map +1 -1
- package/lib/esm/core-react/utils/Props.d.ts.map +1 -1
- package/lib/esm/core-react/utils/Props.js +3 -3
- package/lib/esm/core-react/utils/Props.js.map +1 -1
- package/lib/esm/core-react/utils/Rectangle.d.ts.map +1 -1
- package/lib/esm/core-react/utils/Rectangle.js +15 -7
- package/lib/esm/core-react/utils/Rectangle.js.map +1 -1
- package/lib/esm/core-react/utils/ScrollPositionMaintainer.d.ts.map +1 -1
- package/lib/esm/core-react/utils/ScrollPositionMaintainer.js +4 -2
- package/lib/esm/core-react/utils/ScrollPositionMaintainer.js.map +1 -1
- package/lib/esm/core-react/utils/Size.d.ts.map +1 -1
- package/lib/esm/core-react/utils/Size.js +4 -5
- package/lib/esm/core-react/utils/Size.js.map +1 -1
- package/lib/esm/core-react/utils/Timer.d.ts.map +1 -1
- package/lib/esm/core-react/utils/Timer.js +3 -3
- package/lib/esm/core-react/utils/Timer.js.map +1 -1
- package/lib/esm/core-react/utils/UiGeometry.d.ts.map +1 -1
- package/lib/esm/core-react/utils/UiGeometry.js +9 -5
- package/lib/esm/core-react/utils/UiGeometry.js.map +1 -1
- package/lib/esm/core-react/utils/flattenChildren.js +3 -3
- package/lib/esm/core-react/utils/flattenChildren.js.map +1 -1
- package/lib/esm/core-react/utils/getBestBWContrastColor.js +5 -5
- package/lib/esm/core-react/utils/getBestBWContrastColor.js.map +1 -1
- package/lib/esm/core-react/utils/getCssVariable.d.ts.map +1 -1
- package/lib/esm/core-react/utils/getCssVariable.js +4 -4
- package/lib/esm/core-react/utils/getCssVariable.js.map +1 -1
- package/lib/esm/core-react/utils/getDisplayName.d.ts.map +1 -1
- package/lib/esm/core-react/utils/getDisplayName.js +3 -3
- package/lib/esm/core-react/utils/getDisplayName.js.map +1 -1
- package/lib/esm/core-react/utils/getUserColor.d.ts.map +1 -1
- package/lib/esm/core-react/utils/getUserColor.js +5 -4
- package/lib/esm/core-react/utils/getUserColor.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.js +4 -4
- package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js +22 -11
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useDisposable.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useDisposable.js +3 -3
- package/lib/esm/core-react/utils/hooks/useDisposable.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useEffectSkipFirst.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useEffectSkipFirst.js +3 -3
- package/lib/esm/core-react/utils/hooks/useEffectSkipFirst.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useEventListener.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useEventListener.js +3 -3
- package/lib/esm/core-react/utils/hooks/useEventListener.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useInterval.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useInterval.js +6 -4
- package/lib/esm/core-react/utils/hooks/useInterval.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useLifecycleLogging.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useLifecycleLogging.js +7 -4
- package/lib/esm/core-react/utils/hooks/useLifecycleLogging.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useOnOutsideClick.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useOnOutsideClick.js +15 -6
- package/lib/esm/core-react/utils/hooks/useOnOutsideClick.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useProximityToMouse.js +3 -3
- package/lib/esm/core-react/utils/hooks/useProximityToMouse.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useRefEffect.d.ts +1 -1
- package/lib/esm/core-react/utils/hooks/useRefEffect.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useRefEffect.js +3 -3
- package/lib/esm/core-react/utils/hooks/useRefEffect.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useRefState.js +3 -3
- package/lib/esm/core-react/utils/hooks/useRefState.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useRefs.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useRefs.js +8 -6
- package/lib/esm/core-react/utils/hooks/useRefs.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useResizeObserver.d.ts +8 -8
- package/lib/esm/core-react/utils/hooks/useResizeObserver.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js +43 -32
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useTargeted.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useTargeted.js +7 -4
- package/lib/esm/core-react/utils/hooks/useTargeted.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useThrottledFn.js +3 -3
- package/lib/esm/core-react/utils/hooks/useThrottledFn.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useWidgetOpacityContext.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useWidgetOpacityContext.js +3 -4
- package/lib/esm/core-react/utils/hooks/useWidgetOpacityContext.js.map +1 -1
- package/lib/esm/core-react/utils/isPromiseLike.d.ts.map +1 -1
- package/lib/esm/core-react/utils/isPromiseLike.js +6 -4
- package/lib/esm/core-react/utils/isPromiseLike.js.map +1 -1
- package/lib/esm/core-react/utils/reuseOrCreatePromise.d.ts +14 -0
- package/lib/esm/core-react/utils/reuseOrCreatePromise.d.ts.map +1 -0
- package/lib/esm/core-react/utils/reuseOrCreatePromise.js +29 -0
- package/lib/esm/core-react/utils/reuseOrCreatePromise.js.map +1 -0
- package/lib/esm/core-react/utils/shallowDiffers.d.ts.map +1 -1
- package/lib/esm/core-react/utils/shallowDiffers.js +3 -3
- package/lib/esm/core-react/utils/shallowDiffers.js.map +1 -1
- package/lib/esm/core-react/utils/typeUtils.js +3 -3
- package/lib/esm/core-react/utils/typeUtils.js.map +1 -1
- package/lib/esm/core-react.d.ts +3 -3
- package/lib/esm/core-react.d.ts.map +1 -1
- package/lib/esm/core-react.js +6 -6
- package/lib/esm/core-react.js.map +1 -1
- package/lib/public/locales/en/UiCore.json +31 -31
- package/package.json +8 -17
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
/** @packageDocumentation
|
|
7
7
|
* @module Utilities
|
|
8
8
|
*/
|
|
@@ -11,6 +11,7 @@ exports.IconHelper = void 0;
|
|
|
11
11
|
const React = require("react");
|
|
12
12
|
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
13
13
|
const IconComponent_1 = require("../icons/IconComponent");
|
|
14
|
+
const ConditionalIconItem_1 = require("../icons/ConditionalIconItem");
|
|
14
15
|
/** Icon Helper Class used to store the data needed to generate an <Icon> for use in any control that shows an icon.
|
|
15
16
|
* @public
|
|
16
17
|
*/
|
|
@@ -18,6 +19,9 @@ class IconHelper {
|
|
|
18
19
|
static get reactIconKey() {
|
|
19
20
|
return "#-react-iconspec-node-#";
|
|
20
21
|
}
|
|
22
|
+
static get conditionalIconItemKey() {
|
|
23
|
+
return "#-conditional-icon-item-node-#";
|
|
24
|
+
}
|
|
21
25
|
/** Returns an <Icon> ReactNode from the many ways an icon can be specified.
|
|
22
26
|
* @param icon abstract icon specification.
|
|
23
27
|
* @param internalData a map that may hold a React.ReactNode stored in an abstract item definition.
|
|
@@ -27,6 +31,9 @@ class IconHelper {
|
|
|
27
31
|
if (!icon)
|
|
28
32
|
return null;
|
|
29
33
|
// istanbul ignore else
|
|
34
|
+
if (ConditionalIconItem_1.ConditionalIconItem.isConditionalIconItem(icon))
|
|
35
|
+
return (React.createElement(IconComponent_1.Icon, { iconSpec: ConditionalIconItem_1.ConditionalIconItem.getValue(icon) }));
|
|
36
|
+
// istanbul ignore else
|
|
30
37
|
if (React.isValidElement(icon))
|
|
31
38
|
return React.createElement(IconComponent_1.Icon, { iconSpec: icon });
|
|
32
39
|
// istanbul ignore if
|
|
@@ -39,7 +46,15 @@ class IconHelper {
|
|
|
39
46
|
if (iconString === IconHelper.reactIconKey) {
|
|
40
47
|
// istanbul ignore else
|
|
41
48
|
if (internalData)
|
|
42
|
-
return React.createElement(IconComponent_1.Icon, { iconSpec: internalData.get(IconHelper.reactIconKey) });
|
|
49
|
+
return (React.createElement(IconComponent_1.Icon, { iconSpec: internalData.get(IconHelper.reactIconKey) }));
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
else if (iconString === IconHelper.conditionalIconItemKey) {
|
|
53
|
+
// istanbul ignore else
|
|
54
|
+
if (internalData) {
|
|
55
|
+
const iconItem = internalData.get(IconHelper.conditionalIconItemKey);
|
|
56
|
+
return React.createElement(IconComponent_1.Icon, { iconSpec: ConditionalIconItem_1.ConditionalIconItem.getValue(iconItem) });
|
|
57
|
+
}
|
|
43
58
|
return null;
|
|
44
59
|
}
|
|
45
60
|
return React.createElement(IconComponent_1.Icon, { iconSpec: iconString });
|
|
@@ -50,8 +65,22 @@ class IconHelper {
|
|
|
50
65
|
* @param internalData a map supplied by the caller to store away react element if React.ReactNode
|
|
51
66
|
*/
|
|
52
67
|
static getIconData(iconSpec, internalData) {
|
|
53
|
-
|
|
54
|
-
if (
|
|
68
|
+
let icon;
|
|
69
|
+
if (ConditionalIconItem_1.ConditionalIconItem.isConditionalIconItem(iconSpec)) {
|
|
70
|
+
icon = IconHelper.conditionalIconItemKey;
|
|
71
|
+
// istanbul ignore else
|
|
72
|
+
if (internalData)
|
|
73
|
+
internalData.set(IconHelper.conditionalIconItemKey, iconSpec);
|
|
74
|
+
return icon;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
icon = React.isValidElement(iconSpec)
|
|
78
|
+
? IconHelper.reactIconKey
|
|
79
|
+
: iconSpec;
|
|
80
|
+
}
|
|
81
|
+
if (internalData &&
|
|
82
|
+
typeof icon === "string" &&
|
|
83
|
+
icon === IconHelper.reactIconKey) {
|
|
55
84
|
internalData.set(IconHelper.reactIconKey, iconSpec);
|
|
56
85
|
}
|
|
57
86
|
if (typeof icon === "string" || icon instanceof appui_abstract_1.ConditionalStringValue)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconHelper.js","sourceRoot":"","sources":["../../../../src/core-react/utils/IconHelper.tsx"],"names":[],"mappings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AAC;YACJ,OAAO,IAAI,CAAC;SACb;aAAM,IAAI,UAAU,KAAK,UAAU,CAAC,sBAAsB,EAAE;YAC3D,uBAAuB;YACvB,IAAI,YAAY,EAAE;gBAChB,MAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,CAC/B,UAAU,CAAC,sBAAsB,CACX,CAAC;gBACzB,OAAO,oBAAC,oBAAI,IAAC,QAAQ,EAAE,yCAAmB,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAI,CAAC;aACnE;YACD,OAAO,IAAI,CAAC;SACb;QACD,OAAO,oBAAC,oBAAI,IAAC,QAAQ,EAAE,UAAU,GAAI,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,WAAW,CACvB,QAAkB,EAClB,YAA+B;QAE/B,IAAI,IAAI,CAAC;QACT,IAAI,yCAAmB,CAAC,qBAAqB,CAAC,QAAQ,CAAC,EAAE;YACvD,IAAI,GAAG,UAAU,CAAC,sBAAsB,CAAC;YACzC,uBAAuB;YACvB,IAAI,YAAY;gBACd,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,sBAAsB,EAAE,QAAQ,CAAC,CAAC;YAChE,OAAO,IAAI,CAAC;SACb;aAAM;YACL,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC;gBACnC,CAAC,CAAC,UAAU,CAAC,YAAY;gBACzB,CAAC,CAAC,QAAQ,CAAC;SACd;QAED,IACE,YAAY;YACZ,OAAO,IAAI,KAAK,QAAQ;YACxB,IAAI,KAAK,UAAU,CAAC,YAAY,EAChC;YACA,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;SACrD;QAED,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,YAAY,uCAAsB;YACpE,OAAO,IAAI,CAAC;QAEd,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAnGD,gCAmGC","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 { ConditionalStringValue } from \"@itwin/appui-abstract\";\nimport type { IconSpec } from \"../icons/IconComponent\";\nimport { Icon } from \"../icons/IconComponent\";\nimport { ConditionalIconItem } from \"../icons/ConditionalIconItem\";\n\n/** Icon Helper Class used to store the data needed to generate an <Icon> for use in any control that shows an icon.\n * @public\n */\nexport class IconHelper {\n public static get reactIconKey(): string {\n return \"#-react-iconspec-node-#\";\n }\n public static get conditionalIconItemKey(): string {\n return \"#-conditional-icon-item-node-#\";\n }\n /** Returns an <Icon> ReactNode from the many ways an icon can be specified.\n * @param icon abstract icon specification.\n * @param internalData a map that may hold a React.ReactNode stored in an abstract item definition.\n */\n public static getIconReactNode(\n icon:\n | string\n | ConditionalStringValue\n | React.ReactNode\n | ConditionalIconItem,\n internalData?: Map<string, any>\n ): React.ReactNode {\n // istanbul ignore else\n if (!icon) return null;\n\n // istanbul ignore else\n if (ConditionalIconItem.isConditionalIconItem(icon))\n return (\n <Icon\n iconSpec={ConditionalIconItem.getValue(icon as ConditionalIconItem)}\n />\n );\n // istanbul ignore else\n if (React.isValidElement(icon)) return <Icon iconSpec={icon} />;\n\n // istanbul ignore if\n if (!(icon instanceof ConditionalStringValue) && typeof icon !== \"string\")\n return null;\n\n const iconString = ConditionalStringValue.getValue(icon);\n if (!iconString) return null;\n\n // istanbul ignore else\n if (iconString === IconHelper.reactIconKey) {\n // istanbul ignore else\n if (internalData)\n return (\n <Icon\n iconSpec={\n internalData.get(IconHelper.reactIconKey) as React.ReactNode\n }\n />\n );\n return null;\n } else if (iconString === IconHelper.conditionalIconItemKey) {\n // istanbul ignore else\n if (internalData) {\n const iconItem = internalData.get(\n IconHelper.conditionalIconItemKey\n ) as ConditionalIconItem;\n return <Icon iconSpec={ConditionalIconItem.getValue(iconItem)} />;\n }\n return null;\n }\n return <Icon iconSpec={iconString} />;\n }\n\n /** Returns an icon definition that can be stored in an abstract item definition. If the iconSpec specifies a ReactNode\n * then the react data is stored in the internalData map and the key to the react data is returned.\n * @param iconSpec any supported variations of how an icon can be defined in an abstract item or IconProps.\n * @param internalData a map supplied by the caller to store away react element if React.ReactNode\n */\n public static getIconData(\n iconSpec: IconSpec,\n internalData?: Map<string, any>\n ): string | ConditionalStringValue {\n let icon;\n if (ConditionalIconItem.isConditionalIconItem(iconSpec)) {\n icon = IconHelper.conditionalIconItemKey;\n // istanbul ignore else\n if (internalData)\n internalData.set(IconHelper.conditionalIconItemKey, iconSpec);\n return icon;\n } else {\n icon = React.isValidElement(iconSpec)\n ? IconHelper.reactIconKey\n : iconSpec;\n }\n\n if (\n internalData &&\n typeof icon === \"string\" &&\n icon === IconHelper.reactIconKey\n ) {\n internalData.set(IconHelper.reactIconKey, iconSpec);\n }\n\n if (typeof icon === \"string\" || icon instanceof ConditionalStringValue)\n return icon;\n\n return \"\";\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconWebComponent.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/IconWebComponent.ts"],"names":[],"mappings":"AAMA;;GAEG;
|
|
1
|
+
{"version":3,"file":"IconWebComponent.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/IconWebComponent.ts"],"names":[],"mappings":"AAMA;;GAEG;AAoFH;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;YACjC,iBAAiB;YAKjB,OAAO;CAetB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
// istanbul ignore file
|
|
7
7
|
// IconWebComponent requires in-browser testing
|
|
8
8
|
/** @packageDocumentation
|
|
@@ -14,6 +14,70 @@ const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
|
14
14
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
15
15
|
const UiCore_1 = require("../UiCore");
|
|
16
16
|
const dompurify_1 = require("dompurify"), DOMPurifyNS = dompurify_1;
|
|
17
|
+
const reuseOrCreatePromise_1 = require("./reuseOrCreatePromise");
|
|
18
|
+
/**
|
|
19
|
+
* "getSvg" list
|
|
20
|
+
* (if multiple icon require the same thing,
|
|
21
|
+
* only do the fetch once, and have all icon use the same result)
|
|
22
|
+
*/
|
|
23
|
+
const cache = new Map();
|
|
24
|
+
/**
|
|
25
|
+
* Parse 'data:' uri to retrieve the Svg component within it.
|
|
26
|
+
* @param src data:image/svg+xml;base64
|
|
27
|
+
* @param element Element for logging purpose.
|
|
28
|
+
* @returns HTMLElement (svg)
|
|
29
|
+
*/
|
|
30
|
+
function parseSvgFromDataUri(src, element) {
|
|
31
|
+
const dataUriParts = src.split(",");
|
|
32
|
+
if (dataUriParts.length !== 2 ||
|
|
33
|
+
"data:image/svg+xml;base64" !== dataUriParts[0]) {
|
|
34
|
+
core_bentley_1.Logger.logError(UiCore_1.UiCore.loggerCategory(element), "Unable to load icon.");
|
|
35
|
+
}
|
|
36
|
+
// the esm build of dompurify has a default import but the cjs build does not
|
|
37
|
+
// if there is a default export, use it (likely esm), otherwise use the namespace
|
|
38
|
+
// istanbul ignore next
|
|
39
|
+
const sanitizer = dompurify_1.default ?? DOMPurifyNS;
|
|
40
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
41
|
+
const sanitizedSvg = sanitizer.sanitize(atob(dataUriParts[1]));
|
|
42
|
+
const parsedSvg = new window.DOMParser().parseFromString(sanitizedSvg, "text/xml");
|
|
43
|
+
const errorNode = parsedSvg.querySelector("parsererror");
|
|
44
|
+
if (errorNode || "svg" !== parsedSvg.documentElement.nodeName.toLowerCase()) {
|
|
45
|
+
throw new appui_abstract_1.UiError(UiCore_1.UiCore.loggerCategory(element), "Unable to load icon.");
|
|
46
|
+
}
|
|
47
|
+
return parsedSvg.documentElement;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Fetch the src from the network and return the SVG element.
|
|
51
|
+
* @param src URL representing a .svg file
|
|
52
|
+
* @param element Element for logging purpose
|
|
53
|
+
* @returns HTMLElement (svg)
|
|
54
|
+
*/
|
|
55
|
+
async function fetchSvg(src, element) {
|
|
56
|
+
const response = await fetch(src).catch((_error) => {
|
|
57
|
+
core_bentley_1.Logger.logError(UiCore_1.UiCore.loggerCategory(element), "Unable to load icon.");
|
|
58
|
+
});
|
|
59
|
+
if (!response || !response.ok) {
|
|
60
|
+
throw new appui_abstract_1.UiError(UiCore_1.UiCore.loggerCategory(element), "Unable to load icon.");
|
|
61
|
+
}
|
|
62
|
+
const str = await response.text();
|
|
63
|
+
if (str === undefined) {
|
|
64
|
+
throw new appui_abstract_1.UiError(UiCore_1.UiCore.loggerCategory(element), "Unable to load icon.");
|
|
65
|
+
}
|
|
66
|
+
const data = new window.DOMParser().parseFromString(str, "text/xml");
|
|
67
|
+
return data.documentElement;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Get the svg (fetch and parse for url, or decode and parse for data: url)
|
|
71
|
+
* @param src URL of the content to download/parse
|
|
72
|
+
* @param element Element for logging purpose.
|
|
73
|
+
* @returns HTMLElement (svg)
|
|
74
|
+
*/
|
|
75
|
+
async function getSvg(src, element) {
|
|
76
|
+
if (src.startsWith("data:")) {
|
|
77
|
+
return parseSvgFromDataUri(src, element);
|
|
78
|
+
}
|
|
79
|
+
return fetchSvg(src, element);
|
|
80
|
+
}
|
|
17
81
|
/**
|
|
18
82
|
* IconWebComponent loads icon from an svg path
|
|
19
83
|
*/
|
|
@@ -27,46 +91,12 @@ class IconWebComponent extends HTMLElement {
|
|
|
27
91
|
if (this.childNodes.length)
|
|
28
92
|
return;
|
|
29
93
|
const src = this.getAttribute("src") || "";
|
|
30
|
-
if (src
|
|
31
|
-
const dataUriParts = src.split(",");
|
|
32
|
-
if (dataUriParts.length !== 2 || "data:image/svg+xml;base64" !== dataUriParts[0]) {
|
|
33
|
-
core_bentley_1.Logger.logError(UiCore_1.UiCore.loggerCategory(this), "Unable to load icon.");
|
|
34
|
-
}
|
|
35
|
-
// the esm build of dompurify has a default import but the cjs build does not
|
|
36
|
-
// if there is a default export, use it (likely esm), otherwise use the namespace
|
|
37
|
-
// istanbul ignore next
|
|
38
|
-
const sanitizer = dompurify_1.default !== null && dompurify_1.default !== void 0 ? dompurify_1.default : DOMPurifyNS;
|
|
39
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
40
|
-
const sanitizedSvg = sanitizer.sanitize(atob(dataUriParts[1]));
|
|
41
|
-
const parsedSvg = new window.DOMParser().parseFromString(sanitizedSvg, "text/xml");
|
|
42
|
-
const errorNode = parsedSvg.querySelector("parsererror");
|
|
43
|
-
if (errorNode || "svg" !== parsedSvg.documentElement.nodeName.toLowerCase()) {
|
|
44
|
-
throw new appui_abstract_1.UiError(UiCore_1.UiCore.loggerCategory(this), "Unable to load icon.");
|
|
45
|
-
}
|
|
46
|
-
!this.childNodes.length && this.append(parsedSvg.documentElement);
|
|
94
|
+
if (!src)
|
|
47
95
|
return;
|
|
96
|
+
const svg = await (0, reuseOrCreatePromise_1.reuseOrCreatePromise)(src, async () => getSvg(src, this), cache);
|
|
97
|
+
if (svg && !this.childNodes.length) {
|
|
98
|
+
this.append(svg.cloneNode(true));
|
|
48
99
|
}
|
|
49
|
-
await fetch(src)
|
|
50
|
-
.catch((_error) => {
|
|
51
|
-
core_bentley_1.Logger.logError(UiCore_1.UiCore.loggerCategory(this), "Unable to load icon.");
|
|
52
|
-
})
|
|
53
|
-
.then(async (response) => {
|
|
54
|
-
if (response && response.ok) {
|
|
55
|
-
return response.text();
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
throw new appui_abstract_1.UiError(UiCore_1.UiCore.loggerCategory(this), "Unable to load icon.");
|
|
59
|
-
}
|
|
60
|
-
})
|
|
61
|
-
.then((str) => {
|
|
62
|
-
if (str !== undefined) {
|
|
63
|
-
return (new window.DOMParser()).parseFromString(str, "text/xml");
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
throw new appui_abstract_1.UiError(UiCore_1.UiCore.loggerCategory(this), "Unable to load icon.");
|
|
67
|
-
}
|
|
68
|
-
})
|
|
69
|
-
.then((data) => !this.childNodes.length && this.append(data.documentElement));
|
|
70
100
|
}
|
|
71
101
|
}
|
|
72
102
|
exports.IconWebComponent = IconWebComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconWebComponent.js","sourceRoot":"","sources":["../../../../src/core-react/utils/IconWebComponent.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"IconWebComponent.js","sourceRoot":"","sources":["../../../../src/core-react/utils/IconWebComponent.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,uBAAuB;AACvB,+CAA+C;AAC/C;;GAEG;;;AAEH,0DAAgD;AAChD,sDAA6C;AAC7C,sCAAmC;AACnC,oEAAoD;AACpD,iEAA8D;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,YAAY,CAAC,MAAM,KAAK,CAAC;QACzB,2BAA2B,KAAK,YAAY,CAAC,CAAC,CAAC,EAC/C;QACA,qBAAM,CAAC,QAAQ,CAAC,eAAM,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,sBAAsB,CAAC,CAAC;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AC,EAAE,sBAAsB,CAAC,CAAC;KAC3E;IACD,MAAM,IAAI,GAAG,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IACrE,OAAO,IAAI,CAAC,eAAe,CAAC;AAC9B,CAAC;AAED;;;;;GAKG;AACH,KAAK,UAAU,MAAM,CAAC,GAAW,EAAE,OAAY;IAC7C,IAAI,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;QAC3B,OAAO,mBAAmB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KAC1C;IACD,OAAO,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAa,gBAAiB,SAAQ,WAAW;IACvC,KAAK,CAAC,iBAAiB;QAC7B,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;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,IAAA,2CAAoB,EACpC,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;YAClC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;SAClC;IACH,CAAC;CACF;AArBD,4CAqBC","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// istanbul ignore file\n// IconWebComponent requires in-browser testing\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/**\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\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 ) {\n Logger.logError(UiCore.loggerCategory(element), \"Unable to load icon.\");\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 // istanbul ignore next\n const sanitizer = DOMPurify ?? DOMPurifyNS;\n // eslint-disable-next-line deprecation/deprecation\n const sanitizedSvg = sanitizer.sanitize(atob(dataUriParts[1]));\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/**\n * IconWebComponent loads icon from an svg path\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Point.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/Point.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD;;GAEG;AACH,qBAAa,KAAM,YAAW,UAAU;aAOH,CAAC;aAAsB,CAAC;IAN3D,yCAAyC;WAC3B,MAAM,CAAC,UAAU,EAAE,UAAU;IAI3C,2BAA2B;gBACQ,CAAC,SAAI,EAAkB,CAAC,SAAI;
|
|
1
|
+
{"version":3,"file":"Point.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/Point.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD;;GAEG;AACH,qBAAa,KAAM,YAAW,UAAU;aAOH,CAAC;aAAsB,CAAC;IAN3D,yCAAyC;WAC3B,MAAM,CAAC,UAAU,EAAE,UAAU;IAI3C,2BAA2B;gBACQ,CAAC,SAAI,EAAkB,CAAC,SAAI;IAE/D,oDAAoD;IAC7C,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM;IAK/C,oDAAoD;IAC7C,sBAAsB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM;IAIxD,kCAAkC;IAC3B,WAAW,CAAC,KAAK,EAAE,UAAU;IAIpC,oEAAoE;IAC7D,MAAM,CAAC,MAAM,EAAE,UAAU;IAIhC,8DAA8D;IACvD,OAAO,CAAC,MAAM,EAAE,MAAM;IAI7B,8DAA8D;IACvD,OAAO,CAAC,MAAM,EAAE,MAAM;IAI7B,oEAAoE;IAC7D,MAAM,CAAC,KAAK,EAAE,UAAU;IAI/B,oDAAoD;IAC7C,IAAI,CAAC,CAAC,EAAE,MAAM;IAIrB,oDAAoD;IAC7C,IAAI,CAAC,CAAC,EAAE,MAAM;IAIrB,8EAA8E;IACvE,QAAQ,CAAC,MAAM,EAAE,MAAM;IAI9B,qDAAqD;IAC9C,OAAO,IAAI,UAAU;CAM7B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
/** @packageDocumentation
|
|
7
7
|
* @module Utilities
|
|
8
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Point.js","sourceRoot":"","sources":["../../../../src/core-react/utils/Point.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"Point.js","sourceRoot":"","sources":["../../../../src/core-react/utils/Point.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAIH;;GAEG;AACH,MAAa,KAAK;IAChB,yCAAyC;IAClC,MAAM,CAAC,MAAM,CAAC,UAAsB;QACzC,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC;IAED,2BAA2B;IAC3B,YAAmC,IAAI,CAAC,EAAkB,IAAI,CAAC;QAA5B,MAAC,GAAD,CAAC,CAAI;QAAkB,MAAC,GAAD,CAAC,CAAI;IAAG,CAAC;IAEnE,oDAAoD;IAC7C,aAAa,CAAC,KAAiB;QACpC,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,oDAAoD;IAC7C,sBAAsB,CAAC,KAAiB;QAC7C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,kCAAkC;IAC3B,WAAW,CAAC,KAAiB;QAClC,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACvD,CAAC;IAED,oEAAoE;IAC7D,MAAM,CAAC,MAAkB;QAC9B,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,8DAA8D;IACvD,OAAO,CAAC,MAAc;QAC3B,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5C,CAAC;IAED,8DAA8D;IACvD,OAAO,CAAC,MAAc;QAC3B,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED,oEAAoE;IAC7D,MAAM,CAAC,KAAiB;QAC7B,OAAO,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;IAClD,CAAC;IAED,oDAAoD;IAC7C,IAAI,CAAC,CAAS;QACnB,OAAO,IAAI,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC;IAED,oDAAoD;IAC7C,IAAI,CAAC,CAAS;QACnB,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9B,CAAC;IAED,8EAA8E;IACvE,QAAQ,CAAC,MAAc;QAC5B,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;IACrD,CAAC;IAED,qDAAqD;IAC9C,OAAO;QACZ,OAAO;YACL,CAAC,EAAE,IAAI,CAAC,CAAC;YACT,CAAC,EAAE,IAAI,CAAC,CAAC;SACV,CAAC;IACJ,CAAC;CACF;AAnED,sBAmEC","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 type { PointProps } from \"@itwin/appui-abstract\";\n\n/** Describes and provides methods to work with 2d points.\n * @internal\n */\nexport class Point implements PointProps {\n /** Creates point from [[PointProps]]. */\n public static create(pointProps: PointProps) {\n return new Point(pointProps.x, pointProps.y);\n }\n\n /** Creates a new point. */\n public constructor(public readonly x = 0, public readonly y = 0) {}\n\n /** Calculates Euclidean distance to other point. */\n public getDistanceTo(other: PointProps): number {\n const offset = this.getOffsetTo(other);\n return Math.sqrt(Math.pow(offset.x, 2) + Math.pow(offset.y, 2));\n }\n\n /** Calculates grid-like distance to other point. */\n public getManhattanDistanceTo(other: PointProps): number {\n return Math.abs(this.x - other.x) + Math.abs(this.y - other.y);\n }\n\n /** Gets offset to other point. */\n public getOffsetTo(other: PointProps) {\n return new Point(other.x - this.x, other.y - this.y);\n }\n\n /** @returns New [[Point]] that is offset along the X and Y axes. */\n public offset(offset: PointProps) {\n return new Point(this.x + offset.x, this.y + offset.y);\n }\n\n /** @returns New [[Point]] that is offset along the X axis. */\n public offsetX(offset: number) {\n return new Point(this.x + offset, this.y);\n }\n\n /** @returns New [[Point]] that is offset along the Y axis. */\n public offsetY(offset: number) {\n return new Point(this.x, this.y + offset);\n }\n\n /** @returns True if position of this and other points are equal. */\n public equals(other: PointProps) {\n return other.x === this.x && other.y === this.y;\n }\n\n /** @returns New [[Point]] with modified x value. */\n public setX(x: number) {\n return new Point(x, this.y);\n }\n\n /** @returns New [[Point]] with modified y value. */\n public setY(y: number) {\n return new Point(this.x, y);\n }\n\n /** @returns New [[Point]] with coordinates multiplied by specified factor. */\n public multiply(factor: number) {\n return new Point(this.x * factor, this.y * factor);\n }\n\n /** @returns [[PointProps]] object for this point. */\n public toProps(): PointProps {\n return {\n x: this.x,\n y: this.y,\n };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Props.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/Props.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD,kCAAkC;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,gHAAgH;IAChH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"Props.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/Props.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD,kCAAkC;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,gHAAgH;IAChH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,cACf,SAAQ,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAC7C,WAAW;CAAG;AAElB;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,IAAI,IAAI,CAC3E,CAAC,EACD,UAAU,CACX,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
/** @packageDocumentation
|
|
7
7
|
* @module Utilities
|
|
8
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Props.js","sourceRoot":"","sources":["../../../../src/core-react/utils/Props.tsx"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"Props.js","sourceRoot":"","sources":["../../../../src/core-react/utils/Props.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG","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 type * as React from \"react\";\nimport type { Omit } from \"./typeUtils\";\n\n/** Props used by components that expect class name to be passed in.\n * @public\n */\nexport interface ClassNameProps {\n /** Custom CSS class name */\n className?: string;\n}\n\n/** Common props used by components.\n * @public\n */\nexport interface CommonProps extends ClassNameProps {\n /** Custom CSS style properties */\n style?: React.CSSProperties;\n /** Optional unique identifier for item. If defined it will be added to DOM Element attribute as data-item-id */\n itemId?: string;\n}\n\n/** Common properties using a div element.\n * @public\n */\nexport interface CommonDivProps\n extends React.AllHTMLAttributes<HTMLDivElement>,\n CommonProps {}\n\n/** Props used by components that do not expect children to be passed in.\n * @public\n */\nexport interface NoChildrenProps {\n children?: undefined;\n}\n\n/** Omit children property from T.\n * @public\n */\nexport type OmitChildrenProp<T extends { children?: React.ReactNode }> = Omit<\n T,\n \"children\"\n>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rectangle.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/Rectangle.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAG9B;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,oBAAY,MAAM;IAChB,OAAO,IAAA;IACP,QAAQ,IAAA;IACR,WAAW,IAAA;IACX,UAAU,IAAA;CACX;AAED;;GAEG;AACH,qBAAa,SAAU,YAAW,cAAc;
|
|
1
|
+
{"version":3,"file":"Rectangle.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/Rectangle.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAG9B;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAA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|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
/** @packageDocumentation
|
|
7
7
|
* @module Utilities
|
|
8
8
|
*/
|
|
@@ -149,7 +149,10 @@ class Rectangle {
|
|
|
149
149
|
* @note Inclusive.
|
|
150
150
|
*/
|
|
151
151
|
containsPoint(point) {
|
|
152
|
-
return point.x >= this.left &&
|
|
152
|
+
return (point.x >= this.left &&
|
|
153
|
+
point.x <= this.right &&
|
|
154
|
+
point.y >= this.top &&
|
|
155
|
+
point.y <= this.bottom);
|
|
153
156
|
}
|
|
154
157
|
/**
|
|
155
158
|
* Checks if a point given as x,y is within the rectangle.
|
|
@@ -163,7 +166,10 @@ class Rectangle {
|
|
|
163
166
|
* @note Inclusive.
|
|
164
167
|
*/
|
|
165
168
|
contains(other) {
|
|
166
|
-
return other.left >= this.left &&
|
|
169
|
+
return (other.left >= this.left &&
|
|
170
|
+
other.right <= this.right &&
|
|
171
|
+
other.top >= this.top &&
|
|
172
|
+
other.bottom <= this.bottom);
|
|
167
173
|
}
|
|
168
174
|
/** @returns New [[Rectangle]] which is contained in other rectangle. */
|
|
169
175
|
containIn(other) {
|
|
@@ -193,8 +199,10 @@ class Rectangle {
|
|
|
193
199
|
}
|
|
194
200
|
/** @returns true if this rectangle intersects other rectangle. */
|
|
195
201
|
intersects(other) {
|
|
196
|
-
return this.left < other.right &&
|
|
197
|
-
this.
|
|
202
|
+
return (this.left < other.right &&
|
|
203
|
+
this.right > other.left &&
|
|
204
|
+
this.top < other.bottom &&
|
|
205
|
+
this.bottom > other.top);
|
|
198
206
|
}
|
|
199
207
|
/**
|
|
200
208
|
* Merges outer edges of this and other rectangles.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rectangle.js","sourceRoot":"","sources":["../../../../src/core-react/utils/Rectangle.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,mCAAgC;AAEhC,iCAA8B;AAC9B,6CAA0C;AAY1C;;GAEG;AACH,IAAY,MAKX;AALD,WAAY,MAAM;IAChB,yCAAO,CAAA;IACP,2CAAQ,CAAA;IACR,iDAAW,CAAA;IACX,+CAAU,CAAA;AACZ,CAAC,EALW,MAAM,GAAN,cAAM,KAAN,cAAM,QAKjB;AAED;;GAEG;AACH,MAAa,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;QAC1C,OAAO,IAAI,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACtD,CAAC;IAED,sHAAsH;IAC/G,MAAM,CAAC,UAAU,CAAC,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU;QACrE,OAAO,IAAI,SAAS,CAClB,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,EAClC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACxC,CAAC;IAED,+CAA+C;IAC/C,YAAmC,OAAO,CAAC,EAAkB,MAAM,CAAC,EAAkB,QAAQ,CAAC,EAAkB,SAAS,CAAC;QA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G,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC;iBACnC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM;gBAC7B,gBAAgB,GAAG,CAAC,CAAC;;gBAErB,gBAAgB,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;SAC5C;aAAM;YACL,IAAI,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG;gBACpB,gBAAgB,GAAG,uBAAU,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;iBAClF,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM;gBAC7B,gBAAgB,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;;gBAExC,gBAAgB,GAAG,uBAAU,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;SAC3F;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;AAjRD,8BAiRC","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 type { PointProps } from \"@itwin/appui-abstract\";\r\nimport { Point } from \"./Point\";\r\nimport type { SizeProps } from \"./Size\";\r\nimport { Size } from \"./Size\";\r\nimport { UiGeometry } from \"./UiGeometry\";\r\n\r\n/** Describes 2d bounds.\r\n * @public\r\n */\r\nexport interface RectangleProps {\r\n readonly left: number;\r\n readonly top: number;\r\n readonly right: number;\r\n readonly bottom: number;\r\n}\r\n\r\n/** Available corners of [[Rectangle]].\r\n * @internal\r\n */\r\nexport enum Corner {\r\n TopLeft,\r\n TopRight,\r\n BottomRight,\r\n BottomLeft,\r\n}\r\n\r\n/** Describes and provides methods to work with 2d bounds.\r\n * @internal\r\n */\r\nexport class Rectangle implements RectangleProps {\r\n /** Creates rectangle from [[RectangleProps]]. */\r\n public static create(props: RectangleProps): Rectangle {\r\n return new Rectangle(props.left, props.top, props.right, props.bottom);\r\n }\r\n\r\n /** Creates rectangle from [[SizeProps]]. */\r\n public static createFromSize(size: SizeProps): Rectangle {\r\n return new Rectangle(0, 0, size.width, size.height);\r\n }\r\n\r\n /** Create a rectangle with 2 pairs of xy candidates. Theses are compared and shuffled as needed for the rectangle. */\r\n public static createXYXY(xA: number, yA: number, xB: number, yB: number): Rectangle {\r\n return new Rectangle(\r\n Math.min(xA, xB), Math.min(yA, yB),\r\n Math.max(xA, xB), Math.max(yA, yB));\r\n }\r\n\r\n /** Creates rectangle with specified bounds. */\r\n public constructor(public readonly left = 0, public readonly top = 0, public readonly right = 0, public readonly bottom = 0) {\r\n }\r\n\r\n /** @returns Size of this rectangle. */\r\n public getSize(): Size {\r\n const width = this.getWidth();\r\n const height = this.getHeight();\r\n return new Size(width, height);\r\n }\r\n\r\n /** @returns Width of this rectangle. */\r\n public getWidth(): number {\r\n return this.right - this.left;\r\n }\r\n\r\n /** @returns Height of this rectangle. */\r\n public getHeight(): number {\r\n return this.bottom - this.top;\r\n }\r\n\r\n /** @returns Position of specified corner. */\r\n public getCorner(corner: Corner): Point {\r\n switch (corner) {\r\n case Corner.TopLeft: {\r\n return this.topLeft();\r\n }\r\n case Corner.TopRight: {\r\n return new Point(this.right, this.top);\r\n }\r\n case Corner.BottomLeft: {\r\n return new Point(this.left, this.bottom);\r\n }\r\n case Corner.BottomRight: {\r\n return new Point(this.right, this.bottom);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Inset the bounds of this rectangle.\r\n * @note Negative arguments will increase the size of rectangle.\r\n * @returns New [[Rectangle]] with modified bounds.\r\n */\r\n public inset(left: number, top: number, right: number, bottom: number): Rectangle {\r\n return new Rectangle(this.left + left, this.top + top, this.right - right, this.bottom - bottom);\r\n }\r\n\r\n /**\r\n * Offsets the rectangle along the X and Y axes.\r\n * @returns New [[Rectangle]] with modified position.\r\n */\r\n public offset(offset: PointProps): Rectangle {\r\n return new Rectangle(this.left + offset.x, this.top + offset.y, this.right + offset.x, this.bottom + offset.y);\r\n }\r\n\r\n /**\r\n * Offsets the rectangle along the X axis.\r\n * @returns New [[Rectangle]] with modified position along X axis.\r\n */\r\n public offsetX(offset: number): Rectangle {\r\n return new Rectangle(this.left + offset, this.top, this.right + offset, this.bottom);\r\n }\r\n\r\n /**\r\n * Offsets the rectangle along the Y axis.\r\n * @returns New [[Rectangle]] with modified position along Y axis.\r\n */\r\n public offsetY(offset: number): Rectangle {\r\n return new Rectangle(this.left, this.top + offset, this.right, this.bottom + offset);\r\n }\r\n\r\n /**\r\n * Moves the top left corner of rectangle to specified point.\r\n * @returns New [[Rectangle]] with modified position.\r\n */\r\n public setPosition(position: PointProps): Rectangle {\r\n return new Rectangle(position.x, position.y, position.x + this.getWidth(), position.y + this.getHeight());\r\n }\r\n\r\n /**\r\n * Sets the height of the rectangle.\r\n * @note Only [[Edge.Bottom]] is subject to change.\r\n * @returns New [[Rectangle]] with modified height.\r\n */\r\n public setHeight(height: number): Rectangle {\r\n return new Rectangle(this.left, this.top, this.right, this.top + height);\r\n }\r\n\r\n /**\r\n * Sets the width of the rectangle.\r\n * @note Only [[Edge.Right]] is subject to change.\r\n * @returns New [[Rectangle]] with modified width.\r\n */\r\n public setWidth(width: number): Rectangle {\r\n return new Rectangle(this.left, this.top, this.left + width, this.bottom);\r\n }\r\n\r\n /**\r\n * Sets the height and width of the rectangle.\r\n * @note Only [[Edge.Bottom]] and [[Edge.Right]] are subjects to change.\r\n * @returns New [[Rectangle]] with modified height.\r\n */\r\n public setSize(size: SizeProps): Rectangle {\r\n return new Rectangle(this.left, this.top, this.left + size.width, this.top + size.height);\r\n }\r\n\r\n /** Checks if bounds of two rectangles match. */\r\n public equals(other: RectangleProps): boolean {\r\n if (this.left === other.left &&\r\n this.top === other.top &&\r\n this.right === other.right &&\r\n this.bottom === other.bottom)\r\n return true;\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Checks if point is within bounds of the rectangle.\r\n * @note Inclusive.\r\n */\r\n public containsPoint(point: PointProps): boolean {\r\n return point.x >= this.left && point.x <= this.right && point.y >= this.top && point.y <= this.bottom;\r\n }\r\n\r\n /**\r\n * Checks if a point given as x,y is within the rectangle.\r\n * @note Inclusive.\r\n */\r\n public containsXY(x: number, y: number): boolean {\r\n return this.containsPoint({x, y});\r\n }\r\n\r\n /**\r\n * @returns true if this rectangle contains other rectangle.\r\n * @note Inclusive.\r\n */\r\n public contains(other: RectangleProps): boolean {\r\n return other.left >= this.left && other.right <= this.right && other.top >= this.top && other.bottom <= this.bottom;\r\n }\r\n\r\n /** @returns New [[Rectangle]] which is contained in other rectangle. */\r\n public containIn(other: RectangleProps): Rectangle {\r\n let contained: Rectangle = this.containVerticallyIn(other);\r\n contained = contained.containHorizontallyIn(other);\r\n return contained;\r\n }\r\n\r\n /** @returns New [[Rectangle]] which is vertically contained in other rectangle. */\r\n public containVerticallyIn(other: RectangleProps): Rectangle {\r\n const contained = this.offsetY(Math.min(other.bottom - this.bottom, 0));\r\n return contained.offsetY(Math.max(other.top - contained.top, 0));\r\n }\r\n\r\n /** @returns New [[Rectangle]] which is horizontally contained in other rectangle. */\r\n public containHorizontallyIn(other: RectangleProps): Rectangle {\r\n const contained = this.offsetX(Math.min(other.right - this.right, 0));\r\n return contained.offsetX(Math.max(other.left - contained.left, 0));\r\n }\r\n\r\n /** @returns [[Corner.TopLeft]] position of this rectangle. */\r\n public topLeft(): Point {\r\n return new Point(this.left, this.top);\r\n }\r\n\r\n /** @returns Center point position of this rectangle. */\r\n public center(): Point {\r\n const x = this.left + (this.right - this.left) / 2;\r\n const y = this.top + (this.bottom - this.top) / 2;\r\n return new Point(x, y);\r\n }\r\n\r\n /** @returns true if this rectangle intersects other rectangle. */\r\n public intersects(other: RectangleProps): boolean {\r\n return this.left < other.right && this.right > other.left &&\r\n this.top < other.bottom && this.bottom > other.top;\r\n }\r\n\r\n /**\r\n * Merges outer edges of this and other rectangles.\r\n * @returns New [[Rectangle]] with merged bounds.\r\n */\r\n public outerMergeWith(other: RectangleProps): Rectangle {\r\n const left = Math.min(this.left, other.left);\r\n const top = Math.min(this.top, other.top);\r\n const right = Math.max(this.right, other.right);\r\n const bottom = Math.max(this.bottom, other.bottom);\r\n return new Rectangle(left, top, right, bottom);\r\n }\r\n\r\n /**\r\n * Vertically divides this rectangle into specified number of equal height segments.\r\n * @returns Vertical rectangle segment.\r\n */\r\n public getVerticalSegmentBounds(segmentId: number, numberOfSegments: number): Rectangle {\r\n const segmentHeight = this.getHeight() / numberOfSegments;\r\n\r\n const top = segmentId * segmentHeight;\r\n return this.inset(0, top, 0, 0).setHeight(segmentHeight);\r\n }\r\n\r\n /**\r\n * Horizontally divides this rectangle into specified number of equal width segments.\r\n * @returns Horizontal rectangle segment.\r\n */\r\n public getHorizontalSegmentBounds(segmentId: number, numberOfSegments: number): Rectangle {\r\n const segmentWidth = this.getWidth() / numberOfSegments;\r\n\r\n const left = segmentId * segmentWidth;\r\n return this.inset(left, 0, 0, 0).setWidth(segmentWidth);\r\n }\r\n\r\n /**\r\n * Calculates the shortest distance between this rectangle and a given point.\r\n * @returns The shortest distance to a point.\r\n */\r\n public getShortestDistanceToPoint(point: PointProps): number {\r\n let shortestDistance = 0;\r\n\r\n if (point.x < this.left) {\r\n if (point.y < this.top)\r\n shortestDistance = UiGeometry.hypotenuseXY(this.left - point.x, this.top - point.y);\r\n else if (point.y <= this.bottom)\r\n shortestDistance = this.left - point.x;\r\n else\r\n shortestDistance = UiGeometry.hypotenuseXY(this.left - point.x, this.bottom - point.y);\r\n } else if (point.x <= this.right) {\r\n if (point.y < this.top)\r\n shortestDistance = this.top - point.y;\r\n else if (point.y <= this.bottom)\r\n shortestDistance = 0;\r\n else\r\n shortestDistance = point.y - this.bottom;\r\n } else {\r\n if (point.y < this.top)\r\n shortestDistance = UiGeometry.hypotenuseXY(this.right - point.x, this.top - point.y);\r\n else if (point.y <= this.bottom)\r\n shortestDistance = point.x - this.right;\r\n else\r\n shortestDistance = UiGeometry.hypotenuseXY(this.right - point.x, this.bottom - point.y);\r\n }\r\n\r\n return shortestDistance;\r\n }\r\n\r\n /** @returns [[RectangleProps]] object for this rectangle. */\r\n public toProps(): RectangleProps {\r\n return {\r\n bottom: this.bottom,\r\n left: this.left,\r\n right: this.right,\r\n top: this.top,\r\n };\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Rectangle.js","sourceRoot":"","sources":["../../../../src/core-react/utils/Rectangle.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,mCAAgC;AAEhC,iCAA8B;AAC9B,6CAA0C;AAY1C;;GAEG;AACH,IAAY,MAKX;AALD,WAAY,MAAM;IAChB,yCAAO,CAAA;IACP,2CAAQ,CAAA;IACR,iDAAW,CAAA;IACX,+CAAU,CAAA;AACZ,CAAC,EALW,MAAM,GAAN,cAAM,KAAN,cAAM,QAKjB;AAED;;GAEG;AACH,MAAa,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,cA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IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CACtB,CAAC;SACL;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;AA7VD,8BA6VC","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 type { PointProps } from \"@itwin/appui-abstract\";\nimport { Point } from \"./Point\";\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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollPositionMaintainer.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/ScrollPositionMaintainer.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,qBAAa,wBAAyB,YAAW,WAAW;IAC1D,OAAO,CAAC,QAAQ,CAAuB;gBACpB,EAAE,EAAE,OAAO;IAIvB,OAAO;
|
|
1
|
+
{"version":3,"file":"ScrollPositionMaintainer.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/ScrollPositionMaintainer.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,qBAAa,wBAAyB,YAAW,WAAW;IAC1D,OAAO,CAAC,QAAQ,CAAuB;gBACpB,EAAE,EAAE,OAAO;IAIvB,OAAO;IAGd,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAWlC,OAAO,CAAC,MAAM,CAAC,sBAAsB;CAGtC"}
|
|
@@ -18,7 +18,9 @@ class ScrollPositionMaintainer {
|
|
|
18
18
|
this._storage = new Map();
|
|
19
19
|
ScrollPositionMaintainer.saveScrollPositions([el], this._storage);
|
|
20
20
|
}
|
|
21
|
-
dispose() {
|
|
21
|
+
dispose() {
|
|
22
|
+
ScrollPositionMaintainer.restoreScrollPositions(this._storage);
|
|
23
|
+
}
|
|
22
24
|
static saveScrollPositions(elems, storage) {
|
|
23
25
|
for (const el of elems) {
|
|
24
26
|
// istanbul ignore else
|
|
@@ -30,7 +32,7 @@ class ScrollPositionMaintainer {
|
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
static restoreScrollPositions(storage) {
|
|
33
|
-
storage.forEach((scrollTop, el) => el.scrollTop = scrollTop);
|
|
35
|
+
storage.forEach((scrollTop, el) => (el.scrollTop = scrollTop));
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
38
|
exports.ScrollPositionMaintainer = ScrollPositionMaintainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollPositionMaintainer.js","sourceRoot":"","sources":["../../../../src/core-react/utils/ScrollPositionMaintainer.ts"],"names":[],"mappings":";;;AASA;;;;;;;;;;;GAWG;AACH,MAAa,wBAAwB;IAEnC,YAAmB,EAAW;QAC5B,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;QAC1B,wBAAwB,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACpE,CAAC;IACM,OAAO,
|
|
1
|
+
{"version":3,"file":"ScrollPositionMaintainer.js","sourceRoot":"","sources":["../../../../src/core-react/utils/ScrollPositionMaintainer.ts"],"names":[],"mappings":";;;AASA;;;;;;;;;;;GAWG;AACH,MAAa,wBAAwB;IAEnC,YAAmB,EAAW;QAC5B,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;QAC1B,wBAAwB,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACpE,CAAC;IACM,OAAO;QACZ,wBAAwB,CAAC,sBAAsB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjE,CAAC;IACO,MAAM,CAAC,mBAAmB,CAChC,KAAiC,EACjC,OAA6B;QAE7B,KAAK,MAAM,EAAE,IAAI,KAAK,EAAE;YACtB,uBAAuB;YACvB,IAAI,EAAE,CAAC,SAAS;gBAAE,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC;YAChD,uBAAuB;YACvB,IAAI,EAAE,CAAC,QAAQ;gBAAE,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;SACjE;IACH,CAAC;IACO,MAAM,CAAC,sBAAsB,CAAC,OAA6B;QACjE,OAAO,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC;IACjE,CAAC;CACF;AAvBD,4DAuBC","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 { IDisposable } from \"@itwin/core-bentley\";\n\n/**\n * A helper class to recursively save and restore scroll positions.\n * Usage:\n * ```ts\n * // scroll positions are saved when `ScrollPositionMaintainer` object is created\n * const maintainer = new ScrollPositionMaintainer(element);\n * // can do something with `element` here\n * // disposing the `maintainer` object restores scroll positions\n * maintainer.dispose();\n * ```\n * @public\n */\nexport class ScrollPositionMaintainer implements IDisposable {\n private _storage: Map<Element, number>;\n public constructor(el: Element) {\n this._storage = new Map();\n ScrollPositionMaintainer.saveScrollPositions([el], this._storage);\n }\n public dispose() {\n ScrollPositionMaintainer.restoreScrollPositions(this._storage);\n }\n private static saveScrollPositions(\n elems: Element[] | HTMLCollection,\n storage: Map<Element, number>\n ) {\n for (const el of elems) {\n // istanbul ignore else\n if (el.scrollTop) storage.set(el, el.scrollTop);\n // istanbul ignore else\n if (el.children) this.saveScrollPositions(el.children, storage);\n }\n }\n private static restoreScrollPositions(storage: Map<Element, number>) {\n storage.forEach((scrollTop, el) => (el.scrollTop = scrollTop));\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Size.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/Size.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;GAEG;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;
|
|
1
|
+
{"version":3,"file":"Size.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/Size.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;GAEG;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"}
|