chore(context-menu): update types

This commit is contained in:
Eric Y Liu 2021-03-19 17:03:24 -07:00
commit 2c9c2f1690
4 changed files with 6 additions and 3 deletions

View file

@ -751,6 +751,7 @@ None.
| :--------- | :--------- | :----- | | :--------- | :--------- | :----- |
| click | forwarded | -- | | click | forwarded | -- |
| keydown | forwarded | -- | | keydown | forwarded | -- |
| open | dispatched | -- |
| close | dispatched | -- | | close | dispatched | -- |
## `ContextMenuDivider` ## `ContextMenuDivider`
@ -800,7 +801,7 @@ None.
| disabled | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the disabled state | | disabled | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the disabled state |
| labelText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the label text<br />Alternatively, use the "labelText" slot (e.g., &lt;span slot="labelText"&gt;...&lt;/span&gt;) | | labelText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the label text<br />Alternatively, use the "labelText" slot (e.g., &lt;span slot="labelText"&gt;...&lt;/span&gt;) |
| shortcutText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the shortcut text<br />Alternatively, use the "shortcutText" slot (e.g., &lt;span slot="shortcutText"&gt;...&lt;/span&gt;) | | shortcutText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the shortcut text<br />Alternatively, use the "shortcutText" slot (e.g., &lt;span slot="shortcutText"&gt;...&lt;/span&gt;) |
| id | <code>let</code> | No | <code>string</code> | <code>"ccs-" + Math.random().toString(36)</code> | Specify the id<br />It's highly recommended to provide an id when using in a selectable/radio menu group | | id | <code>let</code> | No | <code>string</code> | <code>"ccs-" + Math.random().toString(36)</code> | Specify the id<br />It's recommended to provide an id as a value to bind to within a selectable/radio menu group |
### Slots ### Slots

View file

@ -1605,6 +1605,7 @@
"events": [ "events": [
{ "type": "forwarded", "name": "click", "element": "ul" }, { "type": "forwarded", "name": "click", "element": "ul" },
{ "type": "forwarded", "name": "keydown", "element": "ul" }, { "type": "forwarded", "name": "keydown", "element": "ul" },
{ "type": "dispatched", "name": "open" },
{ "type": "dispatched", "name": "close" } { "type": "dispatched", "name": "close" }
], ],
"typedefs": [], "typedefs": [],
@ -1722,7 +1723,7 @@
{ {
"name": "id", "name": "id",
"kind": "let", "kind": "let",
"description": "Specify the id\nIt's highly recommended to provide an id when using in a selectable/radio menu group", "description": "Specify the id\nIt's recommended to provide an id as a value to bind to within a selectable/radio menu group",
"type": "string", "type": "string",
"value": "\"ccs-\" + Math.random().toString(36)", "value": "\"ccs-\" + Math.random().toString(36)",
"isFunction": false, "isFunction": false,

View file

@ -34,6 +34,7 @@ export default class ContextMenu extends SvelteComponentTyped<
{ {
click: WindowEventMap["click"]; click: WindowEventMap["click"];
keydown: WindowEventMap["keydown"]; keydown: WindowEventMap["keydown"];
open: CustomEvent<any>;
close: CustomEvent<any>; close: CustomEvent<any>;
}, },
{ default: {} } { default: {} }

View file

@ -50,7 +50,7 @@ export interface ContextMenuOptionProps
/** /**
* Specify the id * Specify the id
* It's highly recommended to provide an id when using in a selectable/radio menu group * It's recommended to provide an id as a value to bind to within a selectable/radio menu group
* @default "ccs-" + Math.random().toString(36) * @default "ccs-" + Math.random().toString(36)
*/ */
id?: string; id?: string;