@itwin/imodel-components-react 4.10.0 → 4.12.0
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 +17 -1
- package/lib/cjs/imodel-components-react/UiIModelComponents.d.ts +1 -1
- package/lib/cjs/imodel-components-react/UiIModelComponents.js +6 -6
- package/lib/cjs/imodel-components-react/UiIModelComponents.js.map +1 -1
- package/lib/cjs/imodel-components-react/UiIModelComponents.json +150 -0
- package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts +2 -1
- package/lib/cjs/imodel-components-react/color/AlphaSlider.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/AlphaSlider.js +4 -2
- package/lib/cjs/imodel-components-react/color/AlphaSlider.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts +2 -0
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.js +5 -2
- package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts +2 -0
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts +2 -0
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js +5 -5
- package/lib/cjs/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/HueSlider.d.ts +2 -0
- package/lib/cjs/imodel-components-react/color/HueSlider.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/HueSlider.js +4 -3
- package/lib/cjs/imodel-components-react/color/HueSlider.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts +2 -0
- package/lib/cjs/imodel-components-react/color/SaturationPicker.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/SaturationPicker.js +4 -3
- package/lib/cjs/imodel-components-react/color/SaturationPicker.js.map +1 -1
- package/lib/cjs/imodel-components-react/color/Swatch.d.ts +2 -0
- package/lib/cjs/imodel-components-react/color/Swatch.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/color/Swatch.js +2 -0
- package/lib/cjs/imodel-components-react/color/Swatch.js.map +1 -1
- package/lib/cjs/imodel-components-react/editors/ColorEditor.js +2 -1
- package/lib/cjs/imodel-components-react/editors/ColorEditor.js.map +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.js +5 -4
- package/lib/cjs/imodel-components-react/inputs/QuantityInput.js.map +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js +1 -1
- package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js +10 -5
- package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js +1 -2
- package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
- package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js +5 -4
- 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 +6 -7
- 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 +10 -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 -14
- 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 +13 -9
- 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 +21 -28
- package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.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 +18 -17
- 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 +7 -6
- 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 +14 -13
- 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 +7 -6
- 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 +9 -8
- 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 +23 -22
- 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 +7 -6
- 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 +15 -14
- 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 +6 -6
- package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/PlayButton.d.ts +3 -15
- package/lib/cjs/imodel-components-react/timeline/PlayButton.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/PlayButton.js +12 -42
- package/lib/cjs/imodel-components-react/timeline/PlayButton.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/Scrubber.js +1 -1
- package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts +2 -20
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js +111 -202
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/SolarTimeline.scss +25 -333
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts +5 -1
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js +39 -30
- package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts +2 -2
- package/lib/cjs/imodel-components-react/timeline/interfaces.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/timeline/interfaces.js.map +1 -1
- package/lib/cjs/imodel-components-react/useTranslation.d.ts +7 -0
- package/lib/cjs/imodel-components-react/useTranslation.d.ts.map +1 -0
- package/lib/cjs/imodel-components-react/useTranslation.js +52 -0
- package/lib/cjs/imodel-components-react/useTranslation.js.map +1 -0
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js +13 -8
- package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
- package/lib/esm/imodel-components-react/UiIModelComponents.d.ts +1 -1
- package/lib/esm/imodel-components-react/UiIModelComponents.js +6 -6
- package/lib/esm/imodel-components-react/UiIModelComponents.js.map +1 -1
- package/lib/esm/imodel-components-react/UiIModelComponents.json +150 -0
- package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts +2 -1
- package/lib/esm/imodel-components-react/color/AlphaSlider.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/AlphaSlider.js +4 -2
- package/lib/esm/imodel-components-react/color/AlphaSlider.js.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts +2 -0
- package/lib/esm/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerButton.js +5 -2
- package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts +2 -0
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.js +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts +2 -0
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.js +5 -5
- package/lib/esm/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
- package/lib/esm/imodel-components-react/color/HueSlider.d.ts +2 -0
- package/lib/esm/imodel-components-react/color/HueSlider.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/HueSlider.js +4 -3
- package/lib/esm/imodel-components-react/color/HueSlider.js.map +1 -1
- package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts +2 -0
- package/lib/esm/imodel-components-react/color/SaturationPicker.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/SaturationPicker.js +4 -3
- package/lib/esm/imodel-components-react/color/SaturationPicker.js.map +1 -1
- package/lib/esm/imodel-components-react/color/Swatch.d.ts +2 -0
- package/lib/esm/imodel-components-react/color/Swatch.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/color/Swatch.js +2 -0
- package/lib/esm/imodel-components-react/color/Swatch.js.map +1 -1
- package/lib/esm/imodel-components-react/editors/ColorEditor.js +2 -1
- package/lib/esm/imodel-components-react/editors/ColorEditor.js.map +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityInput.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityInput.js +5 -4
- package/lib/esm/imodel-components-react/inputs/QuantityInput.js.map +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js +1 -1
- package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js +10 -5
- package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js +1 -2
- package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
- package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js +5 -4
- 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 +6 -7
- 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 +10 -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 -14
- 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 +13 -9
- 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 +21 -28
- package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.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 +18 -17
- 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 +7 -6
- 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 +14 -13
- 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 +7 -6
- 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 +9 -8
- 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 +23 -22
- 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 +7 -6
- 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 +15 -14
- 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 +6 -6
- package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/PlayButton.d.ts +3 -15
- package/lib/esm/imodel-components-react/timeline/PlayButton.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/PlayButton.js +12 -39
- package/lib/esm/imodel-components-react/timeline/PlayButton.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/Scrubber.js +1 -1
- package/lib/esm/imodel-components-react/timeline/Scrubber.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts +2 -20
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.js +112 -203
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/SolarTimeline.scss +25 -333
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts +5 -1
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.js +40 -31
- package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
- package/lib/esm/imodel-components-react/timeline/interfaces.d.ts +2 -2
- package/lib/esm/imodel-components-react/timeline/interfaces.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/timeline/interfaces.js.map +1 -1
- package/lib/esm/imodel-components-react/useTranslation.d.ts +7 -0
- package/lib/esm/imodel-components-react/useTranslation.d.ts.map +1 -0
- package/lib/esm/imodel-components-react/useTranslation.js +25 -0
- package/lib/esm/imodel-components-react/useTranslation.js.map +1 -0
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.js +13 -8
- package/lib/esm/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
- package/lib/public/locales/en/UiIModelComponents.json +14 -3
- package/package.json +11 -12
- package/lib/cjs/imodel-components-react/timeline/PlayButton.scss +0 -28
- package/lib/esm/imodel-components-react/timeline/PlayButton.scss +0 -28
|
@@ -32,72 +32,73 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
exports.DecimalPrecisionSelector = void 0;
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
|
-
const UiIModelComponents_1 = require("../../UiIModelComponents");
|
|
36
35
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
36
|
+
const useTranslation_1 = require("../../useTranslation");
|
|
37
37
|
/** Component use to set Decimal Precision
|
|
38
38
|
* the unit label.
|
|
39
39
|
* @internal
|
|
40
40
|
*/
|
|
41
41
|
function DecimalPrecisionSelector(props) {
|
|
42
42
|
const { precision, onChange, ...otherProps } = props;
|
|
43
|
-
const
|
|
43
|
+
const { translate } = (0, useTranslation_1.useTranslation)();
|
|
44
|
+
const options = [
|
|
44
45
|
{
|
|
45
46
|
value: 0,
|
|
46
|
-
label:
|
|
47
|
+
label: translate("QuantityFormat.decimal_precision.zero"),
|
|
47
48
|
},
|
|
48
49
|
{
|
|
49
50
|
value: 1,
|
|
50
|
-
label:
|
|
51
|
+
label: translate("QuantityFormat.decimal_precision.one"),
|
|
51
52
|
},
|
|
52
53
|
{
|
|
53
54
|
value: 2,
|
|
54
|
-
label:
|
|
55
|
+
label: translate("QuantityFormat.decimal_precision.two"),
|
|
55
56
|
},
|
|
56
57
|
{
|
|
57
58
|
value: 3,
|
|
58
|
-
label:
|
|
59
|
+
label: translate("QuantityFormat.decimal_precision.three"),
|
|
59
60
|
},
|
|
60
61
|
{
|
|
61
62
|
value: 4,
|
|
62
|
-
label:
|
|
63
|
+
label: translate("QuantityFormat.decimal_precision.four"),
|
|
63
64
|
},
|
|
64
65
|
{
|
|
65
66
|
value: 5,
|
|
66
|
-
label:
|
|
67
|
+
label: translate("QuantityFormat.decimal_precision.five"),
|
|
67
68
|
},
|
|
68
69
|
{
|
|
69
70
|
value: 6,
|
|
70
|
-
label:
|
|
71
|
+
label: translate("QuantityFormat.decimal_precision.six"),
|
|
71
72
|
},
|
|
72
73
|
{
|
|
73
74
|
value: 7,
|
|
74
|
-
label:
|
|
75
|
+
label: translate("QuantityFormat.decimal_precision.seven"),
|
|
75
76
|
},
|
|
76
77
|
{
|
|
77
78
|
value: 8,
|
|
78
|
-
label:
|
|
79
|
+
label: translate("QuantityFormat.decimal_precision.eight"),
|
|
79
80
|
},
|
|
80
81
|
{
|
|
81
82
|
value: 9,
|
|
82
|
-
label:
|
|
83
|
+
label: translate("QuantityFormat.decimal_precision.nine"),
|
|
83
84
|
},
|
|
84
85
|
{
|
|
85
86
|
value: 10,
|
|
86
|
-
label:
|
|
87
|
+
label: translate("QuantityFormat.decimal_precision.ten"),
|
|
87
88
|
},
|
|
88
89
|
{
|
|
89
90
|
value: 11,
|
|
90
|
-
label:
|
|
91
|
+
label: translate("QuantityFormat.decimal_precision.eleven"),
|
|
91
92
|
},
|
|
92
93
|
{
|
|
93
94
|
value: 12,
|
|
94
|
-
label:
|
|
95
|
+
label: translate("QuantityFormat.decimal_precision.twelve"),
|
|
95
96
|
},
|
|
96
|
-
]
|
|
97
|
+
];
|
|
97
98
|
const handleOnChange = React.useCallback((newValue) => {
|
|
98
99
|
onChange && onChange(newValue);
|
|
99
100
|
}, [onChange]);
|
|
100
|
-
return (React.createElement(itwinui_react_1.Select, { options: options
|
|
101
|
+
return (React.createElement(itwinui_react_1.Select, { options: options, value: precision, onChange: handleOnChange, size: "small", ...otherProps }));
|
|
101
102
|
}
|
|
102
103
|
exports.DecimalPrecisionSelector = DecimalPrecisionSelector;
|
|
103
104
|
//# sourceMappingURL=DecimalPrecision.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecimalPrecision.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/DecimalPrecision.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;
|
|
1
|
+
{"version":3,"file":"DecimalPrecision.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/DecimalPrecision.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAG/B,wDAA8C;AAC9C,yDAAsD;AAUtD;;;GAGG;AACH,SAAgB,wBAAwB,CAAC,KAAoC;IAC3E,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IACrD,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,+BAAc,GAAE,CAAC;IACvC,MAAM,OAAO,GAA2B;QACtC;YACE,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,SAAS,CAAC,uCAAuC,CAAC;SAC1D;QACD;YACE,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,SAAS,CAAC,sCAAsC,CAAC;SACzD;QACD;YACE,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,SAAS,CAAC,sCAAsC,CAAC;SACzD;QACD;YACE,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,SAAS,CAAC,wCAAwC,CAAC;SAC3D;QACD;YACE,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,SAAS,CAAC,uCAAuC,CAAC;SAC1D;QACD;YACE,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,SAAS,CAAC,uCAAuC,CAAC;SAC1D;QACD;YACE,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,SAAS,CAAC,sCAAsC,CAAC;SACzD;QACD;YACE,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,SAAS,CAAC,wCAAwC,CAAC;SAC3D;QACD;YACE,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,SAAS,CAAC,wCAAwC,CAAC;SAC3D;QACD;YACE,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,SAAS,CAAC,uCAAuC,CAAC;SAC1D;QACD;YACE,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,SAAS,CAAC,sCAAsC,CAAC;SACzD;QACD;YACE,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,SAAS,CAAC,yCAAyC,CAAC;SAC5D;QACD;YACE,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,SAAS,CAAC,yCAAyC,CAAC;SAC5D;KACF,CAAC;IAEF,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,sBAAM,IACL,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAC,OAAO,KACR,UAAU,GACd,CACH,CAAC;AACJ,CAAC;AA1ED,4DA0EC","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 type { SelectOption } from \"@itwin/itwinui-react\";\nimport { Select } from \"@itwin/itwinui-react\";\nimport { useTranslation } from \"../../useTranslation\";\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 { translate } = useTranslation();\n const options: SelectOption<number>[] = [\n {\n value: 0,\n label: translate(\"QuantityFormat.decimal_precision.zero\"),\n },\n {\n value: 1,\n label: translate(\"QuantityFormat.decimal_precision.one\"),\n },\n {\n value: 2,\n label: translate(\"QuantityFormat.decimal_precision.two\"),\n },\n {\n value: 3,\n label: translate(\"QuantityFormat.decimal_precision.three\"),\n },\n {\n value: 4,\n label: translate(\"QuantityFormat.decimal_precision.four\"),\n },\n {\n value: 5,\n label: translate(\"QuantityFormat.decimal_precision.five\"),\n },\n {\n value: 6,\n label: translate(\"QuantityFormat.decimal_precision.six\"),\n },\n {\n value: 7,\n label: translate(\"QuantityFormat.decimal_precision.seven\"),\n },\n {\n value: 8,\n label: translate(\"QuantityFormat.decimal_precision.eight\"),\n },\n {\n value: 9,\n label: translate(\"QuantityFormat.decimal_precision.nine\"),\n },\n {\n value: 10,\n label: translate(\"QuantityFormat.decimal_precision.ten\"),\n },\n {\n value: 11,\n label: translate(\"QuantityFormat.decimal_precision.eleven\"),\n },\n {\n value: 12,\n label: translate(\"QuantityFormat.decimal_precision.twelve\"),\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}\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;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,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;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,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,qBA8B5E"}
|
|
@@ -32,27 +32,28 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
exports.DecimalSeparatorSelector = void 0;
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
|
-
const UiIModelComponents_1 = require("../../UiIModelComponents");
|
|
36
35
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
36
|
+
const useTranslation_1 = require("../../useTranslation");
|
|
37
37
|
/** Component use to set Decimal Separator
|
|
38
38
|
* @internal
|
|
39
39
|
*/
|
|
40
40
|
function DecimalSeparatorSelector(props) {
|
|
41
41
|
const { separator, onChange, ...otherProps } = props;
|
|
42
|
-
const
|
|
42
|
+
const { translate } = (0, useTranslation_1.useTranslation)();
|
|
43
|
+
const options = [
|
|
43
44
|
{
|
|
44
45
|
value: ".",
|
|
45
|
-
label:
|
|
46
|
+
label: translate("QuantityFormat.decimal_separator.point"),
|
|
46
47
|
},
|
|
47
48
|
{
|
|
48
49
|
value: ",",
|
|
49
|
-
label:
|
|
50
|
+
label: translate("QuantityFormat.decimal_separator.comma"),
|
|
50
51
|
},
|
|
51
|
-
]
|
|
52
|
+
];
|
|
52
53
|
const handleOnChange = React.useCallback((newValue) => {
|
|
53
54
|
onChange && onChange(newValue);
|
|
54
55
|
}, [onChange]);
|
|
55
|
-
return (React.createElement(itwinui_react_1.Select, { options: options
|
|
56
|
+
return (React.createElement(itwinui_react_1.Select, { options: options, value: separator, onChange: handleOnChange, size: "small", ...otherProps }));
|
|
56
57
|
}
|
|
57
58
|
exports.DecimalSeparatorSelector = DecimalSeparatorSelector;
|
|
58
59
|
//# sourceMappingURL=DecimalSeparator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecimalSeparator.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/DecimalSeparator.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;
|
|
1
|
+
{"version":3,"file":"DecimalSeparator.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/DecimalSeparator.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAG/B,wDAA8C;AAC9C,yDAAsD;AAWtD;;GAEG;AACH,SAAgB,wBAAwB,CAAC,KAAoC;IAC3E,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IACrD,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,+BAAc,GAAE,CAAC;IACvC,MAAM,OAAO,GAA2B;QACtC;YACE,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,SAAS,CAAC,wCAAwC,CAAC;SAC3D;QACD;YACE,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,SAAS,CAAC,wCAAwC,CAAC;SAC3D;KACF,CAAC;IAEF,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,sBAAM,IACL,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAC,OAAO,KACR,UAAU,GACd,CACH,CAAC;AACJ,CAAC;AA9BD,4DA8BC","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 type { SelectOption } from \"@itwin/itwinui-react\";\nimport { Select } from \"@itwin/itwinui-react\";\nimport { useTranslation } from \"../../useTranslation\";\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 { translate } = useTranslation();\n const options: SelectOption<string>[] = [\n {\n value: \".\",\n label: translate(\"QuantityFormat.decimal_separator.point\"),\n },\n {\n value: \",\",\n label: translate(\"QuantityFormat.decimal_separator.comma\"),\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}\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;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,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,
|
|
1
|
+
{"version":3,"file":"FractionPrecision.d.ts","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/FractionPrecision.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,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,qBA2DtC"}
|
|
@@ -32,55 +32,56 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
exports.FractionPrecisionSelector = void 0;
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
|
-
const UiIModelComponents_1 = require("../../UiIModelComponents");
|
|
36
35
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
36
|
+
const useTranslation_1 = require("../../useTranslation");
|
|
37
37
|
/** Component use to set Fraction precision
|
|
38
38
|
* @internal
|
|
39
39
|
*/
|
|
40
40
|
function FractionPrecisionSelector(props) {
|
|
41
41
|
const { precision, onChange, ...otherProps } = props;
|
|
42
|
-
const
|
|
42
|
+
const { translate } = (0, useTranslation_1.useTranslation)();
|
|
43
|
+
const options = [
|
|
43
44
|
{
|
|
44
45
|
value: 1,
|
|
45
|
-
label:
|
|
46
|
+
label: translate("QuantityFormat.fraction_precision.whole"),
|
|
46
47
|
},
|
|
47
48
|
{
|
|
48
49
|
value: 2,
|
|
49
|
-
label:
|
|
50
|
+
label: translate("QuantityFormat.fraction_precision.half"),
|
|
50
51
|
},
|
|
51
52
|
{
|
|
52
53
|
value: 4,
|
|
53
|
-
label:
|
|
54
|
+
label: translate("QuantityFormat.fraction_precision.quarter"),
|
|
54
55
|
},
|
|
55
56
|
{
|
|
56
57
|
value: 8,
|
|
57
|
-
label:
|
|
58
|
+
label: translate("QuantityFormat.fraction_precision.eighth"),
|
|
58
59
|
},
|
|
59
60
|
{
|
|
60
61
|
value: 16,
|
|
61
|
-
label:
|
|
62
|
+
label: translate("QuantityFormat.fraction_precision.sixteenth"),
|
|
62
63
|
},
|
|
63
64
|
{
|
|
64
65
|
value: 32,
|
|
65
|
-
label:
|
|
66
|
+
label: translate("QuantityFormat.fraction_precision.over32"),
|
|
66
67
|
},
|
|
67
68
|
{
|
|
68
69
|
value: 64,
|
|
69
|
-
label:
|
|
70
|
+
label: translate("QuantityFormat.fraction_precision.over64"),
|
|
70
71
|
},
|
|
71
72
|
{
|
|
72
73
|
value: 128,
|
|
73
|
-
label:
|
|
74
|
+
label: translate("QuantityFormat.fraction_precision.over128"),
|
|
74
75
|
},
|
|
75
76
|
{
|
|
76
77
|
value: 256,
|
|
77
|
-
label:
|
|
78
|
+
label: translate("QuantityFormat.fraction_precision.over256"),
|
|
78
79
|
},
|
|
79
|
-
]
|
|
80
|
+
];
|
|
80
81
|
const handleOnChange = React.useCallback((newValue) => {
|
|
81
82
|
onChange && onChange(newValue);
|
|
82
83
|
}, [onChange]);
|
|
83
|
-
return (React.createElement(itwinui_react_1.Select, { options: options
|
|
84
|
+
return (React.createElement(itwinui_react_1.Select, { options: options, value: precision, onChange: handleOnChange, size: "small", ...otherProps }));
|
|
84
85
|
}
|
|
85
86
|
exports.FractionPrecisionSelector = FractionPrecisionSelector;
|
|
86
87
|
//# sourceMappingURL=FractionPrecision.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FractionPrecision.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/FractionPrecision.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;
|
|
1
|
+
{"version":3,"file":"FractionPrecision.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/FractionPrecision.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAG/B,wDAA8C;AAC9C,yDAAsD;AAUtD;;GAEG;AACH,SAAgB,yBAAyB,CACvC,KAAqC;IAErC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IACrD,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,+BAAc,GAAE,CAAC;IACvC,MAAM,OAAO,GAA2B;QACtC;YACE,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,SAAS,CAAC,yCAAyC,CAAC;SAC5D;QACD;YACE,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,SAAS,CAAC,wCAAwC,CAAC;SAC3D;QACD;YACE,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,SAAS,CAAC,2CAA2C,CAAC;SAC9D;QACD;YACE,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,SAAS,CAAC,0CAA0C,CAAC;SAC7D;QACD;YACE,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,SAAS,CAAC,6CAA6C,CAAC;SAChE;QACD;YACE,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,SAAS,CAAC,0CAA0C,CAAC;SAC7D;QACD;YACE,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,SAAS,CAAC,0CAA0C,CAAC;SAC7D;QACD;YACE,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,SAAS,CAAC,2CAA2C,CAAC;SAC9D;QACD;YACE,KAAK,EAAE,GAAG;YACV,KAAK,EAAE,SAAS,CAAC,2CAA2C,CAAC;SAC9D;KACF,CAAC;IAEF,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,sBAAM,IACL,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAC,OAAO,KACR,UAAU,GACd,CACH,CAAC;AACJ,CAAC;AA5DD,8DA4DC","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 type { SelectOption } from \"@itwin/itwinui-react\";\nimport { Select } from \"@itwin/itwinui-react\";\nimport { useTranslation } from \"../../useTranslation\";\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 { translate } = useTranslation();\n const options: SelectOption<number>[] = [\n {\n value: 1,\n label: translate(\"QuantityFormat.fraction_precision.whole\"),\n },\n {\n value: 2,\n label: translate(\"QuantityFormat.fraction_precision.half\"),\n },\n {\n value: 4,\n label: translate(\"QuantityFormat.fraction_precision.quarter\"),\n },\n {\n value: 8,\n label: translate(\"QuantityFormat.fraction_precision.eighth\"),\n },\n {\n value: 16,\n label: translate(\"QuantityFormat.fraction_precision.sixteenth\"),\n },\n {\n value: 32,\n label: translate(\"QuantityFormat.fraction_precision.over32\"),\n },\n {\n value: 64,\n label: translate(\"QuantityFormat.fraction_precision.over64\"),\n },\n {\n value: 128,\n label: translate(\"QuantityFormat.fraction_precision.over128\"),\n },\n {\n value: 256,\n label: translate(\"QuantityFormat.fraction_precision.over256\"),\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}\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;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ScientificType.d.ts","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/ScientificType.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD;;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,qBA8BxE"}
|
|
@@ -32,28 +32,29 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
exports.ScientificTypeSelector = void 0;
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
|
-
const UiIModelComponents_1 = require("../../UiIModelComponents");
|
|
36
35
|
const core_quantity_1 = require("@itwin/core-quantity");
|
|
37
36
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
37
|
+
const useTranslation_1 = require("../../useTranslation");
|
|
38
38
|
/** Component use to set Scientific type.
|
|
39
39
|
* @internal
|
|
40
40
|
*/
|
|
41
41
|
function ScientificTypeSelector(props) {
|
|
42
42
|
const { type, onChange, ...otherProps } = props;
|
|
43
|
-
const
|
|
43
|
+
const { translate } = (0, useTranslation_1.useTranslation)();
|
|
44
|
+
const formatOptions = [
|
|
44
45
|
{
|
|
45
46
|
value: core_quantity_1.ScientificType.Normalized,
|
|
46
|
-
label:
|
|
47
|
+
label: translate("QuantityFormat.scientific-type.normalized"),
|
|
47
48
|
},
|
|
48
49
|
{
|
|
49
50
|
value: core_quantity_1.ScientificType.ZeroNormalized,
|
|
50
|
-
label:
|
|
51
|
+
label: translate("QuantityFormat.scientific-type.zero-normalized"),
|
|
51
52
|
},
|
|
52
|
-
]
|
|
53
|
+
];
|
|
53
54
|
const handleOnChange = React.useCallback((newValue) => {
|
|
54
55
|
onChange && onChange(newValue);
|
|
55
56
|
}, [onChange]);
|
|
56
|
-
return (React.createElement(itwinui_react_1.Select, { options: formatOptions
|
|
57
|
+
return (React.createElement(itwinui_react_1.Select, { options: formatOptions, value: type, onChange: handleOnChange, size: "small", ...otherProps }));
|
|
57
58
|
}
|
|
58
59
|
exports.ScientificTypeSelector = ScientificTypeSelector;
|
|
59
60
|
//# sourceMappingURL=ScientificType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScientificType.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/ScientificType.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,
|
|
1
|
+
{"version":3,"file":"ScientificType.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/ScientificType.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,wDAAsD;AAEtD,wDAA8C;AAC9C,yDAAsD;AAWtD;;GAEG;AACH,SAAgB,sBAAsB,CAAC,KAAkC;IACvE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAChD,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,+BAAc,GAAE,CAAC;IACvC,MAAM,aAAa,GAAmC;QACpD;YACE,KAAK,EAAE,8BAAc,CAAC,UAAU;YAChC,KAAK,EAAE,SAAS,CAAC,2CAA2C,CAAC;SAC9D;QACD;YACE,KAAK,EAAE,8BAAc,CAAC,cAAc;YACpC,KAAK,EAAE,SAAS,CAAC,gDAAgD,CAAC;SACnE;KACF,CAAC;IAEF,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,sBAAM,IACL,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAC,OAAO,KACR,UAAU,GACd,CACH,CAAC;AACJ,CAAC;AA9BD,wDA8BC","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 { ScientificType } from \"@itwin/core-quantity\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { Select } from \"@itwin/itwinui-react\";\nimport { useTranslation } from \"../../useTranslation\";\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 { translate } = useTranslation();\n const formatOptions: SelectOption<ScientificType>[] = [\n {\n value: ScientificType.Normalized,\n label: translate(\"QuantityFormat.scientific-type.normalized\"),\n },\n {\n value: ScientificType.ZeroNormalized,\n label: translate(\"QuantityFormat.scientific-type.zero-normalized\"),\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}\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;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"SignOption.d.ts","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/SignOption.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD;;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,qBAsChE"}
|
|
@@ -32,36 +32,37 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
exports.SignOptionSelector = void 0;
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
|
-
const UiIModelComponents_1 = require("../../UiIModelComponents");
|
|
36
35
|
const core_quantity_1 = require("@itwin/core-quantity");
|
|
37
36
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
37
|
+
const useTranslation_1 = require("../../useTranslation");
|
|
38
38
|
/** Component use to set Sign option.
|
|
39
39
|
* @internal
|
|
40
40
|
*/
|
|
41
41
|
function SignOptionSelector(props) {
|
|
42
42
|
const { signOption, onChange, ...otherProps } = props;
|
|
43
|
-
const
|
|
43
|
+
const { translate } = (0, useTranslation_1.useTranslation)();
|
|
44
|
+
const options = [
|
|
44
45
|
{
|
|
45
46
|
value: core_quantity_1.ShowSignOption.NoSign,
|
|
46
|
-
label:
|
|
47
|
+
label: translate("QuantityFormat.sign_option.noSign"),
|
|
47
48
|
},
|
|
48
49
|
{
|
|
49
50
|
value: core_quantity_1.ShowSignOption.OnlyNegative,
|
|
50
|
-
label:
|
|
51
|
+
label: translate("QuantityFormat.sign_option.onlyNegative"),
|
|
51
52
|
},
|
|
52
53
|
{
|
|
53
54
|
value: core_quantity_1.ShowSignOption.SignAlways,
|
|
54
|
-
label:
|
|
55
|
+
label: translate("QuantityFormat.sign_option.signAlways"),
|
|
55
56
|
},
|
|
56
57
|
{
|
|
57
58
|
value: core_quantity_1.ShowSignOption.NegativeParentheses,
|
|
58
|
-
label:
|
|
59
|
+
label: translate("QuantityFormat.sign_option.negativeParentheses"),
|
|
59
60
|
},
|
|
60
|
-
]
|
|
61
|
+
];
|
|
61
62
|
const handleOnChange = React.useCallback((newValue) => {
|
|
62
63
|
onChange && onChange(newValue);
|
|
63
64
|
}, [onChange]);
|
|
64
|
-
return (React.createElement(itwinui_react_1.Select, { options: options
|
|
65
|
+
return (React.createElement(itwinui_react_1.Select, { options: options, value: signOption, onChange: handleOnChange, size: "small", ...otherProps }));
|
|
65
66
|
}
|
|
66
67
|
exports.SignOptionSelector = SignOptionSelector;
|
|
67
68
|
//# sourceMappingURL=SignOption.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignOption.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/SignOption.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,
|
|
1
|
+
{"version":3,"file":"SignOption.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/SignOption.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,wDAAsD;AAEtD,wDAA8C;AAC9C,yDAAsD;AAUtD;;GAEG;AACH,SAAgB,kBAAkB,CAAC,KAA8B;IAC/D,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IACtD,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,+BAAc,GAAE,CAAC;IACvC,MAAM,OAAO,GAAmC;QAC9C;YACE,KAAK,EAAE,8BAAc,CAAC,MAAM;YAC5B,KAAK,EAAE,SAAS,CAAC,mCAAmC,CAAC;SACtD;QACD;YACE,KAAK,EAAE,8BAAc,CAAC,YAAY;YAClC,KAAK,EAAE,SAAS,CAAC,yCAAyC,CAAC;SAC5D;QACD;YACE,KAAK,EAAE,8BAAc,CAAC,UAAU;YAChC,KAAK,EAAE,SAAS,CAAC,uCAAuC,CAAC;SAC1D;QACD;YACE,KAAK,EAAE,8BAAc,CAAC,mBAAmB;YACzC,KAAK,EAAE,SAAS,CAAC,gDAAgD,CAAC;SACnE;KACF,CAAC;IAEF,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,sBAAM,IACL,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAC,OAAO,KACR,UAAU,GACd,CACH,CAAC;AACJ,CAAC;AAtCD,gDAsCC","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 { ShowSignOption } from \"@itwin/core-quantity\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { Select } from \"@itwin/itwinui-react\";\nimport { useTranslation } from \"../../useTranslation\";\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 { translate } = useTranslation();\n const options: SelectOption<ShowSignOption>[] = [\n {\n value: ShowSignOption.NoSign,\n label: translate(\"QuantityFormat.sign_option.noSign\"),\n },\n {\n value: ShowSignOption.OnlyNegative,\n label: translate(\"QuantityFormat.sign_option.onlyNegative\"),\n },\n {\n value: ShowSignOption.SignAlways,\n label: translate(\"QuantityFormat.sign_option.signAlways\"),\n },\n {\n value: ShowSignOption.NegativeParentheses,\n label: translate(\"QuantityFormat.sign_option.negativeParentheses\"),\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}\n value={signOption}\n onChange={handleOnChange}\n size=\"small\"\n {...otherProps}\n />\n );\n}\n"]}
|
package/lib/cjs/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;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,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;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,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,qBAoD5E"}
|
|
@@ -32,44 +32,45 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
exports.StationSeparatorSelector = void 0;
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
|
-
const UiIModelComponents_1 = require("../../UiIModelComponents");
|
|
36
35
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
36
|
+
const useTranslation_1 = require("../../useTranslation");
|
|
37
37
|
/** Component use to setStation separator.
|
|
38
38
|
* @internal
|
|
39
39
|
*/
|
|
40
40
|
function StationSeparatorSelector(props) {
|
|
41
41
|
const { separator, disabled, onChange, ...otherProps } = props;
|
|
42
|
-
const
|
|
43
|
-
{
|
|
44
|
-
value: "+",
|
|
45
|
-
label: UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.station_separator.plus"),
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
value: "-",
|
|
49
|
-
label: UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.station_separator.minus"),
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
value: " ",
|
|
53
|
-
label: UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.station_separator.blank"),
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
value: "^",
|
|
57
|
-
label: UiIModelComponents_1.UiIModelComponents.translate("QuantityFormat.station_separator.caret"),
|
|
58
|
-
},
|
|
59
|
-
]);
|
|
42
|
+
const { translate } = (0, useTranslation_1.useTranslation)();
|
|
60
43
|
const handleOnChange = React.useCallback((newValue) => {
|
|
61
44
|
onChange && onChange(newValue);
|
|
62
45
|
}, [onChange]);
|
|
63
46
|
const separatorOptions = React.useMemo(() => {
|
|
47
|
+
const uomDefaultEntries = [
|
|
48
|
+
{
|
|
49
|
+
value: "+",
|
|
50
|
+
label: translate("QuantityFormat.station_separator.plus"),
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
value: "-",
|
|
54
|
+
label: translate("QuantityFormat.station_separator.minus"),
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
value: " ",
|
|
58
|
+
label: translate("QuantityFormat.station_separator.blank"),
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
value: "^",
|
|
62
|
+
label: translate("QuantityFormat.station_separator.caret"),
|
|
63
|
+
},
|
|
64
|
+
];
|
|
64
65
|
const completeListOfEntries = [];
|
|
65
66
|
// istanbul ignore next (only used if format already has a character that does not match standard options)
|
|
66
67
|
if (undefined ===
|
|
67
|
-
uomDefaultEntries.
|
|
68
|
+
uomDefaultEntries.find((option) => option.value === separator)) {
|
|
68
69
|
completeListOfEntries.push({ value: separator, label: separator });
|
|
69
70
|
}
|
|
70
|
-
completeListOfEntries.push(...uomDefaultEntries
|
|
71
|
+
completeListOfEntries.push(...uomDefaultEntries);
|
|
71
72
|
return completeListOfEntries;
|
|
72
|
-
}, [separator]);
|
|
73
|
+
}, [separator, translate]);
|
|
73
74
|
return (React.createElement(itwinui_react_1.Select, { options: separatorOptions, disabled: disabled, value: separator, onChange: handleOnChange, size: "small", ...otherProps }));
|
|
74
75
|
}
|
|
75
76
|
exports.StationSeparatorSelector = StationSeparatorSelector;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StationSeparatorSelector.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/StationSeparatorSelector.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;
|
|
1
|
+
{"version":3,"file":"StationSeparatorSelector.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/StationSeparatorSelector.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAG/B,wDAA8C;AAC9C,yDAAsD;AAWtD;;GAEG;AACH,SAAgB,wBAAwB,CAAC,KAAoC;IAC3E,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAC/D,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,+BAAc,GAAE,CAAC;IAEvC,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,iBAAiB,GAA2B;YAChD;gBACE,KAAK,EAAE,GAAG;gBACV,KAAK,EAAE,SAAS,CAAC,uCAAuC,CAAC;aAC1D;YACD;gBACE,KAAK,EAAE,GAAG;gBACV,KAAK,EAAE,SAAS,CAAC,wCAAwC,CAAC;aAC3D;YACD;gBACE,KAAK,EAAE,GAAG;gBACV,KAAK,EAAE,SAAS,CAAC,wCAAwC,CAAC;aAC3D;YACD;gBACE,KAAK,EAAE,GAAG;gBACV,KAAK,EAAE,SAAS,CAAC,wCAAwC,CAAC;aAC3D;SACF,CAAC;QACF,MAAM,qBAAqB,GAA2B,EAAE,CAAC;QACzD,0GAA0G;QAC1G,IACE,SAAS;YACT,iBAAiB,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,EAC9D;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,CAAC;QACjD,OAAO,qBAAqB,CAAC;IAC/B,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;IAE3B,OAAO,CACL,oBAAC,sBAAM,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;AApDD,4DAoDC","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 type { SelectOption } from \"@itwin/itwinui-react\";\nimport { Select } from \"@itwin/itwinui-react\";\nimport { useTranslation } from \"../../useTranslation\";\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 { translate } = useTranslation();\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 uomDefaultEntries: SelectOption<string>[] = [\n {\n value: \"+\",\n label: translate(\"QuantityFormat.station_separator.plus\"),\n },\n {\n value: \"-\",\n label: translate(\"QuantityFormat.station_separator.minus\"),\n },\n {\n value: \" \",\n label: translate(\"QuantityFormat.station_separator.blank\"),\n },\n {\n value: \"^\",\n label: translate(\"QuantityFormat.station_separator.caret\"),\n },\n ];\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.find((option) => option.value === separator)\n ) {\n completeListOfEntries.push({ value: separator, label: separator });\n }\n completeListOfEntries.push(...uomDefaultEntries);\n return completeListOfEntries;\n }, [separator, translate]);\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;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,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;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,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,qBA+BlE"}
|
|
@@ -32,27 +32,28 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
exports.StationSizeSelector = void 0;
|
|
34
34
|
const React = __importStar(require("react"));
|
|
35
|
-
const UiIModelComponents_1 = require("../../UiIModelComponents");
|
|
36
35
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
36
|
+
const useTranslation_1 = require("../../useTranslation");
|
|
37
37
|
/** Component use to set Station size (number of digits from right until '+').
|
|
38
38
|
* @internal
|
|
39
39
|
*/
|
|
40
40
|
function StationSizeSelector(props) {
|
|
41
41
|
const { value, disabled, onChange, ...otherProps } = props;
|
|
42
|
-
const
|
|
42
|
+
const { translate } = (0, useTranslation_1.useTranslation)();
|
|
43
|
+
const separatorOptions = [
|
|
43
44
|
{
|
|
44
45
|
value: 2,
|
|
45
|
-
label:
|
|
46
|
+
label: translate("QuantityFormat.station_size.two"),
|
|
46
47
|
},
|
|
47
48
|
{
|
|
48
49
|
value: 3,
|
|
49
|
-
label:
|
|
50
|
+
label: translate("QuantityFormat.station_size.three"),
|
|
50
51
|
},
|
|
51
|
-
]
|
|
52
|
+
];
|
|
52
53
|
const handleOnChange = React.useCallback((newValue) => {
|
|
53
54
|
onChange && onChange(newValue);
|
|
54
55
|
}, [onChange]);
|
|
55
|
-
return (React.createElement(itwinui_react_1.Select, { options: separatorOptions
|
|
56
|
+
return (React.createElement(itwinui_react_1.Select, { options: separatorOptions, disabled: disabled, value: value, onChange: handleOnChange, size: "small", ...otherProps }));
|
|
56
57
|
}
|
|
57
58
|
exports.StationSizeSelector = StationSizeSelector;
|
|
58
59
|
//# sourceMappingURL=StationSizeSelector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StationSizeSelector.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/StationSizeSelector.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;
|
|
1
|
+
{"version":3,"file":"StationSizeSelector.js","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/StationSizeSelector.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAG/B,wDAA8C;AAC9C,yDAAsD;AAWtD;;GAEG;AACH,SAAgB,mBAAmB,CAAC,KAA+B;IACjE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAC3D,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,+BAAc,GAAE,CAAC;IACvC,MAAM,gBAAgB,GAA2B;QAC/C;YACE,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,SAAS,CAAC,iCAAiC,CAAC;SACpD;QACD;YACE,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,SAAS,CAAC,mCAAmC,CAAC;SACtD;KACF,CAAC;IAEF,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,sBAAM,IACL,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAC,OAAO,KACR,UAAU,GACd,CACH,CAAC;AACJ,CAAC;AA/BD,kDA+BC","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 type { SelectOption } from \"@itwin/itwinui-react\";\nimport { Select } from \"@itwin/itwinui-react\";\nimport { useTranslation } from \"../../useTranslation\";\n\n/** Properties of [[StationSizeSelector]] component.\n * @internal\n */\nexport interface StationSizeSelectorProps extends CommonProps {\n value: number;\n disabled: boolean;\n onChange: (value: number) => void;\n}\n\n/** Component use to set Station size (number of digits from right until '+').\n * @internal\n */\nexport function StationSizeSelector(props: StationSizeSelectorProps) {\n const { value, disabled, onChange, ...otherProps } = props;\n const { translate } = useTranslation();\n const separatorOptions: SelectOption<number>[] = [\n {\n value: 2,\n label: translate(\"QuantityFormat.station_size.two\"),\n },\n {\n value: 3,\n label: translate(\"QuantityFormat.station_size.three\"),\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={separatorOptions}\n disabled={disabled}\n value={value}\n onChange={handleOnChange}\n size=\"small\"\n {...otherProps}\n />\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThousandsSelector.d.ts","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/ThousandsSelector.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKrD;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"ThousandsSelector.d.ts","sourceRoot":"","sources":["../../../../../src/imodel-components-react/quantityformat/misc/ThousandsSelector.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKrD;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,qBAmC9D"}
|