@itwin/appui-react 4.10.0-dev.1 → 4.10.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 +11 -1
- package/lib/cjs/appui-react/accudraw/AccuDrawInputField.js +2 -2
- package/lib/cjs/appui-react/accudraw/AccuDrawInputField.js.map +1 -1
- package/lib/cjs/appui-react/accudraw/Calculator.js +9 -9
- package/lib/cjs/appui-react/accudraw/Calculator.js.map +1 -1
- package/lib/cjs/appui-react/content/ContentGroup.d.ts.map +1 -1
- package/lib/cjs/appui-react/content/ContentGroup.js +2 -2
- package/lib/cjs/appui-react/content/ContentGroup.js.map +1 -1
- package/lib/cjs/appui-react/content/IModelViewport.d.ts.map +1 -1
- package/lib/cjs/appui-react/content/IModelViewport.js +2 -2
- package/lib/cjs/appui-react/content/IModelViewport.js.map +1 -1
- package/lib/cjs/appui-react/feedback/ValidationTextbox.js +2 -2
- package/lib/cjs/appui-react/feedback/ValidationTextbox.js.map +1 -1
- package/lib/cjs/appui-react/hooks/useEscapeSetFocusToHome.js +1 -1
- package/lib/cjs/appui-react/hooks/useEscapeSetFocusToHome.js.map +1 -1
- package/lib/cjs/appui-react/keyboardshortcut/KeyboardShortcut.js.map +1 -1
- package/lib/cjs/appui-react/{layout/widget-panels/CenterContent.scss → layers.scss} +6 -2
- package/lib/cjs/appui-react/layout/StandardLayout.d.ts +24 -0
- package/lib/cjs/appui-react/layout/StandardLayout.d.ts.map +1 -0
- package/lib/cjs/appui-react/layout/StandardLayout.js +56 -0
- package/lib/cjs/appui-react/layout/StandardLayout.js.map +1 -0
- package/lib/cjs/appui-react/layout/StandardLayout.scss +94 -0
- package/lib/cjs/appui-react/layout/backstage/Backstage.js +1 -1
- package/lib/cjs/appui-react/layout/backstage/Backstage.js.map +1 -1
- package/lib/cjs/appui-react/layout/base/SafeAreaInsets.js +4 -4
- package/lib/cjs/appui-react/layout/base/SafeAreaInsets.js.map +1 -1
- package/lib/cjs/appui-react/layout/outline/PanelOutline.scss +1 -10
- package/lib/cjs/appui-react/layout/state/internal/PanelStateHelpers.d.ts.map +1 -1
- package/lib/cjs/appui-react/layout/state/internal/PanelStateHelpers.js +1 -0
- package/lib/cjs/appui-react/layout/state/internal/PanelStateHelpers.js.map +1 -1
- package/lib/cjs/appui-react/layout/state/internal/TabStateHelpers.d.ts.map +1 -1
- package/lib/cjs/appui-react/layout/state/internal/TabStateHelpers.js +5 -0
- package/lib/cjs/appui-react/layout/state/internal/TabStateHelpers.js.map +1 -1
- package/lib/cjs/appui-react/layout/state/internal/ToolSettingsStateHelpers.d.ts.map +1 -1
- package/lib/cjs/appui-react/layout/state/internal/ToolSettingsStateHelpers.js +6 -0
- package/lib/cjs/appui-react/layout/state/internal/ToolSettingsStateHelpers.js.map +1 -1
- package/lib/cjs/appui-react/layout/state/internal/WidgetStateHelpers.d.ts.map +1 -1
- package/lib/cjs/appui-react/layout/state/internal/WidgetStateHelpers.js +2 -0
- package/lib/cjs/appui-react/layout/state/internal/WidgetStateHelpers.js.map +1 -1
- package/lib/cjs/appui-react/layout/target/PanelTargets.scss +2 -0
- package/lib/cjs/appui-react/layout/tool-settings/Docked.d.ts +12 -6
- package/lib/cjs/appui-react/layout/tool-settings/Docked.d.ts.map +1 -1
- package/lib/cjs/appui-react/layout/tool-settings/Docked.js +52 -21
- package/lib/cjs/appui-react/layout/tool-settings/Docked.js.map +1 -1
- package/lib/cjs/appui-react/layout/tool-settings/Docked.scss +15 -23
- package/lib/cjs/appui-react/layout/tool-settings/Handle.d.ts.map +1 -1
- package/lib/cjs/appui-react/layout/tool-settings/Handle.js +3 -1
- package/lib/cjs/appui-react/layout/tool-settings/Handle.js.map +1 -1
- package/lib/cjs/appui-react/layout/tool-settings/Handle.scss +6 -12
- package/lib/cjs/appui-react/layout/tool-settings/Overflow.d.ts.map +1 -1
- package/lib/cjs/appui-react/layout/tool-settings/Overflow.js +4 -5
- package/lib/cjs/appui-react/layout/tool-settings/Overflow.js.map +1 -1
- package/lib/cjs/appui-react/layout/tool-settings/Overflow.scss +0 -15
- package/lib/cjs/appui-react/layout/tool-settings/Setting.scss +1 -12
- package/lib/cjs/appui-react/layout/widget/Buttons.d.ts +4 -4
- package/lib/cjs/appui-react/layout/widget/Buttons.d.ts.map +1 -1
- package/lib/cjs/appui-react/layout/widget/Buttons.js +8 -31
- package/lib/cjs/appui-react/layout/widget/Buttons.js.map +1 -1
- package/lib/cjs/appui-react/layout/widget/ContentContainer.d.ts.map +1 -1
- package/lib/cjs/appui-react/layout/widget/ContentContainer.js +2 -0
- package/lib/cjs/appui-react/layout/widget/ContentContainer.js.map +1 -1
- package/lib/cjs/appui-react/layout/widget/ContentManager.d.ts +1 -1
- package/lib/cjs/appui-react/layout/widget/ContentManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/layout/widget/ContentManager.js +1 -1
- package/lib/cjs/appui-react/layout/widget/ContentManager.js.map +1 -1
- package/lib/cjs/appui-react/layout/widget/ContentRenderer.d.ts.map +1 -1
- package/lib/cjs/appui-react/layout/widget/ContentRenderer.js +6 -0
- package/lib/cjs/appui-react/layout/widget/ContentRenderer.js.map +1 -1
- package/lib/cjs/appui-react/layout/widget/Dock.d.ts +2 -0
- package/lib/cjs/appui-react/layout/widget/Dock.d.ts.map +1 -1
- package/lib/cjs/appui-react/layout/widget/Dock.js +10 -1
- package/lib/cjs/appui-react/layout/widget/Dock.js.map +1 -1
- package/lib/cjs/appui-react/layout/widget/FloatingWidget.d.ts.map +1 -1
- package/lib/cjs/appui-react/layout/widget/FloatingWidget.js +15 -17
- package/lib/cjs/appui-react/layout/widget/FloatingWidget.js.map +1 -1
- package/lib/cjs/appui-react/layout/widget/FloatingWidget.scss +92 -105
- package/lib/cjs/appui-react/layout/widget/PinToggle.d.ts +2 -0
- package/lib/cjs/appui-react/layout/widget/PinToggle.d.ts.map +1 -1
- package/lib/cjs/appui-react/layout/widget/PinToggle.js +10 -1
- package/lib/cjs/appui-react/layout/widget/PinToggle.js.map +1 -1
- package/lib/cjs/appui-react/layout/widget/SendBack.d.ts.map +1 -1
- package/lib/cjs/appui-react/layout/widget/SendBack.js +4 -5
- package/lib/cjs/appui-react/layout/widget/SendBack.js.map +1 -1
- package/lib/cjs/appui-react/layout/widget/Tab.d.ts.map +1 -1
- package/lib/cjs/appui-react/layout/widget/Tab.js +5 -10
- package/lib/cjs/appui-react/layout/widget/Tab.js.map +1 -1
- package/lib/cjs/appui-react/layout/widget/TabBar.d.ts.map +1 -1
- package/lib/cjs/appui-react/layout/widget/TabBar.js +4 -1
- package/lib/cjs/appui-react/layout/widget/TabBar.js.map +1 -1
- package/lib/cjs/appui-react/layout/widget/TabBar.scss +17 -19
- package/lib/cjs/appui-react/layout/widget/usePanelWidgetId.d.ts +8 -0
- package/lib/cjs/appui-react/layout/widget/usePanelWidgetId.d.ts.map +1 -0
- package/lib/cjs/appui-react/layout/widget/usePanelWidgetId.js +39 -0
- package/lib/cjs/appui-react/layout/widget/usePanelWidgetId.js.map +1 -0
- package/lib/cjs/appui-react/layout/widget-panels/Grip.d.ts +1 -1
- package/lib/cjs/appui-react/layout/widget-panels/Grip.d.ts.map +1 -1
- package/lib/cjs/appui-react/layout/widget-panels/Grip.js +4 -0
- package/lib/cjs/appui-react/layout/widget-panels/Grip.js.map +1 -1
- package/lib/cjs/appui-react/layout/widget-panels/Grip.scss +106 -104
- package/lib/cjs/appui-react/layout/widget-panels/Panel.d.ts +1 -1
- package/lib/cjs/appui-react/layout/widget-panels/Panel.d.ts.map +1 -1
- package/lib/cjs/appui-react/layout/widget-panels/Panel.js +10 -16
- package/lib/cjs/appui-react/layout/widget-panels/Panel.js.map +1 -1
- package/lib/cjs/appui-react/layout/widget-panels/Panel.scss +175 -243
- package/lib/cjs/appui-react/layout/widget-panels/PanelSections.d.ts +1 -0
- package/lib/cjs/appui-react/layout/widget-panels/PanelSections.d.ts.map +1 -1
- package/lib/cjs/appui-react/layout/widget-panels/PanelSections.js +35 -31
- package/lib/cjs/appui-react/layout/widget-panels/PanelSections.js.map +1 -1
- package/lib/{esm/appui-react/layout/widget-panels/Panels.scss → cjs/appui-react/layout/widget-panels/PanelSections.scss} +1 -11
- package/lib/cjs/appui-react/layout/widget-panels/usePanelsAutoCollapse.d.ts +7 -0
- package/lib/cjs/appui-react/layout/widget-panels/usePanelsAutoCollapse.d.ts.map +1 -0
- package/lib/cjs/appui-react/layout/widget-panels/{AppContent.js → usePanelsAutoCollapse.js} +3 -26
- package/lib/cjs/appui-react/layout/widget-panels/usePanelsAutoCollapse.js.map +1 -0
- package/lib/cjs/appui-react/messages/MessageManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/messages/MessageManager.js +0 -1
- package/lib/cjs/appui-react/messages/MessageManager.js.map +1 -1
- package/lib/cjs/appui-react/messages/getToastCategory.d.ts +1 -1
- package/lib/cjs/appui-react/navigationaids/StandardRotationNavigationAid.js +1 -1
- package/lib/cjs/appui-react/navigationaids/StandardRotationNavigationAid.js.map +1 -1
- package/lib/cjs/appui-react/popup/CardPopup.js +1 -1
- package/lib/cjs/appui-react/popup/CardPopup.js.map +1 -1
- package/lib/cjs/appui-react/popup/KeyinPalettePanel.d.ts.map +1 -1
- package/lib/cjs/appui-react/popup/KeyinPalettePanel.js +6 -4
- package/lib/cjs/appui-react/popup/KeyinPalettePanel.js.map +1 -1
- package/lib/cjs/appui-react/popup/KeyinPalettePopup.js +1 -1
- package/lib/cjs/appui-react/popup/KeyinPalettePopup.js.map +1 -1
- package/lib/cjs/appui-react/popup/ToolSettingsPopup.js +1 -1
- package/lib/cjs/appui-react/popup/ToolSettingsPopup.js.map +1 -1
- package/lib/cjs/appui-react/popup/ToolbarPopup.js +1 -1
- package/lib/cjs/appui-react/popup/ToolbarPopup.js.map +1 -1
- package/lib/cjs/appui-react/preview/PreviewFeatures.d.ts +6 -1
- package/lib/cjs/appui-react/preview/PreviewFeatures.d.ts.map +1 -1
- package/lib/cjs/appui-react/preview/PreviewFeatures.js +1 -0
- package/lib/cjs/appui-react/preview/PreviewFeatures.js.map +1 -1
- package/lib/cjs/appui-react/preview/enable-maximized-widget/MaximizeToggle.d.ts +9 -0
- package/lib/cjs/appui-react/preview/enable-maximized-widget/MaximizeToggle.d.ts.map +1 -0
- package/lib/cjs/appui-react/preview/enable-maximized-widget/MaximizeToggle.js +51 -0
- package/lib/cjs/appui-react/preview/enable-maximized-widget/MaximizeToggle.js.map +1 -0
- package/lib/cjs/appui-react/preview/enable-maximized-widget/MaximizedWidget.d.ts +18 -0
- package/lib/cjs/appui-react/preview/enable-maximized-widget/MaximizedWidget.d.ts.map +1 -0
- package/lib/cjs/appui-react/preview/enable-maximized-widget/MaximizedWidget.js +27 -0
- package/lib/cjs/appui-react/preview/enable-maximized-widget/MaximizedWidget.js.map +1 -0
- package/lib/cjs/appui-react/preview/enable-maximized-widget/useMaximizedWidget.d.ts +50 -0
- package/lib/cjs/appui-react/preview/enable-maximized-widget/useMaximizedWidget.d.ts.map +1 -0
- package/lib/cjs/appui-react/preview/enable-maximized-widget/useMaximizedWidget.js +115 -0
- package/lib/cjs/appui-react/preview/enable-maximized-widget/useMaximizedWidget.js.map +1 -0
- package/lib/cjs/appui-react/preview/enable-maximized-widget/useMaximizedWidget.scss +36 -0
- package/lib/cjs/appui-react/{layout/widget → preview/horizontal-panel-alignment}/PreviewHorizontalPanelAlign.d.ts +4 -6
- package/lib/cjs/appui-react/preview/horizontal-panel-alignment/PreviewHorizontalPanelAlign.d.ts.map +1 -0
- package/lib/cjs/appui-react/{layout/widget → preview/horizontal-panel-alignment}/PreviewHorizontalPanelAlign.js +17 -21
- package/lib/cjs/appui-react/preview/horizontal-panel-alignment/PreviewHorizontalPanelAlign.js.map +1 -0
- package/lib/cjs/appui-react/preview/horizontal-panel-alignment/useHorizontalPanelAlignment.d.ts +19 -0
- package/lib/cjs/appui-react/preview/horizontal-panel-alignment/useHorizontalPanelAlignment.d.ts.map +1 -0
- package/lib/cjs/appui-react/preview/horizontal-panel-alignment/useHorizontalPanelAlignment.js +30 -0
- package/lib/cjs/appui-react/preview/horizontal-panel-alignment/useHorizontalPanelAlignment.js.map +1 -0
- package/lib/cjs/appui-react/preview/horizontal-panel-alignment/useHorizontalPanelAlignment.scss +49 -0
- package/lib/cjs/appui-react/preview/widget-action-dropdown/Button.d.ts +1 -1
- package/lib/cjs/appui-react/preview/widget-action-dropdown/Button.js +1 -1
- package/lib/cjs/appui-react/preview/widget-action-dropdown/Button.js.map +1 -1
- package/lib/cjs/appui-react/preview/widget-action-dropdown/MoreButton.d.ts +3 -2
- package/lib/cjs/appui-react/preview/widget-action-dropdown/MoreButton.d.ts.map +1 -1
- package/lib/cjs/appui-react/preview/widget-action-dropdown/MoreButton.js +5 -5
- package/lib/cjs/appui-react/preview/widget-action-dropdown/MoreButton.js.map +1 -1
- package/lib/cjs/appui-react/redux/SessionState.d.ts +2 -2
- package/lib/cjs/appui-react/redux/SessionState.d.ts.map +1 -1
- package/lib/cjs/appui-react/redux/SessionState.js.map +1 -1
- package/lib/cjs/appui-react/statusbar/StatusBarComposer.js +1 -1
- package/lib/cjs/appui-react/statusbar/StatusBarComposer.js.map +1 -1
- package/lib/cjs/appui-react/statusbar/StatusBarItem.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/ActivityCenter.d.ts.map +1 -1
- package/lib/cjs/appui-react/statusfields/ActivityCenter.js +1 -0
- package/lib/cjs/appui-react/statusfields/ActivityCenter.js.map +1 -1
- package/lib/cjs/appui-react/tools/FrameworkToolAdmin.d.ts.map +1 -1
- package/lib/cjs/appui-react/tools/FrameworkToolAdmin.js +2 -1
- package/lib/cjs/appui-react/tools/FrameworkToolAdmin.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/BaseUiItemsProvider.js +3 -3
- package/lib/cjs/appui-react/ui-items-provider/BaseUiItemsProvider.js.map +1 -1
- package/lib/cjs/appui-react/uiprovider/DefaultDialogGridContainer.scss +0 -7
- package/lib/cjs/appui-react/utils/matchesWords.js +4 -4
- package/lib/cjs/appui-react/utils/matchesWords.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.js +13 -16
- package/lib/cjs/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.scss +0 -23
- package/lib/cjs/appui-react/widget-panels/ToolSettings.scss +0 -6
- package/lib/cjs/appui-react/widgets/WidgetDef.d.ts +1 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/cjs/appui-react.d.ts +1 -0
- package/lib/cjs/appui-react.d.ts.map +1 -1
- package/lib/cjs/appui-react.js +1 -0
- package/lib/cjs/appui-react.js.map +1 -1
- package/lib/esm/appui-react/accudraw/AccuDrawInputField.js +2 -2
- package/lib/esm/appui-react/accudraw/AccuDrawInputField.js.map +1 -1
- package/lib/esm/appui-react/accudraw/Calculator.js +9 -9
- package/lib/esm/appui-react/accudraw/Calculator.js.map +1 -1
- package/lib/esm/appui-react/content/ContentGroup.d.ts.map +1 -1
- package/lib/esm/appui-react/content/ContentGroup.js +2 -2
- package/lib/esm/appui-react/content/ContentGroup.js.map +1 -1
- package/lib/esm/appui-react/content/IModelViewport.d.ts.map +1 -1
- package/lib/esm/appui-react/content/IModelViewport.js +2 -2
- package/lib/esm/appui-react/content/IModelViewport.js.map +1 -1
- package/lib/esm/appui-react/feedback/ValidationTextbox.js +2 -2
- package/lib/esm/appui-react/feedback/ValidationTextbox.js.map +1 -1
- package/lib/esm/appui-react/hooks/useEscapeSetFocusToHome.js +1 -1
- package/lib/esm/appui-react/hooks/useEscapeSetFocusToHome.js.map +1 -1
- package/lib/esm/appui-react/keyboardshortcut/KeyboardShortcut.js.map +1 -1
- package/lib/esm/appui-react/{layout/widget-panels/CenterContent.scss → layers.scss} +6 -2
- package/lib/esm/appui-react/layout/StandardLayout.d.ts +24 -0
- package/lib/esm/appui-react/layout/StandardLayout.d.ts.map +1 -0
- package/lib/esm/appui-react/layout/StandardLayout.js +52 -0
- package/lib/esm/appui-react/layout/StandardLayout.js.map +1 -0
- package/lib/esm/appui-react/layout/StandardLayout.scss +94 -0
- package/lib/esm/appui-react/layout/backstage/Backstage.js +1 -1
- package/lib/esm/appui-react/layout/backstage/Backstage.js.map +1 -1
- package/lib/esm/appui-react/layout/base/SafeAreaInsets.js +4 -4
- package/lib/esm/appui-react/layout/base/SafeAreaInsets.js.map +1 -1
- package/lib/esm/appui-react/layout/outline/PanelOutline.scss +1 -10
- package/lib/esm/appui-react/layout/state/internal/PanelStateHelpers.d.ts.map +1 -1
- package/lib/esm/appui-react/layout/state/internal/PanelStateHelpers.js +1 -0
- package/lib/esm/appui-react/layout/state/internal/PanelStateHelpers.js.map +1 -1
- package/lib/esm/appui-react/layout/state/internal/TabStateHelpers.d.ts.map +1 -1
- package/lib/esm/appui-react/layout/state/internal/TabStateHelpers.js +5 -0
- package/lib/esm/appui-react/layout/state/internal/TabStateHelpers.js.map +1 -1
- package/lib/esm/appui-react/layout/state/internal/ToolSettingsStateHelpers.d.ts.map +1 -1
- package/lib/esm/appui-react/layout/state/internal/ToolSettingsStateHelpers.js +6 -0
- package/lib/esm/appui-react/layout/state/internal/ToolSettingsStateHelpers.js.map +1 -1
- package/lib/esm/appui-react/layout/state/internal/WidgetStateHelpers.d.ts.map +1 -1
- package/lib/esm/appui-react/layout/state/internal/WidgetStateHelpers.js +2 -0
- package/lib/esm/appui-react/layout/state/internal/WidgetStateHelpers.js.map +1 -1
- package/lib/esm/appui-react/layout/target/PanelTargets.scss +2 -0
- package/lib/esm/appui-react/layout/tool-settings/Docked.d.ts +12 -6
- package/lib/esm/appui-react/layout/tool-settings/Docked.d.ts.map +1 -1
- package/lib/esm/appui-react/layout/tool-settings/Docked.js +53 -22
- package/lib/esm/appui-react/layout/tool-settings/Docked.js.map +1 -1
- package/lib/esm/appui-react/layout/tool-settings/Docked.scss +15 -23
- package/lib/esm/appui-react/layout/tool-settings/Handle.d.ts.map +1 -1
- package/lib/esm/appui-react/layout/tool-settings/Handle.js +3 -1
- package/lib/esm/appui-react/layout/tool-settings/Handle.js.map +1 -1
- package/lib/esm/appui-react/layout/tool-settings/Handle.scss +6 -12
- package/lib/esm/appui-react/layout/tool-settings/Overflow.d.ts.map +1 -1
- package/lib/esm/appui-react/layout/tool-settings/Overflow.js +4 -5
- package/lib/esm/appui-react/layout/tool-settings/Overflow.js.map +1 -1
- package/lib/esm/appui-react/layout/tool-settings/Overflow.scss +0 -15
- package/lib/esm/appui-react/layout/tool-settings/Setting.scss +1 -12
- package/lib/esm/appui-react/layout/widget/Buttons.d.ts +4 -4
- package/lib/esm/appui-react/layout/widget/Buttons.d.ts.map +1 -1
- package/lib/esm/appui-react/layout/widget/Buttons.js +8 -30
- package/lib/esm/appui-react/layout/widget/Buttons.js.map +1 -1
- package/lib/esm/appui-react/layout/widget/ContentContainer.d.ts.map +1 -1
- package/lib/esm/appui-react/layout/widget/ContentContainer.js +2 -0
- package/lib/esm/appui-react/layout/widget/ContentContainer.js.map +1 -1
- package/lib/esm/appui-react/layout/widget/ContentManager.d.ts +1 -1
- package/lib/esm/appui-react/layout/widget/ContentManager.d.ts.map +1 -1
- package/lib/esm/appui-react/layout/widget/ContentManager.js +1 -1
- package/lib/esm/appui-react/layout/widget/ContentManager.js.map +1 -1
- package/lib/esm/appui-react/layout/widget/ContentRenderer.d.ts.map +1 -1
- package/lib/esm/appui-react/layout/widget/ContentRenderer.js +6 -0
- package/lib/esm/appui-react/layout/widget/ContentRenderer.js.map +1 -1
- package/lib/esm/appui-react/layout/widget/Dock.d.ts +2 -0
- package/lib/esm/appui-react/layout/widget/Dock.d.ts.map +1 -1
- package/lib/esm/appui-react/layout/widget/Dock.js +8 -0
- package/lib/esm/appui-react/layout/widget/Dock.js.map +1 -1
- package/lib/esm/appui-react/layout/widget/FloatingWidget.d.ts.map +1 -1
- package/lib/esm/appui-react/layout/widget/FloatingWidget.js +15 -17
- package/lib/esm/appui-react/layout/widget/FloatingWidget.js.map +1 -1
- package/lib/esm/appui-react/layout/widget/FloatingWidget.scss +92 -105
- package/lib/esm/appui-react/layout/widget/PinToggle.d.ts +2 -0
- package/lib/esm/appui-react/layout/widget/PinToggle.d.ts.map +1 -1
- package/lib/esm/appui-react/layout/widget/PinToggle.js +8 -0
- package/lib/esm/appui-react/layout/widget/PinToggle.js.map +1 -1
- package/lib/esm/appui-react/layout/widget/SendBack.d.ts.map +1 -1
- package/lib/esm/appui-react/layout/widget/SendBack.js +4 -5
- package/lib/esm/appui-react/layout/widget/SendBack.js.map +1 -1
- package/lib/esm/appui-react/layout/widget/Tab.d.ts.map +1 -1
- package/lib/esm/appui-react/layout/widget/Tab.js +5 -10
- package/lib/esm/appui-react/layout/widget/Tab.js.map +1 -1
- package/lib/esm/appui-react/layout/widget/TabBar.d.ts.map +1 -1
- package/lib/esm/appui-react/layout/widget/TabBar.js +4 -1
- package/lib/esm/appui-react/layout/widget/TabBar.js.map +1 -1
- package/lib/esm/appui-react/layout/widget/TabBar.scss +17 -19
- package/lib/esm/appui-react/layout/widget/usePanelWidgetId.d.ts +8 -0
- package/lib/esm/appui-react/layout/widget/usePanelWidgetId.d.ts.map +1 -0
- package/lib/esm/appui-react/layout/widget/usePanelWidgetId.js +34 -0
- package/lib/esm/appui-react/layout/widget/usePanelWidgetId.js.map +1 -0
- package/lib/esm/appui-react/layout/widget-panels/Grip.d.ts +1 -1
- package/lib/esm/appui-react/layout/widget-panels/Grip.d.ts.map +1 -1
- package/lib/esm/appui-react/layout/widget-panels/Grip.js +4 -0
- package/lib/esm/appui-react/layout/widget-panels/Grip.js.map +1 -1
- package/lib/esm/appui-react/layout/widget-panels/Grip.scss +106 -104
- package/lib/esm/appui-react/layout/widget-panels/Panel.d.ts +1 -1
- package/lib/esm/appui-react/layout/widget-panels/Panel.d.ts.map +1 -1
- package/lib/esm/appui-react/layout/widget-panels/Panel.js +10 -16
- package/lib/esm/appui-react/layout/widget-panels/Panel.js.map +1 -1
- package/lib/esm/appui-react/layout/widget-panels/Panel.scss +175 -243
- package/lib/esm/appui-react/layout/widget-panels/PanelSections.d.ts +1 -0
- package/lib/esm/appui-react/layout/widget-panels/PanelSections.d.ts.map +1 -1
- package/lib/esm/appui-react/layout/widget-panels/PanelSections.js +34 -30
- package/lib/esm/appui-react/layout/widget-panels/PanelSections.js.map +1 -1
- package/lib/{cjs/appui-react/layout/widget-panels/Panels.scss → esm/appui-react/layout/widget-panels/PanelSections.scss} +1 -11
- package/lib/esm/appui-react/layout/widget-panels/usePanelsAutoCollapse.d.ts +7 -0
- package/lib/esm/appui-react/layout/widget-panels/usePanelsAutoCollapse.d.ts.map +1 -0
- package/lib/esm/appui-react/layout/widget-panels/{AppContent.js → usePanelsAutoCollapse.js} +3 -25
- package/lib/esm/appui-react/layout/widget-panels/usePanelsAutoCollapse.js.map +1 -0
- package/lib/esm/appui-react/messages/MessageManager.d.ts.map +1 -1
- package/lib/esm/appui-react/messages/MessageManager.js +0 -1
- package/lib/esm/appui-react/messages/MessageManager.js.map +1 -1
- package/lib/esm/appui-react/messages/getToastCategory.d.ts +1 -1
- package/lib/esm/appui-react/navigationaids/StandardRotationNavigationAid.js +1 -1
- package/lib/esm/appui-react/navigationaids/StandardRotationNavigationAid.js.map +1 -1
- package/lib/esm/appui-react/popup/CardPopup.js +1 -1
- package/lib/esm/appui-react/popup/CardPopup.js.map +1 -1
- package/lib/esm/appui-react/popup/KeyinPalettePanel.d.ts.map +1 -1
- package/lib/esm/appui-react/popup/KeyinPalettePanel.js +6 -4
- package/lib/esm/appui-react/popup/KeyinPalettePanel.js.map +1 -1
- package/lib/esm/appui-react/popup/KeyinPalettePopup.js +1 -1
- package/lib/esm/appui-react/popup/KeyinPalettePopup.js.map +1 -1
- package/lib/esm/appui-react/popup/ToolSettingsPopup.js +1 -1
- package/lib/esm/appui-react/popup/ToolSettingsPopup.js.map +1 -1
- package/lib/esm/appui-react/popup/ToolbarPopup.js +1 -1
- package/lib/esm/appui-react/popup/ToolbarPopup.js.map +1 -1
- package/lib/esm/appui-react/preview/PreviewFeatures.d.ts +6 -1
- package/lib/esm/appui-react/preview/PreviewFeatures.d.ts.map +1 -1
- package/lib/esm/appui-react/preview/PreviewFeatures.js +1 -0
- package/lib/esm/appui-react/preview/PreviewFeatures.js.map +1 -1
- package/lib/esm/appui-react/preview/enable-maximized-widget/MaximizeToggle.d.ts +9 -0
- package/lib/esm/appui-react/preview/enable-maximized-widget/MaximizeToggle.d.ts.map +1 -0
- package/lib/esm/appui-react/preview/enable-maximized-widget/MaximizeToggle.js +46 -0
- package/lib/esm/appui-react/preview/enable-maximized-widget/MaximizeToggle.js.map +1 -0
- package/lib/esm/appui-react/preview/enable-maximized-widget/MaximizedWidget.d.ts +18 -0
- package/lib/esm/appui-react/preview/enable-maximized-widget/MaximizedWidget.d.ts.map +1 -0
- package/lib/esm/appui-react/preview/enable-maximized-widget/MaximizedWidget.js +23 -0
- package/lib/esm/appui-react/preview/enable-maximized-widget/MaximizedWidget.js.map +1 -0
- package/lib/esm/appui-react/preview/enable-maximized-widget/useMaximizedWidget.d.ts +50 -0
- package/lib/esm/appui-react/preview/enable-maximized-widget/useMaximizedWidget.d.ts.map +1 -0
- package/lib/esm/appui-react/preview/enable-maximized-widget/useMaximizedWidget.js +106 -0
- package/lib/esm/appui-react/preview/enable-maximized-widget/useMaximizedWidget.js.map +1 -0
- package/lib/esm/appui-react/preview/enable-maximized-widget/useMaximizedWidget.scss +36 -0
- package/lib/esm/appui-react/{layout/widget → preview/horizontal-panel-alignment}/PreviewHorizontalPanelAlign.d.ts +4 -6
- package/lib/esm/appui-react/preview/horizontal-panel-alignment/PreviewHorizontalPanelAlign.d.ts.map +1 -0
- package/lib/esm/appui-react/{layout/widget → preview/horizontal-panel-alignment}/PreviewHorizontalPanelAlign.js +15 -18
- package/lib/esm/appui-react/preview/horizontal-panel-alignment/PreviewHorizontalPanelAlign.js.map +1 -0
- package/lib/esm/appui-react/preview/horizontal-panel-alignment/useHorizontalPanelAlignment.d.ts +19 -0
- package/lib/esm/appui-react/preview/horizontal-panel-alignment/useHorizontalPanelAlignment.d.ts.map +1 -0
- package/lib/esm/appui-react/preview/horizontal-panel-alignment/useHorizontalPanelAlignment.js +26 -0
- package/lib/esm/appui-react/preview/horizontal-panel-alignment/useHorizontalPanelAlignment.js.map +1 -0
- package/lib/esm/appui-react/preview/horizontal-panel-alignment/useHorizontalPanelAlignment.scss +49 -0
- package/lib/esm/appui-react/preview/widget-action-dropdown/Button.d.ts +1 -1
- package/lib/esm/appui-react/preview/widget-action-dropdown/Button.js +1 -1
- package/lib/esm/appui-react/preview/widget-action-dropdown/Button.js.map +1 -1
- package/lib/esm/appui-react/preview/widget-action-dropdown/MoreButton.d.ts +3 -2
- package/lib/esm/appui-react/preview/widget-action-dropdown/MoreButton.d.ts.map +1 -1
- package/lib/esm/appui-react/preview/widget-action-dropdown/MoreButton.js +5 -5
- package/lib/esm/appui-react/preview/widget-action-dropdown/MoreButton.js.map +1 -1
- package/lib/esm/appui-react/redux/SessionState.d.ts +2 -2
- package/lib/esm/appui-react/redux/SessionState.d.ts.map +1 -1
- package/lib/esm/appui-react/redux/SessionState.js.map +1 -1
- package/lib/esm/appui-react/statusbar/StatusBarComposer.js +1 -1
- package/lib/esm/appui-react/statusbar/StatusBarComposer.js.map +1 -1
- package/lib/esm/appui-react/statusbar/StatusBarItem.js.map +1 -1
- package/lib/esm/appui-react/statusfields/ActivityCenter.d.ts.map +1 -1
- package/lib/esm/appui-react/statusfields/ActivityCenter.js +1 -0
- package/lib/esm/appui-react/statusfields/ActivityCenter.js.map +1 -1
- package/lib/esm/appui-react/tools/FrameworkToolAdmin.d.ts.map +1 -1
- package/lib/esm/appui-react/tools/FrameworkToolAdmin.js +2 -1
- package/lib/esm/appui-react/tools/FrameworkToolAdmin.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/BaseUiItemsProvider.js +3 -3
- package/lib/esm/appui-react/ui-items-provider/BaseUiItemsProvider.js.map +1 -1
- package/lib/esm/appui-react/uiprovider/DefaultDialogGridContainer.scss +0 -7
- package/lib/esm/appui-react/utils/matchesWords.js +4 -4
- package/lib/esm/appui-react/utils/matchesWords.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.js +15 -18
- package/lib/esm/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.scss +0 -23
- package/lib/esm/appui-react/widget-panels/ToolSettings.scss +0 -6
- package/lib/esm/appui-react/widgets/WidgetDef.d.ts +1 -1
- package/lib/esm/appui-react/widgets/WidgetDef.d.ts.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/esm/appui-react.d.ts +1 -0
- package/lib/esm/appui-react.d.ts.map +1 -1
- package/lib/esm/appui-react.js +1 -0
- package/lib/esm/appui-react.js.map +1 -1
- package/lib/public/locales/en/UiFramework.json +1 -1
- package/package.json +19 -19
- package/lib/cjs/appui-react/layout/widget/PreviewHorizontalPanelAlign.d.ts.map +0 -1
- package/lib/cjs/appui-react/layout/widget/PreviewHorizontalPanelAlign.js.map +0 -1
- package/lib/cjs/appui-react/layout/widget/PreviewMaximizeToggle.d.ts +0 -30
- package/lib/cjs/appui-react/layout/widget/PreviewMaximizeToggle.d.ts.map +0 -1
- package/lib/cjs/appui-react/layout/widget/PreviewMaximizeToggle.js +0 -65
- package/lib/cjs/appui-react/layout/widget/PreviewMaximizeToggle.js.map +0 -1
- package/lib/cjs/appui-react/layout/widget-panels/AppContent.d.ts +0 -11
- package/lib/cjs/appui-react/layout/widget-panels/AppContent.d.ts.map +0 -1
- package/lib/cjs/appui-react/layout/widget-panels/AppContent.js.map +0 -1
- package/lib/cjs/appui-react/layout/widget-panels/CenterContent.d.ts +0 -10
- package/lib/cjs/appui-react/layout/widget-panels/CenterContent.d.ts.map +0 -1
- package/lib/cjs/appui-react/layout/widget-panels/CenterContent.js +0 -23
- package/lib/cjs/appui-react/layout/widget-panels/CenterContent.js.map +0 -1
- package/lib/cjs/appui-react/layout/widget-panels/Content.d.ts +0 -21
- package/lib/cjs/appui-react/layout/widget-panels/Content.d.ts.map +0 -1
- package/lib/cjs/appui-react/layout/widget-panels/Content.js +0 -21
- package/lib/cjs/appui-react/layout/widget-panels/Content.js.map +0 -1
- package/lib/cjs/appui-react/layout/widget-panels/Content.scss +0 -37
- package/lib/cjs/appui-react/layout/widget-panels/Panels.d.ts +0 -24
- package/lib/cjs/appui-react/layout/widget-panels/Panels.d.ts.map +0 -1
- package/lib/cjs/appui-react/layout/widget-panels/Panels.js +0 -48
- package/lib/cjs/appui-react/layout/widget-panels/Panels.js.map +0 -1
- package/lib/esm/appui-react/layout/widget/PreviewHorizontalPanelAlign.d.ts.map +0 -1
- package/lib/esm/appui-react/layout/widget/PreviewHorizontalPanelAlign.js.map +0 -1
- package/lib/esm/appui-react/layout/widget/PreviewMaximizeToggle.d.ts +0 -30
- package/lib/esm/appui-react/layout/widget/PreviewMaximizeToggle.d.ts.map +0 -1
- package/lib/esm/appui-react/layout/widget/PreviewMaximizeToggle.js +0 -58
- package/lib/esm/appui-react/layout/widget/PreviewMaximizeToggle.js.map +0 -1
- package/lib/esm/appui-react/layout/widget-panels/AppContent.d.ts +0 -11
- package/lib/esm/appui-react/layout/widget-panels/AppContent.d.ts.map +0 -1
- package/lib/esm/appui-react/layout/widget-panels/AppContent.js.map +0 -1
- package/lib/esm/appui-react/layout/widget-panels/CenterContent.d.ts +0 -10
- package/lib/esm/appui-react/layout/widget-panels/CenterContent.d.ts.map +0 -1
- package/lib/esm/appui-react/layout/widget-panels/CenterContent.js +0 -19
- package/lib/esm/appui-react/layout/widget-panels/CenterContent.js.map +0 -1
- package/lib/esm/appui-react/layout/widget-panels/Content.d.ts +0 -21
- package/lib/esm/appui-react/layout/widget-panels/Content.d.ts.map +0 -1
- package/lib/esm/appui-react/layout/widget-panels/Content.js +0 -18
- package/lib/esm/appui-react/layout/widget-panels/Content.js.map +0 -1
- package/lib/esm/appui-react/layout/widget-panels/Content.scss +0 -37
- package/lib/esm/appui-react/layout/widget-panels/Panels.d.ts +0 -24
- package/lib/esm/appui-react/layout/widget-panels/Panels.d.ts.map +0 -1
- package/lib/esm/appui-react/layout/widget-panels/Panels.js +0 -44
- package/lib/esm/appui-react/layout/widget-panels/Panels.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appui-react.js","sourceRoot":"","sources":["../../src/appui-react.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;;;;;;AAEhG,yIAAyI;AAEzI,4DAA0C,CAAC,+DAA+D;AAE1G,8EAA4D;AAC5D,wEAAsD;AACtD,mFAAiE;AACjE,8EAA4D;AAC5D,4EAA0D;AAC1D,wEAAsD;AACtD,oEAAkD;AAClD,0EAAwD;AACxD,yEAAuD;AACvD,2EAAyD;AACzD,oEAAkD;AAClD,yEAAuD;AAEvD,4EAA0D;AAC1D,gFAA8D;AAC9D,wEAAsD;AACtD,iFAA+D;AAC/D,2EAAyD;AACzD,mFAAiE;AACjE,2FAAyE;AAEzE,qFAAmE;AACnE,qFAAmE;AACnE,qEAAmD;AAEnD,uEAAqD;AACrD,qEAAmD;AACnD,sEAAoD;AACpD,gFAA8D;AAC9D,wEAAsD;AACtD,2EAAyD;AACzD,+EAA6D;AAC7D,uEAAqD;AACrD,2EAAyD;AACzD,6EAA2D;AAE3D,yEAAuD;AACvD,iFAA+D;AAC/D,+EAA6D;AAC7D,sFAAoE;AACpE,6EAA2D;AAE3D,yEAAuD;AACvD,0EAAwD;AACxD,4EAA0D;AAC1D,qEAAmD;AACnD,sEAAoD;AACpD,6EAA2D;AAC3D,0EAAwD;AACxD,4EAA0D;AAE1D,2EAAyD;AAC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jD,sEAAoD;AACpD,oEAAkD;AAClD,kEAAgD;AAEhD,6EAA2D;AAC3D,4EAA0D;AAC1D,yFAAuE;AAEvE;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n// cSpell:ignore safearea cursormenu clientservices oidc Textbox Modeless configurableui stagepanels dragdrop uiadmin itemsarbiter Popout\n\nexport * from \"./appui-react/UiFramework\"; // Please ensure that this line comes before all other exports.\n\nexport * from \"./appui-react/accudraw/AccuDrawCommandItems\";\nexport * from \"./appui-react/accudraw/AccuDrawDialog\";\nexport * from \"./appui-react/accudraw/AccuDrawKeyboardShortcuts\";\nexport * from \"./appui-react/accudraw/AccuDrawPopupManager\";\nexport * from \"./appui-react/accudraw/AccuDrawUiSettings\";\nexport * from \"./appui-react/accudraw/AccuDrawWidget\";\nexport * from \"./appui-react/accudraw/Calculator\";\nexport * from \"./appui-react/accudraw/CalculatorEngine\";\nexport * from \"./appui-react/accudraw/CalculatorPopup\";\nexport * from \"./appui-react/accudraw/FrameworkAccuDraw\";\nexport * from \"./appui-react/accudraw/MenuButton\";\nexport * from \"./appui-react/accudraw/MenuButtonPopup\";\n\nexport * from \"./appui-react/backstage/BackstageComposer\";\nexport * from \"./appui-react/backstage/BackstageComposerItem\";\nexport * from \"./appui-react/backstage/BackstageItem\";\nexport * from \"./appui-react/backstage/BackstageItemUtilities\";\nexport * from \"./appui-react/backstage/BackstageManager\";\nexport * from \"./appui-react/backstage/useDefaultBackstageItems\";\nexport * from \"./appui-react/backstage/useUiItemsProviderBackstageItems\";\n\nexport * from \"./appui-react/configurableui/ConfigurableUiContent\";\nexport * from \"./appui-react/configurableui/ConfigurableUiControl\";\nexport * from \"./appui-react/configurableui/state\";\n\nexport * from \"./appui-react/content/ContentControl\";\nexport * from \"./appui-react/content/ContentGroup\";\nexport * from \"./appui-react/content/ContentLayout\";\nexport * from \"./appui-react/content/FloatingViewportContent\";\nexport * from \"./appui-react/content/ViewStateHelper\";\nexport * from \"./appui-react/content/StageContentLayout\";\nexport * from \"./appui-react/content/ViewportContentControl\";\nexport * from \"./appui-react/content/IModelViewport\";\nexport * from \"./appui-react/content/DefaultViewOverlay\";\nexport * from \"./appui-react/content/split-pane/SplitPane\";\n\nexport * from \"./appui-react/cursor/CursorInformation\";\nexport * from \"./appui-react/cursor/cursorprompt/CursorPrompt\";\nexport * from \"./appui-react/cursor/cursorpopup/CursorPopup\";\nexport * from \"./appui-react/cursor/cursorpopup/CursorPopupManager\";\nexport * from \"./appui-react/cursor/cursormenu/CursorMenu\";\n\nexport * from \"./appui-react/dialog/DialogManagerBase\";\nexport * from \"./appui-react/dialog/ModalDialogManager\";\nexport * from \"./appui-react/dialog/ContentDialogManager\";\nexport * from \"./appui-react/dialog/ContentDialog\";\nexport * from \"./appui-react/dialog/ModelessDialog\";\nexport * from \"./appui-react/dialog/ModelessDialogManager\";\nexport * from \"./appui-react/dialog/StandardMessageBox\";\nexport * from \"./appui-react/dialog/UiDataProvidedDialog\";\n\nexport * from \"./appui-react/feedback/ValidationTextbox\";\nexport * from \"./appui-react/feedback/ElementTooltip\";\n\nexport * from \"./appui-react/framework/FrameworkBackstage\";\nexport * from \"./appui-react/framework/FrameworkChildWindows\";\nexport * from \"./appui-react/framework/FrameworkContent\";\nexport * from \"./appui-react/framework/FrameworkControls\";\nexport * from \"./appui-react/framework/FrameworkDialogs\";\nexport * from \"./appui-react/framework/FrameworkFrontstages\";\nexport * from \"./appui-react/framework/FrameworkKeyboardShortcuts\";\nexport * from \"./appui-react/framework/FrameworkToolSettings\";\nexport * from \"./appui-react/framework/FrameworkVisibility\";\n\nexport * from \"./appui-react/frontstage/FrontstageConfig\";\nexport * from \"./appui-react/frontstage/FrontstageDef\";\nexport * from \"./appui-react/frontstage/FrontstageProvider\";\nexport * from \"./appui-react/frontstage/ModalFrontstage\";\nexport * from \"./appui-react/frontstage/ModalSettingsStage\";\nexport * from \"./appui-react/frontstage/NestedFrontstage\";\nexport * from \"./appui-react/frontstage/StageUsage\";\nexport * from \"./appui-react/frontstage/StandardFrontstageProvider\";\n\nexport * from \"./appui-react/hooks/useActiveIModelConnection\";\nexport * from \"./appui-react/hooks/useActiveStageId\";\nexport * from \"./appui-react/hooks/useActiveViewport\";\nexport * from \"./appui-react/hooks/useAvailableUiItemsProviders\";\nexport * from \"./appui-react/hooks/useAnalysisAnimationDataProvider\";\nexport * from \"./appui-react/hooks/useScheduleAnimationDataProvider\";\nexport * from \"./appui-react/hooks/useSolarDataProvider\";\nexport * from \"./appui-react/hooks/useUiVisibility\";\n\nexport * from \"./appui-react/keyboardshortcut/KeyboardShortcut\";\nexport * from \"./appui-react/keyboardshortcut/KeyboardShortcutMenu\";\n\nexport * from \"./appui-react/messages/AppNotificationManager\";\nexport * from \"./appui-react/messages/InputField\";\nexport * from \"./appui-react/messages/MessageManager\";\nexport * from \"./appui-react/messages/Pointer\";\nexport * from \"./appui-react/messages/ReactNotifyMessageDetails\";\n\nexport * from \"./appui-react/navigationaids/CubeNavigationAidControl\";\nexport * from \"./appui-react/navigationaids/DrawingNavigationAidControl\";\nexport * from \"./appui-react/navigationaids/NavigationAidControl\";\nexport * from \"./appui-react/navigationaids/SheetNavigationAid\";\nexport * from \"./appui-react/navigationaids/SheetsModalFrontstage\";\nexport * from \"./appui-react/navigationaids/StandardRotationNavigationAid\";\n\nexport * from \"./appui-react/pickers/ListPicker\";\nexport * from \"./appui-react/pickers/ViewSelector\";\n\nexport * from \"./appui-react/popup/KeyinPalettePanel\";\nexport * from \"./appui-react/popup/KeyinPalettePopup\";\nexport * from \"./appui-react/popup/HTMLElementPopup\";\nexport * from \"./appui-react/popup/InputEditorPopup\";\nexport * from \"./appui-react/popup/PopupManager\";\nexport * from \"./appui-react/popup/PositionPopup\";\nexport * from \"./appui-react/popup/ToolbarPopup\";\n\nexport {\n PreviewFeatures,\n PreviewFeaturesProvider,\n PreviewFeaturesProviderProps,\n} from \"./appui-react/preview/PreviewFeatures\";\n\nexport * from \"./appui-react/redux/SessionState\";\nexport * from \"./appui-react/redux/StateManager\";\nexport * from \"./appui-react/redux/FrameworkState\";\nexport * from \"./appui-react/redux/connectIModel\";\nexport * from \"./appui-react/redux/ReducerRegistry\";\nexport * from \"./appui-react/redux/redux-ts\";\n\nexport * from \"./appui-react/safearea/SafeAreaContext\";\nexport * from \"./appui-react/safearea/SafeAreaInsets\";\n\nexport * from \"./appui-react/selection/SelectionContextItemDef\";\nexport * from \"./appui-react/selection/HideIsolateEmphasizeManager\";\n\nexport * from \"./appui-react/settings/ui/UiSettingsPage\";\nexport * from \"./appui-react/settings/quantityformatting/QuantityFormat\";\nexport * from \"./appui-react/settings/quantityformatting/UnitSystemSelector\";\n\nexport * from \"./appui-react/shared/ActionButtonItemDef\";\nexport * from \"./appui-react/shared/AnyItemDef\";\nexport * from \"./appui-react/shared/AnyToolbarItemDef\";\nexport * from \"./appui-react/shared/CommandItemDef\";\nexport * from \"./appui-react/shared/CustomItemDef\";\nexport * from \"./appui-react/shared/CustomItemProps\";\nexport * from \"./appui-react/shared/GroupItemProps\";\nexport * from \"./appui-react/shared/ItemDefBase\";\nexport * from \"./appui-react/shared/ItemMap\";\nexport * from \"./appui-react/shared/ItemProps\";\nexport * from \"./appui-react/shared/MenuItem\";\nexport * from \"./appui-react/shared/SelectionScope\";\nexport * from \"./appui-react/shared/ToolItemDef\";\n\nexport * from \"./appui-react/stagepanels/StagePanelConfig\";\nexport * from \"./appui-react/stagepanels/StagePanelDef\";\nexport * from \"./appui-react/stagepanels/StagePanelLocation\";\nexport * from \"./appui-react/stagepanels/StagePanelSection\";\nexport * from \"./appui-react/stagepanels/StagePanelState\";\n\nexport * from \"./appui-react/statusbar/dialog/Dialog\";\nexport * from \"./appui-react/statusbar/Indicator\";\nexport * from \"./appui-react/statusbar/LabelIndicator\";\nexport * from \"./appui-react/statusbar/Separator\";\nexport * from \"./appui-react/statusbar/StatusBar\";\nexport * from \"./appui-react/statusbar/StatusBarWidgetControl\";\nexport * from \"./appui-react/statusbar/StatusBarComposer\";\nexport * from \"./appui-react/statusbar/StatusBarItem\";\nexport * from \"./appui-react/statusbar/StatusBarItemUtilities\";\nexport * from \"./appui-react/statusbar/StatusBarComposer\";\nexport * from \"./appui-react/statusbar/useUiItemsProviderStatusBarItems\";\nexport * from \"./appui-react/statusbar/useDefaultStatusBarItems\";\n\nexport * from \"./appui-react/statusfields/tileloading/TileLoadingIndicator\";\nexport * from \"./appui-react/statusfields/ActivityCenter\";\nexport * from \"./appui-react/statusfields/MessageCenter\";\nexport * from \"./appui-react/statusfields/SectionsField\";\nexport * from \"./appui-react/statusfields/SelectionCount\";\nexport * from \"./appui-react/statusfields/SelectionInfo\";\nexport * from \"./appui-react/statusfields/SelectionScope\";\nexport * from \"./appui-react/statusfields/SnapMode\";\nexport * from \"./appui-react/statusfields/ViewAttributes\";\nexport * from \"./appui-react/statusfields/toolassistance/ToolAssistanceField\";\n\nexport * from \"./appui-react/syncui/SyncUiEventDispatcher\";\nexport * from \"./appui-react/syncui/UiSyncEvent\";\n\nexport * from \"./appui-react/theme/ThemeManager\";\n\nexport * from \"./appui-react/timeline/ScheduleAnimationProvider\";\nexport * from \"./appui-react/timeline/AnalysisAnimationProvider\";\nexport * from \"./appui-react/timeline/SolarTimelineDataProvider\";\n\nexport * from \"./appui-react/toolbar/DragInteraction\";\nexport * from \"./appui-react/toolbar/GroupItem\";\nexport * from \"./appui-react/toolbar/Toolbar\";\nexport * from \"./appui-react/toolbar/ToolbarComposer\";\nexport * from \"./appui-react/toolbar/ToolbarHelper\";\nexport * from \"./appui-react/toolbar/ToolbarItem\";\nexport * from \"./appui-react/toolbar/ToolbarItemUtilities\";\nexport * from \"./appui-react/toolbar/ToolbarWithOverflow\";\nexport * from \"./appui-react/toolbar/useDefaultToolbarItems\";\nexport * from \"./appui-react/toolbar/useUiItemsProviderToolbarItems\";\n\nexport * from \"./appui-react/tools/CoreToolDefinitions\";\nexport * from \"./appui-react/tools/FrameworkToolAdmin\";\nexport * from \"./appui-react/tools/RestoreLayoutTool\";\nexport * from \"./appui-react/tools/ToolSettingsTools\";\n\nexport * from \"./appui-react/ui-items-provider/BaseUiItemsProvider\";\nexport * from \"./appui-react/ui-items-provider/ProviderItem\";\nexport * from \"./appui-react/ui-items-provider/StandardContentToolsProvider\";\nexport * from \"./appui-react/ui-items-provider/StandardContentToolsUiItemsProvider\";\nexport * from \"./appui-react/ui-items-provider/StandardNavigationToolsProvider\";\nexport * from \"./appui-react/ui-items-provider/StandardNavigationToolsUiItemsProvider\";\nexport * from \"./appui-react/ui-items-provider/StandardStatusbarItemsProvider\";\nexport * from \"./appui-react/ui-items-provider/StandardStatusbarUiItemsProvider\";\nexport * from \"./appui-react/ui-items-provider/UiItemsManager\";\nexport * from \"./appui-react/ui-items-provider/UiItemsProvider\";\n\nexport * from \"./appui-react/uiadmin/FrameworkUiAdmin\";\n\nexport * from \"./appui-react/uiprovider/DefaultDialogGridContainer\";\n\nexport * from \"./appui-react/uistate/AppUiSettings\";\nexport * from \"./appui-react/uistate/useUiStateStorage\";\n\nexport * from \"./appui-react/utils/ViewUtilities\";\nexport * from \"./appui-react/utils/PropsHelper\";\nexport * from \"./appui-react/utils/ToolbarButtonHelper\";\n\nexport * from \"./appui-react/widget-panels/Content\";\nexport * from \"./appui-react/widget-panels/Frontstage\";\nexport * from \"./appui-react/widget-panels/FrontstageContent\";\nexport * from \"./appui-react/widget-panels/ModalFrontstageComposer\";\nexport * from \"./appui-react/widget-panels/StatusBar\";\nexport * from \"./appui-react/widget-panels/Tab\";\nexport * from \"./appui-react/widget-panels/Toolbars\";\nexport * from \"./appui-react/widget-panels/ToolSettings\";\nexport * from \"./appui-react/widget-panels/useWidgetDirection\";\nexport * from \"./appui-react/widget-panels/useTransientState\";\n\nexport * from \"./appui-react/widgets/BackstageAppButton\";\nexport * from \"./appui-react/widgets/BasicNavigationWidget\";\nexport * from \"./appui-react/widgets/BasicToolWidget\";\nexport * from \"./appui-react/widgets/ContentToolWidgetComposer\";\nexport * from \"./appui-react/widgets/NavigationWidgetComposer\";\nexport * from \"./appui-react/widgets/StableWidgetDef\";\nexport * from \"./appui-react/widgets/StatusBarWidgetComposerControl\";\nexport * from \"./appui-react/widgets/ToolWidgetComposer\";\nexport * from \"./appui-react/widgets/ViewToolWidgetComposer\";\nexport * from \"./appui-react/widgets/Widget\";\nexport * from \"./appui-react/widgets/WidgetConfig\";\nexport * from \"./appui-react/widgets/WidgetControl\";\nexport * from \"./appui-react/widgets/WidgetDef\";\nexport * from \"./appui-react/widgets/WidgetHost\";\nexport * from \"./appui-react/widgets/WidgetManager\";\nexport * from \"./appui-react/widgets/WidgetState\";\nexport * from \"./appui-react/widgets/useWidget\";\n\nexport * from \"./appui-react/toolsettings/ToolInformation\";\nexport * from \"./appui-react/toolsettings/ToolUiProvider\";\nexport * from \"./appui-react/toolsettings/DefaultToolSettingsProvider\";\n\n/** @docs-package-description\n * The ui-framework package contains classes and components for specifying the application UI consisting of the\n * Backstage, Frontstages, Content Views, Tool Bars, Status Bars, Widgets and Panels.\n * For more information, see [learning about appui-react]($docs/learning/ui/appui-react/index.md).\n */\n/**\n * @docs-group-description AccuDraw\n * Classes and components providing a UI for AccuDraw, an aide for entering coordinate data.\n */\n/**\n * @docs-group-description Admin\n * APIs for various UI components, such as toolbars, buttons and menus.\n */\n/**\n * @docs-group-description Backstage\n * Classes for working with a Backstage\n */\n/**\n * @docs-group-description ConfigurableUi\n * Classes for working with the Application UI Configuration\n */\n/**\n * @docs-group-description ContentView\n * Classes for working with a Content View, Group, Layout or Control\n */\n/**\n * @docs-group-description Cursor\n * Cursor related information, components and events\n */\n/**\n * @docs-group-description Dialog\n * Classes for working with a dialog\n */\n/**\n * @docs-group-description Frontstage\n * Classes for working with a Frontstage\n */\n/**\n * @docs-group-description Hooks\n * Hook functions for use in Functional React Components.\n */\n/**\n * @docs-group-description IModelComponents\n * Classes for displaying information about an iModel\n */\n/**\n * @docs-group-description Item\n * Classes for working with an Item in a Tool Widget, Navigation Widget or Backstage\n */\n/**\n * @docs-group-description KeyboardShortcut\n * Classes for working with Keyboard Shortcuts\n */\n/**\n * @docs-group-description NavigationAids\n * Classes for working with Navigation Aids\n */\n/**\n * @docs-group-description Notification\n * Classes for working with a Notification or Message\n */\n/**\n * @docs-group-description ChildWindowManager\n * Classes for working with child windows.\n */\n/**\n * @docs-group-description Picker\n * Classes for working with various pickers\n */\n/**\n * @docs-group-description Popup\n * Classes for working with popup components\n */\n/**\n * @docs-group-description State\n * Classes for maintaining state\n */\n/**\n * @docs-group-description Settings\n * Classes and components used by settings pages displayed in the modal settings stage\n */\n/**\n * @docs-group-description StandardUiItemsProvider\n * Standard UiItemsProvider classes.\n */\n/**\n * @docs-group-description StatusBar\n * Classes for defining a StatusBar\n */\n/**\n * @docs-group-description SyncUi\n * Classes for informing UI components to sync/refresh their display\n */\n/**\n * @docs-group-description Timeline\n * Classes for working with a TimelineComponent\n */\n/**\n * @docs-group-description Toolbar\n * Classes used to construct a Toolbar\n */\n/**\n * @docs-group-description Tools\n * Core Tool definitions\n */\n/**\n * @docs-group-description ToolSettings\n * Classes for working Tool Settings. See learning documentation [Tool Settings]($docs/learning/ui/appui-react/toolsettings.md).\n */\n/**\n * @docs-group-description UiProvider\n * Interfaces and classes for specifying UI items to be inserted at runtime.\n */\n/**\n * @docs-group-description UiStateStorage\n * Interfaces and classes for persisting UI settings.\n */\n/**\n * @docs-group-description Utilities\n * Various utility classes for working with a UI and Redux.\n */\n/**\n * @docs-group-description Widget\n * Classes for working with a Widget\n */\n"]}
|
|
1
|
+
{"version":3,"file":"appui-react.js","sourceRoot":"","sources":["../../src/appui-react.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;;;;;;AAEhG,yIAAyI;AAEzI,qCAAmC;AACnC,4DAA0C,CAAC,+DAA+D;AAE1G,8EAA4D;AAC5D,wEAAsD;AACtD,mFAAiE;AACjE,8EAA4D;AAC5D,4EAA0D;AAC1D,wEAAsD;AACtD,oEAAkD;AAClD,0EAAwD;AACxD,yEAAuD;AACvD,2EAAyD;AACzD,oEAAkD;AAClD,yEAAuD;AAEvD,4EAA0D;AAC1D,gFAA8D;AAC9D,wEAAsD;AACtD,iFAA+D;AAC/D,2EAAyD;AACzD,mFAAiE;AACjE,2FAAyE;AAEzE,qFAAmE;AACnE,qFAAmE;AACnE,qEAAmD;AAEnD,uEAAqD;AACrD,qEAAmD;AACnD,sEAAoD;AACpD,gFAA8D;AAC9D,wEAAsD;AACtD,2EAAyD;AACzD,+EAA6D;AAC7D,uEAAqD;AACrD,2EAAyD;AACzD,6EAA2D;AAE3D,yEAAuD;AACvD,iFAA+D;AAC/D,+EAA6D;AAC7D,sFAAoE;AACpE,6EAA2D;AAE3D,yEAAuD;AACvD,0EAAwD;AACxD,4EAA0D;AAC1D,qEAAmD;AACnD,sEAAoD;AACpD,6EAA2D;AAC3D,0EAAwD;AACxD,4EAA0D;AAE1D,2EAAyD;AACzD,wEAAsD;AAEtD,6EAA2D;AAC3D,gFAA8D;AAC9D,2EAAyD;AACzD,4EAA0D;AAC1D,2EAAyD;AACzD,+EAA6D;AAC7D,qFAAmE;AACnE,gFAA8D;AAC9D,8EAA4D;AAE5D,4EAA0D;AAC1D,yEAAuD;AACvD,8EAA4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AGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n// cSpell:ignore safearea cursormenu clientservices oidc Textbox Modeless configurableui stagepanels dragdrop uiadmin itemsarbiter Popout\n\nimport \"./appui-react/layers.scss\";\nexport * from \"./appui-react/UiFramework\"; // Please ensure that this line comes before all other exports.\n\nexport * from \"./appui-react/accudraw/AccuDrawCommandItems\";\nexport * from \"./appui-react/accudraw/AccuDrawDialog\";\nexport * from \"./appui-react/accudraw/AccuDrawKeyboardShortcuts\";\nexport * from \"./appui-react/accudraw/AccuDrawPopupManager\";\nexport * from \"./appui-react/accudraw/AccuDrawUiSettings\";\nexport * from \"./appui-react/accudraw/AccuDrawWidget\";\nexport * from \"./appui-react/accudraw/Calculator\";\nexport * from \"./appui-react/accudraw/CalculatorEngine\";\nexport * from \"./appui-react/accudraw/CalculatorPopup\";\nexport * from \"./appui-react/accudraw/FrameworkAccuDraw\";\nexport * from \"./appui-react/accudraw/MenuButton\";\nexport * from \"./appui-react/accudraw/MenuButtonPopup\";\n\nexport * from \"./appui-react/backstage/BackstageComposer\";\nexport * from \"./appui-react/backstage/BackstageComposerItem\";\nexport * from \"./appui-react/backstage/BackstageItem\";\nexport * from \"./appui-react/backstage/BackstageItemUtilities\";\nexport * from \"./appui-react/backstage/BackstageManager\";\nexport * from \"./appui-react/backstage/useDefaultBackstageItems\";\nexport * from \"./appui-react/backstage/useUiItemsProviderBackstageItems\";\n\nexport * from \"./appui-react/configurableui/ConfigurableUiContent\";\nexport * from \"./appui-react/configurableui/ConfigurableUiControl\";\nexport * from \"./appui-react/configurableui/state\";\n\nexport * from \"./appui-react/content/ContentControl\";\nexport * from \"./appui-react/content/ContentGroup\";\nexport * from \"./appui-react/content/ContentLayout\";\nexport * from \"./appui-react/content/FloatingViewportContent\";\nexport * from \"./appui-react/content/ViewStateHelper\";\nexport * from \"./appui-react/content/StageContentLayout\";\nexport * from \"./appui-react/content/ViewportContentControl\";\nexport * from \"./appui-react/content/IModelViewport\";\nexport * from \"./appui-react/content/DefaultViewOverlay\";\nexport * from \"./appui-react/content/split-pane/SplitPane\";\n\nexport * from \"./appui-react/cursor/CursorInformation\";\nexport * from \"./appui-react/cursor/cursorprompt/CursorPrompt\";\nexport * from \"./appui-react/cursor/cursorpopup/CursorPopup\";\nexport * from \"./appui-react/cursor/cursorpopup/CursorPopupManager\";\nexport * from \"./appui-react/cursor/cursormenu/CursorMenu\";\n\nexport * from \"./appui-react/dialog/DialogManagerBase\";\nexport * from \"./appui-react/dialog/ModalDialogManager\";\nexport * from \"./appui-react/dialog/ContentDialogManager\";\nexport * from \"./appui-react/dialog/ContentDialog\";\nexport * from \"./appui-react/dialog/ModelessDialog\";\nexport * from \"./appui-react/dialog/ModelessDialogManager\";\nexport * from \"./appui-react/dialog/StandardMessageBox\";\nexport * from \"./appui-react/dialog/UiDataProvidedDialog\";\n\nexport * from \"./appui-react/feedback/ValidationTextbox\";\nexport * from \"./appui-react/feedback/ElementTooltip\";\n\nexport * from \"./appui-react/framework/FrameworkBackstage\";\nexport * from \"./appui-react/framework/FrameworkChildWindows\";\nexport * from \"./appui-react/framework/FrameworkContent\";\nexport * from \"./appui-react/framework/FrameworkControls\";\nexport * from \"./appui-react/framework/FrameworkDialogs\";\nexport * from \"./appui-react/framework/FrameworkFrontstages\";\nexport * from \"./appui-react/framework/FrameworkKeyboardShortcuts\";\nexport * from \"./appui-react/framework/FrameworkToolSettings\";\nexport * from \"./appui-react/framework/FrameworkVisibility\";\n\nexport * from \"./appui-react/frontstage/FrontstageConfig\";\nexport * from \"./appui-react/frontstage/FrontstageDef\";\nexport * from \"./appui-react/frontstage/FrontstageProvider\";\nexport * from \"./appui-react/frontstage/ModalFrontstage\";\nexport * from \"./appui-react/frontstage/ModalSettingsStage\";\nexport * from \"./appui-react/frontstage/NestedFrontstage\";\nexport * from \"./appui-react/frontstage/StageUsage\";\nexport * from \"./appui-react/frontstage/StandardFrontstageProvider\";\n\nexport * from \"./appui-react/hooks/useActiveIModelConnection\";\nexport * from \"./appui-react/hooks/useActiveStageId\";\nexport * from \"./appui-react/hooks/useActiveViewport\";\nexport * from \"./appui-react/hooks/useAvailableUiItemsProviders\";\nexport * from \"./appui-react/hooks/useAnalysisAnimationDataProvider\";\nexport * from \"./appui-react/hooks/useScheduleAnimationDataProvider\";\nexport * from \"./appui-react/hooks/useSolarDataProvider\";\nexport * from \"./appui-react/hooks/useUiVisibility\";\n\nexport * from \"./appui-react/keyboardshortcut/KeyboardShortcut\";\nexport * from \"./appui-react/keyboardshortcut/KeyboardShortcutMenu\";\n\nexport * from \"./appui-react/messages/AppNotificationManager\";\nexport * from \"./appui-react/messages/InputField\";\nexport * from \"./appui-react/messages/MessageManager\";\nexport * from \"./appui-react/messages/Pointer\";\nexport * from \"./appui-react/messages/ReactNotifyMessageDetails\";\n\nexport * from \"./appui-react/navigationaids/CubeNavigationAidControl\";\nexport * from \"./appui-react/navigationaids/DrawingNavigationAidControl\";\nexport * from \"./appui-react/navigationaids/NavigationAidControl\";\nexport * from \"./appui-react/navigationaids/SheetNavigationAid\";\nexport * from \"./appui-react/navigationaids/SheetsModalFrontstage\";\nexport * from \"./appui-react/navigationaids/StandardRotationNavigationAid\";\n\nexport * from \"./appui-react/pickers/ListPicker\";\nexport * from \"./appui-react/pickers/ViewSelector\";\n\nexport * from \"./appui-react/popup/KeyinPalettePanel\";\nexport * from \"./appui-react/popup/KeyinPalettePopup\";\nexport * from \"./appui-react/popup/HTMLElementPopup\";\nexport * from \"./appui-react/popup/InputEditorPopup\";\nexport * from \"./appui-react/popup/PopupManager\";\nexport * from \"./appui-react/popup/PositionPopup\";\nexport * from \"./appui-react/popup/ToolbarPopup\";\n\nexport {\n PreviewFeatures,\n PreviewFeaturesProvider,\n PreviewFeaturesProviderProps,\n} from \"./appui-react/preview/PreviewFeatures\";\n\nexport * from \"./appui-react/redux/SessionState\";\nexport * from \"./appui-react/redux/StateManager\";\nexport * from \"./appui-react/redux/FrameworkState\";\nexport * from \"./appui-react/redux/connectIModel\";\nexport * from \"./appui-react/redux/ReducerRegistry\";\nexport * from \"./appui-react/redux/redux-ts\";\n\nexport * from \"./appui-react/safearea/SafeAreaContext\";\nexport * from \"./appui-react/safearea/SafeAreaInsets\";\n\nexport * from \"./appui-react/selection/SelectionContextItemDef\";\nexport * from \"./appui-react/selection/HideIsolateEmphasizeManager\";\n\nexport * from \"./appui-react/settings/ui/UiSettingsPage\";\nexport * from \"./appui-react/settings/quantityformatting/QuantityFormat\";\nexport * from \"./appui-react/settings/quantityformatting/UnitSystemSelector\";\n\nexport * from \"./appui-react/shared/ActionButtonItemDef\";\nexport * from \"./appui-react/shared/AnyItemDef\";\nexport * from \"./appui-react/shared/AnyToolbarItemDef\";\nexport * from \"./appui-react/shared/CommandItemDef\";\nexport * from \"./appui-react/shared/CustomItemDef\";\nexport * from \"./appui-react/shared/CustomItemProps\";\nexport * from \"./appui-react/shared/GroupItemProps\";\nexport * from \"./appui-react/shared/ItemDefBase\";\nexport * from \"./appui-react/shared/ItemMap\";\nexport * from \"./appui-react/shared/ItemProps\";\nexport * from \"./appui-react/shared/MenuItem\";\nexport * from \"./appui-react/shared/SelectionScope\";\nexport * from \"./appui-react/shared/ToolItemDef\";\n\nexport * from \"./appui-react/stagepanels/StagePanelConfig\";\nexport * from \"./appui-react/stagepanels/StagePanelDef\";\nexport * from \"./appui-react/stagepanels/StagePanelLocation\";\nexport * from \"./appui-react/stagepanels/StagePanelSection\";\nexport * from \"./appui-react/stagepanels/StagePanelState\";\n\nexport * from \"./appui-react/statusbar/dialog/Dialog\";\nexport * from \"./appui-react/statusbar/Indicator\";\nexport * from \"./appui-react/statusbar/LabelIndicator\";\nexport * from \"./appui-react/statusbar/Separator\";\nexport * from \"./appui-react/statusbar/StatusBar\";\nexport * from \"./appui-react/statusbar/StatusBarWidgetControl\";\nexport * from \"./appui-react/statusbar/StatusBarComposer\";\nexport * from \"./appui-react/statusbar/StatusBarItem\";\nexport * from \"./appui-react/statusbar/StatusBarItemUtilities\";\nexport * from \"./appui-react/statusbar/StatusBarComposer\";\nexport * from \"./appui-react/statusbar/useUiItemsProviderStatusBarItems\";\nexport * from \"./appui-react/statusbar/useDefaultStatusBarItems\";\n\nexport * from \"./appui-react/statusfields/tileloading/TileLoadingIndicator\";\nexport * from \"./appui-react/statusfields/ActivityCenter\";\nexport * from \"./appui-react/statusfields/MessageCenter\";\nexport * from \"./appui-react/statusfields/SectionsField\";\nexport * from \"./appui-react/statusfields/SelectionCount\";\nexport * from \"./appui-react/statusfields/SelectionInfo\";\nexport * from \"./appui-react/statusfields/SelectionScope\";\nexport * from \"./appui-react/statusfields/SnapMode\";\nexport * from \"./appui-react/statusfields/ViewAttributes\";\nexport * from \"./appui-react/statusfields/toolassistance/ToolAssistanceField\";\n\nexport * from \"./appui-react/syncui/SyncUiEventDispatcher\";\nexport * from \"./appui-react/syncui/UiSyncEvent\";\n\nexport * from \"./appui-react/theme/ThemeManager\";\n\nexport * from \"./appui-react/timeline/ScheduleAnimationProvider\";\nexport * from \"./appui-react/timeline/AnalysisAnimationProvider\";\nexport * from \"./appui-react/timeline/SolarTimelineDataProvider\";\n\nexport * from \"./appui-react/toolbar/DragInteraction\";\nexport * from \"./appui-react/toolbar/GroupItem\";\nexport * from \"./appui-react/toolbar/Toolbar\";\nexport * from \"./appui-react/toolbar/ToolbarComposer\";\nexport * from \"./appui-react/toolbar/ToolbarHelper\";\nexport * from \"./appui-react/toolbar/ToolbarItem\";\nexport * from \"./appui-react/toolbar/ToolbarItemUtilities\";\nexport * from \"./appui-react/toolbar/ToolbarWithOverflow\";\nexport * from \"./appui-react/toolbar/useDefaultToolbarItems\";\nexport * from \"./appui-react/toolbar/useUiItemsProviderToolbarItems\";\n\nexport * from \"./appui-react/tools/CoreToolDefinitions\";\nexport * from \"./appui-react/tools/FrameworkToolAdmin\";\nexport * from \"./appui-react/tools/RestoreLayoutTool\";\nexport * from \"./appui-react/tools/ToolSettingsTools\";\n\nexport * from \"./appui-react/ui-items-provider/BaseUiItemsProvider\";\nexport * from \"./appui-react/ui-items-provider/ProviderItem\";\nexport * from \"./appui-react/ui-items-provider/StandardContentToolsProvider\";\nexport * from \"./appui-react/ui-items-provider/StandardContentToolsUiItemsProvider\";\nexport * from \"./appui-react/ui-items-provider/StandardNavigationToolsProvider\";\nexport * from \"./appui-react/ui-items-provider/StandardNavigationToolsUiItemsProvider\";\nexport * from \"./appui-react/ui-items-provider/StandardStatusbarItemsProvider\";\nexport * from \"./appui-react/ui-items-provider/StandardStatusbarUiItemsProvider\";\nexport * from \"./appui-react/ui-items-provider/UiItemsManager\";\nexport * from \"./appui-react/ui-items-provider/UiItemsProvider\";\n\nexport * from \"./appui-react/uiadmin/FrameworkUiAdmin\";\n\nexport * from \"./appui-react/uiprovider/DefaultDialogGridContainer\";\n\nexport * from \"./appui-react/uistate/AppUiSettings\";\nexport * from \"./appui-react/uistate/useUiStateStorage\";\n\nexport * from \"./appui-react/utils/ViewUtilities\";\nexport * from \"./appui-react/utils/PropsHelper\";\nexport * from \"./appui-react/utils/ToolbarButtonHelper\";\n\nexport * from \"./appui-react/widget-panels/Content\";\nexport * from \"./appui-react/widget-panels/Frontstage\";\nexport * from \"./appui-react/widget-panels/FrontstageContent\";\nexport * from \"./appui-react/widget-panels/ModalFrontstageComposer\";\nexport * from \"./appui-react/widget-panels/StatusBar\";\nexport * from \"./appui-react/widget-panels/Tab\";\nexport * from \"./appui-react/widget-panels/Toolbars\";\nexport * from \"./appui-react/widget-panels/ToolSettings\";\nexport * from \"./appui-react/widget-panels/useWidgetDirection\";\nexport * from \"./appui-react/widget-panels/useTransientState\";\n\nexport * from \"./appui-react/widgets/BackstageAppButton\";\nexport * from \"./appui-react/widgets/BasicNavigationWidget\";\nexport * from \"./appui-react/widgets/BasicToolWidget\";\nexport * from \"./appui-react/widgets/ContentToolWidgetComposer\";\nexport * from \"./appui-react/widgets/NavigationWidgetComposer\";\nexport * from \"./appui-react/widgets/StableWidgetDef\";\nexport * from \"./appui-react/widgets/StatusBarWidgetComposerControl\";\nexport * from \"./appui-react/widgets/ToolWidgetComposer\";\nexport * from \"./appui-react/widgets/ViewToolWidgetComposer\";\nexport * from \"./appui-react/widgets/Widget\";\nexport * from \"./appui-react/widgets/WidgetConfig\";\nexport * from \"./appui-react/widgets/WidgetControl\";\nexport * from \"./appui-react/widgets/WidgetDef\";\nexport * from \"./appui-react/widgets/WidgetHost\";\nexport * from \"./appui-react/widgets/WidgetManager\";\nexport * from \"./appui-react/widgets/WidgetState\";\nexport * from \"./appui-react/widgets/useWidget\";\n\nexport * from \"./appui-react/toolsettings/ToolInformation\";\nexport * from \"./appui-react/toolsettings/ToolUiProvider\";\nexport * from \"./appui-react/toolsettings/DefaultToolSettingsProvider\";\n\n/** @docs-package-description\n * The ui-framework package contains classes and components for specifying the application UI consisting of the\n * Backstage, Frontstages, Content Views, Tool Bars, Status Bars, Widgets and Panels.\n * For more information, see [learning about appui-react]($docs/learning/ui/appui-react/index.md).\n */\n/**\n * @docs-group-description AccuDraw\n * Classes and components providing a UI for AccuDraw, an aide for entering coordinate data.\n */\n/**\n * @docs-group-description Admin\n * APIs for various UI components, such as toolbars, buttons and menus.\n */\n/**\n * @docs-group-description Backstage\n * Classes for working with a Backstage\n */\n/**\n * @docs-group-description ConfigurableUi\n * Classes for working with the Application UI Configuration\n */\n/**\n * @docs-group-description ContentView\n * Classes for working with a Content View, Group, Layout or Control\n */\n/**\n * @docs-group-description Cursor\n * Cursor related information, components and events\n */\n/**\n * @docs-group-description Dialog\n * Classes for working with a dialog\n */\n/**\n * @docs-group-description Frontstage\n * Classes for working with a Frontstage\n */\n/**\n * @docs-group-description Hooks\n * Hook functions for use in Functional React Components.\n */\n/**\n * @docs-group-description IModelComponents\n * Classes for displaying information about an iModel\n */\n/**\n * @docs-group-description Item\n * Classes for working with an Item in a Tool Widget, Navigation Widget or Backstage\n */\n/**\n * @docs-group-description KeyboardShortcut\n * Classes for working with Keyboard Shortcuts\n */\n/**\n * @docs-group-description NavigationAids\n * Classes for working with Navigation Aids\n */\n/**\n * @docs-group-description Notification\n * Classes for working with a Notification or Message\n */\n/**\n * @docs-group-description ChildWindowManager\n * Classes for working with child windows.\n */\n/**\n * @docs-group-description Picker\n * Classes for working with various pickers\n */\n/**\n * @docs-group-description Popup\n * Classes for working with popup components\n */\n/**\n * @docs-group-description State\n * Classes for maintaining state\n */\n/**\n * @docs-group-description Settings\n * Classes and components used by settings pages displayed in the modal settings stage\n */\n/**\n * @docs-group-description StandardUiItemsProvider\n * Standard UiItemsProvider classes.\n */\n/**\n * @docs-group-description StatusBar\n * Classes for defining a StatusBar\n */\n/**\n * @docs-group-description SyncUi\n * Classes for informing UI components to sync/refresh their display\n */\n/**\n * @docs-group-description Timeline\n * Classes for working with a TimelineComponent\n */\n/**\n * @docs-group-description Toolbar\n * Classes used to construct a Toolbar\n */\n/**\n * @docs-group-description Tools\n * Core Tool definitions\n */\n/**\n * @docs-group-description ToolSettings\n * Classes for working Tool Settings. See learning documentation [Tool Settings]($docs/learning/ui/appui-react/toolsettings.md).\n */\n/**\n * @docs-group-description UiProvider\n * Interfaces and classes for specifying UI items to be inserted at runtime.\n */\n/**\n * @docs-group-description UiStateStorage\n * Interfaces and classes for persisting UI settings.\n */\n/**\n * @docs-group-description Utilities\n * Various utility classes for working with a UI and Redux.\n */\n/**\n * @docs-group-description Widget\n * Classes for working with a Widget\n */\n"]}
|
|
@@ -70,10 +70,10 @@ const ForwardRefAccuDrawInput = React.forwardRef(function ForwardRefAccuDrawInpu
|
|
|
70
70
|
}, []);
|
|
71
71
|
const handleKeyDown = React.useCallback((e) => {
|
|
72
72
|
switch (e.key) {
|
|
73
|
-
case Key.Escape:
|
|
73
|
+
case Key.Escape.valueOf():
|
|
74
74
|
onEscPressed && onEscPressed();
|
|
75
75
|
return;
|
|
76
|
-
case Key.Enter:
|
|
76
|
+
case Key.Enter.valueOf():
|
|
77
77
|
onEnterPressed && onEnterPressed();
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccuDrawInputField.js","sourceRoot":"","sources":["../../../../src/appui-react/accudraw/AccuDrawInputField.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,2BAA2B,CAAC;AACnC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAGlC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAK7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,SAAS,QAAQ,CAAC,IAAY;IAC5B,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC;AACxE,CAAC;AAkCD,MAAM,uBAAuB,GAAG,KAAK,CAAC,UAAU,CAG9C,SAAS,4BAA4B,CAAC,KAA8B,EAAE,GAAG;IACzE,MAAM,EACJ,SAAS,EACT,KAA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AEZ,MAAM,eAAe,GAAG,UAAU,CAAC,2BAA2B,EAAE,SAAS,CAAC,CAAC;IAC3E,MAAM,eAAe,GAAG,UAAU,CAChC,2BAA2B,EAC3B,aAAa,IAAI,qBAAqB,EACtC,cAAc,CACf,CAAC;IAEF,OAAO,CACL;QACE,+BAAO,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU;YAC9D,KAAK;YACL,QAAQ,IAAI,oBAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,CACnC;QACR,oBAAC,KAAK,OACA,UAAU,EACd,GAAG,EAAE,IAAI,EACT,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAC,KAAK,EAClB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,aAAa,EACxB,IAAI,EAAC,OAAO,GACZ;QACF,8BAAM,SAAS,EAAC,oBAAoB,IACjC,QAAQ,IAAI,oBAAC,IAAI,IAAC,QAAQ,EAAE,oBAAC,OAAO,OAAG,GAAI,CACvC,CACN,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAEE,uBAAuB,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 AccuDraw\n */\n\nimport \"./AccuDrawInputField.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Key } from \"ts-key-enum\";\nimport type { ItemField } from \"@itwin/core-frontend\";\nimport type { CommonProps, IconSpec } from \"@itwin/core-react\";\nimport { Icon, useRefs } from \"@itwin/core-react\";\nimport { Input } from \"@itwin/itwinui-react\";\nimport type {\n AccuDrawSetFieldFocusEventArgs,\n AccuDrawSetFieldValueToUiEventArgs,\n} from \"./FrameworkAccuDraw\";\nimport { FrameworkAccuDraw } from \"./FrameworkAccuDraw\";\nimport { UiFramework } from \"../UiFramework\";\nimport { SvgLock } from \"@itwin/itwinui-icons-react\";\n\nfunction isLetter(char: string): boolean {\n return char.length === 1 && char.toLowerCase() !== char.toUpperCase();\n}\n\n/** Properties for [[AccuDrawInputField]] component\n * @beta\n */\nexport interface AccuDrawInputFieldProps extends CommonProps {\n /** Which AccuDraw field this represents */\n field: ItemField;\n /** id for the input element */\n id: string;\n /** Indicates whether field is locked */\n isLocked?: boolean;\n /** label for the input element */\n label?: string;\n /** icon for the input element */\n iconSpec?: IconSpec;\n /** Custom CSS class name for the label */\n labelClassName?: string;\n /** Custom CSS Style for the label */\n labelStyle?: React.CSSProperties;\n /** Center justified label */\n labelCentered?: boolean;\n /** Triggered when the content is changed */\n onValueChanged: (stringValue: string) => void;\n /** Frequency to poll for changes in value, in milliseconds */\n valueChangedDelay?: number;\n /** Listens for <Enter> keypress */\n onEnterPressed?: () => void;\n /** Listens for <Esc> keypress */\n onEscPressed?: () => void;\n /** Provides ability to return reference to HTMLInputElement */\n ref?: React.Ref<HTMLInputElement>;\n}\n\nconst ForwardRefAccuDrawInput = React.forwardRef<\n HTMLInputElement,\n AccuDrawInputFieldProps\n>(function ForwardRefAccuDrawInputField(props: AccuDrawInputFieldProps, ref) {\n const {\n className,\n style,\n id,\n label,\n iconSpec,\n labelClassName,\n labelStyle,\n labelCentered,\n field,\n isLocked,\n onValueChanged,\n valueChangedDelay,\n onEnterPressed,\n onEscPressed,\n ...inputProps\n } = props;\n const [stringValue, setStringValue] = React.useState(\"\");\n const timeoutId = React.useRef(0);\n const [needValueChanged, setNeedValueChanged] = React.useState(false);\n const [needSelection, setNeedSelection] = React.useState(false);\n const [isFocusField, setIsFocusField] = React.useState(false);\n const inputElementRef = React.useRef<HTMLInputElement>(null);\n const refs = useRefs(inputElementRef, ref); // combine ref needed for target with the forwardRef needed by the Parent when parent is a Type Editor.\n\n React.useEffect(() => {\n const formattedValue = FrameworkAccuDraw.getFieldDisplayValue(field);\n setStringValue(formattedValue);\n }, [field]);\n\n const handleChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>): void => {\n const value = event.currentTarget.value;\n\n // istanbul ignore next\n if (value === undefined) return;\n\n // istanbul ignore else\n if (stringValue !== value) {\n setStringValue(value);\n setNeedValueChanged(true);\n }\n },\n [stringValue]\n );\n\n const unsetTimeout = (): void => {\n // istanbul ignore else\n if (timeoutId) {\n window.clearTimeout(timeoutId.current);\n timeoutId.current = 0;\n }\n };\n\n React.useEffect(() => {\n // After setStringValue & re-render\n // istanbul ignore else\n if (needValueChanged) {\n if (valueChangedDelay) {\n unsetTimeout();\n timeoutId.current = window.setTimeout(() => {\n onValueChanged(stringValue);\n }, valueChangedDelay);\n } else {\n onValueChanged(stringValue);\n }\n setNeedValueChanged(false);\n }\n }, [onValueChanged, valueChangedDelay, stringValue, needValueChanged]);\n\n React.useEffect(() => {\n // On unmount\n return () => unsetTimeout();\n }, []);\n\n const handleKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n switch (e.key) {\n case Key.Escape:\n onEscPressed && onEscPressed();\n return;\n case Key.Enter:\n onEnterPressed && onEnterPressed();\n return;\n }\n\n if (isLetter(e.key)) {\n e.preventDefault();\n UiFramework.keyboardShortcuts.processKey(e.key);\n return;\n }\n },\n [onEscPressed, onEnterPressed]\n );\n\n React.useEffect(() => {\n const handleSetFieldValueToUi = (\n args: AccuDrawSetFieldValueToUiEventArgs\n ) => {\n if (args.field === field && stringValue !== args.formattedValue) {\n setStringValue(args.formattedValue);\n // istanbul ignore else\n if (isFocusField) setNeedSelection(true);\n }\n };\n return FrameworkAccuDraw.onAccuDrawSetFieldValueToUiEvent.addListener(\n handleSetFieldValueToUi\n );\n }, [field, isFocusField, stringValue]);\n\n React.useEffect(() => {\n if (needSelection) {\n // istanbul ignore else\n if (inputElementRef.current) inputElementRef.current.select();\n setNeedSelection(false);\n }\n }, [needSelection]);\n\n React.useEffect(() => {\n const handleSetFieldFocus = (args: AccuDrawSetFieldFocusEventArgs) => {\n setIsFocusField(args.field === field);\n };\n return FrameworkAccuDraw.onAccuDrawSetFieldFocusEvent.addListener(\n handleSetFieldFocus\n );\n }, [field]);\n\n const inputClassNames = classnames(\"uifw-accudraw-input-field\", className);\n const labelClassNames = classnames(\n \"uifw-accudraw-input-label\",\n labelCentered && \"uifw-label-centered\",\n labelClassName\n );\n\n return (\n <>\n <label htmlFor={id} className={labelClassNames} style={labelStyle}>\n {label}\n {iconSpec && <Icon iconSpec={iconSpec} />}\n </label>\n <Input\n {...inputProps}\n ref={refs}\n id={id}\n value={stringValue}\n className={inputClassNames}\n style={style}\n autoComplete=\"off\"\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n size=\"small\"\n />\n <span className=\"uifw-accudraw-lock\">\n {isLocked && <Icon iconSpec={<SvgLock />} />}\n </span>\n </>\n );\n});\n\n/** Input field for AccuDraw Ui\n * @beta\n */\nexport const AccuDrawInputField: (\n props: AccuDrawInputFieldProps\n) => React.ReactElement | null = ForwardRefAccuDrawInput;\n"]}
|
|
1
|
+
{"version":3,"file":"AccuDrawInputField.js","sourceRoot":"","sources":["../../../../src/appui-react/accudraw/AccuDrawInputField.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,2BAA2B,CAAC;AACnC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAGlC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAK7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,E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AC;SACzB;IACH,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,mBAAmB,GAAG,CAAC,IAAoC,EAAE,EAAE;YACnE,eAAe,CAAC,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QACxC,CAAC,CAAC;QACF,OAAO,iBAAiB,CAAC,4BAA4B,CAAC,WAAW,CAC/D,mBAAmB,CACpB,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,MAAM,eAAe,GAAG,UAAU,CAAC,2BAA2B,EAAE,SAAS,CAAC,CAAC;IAC3E,MAAM,eAAe,GAAG,UAAU,CAChC,2BAA2B,EAC3B,aAAa,IAAI,qBAAqB,EACtC,cAAc,CACf,CAAC;IAEF,OAAO,CACL;QACE,+BAAO,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU;YAC9D,KAAK;YACL,QAAQ,IAAI,oBAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,CACnC;QACR,oBAAC,KAAK,OACA,UAAU,EACd,GAAG,EAAE,IAAI,EACT,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAC,KAAK,EAClB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,aAAa,EACxB,IAAI,EAAC,OAAO,GACZ;QACF,8BAAM,SAAS,EAAC,oBAAoB,IACjC,QAAQ,IAAI,oBAAC,IAAI,IAAC,QAAQ,EAAE,oBAAC,OAAO,OAAG,GAAI,CACvC,CACN,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAEE,uBAAuB,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 AccuDraw\n */\n\nimport \"./AccuDrawInputField.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Key } from \"ts-key-enum\";\nimport type { ItemField } from \"@itwin/core-frontend\";\nimport type { CommonProps, IconSpec } from \"@itwin/core-react\";\nimport { Icon, useRefs } from \"@itwin/core-react\";\nimport { Input } from \"@itwin/itwinui-react\";\nimport type {\n AccuDrawSetFieldFocusEventArgs,\n AccuDrawSetFieldValueToUiEventArgs,\n} from \"./FrameworkAccuDraw\";\nimport { FrameworkAccuDraw } from \"./FrameworkAccuDraw\";\nimport { UiFramework } from \"../UiFramework\";\nimport { SvgLock } from \"@itwin/itwinui-icons-react\";\n\nfunction isLetter(char: string): boolean {\n return char.length === 1 && char.toLowerCase() !== char.toUpperCase();\n}\n\n/** Properties for [[AccuDrawInputField]] component\n * @beta\n */\nexport interface AccuDrawInputFieldProps extends CommonProps {\n /** Which AccuDraw field this represents */\n field: ItemField;\n /** id for the input element */\n id: string;\n /** Indicates whether field is locked */\n isLocked?: boolean;\n /** label for the input element */\n label?: string;\n /** icon for the input element */\n iconSpec?: IconSpec;\n /** Custom CSS class name for the label */\n labelClassName?: string;\n /** Custom CSS Style for the label */\n labelStyle?: React.CSSProperties;\n /** Center justified label */\n labelCentered?: boolean;\n /** Triggered when the content is changed */\n onValueChanged: (stringValue: string) => void;\n /** Frequency to poll for changes in value, in milliseconds */\n valueChangedDelay?: number;\n /** Listens for <Enter> keypress */\n onEnterPressed?: () => void;\n /** Listens for <Esc> keypress */\n onEscPressed?: () => void;\n /** Provides ability to return reference to HTMLInputElement */\n ref?: React.Ref<HTMLInputElement>;\n}\n\nconst ForwardRefAccuDrawInput = React.forwardRef<\n HTMLInputElement,\n AccuDrawInputFieldProps\n>(function ForwardRefAccuDrawInputField(props: AccuDrawInputFieldProps, ref) {\n const {\n className,\n style,\n id,\n label,\n iconSpec,\n labelClassName,\n labelStyle,\n labelCentered,\n field,\n isLocked,\n onValueChanged,\n valueChangedDelay,\n onEnterPressed,\n onEscPressed,\n ...inputProps\n } = props;\n const [stringValue, setStringValue] = React.useState(\"\");\n const timeoutId = React.useRef(0);\n const [needValueChanged, setNeedValueChanged] = React.useState(false);\n const [needSelection, setNeedSelection] = React.useState(false);\n const [isFocusField, setIsFocusField] = React.useState(false);\n const inputElementRef = React.useRef<HTMLInputElement>(null);\n const refs = useRefs(inputElementRef, ref); // combine ref needed for target with the forwardRef needed by the Parent when parent is a Type Editor.\n\n React.useEffect(() => {\n const formattedValue = FrameworkAccuDraw.getFieldDisplayValue(field);\n setStringValue(formattedValue);\n }, [field]);\n\n const handleChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>): void => {\n const value = event.currentTarget.value;\n\n // istanbul ignore next\n if (value === undefined) return;\n\n // istanbul ignore else\n if (stringValue !== value) {\n setStringValue(value);\n setNeedValueChanged(true);\n }\n },\n [stringValue]\n );\n\n const unsetTimeout = (): void => {\n // istanbul ignore else\n if (timeoutId) {\n window.clearTimeout(timeoutId.current);\n timeoutId.current = 0;\n }\n };\n\n React.useEffect(() => {\n // After setStringValue & re-render\n // istanbul ignore else\n if (needValueChanged) {\n if (valueChangedDelay) {\n unsetTimeout();\n timeoutId.current = window.setTimeout(() => {\n onValueChanged(stringValue);\n }, valueChangedDelay);\n } else {\n onValueChanged(stringValue);\n }\n setNeedValueChanged(false);\n }\n }, [onValueChanged, valueChangedDelay, stringValue, needValueChanged]);\n\n React.useEffect(() => {\n // On unmount\n return () => unsetTimeout();\n }, []);\n\n const handleKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n switch (e.key) {\n case Key.Escape.valueOf():\n onEscPressed && onEscPressed();\n return;\n case Key.Enter.valueOf():\n onEnterPressed && onEnterPressed();\n return;\n }\n\n if (isLetter(e.key)) {\n e.preventDefault();\n UiFramework.keyboardShortcuts.processKey(e.key);\n return;\n }\n },\n [onEscPressed, onEnterPressed]\n );\n\n React.useEffect(() => {\n const handleSetFieldValueToUi = (\n args: AccuDrawSetFieldValueToUiEventArgs\n ) => {\n if (args.field === field && stringValue !== args.formattedValue) {\n setStringValue(args.formattedValue);\n // istanbul ignore else\n if (isFocusField) setNeedSelection(true);\n }\n };\n return FrameworkAccuDraw.onAccuDrawSetFieldValueToUiEvent.addListener(\n handleSetFieldValueToUi\n );\n }, [field, isFocusField, stringValue]);\n\n React.useEffect(() => {\n if (needSelection) {\n // istanbul ignore else\n if (inputElementRef.current) inputElementRef.current.select();\n setNeedSelection(false);\n }\n }, [needSelection]);\n\n React.useEffect(() => {\n const handleSetFieldFocus = (args: AccuDrawSetFieldFocusEventArgs) => {\n setIsFocusField(args.field === field);\n };\n return FrameworkAccuDraw.onAccuDrawSetFieldFocusEvent.addListener(\n handleSetFieldFocus\n );\n }, [field]);\n\n const inputClassNames = classnames(\"uifw-accudraw-input-field\", className);\n const labelClassNames = classnames(\n \"uifw-accudraw-input-label\",\n labelCentered && \"uifw-label-centered\",\n labelClassName\n );\n\n return (\n <>\n <label htmlFor={id} className={labelClassNames} style={labelStyle}>\n {label}\n {iconSpec && <Icon iconSpec={iconSpec} />}\n </label>\n <Input\n {...inputProps}\n ref={refs}\n id={id}\n value={stringValue}\n className={inputClassNames}\n style={style}\n autoComplete=\"off\"\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n size=\"small\"\n />\n <span className=\"uifw-accudraw-lock\">\n {isLocked && <Icon iconSpec={<SvgLock />} />}\n </span>\n </>\n );\n});\n\n/** Input field for AccuDraw Ui\n * @beta\n */\nexport const AccuDrawInputField: (\n props: AccuDrawInputFieldProps\n) => React.ReactElement | null = ForwardRefAccuDrawInput;\n"]}
|
|
@@ -63,39 +63,39 @@ class Calculator extends React.PureComponent {
|
|
|
63
63
|
break;
|
|
64
64
|
case "c":
|
|
65
65
|
case "C":
|
|
66
|
-
case Key.Clear:
|
|
66
|
+
case Key.Clear.valueOf():
|
|
67
67
|
this._onOperatorButtonClick(CalculatorOperator.Clear);
|
|
68
68
|
break;
|
|
69
|
-
case Key.Escape:
|
|
69
|
+
case Key.Escape.valueOf():
|
|
70
70
|
this._cancel();
|
|
71
71
|
break;
|
|
72
|
-
case Key.Backspace:
|
|
72
|
+
case Key.Backspace.valueOf():
|
|
73
73
|
this._onOperatorButtonClick(CalculatorOperator.Backspace);
|
|
74
74
|
break;
|
|
75
75
|
case "/":
|
|
76
|
-
case Key.Divide:
|
|
76
|
+
case Key.Divide.valueOf():
|
|
77
77
|
this._onOperatorButtonClick(CalculatorOperator.Divide);
|
|
78
78
|
break;
|
|
79
79
|
case "*":
|
|
80
|
-
case Key.Multiply:
|
|
80
|
+
case Key.Multiply.valueOf():
|
|
81
81
|
this._onOperatorButtonClick(CalculatorOperator.Multiply);
|
|
82
82
|
break;
|
|
83
83
|
case "-":
|
|
84
|
-
case Key.Subtract:
|
|
84
|
+
case Key.Subtract.valueOf():
|
|
85
85
|
this._onOperatorButtonClick(CalculatorOperator.Subtract);
|
|
86
86
|
break;
|
|
87
87
|
case "+":
|
|
88
|
-
case Key.Add:
|
|
88
|
+
case Key.Add.valueOf():
|
|
89
89
|
this._onOperatorButtonClick(CalculatorOperator.Add);
|
|
90
90
|
break;
|
|
91
91
|
case ".":
|
|
92
|
-
case Key.Decimal:
|
|
92
|
+
case Key.Decimal.valueOf():
|
|
93
93
|
this._onOperatorButtonClick(CalculatorOperator.Decimal);
|
|
94
94
|
break;
|
|
95
95
|
case "=":
|
|
96
96
|
this._onOperatorButtonClick(CalculatorOperator.Equals);
|
|
97
97
|
break;
|
|
98
|
-
case Key.Enter:
|
|
98
|
+
case Key.Enter.valueOf():
|
|
99
99
|
if (!this._equalsClicked)
|
|
100
100
|
this._onOperatorButtonClick(CalculatorOperator.Equals);
|
|
101
101
|
this._ok();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calculator.js","sourceRoot":"","sources":["../../../../src/appui-react/accudraw/Calculator.tsx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AAC;CACF;AASD,MAAM,WAAY,SAAQ,KAAK,CAAC,aAA+B;IAA/D;;QACU,mBAAc,GAAG,CACvB,MAAuD,EACvD,EAAE;YACF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACzC,CAAC,CAAC;IAiBJ,CAAC;IAfiB,MAAM;QACpB,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAE7D,MAAM,cAAc,GAAG,UAAU,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAC;QAErE,OAAO,CACL,oBAAC,YAAY,OACP,KAAK,EACT,SAAS,EAAE,cAAc,EACzB,OAAO,EAAE,IAAI,CAAC,cAAc,IAE3B,OAAO,CACK,CAChB,CAAC;IACJ,CAAC;CACF;AASD,MAAM,cAAe,SAAQ,KAAK,CAAC,aAAkC;IAArE;;QACU,mBAAc,GAAG,CACvB,MAAuD,EACvD,EAAE;YACF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC1C,CAAC,CAAC;IAiBJ,CAAC;IAfiB,MAAM;QACpB,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAExE,MAAM,cAAc,GAAG,UAAU,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAC;QAErE,OAAO,CACL,oBAAC,YAAY,OACP,KAAK,EACT,SAAS,EAAE,cAAc,EACzB,OAAO,EAAE,IAAI,CAAC,cAAc,IAE3B,QAAQ,CACI,CAChB,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module AccuDraw\n */\n\nimport \"./Calculator.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Key } from \"ts-key-enum\";\nimport type { OnCancelFunc, OnNumberCommitFunc } from \"@itwin/appui-abstract\";\nimport type { CommonProps, Omit } from \"@itwin/core-react\";\nimport { Icon, IconInput } from \"@itwin/core-react\";\nimport { Button, Input } from \"@itwin/itwinui-react\";\nimport { CalculatorEngine, CalculatorOperator } from \"./CalculatorEngine\";\nimport type { SquareButtonProps } from \"./SquareButton\";\nimport { SquareButton } from \"./SquareButton\";\nimport { SvgCheckmark, SvgRemove } from \"@itwin/itwinui-icons-react\";\nimport backspaceIcon from \"./backspace.svg\";\n\n// cSpell:ignore plusmn\n\n/** @alpha */\nexport interface CalculatorProps extends CommonProps {\n /** Initial value */\n initialValue?: number;\n /** Icon to display beside the calculated result */\n resultIcon?: React.ReactNode;\n /** A function to be run when the OK button is clicked */\n onOk?: OnNumberCommitFunc;\n /** A function to be run when the Cancel button is clicked */\n onCancel?: OnCancelFunc;\n\n /** @internal Calculator state machine. */\n engine: CalculatorEngine;\n}\n\ninterface CalculatorState {\n displayValue: string;\n}\n\n/** @internal */\nexport type CalculatorPropsProps = Pick<CalculatorProps, \"engine\">;\n\n/** @alpha */\nexport class Calculator extends React.PureComponent<\n CalculatorProps,\n CalculatorState\n> {\n private _mainDiv = React.createRef<HTMLDivElement>();\n private _equalsClicked = false;\n\n /** @internal */\n public static readonly defaultProps: CalculatorPropsProps = {\n engine: new CalculatorEngine(),\n };\n\n constructor(props: CalculatorProps) {\n super(props);\n\n let displayValue = \"0\";\n if (this.props.initialValue)\n displayValue = this.props.engine.processValue(\n this.props.initialValue.toString()\n );\n\n this.state = {\n displayValue,\n };\n }\n\n private _onValueButtonClick = (keyChar: string) => {\n const displayValue = this.props.engine.processValue(keyChar);\n this._mainDivFocus();\n this.setState({ displayValue });\n };\n\n private _onOperatorButtonClick = (operator: CalculatorOperator) => {\n if (operator === CalculatorOperator.Clear && this._equalsClicked)\n operator = CalculatorOperator.ClearAll;\n\n const displayValue = this.props.engine.processOperator(operator);\n this._mainDivFocus();\n this.setState({ displayValue });\n\n if (operator === CalculatorOperator.Equals) this._equalsClicked = true;\n else if (operator === CalculatorOperator.ClearAll)\n this._equalsClicked = false;\n };\n\n private _handleOk = (_event: React.MouseEvent): void => {\n this._ok();\n };\n\n private _ok() {\n // istanbul ignore else\n if (this.props.onOk) {\n this.props.onOk(this.props.engine.result);\n }\n this._clearAll();\n }\n\n private _handleCancel = (_event: React.MouseEvent): void => {\n this._cancel();\n };\n\n private _cancel() {\n // istanbul ignore else\n if (this.props.onCancel) {\n this.props.onCancel();\n }\n this._clearAll();\n }\n\n private _clearAll() {\n this.props.engine.clearAll();\n this._equalsClicked = false;\n }\n\n public override componentDidMount() {\n this._mainDivFocus();\n }\n\n private _mainDivFocus() {\n if (this._mainDiv.current) this._mainDiv.current.focus();\n }\n\n public override render() {\n const { className, resultIcon, onOk, onCancel, initialValue, ...props } =\n this.props;\n\n const classNames = classnames(\"uifw-calculator\", className);\n\n const topSection = resultIcon ? (\n <IconInput\n containerClassName=\"uifw-calculator-top-input\"\n value={this.state.displayValue}\n readOnly={true}\n icon={resultIcon}\n />\n ) : (\n <Input value={this.state.displayValue} readOnly={true} size=\"small\" />\n );\n\n return (\n // The event handler is only being used to capture bubbled events\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n {...props}\n ref={this._mainDiv}\n tabIndex={-1}\n className={classNames}\n onKeyDown={this._handleKeyDown}\n >\n <div className=\"uifw-calculator-top\">{topSection}</div>\n <CalculatorKeyPad\n onValueClick={this._onValueButtonClick}\n onOperatorClick={this._onOperatorButtonClick}\n />\n <div className=\"uifw-calculator-bottom-buttons\">\n <Button\n className={classnames(\n \"uifw-calculator-large-button\",\n \"uifw-calculator-ok-button\"\n )}\n styleType=\"cta\"\n onClick={this._handleOk}\n >\n <Icon iconSpec={<SvgCheckmark />} />\n </Button>\n <Button\n className={classnames(\n \"uifw-calculator-large-button\",\n \"uifw-calculator-cancel-button\"\n )}\n onClick={this._handleCancel}\n >\n <Icon iconSpec={<SvgRemove />} />\n </Button>\n </div>\n </div>\n );\n }\n\n private _handleKeyDown = (\n event: React.KeyboardEvent<HTMLDivElement>\n ): void => {\n switch (event.key) {\n case \"0\":\n case \"1\":\n case \"2\":\n case \"3\":\n case \"4\":\n case \"5\":\n case \"6\":\n case \"7\":\n case \"8\":\n case \"9\":\n this._onValueButtonClick(event.key);\n break;\n case \"a\":\n case \"A\":\n this._onOperatorButtonClick(CalculatorOperator.ClearAll);\n break;\n case \"c\":\n case \"C\":\n case Key.Clear:\n this._onOperatorButtonClick(CalculatorOperator.Clear);\n break;\n case Key.Escape:\n this._cancel();\n break;\n case Key.Backspace:\n this._onOperatorButtonClick(CalculatorOperator.Backspace);\n break;\n case \"/\":\n case Key.Divide:\n this._onOperatorButtonClick(CalculatorOperator.Divide);\n break;\n case \"*\":\n case Key.Multiply:\n this._onOperatorButtonClick(CalculatorOperator.Multiply);\n break;\n case \"-\":\n case Key.Subtract:\n this._onOperatorButtonClick(CalculatorOperator.Subtract);\n break;\n case \"+\":\n case Key.Add:\n this._onOperatorButtonClick(CalculatorOperator.Add);\n break;\n case \".\":\n case Key.Decimal:\n this._onOperatorButtonClick(CalculatorOperator.Decimal);\n break;\n case \"=\":\n this._onOperatorButtonClick(CalculatorOperator.Equals);\n break;\n case Key.Enter:\n if (!this._equalsClicked)\n this._onOperatorButtonClick(CalculatorOperator.Equals);\n this._ok();\n break;\n }\n };\n}\n\ninterface CalculatorKeyPadProps extends CommonProps {\n /** A function to be run when a value is clicked */\n onValueClick: (key: string) => void;\n /** A function to be run when a value is clicked */\n onOperatorClick: (operator: CalculatorOperator) => void;\n}\n\nclass CalculatorKeyPad extends React.PureComponent<CalculatorKeyPadProps> {\n public override render() {\n return (\n <div className={classnames(\"uifw-calculator-button-grid\")}>\n <OperatorButton\n operator={CalculatorOperator.ClearAll}\n onClick={this.props.onOperatorClick}\n >\n AC\n </OperatorButton>\n <OperatorButton\n operator={CalculatorOperator.Clear}\n onClick={this.props.onOperatorClick}\n >\n C\n </OperatorButton>\n <OperatorButton\n operator={CalculatorOperator.Backspace}\n onClick={this.props.onOperatorClick}\n >\n <div className=\"uifw-calculator-button-svg\">\n <Icon iconSpec={backspaceIcon} />\n </div>\n </OperatorButton>\n <OperatorButton\n operator={CalculatorOperator.Divide}\n onClick={this.props.onOperatorClick}\n className=\"uifw-calculator-large-font\"\n >\n ÷\n </OperatorButton>\n\n <ValueButton keyChar=\"7\" onClick={this.props.onValueClick} />\n <ValueButton keyChar=\"8\" onClick={this.props.onValueClick} />\n <ValueButton keyChar=\"9\" onClick={this.props.onValueClick} />\n <OperatorButton\n operator={CalculatorOperator.Multiply}\n onClick={this.props.onOperatorClick}\n className=\"uifw-calculator-large-font\"\n >\n ×\n </OperatorButton>\n\n <ValueButton keyChar=\"4\" onClick={this.props.onValueClick} />\n <ValueButton keyChar=\"5\" onClick={this.props.onValueClick} />\n <ValueButton keyChar=\"6\" onClick={this.props.onValueClick} />\n <OperatorButton\n operator={CalculatorOperator.Subtract}\n onClick={this.props.onOperatorClick}\n className=\"uifw-calculator-large-font\"\n >\n −\n </OperatorButton>\n\n <ValueButton keyChar=\"1\" onClick={this.props.onValueClick} />\n <ValueButton keyChar=\"2\" onClick={this.props.onValueClick} />\n <ValueButton keyChar=\"3\" onClick={this.props.onValueClick} />\n <OperatorButton\n operator={CalculatorOperator.Add}\n onClick={this.props.onOperatorClick}\n className=\"uifw-calculator-large-font\"\n >\n +\n </OperatorButton>\n\n <ValueButton keyChar=\"0\" onClick={this.props.onValueClick} />\n <OperatorButton\n operator={CalculatorOperator.NegPos}\n onClick={this.props.onOperatorClick}\n className=\"uifw-calculator-large-font\"\n >\n ±\n </OperatorButton>\n <OperatorButton\n operator={CalculatorOperator.Decimal}\n onClick={this.props.onOperatorClick}\n className=\"uifw-calculator-large-font\"\n >\n .\n </OperatorButton>\n <OperatorButton\n operator={CalculatorOperator.Equals}\n onClick={this.props.onOperatorClick}\n className=\"uifw-calculator-large-font\"\n >\n =\n </OperatorButton>\n <span />\n </div>\n );\n }\n}\n\ninterface ValueButtonProps extends Omit<SquareButtonProps, \"onClick\"> {\n /** Key to display */\n keyChar: string;\n /** A function to be run when the element is clicked */\n onClick: (key: string) => void;\n}\n\nclass ValueButton extends React.PureComponent<ValueButtonProps> {\n private _handleOnClick = (\n _event: React.MouseEvent<HTMLButtonElement, MouseEvent>\n ) => {\n this.props.onClick(this.props.keyChar);\n };\n\n public override render() {\n const { className, keyChar, onClick, ...props } = this.props;\n\n const itemClassNames = classnames(\"uifw-calculator-item\", className);\n\n return (\n <SquareButton\n {...props}\n className={itemClassNames}\n onClick={this._handleOnClick}\n >\n {keyChar}\n </SquareButton>\n );\n }\n}\n\ninterface OperatorButtonProps extends Omit<SquareButtonProps, \"onClick\"> {\n /** Key to display */\n operator: CalculatorOperator;\n /** A function to be run when the element is clicked */\n onClick: (operator: CalculatorOperator) => void;\n}\n\nclass OperatorButton extends React.PureComponent<OperatorButtonProps> {\n private _handleOnClick = (\n _event: React.MouseEvent<HTMLButtonElement, MouseEvent>\n ) => {\n this.props.onClick(this.props.operator);\n };\n\n public override render() {\n const { className, children, operator, onClick, ...props } = this.props;\n\n const itemClassNames = classnames(\"uifw-calculator-item\", className);\n\n return (\n <SquareButton\n {...props}\n className={itemClassNames}\n onClick={this._handleOnClick}\n >\n {children}\n </SquareButton>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Calculator.js","sourceRoot":"","sources":["../../../../src/appui-react/accudraw/Calculator.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAGlC,OAAO,E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,aAA+B;IAA/D;;QACU,mBAAc,GAAG,CACvB,MAAuD,EACvD,EAAE;YACF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACzC,CAAC,CAAC;IAiBJ,CAAC;IAfiB,MAAM;QACpB,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAE7D,MAAM,cAAc,GAAG,UAAU,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAC;QAErE,OAAO,CACL,oBAAC,YAAY,OACP,KAAK,EACT,SAAS,EAAE,cAAc,EACzB,OAAO,EAAE,IAAI,CAAC,cAAc,IAE3B,OAAO,CACK,CAChB,CAAC;IACJ,CAAC;CACF;AASD,MAAM,cAAe,SAAQ,KAAK,CAAC,aAAkC;IAArE;;QACU,mBAAc,GAAG,CACvB,MAAuD,EACvD,EAAE;YACF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC1C,CAAC,CAAC;IAiBJ,CAAC;IAfiB,MAAM;QACpB,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAExE,MAAM,cAAc,GAAG,UAAU,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAC;QAErE,OAAO,CACL,oBAAC,YAAY,OACP,KAAK,EACT,SAAS,EAAE,cAAc,EACzB,OAAO,EAAE,IAAI,CAAC,cAAc,IAE3B,QAAQ,CACI,CAChB,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module AccuDraw\n */\n\nimport \"./Calculator.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { Key } from \"ts-key-enum\";\nimport type { OnCancelFunc, OnNumberCommitFunc } from \"@itwin/appui-abstract\";\nimport type { CommonProps, Omit } from \"@itwin/core-react\";\nimport { Icon, IconInput } from \"@itwin/core-react\";\nimport { Button, Input } from \"@itwin/itwinui-react\";\nimport { CalculatorEngine, CalculatorOperator } from \"./CalculatorEngine\";\nimport type { SquareButtonProps } from \"./SquareButton\";\nimport { SquareButton } from \"./SquareButton\";\nimport { SvgCheckmark, SvgRemove } from \"@itwin/itwinui-icons-react\";\nimport backspaceIcon from \"./backspace.svg\";\n\n// cSpell:ignore plusmn\n\n/** @alpha */\nexport interface CalculatorProps extends CommonProps {\n /** Initial value */\n initialValue?: number;\n /** Icon to display beside the calculated result */\n resultIcon?: React.ReactNode;\n /** A function to be run when the OK button is clicked */\n onOk?: OnNumberCommitFunc;\n /** A function to be run when the Cancel button is clicked */\n onCancel?: OnCancelFunc;\n\n /** @internal Calculator state machine. */\n engine: CalculatorEngine;\n}\n\ninterface CalculatorState {\n displayValue: string;\n}\n\n/** @internal */\nexport type CalculatorPropsProps = Pick<CalculatorProps, \"engine\">;\n\n/** @alpha */\nexport class Calculator extends React.PureComponent<\n CalculatorProps,\n CalculatorState\n> {\n private _mainDiv = React.createRef<HTMLDivElement>();\n private _equalsClicked = false;\n\n /** @internal */\n public static readonly defaultProps: CalculatorPropsProps = {\n engine: new CalculatorEngine(),\n };\n\n constructor(props: CalculatorProps) {\n super(props);\n\n let displayValue = \"0\";\n if (this.props.initialValue)\n displayValue = this.props.engine.processValue(\n this.props.initialValue.toString()\n );\n\n this.state = {\n displayValue,\n };\n }\n\n private _onValueButtonClick = (keyChar: string) => {\n const displayValue = this.props.engine.processValue(keyChar);\n this._mainDivFocus();\n this.setState({ displayValue });\n };\n\n private _onOperatorButtonClick = (operator: CalculatorOperator) => {\n if (operator === CalculatorOperator.Clear && this._equalsClicked)\n operator = CalculatorOperator.ClearAll;\n\n const displayValue = this.props.engine.processOperator(operator);\n this._mainDivFocus();\n this.setState({ displayValue });\n\n if (operator === CalculatorOperator.Equals) this._equalsClicked = true;\n else if (operator === CalculatorOperator.ClearAll)\n this._equalsClicked = false;\n };\n\n private _handleOk = (_event: React.MouseEvent): void => {\n this._ok();\n };\n\n private _ok() {\n // istanbul ignore else\n if (this.props.onOk) {\n this.props.onOk(this.props.engine.result);\n }\n this._clearAll();\n }\n\n private _handleCancel = (_event: React.MouseEvent): void => {\n this._cancel();\n };\n\n private _cancel() {\n // istanbul ignore else\n if (this.props.onCancel) {\n this.props.onCancel();\n }\n this._clearAll();\n }\n\n private _clearAll() {\n this.props.engine.clearAll();\n this._equalsClicked = false;\n }\n\n public override componentDidMount() {\n this._mainDivFocus();\n }\n\n private _mainDivFocus() {\n if (this._mainDiv.current) this._mainDiv.current.focus();\n }\n\n public override render() {\n const { className, resultIcon, onOk, onCancel, initialValue, ...props } =\n this.props;\n\n const classNames = classnames(\"uifw-calculator\", className);\n\n const topSection = resultIcon ? (\n <IconInput\n containerClassName=\"uifw-calculator-top-input\"\n value={this.state.displayValue}\n readOnly={true}\n icon={resultIcon}\n />\n ) : (\n <Input value={this.state.displayValue} readOnly={true} size=\"small\" />\n );\n\n return (\n // The event handler is only being used to capture bubbled events\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n {...props}\n ref={this._mainDiv}\n tabIndex={-1}\n className={classNames}\n onKeyDown={this._handleKeyDown}\n >\n <div className=\"uifw-calculator-top\">{topSection}</div>\n <CalculatorKeyPad\n onValueClick={this._onValueButtonClick}\n onOperatorClick={this._onOperatorButtonClick}\n />\n <div className=\"uifw-calculator-bottom-buttons\">\n <Button\n className={classnames(\n \"uifw-calculator-large-button\",\n \"uifw-calculator-ok-button\"\n )}\n styleType=\"cta\"\n onClick={this._handleOk}\n >\n <Icon iconSpec={<SvgCheckmark />} />\n </Button>\n <Button\n className={classnames(\n \"uifw-calculator-large-button\",\n \"uifw-calculator-cancel-button\"\n )}\n onClick={this._handleCancel}\n >\n <Icon iconSpec={<SvgRemove />} />\n </Button>\n </div>\n </div>\n );\n }\n\n private _handleKeyDown = (\n event: React.KeyboardEvent<HTMLDivElement>\n ): void => {\n switch (event.key) {\n case \"0\":\n case \"1\":\n case \"2\":\n case \"3\":\n case \"4\":\n case \"5\":\n case \"6\":\n case \"7\":\n case \"8\":\n case \"9\":\n this._onValueButtonClick(event.key);\n break;\n case \"a\":\n case \"A\":\n this._onOperatorButtonClick(CalculatorOperator.ClearAll);\n break;\n case \"c\":\n case \"C\":\n case Key.Clear.valueOf():\n this._onOperatorButtonClick(CalculatorOperator.Clear);\n break;\n case Key.Escape.valueOf():\n this._cancel();\n break;\n case Key.Backspace.valueOf():\n this._onOperatorButtonClick(CalculatorOperator.Backspace);\n break;\n case \"/\":\n case Key.Divide.valueOf():\n this._onOperatorButtonClick(CalculatorOperator.Divide);\n break;\n case \"*\":\n case Key.Multiply.valueOf():\n this._onOperatorButtonClick(CalculatorOperator.Multiply);\n break;\n case \"-\":\n case Key.Subtract.valueOf():\n this._onOperatorButtonClick(CalculatorOperator.Subtract);\n break;\n case \"+\":\n case Key.Add.valueOf():\n this._onOperatorButtonClick(CalculatorOperator.Add);\n break;\n case \".\":\n case Key.Decimal.valueOf():\n this._onOperatorButtonClick(CalculatorOperator.Decimal);\n break;\n case \"=\":\n this._onOperatorButtonClick(CalculatorOperator.Equals);\n break;\n case Key.Enter.valueOf():\n if (!this._equalsClicked)\n this._onOperatorButtonClick(CalculatorOperator.Equals);\n this._ok();\n break;\n }\n };\n}\n\ninterface CalculatorKeyPadProps extends CommonProps {\n /** A function to be run when a value is clicked */\n onValueClick: (key: string) => void;\n /** A function to be run when a value is clicked */\n onOperatorClick: (operator: CalculatorOperator) => void;\n}\n\nclass CalculatorKeyPad extends React.PureComponent<CalculatorKeyPadProps> {\n public override render() {\n return (\n <div className={classnames(\"uifw-calculator-button-grid\")}>\n <OperatorButton\n operator={CalculatorOperator.ClearAll}\n onClick={this.props.onOperatorClick}\n >\n AC\n </OperatorButton>\n <OperatorButton\n operator={CalculatorOperator.Clear}\n onClick={this.props.onOperatorClick}\n >\n C\n </OperatorButton>\n <OperatorButton\n operator={CalculatorOperator.Backspace}\n onClick={this.props.onOperatorClick}\n >\n <div className=\"uifw-calculator-button-svg\">\n <Icon iconSpec={backspaceIcon} />\n </div>\n </OperatorButton>\n <OperatorButton\n operator={CalculatorOperator.Divide}\n onClick={this.props.onOperatorClick}\n className=\"uifw-calculator-large-font\"\n >\n ÷\n </OperatorButton>\n\n <ValueButton keyChar=\"7\" onClick={this.props.onValueClick} />\n <ValueButton keyChar=\"8\" onClick={this.props.onValueClick} />\n <ValueButton keyChar=\"9\" onClick={this.props.onValueClick} />\n <OperatorButton\n operator={CalculatorOperator.Multiply}\n onClick={this.props.onOperatorClick}\n className=\"uifw-calculator-large-font\"\n >\n ×\n </OperatorButton>\n\n <ValueButton keyChar=\"4\" onClick={this.props.onValueClick} />\n <ValueButton keyChar=\"5\" onClick={this.props.onValueClick} />\n <ValueButton keyChar=\"6\" onClick={this.props.onValueClick} />\n <OperatorButton\n operator={CalculatorOperator.Subtract}\n onClick={this.props.onOperatorClick}\n className=\"uifw-calculator-large-font\"\n >\n −\n </OperatorButton>\n\n <ValueButton keyChar=\"1\" onClick={this.props.onValueClick} />\n <ValueButton keyChar=\"2\" onClick={this.props.onValueClick} />\n <ValueButton keyChar=\"3\" onClick={this.props.onValueClick} />\n <OperatorButton\n operator={CalculatorOperator.Add}\n onClick={this.props.onOperatorClick}\n className=\"uifw-calculator-large-font\"\n >\n +\n </OperatorButton>\n\n <ValueButton keyChar=\"0\" onClick={this.props.onValueClick} />\n <OperatorButton\n operator={CalculatorOperator.NegPos}\n onClick={this.props.onOperatorClick}\n className=\"uifw-calculator-large-font\"\n >\n ±\n </OperatorButton>\n <OperatorButton\n operator={CalculatorOperator.Decimal}\n onClick={this.props.onOperatorClick}\n className=\"uifw-calculator-large-font\"\n >\n .\n </OperatorButton>\n <OperatorButton\n operator={CalculatorOperator.Equals}\n onClick={this.props.onOperatorClick}\n className=\"uifw-calculator-large-font\"\n >\n =\n </OperatorButton>\n <span />\n </div>\n );\n }\n}\n\ninterface ValueButtonProps extends Omit<SquareButtonProps, \"onClick\"> {\n /** Key to display */\n keyChar: string;\n /** A function to be run when the element is clicked */\n onClick: (key: string) => void;\n}\n\nclass ValueButton extends React.PureComponent<ValueButtonProps> {\n private _handleOnClick = (\n _event: React.MouseEvent<HTMLButtonElement, MouseEvent>\n ) => {\n this.props.onClick(this.props.keyChar);\n };\n\n public override render() {\n const { className, keyChar, onClick, ...props } = this.props;\n\n const itemClassNames = classnames(\"uifw-calculator-item\", className);\n\n return (\n <SquareButton\n {...props}\n className={itemClassNames}\n onClick={this._handleOnClick}\n >\n {keyChar}\n </SquareButton>\n );\n }\n}\n\ninterface OperatorButtonProps extends Omit<SquareButtonProps, \"onClick\"> {\n /** Key to display */\n operator: CalculatorOperator;\n /** A function to be run when the element is clicked */\n onClick: (operator: CalculatorOperator) => void;\n}\n\nclass OperatorButton extends React.PureComponent<OperatorButtonProps> {\n private _handleOnClick = (\n _event: React.MouseEvent<HTMLButtonElement, MouseEvent>\n ) => {\n this.props.onClick(this.props.operator);\n };\n\n public override render() {\n const { className, children, operator, onClick, ...props } = this.props;\n\n const itemClassNames = classnames(\"uifw-calculator-item\", className);\n\n return (\n <SquareButton\n {...props}\n className={itemClassNames}\n onClick={this._handleOnClick}\n >\n {children}\n </SquareButton>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentGroup.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentGroup.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,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GACpB,cAAc,GAAG,SAAS;IAa7B,uFAAuF;IAChF,mBAAmB;IAI1B,4EAA4E;IACrE,kBAAkB,IAAI,cAAc,EAAE;IAe7C,6CAA6C;IACtC,uBAAuB,IAAI,IAAI;IAItC,uCAAuC;IAChC,iBAAiB,IAAI,IAAI;IAEhC,0CAA0C;IACnC,oBAAoB,IAAI,IAAI;IAInC;;OAEG;IACI,MAAM,CAAC,eAAe,CAAC,EAAE,eAAe,GAAG,iBAAiB;IA4BnE;;OAEG;IACI,YAAY,IAAI,KAAK,CAAC,cAAc,GAAG,SAAS,CAAC;CAczD"}
|
|
@@ -144,9 +144,9 @@ class ContentGroup {
|
|
|
144
144
|
const classId = InternalConfigurableUiManager.getConstructorClassId(content.classId);
|
|
145
145
|
if (classId !== undefined)
|
|
146
146
|
content.classId = classId;
|
|
147
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
148
147
|
else
|
|
149
|
-
throw new UiError(
|
|
148
|
+
throw new UiError(// eslint-disable-line deprecation/deprecation
|
|
149
|
+
UiFramework.loggerCategory(this), `toJSON: ContentControl at index ${index} is NOT registered with a string id`);
|
|
150
150
|
if (contentCallback)
|
|
151
151
|
contentCallback(content);
|
|
152
152
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentGroup.js","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentGroup.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EACL,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAC;AA0BhG;;;GAGG;AACH,MAAM,OAAgB,oBAAoB;IAIxC;;OAEG;IACI,kBAAkB,CAAC,iBAAoC;QAC5D,OAAO,iBAAiB,CAA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AAI,OAAO,CAAC,QAAQ,EAAE;gBAC1C,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;aAClC;iBAAM;gBACL,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAC3B;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACnB,CAAC;;AAvMc,iBAAI,GAAG,CAAC,AAAJ,CAAK;SADb,YAAY","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 ContentView\n */\n\nimport type * as React from \"react\";\nimport type { ScreenViewport } from \"@itwin/core-frontend\";\nimport type { ContentLayoutProps } from \"@itwin/appui-abstract\";\nimport { UiError } from \"@itwin/appui-abstract\";\nimport type { ConfigurableUiControlConstructor } from \"../configurableui/ConfigurableUiControl\";\nimport {\n ConfigurableCreateInfo,\n ConfigurableUiControlType,\n} from \"../configurableui/ConfigurableUiControl\";\nimport { UiFramework } from \"../UiFramework\";\nimport type { ContentControl } from \"./ContentControl\";\nimport type { FrontstageConfig } from \"../frontstage/FrontstageConfig\";\nimport { InternalConfigurableUiManager } from \"../configurableui/InternalConfigurableUiManager\";\n\n/** Properties for content displayed in a content view\n * @public\n */\nexport interface ContentProps {\n /** A unique id for the Content View within the group */\n id: string;\n /** The class name or [[ConfigurableUiControlConstructor]] of the content control */\n classId: string | ConfigurableUiControlConstructor;\n /** Optional application data passed down to the Content View */\n applicationData?: any;\n}\n\n/** Properties for a [[ContentGroup]]\n * @public\n */\nexport interface ContentGroupProps {\n /** An id for the [[ContentGroup]]. This id is used to locate a ContentGroup and it also can be used by an ContentGroupProvider to save/restore content settings */\n id: string;\n /** Content Layout Id or complete set of [[ContentLayoutProps]] */\n layout: ContentLayoutProps;\n /** A collection of [[ContentProps]], one for each content view */\n contents: ContentProps[];\n}\n\n/** Abstract class that can be implemented and specified by frontstage to dynamically construct\n * content group just prior to activating the frontstage.\n * @public\n */\nexport abstract class ContentGroupProvider {\n /** Return the contentGroup based on the `FrontstageConfig`. */\n public abstract contentGroup(config: FrontstageConfig): Promise<ContentGroup>;\n\n /** Allow provider to update any data stored in ContentGroupProps. Typically this may\n * be to remove applicationData entries.\n */\n public prepareToSaveProps(contentGroupProps: ContentGroupProps) {\n return contentGroupProps;\n }\n\n /** Allow provider to update any stored ContentGroupProps be it is to be used to create ContentGroup and layouts.\n * Typically this may be to add applicationData to content entries.\n */\n public applyUpdatesToSavedProps(contentGroupProps: ContentGroupProps) {\n return contentGroupProps;\n }\n\n /** Allow provider to save any content group data before the stage deactivated. */\n public async onFrontstageDeactivated() {}\n}\n\n/** Callback to process content properties during toJSON method\n * @public\n */\nexport type ContentCallback = (content: ContentProps) => void;\n\n/** ContentGroup class. Content Groups define content displayed in content views that are laid out using a [[ContentLayout]].\n * @public\n */\nexport class ContentGroup {\n private static _sId = 0;\n public groupId: string;\n public propsId: string;\n public layout: ContentLayoutProps;\n public contentPropsList: ContentProps[];\n private _contentControls = new Map<string, ContentControl>();\n private _contentSetMap = new Map<string, ContentControl>();\n\n public get id() {\n return this.groupId;\n }\n\n constructor(contentGroupProps: ContentGroupProps) {\n this.layout = { ...contentGroupProps.layout };\n this.propsId = contentGroupProps.id;\n // ensure we have a unique groupId for each instance of a content group - this will be used to generate a key in the React controls\n this.groupId = `[${contentGroupProps.id}-${ContentGroup._sId++}]`;\n this.contentPropsList = contentGroupProps.contents;\n }\n\n /** Gets a [[ContentControl]] from the Content Group based on its [[ContentProps]]. */\n public getContentControl(\n contentProps: ContentProps,\n _index: number\n ): ContentControl | undefined {\n // ensure we have a unique control Id for each instance of a content control - this will be used as a key for the React control - see `ContentControl.getKeyedReactNode`\n const id = `${contentProps.id}::${this.groupId}`;\n let contentControl: ContentControl | undefined;\n\n if (!this._contentControls.get(contentProps.id)) {\n let usedClassId: string = \"\";\n\n if (typeof contentProps.classId === \"string\") {\n if (\n !this._contentControls.get(contentProps.id) &&\n UiFramework.controls.isRegistered(contentProps.classId)\n ) {\n contentControl = UiFramework.controls.create(\n contentProps.classId,\n id,\n contentProps.applicationData,\n contentProps.id\n ) as ContentControl;\n usedClassId = contentProps.classId;\n }\n } else {\n const info = new ConfigurableCreateInfo(\n contentProps.classId.name,\n id,\n contentProps.id\n );\n contentControl = new contentProps.classId(\n info,\n contentProps.applicationData\n ) as ContentControl;\n usedClassId = contentProps.classId.name;\n }\n\n if (contentControl) {\n if (\n contentControl.getType() !== ConfigurableUiControlType.Content &&\n contentControl.getType() !== ConfigurableUiControlType.Viewport\n ) {\n // eslint-disable-next-line deprecation/deprecation\n throw new UiError(\n UiFramework.loggerCategory(this),\n `getContentControl error: '${usedClassId}' is NOT a ContentControl or ViewportContentControl`\n );\n }\n contentControl.initialize();\n this._contentControls.set(contentProps.id, contentControl);\n }\n }\n\n return this._contentControls.get(contentProps.id);\n }\n\n /** Gets a [[ContentControl]] from the Content Group with a given ID. */\n public getContentControlById(id: string): ContentControl | undefined {\n return this._contentControls.get(id);\n }\n\n /** Gets the React nodes representing the Content Views in this Content Group. */\n public getContentNodes(): React.ReactNode[] {\n const contentNodes: React.ReactNode[] = new Array<React.ReactNode>();\n\n this._contentSetMap.clear();\n\n this.contentPropsList.forEach(\n (contentProps: ContentProps, index: number) => {\n const control = this.getContentControl(contentProps, index);\n if (control) {\n contentNodes.push(control.reactNode);\n this._contentSetMap.set(control.controlId, control);\n }\n }\n );\n\n return contentNodes;\n }\n\n /** Gets the [[ContentControl]] associated with a given React node representing a Content View. */\n public getControlFromElement(\n node: React.ReactNode\n ): ContentControl | undefined {\n if (this._contentSetMap.size === 0) this.getContentNodes();\n\n if (node && (node as React.ReactElement<any>).key) {\n const key = (node as React.ReactElement<any>).key as string;\n // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id\n const controlId = key.split(\"::\", 1)[0];\n return this._contentSetMap.get(controlId);\n }\n\n return undefined;\n }\n\n /** Refreshes the React nodes representing the Content Views in this Content Group.. */\n public refreshContentNodes() {\n this._contentSetMap.clear();\n }\n\n /** Gets an array of the content controls representing the Content Views. */\n public getContentControls(): ContentControl[] {\n const contentControls: ContentControl[] = new Array<ContentControl>();\n\n this.contentPropsList.forEach(\n (contentProps: ContentProps, index: number) => {\n const control = this.getContentControl(contentProps, index);\n if (control) {\n contentControls.push(control);\n }\n }\n );\n\n return contentControls;\n }\n\n /** Called when Frontstage is deactivated. */\n public onFrontstageDeactivated(): void {\n this.clearContentControls();\n }\n\n /** Called when Frontstage is ready. */\n public onFrontstageReady(): void {}\n\n /** Clears the map of content controls. */\n public clearContentControls(): void {\n this._contentControls.clear();\n }\n\n /** Creates [[ContentGroupProps]] for JSON purposes\n * @public\n */\n public toJSON(contentCallback?: ContentCallback): ContentGroupProps {\n const contentGroupProps: ContentGroupProps = {\n id: this.propsId,\n layout: this.layout,\n contents: this.contentPropsList,\n };\n\n contentGroupProps.contents.forEach(\n (content: ContentProps, index: number) => {\n if (typeof content.classId !== \"string\") {\n const classId = InternalConfigurableUiManager.getConstructorClassId(\n content.classId\n );\n if (classId !== undefined) content.classId = classId;\n // eslint-disable-next-line deprecation/deprecation\n else\n throw new UiError(\n UiFramework.loggerCategory(this),\n `toJSON: ContentControl at index ${index} is NOT registered with a string id`\n );\n\n if (contentCallback) contentCallback(content);\n }\n }\n );\n\n return contentGroupProps;\n }\n\n /** Gets Viewports from Viewport Content Controls\n * @internal\n */\n public getViewports(): Array<ScreenViewport | undefined> {\n const contentControls = this.getContentControls();\n const viewports = new Array<ScreenViewport | undefined>();\n\n contentControls.forEach((control: ContentControl) => {\n if (control.isViewport && control.viewport) {\n viewports.push(control.viewport);\n } else {\n viewports.push(undefined);\n }\n });\n\n return viewports;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ContentGroup.js","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentGroup.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG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J,IAAI,eAAe;oBAAE,eAAe,CAAC,OAAO,CAAC,CAAC;aAC/C;QACH,CAAC,CACF,CAAC;QAEF,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,YAAY;QACjB,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAClD,MAAM,SAAS,GAAG,IAAI,KAAK,EAA8B,CAAC;QAE1D,eAAe,CAAC,OAAO,CAAC,CAAC,OAAuB,EAAE,EAAE;YAClD,IAAI,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,QAAQ,EAAE;gBAC1C,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;aAClC;iBAAM;gBACL,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAC3B;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACnB,CAAC;;AAtMc,iBAAI,GAAG,CAAC,AAAJ,CAAK;SADb,YAAY","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 ContentView\n */\n\nimport type * as React from \"react\";\nimport type { ScreenViewport } from \"@itwin/core-frontend\";\nimport type { ContentLayoutProps } from \"@itwin/appui-abstract\";\nimport { UiError } from \"@itwin/appui-abstract\";\nimport type { ConfigurableUiControlConstructor } from \"../configurableui/ConfigurableUiControl\";\nimport {\n ConfigurableCreateInfo,\n ConfigurableUiControlType,\n} from \"../configurableui/ConfigurableUiControl\";\nimport { UiFramework } from \"../UiFramework\";\nimport type { ContentControl } from \"./ContentControl\";\nimport type { FrontstageConfig } from \"../frontstage/FrontstageConfig\";\nimport { InternalConfigurableUiManager } from \"../configurableui/InternalConfigurableUiManager\";\n\n/** Properties for content displayed in a content view\n * @public\n */\nexport interface ContentProps {\n /** A unique id for the Content View within the group */\n id: string;\n /** The class name or [[ConfigurableUiControlConstructor]] of the content control */\n classId: string | ConfigurableUiControlConstructor;\n /** Optional application data passed down to the Content View */\n applicationData?: any;\n}\n\n/** Properties for a [[ContentGroup]]\n * @public\n */\nexport interface ContentGroupProps {\n /** An id for the [[ContentGroup]]. This id is used to locate a ContentGroup and it also can be used by an ContentGroupProvider to save/restore content settings */\n id: string;\n /** Content Layout Id or complete set of [[ContentLayoutProps]] */\n layout: ContentLayoutProps;\n /** A collection of [[ContentProps]], one for each content view */\n contents: ContentProps[];\n}\n\n/** Abstract class that can be implemented and specified by frontstage to dynamically construct\n * content group just prior to activating the frontstage.\n * @public\n */\nexport abstract class ContentGroupProvider {\n /** Return the contentGroup based on the `FrontstageConfig`. */\n public abstract contentGroup(config: FrontstageConfig): Promise<ContentGroup>;\n\n /** Allow provider to update any data stored in ContentGroupProps. Typically this may\n * be to remove applicationData entries.\n */\n public prepareToSaveProps(contentGroupProps: ContentGroupProps) {\n return contentGroupProps;\n }\n\n /** Allow provider to update any stored ContentGroupProps be it is to be used to create ContentGroup and layouts.\n * Typically this may be to add applicationData to content entries.\n */\n public applyUpdatesToSavedProps(contentGroupProps: ContentGroupProps) {\n return contentGroupProps;\n }\n\n /** Allow provider to save any content group data before the stage deactivated. */\n public async onFrontstageDeactivated() {}\n}\n\n/** Callback to process content properties during toJSON method\n * @public\n */\nexport type ContentCallback = (content: ContentProps) => void;\n\n/** ContentGroup class. Content Groups define content displayed in content views that are laid out using a [[ContentLayout]].\n * @public\n */\nexport class ContentGroup {\n private static _sId = 0;\n public groupId: string;\n public propsId: string;\n public layout: ContentLayoutProps;\n public contentPropsList: ContentProps[];\n private _contentControls = new Map<string, ContentControl>();\n private _contentSetMap = new Map<string, ContentControl>();\n\n public get id() {\n return this.groupId;\n }\n\n constructor(contentGroupProps: ContentGroupProps) {\n this.layout = { ...contentGroupProps.layout };\n this.propsId = contentGroupProps.id;\n // ensure we have a unique groupId for each instance of a content group - this will be used to generate a key in the React controls\n this.groupId = `[${contentGroupProps.id}-${ContentGroup._sId++}]`;\n this.contentPropsList = contentGroupProps.contents;\n }\n\n /** Gets a [[ContentControl]] from the Content Group based on its [[ContentProps]]. */\n public getContentControl(\n contentProps: ContentProps,\n _index: number\n ): ContentControl | undefined {\n // ensure we have a unique control Id for each instance of a content control - this will be used as a key for the React control - see `ContentControl.getKeyedReactNode`\n const id = `${contentProps.id}::${this.groupId}`;\n let contentControl: ContentControl | undefined;\n\n if (!this._contentControls.get(contentProps.id)) {\n let usedClassId: string = \"\";\n\n if (typeof contentProps.classId === \"string\") {\n if (\n !this._contentControls.get(contentProps.id) &&\n UiFramework.controls.isRegistered(contentProps.classId)\n ) {\n contentControl = UiFramework.controls.create(\n contentProps.classId,\n id,\n contentProps.applicationData,\n contentProps.id\n ) as ContentControl;\n usedClassId = contentProps.classId;\n }\n } else {\n const info = new ConfigurableCreateInfo(\n contentProps.classId.name,\n id,\n contentProps.id\n );\n contentControl = new contentProps.classId(\n info,\n contentProps.applicationData\n ) as ContentControl;\n usedClassId = contentProps.classId.name;\n }\n\n if (contentControl) {\n if (\n contentControl.getType() !== ConfigurableUiControlType.Content &&\n contentControl.getType() !== ConfigurableUiControlType.Viewport\n ) {\n // eslint-disable-next-line deprecation/deprecation\n throw new UiError(\n UiFramework.loggerCategory(this),\n `getContentControl error: '${usedClassId}' is NOT a ContentControl or ViewportContentControl`\n );\n }\n contentControl.initialize();\n this._contentControls.set(contentProps.id, contentControl);\n }\n }\n\n return this._contentControls.get(contentProps.id);\n }\n\n /** Gets a [[ContentControl]] from the Content Group with a given ID. */\n public getContentControlById(id: string): ContentControl | undefined {\n return this._contentControls.get(id);\n }\n\n /** Gets the React nodes representing the Content Views in this Content Group. */\n public getContentNodes(): React.ReactNode[] {\n const contentNodes: React.ReactNode[] = new Array<React.ReactNode>();\n\n this._contentSetMap.clear();\n\n this.contentPropsList.forEach(\n (contentProps: ContentProps, index: number) => {\n const control = this.getContentControl(contentProps, index);\n if (control) {\n contentNodes.push(control.reactNode);\n this._contentSetMap.set(control.controlId, control);\n }\n }\n );\n\n return contentNodes;\n }\n\n /** Gets the [[ContentControl]] associated with a given React node representing a Content View. */\n public getControlFromElement(\n node: React.ReactNode\n ): ContentControl | undefined {\n if (this._contentSetMap.size === 0) this.getContentNodes();\n\n if (node && (node as React.ReactElement<any>).key) {\n const key = (node as React.ReactElement<any>).key as string;\n // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id\n const controlId = key.split(\"::\", 1)[0];\n return this._contentSetMap.get(controlId);\n }\n\n return undefined;\n }\n\n /** Refreshes the React nodes representing the Content Views in this Content Group.. */\n public refreshContentNodes() {\n this._contentSetMap.clear();\n }\n\n /** Gets an array of the content controls representing the Content Views. */\n public getContentControls(): ContentControl[] {\n const contentControls: ContentControl[] = new Array<ContentControl>();\n\n this.contentPropsList.forEach(\n (contentProps: ContentProps, index: number) => {\n const control = this.getContentControl(contentProps, index);\n if (control) {\n contentControls.push(control);\n }\n }\n );\n\n return contentControls;\n }\n\n /** Called when Frontstage is deactivated. */\n public onFrontstageDeactivated(): void {\n this.clearContentControls();\n }\n\n /** Called when Frontstage is ready. */\n public onFrontstageReady(): void {}\n\n /** Clears the map of content controls. */\n public clearContentControls(): void {\n this._contentControls.clear();\n }\n\n /** Creates [[ContentGroupProps]] for JSON purposes\n * @public\n */\n public toJSON(contentCallback?: ContentCallback): ContentGroupProps {\n const contentGroupProps: ContentGroupProps = {\n id: this.propsId,\n layout: this.layout,\n contents: this.contentPropsList,\n };\n\n contentGroupProps.contents.forEach(\n (content: ContentProps, index: number) => {\n if (typeof content.classId !== \"string\") {\n const classId = InternalConfigurableUiManager.getConstructorClassId(\n content.classId\n );\n if (classId !== undefined) content.classId = classId;\n else\n throw new UiError( // eslint-disable-line deprecation/deprecation\n UiFramework.loggerCategory(this),\n `toJSON: ContentControl at index ${index} is NOT registered with a string id`\n );\n\n if (contentCallback) contentCallback(content);\n }\n }\n );\n\n return contentGroupProps;\n }\n\n /** Gets Viewports from Viewport Content Controls\n * @internal\n */\n public getViewports(): Array<ScreenViewport | undefined> {\n const contentControls = this.getContentControls();\n const viewports = new Array<ScreenViewport | undefined>();\n\n contentControls.forEach((control: ContentControl) => {\n if (control.isViewport && control.viewport) {\n viewports.push(control.viewport);\n } else {\n viewports.push(undefined);\n }\n });\n\n return viewports;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelViewport.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/content/IModelViewport.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,SAAS,EACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGnE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAItF,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAMlE;;GAEG;AACH,eAAO,MAAM,uBAAuB,yEAGhB,CAAC;AAErB;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,oDAAoD;IACpD,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,2CAA2C;IAC3C,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,CAAC,MAAM,gBAAgB,CAAC,CAAC;IAC/D,iFAAiF;IACjF,cAAc,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACxC,kGAAkG;IAClG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gHAAgH;IAChH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,iHAAiH;IACjH,iBAAiB,CAAC,EAAE,CAAC,S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
viewState = this._viewState;
|
|
63
63
|
}
|
|
64
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
65
64
|
else
|
|
66
|
-
throw new UiError(
|
|
65
|
+
throw new UiError(// eslint-disable-line deprecation/deprecation
|
|
66
|
+
UiFramework.loggerCategory(this), "No ViewState could be determined");
|
|
67
67
|
return viewState;
|
|
68
68
|
};
|
|
69
69
|
/** Get the default ViewOverlay unless parameter is set to not use it. May be override in an application specific sub-class */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelViewport.js","sourceRoot":"","sources":["../../../../src/appui-react/content/IModelViewport.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,oCAAoC,EAAE,MAAM,iDAAiD,CAAC;AACvG,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,mCAAmC,CACxE,IAAI,EACJ,IAAI,CACL,CAAC,iBAAiB,CAAC,CAAC;AA2BrB;;GAEG;AACH,uBAAuB;AACvB,MAAM,UAAU,eAAe,CAAC,EAC9B,QAAQ,EACR,cAAc,EACd,mBAAmB,GACE;IACrB,MAAM,kBAAkB,GAAG,WAAW,CAAC,CAAC,KAAqB,EAAE,EAAE;QAC/D,M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AAC,QAAQ,GAAG,CAAC,CAAC;gBACvD,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,SAAS;oBACpC,WAAW,CAAC,WAAW,CAAC,mBAAmB,EAAE,yBAAyB,CACpE,CAAC,CACF,CAAC;YACN,CAAC,EACD,cAAc,EAAE,IAAI,CAAC,eAAe,GACpC,CACH,CAAC;IACJ,CAAC;IAED,kFAAkF;IACxE,wBAAwB,CAChC,QAAsC;QAEtC,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC;QAC9D,OAAO,oBAAC,YAAY;;YAAG,SAAS;gBAAiB,CAAC;IACpD,CAAC;IAED,uDAAuD;IACvC,oCAAoC,CAClD,gBAAkC,EAClC,uBAAmC,EACnC,SAAoB,EACpB,KAAa;QAEb,OAAO,IAAI,CAAC,6BAA6B,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;IACzE,CAAC;IAcD,uEAAuE;IACvE,IAAoB,oBAAoB;QACtC,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO,KAAK,CAAC,oBAAoB,CAAC;;YAChD,OAAO,oCAAoC,CAAC,eAAe,CAAC;IACnE,CAAC;CACF;AAED,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,EAAE,qBAAqB,CAAC,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 ContentView\n */\n\nimport * as React from \"react\";\nimport type { Id64String } from \"@itwin/core-bentley\";\nimport type {\n IModelConnection,\n ScreenViewport,\n ViewState,\n} from \"@itwin/core-frontend\";\nimport type { ViewStateProp } from \"@itwin/imodel-components-react\";\nimport { ViewportComponent } from \"@itwin/imodel-components-react\";\nimport { FillCentered } from \"@itwin/core-react\";\n\nimport type { ConfigurableCreateInfo } from \"../configurableui/ConfigurableUiControl\";\nimport { connectIModelConnectionAndViewState } from \"../redux/connectIModel\";\nimport { UiFramework } from \"../UiFramework\";\nimport { DefaultViewOverlay } from \"./DefaultViewOverlay\";\nimport { ViewportContentControl } from \"./ViewportContentControl\";\nimport { StandardRotationNavigationAidControl } from \"../navigationaids/StandardRotationNavigationAid\";\nimport { UiError } from \"@itwin/appui-abstract\";\nimport { useSelector } from \"react-redux\";\nimport type { FrameworkState } from \"../redux/FrameworkState\";\n\n/** Viewport that is connected to the IModelConnection property in the Redux store. The application must set up the Redux store and include the FrameworkReducer.\n * @public\n */\nexport const IModelConnectedViewport = connectIModelConnectionAndViewState(\n null,\n null\n)(ViewportComponent);\n\n/** [[IModelViewportControl]] options. These options are set in the applicationData property of the [[ContentProps]].\n * @public\n */\nexport interface IModelViewportControlOptions {\n /** ViewState or a function to return a ViewState */\n viewState?: ViewStateProp;\n /** IModelConnection of data in Viewport */\n iModelConnection?: IModelConnection | (() => IModelConnection);\n /** Map of options that can be used to enable/disable features within the view */\n featureOptions?: { [key: string]: any };\n /** Optional background color which may be used if viewState and iModelConnection are undefined */\n bgColor?: string;\n /** Optional property to always use the supplied `viewState` property instead of using viewport.view when set */\n alwaysUseSuppliedViewState?: boolean;\n /** Optional property to supply custom view overlay. Uses when caller want to supply custom overlay component. */\n supplyViewOverlay?: (_viewport: ScreenViewport) => React.ReactNode;\n /** Optional property to defer reactNode initialization until first reactNode property is needed. Useful when subclassing the `IModelViewportControl`. */\n deferNodeInitialization?: boolean;\n}\n\ninterface ViewOverlayHostProps {\n viewport: ScreenViewport;\n featureOptions?: { [key: string]: any };\n userSuppliedOverlay?: (_viewport: ScreenViewport) => React.ReactNode;\n}\n/** View Overlay component -- exported for testing\n * @internal\n */\n// istanbul ignore next\nexport function ViewOverlayHost({\n viewport,\n featureOptions,\n userSuppliedOverlay,\n}: ViewOverlayHostProps) {\n const displayViewOverlay = useSelector((state: FrameworkState) => {\n const frameworkState: FrameworkState = (state as any)[\n UiFramework.frameworkStateKey\n ];\n return frameworkState\n ? frameworkState.configurableUiState.viewOverlayDisplay\n : true;\n });\n if (!displayViewOverlay) return null;\n return userSuppliedOverlay ? (\n <React.Fragment>{userSuppliedOverlay(viewport)}</React.Fragment>\n ) : (\n <DefaultViewOverlay viewport={viewport} featureOptions={featureOptions} />\n );\n}\n/** iModel Viewport Control\n * @public\n */\n// istanbul ignore next\nexport class IModelViewportControl extends ViewportContentControl {\n public static get id() {\n return \"UiFramework.IModelViewportControl\";\n }\n protected _featureOptions: { [key: string]: boolean | string } = {};\n protected _viewState: ViewStateProp | undefined;\n protected _iModelConnection: IModelConnection | undefined;\n protected _alwaysUseSuppliedViewState: boolean;\n private _userSuppliedViewOverlay?: (\n _viewport: ScreenViewport\n ) => React.ReactNode;\n\n constructor(\n info: ConfigurableCreateInfo,\n protected _options: IModelViewportControlOptions\n ) {\n _options = _options ?? {};\n super(info, _options);\n this._options = _options;\n\n if (_options.featureOptions) this._featureOptions = _options.featureOptions;\n this._alwaysUseSuppliedViewState =\n _options.alwaysUseSuppliedViewState ?? false;\n this._userSuppliedViewOverlay = _options.supplyViewOverlay;\n\n if (!_options.deferNodeInitialization) this.initializeReactNode();\n }\n\n protected initializeReactNode() {\n const options = this._options;\n\n if (options.viewState) this._viewState = options.viewState;\n\n const iModelConnection =\n typeof options.iModelConnection === \"function\"\n ? options.iModelConnection()\n : options.iModelConnection;\n\n if (this._viewState && iModelConnection) {\n /** Passing _determineViewState as a function reference; it is not called here. */\n this._reactNode = this.getImodelViewportReactElement(\n iModelConnection,\n this._determineViewState\n );\n } else {\n if (\n UiFramework.getIModelConnection() &&\n UiFramework.getDefaultViewState()\n ) {\n this._reactNode = this.getImodelConnectedViewportReactElement();\n } else {\n this._reactNode = this.getNoContentReactElement(options);\n this.setIsReady();\n }\n }\n }\n\n protected override getReactNode(): React.ReactNode {\n if (\n !React.isValidElement(this._reactNode) &&\n this._options.deferNodeInitialization\n )\n this.initializeReactNode();\n\n return this.getKeyedReactNode();\n }\n\n /**\n * This is passed as a function to the ViewportComponent as the `viewState` prop in getImodelViewportReactElement().\n * It is called by ViewportComponent on a mount to resolve the viewState.\n */\n private _determineViewState = (): ViewState => {\n let viewState: ViewState;\n\n if (this.viewport && !this._alwaysUseSuppliedViewState)\n viewState = this.viewport.view;\n else if (this._viewState) {\n if (typeof this._viewState === \"function\") viewState = this._viewState();\n else viewState = this._viewState;\n }\n // eslint-disable-next-line deprecation/deprecation\n else\n throw new UiError(\n UiFramework.loggerCategory(this),\n \"No ViewState could be determined\"\n );\n\n return viewState!;\n };\n\n /** Get the React component that will contain the Viewport */\n protected getImodelConnectedViewportReactElement(): React.ReactNode {\n return (\n <IModelConnectedViewport\n viewportRef={(v: ScreenViewport) => {\n this.viewport = v;\n // for convenience, if window defined bind viewport to window\n if (undefined !== window) (window as any).viewport = v;\n if (!UiFramework.frontstages.isLoading)\n UiFramework.frontstages.activeFrontstageDef?.setActiveViewFromViewport(\n v\n );\n }}\n getViewOverlay={this._getViewOverlay}\n />\n );\n }\n\n /** Get the React component that will contain the Viewport */\n protected getImodelViewportReactElement(\n iModelConnection: IModelConnection,\n viewState: ViewStateProp\n ): React.ReactNode {\n return (\n <ViewportComponent\n viewState={viewState}\n imodel={iModelConnection}\n controlId={this.controlId}\n viewportRef={(v: ScreenViewport) => {\n this.viewport = v;\n // for convenience, if window defined bind viewport to window\n if (undefined !== window) (window as any).viewport = v;\n if (!UiFramework.frontstages.isLoading)\n UiFramework.frontstages.activeFrontstageDef?.setActiveViewFromViewport(\n v\n );\n }}\n getViewOverlay={this._getViewOverlay}\n />\n );\n }\n\n /** Get the React component that will be shown when no iModel data is available */\n protected getNoContentReactElement(\n _options: IModelViewportControlOptions\n ): React.ReactNode {\n const noContent = UiFramework.translate(\"general.no-content\");\n return <FillCentered> {noContent} </FillCentered>;\n }\n\n /** Get the React.Element for a ViewSelector change. */\n public override getReactElementForViewSelectorChange(\n iModelConnection: IModelConnection,\n _unusedViewDefinitionId: Id64String,\n viewState: ViewState,\n _name: string\n ): React.ReactNode {\n return this.getImodelViewportReactElement(iModelConnection, viewState);\n }\n\n /** Get the default ViewOverlay unless parameter is set to not use it. May be override in an application specific sub-class */\n protected _getViewOverlay = (vp: ScreenViewport): React.ReactNode => {\n return (\n <ViewOverlayHost\n viewport={vp}\n featureOptions={this._featureOptions}\n userSuppliedOverlay={this._userSuppliedViewOverlay}\n data-testid=\"ViewOverlay\"\n />\n );\n };\n\n /** Get the NavigationAidControl associated with this ContentControl */\n public override get navigationAidControl(): string {\n if (this.viewport) return super.navigationAidControl;\n else return StandardRotationNavigationAidControl.navigationAidId;\n }\n}\n\nUiFramework.controls.register(IModelViewportControl.id, IModelViewportControl);\n"]}
|
|
1
|
+
{"version":3,"file":"IModelViewport.js","sourceRoot":"","sources":["../../../../src/appui-react/content/IModelViewport.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,oCAAoC,EAAE,MAAM,iDAAiD,CAAC;AACvG,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,mCAAmC,CACxE,IAAI,EACJ,IAAI,CACL,CAAC,iBAAiB,CAAC,CAAC;AA2BrB;;GAEG;AACH,uBAAuB;AACvB,MAAM,UAAU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AAC,CAAiB,EAAE,EAAE;gBACjC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;gBAClB,6DAA6D;gBAC7D,IAAI,SAAS,KAAK,MAAM;oBAAG,MAAc,CAAC,QAAQ,GAAG,CAAC,CAAC;gBACvD,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,SAAS;oBACpC,WAAW,CAAC,WAAW,CAAC,mBAAmB,EAAE,yBAAyB,CACpE,CAAC,CACF,CAAC;YACN,CAAC,EACD,cAAc,EAAE,IAAI,CAAC,eAAe,GACpC,CACH,CAAC;IACJ,CAAC;IAED,kFAAkF;IACxE,wBAAwB,CAChC,QAAsC;QAEtC,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC;QAC9D,OAAO,oBAAC,YAAY;;YAAG,SAAS;gBAAiB,CAAC;IACpD,CAAC;IAED,uDAAuD;IACvC,oCAAoC,CAClD,gBAAkC,EAClC,uBAAmC,EACnC,SAAoB,EACpB,KAAa;QAEb,OAAO,IAAI,CAAC,6BAA6B,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;IACzE,CAAC;IAcD,uEAAuE;IACvE,IAAoB,oBAAoB;QACtC,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO,KAAK,CAAC,oBAAoB,CAAC;;YAChD,OAAO,oCAAoC,CAAC,eAAe,CAAC;IACnE,CAAC;CACF;AAED,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,EAAE,qBAAqB,CAAC,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 ContentView\n */\n\nimport * as React from \"react\";\nimport type { Id64String } from \"@itwin/core-bentley\";\nimport type {\n IModelConnection,\n ScreenViewport,\n ViewState,\n} from \"@itwin/core-frontend\";\nimport type { ViewStateProp } from \"@itwin/imodel-components-react\";\nimport { ViewportComponent } from \"@itwin/imodel-components-react\";\nimport { FillCentered } from \"@itwin/core-react\";\n\nimport type { ConfigurableCreateInfo } from \"../configurableui/ConfigurableUiControl\";\nimport { connectIModelConnectionAndViewState } from \"../redux/connectIModel\";\nimport { UiFramework } from \"../UiFramework\";\nimport { DefaultViewOverlay } from \"./DefaultViewOverlay\";\nimport { ViewportContentControl } from \"./ViewportContentControl\";\nimport { StandardRotationNavigationAidControl } from \"../navigationaids/StandardRotationNavigationAid\";\nimport { UiError } from \"@itwin/appui-abstract\";\nimport { useSelector } from \"react-redux\";\nimport type { FrameworkState } from \"../redux/FrameworkState\";\n\n/** Viewport that is connected to the IModelConnection property in the Redux store. The application must set up the Redux store and include the FrameworkReducer.\n * @public\n */\nexport const IModelConnectedViewport = connectIModelConnectionAndViewState(\n null,\n null\n)(ViewportComponent);\n\n/** [[IModelViewportControl]] options. These options are set in the applicationData property of the [[ContentProps]].\n * @public\n */\nexport interface IModelViewportControlOptions {\n /** ViewState or a function to return a ViewState */\n viewState?: ViewStateProp;\n /** IModelConnection of data in Viewport */\n iModelConnection?: IModelConnection | (() => IModelConnection);\n /** Map of options that can be used to enable/disable features within the view */\n featureOptions?: { [key: string]: any };\n /** Optional background color which may be used if viewState and iModelConnection are undefined */\n bgColor?: string;\n /** Optional property to always use the supplied `viewState` property instead of using viewport.view when set */\n alwaysUseSuppliedViewState?: boolean;\n /** Optional property to supply custom view overlay. Uses when caller want to supply custom overlay component. */\n supplyViewOverlay?: (_viewport: ScreenViewport) => React.ReactNode;\n /** Optional property to defer reactNode initialization until first reactNode property is needed. Useful when subclassing the `IModelViewportControl`. */\n deferNodeInitialization?: boolean;\n}\n\ninterface ViewOverlayHostProps {\n viewport: ScreenViewport;\n featureOptions?: { [key: string]: any };\n userSuppliedOverlay?: (_viewport: ScreenViewport) => React.ReactNode;\n}\n/** View Overlay component -- exported for testing\n * @internal\n */\n// istanbul ignore next\nexport function ViewOverlayHost({\n viewport,\n featureOptions,\n userSuppliedOverlay,\n}: ViewOverlayHostProps) {\n const displayViewOverlay = useSelector((state: FrameworkState) => {\n const frameworkState: FrameworkState = (state as any)[\n UiFramework.frameworkStateKey\n ];\n return frameworkState\n ? frameworkState.configurableUiState.viewOverlayDisplay\n : true;\n });\n if (!displayViewOverlay) return null;\n return userSuppliedOverlay ? (\n <React.Fragment>{userSuppliedOverlay(viewport)}</React.Fragment>\n ) : (\n <DefaultViewOverlay viewport={viewport} featureOptions={featureOptions} />\n );\n}\n/** iModel Viewport Control\n * @public\n */\n// istanbul ignore next\nexport class IModelViewportControl extends ViewportContentControl {\n public static get id() {\n return \"UiFramework.IModelViewportControl\";\n }\n protected _featureOptions: { [key: string]: boolean | string } = {};\n protected _viewState: ViewStateProp | undefined;\n protected _iModelConnection: IModelConnection | undefined;\n protected _alwaysUseSuppliedViewState: boolean;\n private _userSuppliedViewOverlay?: (\n _viewport: ScreenViewport\n ) => React.ReactNode;\n\n constructor(\n info: ConfigurableCreateInfo,\n protected _options: IModelViewportControlOptions\n ) {\n _options = _options ?? {};\n super(info, _options);\n this._options = _options;\n\n if (_options.featureOptions) this._featureOptions = _options.featureOptions;\n this._alwaysUseSuppliedViewState =\n _options.alwaysUseSuppliedViewState ?? false;\n this._userSuppliedViewOverlay = _options.supplyViewOverlay;\n\n if (!_options.deferNodeInitialization) this.initializeReactNode();\n }\n\n protected initializeReactNode() {\n const options = this._options;\n\n if (options.viewState) this._viewState = options.viewState;\n\n const iModelConnection =\n typeof options.iModelConnection === \"function\"\n ? options.iModelConnection()\n : options.iModelConnection;\n\n if (this._viewState && iModelConnection) {\n /** Passing _determineViewState as a function reference; it is not called here. */\n this._reactNode = this.getImodelViewportReactElement(\n iModelConnection,\n this._determineViewState\n );\n } else {\n if (\n UiFramework.getIModelConnection() &&\n UiFramework.getDefaultViewState()\n ) {\n this._reactNode = this.getImodelConnectedViewportReactElement();\n } else {\n this._reactNode = this.getNoContentReactElement(options);\n this.setIsReady();\n }\n }\n }\n\n protected override getReactNode(): React.ReactNode {\n if (\n !React.isValidElement(this._reactNode) &&\n this._options.deferNodeInitialization\n )\n this.initializeReactNode();\n\n return this.getKeyedReactNode();\n }\n\n /**\n * This is passed as a function to the ViewportComponent as the `viewState` prop in getImodelViewportReactElement().\n * It is called by ViewportComponent on a mount to resolve the viewState.\n */\n private _determineViewState = (): ViewState => {\n let viewState: ViewState;\n\n if (this.viewport && !this._alwaysUseSuppliedViewState)\n viewState = this.viewport.view;\n else if (this._viewState) {\n if (typeof this._viewState === \"function\") viewState = this._viewState();\n else viewState = this._viewState;\n } else\n throw new UiError( // eslint-disable-line deprecation/deprecation\n UiFramework.loggerCategory(this),\n \"No ViewState could be determined\"\n );\n\n return viewState!;\n };\n\n /** Get the React component that will contain the Viewport */\n protected getImodelConnectedViewportReactElement(): React.ReactNode {\n return (\n <IModelConnectedViewport\n viewportRef={(v: ScreenViewport) => {\n this.viewport = v;\n // for convenience, if window defined bind viewport to window\n if (undefined !== window) (window as any).viewport = v;\n if (!UiFramework.frontstages.isLoading)\n UiFramework.frontstages.activeFrontstageDef?.setActiveViewFromViewport(\n v\n );\n }}\n getViewOverlay={this._getViewOverlay}\n />\n );\n }\n\n /** Get the React component that will contain the Viewport */\n protected getImodelViewportReactElement(\n iModelConnection: IModelConnection,\n viewState: ViewStateProp\n ): React.ReactNode {\n return (\n <ViewportComponent\n viewState={viewState}\n imodel={iModelConnection}\n controlId={this.controlId}\n viewportRef={(v: ScreenViewport) => {\n this.viewport = v;\n // for convenience, if window defined bind viewport to window\n if (undefined !== window) (window as any).viewport = v;\n if (!UiFramework.frontstages.isLoading)\n UiFramework.frontstages.activeFrontstageDef?.setActiveViewFromViewport(\n v\n );\n }}\n getViewOverlay={this._getViewOverlay}\n />\n );\n }\n\n /** Get the React component that will be shown when no iModel data is available */\n protected getNoContentReactElement(\n _options: IModelViewportControlOptions\n ): React.ReactNode {\n const noContent = UiFramework.translate(\"general.no-content\");\n return <FillCentered> {noContent} </FillCentered>;\n }\n\n /** Get the React.Element for a ViewSelector change. */\n public override getReactElementForViewSelectorChange(\n iModelConnection: IModelConnection,\n _unusedViewDefinitionId: Id64String,\n viewState: ViewState,\n _name: string\n ): React.ReactNode {\n return this.getImodelViewportReactElement(iModelConnection, viewState);\n }\n\n /** Get the default ViewOverlay unless parameter is set to not use it. May be override in an application specific sub-class */\n protected _getViewOverlay = (vp: ScreenViewport): React.ReactNode => {\n return (\n <ViewOverlayHost\n viewport={vp}\n featureOptions={this._featureOptions}\n userSuppliedOverlay={this._userSuppliedViewOverlay}\n data-testid=\"ViewOverlay\"\n />\n );\n };\n\n /** Get the NavigationAidControl associated with this ContentControl */\n public override get navigationAidControl(): string {\n if (this.viewport) return super.navigationAidControl;\n else return StandardRotationNavigationAidControl.navigationAidId;\n }\n}\n\nUiFramework.controls.register(IModelViewportControl.id, IModelViewportControl);\n"]}
|
|
@@ -42,12 +42,12 @@ export class ValidationTextbox extends React.PureComponent {
|
|
|
42
42
|
this._handleKeyUp = (event) => {
|
|
43
43
|
this.processValidateText(event.target);
|
|
44
44
|
switch (event.key) {
|
|
45
|
-
case Key.Escape:
|
|
45
|
+
case Key.Escape.valueOf():
|
|
46
46
|
// istanbul ignore else
|
|
47
47
|
if (this.props.onEscPressed)
|
|
48
48
|
this.props.onEscPressed();
|
|
49
49
|
break;
|
|
50
|
-
case Key.Enter:
|
|
50
|
+
case Key.Enter.valueOf():
|
|
51
51
|
// istanbul ignore else
|
|
52
52
|
if (this.props.onEnterPressed)
|
|
53
53
|
this.props.onEnterPressed();
|