feat(context-menu): annotate props, generate types

This commit is contained in:
Eric Y Liu 2021-03-19 13:42:15 -07:00
commit 2ff4d43292
11 changed files with 582 additions and 19 deletions

View file

@ -1,5 +1,5 @@
{
"total": 161,
"total": 166,
"components": [
{
"moduleName": "Accordion",
@ -1556,6 +1556,243 @@
"typedefs": [],
"rest_props": { "type": "Element", "name": "div" }
},
{
"moduleName": "ContextMenu",
"filePath": "src/ContextMenu/ContextMenu.svelte",
"props": [
{
"name": "open",
"kind": "let",
"description": "Set to `true` to open the menu\nEither `x` and `y` must be greater than zero",
"type": "boolean",
"value": "false",
"isFunction": false,
"constant": false,
"reactive": true
},
{
"name": "x",
"kind": "let",
"description": "Specify the horizontal offset of the menu position",
"type": "number",
"value": "0",
"isFunction": false,
"constant": false,
"reactive": true
},
{
"name": "y",
"kind": "let",
"description": "Specify the vertical offset of the menu position",
"type": "number",
"value": "0",
"isFunction": false,
"constant": false,
"reactive": true
},
{
"name": "ref",
"kind": "let",
"description": "Obtain a reference to the unordered list HTML element",
"type": "null | HTMLUListElement",
"value": "null",
"isFunction": false,
"constant": false,
"reactive": true
}
],
"slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }],
"events": [
{ "type": "forwarded", "name": "click", "element": "ul" },
{ "type": "forwarded", "name": "keydown", "element": "ul" },
{ "type": "dispatched", "name": "close" }
],
"typedefs": [],
"rest_props": { "type": "Element", "name": "ul" }
},
{
"moduleName": "ContextMenuDivider",
"filePath": "src/ContextMenu/ContextMenuDivider.svelte",
"props": [],
"slots": [],
"events": [],
"typedefs": []
},
{
"moduleName": "ContextMenuGroup",
"filePath": "src/ContextMenu/ContextMenuGroup.svelte",
"props": [
{
"name": "selectedIds",
"kind": "let",
"type": "string[]",
"value": "[]",
"isFunction": false,
"constant": false,
"reactive": true
},
{
"name": "labelText",
"kind": "let",
"description": "Specify the label text",
"type": "string",
"value": "\"\"",
"isFunction": false,
"constant": false,
"reactive": false
}
],
"slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }],
"events": [],
"typedefs": []
},
{
"moduleName": "ContextMenuOption",
"filePath": "src/ContextMenu/ContextMenuOption.svelte",
"props": [
{
"name": "disabled",
"kind": "let",
"description": "Set to `true` to enable the disabled state",
"type": "boolean",
"value": "false",
"isFunction": false,
"constant": false,
"reactive": false
},
{
"name": "indented",
"kind": "let",
"description": "Set to `true` to indent the label",
"type": "boolean",
"value": "false",
"isFunction": false,
"constant": false,
"reactive": true
},
{
"name": "icon",
"kind": "let",
"description": "Specify the icon from `carbon-icons-svelte` to render\nIcon is rendered to the left of the label text",
"type": "typeof import(\"carbon-icons-svelte\").CarbonIcon",
"isFunction": false,
"constant": false,
"reactive": true
},
{
"name": "labelText",
"kind": "let",
"description": "Specify the label text\nAlternatively, use the \"labelText\" slot (e.g., <span slot=\"labelText\">...</span>)",
"type": "string",
"value": "\"\"",
"isFunction": false,
"constant": false,
"reactive": false
},
{
"name": "selected",
"kind": "let",
"description": "Set to `true` to use the selected variant",
"type": "boolean",
"value": "false",
"isFunction": false,
"constant": false,
"reactive": true
},
{
"name": "selectable",
"kind": "let",
"description": "Set to `true` to enable the selectable variant\nAutomatically set to `true` if `selected` is `true`",
"type": "boolean",
"value": "false",
"isFunction": false,
"constant": false,
"reactive": true
},
{
"name": "shortcutText",
"kind": "let",
"description": "Specify the shortcut text\nAlternatively, use the \"shortcutText\" slot (e.g., <span slot=\"shortcutText\">...</span>)",
"type": "string",
"value": "\"\"",
"isFunction": false,
"constant": false,
"reactive": false
},
{
"name": "id",
"kind": "let",
"description": "Specify the id\nIt's highly recommended to provide an id when using in a selectable/radio menu group",
"type": "string",
"value": "\"ccs-\" + Math.random().toString(36)",
"isFunction": false,
"constant": false,
"reactive": false
},
{
"name": "ref",
"kind": "let",
"description": "Obtain a reference to the list item HTML element",
"type": "null | HTMLLIElement",
"value": "null",
"isFunction": false,
"constant": false,
"reactive": true
}
],
"slots": [
{ "name": "__default__", "default": true, "slot_props": "{}" },
{
"name": "labelText",
"default": false,
"fallback": "{labelText}",
"slot_props": "{}"
},
{
"name": "shortcutText",
"default": false,
"fallback": "{shortcutText}",
"slot_props": "{}"
}
],
"events": [
{ "type": "forwarded", "name": "keydown", "element": "li" },
{ "type": "forwarded", "name": "mouseenter", "element": "li" },
{ "type": "forwarded", "name": "mouseleave", "element": "li" },
{ "type": "dispatched", "name": "click" }
],
"typedefs": [],
"rest_props": { "type": "Element", "name": "li" }
},
{
"moduleName": "ContextMenuRadioGroup",
"filePath": "src/ContextMenu/ContextMenuRadioGroup.svelte",
"props": [
{
"name": "selectedId",
"kind": "let",
"description": "Set the selected radio group id",
"type": "string",
"value": "\"\"",
"isFunction": false,
"constant": false,
"reactive": true
},
{
"name": "labelText",
"kind": "let",
"description": "Specify the label text",
"type": "string",
"value": "\"\"",
"isFunction": false,
"constant": false,
"reactive": false
}
],
"slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }],
"events": [],
"typedefs": []
},
{
"moduleName": "Copy",
"filePath": "src/Copy/Copy.svelte",