@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,34 +1,34 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module LineWeight
|
|
3
|
-
*/
|
|
4
|
-
import "./Swatch.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 [[LineWeightSwatch]] React component
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export interface LineWeightSwatchProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {
|
|
12
|
-
/** color specification */
|
|
13
|
-
weight: number;
|
|
14
|
-
/** color specification */
|
|
15
|
-
colorDef?: ColorDef;
|
|
16
|
-
/** hide the weight label */
|
|
17
|
-
hideLabel?: boolean;
|
|
18
|
-
/** Disabled or not */
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
/** Readonly or not */
|
|
21
|
-
readonly?: boolean;
|
|
22
|
-
/** function to run when user selects a line weight swatch */
|
|
23
|
-
onClick?: () => void;
|
|
24
|
-
}
|
|
25
|
-
/** LineWeightSwatch Functional component
|
|
26
|
-
* @public
|
|
27
|
-
*/
|
|
28
|
-
export declare class LineWeightSwatch extends React.PureComponent<LineWeightSwatchProps> {
|
|
29
|
-
/** @internal */
|
|
30
|
-
constructor(props: LineWeightSwatchProps);
|
|
31
|
-
componentDidMount(): void;
|
|
32
|
-
render(): JSX.Element;
|
|
33
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module LineWeight
|
|
3
|
+
*/
|
|
4
|
+
import "./Swatch.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 [[LineWeightSwatch]] React component
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export interface LineWeightSwatchProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {
|
|
12
|
+
/** color specification */
|
|
13
|
+
weight: number;
|
|
14
|
+
/** color specification */
|
|
15
|
+
colorDef?: ColorDef;
|
|
16
|
+
/** hide the weight label */
|
|
17
|
+
hideLabel?: boolean;
|
|
18
|
+
/** Disabled or not */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** Readonly or not */
|
|
21
|
+
readonly?: boolean;
|
|
22
|
+
/** function to run when user selects a line weight swatch */
|
|
23
|
+
onClick?: () => void;
|
|
24
|
+
}
|
|
25
|
+
/** LineWeightSwatch Functional component
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
export declare class LineWeightSwatch extends React.PureComponent<LineWeightSwatchProps> {
|
|
29
|
+
/** @internal */
|
|
30
|
+
constructor(props: LineWeightSwatchProps);
|
|
31
|
+
componentDidMount(): void;
|
|
32
|
+
render(): JSX.Element;
|
|
33
|
+
}
|
|
34
34
|
//# sourceMappingURL=Swatch.d.ts.map
|
|
@@ -1,60 +1,60 @@
|
|
|
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 LineWeight
|
|
7
|
-
*/
|
|
8
|
-
import "./Swatch.scss";
|
|
9
|
-
import classnames from "classnames";
|
|
10
|
-
import * as React from "react";
|
|
11
|
-
import { getCSSColorFromDef } from "../color/getCSSColorFromDef";
|
|
12
|
-
/** LineWeightSwatch Functional component
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
export class LineWeightSwatch extends React.PureComponent {
|
|
16
|
-
/** @internal */
|
|
17
|
-
constructor(props) {
|
|
18
|
-
super(props);
|
|
19
|
-
}
|
|
20
|
-
componentDidMount() {
|
|
21
|
-
// eslint-disable-next-line no-console
|
|
22
|
-
// console.log(`LineWeightSwatchProps.componentDidMount setFocusRef=${this.props.setFocusRef} focusRef=${this.props.focusRef && this.props.focusRef.current ? "set" : "unset"}`);
|
|
23
|
-
}
|
|
24
|
-
render() {
|
|
25
|
-
const { onClick, colorDef, weight, hideLabel, className, // do not pass on color swatch specific props
|
|
26
|
-
// eslint-disable-next-line comma-dangle
|
|
27
|
-
disabled, readonly, ...otherProps // pass-through props
|
|
28
|
-
} = this.props;
|
|
29
|
-
let rgbaString = "";
|
|
30
|
-
if (colorDef) {
|
|
31
|
-
rgbaString = getCSSColorFromDef(colorDef);
|
|
32
|
-
}
|
|
33
|
-
const buttonStyle = colorDef ?
|
|
34
|
-
{
|
|
35
|
-
...this.props.style,
|
|
36
|
-
color: rgbaString,
|
|
37
|
-
} :
|
|
38
|
-
{
|
|
39
|
-
...this.props.style,
|
|
40
|
-
};
|
|
41
|
-
const svgStyle = colorDef ?
|
|
42
|
-
{
|
|
43
|
-
height: `${weight}px`,
|
|
44
|
-
background: rgbaString,
|
|
45
|
-
} :
|
|
46
|
-
{
|
|
47
|
-
height: `${weight}px`,
|
|
48
|
-
};
|
|
49
|
-
const handleClick = (_e) => {
|
|
50
|
-
// istanbul ignore else
|
|
51
|
-
if (onClick)
|
|
52
|
-
onClick();
|
|
53
|
-
};
|
|
54
|
-
const classes = classnames("components-lineweight-swatch", hideLabel && "hide-label", readonly && "readonly", className);
|
|
55
|
-
return (React.createElement("button", { ...otherProps, style: buttonStyle, className: classes, onClick: handleClick, disabled: disabled },
|
|
56
|
-
!hideLabel && React.createElement("span", null, weight.toFixed(0)),
|
|
57
|
-
React.createElement("div", { style: svgStyle })));
|
|
58
|
-
}
|
|
59
|
-
}
|
|
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 LineWeight
|
|
7
|
+
*/
|
|
8
|
+
import "./Swatch.scss";
|
|
9
|
+
import classnames from "classnames";
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import { getCSSColorFromDef } from "../color/getCSSColorFromDef";
|
|
12
|
+
/** LineWeightSwatch Functional component
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export class LineWeightSwatch extends React.PureComponent {
|
|
16
|
+
/** @internal */
|
|
17
|
+
constructor(props) {
|
|
18
|
+
super(props);
|
|
19
|
+
}
|
|
20
|
+
componentDidMount() {
|
|
21
|
+
// eslint-disable-next-line no-console
|
|
22
|
+
// console.log(`LineWeightSwatchProps.componentDidMount setFocusRef=${this.props.setFocusRef} focusRef=${this.props.focusRef && this.props.focusRef.current ? "set" : "unset"}`);
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
const { onClick, colorDef, weight, hideLabel, className, // do not pass on color swatch specific props
|
|
26
|
+
// eslint-disable-next-line comma-dangle
|
|
27
|
+
disabled, readonly, ...otherProps // pass-through props
|
|
28
|
+
} = this.props;
|
|
29
|
+
let rgbaString = "";
|
|
30
|
+
if (colorDef) {
|
|
31
|
+
rgbaString = getCSSColorFromDef(colorDef);
|
|
32
|
+
}
|
|
33
|
+
const buttonStyle = colorDef ?
|
|
34
|
+
{
|
|
35
|
+
...this.props.style,
|
|
36
|
+
color: rgbaString,
|
|
37
|
+
} :
|
|
38
|
+
{
|
|
39
|
+
...this.props.style,
|
|
40
|
+
};
|
|
41
|
+
const svgStyle = colorDef ?
|
|
42
|
+
{
|
|
43
|
+
height: `${weight}px`,
|
|
44
|
+
background: rgbaString,
|
|
45
|
+
} :
|
|
46
|
+
{
|
|
47
|
+
height: `${weight}px`,
|
|
48
|
+
};
|
|
49
|
+
const handleClick = (_e) => {
|
|
50
|
+
// istanbul ignore else
|
|
51
|
+
if (onClick)
|
|
52
|
+
onClick();
|
|
53
|
+
};
|
|
54
|
+
const classes = classnames("components-lineweight-swatch", hideLabel && "hide-label", readonly && "readonly", className);
|
|
55
|
+
return (React.createElement("button", { ...otherProps, style: buttonStyle, className: classes, onClick: handleClick, disabled: disabled },
|
|
56
|
+
!hideLabel && React.createElement("span", null, weight.toFixed(0)),
|
|
57
|
+
React.createElement("div", { style: svgStyle })));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
60
|
//# sourceMappingURL=Swatch.js.map
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module LineWeight
|
|
3
|
-
*/
|
|
4
|
-
import "./WeightPickerButton.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 [[WeightPickerButton]] React component
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export interface WeightPickerProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {
|
|
12
|
-
/** active weight */
|
|
13
|
-
activeWeight: number;
|
|
14
|
-
/** available weights */
|
|
15
|
-
weights: number[];
|
|
16
|
-
/** color specification */
|
|
17
|
-
colorDef?: ColorDef;
|
|
18
|
-
/** function to run when user selects weight swatch */
|
|
19
|
-
onLineWeightPick?: ((weight: number) => void) | undefined;
|
|
20
|
-
/** Disabled or not */
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
/** Readonly or not */
|
|
23
|
-
readonly?: boolean;
|
|
24
|
-
/** hide the weight label */
|
|
25
|
-
hideLabel?: boolean;
|
|
26
|
-
/** Title to show at top of DropDown */
|
|
27
|
-
dropDownTitle?: string;
|
|
28
|
-
}
|
|
29
|
-
/** @internal */
|
|
30
|
-
interface WeightPickerState {
|
|
31
|
-
showPopup: boolean;
|
|
32
|
-
targetElement: HTMLDivElement | null;
|
|
33
|
-
}
|
|
34
|
-
/** WeightPickerButton component
|
|
35
|
-
* @public
|
|
36
|
-
*/
|
|
37
|
-
export declare class WeightPickerButton extends React.PureComponent<WeightPickerProps, WeightPickerState> {
|
|
38
|
-
private _target;
|
|
39
|
-
private _weightsContainer;
|
|
40
|
-
private _focusTarget;
|
|
41
|
-
/** @internal */
|
|
42
|
-
constructor(props: WeightPickerProps);
|
|
43
|
-
setFocus(): void;
|
|
44
|
-
static defaultProps: {
|
|
45
|
-
weights: number[];
|
|
46
|
-
};
|
|
47
|
-
private _togglePopup;
|
|
48
|
-
private _onPopupOpened;
|
|
49
|
-
private _closePopup;
|
|
50
|
-
private _handleWeightPicked;
|
|
51
|
-
componentDidMount(): void;
|
|
52
|
-
private buildIdForWeight;
|
|
53
|
-
private moveFocusInPopup;
|
|
54
|
-
private _handleKeyDown;
|
|
55
|
-
private _setWeightContainer;
|
|
56
|
-
private renderPopup;
|
|
57
|
-
/** @internal */
|
|
58
|
-
render(): JSX.Element;
|
|
59
|
-
}
|
|
60
|
-
export {};
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module LineWeight
|
|
3
|
+
*/
|
|
4
|
+
import "./WeightPickerButton.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 [[WeightPickerButton]] React component
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export interface WeightPickerProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {
|
|
12
|
+
/** active weight */
|
|
13
|
+
activeWeight: number;
|
|
14
|
+
/** available weights */
|
|
15
|
+
weights: number[];
|
|
16
|
+
/** color specification */
|
|
17
|
+
colorDef?: ColorDef;
|
|
18
|
+
/** function to run when user selects weight swatch */
|
|
19
|
+
onLineWeightPick?: ((weight: number) => void) | undefined;
|
|
20
|
+
/** Disabled or not */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** Readonly or not */
|
|
23
|
+
readonly?: boolean;
|
|
24
|
+
/** hide the weight label */
|
|
25
|
+
hideLabel?: boolean;
|
|
26
|
+
/** Title to show at top of DropDown */
|
|
27
|
+
dropDownTitle?: string;
|
|
28
|
+
}
|
|
29
|
+
/** @internal */
|
|
30
|
+
interface WeightPickerState {
|
|
31
|
+
showPopup: boolean;
|
|
32
|
+
targetElement: HTMLDivElement | null;
|
|
33
|
+
}
|
|
34
|
+
/** WeightPickerButton component
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
export declare class WeightPickerButton extends React.PureComponent<WeightPickerProps, WeightPickerState> {
|
|
38
|
+
private _target;
|
|
39
|
+
private _weightsContainer;
|
|
40
|
+
private _focusTarget;
|
|
41
|
+
/** @internal */
|
|
42
|
+
constructor(props: WeightPickerProps);
|
|
43
|
+
setFocus(): void;
|
|
44
|
+
static defaultProps: {
|
|
45
|
+
weights: number[];
|
|
46
|
+
};
|
|
47
|
+
private _togglePopup;
|
|
48
|
+
private _onPopupOpened;
|
|
49
|
+
private _closePopup;
|
|
50
|
+
private _handleWeightPicked;
|
|
51
|
+
componentDidMount(): void;
|
|
52
|
+
private buildIdForWeight;
|
|
53
|
+
private moveFocusInPopup;
|
|
54
|
+
private _handleKeyDown;
|
|
55
|
+
private _setWeightContainer;
|
|
56
|
+
private renderPopup;
|
|
57
|
+
/** @internal */
|
|
58
|
+
render(): JSX.Element;
|
|
59
|
+
}
|
|
60
|
+
export {};
|
|
61
61
|
//# sourceMappingURL=WeightPickerButton.d.ts.map
|
|
@@ -1,134 +1,135 @@
|
|
|
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 LineWeight
|
|
7
|
-
*/
|
|
8
|
-
import "./WeightPickerButton.scss";
|
|
9
|
-
import classnames from "classnames";
|
|
10
|
-
import * as React from "react";
|
|
11
|
-
import { RelativePosition, SpecialKey } from "@itwin/appui-abstract";
|
|
12
|
-
import { ElementResizeObserver, Popup } from "@itwin/core-react";
|
|
13
|
-
import { LineWeightSwatch } from "./Swatch";
|
|
14
|
-
/** WeightPickerButton component
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/** @internal */
|
|
19
|
-
constructor(props) {
|
|
20
|
-
super(props);
|
|
21
|
-
this._target = React.createRef();
|
|
22
|
-
this._weightsContainer = null;
|
|
23
|
-
this._focusTarget = React.createRef(); // weight button that should receive focus after popup is open
|
|
24
|
-
this._togglePopup = () => {
|
|
25
|
-
if (this.props.readonly)
|
|
26
|
-
return;
|
|
27
|
-
this.setState((prevState) => ({ showPopup: !prevState.showPopup }));
|
|
28
|
-
};
|
|
29
|
-
this._onPopupOpened = () => {
|
|
30
|
-
};
|
|
31
|
-
this._closePopup = () => {
|
|
32
|
-
this.setState((_prevState) => ({ showPopup: false }));
|
|
33
|
-
};
|
|
34
|
-
this._handleWeightPicked = (weight) => {
|
|
35
|
-
this._closePopup();
|
|
36
|
-
this.props.onLineWeightPick && this.props.onLineWeightPick(weight);
|
|
37
|
-
};
|
|
38
|
-
this._handleKeyDown = (event) => {
|
|
39
|
-
if (event.key === SpecialKey.Enter) {
|
|
40
|
-
event.preventDefault();
|
|
41
|
-
event.stopPropagation();
|
|
42
|
-
const weightButton = document.activeElement;
|
|
43
|
-
// istanbul ignore else
|
|
44
|
-
if (weightButton.tagName === "BUTTON") {
|
|
45
|
-
try {
|
|
46
|
-
const values = weightButton.id.split("-");
|
|
47
|
-
// istanbul ignore else
|
|
48
|
-
if (values.length) {
|
|
49
|
-
const weight = parseInt(values[values.length - 1], 10);
|
|
50
|
-
// istanbul ignore else
|
|
51
|
-
if (!isNaN(weight)) {
|
|
52
|
-
// istanbul ignore else
|
|
53
|
-
if (this.props.onLineWeightPick)
|
|
54
|
-
this.props.onLineWeightPick(weight);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
catch { }
|
|
59
|
-
}
|
|
60
|
-
this._closePopup();
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
switch (event.key) {
|
|
64
|
-
case SpecialKey.ArrowDown:
|
|
65
|
-
this.moveFocusInPopup(false, event);
|
|
66
|
-
break;
|
|
67
|
-
case SpecialKey.ArrowUp:
|
|
68
|
-
this.moveFocusInPopup(true, event);
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
this._setWeightContainer = (el) => {
|
|
74
|
-
this._weightsContainer = el;
|
|
75
|
-
};
|
|
76
|
-
this.state = { showPopup: false, targetElement: null };
|
|
77
|
-
}
|
|
78
|
-
setFocus() {
|
|
79
|
-
// istanbul ignore next
|
|
80
|
-
this._focusTarget.current && this._focusTarget.current.focus();
|
|
81
|
-
}
|
|
82
|
-
componentDidMount() {
|
|
83
|
-
// eslint-disable-next-line no-console
|
|
84
|
-
// console.log(`WeightPickerButton.componentDidMount focusRef=${this._focusTarget && this._focusTarget.current ? "set" : "unset"}`);
|
|
85
|
-
this.setState({ targetElement: this._target.current });
|
|
86
|
-
}
|
|
87
|
-
buildIdForWeight(weight) {
|
|
88
|
-
return `ui-core-lineweight-${weight}`;
|
|
89
|
-
}
|
|
90
|
-
moveFocusInPopup(moveUp, event) {
|
|
91
|
-
const activeElement = document.activeElement;
|
|
92
|
-
// istanbul ignore else
|
|
93
|
-
if (this._weightsContainer && activeElement && activeElement.tagName === "BUTTON") {
|
|
94
|
-
const values = activeElement.id.split("-");
|
|
95
|
-
// istanbul ignore else
|
|
96
|
-
if (values.length === 4 && values[2] === "lineweight") {
|
|
97
|
-
const weight = parseInt(values[3], 10);
|
|
98
|
-
const foundIndex = this.props.weights.findIndex((val) => val === weight);
|
|
99
|
-
// istanbul ignore next
|
|
100
|
-
if (foundIndex < 0)
|
|
101
|
-
return;
|
|
102
|
-
const nextWeight = moveUp ? (foundIndex <= 0 ? this.props.weights[this.props.weights.length - 1] : this.props.weights[foundIndex - 1]) :
|
|
103
|
-
(foundIndex < this.props.weights.length - 1 ? this.props.weights[foundIndex + 1] : this.props.weights[0]);
|
|
104
|
-
const focusLocation = this._weightsContainer.querySelector(`#${this.buildIdForWeight(nextWeight)}`);
|
|
105
|
-
// istanbul ignore else
|
|
106
|
-
if (focusLocation) {
|
|
107
|
-
focusLocation.focus();
|
|
108
|
-
event.preventDefault();
|
|
109
|
-
event.stopPropagation();
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
renderPopup(title) {
|
|
115
|
-
return (React.createElement("div", { className: "components-weightpicker-popup-container" },
|
|
116
|
-
title && React.createElement("h4", null, title),
|
|
117
|
-
React.createElement("ul", { "data-testid": "components-weightpicker-popup-lines", className: "components-weightpicker-popup-lines", onKeyDown: this._handleKeyDown, ref: this._setWeightContainer }, this.props.weights.map((weight, index) => {
|
|
118
|
-
const classNames = classnames("components-weightpicker-swatch", weight === this.props.activeWeight && "active");
|
|
119
|
-
return (React.createElement(LineWeightSwatch, { className: classNames, key: index, colorDef: this.props.colorDef, id: this.buildIdForWeight(weight), hideLabel: this.props.hideLabel, onClick: this._handleWeightPicked.bind(this, weight), weight: weight }));
|
|
120
|
-
}))));
|
|
121
|
-
}
|
|
122
|
-
/** @internal */
|
|
123
|
-
render() {
|
|
124
|
-
const buttonClassNames = classnames("components-weightpicker-button", this.props.className);
|
|
125
|
-
return (React.createElement(React.Fragment, null,
|
|
126
|
-
React.createElement("div", { ref: this._target, style: this.props.style },
|
|
127
|
-
React.createElement(LineWeightSwatch, { "data-testid": "components-weightpicker-button", className: buttonClassNames, weight: this.props.activeWeight, colorDef: this.props.colorDef, readonly: this.props.readonly, disabled: this.props.disabled, hideLabel: this.props.hideLabel, "aria-haspopup": "listbox", "aria-expanded": this.state.showPopup, onClick: this._togglePopup })),
|
|
128
|
-
React.createElement(ElementResizeObserver, { watchedElement: this.state.targetElement, render: ({ width }) => (React.createElement(Popup, { className: "components-weightpicker-popup", style: { width: `${width}px` }, isOpen: this.state.showPopup, position: RelativePosition.Bottom, offset: 0, showShadow: false, onClose: this._closePopup, onOpen: this._onPopupOpened, focusTarget: `#${this.buildIdForWeight(this.props.activeWeight)}`, moveFocus: true, target: this.state.targetElement, closeOnNestedPopupOutsideClick: true }, this.renderPopup(this.props.dropDownTitle))) })));
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
WeightPickerButton.defaultProps = {
|
|
132
|
-
weights: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
|
133
|
-
};
|
|
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 LineWeight
|
|
7
|
+
*/
|
|
8
|
+
import "./WeightPickerButton.scss";
|
|
9
|
+
import classnames from "classnames";
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import { RelativePosition, SpecialKey } from "@itwin/appui-abstract";
|
|
12
|
+
import { ElementResizeObserver, Popup } from "@itwin/core-react";
|
|
13
|
+
import { LineWeightSwatch } from "./Swatch";
|
|
14
|
+
/** WeightPickerButton component
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
class WeightPickerButton extends React.PureComponent {
|
|
18
|
+
/** @internal */
|
|
19
|
+
constructor(props) {
|
|
20
|
+
super(props);
|
|
21
|
+
this._target = React.createRef();
|
|
22
|
+
this._weightsContainer = null;
|
|
23
|
+
this._focusTarget = React.createRef(); // weight button that should receive focus after popup is open
|
|
24
|
+
this._togglePopup = () => {
|
|
25
|
+
if (this.props.readonly)
|
|
26
|
+
return;
|
|
27
|
+
this.setState((prevState) => ({ showPopup: !prevState.showPopup }));
|
|
28
|
+
};
|
|
29
|
+
this._onPopupOpened = () => {
|
|
30
|
+
};
|
|
31
|
+
this._closePopup = () => {
|
|
32
|
+
this.setState((_prevState) => ({ showPopup: false }));
|
|
33
|
+
};
|
|
34
|
+
this._handleWeightPicked = (weight) => {
|
|
35
|
+
this._closePopup();
|
|
36
|
+
this.props.onLineWeightPick && this.props.onLineWeightPick(weight);
|
|
37
|
+
};
|
|
38
|
+
this._handleKeyDown = (event) => {
|
|
39
|
+
if (event.key === SpecialKey.Enter) {
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
event.stopPropagation();
|
|
42
|
+
const weightButton = document.activeElement;
|
|
43
|
+
// istanbul ignore else
|
|
44
|
+
if (weightButton.tagName === "BUTTON") {
|
|
45
|
+
try {
|
|
46
|
+
const values = weightButton.id.split("-");
|
|
47
|
+
// istanbul ignore else
|
|
48
|
+
if (values.length) {
|
|
49
|
+
const weight = parseInt(values[values.length - 1], 10);
|
|
50
|
+
// istanbul ignore else
|
|
51
|
+
if (!isNaN(weight)) {
|
|
52
|
+
// istanbul ignore else
|
|
53
|
+
if (this.props.onLineWeightPick)
|
|
54
|
+
this.props.onLineWeightPick(weight);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
catch { }
|
|
59
|
+
}
|
|
60
|
+
this._closePopup();
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
switch (event.key) {
|
|
64
|
+
case SpecialKey.ArrowDown:
|
|
65
|
+
this.moveFocusInPopup(false, event);
|
|
66
|
+
break;
|
|
67
|
+
case SpecialKey.ArrowUp:
|
|
68
|
+
this.moveFocusInPopup(true, event);
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
this._setWeightContainer = (el) => {
|
|
74
|
+
this._weightsContainer = el;
|
|
75
|
+
};
|
|
76
|
+
this.state = { showPopup: false, targetElement: null };
|
|
77
|
+
}
|
|
78
|
+
setFocus() {
|
|
79
|
+
// istanbul ignore next
|
|
80
|
+
this._focusTarget.current && this._focusTarget.current.focus();
|
|
81
|
+
}
|
|
82
|
+
componentDidMount() {
|
|
83
|
+
// eslint-disable-next-line no-console
|
|
84
|
+
// console.log(`WeightPickerButton.componentDidMount focusRef=${this._focusTarget && this._focusTarget.current ? "set" : "unset"}`);
|
|
85
|
+
this.setState({ targetElement: this._target.current });
|
|
86
|
+
}
|
|
87
|
+
buildIdForWeight(weight) {
|
|
88
|
+
return `ui-core-lineweight-${weight}`;
|
|
89
|
+
}
|
|
90
|
+
moveFocusInPopup(moveUp, event) {
|
|
91
|
+
const activeElement = document.activeElement;
|
|
92
|
+
// istanbul ignore else
|
|
93
|
+
if (this._weightsContainer && activeElement && activeElement.tagName === "BUTTON") {
|
|
94
|
+
const values = activeElement.id.split("-");
|
|
95
|
+
// istanbul ignore else
|
|
96
|
+
if (values.length === 4 && values[2] === "lineweight") {
|
|
97
|
+
const weight = parseInt(values[3], 10);
|
|
98
|
+
const foundIndex = this.props.weights.findIndex((val) => val === weight);
|
|
99
|
+
// istanbul ignore next
|
|
100
|
+
if (foundIndex < 0)
|
|
101
|
+
return;
|
|
102
|
+
const nextWeight = moveUp ? (foundIndex <= 0 ? this.props.weights[this.props.weights.length - 1] : this.props.weights[foundIndex - 1]) :
|
|
103
|
+
(foundIndex < this.props.weights.length - 1 ? this.props.weights[foundIndex + 1] : this.props.weights[0]);
|
|
104
|
+
const focusLocation = this._weightsContainer.querySelector(`#${this.buildIdForWeight(nextWeight)}`);
|
|
105
|
+
// istanbul ignore else
|
|
106
|
+
if (focusLocation) {
|
|
107
|
+
focusLocation.focus();
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
event.stopPropagation();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
renderPopup(title) {
|
|
115
|
+
return (React.createElement("div", { className: "components-weightpicker-popup-container" },
|
|
116
|
+
title && React.createElement("h4", null, title),
|
|
117
|
+
React.createElement("ul", { "data-testid": "components-weightpicker-popup-lines", className: "components-weightpicker-popup-lines", onKeyDown: this._handleKeyDown, ref: this._setWeightContainer }, this.props.weights.map((weight, index) => {
|
|
118
|
+
const classNames = classnames("components-weightpicker-swatch", weight === this.props.activeWeight && "active");
|
|
119
|
+
return (React.createElement(LineWeightSwatch, { className: classNames, key: index, colorDef: this.props.colorDef, id: this.buildIdForWeight(weight), hideLabel: this.props.hideLabel, onClick: this._handleWeightPicked.bind(this, weight), weight: weight }));
|
|
120
|
+
}))));
|
|
121
|
+
}
|
|
122
|
+
/** @internal */
|
|
123
|
+
render() {
|
|
124
|
+
const buttonClassNames = classnames("components-weightpicker-button", this.props.className);
|
|
125
|
+
return (React.createElement(React.Fragment, null,
|
|
126
|
+
React.createElement("div", { ref: this._target, style: this.props.style },
|
|
127
|
+
React.createElement(LineWeightSwatch, { "data-testid": "components-weightpicker-button", className: buttonClassNames, weight: this.props.activeWeight, colorDef: this.props.colorDef, readonly: this.props.readonly, disabled: this.props.disabled, hideLabel: this.props.hideLabel, "aria-haspopup": "listbox", "aria-expanded": this.state.showPopup, onClick: this._togglePopup })),
|
|
128
|
+
React.createElement(ElementResizeObserver, { watchedElement: this.state.targetElement, render: ({ width }) => (React.createElement(Popup, { className: "components-weightpicker-popup", style: { width: `${width}px` }, isOpen: this.state.showPopup, position: RelativePosition.Bottom, offset: 0, showShadow: false, onClose: this._closePopup, onOpen: this._onPopupOpened, focusTarget: `#${this.buildIdForWeight(this.props.activeWeight)}`, moveFocus: true, target: this.state.targetElement, closeOnNestedPopupOutsideClick: true }, this.renderPopup(this.props.dropDownTitle))) })));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
WeightPickerButton.defaultProps = {
|
|
132
|
+
weights: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
|
133
|
+
};
|
|
134
|
+
export { WeightPickerButton };
|
|
134
135
|
//# sourceMappingURL=WeightPickerButton.js.map
|