import { jsx as _jsx } from "react/jsx-runtime";
import { OIDField } from '../../../scalars/components/oid-field/index.js';
import { normalizeStringValue } from './utils.js';
export const buildOidCellEditor = (oidFieldProps) => {
    const OidCellEditor = (value, onChange, context) => {
        const oidValue = normalizeStringValue(value);
        if (oidFieldProps.autoComplete !== false && oidFieldProps.fetchOptionsCallback) {
            const { autoComplete: _1, fetchOptionsCallback, ...restProps } = oidFieldProps;
            return (_jsx(OIDField, { name: context.column.field, className: "max-w-full", autoFocus: true, fetchOptionsCallback: fetchOptionsCallback, ...restProps, value: oidValue, onChange: (value) => {
                    onChange(value);
                } }));
        }
        const { autoComplete: _1, fetchOptionsCallback: _2, fetchSelectedOptionCallback: _3, previewPlaceholder: _4, ...restProps } = oidFieldProps;
        return (_jsx(OIDField, { name: context.column.field, className: "max-w-full", autoFocus: true, autoComplete: false, ...restProps, value: oidValue, onChange: (value) => {
                onChange(value);
            } }));
    };
    return OidCellEditor;
};
//# sourceMappingURL=oid-editor.js.map