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

<Meta of={InputStories} />

# GridEditorInputTime

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

This editor is used to edit values in the hh:mm format

<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 { GridEditorInputTime, Column } from '@planview/pv-grid'

const EditableColumn: Column = {
    id: 'timeAdded',
    label: 'Time added',
    cell: {
        editable: true,
        Editor: GridEditorInputTime,
    },
}
```

If you want to customize any additional props:

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

const EditableColumn: Column = {
    id: 'timeAdded',
    label: 'Time added',
    cell: {
        editable: true,
        Editor(props) {
            return <GridEditorInputTime {...props} placeholder="Valid value" />
        },
    },
}
```
