@itwin/imodel-components-react 4.0.0-dev.12 → 4.0.0-dev.14
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 +113 -1
- package/README.md +2 -2
- package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts +28 -28
- package/lib/cjs/imodel-components-react/UiIModelComponents.js +75 -77
- package/lib/cjs/imodel-components-react/UiIModelComponents.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts +36 -36
- package/lib/cjs/imodel-components-react/color/AlphaSlider.js +190 -186
- package/lib/cjs/imodel-components-react/color/AlphaSlider.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts +37 -37
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.js +112 -108
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts +23 -23
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js +78 -74
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerPanel.d.ts +21 -21
- package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js +149 -145
- package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts +44 -44
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js +143 -139
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/HueSlider.d.ts +22 -22
- package/lib/cjs/imodel-components-react/color/HueSlider.js +203 -199
- package/lib/cjs/imodel-components-react/color/HueSlider.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts +20 -20
- package/lib/cjs/imodel-components-react/color/SaturationPicker.js +217 -213
- package/lib/cjs/imodel-components-react/color/SaturationPicker.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/Swatch.d.ts +22 -22
- package/lib/cjs/imodel-components-react/color/Swatch.js +64 -60
- package/lib/cjs/imodel-components-react/color/Swatch.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.d.ts +6 -6
- package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js +23 -23
- package/lib/cjs/imodel-components-react/editors/ColorEditor.d.ts +44 -44
- package/lib/cjs/imodel-components-react/editors/ColorEditor.js +155 -151
- package/lib/cjs/imodel-components-react/editors/ColorEditor.js.map +1 -1
- package/lib/cjs/imodel-components-react/editors/WeightEditor.d.ts +47 -47
- package/lib/cjs/imodel-components-react/editors/WeightEditor.js +164 -160
- package/lib/cjs/imodel-components-react/editors/WeightEditor.js.map +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.d.ts +25 -25
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.js +100 -96
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.js.map +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts +44 -44
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js +272 -268
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
- package/lib/cjs/imodel-components-react/lineweight/Swatch.d.ts +33 -33
- package/lib/cjs/imodel-components-react/lineweight/Swatch.js +89 -85
- package/lib/cjs/imodel-components-react/lineweight/Swatch.js.map +1 -1
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.d.ts +60 -60
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js +163 -159
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.scss +1 -2
- package/lib/cjs/imodel-components-react/navigationaids/Cube.d.ts +45 -45
- package/lib/cjs/imodel-components-react/navigationaids/Cube.js +131 -127
- package/lib/cjs/imodel-components-react/navigationaids/Cube.js.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +175 -174
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js +650 -638
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +145 -145
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js +657 -653
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.d.ts +26 -26
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js +103 -99
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.scss +0 -4
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js +56 -53
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts +18 -18
- package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js +88 -84
- package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.js +89 -86
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js +112 -109
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.d.ts +19 -19
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js +133 -133
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +21 -21
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js +187 -184
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +22 -22
- package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js +149 -145
- package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js +63 -59
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js +51 -47
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +16 -16
- package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js +58 -54
- package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.d.ts +18 -18
- package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js +52 -48
- package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js +54 -50
- package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +62 -58
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js +51 -47
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js +60 -56
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +98 -95
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +23 -23
- package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js +123 -119
- package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +52 -52
- package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js +142 -143
- package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +31 -31
- package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js +69 -69
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.d.ts +27 -27
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.js +85 -81
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts +33 -33
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.js +99 -95
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/Scrubber.d.ts +54 -54
- package/lib/cjs/imodel-components-react/timeline/Scrubber.js +195 -191
- package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts +77 -77
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js +432 -428
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.d.ts +15 -15
- package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js +58 -54
- package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts +130 -133
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js +398 -365
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.scss +17 -0
- package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts +174 -174
- package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/interfaces.js +45 -45
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts +42 -42
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js +276 -274
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.d.ts +106 -106
- package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js +105 -105
- package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
- package/lib/cjs/imodel-components-react.d.ts +82 -82
- package/lib/cjs/imodel-components-react.js +105 -101
- package/lib/cjs/imodel-components-react.js.map +1 -1
- package/lib/esm/imodel-components-react/UiIModelComponents.d.ts +28 -28
- package/lib/esm/imodel-components-react/UiIModelComponents.js +72 -73
- package/lib/esm/imodel-components-react/UiIModelComponents.js.map +1 -1
- package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts +36 -36
- package/lib/esm/imodel-components-react/color/AlphaSlider.js +160 -160
- package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts +37 -37
- package/lib/esm/imodel-components-react/color/ColorPickerButton.js +83 -83
- package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts +23 -23
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.js +51 -51
- package/lib/esm/imodel-components-react/color/ColorPickerPanel.d.ts +21 -21
- package/lib/esm/imodel-components-react/color/ColorPickerPanel.js +122 -122
- package/lib/esm/imodel-components-react/color/ColorPickerPanel.js.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts +44 -44
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.js +114 -114
- package/lib/esm/imodel-components-react/color/HueSlider.d.ts +22 -22
- package/lib/esm/imodel-components-react/color/HueSlider.js +173 -173
- package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts +20 -20
- package/lib/esm/imodel-components-react/color/SaturationPicker.js +187 -187
- package/lib/esm/imodel-components-react/color/Swatch.d.ts +22 -22
- package/lib/esm/imodel-components-react/color/Swatch.js +34 -34
- package/lib/esm/imodel-components-react/color/getCSSColorFromDef.d.ts +6 -6
- package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js +19 -19
- package/lib/esm/imodel-components-react/editors/ColorEditor.d.ts +44 -44
- package/lib/esm/imodel-components-react/editors/ColorEditor.js +124 -124
- package/lib/esm/imodel-components-react/editors/WeightEditor.d.ts +47 -47
- package/lib/esm/imodel-components-react/editors/WeightEditor.js +133 -133
- package/lib/esm/imodel-components-react/inputs/QuantityInput.d.ts +25 -25
- package/lib/esm/imodel-components-react/inputs/QuantityInput.js +70 -70
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts +44 -44
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js +243 -243
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
- package/lib/esm/imodel-components-react/lineweight/Swatch.d.ts +33 -33
- package/lib/esm/imodel-components-react/lineweight/Swatch.js +59 -59
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.d.ts +60 -60
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js +134 -133
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.scss +1 -2
- package/lib/esm/imodel-components-react/navigationaids/Cube.d.ts +45 -45
- package/lib/esm/imodel-components-react/navigationaids/Cube.js +100 -100
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +175 -174
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js +620 -610
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +145 -145
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js +627 -626
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.d.ts +26 -26
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js +76 -76
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.scss +0 -4
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js +29 -30
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts +18 -18
- package/lib/esm/imodel-components-react/quantityformat/FormatSample.js +61 -61
- package/lib/esm/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatType.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/FormatType.js +62 -63
- package/lib/esm/imodel-components-react/quantityformat/FormatType.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js +82 -83
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatUnits.d.ts +19 -19
- package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js +106 -110
- package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.d.ts +21 -21
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js +157 -158
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts +22 -22
- package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js +122 -122
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js +36 -36
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js +24 -24
- package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts +16 -16
- package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js +31 -31
- package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.d.ts +18 -18
- package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js +25 -25
- package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js +27 -27
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +35 -35
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js +24 -24
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js +33 -33
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +68 -69
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.d.ts +23 -23
- package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js +96 -96
- package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +52 -52
- package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js +138 -139
- package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts +31 -31
- package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js +65 -65
- package/lib/esm/imodel-components-react/timeline/InlineEdit.d.ts +27 -27
- package/lib/esm/imodel-components-react/timeline/InlineEdit.js +55 -55
- package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts +33 -33
- package/lib/esm/imodel-components-react/timeline/PlayerButton.js +68 -68
- package/lib/esm/imodel-components-react/timeline/Scrubber.d.ts +54 -54
- package/lib/esm/imodel-components-react/timeline/Scrubber.js +164 -164
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts +77 -77
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.js +402 -402
- package/lib/esm/imodel-components-react/timeline/SpeedTimeline.d.ts +15 -15
- package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js +28 -28
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts +130 -133
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.js +368 -339
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.scss +17 -0
- package/lib/esm/imodel-components-react/timeline/interfaces.d.ts +174 -174
- package/lib/esm/imodel-components-react/timeline/interfaces.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/interfaces.js +42 -42
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts +42 -42
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.js +249 -251
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
- package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.d.ts +106 -106
- package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js +96 -95
- package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
- package/lib/esm/imodel-components-react.d.ts +82 -82
- package/lib/esm/imodel-components-react.js +87 -87
- package/package.json +26 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimelineComponent.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/TimelineComponent.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;G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AAC,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\n\r\nimport \"./TimelineComponent.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { GenericUiEventArgs, UiAdmin } from \"@itwin/appui-abstract\";\r\nimport { DateFormatOptions, toDateString, toTimeString, UiComponents } from \"@itwin/components-react\";\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\nimport { DropdownMenu, MenuDivider, MenuItem } from \"@itwin/itwinui-react\";\r\nimport { Icon } from \"@itwin/core-react\";\r\nimport { SvgCaretLeft, SvgCaretRight, SvgCheckmark, SvgMoreVertical, SvgPlayCircular } from \"@itwin/itwinui-icons-react\";\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}>\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":"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,EA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AAU,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 { 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"]}
|
|
@@ -159,3 +159,20 @@
|
|
|
159
159
|
transform: translateY(-50%);
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
+
|
|
163
|
+
.timeline-component-max-sized-scrolling-menu {
|
|
164
|
+
display: flex;
|
|
165
|
+
max-height: 100%;
|
|
166
|
+
> .tippy-box {
|
|
167
|
+
display: flex;
|
|
168
|
+
> .tippy-content {
|
|
169
|
+
display: flex;
|
|
170
|
+
> div {
|
|
171
|
+
display: flex;
|
|
172
|
+
> .iui-menu {
|
|
173
|
+
overflow: auto;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
@@ -1,175 +1,175 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Timeline
|
|
3
|
-
*/
|
|
4
|
-
import { ColorDef } from "@itwin/core-common";
|
|
5
|
-
import { ScreenViewport } from "@itwin/core-frontend";
|
|
6
|
-
import { GenericUiEventArgs } from "@itwin/appui-abstract";
|
|
7
|
-
/**
|
|
8
|
-
* A range of time which can be used to focus in on activities scheduled around a milestone.
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export interface MilestoneRange {
|
|
12
|
-
start: Date;
|
|
13
|
-
end: Date;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* A Milestone event that is to be noted in the timeline.
|
|
17
|
-
* @internal
|
|
18
|
-
* @deprecated in 3.0. Obsolete.
|
|
19
|
-
*/
|
|
20
|
-
export interface Milestone {
|
|
21
|
-
/** uniqueId of milestone */
|
|
22
|
-
id: string;
|
|
23
|
-
/** milestone date */
|
|
24
|
-
date: Date;
|
|
25
|
-
parentId?: string;
|
|
26
|
-
/** Milestone label that is display if space allows */
|
|
27
|
-
label?: string;
|
|
28
|
-
/** Milestone description that is show as tooltip */
|
|
29
|
-
description?: string;
|
|
30
|
-
/** animation range that includes milestone */
|
|
31
|
-
range?: MilestoneRange;
|
|
32
|
-
/** Set to true if read only. */
|
|
33
|
-
readonly?: boolean;
|
|
34
|
-
children?: Milestone[];
|
|
35
|
-
}
|
|
36
|
-
/** The timeline scale.
|
|
37
|
-
* @public
|
|
38
|
-
*/
|
|
39
|
-
export declare enum TimelineScale {
|
|
40
|
-
/** Show years */
|
|
41
|
-
Years = 0,
|
|
42
|
-
/** Show quarters */
|
|
43
|
-
Quarters = 1,
|
|
44
|
-
/** Show months */
|
|
45
|
-
Months = 2,
|
|
46
|
-
/** Show days */
|
|
47
|
-
Days = 3,
|
|
48
|
-
/** Show hours */
|
|
49
|
-
Hours = 4
|
|
50
|
-
}
|
|
51
|
-
/** Determines if data displayed to use is the actual date or the amount of time elapsed since project start.
|
|
52
|
-
* @public
|
|
53
|
-
*/
|
|
54
|
-
export declare enum TimelineDateDisplay {
|
|
55
|
-
/** Display time axis using actual start/end dates */
|
|
56
|
-
ActualTime = 0,
|
|
57
|
-
/** Display time axis using time relative to actual start/end dates */
|
|
58
|
-
ProjectTime = 1
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Playback Settings.
|
|
62
|
-
* @public
|
|
63
|
-
*/
|
|
64
|
-
export interface PlaybackSettings {
|
|
65
|
-
/** time in milliseconds to play animation from start date to end date */
|
|
66
|
-
duration?: number;
|
|
67
|
-
/** Set to True if animation to restart each time playbackEnd is reached. Defaults to false. */
|
|
68
|
-
loop?: boolean;
|
|
69
|
-
/** If true a minimal set of data is displayed. */
|
|
70
|
-
minimized?: boolean;
|
|
71
|
-
/** Playback start. If defined must be within start-end range. If not define 'start' is used. */
|
|
72
|
-
playbackStart?: Date;
|
|
73
|
-
/** Playback end. If defined must be within start-end range and later than playbackStart. If not define 'end' is used. */
|
|
74
|
-
playbackEnd?: Date;
|
|
75
|
-
/** Set to True if user should be allowed to insert milestone dates. Defaults to false */
|
|
76
|
-
allowMilestoneEdits?: boolean;
|
|
77
|
-
/** Define if actual date/times are used or date/times relative to project are used to draw timeline axis. */
|
|
78
|
-
dateDisplay?: TimelineDateDisplay;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* 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.
|
|
82
|
-
* @public
|
|
83
|
-
*/
|
|
84
|
-
export
|
|
85
|
-
/**
|
|
86
|
-
* An interface used to notify Handlers of Playback Settings changes.
|
|
87
|
-
* Contains the settings to be used.
|
|
88
|
-
* @public
|
|
89
|
-
*/
|
|
90
|
-
export
|
|
91
|
-
/** Actions for Pause/Play event
|
|
92
|
-
* @public
|
|
93
|
-
*/
|
|
94
|
-
export declare enum TimelinePausePlayAction {
|
|
95
|
-
Toggle = 0,
|
|
96
|
-
Pause = 1,
|
|
97
|
-
Play = 2
|
|
98
|
-
}
|
|
99
|
-
/** Args for event to pause or play the timeline component
|
|
100
|
-
* @public
|
|
101
|
-
*/
|
|
102
|
-
export interface TimelinePausePlayArgs extends GenericUiEventArgs {
|
|
103
|
-
timelineAction: TimelinePausePlayAction;
|
|
104
|
-
}
|
|
105
|
-
/** Interface for a timeline data provider class
|
|
106
|
-
* @public
|
|
107
|
-
*/
|
|
108
|
-
export interface TimelineDataProvider {
|
|
109
|
-
/** uniqueId of provider */
|
|
110
|
-
id: string;
|
|
111
|
-
/** view id when viewport is initially assigned */
|
|
112
|
-
viewId: string;
|
|
113
|
-
/** returns true if the provider has timeline animation data available */
|
|
114
|
-
supportsTimelineAnimation: boolean;
|
|
115
|
-
/** Starting date for entire timeline */
|
|
116
|
-
start?: Date;
|
|
117
|
-
/** End date for entire timeline */
|
|
118
|
-
end?: Date;
|
|
119
|
-
/** Current animation fraction from 0.0 to 1.0 */
|
|
120
|
-
animationFraction?: number;
|
|
121
|
-
getSettings(): PlaybackSettings;
|
|
122
|
-
/** Called to get the initial scrubber location. This must be a value between 0 and the duration in PlaybackSettings. */
|
|
123
|
-
initialDuration: number;
|
|
124
|
-
/** Called to get the duration of the Playback. */
|
|
125
|
-
duration: number;
|
|
126
|
-
/** If true the playback will continuously loop. */
|
|
127
|
-
loop: boolean;
|
|
128
|
-
/** Called to save the playback settings */
|
|
129
|
-
updateSettings(settings: PlaybackSettings): void;
|
|
130
|
-
/** Async call to load milestone and settings data */
|
|
131
|
-
loadTimelineData(): Promise<boolean>;
|
|
132
|
-
/** Called when an internal process has defined the playback settings and the UI needs to be updated */
|
|
133
|
-
onPlaybackSettingChanged?: PlaybackSettingsChangeHandler;
|
|
134
|
-
/** Called when the an internal process has defined the playback settings and the UI needs to be updated */
|
|
135
|
-
onAnimationFractionChanged?: AnimationFractionChangeHandler;
|
|
136
|
-
/** viewport to show animation */
|
|
137
|
-
viewport?: ScreenViewport;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* An interface used to notify Handlers of Playback progress.
|
|
141
|
-
* Contains the settings to be used.
|
|
142
|
-
* @alpha
|
|
143
|
-
*/
|
|
144
|
-
export
|
|
145
|
-
/** Data Provider interface for getting and setting solar position
|
|
146
|
-
* @alpha
|
|
147
|
-
*/
|
|
148
|
-
export interface SolarDataProvider {
|
|
149
|
-
viewId: string;
|
|
150
|
-
/** returns true if the provider has timeline animation data available */
|
|
151
|
-
supportsTimelineAnimation: boolean;
|
|
152
|
-
readonly shouldShowTimeline: boolean;
|
|
153
|
-
/** Starting date for entire timeline */
|
|
154
|
-
day: Date;
|
|
155
|
-
/** Starting time for day in milliseconds */
|
|
156
|
-
readonly dayStartMs: number;
|
|
157
|
-
/** Time of day for sun */
|
|
158
|
-
readonly timeOfDay: Date;
|
|
159
|
-
/** Called during playback to update animation */
|
|
160
|
-
onTimeChanged?: SolarPlaybackProgressHandler;
|
|
161
|
-
/** viewport to show animation */
|
|
162
|
-
viewport?: ScreenViewport;
|
|
163
|
-
/** Time of Sunrise to nearest minute */
|
|
164
|
-
readonly sunrise: Date;
|
|
165
|
-
/** time of Sunrise to nearest minute */
|
|
166
|
-
readonly sunset: Date;
|
|
167
|
-
/** shadow color */
|
|
168
|
-
shadowColor: ColorDef;
|
|
169
|
-
/** timezone offset for local project time */
|
|
170
|
-
readonly timeZoneOffset: number;
|
|
171
|
-
/** set date for shadow study. If isProjectDate is false the is assume to be in users
|
|
172
|
-
* current time and the value is adjusted to be the same date and time at the project location. */
|
|
173
|
-
setDateAndTime: (day: Date, isProjectDate?: boolean) => void;
|
|
174
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Timeline
|
|
3
|
+
*/
|
|
4
|
+
import { ColorDef } from "@itwin/core-common";
|
|
5
|
+
import { ScreenViewport } from "@itwin/core-frontend";
|
|
6
|
+
import { GenericUiEventArgs } from "@itwin/appui-abstract";
|
|
7
|
+
/**
|
|
8
|
+
* A range of time which can be used to focus in on activities scheduled around a milestone.
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export interface MilestoneRange {
|
|
12
|
+
start: Date;
|
|
13
|
+
end: Date;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A Milestone event that is to be noted in the timeline.
|
|
17
|
+
* @internal
|
|
18
|
+
* @deprecated in 3.0. Obsolete.
|
|
19
|
+
*/
|
|
20
|
+
export interface Milestone {
|
|
21
|
+
/** uniqueId of milestone */
|
|
22
|
+
id: string;
|
|
23
|
+
/** milestone date */
|
|
24
|
+
date: Date;
|
|
25
|
+
parentId?: string;
|
|
26
|
+
/** Milestone label that is display if space allows */
|
|
27
|
+
label?: string;
|
|
28
|
+
/** Milestone description that is show as tooltip */
|
|
29
|
+
description?: string;
|
|
30
|
+
/** animation range that includes milestone */
|
|
31
|
+
range?: MilestoneRange;
|
|
32
|
+
/** Set to true if read only. */
|
|
33
|
+
readonly?: boolean;
|
|
34
|
+
children?: Milestone[];
|
|
35
|
+
}
|
|
36
|
+
/** The timeline scale.
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
export declare enum TimelineScale {
|
|
40
|
+
/** Show years */
|
|
41
|
+
Years = 0,
|
|
42
|
+
/** Show quarters */
|
|
43
|
+
Quarters = 1,
|
|
44
|
+
/** Show months */
|
|
45
|
+
Months = 2,
|
|
46
|
+
/** Show days */
|
|
47
|
+
Days = 3,
|
|
48
|
+
/** Show hours */
|
|
49
|
+
Hours = 4
|
|
50
|
+
}
|
|
51
|
+
/** Determines if data displayed to use is the actual date or the amount of time elapsed since project start.
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
export declare enum TimelineDateDisplay {
|
|
55
|
+
/** Display time axis using actual start/end dates */
|
|
56
|
+
ActualTime = 0,
|
|
57
|
+
/** Display time axis using time relative to actual start/end dates */
|
|
58
|
+
ProjectTime = 1
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Playback Settings.
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
export interface PlaybackSettings {
|
|
65
|
+
/** time in milliseconds to play animation from start date to end date */
|
|
66
|
+
duration?: number;
|
|
67
|
+
/** Set to True if animation to restart each time playbackEnd is reached. Defaults to false. */
|
|
68
|
+
loop?: boolean;
|
|
69
|
+
/** If true a minimal set of data is displayed. */
|
|
70
|
+
minimized?: boolean;
|
|
71
|
+
/** Playback start. If defined must be within start-end range. If not define 'start' is used. */
|
|
72
|
+
playbackStart?: Date;
|
|
73
|
+
/** Playback end. If defined must be within start-end range and later than playbackStart. If not define 'end' is used. */
|
|
74
|
+
playbackEnd?: Date;
|
|
75
|
+
/** Set to True if user should be allowed to insert milestone dates. Defaults to false */
|
|
76
|
+
allowMilestoneEdits?: boolean;
|
|
77
|
+
/** Define if actual date/times are used or date/times relative to project are used to draw timeline axis. */
|
|
78
|
+
dateDisplay?: TimelineDateDisplay;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* 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.
|
|
82
|
+
* @public
|
|
83
|
+
*/
|
|
84
|
+
export type AnimationFractionChangeHandler = (animationFraction: number) => void;
|
|
85
|
+
/**
|
|
86
|
+
* An interface used to notify Handlers of Playback Settings changes.
|
|
87
|
+
* Contains the settings to be used.
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
export type PlaybackSettingsChangeHandler = (settingsChange: PlaybackSettings) => void;
|
|
91
|
+
/** Actions for Pause/Play event
|
|
92
|
+
* @public
|
|
93
|
+
*/
|
|
94
|
+
export declare enum TimelinePausePlayAction {
|
|
95
|
+
Toggle = 0,
|
|
96
|
+
Pause = 1,
|
|
97
|
+
Play = 2
|
|
98
|
+
}
|
|
99
|
+
/** Args for event to pause or play the timeline component
|
|
100
|
+
* @public
|
|
101
|
+
*/
|
|
102
|
+
export interface TimelinePausePlayArgs extends GenericUiEventArgs {
|
|
103
|
+
timelineAction: TimelinePausePlayAction;
|
|
104
|
+
}
|
|
105
|
+
/** Interface for a timeline data provider class
|
|
106
|
+
* @public
|
|
107
|
+
*/
|
|
108
|
+
export interface TimelineDataProvider {
|
|
109
|
+
/** uniqueId of provider */
|
|
110
|
+
id: string;
|
|
111
|
+
/** view id when viewport is initially assigned */
|
|
112
|
+
viewId: string;
|
|
113
|
+
/** returns true if the provider has timeline animation data available */
|
|
114
|
+
supportsTimelineAnimation: boolean;
|
|
115
|
+
/** Starting date for entire timeline */
|
|
116
|
+
start?: Date;
|
|
117
|
+
/** End date for entire timeline */
|
|
118
|
+
end?: Date;
|
|
119
|
+
/** Current animation fraction from 0.0 to 1.0 */
|
|
120
|
+
animationFraction?: number;
|
|
121
|
+
getSettings(): PlaybackSettings;
|
|
122
|
+
/** Called to get the initial scrubber location. This must be a value between 0 and the duration in PlaybackSettings. */
|
|
123
|
+
initialDuration: number;
|
|
124
|
+
/** Called to get the duration of the Playback. */
|
|
125
|
+
duration: number;
|
|
126
|
+
/** If true the playback will continuously loop. */
|
|
127
|
+
loop: boolean;
|
|
128
|
+
/** Called to save the playback settings */
|
|
129
|
+
updateSettings(settings: PlaybackSettings): void;
|
|
130
|
+
/** Async call to load milestone and settings data */
|
|
131
|
+
loadTimelineData(): Promise<boolean>;
|
|
132
|
+
/** Called when an internal process has defined the playback settings and the UI needs to be updated */
|
|
133
|
+
onPlaybackSettingChanged?: PlaybackSettingsChangeHandler;
|
|
134
|
+
/** Called when the an internal process has defined the playback settings and the UI needs to be updated */
|
|
135
|
+
onAnimationFractionChanged?: AnimationFractionChangeHandler;
|
|
136
|
+
/** viewport to show animation */
|
|
137
|
+
viewport?: ScreenViewport;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* An interface used to notify Handlers of Playback progress.
|
|
141
|
+
* Contains the settings to be used.
|
|
142
|
+
* @alpha
|
|
143
|
+
*/
|
|
144
|
+
export type SolarPlaybackProgressHandler = (time: Date) => void;
|
|
145
|
+
/** Data Provider interface for getting and setting solar position
|
|
146
|
+
* @alpha
|
|
147
|
+
*/
|
|
148
|
+
export interface SolarDataProvider {
|
|
149
|
+
viewId: string;
|
|
150
|
+
/** returns true if the provider has timeline animation data available */
|
|
151
|
+
supportsTimelineAnimation: boolean;
|
|
152
|
+
readonly shouldShowTimeline: boolean;
|
|
153
|
+
/** Starting date for entire timeline */
|
|
154
|
+
day: Date;
|
|
155
|
+
/** Starting time for day in milliseconds */
|
|
156
|
+
readonly dayStartMs: number;
|
|
157
|
+
/** Time of day for sun */
|
|
158
|
+
readonly timeOfDay: Date;
|
|
159
|
+
/** Called during playback to update animation */
|
|
160
|
+
onTimeChanged?: SolarPlaybackProgressHandler;
|
|
161
|
+
/** viewport to show animation */
|
|
162
|
+
viewport?: ScreenViewport;
|
|
163
|
+
/** Time of Sunrise to nearest minute */
|
|
164
|
+
readonly sunrise: Date;
|
|
165
|
+
/** time of Sunrise to nearest minute */
|
|
166
|
+
readonly sunset: Date;
|
|
167
|
+
/** shadow color */
|
|
168
|
+
shadowColor: ColorDef;
|
|
169
|
+
/** timezone offset for local project time */
|
|
170
|
+
readonly timeZoneOffset: number;
|
|
171
|
+
/** set date for shadow study. If isProjectDate is false the is assume to be in users
|
|
172
|
+
* current time and the value is adjusted to be the same date and time at the project location. */
|
|
173
|
+
setDateAndTime: (day: Date, isProjectDate?: boolean) => void;
|
|
174
|
+
}
|
|
175
175
|
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -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;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,IAAI,CAAC;IACZ,GAAG,EAAE,IAAI,CAAC;CACX;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,4BAA4B;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,qBAAqB;IACrB,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;CACxB;AAED;;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,
|
|
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;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,IAAI,CAAC;IACZ,GAAG,EAA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