@itwin/imodel-components-react 3.4.0-dev.62 → 3.4.0-dev.63
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 +16 -1
- package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts +28 -28
- package/lib/cjs/imodel-components-react/UiIModelComponents.js +79 -79
- 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 +186 -186
- package/lib/cjs/imodel-components-react/color/AlphaSlider.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/AlphaSlider.scss +63 -63
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts +37 -37
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.js +107 -107
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.scss +91 -91
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts +23 -23
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js +74 -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 +145 -145
- package/lib/cjs/imodel-components-react/color/ColorPickerPanel.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerPanel.scss +93 -93
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts +44 -44
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js +137 -137
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.scss +64 -64
- package/lib/cjs/imodel-components-react/color/HueSlider.d.ts +22 -22
- package/lib/cjs/imodel-components-react/color/HueSlider.js +199 -199
- package/lib/cjs/imodel-components-react/color/HueSlider.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/HueSlider.scss +61 -61
- package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts +20 -20
- package/lib/cjs/imodel-components-react/color/SaturationPicker.js +213 -213
- package/lib/cjs/imodel-components-react/color/SaturationPicker.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/SaturationPicker.scss +35 -35
- package/lib/cjs/imodel-components-react/color/Swatch.d.ts +22 -22
- package/lib/cjs/imodel-components-react/color/Swatch.js +60 -60
- package/lib/cjs/imodel-components-react/color/Swatch.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/Swatch.scss +23 -23
- 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/color/getCSSColorFromDef.js.map +1 -1
- package/lib/cjs/imodel-components-react/editors/ColorEditor.d.ts +44 -44
- package/lib/cjs/imodel-components-react/editors/ColorEditor.js +151 -151
- package/lib/cjs/imodel-components-react/editors/ColorEditor.js.map +1 -1
- package/lib/cjs/imodel-components-react/editors/ColorEditor.scss +18 -18
- package/lib/cjs/imodel-components-react/editors/WeightEditor.d.ts +47 -47
- package/lib/cjs/imodel-components-react/editors/WeightEditor.js +160 -160
- package/lib/cjs/imodel-components-react/editors/WeightEditor.js.map +1 -1
- package/lib/cjs/imodel-components-react/editors/WeightEditor.scss +16 -16
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.d.ts +25 -25
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.js +96 -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.js +265 -265
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.scss +107 -107
- package/lib/cjs/imodel-components-react/lineweight/Swatch.d.ts +33 -33
- package/lib/cjs/imodel-components-react/lineweight/Swatch.js +85 -85
- package/lib/cjs/imodel-components-react/lineweight/Swatch.js.map +1 -1
- package/lib/cjs/imodel-components-react/lineweight/Swatch.scss +48 -48
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.d.ts +60 -60
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js +159 -159
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.scss +52 -52
- package/lib/cjs/imodel-components-react/navigationaids/Cube.d.ts +45 -45
- package/lib/cjs/imodel-components-react/navigationaids/Cube.js +127 -127
- package/lib/cjs/imodel-components-react/navigationaids/Cube.js.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/Cube.scss +19 -19
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +174 -174
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js +634 -634
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.scss +180 -180
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +145 -145
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js +647 -647
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.scss +133 -133
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.d.ts +26 -26
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js +99 -99
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.scss +64 -64
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.d.ts +17 -17
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js +53 -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 +83 -83
- 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 +86 -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 +109 -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 +184 -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 +154 -154
- 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 +59 -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 +47 -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 +54 -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 +48 -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 +50 -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 +58 -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 +47 -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 +56 -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 +95 -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 +119 -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.js +143 -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/BaseTimelineDataProvider.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.d.ts +27 -27
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.js +81 -81
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.scss +26 -26
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts +33 -33
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.js +91 -91
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.scss +25 -25
- package/lib/cjs/imodel-components-react/timeline/Scrubber.d.ts +54 -54
- package/lib/cjs/imodel-components-react/timeline/Scrubber.js +191 -191
- package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/Scrubber.scss +106 -106
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts +77 -77
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js +424 -424
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.scss +357 -357
- package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.d.ts +15 -15
- package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js +54 -54
- package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.scss +39 -39
- package/lib/cjs/imodel-components-react/timeline/Timeline.scss +164 -164
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts +133 -133
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js +358 -358
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.scss +163 -163
- package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts +174 -174
- package/lib/cjs/imodel-components-react/timeline/interfaces.js +45 -45
- package/lib/cjs/imodel-components-react/timeline/interfaces.js.map +1 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts +42 -42
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js +274 -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 +101 -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 +75 -75
- 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/AlphaSlider.js.map +1 -1
- package/lib/esm/imodel-components-react/color/AlphaSlider.scss +63 -63
- package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts +37 -37
- package/lib/esm/imodel-components-react/color/ColorPickerButton.js +82 -82
- package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerButton.scss +91 -91
- 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/ColorPickerDialog.js.map +1 -1
- 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/ColorPickerPanel.scss +93 -93
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts +44 -44
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.js +112 -112
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.scss +64 -64
- 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/HueSlider.js.map +1 -1
- package/lib/esm/imodel-components-react/color/HueSlider.scss +61 -61
- 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/SaturationPicker.js.map +1 -1
- package/lib/esm/imodel-components-react/color/SaturationPicker.scss +35 -35
- 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/Swatch.js.map +1 -1
- package/lib/esm/imodel-components-react/color/Swatch.scss +23 -23
- 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/color/getCSSColorFromDef.js.map +1 -1
- 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/ColorEditor.js.map +1 -1
- package/lib/esm/imodel-components-react/editors/ColorEditor.scss +18 -18
- 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/editors/WeightEditor.js.map +1 -1
- package/lib/esm/imodel-components-react/editors/WeightEditor.scss +16 -16
- 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/QuantityInput.js.map +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts +44 -44
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js +240 -240
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.scss +107 -107
- 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/Swatch.js.map +1 -1
- package/lib/esm/imodel-components-react/lineweight/Swatch.scss +48 -48
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.d.ts +60 -60
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js +133 -133
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.scss +52 -52
- 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/Cube.js.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/Cube.scss +19 -19
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.d.ts +174 -174
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js +606 -606
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.scss +180 -180
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts +145 -145
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js +620 -620
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.scss +133 -133
- 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 +64 -64
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js +30 -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 +60 -60
- 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 +63 -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 +83 -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 +110 -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 +158 -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 +131 -131
- package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
- 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/DecimalPrecision.js.map +1 -1
- 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/DecimalSeparator.js.map +1 -1
- 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/FractionPrecision.js.map +1 -1
- 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/ScientificType.js.map +1 -1
- 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/SignOption.js.map +1 -1
- 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/StationSeparatorSelector.js.map +1 -1
- 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/StationSizeSelector.js.map +1 -1
- 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/ThousandsSelector.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts +17 -17
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +69 -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/quantityformat/misc/UnitDescr.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts +52 -52
- package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js +139 -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/BaseTimelineDataProvider.js.map +1 -1
- 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/InlineEdit.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/InlineEdit.scss +26 -26
- package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts +33 -33
- package/lib/esm/imodel-components-react/timeline/PlayerButton.js +64 -64
- package/lib/esm/imodel-components-react/timeline/PlayerButton.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/PlayerButton.scss +25 -25
- 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/Scrubber.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/Scrubber.scss +106 -106
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts +77 -77
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.js +398 -398
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.scss +357 -357
- 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/SpeedTimeline.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/SpeedTimeline.scss +39 -39
- package/lib/esm/imodel-components-react/timeline/Timeline.scss +164 -164
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts +133 -133
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.js +332 -332
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.scss +163 -163
- package/lib/esm/imodel-components-react/timeline/interfaces.d.ts +174 -174
- package/lib/esm/imodel-components-react/timeline/interfaces.js +42 -42
- package/lib/esm/imodel-components-react/timeline/interfaces.js.map +1 -1
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts +42 -42
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.js +251 -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 +95 -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/lib/esm/imodel-components-react.js.map +1 -1
- package/lib/public/locales/en/UiIModelComponents.json +139 -139
- package/package.json +19 -19
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
/** @packageDocumentation
|
|
7
|
-
* @module QuantityFormat
|
|
8
|
-
*/
|
|
9
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
-
if (mod && mod.__esModule) return mod;
|
|
23
|
-
var result = {};
|
|
24
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
-
__setModuleDefault(result, mod);
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.FormatSample = void 0;
|
|
30
|
-
const React = __importStar(require("react"));
|
|
31
|
-
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
32
|
-
const core_react_1 = require("@itwin/core-react");
|
|
33
|
-
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
34
|
-
const UiIModelComponents_1 = require("../UiIModelComponents");
|
|
35
|
-
/** Component to show the persistence value and formatted value given a FormatterSpec.
|
|
36
|
-
* @alpha
|
|
37
|
-
*/
|
|
38
|
-
function FormatSample(props) {
|
|
39
|
-
const { initialMagnitude, formatSpec, hideLabels } = props;
|
|
40
|
-
const initialValue = initialMagnitude !== null && initialMagnitude !== void 0 ? initialMagnitude : 0;
|
|
41
|
-
const [magnitude, setMagnitude] = React.useState(initialValue);
|
|
42
|
-
const [sampleValue, setSampleValue] = React.useState(initialValue.toString());
|
|
43
|
-
React.useEffect(() => {
|
|
44
|
-
const value = initialMagnitude !== null && initialMagnitude !== void 0 ? initialMagnitude : 0;
|
|
45
|
-
setMagnitude(value);
|
|
46
|
-
setSampleValue(value.toString());
|
|
47
|
-
}, [initialMagnitude]);
|
|
48
|
-
const handleOnValueBlur = React.useCallback(() => {
|
|
49
|
-
let newValue = Number.parseFloat(sampleValue);
|
|
50
|
-
if (Number.isNaN(newValue))
|
|
51
|
-
newValue = 0;
|
|
52
|
-
setMagnitude(newValue);
|
|
53
|
-
setSampleValue(newValue.toString());
|
|
54
|
-
}, [sampleValue]);
|
|
55
|
-
const handleOnValueChange = React.useCallback((event) => {
|
|
56
|
-
setSampleValue(event.target.value);
|
|
57
|
-
}, []);
|
|
58
|
-
const handleKeyDown = React.useCallback((e) => {
|
|
59
|
-
// istanbul ignore else
|
|
60
|
-
if (e.key === appui_abstract_1.SpecialKey.Enter) {
|
|
61
|
-
let newValue = Number.parseFloat(sampleValue);
|
|
62
|
-
if (Number.isNaN(newValue))
|
|
63
|
-
newValue = 0;
|
|
64
|
-
setMagnitude(newValue);
|
|
65
|
-
setSampleValue(newValue.toString());
|
|
66
|
-
e.preventDefault();
|
|
67
|
-
}
|
|
68
|
-
}, [sampleValue]);
|
|
69
|
-
const activePersistenceUnitLabel = formatSpec ? formatSpec.persistenceUnit.label : "";
|
|
70
|
-
const formattedValue = formatSpec ? formatSpec.applyFormatting(magnitude) : "";
|
|
71
|
-
const valueLabel = React.useRef(UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.labels.value"));
|
|
72
|
-
const formattedLabel = React.useRef(UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.labels.formatted"));
|
|
73
|
-
return (React.createElement(React.Fragment, null,
|
|
74
|
-
!hideLabels && React.createElement("span", { className: "uicore-label" }, valueLabel.current),
|
|
75
|
-
React.createElement("span", { className: "components-inline" },
|
|
76
|
-
React.createElement(itwinui_react_1.Input, { "data-testid": "format-sample-input", className: "components-quantity-persistence-input", value: sampleValue, onChange: handleOnValueChange, onKeyDown: handleKeyDown, onBlur: handleOnValueBlur, size: "small" }),
|
|
77
|
-
activePersistenceUnitLabel),
|
|
78
|
-
!hideLabels && React.createElement("span", { className: "uicore-label" }, formattedLabel.current),
|
|
79
|
-
React.createElement("span", null,
|
|
80
|
-
hideLabels && (formattedValue.length > 0) && React.createElement(core_react_1.WebFontIcon, { iconName: "icon-progress-forward-2" }),
|
|
81
|
-
React.createElement("span", { "data-testid": "format-sample-formatted", className: "uicore-label components-quantity-formatted-sample" }, formattedValue))));
|
|
82
|
-
}
|
|
83
|
-
exports.FormatSample = FormatSample;
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module QuantityFormat
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.FormatSample = void 0;
|
|
30
|
+
const React = __importStar(require("react"));
|
|
31
|
+
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
32
|
+
const core_react_1 = require("@itwin/core-react");
|
|
33
|
+
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
34
|
+
const UiIModelComponents_1 = require("../UiIModelComponents");
|
|
35
|
+
/** Component to show the persistence value and formatted value given a FormatterSpec.
|
|
36
|
+
* @alpha
|
|
37
|
+
*/
|
|
38
|
+
function FormatSample(props) {
|
|
39
|
+
const { initialMagnitude, formatSpec, hideLabels } = props;
|
|
40
|
+
const initialValue = initialMagnitude !== null && initialMagnitude !== void 0 ? initialMagnitude : 0;
|
|
41
|
+
const [magnitude, setMagnitude] = React.useState(initialValue);
|
|
42
|
+
const [sampleValue, setSampleValue] = React.useState(initialValue.toString());
|
|
43
|
+
React.useEffect(() => {
|
|
44
|
+
const value = initialMagnitude !== null && initialMagnitude !== void 0 ? initialMagnitude : 0;
|
|
45
|
+
setMagnitude(value);
|
|
46
|
+
setSampleValue(value.toString());
|
|
47
|
+
}, [initialMagnitude]);
|
|
48
|
+
const handleOnValueBlur = React.useCallback(() => {
|
|
49
|
+
let newValue = Number.parseFloat(sampleValue);
|
|
50
|
+
if (Number.isNaN(newValue))
|
|
51
|
+
newValue = 0;
|
|
52
|
+
setMagnitude(newValue);
|
|
53
|
+
setSampleValue(newValue.toString());
|
|
54
|
+
}, [sampleValue]);
|
|
55
|
+
const handleOnValueChange = React.useCallback((event) => {
|
|
56
|
+
setSampleValue(event.target.value);
|
|
57
|
+
}, []);
|
|
58
|
+
const handleKeyDown = React.useCallback((e) => {
|
|
59
|
+
// istanbul ignore else
|
|
60
|
+
if (e.key === appui_abstract_1.SpecialKey.Enter) {
|
|
61
|
+
let newValue = Number.parseFloat(sampleValue);
|
|
62
|
+
if (Number.isNaN(newValue))
|
|
63
|
+
newValue = 0;
|
|
64
|
+
setMagnitude(newValue);
|
|
65
|
+
setSampleValue(newValue.toString());
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
}
|
|
68
|
+
}, [sampleValue]);
|
|
69
|
+
const activePersistenceUnitLabel = formatSpec ? formatSpec.persistenceUnit.label : "";
|
|
70
|
+
const formattedValue = formatSpec ? formatSpec.applyFormatting(magnitude) : "";
|
|
71
|
+
const valueLabel = React.useRef(UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.labels.value"));
|
|
72
|
+
const formattedLabel = React.useRef(UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.labels.formatted"));
|
|
73
|
+
return (React.createElement(React.Fragment, null,
|
|
74
|
+
!hideLabels && React.createElement("span", { className: "uicore-label" }, valueLabel.current),
|
|
75
|
+
React.createElement("span", { className: "components-inline" },
|
|
76
|
+
React.createElement(itwinui_react_1.Input, { "data-testid": "format-sample-input", className: "components-quantity-persistence-input", value: sampleValue, onChange: handleOnValueChange, onKeyDown: handleKeyDown, onBlur: handleOnValueBlur, size: "small" }),
|
|
77
|
+
activePersistenceUnitLabel),
|
|
78
|
+
!hideLabels && React.createElement("span", { className: "uicore-label" }, formattedLabel.current),
|
|
79
|
+
React.createElement("span", null,
|
|
80
|
+
hideLabels && (formattedValue.length > 0) && React.createElement(core_react_1.WebFontIcon, { iconName: "icon-progress-forward-2" }),
|
|
81
|
+
React.createElement("span", { "data-testid": "format-sample-formatted", className: "uicore-label components-quantity-formatted-sample" }, formattedValue))));
|
|
82
|
+
}
|
|
83
|
+
exports.FormatSample = FormatSample;
|
|
84
84
|
//# sourceMappingURL=FormatSample.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormatSample.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatSample.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,0DAAmD;AACnD,kDAA6D;AAC7D,wDAA6C;AAC7C,8DAA2D;AAW3D;;GAEG;AACH,SAAgB,YAAY,CAAC,KAAwB;IACnD,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAC3D,MAAM,YAAY,GAAG,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,CAAC,CAAC;IAC3C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAC/D,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;IAE9E,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,KAAK,GAAG,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,CAAC,CAAC;QACpC,YAAY,CAAC,KAAK,CAAC,CAAC;QACpB,cAAc,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnC,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEvB,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAC/C,IAAI,QAAQ,GAAG,MAAM,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AC,CAAC;IAC7F,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,uCAAkB,CAAC,SAAS,CAAC,iCAAiC,CAAC,CAAC,CAAC;IAErG,OAAO,CACL;QACG,CAAC,UAAU,IAAI,8BAAM,SAAS,EAAE,cAAc,IAAG,UAAU,CAAC,OAAO,CAAQ;QAC5E,8BAAM,SAAS,EAAC,mBAAmB;YACjC,oBAAC,qBAAK,mBAAa,qBAAqB,EAAC,SAAS,EAAE,uCAAuC,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,mBAAmB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAC,OAAO,GAAG;YAAC,0BAA0B,CAC1O;QACN,CAAC,UAAU,IAAI,8BAAM,SAAS,EAAE,cAAc,IAAG,cAAc,CAAC,OAAO,CAAQ;QAChF;YACG,UAAU,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,oBAAC,wBAAW,IAAC,QAAQ,EAAC,yBAAyB,GAAG;YAChG,6CAAkB,yBAAyB,EAAC,SAAS,EAAE,mDAAmD,IAAG,cAAc,CAAQ,CAC9H,CACN,CACJ,CAAC;AACJ,CAAC;AAvDD,oCAuDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"FormatSample.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatSample.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,0DAAmD;AACnD,kDAA6D;AAC7D,wDAA6C;AAC7C,8DAA2D;AAW3D;;GAEG;AACH,SAAgB,YAAY,CAAC,KAAwB;IACnD,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAC3D,MAAM,YAAY,GAAG,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GA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yB,GAAG;YAChG,6CAAkB,yBAAyB,EAAC,SAAS,EAAE,mDAAmD,IAAG,cAAc,CAAQ,CAC9H,CACN,CACJ,CAAC;AACJ,CAAC;AAvDD,oCAuDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module QuantityFormat\n */\n\nimport * as React from \"react\";\nimport { FormatterSpec } from \"@itwin/core-quantity\";\nimport { SpecialKey } from \"@itwin/appui-abstract\";\nimport { CommonProps, WebFontIcon } from \"@itwin/core-react\";\nimport { Input } from \"@itwin/itwinui-react\";\nimport { UiIModelComponents } from \"../UiIModelComponents\";\n\n/** Properties of [[FormatSample]] component.\n * @alpha\n */\nexport interface FormatSampleProps extends CommonProps {\n formatSpec?: FormatterSpec;\n initialMagnitude?: number;\n hideLabels?: boolean;\n}\n\n/** Component to show the persistence value and formatted value given a FormatterSpec.\n * @alpha\n */\nexport function FormatSample(props: FormatSampleProps) {\n const { initialMagnitude, formatSpec, hideLabels } = props;\n const initialValue = initialMagnitude ?? 0;\n const [magnitude, setMagnitude] = React.useState(initialValue);\n const [sampleValue, setSampleValue] = React.useState(initialValue.toString());\n\n React.useEffect(() => {\n const value = initialMagnitude ?? 0;\n setMagnitude(value);\n setSampleValue(value.toString());\n }, [initialMagnitude]);\n\n const handleOnValueBlur = React.useCallback(() => {\n let newValue = Number.parseFloat(sampleValue);\n if (Number.isNaN(newValue))\n newValue = 0;\n setMagnitude(newValue);\n setSampleValue(newValue.toString());\n }, [sampleValue]);\n\n const handleOnValueChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setSampleValue(event.target.value);\n }, []);\n\n const handleKeyDown = React.useCallback((e: React.KeyboardEvent<HTMLInputElement>) => {\n // istanbul ignore else\n if (e.key === SpecialKey.Enter) {\n let newValue = Number.parseFloat(sampleValue);\n if (Number.isNaN(newValue))\n newValue = 0;\n setMagnitude(newValue);\n setSampleValue(newValue.toString());\n e.preventDefault();\n }\n }, [sampleValue]);\n\n const activePersistenceUnitLabel = formatSpec ? formatSpec.persistenceUnit.label : \"\";\n const formattedValue = formatSpec ? formatSpec.applyFormatting(magnitude) : \"\";\n\n const valueLabel = React.useRef(UiIModelComponents.translate(\"QuantityFormat.labels.value\"));\n const formattedLabel = React.useRef(UiIModelComponents.translate(\"QuantityFormat.labels.formatted\"));\n\n return (\n <>\n {!hideLabels && <span className={\"uicore-label\"}>{valueLabel.current}</span>}\n <span className=\"components-inline\">\n <Input data-testid=\"format-sample-input\" className={\"components-quantity-persistence-input\"} value={sampleValue} onChange={handleOnValueChange} onKeyDown={handleKeyDown} onBlur={handleOnValueBlur} size=\"small\" />{activePersistenceUnitLabel}\n </span>\n {!hideLabels && <span className={\"uicore-label\"}>{formattedLabel.current}</span>}\n <span>\n {hideLabels && (formattedValue.length > 0) && <WebFontIcon iconName=\"icon-progress-forward-2\" />}\n <span data-testid=\"format-sample-formatted\" className={\"uicore-label components-quantity-formatted-sample\"}>{formattedValue}</span>\n </span>\n </>\n );\n}\n"]}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module QuantityFormat
|
|
3
|
-
*/
|
|
4
|
-
/// <reference types="react" />
|
|
5
|
-
import { CommonProps } from "@itwin/core-react";
|
|
6
|
-
import { FormatProps } from "@itwin/core-quantity";
|
|
7
|
-
/** Properties of [[FormatTypeOptionProps]] component.
|
|
8
|
-
* @alpha
|
|
9
|
-
*/
|
|
10
|
-
export interface FormatTypeOptionProps extends CommonProps {
|
|
11
|
-
formatProps: FormatProps;
|
|
12
|
-
onChange?: (format: FormatProps) => void;
|
|
13
|
-
}
|
|
14
|
-
/** Component to set the Quantity Format type.
|
|
15
|
-
* @alpha
|
|
16
|
-
*/
|
|
17
|
-
export declare function FormatTypeOption(props: FormatTypeOptionProps): JSX.Element;
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module QuantityFormat
|
|
3
|
+
*/
|
|
4
|
+
/// <reference types="react" />
|
|
5
|
+
import { CommonProps } from "@itwin/core-react";
|
|
6
|
+
import { FormatProps } from "@itwin/core-quantity";
|
|
7
|
+
/** Properties of [[FormatTypeOptionProps]] component.
|
|
8
|
+
* @alpha
|
|
9
|
+
*/
|
|
10
|
+
export interface FormatTypeOptionProps extends CommonProps {
|
|
11
|
+
formatProps: FormatProps;
|
|
12
|
+
onChange?: (format: FormatProps) => void;
|
|
13
|
+
}
|
|
14
|
+
/** Component to set the Quantity Format type.
|
|
15
|
+
* @alpha
|
|
16
|
+
*/
|
|
17
|
+
export declare function FormatTypeOption(props: FormatTypeOptionProps): JSX.Element;
|
|
18
18
|
//# sourceMappingURL=FormatType.d.ts.map
|
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
/** @packageDocumentation
|
|
7
|
-
* @module QuantityFormat
|
|
8
|
-
*/
|
|
9
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
-
if (mod && mod.__esModule) return mod;
|
|
23
|
-
var result = {};
|
|
24
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
-
__setModuleDefault(result, mod);
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.FormatTypeOption = void 0;
|
|
30
|
-
const React = __importStar(require("react"));
|
|
31
|
-
const UiIModelComponents_1 = require("../UiIModelComponents");
|
|
32
|
-
const core_quantity_1 = require("@itwin/core-quantity");
|
|
33
|
-
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
34
|
-
/** Component to select the format type.
|
|
35
|
-
* @alpha
|
|
36
|
-
*/
|
|
37
|
-
function FormatTypeSelector(props) {
|
|
38
|
-
const { type, onChange, ...otherProps } = props;
|
|
39
|
-
const formatOptions = React.useRef([
|
|
40
|
-
{ value: core_quantity_1.FormatType.Decimal, label: UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.decimal") },
|
|
41
|
-
{ value: core_quantity_1.FormatType.Scientific, label: UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.scientific") },
|
|
42
|
-
{ value: core_quantity_1.FormatType.Station, label: UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.station") },
|
|
43
|
-
{ value: core_quantity_1.FormatType.Fractional, label: UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.fractional") },
|
|
44
|
-
]);
|
|
45
|
-
const handleOnChange = React.useCallback((newValue) => {
|
|
46
|
-
onChange && onChange(newValue);
|
|
47
|
-
}, [onChange]);
|
|
48
|
-
return (React.createElement(itwinui_react_1.Select, { options: formatOptions.current, value: type, onChange: handleOnChange, size: "small", ...otherProps }));
|
|
49
|
-
}
|
|
50
|
-
/** Component to set the Quantity Format type.
|
|
51
|
-
* @alpha
|
|
52
|
-
*/
|
|
53
|
-
function FormatTypeOption(props) {
|
|
54
|
-
const { formatProps, onChange } = props;
|
|
55
|
-
const handleFormatTypeChange = React.useCallback((newType) => {
|
|
56
|
-
var _a;
|
|
57
|
-
const type = (0, core_quantity_1.formatTypeToString)(newType);
|
|
58
|
-
let precision;
|
|
59
|
-
let stationOffsetSize;
|
|
60
|
-
let scientificType;
|
|
61
|
-
switch (newType) { // type must be decimal, fractional, scientific, or station
|
|
62
|
-
case core_quantity_1.FormatType.Scientific:
|
|
63
|
-
precision = core_quantity_1.DecimalPrecision.Six;
|
|
64
|
-
scientificType = (0, core_quantity_1.scientificTypeToString)(core_quantity_1.ScientificType.Normalized);
|
|
65
|
-
break;
|
|
66
|
-
case core_quantity_1.FormatType.Decimal:
|
|
67
|
-
precision = core_quantity_1.DecimalPrecision.Four;
|
|
68
|
-
break;
|
|
69
|
-
case core_quantity_1.FormatType.Station:
|
|
70
|
-
precision = core_quantity_1.DecimalPrecision.Two;
|
|
71
|
-
stationOffsetSize = ((_a = formatProps.composite) === null || _a === void 0 ? void 0 : _a.units[0].name.toLocaleLowerCase().endsWith("m")) ? 3 : 2;
|
|
72
|
-
break;
|
|
73
|
-
case core_quantity_1.FormatType.Fractional:
|
|
74
|
-
precision = core_quantity_1.FractionalPrecision.Eight;
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
const newFormatProps = { ...formatProps, type, precision, scientificType, stationOffsetSize };
|
|
78
|
-
onChange && onChange(newFormatProps);
|
|
79
|
-
}, [formatProps, onChange]);
|
|
80
|
-
const formatType = (0, core_quantity_1.parseFormatType)(formatProps.type, "format");
|
|
81
|
-
const label = React.useRef(UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.labels.type"));
|
|
82
|
-
return (React.createElement(React.Fragment, null,
|
|
83
|
-
React.createElement("span", { className: "uicore-label.current" }, label.current),
|
|
84
|
-
React.createElement(FormatTypeSelector, { "data-testid": "format-type-selector", type: formatType, onChange: handleFormatTypeChange })));
|
|
85
|
-
}
|
|
86
|
-
exports.FormatTypeOption = FormatTypeOption;
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module QuantityFormat
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.FormatTypeOption = void 0;
|
|
30
|
+
const React = __importStar(require("react"));
|
|
31
|
+
const UiIModelComponents_1 = require("../UiIModelComponents");
|
|
32
|
+
const core_quantity_1 = require("@itwin/core-quantity");
|
|
33
|
+
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
34
|
+
/** Component to select the format type.
|
|
35
|
+
* @alpha
|
|
36
|
+
*/
|
|
37
|
+
function FormatTypeSelector(props) {
|
|
38
|
+
const { type, onChange, ...otherProps } = props;
|
|
39
|
+
const formatOptions = React.useRef([
|
|
40
|
+
{ value: core_quantity_1.FormatType.Decimal, label: UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.decimal") },
|
|
41
|
+
{ value: core_quantity_1.FormatType.Scientific, label: UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.scientific") },
|
|
42
|
+
{ value: core_quantity_1.FormatType.Station, label: UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.station") },
|
|
43
|
+
{ value: core_quantity_1.FormatType.Fractional, label: UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.fractional") },
|
|
44
|
+
]);
|
|
45
|
+
const handleOnChange = React.useCallback((newValue) => {
|
|
46
|
+
onChange && onChange(newValue);
|
|
47
|
+
}, [onChange]);
|
|
48
|
+
return (React.createElement(itwinui_react_1.Select, { options: formatOptions.current, value: type, onChange: handleOnChange, size: "small", ...otherProps }));
|
|
49
|
+
}
|
|
50
|
+
/** Component to set the Quantity Format type.
|
|
51
|
+
* @alpha
|
|
52
|
+
*/
|
|
53
|
+
function FormatTypeOption(props) {
|
|
54
|
+
const { formatProps, onChange } = props;
|
|
55
|
+
const handleFormatTypeChange = React.useCallback((newType) => {
|
|
56
|
+
var _a;
|
|
57
|
+
const type = (0, core_quantity_1.formatTypeToString)(newType);
|
|
58
|
+
let precision;
|
|
59
|
+
let stationOffsetSize;
|
|
60
|
+
let scientificType;
|
|
61
|
+
switch (newType) { // type must be decimal, fractional, scientific, or station
|
|
62
|
+
case core_quantity_1.FormatType.Scientific:
|
|
63
|
+
precision = core_quantity_1.DecimalPrecision.Six;
|
|
64
|
+
scientificType = (0, core_quantity_1.scientificTypeToString)(core_quantity_1.ScientificType.Normalized);
|
|
65
|
+
break;
|
|
66
|
+
case core_quantity_1.FormatType.Decimal:
|
|
67
|
+
precision = core_quantity_1.DecimalPrecision.Four;
|
|
68
|
+
break;
|
|
69
|
+
case core_quantity_1.FormatType.Station:
|
|
70
|
+
precision = core_quantity_1.DecimalPrecision.Two;
|
|
71
|
+
stationOffsetSize = ((_a = formatProps.composite) === null || _a === void 0 ? void 0 : _a.units[0].name.toLocaleLowerCase().endsWith("m")) ? 3 : 2;
|
|
72
|
+
break;
|
|
73
|
+
case core_quantity_1.FormatType.Fractional:
|
|
74
|
+
precision = core_quantity_1.FractionalPrecision.Eight;
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
const newFormatProps = { ...formatProps, type, precision, scientificType, stationOffsetSize };
|
|
78
|
+
onChange && onChange(newFormatProps);
|
|
79
|
+
}, [formatProps, onChange]);
|
|
80
|
+
const formatType = (0, core_quantity_1.parseFormatType)(formatProps.type, "format");
|
|
81
|
+
const label = React.useRef(UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.labels.type"));
|
|
82
|
+
return (React.createElement(React.Fragment, null,
|
|
83
|
+
React.createElement("span", { className: "uicore-label.current" }, label.current),
|
|
84
|
+
React.createElement(FormatTypeSelector, { "data-testid": "format-type-selector", type: formatType, onChange: handleFormatTypeChange })));
|
|
85
|
+
}
|
|
86
|
+
exports.FormatTypeOption = FormatTypeOption;
|
|
87
87
|
//# sourceMappingURL=FormatType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormatType.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatType.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,8DAA2D;AAC3D,wDAE8B;AAC9B,wDAA4D;AAU5D;;GAEG;AACH,SAAS,kBAAkB,CAAC,KAA8B;IACxD,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAChD,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAA6B;QAC7D,EAAE,KAAK,EAAE,0BAAU,CAAC,OAAO,EAAE,KAAK,EAAE,uCAA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BAAc,CAAC,UAAU,CAAC,CAAC;gBACnE,MAAM;YACR,KAAK,0BAAU,CAAC,OAAO;gBACrB,SAAS,GAAG,gCAAgB,CAAC,IAAI,CAAC;gBAClC,MAAM;YACR,KAAK,0BAAU,CAAC,OAAO;gBACrB,SAAS,GAAG,gCAAgB,CAAC,GAAG,CAAC;gBACjC,iBAAiB,GAAG,CAAA,MAAA,WAAW,CAAC,SAAS,0CAAE,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC,GAAG,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACnG,MAAM;YACR,KAAK,0BAAU,CAAC,UAAU;gBACxB,SAAS,GAAG,mCAAmB,CAAC,KAAK,CAAC;gBACtC,MAAM;SACT;QACD,MAAM,cAAc,GAAG,EAAE,GAAG,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,iBAAiB,EAAE,CAAC;QAC9F,QAAQ,IAAI,QAAQ,CAAC,cAAc,CAAC,CAAC;IACvC,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE5B,MAAM,UAAU,GAAG,IAAA,+BAAe,EAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC/D,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,uCAAkB,CAAC,SAAS,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAEvF,OAAO,CACL;QACE,8BAAM,SAAS,EAAE,sBAAsB,IAAG,KAAK,CAAC,OAAO,CAAQ;QAC/D,oBAAC,kBAAkB,mBAAa,sBAAsB,EAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,sBAAsB,GAAI,CAC5G,CACJ,CAAC;AACJ,CAAC;AApCD,4CAoCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"FormatType.js","sourceRoot":"","sources":["../../../../src/imodel-components-react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K,CAAC,MAAM,CAAC,uCAAkB,CAAC,SAAS,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAEvF,OAAO,CACL;QACE,8BAAM,SAAS,EAAE,sBAAsB,IAAG,KAAK,CAAC,OAAO,CAAQ;QAC/D,oBAAC,kBAAkB,mBAAa,sBAAsB,EAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,sBAAsB,GAAI,CAC5G,CACJ,CAAC;AACJ,CAAC;AApCD,4CAoCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module QuantityFormat\n */\n\nimport * as React from \"react\";\nimport { CommonProps } from \"@itwin/core-react\";\nimport { UiIModelComponents } from \"../UiIModelComponents\";\nimport { DecimalPrecision, FormatProps, FormatType, formatTypeToString, FractionalPrecision, parseFormatType,\n ScientificType, scientificTypeToString,\n} from \"@itwin/core-quantity\";\nimport { Select, SelectOption } from \"@itwin/itwinui-react\";\n\n/** Properties of [[FormatTypeSelector]] component.\n * @alpha\n */\ninterface FormatTypeSelectorProps extends CommonProps {\n type: FormatType;\n onChange: (value: FormatType) => void;\n}\n\n/** Component to select the format type.\n * @alpha\n */\nfunction FormatTypeSelector(props: FormatTypeSelectorProps) {\n const { type, onChange, ...otherProps } = props;\n const formatOptions = React.useRef<SelectOption<FormatType>[]>([\n { value: FormatType.Decimal, label: UiIModelComponents.translate(\"QuantityFormat.decimal\") },\n { value: FormatType.Scientific, label: UiIModelComponents.translate(\"QuantityFormat.scientific\") },\n { value: FormatType.Station, label: UiIModelComponents.translate(\"QuantityFormat.station\") },\n { value: FormatType.Fractional, label: UiIModelComponents.translate(\"QuantityFormat.fractional\") },\n ]);\n\n const handleOnChange = React.useCallback((newValue: FormatType) => {\n onChange && onChange(newValue);\n }, [onChange]);\n\n return (\n <Select options={formatOptions.current} value={type} onChange={handleOnChange} size=\"small\" {...otherProps} />\n );\n}\n\n/** Properties of [[FormatTypeOptionProps]] component.\n * @alpha\n */\nexport interface FormatTypeOptionProps extends CommonProps {\n formatProps: FormatProps;\n onChange?: (format: FormatProps) => void;\n}\n\n/** Component to set the Quantity Format type.\n * @alpha\n */\nexport function FormatTypeOption(props: FormatTypeOptionProps) {\n const { formatProps, onChange } = props;\n const handleFormatTypeChange = React.useCallback((newType: FormatType) => {\n const type = formatTypeToString(newType);\n let precision: number | undefined;\n let stationOffsetSize: number | undefined;\n let scientificType: string | undefined;\n switch (newType) { // type must be decimal, fractional, scientific, or station\n case FormatType.Scientific:\n precision = DecimalPrecision.Six;\n scientificType = scientificTypeToString(ScientificType.Normalized);\n break;\n case FormatType.Decimal:\n precision = DecimalPrecision.Four;\n break;\n case FormatType.Station:\n precision = DecimalPrecision.Two;\n stationOffsetSize = formatProps.composite?.units[0].name.toLocaleLowerCase().endsWith(\"m\") ? 3 : 2;\n break;\n case FormatType.Fractional:\n precision = FractionalPrecision.Eight;\n break;\n }\n const newFormatProps = { ...formatProps, type, precision, scientificType, stationOffsetSize };\n onChange && onChange(newFormatProps);\n }, [formatProps, onChange]);\n\n const formatType = parseFormatType(formatProps.type, \"format\");\n const label = React.useRef(UiIModelComponents.translate(\"QuantityFormat.labels.type\"));\n\n return (\n <>\n <span className={\"uicore-label.current\"}>{label.current}</span>\n <FormatTypeSelector data-testid=\"format-type-selector\" type={formatType} onChange={handleFormatTypeChange} />\n </>\n );\n}\n\n"]}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module QuantityFormat
|
|
3
|
-
*/
|
|
4
|
-
/// <reference types="react" />
|
|
5
|
-
import { CommonProps } from "@itwin/core-react";
|
|
6
|
-
import { FormatProps } from "@itwin/core-quantity";
|
|
7
|
-
/** Properties of [[FormatUnitLabel]] component.
|
|
8
|
-
* @alpha
|
|
9
|
-
*/
|
|
10
|
-
export interface FormatUnitLabelProps extends CommonProps {
|
|
11
|
-
formatProps: FormatProps;
|
|
12
|
-
onUnitLabelChange?: (format: FormatProps) => void;
|
|
13
|
-
}
|
|
14
|
-
/** Component to set the label separator definition in a Quantity Format and if it the label is to be displayed.
|
|
15
|
-
* @alpha
|
|
16
|
-
*/
|
|
17
|
-
export declare function FormatUnitLabel(props: FormatUnitLabelProps): JSX.Element;
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module QuantityFormat
|
|
3
|
+
*/
|
|
4
|
+
/// <reference types="react" />
|
|
5
|
+
import { CommonProps } from "@itwin/core-react";
|
|
6
|
+
import { FormatProps } from "@itwin/core-quantity";
|
|
7
|
+
/** Properties of [[FormatUnitLabel]] component.
|
|
8
|
+
* @alpha
|
|
9
|
+
*/
|
|
10
|
+
export interface FormatUnitLabelProps extends CommonProps {
|
|
11
|
+
formatProps: FormatProps;
|
|
12
|
+
onUnitLabelChange?: (format: FormatProps) => void;
|
|
13
|
+
}
|
|
14
|
+
/** Component to set the label separator definition in a Quantity Format and if it the label is to be displayed.
|
|
15
|
+
* @alpha
|
|
16
|
+
*/
|
|
17
|
+
export declare function FormatUnitLabel(props: FormatUnitLabelProps): JSX.Element;
|
|
18
18
|
//# sourceMappingURL=FormatUnitLabel.d.ts.map
|