@itwin/core-react 4.11.0 → 4.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -1
- package/ContributeGuidelines.md +2 -2
- package/lib/cjs/core-react/UiCore.d.ts +2 -6
- package/lib/cjs/core-react/UiCore.d.ts.map +1 -1
- package/lib/cjs/core-react/UiCore.js +2 -18
- package/lib/cjs/core-react/UiCore.js.map +1 -1
- package/lib/cjs/core-react/UiCore.json +31 -0
- package/lib/cjs/core-react/autosuggest/AutoSuggest.d.ts +1 -1
- package/lib/cjs/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
- package/lib/cjs/core-react/autosuggest/AutoSuggest.js +2 -2
- package/lib/cjs/core-react/autosuggest/AutoSuggest.js.map +1 -1
- package/lib/cjs/core-react/badge/Badge.d.ts +6 -9
- package/lib/cjs/core-react/badge/Badge.d.ts.map +1 -1
- package/lib/cjs/core-react/badge/Badge.js +10 -9
- package/lib/cjs/core-react/badge/Badge.js.map +1 -1
- package/lib/{esm/core-react/badge/BadgeUtilities.d.ts → cjs/core-react/badge/BadgeType.d.ts} +1 -9
- package/lib/cjs/core-react/badge/BadgeType.d.ts.map +1 -0
- package/lib/cjs/core-react/{useTranslation.js → badge/BadgeType.js} +9 -13
- package/lib/cjs/core-react/badge/BadgeType.js.map +1 -0
- package/lib/cjs/core-react/badge/NewBadge.d.ts +2 -3
- package/lib/cjs/core-react/badge/NewBadge.d.ts.map +1 -1
- package/lib/cjs/core-react/badge/NewBadge.js +6 -7
- package/lib/cjs/core-react/badge/NewBadge.js.map +1 -1
- package/lib/cjs/core-react/badge/NewBadge.scss +2 -3
- package/lib/cjs/core-react/badge/TechnicalPreviewBadge.d.ts +10 -0
- package/lib/cjs/core-react/badge/TechnicalPreviewBadge.d.ts.map +1 -0
- package/lib/cjs/core-react/badge/TechnicalPreviewBadge.js +29 -0
- package/lib/cjs/core-react/badge/TechnicalPreviewBadge.js.map +1 -0
- package/lib/cjs/core-react/badge/{Badge.scss → TechnicalPreviewBadge.scss} +1 -7
- package/lib/cjs/core-react/base/Centered.d.ts +1 -0
- package/lib/cjs/core-react/base/Centered.d.ts.map +1 -1
- package/lib/cjs/core-react/base/Centered.js +2 -0
- package/lib/cjs/core-react/base/Centered.js.map +1 -1
- package/lib/cjs/core-react/base/Div.d.ts +2 -0
- package/lib/cjs/core-react/base/Div.d.ts.map +1 -1
- package/lib/cjs/core-react/base/Div.js +2 -0
- package/lib/cjs/core-react/base/Div.js.map +1 -1
- package/lib/cjs/core-react/base/DivWithOutsideClick.d.ts +1 -0
- package/lib/cjs/core-react/base/DivWithOutsideClick.d.ts.map +1 -1
- package/lib/cjs/core-react/base/DivWithOutsideClick.js +1 -0
- package/lib/cjs/core-react/base/DivWithOutsideClick.js.map +1 -1
- package/lib/cjs/core-react/base/FillCentered.d.ts +1 -0
- package/lib/cjs/core-react/base/FillCentered.d.ts.map +1 -1
- package/lib/cjs/core-react/base/FillCentered.js +2 -0
- package/lib/cjs/core-react/base/FillCentered.js.map +1 -1
- package/lib/cjs/core-react/base/FlexWrapContainer.d.ts +1 -0
- package/lib/cjs/core-react/base/FlexWrapContainer.d.ts.map +1 -1
- package/lib/cjs/core-react/base/FlexWrapContainer.js +2 -0
- package/lib/cjs/core-react/base/FlexWrapContainer.js.map +1 -1
- package/lib/cjs/core-react/base/Gap.d.ts +2 -0
- package/lib/cjs/core-react/base/Gap.d.ts.map +1 -1
- package/lib/cjs/core-react/base/Gap.js +3 -1
- package/lib/cjs/core-react/base/Gap.js.map +1 -1
- package/lib/cjs/core-react/base/ScrollView.d.ts +1 -0
- package/lib/cjs/core-react/base/ScrollView.d.ts.map +1 -1
- package/lib/cjs/core-react/base/ScrollView.js +2 -0
- package/lib/cjs/core-react/base/ScrollView.js.map +1 -1
- package/lib/cjs/core-react/button/UnderlinedButton.d.ts +2 -0
- package/lib/cjs/core-react/button/UnderlinedButton.d.ts.map +1 -1
- package/lib/cjs/core-react/button/UnderlinedButton.js +2 -0
- package/lib/cjs/core-react/button/UnderlinedButton.js.map +1 -1
- package/lib/cjs/core-react/checklistbox/CheckListBox.d.ts +4 -0
- package/lib/cjs/core-react/checklistbox/CheckListBox.d.ts.map +1 -1
- package/lib/cjs/core-react/checklistbox/CheckListBox.js +4 -0
- package/lib/cjs/core-react/checklistbox/CheckListBox.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.js +1 -2
- package/lib/cjs/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.d.ts +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.js +3 -3
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.js +3 -3
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js +3 -5
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.d.ts +4 -0
- package/lib/cjs/core-react/dialog/Dialog.d.ts.map +1 -1
- package/lib/cjs/core-react/dialog/Dialog.js +69 -53
- package/lib/cjs/core-react/dialog/Dialog.js.map +1 -1
- package/lib/cjs/core-react/dialog/GlobalDialog.d.ts +3 -0
- package/lib/cjs/core-react/dialog/GlobalDialog.d.ts.map +1 -1
- package/lib/cjs/core-react/dialog/GlobalDialog.js +7 -3
- package/lib/cjs/core-react/dialog/GlobalDialog.js.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.d.ts +4 -2
- package/lib/cjs/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.js +5 -3
- package/lib/cjs/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/cjs/core-react/expandable/ExpandableList.d.ts +3 -3
- package/lib/cjs/core-react/expandable/ExpandableList.d.ts.map +1 -1
- package/lib/cjs/core-react/expandable/ExpandableList.js +5 -2
- package/lib/cjs/core-react/expandable/ExpandableList.js.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/IconComponent.d.ts.map +1 -1
- package/lib/cjs/core-react/icons/IconComponent.js +22 -12
- package/lib/cjs/core-react/icons/IconComponent.js.map +1 -1
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.d.ts +3 -2
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.d.ts.map +1 -1
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js +3 -2
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
- package/lib/cjs/core-react/inputs/InputLabel.d.ts +2 -0
- package/lib/cjs/core-react/inputs/InputLabel.d.ts.map +1 -1
- package/lib/cjs/core-react/inputs/InputLabel.js +5 -0
- package/lib/cjs/core-react/inputs/InputLabel.js.map +1 -1
- package/lib/cjs/core-react/inputs/InputStatus.d.ts +1 -0
- package/lib/cjs/core-react/inputs/InputStatus.d.ts.map +1 -1
- package/lib/cjs/core-react/inputs/InputStatus.js +1 -0
- package/lib/cjs/core-react/inputs/InputStatus.js.map +1 -1
- package/lib/cjs/core-react/inputs/LabeledComponentProps.d.ts +2 -0
- package/lib/cjs/core-react/inputs/LabeledComponentProps.d.ts.map +1 -1
- package/lib/cjs/core-react/inputs/LabeledComponentProps.js.map +1 -1
- package/lib/cjs/core-react/inputs/iconinput/IconInput.d.ts +2 -0
- package/lib/cjs/core-react/inputs/iconinput/IconInput.d.ts.map +1 -1
- package/lib/cjs/core-react/inputs/iconinput/IconInput.js +3 -0
- package/lib/cjs/core-react/inputs/iconinput/IconInput.js.map +1 -1
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts +3 -0
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.js +1 -0
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.js.map +1 -1
- package/lib/cjs/core-react/l10n/LocalizationProvider.d.ts +20 -0
- package/lib/cjs/core-react/l10n/LocalizationProvider.d.ts.map +1 -0
- package/lib/cjs/core-react/l10n/LocalizationProvider.js +29 -0
- package/lib/cjs/core-react/l10n/LocalizationProvider.js.map +1 -0
- package/lib/cjs/core-react/l10n/usePackageTranslation.d.ts +15 -0
- package/lib/cjs/core-react/l10n/usePackageTranslation.d.ts.map +1 -0
- package/lib/cjs/core-react/l10n/usePackageTranslation.js +64 -0
- package/lib/cjs/core-react/l10n/usePackageTranslation.js.map +1 -0
- package/lib/cjs/core-react/l10n/useTranslation.d.ts +7 -0
- package/lib/cjs/core-react/l10n/useTranslation.d.ts.map +1 -0
- package/lib/cjs/core-react/l10n/useTranslation.js +30 -0
- package/lib/cjs/core-react/l10n/useTranslation.js.map +1 -0
- package/lib/cjs/core-react/listbox/Listbox.d.ts +14 -14
- package/lib/cjs/core-react/listbox/Listbox.d.ts.map +1 -1
- package/lib/cjs/core-react/listbox/Listbox.js +8 -10
- package/lib/cjs/core-react/listbox/Listbox.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingBar.d.ts +3 -2
- package/lib/cjs/core-react/loading/LoadingBar.d.ts.map +1 -1
- package/lib/cjs/core-react/loading/LoadingBar.js +2 -2
- package/lib/cjs/core-react/loading/LoadingBar.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingPrompt.d.ts +3 -2
- package/lib/cjs/core-react/loading/LoadingPrompt.d.ts.map +1 -1
- package/lib/cjs/core-react/loading/LoadingPrompt.js +2 -2
- package/lib/cjs/core-react/loading/LoadingPrompt.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingSpinner.d.ts +4 -2
- package/lib/cjs/core-react/loading/LoadingSpinner.d.ts.map +1 -1
- package/lib/cjs/core-react/loading/LoadingSpinner.js +2 -2
- package/lib/cjs/core-react/loading/LoadingSpinner.js.map +1 -1
- package/lib/cjs/core-react/loading/LoadingStatus.d.ts +3 -2
- package/lib/cjs/core-react/loading/LoadingStatus.d.ts.map +1 -1
- package/lib/cjs/core-react/loading/LoadingStatus.js +2 -2
- package/lib/cjs/core-react/loading/LoadingStatus.js.map +1 -1
- package/lib/cjs/core-react/messagebox/MessageBox.d.ts.map +1 -1
- package/lib/cjs/core-react/messagebox/MessageBox.js +3 -1
- package/lib/cjs/core-react/messagebox/MessageBox.js.map +1 -1
- 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/popup/Popup.js +4 -8
- package/lib/cjs/core-react/popup/Popup.js.map +1 -1
- package/lib/cjs/core-react/radialmenu/Annulus.d.ts +7 -8
- package/lib/cjs/core-react/radialmenu/Annulus.d.ts.map +1 -1
- package/lib/cjs/core-react/radialmenu/Annulus.js +7 -8
- package/lib/cjs/core-react/radialmenu/Annulus.js.map +1 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.d.ts +0 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/cjs/core-react/searchbox/SearchBox.d.ts +3 -3
- package/lib/cjs/core-react/searchbox/SearchBox.d.ts.map +1 -1
- package/lib/cjs/core-react/searchbox/SearchBox.js +15 -9
- package/lib/cjs/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/cjs/core-react/settings/SettingsContainer.d.ts.map +1 -1
- package/lib/cjs/core-react/settings/SettingsContainer.js +8 -4
- package/lib/cjs/core-react/settings/SettingsContainer.js.map +1 -1
- package/lib/cjs/core-react/settings/SettingsManager.d.ts +10 -7
- package/lib/cjs/core-react/settings/SettingsManager.d.ts.map +1 -1
- package/lib/cjs/core-react/settings/SettingsManager.js +14 -12
- package/lib/cjs/core-react/settings/SettingsManager.js.map +1 -1
- package/lib/cjs/core-react/tabs/Tabs.d.ts +5 -5
- package/lib/cjs/core-react/tabs/Tabs.d.ts.map +1 -1
- package/lib/cjs/core-react/tabs/Tabs.js +1 -0
- package/lib/cjs/core-react/tabs/Tabs.js.map +1 -1
- package/lib/cjs/core-react/tabs/VerticalTabs.d.ts +1 -0
- package/lib/cjs/core-react/tabs/VerticalTabs.d.ts.map +1 -1
- package/lib/cjs/core-react/tabs/VerticalTabs.js +2 -0
- package/lib/cjs/core-react/tabs/VerticalTabs.js.map +1 -1
- package/lib/cjs/core-react/text/BlockText.d.ts +1 -0
- package/lib/cjs/core-react/text/BlockText.d.ts.map +1 -1
- package/lib/cjs/core-react/text/BlockText.js +2 -0
- package/lib/cjs/core-react/text/BlockText.js.map +1 -1
- package/lib/cjs/core-react/text/BodyText.d.ts +1 -1
- package/lib/cjs/core-react/text/BodyText.d.ts.map +1 -1
- package/lib/cjs/core-react/text/BodyText.js +2 -1
- package/lib/cjs/core-react/text/BodyText.js.map +1 -1
- package/lib/cjs/core-react/text/DisabledText.d.ts +1 -0
- package/lib/cjs/core-react/text/DisabledText.d.ts.map +1 -1
- package/lib/cjs/core-react/text/DisabledText.js +2 -1
- package/lib/cjs/core-react/text/DisabledText.js.map +1 -1
- package/lib/cjs/core-react/text/MutedText.d.ts.map +1 -1
- package/lib/cjs/core-react/text/MutedText.js +1 -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.map +1 -1
- package/lib/cjs/core-react/text/TextProps.d.ts +1 -0
- package/lib/cjs/core-react/text/TextProps.d.ts.map +1 -1
- package/lib/cjs/core-react/text/TextProps.js.map +1 -1
- package/lib/cjs/core-react/tree/ExpansionToggle.d.ts +1 -3
- package/lib/cjs/core-react/tree/ExpansionToggle.d.ts.map +1 -1
- package/lib/cjs/core-react/tree/ExpansionToggle.js +9 -10
- package/lib/cjs/core-react/tree/ExpansionToggle.js.map +1 -1
- package/lib/cjs/core-react/tree/Node.js +1 -2
- package/lib/cjs/core-react/tree/Node.js.map +1 -1
- package/lib/cjs/core-react/utils/IconWebComponent.d.ts +4 -2
- package/lib/cjs/core-react/utils/IconWebComponent.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/IconWebComponent.js +10 -6
- package/lib/cjs/core-react/utils/IconWebComponent.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/getObjectClassName.js +2 -3
- package/lib/cjs/core-react/utils/getObjectClassName.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.d.ts +4 -1
- package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.js +5 -2
- package/lib/cjs/core-react/utils/hooks/ResizeObserverPolyfill.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.d.ts +1 -1
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js +2 -3
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js +12 -16
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/cjs/core-react.d.ts +3 -3
- package/lib/cjs/core-react.d.ts.map +1 -1
- package/lib/cjs/core-react.js +12 -9
- package/lib/cjs/core-react.js.map +1 -1
- package/lib/esm/core-react/UiCore.d.ts +2 -6
- package/lib/esm/core-react/UiCore.d.ts.map +1 -1
- package/lib/esm/core-react/UiCore.js +2 -18
- package/lib/esm/core-react/UiCore.js.map +1 -1
- package/lib/esm/core-react/UiCore.json +31 -0
- package/lib/esm/core-react/autosuggest/AutoSuggest.d.ts +1 -1
- package/lib/esm/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
- package/lib/esm/core-react/autosuggest/AutoSuggest.js +1 -1
- package/lib/esm/core-react/autosuggest/AutoSuggest.js.map +1 -1
- package/lib/esm/core-react/badge/Badge.d.ts +6 -9
- package/lib/esm/core-react/badge/Badge.d.ts.map +1 -1
- package/lib/esm/core-react/badge/Badge.js +10 -9
- package/lib/esm/core-react/badge/Badge.js.map +1 -1
- package/lib/{cjs/core-react/badge/BadgeUtilities.d.ts → esm/core-react/badge/BadgeType.d.ts} +1 -9
- package/lib/esm/core-react/badge/BadgeType.d.ts.map +1 -0
- package/lib/esm/core-react/badge/BadgeType.js +13 -0
- package/lib/esm/core-react/badge/BadgeType.js.map +1 -0
- package/lib/esm/core-react/badge/NewBadge.d.ts +2 -3
- package/lib/esm/core-react/badge/NewBadge.d.ts.map +1 -1
- package/lib/esm/core-react/badge/NewBadge.js +6 -7
- package/lib/esm/core-react/badge/NewBadge.js.map +1 -1
- package/lib/esm/core-react/badge/NewBadge.scss +2 -3
- package/lib/esm/core-react/badge/TechnicalPreviewBadge.d.ts +10 -0
- package/lib/esm/core-react/badge/TechnicalPreviewBadge.d.ts.map +1 -0
- package/lib/esm/core-react/badge/TechnicalPreviewBadge.js +25 -0
- package/lib/esm/core-react/badge/TechnicalPreviewBadge.js.map +1 -0
- package/lib/esm/core-react/badge/{Badge.scss → TechnicalPreviewBadge.scss} +1 -7
- package/lib/esm/core-react/base/Centered.d.ts +1 -0
- package/lib/esm/core-react/base/Centered.d.ts.map +1 -1
- package/lib/esm/core-react/base/Centered.js +2 -0
- package/lib/esm/core-react/base/Centered.js.map +1 -1
- package/lib/esm/core-react/base/Div.d.ts +2 -0
- package/lib/esm/core-react/base/Div.d.ts.map +1 -1
- package/lib/esm/core-react/base/Div.js +2 -0
- package/lib/esm/core-react/base/Div.js.map +1 -1
- package/lib/esm/core-react/base/DivWithOutsideClick.d.ts +1 -0
- package/lib/esm/core-react/base/DivWithOutsideClick.d.ts.map +1 -1
- package/lib/esm/core-react/base/DivWithOutsideClick.js +1 -0
- package/lib/esm/core-react/base/DivWithOutsideClick.js.map +1 -1
- package/lib/esm/core-react/base/FillCentered.d.ts +1 -0
- package/lib/esm/core-react/base/FillCentered.d.ts.map +1 -1
- package/lib/esm/core-react/base/FillCentered.js +2 -0
- package/lib/esm/core-react/base/FillCentered.js.map +1 -1
- package/lib/esm/core-react/base/FlexWrapContainer.d.ts +1 -0
- package/lib/esm/core-react/base/FlexWrapContainer.d.ts.map +1 -1
- package/lib/esm/core-react/base/FlexWrapContainer.js +2 -0
- package/lib/esm/core-react/base/FlexWrapContainer.js.map +1 -1
- package/lib/esm/core-react/base/Gap.d.ts +2 -0
- package/lib/esm/core-react/base/Gap.d.ts.map +1 -1
- package/lib/esm/core-react/base/Gap.js +3 -1
- package/lib/esm/core-react/base/Gap.js.map +1 -1
- package/lib/esm/core-react/base/ScrollView.d.ts +1 -0
- package/lib/esm/core-react/base/ScrollView.d.ts.map +1 -1
- package/lib/esm/core-react/base/ScrollView.js +2 -0
- package/lib/esm/core-react/base/ScrollView.js.map +1 -1
- package/lib/esm/core-react/button/UnderlinedButton.d.ts +2 -0
- package/lib/esm/core-react/button/UnderlinedButton.d.ts.map +1 -1
- package/lib/esm/core-react/button/UnderlinedButton.js +2 -0
- package/lib/esm/core-react/button/UnderlinedButton.js.map +1 -1
- package/lib/esm/core-react/checklistbox/CheckListBox.d.ts +4 -0
- package/lib/esm/core-react/checklistbox/CheckListBox.d.ts.map +1 -1
- package/lib/esm/core-react/checklistbox/CheckListBox.js +4 -0
- package/lib/esm/core-react/checklistbox/CheckListBox.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.js +1 -2
- package/lib/esm/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuItem.d.ts +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuItem.js +3 -3
- package/lib/esm/core-react/contextmenu/ContextMenuItem.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextSubMenu.js +3 -3
- package/lib/esm/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.js +3 -5
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.d.ts +4 -0
- package/lib/esm/core-react/dialog/Dialog.d.ts.map +1 -1
- package/lib/esm/core-react/dialog/Dialog.js +69 -53
- package/lib/esm/core-react/dialog/Dialog.js.map +1 -1
- package/lib/esm/core-react/dialog/GlobalDialog.d.ts +3 -0
- package/lib/esm/core-react/dialog/GlobalDialog.d.ts.map +1 -1
- package/lib/esm/core-react/dialog/GlobalDialog.js +7 -3
- package/lib/esm/core-react/dialog/GlobalDialog.js.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.d.ts +4 -2
- package/lib/esm/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.js +5 -3
- package/lib/esm/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/esm/core-react/expandable/ExpandableList.d.ts +3 -3
- package/lib/esm/core-react/expandable/ExpandableList.d.ts.map +1 -1
- package/lib/esm/core-react/expandable/ExpandableList.js +5 -2
- package/lib/esm/core-react/expandable/ExpandableList.js.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/IconComponent.d.ts.map +1 -1
- package/lib/esm/core-react/icons/IconComponent.js +21 -11
- package/lib/esm/core-react/icons/IconComponent.js.map +1 -1
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.d.ts +3 -2
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.d.ts.map +1 -1
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js +3 -2
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
- package/lib/esm/core-react/inputs/InputLabel.d.ts +2 -0
- package/lib/esm/core-react/inputs/InputLabel.d.ts.map +1 -1
- package/lib/esm/core-react/inputs/InputLabel.js +5 -0
- package/lib/esm/core-react/inputs/InputLabel.js.map +1 -1
- package/lib/esm/core-react/inputs/InputStatus.d.ts +1 -0
- package/lib/esm/core-react/inputs/InputStatus.d.ts.map +1 -1
- package/lib/esm/core-react/inputs/InputStatus.js +1 -0
- package/lib/esm/core-react/inputs/InputStatus.js.map +1 -1
- package/lib/esm/core-react/inputs/LabeledComponentProps.d.ts +2 -0
- package/lib/esm/core-react/inputs/LabeledComponentProps.d.ts.map +1 -1
- package/lib/esm/core-react/inputs/LabeledComponentProps.js.map +1 -1
- package/lib/esm/core-react/inputs/iconinput/IconInput.d.ts +2 -0
- package/lib/esm/core-react/inputs/iconinput/IconInput.d.ts.map +1 -1
- package/lib/esm/core-react/inputs/iconinput/IconInput.js +3 -0
- package/lib/esm/core-react/inputs/iconinput/IconInput.js.map +1 -1
- package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts +3 -0
- package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
- package/lib/esm/core-react/inputs/numberinput/NumberInput.js +1 -0
- package/lib/esm/core-react/inputs/numberinput/NumberInput.js.map +1 -1
- package/lib/esm/core-react/l10n/LocalizationProvider.d.ts +20 -0
- package/lib/esm/core-react/l10n/LocalizationProvider.d.ts.map +1 -0
- package/lib/esm/core-react/l10n/LocalizationProvider.js +24 -0
- package/lib/esm/core-react/l10n/LocalizationProvider.js.map +1 -0
- package/lib/esm/core-react/l10n/usePackageTranslation.d.ts +15 -0
- package/lib/esm/core-react/l10n/usePackageTranslation.d.ts.map +1 -0
- package/lib/esm/core-react/l10n/usePackageTranslation.js +60 -0
- package/lib/esm/core-react/l10n/usePackageTranslation.js.map +1 -0
- package/lib/esm/core-react/l10n/useTranslation.d.ts +7 -0
- package/lib/esm/core-react/l10n/useTranslation.d.ts.map +1 -0
- package/lib/esm/core-react/l10n/useTranslation.js +26 -0
- package/lib/esm/core-react/l10n/useTranslation.js.map +1 -0
- package/lib/esm/core-react/listbox/Listbox.d.ts +14 -14
- package/lib/esm/core-react/listbox/Listbox.d.ts.map +1 -1
- package/lib/esm/core-react/listbox/Listbox.js +8 -10
- package/lib/esm/core-react/listbox/Listbox.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingBar.d.ts +3 -2
- package/lib/esm/core-react/loading/LoadingBar.d.ts.map +1 -1
- package/lib/esm/core-react/loading/LoadingBar.js +2 -2
- package/lib/esm/core-react/loading/LoadingBar.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingPrompt.d.ts +3 -2
- package/lib/esm/core-react/loading/LoadingPrompt.d.ts.map +1 -1
- package/lib/esm/core-react/loading/LoadingPrompt.js +2 -2
- package/lib/esm/core-react/loading/LoadingPrompt.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingSpinner.d.ts +4 -2
- package/lib/esm/core-react/loading/LoadingSpinner.d.ts.map +1 -1
- package/lib/esm/core-react/loading/LoadingSpinner.js +2 -2
- package/lib/esm/core-react/loading/LoadingSpinner.js.map +1 -1
- package/lib/esm/core-react/loading/LoadingStatus.d.ts +3 -2
- package/lib/esm/core-react/loading/LoadingStatus.d.ts.map +1 -1
- package/lib/esm/core-react/loading/LoadingStatus.js +2 -2
- package/lib/esm/core-react/loading/LoadingStatus.js.map +1 -1
- package/lib/esm/core-react/messagebox/MessageBox.d.ts.map +1 -1
- package/lib/esm/core-react/messagebox/MessageBox.js +3 -1
- package/lib/esm/core-react/messagebox/MessageBox.js.map +1 -1
- 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/popup/Popup.js +4 -8
- package/lib/esm/core-react/popup/Popup.js.map +1 -1
- package/lib/esm/core-react/radialmenu/Annulus.d.ts +7 -8
- package/lib/esm/core-react/radialmenu/Annulus.d.ts.map +1 -1
- package/lib/esm/core-react/radialmenu/Annulus.js +7 -8
- package/lib/esm/core-react/radialmenu/Annulus.js.map +1 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.d.ts +0 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.d.ts.map +1 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/esm/core-react/searchbox/SearchBox.d.ts +3 -3
- package/lib/esm/core-react/searchbox/SearchBox.d.ts.map +1 -1
- package/lib/esm/core-react/searchbox/SearchBox.js +15 -9
- package/lib/esm/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/esm/core-react/settings/SettingsContainer.d.ts.map +1 -1
- package/lib/esm/core-react/settings/SettingsContainer.js +8 -4
- package/lib/esm/core-react/settings/SettingsContainer.js.map +1 -1
- package/lib/esm/core-react/settings/SettingsManager.d.ts +10 -7
- package/lib/esm/core-react/settings/SettingsManager.d.ts.map +1 -1
- package/lib/esm/core-react/settings/SettingsManager.js +13 -10
- package/lib/esm/core-react/settings/SettingsManager.js.map +1 -1
- package/lib/esm/core-react/tabs/Tabs.d.ts +5 -5
- package/lib/esm/core-react/tabs/Tabs.d.ts.map +1 -1
- package/lib/esm/core-react/tabs/Tabs.js +1 -0
- package/lib/esm/core-react/tabs/Tabs.js.map +1 -1
- package/lib/esm/core-react/tabs/VerticalTabs.d.ts +1 -0
- package/lib/esm/core-react/tabs/VerticalTabs.d.ts.map +1 -1
- package/lib/esm/core-react/tabs/VerticalTabs.js +2 -0
- package/lib/esm/core-react/tabs/VerticalTabs.js.map +1 -1
- package/lib/esm/core-react/text/BlockText.d.ts +1 -0
- package/lib/esm/core-react/text/BlockText.d.ts.map +1 -1
- package/lib/esm/core-react/text/BlockText.js +2 -0
- package/lib/esm/core-react/text/BlockText.js.map +1 -1
- package/lib/esm/core-react/text/BodyText.d.ts +1 -1
- package/lib/esm/core-react/text/BodyText.d.ts.map +1 -1
- package/lib/esm/core-react/text/BodyText.js +2 -1
- package/lib/esm/core-react/text/BodyText.js.map +1 -1
- package/lib/esm/core-react/text/DisabledText.d.ts +1 -0
- package/lib/esm/core-react/text/DisabledText.d.ts.map +1 -1
- package/lib/esm/core-react/text/DisabledText.js +2 -1
- package/lib/esm/core-react/text/DisabledText.js.map +1 -1
- package/lib/esm/core-react/text/MutedText.d.ts.map +1 -1
- package/lib/esm/core-react/text/MutedText.js +1 -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.map +1 -1
- package/lib/esm/core-react/text/TextProps.d.ts +1 -0
- package/lib/esm/core-react/text/TextProps.d.ts.map +1 -1
- package/lib/esm/core-react/text/TextProps.js.map +1 -1
- package/lib/esm/core-react/tree/ExpansionToggle.d.ts +1 -3
- package/lib/esm/core-react/tree/ExpansionToggle.d.ts.map +1 -1
- package/lib/esm/core-react/tree/ExpansionToggle.js +9 -10
- package/lib/esm/core-react/tree/ExpansionToggle.js.map +1 -1
- package/lib/esm/core-react/tree/Node.js +1 -2
- package/lib/esm/core-react/tree/Node.js.map +1 -1
- package/lib/esm/core-react/utils/IconWebComponent.d.ts +4 -2
- package/lib/esm/core-react/utils/IconWebComponent.d.ts.map +1 -1
- package/lib/esm/core-react/utils/IconWebComponent.js +8 -5
- package/lib/esm/core-react/utils/IconWebComponent.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/getObjectClassName.js +2 -3
- package/lib/esm/core-react/utils/getObjectClassName.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.d.ts +4 -1
- package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.js +3 -1
- package/lib/esm/core-react/utils/hooks/ResizeObserverPolyfill.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.d.ts +1 -1
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js +2 -3
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useResizeObserver.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js +13 -17
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/esm/core-react.d.ts +3 -3
- package/lib/esm/core-react.d.ts.map +1 -1
- package/lib/esm/core-react.js +5 -4
- package/lib/esm/core-react.js.map +1 -1
- package/package.json +8 -33
- package/lib/cjs/core-react/badge/BadgeUtilities.d.ts.map +0 -1
- package/lib/cjs/core-react/badge/BadgeUtilities.js +0 -43
- package/lib/cjs/core-react/badge/BadgeUtilities.js.map +0 -1
- package/lib/cjs/core-react/badge/BetaBadge.d.ts +0 -10
- package/lib/cjs/core-react/badge/BetaBadge.d.ts.map +0 -1
- package/lib/cjs/core-react/badge/BetaBadge.js +0 -23
- package/lib/cjs/core-react/badge/BetaBadge.js.map +0 -1
- package/lib/cjs/core-react/badge/new-feature-badge.svg +0 -1
- package/lib/cjs/core-react/badge/technical-preview-badge.svg +0 -1
- package/lib/cjs/core-react/useTranslation.d.ts +0 -10
- package/lib/cjs/core-react/useTranslation.d.ts.map +0 -1
- package/lib/cjs/core-react/useTranslation.js.map +0 -1
- package/lib/esm/core-react/badge/BadgeUtilities.d.ts.map +0 -1
- package/lib/esm/core-react/badge/BadgeUtilities.js +0 -39
- package/lib/esm/core-react/badge/BadgeUtilities.js.map +0 -1
- package/lib/esm/core-react/badge/BetaBadge.d.ts +0 -10
- package/lib/esm/core-react/badge/BetaBadge.d.ts.map +0 -1
- package/lib/esm/core-react/badge/BetaBadge.js +0 -19
- package/lib/esm/core-react/badge/BetaBadge.js.map +0 -1
- package/lib/esm/core-react/badge/new-feature-badge.svg +0 -1
- package/lib/esm/core-react/badge/technical-preview-badge.svg +0 -1
- package/lib/esm/core-react/useTranslation.d.ts +0 -10
- package/lib/esm/core-react/useTranslation.d.ts.map +0 -1
- package/lib/esm/core-react/useTranslation.js +0 -16
- package/lib/esm/core-react/useTranslation.js.map +0 -1
|
@@ -11,8 +11,10 @@ exports.VerticalTabs = void 0;
|
|
|
11
11
|
const React = require("react");
|
|
12
12
|
const Tabs_1 = require("./Tabs");
|
|
13
13
|
const Orientation_1 = require("../enums/Orientation");
|
|
14
|
+
/* eslint-disable deprecation/deprecation */
|
|
14
15
|
/** Vertical tabs meant to represent the current position in a page/section
|
|
15
16
|
* @public
|
|
17
|
+
* @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/tabs#vertical iTwinUI Tabs} instead.
|
|
16
18
|
*/
|
|
17
19
|
function VerticalTabs(props) {
|
|
18
20
|
return (React.createElement(Tabs_1.Tabs, { mainClassName: "uicore-tabs-vertical", orientation: Orientation_1.Orientation.Vertical, ...props }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerticalTabs.js","sourceRoot":"","sources":["../../../../src/core-react/tabs/VerticalTabs.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAE/B,iCAA8B;AAC9B,sDAAmD;AAEnD
|
|
1
|
+
{"version":3,"file":"VerticalTabs.js","sourceRoot":"","sources":["../../../../src/core-react/tabs/VerticalTabs.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAE/B,iCAA8B;AAC9B,sDAAmD;AAEnD,4CAA4C;AAE5C;;;GAGG;AACH,SAAgB,YAAY,CAAC,KAAgB;IAC3C,OAAO,CACL,oBAAC,WAAI,IACH,aAAa,EAAC,sBAAsB,EACpC,WAAW,EAAE,yBAAW,CAAC,QAAQ,KAC7B,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AARD,oCAQC","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 Tabs\n */\n\nimport * as React from \"react\";\nimport type { TabsProps } from \"./Tabs\";\nimport { Tabs } from \"./Tabs\";\nimport { Orientation } from \"../enums/Orientation\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Vertical tabs meant to represent the current position in a page/section\n * @public\n * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/tabs#vertical iTwinUI Tabs} instead.\n */\nexport function VerticalTabs(props: TabsProps) {\n return (\n <Tabs\n mainClassName=\"uicore-tabs-vertical\"\n orientation={Orientation.Vertical}\n {...props}\n />\n );\n}\n"]}
|
|
@@ -5,6 +5,7 @@ import * as React from "react";
|
|
|
5
5
|
import type { TextProps } from "./TextProps";
|
|
6
6
|
/** Styled block text React functional component
|
|
7
7
|
* @public
|
|
8
|
+
* @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/typography#text iTwinUI Text} instead.
|
|
8
9
|
*/
|
|
9
10
|
export declare function BlockText(props: TextProps): React.JSX.Element;
|
|
10
11
|
//# sourceMappingURL=BlockText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockText.d.ts","sourceRoot":"","sources":["../../../../src/core-react/text/BlockText.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C
|
|
1
|
+
{"version":3,"file":"BlockText.d.ts","sourceRoot":"","sources":["../../../../src/core-react/text/BlockText.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;GAGG;AAEH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,qBAGzC"}
|
|
@@ -12,7 +12,9 @@ const React = require("react");
|
|
|
12
12
|
const StyledText_1 = require("./StyledText");
|
|
13
13
|
/** Styled block text React functional component
|
|
14
14
|
* @public
|
|
15
|
+
* @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/typography#text iTwinUI Text} instead.
|
|
15
16
|
*/
|
|
17
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
16
18
|
function BlockText(props) {
|
|
17
19
|
// eslint-disable-next-line deprecation/deprecation
|
|
18
20
|
return React.createElement(StyledText_1.StyledText, { ...props, mainClassName: "uicore-text-block" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockText.js","sourceRoot":"","sources":["../../../../src/core-react/text/BlockText.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAC/B,6CAA0C;AAG1C
|
|
1
|
+
{"version":3,"file":"BlockText.js","sourceRoot":"","sources":["../../../../src/core-react/text/BlockText.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAC/B,6CAA0C;AAG1C;;;GAGG;AACH,mDAAmD;AACnD,SAAgB,SAAS,CAAC,KAAgB;IACxC,mDAAmD;IACnD,OAAO,oBAAC,uBAAU,OAAK,KAAK,EAAE,aAAa,EAAC,mBAAmB,GAAG,CAAC;AACrE,CAAC;AAHD,8BAGC","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 Text\n */\n\nimport * as React from \"react\";\nimport { StyledText } from \"./StyledText\";\nimport type { TextProps } from \"./TextProps\";\n\n/** Styled block text React functional component\n * @public\n * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/typography#text iTwinUI Text} instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function BlockText(props: TextProps) {\n // eslint-disable-next-line deprecation/deprecation\n return <StyledText {...props} mainClassName=\"uicore-text-block\" />;\n}\n"]}
|
|
@@ -5,7 +5,7 @@ import * as React from "react";
|
|
|
5
5
|
import type { TextProps } from "./TextProps";
|
|
6
6
|
/** Styled body text React functional component
|
|
7
7
|
* @public
|
|
8
|
-
* @deprecated in 4.0 Use
|
|
8
|
+
* @deprecated in 4.0 Use `<Text variant='body' />` from iTwinUI-react package.
|
|
9
9
|
*/
|
|
10
10
|
export declare function BodyText(props: TextProps): React.JSX.Element;
|
|
11
11
|
//# sourceMappingURL=BodyText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BodyText.d.ts","sourceRoot":"","sources":["../../../../src/core-react/text/BodyText.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;GAGG;
|
|
1
|
+
{"version":3,"file":"BodyText.d.ts","sourceRoot":"","sources":["../../../../src/core-react/text/BodyText.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;GAGG;AAEH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,qBAGxC"}
|
|
@@ -12,8 +12,9 @@ const React = require("react");
|
|
|
12
12
|
const StyledText_1 = require("./StyledText");
|
|
13
13
|
/** Styled body text React functional component
|
|
14
14
|
* @public
|
|
15
|
-
* @deprecated in 4.0 Use
|
|
15
|
+
* @deprecated in 4.0 Use `<Text variant='body' />` from iTwinUI-react package.
|
|
16
16
|
*/
|
|
17
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
17
18
|
function BodyText(props) {
|
|
18
19
|
// eslint-disable-next-line deprecation/deprecation
|
|
19
20
|
return React.createElement(StyledText_1.StyledText, { ...props, mainClassName: "uicore-text-body" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BodyText.js","sourceRoot":"","sources":["../../../../src/core-react/text/BodyText.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAC/B,6CAA0C;AAG1C;;;GAGG;AACH,SAAgB,QAAQ,CAAC,KAAgB;IACvC,mDAAmD;IACnD,OAAO,oBAAC,uBAAU,OAAK,KAAK,EAAE,aAAa,EAAC,kBAAkB,GAAG,CAAC;AACpE,CAAC;AAHD,4BAGC","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 Text\n */\n\nimport * as React from \"react\";\nimport { StyledText } from \"./StyledText\";\nimport type { TextProps } from \"./TextProps\";\n\n/** Styled body text React functional component\n * @public\n * @deprecated in 4.0 Use
|
|
1
|
+
{"version":3,"file":"BodyText.js","sourceRoot":"","sources":["../../../../src/core-react/text/BodyText.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAC/B,6CAA0C;AAG1C;;;GAGG;AACH,mDAAmD;AACnD,SAAgB,QAAQ,CAAC,KAAgB;IACvC,mDAAmD;IACnD,OAAO,oBAAC,uBAAU,OAAK,KAAK,EAAE,aAAa,EAAC,kBAAkB,GAAG,CAAC;AACpE,CAAC;AAHD,4BAGC","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 Text\n */\n\nimport * as React from \"react\";\nimport { StyledText } from \"./StyledText\";\nimport type { TextProps } from \"./TextProps\";\n\n/** Styled body text React functional component\n * @public\n * @deprecated in 4.0 Use `<Text variant='body' />` from iTwinUI-react package.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function BodyText(props: TextProps) {\n // eslint-disable-next-line deprecation/deprecation\n return <StyledText {...props} mainClassName=\"uicore-text-body\" />;\n}\n"]}
|
|
@@ -5,6 +5,7 @@ import * as React from "react";
|
|
|
5
5
|
import type { TextProps } from "./TextProps";
|
|
6
6
|
/** Styled disabled text React functional component
|
|
7
7
|
* @public
|
|
8
|
+
* @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/typography#text iTwinUI Text} instead.
|
|
8
9
|
*/
|
|
9
10
|
export declare function DisabledText(props: TextProps): React.JSX.Element;
|
|
10
11
|
//# sourceMappingURL=DisabledText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisabledText.d.ts","sourceRoot":"","sources":["../../../../src/core-react/text/DisabledText.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"DisabledText.d.ts","sourceRoot":"","sources":["../../../../src/core-react/text/DisabledText.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAI7C;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,qBAE5C"}
|
|
@@ -10,11 +10,12 @@ exports.DisabledText = void 0;
|
|
|
10
10
|
*/
|
|
11
11
|
const React = require("react");
|
|
12
12
|
const StyledText_1 = require("./StyledText");
|
|
13
|
+
/* eslint-disable deprecation/deprecation */
|
|
13
14
|
/** Styled disabled text React functional component
|
|
14
15
|
* @public
|
|
16
|
+
* @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/typography#text iTwinUI Text} instead.
|
|
15
17
|
*/
|
|
16
18
|
function DisabledText(props) {
|
|
17
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
18
19
|
return React.createElement(StyledText_1.StyledText, { ...props, mainClassName: "uicore-text-disabled" });
|
|
19
20
|
}
|
|
20
21
|
exports.DisabledText = DisabledText;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisabledText.js","sourceRoot":"","sources":["../../../../src/core-react/text/DisabledText.tsx"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG;;GAEG;AACH,+BAA+B;AAC/B,6CAA0C;AAG1C
|
|
1
|
+
{"version":3,"file":"DisabledText.js","sourceRoot":"","sources":["../../../../src/core-react/text/DisabledText.tsx"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG;;GAEG;AACH,+BAA+B;AAC/B,6CAA0C;AAG1C,4CAA4C;AAE5C;;;GAGG;AACH,SAAgB,YAAY,CAAC,KAAgB;IAC3C,OAAO,oBAAC,uBAAU,OAAK,KAAK,EAAE,aAAa,EAAC,sBAAsB,GAAG,CAAC;AACxE,CAAC;AAFD,oCAEC","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 Text\n */\nimport * as React from \"react\";\nimport { StyledText } from \"./StyledText\";\nimport type { TextProps } from \"./TextProps\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Styled disabled text React functional component\n * @public\n * @deprecated in 4.12.x. Use {@link https://itwinui.bentley.com/docs/typography#text iTwinUI Text} instead.\n */\nexport function DisabledText(props: TextProps) {\n return <StyledText {...props} mainClassName=\"uicore-text-disabled\" />;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutedText.d.ts","sourceRoot":"","sources":["../../../../src/core-react/text/MutedText.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;GAGG;
|
|
1
|
+
{"version":3,"file":"MutedText.d.ts","sourceRoot":"","sources":["../../../../src/core-react/text/MutedText.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;GAGG;AAEH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,qBAGzC"}
|
|
@@ -14,6 +14,7 @@ const StyledText_1 = require("./StyledText");
|
|
|
14
14
|
* @public
|
|
15
15
|
* @deprecated in 4.0 Use \<Text isMuted /\> from iTwinUI-react package.
|
|
16
16
|
*/
|
|
17
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
17
18
|
function MutedText(props) {
|
|
18
19
|
// eslint-disable-next-line deprecation/deprecation
|
|
19
20
|
return React.createElement(StyledText_1.StyledText, { ...props, mainClassName: "uicore-text-muted" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutedText.js","sourceRoot":"","sources":["../../../../src/core-react/text/MutedText.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAC/B,6CAA0C;AAG1C;;;GAGG;AACH,SAAgB,SAAS,CAAC,KAAgB;IACxC,mDAAmD;IACnD,OAAO,oBAAC,uBAAU,OAAK,KAAK,EAAE,aAAa,EAAC,mBAAmB,GAAG,CAAC;AACrE,CAAC;AAHD,8BAGC","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 Text\n */\n\nimport * as React from \"react\";\nimport { StyledText } from \"./StyledText\";\nimport type { TextProps } from \"./TextProps\";\n\n/** Styled muted/gray text React functional component\n * @public\n * @deprecated in 4.0 Use \\<Text isMuted /\\> from iTwinUI-react package.\n */\nexport function MutedText(props: TextProps) {\n // eslint-disable-next-line deprecation/deprecation\n return <StyledText {...props} mainClassName=\"uicore-text-muted\" />;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MutedText.js","sourceRoot":"","sources":["../../../../src/core-react/text/MutedText.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAC/B,6CAA0C;AAG1C;;;GAGG;AACH,mDAAmD;AACnD,SAAgB,SAAS,CAAC,KAAgB;IACxC,mDAAmD;IACnD,OAAO,oBAAC,uBAAU,OAAK,KAAK,EAAE,aAAa,EAAC,mBAAmB,GAAG,CAAC;AACrE,CAAC;AAHD,8BAGC","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 Text\n */\n\nimport * as React from \"react\";\nimport { StyledText } from \"./StyledText\";\nimport type { TextProps } from \"./TextProps\";\n\n/** Styled muted/gray text React functional component\n * @public\n * @deprecated in 4.0 Use \\<Text isMuted /\\> from iTwinUI-react package.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport function MutedText(props: TextProps) {\n // eslint-disable-next-line deprecation/deprecation\n return <StyledText {...props} mainClassName=\"uicore-text-muted\" />;\n}\n"]}
|
|
@@ -5,6 +5,7 @@ import * as React from "react";
|
|
|
5
5
|
import type { TextProps } from "./TextProps";
|
|
6
6
|
/** Properties for [[StyledText]] component
|
|
7
7
|
* @public
|
|
8
|
+
* @deprecated in 4.12.x. Props of deprecated component {@link StyledText}.
|
|
8
9
|
*/
|
|
9
10
|
export interface StyledTextProps extends TextProps {
|
|
10
11
|
/** Main CSS class name */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledText.d.ts","sourceRoot":"","sources":["../../../../src/core-react/text/StyledText.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"StyledText.d.ts","sourceRoot":"","sources":["../../../../src/core-react/text/StyledText.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAI7C;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,0BAA0B;IAC1B,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,qBAYhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledText.js","sourceRoot":"","sources":["../../../../src/core-react/text/StyledText.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,2CAAoC;AACpC,+BAA+B;
|
|
1
|
+
{"version":3,"file":"StyledText.js","sourceRoot":"","sources":["../../../../src/core-react/text/StyledText.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,2CAAoC;AACpC,+BAA+B;AAc/B;;;GAGG;AACH,SAAgB,UAAU,CAAC,KAAsB;IAC/C,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAE1E,OAAO,CACL,iCACM,SAAS,EACb,SAAS,EAAE,IAAA,oBAAU,EAAC,aAAa,EAAE,SAAS,CAAC,EAC/C,KAAK,EAAE,KAAK,IAEX,QAAQ,CACJ,CACR,CAAC;AACJ,CAAC;AAZD,gCAYC","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 Text\n */\n\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { TextProps } from \"./TextProps\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Properties for [[StyledText]] component\n * @public\n * @deprecated in 4.12.x. Props of deprecated component {@link StyledText}.\n */\nexport interface StyledTextProps extends TextProps {\n /** Main CSS class name */\n mainClassName: string;\n}\n\n/** The base component for other text components that pass a main CSS class name.\n * @public\n * @deprecated in 4.0 Use \\<Text /\\> component from iTwinUI-react library.\n */\nexport function StyledText(props: StyledTextProps) {\n const { mainClassName, className, style, children, ...spanProps } = props;\n\n return (\n <span\n {...spanProps}\n className={classnames(mainClassName, className)}\n style={style}\n >\n {children}\n </span>\n );\n}\n"]}
|
|
@@ -5,6 +5,7 @@ import type * as React from "react";
|
|
|
5
5
|
import type { CommonProps } from "../utils/Props";
|
|
6
6
|
/** Properties for various text components
|
|
7
7
|
* @public
|
|
8
|
+
* @deprecated in 4.12.x. Props of deprecated text components.
|
|
8
9
|
*/
|
|
9
10
|
export interface TextProps extends React.AllHTMLAttributes<HTMLSpanElement>, CommonProps {
|
|
10
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextProps.d.ts","sourceRoot":"","sources":["../../../../src/core-react/text/TextProps.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD
|
|
1
|
+
{"version":3,"file":"TextProps.d.ts","sourceRoot":"","sources":["../../../../src/core-react/text/TextProps.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,SACf,SAAQ,KAAK,CAAC,iBAAiB,CAAC,eAAe,CAAC,EAC9C,WAAW;CAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextProps.js","sourceRoot":"","sources":["../../../../src/core-react/text/TextProps.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Text\n */\n\nimport type * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/** Properties for various text components\n * @public\n */\nexport interface TextProps\n extends React.AllHTMLAttributes<HTMLSpanElement>,\n CommonProps {}\n"]}
|
|
1
|
+
{"version":3,"file":"TextProps.js","sourceRoot":"","sources":["../../../../src/core-react/text/TextProps.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Text\n */\n\nimport type * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/** Properties for various text components\n * @public\n * @deprecated in 4.12.x. Props of deprecated text components.\n */\nexport interface TextProps\n extends React.AllHTMLAttributes<HTMLSpanElement>,\n CommonProps {}\n"]}
|
|
@@ -15,7 +15,5 @@ export interface ExpansionToggleProps extends CommonProps {
|
|
|
15
15
|
/** ExpansionToggle React component used by the [[TreeNode]] component to show collapsed or expanded state
|
|
16
16
|
* @public
|
|
17
17
|
*/
|
|
18
|
-
export declare
|
|
19
|
-
render(): React.JSX.Element;
|
|
20
|
-
}
|
|
18
|
+
export declare function ExpansionToggle(props: ExpansionToggleProps): React.JSX.Element;
|
|
21
19
|
//# sourceMappingURL=ExpansionToggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpansionToggle.d.ts","sourceRoot":"","sources":["../../../../src/core-react/tree/ExpansionToggle.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,wBAAwB,CAAC;AAEhC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAKlD;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,WAAW;IACvD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IACxD,CAAC,aAAa,CAAC,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"ExpansionToggle.d.ts","sourceRoot":"","sources":["../../../../src/core-react/tree/ExpansionToggle.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,wBAAwB,CAAC;AAEhC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAKlD;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,WAAW;IACvD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IACxD,CAAC,aAAa,CAAC,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,qBAwB1D"}
|
|
@@ -11,21 +11,20 @@ exports.ExpansionToggle = void 0;
|
|
|
11
11
|
require("./ExpansionToggle.scss");
|
|
12
12
|
const classnames_1 = require("classnames");
|
|
13
13
|
const React = require("react");
|
|
14
|
-
const UiCore_1 = require("../UiCore");
|
|
15
14
|
const IconComponent_1 = require("../icons/IconComponent");
|
|
16
15
|
const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
|
|
16
|
+
const useTranslation_1 = require("../l10n/useTranslation");
|
|
17
17
|
/** ExpansionToggle React component used by the [[TreeNode]] component to show collapsed or expanded state
|
|
18
18
|
* @public
|
|
19
19
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
20
|
+
function ExpansionToggle(props) {
|
|
21
|
+
const { translate } = (0, useTranslation_1.useTranslation)();
|
|
22
|
+
const className = (0, classnames_1.default)("core-tree-expansionToggle", props.isExpanded && "is-expanded", props.className);
|
|
23
|
+
const label = translate(props.isExpanded ? "tree.collapse" : "tree.expand");
|
|
24
|
+
return (
|
|
25
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
26
|
+
React.createElement("div", { onMouseDown: (e) => e.stopPropagation(), onClick: props.onClick, className: className, style: props.style, "data-testid": props["data-testid"], role: "button", tabIndex: -1, "aria-label": label },
|
|
27
|
+
React.createElement(IconComponent_1.Icon, { className: "toggle icon", iconSpec: React.createElement(itwinui_icons_react_1.SvgChevronRight, null) })));
|
|
29
28
|
}
|
|
30
29
|
exports.ExpansionToggle = ExpansionToggle;
|
|
31
30
|
//# sourceMappingURL=ExpansionToggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpansionToggle.js","sourceRoot":"","sources":["../../../../src/core-react/tree/ExpansionToggle.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,kCAAgC;AAChC,2CAAoC;AACpC,+BAA+B;AAE/B,
|
|
1
|
+
{"version":3,"file":"ExpansionToggle.js","sourceRoot":"","sources":["../../../../src/core-react/tree/ExpansionToggle.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,kCAAgC;AAChC,2CAAoC;AACpC,+BAA+B;AAE/B,0DAA8C;AAC9C,oEAA6D;AAC7D,2DAAwD;AAWxD;;GAEG;AACH,SAAgB,eAAe,CAAC,KAA2B;IACzD,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,+BAAc,GAAE,CAAC;IACvC,MAAM,SAAS,GAAG,IAAA,oBAAU,EAC1B,2BAA2B,EAC3B,KAAK,CAAC,UAAU,IAAI,aAAa,EACjC,KAAK,CAAC,SAAS,CAChB,CAAC;IACF,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;IAE5E,OAAO;IACL,iEAAiE;IACjE,6BACE,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EACvC,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,iBACL,KAAK,CAAC,aAAa,CAAC,EACjC,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,CAAC,gBACA,KAAK;QAEjB,oBAAC,oBAAI,IAAC,SAAS,EAAC,aAAa,EAAC,QAAQ,EAAE,oBAAC,qCAAe,OAAG,GAAI,CAC3D,CACP,CAAC;AACJ,CAAC;AAxBD,0CAwBC","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 Tree\n */\n\nimport \"./ExpansionToggle.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"../utils/Props\";\nimport { Icon } from \"../icons/IconComponent\";\nimport { SvgChevronRight } from \"@itwin/itwinui-icons-react\";\nimport { useTranslation } from \"../l10n/useTranslation\";\n\n/** Properties for the [[ExpansionToggle]] component\n * @public\n */\nexport interface ExpansionToggleProps extends CommonProps {\n isExpanded?: boolean;\n onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;\n [\"data-testid\"]?: string;\n}\n\n/** ExpansionToggle React component used by the [[TreeNode]] component to show collapsed or expanded state\n * @public\n */\nexport function ExpansionToggle(props: ExpansionToggleProps) {\n const { translate } = useTranslation();\n const className = classnames(\n \"core-tree-expansionToggle\",\n props.isExpanded && \"is-expanded\",\n props.className\n );\n const label = translate(props.isExpanded ? \"tree.collapse\" : \"tree.expand\");\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\n <div\n onMouseDown={(e) => e.stopPropagation()}\n onClick={props.onClick}\n className={className}\n style={props.style}\n data-testid={props[\"data-testid\"]}\n role=\"button\"\n tabIndex={-1}\n aria-label={label}\n >\n <Icon className=\"toggle icon\" iconSpec={<SvgChevronRight />} />\n </div>\n );\n}\n"]}
|
|
@@ -40,9 +40,8 @@ class TreeNode extends React.Component {
|
|
|
40
40
|
this.props.onClickExpansionToggle();
|
|
41
41
|
};
|
|
42
42
|
this._onClick = (e) => {
|
|
43
|
-
var _a, _b;
|
|
44
43
|
e.stopPropagation();
|
|
45
|
-
|
|
44
|
+
this.props.onClick?.(e);
|
|
46
45
|
};
|
|
47
46
|
}
|
|
48
47
|
render() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Node.js","sourceRoot":"","sources":["../../../../src/core-react/tree/Node.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GA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AE,UAAU,EAAE,MAAM,EAAE,iBAChB,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC;gBAErD,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,CACvB,oBAAC,8BAAc,IACb,IAAI,EAAC,SAAS,EACd,aAAa,QACb,SAAS,EAAC,yBAAyB,GACnC,CACH;gBACA,MAAM;gBACN,QAAQ;gBACR,IAAI;gBACJ,IAAI,CAAC,KAAK,CAAC,KAAK,CACb;YACL,IAAI,CAAC,KAAK,CAAC,QAAQ,CAChB,CACP,CAAC;IACJ,CAAC;IAEO,wBAAwB,CAAC,KAAa;QAC5C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;YAAE,OAAO,SAAS,CAAC;QACjD,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,KAAK,EAAE,CAAC;IACjD,CAAC;CA0BF;AA/HD,4BA+HC","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 Tree\n */\n\nimport \"./Node.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Checkbox, ProgressRadial } from \"@itwin/itwinui-react\";\nimport { CheckBoxState } from \"../enums/CheckBoxState\";\nimport type { CommonProps } from \"../utils/Props\";\nimport type { Omit } from \"../utils/typeUtils\";\nimport { ExpansionToggle } from \"./ExpansionToggle\";\n\ntype CheckboxProps = React.ComponentPropsWithoutRef<typeof Checkbox>;\n\n/** Props for node Checkbox renderer\n * @public\n */\nexport type NodeCheckboxRenderProps = Omit<\n CheckboxProps,\n \"onChange\" | \"onClick\"\n> & {\n onChange: (checked: boolean) => void;\n onClick: (e: React.MouseEvent) => void;\n};\n\n/** Type for node Checkbox renderer\n * @public\n */\nexport type NodeCheckboxRenderer = (\n props: NodeCheckboxRenderProps\n) => React.ReactNode;\n\n/** Number of pixels the node gets offset per each hierarchy level\n * @internal\n */\nexport const LEVEL_OFFSET = 20;\n\nconst EXPANSION_TOGGLE_WIDTH = 24;\n\n/** Properties for Tree Node CheckBox\n * @public\n */\nexport interface NodeCheckboxProps {\n /** State of the checkbox */\n state?: CheckBoxState;\n /** Click event callback */\n onClick?: (newState: CheckBoxState) => void;\n /** Indicates whether checkbox is disabled */\n isDisabled?: boolean;\n /** Tooltip to be displayed when mouse is hovered over checkbox */\n tooltip?: string;\n}\n\n/** Properties for the [[TreeNode]] React component\n * @public\n */\nexport interface TreeNodeProps extends CommonProps {\n label: React.ReactNode;\n level: number;\n icon?: React.ReactChild;\n /** Properties for the checkbox.\n * @public */\n checkboxProps?: NodeCheckboxProps;\n isLeaf?: boolean;\n isLoading?: boolean;\n isExpanded?: boolean;\n isFocused?: boolean;\n isSelected?: boolean;\n isHoverDisabled?: boolean;\n onClick?: (e: React.MouseEvent) => void;\n onContextMenu?: (e: React.MouseEvent) => void;\n onMouseMove?: (e: React.MouseEvent) => void;\n onMouseDown?: (e: React.MouseEvent) => void;\n onMouseUp?: (e: React.MouseEvent) => void;\n onClickExpansionToggle?: () => void;\n children?: React.ReactNode;\n\n /** Contains render overrides for different pieces of the node component. */\n renderOverrides?: {\n /** Callback to render a checkbox. Only called when checkbox is displayed. */\n renderCheckbox?: NodeCheckboxRenderer;\n };\n [\"data-testid\"]?: string;\n}\n\n/** Presentation React component for a Tree node\n * @public\n */\nexport class TreeNode extends React.Component<TreeNodeProps> {\n constructor(props: TreeNodeProps) {\n super(props);\n }\n\n public override render() {\n const className = classnames(\n \"core-tree-node\",\n this.props.isFocused && \"is-focused\",\n this.props.isSelected && \"is-selected\",\n this.props.isHoverDisabled && \"is-hover-disabled\",\n this.props.className\n );\n let offset = this.props.level * LEVEL_OFFSET;\n if (!this.props.isLoading && this.props.isLeaf)\n offset += EXPANSION_TOGGLE_WIDTH; // Add expansion toggle/loader width if they're not rendered\n\n let checkbox: React.ReactNode;\n if (this.props.checkboxProps) {\n const props: NodeCheckboxRenderProps = {\n label: \"\",\n checked: this.props.checkboxProps.state === CheckBoxState.On,\n indeterminate: this.props.checkboxProps.state === CheckBoxState.Partial,\n disabled: this.props.checkboxProps.isDisabled,\n title: this.props.checkboxProps.tooltip,\n onClick: this._onCheckboxClick,\n onChange: this._onCheckboxChange,\n };\n if (\n this.props.renderOverrides &&\n this.props.renderOverrides.renderCheckbox\n ) {\n checkbox = this.props.renderOverrides.renderCheckbox(props);\n } else {\n checkbox = (\n <Checkbox\n {...props}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) =>\n this._onCheckboxChange(e.target.checked)\n }\n data-testid={this.createSubComponentTestId(\"checkbox\")}\n />\n );\n }\n }\n\n const icon = this.props.icon ? (\n <div className=\"core-tree-node-icon\">{this.props.icon}</div>\n ) : undefined;\n\n const toggle = this.props.isLoading ? undefined : this.props.isLeaf ? (\n <div />\n ) : (\n <ExpansionToggle\n className=\"expansion-toggle\"\n data-testid={this.createSubComponentTestId(\"expansion-toggle\")}\n onClick={this._onClickExpansionToggle}\n isExpanded={this.props.isExpanded}\n />\n );\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\n <div\n className={className}\n style={this.props.style}\n data-testid={this.props[\"data-testid\"]}\n onClick={this._onClick}\n onContextMenu={this.props.onContextMenu}\n onMouseDown={this.props.onMouseDown}\n onMouseUp={this.props.onMouseUp}\n onMouseMove={this.props.onMouseMove}\n role=\"treeitem\"\n aria-selected={this.props.isSelected ? \"true\" : \"false\"}\n tabIndex={-1}\n >\n <div\n className=\"contents\"\n style={{ marginLeft: offset }}\n data-testid={this.createSubComponentTestId(\"contents\")}\n >\n {this.props.isLoading && (\n <ProgressRadial\n size=\"x-small\"\n indeterminate\n className=\"core-progress-indicator\"\n />\n )}\n {toggle}\n {checkbox}\n {icon}\n {this.props.label}\n </div>\n {this.props.children}\n </div>\n );\n }\n\n private createSubComponentTestId(subId: string): string | undefined {\n if (!this.props[\"data-testid\"]) return undefined;\n return `${this.props[\"data-testid\"]}-${subId}`;\n }\n\n private _onCheckboxChange = (checked: boolean) => {\n if (\n this.props.checkboxProps &&\n this.props.checkboxProps.onClick &&\n !this.props.checkboxProps.isDisabled\n )\n this.props.checkboxProps.onClick(\n checked ? CheckBoxState.On : CheckBoxState.Off\n );\n };\n\n private _onCheckboxClick = (e: React.MouseEvent) => {\n e.stopPropagation();\n };\n\n private _onClickExpansionToggle = (e: React.MouseEvent<HTMLDivElement>) => {\n e.stopPropagation();\n if (this.props.onClickExpansionToggle) this.props.onClickExpansionToggle();\n };\n\n private _onClick = (e: React.MouseEvent<HTMLDivElement>) => {\n e.stopPropagation();\n this.props.onClick?.(e);\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Node.js","sourceRoot":"","sources":["../../../../src/core-react/tree/Node.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,uBAAqB;AACrB,2CAAoC;AACpC,+BAA+B;AAC/B,wDAAgE;AAChE,0DAAuD;AAGvD,uDAAoD;AAsBpD;;GAEG;AACU,QAAA,YAAY,GAAG,EAAE,CAAC;AAE/B,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAgDlC;;GAEG;AACH,MAAa,QAAS,SAAQ,KAAK,CAAC,SAAwB;IAC1D,YAAY,KAAoB;QAC9B,KAAK,CAAC,KAAK,CAAC,CAAC;QAqGP,sBAAiB,GAAG,CAAC,OAAgB,EAAE,EAAE;YAC/C,IACE,IAAI,CAAC,KAAK,CAAC,aAAa;gBACxB,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO;gBAChC,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,UAAU;gBAEpC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAC9B,OAAO,CAAC,CAAC,CAAC,6BAAa,CAAC,EAAE,CAAC,CAAC,CAAC,6BAAa,CAAC,GAAG,CAC/C,CAAC;QACN,CAAC,CAAC;QAEM,qBAAgB,GA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QACjE,6BACE,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,iBACV,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,EACtC,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,EACvC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,IAAI,EAAC,UAAU,mBACA,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EACvD,QAAQ,EAAE,CAAC,CAAC;YAEZ,6BACE,SAAS,EAAC,UAAU,EACpB,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,iBAChB,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC;gBAErD,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,CACvB,oBAAC,8BAAc,IACb,IAAI,EAAC,SAAS,EACd,aAAa,QACb,SAAS,EAAC,yBAAyB,GACnC,CACH;gBACA,MAAM;gBACN,QAAQ;gBACR,IAAI;gBACJ,IAAI,CAAC,KAAK,CAAC,KAAK,CACb;YACL,IAAI,CAAC,KAAK,CAAC,QAAQ,CAChB,CACP,CAAC;IACJ,CAAC;IAEO,wBAAwB,CAAC,KAAa;QAC5C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;YAAE,OAAO,SAAS,CAAC;QACjD,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,KAAK,EAAE,CAAC;IACjD,CAAC;CA0BF;AA/HD,4BA+HC","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 Tree\n */\n\nimport \"./Node.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Checkbox, ProgressRadial } from \"@itwin/itwinui-react\";\nimport { CheckBoxState } from \"../enums/CheckBoxState\";\nimport type { CommonProps } from \"../utils/Props\";\nimport type { Omit } from \"../utils/typeUtils\";\nimport { ExpansionToggle } from \"./ExpansionToggle\";\n\ntype CheckboxProps = React.ComponentPropsWithoutRef<typeof Checkbox>;\n\n/** Props for node Checkbox renderer\n * @public\n */\nexport type NodeCheckboxRenderProps = Omit<\n CheckboxProps,\n \"onChange\" | \"onClick\"\n> & {\n onChange: (checked: boolean) => void;\n onClick: (e: React.MouseEvent) => void;\n};\n\n/** Type for node Checkbox renderer\n * @public\n */\nexport type NodeCheckboxRenderer = (\n props: NodeCheckboxRenderProps\n) => React.ReactNode;\n\n/** Number of pixels the node gets offset per each hierarchy level\n * @internal\n */\nexport const LEVEL_OFFSET = 20;\n\nconst EXPANSION_TOGGLE_WIDTH = 24;\n\n/** Properties for Tree Node CheckBox\n * @public\n */\nexport interface NodeCheckboxProps {\n /** State of the checkbox */\n state?: CheckBoxState;\n /** Click event callback */\n onClick?: (newState: CheckBoxState) => void;\n /** Indicates whether checkbox is disabled */\n isDisabled?: boolean;\n /** Tooltip to be displayed when mouse is hovered over checkbox */\n tooltip?: string;\n}\n\n/** Properties for the [[TreeNode]] React component\n * @public\n */\nexport interface TreeNodeProps extends CommonProps {\n label: React.ReactNode;\n level: number;\n icon?: React.ReactChild;\n /** Properties for the checkbox.\n * @public */\n checkboxProps?: NodeCheckboxProps;\n isLeaf?: boolean;\n isLoading?: boolean;\n isExpanded?: boolean;\n isFocused?: boolean;\n isSelected?: boolean;\n isHoverDisabled?: boolean;\n onClick?: (e: React.MouseEvent) => void;\n onContextMenu?: (e: React.MouseEvent) => void;\n onMouseMove?: (e: React.MouseEvent) => void;\n onMouseDown?: (e: React.MouseEvent) => void;\n onMouseUp?: (e: React.MouseEvent) => void;\n onClickExpansionToggle?: () => void;\n children?: React.ReactNode;\n\n /** Contains render overrides for different pieces of the node component. */\n renderOverrides?: {\n /** Callback to render a checkbox. Only called when checkbox is displayed. */\n renderCheckbox?: NodeCheckboxRenderer;\n };\n [\"data-testid\"]?: string;\n}\n\n/** Presentation React component for a Tree node\n * @public\n */\nexport class TreeNode extends React.Component<TreeNodeProps> {\n constructor(props: TreeNodeProps) {\n super(props);\n }\n\n public override render() {\n const className = classnames(\n \"core-tree-node\",\n this.props.isFocused && \"is-focused\",\n this.props.isSelected && \"is-selected\",\n this.props.isHoverDisabled && \"is-hover-disabled\",\n this.props.className\n );\n let offset = this.props.level * LEVEL_OFFSET;\n if (!this.props.isLoading && this.props.isLeaf)\n offset += EXPANSION_TOGGLE_WIDTH; // Add expansion toggle/loader width if they're not rendered\n\n let checkbox: React.ReactNode;\n if (this.props.checkboxProps) {\n const props: NodeCheckboxRenderProps = {\n label: \"\",\n checked: this.props.checkboxProps.state === CheckBoxState.On,\n indeterminate: this.props.checkboxProps.state === CheckBoxState.Partial,\n disabled: this.props.checkboxProps.isDisabled,\n title: this.props.checkboxProps.tooltip,\n onClick: this._onCheckboxClick,\n onChange: this._onCheckboxChange,\n };\n if (\n this.props.renderOverrides &&\n this.props.renderOverrides.renderCheckbox\n ) {\n checkbox = this.props.renderOverrides.renderCheckbox(props);\n } else {\n checkbox = (\n <Checkbox\n {...props}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) =>\n this._onCheckboxChange(e.target.checked)\n }\n data-testid={this.createSubComponentTestId(\"checkbox\")}\n />\n );\n }\n }\n\n const icon = this.props.icon ? (\n <div className=\"core-tree-node-icon\">{this.props.icon}</div>\n ) : undefined;\n\n const toggle = this.props.isLoading ? undefined : this.props.isLeaf ? (\n <div />\n ) : (\n <ExpansionToggle\n className=\"expansion-toggle\"\n data-testid={this.createSubComponentTestId(\"expansion-toggle\")}\n onClick={this._onClickExpansionToggle}\n isExpanded={this.props.isExpanded}\n />\n );\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\n <div\n className={className}\n style={this.props.style}\n data-testid={this.props[\"data-testid\"]}\n onClick={this._onClick}\n onContextMenu={this.props.onContextMenu}\n onMouseDown={this.props.onMouseDown}\n onMouseUp={this.props.onMouseUp}\n onMouseMove={this.props.onMouseMove}\n role=\"treeitem\"\n aria-selected={this.props.isSelected ? \"true\" : \"false\"}\n tabIndex={-1}\n >\n <div\n className=\"contents\"\n style={{ marginLeft: offset }}\n data-testid={this.createSubComponentTestId(\"contents\")}\n >\n {this.props.isLoading && (\n <ProgressRadial\n size=\"x-small\"\n indeterminate\n className=\"core-progress-indicator\"\n />\n )}\n {toggle}\n {checkbox}\n {icon}\n {this.props.label}\n </div>\n {this.props.children}\n </div>\n );\n }\n\n private createSubComponentTestId(subId: string): string | undefined {\n if (!this.props[\"data-testid\"]) return undefined;\n return `${this.props[\"data-testid\"]}-${subId}`;\n }\n\n private _onCheckboxChange = (checked: boolean) => {\n if (\n this.props.checkboxProps &&\n this.props.checkboxProps.onClick &&\n !this.props.checkboxProps.isDisabled\n )\n this.props.checkboxProps.onClick(\n checked ? CheckBoxState.On : CheckBoxState.Off\n );\n };\n\n private _onCheckboxClick = (e: React.MouseEvent) => {\n e.stopPropagation();\n };\n\n private _onClickExpansionToggle = (e: React.MouseEvent<HTMLDivElement>) => {\n e.stopPropagation();\n if (this.props.onClickExpansionToggle) this.props.onClickExpansionToggle();\n };\n\n private _onClick = (e: React.MouseEvent<HTMLDivElement>) => {\n e.stopPropagation();\n this.props.onClick?.(e);\n };\n}\n"]}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Utilities
|
|
3
3
|
*/
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
4
|
+
/** IconWebComponent loads icon from an svg path
|
|
5
|
+
* @internal
|
|
6
6
|
*/
|
|
7
7
|
export declare class IconWebComponent extends HTMLElement {
|
|
8
8
|
private connectedCallback;
|
|
9
9
|
private loadSvg;
|
|
10
10
|
}
|
|
11
|
+
/** @internal */
|
|
12
|
+
export declare function registerIconWebComponent(): void;
|
|
11
13
|
//# sourceMappingURL=IconWebComponent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconWebComponent.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/IconWebComponent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconWebComponent.d.ts","sourceRoot":"","sources":["../../../../src/core-react/utils/IconWebComponent.ts"],"names":[],"mappings":"AAIA;;GAEG;AAiGH;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;YACjC,iBAAiB;YAKjB,OAAO;CAetB;AAED,gBAAgB;AAChB,wBAAgB,wBAAwB,SAGvC"}
|
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
// istanbul ignore file
|
|
7
|
-
// IconWebComponent requires in-browser testing
|
|
8
6
|
/** @packageDocumentation
|
|
9
7
|
* @module Utilities
|
|
10
8
|
*/
|
|
11
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.IconWebComponent = void 0;
|
|
10
|
+
exports.registerIconWebComponent = exports.IconWebComponent = void 0;
|
|
13
11
|
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
14
12
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
15
13
|
const UiCore_1 = require("../UiCore");
|
|
@@ -47,7 +45,7 @@ function parseSvgFromDataUri(src, element) {
|
|
|
47
45
|
// the esm build of dompurify has a default import but the cjs build does not
|
|
48
46
|
// if there is a default export, use it (likely esm), otherwise use the namespace
|
|
49
47
|
// istanbul ignore next
|
|
50
|
-
const sanitizer = dompurify_1.default
|
|
48
|
+
const sanitizer = dompurify_1.default ?? DOMPurifyNS;
|
|
51
49
|
const sanitizedSvg = sanitizer.sanitize(rawSvg);
|
|
52
50
|
const parsedSvg = new window.DOMParser().parseFromString(sanitizedSvg, "text/xml");
|
|
53
51
|
const errorNode = parsedSvg.querySelector("parsererror");
|
|
@@ -91,8 +89,8 @@ async function getSvg(src, element) {
|
|
|
91
89
|
}
|
|
92
90
|
return fetchSvg(src, element);
|
|
93
91
|
}
|
|
94
|
-
/**
|
|
95
|
-
*
|
|
92
|
+
/** IconWebComponent loads icon from an svg path
|
|
93
|
+
* @internal
|
|
96
94
|
*/
|
|
97
95
|
class IconWebComponent extends HTMLElement {
|
|
98
96
|
async connectedCallback() {
|
|
@@ -113,4 +111,10 @@ class IconWebComponent extends HTMLElement {
|
|
|
113
111
|
}
|
|
114
112
|
}
|
|
115
113
|
exports.IconWebComponent = IconWebComponent;
|
|
114
|
+
/** @internal */
|
|
115
|
+
function registerIconWebComponent() {
|
|
116
|
+
if (window.customElements.get("svg-loader") === undefined)
|
|
117
|
+
window.customElements.define("svg-loader", IconWebComponent);
|
|
118
|
+
}
|
|
119
|
+
exports.registerIconWebComponent = registerIconWebComponent;
|
|
116
120
|
//# sourceMappingURL=IconWebComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconWebComponent.js","sourceRoot":"","sources":["../../../../src/core-react/utils/IconWebComponent.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG
|
|
1
|
+
{"version":3,"file":"IconWebComponent.js","sourceRoot":"","sources":["../../../../src/core-react/utils/IconWebComponent.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,0DAAgD;AAChD,sDAA6C;AAC7C,sCAAmC;AACnC,oEAAoD;AACpD,iEAA8D;AAE9D;;;;GAIG;AACH,MAAM,KAAK,GAAG,IAAI,GAAG,EAAwB,CAAC;AAE9C;;;;;GAKG;AACH,SAAS,mBAAmB,CAAC,GAAW,EAAE,OAAY;IACpD,MAAM,YAAY,GAAG,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Aa,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,CAAC;IAEO,KAAK,CAAC,OAAO;QACnB,qDAAqD;QACrD,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM;YAAE,OAAO;QACnC,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAC3C,IAAI,CAAC,GAAG;YAAE,OAAO;QAEjB,MAAM,GAAG,GAAG,MAAM,IAAA,2CAAoB,EACpC,GAAG,EACH,KAAK,IAAI,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,EAC7B,KAAK,CACN,CAAC;QACF,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;YAClC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;SAClC;IACH,CAAC;CACF;AArBD,4CAqBC;AAED,gBAAgB;AAChB,SAAgB,wBAAwB;IACtC,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,SAAS;QACvD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;AACjE,CAAC;AAHD,4DAGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n\nimport { UiError } from \"@itwin/appui-abstract\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { UiCore } from \"../UiCore\";\nimport DOMPurify, * as DOMPurifyNS from \"dompurify\";\nimport { reuseOrCreatePromise } from \"./reuseOrCreatePromise\";\n\n/**\n * \"getSvg\" list\n * (if multiple icon require the same thing,\n * only do the fetch once, and have all icon use the same result)\n */\nconst cache = new Map<string, Promise<any>>();\n\n/**\n * Parse 'data:' uri to retrieve the Svg component within it.\n * @param src data:image/svg+xml;base64 or data:image/svg+xml\n * @param element Element for logging purpose.\n * @returns HTMLElement (svg)\n */\nfunction parseSvgFromDataUri(src: string, element: any) {\n const dataUriParts = src.split(\",\");\n\n if (\n (dataUriParts.length !== 2 &&\n \"data:image/svg+xml;base64\" === dataUriParts[0]) ||\n (\"data:image/svg+xml;base64\" !== dataUriParts[0] &&\n \"data:image/svg+xml\" !== dataUriParts[0])\n ) {\n Logger.logError(UiCore.loggerCategory(element), \"Unable to load icon.\");\n return;\n }\n\n let rawSvg = \"\";\n if (\"data:image/svg+xml;base64\" === dataUriParts[0]) {\n rawSvg = window.atob(dataUriParts[1]);\n } else {\n // `,` is valid character in data when not in base64, rebuild the data correctly\n rawSvg = decodeURIComponent(dataUriParts.slice(1).join(\",\"));\n }\n\n // the esm build of dompurify has a default import but the cjs build does not\n // if there is a default export, use it (likely esm), otherwise use the namespace\n // istanbul ignore next\n const sanitizer = DOMPurify ?? DOMPurifyNS;\n const sanitizedSvg = sanitizer.sanitize(rawSvg);\n\n const parsedSvg = new window.DOMParser().parseFromString(\n sanitizedSvg,\n \"text/xml\"\n );\n const errorNode = parsedSvg.querySelector(\"parsererror\");\n if (errorNode || \"svg\" !== parsedSvg.documentElement.nodeName.toLowerCase()) {\n // eslint-disable-next-line deprecation/deprecation\n throw new UiError(UiCore.loggerCategory(element), \"Unable to load icon.\");\n }\n\n return parsedSvg.documentElement;\n}\n\n/**\n * Fetch the src from the network and return the SVG element.\n * @param src URL representing a .svg file\n * @param element Element for logging purpose\n * @returns HTMLElement (svg)\n */\nasync function fetchSvg(src: string, element: any) {\n const response = await fetch(src).catch((_error) => {\n Logger.logError(UiCore.loggerCategory(element), \"Unable to load icon.\");\n });\n if (!response || !response.ok) {\n // eslint-disable-next-line deprecation/deprecation\n throw new UiError(UiCore.loggerCategory(element), \"Unable to load icon.\");\n }\n const str = await response.text();\n if (str === undefined) {\n // eslint-disable-next-line deprecation/deprecation\n throw new UiError(UiCore.loggerCategory(element), \"Unable to load icon.\");\n }\n const data = new window.DOMParser().parseFromString(str, \"text/xml\");\n return data.documentElement;\n}\n\n/**\n * Get the svg (fetch and parse for url, or decode and parse for data: url)\n * @param src URL of the content to download/parse\n * @param element Element for logging purpose.\n * @returns HTMLElement (svg)\n */\nasync function getSvg(src: string, element: any) {\n if (src.startsWith(\"data:\")) {\n return parseSvgFromDataUri(src, element);\n }\n return fetchSvg(src, element);\n}\n\n/** IconWebComponent loads icon from an svg path\n * @internal\n */\nexport class IconWebComponent extends HTMLElement {\n private async connectedCallback() {\n await this.loadSvg();\n this.dispatchEvent(new CustomEvent(\"load\"));\n }\n\n private async loadSvg() {\n // if svg was already appended don't request it again\n if (this.childNodes.length) return;\n const src = this.getAttribute(\"src\") || \"\";\n if (!src) return;\n\n const svg = await reuseOrCreatePromise(\n src,\n async () => getSvg(src, this),\n cache\n );\n if (svg && !this.childNodes.length) {\n this.append(svg.cloneNode(true));\n }\n }\n}\n\n/** @internal */\nexport function registerIconWebComponent() {\n if (window.customElements.get(\"svg-loader\") === undefined)\n window.customElements.define(\"svg-loader\", IconWebComponent);\n}\n"]}
|
|
@@ -12,7 +12,7 @@ exports.getCssVariableAsNumber = exports.getCssVariable = void 0;
|
|
|
12
12
|
* @public
|
|
13
13
|
*/
|
|
14
14
|
function getCssVariable(variableName, htmlElement) {
|
|
15
|
-
const element = htmlElement
|
|
15
|
+
const element = htmlElement ?? document.documentElement;
|
|
16
16
|
const cssStyles = getComputedStyle(element, null);
|
|
17
17
|
const cssVal = String(cssStyles.getPropertyValue(variableName)).trim();
|
|
18
18
|
return cssVal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCssVariable.js","sourceRoot":"","sources":["../../../../src/core-react/utils/getCssVariable.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH;;GAEG;AACH,SAAgB,cAAc,CAC5B,YAAoB,EACpB,WAAyB;IAEzB,MAAM,OAAO,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"getCssVariable.js","sourceRoot":"","sources":["../../../../src/core-react/utils/getCssVariable.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH;;GAEG;AACH,SAAgB,cAAc,CAC5B,YAAoB,EACpB,WAAyB;IAEzB,MAAM,OAAO,GAAG,WAAW,IAAI,QAAQ,CAAC,eAAe,CAAC;IACxD,MAAM,SAAS,GAAG,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACvE,OAAO,MAAM,CAAC;AAChB,CAAC;AARD,wCAQC;AAED;;GAEG;AACH,SAAgB,sBAAsB,CACpC,YAAoB,EACpB,WAAyB;IAEzB,IAAI,SAAS,GAAW,GAAG,CAAC;IAC5B,MAAM,SAAS,GAAG,cAAc,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IAC5D,IAAI,SAAS;QAAE,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IACjD,OAAO,SAAS,CAAC;AACnB,CAAC;AARD,wDAQC","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/** Get CSS variable\n * @public\n */\nexport function getCssVariable(\n variableName: string,\n htmlElement?: HTMLElement\n): string {\n const element = htmlElement ?? document.documentElement;\n const cssStyles = getComputedStyle(element, null);\n const cssVal = String(cssStyles.getPropertyValue(variableName)).trim();\n return cssVal;\n}\n\n/** Get CSS variable as number\n * @public\n */\nexport function getCssVariableAsNumber(\n variableName: string,\n htmlElement?: HTMLElement\n): number {\n let cssValNum: number = NaN;\n const cssValStr = getCssVariable(variableName, htmlElement);\n if (cssValStr) cssValNum = parseFloat(cssValStr);\n return cssValNum;\n}\n"]}
|
|
@@ -13,10 +13,9 @@ exports.getObjectClassName = void 0;
|
|
|
13
13
|
* @internal
|
|
14
14
|
*/
|
|
15
15
|
const getObjectClassName = (obj) => {
|
|
16
|
-
|
|
17
|
-
return (obj === null || obj === void 0 ? void 0 : obj.name)
|
|
16
|
+
return obj?.name
|
|
18
17
|
? obj.name
|
|
19
|
-
:
|
|
18
|
+
: obj?.constructor?.name
|
|
20
19
|
? obj.constructor.name
|
|
21
20
|
: "";
|
|
22
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getObjectClassName.js","sourceRoot":"","sources":["../../../../src/core-react/utils/getObjectClassName.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH;;;GAGG;AACI,MAAM,kBAAkB,GAAG,CAAC,GAAQ,EAAU,EAAE
|
|
1
|
+
{"version":3,"file":"getObjectClassName.js","sourceRoot":"","sources":["../../../../src/core-react/utils/getObjectClassName.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH;;;GAGG;AACI,MAAM,kBAAkB,GAAG,CAAC,GAAQ,EAAU,EAAE;IACrD,OAAO,GAAG,EAAE,IAAI;QACd,CAAC,CAAC,GAAG,CAAC,IAAI;QACV,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI;YACxB,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI;YACtB,CAAC,CAAC,EAAE,CAAC;AACT,CAAC,CAAC;AANW,QAAA,kBAAkB,sBAM7B","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/**\n * Returns the name of a class from a static or instance object.\n * @internal\n */\nexport const getObjectClassName = (obj: any): string => {\n return obj?.name\n ? obj.name\n : obj?.constructor?.name\n ? obj.constructor.name\n : \"\";\n};\n"]}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/** @internal */
|
|
2
2
|
export type ResizeObserverType = typeof import("resize-observer-polyfill").default;
|
|
3
3
|
/** @internal */
|
|
4
|
-
export declare
|
|
4
|
+
export declare function getResizeObserver(): {
|
|
5
|
+
new (callback: ResizeObserverCallback): ResizeObserver;
|
|
6
|
+
prototype: ResizeObserver;
|
|
7
|
+
};
|
|
5
8
|
//# sourceMappingURL=ResizeObserverPolyfill.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResizeObserverPolyfill.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/ResizeObserverPolyfill.tsx"],"names":[],"mappings":"AASA,gBAAgB;AAChB,MAAM,MAAM,kBAAkB,GAC5B,cAAc,0BAA0B,EAAE,OAAO,CAAC;AAQpD,gBAAgB;AAChB,
|
|
1
|
+
{"version":3,"file":"ResizeObserverPolyfill.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/ResizeObserverPolyfill.tsx"],"names":[],"mappings":"AASA,gBAAgB;AAChB,MAAM,MAAM,kBAAkB,GAC5B,cAAc,0BAA0B,EAAE,OAAO,CAAC;AAQpD,gBAAgB;AAChB,wBAAgB,iBAAiB;;;EAEhC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getResizeObserver = void 0;
|
|
4
4
|
/*---------------------------------------------------------------------------------------------
|
|
5
5
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
6
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -16,5 +16,8 @@ function getModule(mod) {
|
|
|
16
16
|
return mod;
|
|
17
17
|
}
|
|
18
18
|
/** @internal */
|
|
19
|
-
|
|
19
|
+
function getResizeObserver() {
|
|
20
|
+
return window.ResizeObserver ?? getModule(ResizeObserverPolyfill);
|
|
21
|
+
}
|
|
22
|
+
exports.getResizeObserver = getResizeObserver;
|
|
20
23
|
//# sourceMappingURL=ResizeObserverPolyfill.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResizeObserverPolyfill.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/ResizeObserverPolyfill.tsx"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG;;GAEG;AACH,mEAAmE;AAMnE,SAAS,SAAS,CAAC,GAAQ;IACzB,wBAAwB;IACxB,IAAI,GAAG,CAAC,OAAO;QAAE,OAAO,GAAG,CAAC,OAAO,CAAC;IACpC,OAAO,GAAG,CAAC;AACb,CAAC;AAED,gBAAgB;
|
|
1
|
+
{"version":3,"file":"ResizeObserverPolyfill.js","sourceRoot":"","sources":["../../../../../src/core-react/utils/hooks/ResizeObserverPolyfill.tsx"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG;;GAEG;AACH,mEAAmE;AAMnE,SAAS,SAAS,CAAC,GAAQ;IACzB,wBAAwB;IACxB,IAAI,GAAG,CAAC,OAAO;QAAE,OAAO,GAAG,CAAC,OAAO,CAAC;IACpC,OAAO,GAAG,CAAC;AACb,CAAC;AAED,gBAAgB;AAChB,SAAgB,iBAAiB;IAC/B,OAAO,MAAM,CAAC,cAAc,IAAI,SAAS,CAAC,sBAAsB,CAAC,CAAC;AACpE,CAAC;AAFD,8CAEC","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 ResizeObserverPolyfill from \"resize-observer-polyfill\";\n\n/** @internal */\nexport type ResizeObserverType =\n typeof import(\"resize-observer-polyfill\").default; // eslint-disable-line @typescript-eslint/consistent-type-imports\n\nfunction getModule(mod: any) {\n /* istanbul ignore if */\n if (mod.default) return mod.default;\n return mod;\n}\n\n/** @internal */\nexport function getResizeObserver() {\n return window.ResizeObserver ?? getModule(ResizeObserverPolyfill);\n}\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Utilities
|
|
3
3
|
*/
|
|
4
4
|
/** Hook that will show a popup window
|
|
5
|
-
* @
|
|
5
|
+
* @public
|
|
6
6
|
*/
|
|
7
7
|
export declare function useCrossOriginPopup(visible: boolean, url: string | undefined, title: string, width: number, height: number, onClose: () => void): void;
|
|
8
8
|
//# sourceMappingURL=useCrossOriginPopup.d.ts.map
|
|
@@ -11,7 +11,7 @@ exports.useCrossOriginPopup = void 0;
|
|
|
11
11
|
const React = require("react");
|
|
12
12
|
const useInterval_1 = require("./useInterval");
|
|
13
13
|
/** Hook that will show a popup window
|
|
14
|
-
* @
|
|
14
|
+
* @public
|
|
15
15
|
*/
|
|
16
16
|
function useCrossOriginPopup(visible, url, title, width, height, onClose) {
|
|
17
17
|
const [checkPopupAliveDelay, setCheckPopupAliveDelay] = React.useState();
|
|
@@ -51,8 +51,7 @@ function useCrossOriginPopup(visible, url, title, width, height, onClose) {
|
|
|
51
51
|
}
|
|
52
52
|
}, [handleClosedPopup]);
|
|
53
53
|
const checkPopupClosed = React.useCallback(() => {
|
|
54
|
-
|
|
55
|
-
if ((_a = popupWindow.current) === null || _a === void 0 ? void 0 : _a.closed) {
|
|
54
|
+
if (popupWindow.current?.closed) {
|
|
56
55
|
// Popup has been closed by end-user, inform our host and cleanup
|
|
57
56
|
handleClosedPopup();
|
|
58
57
|
}
|