/*---------------------------------------------------------------------------------------------
 * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
 * See LICENSE.md in the project root for license terms and full copyright notice.
 *--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module PropertyEditors
 */
import * as React from "react";
import { NumericInputEditor as BaseNumericInputEditor, NumericInputPropertyEditor as BaseNumericInputPropertyEditor, } from "@itwin/components-react";
import { LockButtonInputDecoration, useLockDecoration, } from "./LockProvider.js";
import { useToolSettingsKeyPressCommit } from "../preview/tool-settings-key-press-commit/useToolSettingsKeyPressCommit.js";
/** @internal */
export class NumericInputPropertyEditor extends BaseNumericInputPropertyEditor {
    get reactNode() {
        return React.createElement(NumericEditor, null);
    }
}
const NumericEditor = React.forwardRef(function NumericEditor(props, forwardedRef) {
    const shouldCommitOnChange = useToolSettingsKeyPressCommit();
    const lockDecoration = useLockDecoration();
    const internalProps = {
        decoration: lockDecoration ? React.createElement(LockButtonInputDecoration, null) : undefined,
    };
    return (React.createElement(BaseNumericInputEditor, { ...props, ...internalProps, shouldCommitOnChange: shouldCommitOnChange, ref: forwardedRef }));
});
//# sourceMappingURL=NumericEditor.js.map