import { jsx as _jsx } from "react/jsx-runtime";
import { cn } from '../../../utils/cn.js';
import { DataFormFieldLayout } from '../shared/data_form_field_layout.js';
export function TelField(props) {
    const { field, mode, value, config, on_change, on_blur } = props;
    const string_value = value != null ? String(value) : '';
    const field_style = config.style_resolver.has_style(mode === 'view' ? 'field_view' : 'field')
        ? config.style_resolver.to_style(mode === 'view' ? 'field_view' : 'field')
        : undefined;
    return (_jsx(DataFormFieldLayout, { ...props, children: mode === 'edit' ? (_jsx("input", { type: "tel", className: cn('cls_data_form_tel_input', 'w-full'), style: field_style, value: string_value, placeholder: field.placeholder, disabled: field.disabled, onChange: (e) => on_change(e.target.value), onBlur: on_blur })) : (_jsx("div", { className: "cls_data_form_tel_view", style: field_style, children: string_value || '\u00A0' })) }));
}
//# sourceMappingURL=tel_field.js.map