## class: `WyFileItem`, `wy-file-item`

File list item showing file icon, name and actions.

**Used sub components:**

*   [`<wy-item>`](./ui/wy-item)
*   [`<wy-icon>`](./ui/wy-icon)
*   [`<wy-file-menu>`](./wy-file-menu)

### Fields

| Name          | Type                          | Default            | Description                                        | Inherited From |
| ------------- | ----------------------------- | ------------------ | -------------------------------------------------- | -------------- |
| `file`        | `FileType \| undefined`       |                    | File data displayed in the list item.              |                |
| `status`      | `FileStatusType`              | `{ state: "ok", }` | Current status metadata for the file item.         |                |
| `interactive` | `boolean`                     | `false`            | Enable interactive hover/focus styling.            |                |
| `rounded`     | `boolean`                     | `false`            | Render the item with rounded corners.              |                |
| `actionType`  | `FileActionType \| undefined` |                    | Optional action type used for contextual handling. |                |

### Methods

| Name                    | Description                                                               | Parameters                           | Return | Inherited From |
| ----------------------- | ------------------------------------------------------------------------- | ------------------------------------ | ------ | -------------- |
| `dispatchEditName`      | Emit an \`edit-name\` event requesting rename mode for the provided file. | `file: FileType`                     |        |                |
| `dispatchRename`        | Emit a \`rename\` event with a new filename.                              | `file: FileType, name: string`       |        |                |
| `dispatchTrash`         | Emit a \`trash\` event to move the file to the recycle bin.               | `file: FileType`                     |        |                |
| `dispatchRestore`       | Emit a \`restore\` event to recover the provided file.                    | `file: FileType`                     |        |                |
| `dispatchDeleteForever` | Emit a \`delete-forever\` event to permanently remove the file.           | `file: FileType`                     |        |                |
| `dispatchSubscribe`     | Emit a \`subscribe\` event toggling subscription for the file.            | `file: FileType, subscribe: boolean` |        |                |

### Events

| Name             | Type                         | Description                                 | Inherited From |
| ---------------- | ---------------------------- | ------------------------------------------- | -------------- |
| `edit-name`      | `FileEditNameEventType`      | Emitted when rename mode is requested.      |                |
| `rename`         | `FileRenameEventType`        | Emitted when a file rename is confirmed.    |                |
| `trash`          | `FileTrashEventType`         | Emitted when a file is trashed.             |                |
| `restore`        | `FileRestoreEventType`       | Emitted when a file is restored.            |                |
| `delete-forever` | `FileDeleteForeverEventType` | Emitted when a file is permanently deleted. |                |
| `subscribe`      | `FileSubscribeEventType`     | Emitted when subscribe state is toggled.    |                |

### Attributes

| Name          | Field       | Inherited From |
| ------------- | ----------- | -------------- |
| `file`        | file        |                |
| `status`      | status      |                |
| `interactive` | interactive |                |
| `rounded`     | rounded     |                |
| `actionType`  | actionType  |                |

### CSS Parts

| Name       | Description                      |
| ---------- | -------------------------------- |
| `wy-input` | Input used when renaming a file. |

### Slots

| Name      | Description                          |
| --------- | ------------------------------------ |
| `title`   | Custom title content for the item.   |
| `actions` | Actions slot (e.g. buttons / menus). |

<hr/>

## Exports

| Kind                        | Name           | Declaration | Module                         | Package |
| --------------------------- | -------------- | ----------- | ------------------------------ | ------- |
| `js`                        | `WyFileItem`   | WyFileItem  | lib/components/wy-file-item.ts |         |
| `custom-element-definition` | `wy-file-item` | WyFileItem  | lib/components/wy-file-item.ts |         |
