@itwin/core-react 4.15.5 → 4.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -1
- package/lib/cjs/core-react/UiCore.d.ts +1 -0
- package/lib/cjs/core-react/UiCore.d.ts.map +1 -1
- package/lib/cjs/core-react/UiCore.js +2 -0
- package/lib/cjs/core-react/UiCore.js.map +1 -1
- package/lib/cjs/core-react/autosuggest/AutoSuggest.d.ts +5 -3
- package/lib/cjs/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
- package/lib/cjs/core-react/autosuggest/AutoSuggest.js +1 -2
- package/lib/cjs/core-react/autosuggest/AutoSuggest.js.map +1 -1
- package/lib/cjs/core-react/badge/Badge.d.ts +3 -2
- package/lib/cjs/core-react/badge/Badge.d.ts.map +1 -1
- package/lib/cjs/core-react/badge/Badge.js +5 -2
- package/lib/cjs/core-react/badge/Badge.js.map +1 -1
- package/lib/cjs/core-react/badge/BadgeType.d.ts +6 -0
- package/lib/cjs/core-react/badge/BadgeType.d.ts.map +1 -1
- package/lib/cjs/core-react/badge/BadgeType.js +2 -1
- package/lib/cjs/core-react/badge/BadgeType.js.map +1 -1
- package/lib/cjs/core-react/badge/DeprecatedBadge.d.ts +10 -0
- package/lib/cjs/core-react/badge/DeprecatedBadge.d.ts.map +1 -0
- package/lib/cjs/core-react/badge/DeprecatedBadge.js +29 -0
- package/lib/cjs/core-react/badge/DeprecatedBadge.js.map +1 -0
- package/lib/cjs/core-react/badge/DeprecatedBadge.scss +11 -0
- package/lib/cjs/core-react/badge/NewBadge.scss +4 -0
- package/lib/cjs/core-react/badge/TechnicalPreviewBadge.js +2 -2
- package/lib/cjs/core-react/badge/TechnicalPreviewBadge.js.map +1 -1
- package/lib/cjs/core-react/badge/TechnicalPreviewBadge.scss +4 -0
- package/lib/cjs/core-react/colorthemes.scss +0 -8
- package/lib/cjs/core-react/contextmenu/ContextMenu.d.ts +3 -6
- package/lib/cjs/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.js +2 -4
- package/lib/cjs/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenu.scss +5 -6
- package/lib/cjs/core-react/contextmenu/ContextMenuDirection.d.ts +1 -3
- package/lib/cjs/core-react/contextmenu/ContextMenuDirection.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuDirection.js +1 -7
- package/lib/cjs/core-react/contextmenu/ContextMenuDirection.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuDivider.d.ts +2 -2
- package/lib/cjs/core-react/contextmenu/ContextMenuDivider.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuDivider.js +3 -3
- package/lib/cjs/core-react/contextmenu/ContextMenuDivider.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.d.ts +8 -6
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.js +6 -7
- package/lib/cjs/core-react/contextmenu/ContextMenuItem.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.d.ts +3 -4
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.js +6 -5
- package/lib/cjs/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.d.ts +2 -1
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js +1 -0
- package/lib/cjs/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
- package/lib/cjs/core-react/contextmenu/PopupContextMenu.d.ts +2 -0
- package/lib/cjs/core-react/contextmenu/PopupContextMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/contextmenu/PopupContextMenu.js +2 -3
- package/lib/cjs/core-react/contextmenu/PopupContextMenu.js.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.js +0 -1
- package/lib/cjs/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/cjs/core-react/enums/CheckBoxState.d.ts +1 -0
- package/lib/cjs/core-react/enums/CheckBoxState.d.ts.map +1 -1
- package/lib/cjs/core-react/enums/CheckBoxState.js +1 -0
- package/lib/cjs/core-react/enums/CheckBoxState.js.map +1 -1
- package/lib/cjs/core-react/enums/Orientation.d.ts +1 -0
- package/lib/cjs/core-react/enums/Orientation.d.ts.map +1 -1
- package/lib/cjs/core-react/enums/Orientation.js +1 -0
- package/lib/cjs/core-react/enums/Orientation.js.map +1 -1
- package/lib/cjs/core-react/enums/TimeFormat.d.ts +1 -0
- package/lib/cjs/core-react/enums/TimeFormat.d.ts.map +1 -1
- package/lib/cjs/core-react/enums/TimeFormat.js +1 -0
- package/lib/cjs/core-react/enums/TimeFormat.js.map +1 -1
- package/lib/cjs/core-react/focus/ItemKeyboardNavigator.d.ts.map +1 -1
- package/lib/cjs/core-react/focus/ItemKeyboardNavigator.js.map +1 -1
- package/lib/cjs/core-react/focustrap/FocusTrap.js +1 -1
- package/lib/cjs/core-react/focustrap/FocusTrap.js.map +1 -1
- package/lib/cjs/core-react/hocs/withOnOutsideClick.d.ts +0 -2
- package/lib/cjs/core-react/hocs/withOnOutsideClick.d.ts.map +1 -1
- package/lib/cjs/core-react/hocs/withOnOutsideClick.js +0 -1
- package/lib/cjs/core-react/hocs/withOnOutsideClick.js.map +1 -1
- package/lib/cjs/core-react/icons/ConditionalIconItem.d.ts +1 -0
- package/lib/cjs/core-react/icons/ConditionalIconItem.d.ts.map +1 -1
- package/lib/cjs/core-react/icons/ConditionalIconItem.js +2 -0
- package/lib/cjs/core-react/icons/ConditionalIconItem.js.map +1 -1
- package/lib/cjs/core-react/icons/IconComponent.d.ts +3 -0
- package/lib/cjs/core-react/icons/IconComponent.d.ts.map +1 -1
- package/lib/cjs/core-react/icons/IconComponent.js +1 -0
- package/lib/cjs/core-react/icons/IconComponent.js.map +1 -1
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.d.ts +0 -1
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.d.ts.map +1 -1
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js +0 -2
- package/lib/cjs/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
- package/lib/cjs/core-react/inputs/InputLabel.d.ts.map +1 -1
- package/lib/cjs/core-react/inputs/InputLabel.js +1 -8
- package/lib/cjs/core-react/inputs/InputLabel.js.map +1 -1
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
- package/lib/cjs/core-react/inputs/numberinput/NumberInput.js.map +1 -1
- package/lib/cjs/core-react/l10n/LocalizationProvider.d.ts +1 -0
- package/lib/cjs/core-react/l10n/LocalizationProvider.d.ts.map +1 -1
- package/lib/cjs/core-react/l10n/LocalizationProvider.js +1 -0
- package/lib/cjs/core-react/l10n/LocalizationProvider.js.map +1 -1
- package/lib/cjs/core-react/l10n/useTranslation.d.ts.map +1 -1
- package/lib/cjs/core-react/l10n/useTranslation.js +1 -1
- package/lib/cjs/core-react/l10n/useTranslation.js.map +1 -1
- package/lib/cjs/core-react/listbox/Listbox.d.ts +10 -7
- package/lib/cjs/core-react/listbox/Listbox.d.ts.map +1 -1
- package/lib/cjs/core-react/listbox/Listbox.js +6 -3
- package/lib/cjs/core-react/listbox/Listbox.js.map +1 -1
- package/lib/cjs/core-react/messagebox/MessageBox.d.ts.map +1 -1
- package/lib/cjs/core-react/messagebox/MessageBox.js +2 -9
- package/lib/cjs/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.d.ts +0 -2
- package/lib/cjs/core-react/radialmenu/RadialMenu.d.ts.map +1 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.js +0 -2
- package/lib/cjs/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/cjs/core-react/radialmenu/RadialMenu.scss +3 -3
- package/lib/cjs/core-react/searchbox/SearchBox.d.ts +0 -2
- package/lib/cjs/core-react/searchbox/SearchBox.d.ts.map +1 -1
- package/lib/cjs/core-react/searchbox/SearchBox.js +0 -2
- package/lib/cjs/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/cjs/core-react/settings/SettingsContainer.d.ts +7 -3
- package/lib/cjs/core-react/settings/SettingsContainer.d.ts.map +1 -1
- package/lib/cjs/core-react/settings/SettingsContainer.js +14 -19
- package/lib/cjs/core-react/settings/SettingsContainer.js.map +1 -1
- package/lib/cjs/core-react/settings/SettingsManager.d.ts +3 -1
- package/lib/cjs/core-react/settings/SettingsManager.d.ts.map +1 -1
- package/lib/cjs/core-react/settings/SettingsManager.js +6 -10
- package/lib/cjs/core-react/settings/SettingsManager.js.map +1 -1
- package/lib/cjs/core-react/tabs/Tabs.d.ts +0 -3
- package/lib/cjs/core-react/tabs/Tabs.d.ts.map +1 -1
- package/lib/cjs/core-react/tabs/Tabs.js +0 -4
- package/lib/cjs/core-react/tabs/Tabs.js.map +1 -1
- package/lib/cjs/core-react/tree/ExpansionToggle.d.ts.map +1 -1
- package/lib/cjs/core-react/tree/ExpansionToggle.js +0 -1
- package/lib/cjs/core-react/tree/ExpansionToggle.js.map +1 -1
- package/lib/cjs/core-react/tree/Node.d.ts +2 -0
- package/lib/cjs/core-react/tree/Node.d.ts.map +1 -1
- package/lib/cjs/core-react/tree/Node.js +1 -5
- package/lib/cjs/core-react/tree/Node.js.map +1 -1
- package/lib/cjs/core-react/uistate/LocalStateStorage.d.ts +2 -2
- package/lib/cjs/core-react/uistate/LocalStateStorage.d.ts.map +1 -1
- package/lib/cjs/core-react/uistate/LocalStateStorage.js +3 -4
- package/lib/cjs/core-react/uistate/LocalStateStorage.js.map +1 -1
- package/lib/cjs/core-react/uistate/UiStateEntry.d.ts +1 -0
- package/lib/cjs/core-react/uistate/UiStateEntry.d.ts.map +1 -1
- package/lib/cjs/core-react/uistate/UiStateEntry.js +2 -0
- package/lib/cjs/core-react/uistate/UiStateEntry.js.map +1 -1
- package/lib/cjs/core-react/uistate/UiStateStorage.d.ts +3 -0
- package/lib/cjs/core-react/uistate/UiStateStorage.d.ts.map +1 -1
- package/lib/cjs/core-react/uistate/UiStateStorage.js +1 -0
- package/lib/cjs/core-react/uistate/UiStateStorage.js.map +1 -1
- package/lib/cjs/core-react/utils/IconWebComponent.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/IconWebComponent.js +1 -3
- package/lib/cjs/core-react/utils/IconWebComponent.js.map +1 -1
- package/lib/cjs/core-react/utils/ListenerType.d.ts +15 -0
- package/lib/cjs/core-react/utils/ListenerType.d.ts.map +1 -0
- package/lib/cjs/core-react/utils/ListenerType.js +3 -0
- package/lib/cjs/core-react/utils/ListenerType.js.map +1 -0
- package/lib/cjs/core-react/utils/Rectangle.d.ts +1 -0
- package/lib/cjs/core-react/utils/Rectangle.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/Rectangle.js.map +1 -1
- package/lib/cjs/core-react/utils/Size.d.ts +1 -0
- package/lib/cjs/core-react/utils/Size.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/Size.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.d.ts +1 -0
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js +1 -0
- package/lib/cjs/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.d.ts +3 -2
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.d.ts.map +1 -1
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js +2 -1
- package/lib/cjs/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/cjs/core-react.d.ts +5 -0
- package/lib/cjs/core-react.d.ts.map +1 -1
- package/lib/cjs/core-react.js +10 -6
- package/lib/cjs/core-react.js.map +1 -1
- package/lib/esm/core-react/UiCore.d.ts +1 -0
- package/lib/esm/core-react/UiCore.d.ts.map +1 -1
- package/lib/esm/core-react/UiCore.js +2 -0
- package/lib/esm/core-react/UiCore.js.map +1 -1
- package/lib/esm/core-react/autosuggest/AutoSuggest.d.ts +5 -3
- package/lib/esm/core-react/autosuggest/AutoSuggest.d.ts.map +1 -1
- package/lib/esm/core-react/autosuggest/AutoSuggest.js +1 -2
- package/lib/esm/core-react/autosuggest/AutoSuggest.js.map +1 -1
- package/lib/esm/core-react/badge/Badge.d.ts +3 -2
- package/lib/esm/core-react/badge/Badge.d.ts.map +1 -1
- package/lib/esm/core-react/badge/Badge.js +5 -2
- package/lib/esm/core-react/badge/Badge.js.map +1 -1
- package/lib/esm/core-react/badge/BadgeType.d.ts +6 -0
- package/lib/esm/core-react/badge/BadgeType.d.ts.map +1 -1
- package/lib/esm/core-react/badge/BadgeType.js +2 -1
- package/lib/esm/core-react/badge/BadgeType.js.map +1 -1
- package/lib/esm/core-react/badge/DeprecatedBadge.d.ts +10 -0
- package/lib/esm/core-react/badge/DeprecatedBadge.d.ts.map +1 -0
- package/lib/esm/core-react/badge/DeprecatedBadge.js +25 -0
- package/lib/esm/core-react/badge/DeprecatedBadge.js.map +1 -0
- package/lib/esm/core-react/badge/DeprecatedBadge.scss +11 -0
- package/lib/esm/core-react/badge/NewBadge.scss +4 -0
- package/lib/esm/core-react/badge/TechnicalPreviewBadge.js +2 -2
- package/lib/esm/core-react/badge/TechnicalPreviewBadge.js.map +1 -1
- package/lib/esm/core-react/badge/TechnicalPreviewBadge.scss +4 -0
- package/lib/esm/core-react/colorthemes.scss +0 -8
- package/lib/esm/core-react/contextmenu/ContextMenu.d.ts +3 -6
- package/lib/esm/core-react/contextmenu/ContextMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.js +2 -4
- package/lib/esm/core-react/contextmenu/ContextMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenu.scss +5 -6
- package/lib/esm/core-react/contextmenu/ContextMenuDirection.d.ts +1 -3
- package/lib/esm/core-react/contextmenu/ContextMenuDirection.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuDirection.js +1 -7
- package/lib/esm/core-react/contextmenu/ContextMenuDirection.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuDivider.d.ts +2 -2
- package/lib/esm/core-react/contextmenu/ContextMenuDivider.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuDivider.js +3 -3
- package/lib/esm/core-react/contextmenu/ContextMenuDivider.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuItem.d.ts +8 -6
- package/lib/esm/core-react/contextmenu/ContextMenuItem.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextMenuItem.js +6 -7
- package/lib/esm/core-react/contextmenu/ContextMenuItem.js.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextSubMenu.d.ts +3 -4
- package/lib/esm/core-react/contextmenu/ContextSubMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/ContextSubMenu.js +6 -5
- package/lib/esm/core-react/contextmenu/ContextSubMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.d.ts +2 -1
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.js +1 -0
- package/lib/esm/core-react/contextmenu/GlobalContextMenu.js.map +1 -1
- package/lib/esm/core-react/contextmenu/PopupContextMenu.d.ts +2 -0
- package/lib/esm/core-react/contextmenu/PopupContextMenu.d.ts.map +1 -1
- package/lib/esm/core-react/contextmenu/PopupContextMenu.js +2 -3
- package/lib/esm/core-react/contextmenu/PopupContextMenu.js.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.d.ts.map +1 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.js +0 -1
- package/lib/esm/core-react/elementseparator/ElementSeparator.js.map +1 -1
- package/lib/esm/core-react/enums/CheckBoxState.d.ts +1 -0
- package/lib/esm/core-react/enums/CheckBoxState.d.ts.map +1 -1
- package/lib/esm/core-react/enums/CheckBoxState.js +1 -0
- package/lib/esm/core-react/enums/CheckBoxState.js.map +1 -1
- package/lib/esm/core-react/enums/Orientation.d.ts +1 -0
- package/lib/esm/core-react/enums/Orientation.d.ts.map +1 -1
- package/lib/esm/core-react/enums/Orientation.js +1 -0
- package/lib/esm/core-react/enums/Orientation.js.map +1 -1
- package/lib/esm/core-react/enums/TimeFormat.d.ts +1 -0
- package/lib/esm/core-react/enums/TimeFormat.d.ts.map +1 -1
- package/lib/esm/core-react/enums/TimeFormat.js +1 -0
- package/lib/esm/core-react/enums/TimeFormat.js.map +1 -1
- package/lib/esm/core-react/focus/ItemKeyboardNavigator.d.ts.map +1 -1
- package/lib/esm/core-react/focus/ItemKeyboardNavigator.js.map +1 -1
- package/lib/esm/core-react/focustrap/FocusTrap.js +1 -1
- package/lib/esm/core-react/focustrap/FocusTrap.js.map +1 -1
- package/lib/esm/core-react/hocs/withOnOutsideClick.d.ts +0 -2
- package/lib/esm/core-react/hocs/withOnOutsideClick.d.ts.map +1 -1
- package/lib/esm/core-react/hocs/withOnOutsideClick.js +0 -1
- package/lib/esm/core-react/hocs/withOnOutsideClick.js.map +1 -1
- package/lib/esm/core-react/icons/ConditionalIconItem.d.ts +1 -0
- package/lib/esm/core-react/icons/ConditionalIconItem.d.ts.map +1 -1
- package/lib/esm/core-react/icons/ConditionalIconItem.js +2 -0
- package/lib/esm/core-react/icons/ConditionalIconItem.js.map +1 -1
- package/lib/esm/core-react/icons/IconComponent.d.ts +3 -0
- package/lib/esm/core-react/icons/IconComponent.d.ts.map +1 -1
- package/lib/esm/core-react/icons/IconComponent.js +1 -0
- package/lib/esm/core-react/icons/IconComponent.js.map +1 -1
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.d.ts +0 -1
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.d.ts.map +1 -1
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js +0 -2
- package/lib/esm/core-react/imagecheckbox/ImageCheckBox.js.map +1 -1
- package/lib/esm/core-react/inputs/InputLabel.d.ts.map +1 -1
- package/lib/esm/core-react/inputs/InputLabel.js +1 -8
- package/lib/esm/core-react/inputs/InputLabel.js.map +1 -1
- package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
- package/lib/esm/core-react/inputs/numberinput/NumberInput.js.map +1 -1
- package/lib/esm/core-react/l10n/LocalizationProvider.d.ts +1 -0
- package/lib/esm/core-react/l10n/LocalizationProvider.d.ts.map +1 -1
- package/lib/esm/core-react/l10n/LocalizationProvider.js +1 -0
- package/lib/esm/core-react/l10n/LocalizationProvider.js.map +1 -1
- package/lib/esm/core-react/l10n/useTranslation.d.ts.map +1 -1
- package/lib/esm/core-react/l10n/useTranslation.js +1 -1
- package/lib/esm/core-react/l10n/useTranslation.js.map +1 -1
- package/lib/esm/core-react/listbox/Listbox.d.ts +10 -7
- package/lib/esm/core-react/listbox/Listbox.d.ts.map +1 -1
- package/lib/esm/core-react/listbox/Listbox.js +6 -3
- package/lib/esm/core-react/listbox/Listbox.js.map +1 -1
- package/lib/esm/core-react/messagebox/MessageBox.d.ts.map +1 -1
- package/lib/esm/core-react/messagebox/MessageBox.js +2 -9
- package/lib/esm/core-react/messagebox/MessageBox.js.map +1 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.d.ts +0 -2
- package/lib/esm/core-react/radialmenu/RadialMenu.d.ts.map +1 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.js +0 -2
- package/lib/esm/core-react/radialmenu/RadialMenu.js.map +1 -1
- package/lib/esm/core-react/radialmenu/RadialMenu.scss +3 -3
- package/lib/esm/core-react/searchbox/SearchBox.d.ts +0 -2
- package/lib/esm/core-react/searchbox/SearchBox.d.ts.map +1 -1
- package/lib/esm/core-react/searchbox/SearchBox.js +0 -2
- package/lib/esm/core-react/searchbox/SearchBox.js.map +1 -1
- package/lib/esm/core-react/settings/SettingsContainer.d.ts +7 -3
- package/lib/esm/core-react/settings/SettingsContainer.d.ts.map +1 -1
- package/lib/esm/core-react/settings/SettingsContainer.js +14 -19
- package/lib/esm/core-react/settings/SettingsContainer.js.map +1 -1
- package/lib/esm/core-react/settings/SettingsManager.d.ts +3 -1
- package/lib/esm/core-react/settings/SettingsManager.d.ts.map +1 -1
- package/lib/esm/core-react/settings/SettingsManager.js +6 -10
- package/lib/esm/core-react/settings/SettingsManager.js.map +1 -1
- package/lib/esm/core-react/tabs/Tabs.d.ts +0 -3
- package/lib/esm/core-react/tabs/Tabs.d.ts.map +1 -1
- package/lib/esm/core-react/tabs/Tabs.js +0 -4
- package/lib/esm/core-react/tabs/Tabs.js.map +1 -1
- package/lib/esm/core-react/tree/ExpansionToggle.d.ts.map +1 -1
- package/lib/esm/core-react/tree/ExpansionToggle.js +0 -1
- package/lib/esm/core-react/tree/ExpansionToggle.js.map +1 -1
- package/lib/esm/core-react/tree/Node.d.ts +2 -0
- package/lib/esm/core-react/tree/Node.d.ts.map +1 -1
- package/lib/esm/core-react/tree/Node.js +1 -5
- package/lib/esm/core-react/tree/Node.js.map +1 -1
- package/lib/esm/core-react/uistate/LocalStateStorage.d.ts +2 -2
- package/lib/esm/core-react/uistate/LocalStateStorage.d.ts.map +1 -1
- package/lib/esm/core-react/uistate/LocalStateStorage.js +3 -4
- package/lib/esm/core-react/uistate/LocalStateStorage.js.map +1 -1
- package/lib/esm/core-react/uistate/UiStateEntry.d.ts +1 -0
- package/lib/esm/core-react/uistate/UiStateEntry.d.ts.map +1 -1
- package/lib/esm/core-react/uistate/UiStateEntry.js +2 -0
- package/lib/esm/core-react/uistate/UiStateEntry.js.map +1 -1
- package/lib/esm/core-react/uistate/UiStateStorage.d.ts +3 -0
- package/lib/esm/core-react/uistate/UiStateStorage.d.ts.map +1 -1
- package/lib/esm/core-react/uistate/UiStateStorage.js +1 -0
- package/lib/esm/core-react/uistate/UiStateStorage.js.map +1 -1
- package/lib/esm/core-react/utils/IconWebComponent.d.ts.map +1 -1
- package/lib/esm/core-react/utils/IconWebComponent.js +1 -3
- package/lib/esm/core-react/utils/IconWebComponent.js.map +1 -1
- package/lib/esm/core-react/utils/ListenerType.d.ts +15 -0
- package/lib/esm/core-react/utils/ListenerType.d.ts.map +1 -0
- package/lib/esm/core-react/utils/ListenerType.js +2 -0
- package/lib/esm/core-react/utils/ListenerType.js.map +1 -0
- package/lib/esm/core-react/utils/Rectangle.d.ts +1 -0
- package/lib/esm/core-react/utils/Rectangle.d.ts.map +1 -1
- package/lib/esm/core-react/utils/Rectangle.js.map +1 -1
- package/lib/esm/core-react/utils/Size.d.ts +1 -0
- package/lib/esm/core-react/utils/Size.d.ts.map +1 -1
- package/lib/esm/core-react/utils/Size.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.d.ts +1 -0
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js +1 -0
- package/lib/esm/core-react/utils/hooks/useCrossOriginPopup.js.map +1 -1
- package/lib/esm/core-react/utils/hooks/useResizeObserver.d.ts +3 -2
- package/lib/esm/core-react/utils/hooks/useResizeObserver.d.ts.map +1 -1
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js +2 -1
- package/lib/esm/core-react/utils/hooks/useResizeObserver.js.map +1 -1
- package/lib/esm/core-react.d.ts +5 -0
- package/lib/esm/core-react.d.ts.map +1 -1
- package/lib/esm/core-react.js +6 -2
- package/lib/esm/core-react.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionalIconItem.d.ts","sourceRoot":"","sources":["../../../../src/core-react/icons/ConditionalIconItem.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"ConditionalIconItem.d.ts","sourceRoot":"","sources":["../../../../src/core-react/icons/ConditionalIconItem.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAIhD;;;GAGG;AACH,qBAAa,mBAAmB;aASZ,UAAU,EAAE,MAAM,QAAQ;aAC1B,YAAY,EAAE,MAAM,EAAE;IATxC,OAAO,CAAC,MAAM,CAAC,CAAW;IAE1B;;;;OAIG;gBAEe,UAAU,EAAE,MAAM,QAAQ,EAC1B,YAAY,EAAE,MAAM,EAAE,EACtC,KAAK,CAAC,EAAE,QAAQ;IAKlB,mDAAmD;IACnD,IAAW,KAAK,IAAI,QAAQ,CAI3B;IAED,2DAA2D;IACpD,OAAO,IAAI,OAAO;IAUzB,gGAAgG;WAClF,YAAY,CACxB,gBAAgB,EAAE,mBAAmB,GAAG,MAAM,GAAG,SAAS,EAC1D,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,GACpB,OAAO;IAkBV,0FAA0F;WAC5E,QAAQ,CACpB,gBAAgB,EAAE,mBAAmB,GAAG,MAAM,GAAG,SAAS,GACzD,QAAQ,GAAG,SAAS;CAUxB"}
|
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.ConditionalIconItem = void 0;
|
|
11
|
+
/* eslint-disable deprecation/deprecation */
|
|
11
12
|
/** Class used to return an icon. The icon is variable and can be changed in response to subscribed event ids.
|
|
12
13
|
* @public
|
|
14
|
+
* @deprecated in 4.16.0. Use {@link @itwin/appui-react#ConditionalIconValue} instead.
|
|
13
15
|
*/
|
|
14
16
|
class ConditionalIconItem {
|
|
15
17
|
/** Constructor for ConditionalIconItem
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionalIconItem.js","sourceRoot":"","sources":["../../../../src/core-react/icons/ConditionalIconItem.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAIH
|
|
1
|
+
{"version":3,"file":"ConditionalIconItem.js","sourceRoot":"","sources":["../../../../src/core-react/icons/ConditionalIconItem.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAIH,4CAA4C;AAE5C;;;GAGG;AACH,MAAa,mBAAmB;IAG9B;;;;OAIG;IACH,YACkB,UAA0B,EAC1B,YAAsB,EACtC,KAAgB;QAFA,eAAU,GAAV,UAAU,CAAgB;QAC1B,iBAAY,GAAZ,YAAY,CAAU;QAGtC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,mDAAmD;IACnD,IAAW,KAAK;QACd,IAAI,SAAS,KAAK,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC,MAAM,CAAC;QAClD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,2DAA2D;IACpD,OAAO;QACZ,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAEnC,IAAI,QAAQ,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,gGAAgG;IACzF,MAAM,CAAC,YAAY,CACxB,gBAA0D,EAC1D,QAAqB;QAErB,IACE,SAAS,KAAK,gBAAgB;YAC9B,CAAC,CAAC,gBAAgB,YAAY,mBAAmB,CAAC;YAElD,OAAO,KAAK,CAAC;QAEf,MAAM,QAAQ,GAAG,gBAAgB,CAAC;QAElC,IACE,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,KAAa,EAAW,EAAE,CACpD,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAClC;YAED,OAAO,QAAQ,CAAC,OAAO,EAAE,CAAC;QAE5B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,0FAA0F;IACnF,MAAM,CAAC,QAAQ,CACpB,gBAA0D;QAE1D,IAAI,SAAS,KAAK,gBAAgB;YAAE,OAAO,SAAS,CAAC;QAErD,IAAI,gBAAgB,YAAY,mBAAmB,EAAE,CAAC;YACpD,MAAM,QAAQ,GAAG,gBAAgB,CAAC;YAClC,OAAO,QAAQ,CAAC,KAAK,CAAC;QACxB,CAAC;QAED,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF;AArED,kDAqEC","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 Icon\n */\n\nimport type { IconSpec } from \"./IconComponent\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Class used to return an icon. The icon is variable and can be changed in response to subscribed event ids.\n * @public\n * @deprecated in 4.16.0. Use {@link @itwin/appui-react#ConditionalIconValue} instead.\n */\nexport class ConditionalIconItem {\n private _value?: IconSpec;\n\n /** Constructor for ConditionalIconItem\n * @param iconGetter Function to retrieve the icon that matches the condition. Returns an IconSpec.\n * @param syncEventIds The array of event ids to be monitored. These events are triggered when the condition(s) that control the icon change.\n * @param value The default IconSpec. If this is not specified, the function is run to get the initial value.\n */\n constructor(\n public readonly iconGetter: () => IconSpec,\n public readonly syncEventIds: string[],\n value?: IconSpec\n ) {\n this._value = value;\n }\n\n /** The current IconSpec according to conditions */\n public get value(): IconSpec {\n if (undefined !== this._value) return this._value;\n this._value = this.iconGetter();\n return this._value;\n }\n\n /** Called to update the value by running the iconGetter */\n public refresh(): boolean {\n const newValue = this.iconGetter();\n\n if (newValue !== this._value) {\n this._value = newValue;\n return true;\n }\n return false;\n }\n\n /** A helper function that updates the IconSpec value when the specified events are triggered */\n public static refreshValue(\n conditionalValue: ConditionalIconItem | string | undefined,\n eventIds: Set<string>\n ): boolean {\n if (\n undefined === conditionalValue ||\n !(conditionalValue instanceof ConditionalIconItem)\n )\n return false;\n\n const iconItem = conditionalValue;\n\n if (\n iconItem.syncEventIds.some((value: string): boolean =>\n eventIds.has(value.toLowerCase())\n )\n )\n return iconItem.refresh();\n\n return false;\n }\n /** helper function to get the iconSpec from a ConditionIconItem as IconSpec | undefined*/\n public static getValue(\n conditionalValue: ConditionalIconItem | string | undefined\n ): IconSpec | undefined {\n if (undefined === conditionalValue) return undefined;\n\n if (conditionalValue instanceof ConditionalIconItem) {\n const iconItem = conditionalValue;\n return iconItem.value;\n }\n\n return conditionalValue;\n }\n}\n"]}
|
|
@@ -13,10 +13,12 @@ import { ConditionalIconItem } from "./ConditionalIconItem";
|
|
|
13
13
|
* - A dataURI with MimeTypes `image/svg+xml` (ensure valid dataURI encoding) or `image/svg+xml;base64`;
|
|
14
14
|
* - Anything else will be treated as a class name and be directly added to the `class` attribute.
|
|
15
15
|
* @public
|
|
16
|
+
* @deprecated in 4.16.0. Use `React.ReactNode` instead.
|
|
16
17
|
*/
|
|
17
18
|
export type IconSpec = string | ConditionalStringValue | React.ReactNode | ConditionalIconItem;
|
|
18
19
|
/** Properties for the [[Icon]] React component
|
|
19
20
|
* @public
|
|
21
|
+
* @deprecated in 4.16.0. Props of deprecated {@link Icon} component.
|
|
20
22
|
*/
|
|
21
23
|
export interface IconProps extends CommonProps {
|
|
22
24
|
/** CSS class name or SvgPath for icon. This is optional because it is improperly
|
|
@@ -26,6 +28,7 @@ export interface IconProps extends CommonProps {
|
|
|
26
28
|
}
|
|
27
29
|
/** Icon Functional component displays an icon based on an [[IconSpec]].
|
|
28
30
|
* @public
|
|
31
|
+
* @deprecated in 4.16.0. Used to render a deprecated {@link IconSpec} type. Use {@link https://itwinui.bentley.com/ iTwinUI Icon} instead.
|
|
29
32
|
*/
|
|
30
33
|
export declare function Icon(props: IconProps): React.JSX.Element | null;
|
|
31
34
|
//# sourceMappingURL=IconComponent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconComponent.d.ts","sourceRoot":"","sources":["../../../../src/core-react/icons/IconComponent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"IconComponent.d.ts","sourceRoot":"","sources":["../../../../src/core-react/icons/IconComponent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAI5D;;;;;;;;GAQG;AACH,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,sBAAsB,GACtB,KAAK,CAAC,SAAS,GACf,mBAAmB,CAAC;AAExB;;;GAGG;AACH,MAAM,WAAW,SAAU,SAAQ,WAAW;IAC5C;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAWD;;;GAGG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,4BA4DpC"}
|
|
@@ -23,6 +23,7 @@ function getWebComponentSource(iconSpec) {
|
|
|
23
23
|
}
|
|
24
24
|
/** Icon Functional component displays an icon based on an [[IconSpec]].
|
|
25
25
|
* @public
|
|
26
|
+
* @deprecated in 4.16.0. Used to render a deprecated {@link IconSpec} type. Use {@link https://itwinui.bentley.com/ iTwinUI Icon} instead.
|
|
26
27
|
*/
|
|
27
28
|
function Icon(props) {
|
|
28
29
|
if (!props.iconSpec)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconComponent.js","sourceRoot":"","sources":["../../../../src/core-react/icons/IconComponent.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,gCAA8B;AAC9B,+BAA+B;AAC/B,2CAAoC;AACpC,0DAA+D;AAE/D,oEAAoD;AACpD,+DAA4D;
|
|
1
|
+
{"version":3,"file":"IconComponent.js","sourceRoot":"","sources":["../../../../src/core-react/icons/IconComponent.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,gCAA8B;AAC9B,+BAA+B;AAC/B,2CAAoC;AACpC,0DAA+D;AAE/D,oEAAoD;AACpD,+DAA4D;AA8B5D,qDAAqD;AACrD,SAAS,qBAAqB,CAAC,QAAgB;IAC7C,IAAI,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1D,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;GAGG;AACH,SAAgB,IAAI,CAAC,KAAgB;IACnC,IAAI,CAAC,KAAK,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAEjC,MAAM,aAAa,GAAG,gBAAgB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACvD,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE,CAAC;QACtC,MAAM,UAAU,GAAG,aAAa,CAAC;QACjC,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;QAE7D,IACE,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC;YAC9B,UAAU,CAAC,QAAQ,CAA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L,CAAC;AACJ,CAAC;AA5DD,oBA4DC;AAED,SAAS,gBAAgB,CACvB,QAAkB;IAElB,IAAI,KAAK,GAAG,QAAQ,CAAC;IACrB,OAAO,IAAI,EAAE,CAAC;QACZ,IAAI,KAAK,YAAY,yCAAmB,EAAE,CAAC;YACzC,KAAK,GAAG,yCAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAC5C,SAAS;QACX,CAAC;QACD,IAAI,KAAK,YAAY,uCAAsB,EAAE,CAAC;YAC5C,KAAK,GAAG,uCAAsB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAC/C,MAAM;QACR,CAAC;QACD,MAAM;IACR,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Icon\n */\n\nimport \"./IconComponent.scss\";\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport { ConditionalStringValue } from \"@itwin/appui-abstract\";\nimport type { CommonProps } from \"../utils/Props\";\nimport DOMPurify, * as DOMPurifyNS from \"dompurify\";\nimport { ConditionalIconItem } from \"./ConditionalIconItem\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Prototype for an IconSpec which can be a string, ReactNode or ConditionalStringValue.\n * Strings are expected to be one of the following:\n * - Created by `IconSpecUtilities.createWebComponentIconSpec` in appui-abstract (deprecated).\n * - A URL to a SVG file (must end with \".svg\").\n * - A dataURI with MimeTypes `image/svg+xml` (ensure valid dataURI encoding) or `image/svg+xml;base64`;\n * - Anything else will be treated as a class name and be directly added to the `class` attribute.\n * @public\n * @deprecated in 4.16.0. Use `React.ReactNode` instead.\n */\nexport type IconSpec =\n | string\n | ConditionalStringValue\n | React.ReactNode\n | ConditionalIconItem;\n\n/** Properties for the [[Icon]] React component\n * @public\n * @deprecated in 4.16.0. Props of deprecated {@link Icon} component.\n */\nexport interface IconProps extends CommonProps {\n /** CSS class name or SvgPath for icon. This is optional because it is improperly\n * used to extend other interfaces and changing it would break existing API.\n */\n iconSpec?: IconSpec;\n}\n\n/** Get the SVG Source from an svg-loader IconSpec */\nfunction getWebComponentSource(iconSpec: string): string | undefined {\n if (iconSpec.startsWith(\"webSvg:\") && iconSpec.length > 7) {\n return iconSpec.slice(7);\n }\n\n return undefined;\n}\n\n/** Icon Functional component displays an icon based on an [[IconSpec]].\n * @public\n * @deprecated in 4.16.0. Used to render a deprecated {@link IconSpec} type. Use {@link https://itwinui.bentley.com/ iTwinUI Icon} instead.\n */\nexport function Icon(props: IconProps) {\n if (!props.iconSpec) return null;\n\n const iconSpecValue = getIconSpecValue(props.iconSpec);\n if (typeof iconSpecValue === \"string\") {\n const iconString = iconSpecValue;\n const webComponentString = getWebComponentSource(iconString);\n\n if (\n iconString.startsWith(\"data:\") ||\n iconString.endsWith(\".svg\") ||\n webComponentString\n ) {\n const definitiveIconString = webComponentString\n ? webComponentString\n : iconString;\n const svgLoader = `<svg-loader src=\"${definitiveIconString}\"></svg-loader>`;\n const svgDiv = `<div>${svgLoader}</div>`;\n // the esm build of dompurify has a default import but the cjs build does not\n // if there is a default export, use it (likely esm), otherwise use the namespace\n const sanitizer = DOMPurify ?? DOMPurifyNS;\n\n const sanitizerConfig = {\n ALLOWED_TAGS: [\"svg-loader\"],\n ADD_URI_SAFE_ATTR: definitiveIconString.startsWith(\"data:\")\n ? [\"src\"]\n : [],\n };\n\n const sanitizedIconString = sanitizer.sanitize(svgDiv, sanitizerConfig);\n const webComponentNode = (\n // we can safely disable jam3/no-sanitizer-with-danger as we are sanitizing above\n // eslint-disable-next-line jam3/no-sanitizer-with-danger\n <div dangerouslySetInnerHTML={{ __html: sanitizedIconString }}></div>\n );\n return (\n <i className={classnames(\"icon\", \"core-svg-icon\", props.className)}>\n {webComponentNode}\n </i>\n );\n }\n\n // CSS icon\n return (\n <i\n className={classnames(\"icon\", iconString, props.className)}\n style={props.style}\n />\n );\n }\n\n // ReactNode icon\n return (\n <i\n className={classnames(\"icon\", \"core-svg-icon\", props.className)}\n style={props.style}\n >\n {iconSpecValue}\n </i>\n );\n}\n\nfunction getIconSpecValue(\n iconSpec: IconSpec\n): Exclude<IconSpec, ConditionalIconItem | ConditionalStringValue> {\n let value = iconSpec;\n while (true) {\n if (value instanceof ConditionalIconItem) {\n value = ConditionalIconItem.getValue(value);\n continue;\n }\n if (value instanceof ConditionalStringValue) {\n value = ConditionalStringValue.getValue(value);\n break;\n }\n break;\n }\n return value;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageCheckBox.d.ts","sourceRoot":"","sources":["../../../../src/core-react/imagecheckbox/ImageCheckBox.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAE9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ImageCheckBox.d.ts","sourceRoot":"","sources":["../../../../src/core-react/imagecheckbox/ImageCheckBox.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAE9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,oCAAoC;IACpC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAClC,gDAAgD;IAChD,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACnC,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,GAAG,CAAC;IACpC,2DAA2D;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;CACxC;AAED;;;GAGG;AACH,qBAAa,aAAc,SAAQ,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC;IACxE,OAAO,CAAC,SAAS,CAMf;IAEF,OAAO,CAAC,aAAa,CAEnB;IAEF,OAAO,CAAC,aAAa,CAEnB;IAEc,MAAM;CAqCvB"}
|
|
@@ -16,7 +16,6 @@ const IconComponent_1 = require("../icons/IconComponent");
|
|
|
16
16
|
* @public
|
|
17
17
|
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/checkbox iTwinUI checkbox} instead (custom icons are not supported at the moment, but feel free to submit your use cases).
|
|
18
18
|
*/
|
|
19
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
20
19
|
class ImageCheckBox extends React.PureComponent {
|
|
21
20
|
constructor() {
|
|
22
21
|
super(...arguments);
|
|
@@ -36,7 +35,6 @@ class ImageCheckBox extends React.PureComponent {
|
|
|
36
35
|
e.stopPropagation();
|
|
37
36
|
};
|
|
38
37
|
}
|
|
39
|
-
/** @internal */
|
|
40
38
|
render() {
|
|
41
39
|
const checkBoxClass = (0, classnames_1.default)("core-image-checkbox", this.props.className);
|
|
42
40
|
const imageClass = (0, classnames_1.default)("image", this.props.border && "image-checkbox-border");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageCheckBox.js","sourceRoot":"","sources":["../../../../src/core-react/imagecheckbox/ImageCheckBox.tsx"],"names":[],"mappings":";A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jC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO;YACpB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QAExB,OAAO;QACL,yJAAyJ;QACzJ,+BACE,SAAS,EAAE,aAAa,EACxB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,OAAO,EAAE,IAAI,CAAC,aAAa,EAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO;YAEzB,+BACE,IAAI,EAAC,UAAU,EACf,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EACpC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EAC5B,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAC3B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,OAAO,EAAE,IAAI,CAAC,aAAa,EAC3B,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GACxB;YACF,8BAAM,SAAS,EAAE,UAAU;gBACzB,oBAAC,oBAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,CACvB,CACD,CACT,CAAC;IACJ,CAAC;CACF;AAtDD,sCAsDC","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 Checkbox\n */\n\nimport \"./ImageCheckBox.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Icon } from \"../icons/IconComponent\";\nimport type { CommonProps } from \"../utils/Props\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Properties for the [[ImageCheckBox]] component\n * @public\n * @deprecated in 4.12.0. Props of deprecated component {@link ImageCheckBox}.\n */\nexport interface ImageCheckBoxProps extends CommonProps {\n /** Image for the \"checked\" state */\n imageOn: string | React.ReactNode;\n /** Image for the \"unchecked\" (default) state */\n imageOff: string | React.ReactNode;\n /** Determine if the item is checked or not */\n checked?: boolean;\n /** Determine if the item is disabled or not */\n disabled?: boolean;\n /** Function called when item is clicked. */\n onClick?: (checked: boolean) => any;\n /** Custom CSS class name for the checkbox input element */\n inputClassName?: string;\n /** Custom CSS Style for the checkbox input element */\n inputStyle?: React.CSSProperties;\n /** Tooltip to be displayed when mouse is hovered over the checkbox */\n tooltip?: string;\n /** If true, draw a border around the image checkbox */\n border?: boolean;\n /** Provides ability to return reference to HTMLInputElement */\n inputRef?: React.Ref<HTMLInputElement>;\n}\n\n/** ImageCheckBox React component shows a checked or unchecked image\n * @public\n * @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/checkbox iTwinUI checkbox} instead (custom icons are not supported at the moment, but feel free to submit your use cases).\n */\nexport class ImageCheckBox extends React.PureComponent<ImageCheckBoxProps> {\n private _onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n if (e && e.stopPropagation) e.stopPropagation();\n\n if (this.props.onClick) {\n this.props.onClick(e.target.checked);\n }\n };\n\n private _onInputClick = (e: React.MouseEvent<HTMLInputElement>) => {\n if (e && e.stopPropagation) e.stopPropagation();\n };\n\n private _onLabelClick = (e: React.MouseEvent<HTMLLabelElement>) => {\n if (e && e.stopPropagation) e.stopPropagation();\n };\n\n public override render() {\n const checkBoxClass = classnames(\n \"core-image-checkbox\",\n this.props.className\n );\n const imageClass = classnames(\n \"image\",\n this.props.border && \"image-checkbox-border\"\n );\n const iconSpec = this.props.checked\n ? this.props.imageOn\n : this.props.imageOff;\n\n return (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/label-has-associated-control, jsx-a11y/no-noninteractive-element-interactions\n <label\n className={checkBoxClass}\n style={this.props.style}\n onClick={this._onLabelClick}\n title={this.props.tooltip}\n >\n <input\n type=\"checkbox\"\n className={this.props.inputClassName}\n style={this.props.inputStyle}\n checked={this.props.checked}\n disabled={this.props.disabled}\n onChange={this._onChange}\n onClick={this._onInputClick}\n ref={this.props.inputRef}\n />\n <span className={imageClass}>\n <Icon iconSpec={iconSpec} />\n </span>\n </label>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputLabel.d.ts","sourceRoot":"","sources":["../../../../src/core-react/inputs/InputLabel.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAQH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"InputLabel.d.ts","sourceRoot":"","sources":["../../../../src/core-react/inputs/InputLabel.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAQH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AAIjC;;;GAGG;AACH,MAAM,WAAW,eACf,SAAQ,qBAAqB,EAC3B,sBAAsB,EACtB,WAAW;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAQD;;;GAGG;AACH,qBAAa,UAAW,SAAQ,KAAK,CAAC,aAAa,CAAC,eAAe,CAAC;IAClD,MAAM,IAAI,KAAK,CAAC,YAAY;CAgD7C"}
|
|
@@ -14,26 +14,19 @@ const React = require("react");
|
|
|
14
14
|
const IconComponent_1 = require("../icons/IconComponent");
|
|
15
15
|
const InputStatus_1 = require("./InputStatus");
|
|
16
16
|
const inputLabelIconSpec = {
|
|
17
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
18
17
|
[InputStatus_1.InputStatus.Error]: React.createElement(itwinui_icons_react_1.SvgStatusError, null),
|
|
19
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
20
18
|
[InputStatus_1.InputStatus.Success]: React.createElement(itwinui_icons_react_1.SvgStatusSuccess, null),
|
|
21
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
22
19
|
[InputStatus_1.InputStatus.Warning]: React.createElement(itwinui_icons_react_1.SvgStatusWarning, null),
|
|
23
20
|
};
|
|
24
21
|
/** Text input wrapper that provides additional styling and labeling
|
|
25
22
|
* @public
|
|
26
23
|
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/input iTwinUI input} instead.
|
|
27
24
|
*/
|
|
28
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
29
25
|
class InputLabel extends React.PureComponent {
|
|
30
26
|
render() {
|
|
31
27
|
const { label, status, className, style, labelClassName, labelStyle, message, messageClassName, messageStyle, } = this.props;
|
|
32
28
|
return (React.createElement("label", { style: style, className: (0, classnames_1.default)("uicore-inputs-labeled-input", this.props.disabled && "uicore-disabled", status, className) },
|
|
33
|
-
label && (React.createElement("div", { className: (0, classnames_1.default)("uicore-label", labelClassName), style: labelStyle },
|
|
34
|
-
" ",
|
|
35
|
-
label,
|
|
36
|
-
" ")),
|
|
29
|
+
label && (React.createElement("div", { className: (0, classnames_1.default)("uicore-label", labelClassName), style: labelStyle }, label)),
|
|
37
30
|
React.createElement("div", { className: (0, classnames_1.default)("input", { "with-icon": !!status }) },
|
|
38
31
|
this.props.children,
|
|
39
32
|
status && (React.createElement(IconComponent_1.Icon, { className: "icon", iconSpec: inputLabelIconSpec[`{status}`] }))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputLabel.js","sourceRoot":"","sources":["../../../../src/core-react/inputs/InputLabel.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,oEAIoC;AACpC,2CAAoC;AACpC,+BAA+B;AAE/B,0DAA8C;AAE9C,+CAA4C;
|
|
1
|
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ACV,6BACE,SAAS,EAAE,IAAA,oBAAU,EAAC,gBAAgB,EAAE,gBAAgB,CAAC,EACzD,KAAK,EAAE,YAAY,IAElB,OAAO,CACJ,CACP,CACK,CACT,CAAC;IACJ,CAAC;CACF;AAjDD,gCAiDC","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 Inputs\n */\n\nimport {\n SvgStatusError,\n SvgStatusSuccess,\n SvgStatusWarning,\n} from \"@itwin/itwinui-icons-react\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { IconSpec } from \"../icons/IconComponent\";\nimport { Icon } from \"../icons/IconComponent\";\nimport type { CommonProps } from \"../utils/Props\";\nimport { InputStatus } from \"./InputStatus\";\nimport type {\n LabeledComponentProps,\n MessagedComponentProps,\n} from \"./LabeledComponentProps\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Properties for [[InputLabel]] components\n * @public\n * @deprecated in 4.12.0. Props of deprecated component {@link InputLabel}.\n */\nexport interface InputLabelProps\n extends LabeledComponentProps,\n MessagedComponentProps,\n CommonProps {\n disabled?: boolean;\n /** Labeled content */\n children?: React.ReactNode;\n}\n\nconst inputLabelIconSpec: { [key: string]: IconSpec } = {\n [InputStatus.Error]: <SvgStatusError />,\n [InputStatus.Success]: <SvgStatusSuccess />,\n [InputStatus.Warning]: <SvgStatusWarning />,\n};\n\n/** Text input wrapper that provides additional styling and labeling\n * @public\n * @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/input iTwinUI input} instead.\n */\nexport class InputLabel extends React.PureComponent<InputLabelProps> {\n public override render(): React.ReactElement {\n const {\n label,\n status,\n className,\n style,\n labelClassName,\n labelStyle,\n message,\n messageClassName,\n messageStyle,\n } = this.props;\n\n return (\n <label\n style={style}\n className={classnames(\n \"uicore-inputs-labeled-input\",\n this.props.disabled && \"uicore-disabled\",\n status,\n className\n )}\n >\n {label && (\n <div\n className={classnames(\"uicore-label\", labelClassName)}\n style={labelStyle}\n >\n {label}\n </div>\n )}\n <div className={classnames(\"input\", { \"with-icon\": !!status })}>\n {this.props.children}\n {status && (\n <Icon className=\"icon\" iconSpec={inputLabelIconSpec[`{status}`]} />\n )}\n </div>\n {message && (\n <div\n className={classnames(\"uicore-message\", messageClassName)}\n style={messageStyle}\n >\n {message}\n </div>\n )}\n </label>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/inputs/numberinput/NumberInput.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../../../src/core-react/inputs/numberinput/NumberInput.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAW7C,KAAK,UAAU,GAAG,KAAK,CAAC,wBAAwB,CAAC,OAAO,KAAK,CAAC,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,CAAC;AAEhD;;;GAGG;AACH,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,UAAU,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,UAAU,CAAC;IAC7D,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC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BAA+B,CACpD;YAGD,6BACE,SAAS,EAAC,sDAAsD,EAChE,QAAQ,EAAE,CAAC,CAAC,EACZ,OAAO,EAAE,aAAa,EACtB,IAAI,EAAC,cAAc;gBAEnB,oBAAC,oBAAI,IAAC,QAAQ,EAAE,OAAO,GAAI,CACvB;YAEN,6BACE,SAAS,EAAC,wDAAwD,EAClE,QAAQ,EAAE,CAAC,CAAC,EACZ,OAAO,EAAE,eAAe,EACxB,IAAI,EAAC,cAAc;gBAEnB,oBAAC,oBAAI,IAAC,QAAQ,EAAE,SAAS,GAAI,CACzB,CACF,CACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACU,QAAA,WAAW,GAGD,qBAAqB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Inputs\n */\n\nimport \"./NumberInput.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Key } from \"ts-key-enum\";\nimport { Input } from \"@itwin/itwinui-react\";\nimport { Icon } from \"../../icons/IconComponent\";\nimport {\n SvgCaretDown,\n SvgCaretDownSmall,\n SvgCaretUp,\n SvgCaretUpSmall,\n} from \"@itwin/itwinui-icons-react\";\n\ntype InputProps = React.ComponentPropsWithoutRef<typeof Input>;\n\n/** Step function prototype for [[NumberInput]] component\n * @public\n * @deprecated in 4.12.0. Interface used in a deprecated component {@link NumberInput}.\n */\nexport type StepFunctionProp =\n | number\n | ((direction: string) => number | undefined);\n\n/** Properties for the [[NumberInput]] component\n * @public\n * @deprecated in 4.12.0. Props of deprecated component {@link NumberInput}.\n */\nexport interface NumberInputProps\n extends Omit<InputProps, \"min\" | \"max\" | \"step\" | \"onChange\"> {\n /** Numeric value, set to `undefined` to show placeholder text */\n value?: number;\n /** CSS class name for the NumberInput component container div */\n containerClassName?: string;\n /** Style for component container div. */\n containerStyle?: React.CSSProperties;\n /** number or function\tNumber.MIN_SAFE_INTEGER */\n min?: number;\n /** number or function\tdefaults to Number.MAX_SAFE_INTEGER */\n max?: number;\n /** increment step value used while incrementing or decrementing (up/down buttons or arrow keys) defaults to 1. */\n // eslint-disable-next-line deprecation/deprecation\n step?: StepFunctionProp;\n /** number of decimal places, defaults to 0 */\n precision?: number;\n /** function parseFloat */\n parse?: (value: string) => number | null | undefined;\n /** function optional formatting function that takes the number value and the internal formatted value in case function just adds prefix or suffix. */\n format?: (num: number | null | undefined, formattedValue: string) => string;\n /** Set to true to \"snap\" to the closest step value while incrementing or decrementing (up/down buttons or arrow keys). */\n snap?: boolean;\n /** Function to call when value is changed. */\n onChange?: (value: number | undefined, stringValue: string) => void;\n /** if true up/down buttons are shown larger and side by side */\n showTouchButtons?: boolean;\n /** Provides ability to return reference to HTMLInputElement */\n ref?: React.Ref<HTMLInputElement>;\n /**\n * Makes this component behave as controlled component.\n * @internal\n */\n isControlled?: boolean;\n}\n\nconst ForwardRefNumberInput = React.forwardRef<\n HTMLInputElement,\n // eslint-disable-next-line deprecation/deprecation\n NumberInputProps\n>(function ForwardRefNumberInput(props, ref) {\n const {\n containerClassName,\n className,\n value,\n min,\n max,\n precision,\n format,\n parse,\n onChange,\n onBlur,\n onKeyDown,\n step,\n snap,\n showTouchButtons,\n containerStyle,\n isControlled,\n ...otherProps\n } = props;\n const currentValueRef = React.useRef(value);\n\n /**\n * Used internally to parse the argument x to it's numeric representation.\n * If the argument cannot be converted to finite number returns 0; If a\n * \"precision\" prop is specified uses it round the number with that\n * precision (no fixed precision here because the return value is float, not\n * string).\n */\n const parseInternal = React.useCallback(\n (x: string) => {\n let n: number | undefined | null;\n\n if (parse) n = parse(x);\n if (undefined === n || null === n) {\n n = parseFloat(x);\n if (isNaN(n) || !isFinite(n)) {\n n = 0;\n }\n }\n\n const localPrecision = undefined === precision ? 10 : precision;\n const q = Math.pow(10, localPrecision);\n const localMin = undefined === min ? Number.MIN_SAFE_INTEGER : min;\n const localMax = undefined === max ? Number.MAX_SAFE_INTEGER : max;\n n = Math.min(Math.max(n, localMin), localMax);\n n = Math.round(n * q) / q;\n\n return n;\n },\n [parse, precision, min, max]\n );\n\n /**\n * This is used internally to format a number to its display representation.\n * It will invoke the format function if one is provided.\n */\n const formatInternal = React.useCallback(\n (num: number | undefined | null) => {\n const localPrecision =\n undefined === precision || null === precision ? 0 : precision;\n const str =\n undefined === num || null === num ? \"\" : num.toFixed(localPrecision);\n\n if (format) return format(num, str);\n\n return str;\n },\n [format, precision]\n );\n\n const [formattedValue, setFormattedValue] = React.useState(() =>\n formatInternal(value)\n );\n\n // See if new initialValue props have changed since component mounted\n React.useEffect(() => {\n currentValueRef.current = value;\n const currentFormattedValue = formatInternal(currentValueRef.current);\n setFormattedValue(currentFormattedValue);\n }, [formatInternal, value]);\n\n const handleChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const newVal = event.currentTarget.value;\n setFormattedValue(newVal);\n isControlled && onChange && onChange(parseInternal(newVal), newVal);\n },\n [isControlled, onChange, parseInternal]\n );\n\n const updateValue = React.useCallback(\n (newVal: number) => {\n const newFormattedVal = formatInternal(newVal);\n onChange && onChange(newVal, newFormattedVal);\n setFormattedValue(newFormattedVal);\n },\n [onChange, formatInternal]\n );\n\n const updateValueFromString = React.useCallback(\n (strValue: string) => {\n const newVal = parseInternal(strValue);\n updateValue(newVal);\n },\n [parseInternal, updateValue]\n );\n\n const handleBlur = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n const newVal = parseInternal(event.target.value);\n onBlur && onBlur(event);\n updateValue(newVal);\n },\n [parseInternal, updateValue, onBlur]\n );\n\n const getIncrementValue = React.useCallback(\n (increment: boolean) => {\n if (typeof step === \"function\") {\n const stepVal = step(increment ? \"up\" : \"down\");\n return stepVal ? stepVal : 1;\n }\n\n return !step ? 1 : step;\n },\n [step]\n );\n\n /**\n * The internal method that actually sets the new value on the input\n */\n const applyStep = React.useCallback(\n (increment: boolean) => {\n const incrementValue = getIncrementValue(increment);\n\n let num =\n parseInternal(formattedValue) +\n (increment ? incrementValue : -incrementValue);\n if (snap) {\n num = Math.round(num / incrementValue) * incrementValue;\n }\n\n const localMin = undefined === min ? Number.MIN_SAFE_INTEGER : min;\n const localMax = undefined === max ? Number.MAX_SAFE_INTEGER : max;\n num = Math.min(Math.max(num, localMin), localMax);\n\n updateValue(num);\n },\n [\n formattedValue,\n getIncrementValue,\n max,\n min,\n parseInternal,\n snap,\n updateValue,\n ]\n );\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === Key.Enter.valueOf()) {\n updateValueFromString(event.currentTarget.value);\n event.preventDefault();\n event.stopPropagation();\n } else if (event.key === Key.Escape.valueOf()) {\n setFormattedValue(formatInternal(currentValueRef.current));\n event.preventDefault();\n } else if (event.key === Key.ArrowDown.valueOf()) {\n applyStep(false);\n event.preventDefault();\n event.stopPropagation();\n } else if (event.key === Key.ArrowUp.valueOf()) {\n applyStep(true);\n event.preventDefault();\n event.stopPropagation();\n }\n onKeyDown && onKeyDown(event);\n },\n [applyStep, formatInternal, updateValueFromString, onKeyDown]\n );\n\n const handleDownClick = React.useCallback(\n (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n applyStep(false);\n event.preventDefault();\n },\n [applyStep]\n );\n\n const handleUpClick = React.useCallback(\n (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n applyStep(true);\n event.preventDefault();\n },\n [applyStep]\n );\n\n const handleFocus = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n event.currentTarget.select();\n },\n []\n );\n\n const isDisabled = !!otherProps.disabled;\n const containerClasses = classnames(\n \"core-number-input-container\",\n containerClassName,\n showTouchButtons && \"core-number-buttons-for-touch\",\n isDisabled && \"core-number-input-disabled\"\n );\n\n const caretUp = showTouchButtons ? <SvgCaretUp /> : <SvgCaretUpSmall />;\n const caretDown = showTouchButtons ? <SvgCaretDown /> : <SvgCaretDownSmall />;\n\n return (\n <div className={containerClasses} style={containerStyle}>\n <Input\n ref={ref}\n value={formattedValue}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n onBlur={handleBlur}\n size=\"small\"\n className={classnames(\"core-input\", className)}\n {...otherProps}\n />\n <div\n className={classnames(\n \"core-number-input-buttons-container\",\n showTouchButtons && \"core-number-buttons-for-touch\"\n )}\n >\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n className=\"core-number-input-button core-number-input-button-up\"\n tabIndex={-1}\n onClick={handleUpClick}\n role=\"presentation\"\n >\n <Icon iconSpec={caretUp} />\n </div>\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n className=\"core-number-input-button core-number-input-button-down\"\n tabIndex={-1}\n onClick={handleDownClick}\n role=\"presentation\"\n >\n <Icon iconSpec={caretDown} />\n </div>\n </div>\n </div>\n );\n});\n\n/** Input component for numbers with up and down buttons to increment and decrement the value.\n * @public\n * @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/input iTwinUI input} instead.\n */\nexport const NumberInput: (\n // eslint-disable-next-line deprecation/deprecation\n props: NumberInputProps\n) => React.ReactNode = ForwardRefNumberInput;\n"]}
|
|
1
|
+
{"version":3,"file":"NumberInput.js","sourceRoot":"","sources":["../../../../../src/core-react/inputs/numberinput/NumberInput.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,8BAA4B;AAC5B,2CAAoC;AACpC,+BAA+B;AAC/B,6CAAkC;AAClC,wDAA6C;AAC7C,6DAAiD;AACjD,oEAKoC;AAqDpC,MAAM,qBAAqB,GAAG,KAAK,CAAC,UAAU,CAG5C,SAAS,qBAAqB,CAAC,KAAK,EAAE,GAAG;IACzC,MAAM,EACJ,kBAAkB,EAClB,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,EACH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AE,OAAO,GAAI,CACvB;YAEN,6BACE,SAAS,EAAC,wDAAwD,EAClE,QAAQ,EAAE,CAAC,CAAC,EACZ,OAAO,EAAE,eAAe,EACxB,IAAI,EAAC,cAAc;gBAEnB,oBAAC,oBAAI,IAAC,QAAQ,EAAE,SAAS,GAAI,CACzB,CACF,CACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACU,QAAA,WAAW,GACtB,qBAAqB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Inputs\n */\n\nimport \"./NumberInput.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Key } from \"ts-key-enum\";\nimport { Input } from \"@itwin/itwinui-react\";\nimport { Icon } from \"../../icons/IconComponent\";\nimport {\n SvgCaretDown,\n SvgCaretDownSmall,\n SvgCaretUp,\n SvgCaretUpSmall,\n} from \"@itwin/itwinui-icons-react\";\n\n/* eslint-disable deprecation/deprecation */\n\ntype InputProps = React.ComponentPropsWithoutRef<typeof Input>;\n\n/** Step function prototype for [[NumberInput]] component\n * @public\n * @deprecated in 4.12.0. Interface used in a deprecated component {@link NumberInput}.\n */\nexport type StepFunctionProp =\n | number\n | ((direction: string) => number | undefined);\n\n/** Properties for the [[NumberInput]] component\n * @public\n * @deprecated in 4.12.0. Props of deprecated component {@link NumberInput}.\n */\nexport interface NumberInputProps\n extends Omit<InputProps, \"min\" | \"max\" | \"step\" | \"onChange\"> {\n /** Numeric value, set to `undefined` to show placeholder text */\n value?: number;\n /** CSS class name for the NumberInput component container div */\n containerClassName?: string;\n /** Style for component container div. */\n containerStyle?: React.CSSProperties;\n /** number or function\tNumber.MIN_SAFE_INTEGER */\n min?: number;\n /** number or function\tdefaults to Number.MAX_SAFE_INTEGER */\n max?: number;\n /** increment step value used while incrementing or decrementing (up/down buttons or arrow keys) defaults to 1. */\n step?: StepFunctionProp;\n /** number of decimal places, defaults to 0 */\n precision?: number;\n /** function parseFloat */\n parse?: (value: string) => number | null | undefined;\n /** function optional formatting function that takes the number value and the internal formatted value in case function just adds prefix or suffix. */\n format?: (num: number | null | undefined, formattedValue: string) => string;\n /** Set to true to \"snap\" to the closest step value while incrementing or decrementing (up/down buttons or arrow keys). */\n snap?: boolean;\n /** Function to call when value is changed. */\n onChange?: (value: number | undefined, stringValue: string) => void;\n /** if true up/down buttons are shown larger and side by side */\n showTouchButtons?: boolean;\n /** Provides ability to return reference to HTMLInputElement */\n ref?: React.Ref<HTMLInputElement>;\n /**\n * Makes this component behave as controlled component.\n * @internal\n */\n isControlled?: boolean;\n}\n\nconst ForwardRefNumberInput = React.forwardRef<\n HTMLInputElement,\n NumberInputProps\n>(function ForwardRefNumberInput(props, ref) {\n const {\n containerClassName,\n className,\n value,\n min,\n max,\n precision,\n format,\n parse,\n onChange,\n onBlur,\n onKeyDown,\n step,\n snap,\n showTouchButtons,\n containerStyle,\n isControlled,\n ...otherProps\n } = props;\n const currentValueRef = React.useRef(value);\n\n /**\n * Used internally to parse the argument x to it's numeric representation.\n * If the argument cannot be converted to finite number returns 0; If a\n * \"precision\" prop is specified uses it round the number with that\n * precision (no fixed precision here because the return value is float, not\n * string).\n */\n const parseInternal = React.useCallback(\n (x: string) => {\n let n: number | undefined | null;\n\n if (parse) n = parse(x);\n if (undefined === n || null === n) {\n n = parseFloat(x);\n if (isNaN(n) || !isFinite(n)) {\n n = 0;\n }\n }\n\n const localPrecision = undefined === precision ? 10 : precision;\n const q = Math.pow(10, localPrecision);\n const localMin = undefined === min ? Number.MIN_SAFE_INTEGER : min;\n const localMax = undefined === max ? Number.MAX_SAFE_INTEGER : max;\n n = Math.min(Math.max(n, localMin), localMax);\n n = Math.round(n * q) / q;\n\n return n;\n },\n [parse, precision, min, max]\n );\n\n /**\n * This is used internally to format a number to its display representation.\n * It will invoke the format function if one is provided.\n */\n const formatInternal = React.useCallback(\n (num: number | undefined | null) => {\n const localPrecision =\n undefined === precision || null === precision ? 0 : precision;\n const str =\n undefined === num || null === num ? \"\" : num.toFixed(localPrecision);\n\n if (format) return format(num, str);\n\n return str;\n },\n [format, precision]\n );\n\n const [formattedValue, setFormattedValue] = React.useState(() =>\n formatInternal(value)\n );\n\n // See if new initialValue props have changed since component mounted\n React.useEffect(() => {\n currentValueRef.current = value;\n const currentFormattedValue = formatInternal(currentValueRef.current);\n setFormattedValue(currentFormattedValue);\n }, [formatInternal, value]);\n\n const handleChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const newVal = event.currentTarget.value;\n setFormattedValue(newVal);\n isControlled && onChange && onChange(parseInternal(newVal), newVal);\n },\n [isControlled, onChange, parseInternal]\n );\n\n const updateValue = React.useCallback(\n (newVal: number) => {\n const newFormattedVal = formatInternal(newVal);\n onChange && onChange(newVal, newFormattedVal);\n setFormattedValue(newFormattedVal);\n },\n [onChange, formatInternal]\n );\n\n const updateValueFromString = React.useCallback(\n (strValue: string) => {\n const newVal = parseInternal(strValue);\n updateValue(newVal);\n },\n [parseInternal, updateValue]\n );\n\n const handleBlur = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n const newVal = parseInternal(event.target.value);\n onBlur && onBlur(event);\n updateValue(newVal);\n },\n [parseInternal, updateValue, onBlur]\n );\n\n const getIncrementValue = React.useCallback(\n (increment: boolean) => {\n if (typeof step === \"function\") {\n const stepVal = step(increment ? \"up\" : \"down\");\n return stepVal ? stepVal : 1;\n }\n\n return !step ? 1 : step;\n },\n [step]\n );\n\n /**\n * The internal method that actually sets the new value on the input\n */\n const applyStep = React.useCallback(\n (increment: boolean) => {\n const incrementValue = getIncrementValue(increment);\n\n let num =\n parseInternal(formattedValue) +\n (increment ? incrementValue : -incrementValue);\n if (snap) {\n num = Math.round(num / incrementValue) * incrementValue;\n }\n\n const localMin = undefined === min ? Number.MIN_SAFE_INTEGER : min;\n const localMax = undefined === max ? Number.MAX_SAFE_INTEGER : max;\n num = Math.min(Math.max(num, localMin), localMax);\n\n updateValue(num);\n },\n [\n formattedValue,\n getIncrementValue,\n max,\n min,\n parseInternal,\n snap,\n updateValue,\n ]\n );\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === Key.Enter.valueOf()) {\n updateValueFromString(event.currentTarget.value);\n event.preventDefault();\n event.stopPropagation();\n } else if (event.key === Key.Escape.valueOf()) {\n setFormattedValue(formatInternal(currentValueRef.current));\n event.preventDefault();\n } else if (event.key === Key.ArrowDown.valueOf()) {\n applyStep(false);\n event.preventDefault();\n event.stopPropagation();\n } else if (event.key === Key.ArrowUp.valueOf()) {\n applyStep(true);\n event.preventDefault();\n event.stopPropagation();\n }\n onKeyDown && onKeyDown(event);\n },\n [applyStep, formatInternal, updateValueFromString, onKeyDown]\n );\n\n const handleDownClick = React.useCallback(\n (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n applyStep(false);\n event.preventDefault();\n },\n [applyStep]\n );\n\n const handleUpClick = React.useCallback(\n (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n applyStep(true);\n event.preventDefault();\n },\n [applyStep]\n );\n\n const handleFocus = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n event.currentTarget.select();\n },\n []\n );\n\n const isDisabled = !!otherProps.disabled;\n const containerClasses = classnames(\n \"core-number-input-container\",\n containerClassName,\n showTouchButtons && \"core-number-buttons-for-touch\",\n isDisabled && \"core-number-input-disabled\"\n );\n\n const caretUp = showTouchButtons ? <SvgCaretUp /> : <SvgCaretUpSmall />;\n const caretDown = showTouchButtons ? <SvgCaretDown /> : <SvgCaretDownSmall />;\n\n return (\n <div className={containerClasses} style={containerStyle}>\n <Input\n ref={ref}\n value={formattedValue}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n onBlur={handleBlur}\n size=\"small\"\n className={classnames(\"core-input\", className)}\n {...otherProps}\n />\n <div\n className={classnames(\n \"core-number-input-buttons-container\",\n showTouchButtons && \"core-number-buttons-for-touch\"\n )}\n >\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n className=\"core-number-input-button core-number-input-button-up\"\n tabIndex={-1}\n onClick={handleUpClick}\n role=\"presentation\"\n >\n <Icon iconSpec={caretUp} />\n </div>\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n className=\"core-number-input-button core-number-input-button-down\"\n tabIndex={-1}\n onClick={handleDownClick}\n role=\"presentation\"\n >\n <Icon iconSpec={caretDown} />\n </div>\n </div>\n </div>\n );\n});\n\n/** Input component for numbers with up and down buttons to increment and decrement the value.\n * @public\n * @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/input iTwinUI input} instead.\n */\nexport const NumberInput: (props: NumberInputProps) => React.ReactNode =\n ForwardRefNumberInput;\n"]}
|
|
@@ -10,6 +10,7 @@ interface LocalizationProviderProps {
|
|
|
10
10
|
}
|
|
11
11
|
/** Provides localization capability to the components.
|
|
12
12
|
* @alpha
|
|
13
|
+
* @deprecated in 4.16.0. Use {@link @itwin/components-react#LocalizationProvider} instead.
|
|
13
14
|
*/
|
|
14
15
|
export declare function LocalizationProvider(props: LocalizationProviderProps): React.JSX.Element;
|
|
15
16
|
/** Returns localization context.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalizationProvider.d.ts","sourceRoot":"","sources":["../../../../src/core-react/l10n/LocalizationProvider.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3E,KAAK,YAAY,GAAG,IAAI,CACtB,gBAAgB,EAChB,oBAAoB,GAAG,mBAAmB,CAC3C,CAAC;AAMF,UAAU,yBAAyB;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED
|
|
1
|
+
{"version":3,"file":"LocalizationProvider.d.ts","sourceRoot":"","sources":["../../../../src/core-react/l10n/LocalizationProvider.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3E,KAAK,YAAY,GAAG,IAAI,CACtB,gBAAgB,EAChB,oBAAoB,GAAG,mBAAmB,CAC3C,CAAC;AAMF,UAAU,yBAAyB;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,qBAOpE;AAED;;GAEG;AACH,wBAAgB,eAAe,6BAG9B"}
|
|
@@ -12,6 +12,7 @@ const React = require("react");
|
|
|
12
12
|
const LocalizationContext = React.createContext(undefined);
|
|
13
13
|
/** Provides localization capability to the components.
|
|
14
14
|
* @alpha
|
|
15
|
+
* @deprecated in 4.16.0. Use {@link @itwin/components-react#LocalizationProvider} instead.
|
|
15
16
|
*/
|
|
16
17
|
function LocalizationProvider(props) {
|
|
17
18
|
const { children, localization } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalizationProvider.js","sourceRoot":"","sources":["../../../../src/core-react/l10n/LocalizationProvider.tsx"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG;;GAEG;AACH,+BAA+B;AAQ/B,MAAM,mBAAmB,GAAG,KAAK,CAAC,aAAa,CAC7C,SAAS,CACV,CAAC;AAOF
|
|
1
|
+
{"version":3,"file":"LocalizationProvider.js","sourceRoot":"","sources":["../../../../src/core-react/l10n/LocalizationProvider.tsx"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG;;GAEG;AACH,+BAA+B;AAQ/B,MAAM,mBAAmB,GAAG,KAAK,CAAC,aAAa,CAC7C,SAAS,CACV,CAAC;AAOF;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,KAAgC;IACnE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IACzC,OAAO,CACL,oBAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IAC9C,QAAQ,CACoB,CAChC,CAAC;AACJ,CAAC;AAPD,oDAOC;AAED;;GAEG;AACH,SAAgB,eAAe;IAC7B,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;IAC3D,OAAO,YAAY,CAAC;AACtB,CAAC;AAHD,0CAGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\nimport * as React from \"react\";\nimport type { Localization as CoreLocalization } from \"@itwin/core-common\";\n\ntype Localization = Pick<\n CoreLocalization,\n \"getLocalizedString\" | \"registerNamespace\"\n>;\n\nconst LocalizationContext = React.createContext<Localization | undefined>(\n undefined\n);\n\ninterface LocalizationProviderProps {\n children?: React.ReactNode;\n localization: Localization;\n}\n\n/** Provides localization capability to the components.\n * @alpha\n * @deprecated in 4.16.0. Use {@link @itwin/components-react#LocalizationProvider} instead.\n */\nexport function LocalizationProvider(props: LocalizationProviderProps) {\n const { children, localization } = props;\n return (\n <LocalizationContext.Provider value={localization}>\n {children}\n </LocalizationContext.Provider>\n );\n}\n\n/** Returns localization context.\n * @internal\n */\nexport function useLocalization() {\n const localization = React.useContext(LocalizationContext);\n return localization;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTranslation.d.ts","sourceRoot":"","sources":["../../../../src/core-react/l10n/useTranslation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTranslation.d.ts","sourceRoot":"","sources":["../../../../src/core-react/l10n/useTranslation.tsx"],"names":[],"mappings":"AAWA;;GAEG;AACH,wBAAgB,cAAc;;EAa7B"}
|
|
@@ -9,6 +9,7 @@ const defaults = require("../UiCore.json");
|
|
|
9
9
|
const React = require("react");
|
|
10
10
|
const UiCore_1 = require("../UiCore");
|
|
11
11
|
const usePackageTranslation_1 = require("./usePackageTranslation");
|
|
12
|
+
/* eslint-disable deprecation/deprecation */
|
|
12
13
|
/** Returns a translation function to localize package components.
|
|
13
14
|
* @internal
|
|
14
15
|
*/
|
|
@@ -17,7 +18,6 @@ function useTranslation() {
|
|
|
17
18
|
if (!UiCore_1.UiCore.initialized) {
|
|
18
19
|
return undefined;
|
|
19
20
|
}
|
|
20
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
21
21
|
return UiCore_1.UiCore.translate(key);
|
|
22
22
|
}, []);
|
|
23
23
|
return (0, usePackageTranslation_1.usePackageTranslation)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTranslation.js","sourceRoot":"","sources":["../../../../src/core-react/l10n/useTranslation.tsx"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG,2CAA2C;AAC3C,+BAA+B;AAC/B,sCAAmC;AACnC,mEAAgE;AAEhE;;GAEG;AACH,SAAgB,cAAc;IAC5B,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,GAAW,EAAE,EAAE;QACjD,IAAI,CAAC,eAAM,CAAC,WAAW,EAAE,CAAC;YACxB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,
|
|
1
|
+
{"version":3,"file":"useTranslation.js","sourceRoot":"","sources":["../../../../src/core-react/l10n/useTranslation.tsx"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG,2CAA2C;AAC3C,+BAA+B;AAC/B,sCAAmC;AACnC,mEAAgE;AAEhE,4CAA4C;AAE5C;;GAEG;AACH,SAAgB,cAAc;IAC5B,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,GAAW,EAAE,EAAE;QACjD,IAAI,CAAC,eAAM,CAAC,WAAW,EAAE,CAAC;YACxB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,eAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,IAAA,6CAAqB,EAAC;QAC3B,SAAS,EAAE,eAAM,CAAC,qBAAqB;QACvC,QAAQ;QACR,QAAQ;KACT,CAAC,CAAC;AACL,CAAC;AAbD,wCAaC","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 *--------------------------------------------------------------------------------------------*/\nimport * as defaults from \"../UiCore.json\";\nimport * as React from \"react\";\nimport { UiCore } from \"../UiCore\";\nimport { usePackageTranslation } from \"./usePackageTranslation\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Returns a translation function to localize package components.\n * @internal\n */\nexport function useTranslation() {\n const fallback = React.useCallback((key: string) => {\n if (!UiCore.initialized) {\n return undefined;\n }\n\n return UiCore.translate(key);\n }, []);\n return usePackageTranslation({\n namespace: UiCore.localizationNamespace,\n fallback,\n defaults,\n });\n}\n"]}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Listbox
|
|
3
|
+
*/
|
|
1
4
|
import * as React from "react";
|
|
2
5
|
import "./Listbox.scss";
|
|
3
6
|
/** Ideas borrowed from https://reacttraining.com/reach-ui/listbox */
|
|
4
7
|
/** `Listbox` value.
|
|
5
|
-
* @
|
|
8
|
+
* @public
|
|
6
9
|
* @deprecated in 4.12.0. Value used in a deprecated component {@link Listbox}.
|
|
7
10
|
*/
|
|
8
11
|
export type ListboxValue = string;
|
|
9
12
|
/** `Listbox` Props.
|
|
10
|
-
* @
|
|
13
|
+
* @public
|
|
11
14
|
* @deprecated in 4.12.0. Props of deprecated component {@link Listbox}.
|
|
12
15
|
*/
|
|
13
16
|
export interface ListboxProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement> {
|
|
@@ -18,7 +21,7 @@ export interface ListboxProps extends React.DetailedHTMLProps<React.HTMLAttribut
|
|
|
18
21
|
onListboxValueChange?: (newValue: ListboxValue, isControlOrCommandPressed?: boolean) => void;
|
|
19
22
|
}
|
|
20
23
|
/** `ListboxItem` Props.
|
|
21
|
-
* @
|
|
24
|
+
* @public
|
|
22
25
|
* @deprecated in 4.12.0. Props of deprecated component {@link ListboxItem}.
|
|
23
26
|
*/
|
|
24
27
|
export interface ListboxItemProps extends React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement> {
|
|
@@ -28,7 +31,7 @@ export interface ListboxItemProps extends React.DetailedHTMLProps<React.LiHTMLAt
|
|
|
28
31
|
disabled?: boolean;
|
|
29
32
|
}
|
|
30
33
|
/** `Listbox` Context.
|
|
31
|
-
* @
|
|
34
|
+
* @public
|
|
32
35
|
* @deprecated in 4.12.0. Props of deprecated context {@link ListboxContext}.
|
|
33
36
|
*/
|
|
34
37
|
export interface ListboxContextProps {
|
|
@@ -39,17 +42,17 @@ export interface ListboxContextProps {
|
|
|
39
42
|
listboxRef?: React.RefObject<HTMLUListElement>;
|
|
40
43
|
}
|
|
41
44
|
/** Context set up by listbox for use by `ListboxItems` .
|
|
42
|
-
* @
|
|
45
|
+
* @public
|
|
43
46
|
* @deprecated in 4.12.0. Context of deprecated component {@link Listbox}.
|
|
44
47
|
*/
|
|
45
48
|
export declare const ListboxContext: React.Context<ListboxContextProps>;
|
|
46
49
|
/** Single select `Listbox` component
|
|
47
|
-
* @
|
|
50
|
+
* @public
|
|
48
51
|
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/list iTwinUI list} instead.
|
|
49
52
|
*/
|
|
50
53
|
export declare function Listbox(props: ListboxProps): React.JSX.Element;
|
|
51
54
|
/** `ListboxItem` component.
|
|
52
|
-
* @
|
|
55
|
+
* @public
|
|
53
56
|
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/list iTwinUI list} instead.
|
|
54
57
|
*/
|
|
55
58
|
export declare function ListboxItem(props: ListboxItemProps): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Listbox.d.ts","sourceRoot":"","sources":["../../../../src/core-react/listbox/Listbox.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,gBAAgB,CAAC;AAGxB,sEAAsE;AAItE;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC;;;GAGG;AACH,MAAM,WAAW,YACf,SAAQ,KAAK,CAAC,iBAAiB,CAC7B,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,EACtC,gBAAgB,CACjB;IACD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,oBAAoB,CAAC,EAAE,CACrB,QAAQ,EAAE,YAAY,EACtB,yBAAyB,CAAC,EAAE,OAAO,KAChC,IAAI,CAAC;CACX;AAED;;;GAGG;AACH,MAAM,WAAW,gBACf,SAAQ,KAAK,CAAC,iBAAiB,CAC7B,KAAK,CAAC,gBAAgB,CAAC,aAAa,CAAC,EACrC,aAAa,CACd;IACD,+BAA+B;IAC/B,KAAK,EAAE,YAAY,CAAC;IACpB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,UAAU,CA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C;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,oBAAoB,EAAE,CACpB,QAAQ,EAAE,YAAY,EACtB,yBAAyB,CAAC,EAAE,OAAO,KAChC,IAAI,CAAC;IACV,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;CAChD;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,oCAEzB,CAAC;AA4DH;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,qBAoM1C;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,qBAwDlD"}
|
|
@@ -5,13 +5,16 @@ exports.ListboxItem = exports.Listbox = exports.ListboxContext = void 0;
|
|
|
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.
|
|
7
7
|
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
/** @packageDocumentation
|
|
9
|
+
* @module Listbox
|
|
10
|
+
*/
|
|
8
11
|
const React = require("react");
|
|
9
12
|
const classnames_1 = require("classnames");
|
|
10
13
|
const ts_key_enum_1 = require("ts-key-enum");
|
|
11
14
|
require("./Listbox.scss");
|
|
12
15
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
13
16
|
/** Context set up by listbox for use by `ListboxItems` .
|
|
14
|
-
* @
|
|
17
|
+
* @public
|
|
15
18
|
* @deprecated in 4.12.0. Context of deprecated component {@link Listbox}.
|
|
16
19
|
*/
|
|
17
20
|
exports.ListboxContext = React.createContext({
|
|
@@ -68,7 +71,7 @@ function processKeyboardNavigation(optionValues, itemIndex, key) {
|
|
|
68
71
|
return [newIndex, keyProcessed];
|
|
69
72
|
}
|
|
70
73
|
/** Single select `Listbox` component
|
|
71
|
-
* @
|
|
74
|
+
* @public
|
|
72
75
|
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/list iTwinUI list} instead.
|
|
73
76
|
*/
|
|
74
77
|
function Listbox(props) {
|
|
@@ -185,7 +188,7 @@ function Listbox(props) {
|
|
|
185
188
|
}
|
|
186
189
|
exports.Listbox = Listbox;
|
|
187
190
|
/** `ListboxItem` component.
|
|
188
|
-
* @
|
|
191
|
+
* @public
|
|
189
192
|
* @deprecated in 4.12.0. Use {@link https://itwinui.bentley.com/docs/list iTwinUI list} instead.
|
|
190
193
|
*/
|
|
191
194
|
function ListboxItem(props) {
|