import { Input } from '@/component/ui/input' import { ElementDefinition } from '@/entitiy/element/model/interface' import { Hash } from 'lucide-react' interface NumberConfig { placeholder?: string required?: boolean targetCells: any[] } export const numberDefinition: ElementDefinition = { type: 'number', label: 'Число', icon: , version: 1, defaultConfig: { placeholder: '', required: false, targetCells: [], }, mapToCells: config => config.targetCells || [], mapToCellValues: (config, value) => { const cells = config.targetCells || [] return cells.map(target => ({ target, value: value || 0 })) }, Editor: () => (
Дополнительные настройки отсутствуют
), Preview: ({ config }) => (
Предпросмотр
), Render: ({ config, value, onChange }) => ( onChange?.(parseFloat(e.target.value) || 0)} required={config.required} /> ), }