@itwin/imodel-components-react 3.4.0-dev.43 → 3.4.0-dev.44
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/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 +20 -20
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module QuantityFormat
|
|
3
|
-
*/
|
|
4
|
-
/// <reference types="react" />
|
|
5
|
-
import { CommonProps } from "@itwin/core-react";
|
|
6
|
-
import { FormatProps, UnitProps, UnitsProvider } from "@itwin/core-quantity";
|
|
7
|
-
/** Properties of [[FormatUnits]] component.
|
|
8
|
-
* @alpha
|
|
9
|
-
*/
|
|
10
|
-
export interface FormatUnitsProps extends CommonProps {
|
|
11
|
-
initialFormat: FormatProps;
|
|
12
|
-
persistenceUnit?: UnitProps;
|
|
13
|
-
unitsProvider: UnitsProvider;
|
|
14
|
-
onUnitsChange?: (format: FormatProps) => void;
|
|
15
|
-
}
|
|
16
|
-
/** Component to show/edit Units used for Quantity Formatting.
|
|
17
|
-
* @alpha
|
|
18
|
-
*/
|
|
19
|
-
export declare function FormatUnits(props: FormatUnitsProps): JSX.Element;
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module QuantityFormat
|
|
3
|
+
*/
|
|
4
|
+
/// <reference types="react" />
|
|
5
|
+
import { CommonProps } from "@itwin/core-react";
|
|
6
|
+
import { FormatProps, UnitProps, UnitsProvider } from "@itwin/core-quantity";
|
|
7
|
+
/** Properties of [[FormatUnits]] component.
|
|
8
|
+
* @alpha
|
|
9
|
+
*/
|
|
10
|
+
export interface FormatUnitsProps extends CommonProps {
|
|
11
|
+
initialFormat: FormatProps;
|
|
12
|
+
persistenceUnit?: UnitProps;
|
|
13
|
+
unitsProvider: UnitsProvider;
|
|
14
|
+
onUnitsChange?: (format: FormatProps) => void;
|
|
15
|
+
}
|
|
16
|
+
/** Component to show/edit Units used for Quantity Formatting.
|
|
17
|
+
* @alpha
|
|
18
|
+
*/
|
|
19
|
+
export declare function FormatUnits(props: FormatUnitsProps): JSX.Element;
|
|
20
20
|
//# sourceMappingURL=FormatUnits.d.ts.map
|
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/** @packageDocumentation
|
|
6
|
-
* @module QuantityFormat
|
|
7
|
-
*/
|
|
8
|
-
import * as React from "react";
|
|
9
|
-
import { Input } from "@itwin/itwinui-react";
|
|
10
|
-
import { UnitDescr } from "./misc/UnitDescr";
|
|
11
|
-
import { UiIModelComponents } from "../UiIModelComponents";
|
|
12
|
-
/** Component to show/edit Units used for Quantity Formatting.
|
|
13
|
-
* @alpha
|
|
14
|
-
*/
|
|
15
|
-
export function FormatUnits(props) {
|
|
16
|
-
var _a, _b, _c;
|
|
17
|
-
const { initialFormat, persistenceUnit, unitsProvider, onUnitsChange } = props;
|
|
18
|
-
const initialFormatRef = React.useRef(initialFormat);
|
|
19
|
-
const [formatProps, setFormatProps] = React.useState(initialFormat);
|
|
20
|
-
React.useEffect(() => {
|
|
21
|
-
if (initialFormatRef.current !== initialFormat) {
|
|
22
|
-
initialFormatRef.current = initialFormat;
|
|
23
|
-
setFormatProps(initialFormat);
|
|
24
|
-
}
|
|
25
|
-
}, [initialFormat]);
|
|
26
|
-
const handleSetFormatProps = React.useCallback((newProps) => {
|
|
27
|
-
setFormatProps(newProps);
|
|
28
|
-
onUnitsChange && onUnitsChange(newProps);
|
|
29
|
-
}, [onUnitsChange]);
|
|
30
|
-
const handleUnitLabelChange = React.useCallback((newLabel, index) => {
|
|
31
|
-
// istanbul ignore else
|
|
32
|
-
if (formatProps.composite && formatProps.composite.units.length > index && index >= 0) {
|
|
33
|
-
const units = formatProps.composite.units.map((entry, ndx) => {
|
|
34
|
-
// istanbul ignore else
|
|
35
|
-
if (index === ndx)
|
|
36
|
-
return { name: entry.name, label: newLabel };
|
|
37
|
-
else
|
|
38
|
-
return entry;
|
|
39
|
-
});
|
|
40
|
-
const composite = { ...formatProps.composite, units };
|
|
41
|
-
const newFormatProps = { ...formatProps, composite };
|
|
42
|
-
handleSetFormatProps(newFormatProps);
|
|
43
|
-
}
|
|
44
|
-
}, [formatProps, handleSetFormatProps]);
|
|
45
|
-
const handleUnitChange = React.useCallback((newUnit, index) => {
|
|
46
|
-
const unitParts = newUnit.split(/:/);
|
|
47
|
-
if (unitParts[0] === "REMOVEUNIT") {
|
|
48
|
-
// istanbul ignore else
|
|
49
|
-
if (formatProps.composite && formatProps.composite.units.length > 1) {
|
|
50
|
-
const units = [...formatProps.composite.units];
|
|
51
|
-
units.pop();
|
|
52
|
-
const composite = { ...formatProps.composite, units };
|
|
53
|
-
const newFormatProps = { ...formatProps, composite };
|
|
54
|
-
handleSetFormatProps(newFormatProps);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
else if (unitParts[0] === "ADDSUBUNIT") {
|
|
58
|
-
const units = formatProps.composite && formatProps.composite.units.length ?
|
|
59
|
-
[...formatProps.composite.units, { name: unitParts[1], label: unitParts[2] }] :
|
|
60
|
-
/* istanbul ignore next*/ [{ name: unitParts[1], label: unitParts[2] }];
|
|
61
|
-
const composite = { ...formatProps.composite, units };
|
|
62
|
-
const newFormatProps = { ...formatProps, composite };
|
|
63
|
-
handleSetFormatProps(newFormatProps);
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
// istanbul ignore else
|
|
67
|
-
if (formatProps.composite && formatProps.composite.units.length > index && index >= 0) {
|
|
68
|
-
const units = formatProps.composite.units.map((entry, ndx) => {
|
|
69
|
-
// istanbul ignore else
|
|
70
|
-
if (index === ndx)
|
|
71
|
-
return { name: unitParts[0], label: unitParts[1] };
|
|
72
|
-
else
|
|
73
|
-
return entry;
|
|
74
|
-
});
|
|
75
|
-
const composite = { ...formatProps.composite, units };
|
|
76
|
-
const newFormatProps = { ...formatProps, composite };
|
|
77
|
-
handleSetFormatProps(newFormatProps);
|
|
78
|
-
}
|
|
79
|
-
else if (!formatProps.composite) {
|
|
80
|
-
const composite = { units: [{ name: unitParts[0], label: unitParts[1] }] };
|
|
81
|
-
const newFormatProps = { ...formatProps, composite };
|
|
82
|
-
handleSetFormatProps(newFormatProps);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}, [formatProps, handleSetFormatProps]);
|
|
86
|
-
const handleOnSpacerChange = React.useCallback((e) => {
|
|
87
|
-
// istanbul ignore else
|
|
88
|
-
if (formatProps.composite) {
|
|
89
|
-
const spacerValue = e.target.value.length ? e.target.value[0] : /* istanbul ignore next */ ""; // spacer can only be empty or a single character
|
|
90
|
-
const composite = { ...formatProps.composite, spacer: spacerValue };
|
|
91
|
-
const newFormatProps = { ...formatProps, composite };
|
|
92
|
-
handleSetFormatProps(newFormatProps);
|
|
93
|
-
}
|
|
94
|
-
}, [formatProps, handleSetFormatProps]);
|
|
95
|
-
const compositeSpacer = React.useRef(UiIModelComponents.translate("QuantityFormat.labels.compositeSpacer"));
|
|
96
|
-
return (React.createElement(React.Fragment, null,
|
|
97
|
-
((_a = formatProps.composite) === null || _a === void 0 ? void 0 : _a.units)
|
|
98
|
-
?
|
|
99
|
-
formatProps.composite.units.map((value, index) => {
|
|
100
|
-
var _a;
|
|
101
|
-
return React.createElement(UnitDescr, { key: value.name, name: value.name, label: (_a = value.label) !== null && _a !== void 0 ? _a : "", parentUnitName: index > 0 ? formatProps.composite.units[index - 1].name :
|
|
102
|
-
undefined, unitsProvider: unitsProvider, index: index, onUnitChange: handleUnitChange, onLabelChange: handleUnitLabelChange, readonly: index < (formatProps.composite.units.length - 1) });
|
|
103
|
-
})
|
|
104
|
-
:
|
|
105
|
-
persistenceUnit && React.createElement(UnitDescr, { key: persistenceUnit.name, name: persistenceUnit.name, label: persistenceUnit.label, unitsProvider: unitsProvider, index: 0, onUnitChange: handleUnitChange, onLabelChange: handleUnitLabelChange }),
|
|
106
|
-
(((_b = formatProps.composite) === null || _b === void 0 ? void 0 : _b.units) && formatProps.composite.units.length > 1) &&
|
|
107
|
-
React.createElement(React.Fragment, null,
|
|
108
|
-
React.createElement("span", { key: "composite-spacer-label", className: "uicore-label" }, compositeSpacer.current),
|
|
109
|
-
React.createElement(Input, { key: "composite-spacer", "data-testid": "composite-spacer", value: (_c = formatProps.composite.spacer) !== null && _c !== void 0 ? _c : "", onChange: handleOnSpacerChange, size: "small" }))));
|
|
110
|
-
}
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module QuantityFormat
|
|
7
|
+
*/
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { Input } from "@itwin/itwinui-react";
|
|
10
|
+
import { UnitDescr } from "./misc/UnitDescr";
|
|
11
|
+
import { UiIModelComponents } from "../UiIModelComponents";
|
|
12
|
+
/** Component to show/edit Units used for Quantity Formatting.
|
|
13
|
+
* @alpha
|
|
14
|
+
*/
|
|
15
|
+
export function FormatUnits(props) {
|
|
16
|
+
var _a, _b, _c;
|
|
17
|
+
const { initialFormat, persistenceUnit, unitsProvider, onUnitsChange } = props;
|
|
18
|
+
const initialFormatRef = React.useRef(initialFormat);
|
|
19
|
+
const [formatProps, setFormatProps] = React.useState(initialFormat);
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
if (initialFormatRef.current !== initialFormat) {
|
|
22
|
+
initialFormatRef.current = initialFormat;
|
|
23
|
+
setFormatProps(initialFormat);
|
|
24
|
+
}
|
|
25
|
+
}, [initialFormat]);
|
|
26
|
+
const handleSetFormatProps = React.useCallback((newProps) => {
|
|
27
|
+
setFormatProps(newProps);
|
|
28
|
+
onUnitsChange && onUnitsChange(newProps);
|
|
29
|
+
}, [onUnitsChange]);
|
|
30
|
+
const handleUnitLabelChange = React.useCallback((newLabel, index) => {
|
|
31
|
+
// istanbul ignore else
|
|
32
|
+
if (formatProps.composite && formatProps.composite.units.length > index && index >= 0) {
|
|
33
|
+
const units = formatProps.composite.units.map((entry, ndx) => {
|
|
34
|
+
// istanbul ignore else
|
|
35
|
+
if (index === ndx)
|
|
36
|
+
return { name: entry.name, label: newLabel };
|
|
37
|
+
else
|
|
38
|
+
return entry;
|
|
39
|
+
});
|
|
40
|
+
const composite = { ...formatProps.composite, units };
|
|
41
|
+
const newFormatProps = { ...formatProps, composite };
|
|
42
|
+
handleSetFormatProps(newFormatProps);
|
|
43
|
+
}
|
|
44
|
+
}, [formatProps, handleSetFormatProps]);
|
|
45
|
+
const handleUnitChange = React.useCallback((newUnit, index) => {
|
|
46
|
+
const unitParts = newUnit.split(/:/);
|
|
47
|
+
if (unitParts[0] === "REMOVEUNIT") {
|
|
48
|
+
// istanbul ignore else
|
|
49
|
+
if (formatProps.composite && formatProps.composite.units.length > 1) {
|
|
50
|
+
const units = [...formatProps.composite.units];
|
|
51
|
+
units.pop();
|
|
52
|
+
const composite = { ...formatProps.composite, units };
|
|
53
|
+
const newFormatProps = { ...formatProps, composite };
|
|
54
|
+
handleSetFormatProps(newFormatProps);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else if (unitParts[0] === "ADDSUBUNIT") {
|
|
58
|
+
const units = formatProps.composite && formatProps.composite.units.length ?
|
|
59
|
+
[...formatProps.composite.units, { name: unitParts[1], label: unitParts[2] }] :
|
|
60
|
+
/* istanbul ignore next*/ [{ name: unitParts[1], label: unitParts[2] }];
|
|
61
|
+
const composite = { ...formatProps.composite, units };
|
|
62
|
+
const newFormatProps = { ...formatProps, composite };
|
|
63
|
+
handleSetFormatProps(newFormatProps);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
// istanbul ignore else
|
|
67
|
+
if (formatProps.composite && formatProps.composite.units.length > index && index >= 0) {
|
|
68
|
+
const units = formatProps.composite.units.map((entry, ndx) => {
|
|
69
|
+
// istanbul ignore else
|
|
70
|
+
if (index === ndx)
|
|
71
|
+
return { name: unitParts[0], label: unitParts[1] };
|
|
72
|
+
else
|
|
73
|
+
return entry;
|
|
74
|
+
});
|
|
75
|
+
const composite = { ...formatProps.composite, units };
|
|
76
|
+
const newFormatProps = { ...formatProps, composite };
|
|
77
|
+
handleSetFormatProps(newFormatProps);
|
|
78
|
+
}
|
|
79
|
+
else if (!formatProps.composite) {
|
|
80
|
+
const composite = { units: [{ name: unitParts[0], label: unitParts[1] }] };
|
|
81
|
+
const newFormatProps = { ...formatProps, composite };
|
|
82
|
+
handleSetFormatProps(newFormatProps);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}, [formatProps, handleSetFormatProps]);
|
|
86
|
+
const handleOnSpacerChange = React.useCallback((e) => {
|
|
87
|
+
// istanbul ignore else
|
|
88
|
+
if (formatProps.composite) {
|
|
89
|
+
const spacerValue = e.target.value.length ? e.target.value[0] : /* istanbul ignore next */ ""; // spacer can only be empty or a single character
|
|
90
|
+
const composite = { ...formatProps.composite, spacer: spacerValue };
|
|
91
|
+
const newFormatProps = { ...formatProps, composite };
|
|
92
|
+
handleSetFormatProps(newFormatProps);
|
|
93
|
+
}
|
|
94
|
+
}, [formatProps, handleSetFormatProps]);
|
|
95
|
+
const compositeSpacer = React.useRef(UiIModelComponents.translate("QuantityFormat.labels.compositeSpacer"));
|
|
96
|
+
return (React.createElement(React.Fragment, null,
|
|
97
|
+
((_a = formatProps.composite) === null || _a === void 0 ? void 0 : _a.units)
|
|
98
|
+
?
|
|
99
|
+
formatProps.composite.units.map((value, index) => {
|
|
100
|
+
var _a;
|
|
101
|
+
return React.createElement(UnitDescr, { key: value.name, name: value.name, label: (_a = value.label) !== null && _a !== void 0 ? _a : "", parentUnitName: index > 0 ? formatProps.composite.units[index - 1].name :
|
|
102
|
+
undefined, unitsProvider: unitsProvider, index: index, onUnitChange: handleUnitChange, onLabelChange: handleUnitLabelChange, readonly: index < (formatProps.composite.units.length - 1) });
|
|
103
|
+
})
|
|
104
|
+
:
|
|
105
|
+
persistenceUnit && React.createElement(UnitDescr, { key: persistenceUnit.name, name: persistenceUnit.name, label: persistenceUnit.label, unitsProvider: unitsProvider, index: 0, onUnitChange: handleUnitChange, onLabelChange: handleUnitLabelChange }),
|
|
106
|
+
(((_b = formatProps.composite) === null || _b === void 0 ? void 0 : _b.units) && formatProps.composite.units.length > 1) &&
|
|
107
|
+
React.createElement(React.Fragment, null,
|
|
108
|
+
React.createElement("span", { key: "composite-spacer-label", className: "uicore-label" }, compositeSpacer.current),
|
|
109
|
+
React.createElement(Input, { key: "composite-spacer", "data-testid": "composite-spacer", value: (_c = formatProps.composite.spacer) !== null && _c !== void 0 ? _c : "", onChange: handleOnSpacerChange, size: "small" }))));
|
|
110
|
+
}
|
|
111
111
|
//# sourceMappingURL=FormatUnits.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormatUnits.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatUnits.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAY3D;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAuB;;IACjD,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IAC/E,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,CAAc,aAAa,CAAC,CAAC;IAClE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IAEpE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;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e,CAAC,IAAI,EAAE,IAAI,EAAE,eAAe,CAAC,IAAI,EACjF,KAAK,EAAE,eAAe,CAAC,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,qBAAqB,GAAI;QAGjJ,CAAC,CAAA,MAAA,WAAW,CAAC,SAAS,0CAAE,KAAK,KAAI,WAAW,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;YACvE;gBACE,8BAAM,GAAG,EAAE,wBAAwB,EAAE,SAAS,EAAE,cAAc,IAAG,eAAe,CAAC,OAAO,CAAQ;gBAChG,oBAAC,KAAK,IAAC,GAAG,EAAE,kBAAkB,iBAAc,kBAAkB,EAAC,KAAK,EAAE,MAAA,WAAW,CAAC,SAAS,CAAC,MAAM,mCAAI,EAAE,EAAE,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAC,OAAO,GAAG,CACxJ,CAEJ,CACJ,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 { CommonProps } from \"@itwin/core-react\";\r\nimport { FormatProps, UnitProps, UnitsProvider } from \"@itwin/core-quantity\";\r\nimport { Input } from \"@itwin/itwinui-react\";\r\nimport { UnitDescr } from \"./misc/UnitDescr\";\r\nimport { UiIModelComponents } from \"../UiIModelComponents\";\r\n\r\n/** Properties of [[FormatUnits]] component.\r\n * @alpha\r\n */\r\nexport interface FormatUnitsProps extends CommonProps {\r\n initialFormat: FormatProps;\r\n persistenceUnit?: UnitProps;\r\n unitsProvider: UnitsProvider;\r\n onUnitsChange?: (format: FormatProps) => void;\r\n}\r\n\r\n/** Component to show/edit Units used for Quantity Formatting.\r\n * @alpha\r\n */\r\nexport function FormatUnits(props: FormatUnitsProps) {\r\n const { initialFormat, persistenceUnit, unitsProvider, onUnitsChange } = props;\r\n const initialFormatRef = React.useRef<FormatProps>(initialFormat);\r\n const [formatProps, setFormatProps] = React.useState(initialFormat);\r\n\r\n React.useEffect(() => {\r\n if (initialFormatRef.current !== initialFormat) {\r\n initialFormatRef.current = initialFormat;\r\n setFormatProps(initialFormat);\r\n }\r\n }, [initialFormat]);\r\n\r\n const handleSetFormatProps = React.useCallback((newProps: FormatProps) => {\r\n setFormatProps(newProps);\r\n onUnitsChange && onUnitsChange(newProps);\r\n }, [onUnitsChange]);\r\n\r\n const handleUnitLabelChange = React.useCallback((newLabel: string, index: number) => {\r\n // istanbul ignore else\r\n if (formatProps.composite && formatProps.composite.units.length > index && index >= 0) {\r\n const units = formatProps.composite.units.map((entry, ndx) => {\r\n // istanbul ignore else\r\n if (index === ndx)\r\n return { name: entry.name, label: newLabel };\r\n else\r\n return entry;\r\n });\r\n\r\n const composite = { ...formatProps.composite, units };\r\n const newFormatProps = { ...formatProps, composite };\r\n handleSetFormatProps(newFormatProps);\r\n }\r\n }, [formatProps, handleSetFormatProps]);\r\n\r\n const handleUnitChange = React.useCallback((newUnit: string, index: number) => {\r\n const unitParts = newUnit.split(/:/);\r\n if (unitParts[0] === \"REMOVEUNIT\") {\r\n // istanbul ignore else\r\n if (formatProps.composite && formatProps.composite.units.length > 1) {\r\n const units = [...formatProps.composite.units];\r\n units.pop();\r\n const composite = { ...formatProps.composite, units };\r\n const newFormatProps = { ...formatProps, composite };\r\n handleSetFormatProps(newFormatProps);\r\n }\r\n } else if (unitParts[0] === \"ADDSUBUNIT\") {\r\n const units = formatProps.composite && formatProps.composite.units.length ?\r\n [...formatProps.composite.units, { name: unitParts[1], label: unitParts[2] }] :\r\n /* istanbul ignore next*/[{ name: unitParts[1], label: unitParts[2] }];\r\n const composite = { ...formatProps.composite, units };\r\n const newFormatProps = { ...formatProps, composite };\r\n handleSetFormatProps(newFormatProps);\r\n } else {\r\n // istanbul ignore else\r\n if (formatProps.composite && formatProps.composite.units.length > index && index >= 0) {\r\n const units = formatProps.composite.units.map((entry, ndx) => {\r\n // istanbul ignore else\r\n if (index === ndx)\r\n return { name: unitParts[0], label: unitParts[1] };\r\n else\r\n return entry;\r\n });\r\n const composite = { ...formatProps.composite, units };\r\n const newFormatProps = { ...formatProps, composite };\r\n handleSetFormatProps(newFormatProps);\r\n } else if (!formatProps.composite) {\r\n const composite = { units: [{ name: unitParts[0], label: unitParts[1] }] };\r\n const newFormatProps = { ...formatProps, composite };\r\n handleSetFormatProps(newFormatProps);\r\n }\r\n }\r\n }, [formatProps, handleSetFormatProps]);\r\n\r\n const handleOnSpacerChange = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\r\n // istanbul ignore else\r\n if (formatProps.composite) {\r\n const spacerValue = e.target.value.length ? e.target.value[0] : /* istanbul ignore next */ \"\"; // spacer can only be empty or a single character\r\n const composite = { ...formatProps.composite, spacer: spacerValue };\r\n const newFormatProps = { ...formatProps, composite };\r\n handleSetFormatProps(newFormatProps);\r\n }\r\n }, [formatProps, handleSetFormatProps]);\r\n\r\n const compositeSpacer = React.useRef(UiIModelComponents.translate(\"QuantityFormat.labels.compositeSpacer\"));\r\n\r\n return (\r\n <>\r\n {(formatProps.composite?.units)\r\n ?\r\n formatProps.composite.units.map((value, index) => <UnitDescr key={value.name} name={value.name}\r\n label={value.label ?? \"\"} parentUnitName={index > 0 ? formatProps.composite!.units[index - 1].name :\r\n undefined} unitsProvider={unitsProvider} index={index} onUnitChange={handleUnitChange} onLabelChange={handleUnitLabelChange}\r\n readonly={index < (formatProps.composite!.units.length - 1)} />)\r\n :\r\n persistenceUnit && <UnitDescr key={persistenceUnit.name} name={persistenceUnit.name}\r\n label={persistenceUnit.label} unitsProvider={unitsProvider} index={0} onUnitChange={handleUnitChange} onLabelChange={handleUnitLabelChange} />\r\n }\r\n\r\n {(formatProps.composite?.units && formatProps.composite.units.length > 1) &&\r\n <>\r\n <span key={\"composite-spacer-label\"} className={\"uicore-label\"}>{compositeSpacer.current}</span>\r\n <Input key={\"composite-spacer\"} data-testid=\"composite-spacer\" value={formatProps.composite.spacer ?? \"\"} onChange={handleOnSpacerChange} size=\"small\" />\r\n </>\r\n }\r\n </>\r\n );\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"FormatUnits.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/quantityformat/FormatUnits.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAY3D;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAuB;;IACjD,MAAM,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IAC/E,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,CAAc,aAAa,CAAC,CAAC;IAClE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IAEpE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,gBAAgB,CAAC,OAAO,KAAK,aAAa,EAAE;YAC9C,gBAAgB,CAAC,OAAO,GAAG,aAAa,CAAC;YACzC,cAAc,CAAC,aAAa,CAAC,CAAC;SAC/B;IACH,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,MAAM,oBAAoB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,QAAqB,EAAE,EAAE;QACvE,cAAc,CAAC,QAAQ,CAAC,CAAC;QACzB,aAAa,IAAI,aAAa,CAAC,QAAQ,CAAC,C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AE,wBAAwB,EAAE,SAAS,EAAE,cAAc,IAAG,eAAe,CAAC,OAAO,CAAQ;gBAChG,oBAAC,KAAK,IAAC,GAAG,EAAE,kBAAkB,iBAAc,kBAAkB,EAAC,KAAK,EAAE,MAAA,WAAW,CAAC,SAAS,CAAC,MAAM,mCAAI,EAAE,EAAE,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAC,OAAO,GAAG,CACxJ,CAEJ,CACJ,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 { CommonProps } from \"@itwin/core-react\";\nimport { FormatProps, UnitProps, UnitsProvider } from \"@itwin/core-quantity\";\nimport { Input } from \"@itwin/itwinui-react\";\nimport { UnitDescr } from \"./misc/UnitDescr\";\nimport { UiIModelComponents } from \"../UiIModelComponents\";\n\n/** Properties of [[FormatUnits]] component.\n * @alpha\n */\nexport interface FormatUnitsProps extends CommonProps {\n initialFormat: FormatProps;\n persistenceUnit?: UnitProps;\n unitsProvider: UnitsProvider;\n onUnitsChange?: (format: FormatProps) => void;\n}\n\n/** Component to show/edit Units used for Quantity Formatting.\n * @alpha\n */\nexport function FormatUnits(props: FormatUnitsProps) {\n const { initialFormat, persistenceUnit, unitsProvider, onUnitsChange } = props;\n const initialFormatRef = React.useRef<FormatProps>(initialFormat);\n const [formatProps, setFormatProps] = React.useState(initialFormat);\n\n React.useEffect(() => {\n if (initialFormatRef.current !== initialFormat) {\n initialFormatRef.current = initialFormat;\n setFormatProps(initialFormat);\n }\n }, [initialFormat]);\n\n const handleSetFormatProps = React.useCallback((newProps: FormatProps) => {\n setFormatProps(newProps);\n onUnitsChange && onUnitsChange(newProps);\n }, [onUnitsChange]);\n\n const handleUnitLabelChange = React.useCallback((newLabel: string, index: number) => {\n // istanbul ignore else\n if (formatProps.composite && formatProps.composite.units.length > index && index >= 0) {\n const units = formatProps.composite.units.map((entry, ndx) => {\n // istanbul ignore else\n if (index === ndx)\n return { name: entry.name, label: newLabel };\n else\n return entry;\n });\n\n const composite = { ...formatProps.composite, units };\n const newFormatProps = { ...formatProps, composite };\n handleSetFormatProps(newFormatProps);\n }\n }, [formatProps, handleSetFormatProps]);\n\n const handleUnitChange = React.useCallback((newUnit: string, index: number) => {\n const unitParts = newUnit.split(/:/);\n if (unitParts[0] === \"REMOVEUNIT\") {\n // istanbul ignore else\n if (formatProps.composite && formatProps.composite.units.length > 1) {\n const units = [...formatProps.composite.units];\n units.pop();\n const composite = { ...formatProps.composite, units };\n const newFormatProps = { ...formatProps, composite };\n handleSetFormatProps(newFormatProps);\n }\n } else if (unitParts[0] === \"ADDSUBUNIT\") {\n const units = formatProps.composite && formatProps.composite.units.length ?\n [...formatProps.composite.units, { name: unitParts[1], label: unitParts[2] }] :\n /* istanbul ignore next*/[{ name: unitParts[1], label: unitParts[2] }];\n const composite = { ...formatProps.composite, units };\n const newFormatProps = { ...formatProps, composite };\n handleSetFormatProps(newFormatProps);\n } else {\n // istanbul ignore else\n if (formatProps.composite && formatProps.composite.units.length > index && index >= 0) {\n const units = formatProps.composite.units.map((entry, ndx) => {\n // istanbul ignore else\n if (index === ndx)\n return { name: unitParts[0], label: unitParts[1] };\n else\n return entry;\n });\n const composite = { ...formatProps.composite, units };\n const newFormatProps = { ...formatProps, composite };\n handleSetFormatProps(newFormatProps);\n } else if (!formatProps.composite) {\n const composite = { units: [{ name: unitParts[0], label: unitParts[1] }] };\n const newFormatProps = { ...formatProps, composite };\n handleSetFormatProps(newFormatProps);\n }\n }\n }, [formatProps, handleSetFormatProps]);\n\n const handleOnSpacerChange = React.useCallback((e: React.ChangeEvent<HTMLInputElement>) => {\n // istanbul ignore else\n if (formatProps.composite) {\n const spacerValue = e.target.value.length ? e.target.value[0] : /* istanbul ignore next */ \"\"; // spacer can only be empty or a single character\n const composite = { ...formatProps.composite, spacer: spacerValue };\n const newFormatProps = { ...formatProps, composite };\n handleSetFormatProps(newFormatProps);\n }\n }, [formatProps, handleSetFormatProps]);\n\n const compositeSpacer = React.useRef(UiIModelComponents.translate(\"QuantityFormat.labels.compositeSpacer\"));\n\n return (\n <>\n {(formatProps.composite?.units)\n ?\n formatProps.composite.units.map((value, index) => <UnitDescr key={value.name} name={value.name}\n label={value.label ?? \"\"} parentUnitName={index > 0 ? formatProps.composite!.units[index - 1].name :\n undefined} unitsProvider={unitsProvider} index={index} onUnitChange={handleUnitChange} onLabelChange={handleUnitLabelChange}\n readonly={index < (formatProps.composite!.units.length - 1)} />)\n :\n persistenceUnit && <UnitDescr key={persistenceUnit.name} name={persistenceUnit.name}\n label={persistenceUnit.label} unitsProvider={unitsProvider} index={0} onUnitChange={handleUnitChange} onLabelChange={handleUnitLabelChange} />\n }\n\n {(formatProps.composite?.units && formatProps.composite.units.length > 1) &&\n <>\n <span key={\"composite-spacer-label\"} className={\"uicore-label\"}>{compositeSpacer.current}</span>\n <Input key={\"composite-spacer\"} data-testid=\"composite-spacer\" value={formatProps.composite.spacer ?? \"\"} onChange={handleOnSpacerChange} size=\"small\" />\n </>\n }\n </>\n );\n}\n"]}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module QuantityFormat
|
|
3
|
-
*/
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
import { CommonProps } from "@itwin/core-react";
|
|
6
|
-
import { FormatProps } from "@itwin/core-quantity";
|
|
7
|
-
/** Properties of [[MiscFormatOptions]] component.
|
|
8
|
-
* @alpha
|
|
9
|
-
*/
|
|
10
|
-
export interface MiscFormatOptionsProps extends CommonProps {
|
|
11
|
-
formatProps: FormatProps;
|
|
12
|
-
onChange?: (format: FormatProps) => void;
|
|
13
|
-
enableMinimumProperties?: boolean;
|
|
14
|
-
showOptions: boolean;
|
|
15
|
-
onShowHideOptions: (show: boolean) => void;
|
|
16
|
-
children?: React.ReactNode;
|
|
17
|
-
}
|
|
18
|
-
/** Component use to set miscellaneous properties is a Formatted Quantity.
|
|
19
|
-
* @alpha
|
|
20
|
-
*/
|
|
21
|
-
export declare function MiscFormatOptions(props: MiscFormatOptionsProps): JSX.Element;
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module QuantityFormat
|
|
3
|
+
*/
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { CommonProps } from "@itwin/core-react";
|
|
6
|
+
import { FormatProps } from "@itwin/core-quantity";
|
|
7
|
+
/** Properties of [[MiscFormatOptions]] component.
|
|
8
|
+
* @alpha
|
|
9
|
+
*/
|
|
10
|
+
export interface MiscFormatOptionsProps extends CommonProps {
|
|
11
|
+
formatProps: FormatProps;
|
|
12
|
+
onChange?: (format: FormatProps) => void;
|
|
13
|
+
enableMinimumProperties?: boolean;
|
|
14
|
+
showOptions: boolean;
|
|
15
|
+
onShowHideOptions: (show: boolean) => void;
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/** Component use to set miscellaneous properties is a Formatted Quantity.
|
|
19
|
+
* @alpha
|
|
20
|
+
*/
|
|
21
|
+
export declare function MiscFormatOptions(props: MiscFormatOptionsProps): JSX.Element;
|
|
22
22
|
//# sourceMappingURL=MiscFormatOptions.d.ts.map
|