Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoala committed Feb 13, 2025
1 parent ba334e4 commit c1f9d74
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ You can also call `setData` manually.
Options can be either passed to the constructor (eg: optionName) or in data-option-name format. You can also use the `data-config` attribute with a json encoded string.

| Name | Type | Description |
| -------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
|----------------------|----------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| items | <code>Array.&lt;(Suggestion\|SuggestionGroup)&gt;</code> | Source items |
| allowNew | <code>Boolean</code> | Allows creation of new tags |
| showAllSuggestions | <code>Boolean</code> | Show all suggestions even if they don't match. Disables validation. |
Expand Down Expand Up @@ -137,6 +137,7 @@ Options can be either passed to the constructor (eg: optionName) or in data-opti
| onClearItem | [<code>ValueCallback</code>](#ValueCallback) | Callback function to call on clear |
| onCreateItem | [<code>CreateCallback</code>](#CreateCallback) | Callback function when an item is created |
| onBlur | [<code>EventCallback</code>](#EventCallback) | Callback function on blur |
| onDataLoaded | [<code>DataCallback</code>](#DataCallback) | Callback function on data load |
| onFocus | [<code>EventCallback</code>](#EventCallback) | Callback function on focus |
| onCanAdd | [<code>AddCallback</code>](#AddCallback) | Callback function to validate item. Return false to show validation message. |
| onServerResponse | [<code>ServerCallback</code>](#ServerCallback) | Callback function to process server response. Must return a Promise |
Expand All @@ -150,12 +151,21 @@ To know more about these features, check the demo!

## Callbacks

<a name="DataCallback"></a>

### DataCallback ⇒ <code>void</code>

| Param | Type |
|-------|----------------------------|
| src | <code>*</code> |
| inst | [<code>Tags</code>](#Tags) |

<a name="EventCallback"></a>

### EventCallback ⇒ <code>void</code>

| Param | Type |
| ----- | -------------------------- |
|-------|----------------------------|
| event | <code>Event</code> |
| inst | [<code>Tags</code>](#Tags) |

Expand All @@ -164,15 +174,15 @@ To know more about these features, check the demo!
### ServerCallback ⇒ <code>Promise</code>

| Param | Type |
| -------- | --------------------- |
|----------|-----------------------|
| response | <code>Response</code> |

<a name="ErrorCallback"></a>

## ErrorCallback ⇒ <code>void</code>

| Param | Type |
| ------ | -------------------------- |
|--------|----------------------------|
| e | <code>Error</code> |
| signal | <code>AbortSignal</code> |
| inst | [<code>Tags</code>](#Tags) |
Expand All @@ -182,7 +192,7 @@ To know more about these features, check the demo!
### ModalItemCallback ⇒ <code>Promise</code>

| Param | Type |
| ----- | -------------------------- |
|-------|----------------------------|
| label | <code>String</code> |
| inst | [<code>Tags</code>](#Tags) |

Expand All @@ -191,7 +201,7 @@ To know more about these features, check the demo!
### RenderCallback ⇒ <code>String</code>

| Param | Type |
| ----- | -------------------------------------- |
|-------|----------------------------------------|
| item | [<code>Suggestion</code>](#Suggestion) |
| label | <code>String</code> |
| inst | [<code>Tags</code>](#Tags) |
Expand All @@ -201,7 +211,7 @@ To know more about these features, check the demo!
### ItemCallback ⇒ <code>void</code>

| Param | Type |
| ----- | -------------------------------------- |
|-------|----------------------------------------|
| item | [<code>Suggestion</code>](#Suggestion) |
| inst | [<code>Tags</code>](#Tags) |

Expand All @@ -210,7 +220,7 @@ To know more about these features, check the demo!
### ValueCallback ⇒ <code>void</code>

| Param | Type |
| ----- | -------------------------- |
|-------|----------------------------|
| value | <code>String</code> |
| inst | [<code>Tags</code>](#Tags) |

Expand All @@ -219,7 +229,7 @@ To know more about these features, check the demo!
### AddCallback ⇒ <code>void</code> \| <code>Boolean</code>

| Param | Type |
| ----- | -------------------------- |
|-------|----------------------------|
| value | <code>String</code> |
| data | <code>Object</code> |
| inst | [<code>Tags</code>](#Tags) |
Expand All @@ -229,7 +239,7 @@ To know more about these features, check the demo!
### CreateCallback ⇒ <code>void</code>

| Param | Type |
| ------ | ------------------------------ |
|--------|--------------------------------|
| option | <code>HTMLOptionElement</code> |
| inst | [<code>Tags</code>](#Tags) |

Expand Down

0 comments on commit c1f9d74

Please sign in to comment.