@itwin/imodel-components-react 4.1.0-dev.0 → 4.1.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 +33 -2
- package/lib/cjs/imodel-components-react/UiIModelComponents.js +4 -2
- package/lib/cjs/imodel-components-react/UiIModelComponents.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts +1 -1
- package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/AlphaSlider.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.js +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/HueSlider.d.ts +2 -2
- package/lib/cjs/imodel-components-react/color/HueSlider.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/HueSlider.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts +1 -1
- package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/SaturationPicker.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/Swatch.d.ts +2 -2
- package/lib/cjs/imodel-components-react/color/Swatch.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/Swatch.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.d.ts +1 -1
- package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js.map +1 -1
- package/lib/cjs/imodel-components-react/editors/ColorEditor.d.ts +3 -2
- package/lib/cjs/imodel-components-react/editors/ColorEditor.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/editors/ColorEditor.js.map +1 -1
- package/lib/cjs/imodel-components-react/editors/WeightEditor.d.ts +3 -2
- package/lib/cjs/imodel-components-react/editors/WeightEditor.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/editors/WeightEditor.js.map +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.d.ts +2 -2
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.js.map +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts +2 -2
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
- package/lib/cjs/imodel-components-react/lineweight/Swatch.d.ts +2 -2
- package/lib/cjs/imodel-components-react/lineweight/Swatch.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/lineweight/Swatch.js.map +1 -1
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.d.ts +2 -2
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/Cube.d.ts +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/Cube.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/Cube.js.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +3 -2
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js +50 -23
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +3 -2
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.d.ts +3 -2
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.d.ts +2 -2
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js +3 -2
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts +2 -2
- package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js +2 -2
- package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.d.ts +2 -2
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.js +2 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +2 -2
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js +2 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.d.ts +2 -2
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js +9 -5
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +2 -2
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js +4 -3
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +3 -3
- package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.d.ts +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.d.ts +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +2 -2
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +2 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +2 -2
- package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +2 -2
- package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +2 -2
- package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.d.ts +1 -1
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts +1 -1
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/Scrubber.d.ts +2 -2
- package/lib/cjs/imodel-components-react/timeline/Scrubber.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts +1 -1
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.d.ts +1 -1
- package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts +2 -2
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js +0 -7
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts +3 -3
- package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/interfaces.js.map +1 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts +4 -3
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js +9 -7
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.d.ts +1 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
- package/lib/esm/imodel-components-react/UiIModelComponents.js +4 -2
- package/lib/esm/imodel-components-react/UiIModelComponents.js.map +1 -1
- package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts +1 -1
- package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/AlphaSlider.js.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerButton.js +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
- package/lib/esm/imodel-components-react/color/HueSlider.d.ts +2 -2
- package/lib/esm/imodel-components-react/color/HueSlider.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/HueSlider.js.map +1 -1
- package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts +1 -1
- package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/SaturationPicker.js.map +1 -1
- package/lib/esm/imodel-components-react/color/Swatch.d.ts +2 -2
- package/lib/esm/imodel-components-react/color/Swatch.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/Swatch.js.map +1 -1
- package/lib/esm/imodel-components-react/color/getCSSColorFromDef.d.ts +1 -1
- package/lib/esm/imodel-components-react/color/getCSSColorFromDef.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js.map +1 -1
- package/lib/esm/imodel-components-react/editors/ColorEditor.d.ts +3 -2
- package/lib/esm/imodel-components-react/editors/ColorEditor.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/editors/ColorEditor.js.map +1 -1
- package/lib/esm/imodel-components-react/editors/WeightEditor.d.ts +3 -2
- package/lib/esm/imodel-components-react/editors/WeightEditor.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/editors/WeightEditor.js.map +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityInput.d.ts +2 -2
- package/lib/esm/imodel-components-react/inputs/QuantityInput.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityInput.js.map +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts +2 -2
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
- package/lib/esm/imodel-components-react/lineweight/Swatch.d.ts +2 -2
- package/lib/esm/imodel-components-react/lineweight/Swatch.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/lineweight/Swatch.js.map +1 -1
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.d.ts +2 -2
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/Cube.d.ts +1 -1
- package/lib/esm/imodel-components-react/navigationaids/Cube.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/Cube.js.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +3 -2
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js +50 -23
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +3 -2
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.d.ts +3 -2
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.d.ts +2 -2
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js +3 -2
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts +2 -2
- package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatSample.js +2 -2
- package/lib/esm/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatType.d.ts +2 -2
- package/lib/esm/imodel-components-react/quantityformat/FormatType.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatType.js +2 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatType.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +2 -2
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js +2 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatUnits.d.ts +2 -2
- package/lib/esm/imodel-components-react/quantityformat/FormatUnits.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js +9 -5
- package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +2 -2
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js +4 -3
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +3 -3
- package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.d.ts +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.d.ts +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +2 -2
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +2 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +2 -2
- package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +2 -2
- package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +2 -2
- package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/InlineEdit.d.ts +1 -1
- package/lib/esm/imodel-components-react/timeline/InlineEdit.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/InlineEdit.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts +1 -1
- package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/PlayerButton.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/Scrubber.d.ts +2 -2
- package/lib/esm/imodel-components-react/timeline/Scrubber.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/Scrubber.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts +1 -1
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/SpeedTimeline.d.ts +1 -1
- package/lib/esm/imodel-components-react/timeline/SpeedTimeline.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts +2 -2
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.js +0 -7
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/interfaces.d.ts +3 -3
- package/lib/esm/imodel-components-react/timeline/interfaces.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/interfaces.js.map +1 -1
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts +4 -3
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.js +9 -7
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
- package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.d.ts +1 -1
- package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
- package/package.json +17 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimelineComponent.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/TimelineComponent.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAsB,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAqB,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACtG,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACzH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAoB,uBAAuB,EAAyB,MAAM,cAAc,CAAC;AAChG,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,0BAA0B,CAAC;AAElC,yBAAyB;AAEzB,MAAM,SAAS,GAAG,EAAE,GAAG,IAAI,CAAC;AAC5B,MAAM,WAAW,GAAG,EAAE,GAAG,IAAI,CAAC;AAC9B,MAAM,SAAS,GAAG,EAAE,GAAG,IAAI,CAAC;AA4F5B;;;GAGG;AACH,MAAM,OAAO,i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,EAAE,QAAQ,EAAE,IAAI,CAAC,sBAAsB,GAAI,CACnI;gBACL,SAAS,IAAI,IAAI,CAAC,eAAe,EAAE,CAChC,CACF,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Timeline\r\n */\r\nimport { GenericUiEventArgs, UiAdmin } from \"@itwin/appui-abstract\";\r\nimport { DateFormatOptions, toDateString, toTimeString, UiComponents } from \"@itwin/components-react\";\r\nimport { Icon } from \"@itwin/core-react\";\r\nimport { SvgCaretLeft, SvgCaretRight, SvgCheckmark, SvgMoreVertical, SvgPlayCircular } from \"@itwin/itwinui-icons-react\";\r\nimport { DropdownMenu, MenuDivider, MenuItem } from \"@itwin/itwinui-react\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\n\r\nimport { UiIModelComponents } from \"../UiIModelComponents\";\r\nimport { InlineEdit } from \"./InlineEdit\";\r\nimport { PlaybackSettings, TimelinePausePlayAction, TimelinePausePlayArgs } from \"./interfaces\";\r\nimport { PlayButton, PlayerButton } from \"./PlayerButton\";\r\nimport { Scrubber } from \"./Scrubber\";\r\n\r\nimport \"./TimelineComponent.scss\";\r\n\r\n// cspell:ignore millisec\r\n\r\nconst slowSpeed = 60 * 1000;\r\nconst mediumSpeed = 20 * 1000;\r\nconst fastSpeed = 10 * 1000;\r\n/**\r\n * [[TimelineMenuItemOption]]: specifies how the app wants the timeline speeds to be installed on the TimelineComponent's ContextMenu\r\n * \"replace\" : use the app-supplied items in place of the standard items\r\n * \"append\" : add the app-supplied items following the standard items\r\n * \"prefix\" : add the app-supplied items before the standard items\r\n *\r\n * @public\r\n */\r\nexport type TimelineMenuItemOption = \"replace\" | \"append\" | \"prefix\";\r\n/**\r\n * [[TimelineMenuItemProps]] specifies playback speed entries in the Timeline's ContextMenu\r\n * @public\r\n */\r\nexport interface TimelineMenuItemProps {\r\n /** localized label for menu item */\r\n label: string;\r\n\r\n /** duration for the entire timeline to play */\r\n timelineDuration: number;\r\n}\r\n/** TimelineDateMarkerProps: Mark a date on the timeline with an indicator\r\n * @public\r\n */\r\nexport interface TimelineDateMarkerProps {\r\n /** Date to mark. If undefined, today's date will be used. */\r\n date?: Date;\r\n /** ReactNode to use as the marker on the timeline. If undefined, a short vertical bar will mark the date. */\r\n dateMarker?: React.ReactNode;\r\n}\r\n/**\r\n * [[TimelineComponentProps]] configure the timeline\r\n * @public\r\n */\r\nexport interface TimelineComponentProps {\r\n /** Start date: beginning of the date range of a date-based timeline. */\r\n startDate?: Date;\r\n /** End date: end of the date range of a date-based timeline. */\r\n endDate?: Date;\r\n /** Total duration: range of the timeline in milliseconds. */\r\n totalDuration: number;\r\n /** Initial value for the current duration (the location of the thumb) in milliseconds */\r\n initialDuration?: number;\r\n /** Show in minimized mode (For future use. This prop will always be treated as true.) */\r\n minimized?: boolean;\r\n /** When playing, repeat indefinitely */\r\n repeat?: boolean;\r\n /** Show duration instead of time */\r\n showDuration?: boolean;\r\n /** Callback with current duration value (as a fraction) */\r\n onChange?: (duration: number) => void;\r\n /** Callback triggered when play/pause button is pressed */\r\n onPlayPause?: (playing: boolean) => void;\r\n /** Callback triggered when backward/forward buttons are pressed */\r\n onJump?: (forward: boolean) => void;\r\n /** Callback triggered when a setting is changed */\r\n onSettingsChange?: (arg: PlaybackSettings) => void;\r\n /** Always display in miniMode with no expand menu (For future use. This prop will always be treated as true) */\r\n alwaysMinimized?: boolean;\r\n /** ComponentId -- must be set to use TimelineComponentEvents */\r\n componentId?: string;\r\n /** Include the repeat option on the Timeline Context Menu */\r\n includeRepeat?: boolean;\r\n /** App-supplied speed entries in the Timeline Context Menu */\r\n appMenuItems?: TimelineMenuItemProps[];\r\n /** How to include the supplied app menu items in the Timeline Context Menu (prefix, append, replace)*/\r\n appMenuItemOption?: TimelineMenuItemOption;\r\n /** Display date and time offset by the number of minutes specified. When undefined - local timezone will be used */\r\n timeZoneOffset?: number;\r\n /** Display a marker on the timeline rail to indicate current date - will only work if starDate and endDate are defined */\r\n markDate?: TimelineDateMarkerProps;\r\n /** Options used to format date string. If not defined it will user browser default locale settings. */\r\n dateFormatOptions?: DateFormatOptions;\r\n /** Options used to format time string. If not defined it will user browser default locale settings. */\r\n timeFormatOptions?: DateFormatOptions;\r\n}\r\n/** @internal */\r\ninterface TimelineComponentState {\r\n /** True if timeline is currently playing, false if paused */\r\n isPlaying: boolean;\r\n /** Minimized mode (For future use. This will always be true) */\r\n minimized?: boolean;\r\n /** Current duration in milliseconds */\r\n currentDuration: number;\r\n /** Total duration in milliseconds */\r\n totalDuration: number;\r\n /** If true, automatically restart when the timeline is finished playing */\r\n repeat: boolean;\r\n /** If true, include the repeat option in the timeline context menu */\r\n includeRepeat: boolean;\r\n}\r\n\r\n/**\r\n * [[TimelineComponent]] is used to playback timeline data\r\n * @public\r\n */\r\nexport class TimelineComponent extends React.Component<TimelineComponentProps, TimelineComponentState> {\r\n private _timeLastCycle = 0;\r\n private _requestFrame = 0;\r\n private _unmounted = false;\r\n private _repeatLabel: string;\r\n private _removeListener?: () => void;\r\n private _standardTimelineMenuItems: TimelineMenuItemProps[] = [\r\n { label: UiIModelComponents.translate(\"timeline.slow\"), timelineDuration: slowSpeed },\r\n { label: UiIModelComponents.translate(\"timeline.medium\"), timelineDuration: mediumSpeed },\r\n { label: UiIModelComponents.translate(\"timeline.fast\"), timelineDuration: fastSpeed },\r\n ];\r\n\r\n constructor(props: TimelineComponentProps) {\r\n super(props);\r\n\r\n this.state = {\r\n isPlaying: false,\r\n minimized: true,\r\n currentDuration: props.initialDuration ? props.initialDuration : /* istanbul ignore next */ 0,\r\n totalDuration: this.props.totalDuration,\r\n repeat: this.props.repeat ? true : false,\r\n includeRepeat: this.props.includeRepeat || this.props.includeRepeat === undefined ? true : false,\r\n };\r\n\r\n this._repeatLabel = UiIModelComponents.translate(\"timeline.repeat\");\r\n // istanbul ignore else\r\n if (this.props.componentId) { // can't handle an event if we have no id\r\n this._removeListener = UiAdmin.onGenericUiEvent.addListener(this._handleTimelinePausePlayEvent);\r\n }\r\n }\r\n\r\n public override componentWillUnmount() {\r\n if (this._removeListener)\r\n this._removeListener();\r\n window.cancelAnimationFrame(this._requestFrame);\r\n this._unmounted = true;\r\n }\r\n\r\n public override shouldComponentUpdate(nextProps: TimelineComponentProps, nextState: TimelineComponentState) {\r\n let result = false;\r\n\r\n // istanbul ignore next\r\n if (nextState !== this.state || nextProps !== this.props ||\r\n nextProps.startDate !== this.props.startDate ||\r\n nextProps.endDate !== this.props.endDate ||\r\n nextProps.initialDuration !== this.props.initialDuration ||\r\n nextProps.repeat !== this.props.repeat\r\n )\r\n result = true;\r\n\r\n return result;\r\n }\r\n\r\n public override componentDidUpdate(prevProps: TimelineComponentProps) {\r\n // istanbul ignore else\r\n if (this.props.initialDuration !== prevProps.initialDuration) {\r\n this._setDuration(this.props.initialDuration ? this.props.initialDuration : /* istanbul ignore next */ 0);\r\n }\r\n\r\n // istanbul ignore else\r\n if (this.props.repeat !== prevProps.repeat) {\r\n this._changeRepeatSetting(this.props.repeat);\r\n }\r\n\r\n // istanbul ignore else\r\n if (this.props.totalDuration !== prevProps.totalDuration) {\r\n this._onSetTotalDuration(this.props.totalDuration);\r\n }\r\n }\r\n private _handleTimelinePausePlayEvent = (args: GenericUiEventArgs): void => {\r\n const timelineArgs = args as TimelinePausePlayArgs;\r\n // istanbul ignore else\r\n if (!timelineArgs || this.props.componentId !== timelineArgs.uiComponentId || timelineArgs.timelineAction === undefined)\r\n return;\r\n\r\n let startPlaying: boolean;\r\n switch (timelineArgs.timelineAction) {\r\n case TimelinePausePlayAction.Play:\r\n startPlaying = true;\r\n break;\r\n case TimelinePausePlayAction.Pause:\r\n startPlaying = false;\r\n break;\r\n case TimelinePausePlayAction.Toggle:\r\n startPlaying = !this.state.isPlaying;\r\n break;\r\n // istanbul ignore next\r\n default:\r\n return; // throw error?\r\n }\r\n if (startPlaying)\r\n this._onPlay();\r\n else\r\n this._onPause();\r\n };\r\n\r\n // user clicked backward button\r\n private _onBackward = () => {\r\n // istanbul ignore else\r\n if (this.props.onJump)\r\n this.props.onJump(false);\r\n };\r\n\r\n // user clicked forward button\r\n private _onForward = () => {\r\n // istanbul ignore else\r\n if (this.props.onJump)\r\n this.props.onJump(true);\r\n };\r\n\r\n // user clicked play button\r\n private _onPlay = () => {\r\n // istanbul ignore if\r\n if (this.state.isPlaying)\r\n return;\r\n\r\n // timeline was complete, restart from the beginning\r\n if (this.state.currentDuration >= this.state.totalDuration) {\r\n this._replay();\r\n } else\r\n this._play();\r\n\r\n // istanbul ignore else\r\n if (this.props.onPlayPause)\r\n this.props.onPlayPause(true);\r\n };\r\n\r\n // user clicked pause button\r\n private _onPause = () => {\r\n // istanbul ignore if\r\n if (!this.state.isPlaying)\r\n return;\r\n\r\n // stop requesting frames\r\n window.cancelAnimationFrame(this._requestFrame);\r\n\r\n // stop playing\r\n this.setState({ isPlaying: false });\r\n\r\n // istanbul ignore else\r\n if (this.props.onPlayPause)\r\n this.props.onPlayPause(false);\r\n };\r\n\r\n // user clicked on timeline rail or dragged scrubber handle\r\n private _onTimelineChange = (values: ReadonlyArray<number>) => {\r\n const currentDuration = values[0];\r\n this._setDuration(currentDuration);\r\n };\r\n\r\n // set the current duration, which will call the OnChange callback\r\n private _setDuration = (currentDuration: number) => {\r\n const actualDuration = Math.min(this.state.totalDuration, (Math.max(currentDuration, 0)));\r\n\r\n this._timeLastCycle = new Date().getTime();\r\n // istanbul ignore else\r\n if (!this._unmounted)\r\n this.setState({ currentDuration: actualDuration });\r\n // istanbul ignore else\r\n if (this.props.onChange) {\r\n const fraction = actualDuration / this.state.totalDuration;\r\n this.props.onChange(fraction);\r\n }\r\n };\r\n\r\n // recursively update the animation until we hit the end or the pause button is clicked\r\n private _updateAnimation = (_timestamp: number) => {\r\n // istanbul ignore else\r\n if (!this.state.isPlaying && !this._unmounted) {\r\n return;\r\n }\r\n\r\n // update duration\r\n const currentTime = new Date().getTime();\r\n const millisecondsElapsed = currentTime - this._timeLastCycle;\r\n const duration = this.state.currentDuration + millisecondsElapsed;\r\n this._setDuration(duration);\r\n\r\n // stop the animation!\r\n if (duration >= this.state.totalDuration) {\r\n window.cancelAnimationFrame(this._requestFrame);\r\n this.setState({ isPlaying: false });\r\n if (this.state.repeat)\r\n this._replay();\r\n else {\r\n // istanbul ignore else\r\n if (this.props.onPlayPause)\r\n this.props.onPlayPause(false);\r\n }\r\n\r\n return;\r\n }\r\n\r\n // continue the animation - request the next frame\r\n this._requestFrame = window.requestAnimationFrame(this._updateAnimation);\r\n };\r\n\r\n private _play() {\r\n // start playing\r\n this.setState({ isPlaying: true }, () => {\r\n // request the next frame\r\n this._timeLastCycle = new Date().getTime();\r\n this._requestFrame = window.requestAnimationFrame(this._updateAnimation);\r\n });\r\n }\r\n\r\n private _replay = () => {\r\n // timeline was complete, restart from the beginning\r\n this.setState({ currentDuration: 0 }, (() => this._play()));\r\n };\r\n\r\n private _displayTime(millisec: number) {\r\n const addZero = (i: number) => {\r\n return (i < 10) ? `0${i}` : i;\r\n };\r\n\r\n const date = new Date(millisec);\r\n // const hours = date.getUTCHours();\r\n const minutes = date.getUTCMinutes();\r\n const seconds = date.getUTCSeconds();\r\n return `${addZero(minutes)}:${addZero(seconds)}`;\r\n }\r\n\r\n private _getMilliseconds(time: string) {\r\n // istanbul ignore else - WIP\r\n if (time.indexOf(\":\") !== -1) {\r\n return (Number(time.split(\":\")[0]) * 60 + Number(time.split(\":\")[1])) * 1000;\r\n } else {\r\n return Number(time) * 1000;\r\n }\r\n }\r\n\r\n // user changed the total duration\r\n private _onTotalDurationChange = (value: string) => {\r\n // NOTE: we should reset the current duration to 0\r\n const milliseconds = this._getMilliseconds(value);\r\n this._onSetTotalDuration(milliseconds);\r\n };\r\n\r\n private _changeRepeatSetting = (newValue?: boolean) => {\r\n // istanbul ignore else\r\n if (newValue !== undefined) {\r\n this.setState(\r\n () => ({ repeat: newValue }),\r\n () => {\r\n // istanbul ignore else\r\n if (this.props.onSettingsChange) {\r\n this.props.onSettingsChange({ loop: this.state.repeat });\r\n }\r\n });\r\n }\r\n };\r\n\r\n private _onRepeatChanged = () => {\r\n this.setState(\r\n (prevState) => ({ repeat: !prevState.repeat }),\r\n () => {\r\n // istanbul ignore else\r\n if (this.props.onSettingsChange) {\r\n this.props.onSettingsChange({ loop: this.state.repeat });\r\n }\r\n });\r\n };\r\n\r\n private _currentDate = (): Date => {\r\n const fraction = this.state.currentDuration / this.state.totalDuration;\r\n if (this.props.endDate && this.props.startDate) {\r\n const timeElapsed = (this.props.endDate.getTime() - this.props.startDate.getTime()) * fraction;\r\n return new Date(this.props.startDate.getTime() + timeElapsed);\r\n }\r\n return new Date();\r\n };\r\n\r\n private _onSetTotalDuration = (milliseconds: number) => {\r\n this.setState(\r\n { totalDuration: milliseconds },\r\n () => {\r\n // istanbul ignore else\r\n if (this.props.onSettingsChange) {\r\n this.props.onSettingsChange({ duration: milliseconds });\r\n }\r\n });\r\n };\r\n\r\n private _createMenuItemNode(item: TimelineMenuItemProps, index: number, currentTimelineDuration: number, close: () => void): JSX.Element {\r\n const label = item.label;\r\n const checked = currentTimelineDuration === item.timelineDuration;\r\n const icon = checked ? <span className=\"icon\"><Icon iconSpec={<SvgCheckmark />} /> </span> : <span />;\r\n return (\r\n <MenuItem key={index} icon={icon}\r\n onClick={() => { this._onSetTotalDuration(item.timelineDuration); close(); }} >\r\n {label}\r\n </MenuItem>\r\n );\r\n }\r\n\r\n private _renderSettings = () => {\r\n const createMenuItemNodes = (close: () => void): JSX.Element[] => {\r\n\r\n const { totalDuration } = this.state;\r\n let contextMenuItems: Array<TimelineMenuItemProps> = [];\r\n\r\n if (!this.props.appMenuItems) {\r\n contextMenuItems = this._standardTimelineMenuItems;\r\n } else {\r\n if (this.props.appMenuItemOption === \"append\") {\r\n contextMenuItems = this._standardTimelineMenuItems.concat(this.props.appMenuItems);\r\n } else if (this.props.appMenuItemOption === \"prefix\") {\r\n contextMenuItems = this.props.appMenuItems.concat(this._standardTimelineMenuItems);\r\n } else {\r\n contextMenuItems = this.props.appMenuItems;\r\n }\r\n }\r\n\r\n const itemNodes: JSX.Element[] = [];\r\n let keyIndex = 0;\r\n if (this.state.includeRepeat) {\r\n const checked = this.state.repeat;\r\n const icon = checked ? <span className=\"icon\"><Icon iconSpec={<SvgCheckmark />} /> </span> : <span />;\r\n itemNodes.push(<MenuItem key={++keyIndex} onClick={() => { this._onRepeatChanged(); close(); }} icon={icon}>\r\n {this._repeatLabel}\r\n </MenuItem>);\r\n itemNodes.push(<MenuDivider key={++keyIndex} />);\r\n }\r\n\r\n contextMenuItems.forEach((item: TimelineMenuItemProps, index: number) => {\r\n itemNodes.push(this._createMenuItemNode(item, index + keyIndex + 1, totalDuration, close));\r\n });\r\n\r\n return itemNodes;\r\n };\r\n\r\n return (\r\n <DropdownMenu menuItems={createMenuItemNodes} placement=\"top-start\" popperOptions={{\r\n modifiers: [\r\n {\r\n name: \"hide\", // When the timeline is no longer visible, hide the popper.\r\n },\r\n {\r\n name: \"preventOverflow\",\r\n options: {\r\n altAxis: true, // Allow the popper to go below the reference element and use as much space as needed.\r\n },\r\n },\r\n {\r\n name: \"computeStyles\",\r\n options: {\r\n roundOffsets: ({ x, y }: { x: number, y: number }) => ({\r\n x,\r\n y: Math.max(y, 0), // Ensure that the top of the popper will not go over the top of the document.\r\n }),\r\n },\r\n },\r\n {\r\n name: \"setPopperClass\", // Ensure we target only THIS popper with a class\r\n enabled: true,\r\n phase: \"beforeWrite\",\r\n fn({ state }) {\r\n state.attributes.popper.class = \"timeline-component-max-sized-scrolling-menu\";\r\n },\r\n },\r\n ]}}>\r\n <span data-testid=\"timeline-settings\" className=\"timeline-settings icon\"\r\n role=\"button\" tabIndex={-1} title={UiComponents.translate(\"button.label.settings\")}\r\n ><Icon iconSpec={<SvgMoreVertical />} /></span>\r\n </DropdownMenu>\r\n );\r\n };\r\n\r\n public override render() {\r\n const { startDate, endDate, showDuration, timeZoneOffset, dateFormatOptions, timeFormatOptions } = this.props;\r\n const { currentDuration, totalDuration, minimized } = this.state;\r\n const currentDate = this._currentDate();\r\n const durationString = this._displayTime(currentDuration);\r\n const totalDurationString = this._displayTime(totalDuration);\r\n const hasDates = !!startDate && !!endDate;\r\n\r\n return (\r\n <div data-testid=\"timeline-component\" className={classnames(\"timeline-component\", !!minimized && \"minimized\", hasDates && \"has-dates\")} >\r\n <div className=\"header\">\r\n <PlayButton className=\"play-button\" isPlaying={this.state.isPlaying} onPlay={this._onPlay} onPause={this._onPause} data-testid=\"timeline-play\" />\r\n <PlayerButton className=\"play-backward\" icon={<SvgCaretLeft />} onClick={this._onBackward}\r\n title={UiIModelComponents.translate(\"timeline.backward\")} />\r\n <PlayerButton className=\"play-button-step\" icon={<SvgPlayCircular />}\r\n isPlaying={this.state.isPlaying} onPlay={this._onPlay} onPause={this._onPause}\r\n title={UiIModelComponents.translate(\"timeline.step\")} />\r\n <PlayerButton className=\"play-forward\" icon={<SvgCaretRight />} onClick={this._onForward}\r\n title={UiIModelComponents.translate(\"timeline.backward\")} />\r\n <span className=\"current-date\">{toDateString(currentDate, timeZoneOffset, dateFormatOptions)}</span>\r\n </div>\r\n <div className=\"scrubber\">\r\n <PlayButton className=\"play-button\" isPlaying={this.state.isPlaying} onPlay={this._onPlay} onPause={this._onPause} />\r\n <div className=\"start-time-container\">\r\n {hasDates && <span data-testid=\"test-start-date\" className=\"start-date\">{toDateString(startDate, timeZoneOffset, dateFormatOptions)}</span>}\r\n {hasDates && !showDuration && <span data-testid=\"test-start-time\" className=\"start-time\">{toTimeString(startDate, timeZoneOffset, timeFormatOptions)}</span>}\r\n {showDuration && <span className=\"duration-start-time\">{durationString}</span>}\r\n </div>\r\n <Scrubber\r\n className=\"slider\"\r\n currentDuration={this.state.currentDuration}\r\n totalDuration={totalDuration}\r\n startDate={startDate}\r\n endDate={endDate}\r\n isPlaying={this.state.isPlaying}\r\n inMiniMode={!!minimized}\r\n showTime={!showDuration}\r\n onChange={this._onTimelineChange}\r\n onUpdate={this._onTimelineChange}\r\n timeZoneOffset={this.props.timeZoneOffset}\r\n markDate={this.props.markDate}\r\n />\r\n <div className=\"end-time-container\">\r\n {hasDates && <span className=\"end-date\">{toDateString(endDate, timeZoneOffset)}</span>}\r\n {hasDates && !showDuration && <span className=\"end-time\">{toTimeString(endDate, timeZoneOffset, timeFormatOptions)}</span>}\r\n {showDuration && <InlineEdit className=\"duration-end-time\" defaultValue={totalDurationString} onChange={this._onTotalDurationChange} />}\r\n </div>\r\n {minimized && this._renderSettings()}\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"TimelineComponent.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/TimelineComponent.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACzH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,QAAQ,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CAAC,OAAO,EAAE,cAAc,CAAC,CAAQ;oBACrF,QAAQ,IAAI,CAAC,YAAY,IAAI,8BAAM,SAAS,EAAC,UAAU,IAAE,YAAY,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,CAAC,CAAQ;oBACzH,YAAY,IAAI,oBAAC,UAAU,IAAC,SAAS,EAAC,mBAAmB,EAAC,YAAY,EAAE,mBAAmB,EAAE,QAAQ,EAAE,IAAI,CAAC,sBAAsB,GAAI,CACnI;gBACL,SAAS,IAAI,IAAI,CAAC,eAAe,EAAE,CAChC,CACF,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Timeline\r\n */\r\nimport type { GenericUiEventArgs} from \"@itwin/appui-abstract\";\r\nimport { UiAdmin } from \"@itwin/appui-abstract\";\r\nimport type { DateFormatOptions} from \"@itwin/components-react\";\r\nimport { toDateString, toTimeString, UiComponents } from \"@itwin/components-react\";\r\nimport { Icon } from \"@itwin/core-react\";\r\nimport { SvgCaretLeft, SvgCaretRight, SvgCheckmark, SvgMoreVertical, SvgPlayCircular } from \"@itwin/itwinui-icons-react\";\r\nimport { DropdownMenu, MenuDivider, MenuItem } from \"@itwin/itwinui-react\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\n\r\nimport { UiIModelComponents } from \"../UiIModelComponents\";\r\nimport { InlineEdit } from \"./InlineEdit\";\r\nimport type { PlaybackSettings, TimelinePausePlayArgs } from \"./interfaces\";\r\nimport { TimelinePausePlayAction } from \"./interfaces\";\r\nimport { PlayButton, PlayerButton } from \"./PlayerButton\";\r\nimport { Scrubber } from \"./Scrubber\";\r\n\r\nimport \"./TimelineComponent.scss\";\r\n\r\n// cspell:ignore millisec\r\n\r\nconst slowSpeed = 60 * 1000;\r\nconst mediumSpeed = 20 * 1000;\r\nconst fastSpeed = 10 * 1000;\r\n/**\r\n * [[TimelineMenuItemOption]]: specifies how the app wants the timeline speeds to be installed on the TimelineComponent's ContextMenu\r\n * \"replace\" : use the app-supplied items in place of the standard items\r\n * \"append\" : add the app-supplied items following the standard items\r\n * \"prefix\" : add the app-supplied items before the standard items\r\n *\r\n * @public\r\n */\r\nexport type TimelineMenuItemOption = \"replace\" | \"append\" | \"prefix\";\r\n/**\r\n * [[TimelineMenuItemProps]] specifies playback speed entries in the Timeline's ContextMenu\r\n * @public\r\n */\r\nexport interface TimelineMenuItemProps {\r\n /** localized label for menu item */\r\n label: string;\r\n\r\n /** duration for the entire timeline to play */\r\n timelineDuration: number;\r\n}\r\n/** TimelineDateMarkerProps: Mark a date on the timeline with an indicator\r\n * @public\r\n */\r\nexport interface TimelineDateMarkerProps {\r\n /** Date to mark. If undefined, today's date will be used. */\r\n date?: Date;\r\n /** ReactNode to use as the marker on the timeline. If undefined, a short vertical bar will mark the date. */\r\n dateMarker?: React.ReactNode;\r\n}\r\n/**\r\n * [[TimelineComponentProps]] configure the timeline\r\n * @public\r\n */\r\nexport interface TimelineComponentProps {\r\n /** Start date: beginning of the date range of a date-based timeline. */\r\n startDate?: Date;\r\n /** End date: end of the date range of a date-based timeline. */\r\n endDate?: Date;\r\n /** Total duration: range of the timeline in milliseconds. */\r\n totalDuration: number;\r\n /** Initial value for the current duration (the location of the thumb) in milliseconds */\r\n initialDuration?: number;\r\n /** Show in minimized mode (For future use. This prop will always be treated as true.) */\r\n minimized?: boolean;\r\n /** When playing, repeat indefinitely */\r\n repeat?: boolean;\r\n /** Show duration instead of time */\r\n showDuration?: boolean;\r\n /** Callback with current duration value (as a fraction) */\r\n onChange?: (duration: number) => void;\r\n /** Callback triggered when play/pause button is pressed */\r\n onPlayPause?: (playing: boolean) => void;\r\n /** Callback triggered when backward/forward buttons are pressed */\r\n onJump?: (forward: boolean) => void;\r\n /** Callback triggered when a setting is changed */\r\n onSettingsChange?: (arg: PlaybackSettings) => void;\r\n /** Always display in miniMode with no expand menu (For future use. This prop will always be treated as true) */\r\n alwaysMinimized?: boolean;\r\n /** ComponentId -- must be set to use TimelineComponentEvents */\r\n componentId?: string;\r\n /** Include the repeat option on the Timeline Context Menu */\r\n includeRepeat?: boolean;\r\n /** App-supplied speed entries in the Timeline Context Menu */\r\n appMenuItems?: TimelineMenuItemProps[];\r\n /** How to include the supplied app menu items in the Timeline Context Menu (prefix, append, replace)*/\r\n appMenuItemOption?: TimelineMenuItemOption;\r\n /** Display date and time offset by the number of minutes specified. When undefined - local timezone will be used */\r\n timeZoneOffset?: number;\r\n /** Display a marker on the timeline rail to indicate current date - will only work if starDate and endDate are defined */\r\n markDate?: TimelineDateMarkerProps;\r\n /** Options used to format date string. If not defined it will user browser default locale settings. */\r\n dateFormatOptions?: DateFormatOptions;\r\n /** Options used to format time string. If not defined it will user browser default locale settings. */\r\n timeFormatOptions?: DateFormatOptions;\r\n}\r\n/** @internal */\r\ninterface TimelineComponentState {\r\n /** True if timeline is currently playing, false if paused */\r\n isPlaying: boolean;\r\n /** Minimized mode (For future use. This will always be true) */\r\n minimized?: boolean;\r\n /** Current duration in milliseconds */\r\n currentDuration: number;\r\n /** Total duration in milliseconds */\r\n totalDuration: number;\r\n /** If true, automatically restart when the timeline is finished playing */\r\n repeat: boolean;\r\n /** If true, include the repeat option in the timeline context menu */\r\n includeRepeat: boolean;\r\n}\r\n\r\n/**\r\n * [[TimelineComponent]] is used to playback timeline data\r\n * @public\r\n */\r\nexport class TimelineComponent extends React.Component<TimelineComponentProps, TimelineComponentState> {\r\n private _timeLastCycle = 0;\r\n private _requestFrame = 0;\r\n private _unmounted = false;\r\n private _repeatLabel: string;\r\n private _removeListener?: () => void;\r\n private _standardTimelineMenuItems: TimelineMenuItemProps[] = [\r\n { label: UiIModelComponents.translate(\"timeline.slow\"), timelineDuration: slowSpeed },\r\n { label: UiIModelComponents.translate(\"timeline.medium\"), timelineDuration: mediumSpeed },\r\n { label: UiIModelComponents.translate(\"timeline.fast\"), timelineDuration: fastSpeed },\r\n ];\r\n\r\n constructor(props: TimelineComponentProps) {\r\n super(props);\r\n\r\n this.state = {\r\n isPlaying: false,\r\n minimized: true,\r\n currentDuration: props.initialDuration ? props.initialDuration : /* istanbul ignore next */ 0,\r\n totalDuration: this.props.totalDuration,\r\n repeat: this.props.repeat ? true : false,\r\n includeRepeat: this.props.includeRepeat || this.props.includeRepeat === undefined ? true : false,\r\n };\r\n\r\n this._repeatLabel = UiIModelComponents.translate(\"timeline.repeat\");\r\n // istanbul ignore else\r\n if (this.props.componentId) { // can't handle an event if we have no id\r\n this._removeListener = UiAdmin.onGenericUiEvent.addListener(this._handleTimelinePausePlayEvent);\r\n }\r\n }\r\n\r\n public override componentWillUnmount() {\r\n if (this._removeListener)\r\n this._removeListener();\r\n window.cancelAnimationFrame(this._requestFrame);\r\n this._unmounted = true;\r\n }\r\n\r\n public override shouldComponentUpdate(nextProps: TimelineComponentProps, nextState: TimelineComponentState) {\r\n let result = false;\r\n\r\n // istanbul ignore next\r\n if (nextState !== this.state || nextProps !== this.props ||\r\n nextProps.startDate !== this.props.startDate ||\r\n nextProps.endDate !== this.props.endDate ||\r\n nextProps.initialDuration !== this.props.initialDuration ||\r\n nextProps.repeat !== this.props.repeat\r\n )\r\n result = true;\r\n\r\n return result;\r\n }\r\n\r\n public override componentDidUpdate(prevProps: TimelineComponentProps) {\r\n // istanbul ignore else\r\n if (this.props.initialDuration !== prevProps.initialDuration) {\r\n this._setDuration(this.props.initialDuration ? this.props.initialDuration : /* istanbul ignore next */ 0);\r\n }\r\n\r\n // istanbul ignore else\r\n if (this.props.repeat !== prevProps.repeat) {\r\n this._changeRepeatSetting(this.props.repeat);\r\n }\r\n\r\n // istanbul ignore else\r\n if (this.props.totalDuration !== prevProps.totalDuration) {\r\n this._onSetTotalDuration(this.props.totalDuration);\r\n }\r\n }\r\n private _handleTimelinePausePlayEvent = (args: GenericUiEventArgs): void => {\r\n const timelineArgs = args as TimelinePausePlayArgs;\r\n // istanbul ignore else\r\n if (!timelineArgs || this.props.componentId !== timelineArgs.uiComponentId || timelineArgs.timelineAction === undefined)\r\n return;\r\n\r\n let startPlaying: boolean;\r\n switch (timelineArgs.timelineAction) {\r\n case TimelinePausePlayAction.Play:\r\n startPlaying = true;\r\n break;\r\n case TimelinePausePlayAction.Pause:\r\n startPlaying = false;\r\n break;\r\n case TimelinePausePlayAction.Toggle:\r\n startPlaying = !this.state.isPlaying;\r\n break;\r\n // istanbul ignore next\r\n default:\r\n return; // throw error?\r\n }\r\n if (startPlaying)\r\n this._onPlay();\r\n else\r\n this._onPause();\r\n };\r\n\r\n // user clicked backward button\r\n private _onBackward = () => {\r\n // istanbul ignore else\r\n if (this.props.onJump)\r\n this.props.onJump(false);\r\n };\r\n\r\n // user clicked forward button\r\n private _onForward = () => {\r\n // istanbul ignore else\r\n if (this.props.onJump)\r\n this.props.onJump(true);\r\n };\r\n\r\n // user clicked play button\r\n private _onPlay = () => {\r\n // istanbul ignore if\r\n if (this.state.isPlaying)\r\n return;\r\n\r\n // timeline was complete, restart from the beginning\r\n if (this.state.currentDuration >= this.state.totalDuration) {\r\n this._replay();\r\n } else\r\n this._play();\r\n\r\n // istanbul ignore else\r\n if (this.props.onPlayPause)\r\n this.props.onPlayPause(true);\r\n };\r\n\r\n // user clicked pause button\r\n private _onPause = () => {\r\n // istanbul ignore if\r\n if (!this.state.isPlaying)\r\n return;\r\n\r\n // stop requesting frames\r\n window.cancelAnimationFrame(this._requestFrame);\r\n\r\n // stop playing\r\n this.setState({ isPlaying: false });\r\n\r\n // istanbul ignore else\r\n if (this.props.onPlayPause)\r\n this.props.onPlayPause(false);\r\n };\r\n\r\n // user clicked on timeline rail or dragged scrubber handle\r\n private _onTimelineChange = (values: ReadonlyArray<number>) => {\r\n const currentDuration = values[0];\r\n this._setDuration(currentDuration);\r\n };\r\n\r\n // set the current duration, which will call the OnChange callback\r\n private _setDuration = (currentDuration: number) => {\r\n const actualDuration = Math.min(this.state.totalDuration, (Math.max(currentDuration, 0)));\r\n\r\n this._timeLastCycle = new Date().getTime();\r\n // istanbul ignore else\r\n if (!this._unmounted)\r\n this.setState({ currentDuration: actualDuration });\r\n // istanbul ignore else\r\n if (this.props.onChange) {\r\n const fraction = actualDuration / this.state.totalDuration;\r\n this.props.onChange(fraction);\r\n }\r\n };\r\n\r\n // recursively update the animation until we hit the end or the pause button is clicked\r\n private _updateAnimation = (_timestamp: number) => {\r\n // istanbul ignore else\r\n if (!this.state.isPlaying && !this._unmounted) {\r\n return;\r\n }\r\n\r\n // update duration\r\n const currentTime = new Date().getTime();\r\n const millisecondsElapsed = currentTime - this._timeLastCycle;\r\n const duration = this.state.currentDuration + millisecondsElapsed;\r\n this._setDuration(duration);\r\n\r\n // stop the animation!\r\n if (duration >= this.state.totalDuration) {\r\n window.cancelAnimationFrame(this._requestFrame);\r\n this.setState({ isPlaying: false });\r\n if (this.state.repeat)\r\n this._replay();\r\n else {\r\n // istanbul ignore else\r\n if (this.props.onPlayPause)\r\n this.props.onPlayPause(false);\r\n }\r\n\r\n return;\r\n }\r\n\r\n // continue the animation - request the next frame\r\n this._requestFrame = window.requestAnimationFrame(this._updateAnimation);\r\n };\r\n\r\n private _play() {\r\n // start playing\r\n this.setState({ isPlaying: true }, () => {\r\n // request the next frame\r\n this._timeLastCycle = new Date().getTime();\r\n this._requestFrame = window.requestAnimationFrame(this._updateAnimation);\r\n });\r\n }\r\n\r\n private _replay = () => {\r\n // timeline was complete, restart from the beginning\r\n this.setState({ currentDuration: 0 }, (() => this._play()));\r\n };\r\n\r\n private _displayTime(millisec: number) {\r\n const addZero = (i: number) => {\r\n return (i < 10) ? `0${i}` : i;\r\n };\r\n\r\n const date = new Date(millisec);\r\n // const hours = date.getUTCHours();\r\n const minutes = date.getUTCMinutes();\r\n const seconds = date.getUTCSeconds();\r\n return `${addZero(minutes)}:${addZero(seconds)}`;\r\n }\r\n\r\n private _getMilliseconds(time: string) {\r\n // istanbul ignore else - WIP\r\n if (time.indexOf(\":\") !== -1) {\r\n return (Number(time.split(\":\")[0]) * 60 + Number(time.split(\":\")[1])) * 1000;\r\n } else {\r\n return Number(time) * 1000;\r\n }\r\n }\r\n\r\n // user changed the total duration\r\n private _onTotalDurationChange = (value: string) => {\r\n // NOTE: we should reset the current duration to 0\r\n const milliseconds = this._getMilliseconds(value);\r\n this._onSetTotalDuration(milliseconds);\r\n };\r\n\r\n private _changeRepeatSetting = (newValue?: boolean) => {\r\n // istanbul ignore else\r\n if (newValue !== undefined) {\r\n this.setState(\r\n () => ({ repeat: newValue }),\r\n () => {\r\n // istanbul ignore else\r\n if (this.props.onSettingsChange) {\r\n this.props.onSettingsChange({ loop: this.state.repeat });\r\n }\r\n });\r\n }\r\n };\r\n\r\n private _onRepeatChanged = () => {\r\n this.setState(\r\n (prevState) => ({ repeat: !prevState.repeat }),\r\n () => {\r\n // istanbul ignore else\r\n if (this.props.onSettingsChange) {\r\n this.props.onSettingsChange({ loop: this.state.repeat });\r\n }\r\n });\r\n };\r\n\r\n private _currentDate = (): Date => {\r\n const fraction = this.state.currentDuration / this.state.totalDuration;\r\n if (this.props.endDate && this.props.startDate) {\r\n const timeElapsed = (this.props.endDate.getTime() - this.props.startDate.getTime()) * fraction;\r\n return new Date(this.props.startDate.getTime() + timeElapsed);\r\n }\r\n return new Date();\r\n };\r\n\r\n private _onSetTotalDuration = (milliseconds: number) => {\r\n this.setState(\r\n { totalDuration: milliseconds },\r\n () => {\r\n // istanbul ignore else\r\n if (this.props.onSettingsChange) {\r\n this.props.onSettingsChange({ duration: milliseconds });\r\n }\r\n });\r\n };\r\n\r\n private _createMenuItemNode(item: TimelineMenuItemProps, index: number, currentTimelineDuration: number, close: () => void): JSX.Element {\r\n const label = item.label;\r\n const checked = currentTimelineDuration === item.timelineDuration;\r\n const icon = checked ? <span className=\"icon\"><Icon iconSpec={<SvgCheckmark />} /> </span> : <span />;\r\n return (\r\n <MenuItem key={index} icon={icon}\r\n onClick={() => { this._onSetTotalDuration(item.timelineDuration); close(); }} >\r\n {label}\r\n </MenuItem>\r\n );\r\n }\r\n\r\n private _renderSettings = () => {\r\n const createMenuItemNodes = (close: () => void): JSX.Element[] => {\r\n\r\n const { totalDuration } = this.state;\r\n let contextMenuItems: Array<TimelineMenuItemProps> = [];\r\n\r\n if (!this.props.appMenuItems) {\r\n contextMenuItems = this._standardTimelineMenuItems;\r\n } else {\r\n if (this.props.appMenuItemOption === \"append\") {\r\n contextMenuItems = this._standardTimelineMenuItems.concat(this.props.appMenuItems);\r\n } else if (this.props.appMenuItemOption === \"prefix\") {\r\n contextMenuItems = this.props.appMenuItems.concat(this._standardTimelineMenuItems);\r\n } else {\r\n contextMenuItems = this.props.appMenuItems;\r\n }\r\n }\r\n\r\n const itemNodes: JSX.Element[] = [];\r\n let keyIndex = 0;\r\n if (this.state.includeRepeat) {\r\n const checked = this.state.repeat;\r\n const icon = checked ? <span className=\"icon\"><Icon iconSpec={<SvgCheckmark />} /> </span> : <span />;\r\n itemNodes.push(<MenuItem key={++keyIndex} onClick={() => { this._onRepeatChanged(); close(); }} icon={icon}>\r\n {this._repeatLabel}\r\n </MenuItem>);\r\n itemNodes.push(<MenuDivider key={++keyIndex} />);\r\n }\r\n\r\n contextMenuItems.forEach((item: TimelineMenuItemProps, index: number) => {\r\n itemNodes.push(this._createMenuItemNode(item, index + keyIndex + 1, totalDuration, close));\r\n });\r\n\r\n return itemNodes;\r\n };\r\n\r\n return (\r\n <DropdownMenu menuItems={createMenuItemNodes} placement=\"top-start\" popperOptions={{\r\n modifiers: [\r\n {\r\n name: \"hide\", // When the timeline is no longer visible, hide the popper.\r\n },\r\n {\r\n name: \"preventOverflow\",\r\n options: {\r\n altAxis: true, // Allow the popper to go below the reference element and use as much space as needed.\r\n },\r\n },\r\n {\r\n name: \"computeStyles\",\r\n options: {\r\n roundOffsets: ({ x, y }: { x: number, y: number }) => ({\r\n x,\r\n y: Math.max(y, 0), // Ensure that the top of the popper will not go over the top of the document.\r\n }),\r\n },\r\n },\r\n {\r\n name: \"setPopperClass\", // Ensure we target only THIS popper with a class\r\n enabled: true,\r\n phase: \"beforeWrite\",\r\n fn({ state }) {\r\n state.attributes.popper.class = \"timeline-component-max-sized-scrolling-menu\";\r\n },\r\n },\r\n ]}}>\r\n <span data-testid=\"timeline-settings\" className=\"timeline-settings icon\"\r\n role=\"button\" tabIndex={-1} title={UiComponents.translate(\"button.label.settings\")}\r\n ><Icon iconSpec={<SvgMoreVertical />} /></span>\r\n </DropdownMenu>\r\n );\r\n };\r\n\r\n public override render() {\r\n const { startDate, endDate, showDuration, timeZoneOffset, dateFormatOptions, timeFormatOptions } = this.props;\r\n const { currentDuration, totalDuration, minimized } = this.state;\r\n const currentDate = this._currentDate();\r\n const durationString = this._displayTime(currentDuration);\r\n const totalDurationString = this._displayTime(totalDuration);\r\n const hasDates = !!startDate && !!endDate;\r\n\r\n return (\r\n <div data-testid=\"timeline-component\" className={classnames(\"timeline-component\", !!minimized && \"minimized\", hasDates && \"has-dates\")} >\r\n <div className=\"header\">\r\n <PlayButton className=\"play-button\" isPlaying={this.state.isPlaying} onPlay={this._onPlay} onPause={this._onPause} data-testid=\"timeline-play\" />\r\n <PlayerButton className=\"play-backward\" icon={<SvgCaretLeft />} onClick={this._onBackward}\r\n title={UiIModelComponents.translate(\"timeline.backward\")} />\r\n <PlayerButton className=\"play-button-step\" icon={<SvgPlayCircular />}\r\n isPlaying={this.state.isPlaying} onPlay={this._onPlay} onPause={this._onPause}\r\n title={UiIModelComponents.translate(\"timeline.step\")} />\r\n <PlayerButton className=\"play-forward\" icon={<SvgCaretRight />} onClick={this._onForward}\r\n title={UiIModelComponents.translate(\"timeline.backward\")} />\r\n <span className=\"current-date\">{toDateString(currentDate, timeZoneOffset, dateFormatOptions)}</span>\r\n </div>\r\n <div className=\"scrubber\">\r\n <PlayButton className=\"play-button\" isPlaying={this.state.isPlaying} onPlay={this._onPlay} onPause={this._onPause} />\r\n <div className=\"start-time-container\">\r\n {hasDates && <span data-testid=\"test-start-date\" className=\"start-date\">{toDateString(startDate, timeZoneOffset, dateFormatOptions)}</span>}\r\n {hasDates && !showDuration && <span data-testid=\"test-start-time\" className=\"start-time\">{toTimeString(startDate, timeZoneOffset, timeFormatOptions)}</span>}\r\n {showDuration && <span className=\"duration-start-time\">{durationString}</span>}\r\n </div>\r\n <Scrubber\r\n className=\"slider\"\r\n currentDuration={this.state.currentDuration}\r\n totalDuration={totalDuration}\r\n startDate={startDate}\r\n endDate={endDate}\r\n isPlaying={this.state.isPlaying}\r\n inMiniMode={!!minimized}\r\n showTime={!showDuration}\r\n onChange={this._onTimelineChange}\r\n onUpdate={this._onTimelineChange}\r\n timeZoneOffset={this.props.timeZoneOffset}\r\n markDate={this.props.markDate}\r\n />\r\n <div className=\"end-time-container\">\r\n {hasDates && <span className=\"end-date\">{toDateString(endDate, timeZoneOffset)}</span>}\r\n {hasDates && !showDuration && <span className=\"end-time\">{toTimeString(endDate, timeZoneOffset, timeFormatOptions)}</span>}\r\n {showDuration && <InlineEdit className=\"duration-end-time\" defaultValue={totalDurationString} onChange={this._onTotalDurationChange} />}\r\n </div>\r\n {minimized && this._renderSettings()}\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Timeline
|
|
3
3
|
*/
|
|
4
|
-
import { ColorDef } from "@itwin/core-common";
|
|
5
|
-
import { ScreenViewport } from "@itwin/core-frontend";
|
|
6
|
-
import { GenericUiEventArgs } from "@itwin/appui-abstract";
|
|
4
|
+
import type { ColorDef } from "@itwin/core-common";
|
|
5
|
+
import type { ScreenViewport } from "@itwin/core-frontend";
|
|
6
|
+
import type { GenericUiEventArgs } from "@itwin/appui-abstract";
|
|
7
7
|
/** The timeline scale.
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/interfaces.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/interfaces.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;GAEG;AACH,oBAAY,aAAa;IACvB,iBAAiB;IACjB,KAAK,IAAA;IACL,oBAAoB;IACpB,QAAQ,IAAA;IACR,kBAAkB;IAClB,MAAM,IAAA;IACN,gBAAgB;IAChB,IAAI,IAAA;IACJ,iBAAiB;IACjB,KAAK,IAAA;CACN;AAED;;GAEG;AACH,oBAAY,mBAAmB;IAC7B,qDAAqD;IACrD,UAAU,IAAA;IACV,sEAAsE;IACtE,WAAW,IAAA;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+FAA+F;IAC/F,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gGAAgG;IAChG,aAAa,CAAC,EAAE,IAAI,CAAC;IACrB,yHAAyH;IACzH,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,yFAAyF;IACzF,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,6GAA6G;IAC7G,WAAW,CAAC,EAAE,mBAAmB,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,iBAAiB,EAAE,MAAM,KAAK,IAAI,CAAC;AAEjF;;;;GAIG;AACH,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E,yBAAyB,EAAE,OAAO,CAAC;IAEnC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACrC,wCAAwC;IACxC,GAAG,EAAE,IAAI,CAAC;IACV,4CAA4C;IAC5C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,0BAA0B;IAC1B,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,iDAAiD;IACjD,aAAa,CAAC,EAAE,4BAA4B,CAAC;IAC7C,iCAAiC;IACjC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,wCAAwC;IACxC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IACvB,wCAAwC;IACxC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;IACtB,mBAAmB;IACnB,WAAW,EAAE,QAAQ,CAAC;IACtB,6CAA6C;IAC7C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC;sGACkG;IAClG,cAAc,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/interfaces.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAMH;;GAEG;AACH,MAAM,CAAN,IAAY,aAWX;AAXD,WAAY,aAAa;IACvB,iBAAiB;IACjB,mDAAK,CAAA;IACL,oBAAoB;IACpB,yDAAQ,CAAA;IACR,kBAAkB;IAClB,qDAAM,CAAA;IACN,gBAAgB;IAChB,iDAAI,CAAA;IACJ,iBAAiB;IACjB,mDAAK,CAAA;AACP,CAAC,EAXW,aAAa,KAAb,aAAa,QAWxB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,qDAAqD;IACrD,yEAAU,CAAA;IACV,sEAAsE;IACtE,2EAAW,CAAA;AACb,CAAC,EALW,mBAAmB,KAAnB,mBAAmB,QAK9B;AAoCD;;GAEG;AACH,MAAM,CAAN,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IACjC,yEAAM,CAAA;IACN,uEAAK,CAAA;IACL,qEAAI,CAAA;AACN,CAAC,EAJW,uBAAuB,KAAvB,uBAAuB,QAIlC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Timeline\r\n */\r\n\r\nimport { ColorDef } from \"@itwin/core-common\";\r\nimport { ScreenViewport } from \"@itwin/core-frontend\";\r\nimport { GenericUiEventArgs } from \"@itwin/appui-abstract\";\r\n\r\n/** The timeline scale.\r\n * @public\r\n */\r\nexport enum TimelineScale {\r\n /** Show years */\r\n Years,\r\n /** Show quarters */\r\n Quarters,\r\n /** Show months */\r\n Months,\r\n /** Show days */\r\n Days,\r\n /** Show hours */\r\n Hours,\r\n}\r\n\r\n/** Determines if data displayed to use is the actual date or the amount of time elapsed since project start.\r\n * @public\r\n */\r\nexport enum TimelineDateDisplay {\r\n /** Display time axis using actual start/end dates */\r\n ActualTime,\r\n /** Display time axis using time relative to actual start/end dates */\r\n ProjectTime,\r\n}\r\n\r\n/**\r\n * Playback Settings.\r\n * @public\r\n */\r\nexport interface PlaybackSettings {\r\n /** time in milliseconds to play animation from start date to end date */\r\n duration?: number;\r\n /** Set to True if animation to restart each time playbackEnd is reached. Defaults to false. */\r\n loop?: boolean;\r\n /** If true a minimal set of data is displayed. */\r\n minimized?: boolean;\r\n /** Playback start. If defined must be within start-end range. If not define 'start' is used. */\r\n playbackStart?: Date;\r\n /** Playback end. If defined must be within start-end range and later than playbackStart. If not define 'end' is used. */\r\n playbackEnd?: Date;\r\n /** Set to True if user should be allowed to insert milestone dates. Defaults to false */\r\n allowMilestoneEdits?: boolean;\r\n /** Define if actual date/times are used or date/times relative to project are used to draw timeline axis. */\r\n dateDisplay?: TimelineDateDisplay;\r\n}\r\n\r\n/**\r\n * An interface used to notify Handlers of the current pointer position in the timeline playback. Valid range is 0 to 1 and it determines percentage complete.\r\n * @public\r\n */\r\nexport type AnimationFractionChangeHandler = (animationFraction: number) => void;\r\n\r\n/**\r\n * An interface used to notify Handlers of Playback Settings changes.\r\n * Contains the settings to be used.\r\n * @public\r\n */\r\nexport type PlaybackSettingsChangeHandler = (settingsChange: PlaybackSettings) => void;\r\n\r\n/** Actions for Pause/Play event\r\n * @public\r\n */\r\nexport enum TimelinePausePlayAction {\r\n Toggle,\r\n Pause,\r\n Play,\r\n}\r\n/** Args for event to pause or play the timeline component\r\n * @public\r\n */\r\nexport interface TimelinePausePlayArgs extends GenericUiEventArgs {\r\n timelineAction: TimelinePausePlayAction;\r\n}\r\n/** Interface for a timeline data provider class\r\n * @public\r\n */\r\nexport interface TimelineDataProvider {\r\n /** uniqueId of provider */\r\n id: string;\r\n /** view id when viewport is initially assigned */\r\n viewId: string;\r\n /** returns true if the provider has timeline animation data available */\r\n supportsTimelineAnimation: boolean;\r\n /** Starting date for entire timeline */\r\n start?: Date;\r\n /** End date for entire timeline */\r\n end?: Date;\r\n /** Current animation fraction from 0.0 to 1.0 */\r\n animationFraction?: number;\r\n getSettings(): PlaybackSettings;\r\n /** Called to get the initial scrubber location. This must be a value between 0 and the duration in PlaybackSettings. */\r\n initialDuration: number;\r\n /** Called to get the duration of the Playback. */\r\n duration: number;\r\n /** If true the playback will continuously loop. */\r\n loop: boolean;\r\n /** Called to save the playback settings */\r\n updateSettings(settings: PlaybackSettings): void;\r\n /** Async call to load milestone and settings data */\r\n loadTimelineData(): Promise<boolean>;\r\n /** Called when an internal process has defined the playback settings and the UI needs to be updated */\r\n onPlaybackSettingChanged?: PlaybackSettingsChangeHandler;\r\n /** Called when the an internal process has defined the playback settings and the UI needs to be updated */\r\n onAnimationFractionChanged?: AnimationFractionChangeHandler;\r\n /** viewport to show animation */\r\n viewport?: ScreenViewport;\r\n}\r\n\r\n/**\r\n * An interface used to notify Handlers of Playback progress.\r\n * Contains the settings to be used.\r\n * @alpha\r\n */\r\nexport type SolarPlaybackProgressHandler = (time: Date) => void;\r\n\r\n/** Data Provider interface for getting and setting solar position\r\n * @alpha\r\n */\r\nexport interface SolarDataProvider {\r\n // View Id used to determine sunrise and sunset\r\n viewId: string;\r\n /** returns true if the provider has timeline animation data available */\r\n supportsTimelineAnimation: boolean;\r\n // set to true is timeline should be shown - return false if view is not set to display shadow.\r\n readonly shouldShowTimeline: boolean;\r\n /** Starting date for entire timeline */\r\n day: Date;\r\n /** Starting time for day in milliseconds */\r\n readonly dayStartMs: number;\r\n /** Time of day for sun */\r\n readonly timeOfDay: Date;\r\n /** Called during playback to update animation */\r\n onTimeChanged?: SolarPlaybackProgressHandler;\r\n /** viewport to show animation */\r\n viewport?: ScreenViewport;\r\n /** Time of Sunrise to nearest minute */\r\n readonly sunrise: Date;\r\n /** time of Sunrise to nearest minute */\r\n readonly sunset: Date;\r\n /** shadow color */\r\n shadowColor: ColorDef;\r\n /** timezone offset for local project time */\r\n readonly timeZoneOffset: number;\r\n /** set date for shadow study. If isProjectDate is false the is assume to be in users\r\n * current time and the value is adjusted to be the same date and time at the project location. */\r\n setDateAndTime: (day: Date, isProjectDate?: boolean) => void;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/interfaces.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAMH;;GAEG;AACH,MAAM,CAAN,IAAY,aAWX;AAXD,WAAY,aAAa;IACvB,iBAAiB;IACjB,mDAAK,CAAA;IACL,oBAAoB;IACpB,yDAAQ,CAAA;IACR,kBAAkB;IAClB,qDAAM,CAAA;IACN,gBAAgB;IAChB,iDAAI,CAAA;IACJ,iBAAiB;IACjB,mDAAK,CAAA;AACP,CAAC,EAXW,aAAa,KAAb,aAAa,QAWxB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,qDAAqD;IACrD,yEAAU,CAAA;IACV,sEAAsE;IACtE,2EAAW,CAAA;AACb,CAAC,EALW,mBAAmB,KAAnB,mBAAmB,QAK9B;AAoCD;;GAEG;AACH,MAAM,CAAN,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IACjC,yEAAM,CAAA;IACN,uEAAK,CAAA;IACL,qEAAI,CAAA;AACN,CAAC,EAJW,uBAAuB,KAAvB,uBAAuB,QAIlC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Timeline\r\n */\r\n\r\nimport type { ColorDef } from \"@itwin/core-common\";\r\nimport type { ScreenViewport } from \"@itwin/core-frontend\";\r\nimport type { GenericUiEventArgs } from \"@itwin/appui-abstract\";\r\n\r\n/** The timeline scale.\r\n * @public\r\n */\r\nexport enum TimelineScale {\r\n /** Show years */\r\n Years,\r\n /** Show quarters */\r\n Quarters,\r\n /** Show months */\r\n Months,\r\n /** Show days */\r\n Days,\r\n /** Show hours */\r\n Hours,\r\n}\r\n\r\n/** Determines if data displayed to use is the actual date or the amount of time elapsed since project start.\r\n * @public\r\n */\r\nexport enum TimelineDateDisplay {\r\n /** Display time axis using actual start/end dates */\r\n ActualTime,\r\n /** Display time axis using time relative to actual start/end dates */\r\n ProjectTime,\r\n}\r\n\r\n/**\r\n * Playback Settings.\r\n * @public\r\n */\r\nexport interface PlaybackSettings {\r\n /** time in milliseconds to play animation from start date to end date */\r\n duration?: number;\r\n /** Set to True if animation to restart each time playbackEnd is reached. Defaults to false. */\r\n loop?: boolean;\r\n /** If true a minimal set of data is displayed. */\r\n minimized?: boolean;\r\n /** Playback start. If defined must be within start-end range. If not define 'start' is used. */\r\n playbackStart?: Date;\r\n /** Playback end. If defined must be within start-end range and later than playbackStart. If not define 'end' is used. */\r\n playbackEnd?: Date;\r\n /** Set to True if user should be allowed to insert milestone dates. Defaults to false */\r\n allowMilestoneEdits?: boolean;\r\n /** Define if actual date/times are used or date/times relative to project are used to draw timeline axis. */\r\n dateDisplay?: TimelineDateDisplay;\r\n}\r\n\r\n/**\r\n * An interface used to notify Handlers of the current pointer position in the timeline playback. Valid range is 0 to 1 and it determines percentage complete.\r\n * @public\r\n */\r\nexport type AnimationFractionChangeHandler = (animationFraction: number) => void;\r\n\r\n/**\r\n * An interface used to notify Handlers of Playback Settings changes.\r\n * Contains the settings to be used.\r\n * @public\r\n */\r\nexport type PlaybackSettingsChangeHandler = (settingsChange: PlaybackSettings) => void;\r\n\r\n/** Actions for Pause/Play event\r\n * @public\r\n */\r\nexport enum TimelinePausePlayAction {\r\n Toggle,\r\n Pause,\r\n Play,\r\n}\r\n/** Args for event to pause or play the timeline component\r\n * @public\r\n */\r\nexport interface TimelinePausePlayArgs extends GenericUiEventArgs {\r\n timelineAction: TimelinePausePlayAction;\r\n}\r\n/** Interface for a timeline data provider class\r\n * @public\r\n */\r\nexport interface TimelineDataProvider {\r\n /** uniqueId of provider */\r\n id: string;\r\n /** view id when viewport is initially assigned */\r\n viewId: string;\r\n /** returns true if the provider has timeline animation data available */\r\n supportsTimelineAnimation: boolean;\r\n /** Starting date for entire timeline */\r\n start?: Date;\r\n /** End date for entire timeline */\r\n end?: Date;\r\n /** Current animation fraction from 0.0 to 1.0 */\r\n animationFraction?: number;\r\n getSettings(): PlaybackSettings;\r\n /** Called to get the initial scrubber location. This must be a value between 0 and the duration in PlaybackSettings. */\r\n initialDuration: number;\r\n /** Called to get the duration of the Playback. */\r\n duration: number;\r\n /** If true the playback will continuously loop. */\r\n loop: boolean;\r\n /** Called to save the playback settings */\r\n updateSettings(settings: PlaybackSettings): void;\r\n /** Async call to load milestone and settings data */\r\n loadTimelineData(): Promise<boolean>;\r\n /** Called when an internal process has defined the playback settings and the UI needs to be updated */\r\n onPlaybackSettingChanged?: PlaybackSettingsChangeHandler;\r\n /** Called when the an internal process has defined the playback settings and the UI needs to be updated */\r\n onAnimationFractionChanged?: AnimationFractionChangeHandler;\r\n /** viewport to show animation */\r\n viewport?: ScreenViewport;\r\n}\r\n\r\n/**\r\n * An interface used to notify Handlers of Playback progress.\r\n * Contains the settings to be used.\r\n * @alpha\r\n */\r\nexport type SolarPlaybackProgressHandler = (time: Date) => void;\r\n\r\n/** Data Provider interface for getting and setting solar position\r\n * @alpha\r\n */\r\nexport interface SolarDataProvider {\r\n // View Id used to determine sunrise and sunset\r\n viewId: string;\r\n /** returns true if the provider has timeline animation data available */\r\n supportsTimelineAnimation: boolean;\r\n // set to true is timeline should be shown - return false if view is not set to display shadow.\r\n readonly shouldShowTimeline: boolean;\r\n /** Starting date for entire timeline */\r\n day: Date;\r\n /** Starting time for day in milliseconds */\r\n readonly dayStartMs: number;\r\n /** Time of day for sun */\r\n readonly timeOfDay: Date;\r\n /** Called during playback to update animation */\r\n onTimeChanged?: SolarPlaybackProgressHandler;\r\n /** viewport to show animation */\r\n viewport?: ScreenViewport;\r\n /** Time of Sunrise to nearest minute */\r\n readonly sunrise: Date;\r\n /** time of Sunrise to nearest minute */\r\n readonly sunset: Date;\r\n /** shadow color */\r\n shadowColor: ColorDef;\r\n /** timezone offset for local project time */\r\n readonly timeZoneOffset: number;\r\n /** set date for shadow study. If isProjectDate is false the is assume to be in users\r\n * current time and the value is adjusted to be the same date and time at the project location. */\r\n setDateAndTime: (day: Date, isProjectDate?: boolean) => void;\r\n}\r\n"]}
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* @module Viewport
|
|
3
3
|
*/
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
import { Id64String } from "@itwin/core-bentley";
|
|
6
|
-
import { IModelConnection,
|
|
7
|
-
import {
|
|
5
|
+
import type { Id64String } from "@itwin/core-bentley";
|
|
6
|
+
import type { IModelConnection, TentativePoint, ViewManager } from "@itwin/core-frontend";
|
|
7
|
+
import { ScreenViewport, ViewState } from "@itwin/core-frontend";
|
|
8
|
+
import type { CommonProps } from "@itwin/core-react";
|
|
8
9
|
/** Type for a ViewState prop
|
|
9
10
|
* @public
|
|
10
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewportComponent.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"ViewportComponent.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAKrD,OAAO,KAAK,EAAE,gBAAgB,EAC5B,cAAc,EAAE,WAAW,EAClB,MAAM,sBAAsB,CAAC;AACxC,OAAO,EACM,cAAc,EAAgB,SAAS,EACnD,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAMrD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,CAAC,MAAM,SAAS,CAAC,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,wBAAwB;IACxB,MAAM,EAAE,gBAAgB,CAAC;IACzB,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B,2CAA2C;IAC3C,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,wDAAwD;IACxD,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC1C,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB;IAChB,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,OAAO,CAAC;IACjD,gBAAgB;IAChB,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,KAAK,CAAC,SAAS,CAAC;IAC/D,sCAAsC;IACtC,mBAAmB,CAAC,EAAE,WAAW,CAAC;IAClC,sCAAsC;IACtC,sBAAsB,CAAC,EAAE,OAAO,cAAc,CAAC;IAC/C,sCAAsC;IACtC,sBAAsB,CAAC,EAAE,cAAc,CAAC;CACzC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,eAwQrD"}
|
|
@@ -18,7 +18,7 @@ import { ViewportComponentEvents, } from "./ViewportComponentEvents";
|
|
|
18
18
|
export function ViewportComponent(props) {
|
|
19
19
|
const { viewState, imodel, viewDefinitionId, getViewOverlay, viewManagerOverride, tentativePointOverride, onContextMenu, style, className, screenViewportOverride, controlId, viewportRef } = props;
|
|
20
20
|
// istanbul ignore next
|
|
21
|
-
const viewManagerRef = React.useRef(viewManagerOverride
|
|
21
|
+
const viewManagerRef = React.useRef(viewManagerOverride !== null && viewManagerOverride !== void 0 ? viewManagerOverride : IModelApp.viewManager);
|
|
22
22
|
const tentativePointOverrideRef = React.useRef(tentativePointOverride);
|
|
23
23
|
const screenViewportCreated = React.useRef(false);
|
|
24
24
|
const viewportDiv = React.useRef(null);
|
|
@@ -64,9 +64,10 @@ export function ViewportComponent(props) {
|
|
|
64
64
|
};
|
|
65
65
|
const targetPoint = React.useRef(null);
|
|
66
66
|
const getRotatePoint = (vp) => {
|
|
67
|
+
var _a, _b;
|
|
67
68
|
const lastTargetPoint = targetPoint.current;
|
|
68
69
|
// istanbul ignore next
|
|
69
|
-
const tentativePoint = tentativePointOverrideRef.current
|
|
70
|
+
const tentativePoint = (_a = tentativePointOverrideRef.current) !== null && _a !== void 0 ? _a : IModelApp.tentativePoint;
|
|
70
71
|
// istanbul ignore else
|
|
71
72
|
if (tentativePoint.isActive)
|
|
72
73
|
return tentativePoint.getPoint();
|
|
@@ -91,7 +92,7 @@ export function ViewportComponent(props) {
|
|
|
91
92
|
const visiblePoint = vp.pickNearestVisibleGeometry(vp.npcToWorld(NpcCenter), vp.pixelsFromInches(ToolSettings.viewToolPickRadiusInches));
|
|
92
93
|
targetPoint.current = (undefined !== visiblePoint ? visiblePoint : vp.view.getTargetPoint());
|
|
93
94
|
// istanbul ignore next
|
|
94
|
-
return targetPoint.current
|
|
95
|
+
return (_b = targetPoint.current) !== null && _b !== void 0 ? _b : vp.view.getCenter();
|
|
95
96
|
};
|
|
96
97
|
const handleCubeRotationChangeEvent = (args) => {
|
|
97
98
|
const viewManager = viewManagerRef.current;
|
|
@@ -199,8 +200,8 @@ export function ViewportComponent(props) {
|
|
|
199
200
|
Logger.logError("ViewportComponent", `A Viewstate or a viewId and imodel must be provided`);
|
|
200
201
|
}
|
|
201
202
|
// istanbul ignore next
|
|
202
|
-
if (isMounted.current && (currentViewState
|
|
203
|
-
setInitialViewState(currentViewState
|
|
203
|
+
if (isMounted.current && ((currentViewState === null || currentViewState === void 0 ? void 0 : currentViewState.iModel.isOpen) || (currentViewState === null || currentViewState === void 0 ? void 0 : currentViewState.iModel.isBlank))) {
|
|
204
|
+
setInitialViewState(currentViewState === null || currentViewState === void 0 ? void 0 : currentViewState.clone());
|
|
204
205
|
}
|
|
205
206
|
}
|
|
206
207
|
if (undefined === initialViewState)
|
|
@@ -209,10 +210,11 @@ export function ViewportComponent(props) {
|
|
|
209
210
|
const [viewOverlay, setViewOverlay] = React.useState(null);
|
|
210
211
|
// This useEffect connects to ViewManger as soon as initialViewState is available once component is mounted.
|
|
211
212
|
React.useEffect(() => {
|
|
213
|
+
var _a;
|
|
212
214
|
const parentDiv = viewportDiv.current;
|
|
213
215
|
const viewManager = viewManagerRef.current;
|
|
214
216
|
// istanbul ignore next
|
|
215
|
-
if (parentDiv && initialViewState && (initialViewState
|
|
217
|
+
if (parentDiv && initialViewState && ((initialViewState === null || initialViewState === void 0 ? void 0 : initialViewState.iModel.isOpen) || (initialViewState === null || initialViewState === void 0 ? void 0 : initialViewState.iModel.isBlank))) {
|
|
216
218
|
if (!screenViewportCreated.current) {
|
|
217
219
|
const screenViewport = getScreenViewport(parentDiv, initialViewState);
|
|
218
220
|
screenViewportRef.current = screenViewport;
|
|
@@ -225,7 +227,7 @@ export function ViewportComponent(props) {
|
|
|
225
227
|
}
|
|
226
228
|
else {
|
|
227
229
|
// istanbul ignore next
|
|
228
|
-
screenViewportRef.current
|
|
230
|
+
(_a = screenViewportRef.current) === null || _a === void 0 ? void 0 : _a.changeView(initialViewState);
|
|
229
231
|
}
|
|
230
232
|
}
|
|
231
233
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewportComponent.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponent.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAc,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAW,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EACL,SAAS,EAAoB,cAAc,EAC3B,YAAY,EAClB,SAAS,GACpB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACyF,uBAAuB,GACtH,MAAM,2BAA2B,CAAC;AAkCnC;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAoB;IACpD,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,cAAc,EAAE,mBAAmB,EAC9E,sBAAsB,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,sBAAsB,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IACpH,uBA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f,aAAa,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,MAAM,cAAc,GAAwB;QAC1C,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU;KACpD,CAAC;IAEF,MAAM,gBAAgB,GAAwB;QAC5C,GAAG,KAAK;QACR,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;KAC9B,CAAC;IAEF,OAAO,CACL,6BAAK,KAAK,EAAE,cAAc,kBAAgB,SAAS;QAEjD;YACE,6BACE,GAAG,EAAE,WAAW,iBACJ,oBAAoB,EAChC,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,gBAAgB,EACvB,aAAa,EAAE,iBAAiB,GAChC;YACD,WAAW,CACX,CACC,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Viewport\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Id64String, Logger } from \"@itwin/core-bentley\";\r\nimport { Point3d, Transform } from \"@itwin/core-geometry\";\r\nimport { NpcCenter } from \"@itwin/core-common\";\r\nimport {\r\n IModelApp, IModelConnection, ScreenViewport,\r\n TentativePoint, ToolSettings, ViewManager,\r\n Viewport, ViewState,\r\n} from \"@itwin/core-frontend\";\r\n\r\nimport { CommonProps } from \"@itwin/core-react\";\r\nimport {\r\n CubeRotationChangeEventArgs, DrawingViewportChangeEventArgs, StandardRotationChangeEventArgs, ViewportComponentEvents,\r\n} from \"./ViewportComponentEvents\";\r\n\r\n/** Type for a ViewState prop\r\n * @public\r\n */\r\nexport type ViewStateProp = ViewState | (() => ViewState);\r\n\r\n/**\r\n * Properties for [[ViewportComponent]] component.\r\n * @public\r\n */\r\nexport interface ViewportProps extends CommonProps {\r\n /** IModel to display */\r\n imodel: IModelConnection;\r\n /** Id of a default view definition to load as a starting point */\r\n viewDefinitionId?: Id64String;\r\n /** ViewState to use as a starting point */\r\n viewState?: ViewStateProp;\r\n /** Function to get a reference to the ScreenViewport */\r\n viewportRef?: (v: ScreenViewport) => void;\r\n /** controlId for this content component @internal */\r\n controlId?: string;\r\n /** @internal */\r\n onContextMenu?: (e: React.MouseEvent) => boolean;\r\n /** @internal */\r\n getViewOverlay?: (viewport: ScreenViewport) => React.ReactNode;\r\n /** @internal used only for testing */\r\n viewManagerOverride?: ViewManager;\r\n /** @internal used only for testing */\r\n screenViewportOverride?: typeof ScreenViewport;\r\n /** @internal used only for testing */\r\n tentativePointOverride?: TentativePoint;\r\n}\r\n\r\n/**\r\n * A viewport React component that creates a ScreenViewport.\r\n * @public\r\n */\r\nexport function ViewportComponent(props: ViewportProps) {\r\n const { viewState, imodel, viewDefinitionId, getViewOverlay, viewManagerOverride,\r\n tentativePointOverride, onContextMenu, style, className, screenViewportOverride, controlId, viewportRef } = props;\r\n // istanbul ignore next\r\n const viewManagerRef = React.useRef(viewManagerOverride ?? IModelApp.viewManager);\r\n const tentativePointOverrideRef = React.useRef(tentativePointOverride);\r\n const screenViewportCreated = React.useRef(false);\r\n const viewportDiv = React.useRef<HTMLDivElement>(null);\r\n const screenViewportRef = React.useRef<ScreenViewport | null>(null);\r\n const isMounted = React.useRef(false);\r\n const viewClassFullName = React.useRef(\"\");\r\n const viewId = React.useRef(\"0\");\r\n\r\n // istanbul ignore next\r\n const handleViewChanged = (vp: Viewport) => {\r\n // istanbul ignore next\r\n if (!(vp.iModel.isOpen || vp.iModel.isBlank))\r\n return;\r\n ViewportComponentEvents.setViewMatrix(vp);\r\n if (viewClassFullName.current !== vp.view.classFullName) {\r\n setTimeout(() => {\r\n ViewportComponentEvents.onViewClassFullNameChangedEvent.emit({ viewport: vp, oldName: viewClassFullName.current, newName: vp.view.classFullName });\r\n viewClassFullName.current = vp.view.classFullName;\r\n });\r\n }\r\n if (viewId.current !== vp.view.id) {\r\n setTimeout(() => {\r\n ViewportComponentEvents.onViewIdChangedEvent.emit({ viewport: vp, oldId: viewId.current, newId: vp.view.id });\r\n viewId.current = vp.view.id;\r\n });\r\n }\r\n };\r\n\r\n const handleStandardRotationChangeEvent = (args: StandardRotationChangeEventArgs) => {\r\n const viewManager = viewManagerRef.current;\r\n const currentScreenViewport = screenViewportRef.current;\r\n if (currentScreenViewport && viewManager.selectedView === currentScreenViewport) {\r\n currentScreenViewport.view.setRotationAboutPoint(ViewState.getStandardViewMatrix(args.standardRotation));\r\n currentScreenViewport.synchWithView();\r\n }\r\n };\r\n\r\n const handleDrawingViewportChangeEvent = (args: DrawingViewportChangeEventArgs) => {\r\n const viewManager = viewManagerRef.current;\r\n const currentScreenViewport = screenViewportRef.current;\r\n if (currentScreenViewport && viewManager.selectedView === currentScreenViewport) {\r\n currentScreenViewport.view.setOrigin(args.origin);\r\n currentScreenViewport.view.setRotation(args.rotation);\r\n currentScreenViewport.synchWithView({ noSaveInUndo: args.complete !== true });\r\n }\r\n };\r\n\r\n const targetPoint = React.useRef<Point3d | null>(null);\r\n\r\n const getRotatePoint = (vp: ScreenViewport): Point3d => {\r\n const lastTargetPoint = targetPoint.current;\r\n // istanbul ignore next\r\n const tentativePoint = tentativePointOverrideRef.current ?? IModelApp.tentativePoint;\r\n // istanbul ignore else\r\n if (tentativePoint.isActive)\r\n return tentativePoint.getPoint();\r\n\r\n // istanbul ignore else\r\n if (undefined !== vp.viewCmdTargetCenter) {\r\n const testPt = vp.worldToView(vp.viewCmdTargetCenter);\r\n const viewRect = vp.viewRect;\r\n if (viewRect.containsPoint(testPt))\r\n return vp.viewCmdTargetCenter;\r\n vp.viewCmdTargetCenter = undefined;\r\n }\r\n\r\n // istanbul ignore else\r\n if (null !== lastTargetPoint) {\r\n const testPt = vp.worldToView(lastTargetPoint);\r\n const viewRect = vp.viewRect.clone();\r\n viewRect.scaleAboutCenter(0.25, 0.25);\r\n // istanbul ignore next hard to reach because of mocks\r\n if (viewRect.containsPoint(testPt))\r\n return lastTargetPoint;\r\n targetPoint.current = null;\r\n }\r\n\r\n const visiblePoint = vp.pickNearestVisibleGeometry(vp.npcToWorld(NpcCenter), vp.pixelsFromInches(ToolSettings.viewToolPickRadiusInches));\r\n targetPoint.current = (undefined !== visiblePoint ? visiblePoint : vp.view.getTargetPoint());\r\n // istanbul ignore next\r\n return targetPoint.current ?? vp.view.getCenter();\r\n };\r\n\r\n const handleCubeRotationChangeEvent = (args: CubeRotationChangeEventArgs) => {\r\n const viewManager = viewManagerRef.current;\r\n const currentScreenViewport = screenViewportRef.current;\r\n // istanbul ignore else\r\n if (currentScreenViewport && viewManager.selectedView === currentScreenViewport) {\r\n const rotMatrix = args.rotMatrix;\r\n // istanbul ignore else\r\n if (currentScreenViewport.rotation !== rotMatrix) {\r\n const inverse = rotMatrix.transpose(); // rotation is from current nav cube state...\r\n const center = getRotatePoint(currentScreenViewport);\r\n const targetMatrix = inverse.multiplyMatrixMatrix(currentScreenViewport.view.getRotation());\r\n const worldTransform = Transform.createFixedPointAndMatrix(center, targetMatrix);\r\n const frustum = currentScreenViewport.getWorldFrustum();\r\n frustum.multiply(worldTransform);\r\n currentScreenViewport.view.setupFromFrustum(frustum);\r\n currentScreenViewport.synchWithView({ noSaveInUndo: !args.complete });\r\n }\r\n }\r\n };\r\n\r\n const handleDisconnectFromViewManager = () => {\r\n const screenViewport = screenViewportRef.current;\r\n if (screenViewport) {\r\n const viewManager = IModelApp.viewManager;\r\n screenViewport.onViewChanged.removeListener(handleViewChanged);\r\n screenViewportRef.current = null;\r\n screenViewportCreated.current = false;\r\n ViewportComponentEvents.onDrawingViewportChangeEvent.removeListener(handleDrawingViewportChangeEvent);\r\n ViewportComponentEvents.onCubeRotationChangeEvent.removeListener(handleCubeRotationChangeEvent);\r\n ViewportComponentEvents.onStandardRotationChangeEvent.removeListener(handleStandardRotationChangeEvent);\r\n viewManager.dropViewport(screenViewport, true);\r\n }\r\n };\r\n\r\n // istanbul ignore next\r\n const handleWindowUnload = () => {\r\n const parentDiv = viewportDiv.current;\r\n if (parentDiv) {\r\n const parentWindow = parentDiv.ownerDocument.defaultView as Window;\r\n if (parentWindow !== window) {\r\n handleDisconnectFromViewManager();\r\n }\r\n }\r\n };\r\n\r\n const getScreenViewport = (parentDiv: HTMLDivElement, inViewState: ViewState) => {\r\n // istanbul ignore next\r\n const screenViewportFactory = screenViewportOverride ? screenViewportOverride : ScreenViewport;\r\n const parentWindow = parentDiv.ownerDocument.defaultView as Window;\r\n parentWindow.addEventListener(\"unload\", handleWindowUnload, true); // listener clear after being called\r\n ViewportComponentEvents.initialize();\r\n ViewportComponentEvents.onDrawingViewportChangeEvent.addListener(handleDrawingViewportChangeEvent);\r\n ViewportComponentEvents.onCubeRotationChangeEvent.addListener(handleCubeRotationChangeEvent);\r\n ViewportComponentEvents.onStandardRotationChangeEvent.addListener(handleStandardRotationChangeEvent);\r\n const screenViewport = screenViewportFactory.create(parentDiv, inViewState);\r\n screenViewportCreated.current = true;\r\n viewClassFullName.current = screenViewport.view.classFullName;\r\n viewId.current = screenViewport.view.id;\r\n screenViewport.onViewChanged.addListener(handleViewChanged);\r\n return screenViewport;\r\n };\r\n\r\n React.useEffect(() => {\r\n isMounted.current = true;\r\n Logger.logInfo(\"ViewportComponent\", `mounting ViewportComponent for controlId=${controlId}`);\r\n\r\n return () => {\r\n isMounted.current = false;\r\n Logger.logInfo(\"ViewportComponent\", `un-mounting ViewportComponent for controlId=${controlId}`);\r\n handleDisconnectFromViewManager();\r\n };\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, []);\r\n\r\n const [initialViewState, setInitialViewState] = React.useState<ViewState | undefined>(() => {\r\n if (viewState) {\r\n if (typeof viewState === \"function\")\r\n return viewState().clone();\r\n else\r\n return viewState.clone();\r\n }\r\n return undefined;\r\n });\r\n\r\n React.useEffect(() => {\r\n setInitialViewState(undefined);\r\n }, [viewDefinitionId, viewState]);\r\n React.useEffect(() => {\r\n async function fetchInitialViewstate() {\r\n let currentViewState: ViewState | undefined;\r\n if (viewState) {\r\n if (typeof viewState === \"function\")\r\n currentViewState = viewState();\r\n else\r\n currentViewState = viewState;\r\n } else if (viewDefinitionId && imodel) {\r\n try {\r\n currentViewState = await imodel.views.load(viewDefinitionId);\r\n // istanbul ignore next\r\n if (!currentViewState) {\r\n Logger.logError(\"ViewportComponent\", `Viewstate failed to load`);\r\n }\r\n } catch (_e) {\r\n // istanbul ignore next\r\n Logger.logError(\"ViewportComponent\", `Viewstate failed to load`);\r\n }\r\n } else {\r\n Logger.logError(\"ViewportComponent\", `A Viewstate or a viewId and imodel must be provided`);\r\n }\r\n // istanbul ignore next\r\n if (isMounted.current && (currentViewState?.iModel.isOpen || currentViewState?.iModel.isBlank)) {\r\n setInitialViewState(currentViewState?.clone());\r\n }\r\n }\r\n if (undefined === initialViewState)\r\n fetchInitialViewstate(); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n }, [imodel, initialViewState, viewDefinitionId, viewState]);\r\n\r\n const [viewOverlay, setViewOverlay] = React.useState<React.ReactNode>(null);\r\n\r\n // This useEffect connects to ViewManger as soon as initialViewState is available once component is mounted.\r\n React.useEffect(() => {\r\n const parentDiv = viewportDiv.current;\r\n const viewManager = viewManagerRef.current;\r\n // istanbul ignore next\r\n if (parentDiv && initialViewState && (initialViewState?.iModel.isOpen || initialViewState?.iModel.isBlank)) {\r\n if (!screenViewportCreated.current) {\r\n const screenViewport = getScreenViewport(parentDiv, initialViewState);\r\n screenViewportRef.current = screenViewport;\r\n\r\n if (viewportRef)\r\n viewportRef(screenViewport);\r\n\r\n Logger.logInfo(\"ViewportComponent\", `processing viewManager.addViewport for controlId=${controlId}`);\r\n viewManager.addViewport(screenViewport);\r\n\r\n // overlay component is set up once a ScreenViewport is available. The overlay component must handle any view changes itself.\r\n setViewOverlay(getViewOverlay ? getViewOverlay(screenViewport) : null);\r\n } else {\r\n // istanbul ignore next\r\n screenViewportRef.current?.changeView(initialViewState);\r\n }\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [controlId, initialViewState, viewportRef]);\r\n\r\n const handleContextMenu = React.useCallback((e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (onContextMenu)\r\n onContextMenu(e);\r\n }, [onContextMenu]);\r\n\r\n const parentDivStyle: React.CSSProperties = {\r\n height: \"100%\", width: \"100%\", position: \"relative\",\r\n };\r\n\r\n const viewportDivStyle: React.CSSProperties = {\r\n ...style,\r\n height: \"100%\", width: \"100%\",\r\n };\r\n\r\n return (\r\n <div style={parentDivStyle} data-item-id={controlId}\r\n >\r\n <>\r\n <div\r\n ref={viewportDiv}\r\n data-testid=\"viewport-component\"\r\n className={className}\r\n style={viewportDivStyle}\r\n onContextMenu={handleContextMenu}\r\n />\r\n {viewOverlay}\r\n </>\r\n </div>\r\n );\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ViewportComponent.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponent.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAI/C,OAAO,EACL,SAAS,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,GACnD,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EAAE,uBAAuB,GAC/B,MAAM,2BAA2B,CAAC;AAkCnC;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAoB;IACpD,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,cAAc,EAAE,mBAAmB,EAC9E,sBAAsB,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,sBAAsB,EAAE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A,iBAAiB,CAAC,OAAO,0CAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC;aACzD;SACF;QACD,uDAAuD;IACzD,CAAC,EAAE,CAAC,SAAS,EAAE,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAAC;IAE/C,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAmB,EAAE,EAAE;QAClE,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,IAAI,aAAa;YACf,aAAa,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,MAAM,cAAc,GAAwB;QAC1C,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU;KACpD,CAAC;IAEF,MAAM,gBAAgB,GAAwB;QAC5C,GAAG,KAAK;QACR,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;KAC9B,CAAC;IAEF,OAAO,CACL,6BAAK,KAAK,EAAE,cAAc,kBAAgB,SAAS;QAEjD;YACE,6BACE,GAAG,EAAE,WAAW,iBACJ,oBAAoB,EAChC,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,gBAAgB,EACvB,aAAa,EAAE,iBAAiB,GAChC;YACD,WAAW,CACX,CACC,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Viewport\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport type { Id64String} from \"@itwin/core-bentley\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport type { Point3d} from \"@itwin/core-geometry\";\r\nimport { Transform } from \"@itwin/core-geometry\";\r\nimport { NpcCenter } from \"@itwin/core-common\";\r\nimport type { IModelConnection,\r\n TentativePoint, ViewManager,\r\n Viewport} from \"@itwin/core-frontend\";\r\nimport {\r\n IModelApp, ScreenViewport, ToolSettings, ViewState,\r\n} from \"@itwin/core-frontend\";\r\n\r\nimport type { CommonProps } from \"@itwin/core-react\";\r\nimport type {\r\n CubeRotationChangeEventArgs, DrawingViewportChangeEventArgs, StandardRotationChangeEventArgs} from \"./ViewportComponentEvents\";\r\nimport { ViewportComponentEvents,\r\n} from \"./ViewportComponentEvents\";\r\n\r\n/** Type for a ViewState prop\r\n * @public\r\n */\r\nexport type ViewStateProp = ViewState | (() => ViewState);\r\n\r\n/**\r\n * Properties for [[ViewportComponent]] component.\r\n * @public\r\n */\r\nexport interface ViewportProps extends CommonProps {\r\n /** IModel to display */\r\n imodel: IModelConnection;\r\n /** Id of a default view definition to load as a starting point */\r\n viewDefinitionId?: Id64String;\r\n /** ViewState to use as a starting point */\r\n viewState?: ViewStateProp;\r\n /** Function to get a reference to the ScreenViewport */\r\n viewportRef?: (v: ScreenViewport) => void;\r\n /** controlId for this content component @internal */\r\n controlId?: string;\r\n /** @internal */\r\n onContextMenu?: (e: React.MouseEvent) => boolean;\r\n /** @internal */\r\n getViewOverlay?: (viewport: ScreenViewport) => React.ReactNode;\r\n /** @internal used only for testing */\r\n viewManagerOverride?: ViewManager;\r\n /** @internal used only for testing */\r\n screenViewportOverride?: typeof ScreenViewport;\r\n /** @internal used only for testing */\r\n tentativePointOverride?: TentativePoint;\r\n}\r\n\r\n/**\r\n * A viewport React component that creates a ScreenViewport.\r\n * @public\r\n */\r\nexport function ViewportComponent(props: ViewportProps) {\r\n const { viewState, imodel, viewDefinitionId, getViewOverlay, viewManagerOverride,\r\n tentativePointOverride, onContextMenu, style, className, screenViewportOverride, controlId, viewportRef } = props;\r\n // istanbul ignore next\r\n const viewManagerRef = React.useRef(viewManagerOverride ?? IModelApp.viewManager);\r\n const tentativePointOverrideRef = React.useRef(tentativePointOverride);\r\n const screenViewportCreated = React.useRef(false);\r\n const viewportDiv = React.useRef<HTMLDivElement>(null);\r\n const screenViewportRef = React.useRef<ScreenViewport | null>(null);\r\n const isMounted = React.useRef(false);\r\n const viewClassFullName = React.useRef(\"\");\r\n const viewId = React.useRef(\"0\");\r\n\r\n // istanbul ignore next\r\n const handleViewChanged = (vp: Viewport) => {\r\n // istanbul ignore next\r\n if (!(vp.iModel.isOpen || vp.iModel.isBlank))\r\n return;\r\n ViewportComponentEvents.setViewMatrix(vp);\r\n if (viewClassFullName.current !== vp.view.classFullName) {\r\n setTimeout(() => {\r\n ViewportComponentEvents.onViewClassFullNameChangedEvent.emit({ viewport: vp, oldName: viewClassFullName.current, newName: vp.view.classFullName });\r\n viewClassFullName.current = vp.view.classFullName;\r\n });\r\n }\r\n if (viewId.current !== vp.view.id) {\r\n setTimeout(() => {\r\n ViewportComponentEvents.onViewIdChangedEvent.emit({ viewport: vp, oldId: viewId.current, newId: vp.view.id });\r\n viewId.current = vp.view.id;\r\n });\r\n }\r\n };\r\n\r\n const handleStandardRotationChangeEvent = (args: StandardRotationChangeEventArgs) => {\r\n const viewManager = viewManagerRef.current;\r\n const currentScreenViewport = screenViewportRef.current;\r\n if (currentScreenViewport && viewManager.selectedView === currentScreenViewport) {\r\n currentScreenViewport.view.setRotationAboutPoint(ViewState.getStandardViewMatrix(args.standardRotation));\r\n currentScreenViewport.synchWithView();\r\n }\r\n };\r\n\r\n const handleDrawingViewportChangeEvent = (args: DrawingViewportChangeEventArgs) => {\r\n const viewManager = viewManagerRef.current;\r\n const currentScreenViewport = screenViewportRef.current;\r\n if (currentScreenViewport && viewManager.selectedView === currentScreenViewport) {\r\n currentScreenViewport.view.setOrigin(args.origin);\r\n currentScreenViewport.view.setRotation(args.rotation);\r\n currentScreenViewport.synchWithView({ noSaveInUndo: args.complete !== true });\r\n }\r\n };\r\n\r\n const targetPoint = React.useRef<Point3d | null>(null);\r\n\r\n const getRotatePoint = (vp: ScreenViewport): Point3d => {\r\n const lastTargetPoint = targetPoint.current;\r\n // istanbul ignore next\r\n const tentativePoint = tentativePointOverrideRef.current ?? IModelApp.tentativePoint;\r\n // istanbul ignore else\r\n if (tentativePoint.isActive)\r\n return tentativePoint.getPoint();\r\n\r\n // istanbul ignore else\r\n if (undefined !== vp.viewCmdTargetCenter) {\r\n const testPt = vp.worldToView(vp.viewCmdTargetCenter);\r\n const viewRect = vp.viewRect;\r\n if (viewRect.containsPoint(testPt))\r\n return vp.viewCmdTargetCenter;\r\n vp.viewCmdTargetCenter = undefined;\r\n }\r\n\r\n // istanbul ignore else\r\n if (null !== lastTargetPoint) {\r\n const testPt = vp.worldToView(lastTargetPoint);\r\n const viewRect = vp.viewRect.clone();\r\n viewRect.scaleAboutCenter(0.25, 0.25);\r\n // istanbul ignore next hard to reach because of mocks\r\n if (viewRect.containsPoint(testPt))\r\n return lastTargetPoint;\r\n targetPoint.current = null;\r\n }\r\n\r\n const visiblePoint = vp.pickNearestVisibleGeometry(vp.npcToWorld(NpcCenter), vp.pixelsFromInches(ToolSettings.viewToolPickRadiusInches));\r\n targetPoint.current = (undefined !== visiblePoint ? visiblePoint : vp.view.getTargetPoint());\r\n // istanbul ignore next\r\n return targetPoint.current ?? vp.view.getCenter();\r\n };\r\n\r\n const handleCubeRotationChangeEvent = (args: CubeRotationChangeEventArgs) => {\r\n const viewManager = viewManagerRef.current;\r\n const currentScreenViewport = screenViewportRef.current;\r\n // istanbul ignore else\r\n if (currentScreenViewport && viewManager.selectedView === currentScreenViewport) {\r\n const rotMatrix = args.rotMatrix;\r\n // istanbul ignore else\r\n if (currentScreenViewport.rotation !== rotMatrix) {\r\n const inverse = rotMatrix.transpose(); // rotation is from current nav cube state...\r\n const center = getRotatePoint(currentScreenViewport);\r\n const targetMatrix = inverse.multiplyMatrixMatrix(currentScreenViewport.view.getRotation());\r\n const worldTransform = Transform.createFixedPointAndMatrix(center, targetMatrix);\r\n const frustum = currentScreenViewport.getWorldFrustum();\r\n frustum.multiply(worldTransform);\r\n currentScreenViewport.view.setupFromFrustum(frustum);\r\n currentScreenViewport.synchWithView({ noSaveInUndo: !args.complete });\r\n }\r\n }\r\n };\r\n\r\n const handleDisconnectFromViewManager = () => {\r\n const screenViewport = screenViewportRef.current;\r\n if (screenViewport) {\r\n const viewManager = IModelApp.viewManager;\r\n screenViewport.onViewChanged.removeListener(handleViewChanged);\r\n screenViewportRef.current = null;\r\n screenViewportCreated.current = false;\r\n ViewportComponentEvents.onDrawingViewportChangeEvent.removeListener(handleDrawingViewportChangeEvent);\r\n ViewportComponentEvents.onCubeRotationChangeEvent.removeListener(handleCubeRotationChangeEvent);\r\n ViewportComponentEvents.onStandardRotationChangeEvent.removeListener(handleStandardRotationChangeEvent);\r\n viewManager.dropViewport(screenViewport, true);\r\n }\r\n };\r\n\r\n // istanbul ignore next\r\n const handleWindowUnload = () => {\r\n const parentDiv = viewportDiv.current;\r\n if (parentDiv) {\r\n const parentWindow = parentDiv.ownerDocument.defaultView as Window;\r\n if (parentWindow !== window) {\r\n handleDisconnectFromViewManager();\r\n }\r\n }\r\n };\r\n\r\n const getScreenViewport = (parentDiv: HTMLDivElement, inViewState: ViewState) => {\r\n // istanbul ignore next\r\n const screenViewportFactory = screenViewportOverride ? screenViewportOverride : ScreenViewport;\r\n const parentWindow = parentDiv.ownerDocument.defaultView as Window;\r\n parentWindow.addEventListener(\"unload\", handleWindowUnload, true); // listener clear after being called\r\n ViewportComponentEvents.initialize();\r\n ViewportComponentEvents.onDrawingViewportChangeEvent.addListener(handleDrawingViewportChangeEvent);\r\n ViewportComponentEvents.onCubeRotationChangeEvent.addListener(handleCubeRotationChangeEvent);\r\n ViewportComponentEvents.onStandardRotationChangeEvent.addListener(handleStandardRotationChangeEvent);\r\n const screenViewport = screenViewportFactory.create(parentDiv, inViewState);\r\n screenViewportCreated.current = true;\r\n viewClassFullName.current = screenViewport.view.classFullName;\r\n viewId.current = screenViewport.view.id;\r\n screenViewport.onViewChanged.addListener(handleViewChanged);\r\n return screenViewport;\r\n };\r\n\r\n React.useEffect(() => {\r\n isMounted.current = true;\r\n Logger.logInfo(\"ViewportComponent\", `mounting ViewportComponent for controlId=${controlId}`);\r\n\r\n return () => {\r\n isMounted.current = false;\r\n Logger.logInfo(\"ViewportComponent\", `un-mounting ViewportComponent for controlId=${controlId}`);\r\n handleDisconnectFromViewManager();\r\n };\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, []);\r\n\r\n const [initialViewState, setInitialViewState] = React.useState<ViewState | undefined>(() => {\r\n if (viewState) {\r\n if (typeof viewState === \"function\")\r\n return viewState().clone();\r\n else\r\n return viewState.clone();\r\n }\r\n return undefined;\r\n });\r\n\r\n React.useEffect(() => {\r\n setInitialViewState(undefined);\r\n }, [viewDefinitionId, viewState]);\r\n React.useEffect(() => {\r\n async function fetchInitialViewstate() {\r\n let currentViewState: ViewState | undefined;\r\n if (viewState) {\r\n if (typeof viewState === \"function\")\r\n currentViewState = viewState();\r\n else\r\n currentViewState = viewState;\r\n } else if (viewDefinitionId && imodel) {\r\n try {\r\n currentViewState = await imodel.views.load(viewDefinitionId);\r\n // istanbul ignore next\r\n if (!currentViewState) {\r\n Logger.logError(\"ViewportComponent\", `Viewstate failed to load`);\r\n }\r\n } catch (_e) {\r\n // istanbul ignore next\r\n Logger.logError(\"ViewportComponent\", `Viewstate failed to load`);\r\n }\r\n } else {\r\n Logger.logError(\"ViewportComponent\", `A Viewstate or a viewId and imodel must be provided`);\r\n }\r\n // istanbul ignore next\r\n if (isMounted.current && (currentViewState?.iModel.isOpen || currentViewState?.iModel.isBlank)) {\r\n setInitialViewState(currentViewState?.clone());\r\n }\r\n }\r\n if (undefined === initialViewState)\r\n fetchInitialViewstate(); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n }, [imodel, initialViewState, viewDefinitionId, viewState]);\r\n\r\n const [viewOverlay, setViewOverlay] = React.useState<React.ReactNode>(null);\r\n\r\n // This useEffect connects to ViewManger as soon as initialViewState is available once component is mounted.\r\n React.useEffect(() => {\r\n const parentDiv = viewportDiv.current;\r\n const viewManager = viewManagerRef.current;\r\n // istanbul ignore next\r\n if (parentDiv && initialViewState && (initialViewState?.iModel.isOpen || initialViewState?.iModel.isBlank)) {\r\n if (!screenViewportCreated.current) {\r\n const screenViewport = getScreenViewport(parentDiv, initialViewState);\r\n screenViewportRef.current = screenViewport;\r\n\r\n if (viewportRef)\r\n viewportRef(screenViewport);\r\n\r\n Logger.logInfo(\"ViewportComponent\", `processing viewManager.addViewport for controlId=${controlId}`);\r\n viewManager.addViewport(screenViewport);\r\n\r\n // overlay component is set up once a ScreenViewport is available. The overlay component must handle any view changes itself.\r\n setViewOverlay(getViewOverlay ? getViewOverlay(screenViewport) : null);\r\n } else {\r\n // istanbul ignore next\r\n screenViewportRef.current?.changeView(initialViewState);\r\n }\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [controlId, initialViewState, viewportRef]);\r\n\r\n const handleContextMenu = React.useCallback((e: React.MouseEvent) => {\r\n e.preventDefault();\r\n if (onContextMenu)\r\n onContextMenu(e);\r\n }, [onContextMenu]);\r\n\r\n const parentDivStyle: React.CSSProperties = {\r\n height: \"100%\", width: \"100%\", position: \"relative\",\r\n };\r\n\r\n const viewportDivStyle: React.CSSProperties = {\r\n ...style,\r\n height: \"100%\", width: \"100%\",\r\n };\r\n\r\n return (\r\n <div style={parentDivStyle} data-item-id={controlId}\r\n >\r\n <>\r\n <div\r\n ref={viewportDiv}\r\n data-testid=\"viewport-component\"\r\n className={className}\r\n style={viewportDivStyle}\r\n onContextMenu={handleContextMenu}\r\n />\r\n {viewOverlay}\r\n </>\r\n </div>\r\n );\r\n}\r\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Viewport
|
|
3
3
|
*/
|
|
4
4
|
import { Matrix3d, Point3d, Vector3d } from "@itwin/core-geometry";
|
|
5
|
-
import { StandardViewId, Viewport } from "@itwin/core-frontend";
|
|
5
|
+
import type { StandardViewId, Viewport } from "@itwin/core-frontend";
|
|
6
6
|
import { UiEvent } from "@itwin/appui-abstract";
|
|
7
7
|
import { Face } from "../navigationaids/Cube";
|
|
8
8
|
/** Arguments for [[DrawingViewportChangeEvent]]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewportComponentEvents.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponentEvents.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,
|
|
1
|
+
{"version":3,"file":"ViewportComponentEvents.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponentEvents.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAA+B,cAAc,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAElG,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,OAAO,CAAC,8BAA8B,CAAC;CAAI;AAE3F;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,QAAQ,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,OAAO,CAAC,2BAA2B,CAAC;CAAI;AAErF;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C,gBAAgB,EAAE,cAAc,CAAC;CAClC;AAED;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,OAAO,CAAC,+B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EAAE,QAAQ,EAAE,QAAQ,GAAE,OAAe,GAAG,IAAI;WAI7F,mBAAmB,CAAC,gBAAgB,EAAE,cAAc,GAAG,IAAI;WAI3D,aAAa,CAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI;CAa9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewportComponentEvents.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponentEvents.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"ViewportComponentEvents.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponentEvents.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAW9C;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,OAAuC;CAAI;AAW3F;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,OAAoC;CAAI;AASrF;;GAEG;AACH,MAAM,OAAO,2BAA4B,SAAQ,OAAwC;CAAI;AAU7F;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,OAAoC;CAAI;AAWrF;;GAEG;AACH,MAAM,OAAO,6BAA8B,SAAQ,OAA0C;CAAI;AAWjG;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,OAA+B;CAAI;AAE3E;;GAEG;AACH,MAAa,uBAAuB;IAG3B,MAAM,CAAC,UAAU;QACtB,IA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AAQ,CAAC,IAAI,EAAE;gBACjB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;gBAC/C,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;aAClD;YACD,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAE/C,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;IACL,CAAC;;AA1Ca,4BAAI,GAAG,IAAI,CAAC,IAAI,CAAC;AACR,8BAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;AAC9B,+BAAO,GAAG,QAAQ,CAAC,UAAU,EAAE,CAAC;AAChC,sCAAc,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;AAC3C,oDAA4B,GAAG,IAAI,0BAA0B,EAAE,CAAC;AAChE,iDAAyB,GAAG,IAAI,uBAAuB,EAAE,CAAC;AAC1D,qDAA6B,GAAG,IAAI,2BAA2B,EAAE,CAAC;AAClE,iDAAyB,GAAG,IAAI,uBAAuB,EAAE,CAAC;AAC1D,uDAA+B,GAAG,IAAI,6BAA6B,EAAE,CAAC;AACtE,4CAAoB,GAAG,IAAI,kBAAkB,EAAE,CAAC;SA3B5D,uBAAuB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Viewport\r\n */\r\n\r\nimport { Matrix3d, Point3d, Vector3d } from \"@itwin/core-geometry\";\r\nimport type { SelectedViewportChangedArgs, StandardViewId, Viewport } from \"@itwin/core-frontend\";\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\nimport { UiEvent } from \"@itwin/appui-abstract\";\r\nimport { Face } from \"../navigationaids/Cube\";\r\n\r\n/** Arguments for [[DrawingViewportChangeEvent]]\r\n * @public\r\n */\r\nexport interface DrawingViewportChangeEventArgs {\r\n rotation: Matrix3d;\r\n origin: Point3d;\r\n complete: boolean;\r\n}\r\n\r\n/** Drawing View Change event\r\n * @public\r\n */\r\nexport class DrawingViewportChangeEvent extends UiEvent<DrawingViewportChangeEventArgs> { }\r\n\r\n/** Arguments for [[CubeRotationChangeEvent]]\r\n * @public\r\n */\r\nexport interface CubeRotationChangeEventArgs {\r\n rotMatrix: Matrix3d;\r\n face: Face;\r\n complete?: boolean;\r\n}\r\n\r\n/** 3d Cube Rotation Change event\r\n * @public\r\n */\r\nexport class CubeRotationChangeEvent extends UiEvent<CubeRotationChangeEventArgs> { }\r\n\r\n/** Arguments for [[StandardRotationChangeEvent]]\r\n * @public\r\n */\r\nexport interface StandardRotationChangeEventArgs {\r\n standardRotation: StandardViewId;\r\n}\r\n\r\n/** Standard Rotation Change event\r\n * @public\r\n */\r\nexport class StandardRotationChangeEvent extends UiEvent<StandardRotationChangeEventArgs> { }\r\n\r\n/** Arguments for [[ViewRotationChangeEvent]]\r\n * @public\r\n */\r\nexport interface ViewRotationChangeEventArgs {\r\n viewport: Viewport;\r\n animationTime?: number;\r\n}\r\n\r\n/** View Rotation Change event\r\n * @public\r\n */\r\nexport class ViewRotationChangeEvent extends UiEvent<ViewRotationChangeEventArgs> { }\r\n\r\n/** Arguments for [[ViewClassFullNameChangedEvent]]\r\n * @public\r\n */\r\nexport interface ViewClassFullNameChangedEventArgs {\r\n viewport: Viewport;\r\n oldName: string;\r\n newName: string;\r\n}\r\n\r\n/** View Class Full Name Change event\r\n * @public\r\n */\r\nexport class ViewClassFullNameChangedEvent extends UiEvent<ViewClassFullNameChangedEventArgs> { }\r\n\r\n/** Arguments for [[ViewIdChangedEvent]]\r\n * @public\r\n */\r\nexport interface ViewIdChangedEventArgs {\r\n viewport: Viewport;\r\n oldId: string;\r\n newId: string;\r\n}\r\n\r\n/** View Id Change event\r\n * @public\r\n */\r\nexport class ViewIdChangedEvent extends UiEvent<ViewIdChangedEventArgs> { }\r\n\r\n/** Viewport Rotation events and methods\r\n * @public\r\n */\r\nexport class ViewportComponentEvents {\r\n private static _removeListener?: () => void;\r\n\r\n public static initialize() {\r\n if (undefined !== this._removeListener)\r\n return;\r\n\r\n this._removeListener = IModelApp.viewManager.onSelectedViewportChanged.addListener(ViewportComponentEvents.handleSelectedViewportChanged);\r\n }\r\n\r\n /** @internal - for unit testing */\r\n public static terminate() {\r\n if (this._removeListener) {\r\n this._removeListener();\r\n this._removeListener = undefined;\r\n }\r\n }\r\n\r\n public static face = Face.None;\r\n public static readonly origin = Point3d.createZero();\r\n public static readonly extents = Vector3d.createZero();\r\n public static readonly rotationMatrix = Matrix3d.createIdentity();\r\n public static readonly onDrawingViewportChangeEvent = new DrawingViewportChangeEvent();\r\n public static readonly onCubeRotationChangeEvent = new CubeRotationChangeEvent();\r\n public static readonly onStandardRotationChangeEvent = new StandardRotationChangeEvent();\r\n public static readonly onViewRotationChangeEvent = new ViewRotationChangeEvent();\r\n public static readonly onViewClassFullNameChangedEvent = new ViewClassFullNameChangedEvent();\r\n public static readonly onViewIdChangedEvent = new ViewIdChangedEvent();\r\n\r\n private static handleSelectedViewportChanged(args: SelectedViewportChangedArgs): void {\r\n if (args.current)\r\n ViewportComponentEvents.setViewMatrix(args.current);\r\n }\r\n\r\n public static setCubeMatrix(rotMatrix: Matrix3d, face = Face.None, complete: boolean = false): void {\r\n this.rotationMatrix.setFrom(rotMatrix);\r\n this.face = face;\r\n this.onCubeRotationChangeEvent.emit({ rotMatrix, complete, face });\r\n }\r\n\r\n public static setDrawingViewportState(origin: Point3d, rotation: Matrix3d, complete: boolean = false): void {\r\n this.onDrawingViewportChangeEvent.emit({ origin, rotation, complete });\r\n }\r\n\r\n public static setStandardRotation(standardRotation: StandardViewId): void {\r\n this.onStandardRotationChangeEvent.emit({ standardRotation });\r\n }\r\n\r\n public static setViewMatrix(viewport: Viewport, animationTime?: number): void {\r\n // When handling onViewChanged, use setTimeout\r\n setTimeout(() => {\r\n // istanbul ignore next\r\n if (viewport.view) {\r\n this.origin.setFrom(viewport.view.getOrigin());\r\n this.extents.setFrom(viewport.view.getExtents());\r\n }\r\n this.rotationMatrix.setFrom(viewport.rotation);\r\n\r\n this.onViewRotationChangeEvent.emit({ viewport, animationTime });\r\n });\r\n }\r\n}\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/imodel-components-react",
|
|
3
|
-
"version": "4.1.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "iTwin.js UI IModel Components",
|
|
5
5
|
"main": "lib/cjs/imodel-components-react.js",
|
|
6
6
|
"module": "lib/esm/imodel-components-react.js",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"url": "http://www.bentley.com"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@itwin/appui-abstract": "
|
|
26
|
-
"@itwin/components-react": "^4.1.0
|
|
27
|
-
"@itwin/core-bentley": "
|
|
28
|
-
"@itwin/core-common": "
|
|
29
|
-
"@itwin/core-frontend": "
|
|
30
|
-
"@itwin/core-geometry": "
|
|
31
|
-
"@itwin/core-quantity": "
|
|
32
|
-
"@itwin/core-react": "^4.1.0
|
|
25
|
+
"@itwin/appui-abstract": "^3.7.0 || ^4.0.0",
|
|
26
|
+
"@itwin/components-react": "^4.1.0",
|
|
27
|
+
"@itwin/core-bentley": "^3.7.0 || ^4.0.0",
|
|
28
|
+
"@itwin/core-common": "^3.7.0 || ^4.0.0",
|
|
29
|
+
"@itwin/core-frontend": "^3.7.0 || ^4.0.0",
|
|
30
|
+
"@itwin/core-geometry": "^3.7.0 || ^4.0.0",
|
|
31
|
+
"@itwin/core-quantity": "^3.7.0 || ^4.0.0",
|
|
32
|
+
"@itwin/core-react": "^4.1.0",
|
|
33
33
|
"react": "^17.0.0 || ^18.0.0",
|
|
34
34
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
35
35
|
},
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@itwin/appui-abstract": "^3.7.0",
|
|
42
42
|
"@itwin/build-tools": "^3.7.0",
|
|
43
|
-
"@itwin/components-react": "4.1.0
|
|
43
|
+
"@itwin/components-react": "4.1.0",
|
|
44
44
|
"@itwin/core-bentley": "^3.7.0",
|
|
45
45
|
"@itwin/core-common": "^3.7.0",
|
|
46
46
|
"@itwin/core-frontend": "^3.7.0",
|
|
47
47
|
"@itwin/core-geometry": "^3.7.0",
|
|
48
48
|
"@itwin/core-orbitgt": "^3.7.0",
|
|
49
49
|
"@itwin/core-quantity": "^3.7.0",
|
|
50
|
-
"@itwin/core-react": "4.1.0
|
|
50
|
+
"@itwin/core-react": "4.1.0",
|
|
51
51
|
"@itwin/eslint-plugin": "^3.7.0",
|
|
52
52
|
"@itwin/webgl-compatibility": "^3.7.0",
|
|
53
53
|
"@testing-library/dom": "^8.11.2",
|
|
@@ -118,7 +118,11 @@
|
|
|
118
118
|
"extends": [
|
|
119
119
|
"plugin:@itwin/ui",
|
|
120
120
|
"plugin:@itwin/jsdoc"
|
|
121
|
-
]
|
|
121
|
+
],
|
|
122
|
+
"rules": {
|
|
123
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
124
|
+
"no-duplicate-imports": "off"
|
|
125
|
+
}
|
|
122
126
|
},
|
|
123
127
|
"scripts": {
|
|
124
128
|
"build": "npm run -s copy:locale && npm run -s build:cjs && npm run -s build:esm",
|
|
@@ -131,6 +135,7 @@
|
|
|
131
135
|
"clean": "rimraf lib .rush/temp/package-deps*.json",
|
|
132
136
|
"cover": "nyc npm -s test",
|
|
133
137
|
"lint": "eslint -f visualstudio \"./src/**/*.{ts,tsx}\" 1>&2",
|
|
138
|
+
"lint:fix": "npm run -s lint -- --fix",
|
|
134
139
|
"extract-api": "betools extract-api --entry=imodel-components-react",
|
|
135
140
|
"test": "mocha --config ../.mocharc.json \"./lib/cjs/test/**/*.test.js\"",
|
|
136
141
|
"test:watch": "npm -s test -- --reporter min --watch-extensions ts,tsx --watch",
|