UNPKG

@itwin/quantity-formatting-react

Version:

React components and utilities for quantity formatting

19 lines 1.33 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; /*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ import * as React from "react"; import { StationSizeSelector } from "./misc/StationSizeSelector.js"; import { useTranslation } from "../../../useTranslation.js"; import { Label } from "@itwin/itwinui-react"; /** Component to show/edit Station Format Offset Size. * @internal */ export function StationOffset(props) { const { formatProps, onChange } = props; const { translate } = useTranslation(); const stationOffsetSelectorId = React.useId(); return (_jsxs("div", { className: "quantityFormat--formatInlineRow", children: [_jsx(Label, { displayStyle: "inline", id: stationOffsetSelectorId, children: translate("QuantityFormat:labels.stationOffsetLabel") }), _jsx(StationSizeSelector, { "aria-labelledby": stationOffsetSelectorId, value: formatProps.stationOffsetSize ?? 2, onChange: (value) => onChange({ ...formatProps, stationOffsetSize: value }) })] })); } //# sourceMappingURL=StationOffset.js.map