@itwin/imodel-components-react 4.10.0-dev.1 → 4.11.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 +20 -1
- package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts +1 -1
- package/lib/cjs/imodel-components-react/UiIModelComponents.js +6 -6
- package/lib/cjs/imodel-components-react/UiIModelComponents.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts +2 -1
- package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/AlphaSlider.js +12 -8
- package/lib/cjs/imodel-components-react/color/AlphaSlider.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts +2 -0
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.js +5 -2
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts +2 -0
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts +2 -0
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js +5 -5
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/HueSlider.d.ts +2 -0
- package/lib/cjs/imodel-components-react/color/HueSlider.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/HueSlider.js +12 -9
- package/lib/cjs/imodel-components-react/color/HueSlider.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts +2 -0
- package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/SaturationPicker.js +12 -11
- package/lib/cjs/imodel-components-react/color/SaturationPicker.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/Swatch.d.ts +2 -0
- package/lib/cjs/imodel-components-react/color/Swatch.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/Swatch.js +2 -0
- package/lib/cjs/imodel-components-react/color/Swatch.js.map +1 -1
- package/lib/cjs/imodel-components-react/editors/ColorEditor.js +3 -2
- package/lib/cjs/imodel-components-react/editors/ColorEditor.js.map +1 -1
- 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.map +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.js +5 -4
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.js.map +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js +5 -5
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js +3 -3
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js +10 -5
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js +3 -3
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.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.js +5 -4
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js +7 -8
- package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.js +10 -10
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js +15 -14
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js +13 -9
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js +22 -29
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js.map +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 +18 -17
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +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 +7 -6
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +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 +14 -13
- package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +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 +7 -6
- package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js.map +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 +9 -8
- package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js.map +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 +23 -22
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +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 +7 -6
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +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 +15 -14
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +6 -6
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.js +2 -2
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/PlayButton.d.ts +12 -0
- package/lib/cjs/imodel-components-react/timeline/PlayButton.d.ts.map +1 -0
- package/lib/cjs/imodel-components-react/timeline/PlayButton.js +50 -0
- package/lib/cjs/imodel-components-react/timeline/PlayButton.js.map +1 -0
- package/lib/cjs/imodel-components-react/timeline/Scrubber.d.ts +0 -1
- package/lib/cjs/imodel-components-react/timeline/Scrubber.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/Scrubber.js +1 -1
- package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts +2 -20
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js +111 -202
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.scss +25 -333
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts +33 -67
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js +226 -330
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.scss +27 -140
- package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts +2 -2
- 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/useTranslation.d.ts +10 -0
- package/lib/cjs/imodel-components-react/useTranslation.d.ts.map +1 -0
- package/lib/cjs/imodel-components-react/useTranslation.js +20 -0
- package/lib/cjs/imodel-components-react/useTranslation.js.map +1 -0
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js +13 -8
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
- package/lib/cjs/imodel-components-react.d.ts +0 -1
- package/lib/cjs/imodel-components-react.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react.js +0 -1
- package/lib/cjs/imodel-components-react.js.map +1 -1
- package/lib/esm/imodel-components-react/UiIModelComponents.d.ts +1 -1
- package/lib/esm/imodel-components-react/UiIModelComponents.js +6 -6
- package/lib/esm/imodel-components-react/UiIModelComponents.js.map +1 -1
- package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts +2 -1
- package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/AlphaSlider.js +12 -8
- package/lib/esm/imodel-components-react/color/AlphaSlider.js.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts +2 -0
- package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerButton.js +5 -2
- package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts +2 -0
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.js +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts +2 -0
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.js +5 -5
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
- package/lib/esm/imodel-components-react/color/HueSlider.d.ts +2 -0
- package/lib/esm/imodel-components-react/color/HueSlider.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/HueSlider.js +12 -9
- package/lib/esm/imodel-components-react/color/HueSlider.js.map +1 -1
- package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts +2 -0
- package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/SaturationPicker.js +12 -11
- package/lib/esm/imodel-components-react/color/SaturationPicker.js.map +1 -1
- package/lib/esm/imodel-components-react/color/Swatch.d.ts +2 -0
- package/lib/esm/imodel-components-react/color/Swatch.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/Swatch.js +2 -0
- package/lib/esm/imodel-components-react/color/Swatch.js.map +1 -1
- package/lib/esm/imodel-components-react/editors/ColorEditor.js +3 -2
- package/lib/esm/imodel-components-react/editors/ColorEditor.js.map +1 -1
- 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.map +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityInput.js +5 -4
- package/lib/esm/imodel-components-react/inputs/QuantityInput.js.map +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js +5 -5
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js +3 -3
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js +10 -5
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js +3 -3
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.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.js +5 -4
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatSample.js +7 -8
- package/lib/esm/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatType.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatType.js +10 -10
- package/lib/esm/imodel-components-react/quantityformat/FormatType.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js +15 -14
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatUnits.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js +13 -9
- package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js +22 -29
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js.map +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 +18 -17
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +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 +7 -6
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +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 +14 -13
- package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +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 +7 -6
- package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js.map +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 +9 -8
- package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js.map +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 +23 -22
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +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 +7 -6
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +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 +15 -14
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +6 -6
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/InlineEdit.js +2 -2
- package/lib/esm/imodel-components-react/timeline/InlineEdit.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/PlayButton.d.ts +12 -0
- package/lib/esm/imodel-components-react/timeline/PlayButton.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/timeline/PlayButton.js +23 -0
- package/lib/esm/imodel-components-react/timeline/PlayButton.js.map +1 -0
- package/lib/esm/imodel-components-react/timeline/Scrubber.d.ts +0 -1
- package/lib/esm/imodel-components-react/timeline/Scrubber.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/Scrubber.js +1 -1
- package/lib/esm/imodel-components-react/timeline/Scrubber.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts +2 -20
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.js +112 -203
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.scss +25 -333
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts +33 -67
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.js +228 -329
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.scss +27 -140
- package/lib/esm/imodel-components-react/timeline/interfaces.d.ts +2 -2
- 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/useTranslation.d.ts +10 -0
- package/lib/esm/imodel-components-react/useTranslation.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/useTranslation.js +16 -0
- package/lib/esm/imodel-components-react/useTranslation.js.map +1 -0
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.js +13 -8
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
- package/lib/esm/imodel-components-react.d.ts +0 -1
- package/lib/esm/imodel-components-react.d.ts.map +1 -1
- package/lib/esm/imodel-components-react.js +0 -1
- package/lib/esm/imodel-components-react.js.map +1 -1
- package/lib/public/locales/en/UiIModelComponents.json +14 -3
- package/package.json +20 -20
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts +0 -34
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts.map +0 -1
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.js +0 -100
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.js.map +0 -1
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.scss +0 -28
- package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts +0 -34
- package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts.map +0 -1
- package/lib/esm/imodel-components-react/timeline/PlayerButton.js +0 -69
- package/lib/esm/imodel-components-react/timeline/PlayerButton.js.map +0 -1
- package/lib/esm/imodel-components-react/timeline/PlayerButton.scss +0 -28
|
@@ -1 +1 @@
|
|
|
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,EACL,YAAY,EACZ,YAAY,EACZ,YAAY,GACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,eAAe,EACf,eAAe,GAChB,MAAM,4BAA4B,CAAC;AACpC,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,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,E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C,qBAAqB,IAAE,cAAc,CAAQ,CAC9D,CACG;gBACN,oBAAC,QAAQ,IACP,SAAS,EAAC,QAAQ,EAClB,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,EAC3C,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,UAAU,EAAE,CAAC,CAAC,SAAS,EACvB,QAAQ,EAAE,CAAC,YAAY,EACvB,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAChC,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAChC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EACzC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GAC7B;gBACF,6BAAK,SAAS,EAAC,oBAAoB;oBAChC,QAAQ,IAAI,CACX,8BAAM,SAAS,EAAC,UAAU,IACvB,YAAY,CAAC,OAAO,EAAE,cAAc,CAAC,CACjC,CACR;oBACA,QAAQ,IAAI,CAAC,YAAY,IAAI,CAC5B,8BAAM,SAAS,EAAC,UAAU,IACvB,YAAY,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,CAAC,CACpD,CACR;oBACA,YAAY,IAAI,CACf,oBAAC,UAAU,IACT,SAAS,EAAC,mBAAmB,EAC7B,YAAY,EAAE,mBAAmB,EACjC,QAAQ,EAAE,IAAI,CAAC,sBAAsB,GACrC,CACH,CACG;gBACL,SAAS,IAAI,IAAI,CAAC,eAAe,EAAE,CAChC,CACF,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Timeline\n */\nimport type { GenericUiEventArgs } from \"@itwin/appui-abstract\";\nimport { UiAdmin } from \"@itwin/appui-abstract\";\nimport type { DateFormatOptions } from \"@itwin/components-react\";\nimport {\n toDateString,\n toTimeString,\n UiComponents,\n} from \"@itwin/components-react\";\nimport { Icon } from \"@itwin/core-react\";\nimport {\n SvgCaretLeft,\n SvgCaretRight,\n SvgCheckmark,\n SvgMoreVertical,\n SvgPlayCircular,\n} from \"@itwin/itwinui-icons-react\";\nimport { DropdownMenu, MenuDivider, MenuItem } from \"@itwin/itwinui-react\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\n\nimport { UiIModelComponents } from \"../UiIModelComponents\";\nimport { InlineEdit } from \"./InlineEdit\";\nimport type { PlaybackSettings, TimelinePausePlayArgs } from \"./interfaces\";\nimport { TimelinePausePlayAction } from \"./interfaces\";\nimport { PlayButton, PlayerButton } from \"./PlayerButton\";\nimport { Scrubber } from \"./Scrubber\";\n\nimport \"./TimelineComponent.scss\";\n\n// cspell:ignore millisec\n\nconst slowSpeed = 60 * 1000;\nconst mediumSpeed = 20 * 1000;\nconst fastSpeed = 10 * 1000;\n/**\n * [[TimelineMenuItemOption]]: specifies how the app wants the timeline speeds to be installed on the TimelineComponent's ContextMenu\n * \"replace\" : use the app-supplied items in place of the standard items\n * \"append\" : add the app-supplied items following the standard items\n * \"prefix\" : add the app-supplied items before the standard items\n *\n * @public\n */\nexport type TimelineMenuItemOption = \"replace\" | \"append\" | \"prefix\";\n/**\n * [[TimelineMenuItemProps]] specifies playback speed entries in the Timeline's ContextMenu\n * @public\n */\nexport interface TimelineMenuItemProps {\n /** localized label for menu item */\n label: string;\n\n /** duration for the entire timeline to play */\n timelineDuration: number;\n}\n/** TimelineDateMarkerProps: Mark a date on the timeline with an indicator\n * @public\n */\nexport interface TimelineDateMarkerProps {\n /** Date to mark. If undefined, today's date will be used. */\n date?: Date;\n /** ReactNode to use as the marker on the timeline. If undefined, a short vertical bar will mark the date. */\n dateMarker?: React.ReactNode;\n}\n/**\n * [[TimelineComponentProps]] configure the timeline\n * @public\n */\nexport interface TimelineComponentProps {\n /** Start date: beginning of the date range of a date-based timeline. */\n startDate?: Date;\n /** End date: end of the date range of a date-based timeline. */\n endDate?: Date;\n /** Total duration: range of the timeline in milliseconds. */\n totalDuration: number;\n /** Initial value for the current duration (the location of the thumb) in milliseconds */\n initialDuration?: number;\n /** Show in minimized mode (For future use. This prop will always be treated as true.) */\n minimized?: boolean;\n /** When playing, repeat indefinitely */\n repeat?: boolean;\n /** Show duration instead of time */\n showDuration?: boolean;\n /** Callback with current duration value (as a fraction) */\n onChange?: (duration: number) => void;\n /** Callback triggered when play/pause button is pressed */\n onPlayPause?: (playing: boolean) => void;\n /** Callback triggered when backward/forward buttons are pressed */\n onJump?: (forward: boolean) => void;\n /** Callback triggered when a setting is changed */\n onSettingsChange?: (arg: PlaybackSettings) => void;\n /** Always display in miniMode with no expand menu (For future use. This prop will always be treated as true) */\n alwaysMinimized?: boolean;\n /** ComponentId -- must be set to use TimelineComponentEvents */\n componentId?: string;\n /** Include the repeat option on the Timeline Context Menu */\n includeRepeat?: boolean;\n /** App-supplied speed entries in the Timeline Context Menu */\n appMenuItems?: TimelineMenuItemProps[];\n /** How to include the supplied app menu items in the Timeline Context Menu (prefix, append, replace)*/\n appMenuItemOption?: TimelineMenuItemOption;\n /** Display date and time offset by the number of minutes specified. When undefined - local timezone will be used */\n timeZoneOffset?: number;\n /** Display a marker on the timeline rail to indicate current date - will only work if starDate and endDate are defined */\n markDate?: TimelineDateMarkerProps;\n /** Options used to format date string. If not defined it will user browser default locale settings. */\n dateFormatOptions?: DateFormatOptions;\n /** Options used to format time string. If not defined it will user browser default locale settings. */\n timeFormatOptions?: DateFormatOptions;\n}\n/** @internal */\ninterface TimelineComponentState {\n /** True if timeline is currently playing, false if paused */\n isPlaying: boolean;\n /** Minimized mode (For future use. This will always be true) */\n minimized?: boolean;\n /** Current duration in milliseconds */\n currentDuration: number;\n /** Total duration in milliseconds */\n totalDuration: number;\n /** If true, automatically restart when the timeline is finished playing */\n repeat: boolean;\n /** If true, include the repeat option in the timeline context menu */\n includeRepeat: boolean;\n}\n\n/**\n * [[TimelineComponent]] is used to playback timeline data\n * @public\n */\nexport class TimelineComponent extends React.Component<\n TimelineComponentProps,\n TimelineComponentState\n> {\n private _timeLastCycle = 0;\n private _requestFrame = 0;\n private _unmounted = false;\n private _repeatLabel: string;\n private _removeListener?: () => void;\n private _standardTimelineMenuItems: TimelineMenuItemProps[] = [\n {\n label: UiIModelComponents.translate(\"timeline.slow\"),\n timelineDuration: slowSpeed,\n },\n {\n label: UiIModelComponents.translate(\"timeline.medium\"),\n timelineDuration: mediumSpeed,\n },\n {\n label: UiIModelComponents.translate(\"timeline.fast\"),\n timelineDuration: fastSpeed,\n },\n ];\n\n constructor(props: TimelineComponentProps) {\n super(props);\n\n this.state = {\n isPlaying: false,\n minimized: true,\n currentDuration: props.initialDuration\n ? props.initialDuration\n : /* istanbul ignore next */ 0,\n totalDuration: this.props.totalDuration,\n repeat: this.props.repeat ? true : false,\n includeRepeat:\n this.props.includeRepeat || this.props.includeRepeat === undefined\n ? true\n : false,\n };\n\n this._repeatLabel = UiIModelComponents.translate(\"timeline.repeat\");\n // istanbul ignore else\n if (this.props.componentId) {\n // can't handle an event if we have no id\n this._removeListener = UiAdmin.onGenericUiEvent.addListener(\n this._handleTimelinePausePlayEvent\n );\n }\n }\n\n public override componentWillUnmount() {\n if (this._removeListener) this._removeListener();\n window.cancelAnimationFrame(this._requestFrame);\n this._unmounted = true;\n }\n\n public override shouldComponentUpdate(\n nextProps: TimelineComponentProps,\n nextState: TimelineComponentState\n ) {\n let result = false;\n\n // istanbul ignore next\n if (\n nextState !== this.state ||\n nextProps !== this.props ||\n nextProps.startDate !== this.props.startDate ||\n nextProps.endDate !== this.props.endDate ||\n nextProps.initialDuration !== this.props.initialDuration ||\n nextProps.repeat !== this.props.repeat\n )\n result = true;\n\n return result;\n }\n\n public override componentDidUpdate(prevProps: TimelineComponentProps) {\n // istanbul ignore else\n if (this.props.initialDuration !== prevProps.initialDuration) {\n this._setDuration(\n this.props.initialDuration\n ? this.props.initialDuration\n : /* istanbul ignore next */ 0,\n this.props.totalDuration !== prevProps.totalDuration\n ? this.props.totalDuration\n : undefined\n );\n }\n\n // istanbul ignore else\n if (this.props.repeat !== prevProps.repeat) {\n this._changeRepeatSetting(this.props.repeat);\n }\n\n // istanbul ignore else\n if (this.props.totalDuration !== prevProps.totalDuration) {\n this._onSetTotalDuration(this.props.totalDuration);\n }\n }\n private _handleTimelinePausePlayEvent = (args: GenericUiEventArgs): void => {\n const timelineArgs = args as TimelinePausePlayArgs;\n // istanbul ignore else\n if (\n !timelineArgs ||\n this.props.componentId !== timelineArgs.uiComponentId ||\n timelineArgs.timelineAction === undefined\n )\n return;\n\n let startPlaying: boolean;\n switch (timelineArgs.timelineAction) {\n case TimelinePausePlayAction.Play:\n startPlaying = true;\n break;\n case TimelinePausePlayAction.Pause:\n startPlaying = false;\n break;\n case TimelinePausePlayAction.Toggle:\n startPlaying = !this.state.isPlaying;\n break;\n // istanbul ignore next\n default:\n return; // throw error?\n }\n if (startPlaying) this._onPlay();\n else this._onPause();\n };\n\n // user clicked backward button\n private _onBackward = () => {\n // istanbul ignore else\n if (this.props.onJump) this.props.onJump(false);\n };\n\n // user clicked forward button\n private _onForward = () => {\n // istanbul ignore else\n if (this.props.onJump) this.props.onJump(true);\n };\n\n // user clicked play button\n private _onPlay = () => {\n // istanbul ignore if\n if (this.state.isPlaying) return;\n\n // timeline was complete, restart from the beginning\n if (this.state.currentDuration >= this.state.totalDuration) {\n this._replay();\n } else this._play();\n\n // istanbul ignore else\n if (this.props.onPlayPause) this.props.onPlayPause(true);\n };\n\n // user clicked pause button\n private _onPause = () => {\n // istanbul ignore if\n if (!this.state.isPlaying) return;\n\n // stop requesting frames\n window.cancelAnimationFrame(this._requestFrame);\n\n // stop playing\n this.setState({ isPlaying: false });\n\n // istanbul ignore else\n if (this.props.onPlayPause) this.props.onPlayPause(false);\n };\n\n // user clicked on timeline rail or dragged scrubber handle\n private _onTimelineChange = (values: ReadonlyArray<number>) => {\n const currentDuration = values[0];\n this._setDuration(currentDuration);\n };\n\n // set the current duration, which will call the OnChange callback\n private _setDuration = (currentDuration: number, updatedTotal?: number) => {\n const actualDuration = Math.min(\n updatedTotal ?? this.state.totalDuration,\n Math.max(currentDuration, 0)\n );\n\n this._timeLastCycle = new Date().getTime();\n // istanbul ignore else\n if (!this._unmounted) this.setState({ currentDuration: actualDuration });\n // istanbul ignore else\n if (this.props.onChange) {\n const fraction =\n actualDuration / (updatedTotal ?? this.state.totalDuration);\n this.props.onChange(fraction);\n }\n };\n\n // recursively update the animation until we hit the end or the pause button is clicked\n private _updateAnimation = (_timestamp: number) => {\n // istanbul ignore else\n if (!this.state.isPlaying && !this._unmounted) {\n return;\n }\n\n // update duration\n const currentTime = new Date().getTime();\n const millisecondsElapsed = currentTime - this._timeLastCycle;\n const duration = this.state.currentDuration + millisecondsElapsed;\n this._setDuration(duration);\n\n // stop the animation!\n if (duration >= this.state.totalDuration) {\n window.cancelAnimationFrame(this._requestFrame);\n this.setState({ isPlaying: false });\n if (this.state.repeat) this._replay();\n else {\n // istanbul ignore else\n if (this.props.onPlayPause) this.props.onPlayPause(false);\n }\n\n return;\n }\n\n // continue the animation - request the next frame\n this._requestFrame = window.requestAnimationFrame(this._updateAnimation);\n };\n\n private _play() {\n // start playing\n this.setState({ isPlaying: true }, () => {\n // request the next frame\n this._timeLastCycle = new Date().getTime();\n this._requestFrame = window.requestAnimationFrame(this._updateAnimation);\n });\n }\n\n private _replay = () => {\n // timeline was complete, restart from the beginning\n this.setState({ currentDuration: 0 }, () => this._play());\n };\n\n private _displayTime(millisec: number) {\n const addZero = (i: number) => {\n return i < 10 ? `0${i}` : i;\n };\n\n const date = new Date(millisec);\n // const hours = date.getUTCHours();\n const minutes = date.getUTCMinutes();\n const seconds = date.getUTCSeconds();\n return `${addZero(minutes)}:${addZero(seconds)}`;\n }\n\n private _getMilliseconds(time: string) {\n // istanbul ignore else - WIP\n if (time.indexOf(\":\") !== -1) {\n return (\n (Number(time.split(\":\")[0]) * 60 + Number(time.split(\":\")[1])) * 1000\n );\n } else {\n return Number(time) * 1000;\n }\n }\n\n // user changed the total duration\n private _onTotalDurationChange = (value: string) => {\n // NOTE: we should reset the current duration to 0\n const milliseconds = this._getMilliseconds(value);\n this._onSetTotalDuration(milliseconds);\n };\n\n private _changeRepeatSetting = (newValue?: boolean) => {\n // istanbul ignore else\n if (newValue !== undefined) {\n this.setState(\n () => ({ repeat: newValue }),\n () => {\n // istanbul ignore else\n if (this.props.onSettingsChange) {\n this.props.onSettingsChange({ loop: this.state.repeat });\n }\n }\n );\n }\n };\n\n private _onRepeatChanged = () => {\n this.setState(\n (prevState) => ({ repeat: !prevState.repeat }),\n () => {\n // istanbul ignore else\n if (this.props.onSettingsChange) {\n this.props.onSettingsChange({ loop: this.state.repeat });\n }\n }\n );\n };\n\n private _currentDate = (): Date => {\n const fraction = this.state.currentDuration / this.state.totalDuration;\n if (this.props.endDate && this.props.startDate) {\n const timeElapsed =\n (this.props.endDate.getTime() - this.props.startDate.getTime()) *\n fraction;\n return new Date(this.props.startDate.getTime() + timeElapsed);\n }\n return new Date();\n };\n\n private _onSetTotalDuration = (milliseconds: number) => {\n this.setState({ totalDuration: milliseconds }, () => {\n // istanbul ignore else\n if (this.props.onSettingsChange) {\n this.props.onSettingsChange({ duration: milliseconds });\n }\n });\n };\n\n private _createMenuItemNode(\n item: TimelineMenuItemProps,\n index: number,\n currentTimelineDuration: number,\n close: () => void\n ): React.ReactElement {\n const label = item.label;\n const checked = currentTimelineDuration === item.timelineDuration;\n const icon = checked ? (\n <span className=\"icon\">\n <Icon iconSpec={<SvgCheckmark />} />{\" \"}\n </span>\n ) : (\n <span />\n );\n return (\n <MenuItem\n key={index}\n startIcon={icon}\n onClick={() => {\n this._onSetTotalDuration(item.timelineDuration);\n close();\n }}\n >\n {label}\n </MenuItem>\n );\n }\n\n private _renderSettings = () => {\n const createMenuItemNodes = (close: () => void): React.ReactElement[] => {\n const { totalDuration } = this.state;\n let contextMenuItems: Array<TimelineMenuItemProps> = [];\n\n if (!this.props.appMenuItems) {\n contextMenuItems = this._standardTimelineMenuItems;\n } else {\n if (this.props.appMenuItemOption === \"append\") {\n contextMenuItems = this._standardTimelineMenuItems.concat(\n this.props.appMenuItems\n );\n } else if (this.props.appMenuItemOption === \"prefix\") {\n contextMenuItems = this.props.appMenuItems.concat(\n this._standardTimelineMenuItems\n );\n } else {\n contextMenuItems = this.props.appMenuItems;\n }\n }\n\n const itemNodes: React.ReactElement[] = [];\n let keyIndex = 0;\n if (this.state.includeRepeat) {\n const checked = this.state.repeat;\n const icon = checked ? (\n <span className=\"icon\">\n <Icon iconSpec={<SvgCheckmark />} />{\" \"}\n </span>\n ) : (\n <span />\n );\n itemNodes.push(\n <MenuItem\n key={++keyIndex}\n onClick={() => {\n this._onRepeatChanged();\n close();\n }}\n startIcon={icon}\n >\n {this._repeatLabel}\n </MenuItem>\n );\n itemNodes.push(<MenuDivider key={++keyIndex} />);\n }\n\n contextMenuItems.forEach((item: TimelineMenuItemProps, index: number) => {\n itemNodes.push(\n this._createMenuItemNode(\n item,\n index + keyIndex + 1,\n totalDuration,\n close\n )\n );\n });\n\n return itemNodes;\n };\n\n return (\n <DropdownMenu menuItems={createMenuItemNodes} placement=\"top-start\">\n <span\n data-testid=\"timeline-settings\"\n className=\"timeline-settings icon\"\n role=\"button\"\n tabIndex={-1}\n title={UiComponents.translate(\"button.label.settings\")}\n >\n <Icon iconSpec={<SvgMoreVertical />} />\n </span>\n </DropdownMenu>\n );\n };\n\n public override render() {\n const {\n startDate,\n endDate,\n showDuration,\n timeZoneOffset,\n dateFormatOptions,\n timeFormatOptions,\n } = this.props;\n const { currentDuration, totalDuration, minimized } = this.state;\n const currentDate = this._currentDate();\n const durationString = this._displayTime(currentDuration);\n const totalDurationString = this._displayTime(totalDuration);\n const hasDates = !!startDate && !!endDate;\n\n return (\n <div\n data-testid=\"timeline-component\"\n className={classnames(\n \"timeline-component\",\n !!minimized && \"minimized\",\n hasDates && \"has-dates\"\n )}\n >\n <div className=\"header\">\n <PlayButton\n className=\"play-button\"\n isPlaying={this.state.isPlaying}\n onPlay={this._onPlay}\n onPause={this._onPause}\n data-testid=\"timeline-play\"\n />\n <PlayerButton\n className=\"play-backward\"\n icon={<SvgCaretLeft />}\n onClick={this._onBackward}\n title={UiIModelComponents.translate(\"timeline.backward\")}\n />\n <PlayerButton\n className=\"play-button-step\"\n icon={<SvgPlayCircular />}\n isPlaying={this.state.isPlaying}\n onPlay={this._onPlay}\n onPause={this._onPause}\n title={UiIModelComponents.translate(\"timeline.step\")}\n />\n <PlayerButton\n className=\"play-forward\"\n icon={<SvgCaretRight />}\n onClick={this._onForward}\n title={UiIModelComponents.translate(\"timeline.backward\")}\n />\n <span className=\"current-date\">\n {toDateString(currentDate, timeZoneOffset, dateFormatOptions)}\n </span>\n </div>\n <div className=\"scrubber\">\n <PlayButton\n className=\"play-button\"\n isPlaying={this.state.isPlaying}\n onPlay={this._onPlay}\n onPause={this._onPause}\n />\n <div className=\"start-time-container\">\n {hasDates && (\n <span data-testid=\"test-start-date\" className=\"start-date\">\n {toDateString(startDate, timeZoneOffset, dateFormatOptions)}\n </span>\n )}\n {hasDates && !showDuration && (\n <span data-testid=\"test-start-time\" className=\"start-time\">\n {toTimeString(startDate, timeZoneOffset, timeFormatOptions)}\n </span>\n )}\n {showDuration && (\n <span className=\"duration-start-time\">{durationString}</span>\n )}\n </div>\n <Scrubber\n className=\"slider\"\n currentDuration={this.state.currentDuration}\n totalDuration={totalDuration}\n startDate={startDate}\n endDate={endDate}\n isPlaying={this.state.isPlaying}\n inMiniMode={!!minimized}\n showTime={!showDuration}\n onChange={this._onTimelineChange}\n onUpdate={this._onTimelineChange}\n timeZoneOffset={this.props.timeZoneOffset}\n markDate={this.props.markDate}\n />\n <div className=\"end-time-container\">\n {hasDates && (\n <span className=\"end-date\">\n {toDateString(endDate, timeZoneOffset)}\n </span>\n )}\n {hasDates && !showDuration && (\n <span className=\"end-time\">\n {toTimeString(endDate, timeZoneOffset, timeFormatOptions)}\n </span>\n )}\n {showDuration && (\n <InlineEdit\n className=\"duration-end-time\"\n defaultValue={totalDurationString}\n onChange={this._onTotalDurationChange}\n />\n )}\n </div>\n {minimized && this._renderSettings()}\n </div>\n </div>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TimelineComponent.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/TimelineComponent.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EACL,YAAY,EACZ,UAAU,EACV,WAAW,EACX,QAAQ,GACT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,SAAS,GAAG,EAAE,GAAG,IAAI,CAAC;AAC5B,MAAM,WAAW,GAAG,EAAE,GAAG,IAAI,CAAC;AAC9B,MAAM,SAAS,GAAG,EAAE,GAAG,IAAI,CAAC;AA4F5B;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA6B;;IAC7D,MAAM,EACJ,iBAAiB,GAAG,SAAS,EAC7B,SAAS,EACT,OAAO,EACP,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,iBAAiB,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,KAAK,CAAC,CAAC,EAAE;QAC5B,OAAO,CACL,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CACtE,CAAC;KACH;SAAM;QACL,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;KAC5B;AACH,CAAC;AAED,SAAS,aAAa,CAAC,EAAU;IAC/B,MAAM,OAAO,GAAG,CAAC,CAAS,EAAE,EAAE;QAC5B,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC,CAAC;IAEF,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1B,oCAAoC;IACpC,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;IACrC,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;IACrC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;AACnD,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Timeline\n */\nimport \"./TimelineComponent.scss\";\nimport * as React from \"react\";\nimport { UiAdmin } from \"@itwin/appui-abstract\";\nimport type { DateFormatOptions } from \"@itwin/components-react\";\nimport { toDateString, toTimeString } from \"@itwin/components-react\";\nimport { SvgCheckmark, SvgMoreVertical } from \"@itwin/itwinui-icons-react\";\nimport {\n DropdownMenu,\n IconButton,\n MenuDivider,\n MenuItem,\n} from \"@itwin/itwinui-react\";\nimport { InlineEdit } from \"./InlineEdit\";\nimport type { PlaybackSettings, TimelinePausePlayArgs } from \"./interfaces\";\nimport { TimelinePausePlayAction } from \"./interfaces\";\nimport { PlayButton } from \"./PlayButton\";\nimport { Scrubber } from \"./Scrubber\";\nimport { useTranslation } from \"../useTranslation\";\n\nconst slowSpeed = 60 * 1000;\nconst mediumSpeed = 20 * 1000;\nconst fastSpeed = 10 * 1000;\n\n/** [[TimelineMenuItemOption]]: specifies how the app wants the timeline speeds to be installed on the TimelineComponent's ContextMenu\n * \"replace\" : use the app-supplied items in place of the standard items\n * \"append\" : add the app-supplied items following the standard items\n * \"prefix\" : add the app-supplied items before the standard items\n *\n * @public\n */\nexport type TimelineMenuItemOption = \"replace\" | \"append\" | \"prefix\";\n\n/** [[TimelineMenuItemProps]] specifies playback speed entries in the Timeline's ContextMenu\n * @public\n */\nexport interface TimelineMenuItemProps {\n /** localized label for menu item */\n label: string;\n\n /** duration for the entire timeline to play */\n timelineDuration: number;\n}\n\n/** TimelineDateMarkerProps: Mark a date on the timeline with an indicator\n * @public\n */\nexport interface TimelineDateMarkerProps {\n /** Date to mark. If undefined, today's date will be used. */\n date?: Date;\n /** ReactNode to use as the marker on the timeline. If undefined, a short vertical bar will mark the date. */\n dateMarker?: React.ReactNode;\n}\n\n/** [[TimelineComponentProps]] configure the timeline\n * @public\n */\nexport interface TimelineComponentProps {\n /** Start date: beginning of the date range of a date-based timeline. */\n startDate?: Date;\n /** End date: end of the date range of a date-based timeline. */\n endDate?: Date;\n /** Total duration: range of the timeline in milliseconds.\n * @note This can be changed by user interaction. See {@link TimelineComponentProps.appMenuItems}.\n */\n totalDuration: number;\n /** Initial value for the current duration (the location of the thumb) in milliseconds */\n initialDuration?: number;\n /** Show in minimized mode (For future use. This prop will always be treated as true.)\n * @deprecated in 4.10.x. Has no effect.\n */\n minimized?: boolean;\n /** When playing, repeat indefinitely. Defaults to `false`.\n * @note This can be changed by user interaction. See {@link TimelineComponentProps.includeRepeat}.\n */\n repeat?: boolean;\n /** Show duration instead of time */\n showDuration?: boolean;\n /** Callback with current duration value (as a fraction) */\n onChange?: (duration: number) => void;\n /** Callback triggered when play/pause button is pressed */\n onPlayPause?: (playing: boolean) => void;\n /** Callback triggered when backward/forward buttons are pressed.\n * @deprecated in 4.10.x. Has no effect.\n */\n onJump?: (forward: boolean) => void;\n /** Callback triggered when a setting is changed */\n onSettingsChange?: (arg: PlaybackSettings) => void;\n /** Always display in miniMode with no expand menu (For future use. This prop will always be treated as true)\n * @deprecated in 4.10.x. Has no effect.\n */\n alwaysMinimized?: boolean;\n /** ComponentId -- must be set to use TimelineComponentEvents\n * @deprecated in 4.11.x. Use the isPlaying prop instead.\n */\n componentId?: string;\n /** Include the repeat option on the Timeline Context Menu. Defaults to `true`. */\n includeRepeat?: boolean;\n /** App-supplied speed entries in the Timeline Context Menu. Defaults to `[Slow, Medium, Fast]` items. */\n appMenuItems?: TimelineMenuItemProps[];\n /** How to include the supplied app menu items in the Timeline Context Menu (prefix, append or replace). Defaults to `replace`. */\n appMenuItemOption?: TimelineMenuItemOption;\n /** Display date and time offset by the number of minutes specified. When undefined - local timezone will be used */\n timeZoneOffset?: number;\n /** Display a marker on the timeline rail to indicate current date - will only work if starDate and endDate are defined */\n markDate?: TimelineDateMarkerProps;\n /** Options used to format date string. If not defined it will user browser default locale settings. */\n dateFormatOptions?: DateFormatOptions;\n /** Options used to format time string. If not defined it will user browser default locale settings. */\n timeFormatOptions?: DateFormatOptions;\n /** Used to control the play/pause state of the Timeline.*/\n isPlaying?: boolean;\n}\n\n/** [[TimelineComponent]] is used to playback timeline data\n * @public\n */\nexport function TimelineComponent(props: TimelineComponentProps) {\n const {\n appMenuItemOption = \"replace\",\n startDate,\n endDate,\n showDuration,\n timeZoneOffset,\n dateFormatOptions,\n timeFormatOptions,\n includeRepeat = true,\n onSettingsChange,\n onChange,\n onPlayPause,\n } = props;\n const [isPlaying, setIsPlaying] = React.useState(!!props.isPlaying);\n const [currentDuration, setCurrentDuration] = React.useState(\n props.initialDuration ?? 0\n );\n const [totalDuration, setTotalDuration] = React.useState(props.totalDuration);\n const [repeat, setRepeat] = React.useState(props.repeat ?? false);\n\n const playOrReplay = React.useCallback(() => {\n if (isPlaying) return;\n\n if (currentDuration >= totalDuration) {\n setCurrentDuration(0);\n }\n\n setIsPlaying(true);\n onPlayPause?.(true);\n }, [isPlaying, onPlayPause, currentDuration, totalDuration]);\n const pause = React.useCallback(() => {\n if (!isPlaying) return;\n setIsPlaying(false);\n onPlayPause?.(false);\n }, [isPlaying, onPlayPause]);\n const updateTotalDuration = (newTotalDuration: number) => {\n if (newTotalDuration === totalDuration) return;\n\n const fraction = currentDuration / totalDuration;\n const newCurrentDuration = fraction * newTotalDuration;\n\n setTotalDuration(newTotalDuration);\n setCurrentDuration(newCurrentDuration);\n onSettingsChange?.({ duration: newTotalDuration });\n };\n const updateDuration = (\n newDuration: number,\n currentTotalDuration = totalDuration\n ) => {\n newDuration = Math.max(newDuration, 0);\n newDuration = Math.min(newDuration, currentTotalDuration);\n\n if (newDuration === currentDuration) return;\n setCurrentDuration(newDuration);\n\n const fraction = newDuration / currentTotalDuration;\n onChange?.(fraction);\n };\n const updateRepeat = (newRepeat: boolean) => {\n if (newRepeat === repeat) return;\n\n setRepeat(newRepeat);\n onSettingsChange?.({ loop: newRepeat });\n };\n\n const [prevTotalDuration, setPrevTotalDuration] = React.useState(\n props.totalDuration\n );\n if (prevTotalDuration !== props.totalDuration) {\n setPrevTotalDuration(props.totalDuration);\n updateTotalDuration(props.totalDuration);\n }\n\n const [prevInitialDuration, setPrevInitialDuration] = React.useState(\n props.initialDuration\n );\n if (prevInitialDuration !== props.initialDuration) {\n setPrevInitialDuration(props.initialDuration);\n updateDuration(props.initialDuration ?? 0, props.totalDuration);\n }\n\n const [prevRepeat, setPrevRepeat] = React.useState(props.repeat);\n if (prevRepeat !== props.repeat) {\n setPrevRepeat(props.repeat);\n updateRepeat(props.repeat ?? repeat);\n }\n\n React.useEffect(() => {\n // eslint-disable-next-line deprecation/deprecation\n if (!props.componentId) return;\n return UiAdmin.onGenericUiEvent.addListener((args) => {\n const timelineArgs = args as TimelinePausePlayArgs;\n if (\n !timelineArgs ||\n // eslint-disable-next-line deprecation/deprecation\n props.componentId !== timelineArgs.uiComponentId ||\n timelineArgs.timelineAction === undefined\n )\n return;\n\n switch (timelineArgs.timelineAction) {\n case TimelinePausePlayAction.Play:\n playOrReplay();\n break;\n case TimelinePausePlayAction.Pause:\n pause();\n break;\n case TimelinePausePlayAction.Toggle:\n if (isPlaying) {\n pause();\n } else {\n playOrReplay();\n }\n break;\n }\n });\n // eslint-disable-next-line deprecation/deprecation\n }, [isPlaying, pause, playOrReplay, props.componentId]);\n useAnimation(({ delta }) => {\n const duration = currentDuration + delta;\n updateDuration(duration);\n\n if (duration >= totalDuration) {\n if (repeat) {\n setCurrentDuration(0);\n return;\n }\n\n pause();\n }\n }, isPlaying);\n\n React.useEffect(() => {\n if (props.isPlaying) playOrReplay();\n\n if (props.isPlaying === false) pause();\n }, [props.isPlaying, playOrReplay, pause]);\n\n const onTimelineChange = (values: ReadonlyArray<number>) => {\n const newDuration = values[0];\n updateDuration(newDuration);\n };\n\n const currentDurationStr = toDisplayTime(currentDuration);\n const totalDurationStr = toDisplayTime(totalDuration);\n const hasDates = !!startDate && !!endDate;\n return (\n <div data-testid=\"timeline-component\" className=\"timeline-component\">\n <PlayButton isPlaying={isPlaying} onPlay={playOrReplay} onPause={pause} />\n <div className=\"time-container\">\n {hasDates && (\n <span data-testid=\"test-start-date\" className=\"timeline-date\">\n {toDateString(startDate, timeZoneOffset, dateFormatOptions)}\n </span>\n )}\n {hasDates && !showDuration && (\n <span data-testid=\"test-start-time\" className=\"timeline-time\">\n {toTimeString(startDate, timeZoneOffset, timeFormatOptions)}\n </span>\n )}\n {showDuration && (\n <span className=\"timeline-duration-time\">{currentDurationStr}</span>\n )}\n </div>\n <Scrubber\n className=\"slider\"\n currentDuration={currentDuration}\n totalDuration={totalDuration}\n startDate={startDate}\n endDate={endDate}\n isPlaying={isPlaying}\n showTime={!showDuration}\n onChange={onTimelineChange}\n onUpdate={onTimelineChange}\n timeZoneOffset={props.timeZoneOffset}\n markDate={props.markDate}\n />\n <div className=\"time-container\">\n {hasDates && (\n <span data-testid=\"test-end-date\" className=\"timeline-date\">\n {toDateString(endDate, timeZoneOffset)}\n </span>\n )}\n {hasDates && !showDuration && (\n <span className=\"timeline-time\">\n {toTimeString(endDate, timeZoneOffset, timeFormatOptions)}\n </span>\n )}\n {showDuration && (\n <InlineEdit\n className=\"timeline-duration-time\"\n defaultValue={totalDurationStr}\n onChange={(value) => {\n const newTotalDuration = timeToMs(value);\n updateTotalDuration(newTotalDuration);\n }}\n />\n )}\n </div>\n <SettingsMenu\n appMenuItems={props.appMenuItems}\n appMenuItemOption={appMenuItemOption}\n includeRepeat={includeRepeat}\n repeat={repeat}\n totalDuration={totalDuration}\n onRepeatClick={() => {\n updateRepeat(!repeat);\n }}\n onTotalDurationChange={(newTotalDuration) => {\n updateTotalDuration(newTotalDuration);\n }}\n />\n </div>\n );\n}\n\ntype SettingsMenuProps = Pick<\n TimelineComponentProps,\n \"appMenuItems\" | \"totalDuration\"\n> &\n Pick<\n Required<TimelineComponentProps>,\n \"appMenuItemOption\" | \"includeRepeat\" | \"repeat\"\n > & {\n onRepeatClick: () => void;\n onTotalDurationChange: (totalDuration: number) => void;\n };\n\nfunction SettingsMenu({\n appMenuItems,\n appMenuItemOption,\n includeRepeat,\n repeat,\n totalDuration,\n onRepeatClick,\n onTotalDurationChange,\n}: SettingsMenuProps) {\n const { translate } = useTranslation();\n\n const menuItems = React.useMemo(() => {\n const standardItems: TimelineMenuItemProps[] = [\n {\n label: translate(\"timeline.slow\"),\n timelineDuration: slowSpeed,\n },\n {\n label: translate(\"timeline.medium\"),\n timelineDuration: mediumSpeed,\n },\n {\n label: translate(\"timeline.fast\"),\n timelineDuration: fastSpeed,\n },\n ];\n\n if (!appMenuItems) {\n return standardItems;\n }\n\n if (appMenuItemOption === \"append\") {\n return [...standardItems, ...appMenuItems];\n }\n if (appMenuItemOption === \"prefix\") {\n return [...appMenuItems, ...standardItems];\n }\n // Replace\n return appMenuItems;\n }, [appMenuItemOption, appMenuItems, translate]);\n\n return (\n <DropdownMenu\n menuItems={(close) => {\n return [\n ...(includeRepeat\n ? [\n <MenuItem\n key=\"repeat\"\n onClick={() => {\n onRepeatClick();\n close();\n }}\n startIcon={repeat ? <SvgCheckmark /> : <></>}\n >\n {translate(\"timeline.repeat\")}\n </MenuItem>,\n <MenuDivider key=\"divider\" />,\n ]\n : []),\n ...menuItems.map((item, index) => {\n const checked = totalDuration === item.timelineDuration;\n return (\n <MenuItem\n key={index}\n startIcon={checked ? <SvgCheckmark /> : <></>}\n onClick={() => {\n onTotalDurationChange(item.timelineDuration);\n close();\n }}\n >\n {item.label}\n </MenuItem>\n );\n }),\n ];\n }}\n placement=\"top-start\"\n >\n <IconButton\n data-testid=\"timeline-settings\"\n label={translate(\"button.label.settings\")}\n styleType=\"borderless\"\n >\n <SvgMoreVertical />\n </IconButton>\n </DropdownMenu>\n );\n}\n\nfunction useAnimation(\n onAnimate: (args: { delta: number }) => void,\n playing = true\n) {\n const onAnimateRef = React.useRef(onAnimate);\n onAnimateRef.current = onAnimate;\n\n const lastTimeRef = React.useRef<number | undefined>();\n\n React.useEffect(() => {\n if (!playing) return;\n\n let handle = 0;\n let didCancel = false;\n\n const animate = (time: number) => {\n if (lastTimeRef.current === undefined) {\n lastTimeRef.current = time;\n }\n\n const delta = time - lastTimeRef.current;\n lastTimeRef.current = time;\n\n onAnimateRef.current({\n delta,\n });\n\n if (didCancel) return;\n\n handle = window.requestAnimationFrame(animate);\n };\n\n handle = window.requestAnimationFrame(animate);\n return () => {\n didCancel = true;\n lastTimeRef.current = undefined;\n window.cancelAnimationFrame(handle);\n };\n }, [playing]);\n}\n\nfunction timeToMs(time: string) {\n if (time.indexOf(\":\") !== -1) {\n return (\n (Number(time.split(\":\")[0]) * 60 + Number(time.split(\":\")[1])) * 1000\n );\n } else {\n return Number(time) * 1000;\n }\n}\n\nfunction toDisplayTime(ms: number) {\n const addZero = (i: number) => {\n return i < 10 ? `0${i}` : i;\n };\n\n const date = new Date(ms);\n // const hours = date.getUTCHours();\n const minutes = date.getUTCMinutes();\n const seconds = date.getUTCSeconds();\n return `${addZero(minutes)}:${addZero(seconds)}`;\n}\n"]}
|
|
@@ -3,159 +3,46 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
.timeline-component {
|
|
6
|
-
box-sizing: border-box;
|
|
7
6
|
width: 100%;
|
|
7
|
+
min-width: 275px;
|
|
8
|
+
|
|
8
9
|
display: flex;
|
|
9
|
-
flex-direction:
|
|
10
|
-
|
|
10
|
+
flex-direction: row;
|
|
11
|
+
align-items: center;
|
|
11
12
|
padding: 8px 16px;
|
|
12
|
-
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
gap: 8px;
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
.time-container {
|
|
15
17
|
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
16
19
|
align-items: center;
|
|
17
|
-
height: 38px;
|
|
18
|
-
position: relative;
|
|
19
|
-
|
|
20
|
-
> .play-backward {
|
|
21
|
-
border-radius: var(--iui-border-radius-1) 0 0 var(--iui-border-radius-1);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
> .play-button-step {
|
|
25
|
-
border-left: none;
|
|
26
|
-
border-right: none;
|
|
27
|
-
border-radius: 0;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
> .play-forward {
|
|
31
|
-
border-radius: 0px var(--iui-border-radius-1) var(--iui-border-radius-1) 0;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
> .current-date {
|
|
35
|
-
font-size: 14px;
|
|
36
|
-
min-width: 180px;
|
|
37
|
-
padding: 8px;
|
|
38
|
-
color: var(--iui-color-text);
|
|
39
|
-
position: absolute;
|
|
40
|
-
left: 50%;
|
|
41
|
-
transform: translateX(-50%);
|
|
42
|
-
border-radius: var(--iui-border-radius-1);
|
|
43
|
-
border: solid 1px var(--iui-color-border);
|
|
44
|
-
background-color: var(--iui-color-background);
|
|
45
|
-
text-align: center;
|
|
46
|
-
box-sizing: border-box;
|
|
47
|
-
display: flex;
|
|
48
|
-
align-items: center;
|
|
49
|
-
justify-content: center;
|
|
50
|
-
}
|
|
51
20
|
}
|
|
52
21
|
|
|
53
|
-
.
|
|
54
|
-
|
|
22
|
+
.timeline-time {
|
|
23
|
+
font-size: 12px;
|
|
24
|
+
color: var(--iui-color-text-muted);
|
|
25
|
+
text-align: center;
|
|
26
|
+
min-height: inherit;
|
|
55
27
|
}
|
|
56
28
|
|
|
57
|
-
|
|
58
|
-
|
|
29
|
+
.timeline-duration-time {
|
|
30
|
+
font-size: 14px;
|
|
31
|
+
width: 40px;
|
|
32
|
+
color: var(--iui-color-text);
|
|
33
|
+
text-align: center;
|
|
34
|
+
min-height: inherit;
|
|
59
35
|
}
|
|
60
36
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
position: relative;
|
|
66
|
-
|
|
67
|
-
.start-time-container,
|
|
68
|
-
.end-time-container {
|
|
69
|
-
display: flex;
|
|
70
|
-
flex-direction: column;
|
|
71
|
-
align-items: center;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.start-time,
|
|
75
|
-
.end-time {
|
|
76
|
-
font-size: 12px;
|
|
77
|
-
color: var(--iui-color-text-muted);
|
|
78
|
-
text-align: center;
|
|
79
|
-
min-height: inherit;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.duration-start-time,
|
|
83
|
-
.duration-end-time {
|
|
84
|
-
font-size: 14px;
|
|
85
|
-
width: 40px;
|
|
86
|
-
color: var(--iui-color-text);
|
|
87
|
-
text-align: center;
|
|
88
|
-
min-height: inherit;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.start-date,
|
|
92
|
-
.end-date {
|
|
93
|
-
font-size: 12px;
|
|
94
|
-
color: var(--iui-color-text-muted);
|
|
95
|
-
padding-bottom: 4px;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.slider {
|
|
99
|
-
position: relative;
|
|
100
|
-
flex: 1;
|
|
101
|
-
margin: 0 20px;
|
|
102
|
-
height: 24px;
|
|
103
|
-
}
|
|
37
|
+
.timeline-date {
|
|
38
|
+
font-size: 12px;
|
|
39
|
+
color: var(--iui-color-text-muted);
|
|
40
|
+
padding-bottom: 4px;
|
|
104
41
|
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.timeline-settings {
|
|
108
|
-
margin-left: auto;
|
|
109
|
-
font-size: 14px;
|
|
110
|
-
color: var(--iui-color-text);
|
|
111
|
-
cursor: pointer;
|
|
112
|
-
|
|
113
|
-
&:hover {
|
|
114
|
-
color: var(--iui-color-text-hover);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
&:focus {
|
|
118
|
-
outline: none;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.timeline-component.minimized .timeline-settings {
|
|
123
|
-
margin-left: 8px;
|
|
124
|
-
margin-right: -6px;
|
|
125
|
-
}
|
|
126
42
|
|
|
127
|
-
.
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
.timeline-component.has-dates .end-time-container {
|
|
132
|
-
margin-left: 8px;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.timeline-component.minimized .header,
|
|
136
|
-
.timeline-component.minimized .timeline-timeline,
|
|
137
|
-
.timeline-component:not(.minimized) .scrubber .start-date,
|
|
138
|
-
.timeline-component:not(.minimized) .scrubber .end-date,
|
|
139
|
-
.timeline-component:not(.has-dates) .scrubber .start-date,
|
|
140
|
-
.timeline-component:not(.has-dates) .scrubber .end-date,
|
|
141
|
-
.timeline-component:not(.minimized) .scrubber .play-button,
|
|
142
|
-
.timeline-component:not(.minimized) .scrubber .timeline-settings {
|
|
143
|
-
display: none;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.separator {
|
|
147
|
-
padding: 0.5em 0;
|
|
148
|
-
position: relative;
|
|
149
|
-
|
|
150
|
-
&:before {
|
|
151
|
-
content: "";
|
|
152
|
-
position: absolute;
|
|
153
|
-
top: 50%;
|
|
154
|
-
left: 4px;
|
|
155
|
-
right: 4px;
|
|
156
|
-
width: auto;
|
|
157
|
-
height: 1px;
|
|
158
|
-
background: #dce0e3;
|
|
159
|
-
transform: translateY(-50%);
|
|
43
|
+
.slider {
|
|
44
|
+
position: relative;
|
|
45
|
+
flex: 1;
|
|
46
|
+
margin: 0 20px;
|
|
160
47
|
}
|
|
161
48
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { ColorDef } from "@itwin/core-common";
|
|
5
5
|
import type { ScreenViewport } from "@itwin/core-frontend";
|
|
6
|
-
import type { GenericUiEventArgs } from "@itwin/appui-abstract";
|
|
7
6
|
/** The timeline scale.
|
|
8
7
|
* @public
|
|
9
8
|
*/
|
|
@@ -70,7 +69,8 @@ export declare enum TimelinePausePlayAction {
|
|
|
70
69
|
/** Args for event to pause or play the timeline component
|
|
71
70
|
* @public
|
|
72
71
|
*/
|
|
73
|
-
export interface TimelinePausePlayArgs
|
|
72
|
+
export interface TimelinePausePlayArgs {
|
|
73
|
+
uiComponentId: string;
|
|
74
74
|
timelineAction: TimelinePausePlayAction;
|
|
75
75
|
}
|
|
76
76
|
/** Interface for a timeline data provider class
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAE3D;;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,CAC3C,iBAAiB,EAAE,MAAM,KACtB,IAAI,CAAC;AAEV;;;;GAIG;AACH,MAAM,MAAM,6BAA6B,GAAG,CAC1C,cAAc,EAAE,gBAAgB,KAC7B,IAAI,CAAC;AAEV;;GAEG;AACH,oBAAY,uBAAuB;IACjC,MAAM,IAAA;IACN,KAAK,IAAA;IACL,IAAI,IAAA;CACL;AACD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,a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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;;;gGAGgG;AAChG;;GAEG;
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/interfaces.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAKH;;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;AAwCD;;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":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Timeline\n */\n\nimport type { ColorDef } from \"@itwin/core-common\";\nimport type { ScreenViewport } from \"@itwin/core-frontend\";\n\n/** The timeline scale.\n * @public\n */\nexport enum TimelineScale {\n /** Show years */\n Years,\n /** Show quarters */\n Quarters,\n /** Show months */\n Months,\n /** Show days */\n Days,\n /** Show hours */\n Hours,\n}\n\n/** Determines if data displayed to use is the actual date or the amount of time elapsed since project start.\n * @public\n */\nexport enum TimelineDateDisplay {\n /** Display time axis using actual start/end dates */\n ActualTime,\n /** Display time axis using time relative to actual start/end dates */\n ProjectTime,\n}\n\n/**\n * Playback Settings.\n * @public\n */\nexport interface PlaybackSettings {\n /** time in milliseconds to play animation from start date to end date */\n duration?: number;\n /** Set to True if animation to restart each time playbackEnd is reached. Defaults to false. */\n loop?: boolean;\n /** If true a minimal set of data is displayed. */\n minimized?: boolean;\n /** Playback start. If defined must be within start-end range. If not define 'start' is used. */\n playbackStart?: Date;\n /** Playback end. If defined must be within start-end range and later than playbackStart. If not define 'end' is used. */\n playbackEnd?: Date;\n /** Set to True if user should be allowed to insert milestone dates. Defaults to false */\n allowMilestoneEdits?: boolean;\n /** Define if actual date/times are used or date/times relative to project are used to draw timeline axis. */\n dateDisplay?: TimelineDateDisplay;\n}\n\n/**\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.\n * @public\n */\nexport type AnimationFractionChangeHandler = (\n animationFraction: number\n) => void;\n\n/**\n * An interface used to notify Handlers of Playback Settings changes.\n * Contains the settings to be used.\n * @public\n */\nexport type PlaybackSettingsChangeHandler = (\n settingsChange: PlaybackSettings\n) => void;\n\n/** Actions for Pause/Play event\n * @public\n */\nexport enum TimelinePausePlayAction {\n Toggle,\n Pause,\n Play,\n}\n/** Args for event to pause or play the timeline component\n * @public\n */\nexport interface TimelinePausePlayArgs {\n uiComponentId: string;\n timelineAction: TimelinePausePlayAction;\n}\n/** Interface for a timeline data provider class\n * @public\n */\nexport interface TimelineDataProvider {\n /** uniqueId of provider */\n id: string;\n /** view id when viewport is initially assigned */\n viewId: string;\n /** returns true if the provider has timeline animation data available */\n supportsTimelineAnimation: boolean;\n /** Starting date for entire timeline */\n start?: Date;\n /** End date for entire timeline */\n end?: Date;\n /** Current animation fraction from 0.0 to 1.0 */\n animationFraction?: number;\n getSettings(): PlaybackSettings;\n /** Called to get the initial scrubber location. This must be a value between 0 and the duration in PlaybackSettings. */\n initialDuration: number;\n /** Called to get the duration of the Playback. */\n duration: number;\n /** If true the playback will continuously loop. */\n loop: boolean;\n /** Called to save the playback settings */\n updateSettings(settings: PlaybackSettings): void;\n /** Async call to load milestone and settings data */\n loadTimelineData(): Promise<boolean>;\n /** Called when an internal process has defined the playback settings and the UI needs to be updated */\n onPlaybackSettingChanged?: PlaybackSettingsChangeHandler;\n /** Called when the an internal process has defined the playback settings and the UI needs to be updated */\n onAnimationFractionChanged?: AnimationFractionChangeHandler;\n /** viewport to show animation */\n viewport?: ScreenViewport;\n}\n\n/**\n * An interface used to notify Handlers of Playback progress.\n * Contains the settings to be used.\n * @alpha\n */\nexport type SolarPlaybackProgressHandler = (time: Date) => void;\n\n/** Data Provider interface for getting and setting solar position\n * @alpha\n */\nexport interface SolarDataProvider {\n // View Id used to determine sunrise and sunset\n viewId: string;\n /** returns true if the provider has timeline animation data available */\n supportsTimelineAnimation: boolean;\n // set to true is timeline should be shown - return false if view is not set to display shadow.\n readonly shouldShowTimeline: boolean;\n /** Starting date for entire timeline */\n day: Date;\n /** Starting time for day in milliseconds */\n readonly dayStartMs: number;\n /** Time of day for sun */\n readonly timeOfDay: Date;\n /** Called during playback to update animation */\n onTimeChanged?: SolarPlaybackProgressHandler;\n /** viewport to show animation */\n viewport?: ScreenViewport;\n /** Time of Sunrise to nearest minute */\n readonly sunrise: Date;\n /** time of Sunrise to nearest minute */\n readonly sunset: Date;\n /** shadow color */\n shadowColor: ColorDef;\n /** timezone offset for local project time */\n readonly timeZoneOffset: number;\n /** set date for shadow study. If isProjectDate is false the is assume to be in users\n * current time and the value is adjusted to be the same date and time at the project location. */\n setDateAndTime: (day: Date, isProjectDate?: boolean) => void;\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface UseTranslationResult {
|
|
2
|
+
translate: (key: string) => string;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Returns a translation function.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare function useTranslation(): UseTranslationResult;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=useTranslation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTranslation.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/useTranslation.ts"],"names":[],"mappings":"AAOA,UAAU,oBAAoB;IAC5B,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CACpC;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,oBAAoB,CAMrD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { UiIModelComponents } from "./UiIModelComponents";
|
|
6
|
+
/**
|
|
7
|
+
* Returns a translation function.
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export function useTranslation() {
|
|
11
|
+
const translate = (key) => {
|
|
12
|
+
return UiIModelComponents.translate(key);
|
|
13
|
+
};
|
|
14
|
+
return { translate };
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=useTranslation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTranslation.js","sourceRoot":"","sources":["../../../src/imodel-components-react/useTranslation.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAM1D;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE;QAChC,OAAO,kBAAkB,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC3C,CAAC,CAAC;IAEF,OAAO,EAAE,SAAS,EAAE,CAAC;AACvB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { UiIModelComponents } from \"./UiIModelComponents\";\n\ninterface UseTranslationResult {\n translate: (key: string) => string;\n}\n\n/**\n * Returns a translation function.\n * @internal\n */\nexport function useTranslation(): UseTranslationResult {\n const translate = (key: string) => {\n return UiIModelComponents.translate(key);\n };\n\n return { translate };\n}\n"]}
|
|
@@ -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,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAKtD,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,WAAW,EAEX,SAAS,EACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,cAAc,EAGf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAQrD;;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,
|
|
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,EAAE,MAAM,qBAAqB,CAAC;AAKtD,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,WAAW,EAEX,SAAS,EACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,cAAc,EAGf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAQrD;;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,qBA2UrD"}
|
|
@@ -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);
|
|
@@ -76,9 +76,10 @@ export function ViewportComponent(props) {
|
|
|
76
76
|
};
|
|
77
77
|
const targetPoint = React.useRef(null);
|
|
78
78
|
const getRotatePoint = (vp) => {
|
|
79
|
+
var _a, _b;
|
|
79
80
|
const lastTargetPoint = targetPoint.current;
|
|
80
81
|
// istanbul ignore next
|
|
81
|
-
const tentativePoint = tentativePointOverrideRef.current
|
|
82
|
+
const tentativePoint = (_a = tentativePointOverrideRef.current) !== null && _a !== void 0 ? _a : IModelApp.tentativePoint;
|
|
82
83
|
// istanbul ignore else
|
|
83
84
|
if (tentativePoint.isActive)
|
|
84
85
|
return tentativePoint.getPoint();
|
|
@@ -96,7 +97,7 @@ export function ViewportComponent(props) {
|
|
|
96
97
|
targetPoint.current =
|
|
97
98
|
undefined !== visiblePoint ? visiblePoint : vp.view.getTargetPoint();
|
|
98
99
|
// istanbul ignore next
|
|
99
|
-
return targetPoint.current
|
|
100
|
+
return (_b = targetPoint.current) !== null && _b !== void 0 ? _b : vp.view.getCenter();
|
|
100
101
|
};
|
|
101
102
|
const handleCubeRotationChangeEvent = (args) => {
|
|
102
103
|
const viewManager = viewManagerRef.current;
|
|
@@ -147,7 +148,10 @@ export function ViewportComponent(props) {
|
|
|
147
148
|
? screenViewportOverride
|
|
148
149
|
: ScreenViewport;
|
|
149
150
|
const parentWindow = parentDiv.ownerDocument.defaultView;
|
|
150
|
-
parentWindow.addEventListener("unload", handleWindowUnload,
|
|
151
|
+
parentWindow.addEventListener("unload", handleWindowUnload, {
|
|
152
|
+
once: true,
|
|
153
|
+
capture: true,
|
|
154
|
+
}); // by specifying 'once', listener clears after being called
|
|
151
155
|
ViewportComponentEvents.initialize();
|
|
152
156
|
ViewportComponentEvents.onDrawingViewportChangeEvent.addListener(handleDrawingViewportChangeEvent);
|
|
153
157
|
ViewportComponentEvents.onCubeRotationChangeEvent.addListener(handleCubeRotationChangeEvent);
|
|
@@ -200,8 +204,8 @@ export function ViewportComponent(props) {
|
|
|
200
204
|
}
|
|
201
205
|
// istanbul ignore next
|
|
202
206
|
if (isMounted.current &&
|
|
203
|
-
(currentViewState
|
|
204
|
-
setInitialViewState(currentViewState
|
|
207
|
+
((currentViewState === null || currentViewState === void 0 ? void 0 : currentViewState.iModel.isOpen) || (currentViewState === null || currentViewState === void 0 ? void 0 : currentViewState.iModel.isBlank))) {
|
|
208
|
+
setInitialViewState(currentViewState === null || currentViewState === void 0 ? void 0 : currentViewState.clone());
|
|
205
209
|
}
|
|
206
210
|
}
|
|
207
211
|
if (undefined === initialViewState)
|
|
@@ -210,12 +214,13 @@ export function ViewportComponent(props) {
|
|
|
210
214
|
const [viewOverlay, setViewOverlay] = React.useState(null);
|
|
211
215
|
// This useEffect connects to ViewManger as soon as initialViewState is available once component is mounted.
|
|
212
216
|
React.useEffect(() => {
|
|
217
|
+
var _a;
|
|
213
218
|
const parentDiv = viewportDiv.current;
|
|
214
219
|
const viewManager = viewManagerRef.current;
|
|
215
220
|
// istanbul ignore next
|
|
216
221
|
if (parentDiv &&
|
|
217
222
|
initialViewState &&
|
|
218
|
-
(initialViewState
|
|
223
|
+
((initialViewState === null || initialViewState === void 0 ? void 0 : initialViewState.iModel.isOpen) || (initialViewState === null || initialViewState === void 0 ? void 0 : initialViewState.iModel.isBlank))) {
|
|
219
224
|
if (!screenViewportCreated.current) {
|
|
220
225
|
const screenViewport = getScreenViewport(parentDiv, initialViewState);
|
|
221
226
|
screenViewportRef.current = screenViewport;
|
|
@@ -228,7 +233,7 @@ export function ViewportComponent(props) {
|
|
|
228
233
|
}
|
|
229
234
|
else {
|
|
230
235
|
// istanbul ignore next
|
|
231
|
-
screenViewportRef.current
|
|
236
|
+
(_a = screenViewportRef.current) === null || _a === void 0 ? void 0 : _a.changeView(initialViewState);
|
|
232
237
|
}
|
|
233
238
|
}
|
|
234
239
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|