UNPKG

@itwin/presentation-components

Version:

React components based on iTwin.js Presentation library

39 lines 1.34 kB
import { ChangeEventHandler } from "react"; import { SchemaContext } from "@itwin/ecschema-metadata"; import { PropertyValueConstraints } from "../../common/ContentBuilder.js"; /** * Value of kind of quantity property. * @internal */ export interface QuantityValue { /** Raw value in persistence unit. */ rawValue?: number; /** Formatted value with unit label based on active unit system or user input. With precision set to 12. */ highPrecisionFormattedValue: string; /** Formatted value with unit label based on active unit system or user input. Default precision. */ defaultFormattedValue: string; roundingError?: number; } /** * Props for [[useQuantityValueInput]] * @internal */ export interface UseQuantityValueInputProps { initialRawValue?: number; schemaContext: SchemaContext; koqName: string; constraints?: PropertyValueConstraints; } /** * Custom hook that manages state for quantity values input. * @internal */ export declare function useQuantityValueInput({ initialRawValue, schemaContext, koqName, constraints, }: UseQuantityValueInputProps): { quantityValue: QuantityValue; inputProps: { onChange: ChangeEventHandler<HTMLInputElement>; placeholder: string; disabled: boolean; }; }; //# sourceMappingURL=UseQuantityValueInput.d.ts.map