import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks'
import * as InputStories from './input-numeric.stories.tsx'

<Meta of={InputStories} />

# GridEditorInputNumeric

```tsx
import { GridEditorInputNumeric } from '@planview/pv-grid'
```

This editor is used to edit numeric values such as quantities, monetary values, percentages and similar types of data.

<Canvas of={InputStories.Default} />

### Props provided by the Grid (via `Editor`)

Additional props are provided by the grid that are not used by this editor.

<Controls include={['value', 'onConfirm', 'onCancel', 'tabIndex']} />

### Props to customize behavior

<Controls exclude={['value', 'onConfirm', 'onCancel', 'tabIndex']} />

## Usage with Column definition

This component should be used as part of a custom `Editor` method on the Column configuration.

```tsx
import { GridEditorInputNumeric, Column } from '@planview/pv-grid'

const EditableColumn: Column = {
    id: 'noItem',
    label: 'Number of items',
    cell: {
        editable: true,
        Editor: GridEditorInputNumeric,
    },
}
```

If you want to customize any additional props:

```tsx
import { GridEditorInputNumeric, Column } from '@planview/pv-grid'

const EditableColumn: Column = {
    id: 'noItem',
    label: 'Number of items',
    cell: {
        editable: true,
        Editor(props) {
            return (
                <GridEditorInputNumeric {...props} placeholder="Valid value" />
            )
        },
    },
}
```
