@itwin/imodel-components-react 4.1.0 → 4.2.0-dev.1
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 +327 -327
- package/LICENSE.md +9 -9
- package/README.md +11 -11
- package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/UiIModelComponents.js +11 -6
- package/lib/cjs/imodel-components-react/UiIModelComponents.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/AlphaSlider.js +23 -17
- package/lib/cjs/imodel-components-react/color/AlphaSlider.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/AlphaSlider.scss +71 -63
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.js +10 -8
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.scss +90 -90
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js +6 -8
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js +11 -12
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.scss +62 -62
- package/lib/cjs/imodel-components-react/color/HueSlider.d.ts +1 -1
- package/lib/cjs/imodel-components-react/color/HueSlider.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/HueSlider.js +32 -15
- package/lib/cjs/imodel-components-react/color/HueSlider.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/HueSlider.scss +78 -61
- package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts +1 -1
- package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/SaturationPicker.js +14 -11
- package/lib/cjs/imodel-components-react/color/SaturationPicker.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/SaturationPicker.scss +36 -35
- package/lib/cjs/imodel-components-react/color/Swatch.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/Swatch.js +5 -8
- package/lib/cjs/imodel-components-react/color/Swatch.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/Swatch.scss +22 -22
- package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js +3 -3
- package/lib/cjs/imodel-components-react/color/getCSSColorFromDef.js.map +1 -1
- package/lib/cjs/imodel-components-react/editors/ColorEditor.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/editors/ColorEditor.js +17 -9
- 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.map +1 -1
- package/lib/cjs/imodel-components-react/editors/WeightEditor.js +8 -6
- 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 +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.js +18 -12
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.js.map +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js +35 -21
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.scss +106 -106
- package/lib/cjs/imodel-components-react/lineweight/Swatch.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/lineweight/Swatch.js +12 -16
- 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.map +1 -1
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js +14 -10
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
- package/lib/cjs/imodel-components-react/lineweight/WeightPickerButton.scss +51 -51
- package/lib/cjs/imodel-components-react/navigationaids/Cube.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/Cube.js +31 -11
- 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.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js +98 -39
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.scss +178 -178
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js +171 -66
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.scss +135 -135
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js +19 -12
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.scss +59 -59
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js +4 -6
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js +12 -8
- package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.js +31 -10
- package/lib/cjs/imodel-components-react/quantityformat/FormatType.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js +15 -8
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js +34 -22
- package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js +61 -38
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js +8 -7
- package/lib/cjs/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js +55 -16
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js +11 -5
- package/lib/cjs/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js +39 -12
- package/lib/cjs/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js +11 -5
- package/lib/cjs/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js +19 -7
- package/lib/cjs/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +21 -8
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js +11 -5
- package/lib/cjs/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js +13 -6
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +21 -10
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js +30 -13
- package/lib/cjs/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js +15 -7
- package/lib/cjs/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js +11 -9
- package/lib/cjs/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.js +7 -4
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/InlineEdit.scss +27 -27
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.js +3 -3
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/PlayerButton.scss +28 -28
- package/lib/cjs/imodel-components-react/timeline/Scrubber.d.ts +1 -1
- package/lib/cjs/imodel-components-react/timeline/Scrubber.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/Scrubber.js +32 -17
- package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/Scrubber.scss +105 -105
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js +61 -27
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.scss +359 -359
- package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js +4 -5
- package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/SpeedTimeline.scss +40 -40
- package/lib/cjs/imodel-components-react/timeline/Timeline.scss +165 -165
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js +56 -29
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.scss +178 -178
- package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/interfaces.js +3 -3
- package/lib/cjs/imodel-components-react/timeline/interfaces.js.map +1 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts +2 -2
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js +40 -26
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js +5 -4
- package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
- package/lib/cjs/imodel-components-react.js +3 -3
- package/lib/cjs/imodel-components-react.js.map +1 -1
- package/lib/esm/imodel-components-react/UiIModelComponents.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/UiIModelComponents.js +11 -6
- package/lib/esm/imodel-components-react/UiIModelComponents.js.map +1 -1
- package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/AlphaSlider.js +23 -17
- package/lib/esm/imodel-components-react/color/AlphaSlider.js.map +1 -1
- package/lib/esm/imodel-components-react/color/AlphaSlider.scss +71 -63
- package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerButton.js +10 -8
- package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerButton.scss +90 -90
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.js +7 -9
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.js +13 -14
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.scss +62 -62
- package/lib/esm/imodel-components-react/color/HueSlider.d.ts +1 -1
- package/lib/esm/imodel-components-react/color/HueSlider.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/HueSlider.js +32 -15
- package/lib/esm/imodel-components-react/color/HueSlider.js.map +1 -1
- package/lib/esm/imodel-components-react/color/HueSlider.scss +78 -61
- package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts +1 -1
- package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/SaturationPicker.js +14 -11
- package/lib/esm/imodel-components-react/color/SaturationPicker.js.map +1 -1
- package/lib/esm/imodel-components-react/color/SaturationPicker.scss +36 -35
- package/lib/esm/imodel-components-react/color/Swatch.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/Swatch.js +5 -8
- package/lib/esm/imodel-components-react/color/Swatch.js.map +1 -1
- package/lib/esm/imodel-components-react/color/Swatch.scss +22 -22
- package/lib/esm/imodel-components-react/color/getCSSColorFromDef.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js +3 -3
- package/lib/esm/imodel-components-react/color/getCSSColorFromDef.js.map +1 -1
- package/lib/esm/imodel-components-react/editors/ColorEditor.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/editors/ColorEditor.js +18 -10
- 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.map +1 -1
- package/lib/esm/imodel-components-react/editors/WeightEditor.js +10 -8
- 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 +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityInput.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityInput.js +18 -12
- package/lib/esm/imodel-components-react/inputs/QuantityInput.js.map +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js +37 -23
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.scss +106 -106
- package/lib/esm/imodel-components-react/lineweight/Swatch.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/lineweight/Swatch.js +12 -16
- 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.map +1 -1
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js +14 -10
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
- package/lib/esm/imodel-components-react/lineweight/WeightPickerButton.scss +51 -51
- package/lib/esm/imodel-components-react/navigationaids/Cube.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/Cube.js +31 -11
- 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.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js +100 -41
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.scss +178 -178
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js +173 -68
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.scss +135 -135
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js +19 -12
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.scss +59 -59
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js +4 -6
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatSample.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatSample.js +12 -8
- package/lib/esm/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatType.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatType.js +31 -10
- package/lib/esm/imodel-components-react/quantityformat/FormatType.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js +15 -8
- package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatUnits.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js +34 -22
- package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js +61 -38
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js +8 -7
- package/lib/esm/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js +55 -16
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js +11 -5
- package/lib/esm/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js +39 -12
- package/lib/esm/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js +11 -5
- package/lib/esm/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js +19 -7
- package/lib/esm/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js +21 -8
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js +11 -5
- package/lib/esm/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js +13 -6
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +21 -10
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js +30 -13
- package/lib/esm/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js +16 -8
- package/lib/esm/imodel-components-react/timeline/BaseSolarDataProvider.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js +11 -9
- package/lib/esm/imodel-components-react/timeline/BaseTimelineDataProvider.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/InlineEdit.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/InlineEdit.js +7 -4
- package/lib/esm/imodel-components-react/timeline/InlineEdit.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/InlineEdit.scss +27 -27
- package/lib/esm/imodel-components-react/timeline/PlayerButton.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/PlayerButton.js +3 -3
- package/lib/esm/imodel-components-react/timeline/PlayerButton.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/PlayerButton.scss +28 -28
- package/lib/esm/imodel-components-react/timeline/Scrubber.d.ts +1 -1
- package/lib/esm/imodel-components-react/timeline/Scrubber.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/Scrubber.js +32 -17
- package/lib/esm/imodel-components-react/timeline/Scrubber.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/Scrubber.scss +105 -105
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.js +63 -29
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.scss +359 -359
- package/lib/esm/imodel-components-react/timeline/SpeedTimeline.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js +4 -5
- package/lib/esm/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/SpeedTimeline.scss +40 -40
- package/lib/esm/imodel-components-react/timeline/Timeline.scss +165 -165
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.js +58 -31
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.scss +178 -178
- package/lib/esm/imodel-components-react/timeline/interfaces.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/interfaces.js +3 -3
- package/lib/esm/imodel-components-react/timeline/interfaces.js.map +1 -1
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts +2 -2
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.js +42 -28
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
- package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js +5 -4
- package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
- package/lib/esm/imodel-components-react.js +3 -3
- package/lib/esm/imodel-components-react.js.map +1 -1
- package/lib/public/locales/en/UiIModelComponents.json +139 -139
- package/package.json +15 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuantityFormatPanel.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/QuantityFormatPanel.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,8BAA8B,EAAE,8BAA8B,EACpG,+BAA+B,EAAE,gCAAgC,GAClE,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,E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AC,2BAA2B,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACxF,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAErB,OAAO,CACL,6BAAK,SAAS,EAAC,yCAAyC,IACrD,eAAe,IAAI,WAAW;QAC7B,oBAAC,WAAW,IAAC,cAAc,EAAE,qBAAqB,KAAM,UAAU,EAChE,aAAa,EAAE,WAAW,EAC1B,aAAa,EAAE,SAAS,CAAC,iBAAiB,CAAC,aAAa,EACxD,eAAe,EAAE,eAAe,EAChC,sBAAsB,EAAE,sBAAsB,EAC9C,wBAAwB,EAAE,wBAAwB,EAClD,iBAAiB,EAAE,iBAAiB,GACpC,CACA,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module QuantityFormat\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport type {\r\n CustomFormatPropEditorSpec, QuantityTypeArg} from \"@itwin/core-frontend\";\r\nimport { getQuantityTypeKey, IModelApp, isCheckboxFormatPropEditorSpec, isCustomQuantityTypeDefinition,\r\n isTextInputFormatPropEditorSpec, isTextSelectFormatPropEditorSpec,\r\n} from \"@itwin/core-frontend\";\r\nimport type { FormatProps, UnitProps, UnitsProvider } from \"@itwin/core-quantity\";\r\nimport type { CommonProps } from \"@itwin/core-react\";\r\nimport { Checkbox, Input, Select } from \"@itwin/itwinui-react\";\r\nimport { FormatPanel } from \"./FormatPanel\";\r\nimport { DeepCompare } from \"@itwin/core-geometry\";\r\n\r\nfunction createTextInputFormatPropEditor(key: string, label: string, inProps: FormatProps,\r\n getString: (props: FormatProps) => string, setString: (props: FormatProps, value: string) => FormatProps, fireFormatChange: (newProps: FormatProps) => void) {\r\n const value = getString(inProps);\r\n return (\r\n <React.Fragment key={`${key}`}>\r\n <span key={`${key}-label`} className={\"uicore-label\"}>{label}</span>\r\n <Input data-testid={`${key}-editor`} key={`${key}-editor`}\r\n value={value}\r\n size=\"small\"\r\n onChange={(e) => {\r\n const newProps = setString(inProps, e.currentTarget.value);\r\n fireFormatChange(newProps);\r\n }}\r\n />\r\n </React.Fragment>\r\n );\r\n}\r\nfunction createSelectFormatPropEditor(key: string, label: string, options: { label: string, value: string }[], inProps: FormatProps,\r\n getString: (props: FormatProps) => string, setString: (props: FormatProps, value: string) => FormatProps, fireFormatChange: (newProps: FormatProps) => void) {\r\n const value = getString(inProps);\r\n return (\r\n <React.Fragment key={`${key}`}>\r\n <span key={`${key}-label`} className={\"uicore-label\"}>{label}</span>\r\n <Select data-testid={`${key}-editor`} key={`${key}-editor`}\r\n value={value}\r\n options={options}\r\n size={\"small\"}\r\n onChange={(newValue) => {\r\n const newProps = setString(inProps, newValue);\r\n fireFormatChange(newProps);\r\n }}\r\n />\r\n </React.Fragment>\r\n );\r\n}\r\n\r\nfunction createCheckboxFormatPropEditor(key: string, label: string, inProps: FormatProps,\r\n getBool: (props: FormatProps) => boolean, setBool: (props: FormatProps, isChecked: boolean) => FormatProps, fireFormatChange: (newProps: FormatProps) => void) {\r\n const isChecked = getBool(inProps);\r\n return (\r\n <React.Fragment key={`${key}`}>\r\n <span key={`${key}-label`} className={\"uicore-label\"}>{label}</span>\r\n <Checkbox data-testid={`${key}-editor`} key={`${key}-editor`}\r\n checked={isChecked}\r\n onChange={(e) => {\r\n const newProps = setBool(inProps, e.target.checked);\r\n fireFormatChange(newProps);\r\n }} />\r\n </React.Fragment>\r\n );\r\n}\r\n\r\nfunction formatAreEqual(obj1: FormatProps, obj2: FormatProps) {\r\n const compare = new DeepCompare();\r\n return compare.compare(obj1, obj2);\r\n}\r\n\r\n/** Properties of [[QuantityFormatPanel]] component.\r\n * @alpha\r\n */\r\nexport interface QuantityFormatPanelProps extends CommonProps {\r\n quantityType: QuantityTypeArg;\r\n onFormatChange?: (format: FormatProps) => void;\r\n /** props below are to be passed on to FormatPanel */\r\n showSample?: boolean;\r\n initialMagnitude?: number;\r\n enableMinimumProperties?: boolean;\r\n}\r\n\r\n/** Component to set properties that control Quantity Formatting.\r\n * @alpha\r\n */\r\nexport function QuantityFormatPanel(props: QuantityFormatPanelProps) {\r\n const { quantityType, onFormatChange, ...otherProps } = props;\r\n const [formatProps, setFormatProps] = React.useState<FormatProps>();\r\n const initialFormatProps = React.useRef<FormatProps>();\r\n\r\n const [persistenceUnit, setPersistenceUnit] = React.useState<UnitProps>();\r\n\r\n React.useEffect(() => {\r\n const newFormatProps = IModelApp.quantityFormatter.getFormatPropsByQuantityType(quantityType);\r\n // istanbul ignore else\r\n if (!initialFormatProps.current)\r\n initialFormatProps.current = newFormatProps;\r\n setFormatProps(newFormatProps);\r\n const quantityTypeKey = getQuantityTypeKey(quantityType);\r\n const quantityTypeDefinition = IModelApp.quantityFormatter.quantityTypesRegistry.get(quantityTypeKey);\r\n // istanbul ignore else\r\n if (quantityTypeDefinition)\r\n setPersistenceUnit(quantityTypeDefinition.persistenceUnit);\r\n else\r\n throw Error(`Unable to locate a quantity type with type ${quantityType}`);\r\n }, [quantityType]); // no dependencies defined as we want this to run on every render\r\n\r\n // handle case where quantityType does not change but the formatProps for that quantity type has (ie after a Set or Clear)\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n React.useEffect(() => {\r\n const newFormatProps = IModelApp.quantityFormatter.getFormatPropsByQuantityType(quantityType);\r\n // istanbul ignore else\r\n if (initialFormatProps.current && newFormatProps) {\r\n if (!formatAreEqual(newFormatProps, initialFormatProps.current)) {\r\n initialFormatProps.current = newFormatProps;\r\n setFormatProps(newFormatProps);\r\n }\r\n }\r\n }); // no dependencies defined as we want this to run on every render\r\n\r\n const handleOnFormatChanged = React.useCallback(async (newProps: FormatProps) => {\r\n setFormatProps(newProps);\r\n onFormatChange && onFormatChange(newProps);\r\n }, [onFormatChange]);\r\n\r\n const createCustomPropEditors = React.useCallback((specs: CustomFormatPropEditorSpec[], inProps: FormatProps, fireFormatChange: (newProps: FormatProps) => void) => {\r\n return specs.map((spec, index) => {\r\n if (isCheckboxFormatPropEditorSpec(spec))\r\n return createCheckboxFormatPropEditor(`${spec.editorType}-${index}`, spec.label, inProps, spec.getBool, spec.setBool, fireFormatChange);\r\n if (isTextSelectFormatPropEditorSpec(spec))\r\n return createSelectFormatPropEditor(`${spec.editorType}-${index}`, spec.label, spec.selectOptions, inProps, spec.getString, spec.setString, fireFormatChange);\r\n /* istanbul ignore else */\r\n if (isTextInputFormatPropEditorSpec(spec))\r\n return createTextInputFormatPropEditor(`${spec.editorType}-${index}`, spec.label, inProps, spec.getString, spec.setString, fireFormatChange);\r\n /* istanbul ignore next */\r\n return <div key={index} />;\r\n });\r\n }, []);\r\n\r\n const providePrimaryChildren = React.useCallback(\r\n (inProps: FormatProps, fireFormatChange: (newProps: FormatProps) => void) => {\r\n const quantityTypeKey = getQuantityTypeKey(quantityType);\r\n const quantityTypeDefinition = IModelApp.quantityFormatter.quantityTypesRegistry.get(quantityTypeKey);\r\n if (quantityTypeDefinition && isCustomQuantityTypeDefinition(quantityTypeDefinition) &&\r\n quantityTypeDefinition.isCompatibleFormatProps(inProps)) {\r\n // istanbul ignore else\r\n if (quantityTypeDefinition.primaryPropEditorSpecs)\r\n return createCustomPropEditors(quantityTypeDefinition.primaryPropEditorSpecs, inProps, fireFormatChange);\r\n }\r\n return null;\r\n }, [createCustomPropEditors, quantityType]);\r\n\r\n const provideSecondaryChildren = React.useCallback(\r\n (inProps: FormatProps, fireFormatChange: (newProps: FormatProps) => void) => {\r\n const quantityTypeKey = getQuantityTypeKey(quantityType);\r\n const quantityTypeDefinition = IModelApp.quantityFormatter.quantityTypesRegistry.get(quantityTypeKey);\r\n if (quantityTypeDefinition && isCustomQuantityTypeDefinition(quantityTypeDefinition) &&\r\n quantityTypeDefinition.isCompatibleFormatProps(inProps)) {\r\n // istanbul ignore else\r\n if (quantityTypeDefinition.secondaryPropEditorSpecs)\r\n return createCustomPropEditors(quantityTypeDefinition.secondaryPropEditorSpecs, inProps, fireFormatChange);\r\n }\r\n return null;\r\n }, [createCustomPropEditors, quantityType]);\r\n\r\n const provideFormatSpec = React.useCallback(\r\n async (inProps: FormatProps, _persistenceUnit: UnitProps, _unitsProvider: UnitsProvider) => {\r\n return IModelApp.quantityFormatter.generateFormatterSpecByType(quantityType, inProps);\r\n }, [quantityType]);\r\n\r\n return (\r\n <div className=\"components-quantityFormat-quantityPanel\">\r\n {persistenceUnit && formatProps &&\r\n <FormatPanel onFormatChange={handleOnFormatChanged} {...otherProps}\r\n initialFormat={formatProps}\r\n unitsProvider={IModelApp.quantityFormatter.unitsProvider}\r\n persistenceUnit={persistenceUnit}\r\n providePrimaryChildren={providePrimaryChildren}\r\n provideSecondaryChildren={provideSecondaryChildren}\r\n provideFormatSpec={provideFormatSpec}\r\n />}\r\n </div>\r\n );\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"QuantityFormatPanel.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/QuantityFormatPanel.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,8BAA8B,EAC9B,8BAA8B,EAC9B,+BAA+B,EAC/B,gCAAgC,GACjC,MAAM,sBAAsB,CAAC;AAO9B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,SAAS,+BAA+B,CACtC,GAAW,EACX,KAAa,EACb,OAAoB,EACpB,SAAyC,EACzC,SAA6D,EAC7D,gBAAiD;IAEjD,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IACjC,OAAO,CACL,oBAAC,KAAK,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a,EAAE,SAAS,CAAC,iBAAiB,CAAC,aAAa,EACxD,eAAe,EAAE,eAAe,EAChC,sBAAsB,EAAE,sBAAsB,EAC9C,wBAAwB,EAAE,wBAAwB,EAClD,iBAAiB,EAAE,iBAAiB,GACpC,CACH,CACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module QuantityFormat\n */\n\nimport * as React from \"react\";\nimport type {\n CustomFormatPropEditorSpec,\n QuantityTypeArg,\n} from \"@itwin/core-frontend\";\nimport {\n getQuantityTypeKey,\n IModelApp,\n isCheckboxFormatPropEditorSpec,\n isCustomQuantityTypeDefinition,\n isTextInputFormatPropEditorSpec,\n isTextSelectFormatPropEditorSpec,\n} from \"@itwin/core-frontend\";\nimport type {\n FormatProps,\n UnitProps,\n UnitsProvider,\n} from \"@itwin/core-quantity\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Checkbox, Input, Select } from \"@itwin/itwinui-react\";\nimport { FormatPanel } from \"./FormatPanel\";\nimport { DeepCompare } from \"@itwin/core-geometry\";\n\nfunction createTextInputFormatPropEditor(\n key: string,\n label: string,\n inProps: FormatProps,\n getString: (props: FormatProps) => string,\n setString: (props: FormatProps, value: string) => FormatProps,\n fireFormatChange: (newProps: FormatProps) => void\n) {\n const value = getString(inProps);\n return (\n <React.Fragment key={`${key}`}>\n <span key={`${key}-label`} className={\"uicore-label\"}>\n {label}\n </span>\n <Input\n data-testid={`${key}-editor`}\n key={`${key}-editor`}\n value={value}\n size=\"small\"\n onChange={(e) => {\n const newProps = setString(inProps, e.currentTarget.value);\n fireFormatChange(newProps);\n }}\n />\n </React.Fragment>\n );\n}\nfunction createSelectFormatPropEditor(\n key: string,\n label: string,\n options: { label: string; value: string }[],\n inProps: FormatProps,\n getString: (props: FormatProps) => string,\n setString: (props: FormatProps, value: string) => FormatProps,\n fireFormatChange: (newProps: FormatProps) => void\n) {\n const value = getString(inProps);\n return (\n <React.Fragment key={`${key}`}>\n <span key={`${key}-label`} className={\"uicore-label\"}>\n {label}\n </span>\n <Select\n data-testid={`${key}-editor`}\n key={`${key}-editor`}\n value={value}\n options={options}\n size={\"small\"}\n onChange={(newValue) => {\n const newProps = setString(inProps, newValue);\n fireFormatChange(newProps);\n }}\n />\n </React.Fragment>\n );\n}\n\nfunction createCheckboxFormatPropEditor(\n key: string,\n label: string,\n inProps: FormatProps,\n getBool: (props: FormatProps) => boolean,\n setBool: (props: FormatProps, isChecked: boolean) => FormatProps,\n fireFormatChange: (newProps: FormatProps) => void\n) {\n const isChecked = getBool(inProps);\n return (\n <React.Fragment key={`${key}`}>\n <span key={`${key}-label`} className={\"uicore-label\"}>\n {label}\n </span>\n <Checkbox\n data-testid={`${key}-editor`}\n key={`${key}-editor`}\n checked={isChecked}\n onChange={(e) => {\n const newProps = setBool(inProps, e.target.checked);\n fireFormatChange(newProps);\n }}\n />\n </React.Fragment>\n );\n}\n\nfunction formatAreEqual(obj1: FormatProps, obj2: FormatProps) {\n const compare = new DeepCompare();\n return compare.compare(obj1, obj2);\n}\n\n/** Properties of [[QuantityFormatPanel]] component.\n * @alpha\n */\nexport interface QuantityFormatPanelProps extends CommonProps {\n quantityType: QuantityTypeArg;\n onFormatChange?: (format: FormatProps) => void;\n /** props below are to be passed on to FormatPanel */\n showSample?: boolean;\n initialMagnitude?: number;\n enableMinimumProperties?: boolean;\n}\n\n/** Component to set properties that control Quantity Formatting.\n * @alpha\n */\nexport function QuantityFormatPanel(props: QuantityFormatPanelProps) {\n const { quantityType, onFormatChange, ...otherProps } = props;\n const [formatProps, setFormatProps] = React.useState<FormatProps>();\n const initialFormatProps = React.useRef<FormatProps>();\n\n const [persistenceUnit, setPersistenceUnit] = React.useState<UnitProps>();\n\n React.useEffect(() => {\n const newFormatProps =\n IModelApp.quantityFormatter.getFormatPropsByQuantityType(quantityType);\n // istanbul ignore else\n if (!initialFormatProps.current)\n initialFormatProps.current = newFormatProps;\n setFormatProps(newFormatProps);\n const quantityTypeKey = getQuantityTypeKey(quantityType);\n const quantityTypeDefinition =\n IModelApp.quantityFormatter.quantityTypesRegistry.get(quantityTypeKey);\n // istanbul ignore else\n if (quantityTypeDefinition)\n setPersistenceUnit(quantityTypeDefinition.persistenceUnit);\n else\n throw Error(`Unable to locate a quantity type with type ${quantityType}`);\n }, [quantityType]); // no dependencies defined as we want this to run on every render\n\n // handle case where quantityType does not change but the formatProps for that quantity type has (ie after a Set or Clear)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n React.useEffect(() => {\n const newFormatProps =\n IModelApp.quantityFormatter.getFormatPropsByQuantityType(quantityType);\n // istanbul ignore else\n if (initialFormatProps.current && newFormatProps) {\n if (!formatAreEqual(newFormatProps, initialFormatProps.current)) {\n initialFormatProps.current = newFormatProps;\n setFormatProps(newFormatProps);\n }\n }\n }); // no dependencies defined as we want this to run on every render\n\n const handleOnFormatChanged = React.useCallback(\n async (newProps: FormatProps) => {\n setFormatProps(newProps);\n onFormatChange && onFormatChange(newProps);\n },\n [onFormatChange]\n );\n\n const createCustomPropEditors = React.useCallback(\n (\n specs: CustomFormatPropEditorSpec[],\n inProps: FormatProps,\n fireFormatChange: (newProps: FormatProps) => void\n ) => {\n return specs.map((spec, index) => {\n if (isCheckboxFormatPropEditorSpec(spec))\n return createCheckboxFormatPropEditor(\n `${spec.editorType}-${index}`,\n spec.label,\n inProps,\n spec.getBool,\n spec.setBool,\n fireFormatChange\n );\n if (isTextSelectFormatPropEditorSpec(spec))\n return createSelectFormatPropEditor(\n `${spec.editorType}-${index}`,\n spec.label,\n spec.selectOptions,\n inProps,\n spec.getString,\n spec.setString,\n fireFormatChange\n );\n /* istanbul ignore else */\n if (isTextInputFormatPropEditorSpec(spec))\n return createTextInputFormatPropEditor(\n `${spec.editorType}-${index}`,\n spec.label,\n inProps,\n spec.getString,\n spec.setString,\n fireFormatChange\n );\n /* istanbul ignore next */\n return <div key={index} />;\n });\n },\n []\n );\n\n const providePrimaryChildren = React.useCallback(\n (\n inProps: FormatProps,\n fireFormatChange: (newProps: FormatProps) => void\n ) => {\n const quantityTypeKey = getQuantityTypeKey(quantityType);\n const quantityTypeDefinition =\n IModelApp.quantityFormatter.quantityTypesRegistry.get(quantityTypeKey);\n if (\n quantityTypeDefinition &&\n isCustomQuantityTypeDefinition(quantityTypeDefinition) &&\n quantityTypeDefinition.isCompatibleFormatProps(inProps)\n ) {\n // istanbul ignore else\n if (quantityTypeDefinition.primaryPropEditorSpecs)\n return createCustomPropEditors(\n quantityTypeDefinition.primaryPropEditorSpecs,\n inProps,\n fireFormatChange\n );\n }\n return null;\n },\n [createCustomPropEditors, quantityType]\n );\n\n const provideSecondaryChildren = React.useCallback(\n (\n inProps: FormatProps,\n fireFormatChange: (newProps: FormatProps) => void\n ) => {\n const quantityTypeKey = getQuantityTypeKey(quantityType);\n const quantityTypeDefinition =\n IModelApp.quantityFormatter.quantityTypesRegistry.get(quantityTypeKey);\n if (\n quantityTypeDefinition &&\n isCustomQuantityTypeDefinition(quantityTypeDefinition) &&\n quantityTypeDefinition.isCompatibleFormatProps(inProps)\n ) {\n // istanbul ignore else\n if (quantityTypeDefinition.secondaryPropEditorSpecs)\n return createCustomPropEditors(\n quantityTypeDefinition.secondaryPropEditorSpecs,\n inProps,\n fireFormatChange\n );\n }\n return null;\n },\n [createCustomPropEditors, quantityType]\n );\n\n const provideFormatSpec = React.useCallback(\n async (\n inProps: FormatProps,\n _persistenceUnit: UnitProps,\n _unitsProvider: UnitsProvider\n ) => {\n return IModelApp.quantityFormatter.generateFormatterSpecByType(\n quantityType,\n inProps\n );\n },\n [quantityType]\n );\n\n return (\n <div className=\"components-quantityFormat-quantityPanel\">\n {persistenceUnit && formatProps && (\n <FormatPanel\n onFormatChange={handleOnFormatChanged}\n {...otherProps}\n initialFormat={formatProps}\n unitsProvider={IModelApp.quantityFormatter.unitsProvider}\n persistenceUnit={persistenceUnit}\n providePrimaryChildren={providePrimaryChildren}\n provideSecondaryChildren={provideSecondaryChildren}\n provideFormatSpec={provideFormatSpec}\n />\n )}\n </div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecimalPrecision.d.ts","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/DecimalPrecision.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKrD;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,WAAW;IAChE,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,
|
|
1
|
+
{"version":3,"file":"DecimalPrecision.d.ts","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/DecimalPrecision.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKrD;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,WAAW;IAChE,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,eAmG5E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
-
*--------------------------------------------------------------------------------------------*/
|
|
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
5
|
/** @packageDocumentation
|
|
6
6
|
* @module QuantityFormat
|
|
7
7
|
*/
|
|
@@ -15,19 +15,58 @@ import { Select } from "@itwin/itwinui-react";
|
|
|
15
15
|
export function DecimalPrecisionSelector(props) {
|
|
16
16
|
const { precision, onChange, ...otherProps } = props;
|
|
17
17
|
const options = React.useRef([
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
{
|
|
18
|
+
{
|
|
19
|
+
value: 0,
|
|
20
|
+
label: UiIModelComponents.translate("QuantityFormat.decimal_precision.zero"),
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
value: 1,
|
|
24
|
+
label: UiIModelComponents.translate("QuantityFormat.decimal_precision.one"),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
value: 2,
|
|
28
|
+
label: UiIModelComponents.translate("QuantityFormat.decimal_precision.two"),
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
value: 3,
|
|
32
|
+
label: UiIModelComponents.translate("QuantityFormat.decimal_precision.three"),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
value: 4,
|
|
36
|
+
label: UiIModelComponents.translate("QuantityFormat.decimal_precision.four"),
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
value: 5,
|
|
40
|
+
label: UiIModelComponents.translate("QuantityFormat.decimal_precision.five"),
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
value: 6,
|
|
44
|
+
label: UiIModelComponents.translate("QuantityFormat.decimal_precision.six"),
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
value: 7,
|
|
48
|
+
label: UiIModelComponents.translate("QuantityFormat.decimal_precision.seven"),
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
value: 8,
|
|
52
|
+
label: UiIModelComponents.translate("QuantityFormat.decimal_precision.eight"),
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
value: 9,
|
|
56
|
+
label: UiIModelComponents.translate("QuantityFormat.decimal_precision.nine"),
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
value: 10,
|
|
60
|
+
label: UiIModelComponents.translate("QuantityFormat.decimal_precision.ten"),
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
value: 11,
|
|
64
|
+
label: UiIModelComponents.translate("QuantityFormat.decimal_precision.eleven"),
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
value: 12,
|
|
68
|
+
label: UiIModelComponents.translate("QuantityFormat.decimal_precision.twelve"),
|
|
69
|
+
},
|
|
31
70
|
]);
|
|
32
71
|
const handleOnChange = React.useCallback((newValue) => {
|
|
33
72
|
onChange && onChange(newValue);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecimalPrecision.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/DecimalPrecision.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"DecimalPrecision.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/DecimalPrecision.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAU9C;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAoC;IAC3E,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IACrD,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAyB;QACnD;YACE,KAAK,EAAE,CAAC;YACR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E;QACnB,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,OAAO,CACL,oBAAC,MAAM,IACL,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAC,OAAO,KACR,UAAU,GACd,CACH,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module QuantityFormat\n */\n\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { UiIModelComponents } from \"../../UiIModelComponents\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { Select } from \"@itwin/itwinui-react\";\n\n/** Properties of [[DecimalPrecisionSelector]] component.\n * @internal\n */\nexport interface DecimalPrecisionSelectorProps extends CommonProps {\n precision: number;\n onChange: (value: number) => void;\n}\n\n/** Component use to set Decimal Precision\n * the unit label.\n * @internal\n */\nexport function DecimalPrecisionSelector(props: DecimalPrecisionSelectorProps) {\n const { precision, onChange, ...otherProps } = props;\n const options = React.useRef<SelectOption<number>[]>([\n {\n value: 0,\n label: UiIModelComponents.translate(\n \"QuantityFormat.decimal_precision.zero\"\n ),\n },\n {\n value: 1,\n label: UiIModelComponents.translate(\n \"QuantityFormat.decimal_precision.one\"\n ),\n },\n {\n value: 2,\n label: UiIModelComponents.translate(\n \"QuantityFormat.decimal_precision.two\"\n ),\n },\n {\n value: 3,\n label: UiIModelComponents.translate(\n \"QuantityFormat.decimal_precision.three\"\n ),\n },\n {\n value: 4,\n label: UiIModelComponents.translate(\n \"QuantityFormat.decimal_precision.four\"\n ),\n },\n {\n value: 5,\n label: UiIModelComponents.translate(\n \"QuantityFormat.decimal_precision.five\"\n ),\n },\n {\n value: 6,\n label: UiIModelComponents.translate(\n \"QuantityFormat.decimal_precision.six\"\n ),\n },\n {\n value: 7,\n label: UiIModelComponents.translate(\n \"QuantityFormat.decimal_precision.seven\"\n ),\n },\n {\n value: 8,\n label: UiIModelComponents.translate(\n \"QuantityFormat.decimal_precision.eight\"\n ),\n },\n {\n value: 9,\n label: UiIModelComponents.translate(\n \"QuantityFormat.decimal_precision.nine\"\n ),\n },\n {\n value: 10,\n label: UiIModelComponents.translate(\n \"QuantityFormat.decimal_precision.ten\"\n ),\n },\n {\n value: 11,\n label: UiIModelComponents.translate(\n \"QuantityFormat.decimal_precision.eleven\"\n ),\n },\n {\n value: 12,\n label: UiIModelComponents.translate(\n \"QuantityFormat.decimal_precision.twelve\"\n ),\n },\n ]);\n\n const handleOnChange = React.useCallback(\n (newValue: number) => {\n onChange && onChange(newValue);\n },\n [onChange]\n );\n\n return (\n <Select\n options={options.current}\n value={precision}\n onChange={handleOnChange}\n size=\"small\"\n {...otherProps}\n />\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecimalSeparator.d.ts","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/DecimalSeparator.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKrD;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,WAAW;IAChE,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,
|
|
1
|
+
{"version":3,"file":"DecimalSeparator.d.ts","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/DecimalSeparator.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKrD;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,WAAW;IAChE,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,eAiC5E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
-
*--------------------------------------------------------------------------------------------*/
|
|
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
5
|
/** @packageDocumentation
|
|
6
6
|
* @module QuantityFormat
|
|
7
7
|
*/
|
|
@@ -14,8 +14,14 @@ import { Select } from "@itwin/itwinui-react";
|
|
|
14
14
|
export function DecimalSeparatorSelector(props) {
|
|
15
15
|
const { separator, onChange, ...otherProps } = props;
|
|
16
16
|
const options = React.useRef([
|
|
17
|
-
{
|
|
18
|
-
|
|
17
|
+
{
|
|
18
|
+
value: ".",
|
|
19
|
+
label: UiIModelComponents.translate("QuantityFormat.decimal_separator.point"),
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
value: ",",
|
|
23
|
+
label: UiIModelComponents.translate("QuantityFormat.decimal_separator.comma"),
|
|
24
|
+
},
|
|
19
25
|
]);
|
|
20
26
|
const handleOnChange = React.useCallback((newValue) => {
|
|
21
27
|
onChange && onChange(newValue);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecimalSeparator.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/DecimalSeparator.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"DecimalSeparator.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/DecimalSeparator.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAW9C;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAoC;IAC3E,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IACrD,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAyB;QACnD;YACE,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,kBAAkB,CAAC,SAAS,CACjC,wCAAwC,CACzC;SACF;QACD;YACE,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,kBAAkB,CAAC,SAAS,CACjC,wCAAwC,CACzC;SACF;KACF,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CACtC,CAAC,QAAgB,EAAE,EAAE;QACnB,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,OAAO,CACL,oBAAC,MAAM,IACL,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAC,OAAO,KACR,UAAU,GACd,CACH,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module QuantityFormat\n */\n\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { UiIModelComponents } from \"../../UiIModelComponents\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { Select } from \"@itwin/itwinui-react\";\n\n/** Properties of [[DecimalSeparatorSelector]] component.\n * @internal\n */\nexport interface DecimalSeparatorSelectorProps extends CommonProps {\n separator: string;\n disabled?: boolean;\n onChange: (value: string) => void;\n}\n\n/** Component use to set Decimal Separator\n * @internal\n */\nexport function DecimalSeparatorSelector(props: DecimalSeparatorSelectorProps) {\n const { separator, onChange, ...otherProps } = props;\n const options = React.useRef<SelectOption<string>[]>([\n {\n value: \".\",\n label: UiIModelComponents.translate(\n \"QuantityFormat.decimal_separator.point\"\n ),\n },\n {\n value: \",\",\n label: UiIModelComponents.translate(\n \"QuantityFormat.decimal_separator.comma\"\n ),\n },\n ]);\n\n const handleOnChange = React.useCallback(\n (newValue: string) => {\n onChange && onChange(newValue);\n },\n [onChange]\n );\n\n return (\n <Select\n options={options.current}\n value={separator}\n onChange={handleOnChange}\n size=\"small\"\n {...otherProps}\n />\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FractionPrecision.d.ts","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/FractionPrecision.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKrD;;GAEG;AACH,MAAM,WAAW,8BAA+B,SAAQ,WAAW;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;GAEG;AACH,wBAAgB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"FractionPrecision.d.ts","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/FractionPrecision.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKrD;;GAEG;AACH,MAAM,WAAW,8BAA+B,SAAQ,WAAW;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,8BAA8B,eA4EtC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
-
*--------------------------------------------------------------------------------------------*/
|
|
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
5
|
/** @packageDocumentation
|
|
6
6
|
* @module QuantityFormat
|
|
7
7
|
*/
|
|
@@ -14,15 +14,42 @@ import { Select } from "@itwin/itwinui-react";
|
|
|
14
14
|
export function FractionPrecisionSelector(props) {
|
|
15
15
|
const { precision, onChange, ...otherProps } = props;
|
|
16
16
|
const options = React.useRef([
|
|
17
|
-
{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
{
|
|
17
|
+
{
|
|
18
|
+
value: 1,
|
|
19
|
+
label: UiIModelComponents.translate("QuantityFormat.fraction_precision.whole"),
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
value: 2,
|
|
23
|
+
label: UiIModelComponents.translate("QuantityFormat.fraction_precision.half"),
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
value: 4,
|
|
27
|
+
label: UiIModelComponents.translate("QuantityFormat.fraction_precision.quarter"),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: 8,
|
|
31
|
+
label: UiIModelComponents.translate("QuantityFormat.fraction_precision.eighth"),
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
value: 16,
|
|
35
|
+
label: UiIModelComponents.translate("QuantityFormat.fraction_precision.sixteenth"),
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
value: 32,
|
|
39
|
+
label: UiIModelComponents.translate("QuantityFormat.fraction_precision.over32"),
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
value: 64,
|
|
43
|
+
label: UiIModelComponents.translate("QuantityFormat.fraction_precision.over64"),
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
value: 128,
|
|
47
|
+
label: UiIModelComponents.translate("QuantityFormat.fraction_precision.over128"),
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: 256,
|
|
51
|
+
label: UiIModelComponents.translate("QuantityFormat.fraction_precision.over256"),
|
|
52
|
+
},
|
|
26
53
|
]);
|
|
27
54
|
const handleOnChange = React.useCallback((newValue) => {
|
|
28
55
|
onChange && onChange(newValue);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FractionPrecision.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/FractionPrecision.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"FractionPrecision.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/FractionPrecision.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAU9C;;GAEG;AACH,MAAM,UAAU,yBAAyB,CACvC,KAAqC;IAErC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IACrD,MAAM,OAAO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*---------------------------------------------------------------------------------------------\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 type { CommonProps } from \"@itwin/core-react\";\nimport { UiIModelComponents } from \"../../UiIModelComponents\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { Select } from \"@itwin/itwinui-react\";\n\n/** Properties of [[FractionPrecisionSelector]] component.\n * @internal\n */\nexport interface FractionPrecisionSelectorProps extends CommonProps {\n precision: number;\n onChange: (value: number) => void;\n}\n\n/** Component use to set Fraction precision\n * @internal\n */\nexport function FractionPrecisionSelector(\n props: FractionPrecisionSelectorProps\n) {\n const { precision, onChange, ...otherProps } = props;\n const options = React.useRef<SelectOption<number>[]>([\n {\n value: 1,\n label: UiIModelComponents.translate(\n \"QuantityFormat.fraction_precision.whole\"\n ),\n },\n {\n value: 2,\n label: UiIModelComponents.translate(\n \"QuantityFormat.fraction_precision.half\"\n ),\n },\n {\n value: 4,\n label: UiIModelComponents.translate(\n \"QuantityFormat.fraction_precision.quarter\"\n ),\n },\n {\n value: 8,\n label: UiIModelComponents.translate(\n \"QuantityFormat.fraction_precision.eighth\"\n ),\n },\n {\n value: 16,\n label: UiIModelComponents.translate(\n \"QuantityFormat.fraction_precision.sixteenth\"\n ),\n },\n {\n value: 32,\n label: UiIModelComponents.translate(\n \"QuantityFormat.fraction_precision.over32\"\n ),\n },\n {\n value: 64,\n label: UiIModelComponents.translate(\n \"QuantityFormat.fraction_precision.over64\"\n ),\n },\n {\n value: 128,\n label: UiIModelComponents.translate(\n \"QuantityFormat.fraction_precision.over128\"\n ),\n },\n {\n value: 256,\n label: UiIModelComponents.translate(\n \"QuantityFormat.fraction_precision.over256\"\n ),\n },\n ]);\n\n const handleOnChange = React.useCallback(\n (newValue: number) => {\n onChange && onChange(newValue);\n },\n [onChange]\n );\n\n return (\n <Select\n options={options.current}\n value={precision}\n onChange={handleOnChange}\n size=\"small\"\n {...otherProps}\n />\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScientificType.d.ts","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/ScientificType.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,WAAW;IAC9D,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,
|
|
1
|
+
{"version":3,"file":"ScientificType.d.ts","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/ScientificType.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,WAAW;IAC9D,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,eAiCxE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
-
*--------------------------------------------------------------------------------------------*/
|
|
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
5
|
/** @packageDocumentation
|
|
6
6
|
* @module QuantityFormat
|
|
7
7
|
*/
|
|
@@ -15,8 +15,14 @@ import { Select } from "@itwin/itwinui-react";
|
|
|
15
15
|
export function ScientificTypeSelector(props) {
|
|
16
16
|
const { type, onChange, ...otherProps } = props;
|
|
17
17
|
const formatOptions = React.useRef([
|
|
18
|
-
{
|
|
19
|
-
|
|
18
|
+
{
|
|
19
|
+
value: ScientificType.Normalized,
|
|
20
|
+
label: UiIModelComponents.translate("QuantityFormat.scientific-type.normalized"),
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
value: ScientificType.ZeroNormalized,
|
|
24
|
+
label: UiIModelComponents.translate("QuantityFormat.scientific-type.zero-normalized"),
|
|
25
|
+
},
|
|
20
26
|
]);
|
|
21
27
|
const handleOnChange = React.useCallback((newValue) => {
|
|
22
28
|
onChange && onChange(newValue);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScientificType.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/ScientificType.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ScientificType.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/ScientificType.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAW9C;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAkC;IACvE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAChD,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAiC;QACjE;YACE,KAAK,EAAE,cAAc,CAAC,UAAU;YAChC,KAAK,EAAE,kBAAkB,CAAC,SAAS,CACjC,2CAA2C,CAC5C;SACF;QACD;YACE,KAAK,EAAE,cAAc,CAAC,cAAc;YACpC,KAAK,EAAE,kBAAkB,CAAC,SAAS,CACjC,gDAAgD,CACjD;SACF;KACF,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CACtC,CAAC,QAAwB,EAAE,EAAE;QAC3B,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,OAAO,CACL,oBAAC,MAAM,IACL,OAAO,EAAE,aAAa,CAAC,OAAO,EAC9B,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAC,OAAO,KACR,UAAU,GACd,CACH,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module QuantityFormat\n */\n\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { UiIModelComponents } from \"../../UiIModelComponents\";\nimport { ScientificType } from \"@itwin/core-quantity\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { Select } from \"@itwin/itwinui-react\";\n\n/** Properties of [[ScientificTypeSelector]] component.\n * @internal\n */\nexport interface ScientificTypeSelectorProps extends CommonProps {\n type: ScientificType;\n onChange: (value: ScientificType) => void;\n disabled?: boolean;\n}\n\n/** Component use to set Scientific type.\n * @internal\n */\nexport function ScientificTypeSelector(props: ScientificTypeSelectorProps) {\n const { type, onChange, ...otherProps } = props;\n const formatOptions = React.useRef<SelectOption<ScientificType>[]>([\n {\n value: ScientificType.Normalized,\n label: UiIModelComponents.translate(\n \"QuantityFormat.scientific-type.normalized\"\n ),\n },\n {\n value: ScientificType.ZeroNormalized,\n label: UiIModelComponents.translate(\n \"QuantityFormat.scientific-type.zero-normalized\"\n ),\n },\n ]);\n\n const handleOnChange = React.useCallback(\n (newValue: ScientificType) => {\n onChange && onChange(newValue);\n },\n [onChange]\n );\n\n return (\n <Select\n options={formatOptions.current}\n value={type}\n onChange={handleOnChange}\n size=\"small\"\n {...otherProps}\n />\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignOption.d.ts","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/SignOption.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,WAAW;IAC1D,UAAU,EAAE,cAAc,CAAC;IAC3B,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;CAC3C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,
|
|
1
|
+
{"version":3,"file":"SignOption.d.ts","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/SignOption.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,WAAW;IAC1D,UAAU,EAAE,cAAc,CAAC;IAC3B,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;CAC3C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,eA2ChE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
-
*--------------------------------------------------------------------------------------------*/
|
|
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
5
|
/** @packageDocumentation
|
|
6
6
|
* @module QuantityFormat
|
|
7
7
|
*/
|
|
@@ -15,10 +15,22 @@ import { Select } from "@itwin/itwinui-react";
|
|
|
15
15
|
export function SignOptionSelector(props) {
|
|
16
16
|
const { signOption, onChange, ...otherProps } = props;
|
|
17
17
|
const options = React.useRef([
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
{
|
|
19
|
+
value: ShowSignOption.NoSign,
|
|
20
|
+
label: UiIModelComponents.translate("QuantityFormat.sign_option.noSign"),
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
value: ShowSignOption.OnlyNegative,
|
|
24
|
+
label: UiIModelComponents.translate("QuantityFormat.sign_option.onlyNegative"),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
value: ShowSignOption.SignAlways,
|
|
28
|
+
label: UiIModelComponents.translate("QuantityFormat.sign_option.signAlways"),
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
value: ShowSignOption.NegativeParentheses,
|
|
32
|
+
label: UiIModelComponents.translate("QuantityFormat.sign_option.negativeParentheses"),
|
|
33
|
+
},
|
|
22
34
|
]);
|
|
23
35
|
const handleOnChange = React.useCallback((newValue) => {
|
|
24
36
|
onChange && onChange(newValue);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignOption.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/SignOption.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"SignOption.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/SignOption.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAU9C;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAA8B;IAC/D,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IACtD,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAiC;QAC3D;YACE,KAAK,EAAE,cAAc,CAAC,MAAM;YAC5B,KAAK,EAAE,kBAAkB,CAAC,SAAS,CAAC,mCAAmC,CAAC;SACzE;QACD;YACE,KAAK,EAAE,cAAc,CAAC,YAAY;YAClC,KAAK,EAAE,kBAAkB,CAAC,SAAS,CACjC,yCAAyC,CAC1C;SACF;QACD;YACE,KAAK,EAAE,cAAc,CAAC,UAAU;YAChC,KAAK,EAAE,kBAAkB,CAAC,SAAS,CACjC,uCAAuC,CACxC;SACF;QACD;YACE,KAAK,EAAE,cAAc,CAAC,mBAAmB;YACzC,KAAK,EAAE,kBAAkB,CAAC,SAAS,CACjC,gDAAgD,CACjD;SACF;KACF,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CACtC,CAAC,QAAwB,EAAE,EAAE;QAC3B,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,OAAO,CACL,oBAAC,MAAM,IACL,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAC,OAAO,KACR,UAAU,GACd,CACH,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module QuantityFormat\n */\n\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { UiIModelComponents } from \"../../UiIModelComponents\";\nimport { ShowSignOption } from \"@itwin/core-quantity\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { Select } from \"@itwin/itwinui-react\";\n\n/** Properties of [[SignOptionSelector]] component.\n * @internal\n */\nexport interface SignOptionSelectorProps extends CommonProps {\n signOption: ShowSignOption;\n onChange: (value: ShowSignOption) => void;\n}\n\n/** Component use to set Sign option.\n * @internal\n */\nexport function SignOptionSelector(props: SignOptionSelectorProps) {\n const { signOption, onChange, ...otherProps } = props;\n const options = React.useRef<SelectOption<ShowSignOption>[]>([\n {\n value: ShowSignOption.NoSign,\n label: UiIModelComponents.translate(\"QuantityFormat.sign_option.noSign\"),\n },\n {\n value: ShowSignOption.OnlyNegative,\n label: UiIModelComponents.translate(\n \"QuantityFormat.sign_option.onlyNegative\"\n ),\n },\n {\n value: ShowSignOption.SignAlways,\n label: UiIModelComponents.translate(\n \"QuantityFormat.sign_option.signAlways\"\n ),\n },\n {\n value: ShowSignOption.NegativeParentheses,\n label: UiIModelComponents.translate(\n \"QuantityFormat.sign_option.negativeParentheses\"\n ),\n },\n ]);\n\n const handleOnChange = React.useCallback(\n (newValue: ShowSignOption) => {\n onChange && onChange(newValue);\n },\n [onChange]\n );\n\n return (\n <Select\n options={options.current}\n value={signOption}\n onChange={handleOnChange}\n size=\"small\"\n {...otherProps}\n />\n );\n}\n"]}
|
package/lib/esm/imodel-components-react/quantityformat/misc/StationSeparatorSelector.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StationSeparatorSelector.d.ts","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/StationSeparatorSelector.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKrD;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,WAAW;IAChE,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,
|
|
1
|
+
{"version":3,"file":"StationSeparatorSelector.d.ts","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/StationSeparatorSelector.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKrD;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,WAAW;IAChE,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,eA2D5E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
-
*--------------------------------------------------------------------------------------------*/
|
|
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
5
|
/** @packageDocumentation
|
|
6
6
|
* @module QuantityFormat
|
|
7
7
|
*/
|
|
@@ -14,10 +14,22 @@ import { Select } from "@itwin/itwinui-react";
|
|
|
14
14
|
export function StationSeparatorSelector(props) {
|
|
15
15
|
const { separator, disabled, onChange, ...otherProps } = props;
|
|
16
16
|
const uomDefaultEntries = React.useRef([
|
|
17
|
-
{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
{
|
|
18
|
+
value: "+",
|
|
19
|
+
label: UiIModelComponents.translate("QuantityFormat.station_separator.plus"),
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
value: "-",
|
|
23
|
+
label: UiIModelComponents.translate("QuantityFormat.station_separator.minus"),
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
value: " ",
|
|
27
|
+
label: UiIModelComponents.translate("QuantityFormat.station_separator.blank"),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: "^",
|
|
31
|
+
label: UiIModelComponents.translate("QuantityFormat.station_separator.caret"),
|
|
32
|
+
},
|
|
21
33
|
]);
|
|
22
34
|
const handleOnChange = React.useCallback((newValue) => {
|
|
23
35
|
onChange && onChange(newValue);
|
|
@@ -25,7 +37,8 @@ export function StationSeparatorSelector(props) {
|
|
|
25
37
|
const separatorOptions = React.useMemo(() => {
|
|
26
38
|
const completeListOfEntries = [];
|
|
27
39
|
// istanbul ignore next (only used if format already has a character that does not match standard options)
|
|
28
|
-
if (undefined ===
|
|
40
|
+
if (undefined ===
|
|
41
|
+
uomDefaultEntries.current.find((option) => option.value === separator)) {
|
|
29
42
|
completeListOfEntries.push({ value: separator, label: separator });
|
|
30
43
|
}
|
|
31
44
|
completeListOfEntries.push(...uomDefaultEntries.current);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StationSeparatorSelector.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/StationSeparatorSelector.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"StationSeparatorSelector.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/StationSeparatorSelector.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAW9C;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAoC;IAC3E,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAC/D,MAAM,iBAAiB,GAAG,KAAK,CAAC,MAAM,CAAyB;QAC7D;YACE,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,kBAAkB,CAAC,SAAS,CACjC,uCAAuC,CACxC;SACF;QACD;YACE,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,kBAAkB,CAAC,SAAS,CACjC,wCAAwC,CACzC;SACF;QACD;YACE,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,kBAAkB,CAAC,SAAS,CACjC,wCAAwC,CACzC;SACF;QACD;YACE,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,kBAAkB,CAAC,SAAS,CACjC,wCAAwC,CACzC;SACF;KACF,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CACtC,CAAC,QAAgB,EAAE,EAAE;QACnB,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QAC1C,MAAM,qBAAqB,GAA2B,EAAE,CAAC;QACzD,0GAA0G;QAC1G,IACE,SAAS;YACT,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,EACtE;YACA,qBAAqB,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;SACpE;QACD,qBAAqB,CAAC,IAAI,CAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACzD,OAAO,qBAAqB,CAAC;IAC/B,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,OAAO,CACL,oBAAC,MAAM,IACL,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAC,OAAO,KACR,UAAU,GACd,CACH,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module QuantityFormat\n */\n\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { UiIModelComponents } from \"../../UiIModelComponents\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { Select } from \"@itwin/itwinui-react\";\n\n/** Properties of [[StationSeparatorSelector]] component.\n * @internal\n */\nexport interface StationSeparatorSelectorProps extends CommonProps {\n separator: string;\n disabled: boolean;\n onChange: (value: string) => void;\n}\n\n/** Component use to setStation separator.\n * @internal\n */\nexport function StationSeparatorSelector(props: StationSeparatorSelectorProps) {\n const { separator, disabled, onChange, ...otherProps } = props;\n const uomDefaultEntries = React.useRef<SelectOption<string>[]>([\n {\n value: \"+\",\n label: UiIModelComponents.translate(\n \"QuantityFormat.station_separator.plus\"\n ),\n },\n {\n value: \"-\",\n label: UiIModelComponents.translate(\n \"QuantityFormat.station_separator.minus\"\n ),\n },\n {\n value: \" \",\n label: UiIModelComponents.translate(\n \"QuantityFormat.station_separator.blank\"\n ),\n },\n {\n value: \"^\",\n label: UiIModelComponents.translate(\n \"QuantityFormat.station_separator.caret\"\n ),\n },\n ]);\n\n const handleOnChange = React.useCallback(\n (newValue: string) => {\n onChange && onChange(newValue);\n },\n [onChange]\n );\n\n const separatorOptions = React.useMemo(() => {\n const completeListOfEntries: SelectOption<string>[] = [];\n // istanbul ignore next (only used if format already has a character that does not match standard options)\n if (\n undefined ===\n uomDefaultEntries.current.find((option) => option.value === separator)\n ) {\n completeListOfEntries.push({ value: separator, label: separator });\n }\n completeListOfEntries.push(...uomDefaultEntries.current);\n return completeListOfEntries;\n }, [separator]);\n\n return (\n <Select\n options={separatorOptions}\n disabled={disabled}\n value={separator}\n onChange={handleOnChange}\n size=\"small\"\n {...otherProps}\n />\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StationSizeSelector.d.ts","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/StationSizeSelector.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKrD;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,WAAW;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,
|
|
1
|
+
{"version":3,"file":"StationSizeSelector.d.ts","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/StationSizeSelector.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKrD;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,WAAW;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,eA8BlE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
-
*--------------------------------------------------------------------------------------------*/
|
|
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
5
|
/** @packageDocumentation
|
|
6
6
|
* @module QuantityFormat
|
|
7
7
|
*/
|
|
@@ -14,8 +14,14 @@ import { Select } from "@itwin/itwinui-react";
|
|
|
14
14
|
export function StationSizeSelector(props) {
|
|
15
15
|
const { value, disabled, onChange, ...otherProps } = props;
|
|
16
16
|
const separatorOptions = React.useRef([
|
|
17
|
-
{
|
|
18
|
-
|
|
17
|
+
{
|
|
18
|
+
value: 2,
|
|
19
|
+
label: UiIModelComponents.translate("QuantityFormat.station_size.two"),
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
value: 3,
|
|
23
|
+
label: UiIModelComponents.translate("QuantityFormat.station_size.three"),
|
|
24
|
+
},
|
|
19
25
|
]);
|
|
20
26
|
const handleOnChange = React.useCallback((newValue) => {
|
|
21
27
|
onChange && onChange(newValue);
|