import {
  Meta,
  Title,
  Primary,
  Controls,
  Stories,
} from '@storybook/addon-docs/blocks';

<Meta title="Changelog/Migration de Combobox" />

# Migration

Les composants de type "select" (`BmsSelect`, `BmsMultiSelect`, `BmsAutocomplete`, `BmsServerAutocomplete`)
ont été regroupés dans un composant `BmsCombobox` adaptable avec des options `multiple`, `autocomplete` et `request`.

En dehors de ces options, l'API du composant reste identique.

## BmsSelect -> BmsCombobox

Aucune modification nécessaire.

```jsx
<BmsSelect :options="options" v-model="modelValue" :label="label" :disabled="disabled" :small="small" />
```

```jsx
<BmsCombobox :options="options" v-model="modelValue" :label="label" :disabled="disabled" :small="small" />
```

## BmsMultiSelect -> BmsCombobox

Ajouter la prop `multiple`.

```jsx
<BmsSelect :options="options" v-model="modelValue" :label="label" :disabled="disabled" :small="small" />
```

```jsx
<BmsCombobox  multiple :options="options" v-model="modelValue" :label="label" :disabled="disabled" :small="small" />
```

## BmsAutocomplete -> BmsCombobox

Ajouter la prop `autocomplete`.

```jsx
<BmsAutocomplete :options="options" v-model="modelValue" :label="label" :disabled="disabled" :small="small" :can-add-new-option="true" @addNewOption="onAddNewOption" />
```

```jsx
<BmsCombobox autocomplete :options="options" v-model="modelValue" :label="label" :disabled="disabled" :small="small"  :can-add-new-option="true" @addNewOption="onAddNewOption" />
```

## BmsServerAutocomplete -> BmsCombobox

Ajouter la prop `autocomplete`. Le composant fonctionne en mode "server" dès lors que la prop `request` est présente.

```jsx
<BmsAutocomplete :request="request" v-model="modelValue" :label="label" :disabled="disabled" :small="small" :can-add-new-option="true" @addNewOption="onAddNewOption" />
```

```jsx
<BmsCombobox autocomplete :request="request" v-model="modelValue" :label="label" :disabled="disabled" :small="small"  :can-add-new-option="true" @addNewOption="onAddNewOption" />
```
