/*---------------------------------------------------------------------------------------------
 * 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 { CustomNumberEditor as BaseCustomNumberEditor, CustomNumberPropertyEditor as BaseCustomNumberPropertyEditor, } from "@itwin/components-react";
import { LockButtonInputDecoration, useLockDecoration, } from "./LockProvider.js";
import { useToolSettingsKeyPressCommit } from "../preview/tool-settings-key-press-commit/useToolSettingsKeyPressCommit.js";
/** @internal */
export class CustomNumberPropertyEditor extends BaseCustomNumberPropertyEditor {
    get reactNode() {
        return React.createElement(CustomNumberEditor, null);
    }
}
const CustomNumberEditor = React.forwardRef(function CustomNumberEditor(props, forwardedRef) {
    const shouldCommitOnChange = useToolSettingsKeyPressCommit();
    const lockDecoration = useLockDecoration();
    const internalProps = {
        decoration: lockDecoration ? React.createElement(LockButtonInputDecoration, null) : undefined,
    };
    return (React.createElement(BaseCustomNumberEditor, { ...props, ...internalProps, shouldCommitOnChange: shouldCommitOnChange, ref: forwardedRef }));
});
//# sourceMappingURL=CustomNumberEditor.js.map