mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 20:33:02 +00:00
Run "yarn build:lib"
This commit is contained in:
parent
be854e0d3f
commit
e7a0d46125
3 changed files with 30 additions and 18 deletions
|
@ -648,8 +648,10 @@ None.
|
||||||
### Types
|
### Types
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
|
export type ComboBoxItemId = any;
|
||||||
|
|
||||||
export interface ComboBoxItem {
|
export interface ComboBoxItem {
|
||||||
id: string;
|
id: ComboBoxItemId;
|
||||||
text: string;
|
text: string;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -662,7 +664,7 @@ export interface ComboBoxItem {
|
||||||
| ref | <code>let</code> | Yes | <code>null | HTMLInputElement</code> | <code>null</code> | Obtain a reference to the input HTML element |
|
| ref | <code>let</code> | Yes | <code>null | HTMLInputElement</code> | <code>null</code> | Obtain a reference to the input HTML element |
|
||||||
| open | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to open the combobox menu dropdown |
|
| open | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to open the combobox menu dropdown |
|
||||||
| value | <code>let</code> | Yes | <code>string</code> | <code>""</code> | Specify the selected combobox value |
|
| value | <code>let</code> | Yes | <code>string</code> | <code>""</code> | Specify the selected combobox value |
|
||||||
| selectedId | <code>let</code> | Yes | <code>string</code> | -- | Set the selected item by value id |
|
| selectedId | <code>let</code> | Yes | <code>ComboBoxItemId</code> | -- | Set the selected item by value id |
|
||||||
| items | <code>let</code> | No | <code>ComboBoxItem[]</code> | <code>[]</code> | Set the combobox items |
|
| items | <code>let</code> | No | <code>ComboBoxItem[]</code> | <code>[]</code> | Set the combobox items |
|
||||||
| itemToString | <code>let</code> | No | <code>(item: ComboBoxItem) => string</code> | <code>(item) => item.text || item.id</code> | Override the display of a combobox item |
|
| itemToString | <code>let</code> | No | <code>(item: ComboBoxItem) => string</code> | <code>(item) => item.text || item.id</code> | Override the display of a combobox item |
|
||||||
| direction | <code>let</code> | No | <code>"bottom" | "top"</code> | <code>"bottom"</code> | Specify the direction of the combobox dropdown menu |
|
| direction | <code>let</code> | No | <code>"bottom" | "top"</code> | <code>"bottom"</code> | Specify the direction of the combobox dropdown menu |
|
||||||
|
@ -688,15 +690,15 @@ None.
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
| Event name | Type | Detail |
|
| Event name | Type | Detail |
|
||||||
| :--------- | :--------- | :-------------------------------------------------------------- |
|
| :--------- | :--------- | :---------------------------------------------------------------------- |
|
||||||
| select | dispatched | <code>{ selectedId: string; selectedItem: ComboBoxItem }</code> |
|
| select | dispatched | <code>{ selectedId: ComboBoxItemId; selectedItem: ComboBoxItem }</code> |
|
||||||
| keydown | forwarded | -- |
|
| keydown | forwarded | -- |
|
||||||
| keyup | forwarded | -- |
|
| keyup | forwarded | -- |
|
||||||
| focus | forwarded | -- |
|
| focus | forwarded | -- |
|
||||||
| blur | forwarded | -- |
|
| blur | forwarded | -- |
|
||||||
| clear | forwarded | -- |
|
| clear | forwarded | -- |
|
||||||
| scroll | forwarded | -- |
|
| scroll | forwarded | -- |
|
||||||
|
|
||||||
## `ComposedModal`
|
## `ComposedModal`
|
||||||
|
|
||||||
|
|
|
@ -1398,7 +1398,7 @@
|
||||||
"name": "selectedId",
|
"name": "selectedId",
|
||||||
"kind": "let",
|
"kind": "let",
|
||||||
"description": "Set the selected item by value id",
|
"description": "Set the selected item by value id",
|
||||||
"type": "string",
|
"type": "ComboBoxItemId",
|
||||||
"isFunction": false,
|
"isFunction": false,
|
||||||
"isFunctionDeclaration": false,
|
"isFunctionDeclaration": false,
|
||||||
"constant": false,
|
"constant": false,
|
||||||
|
@ -1627,7 +1627,7 @@
|
||||||
{
|
{
|
||||||
"type": "dispatched",
|
"type": "dispatched",
|
||||||
"name": "select",
|
"name": "select",
|
||||||
"detail": "{ selectedId: string; selectedItem: ComboBoxItem }"
|
"detail": "{ selectedId: ComboBoxItemId; selectedItem: ComboBoxItem }"
|
||||||
},
|
},
|
||||||
{ "type": "forwarded", "name": "keydown", "element": "input" },
|
{ "type": "forwarded", "name": "keydown", "element": "input" },
|
||||||
{ "type": "forwarded", "name": "keyup", "element": "input" },
|
{ "type": "forwarded", "name": "keyup", "element": "input" },
|
||||||
|
@ -1638,9 +1638,14 @@
|
||||||
],
|
],
|
||||||
"typedefs": [
|
"typedefs": [
|
||||||
{
|
{
|
||||||
"type": "{ id: string; text: string; }",
|
"type": "any",
|
||||||
|
"name": "ComboBoxItemId",
|
||||||
|
"ts": "type ComboBoxItemId = any"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "{ id: ComboBoxItemId; text: string; }",
|
||||||
"name": "ComboBoxItem",
|
"name": "ComboBoxItem",
|
||||||
"ts": "interface ComboBoxItem { id: string; text: string; }"
|
"ts": "interface ComboBoxItem { id: ComboBoxItemId; text: string; }"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"rest_props": { "type": "Element", "name": "input" }
|
"rest_props": { "type": "Element", "name": "input" }
|
||||||
|
|
11
types/ComboBox/ComboBox.svelte.d.ts
vendored
11
types/ComboBox/ComboBox.svelte.d.ts
vendored
|
@ -1,8 +1,10 @@
|
||||||
/// <reference types="svelte" />
|
/// <reference types="svelte" />
|
||||||
import { SvelteComponentTyped } from "svelte";
|
import { SvelteComponentTyped } from "svelte";
|
||||||
|
|
||||||
|
export type ComboBoxItemId = any;
|
||||||
|
|
||||||
export interface ComboBoxItem {
|
export interface ComboBoxItem {
|
||||||
id: string;
|
id: ComboBoxItemId;
|
||||||
text: string;
|
text: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +25,7 @@ export interface ComboBoxProps
|
||||||
/**
|
/**
|
||||||
* Set the selected item by value id
|
* Set the selected item by value id
|
||||||
*/
|
*/
|
||||||
selectedId?: string;
|
selectedId?: ComboBoxItemId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the selected combobox value
|
* Specify the selected combobox value
|
||||||
|
@ -140,7 +142,10 @@ export interface ComboBoxProps
|
||||||
export default class ComboBox extends SvelteComponentTyped<
|
export default class ComboBox extends SvelteComponentTyped<
|
||||||
ComboBoxProps,
|
ComboBoxProps,
|
||||||
{
|
{
|
||||||
select: CustomEvent<{ selectedId: string; selectedItem: ComboBoxItem }>;
|
select: CustomEvent<{
|
||||||
|
selectedId: ComboBoxItemId;
|
||||||
|
selectedItem: ComboBoxItem;
|
||||||
|
}>;
|
||||||
keydown: WindowEventMap["keydown"];
|
keydown: WindowEventMap["keydown"];
|
||||||
keyup: WindowEventMap["keyup"];
|
keyup: WindowEventMap["keyup"];
|
||||||
focus: WindowEventMap["focus"];
|
focus: WindowEventMap["focus"];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue