@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":"UiIModelComponents.js","sourceRoot":"","sources":["../../../src/imodel-components-react/UiIModelComponents.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"UiIModelComponents.js","sourceRoot":"","sources":["../../../src/imodel-components-react/UiIModelComponents.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;GAGG;AACH,MAAa,kBAAkB;IAG7B;;OAEG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU;QAC5B,IAAI,kBAAkB,CAAC,YAAY,EAAE;YACnC,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE,8CAA8C,CAAC,CAAC;YACtH,OAAO;SACR;QAED,MAAM,SAAS,CAAC,YAAY,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAC;QAE1F,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE;YAC3B,oEAAoE;YACpE,MAAM,YAAY,GAAG,IAAI,iBAAiB,EAAE,CAAC;YAC7C,MAAM,YAAY,CAAC,UAAU,EAAE,CAAC;YAChC,MAAM,YAAY,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;SAC7C;aAAM;YACL,MAAM,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;SACvD;QAED,kBAAkB,CAAC,YAAY,GAAG,IAAI,CAAC;IACzC,CAAC;IAED,gEAAgE;IACzD,MAAM,CAAC,SAAS;QACrB,SAAS,CAAC,YAAY,EAAE,mBAAmB,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAC;QACtF,YAAY,CAAC,SAAS,EAAE,CAAC;QACzB,kBAAkB,CAAC,YAAY,GAAG,KAAK,CAAC;IAC1C,CAAC;IAED,4DAA4D;IACrD,MAAM,KAAK,WAAW,KAAc,OAAO,kBAAkB,CAAC,YAAY,CAAC,CAAC,CAAC;IAEpF,kDAAkD;IAC3C,MAAM,KAAK,qBAAqB;QACrC,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IAED,gBAAgB;IACT,MAAM,KAAK,WAAW;QAC3B,OAAO,yBAAyB,CAAC;IACnC,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,SAAS,CAAC,GAAsB;QAC5C,IAAI,CAAC,kBAAkB,CAAC,WAAW,IAAI,0BAA0B,CAAC,CAAC,SAAS,CAAC,YAAY,EAAE;YACzF,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,+EAA+E,CAAC,CAAC;YAC1I,OAAO,EAAE,CAAC;SACX;QACD,OAAO,SAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,kBAAkB,CAAC,qBAAqB,EAAE,CAAC,CAAC;IAC1G,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,cAAc,CAAC,GAAQ;QACnC,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QACpC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,WAAW,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACrF,OAAO,QAAQ,CAAC;IAClB,CAAC;;AA7Dc,+BAAY,GAAG,KAAK,CAAC;SADzB,kBAAkB","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 Common\r\n */\r\n\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\nimport { getClassName } from \"@itwin/appui-abstract\";\r\nimport { UiComponents } from \"@itwin/components-react\";\r\nimport { EmptyLocalization } from \"@itwin/core-common\";\r\n\r\n/**\r\n * Manages the localization service for the imodel-components-react package.\r\n * @public\r\n */\r\nexport class UiIModelComponents {\r\n private static _initialized = false;\r\n\r\n /**\r\n * initialize UiIModelComponents.\r\n */\r\n public static async initialize(): Promise<void> {\r\n if (UiIModelComponents._initialized) {\r\n Logger.logInfo(UiIModelComponents.loggerCategory(UiIModelComponents), `UiIModelComponents.initialize already called`);\r\n return;\r\n }\r\n\r\n await IModelApp.localization?.registerNamespace(UiIModelComponents.localizationNamespace);\r\n\r\n if (!IModelApp.localization) {\r\n // it should only get here in unit test where IModelApp is not setup\r\n const localization = new EmptyLocalization();\r\n await localization.initialize();\r\n await UiComponents.initialize(localization);\r\n } else {\r\n await UiComponents.initialize(IModelApp.localization);\r\n }\r\n\r\n UiIModelComponents._initialized = true;\r\n }\r\n\r\n /** Unregisters the UiIModelComponents localization namespace */\r\n public static terminate() {\r\n IModelApp.localization?.unregisterNamespace(UiIModelComponents.localizationNamespace);\r\n UiComponents.terminate();\r\n UiIModelComponents._initialized = false;\r\n }\r\n\r\n /** Determines if UiIModelComponents has been initialized */\r\n public static get initialized(): boolean { return UiIModelComponents._initialized; }\r\n\r\n /** The internationalization service namespace. */\r\n public static get localizationNamespace(): string {\r\n return \"UiIModelComponents\";\r\n }\r\n\r\n /** @internal */\r\n public static get packageName(): string {\r\n return \"imodel-components-react\";\r\n }\r\n\r\n /** Calls localization.getLocalizedStringWithNamespace with the \"UiIModelComponents\" namespace. Do NOT include the namespace in the key.\r\n * @internal\r\n */\r\n public static translate(key: string | string[]): string {\r\n if (!UiIModelComponents.initialized || /* istanbul ignore next */ !IModelApp.localization) {\r\n Logger.logError(UiIModelComponents.loggerCategory(this), `translate: IModelApp.localization has not been setup. Returning blank string.`);\r\n return \"\";\r\n }\r\n return IModelApp.localization.getLocalizedString(key, { ns: UiIModelComponents.localizationNamespace });\r\n }\r\n\r\n /** @internal */\r\n public static loggerCategory(obj: any): string {\r\n const className = getClassName(obj);\r\n const category = UiIModelComponents.packageName + (className ? `.${className}` : \"\");\r\n return category;\r\n }\r\n\r\n}\r\n"]}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Color
|
|
3
|
-
*/
|
|
4
|
-
import "./AlphaSlider.scss";
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
import { CommonProps } from "@itwin/core-react";
|
|
7
|
-
/** Properties for the [[AlphaSlider]] React component
|
|
8
|
-
* @beta
|
|
9
|
-
*/
|
|
10
|
-
export interface AlphaSliderProps extends React.HTMLAttributes<HTMLDivElement>, CommonProps {
|
|
11
|
-
/** true if slider is oriented horizontal, else vertical orientation is assumed */
|
|
12
|
-
isHorizontal?: boolean;
|
|
13
|
-
/** function to run when user selects color swatch */
|
|
14
|
-
onAlphaChange?: ((alpha: number) => void) | undefined;
|
|
15
|
-
/** Alpha value between 0 (transparent) and 1 (opaque) */
|
|
16
|
-
alpha: number;
|
|
17
|
-
}
|
|
18
|
-
/** AlphaSlider component used to set the alpha value.
|
|
19
|
-
* @beta
|
|
20
|
-
*/
|
|
21
|
-
export declare class AlphaSlider extends React.PureComponent<AlphaSliderProps> {
|
|
22
|
-
private _container;
|
|
23
|
-
private _transparencyLabel;
|
|
24
|
-
/** @internal */
|
|
25
|
-
constructor(props: AlphaSliderProps);
|
|
26
|
-
private _calculateChange;
|
|
27
|
-
/** @internal */
|
|
28
|
-
componentWillUnmount(): void;
|
|
29
|
-
private _onChange;
|
|
30
|
-
private _onMouseDown;
|
|
31
|
-
private _onKeyDown;
|
|
32
|
-
private _onMouseUp;
|
|
33
|
-
private _unbindEventListeners;
|
|
34
|
-
/** @internal */
|
|
35
|
-
render(): React.ReactNode;
|
|
36
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Color
|
|
3
|
+
*/
|
|
4
|
+
import "./AlphaSlider.scss";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { CommonProps } from "@itwin/core-react";
|
|
7
|
+
/** Properties for the [[AlphaSlider]] React component
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
10
|
+
export interface AlphaSliderProps extends React.HTMLAttributes<HTMLDivElement>, CommonProps {
|
|
11
|
+
/** true if slider is oriented horizontal, else vertical orientation is assumed */
|
|
12
|
+
isHorizontal?: boolean;
|
|
13
|
+
/** function to run when user selects color swatch */
|
|
14
|
+
onAlphaChange?: ((alpha: number) => void) | undefined;
|
|
15
|
+
/** Alpha value between 0 (transparent) and 1 (opaque) */
|
|
16
|
+
alpha: number;
|
|
17
|
+
}
|
|
18
|
+
/** AlphaSlider component used to set the alpha value.
|
|
19
|
+
* @beta
|
|
20
|
+
*/
|
|
21
|
+
export declare class AlphaSlider extends React.PureComponent<AlphaSliderProps> {
|
|
22
|
+
private _container;
|
|
23
|
+
private _transparencyLabel;
|
|
24
|
+
/** @internal */
|
|
25
|
+
constructor(props: AlphaSliderProps);
|
|
26
|
+
private _calculateChange;
|
|
27
|
+
/** @internal */
|
|
28
|
+
componentWillUnmount(): void;
|
|
29
|
+
private _onChange;
|
|
30
|
+
private _onMouseDown;
|
|
31
|
+
private _onKeyDown;
|
|
32
|
+
private _onMouseUp;
|
|
33
|
+
private _unbindEventListeners;
|
|
34
|
+
/** @internal */
|
|
35
|
+
render(): React.ReactNode;
|
|
36
|
+
}
|
|
37
37
|
//# sourceMappingURL=AlphaSlider.d.ts.map
|
|
@@ -1,161 +1,161 @@
|
|
|
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
|
-
/** @packageDocumentation
|
|
6
|
-
* @module Color
|
|
7
|
-
*/
|
|
8
|
-
import "./AlphaSlider.scss";
|
|
9
|
-
import classnames from "classnames";
|
|
10
|
-
import * as React from "react";
|
|
11
|
-
import { UiIModelComponents } from "../UiIModelComponents";
|
|
12
|
-
import { SpecialKey } from "@itwin/appui-abstract";
|
|
13
|
-
/** AlphaSlider component used to set the alpha value.
|
|
14
|
-
* @beta
|
|
15
|
-
*/
|
|
16
|
-
export class AlphaSlider extends React.PureComponent {
|
|
17
|
-
/** @internal */
|
|
18
|
-
constructor(props) {
|
|
19
|
-
super(props);
|
|
20
|
-
this._container = null;
|
|
21
|
-
this._transparencyLabel = UiIModelComponents.translate("color.transparency");
|
|
22
|
-
this._calculateChange = (e, isHorizontal, alpha, container) => {
|
|
23
|
-
e.preventDefault();
|
|
24
|
-
const { width: containerWidth, height: containerHeight } = container.getBoundingClientRect();
|
|
25
|
-
let x = 0;
|
|
26
|
-
if ("pageX" in e) {
|
|
27
|
-
x = e.pageX;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
// istanbul ignore if
|
|
31
|
-
if (undefined === e.touches)
|
|
32
|
-
return undefined;
|
|
33
|
-
x = e.touches[0].pageX;
|
|
34
|
-
}
|
|
35
|
-
// istanbul ignore if
|
|
36
|
-
if (undefined === x)
|
|
37
|
-
return undefined;
|
|
38
|
-
let y = 0;
|
|
39
|
-
if ("pageY" in e) {
|
|
40
|
-
y = e.pageY;
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
// istanbul ignore if
|
|
44
|
-
if (undefined === e.touches)
|
|
45
|
-
return;
|
|
46
|
-
y = e.touches[0].pageY;
|
|
47
|
-
}
|
|
48
|
-
// istanbul ignore if
|
|
49
|
-
if (undefined === y)
|
|
50
|
-
return undefined;
|
|
51
|
-
const left = x - (container.getBoundingClientRect().left + window.scrollX);
|
|
52
|
-
const top = y - (container.getBoundingClientRect().top + window.scrollY);
|
|
53
|
-
let t = 0;
|
|
54
|
-
if (!isHorizontal) {
|
|
55
|
-
// istanbul ignore next
|
|
56
|
-
if (top < 0) {
|
|
57
|
-
t = 1;
|
|
58
|
-
}
|
|
59
|
-
else if (top > containerHeight) {
|
|
60
|
-
t = 0;
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
t = 1 - (top / containerHeight);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
else { // horizontal
|
|
67
|
-
// istanbul ignore next
|
|
68
|
-
if (left < 0) {
|
|
69
|
-
t = 0;
|
|
70
|
-
}
|
|
71
|
-
else if (left > containerWidth) {
|
|
72
|
-
t = 1;
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
t = left / containerWidth;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
// istanbul ignore if
|
|
79
|
-
if (t < 0)
|
|
80
|
-
t = 0;
|
|
81
|
-
// istanbul ignore if
|
|
82
|
-
if (t > 1)
|
|
83
|
-
t = 1;
|
|
84
|
-
// istanbul ignore next
|
|
85
|
-
return (alpha !== t) ? t : undefined;
|
|
86
|
-
};
|
|
87
|
-
this._onChange = (e) => {
|
|
88
|
-
// istanbul ignore else
|
|
89
|
-
if (this._container && this.props.onAlphaChange) {
|
|
90
|
-
const change = this._calculateChange(e, this.props.isHorizontal ? this.props.isHorizontal : false, this.props.alpha, this._container);
|
|
91
|
-
undefined !== change && typeof this.props.onAlphaChange === "function" && this.props.onAlphaChange(change);
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
this._onMouseDown = (e) => {
|
|
95
|
-
this._onChange(e);
|
|
96
|
-
// istanbul ignore else
|
|
97
|
-
if (this._container)
|
|
98
|
-
this._container.focus();
|
|
99
|
-
window.addEventListener("mousemove", this._onChange);
|
|
100
|
-
window.addEventListener("mouseup", this._onMouseUp);
|
|
101
|
-
};
|
|
102
|
-
this._onKeyDown = (evt) => {
|
|
103
|
-
let newTransparency;
|
|
104
|
-
if (evt.key === SpecialKey.ArrowLeft || evt.key === SpecialKey.ArrowDown) {
|
|
105
|
-
newTransparency = this.props.alpha - (evt.ctrlKey ? .1 : .05);
|
|
106
|
-
}
|
|
107
|
-
else if (evt.key === SpecialKey.ArrowRight || evt.key === SpecialKey.ArrowUp) {
|
|
108
|
-
newTransparency = this.props.alpha + (evt.ctrlKey ? .1 : .05);
|
|
109
|
-
}
|
|
110
|
-
else if (evt.key === SpecialKey.PageDown) {
|
|
111
|
-
newTransparency = this.props.alpha - (evt.ctrlKey ? .5 : .25);
|
|
112
|
-
}
|
|
113
|
-
else if (evt.key === SpecialKey.PageUp) {
|
|
114
|
-
newTransparency = this.props.alpha + (evt.ctrlKey ? .5 : .25);
|
|
115
|
-
}
|
|
116
|
-
else if (evt.key === SpecialKey.Home) {
|
|
117
|
-
newTransparency = 0;
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
// istanbul ignore else
|
|
121
|
-
if (evt.key === SpecialKey.End) {
|
|
122
|
-
newTransparency = 1;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
// istanbul ignore else
|
|
126
|
-
if (undefined !== newTransparency) {
|
|
127
|
-
// istanbul ignore if
|
|
128
|
-
if (newTransparency > 1)
|
|
129
|
-
newTransparency = 1;
|
|
130
|
-
// istanbul ignore if
|
|
131
|
-
if (newTransparency < 0)
|
|
132
|
-
newTransparency = 0;
|
|
133
|
-
// istanbul ignore else
|
|
134
|
-
if (this.props.onAlphaChange)
|
|
135
|
-
this.props.onAlphaChange(newTransparency);
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
this._onMouseUp = () => {
|
|
139
|
-
this._unbindEventListeners();
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
/** @internal */
|
|
143
|
-
componentWillUnmount() {
|
|
144
|
-
this._unbindEventListeners();
|
|
145
|
-
}
|
|
146
|
-
_unbindEventListeners() {
|
|
147
|
-
window.removeEventListener("mousemove", this._onChange);
|
|
148
|
-
window.removeEventListener("mouseup", this._onMouseUp);
|
|
149
|
-
}
|
|
150
|
-
/** @internal */
|
|
151
|
-
render() {
|
|
152
|
-
const containerClasses = classnames(this.props.isHorizontal ? "components-alpha-container-horizontal" : "components-alpha-container-vertical", this.props.className);
|
|
153
|
-
const pointerStyle = this.props.isHorizontal ?
|
|
154
|
-
{ left: `${(this.props.alpha * 100)}%` } :
|
|
155
|
-
{ left: `0px`, top: `${-(this.props.alpha * 100) + 100}%` };
|
|
156
|
-
return (React.createElement("div", { className: containerClasses, style: this.props.style, "data-testid": "alpha-container" },
|
|
157
|
-
React.createElement("div", { "data-testid": "alpha-slider", role: "slider", "aria-label": this._transparencyLabel, "aria-valuemin": 0, "aria-valuemax": 1, "aria-valuenow": this.props.alpha, className: "components-alpha-slider", ref: (container) => this._container = container, onMouseDown: this._onMouseDown, onTouchMove: this._onChange, onTouchStart: this._onChange, tabIndex: 0, onKeyDown: this._onKeyDown },
|
|
158
|
-
React.createElement("div", { style: pointerStyle, className: "components-alpha-pointer", "data-testid": "alpha-pointer" }))));
|
|
159
|
-
}
|
|
160
|
-
}
|
|
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
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Color
|
|
7
|
+
*/
|
|
8
|
+
import "./AlphaSlider.scss";
|
|
9
|
+
import classnames from "classnames";
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import { UiIModelComponents } from "../UiIModelComponents";
|
|
12
|
+
import { SpecialKey } from "@itwin/appui-abstract";
|
|
13
|
+
/** AlphaSlider component used to set the alpha value.
|
|
14
|
+
* @beta
|
|
15
|
+
*/
|
|
16
|
+
export class AlphaSlider extends React.PureComponent {
|
|
17
|
+
/** @internal */
|
|
18
|
+
constructor(props) {
|
|
19
|
+
super(props);
|
|
20
|
+
this._container = null;
|
|
21
|
+
this._transparencyLabel = UiIModelComponents.translate("color.transparency");
|
|
22
|
+
this._calculateChange = (e, isHorizontal, alpha, container) => {
|
|
23
|
+
e.preventDefault();
|
|
24
|
+
const { width: containerWidth, height: containerHeight } = container.getBoundingClientRect();
|
|
25
|
+
let x = 0;
|
|
26
|
+
if ("pageX" in e) {
|
|
27
|
+
x = e.pageX;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
// istanbul ignore if
|
|
31
|
+
if (undefined === e.touches)
|
|
32
|
+
return undefined;
|
|
33
|
+
x = e.touches[0].pageX;
|
|
34
|
+
}
|
|
35
|
+
// istanbul ignore if
|
|
36
|
+
if (undefined === x)
|
|
37
|
+
return undefined;
|
|
38
|
+
let y = 0;
|
|
39
|
+
if ("pageY" in e) {
|
|
40
|
+
y = e.pageY;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
// istanbul ignore if
|
|
44
|
+
if (undefined === e.touches)
|
|
45
|
+
return;
|
|
46
|
+
y = e.touches[0].pageY;
|
|
47
|
+
}
|
|
48
|
+
// istanbul ignore if
|
|
49
|
+
if (undefined === y)
|
|
50
|
+
return undefined;
|
|
51
|
+
const left = x - (container.getBoundingClientRect().left + window.scrollX);
|
|
52
|
+
const top = y - (container.getBoundingClientRect().top + window.scrollY);
|
|
53
|
+
let t = 0;
|
|
54
|
+
if (!isHorizontal) {
|
|
55
|
+
// istanbul ignore next
|
|
56
|
+
if (top < 0) {
|
|
57
|
+
t = 1;
|
|
58
|
+
}
|
|
59
|
+
else if (top > containerHeight) {
|
|
60
|
+
t = 0;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
t = 1 - (top / containerHeight);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
else { // horizontal
|
|
67
|
+
// istanbul ignore next
|
|
68
|
+
if (left < 0) {
|
|
69
|
+
t = 0;
|
|
70
|
+
}
|
|
71
|
+
else if (left > containerWidth) {
|
|
72
|
+
t = 1;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
t = left / containerWidth;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
// istanbul ignore if
|
|
79
|
+
if (t < 0)
|
|
80
|
+
t = 0;
|
|
81
|
+
// istanbul ignore if
|
|
82
|
+
if (t > 1)
|
|
83
|
+
t = 1;
|
|
84
|
+
// istanbul ignore next
|
|
85
|
+
return (alpha !== t) ? t : undefined;
|
|
86
|
+
};
|
|
87
|
+
this._onChange = (e) => {
|
|
88
|
+
// istanbul ignore else
|
|
89
|
+
if (this._container && this.props.onAlphaChange) {
|
|
90
|
+
const change = this._calculateChange(e, this.props.isHorizontal ? this.props.isHorizontal : false, this.props.alpha, this._container);
|
|
91
|
+
undefined !== change && typeof this.props.onAlphaChange === "function" && this.props.onAlphaChange(change);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
this._onMouseDown = (e) => {
|
|
95
|
+
this._onChange(e);
|
|
96
|
+
// istanbul ignore else
|
|
97
|
+
if (this._container)
|
|
98
|
+
this._container.focus();
|
|
99
|
+
window.addEventListener("mousemove", this._onChange);
|
|
100
|
+
window.addEventListener("mouseup", this._onMouseUp);
|
|
101
|
+
};
|
|
102
|
+
this._onKeyDown = (evt) => {
|
|
103
|
+
let newTransparency;
|
|
104
|
+
if (evt.key === SpecialKey.ArrowLeft || evt.key === SpecialKey.ArrowDown) {
|
|
105
|
+
newTransparency = this.props.alpha - (evt.ctrlKey ? .1 : .05);
|
|
106
|
+
}
|
|
107
|
+
else if (evt.key === SpecialKey.ArrowRight || evt.key === SpecialKey.ArrowUp) {
|
|
108
|
+
newTransparency = this.props.alpha + (evt.ctrlKey ? .1 : .05);
|
|
109
|
+
}
|
|
110
|
+
else if (evt.key === SpecialKey.PageDown) {
|
|
111
|
+
newTransparency = this.props.alpha - (evt.ctrlKey ? .5 : .25);
|
|
112
|
+
}
|
|
113
|
+
else if (evt.key === SpecialKey.PageUp) {
|
|
114
|
+
newTransparency = this.props.alpha + (evt.ctrlKey ? .5 : .25);
|
|
115
|
+
}
|
|
116
|
+
else if (evt.key === SpecialKey.Home) {
|
|
117
|
+
newTransparency = 0;
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
// istanbul ignore else
|
|
121
|
+
if (evt.key === SpecialKey.End) {
|
|
122
|
+
newTransparency = 1;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// istanbul ignore else
|
|
126
|
+
if (undefined !== newTransparency) {
|
|
127
|
+
// istanbul ignore if
|
|
128
|
+
if (newTransparency > 1)
|
|
129
|
+
newTransparency = 1;
|
|
130
|
+
// istanbul ignore if
|
|
131
|
+
if (newTransparency < 0)
|
|
132
|
+
newTransparency = 0;
|
|
133
|
+
// istanbul ignore else
|
|
134
|
+
if (this.props.onAlphaChange)
|
|
135
|
+
this.props.onAlphaChange(newTransparency);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
this._onMouseUp = () => {
|
|
139
|
+
this._unbindEventListeners();
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/** @internal */
|
|
143
|
+
componentWillUnmount() {
|
|
144
|
+
this._unbindEventListeners();
|
|
145
|
+
}
|
|
146
|
+
_unbindEventListeners() {
|
|
147
|
+
window.removeEventListener("mousemove", this._onChange);
|
|
148
|
+
window.removeEventListener("mouseup", this._onMouseUp);
|
|
149
|
+
}
|
|
150
|
+
/** @internal */
|
|
151
|
+
render() {
|
|
152
|
+
const containerClasses = classnames(this.props.isHorizontal ? "components-alpha-container-horizontal" : "components-alpha-container-vertical", this.props.className);
|
|
153
|
+
const pointerStyle = this.props.isHorizontal ?
|
|
154
|
+
{ left: `${(this.props.alpha * 100)}%` } :
|
|
155
|
+
{ left: `0px`, top: `${-(this.props.alpha * 100) + 100}%` };
|
|
156
|
+
return (React.createElement("div", { className: containerClasses, style: this.props.style, "data-testid": "alpha-container" },
|
|
157
|
+
React.createElement("div", { "data-testid": "alpha-slider", role: "slider", "aria-label": this._transparencyLabel, "aria-valuemin": 0, "aria-valuemax": 1, "aria-valuenow": this.props.alpha, className: "components-alpha-slider", ref: (container) => this._container = container, onMouseDown: this._onMouseDown, onTouchMove: this._onChange, onTouchStart: this._onChange, tabIndex: 0, onKeyDown: this._onKeyDown },
|
|
158
|
+
React.createElement("div", { style: pointerStyle, className: "components-alpha-pointer", "data-testid": "alpha-pointer" }))));
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
161
|
//# sourceMappingURL=AlphaSlider.js.map
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Color
|
|
3
|
-
*/
|
|
4
|
-
import "./ColorPickerButton.scss";
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
import { ColorDef } from "@itwin/core-common";
|
|
7
|
-
import { CommonProps } from "@itwin/core-react";
|
|
8
|
-
/** Properties for the [[ColorPickerButton]] React component
|
|
9
|
-
* @beta
|
|
10
|
-
*/
|
|
11
|
-
export interface ColorPickerProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {
|
|
12
|
-
/** Active color */
|
|
13
|
-
initialColor: ColorDef;
|
|
14
|
-
/** Available colors */
|
|
15
|
-
colorDefs?: ColorDef[];
|
|
16
|
-
/** Function to run when user selects color swatch */
|
|
17
|
-
onColorPick?: ((color: ColorDef) => void) | undefined;
|
|
18
|
-
/** Show swatches as squares unless round is set to true */
|
|
19
|
-
round?: boolean;
|
|
20
|
-
/** Disabled or not */
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
/** Readonly or not */
|
|
23
|
-
readonly?: boolean;
|
|
24
|
-
/** Title to show at top of DropDown */
|
|
25
|
-
dropDownTitle?: string;
|
|
26
|
-
/** Number of columns */
|
|
27
|
-
numColumns?: number;
|
|
28
|
-
/** Provides ability to return reference to HTMLButtonElement */
|
|
29
|
-
ref?: React.Ref<HTMLButtonElement>;
|
|
30
|
-
/** If true show up/down caret next to color */
|
|
31
|
-
showCaret?: boolean;
|
|
32
|
-
}
|
|
33
|
-
/** ColorPickerButton component
|
|
34
|
-
* @note Using forwardRef so the ColorEditor (Type Editor) can access the ref of the button element inside this component.
|
|
35
|
-
* @beta
|
|
36
|
-
*/
|
|
37
|
-
export declare const ColorPickerButton: (props: ColorPickerProps) => JSX.Element | null;
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Color
|
|
3
|
+
*/
|
|
4
|
+
import "./ColorPickerButton.scss";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { ColorDef } from "@itwin/core-common";
|
|
7
|
+
import { CommonProps } from "@itwin/core-react";
|
|
8
|
+
/** Properties for the [[ColorPickerButton]] React component
|
|
9
|
+
* @beta
|
|
10
|
+
*/
|
|
11
|
+
export interface ColorPickerProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {
|
|
12
|
+
/** Active color */
|
|
13
|
+
initialColor: ColorDef;
|
|
14
|
+
/** Available colors */
|
|
15
|
+
colorDefs?: ColorDef[];
|
|
16
|
+
/** Function to run when user selects color swatch */
|
|
17
|
+
onColorPick?: ((color: ColorDef) => void) | undefined;
|
|
18
|
+
/** Show swatches as squares unless round is set to true */
|
|
19
|
+
round?: boolean;
|
|
20
|
+
/** Disabled or not */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** Readonly or not */
|
|
23
|
+
readonly?: boolean;
|
|
24
|
+
/** Title to show at top of DropDown */
|
|
25
|
+
dropDownTitle?: string;
|
|
26
|
+
/** Number of columns */
|
|
27
|
+
numColumns?: number;
|
|
28
|
+
/** Provides ability to return reference to HTMLButtonElement */
|
|
29
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
30
|
+
/** If true show up/down caret next to color */
|
|
31
|
+
showCaret?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** ColorPickerButton component
|
|
34
|
+
* @note Using forwardRef so the ColorEditor (Type Editor) can access the ref of the button element inside this component.
|
|
35
|
+
* @beta
|
|
36
|
+
*/
|
|
37
|
+
export declare const ColorPickerButton: (props: ColorPickerProps) => JSX.Element | null;
|
|
38
38
|
//# sourceMappingURL=ColorPickerButton.d.ts.map
|