@itwin/core-react 4.0.0-dev.2 → 4.0.0-dev.20
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 +144 -7
- package/ContributeGuidelines.md +17 -14
- package/LICENSE.md +1 -1
- package/README.md +2 -2
- package/lib/cjs/core-react/UiCore.js +1 -1
- package/lib/cjs/core-react/UiCore.js.map +1 -1
- package/lib/cjs/core-react/autosuggest/AutoSuggest.d.ts +2 -2
- package/lib/cjs/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
- package/lib/cjs/core-react/autosuggest/AutoSuggest.js +1 -1
- package/lib/cjs/core-react/autosuggest/AutoSuggest.js.map +1 -1
- package/lib/cjs/core-react/autosuggest/AutoSuggest.scss +5 -8
- package/lib/cjs/core-react/badge/BetaBadge.d.ts +0 -1
- package/lib/cjs/core-react/badge/BetaBadge.d.ts.map +1 -1
- package/lib/cjs/core-react/badge/BetaBadge.js +0 -1
- package/lib/cjs/core-react/badge/BetaBadge.js.map +1 -1
- package/lib/cjs/core-react/badge/NewBadge.scss +1 -1
- package/lib/cjs/core-react/base/Gap.js +1 -1
- package/lib/cjs/core-react/base/Gap.js.map +1 -1
- package/lib/cjs/core-react/checklistbox/CheckListBox.scss +1 -2
- package/lib/cjs/core-react/classes.scss +0 -3
- package/lib/cjs/core-react/colorthemes.scss +5 -34
- package/lib/cjs/core-react/colorvariables.scss +53 -76
- package/lib/cjs/core-react/contextmenu/ContextMenu.d.ts +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.js +2 -3
- package/lib/cjs/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.scss +12 -13
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.js +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.d.ts +1 -1
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.js +5 -2
- 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 +6 -4
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/TildeFinder.js +1 -1
- package/lib/cjs/core-react/contextmenu/TildeFinder.js.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.d.ts.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.js +18 -10
- package/lib/cjs/core-react/dialog/Dialog.js.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.scss +23 -22
- package/lib/cjs/core-react/dialog/GlobalDialog.js +1 -2
- package/lib/cjs/core-react/dialog/GlobalDialog.js.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.js +2 -2
- package/lib/cjs/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.scss +1 -1
- package/lib/cjs/core-react/expandable/ExpandableList.js +1 -1
- package/lib/cjs/core-react/expandable/ExpandableList.js.map +1 -1
- package/lib/cjs/core-react/expandable/list.scss +5 -5
- package/lib/cjs/core-react/focus/ItemKeyboardNavigator.d.ts +1 -1
- package/lib/cjs/core-react/focus/ItemKeyboardNavigator.d.ts.map +1 -1
- package/lib/cjs/core-react/hocs/withOnOutsideClick.js +1 -2
- package/lib/cjs/core-react/hocs/withOnOutsideClick.js.map +1 -1
- package/lib/cjs/core-react/icons/ConditionalIconItem.d.ts +27 -0
- package/lib/cjs/core-react/icons/ConditionalIconItem.d.ts.map +1 -0
- package/lib/cjs/core-react/icons/ConditionalIconItem.js +65 -0
- package/lib/cjs/core-react/icons/ConditionalIconItem.js.map +1 -0
- package/lib/cjs/core-react/icons/IconComponent.d.ts +3 -2
- package/lib/cjs/core-react/icons/IconComponent.d.ts.map +1 -1
- package/lib/cjs/core-react/icons/IconComponent.js +1 -7
- package/lib/cjs/core-react/icons/IconComponent.js.map +1 -1
- package/lib/cjs/core-react/icons/SvgPath.d.ts +1 -1
- package/lib/cjs/core-react/icons/SvgPath.d.ts.map +1 -1
- package/lib/cjs/core-react/icons/SvgPath.js +2 -2
- package/lib/cjs/core-react/icons/SvgPath.js.map +1 -1
- package/lib/cjs/core-react/icons/{SvgSprite.scss → SvgPath.scss} +1 -1
- package/lib/cjs/core-react/icons/WebFontIcon.d.ts +0 -1
- package/lib/cjs/core-react/icons/WebFontIcon.d.ts.map +1 -1
- package/lib/cjs/core-react/icons/WebFontIcon.js +0 -1
- package/lib/cjs/core-react/icons/WebFontIcon.js.map +1 -1
- package/lib/cjs/core-react/icons/variables.scss +0 -9
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.scss +2 -2
- package/lib/cjs/core-react/index.scss +0 -2
- package/lib/cjs/core-react/inputs/InputLabel.d.ts.map +1 -1
- package/lib/cjs/core-react/inputs/InputLabel.js +9 -1
- package/lib/cjs/core-react/inputs/InputLabel.js.map +1 -1
- package/lib/cjs/core-react/inputs/input-label.scss +2 -2
- package/lib/cjs/core-react/inputs/input.scss +7 -7
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts +6 -1
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.js +13 -8
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.js.map +1 -1
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.scss +12 -13
- package/lib/cjs/core-react/inputs/variables.scss +4 -4
- package/lib/cjs/core-react/listbox/Listbox.d.ts +1 -1
- package/lib/cjs/core-react/listbox/Listbox.d.ts.map +1 -1
- package/lib/cjs/core-react/listbox/Listbox.js +2 -3
- package/lib/cjs/core-react/listbox/Listbox.js.map +1 -1
- package/lib/cjs/core-react/listbox/Listbox.scss +8 -8
- package/lib/cjs/core-react/loading/LoadingBar.js +1 -1
- package/lib/cjs/core-react/loading/LoadingBar.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingPrompt.js +1 -1
- package/lib/cjs/core-react/loading/LoadingPrompt.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingPrompt.scss +2 -2
- package/lib/cjs/core-react/loading/LoadingSpinner.d.ts +1 -1
- package/lib/cjs/core-react/loading/LoadingSpinner.d.ts.map +1 -1
- package/lib/cjs/core-react/loading/LoadingSpinner.js +1 -1
- package/lib/cjs/core-react/loading/LoadingSpinner.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingSpinner.scss +1 -1
- package/lib/cjs/core-react/loading/LoadingStatus.js +1 -1
- package/lib/cjs/core-react/loading/LoadingStatus.js.map +1 -1
- package/lib/cjs/core-react/messagebox/MessageBox.d.ts +13 -1
- package/lib/cjs/core-react/messagebox/MessageBox.d.ts.map +1 -1
- package/lib/cjs/core-react/messagebox/MessageBox.js +55 -11
- package/lib/cjs/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/cjs/core-react/messagebox/MessageBox.scss +24 -14
- package/lib/cjs/core-react/notification/MessageRenderer.js +1 -1
- package/lib/cjs/core-react/notification/MessageRenderer.js.map +1 -1
- package/lib/cjs/core-react/notification/MessageType.d.ts +1 -1
- package/lib/cjs/core-react/notification/MessageType.d.ts.map +1 -1
- package/lib/cjs/core-react/popup/Popup.d.ts.map +1 -1
- package/lib/cjs/core-react/popup/Popup.js +7 -8
- package/lib/cjs/core-react/popup/Popup.js.map +1 -1
- package/lib/cjs/core-react/popup/Popup.scss +5 -5
- package/lib/cjs/core-react/radialmenu/RadialMenu.js +1 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.scss +1 -1
- package/lib/cjs/core-react/searchbox/SearchBox.d.ts.map +1 -1
- package/lib/cjs/core-react/searchbox/SearchBox.js +8 -6
- package/lib/cjs/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/cjs/core-react/searchbox/SearchBox.scss +5 -9
- package/lib/cjs/core-react/settings/SettingsContainer.js +1 -1
- package/lib/cjs/core-react/settings/SettingsContainer.js.map +1 -1
- package/lib/cjs/core-react/settings/SettingsContainer.scss +3 -1
- package/lib/cjs/core-react/style/index.scss +0 -7
- package/lib/cjs/core-react/style/mixins.scss +2 -2
- package/lib/cjs/core-react/style/themecolors.scss +0 -6
- package/lib/cjs/core-react/tabs/tabs.scss +10 -20
- package/lib/cjs/core-react/tabs/vertical.scss +6 -13
- package/lib/cjs/core-react/text/BlockText.d.ts.map +1 -1
- package/lib/cjs/core-react/text/BlockText.js +1 -0
- package/lib/cjs/core-react/text/BlockText.js.map +1 -1
- package/lib/cjs/core-react/text/BodyText.d.ts +1 -0
- package/lib/cjs/core-react/text/BodyText.d.ts.map +1 -1
- package/lib/cjs/core-react/text/BodyText.js +2 -0
- package/lib/cjs/core-react/text/BodyText.js.map +1 -1
- package/lib/cjs/core-react/text/DisabledText.d.ts.map +1 -1
- package/lib/cjs/core-react/text/DisabledText.js +1 -0
- package/lib/cjs/core-react/text/DisabledText.js.map +1 -1
- package/lib/cjs/core-react/text/FilteredText.js +3 -3
- package/lib/cjs/core-react/text/FilteredText.js.map +1 -1
- package/lib/cjs/core-react/text/MutedText.d.ts +1 -0
- package/lib/cjs/core-react/text/MutedText.d.ts.map +1 -1
- package/lib/cjs/core-react/text/MutedText.js +2 -0
- package/lib/cjs/core-react/text/MutedText.js.map +1 -1
- package/lib/cjs/core-react/text/StyledText.d.ts +1 -0
- package/lib/cjs/core-react/text/StyledText.d.ts.map +1 -1
- package/lib/cjs/core-react/text/StyledText.js +1 -0
- package/lib/cjs/core-react/text/StyledText.js.map +1 -1
- package/lib/cjs/core-react/text/block.scss +9 -4
- package/lib/cjs/core-react/text/body.scss +7 -4
- package/lib/cjs/core-react/text/mixins.scss +3 -3
- package/lib/cjs/core-react/tree/ExpansionToggle.d.ts.map +1 -1
- package/lib/cjs/core-react/tree/ExpansionToggle.js +3 -1
- package/lib/cjs/core-react/tree/ExpansionToggle.js.map +1 -1
- package/lib/cjs/core-react/tree/ExpansionToggle.scss +9 -5
- package/lib/cjs/core-react/tree/Node.d.ts +2 -2
- package/lib/cjs/core-react/tree/Node.d.ts.map +1 -1
- package/lib/cjs/core-react/tree/Node.js +2 -3
- package/lib/cjs/core-react/tree/Node.js.map +1 -1
- package/lib/cjs/core-react/tree/Node.scss +3 -19
- package/lib/cjs/core-react/tree/Placeholder.scss +1 -4
- package/lib/cjs/core-react/utils/IconWebComponent.js +1 -1
- package/lib/cjs/core-react/utils/IconWebComponent.js.map +1 -1
- package/lib/cjs/core-react/utils/Point.js +4 -4
- package/lib/cjs/core-react/utils/Point.js.map +1 -1
- package/lib/cjs/core-react/utils/Props.d.ts +1 -1
- package/lib/cjs/core-react/utils/Props.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/Rectangle.js +7 -7
- package/lib/cjs/core-react/utils/Rectangle.js.map +1 -1
- package/lib/cjs/core-react/utils/Size.js +4 -4
- package/lib/cjs/core-react/utils/Size.js.map +1 -1
- package/lib/cjs/core-react/utils/Timer.d.ts +1 -1
- package/lib/cjs/core-react/utils/Timer.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/getBestBWContrastColor.js +3 -3
- package/lib/cjs/core-react/utils/getBestBWContrastColor.js.map +1 -1
- package/lib/cjs/core-react/utils/getCssVariable.js +1 -1
- package/lib/cjs/core-react/utils/getCssVariable.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.d.ts +1 -1
- package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js +1 -2
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useOnOutsideClick.d.ts +1 -1
- package/lib/cjs/core-react/utils/hooks/useOnOutsideClick.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useProximityToMouse.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useProximityToMouse.js +2 -2
- package/lib/cjs/core-react/utils/hooks/useProximityToMouse.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useRefs.d.ts +1 -1
- package/lib/cjs/core-react/utils/hooks/useRefs.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useRefs.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js +8 -13
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/cjs/core-react/utils/typeUtils.d.ts +1 -1
- package/lib/cjs/core-react/utils/typeUtils.d.ts.map +1 -1
- package/lib/cjs/core-react.d.ts +1 -1
- package/lib/cjs/core-react.d.ts.map +1 -1
- package/lib/cjs/core-react.js +6 -2
- package/lib/cjs/core-react.js.map +1 -1
- package/lib/esm/core-react/UiCore.js +2 -1
- package/lib/esm/core-react/UiCore.js.map +1 -1
- package/lib/esm/core-react/autosuggest/AutoSuggest.d.ts +2 -2
- package/lib/esm/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
- package/lib/esm/core-react/autosuggest/AutoSuggest.js +1 -1
- package/lib/esm/core-react/autosuggest/AutoSuggest.js.map +1 -1
- package/lib/esm/core-react/autosuggest/AutoSuggest.scss +5 -8
- package/lib/esm/core-react/badge/BetaBadge.d.ts +0 -1
- package/lib/esm/core-react/badge/BetaBadge.d.ts.map +1 -1
- package/lib/esm/core-react/badge/BetaBadge.js +0 -1
- package/lib/esm/core-react/badge/BetaBadge.js.map +1 -1
- package/lib/esm/core-react/badge/NewBadge.scss +1 -1
- package/lib/esm/core-react/base/Gap.js +1 -1
- package/lib/esm/core-react/base/Gap.js.map +1 -1
- package/lib/esm/core-react/checklistbox/CheckListBox.scss +1 -2
- package/lib/esm/core-react/classes.scss +0 -3
- package/lib/esm/core-react/colorthemes.scss +5 -34
- package/lib/esm/core-react/colorvariables.scss +53 -76
- package/lib/esm/core-react/contextmenu/ContextMenu.d.ts +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.js +3 -3
- package/lib/esm/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.scss +12 -13
- package/lib/esm/core-react/contextmenu/ContextMenuItem.js +2 -1
- package/lib/esm/core-react/contextmenu/ContextMenuItem.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextSubMenu.d.ts +1 -1
- package/lib/esm/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextSubMenu.js +6 -2
- 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 +6 -4
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/TildeFinder.js +2 -1
- package/lib/esm/core-react/contextmenu/TildeFinder.js.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.d.ts.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.js +19 -10
- package/lib/esm/core-react/dialog/Dialog.js.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.scss +23 -22
- package/lib/esm/core-react/dialog/GlobalDialog.js +1 -2
- package/lib/esm/core-react/dialog/GlobalDialog.js.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.js +2 -2
- package/lib/esm/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.scss +1 -1
- package/lib/esm/core-react/expandable/ExpandableList.js +2 -1
- package/lib/esm/core-react/expandable/ExpandableList.js.map +1 -1
- package/lib/esm/core-react/expandable/list.scss +5 -5
- package/lib/esm/core-react/focus/ItemKeyboardNavigator.d.ts +1 -1
- package/lib/esm/core-react/focus/ItemKeyboardNavigator.d.ts.map +1 -1
- package/lib/esm/core-react/hocs/withOnOutsideClick.js +1 -2
- package/lib/esm/core-react/hocs/withOnOutsideClick.js.map +1 -1
- package/lib/esm/core-react/icons/ConditionalIconItem.d.ts +27 -0
- package/lib/esm/core-react/icons/ConditionalIconItem.d.ts.map +1 -0
- package/lib/esm/core-react/icons/ConditionalIconItem.js +61 -0
- package/lib/esm/core-react/icons/ConditionalIconItem.js.map +1 -0
- package/lib/esm/core-react/icons/IconComponent.d.ts +3 -2
- package/lib/esm/core-react/icons/IconComponent.d.ts.map +1 -1
- package/lib/esm/core-react/icons/IconComponent.js +1 -7
- package/lib/esm/core-react/icons/IconComponent.js.map +1 -1
- package/lib/esm/core-react/icons/SvgPath.d.ts +1 -1
- package/lib/esm/core-react/icons/SvgPath.d.ts.map +1 -1
- package/lib/esm/core-react/icons/SvgPath.js +2 -2
- package/lib/esm/core-react/icons/SvgPath.js.map +1 -1
- package/lib/esm/core-react/icons/{SvgSprite.scss → SvgPath.scss} +1 -1
- package/lib/esm/core-react/icons/WebFontIcon.d.ts +0 -1
- package/lib/esm/core-react/icons/WebFontIcon.d.ts.map +1 -1
- package/lib/esm/core-react/icons/WebFontIcon.js +0 -1
- package/lib/esm/core-react/icons/WebFontIcon.js.map +1 -1
- package/lib/esm/core-react/icons/variables.scss +0 -9
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.scss +2 -2
- package/lib/esm/core-react/index.scss +0 -2
- package/lib/esm/core-react/inputs/InputLabel.d.ts.map +1 -1
- package/lib/esm/core-react/inputs/InputLabel.js +9 -1
- package/lib/esm/core-react/inputs/InputLabel.js.map +1 -1
- package/lib/esm/core-react/inputs/input-label.scss +2 -2
- package/lib/esm/core-react/inputs/input.scss +7 -7
- package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts +6 -1
- package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
- package/lib/esm/core-react/inputs/numberinput/NumberInput.js +13 -8
- package/lib/esm/core-react/inputs/numberinput/NumberInput.js.map +1 -1
- package/lib/esm/core-react/inputs/numberinput/NumberInput.scss +12 -13
- package/lib/esm/core-react/inputs/variables.scss +4 -4
- package/lib/esm/core-react/listbox/Listbox.d.ts +1 -1
- package/lib/esm/core-react/listbox/Listbox.d.ts.map +1 -1
- package/lib/esm/core-react/listbox/Listbox.js +2 -3
- package/lib/esm/core-react/listbox/Listbox.js.map +1 -1
- package/lib/esm/core-react/listbox/Listbox.scss +8 -8
- package/lib/esm/core-react/loading/LoadingBar.js +2 -1
- package/lib/esm/core-react/loading/LoadingBar.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingPrompt.js +2 -1
- package/lib/esm/core-react/loading/LoadingPrompt.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingPrompt.scss +2 -2
- package/lib/esm/core-react/loading/LoadingSpinner.d.ts +1 -1
- package/lib/esm/core-react/loading/LoadingSpinner.d.ts.map +1 -1
- package/lib/esm/core-react/loading/LoadingSpinner.js +2 -1
- package/lib/esm/core-react/loading/LoadingSpinner.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingSpinner.scss +1 -1
- package/lib/esm/core-react/loading/LoadingStatus.js +2 -1
- package/lib/esm/core-react/loading/LoadingStatus.js.map +1 -1
- package/lib/esm/core-react/messagebox/MessageBox.d.ts +13 -1
- package/lib/esm/core-react/messagebox/MessageBox.d.ts.map +1 -1
- package/lib/esm/core-react/messagebox/MessageBox.js +56 -11
- package/lib/esm/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/esm/core-react/messagebox/MessageBox.scss +24 -14
- package/lib/esm/core-react/notification/MessageRenderer.js +1 -1
- package/lib/esm/core-react/notification/MessageRenderer.js.map +1 -1
- package/lib/esm/core-react/notification/MessageType.d.ts +1 -1
- package/lib/esm/core-react/notification/MessageType.d.ts.map +1 -1
- package/lib/esm/core-react/popup/Popup.d.ts.map +1 -1
- package/lib/esm/core-react/popup/Popup.js +8 -8
- package/lib/esm/core-react/popup/Popup.js.map +1 -1
- package/lib/esm/core-react/popup/Popup.scss +5 -5
- package/lib/esm/core-react/radialmenu/RadialMenu.js +2 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.scss +1 -1
- package/lib/esm/core-react/searchbox/SearchBox.d.ts.map +1 -1
- package/lib/esm/core-react/searchbox/SearchBox.js +8 -6
- package/lib/esm/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/esm/core-react/searchbox/SearchBox.scss +5 -9
- package/lib/esm/core-react/settings/SettingsContainer.js +1 -1
- package/lib/esm/core-react/settings/SettingsContainer.js.map +1 -1
- package/lib/esm/core-react/settings/SettingsContainer.scss +3 -1
- package/lib/esm/core-react/style/index.scss +0 -7
- package/lib/esm/core-react/style/mixins.scss +2 -2
- package/lib/esm/core-react/style/themecolors.scss +0 -6
- package/lib/esm/core-react/tabs/tabs.scss +10 -20
- package/lib/esm/core-react/tabs/vertical.scss +6 -13
- package/lib/esm/core-react/text/BlockText.d.ts.map +1 -1
- package/lib/esm/core-react/text/BlockText.js +1 -0
- package/lib/esm/core-react/text/BlockText.js.map +1 -1
- package/lib/esm/core-react/text/BodyText.d.ts +1 -0
- package/lib/esm/core-react/text/BodyText.d.ts.map +1 -1
- package/lib/esm/core-react/text/BodyText.js +2 -0
- package/lib/esm/core-react/text/BodyText.js.map +1 -1
- package/lib/esm/core-react/text/DisabledText.d.ts.map +1 -1
- package/lib/esm/core-react/text/DisabledText.js +1 -0
- package/lib/esm/core-react/text/DisabledText.js.map +1 -1
- package/lib/esm/core-react/text/FilteredText.js +3 -3
- package/lib/esm/core-react/text/FilteredText.js.map +1 -1
- package/lib/esm/core-react/text/MutedText.d.ts +1 -0
- package/lib/esm/core-react/text/MutedText.d.ts.map +1 -1
- package/lib/esm/core-react/text/MutedText.js +2 -0
- package/lib/esm/core-react/text/MutedText.js.map +1 -1
- package/lib/esm/core-react/text/StyledText.d.ts +1 -0
- package/lib/esm/core-react/text/StyledText.d.ts.map +1 -1
- package/lib/esm/core-react/text/StyledText.js +1 -0
- package/lib/esm/core-react/text/StyledText.js.map +1 -1
- package/lib/esm/core-react/text/block.scss +9 -4
- package/lib/esm/core-react/text/body.scss +7 -4
- package/lib/esm/core-react/text/mixins.scss +3 -3
- package/lib/esm/core-react/tree/ExpansionToggle.d.ts.map +1 -1
- package/lib/esm/core-react/tree/ExpansionToggle.js +3 -1
- package/lib/esm/core-react/tree/ExpansionToggle.js.map +1 -1
- package/lib/esm/core-react/tree/ExpansionToggle.scss +9 -5
- package/lib/esm/core-react/tree/Node.d.ts +2 -2
- package/lib/esm/core-react/tree/Node.d.ts.map +1 -1
- package/lib/esm/core-react/tree/Node.js +2 -3
- package/lib/esm/core-react/tree/Node.js.map +1 -1
- package/lib/esm/core-react/tree/Node.scss +3 -19
- package/lib/esm/core-react/tree/Placeholder.scss +1 -4
- package/lib/esm/core-react/utils/IconWebComponent.js +1 -1
- package/lib/esm/core-react/utils/IconWebComponent.js.map +1 -1
- package/lib/esm/core-react/utils/Point.js +4 -4
- package/lib/esm/core-react/utils/Point.js.map +1 -1
- package/lib/esm/core-react/utils/Props.d.ts +1 -1
- package/lib/esm/core-react/utils/Props.d.ts.map +1 -1
- package/lib/esm/core-react/utils/Rectangle.js +7 -7
- package/lib/esm/core-react/utils/Rectangle.js.map +1 -1
- package/lib/esm/core-react/utils/Size.js +4 -4
- package/lib/esm/core-react/utils/Size.js.map +1 -1
- package/lib/esm/core-react/utils/Timer.d.ts +1 -1
- package/lib/esm/core-react/utils/Timer.d.ts.map +1 -1
- package/lib/esm/core-react/utils/getBestBWContrastColor.js +3 -3
- package/lib/esm/core-react/utils/getBestBWContrastColor.js.map +1 -1
- package/lib/esm/core-react/utils/getCssVariable.js +1 -1
- package/lib/esm/core-react/utils/getCssVariable.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.d.ts +1 -1
- package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js +1 -2
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useOnOutsideClick.d.ts +1 -1
- package/lib/esm/core-react/utils/hooks/useOnOutsideClick.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useProximityToMouse.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useProximityToMouse.js +2 -2
- package/lib/esm/core-react/utils/hooks/useProximityToMouse.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useRefs.d.ts +1 -1
- package/lib/esm/core-react/utils/hooks/useRefs.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useRefs.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js +8 -13
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/esm/core-react/utils/typeUtils.d.ts +1 -1
- package/lib/esm/core-react/utils/typeUtils.d.ts.map +1 -1
- package/lib/esm/core-react.d.ts +1 -1
- package/lib/esm/core-react.d.ts.map +1 -1
- package/lib/esm/core-react.js +1 -1
- package/lib/esm/core-react.js.map +1 -1
- package/package.json +26 -26
- package/ThirdPartyNotices.md +0 -28
- package/lib/cjs/core-react/badge/BetaBadge.scss +0 -9
- package/lib/cjs/core-react/button/blue-large.scss +0 -12
- package/lib/cjs/core-react/button/blue.scss +0 -25
- package/lib/cjs/core-react/button/button.scss +0 -70
- package/lib/cjs/core-react/button/classes.scss +0 -14
- package/lib/cjs/core-react/button/disabled-large.scss +0 -12
- package/lib/cjs/core-react/button/disabled.scss +0 -17
- package/lib/cjs/core-react/button/hollow-large.scss +0 -13
- package/lib/cjs/core-react/button/hollow.scss +0 -30
- package/lib/cjs/core-react/button/index.scss +0 -14
- package/lib/cjs/core-react/button/primary-large.scss +0 -12
- package/lib/cjs/core-react/button/primary.scss +0 -25
- package/lib/cjs/core-react/button/variables.scss +0 -22
- package/lib/cjs/core-react/checkbox/checkbox.scss +0 -124
- package/lib/cjs/core-react/checkbox/classes.scss +0 -8
- package/lib/cjs/core-react/checkbox/index.scss +0 -8
- package/lib/cjs/core-react/icons/SvgSprite.d.ts +0 -21
- package/lib/cjs/core-react/icons/SvgSprite.d.ts.map +0 -1
- package/lib/cjs/core-react/icons/SvgSprite.js +0 -27
- package/lib/cjs/core-react/icons/SvgSprite.js.map +0 -1
- package/lib/cjs/core-react/style/data-viz.scss +0 -20
- package/lib/cjs/core-react/style/itwinui-overrides.scss +0 -24
- package/lib/cjs/core-react/style/space.scss +0 -13
- package/lib/cjs/core-react/style/speed.scss +0 -12
- package/lib/cjs/core-react/style/typography.scss +0 -44
- package/lib/cjs/core-react/style/variables.scss +0 -12
- package/lib/esm/core-react/badge/BetaBadge.scss +0 -9
- package/lib/esm/core-react/button/blue-large.scss +0 -12
- package/lib/esm/core-react/button/blue.scss +0 -25
- package/lib/esm/core-react/button/button.scss +0 -70
- package/lib/esm/core-react/button/classes.scss +0 -14
- package/lib/esm/core-react/button/disabled-large.scss +0 -12
- package/lib/esm/core-react/button/disabled.scss +0 -17
- package/lib/esm/core-react/button/hollow-large.scss +0 -13
- package/lib/esm/core-react/button/hollow.scss +0 -30
- package/lib/esm/core-react/button/index.scss +0 -14
- package/lib/esm/core-react/button/primary-large.scss +0 -12
- package/lib/esm/core-react/button/primary.scss +0 -25
- package/lib/esm/core-react/button/variables.scss +0 -22
- package/lib/esm/core-react/checkbox/checkbox.scss +0 -124
- package/lib/esm/core-react/checkbox/classes.scss +0 -8
- package/lib/esm/core-react/checkbox/index.scss +0 -8
- package/lib/esm/core-react/icons/SvgSprite.d.ts +0 -21
- package/lib/esm/core-react/icons/SvgSprite.d.ts.map +0 -1
- package/lib/esm/core-react/icons/SvgSprite.js +0 -23
- package/lib/esm/core-react/icons/SvgSprite.js.map +0 -1
- package/lib/esm/core-react/style/data-viz.scss +0 -20
- package/lib/esm/core-react/style/itwinui-overrides.scss +0 -24
- package/lib/esm/core-react/style/space.scss +0 -13
- package/lib/esm/core-react/style/speed.scss +0 -12
- package/lib/esm/core-react/style/typography.scss +0 -44
- package/lib/esm/core-react/style/variables.scss +0 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResizeObserver.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useResizeObserver.tsx"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,+BAA+B;AAC/B,qEAA0D;AAC1D,iDAA8C;AAC9C,uCAAoC;AAEpC;;IAEI;AACJ,SAAgB,iBAAiB,CAAoB,QAAkD;IACrG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;IACpE,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAwB,IAAI,CAAC,CAAC;IACjE,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAE,kEAAkE;IACnG,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACzC,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAM,IAAI,CAAC,CAAC;IAEhD,uBAAuB;IACvB,MAAM,qBAAqB,GAAG,GAAG,EAAE;;QACjC,IAAI,MAAM,CAAC,OAAO;YAChB,eAAe,CAAC,OAAO,CAAC,oBAAoB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAE/D,MAAA,cAAc,CAAC,OAAO,0CAAE,UAAU,EAAE,CAAC;QACrC,cAAc,CAAC,OAAO,GAAG,IAAI,CAAC;IAChC,CAAC,CAAC;IAEF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC;QAC5B,OAAO,GAAG,EAAE;;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5B,MAAM,SAAS,GAAG,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC;YACvD,mBAAmB,CAAC,WAAW,IAAI,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;SAC3G;IACH,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,MAAM,aAAa,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,KAAc,EAAE,MAAe,EAAE,EAAE;QAC1E,uBAAuB;QACvB,QAAQ,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,CAAC,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,CAAC,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,uBAAuB,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;IACzD,MAAM,KAAK,GAAwB,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAEzG,OAAO,CACL,6BAAK,GAAG,EAAE,YAAY,EAAE,SAAS,EAAC,4BAA4B,EAAC,KAAK,EAAE,KAAK,IACxE,WAAW,IAAI,QAAQ,CACpB,CACP,CAAC;AACJ,CAAC;AA7BD,gEA6BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\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 * as React from \"react\";\nimport { ResizeObserver } from \"./ResizeObserverPolyfill\";\nimport { useRefEffect } from \"./useRefEffect\";\nimport { useRefs } from \"./useRefs\";\n\n/** Uses ResizeObserver API to notify about element bound changes.\n * @internal\n */\nexport function useResizeObserver<T extends Element>(onResize?: (width: number, height: number) => void) {\n const [bounds, setBounds] = React.useState({ width: 0, height: 0 });\n const resizeObserver = React.useRef<ResizeObserver | null>(null);\n const rafRef = React.useRef(0); // set to non-zero when requestAnimationFrame processing is active\n const isMountedRef = React.useRef(false);\n const owningWindowRef = React.useRef<any>(null);\n\n // istanbul ignore next\n const resizeObserverCleanup = () => {\n if (rafRef.current)\n owningWindowRef.current.cancelAnimationFrame(rafRef.current);\n\n resizeObserver.current?.disconnect();\n resizeObserver.current = null;\n };\n\n React.useEffect(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n if (rafRef.current)\n owningWindowRef.current.cancelAnimationFrame(rafRef.current);\n owningWindowRef.current?.removeEventListener(\"beforeunload\", resizeObserverCleanup);\n };\n }, []);\n\n const processResize = React.useCallback((target: HTMLElement) => {\n const newBounds = target.getBoundingClientRect();\n // istanbul ignore else\n if (isMountedRef.current && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {\n setBounds(newBounds);\n onResize && onResize(newBounds.width, newBounds.height);\n }\n }, [onResize, bounds.height, bounds.width]);\n\n const handleResize = React.useCallback((entries: any[]) => {\n // istanbul ignore if\n if (!isMountedRef.current || !Array.isArray(entries) || 0 === entries.length) {\n return;\n }\n const target = entries[0].target as HTMLElement;\n // istanbul ignore next\n owningWindowRef.current && owningWindowRef.current.removeEventListener(\"beforeunload\", resizeObserverCleanup);\n\n owningWindowRef.current = target.ownerDocument.defaultView;\n // istanbul ignore else\n if (owningWindowRef.current) {\n owningWindowRef.current.addEventListener(\"unload\", resizeObserverCleanup);\n\n // using requestAnimationFrame to stop the \"ResizeObserver loop completed with undelivered notifications.\" and\n // \"ResizeObserver loop limit exceeded\" messages reported to window.onError\n rafRef.current = owningWindowRef.current.requestAnimationFrame(() => processResize(target));\n }\n }, [processResize]);\n\n const observerRef = useRefEffect((instance: T | null) => {\n resizeObserver.current = new ResizeObserver(handleResize);\n if (instance) {\n resizeObserver.current.observe(instance);\n const newBounds = instance.getBoundingClientRect();\n onResize && onResize(newBounds.width, newBounds.height);\n setBounds(newBounds);\n }\n\n return () => {\n instance && ( /* istanbul ignore next */resizeObserver.current?.unobserve(instance));\n resizeObserver.current = null;\n };\n }, [handleResize, onResize]);\n\n const handleRef = React.useCallback((instance: Element | null) => {\n const newBounds = instance && instance.getBoundingClientRect();\n // istanbul ignore if\n if (newBounds && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {\n setBounds(newBounds);\n onResize && onResize(newBounds.width, newBounds.height);\n }\n }, [bounds.height, bounds.width, onResize]);\n\n const ref = useRefs(handleRef, observerRef);\n return ref;\n}\n\n/** React hook that uses ResizeObserver API to notify about element bound changes. Note: to work similar to ReactResizeDetector\n * width and height are initialized as undefined and only set during after mount if bounds are non-zero. This implementation properly\n * handles observing element in pop-out/child windows.\n * @internal\n */\nexport function useLayoutResizeObserver(inElement: HTMLElement | null, onResize?: (width?: number, height?: number) => void) {\n const inBoundingRect = inElement?.getBoundingClientRect();\n const [bounds, setBounds] = React.useState<{ width?: number, height?: number }>({ width: inBoundingRect?.width, height: inBoundingRect?.height });\n const [watchedElement, setWatchedElement] = React.useState(inElement);\n const resizeObserver = React.useRef<ResizeObserver | null>(null);\n const rafRef = React.useRef(0); // set to non-zero when requestAnimationFrame processing is active\n const isMountedRef = React.useRef(false);\n const owningWindowRef = React.useRef<any>(null);\n\n // istanbul ignore next\n const resizeObserverCleanup = () => {\n if (rafRef.current)\n owningWindowRef.current.cancelAnimationFrame(rafRef.current);\n\n resizeObserver.current?.disconnect();\n resizeObserver.current = null;\n };\n\n React.useEffect(() => {\n isMountedRef.current = true;\n setWatchedElement(inElement);\n\n // istanbul ignore next\n if (inElement) {\n const newBounds = inElement.getBoundingClientRect();\n onResize && onResize(newBounds.width, newBounds.height);\n setBounds(newBounds);\n }\n\n return () => {\n isMountedRef.current = false;\n (rafRef.current && owningWindowRef.current) && owningWindowRef.current.cancelAnimationFrame(rafRef.current);\n owningWindowRef.current && owningWindowRef.current.removeEventListener(\"beforeunload\", resizeObserverCleanup);\n };\n }, [onResize, inElement]);\n\n const processResize = React.useCallback((target: HTMLElement) => {\n const newBounds = target.getBoundingClientRect();\n // istanbul ignore next\n if (isMountedRef.current && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {\n onResize && onResize(newBounds.width, newBounds.height);\n setBounds(newBounds);\n }\n }, [bounds.height, bounds.width, onResize]);\n\n const handleResize = React.useCallback((entries: any[]) => {\n // istanbul ignore next\n if (!isMountedRef.current || !Array.isArray(entries) || 0 === entries.length) {\n return;\n }\n const target = entries[0].target as HTMLElement;\n // istanbul ignore next\n if (owningWindowRef.current)\n owningWindowRef.current.removeEventListener(\"beforeunload\", resizeObserverCleanup);\n\n owningWindowRef.current = target.ownerDocument.defaultView;\n // istanbul ignore else\n if (owningWindowRef.current) {\n owningWindowRef.current.addEventListener(\"unload\", resizeObserverCleanup);\n\n // using requestAnimationFrame to stop the \"ResizeObserver loop completed with undelivered notifications.\" and\n // \"ResizeObserver loop limit exceeded\" messages reported to window.onError\n rafRef.current = owningWindowRef.current.requestAnimationFrame(() => processResize(target));\n }\n }, [processResize]);\n\n React.useLayoutEffect(() => {\n if (!watchedElement) {\n return;\n }\n resizeObserver.current = new ResizeObserver(handleResize);\n resizeObserver.current.observe(watchedElement);\n return () => {\n // istanbul ignore next\n resizeObserver.current?.disconnect();\n resizeObserver.current = null;\n };\n }, [handleResize, watchedElement]);\n\n return [bounds.width, bounds.height];\n}\n\n/** Prop the ElementResizeObserver sends to the render function.\n * @public\n */\nexport interface RenderPropsArgs {\n width?: number;\n height?: number;\n}\n\n/** ElementResizeObserver provides functionality similar to ReactResizeDetector when a render function is specified. This implementation properly handles\n * observing element in pop-out/child windows.\n * @public\n */\nexport function ElementResizeObserver({ watchedElement, render }: { watchedElement: HTMLElement | null, render: (props: RenderPropsArgs) => JSX.Element }) {\n const [width, height] = useLayoutResizeObserver(watchedElement);\n return render({ width, height });\n}\n\n/** ResizableContainerObserver is a component that provides the functionality similar to the ReactResizeDetector option that call a function when\n * the observed element is resized. This implementation properly handles observing element in pop-out/child windows. If children nodes are defined then\n * the div added by the component is considered the container whose size will be observed. If no children are provided then the component will report\n * size changes from its parent container.\n * @public\n */\nexport function ResizableContainerObserver({ onResize, children }: { onResize: (width: number, height: number) => void, children?: React.ReactNode }) {\n const containerRef = React.useRef<HTMLDivElement>(null); // set to non-zero when requestAnimationFrame processing is active\n const [containerElement, setContainerElement] = React.useState<HTMLElement | null>(null);\n const isMountedRef = React.useRef(false);\n const hasChildren = React.Children.count(children) !== 0;\n\n // if no children are specified then monitor size of parent element.\n React.useEffect(() => {\n // istanbul ignore next\n if (!isMountedRef.current && containerRef.current) {\n isMountedRef.current = true;\n const hasParent = !!containerRef.current.parentElement;\n setContainerElement(hasChildren && hasParent ? containerRef.current : containerRef.current.parentElement);\n }\n }, [hasChildren]);\n\n const processResize = React.useCallback((width?: number, height?: number) => {\n // istanbul ignore next\n onResize(width ?? 0, height ?? 0);\n }, [onResize]);\n\n useLayoutResizeObserver(containerElement, processResize);\n const style: React.CSSProperties = hasChildren ? { width: \"100%\", height: \"100%\" } : { display: \"none\" };\n\n return (\n <div ref={containerRef} className=\"uicore-resizable-container\" style={style}>\n {hasChildren && children}\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"useResizeObserver.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/useResizeObserver.tsx"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,+BAA+B;AAC/B,qEAA0D;AAC1D,iDAA8C;AAC9C,uCAAoC;AAEpC;;IAEI;AACJ,SAAgB,iBAAiB,CAAoB,QAAkD;IACrG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;IACpE,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAwB,IAAI,CAAC,CAA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EAAC,4BAA4B,EAAC,KAAK,EAAE,KAAK,IACxE,WAAW,IAAI,QAAQ,CACpB,CACP,CAAC;AACJ,CAAC;AA7BD,gEA6BC","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 * as React from \"react\";\nimport { ResizeObserver } from \"./ResizeObserverPolyfill\";\nimport { useRefEffect } from \"./useRefEffect\";\nimport { useRefs } from \"./useRefs\";\n\n/** Uses ResizeObserver API to notify about element bound changes.\n * @internal\n */\nexport function useResizeObserver<T extends Element>(onResize?: (width: number, height: number) => void) {\n const [bounds, setBounds] = React.useState({ width: 0, height: 0 });\n const resizeObserver = React.useRef<ResizeObserver | null>(null);\n const rafRef = React.useRef(0); // set to non-zero when requestAnimationFrame processing is active\n const isMountedRef = React.useRef(false);\n const owningWindowRef = React.useRef<any>(null);\n\n // istanbul ignore next\n const resizeObserverCleanup = () => {\n if (rafRef.current)\n owningWindowRef.current.cancelAnimationFrame(rafRef.current);\n\n resizeObserver.current?.disconnect();\n resizeObserver.current = null;\n };\n\n React.useEffect(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n if (rafRef.current)\n owningWindowRef.current.cancelAnimationFrame(rafRef.current);\n owningWindowRef.current?.removeEventListener(\"beforeunload\", resizeObserverCleanup);\n };\n }, []);\n\n const processResize = React.useCallback((target: HTMLElement) => {\n const newBounds = target.getBoundingClientRect();\n // istanbul ignore else\n if (isMountedRef.current && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {\n setBounds(newBounds);\n onResize && onResize(newBounds.width, newBounds.height);\n }\n }, [onResize, bounds.height, bounds.width]);\n\n const handleResize = React.useCallback((entries: any[]) => {\n // istanbul ignore if\n if (!isMountedRef.current || !Array.isArray(entries) || 0 === entries.length) {\n return;\n }\n const target = entries[0].target as HTMLElement;\n // istanbul ignore next\n owningWindowRef.current && owningWindowRef.current.removeEventListener(\"beforeunload\", resizeObserverCleanup);\n\n owningWindowRef.current = target.ownerDocument.defaultView;\n // istanbul ignore else\n if (owningWindowRef.current) {\n owningWindowRef.current.addEventListener(\"unload\", resizeObserverCleanup);\n\n // using requestAnimationFrame to stop the \"ResizeObserver loop completed with undelivered notifications.\" and\n // \"ResizeObserver loop limit exceeded\" messages reported to window.onError\n rafRef.current = owningWindowRef.current.requestAnimationFrame(() => processResize(target));\n }\n }, [processResize]);\n\n const observerRef = useRefEffect((instance: T | null) => {\n resizeObserver.current = new ResizeObserver(handleResize);\n if (instance) {\n resizeObserver.current.observe(instance);\n const newBounds = instance.getBoundingClientRect();\n onResize && onResize(newBounds.width, newBounds.height);\n setBounds(newBounds);\n }\n\n return () => {\n instance && ( /* istanbul ignore next */resizeObserver.current?.unobserve(instance));\n resizeObserver.current = null;\n };\n }, [handleResize, onResize]);\n\n const handleRef = React.useCallback((instance: Element | null) => {\n const newBounds = instance && instance.getBoundingClientRect();\n // istanbul ignore if\n if (newBounds && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {\n setBounds(newBounds);\n onResize && onResize(newBounds.width, newBounds.height);\n }\n }, [bounds.height, bounds.width, onResize]);\n\n const ref = useRefs(handleRef, observerRef);\n return ref;\n}\n\n/** React hook that uses ResizeObserver API to notify about element bound changes. Note: to work similar to ReactResizeDetector\n * width and height are initialized as undefined and only set during after mount if bounds are non-zero. This implementation properly\n * handles observing element in pop-out/child windows.\n * @internal\n */\nexport function useLayoutResizeObserver(inElement: HTMLElement | null, onResize?: (width?: number, height?: number) => void) {\n const inBoundingRect = inElement?.getBoundingClientRect();\n const [bounds, setBounds] = React.useState<{ width?: number, height?: number }>({ width: inBoundingRect?.width, height: inBoundingRect?.height });\n const [watchedElement, setWatchedElement] = React.useState(inElement);\n const resizeObserver = React.useRef<ResizeObserver | null>(null);\n const rafRef = React.useRef(0); // set to non-zero when requestAnimationFrame processing is active\n const isMountedRef = React.useRef(false);\n const owningWindowRef = React.useRef<any>(null);\n\n // istanbul ignore next\n const resizeObserverCleanup = () => {\n if (rafRef.current)\n owningWindowRef.current.cancelAnimationFrame(rafRef.current);\n\n resizeObserver.current?.disconnect();\n resizeObserver.current = null;\n };\n\n React.useEffect(() => {\n isMountedRef.current = true;\n setWatchedElement(inElement);\n\n // istanbul ignore next\n if (inElement) {\n const newBounds = inElement.getBoundingClientRect();\n onResize && onResize(newBounds.width, newBounds.height);\n setBounds(newBounds);\n }\n\n return () => {\n isMountedRef.current = false;\n (rafRef.current && owningWindowRef.current) && owningWindowRef.current.cancelAnimationFrame(rafRef.current);\n owningWindowRef.current && owningWindowRef.current.removeEventListener(\"beforeunload\", resizeObserverCleanup);\n };\n }, [onResize, inElement]);\n\n const processResize = React.useCallback((target: HTMLElement) => {\n const newBounds = target.getBoundingClientRect();\n // istanbul ignore next\n if (isMountedRef.current && (bounds.width !== newBounds.width || bounds.height !== newBounds.height)) {\n onResize && onResize(newBounds.width, newBounds.height);\n setBounds(newBounds);\n }\n }, [bounds.height, bounds.width, onResize]);\n\n const handleResize = React.useCallback((entries: any[]) => {\n // istanbul ignore next\n if (!isMountedRef.current || !Array.isArray(entries) || 0 === entries.length) {\n return;\n }\n const target = entries[0].target as HTMLElement;\n // istanbul ignore next\n if (owningWindowRef.current)\n owningWindowRef.current.removeEventListener(\"beforeunload\", resizeObserverCleanup);\n\n owningWindowRef.current = target.ownerDocument.defaultView;\n // istanbul ignore else\n if (owningWindowRef.current) {\n owningWindowRef.current.addEventListener(\"unload\", resizeObserverCleanup);\n\n // using requestAnimationFrame to stop the \"ResizeObserver loop completed with undelivered notifications.\" and\n // \"ResizeObserver loop limit exceeded\" messages reported to window.onError\n rafRef.current = owningWindowRef.current.requestAnimationFrame(() => processResize(target));\n }\n }, [processResize]);\n\n React.useLayoutEffect(() => {\n if (!watchedElement) {\n return;\n }\n resizeObserver.current = new ResizeObserver(handleResize);\n resizeObserver.current.observe(watchedElement);\n return () => {\n // istanbul ignore next\n resizeObserver.current?.disconnect();\n resizeObserver.current = null;\n };\n }, [handleResize, watchedElement]);\n\n return [bounds.width, bounds.height];\n}\n\n/** Prop the ElementResizeObserver sends to the render function.\n * @public\n */\nexport interface RenderPropsArgs {\n width?: number;\n height?: number;\n}\n\n/** ElementResizeObserver provides functionality similar to ReactResizeDetector when a render function is specified. This implementation properly handles\n * observing element in pop-out/child windows.\n * @public\n */\nexport function ElementResizeObserver({ watchedElement, render }: { watchedElement: HTMLElement | null, render: (props: RenderPropsArgs) => JSX.Element }) {\n const [width, height] = useLayoutResizeObserver(watchedElement);\n return render({ width, height });\n}\n\n/** ResizableContainerObserver is a component that provides the functionality similar to the ReactResizeDetector option that call a function when\n * the observed element is resized. This implementation properly handles observing element in pop-out/child windows. If children nodes are defined then\n * the div added by the component is considered the container whose size will be observed. If no children are provided then the component will report\n * size changes from its parent container.\n * @public\n */\nexport function ResizableContainerObserver({ onResize, children }: { onResize: (width: number, height: number) => void, children?: React.ReactNode }) {\n const containerRef = React.useRef<HTMLDivElement>(null); // set to non-zero when requestAnimationFrame processing is active\n const [containerElement, setContainerElement] = React.useState<HTMLElement | null>(null);\n const isMountedRef = React.useRef(false);\n const hasChildren = React.Children.count(children) !== 0;\n\n // if no children are specified then monitor size of parent element.\n React.useEffect(() => {\n // istanbul ignore next\n if (!isMountedRef.current && containerRef.current) {\n isMountedRef.current = true;\n const hasParent = !!containerRef.current.parentElement;\n setContainerElement(hasChildren && hasParent ? containerRef.current : containerRef.current.parentElement);\n }\n }, [hasChildren]);\n\n const processResize = React.useCallback((width?: number, height?: number) => {\n // istanbul ignore next\n onResize(width ?? 0, height ?? 0);\n }, [onResize]);\n\n useLayoutResizeObserver(containerElement, processResize);\n const style: React.CSSProperties = hasChildren ? { width: \"100%\", height: \"100%\" } : { display: \"none\" };\n\n return (\n <div ref={containerRef} className=\"uicore-resizable-container\" style={style}>\n {hasChildren && children}\n </div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeUtils.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/typeUtils.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"typeUtils.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/typeUtils.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
|
package/lib/cjs/core-react.d.ts
CHANGED
|
@@ -34,9 +34,9 @@ export * from "./core-react/focustrap/FocusTrap";
|
|
|
34
34
|
export * from "./core-react/hocs/withIsPressed";
|
|
35
35
|
export * from "./core-react/hocs/withOnOutsideClick";
|
|
36
36
|
export * from "./core-react/hocs/withTimeout";
|
|
37
|
+
export * from "./core-react/icons/ConditionalIconItem";
|
|
37
38
|
export * from "./core-react/icons/IconComponent";
|
|
38
39
|
export * from "./core-react/icons/SvgPath";
|
|
39
|
-
export * from "./core-react/icons/SvgSprite";
|
|
40
40
|
export * from "./core-react/icons/WebFontIcon";
|
|
41
41
|
export * from "./core-react/autosuggest/AutoSuggest";
|
|
42
42
|
export * from "./core-react/imagecheckbox/ImageCheckBox";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-react.d.ts","sourceRoot":"","sources":["../../src/core-react.ts"],"names":[],"mappings":"AAOA,cAAc,qBAAqB,CAAC;AAEpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAE5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uCAAuC,CAAC;AACtD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAA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4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,uCAAuC,CAAC;AACtD,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,sCAAsC,CAAC;AACrD,cAAc,kDAAkD,CAAC;AACjE,cAAc,sCAAsC,CAAC;AACrD,cAAc,8CAA8C,CAAC;AAE7D;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG"}
|
package/lib/cjs/core-react.js
CHANGED
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
7
|
if (k2 === undefined) k2 = k;
|
|
8
|
-
Object.
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
9
13
|
}) : (function(o, m, k, k2) {
|
|
10
14
|
if (k2 === undefined) k2 = k;
|
|
11
15
|
o[k2] = m[k];
|
|
@@ -52,9 +56,9 @@ __exportStar(require("./core-react/focustrap/FocusTrap"), exports);
|
|
|
52
56
|
__exportStar(require("./core-react/hocs/withIsPressed"), exports);
|
|
53
57
|
__exportStar(require("./core-react/hocs/withOnOutsideClick"), exports);
|
|
54
58
|
__exportStar(require("./core-react/hocs/withTimeout"), exports);
|
|
59
|
+
__exportStar(require("./core-react/icons/ConditionalIconItem"), exports);
|
|
55
60
|
__exportStar(require("./core-react/icons/IconComponent"), exports);
|
|
56
61
|
__exportStar(require("./core-react/icons/SvgPath"), exports);
|
|
57
|
-
__exportStar(require("./core-react/icons/SvgSprite"), exports);
|
|
58
62
|
__exportStar(require("./core-react/icons/WebFontIcon"), exports);
|
|
59
63
|
__exportStar(require("./core-react/autosuggest/AutoSuggest"), exports);
|
|
60
64
|
__exportStar(require("./core-react/imagecheckbox/ImageCheckBox"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-react.js","sourceRoot":"","sources":["../../src/core-react.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;AAE/F,gFAAgF;AAEhF,sDAAoC;AAEpC,2DAAyC;AACzC,oEAAkD;AAClD,+DAA6C;AAC7C,8DAA4C;AAE5C,wDAAsC;AACtC,wEAAsD;AACtD,6DAA2C;AAC3C,iEAA+C;AAC/C,sEAAoD;AACpD,wDAAsC;AACtC,kEAAgD;AAChD,+DAA6C;AAE7C,uEAAqD;AAErD,yEAAuD;AAEvD,uEAAqD;AACrD,gFAA8D;AAC9D,8EAA4D;AAC5D,2EAAyD;AACzD,0EAAwD;AACxD,6EAA2D;AAC3D,4EAA0D;AAE1D,6DAA2C;AAC3C,mEAAiD;AAEjD,iFAA+D;AAE/D,+DAA6C;AAC7C,mEAAiD;AACjD,iEAA+C;AAC/C,mEAAiD;AACjD,gEAA8C;AAE9C,yEAAuD;AAEvD,2EAAyD;AACzD,mEAAiD;AAEjD,kEAAgD;AAChD,uEAAqD;AACrD,gEAA8C;AAE9C,mEAAiD;AACjD,6DAA2C;AAC3C,+DAA6C;AAC7C,iEAA+C;AAE/C,uEAAqD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GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","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\n// cSpell:ignore focustrap imagecheckbox iconinput hocs numberinput numericinput\n\nexport * from \"./core-react/UiCore\";\n\nexport * from \"./core-react/badge/Badge\";\nexport * from \"./core-react/badge/BadgeUtilities\";\nexport * from \"./core-react/badge/BetaBadge\";\nexport * from \"./core-react/badge/NewBadge\";\n\nexport * from \"./core-react/base/Div\";\nexport * from \"./core-react/base/DivWithOutsideClick\";\nexport * from \"./core-react/base/Centered\";\nexport * from \"./core-react/base/FillCentered\";\nexport * from \"./core-react/base/FlexWrapContainer\";\nexport * from \"./core-react/base/Gap\";\nexport * from \"./core-react/base/PointerEvents\";\nexport * from \"./core-react/base/ScrollView\";\n\nexport * from \"./core-react/button/UnderlinedButton\";\n\nexport * from \"./core-react/checklistbox/CheckListBox\";\n\nexport * from \"./core-react/contextmenu/ContextMenu\";\nexport * from \"./core-react/contextmenu/ContextMenuDirection\";\nexport * from \"./core-react/contextmenu/ContextMenuDivider\";\nexport * from \"./core-react/contextmenu/ContextMenuItem\";\nexport * from \"./core-react/contextmenu/ContextSubMenu\";\nexport * from \"./core-react/contextmenu/GlobalContextMenu\";\nexport * from \"./core-react/contextmenu/PopupContextMenu\";\n\nexport * from \"./core-react/dialog/Dialog\";\nexport * from \"./core-react/dialog/GlobalDialog\";\n\nexport * from \"./core-react/elementseparator/ElementSeparator\";\n\nexport * from \"./core-react/enums/Alignment\";\nexport * from \"./core-react/enums/CheckBoxState\";\nexport * from \"./core-react/enums/Orientation\";\nexport * from \"./core-react/enums/SortDirection\";\nexport * from \"./core-react/enums/TimeFormat\";\n\nexport * from \"./core-react/expandable/ExpandableList\";\n\nexport * from \"./core-react/focus/ItemKeyboardNavigator\";\nexport * from \"./core-react/focustrap/FocusTrap\";\n\nexport * from \"./core-react/hocs/withIsPressed\";\nexport * from \"./core-react/hocs/withOnOutsideClick\";\nexport * from \"./core-react/hocs/withTimeout\";\n\nexport * from \"./core-react/icons/IconComponent\";\nexport * from \"./core-react/icons/SvgPath\";\nexport * from \"./core-react/icons/SvgSprite\";\nexport * from \"./core-react/icons/WebFontIcon\";\n\nexport * from \"./core-react/autosuggest/AutoSuggest\";\n\nexport * from \"./core-react/imagecheckbox/ImageCheckBox\";\n\nexport * from \"./core-react/inputs/InputLabel\";\nexport * from \"./core-react/inputs/InputStatus\";\nexport * from \"./core-react/inputs/iconinput/IconInput\";\nexport * from \"./core-react/inputs/LabeledComponentProps\";\nexport * from \"./core-react/inputs/numberinput/NumberInput\";\n\nexport * from \"./core-react/listbox/Listbox\";\n\nexport * from \"./core-react/loading/LoadingBar\";\nexport * from \"./core-react/loading/LoadingPrompt\";\nexport * from \"./core-react/loading/LoadingSpinner\";\nexport * from \"./core-react/loading/LoadingStatus\";\n\nexport * from \"./core-react/messagebox/MessageBox\";\n\nexport * from \"./core-react/notification/MessageRenderer\";\nexport * from \"./core-react/notification/MessageType\";\n\nexport * from \"./core-react/popup/Popup\";\n\nexport * from \"./core-react/radialmenu/RadialMenu\";\nexport * from \"./core-react/radialmenu/Annulus\";\n\nexport * from \"./core-react/searchbox/SearchBox\";\n\nexport * from \"./core-react/settings/SettingsManager\";\nexport * from \"./core-react/settings/SettingsContainer\";\n\nexport * from \"./core-react/tabs/VerticalTabs\";\nexport * from \"./core-react/tabs/Tabs\";\n\nexport * from \"./core-react/text/BodyText\";\nexport * from \"./core-react/text/BlockText\";\nexport * from \"./core-react/text/DisabledText\";\nexport * from \"./core-react/text/FilteredText\";\nexport * from \"./core-react/text/MutedText\";\nexport * from \"./core-react/text/StyledText\";\nexport * from \"./core-react/text/TextProps\";\n\nexport { ExpansionToggle, ExpansionToggleProps } from \"./core-react/tree/ExpansionToggle\";\nexport { TreeBranch, TreeBranchProps } from \"./core-react/tree/Branch\";\nexport { TreeNode, TreeNodeProps, NodeCheckboxProps, NodeCheckboxRenderer, NodeCheckboxRenderProps } from \"./core-react/tree/Node\";\nexport { Tree, TreeProps } from \"./core-react/tree/Tree\";\nexport { TreeNodePlaceholder, TreeNodePlaceholderProps } from \"./core-react/tree/Placeholder\";\n\nexport * from \"./core-react/uistate/UiStateEntry\";\nexport * from \"./core-react/uistate/UiStateStorage\";\nexport * from \"./core-react/uistate/LocalStateStorage\";\n\nexport * from \"./core-react/utils/IconHelper\";\nexport * from \"./core-react/utils/Point\";\nexport * from \"./core-react/utils/Props\";\nexport * from \"./core-react/utils/Rectangle\";\nexport * from \"./core-react/utils/Size\";\nexport * from \"./core-react/utils/Timer\";\nexport * from \"./core-react/utils/UiGeometry\";\nexport * from \"./core-react/utils/flattenChildren\";\nexport * from \"./core-react/utils/getBestBWContrastColor\";\nexport * from \"./core-react/utils/getCssVariable\";\nexport * from \"./core-react/utils/getDisplayName\";\nexport * from \"./core-react/utils/getUserColor\";\nexport * from \"./core-react/utils/shallowDiffers\";\nexport * from \"./core-react/utils/typeUtils\";\nexport * from \"./core-react/utils/isPromiseLike\";\nexport * from \"./core-react/utils/ScrollPositionMaintainer\";\n\nexport * from \"./core-react/utils/hooks/useDisposable\";\nexport * from \"./core-react/utils/hooks/useEffectSkipFirst\";\nexport * from \"./core-react/utils/hooks/useEventListener\";\nexport * from \"./core-react/utils/hooks/ResizeObserverPolyfill\";\nexport * from \"./core-react/utils/hooks/useOnOutsideClick\";\nexport * from \"./core-react/utils/hooks/useProximityToMouse\";\nexport * from \"./core-react/utils/hooks/useRefEffect\";\nexport * from \"./core-react/utils/hooks/useRefs\";\nexport * from \"./core-react/utils/hooks/useRefState\";\nexport * from \"./core-react/utils/hooks/useResizeObserver\";\nexport * from \"./core-react/utils/hooks/useTargeted\";\nexport * from \"./core-react/utils/hooks/useWidgetOpacityContext\";\nexport * from \"./core-react/utils/hooks/useInterval\";\nexport * from \"./core-react/utils/hooks/useCrossOriginPopup\";\n\n/** @docs-package-description\n * The core-react package contains general purpose React components, such as Dialog, MessageBox, SearchBox, RadialMenu and SplitButton.\n * For more information, see [learning about core-react]($docs/learning/ui/core/index.md).\n */\n/**\n * @docs-group-description AutoSuggest\n * Component for input with an auto-suggestion dropdown.\n */\n/**\n * @docs-group-description Base\n * Low-level classes and components for building application UI.\n */\n/**\n * @docs-group-description Button\n * Components for working with various Buttons.\n */\n/**\n * @docs-group-description Checkbox\n * Component is a wrapper for the `<input type=\"checkbox\">` HTML element.\n */\n/**\n * @docs-group-description CheckListBox\n * Components for working with a Check listbox.\n */\n/**\n * @docs-group-description Common\n * Common classes and enums used across various UI components.\n */\n/**\n * @docs-group-description ContextMenu\n * Components for working with a Context Menu.\n */\n/**\n * @docs-group-description Dialog\n * Components for working with a Dialog or MessageBox.\n */\n/**\n * @docs-group-description ElementSeparator\n * Components for working with a ElementSeparator.\n */\n/**\n * @docs-group-description Expandable\n * Components for working with a ExpandableBlock or ExpandableList.\n */\n/**\n * @docs-group-description Form\n * Components used to create a Form using supplied properties to specify fields.\n */\n/**\n * @docs-group-description Icon\n * Component that renders core-react icon when given an icon name or SVG source.\n */\n/**\n * @docs-group-description Inputs\n * Components for working with input controls, such as Input, IconInput and NumberInput.\n */\n/**\n * @docs-group-description Loading\n * Components for working with Loading spinners and progress indicators and bars.\n */\n/**\n * @docs-group-description Notification\n * Components for working with messages and tooltips.\n */\n/**\n * @docs-group-description Popup\n * Components for working with a Popup.\n */\n/**\n * @docs-group-description RadialMenu\n * Components for working with a RadialMenu.\n */\n/**\n * @docs-group-description Radio\n * Component is a wrapper for the `<input type=\"radio\">` HTML element.\n */\n/**\n * @docs-group-description SearchBox\n * Components for working with a SearchBox.\n */\n/**\n * @docs-group-description Select\n * Component is a wrapper for the `<select>` HTML element.\n */\n/**\n * @docs-group-description Settings\n * Manager and UI Components that allow users to modify settings for different packages and extensions.\n */\n/**\n * @docs-group-description Slider\n * Component displays a range slider with thumbs for changing the value.\n */\n/**\n * @docs-group-description SplitButton\n * Components for working with a SplitButton.\n */\n/**\n * @docs-group-description Tabs\n * Components for working with horizontal or vertical tabs.\n */\n/**\n * @docs-group-description Text\n * Components for working with styled text.\n */\n/**\n * @docs-group-description Tiles\n * Components for a container rendering elements that can be grouped together.\n */\n/**\n * @docs-group-description Toggle\n * Components for working with a Toggle switch.\n */\n/**\n * @docs-group-description Tooltip\n * Components for working with a Tooltip.\n */\n/**\n * @docs-group-description Tree\n * Presentation React components for working with a Tree.\n */\n/**\n * @docs-group-description UiStateStorage\n * Interfaces and classes for working with persistent UI settings.\n */\n/**\n * @docs-group-description Utilities\n * Various utility classes, functions and React hooks for working with a UI.\n */\n"]}
|
|
1
|
+
{"version":3,"file":"core-react.js","sourceRoot":"","sources":["../../src/core-react.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;;AAE/F,gFAAgF;AAEhF,sDAAoC;AAEpC,2DAAyC;AACzC,oEAAkD;AAClD,+DAA6C;AAC7C,8DAA4C;AAE5C,wDAAsC;AACtC,wEAAsD;AACtD,6DAA2C;AAC3C,iEAA+C;AAC/C,sEAAoD;AACpD,wDAAsC;AACtC,kEAAgD;AAChD,+DAA6C;AAE7C,uEAAqD;AAErD,yEAAuD;AAEvD,uEAAqD;AACrD,gFAA8D;AAC9D,8EAA4D;AAC5D,2EAAyD;AACzD,0EAAwD;AACxD,6EAA2D;AAC3D,4EAA0D;AAE1D,6DAA2C;AAC3C,mEAAiD;AAEjD,iFAA+D;AAE/D,+DAA6C;AAC7C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3D,+EAA6D;AAC7D,wEAAsD;AACtD,mEAAiD;AACjD,uEAAqD;AACrD,6EAA2D;AAC3D,uEAAqD;AACrD,mFAAiE;AACjE,uEAAqD;AACrD,+EAA6D;AAE7D;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","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\n// cSpell:ignore focustrap imagecheckbox iconinput hocs numberinput numericinput\n\nexport * from \"./core-react/UiCore\";\n\nexport * from \"./core-react/badge/Badge\";\nexport * from \"./core-react/badge/BadgeUtilities\";\nexport * from \"./core-react/badge/BetaBadge\";\nexport * from \"./core-react/badge/NewBadge\";\n\nexport * from \"./core-react/base/Div\";\nexport * from \"./core-react/base/DivWithOutsideClick\";\nexport * from \"./core-react/base/Centered\";\nexport * from \"./core-react/base/FillCentered\";\nexport * from \"./core-react/base/FlexWrapContainer\";\nexport * from \"./core-react/base/Gap\";\nexport * from \"./core-react/base/PointerEvents\";\nexport * from \"./core-react/base/ScrollView\";\n\nexport * from \"./core-react/button/UnderlinedButton\";\n\nexport * from \"./core-react/checklistbox/CheckListBox\";\n\nexport * from \"./core-react/contextmenu/ContextMenu\";\nexport * from \"./core-react/contextmenu/ContextMenuDirection\";\nexport * from \"./core-react/contextmenu/ContextMenuDivider\";\nexport * from \"./core-react/contextmenu/ContextMenuItem\";\nexport * from \"./core-react/contextmenu/ContextSubMenu\";\nexport * from \"./core-react/contextmenu/GlobalContextMenu\";\nexport * from \"./core-react/contextmenu/PopupContextMenu\";\n\nexport * from \"./core-react/dialog/Dialog\";\nexport * from \"./core-react/dialog/GlobalDialog\";\n\nexport * from \"./core-react/elementseparator/ElementSeparator\";\n\nexport * from \"./core-react/enums/Alignment\";\nexport * from \"./core-react/enums/CheckBoxState\";\nexport * from \"./core-react/enums/Orientation\";\nexport * from \"./core-react/enums/SortDirection\";\nexport * from \"./core-react/enums/TimeFormat\";\n\nexport * from \"./core-react/expandable/ExpandableList\";\n\nexport * from \"./core-react/focus/ItemKeyboardNavigator\";\nexport * from \"./core-react/focustrap/FocusTrap\";\n\nexport * from \"./core-react/hocs/withIsPressed\";\nexport * from \"./core-react/hocs/withOnOutsideClick\";\nexport * from \"./core-react/hocs/withTimeout\";\n\nexport * from \"./core-react/icons/ConditionalIconItem\";\nexport * from \"./core-react/icons/IconComponent\";\nexport * from \"./core-react/icons/SvgPath\";\nexport * from \"./core-react/icons/WebFontIcon\";\n\nexport * from \"./core-react/autosuggest/AutoSuggest\";\n\nexport * from \"./core-react/imagecheckbox/ImageCheckBox\";\n\nexport * from \"./core-react/inputs/InputLabel\";\nexport * from \"./core-react/inputs/InputStatus\";\nexport * from \"./core-react/inputs/iconinput/IconInput\";\nexport * from \"./core-react/inputs/LabeledComponentProps\";\nexport * from \"./core-react/inputs/numberinput/NumberInput\";\n\nexport * from \"./core-react/listbox/Listbox\";\n\nexport * from \"./core-react/loading/LoadingBar\";\nexport * from \"./core-react/loading/LoadingPrompt\";\nexport * from \"./core-react/loading/LoadingSpinner\";\nexport * from \"./core-react/loading/LoadingStatus\";\n\nexport * from \"./core-react/messagebox/MessageBox\";\n\nexport * from \"./core-react/notification/MessageRenderer\";\nexport * from \"./core-react/notification/MessageType\";\n\nexport * from \"./core-react/popup/Popup\";\n\nexport * from \"./core-react/radialmenu/RadialMenu\";\nexport * from \"./core-react/radialmenu/Annulus\";\n\nexport * from \"./core-react/searchbox/SearchBox\";\n\nexport * from \"./core-react/settings/SettingsManager\";\nexport * from \"./core-react/settings/SettingsContainer\";\n\nexport * from \"./core-react/tabs/VerticalTabs\";\nexport * from \"./core-react/tabs/Tabs\";\n\nexport * from \"./core-react/text/BodyText\";\nexport * from \"./core-react/text/BlockText\";\nexport * from \"./core-react/text/DisabledText\";\nexport * from \"./core-react/text/FilteredText\";\nexport * from \"./core-react/text/MutedText\";\nexport * from \"./core-react/text/StyledText\";\nexport * from \"./core-react/text/TextProps\";\n\nexport { ExpansionToggle, ExpansionToggleProps } from \"./core-react/tree/ExpansionToggle\";\nexport { TreeBranch, TreeBranchProps } from \"./core-react/tree/Branch\";\nexport { TreeNode, TreeNodeProps, NodeCheckboxProps, NodeCheckboxRenderer, NodeCheckboxRenderProps } from \"./core-react/tree/Node\";\nexport { Tree, TreeProps } from \"./core-react/tree/Tree\";\nexport { TreeNodePlaceholder, TreeNodePlaceholderProps } from \"./core-react/tree/Placeholder\";\n\nexport * from \"./core-react/uistate/UiStateEntry\";\nexport * from \"./core-react/uistate/UiStateStorage\";\nexport * from \"./core-react/uistate/LocalStateStorage\";\n\nexport * from \"./core-react/utils/IconHelper\";\nexport * from \"./core-react/utils/Point\";\nexport * from \"./core-react/utils/Props\";\nexport * from \"./core-react/utils/Rectangle\";\nexport * from \"./core-react/utils/Size\";\nexport * from \"./core-react/utils/Timer\";\nexport * from \"./core-react/utils/UiGeometry\";\nexport * from \"./core-react/utils/flattenChildren\";\nexport * from \"./core-react/utils/getBestBWContrastColor\";\nexport * from \"./core-react/utils/getCssVariable\";\nexport * from \"./core-react/utils/getDisplayName\";\nexport * from \"./core-react/utils/getUserColor\";\nexport * from \"./core-react/utils/shallowDiffers\";\nexport * from \"./core-react/utils/typeUtils\";\nexport * from \"./core-react/utils/isPromiseLike\";\nexport * from \"./core-react/utils/ScrollPositionMaintainer\";\n\nexport * from \"./core-react/utils/hooks/useDisposable\";\nexport * from \"./core-react/utils/hooks/useEffectSkipFirst\";\nexport * from \"./core-react/utils/hooks/useEventListener\";\nexport * from \"./core-react/utils/hooks/ResizeObserverPolyfill\";\nexport * from \"./core-react/utils/hooks/useOnOutsideClick\";\nexport * from \"./core-react/utils/hooks/useProximityToMouse\";\nexport * from \"./core-react/utils/hooks/useRefEffect\";\nexport * from \"./core-react/utils/hooks/useRefs\";\nexport * from \"./core-react/utils/hooks/useRefState\";\nexport * from \"./core-react/utils/hooks/useResizeObserver\";\nexport * from \"./core-react/utils/hooks/useTargeted\";\nexport * from \"./core-react/utils/hooks/useWidgetOpacityContext\";\nexport * from \"./core-react/utils/hooks/useInterval\";\nexport * from \"./core-react/utils/hooks/useCrossOriginPopup\";\n\n/** @docs-package-description\n * The core-react package contains general purpose React components, such as Dialog, MessageBox, SearchBox, RadialMenu and SplitButton.\n * For more information, see [learning about core-react]($docs/learning/ui/core/index.md).\n */\n/**\n * @docs-group-description AutoSuggest\n * Component for input with an auto-suggestion dropdown.\n */\n/**\n * @docs-group-description Base\n * Low-level classes and components for building application UI.\n */\n/**\n * @docs-group-description Button\n * Components for working with various Buttons.\n */\n/**\n * @docs-group-description Checkbox\n * Component is a wrapper for the `<input type=\"checkbox\">` HTML element.\n */\n/**\n * @docs-group-description CheckListBox\n * Components for working with a Check listbox.\n */\n/**\n * @docs-group-description Common\n * Common classes and enums used across various UI components.\n */\n/**\n * @docs-group-description ContextMenu\n * Components for working with a Context Menu.\n */\n/**\n * @docs-group-description Dialog\n * Components for working with a Dialog or MessageBox.\n */\n/**\n * @docs-group-description ElementSeparator\n * Components for working with a ElementSeparator.\n */\n/**\n * @docs-group-description Expandable\n * Components for working with a ExpandableBlock or ExpandableList.\n */\n/**\n * @docs-group-description Form\n * Components used to create a Form using supplied properties to specify fields.\n */\n/**\n * @docs-group-description Icon\n * Component that renders core-react icon when given an icon name or SVG source.\n */\n/**\n * @docs-group-description Inputs\n * Components for working with input controls, such as Input, IconInput and NumberInput.\n */\n/**\n * @docs-group-description Loading\n * Components for working with Loading spinners and progress indicators and bars.\n */\n/**\n * @docs-group-description Notification\n * Components for working with messages and tooltips.\n */\n/**\n * @docs-group-description Popup\n * Components for working with a Popup.\n */\n/**\n * @docs-group-description RadialMenu\n * Components for working with a RadialMenu.\n */\n/**\n * @docs-group-description Radio\n * Component is a wrapper for the `<input type=\"radio\">` HTML element.\n */\n/**\n * @docs-group-description SearchBox\n * Components for working with a SearchBox.\n */\n/**\n * @docs-group-description Select\n * Component is a wrapper for the `<select>` HTML element.\n */\n/**\n * @docs-group-description Settings\n * Manager and UI Components that allow users to modify settings for different packages and extensions.\n */\n/**\n * @docs-group-description Slider\n * Component displays a range slider with thumbs for changing the value.\n */\n/**\n * @docs-group-description SplitButton\n * Components for working with a SplitButton.\n */\n/**\n * @docs-group-description Tabs\n * Components for working with horizontal or vertical tabs.\n */\n/**\n * @docs-group-description Text\n * Components for working with styled text.\n */\n/**\n * @docs-group-description Tiles\n * Components for a container rendering elements that can be grouped together.\n */\n/**\n * @docs-group-description Toggle\n * Components for working with a Toggle switch.\n */\n/**\n * @docs-group-description Tooltip\n * Components for working with a Tooltip.\n */\n/**\n * @docs-group-description Tree\n * Presentation React components for working with a Tree.\n */\n/**\n * @docs-group-description UiStateStorage\n * Interfaces and classes for working with persistent UI settings.\n */\n/**\n * @docs-group-description Utilities\n * Various utility classes, functions and React hooks for working with a UI.\n */\n"]}
|
|
@@ -18,7 +18,7 @@ import { IconWebComponent } from "./utils/IconWebComponent";
|
|
|
18
18
|
* Manages the Localization service for the core-react package.
|
|
19
19
|
* @public
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
class UiCore {
|
|
22
22
|
/**
|
|
23
23
|
* Registers the Localization service namespace for UiCore.
|
|
24
24
|
* @param localization The internationalization service created by the host application.
|
|
@@ -79,4 +79,5 @@ export class UiCore {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
UiCore._initialized = false;
|
|
82
|
+
export { UiCore };
|
|
82
83
|
//# sourceMappingURL=UiCore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiCore.js","sourceRoot":"","sources":["../../../src/core-react/UiCore.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,4EAA4E;AAC5E,OAAO,oBAAoB,CAAC;AAC5B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,yBAAyB,CAAC;AACjC,OAAO,gBAAgB,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,2CAA2C;AAE3C;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"UiCore.js","sourceRoot":"","sources":["../../../src/core-react/UiCore.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,4EAA4E;AAC5E,OAAO,oBAAoB,CAAC;AAC5B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,yBAAyB,CAAC;AACjC,OAAO,gBAAgB,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,2CAA2C;AAE3C;;;GAGG;AACH,MAAa,MAAM;IAIjB;;;OAGG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,YAA0B;QACvD,IAAI,MAAM,CAAC,YAAY,EAAE;YACvB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,kCAAkC,CAAC,CAAC;YAClF,OAAO;SACR;QAED,MAAM,CAAC,a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G,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,qBAAqB,EAAE,CAAC,CAAC;IAC5F,CAAC;IAED,gBAAgB;IACT,MAAM,KAAK,WAAW;QAC3B,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,cAAc,CAAC,GAAQ;QACnC,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QACpC,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACzE,OAAO,QAAQ,CAAC;IAClB,CAAC;;AAtEc,mBAAY,GAAG,KAAK,CAAC;SADzB,MAAM","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n\n/** Import color variables, layout variables and Sass classes barrel file */\nimport \"./colorthemes.scss\";\nimport \"./colorvariables.scss\";\nimport \"./layout-variables.scss\";\nimport \"./classes.scss\";\n\nimport { Logger } from \"@itwin/core-bentley\";\nimport type { Localization } from \"@itwin/core-common\";\nimport { getClassName, UiError } from \"@itwin/appui-abstract\";\nimport { IconWebComponent } from \"./utils/IconWebComponent\";\n// cSpell:ignore colorthemes colorvariables\n\n/**\n * Manages the Localization service for the core-react package.\n * @public\n */\nexport class UiCore {\n private static _initialized = false;\n private static _localization?: Localization;\n\n /**\n * Registers the Localization service namespace for UiCore.\n * @param localization The internationalization service created by the host application.\n */\n public static async initialize(localization: Localization): Promise<void> {\n if (UiCore._initialized) {\n Logger.logInfo(UiCore.loggerCategory(UiCore), `UiCore.initialize already called`);\n return;\n }\n\n UiCore._localization = localization;\n await UiCore._localization.registerNamespace(UiCore.localizationNamespace);\n if (window.customElements.get(\"svg-loader\") === undefined)\n window.customElements.define(\"svg-loader\", IconWebComponent);\n\n UiCore._initialized = true;\n }\n\n /** Unregisters the UiCore localization namespace */\n public static terminate() {\n if (UiCore._localization)\n UiCore._localization.unregisterNamespace(UiCore.localizationNamespace);\n UiCore._localization = undefined;\n\n UiCore._initialized = false;\n }\n\n /** Determines if UiCore has been initialized */\n public static get initialized(): boolean { return UiCore._initialized; }\n\n /** The internationalization service created by the host application.\n * @internal\n */\n public static get localization(): Localization {\n // istanbul ignore else\n if (!UiCore._localization)\n throw new UiError(UiCore.loggerCategory(this), \"localization: UiCore.initialize has not been called. Unable to return Localization object.\");\n // istanbul ignore next\n return UiCore._localization;\n }\n\n /** The internationalization service namespace. */\n public static get localizationNamespace(): string {\n return \"UiCore\";\n }\n\n /** Calls localization.getLocalizedStringWithNamespace with the \"UiCore\" namespace. Do NOT include the namespace in the key.\n * @internal\n */\n public static translate(key: string | string[]): string {\n if (!UiCore._localization) {\n Logger.logError(UiCore.loggerCategory(this), `translate: UiCore must be initialize with a localization provider. Returning blank string.`);\n return \"\";\n }\n return UiCore._localization.getLocalizedString(key, { ns: UiCore.localizationNamespace });\n }\n\n /** @internal */\n public static get packageName(): string {\n return \"core-react\";\n }\n\n /** @internal */\n public static loggerCategory(obj: any): string {\n const className = getClassName(obj);\n const category = UiCore.packageName + (className ? `.${className}` : \"\");\n return category;\n }\n\n}\n"]}
|
|
@@ -17,11 +17,11 @@ export interface AutoSuggestData {
|
|
|
17
17
|
/** Prototype for function returning AutoSuggestData
|
|
18
18
|
* @public
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export type GetAutoSuggestDataFunc = (value: string) => AutoSuggestData[];
|
|
21
21
|
/** Prototype for async function returning AutoSuggestData
|
|
22
22
|
* @public
|
|
23
23
|
*/
|
|
24
|
-
export
|
|
24
|
+
export type AsyncGetAutoSuggestDataFunc = (value: string) => Promise<AutoSuggestData[]>;
|
|
25
25
|
/** Properties for the [[AutoSuggest]] component.
|
|
26
26
|
* @public
|
|
27
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoSuggest.d.ts","sourceRoot":"","sources":["../../../../src/core-react/autosuggest/AutoSuggest.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,mBAAmB,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"AutoSuggest.d.ts","sourceRoot":"","sources":["../../../../src/core-react/autosuggest/AutoSuggest.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,mBAAmB,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,eAAe,EAAE,CAAC;AAE1E;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;AAExF;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,WAAW;IAChG,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,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B,CAAC;IACtF,OAAO,CAAC,UAAU,CAAS;gBAEf,KAAK,EAAE,gBAAgB;IAcnC,gBAAgB;IACA,iBAAiB;IAIjC,gBAAgB;IACA,oBAAoB;IAIpB,kBAAkB,CAAC,SAAS,EAAE,gBAAgB;IAQ9D,OAAO,CAAC,SAAS,CAWf;IAEF,OAAO,CAAC,QAAQ,CAId;IAEF,qFAAqF;IACrF,OAAO,CAAC,4BAA4B,CAMlC;IAEF,oFAAoF;IACpF,OAAO,CAAC,4BAA4B,CAGlC;IAEF,OAAO,CAAC,qBAAqB,CAE3B;IAEF,gFAAgF;IAChF,OAAO,CAAC,eAAe,CAsBrB;IAEF,4GAA4G;IAC5G,OAAO,CAAC,mBAAmB,CAAqD;IAEhF,8BAA8B;IAC9B,OAAO,CAAC,iBAAiB,CAIvB;IAEF,OAAO,CAAC,QAAQ;IAgBhB,OAAO,CAAC,cAAc,CAkBpB;IAEF,OAAO,CAAC,MAAM,CAeZ;IAEc,MAAM,IAAI,GAAG,CAAC,OAAO;CAsCtC"}
|
|
@@ -92,7 +92,7 @@ export class AutoSuggest extends React.PureComponent {
|
|
|
92
92
|
this._theme = {
|
|
93
93
|
container: "uicore-autosuggest__container",
|
|
94
94
|
containerOpen: "uicore-autosuggest__container--open",
|
|
95
|
-
input: "uicore-autosuggest__input",
|
|
95
|
+
input: "iui-input uicore-autosuggest__input",
|
|
96
96
|
inputOpen: "uicore-autosuggest__input--open",
|
|
97
97
|
inputFocused: "uicore-autosuggest__input--focused",
|
|
98
98
|
suggestionsContainer: "uicore-autosuggest__suggestions-container",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoSuggest.js","sourceRoot":"","sources":["../../../../src/core-react/autosuggest/AutoSuggest.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,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AC3F,oBAAC,gBAAgB,IACf,KAAK,EAAE,IAAI,CAAC,MAAM,EAClB,WAAW,EAAE,WAAW,EACxB,2BAA2B,EAAE,IAAI,CAAC,4BAA4B,EAC9D,2BAA2B,EAAE,IAAI,CAAC,4BAA4B,EAC9D,kBAAkB,EAAE,IAAI,CAAC,mBAAmB,EAC5C,gBAAgB,EAAE,IAAI,CAAC,iBAAiB,EACxC,UAAU,EAAE,UAAU,EACtB,oBAAoB,EAAE,IAAI,CAAC,qBAAqB,EAChD,uBAAuB,EAAE,uBAAuB,EAChD,oBAAoB,EAAE,oBAAoB,EAC1C,0BAA0B,EAAE,0BAA0B,GACtD,CACE,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\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 AutoSuggest\n */\n\nimport \"./AutoSuggest.scss\";\nimport * as React from \"react\";\nimport * as ReactAutosuggest from \"react-autosuggest\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { SpecialKey } from \"@itwin/appui-abstract\";\nimport { CommonProps } from \"../utils/Props\";\nimport { UiCore } from \"../UiCore\";\n\n/** Data for the [[AutoSuggest]] options\n * @public\n */\nexport interface AutoSuggestData {\n /** Value of [[AutoSuggest]] option. */\n value: string;\n /** Label of [[AutoSuggest]] option. This is shown in the dropdown. */\n label: string;\n}\n\n/** Prototype for function returning AutoSuggestData\n * @public\n */\nexport type GetAutoSuggestDataFunc = (value: string) => AutoSuggestData[];\n\n/** Prototype for async function returning AutoSuggestData\n * @public\n */\nexport type AsyncGetAutoSuggestDataFunc = (value: string) => Promise<AutoSuggestData[]>;\n\n/** Properties for the [[AutoSuggest]] component.\n * @public\n */\nexport interface AutoSuggestProps extends React.InputHTMLAttributes<HTMLInputElement>, CommonProps {\n /** Optional input value override. */\n value?: string;\n /** Options for dropdown. */\n options?: AutoSuggestData[] | GetAutoSuggestDataFunc;\n /** Asynchronously calculate suggestions for any given input value. */\n getSuggestions?: AsyncGetAutoSuggestDataFunc;\n /** Gets a label associated with a given value */\n getLabel?: (value: string | undefined) => string;\n /** Handler for when suggested selected. */\n onSuggestionSelected: (selected: AutoSuggestData) => void;\n /** Handler for Enter key. */\n onPressEnter?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\n /** Handler for Escape key. */\n onPressEscape?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\n /** Handler for Tab key. */\n onPressTab?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\n /** Handler for input receiving focus. */\n onInputFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;\n /** Called every time you need to clear suggestions. */\n onSuggestionsClearRequested?: () => void;\n /** Indicates whether to set focus to the input element */\n setFocus?: boolean;\n\n /** Use it only if you need to customize the rendering of the input.\n * @internal\n */\n renderInputComponent?: any; // ReactAutosuggest.RenderInputComponent<AutoSuggestData>; NOTE: changed to \"any\" because build was failing with RenderInputComponent is not generic?\n /** Use it if you want to customize things inside the suggestions container beyond rendering the suggestions themselves.\n * @internal\n */\n renderSuggestionsContainer?: ReactAutosuggest.RenderSuggestionsContainer;\n\n /** @internal */\n alwaysRenderSuggestions?: boolean;\n}\n\n/** @internal */\ninterface AutoSuggestState {\n inputValue: string;\n suggestions: AutoSuggestData[];\n}\n\n/** Auto Suggest React component. Uses the react-autosuggest component internally.\n * @public\n */\nexport class AutoSuggest extends React.PureComponent<AutoSuggestProps, AutoSuggestState> {\n private _isMounted = false;\n\n constructor(props: AutoSuggestProps) {\n super(props);\n\n // Autosuggest is a controlled component.\n // This means that you need to provide an input value\n // and an onChange handler that updates this value (see below).\n // Suggestions also need to be provided to the Autosuggest,\n // and they are initially empty because the Autosuggest is closed.\n this.state = {\n inputValue: this.getLabel(props.value),\n suggestions: [],\n };\n }\n\n /** @internal */\n public override componentDidMount() {\n this._isMounted = true;\n }\n\n /** @internal */\n public override componentWillUnmount() {\n this._isMounted = false;\n }\n\n public override componentDidUpdate(prevProps: AutoSuggestProps) {\n if (this.props.value !== prevProps.value || this.props.options !== prevProps.options) {\n this.setState((_prevState, props) => ({\n inputValue: this.getLabel(props.value),\n }));\n }\n }\n\n private _onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n let newValue = \"\";\n\n if (e.target.tagName === \"LI\" && e.target.textContent)\n newValue = e.target.textContent;\n else if (e.target.value)\n newValue = e.target.value;\n\n this.setState({\n inputValue: newValue,\n });\n };\n\n private _onFocus = (e: React.FocusEvent<HTMLInputElement>) => {\n // istanbul ignore else\n if (this.props.onInputFocus)\n this.props.onInputFocus(e);\n };\n\n /** Autosuggest will call this function every time you need to update suggestions. */\n private _onSuggestionsFetchRequested = async (request: ReactAutosuggest.SuggestionsFetchRequestedParams): Promise<void> => {\n const value = request.value;\n const suggestions = await this._getSuggestions(value);\n\n if (this._isMounted)\n this.setState({ suggestions });\n };\n\n /** Autosuggest will call this function every time you need to clear suggestions. */\n private _onSuggestionsClearRequested = () => {\n this.setState({ suggestions: [] });\n this.props.onSuggestionsClearRequested && this.props.onSuggestionsClearRequested();\n };\n\n private _onSuggestionSelected = (_event: React.FormEvent<any>, data: ReactAutosuggest.SuggestionSelectedEventData<AutoSuggestData>): void => {\n this.props.onSuggestionSelected(data.suggestion);\n };\n\n /** Teach Autosuggest how to calculate suggestions for any given input value. */\n private _getSuggestions = async (value: string): Promise<AutoSuggestData[]> => {\n if (typeof this.props.options === \"function\")\n return Promise.resolve(this.props.options(value));\n\n if (this.props.getSuggestions)\n return this.props.getSuggestions(value);\n\n if (this.props.options === undefined) {\n Logger.logError(UiCore.loggerCategory(this), `props.options or props.getSuggestions should be provided`);\n return Promise.resolve([]);\n }\n\n const inputValue = value.trim().toLowerCase();\n const inputLength = inputValue.length;\n\n return Promise.resolve(\n inputLength === 0 ?\n /* istanbul ignore next */[] :\n this.props.options.filter((data: AutoSuggestData) => {\n return data.label.toLowerCase().includes(inputValue) || data.value.toLowerCase().includes(inputValue);\n })\n );\n };\n\n /** When suggestion is clicked, Autosuggest needs to populate the input based on the clicked suggestion. */\n private _getSuggestionValue = (suggestion: AutoSuggestData) => suggestion.label;\n\n /** Render each suggestion. */\n private _renderSuggestion = (suggestion: AutoSuggestData) => (\n <span>\n {suggestion.label}\n </span>\n );\n\n private getLabel(value: string | undefined): string {\n let label = \"\";\n\n if (this.props.getLabel) {\n label = this.props.getLabel(value);\n } else if (this.props.options instanceof Array) {\n const entry = this.props.options.find((data: AutoSuggestData) => data.value === value);\n if (entry)\n label = entry.label;\n } else {\n Logger.logError(UiCore.loggerCategory(this), `props.getLabel should be provided when props.options is a function`);\n }\n\n return label;\n }\n\n private _handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n switch (e.key) {\n case SpecialKey.Enter:\n // istanbul ignore else\n if (this.props.onPressEnter)\n this.props.onPressEnter(e);\n break;\n case SpecialKey.Escape:\n // istanbul ignore else\n if (this.props.onPressEscape)\n this.props.onPressEscape(e);\n break;\n case SpecialKey.Tab:\n // istanbul ignore else\n if (this.props.onPressTab)\n this.props.onPressTab(e);\n break;\n }\n };\n\n private _theme = {\n container: \"uicore-autosuggest__container\",\n containerOpen: \"uicore-autosuggest__container--open\",\n input: \"uicore-autosuggest__input\",\n inputOpen: \"uicore-autosuggest__input--open\",\n inputFocused: \"uicore-autosuggest__input--focused\",\n suggestionsContainer: \"uicore-autosuggest__suggestions-container\",\n suggestionsContainerOpen: \"uicore-autosuggest__suggestions-container--open\",\n suggestionsList: \"uicore-autosuggest__suggestions-list\",\n suggestion: \"uicore-autosuggest__suggestion\",\n suggestionFirst: \"uicore-autosuggest__suggestion--first\",\n suggestionHighlighted: \"uicore-autosuggest__suggestion--highlighted\",\n sectionContainer: \"uicore-autosuggest__section-container\",\n sectionContainerFirst: \"uicore-autosuggest__section-container--first\",\n sectionTitle: \"uicore-autosuggest__section-title\",\n };\n\n public override render(): JSX.Element {\n const { inputValue, suggestions } = this.state;\n const { value, onChange, placeholder, options, onSuggestionSelected, setFocus, alwaysRenderSuggestions, // eslint-disable-line @typescript-eslint/no-unused-vars\n onPressEnter, onPressEscape, onPressTab, onInputFocus, getLabel, // eslint-disable-line @typescript-eslint/no-unused-vars\n getSuggestions, // eslint-disable-line deprecation/deprecation, @typescript-eslint/no-unused-vars\n renderInputComponent, renderSuggestionsContainer, onSuggestionsClearRequested, // eslint-disable-line @typescript-eslint/no-unused-vars\n ...props } = this.props;\n const inputPlaceholder = (!inputValue) ? placeholder : undefined;\n\n const inputProps: ReactAutosuggest.InputProps<AutoSuggestData> = {\n ...props,\n value: inputValue,\n onChange: this._onChange,\n onFocus: this._onFocus,\n placeholder: inputPlaceholder,\n autoFocus: setFocus,\n };\n\n return (\n // The onKeyDown event handler is only being used to capture bubbled events\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div className={this.props.className} style={this.props.style} onKeyDown={this._handleKeyDown}>\n <ReactAutosuggest\n theme={this._theme}\n suggestions={suggestions}\n onSuggestionsFetchRequested={this._onSuggestionsFetchRequested}\n onSuggestionsClearRequested={this._onSuggestionsClearRequested}\n getSuggestionValue={this._getSuggestionValue}\n renderSuggestion={this._renderSuggestion}\n inputProps={inputProps}\n onSuggestionSelected={this._onSuggestionSelected}\n alwaysRenderSuggestions={alwaysRenderSuggestions}\n renderInputComponent={renderInputComponent}\n renderSuggestionsContainer={renderSuggestionsContainer}\n />\n </div>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AutoSuggest.js","sourceRoot":"","sources":["../../../../src/core-react/autosuggest/AutoSuggest.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,uBA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I,CAAC,4BAA4B,EAC9D,2BAA2B,EAAE,IAAI,CAAC,4BAA4B,EAC9D,kBAAkB,EAAE,IAAI,CAAC,mBAAmB,EAC5C,gBAAgB,EAAE,IAAI,CAAC,iBAAiB,EACxC,UAAU,EAAE,UAAU,EACtB,oBAAoB,EAAE,IAAI,CAAC,qBAAqB,EAChD,uBAAuB,EAAE,uBAAuB,EAChD,oBAAoB,EAAE,oBAAoB,EAC1C,0BAA0B,EAAE,0BAA0B,GACtD,CACE,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\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 AutoSuggest\n */\n\nimport \"./AutoSuggest.scss\";\nimport * as React from \"react\";\nimport * as ReactAutosuggest from \"react-autosuggest\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { SpecialKey } from \"@itwin/appui-abstract\";\nimport { CommonProps } from \"../utils/Props\";\nimport { UiCore } from \"../UiCore\";\n\n/** Data for the [[AutoSuggest]] options\n * @public\n */\nexport interface AutoSuggestData {\n /** Value of [[AutoSuggest]] option. */\n value: string;\n /** Label of [[AutoSuggest]] option. This is shown in the dropdown. */\n label: string;\n}\n\n/** Prototype for function returning AutoSuggestData\n * @public\n */\nexport type GetAutoSuggestDataFunc = (value: string) => AutoSuggestData[];\n\n/** Prototype for async function returning AutoSuggestData\n * @public\n */\nexport type AsyncGetAutoSuggestDataFunc = (value: string) => Promise<AutoSuggestData[]>;\n\n/** Properties for the [[AutoSuggest]] component.\n * @public\n */\nexport interface AutoSuggestProps extends React.InputHTMLAttributes<HTMLInputElement>, CommonProps {\n /** Optional input value override. */\n value?: string;\n /** Options for dropdown. */\n options?: AutoSuggestData[] | GetAutoSuggestDataFunc;\n /** Asynchronously calculate suggestions for any given input value. */\n getSuggestions?: AsyncGetAutoSuggestDataFunc;\n /** Gets a label associated with a given value */\n getLabel?: (value: string | undefined) => string;\n /** Handler for when suggested selected. */\n onSuggestionSelected: (selected: AutoSuggestData) => void;\n /** Handler for Enter key. */\n onPressEnter?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\n /** Handler for Escape key. */\n onPressEscape?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\n /** Handler for Tab key. */\n onPressTab?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\n /** Handler for input receiving focus. */\n onInputFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;\n /** Called every time you need to clear suggestions. */\n onSuggestionsClearRequested?: () => void;\n /** Indicates whether to set focus to the input element */\n setFocus?: boolean;\n\n /** Use it only if you need to customize the rendering of the input.\n * @internal\n */\n renderInputComponent?: any; // ReactAutosuggest.RenderInputComponent<AutoSuggestData>; NOTE: changed to \"any\" because build was failing with RenderInputComponent is not generic?\n /** Use it if you want to customize things inside the suggestions container beyond rendering the suggestions themselves.\n * @internal\n */\n renderSuggestionsContainer?: ReactAutosuggest.RenderSuggestionsContainer;\n\n /** @internal */\n alwaysRenderSuggestions?: boolean;\n}\n\n/** @internal */\ninterface AutoSuggestState {\n inputValue: string;\n suggestions: AutoSuggestData[];\n}\n\n/** Auto Suggest React component. Uses the react-autosuggest component internally.\n * @public\n */\nexport class AutoSuggest extends React.PureComponent<AutoSuggestProps, AutoSuggestState> {\n private _isMounted = false;\n\n constructor(props: AutoSuggestProps) {\n super(props);\n\n // Autosuggest is a controlled component.\n // This means that you need to provide an input value\n // and an onChange handler that updates this value (see below).\n // Suggestions also need to be provided to the Autosuggest,\n // and they are initially empty because the Autosuggest is closed.\n this.state = {\n inputValue: this.getLabel(props.value),\n suggestions: [],\n };\n }\n\n /** @internal */\n public override componentDidMount() {\n this._isMounted = true;\n }\n\n /** @internal */\n public override componentWillUnmount() {\n this._isMounted = false;\n }\n\n public override componentDidUpdate(prevProps: AutoSuggestProps) {\n if (this.props.value !== prevProps.value || this.props.options !== prevProps.options) {\n this.setState((_prevState, props) => ({\n inputValue: this.getLabel(props.value),\n }));\n }\n }\n\n private _onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n let newValue = \"\";\n\n if (e.target.tagName === \"LI\" && e.target.textContent)\n newValue = e.target.textContent;\n else if (e.target.value)\n newValue = e.target.value;\n\n this.setState({\n inputValue: newValue,\n });\n };\n\n private _onFocus = (e: React.FocusEvent<HTMLInputElement>) => {\n // istanbul ignore else\n if (this.props.onInputFocus)\n this.props.onInputFocus(e);\n };\n\n /** Autosuggest will call this function every time you need to update suggestions. */\n private _onSuggestionsFetchRequested = async (request: ReactAutosuggest.SuggestionsFetchRequestedParams): Promise<void> => {\n const value = request.value;\n const suggestions = await this._getSuggestions(value);\n\n if (this._isMounted)\n this.setState({ suggestions });\n };\n\n /** Autosuggest will call this function every time you need to clear suggestions. */\n private _onSuggestionsClearRequested = () => {\n this.setState({ suggestions: [] });\n this.props.onSuggestionsClearRequested && this.props.onSuggestionsClearRequested();\n };\n\n private _onSuggestionSelected = (_event: React.FormEvent<any>, data: ReactAutosuggest.SuggestionSelectedEventData<AutoSuggestData>): void => {\n this.props.onSuggestionSelected(data.suggestion);\n };\n\n /** Teach Autosuggest how to calculate suggestions for any given input value. */\n private _getSuggestions = async (value: string): Promise<AutoSuggestData[]> => {\n if (typeof this.props.options === \"function\")\n return Promise.resolve(this.props.options(value));\n\n if (this.props.getSuggestions)\n return this.props.getSuggestions(value);\n\n if (this.props.options === undefined) {\n Logger.logError(UiCore.loggerCategory(this), `props.options or props.getSuggestions should be provided`);\n return Promise.resolve([]);\n }\n\n const inputValue = value.trim().toLowerCase();\n const inputLength = inputValue.length;\n\n return Promise.resolve(\n inputLength === 0 ?\n /* istanbul ignore next */[] :\n this.props.options.filter((data: AutoSuggestData) => {\n return data.label.toLowerCase().includes(inputValue) || data.value.toLowerCase().includes(inputValue);\n })\n );\n };\n\n /** When suggestion is clicked, Autosuggest needs to populate the input based on the clicked suggestion. */\n private _getSuggestionValue = (suggestion: AutoSuggestData) => suggestion.label;\n\n /** Render each suggestion. */\n private _renderSuggestion = (suggestion: AutoSuggestData) => (\n <span>\n {suggestion.label}\n </span>\n );\n\n private getLabel(value: string | undefined): string {\n let label = \"\";\n\n if (this.props.getLabel) {\n label = this.props.getLabel(value);\n } else if (this.props.options instanceof Array) {\n const entry = this.props.options.find((data: AutoSuggestData) => data.value === value);\n if (entry)\n label = entry.label;\n } else {\n Logger.logError(UiCore.loggerCategory(this), `props.getLabel should be provided when props.options is a function`);\n }\n\n return label;\n }\n\n private _handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n switch (e.key) {\n case SpecialKey.Enter:\n // istanbul ignore else\n if (this.props.onPressEnter)\n this.props.onPressEnter(e);\n break;\n case SpecialKey.Escape:\n // istanbul ignore else\n if (this.props.onPressEscape)\n this.props.onPressEscape(e);\n break;\n case SpecialKey.Tab:\n // istanbul ignore else\n if (this.props.onPressTab)\n this.props.onPressTab(e);\n break;\n }\n };\n\n private _theme = {\n container: \"uicore-autosuggest__container\",\n containerOpen: \"uicore-autosuggest__container--open\",\n input: \"iui-input uicore-autosuggest__input\",\n inputOpen: \"uicore-autosuggest__input--open\",\n inputFocused: \"uicore-autosuggest__input--focused\",\n suggestionsContainer: \"uicore-autosuggest__suggestions-container\",\n suggestionsContainerOpen: \"uicore-autosuggest__suggestions-container--open\",\n suggestionsList: \"uicore-autosuggest__suggestions-list\",\n suggestion: \"uicore-autosuggest__suggestion\",\n suggestionFirst: \"uicore-autosuggest__suggestion--first\",\n suggestionHighlighted: \"uicore-autosuggest__suggestion--highlighted\",\n sectionContainer: \"uicore-autosuggest__section-container\",\n sectionContainerFirst: \"uicore-autosuggest__section-container--first\",\n sectionTitle: \"uicore-autosuggest__section-title\",\n };\n\n public override render(): JSX.Element {\n const { inputValue, suggestions } = this.state;\n const { value, onChange, placeholder, options, onSuggestionSelected, setFocus, alwaysRenderSuggestions, // eslint-disable-line @typescript-eslint/no-unused-vars\n onPressEnter, onPressEscape, onPressTab, onInputFocus, getLabel, // eslint-disable-line @typescript-eslint/no-unused-vars\n getSuggestions, // eslint-disable-line deprecation/deprecation, @typescript-eslint/no-unused-vars\n renderInputComponent, renderSuggestionsContainer, onSuggestionsClearRequested, // eslint-disable-line @typescript-eslint/no-unused-vars\n ...props } = this.props;\n const inputPlaceholder = (!inputValue) ? placeholder : undefined;\n\n const inputProps: ReactAutosuggest.InputProps<AutoSuggestData> = {\n ...props,\n value: inputValue,\n onChange: this._onChange,\n onFocus: this._onFocus,\n placeholder: inputPlaceholder,\n autoFocus: setFocus,\n };\n\n return (\n // The onKeyDown event handler is only being used to capture bubbled events\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div className={this.props.className} style={this.props.style} onKeyDown={this._handleKeyDown}>\n <ReactAutosuggest\n theme={this._theme}\n suggestions={suggestions}\n onSuggestionsFetchRequested={this._onSuggestionsFetchRequested}\n onSuggestionsClearRequested={this._onSuggestionsClearRequested}\n getSuggestionValue={this._getSuggestionValue}\n renderSuggestion={this._renderSuggestion}\n inputProps={inputProps}\n onSuggestionSelected={this._onSuggestionSelected}\n alwaysRenderSuggestions={alwaysRenderSuggestions}\n renderInputComponent={renderInputComponent}\n renderSuggestionsContainer={renderSuggestionsContainer}\n />\n </div>\n );\n }\n}\n"]}
|
|
@@ -4,17 +4,14 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
@import "../scrollbar";
|
|
6
6
|
@import "../inputs/variables";
|
|
7
|
-
@import "../style/variables";
|
|
8
|
-
@import "~@itwin/itwinui-css/scss/inputs/input";
|
|
9
7
|
|
|
10
8
|
.uicore-autosuggest__container {
|
|
11
9
|
position: relative;
|
|
12
10
|
}
|
|
13
11
|
|
|
14
12
|
.uicore-autosuggest__input {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
padding: $uicore-iui-input-padding;
|
|
13
|
+
min-height: 28px !important;
|
|
14
|
+
padding: $uicore-iui-input-padding !important;
|
|
18
15
|
}
|
|
19
16
|
|
|
20
17
|
.uicore-autosuggest__input--focused {
|
|
@@ -39,8 +36,8 @@
|
|
|
39
36
|
position: absolute;
|
|
40
37
|
top: 24px;
|
|
41
38
|
width: 100%;
|
|
42
|
-
border: 1px solid
|
|
43
|
-
background-color:
|
|
39
|
+
border: 1px solid var(--iui-color-border-foreground);
|
|
40
|
+
background-color: var(--iui-color-background);
|
|
44
41
|
border-bottom-left-radius: 4px;
|
|
45
42
|
border-bottom-right-radius: 4px;
|
|
46
43
|
box-sizing: border-box;
|
|
@@ -64,7 +61,7 @@
|
|
|
64
61
|
}
|
|
65
62
|
|
|
66
63
|
.uicore-autosuggest__suggestion--highlighted {
|
|
67
|
-
background-color:
|
|
64
|
+
background-color: var(--iui-color-background-accent-muted);
|
|
68
65
|
}
|
|
69
66
|
|
|
70
67
|
.uicore-autosuggest__section-container {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BetaBadge.d.ts","sourceRoot":"","sources":["../../../../src/core-react/badge/BetaBadge.tsx"],"names":[],"mappings":"AAIA;;GAEG;;
|
|
1
|
+
{"version":3,"file":"BetaBadge.d.ts","sourceRoot":"","sources":["../../../../src/core-react/badge/BetaBadge.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAI7C;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,eAS3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BetaBadge.js","sourceRoot":"","sources":["../../../../src/core-react/badge/BetaBadge.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"BetaBadge.js","sourceRoot":"","sources":["../../../../src/core-react/badge/BetaBadge.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAE1D;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,KAAkB;IAC1C,MAAM,SAAS,GAAG,UAAU,CAAC,sBAAsB,EACjD,KAAK,CAAC,SAAS,CAChB,CAAC;IACF,OAAO,oBAAC,KAAK,OACP,KAAK,EACT,GAAG,EAAE,aAAa,EAClB,SAAS,EAAE,SAAS,GACpB,CAAC;AACL,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { CommonProps } from \"../utils/Props\";\nimport { Badge } from \"./Badge\";\nimport betaBadgeIcon from \"./technical-preview-badge.svg\";\n\n/** Beta Badge React component\n * @internal\n */\nexport function BetaBadge(props: CommonProps) {\n const className = classnames(\"core-badge-betaBadge\",\n props.className,\n );\n return <Badge\n {...props}\n svg={betaBadgeIcon}\n className={className}\n />;\n}\n"]}
|
|
@@ -11,7 +11,7 @@ import * as React from "react";
|
|
|
11
11
|
*/
|
|
12
12
|
export function Gap(props) {
|
|
13
13
|
const { size, style, ...rest } = props;
|
|
14
|
-
const paddingLeft = size
|
|
14
|
+
const paddingLeft = size ?? "10px";
|
|
15
15
|
return (React.createElement("span", { style: { ...style, paddingLeft }, ...rest }));
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=Gap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Gap.js","sourceRoot":"","sources":["../../../../src/core-react/base/Gap.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B;;GAEG;AACH,MAAM,UAAU,GAAG,CAAC,KAAe;IACjC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IACvC,MAAM,WAAW,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"Gap.js","sourceRoot":"","sources":["../../../../src/core-react/base/Gap.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B;;GAEG;AACH,MAAM,UAAU,GAAG,CAAC,KAAe;IACjC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IACvC,MAAM,WAAW,GAAG,IAAI,IAAI,MAAM,CAAC;IAEnC,OAAO,CACL,8BAAM,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,WAAW,EAAE,KAAM,IAAI,GAAI,CACrD,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Base\n */\n\nimport * as React from \"react\";\nimport { CommonProps } from \"../utils/Props\";\n\n/** Properties for the [[Gap]] component.\n * @public\n */\nexport interface GapProps extends CommonProps {\n size?: string;\n}\n\n/** Horizontal gap or space React component. Defaults to 10px.\n * @public\n */\nexport function Gap(props: GapProps) {\n const { size, style, ...rest } = props;\n const paddingLeft = size ?? \"10px\";\n\n return (\n <span style={{ ...style, paddingLeft }} {...rest} />\n );\n}\n"]}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
@import "../checkbox/index.scss";
|
|
6
5
|
|
|
7
6
|
.core-chk-listbox {
|
|
8
7
|
margin: 0;
|
|
@@ -16,7 +15,7 @@
|
|
|
16
15
|
|
|
17
16
|
> .core-chk-listbox-separator {
|
|
18
17
|
height: 1px;
|
|
19
|
-
background:
|
|
18
|
+
background: var(--iui-color-border-foreground);
|
|
20
19
|
margin: 4px 0;
|
|
21
20
|
pointer-events: none;
|
|
22
21
|
}
|
|
@@ -3,10 +3,7 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
@import "./style/index";
|
|
6
|
-
|
|
7
6
|
@import "./base/classes";
|
|
8
|
-
@import "./button/classes";
|
|
9
|
-
@import "./checkbox/classes";
|
|
10
7
|
@import "./expandable/classes";
|
|
11
8
|
@import "./icons/classes";
|
|
12
9
|
@import "./inputs/classes";
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
@import "~@itwin/itwinui-css/scss/style/theme";
|
|
6
|
-
|
|
7
5
|
// cspell:ignore colorvariables
|
|
8
6
|
|
|
9
7
|
/** @note: This file should only be imported by UiCore.ts.
|
|
10
8
|
* It should NOT be imported by any *.scss or other ui-core files.
|
|
11
9
|
*/
|
|
12
10
|
|
|
11
|
+
$background: var(--iui-color-background);
|
|
12
|
+
$accent: var(--iui-color-background-accent);
|
|
13
|
+
|
|
13
14
|
@mixin light-theme {
|
|
14
15
|
--buic-button-gradient1: rgba(
|
|
15
16
|
var(--iui-color-foreground-body-invert-rgb),
|
|
@@ -17,22 +18,7 @@
|
|
|
17
18
|
);
|
|
18
19
|
--buic-button-gradient2: rgba(var(--iui-color-foreground-body-invert-rgb), 0);
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
--buic-background-editable: #{mix(
|
|
22
|
-
$iui-color-background-1--light,
|
|
23
|
-
$iui-color-background-primary--light,
|
|
24
|
-
70%
|
|
25
|
-
)};
|
|
26
|
-
--buic-row-selection: #{mix(
|
|
27
|
-
$iui-color-background-1--light,
|
|
28
|
-
$iui-color-background-primary--light,
|
|
29
|
-
80%
|
|
30
|
-
)};
|
|
31
|
-
--buic-row-hover: #{mix(
|
|
32
|
-
$iui-color-background-1--light,
|
|
33
|
-
$iui-color-background-primary--light,
|
|
34
|
-
90%
|
|
35
|
-
)};
|
|
21
|
+
--buic-background-editable: var(--iui-color-background);
|
|
36
22
|
}
|
|
37
23
|
|
|
38
24
|
@mixin dark-theme {
|
|
@@ -42,22 +28,7 @@
|
|
|
42
28
|
0.25
|
|
43
29
|
);
|
|
44
30
|
|
|
45
|
-
|
|
46
|
-
--buic-background-editable: #{mix(
|
|
47
|
-
$iui-color-background-1--dark,
|
|
48
|
-
$iui-color-background-primary--dark,
|
|
49
|
-
70%
|
|
50
|
-
)};
|
|
51
|
-
--buic-row-selection: #{mix(
|
|
52
|
-
$iui-color-background-1--dark,
|
|
53
|
-
$iui-color-background-primary--dark,
|
|
54
|
-
80%
|
|
55
|
-
)};
|
|
56
|
-
--buic-row-hover: #{mix(
|
|
57
|
-
$iui-color-background-1--dark,
|
|
58
|
-
$iui-color-background-primary--dark,
|
|
59
|
-
90%
|
|
60
|
-
)};
|
|
31
|
+
--buic-background-editable: var(--iui-color-background);
|
|
61
32
|
}
|
|
62
33
|
|
|
63
34
|
html,
|