Skip to content

Commit

Permalink
fix event name casing
Browse files Browse the repository at this point in the history
  • Loading branch information
break-stuff committed Jul 21, 2024
1 parent 84d2040 commit 50b2b59
Show file tree
Hide file tree
Showing 13 changed files with 145 additions and 49 deletions.
3 changes: 3 additions & 0 deletions demo/lit-app/custom-element-jsx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ export type RadioGroupProps = {
customTag?: RadioGroup["customTag"];
/** some description for custom-event */
"oncustom-event"?: (e: CustomEvent<never>) => void;
/** some description for camelCaseEvent */
oncamelCaseEvent?: (e: CustomEvent<never>) => void;
/** some description for typed-event */
"ontyped-event"?: (e: CustomEvent<HTMLInputElement>) => void;
/** (@deprecated) some description for typed-custom-event */
Expand Down Expand Up @@ -149,6 +151,7 @@ export type CustomElements = {
*
* ### **Events:**
* - **custom-event** - some description for custom-event
* - **camelCaseEvent** - some description for camelCaseEvent
* - **typed-event** - some description for typed-event
* - **typed-custom-event** - (@deprecated) some description for typed-custom-event
*
Expand Down
9 changes: 6 additions & 3 deletions demo/lit-app/custom-element-vuejs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ type RadioGroupProps = {
/** */
customTag?: RadioGroup["customTag"];
/** some description for custom-event */
onCustomEvent?: (e: CustomEvent<never>) => void;
"oncustom-event"?: (e: CustomEvent<never>) => void;
/** some description for camelCaseEvent */
oncamelCaseEvent?: (e: CustomEvent<never>) => void;
/** some description for typed-event */
onTypedEvent?: (e: CustomEvent<HTMLInputElement>) => void;
"ontyped-event"?: (e: CustomEvent<HTMLInputElement>) => void;
/** (@deprecated) some description for typed-custom-event */
onTypedCustomEvent?: (e: CustomEvent<InterfaceEventType>) => void;
"ontyped-custom-event"?: (e: CustomEvent<InterfaceEventType>) => void;
};

type RadioButtonProps = {
Expand Down Expand Up @@ -86,6 +88,7 @@ export type CustomElements = {
*
* ### **Events:**
* - **custom-event** - some description for custom-event
* - **camelCaseEvent** - some description for camelCaseEvent
* - **typed-event** - some description for typed-event
* - **typed-custom-event** - (@deprecated) some description for typed-custom-event
*
Expand Down
3 changes: 3 additions & 0 deletions demo/lit-app/custom-elements-svelte.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ type RadioGroupProps = {
"bind:customTag"?: RadioGroup["customTag"];
/** some description for custom-event */
"on:custom-event"?: (e: CustomEvent<never>) => void;
/** some description for camelCaseEvent */
"on:camelCaseEvent"?: (e: CustomEvent<never>) => void;
/** some description for typed-event */
"on:typed-event"?: (e: CustomEvent<HTMLInputElement>) => void;
/** (@deprecated) some description for typed-custom-event */
Expand Down Expand Up @@ -123,6 +125,7 @@ export type CustomElements = {
*
* ### **Events:**
* - **custom-event** - some description for custom-event
* - **camelCaseEvent** - some description for camelCaseEvent
* - **typed-event** - some description for typed-event
* - **typed-custom-event** - (@deprecated) some description for typed-custom-event
*
Expand Down
32 changes: 18 additions & 14 deletions demo/lit-app/custom-elements.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@
"description": "some description for custom-event",
"name": "custom-event"
},
{
"description": "some description for camelCaseEvent",
"name": "camelCaseEvent"
},
{
"type": {
"text": "HTMLInputElement"
Expand Down Expand Up @@ -819,46 +823,46 @@
},
{
"kind": "javascript-module",
"path": "src/radio-button/radio-button.ts",
"path": "src/radio-group/radio-group.ts",
"declarations": [],
"exports": [
{
"kind": "js",
"name": "RadioButton",
"name": "RadioGroup",
"declaration": {
"name": "RadioButton",
"module": "src/radio-button/radio-button.ts"
"name": "RadioGroup",
"module": "src/radio-group/radio-group.ts"
}
},
{
"kind": "custom-element-definition",
"name": "radio-button",
"name": "radio-group",
"declaration": {
"name": "RadioButton",
"module": "/src/radio-button/RadioButton.js"
"name": "RadioGroup",
"module": "/src/radio-group/RadioGroup.js"
}
}
]
},
{
"kind": "javascript-module",
"path": "src/radio-group/radio-group.ts",
"path": "src/radio-button/radio-button.ts",
"declarations": [],
"exports": [
{
"kind": "js",
"name": "RadioGroup",
"name": "RadioButton",
"declaration": {
"name": "RadioGroup",
"module": "src/radio-group/radio-group.ts"
"name": "RadioButton",
"module": "src/radio-button/radio-button.ts"
}
},
{
"kind": "custom-element-definition",
"name": "radio-group",
"name": "radio-button",
"declaration": {
"name": "RadioGroup",
"module": "/src/radio-group/RadioGroup.js"
"name": "RadioButton",
"module": "/src/radio-button/RadioButton.js"
}
}
]
Expand Down
3 changes: 3 additions & 0 deletions demo/lit-app/solid-js.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ type RadioGroupProps = {
"prop:customTag"?: RadioGroup["customTag"];
/** some description for custom-event */
"on:custom-event"?: (e: CustomEvent<never>) => void;
/** some description for camelCaseEvent */
"on:camelCaseEvent"?: (e: CustomEvent<never>) => void;
/** some description for typed-event */
"on:typed-event"?: (e: CustomEvent<HTMLInputElement>) => void;
/** (@deprecated) some description for typed-custom-event */
Expand Down Expand Up @@ -160,6 +162,7 @@ export type CustomElements = {
*
* ### **Events:**
* - **custom-event** - some description for custom-event
* - **camelCaseEvent** - some description for camelCaseEvent
* - **typed-event** - some description for typed-event
* - **typed-custom-event** - (@deprecated) some description for typed-custom-event
*
Expand Down
1 change: 1 addition & 0 deletions demo/lit-app/src/radio-group/RadioGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export type Example = Test2 | "valueA" | "valueB";
* @cssproperty [--radio-background-color=red] - Controls the color of bar
*
* @fires custom-event - some description for custom-event
* @fires camelCaseEvent - some description for camelCaseEvent
* @fires {HTMLInputElement } typed-event - some description for typed-event
* @event {InterfaceEventType} typed-custom-event - (@deprecated) some description for typed-custom-event
*
Expand Down
60 changes: 51 additions & 9 deletions demo/lit-app/vscode.html-custom-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"tags": [
{
"name": "radio-group",
"description": "\nRadio groups are used to group multiple radios or radio buttons, so they function as a single form control. Here is its [documentation](https://github.com/microsoft/vscode-custom-data/blob/master/samples/webcomponents/src/components/my-component/docs.md).\n\nUse it like this:\n```html\n<radio-group value=\"2\" size=\"3\">\n <span slot=\"label\">My Label</span>\n <radio-button value=\"1\">Option 1</radio-button>\n <radio-button value=\"2\">Option 2</radio-button>\n <radio-button value=\"3\">Option 3</radio-button>\n</radio-group>\n```\n---\n\n\n### **Events:**\n - **custom-event** - some description for custom-event\n- **typed-event** - some description for typed-event\n- **typed-custom-event**\n\n### **Methods:**\n - **validate()** - Validated the radio inputs\n- **checkStatus(value: _string_, message: _string_): _string_** - This is a test method with parameters\n\n\n### **Slots:**\n - _default_ - add radio buttons to the `default` slot to create options to your radio group\n- **label** - placeholder for the radio group label\n\n### **CSS Properties:**\n - **--radio-border-radius** - Controls the border radius of the radio buttons _(default: undefined)_\n- **--radio-background-color** - Controls the color of bar _(default: red)_\n\n### **CSS Parts:**\n - **radio-label** - Applies custom styles the radio group label",
"description": "\nRadio groups are used to group multiple radios or radio buttons, so they function as a single form control. Here is its [documentation](https://github.com/microsoft/vscode-custom-data/blob/master/samples/webcomponents/src/components/my-component/docs.md).\n\nUse it like this:\n```html\n<radio-group value=\"2\" size=\"3\">\n <span slot=\"label\">My Label</span>\n <radio-button value=\"1\">Option 1</radio-button>\n <radio-button value=\"2\">Option 2</radio-button>\n <radio-button value=\"3\">Option 3</radio-button>\n</radio-group>\n```\n---\n\n\n### **Events:**\n - **custom-event** - some description for custom-event\n- **camelCaseEvent** - some description for camelCaseEvent\n- **typed-event** - some description for typed-event\n- **typed-custom-event** - (@deprecated) some description for typed-custom-event\n\n### **Methods:**\n - **validate()** - Validated the radio inputs\n- **checkStatus(value: _string_, message: _string_): _string_** - This is a test method with parameters\n\n\n### **Slots:**\n - _default_ - add radio buttons to the `default` slot to create options to your radio group\n- **label** - placeholder for the radio group label\n\n### **CSS Properties:**\n - **--radio-border-radius** - Controls the border radius of the radio buttons _(default: undefined)_\n- **--radio-background-color** - Controls the color of bar _(default: red)_\n\n### **CSS Parts:**\n - **radio-label** - Applies custom styles the radio group label",
"attributes": [
{
"name": "value",
Expand All @@ -29,24 +29,56 @@
{
"name": "variants",
"description": "This is a test for internal options",
"values": [{ "name": "Variants" }]
"values": [
{ "name": "default" },
{ "name": "primary" },
{ "name": "success" },
{ "name": "neutral" },
{ "name": "warning" },
{ "name": "danger" },
{ "name": "text" }
]
},
{
"name": "external",
"values": [
{ "name": "value1" },
{ "name": "value2" },
{ "name": "value3" }
]
},
{
"name": "deprecated-attribute",
"values": [
{ "name": "value1" },
{ "name": "value2" },
{ "name": "value3" }
]
},
{ "name": "external", "values": [{ "name": "Test" }] },
{ "name": "deprecated-attribute", "values": [{ "name": "Test" }] },
{
"name": "external2",
"description": "This is a test for external .ts options",
"values": [{ "name": "Example" }]
"values": [
{ "name": "value4" },
{ "name": "value5" },
{ "name": "value6" },
{ "name": "valueA" },
{ "name": "valueB" }
]
},
{
"name": "external3",
"description": "This is a test for external .ts options",
"values": [{ "name": "Test3" }]
"values": [
{ "name": "value7" },
{ "name": "value8" },
{ "name": "value9" }
]
},
{
"name": "complex",
"description": "This is a test for options from an object",
"values": [{ "name": "ComplexObjectType" }]
"values": [{ "name": "single" }, { "name": "multi" }]
},
{
"name": "my-attribute",
Expand All @@ -56,7 +88,12 @@
{
"name": "complex-union",
"description": "This is a test for options from an object",
"values": [{ "name": "ChildSize" }]
"values": [
{ "name": "small" },
{ "name": "medium" },
{ "name": "large" },
{ "name": "extra-small" }
]
}
],
"references": []
Expand All @@ -78,7 +115,12 @@
{
"name": "target",
"description": "A lookup type for example",
"values": [{ "name": "Target" }]
"values": [
{ "name": "_blank" },
{ "name": "_self" },
{ "name": "_parent" },
{ "name": "_top" }
]
},
{
"name": "for",
Expand Down
Loading

0 comments on commit 50b2b59

Please sign in to comment.