Skip to content

Commit ed1336b

Browse files
spburtsevmetonym
authored andcommitted
fix(context-menu-option)!: change labelText slot to labelChildren
1 parent 9edcceb commit ed1336b

File tree

5 files changed

+31
-31
lines changed

5 files changed

+31
-31
lines changed

COMPONENT_INDEX.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -855,27 +855,27 @@ None.
855855

856856
### Props
857857

858-
| Prop name | Required | Kind | Reactive | Type | Default value | Description |
859-
| :----------- | :------- | :--------------- | :------- | -------------------------------------- | ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
860-
| ref | No | <code>let</code> | Yes | <code>null &#124; HTMLLIElement</code> | <code>null</code> | Obtain a reference to the list item HTML element |
861-
| selectable | No | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to enable the selectable variant.<br />Automatically set to `true` if `selected` is `true`. |
862-
| selected | No | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to use the selected variant |
863-
| icon | No | <code>let</code> | Yes | <code>any</code> | <code>undefined</code> | Specify the icon to render.<br />Icon is rendered to the left of the label text. |
864-
| indented | No | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to indent the label |
865-
| kind | No | <code>let</code> | No | <code>"default" &#124; "danger"</code> | <code>"default"</code> | Specify the kind of option. |
866-
| disabled | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the disabled state |
867-
| labelText | No | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the label text.<br />Alternatively, use the "labelText" slot.<br />@example <br />`svelte<br />&lt;ContextMenuOption&gt;<br /> &lt;span slot="labelText"&gt;Custom Label&lt;/span&gt;<br />&lt;/ContextMenuOption&gt;<br />` |
868-
| shortcutText | No | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the shortcut text.<br />Alternatively, use the "shortcutText" slot.<br />@example <br />`svelte<br />&lt;ContextMenuOption&gt;<br /> &lt;span slot="shortcutText"&gt;Ctrl+K&lt;/span&gt;<br />&lt;/ContextMenuOption&gt;<br />` |
869-
| id | No | <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. |
870-
871-
### Slots
872-
873-
| Slot name | Default | Props | Fallback |
874-
| :----------- | :------ | :---------------------------------- | :-------------------------------------------------- |
875-
| icon | No | <code>Record<string, never> </code> | <code>&lt;svelte:component this={icon} /&gt;</code> |
876-
| labelText | No | <code>Record<string, never> </code> | <code>{labelText}</code> |
877-
| -- | Yes | <code>Record<string, never> </code> | -- |
878-
| shortcutText | No | <code>Record<string, never> </code> | <code>{shortcutText}</code> |
858+
| Prop name | Required | Kind | Reactive | Type | Default value | Description |
859+
| :----------- | :------- | :--------------- | :------- | -------------------------------------- | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
860+
| ref | No | <code>let</code> | Yes | <code>null &#124; HTMLLIElement</code> | <code>null</code> | Obtain a reference to the list item HTML element |
861+
| selectable | No | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to enable the selectable variant.<br />Automatically set to `true` if `selected` is `true`. |
862+
| selected | No | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to use the selected variant |
863+
| icon | No | <code>let</code> | Yes | <code>any</code> | <code>undefined</code> | Specify the icon to render.<br />Icon is rendered to the left of the label text. |
864+
| indented | No | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to indent the label |
865+
| kind | No | <code>let</code> | No | <code>"default" &#124; "danger"</code> | <code>"default"</code> | Specify the kind of option. |
866+
| disabled | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the disabled state |
867+
| labelText | No | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the label text.<br />Alternatively, use the "labelChildren" slot.<br />@example <br />`svelte<br />&lt;ContextMenuOption&gt;<br /> &lt;span slot="labelChildren"&gt;Custom Label&lt;/span&gt;<br />&lt;/ContextMenuOption&gt;<br />` |
868+
| shortcutText | No | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the shortcut text.<br />Alternatively, use the "shortcutText" slot.<br />@example <br />`svelte<br />&lt;ContextMenuOption&gt;<br /> &lt;span slot="shortcutText"&gt;Ctrl+K&lt;/span&gt;<br />&lt;/ContextMenuOption&gt;<br />` |
869+
| id | No | <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. |
870+
871+
### Slots
872+
873+
| Slot name | Default | Props | Fallback |
874+
| :------------ | :------ | :---------------------------------- | :-------------------------------------------------- |
875+
| icon | No | <code>Record<string, never> </code> | <code>&lt;svelte:component this={icon} /&gt;</code> |
876+
| labelChildren | No | <code>Record<string, never> </code> | <code>{labelText}</code> |
877+
| -- | Yes | <code>Record<string, never> </code> | -- |
878+
| shortcutText | No | <code>Record<string, never> </code> | <code>{shortcutText}</code> |
879879

880880
### Events
881881

docs/src/COMPONENT_API.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2860,7 +2860,7 @@
28602860
{
28612861
"name": "labelText",
28622862
"kind": "let",
2863-
"description": "Specify the label text.\nAlternatively, use the \"labelText\" slot.\n@example \n```svelte\n<ContextMenuOption>\n <span slot=\"labelText\">Custom Label</span>\n</ContextMenuOption>\n```",
2863+
"description": "Specify the label text.\nAlternatively, use the \"labelChildren\" slot.\n@example \n```svelte\n<ContextMenuOption>\n <span slot=\"labelChildren\">Custom Label</span>\n</ContextMenuOption>\n```",
28642864
"type": "string",
28652865
"value": "\"\"",
28662866
"isFunction": false,
@@ -2939,7 +2939,7 @@
29392939
"slot_props": "Record<string, never>"
29402940
},
29412941
{
2942-
"name": "labelText",
2942+
"name": "labelChildren",
29432943
"default": false,
29442944
"fallback": "{labelText}",
29452945
"slot_props": "Record<string, never>"

src/ContextMenu/ContextMenuOption.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
2121
/**
2222
* Specify the label text.
23-
* Alternatively, use the "labelText" slot.
23+
* Alternatively, use the "labelChildren" slot.
2424
* @example
2525
* ```svelte
2626
* <ContextMenuOption>
27-
* <span slot="labelText">Custom Label</span>
27+
* <span slot="labelChildren">Custom Label</span>
2828
* </ContextMenuOption>
2929
* ```
3030
*/
@@ -380,7 +380,7 @@
380380
</div>
381381
{/if}
382382
<span class:bx--menu-option__label={true} title={labelText}>
383-
<slot name="labelText">{labelText}</slot>
383+
<slot name="labelChildren">{labelText}</slot>
384384
</span>
385385
<div class:bx--menu-option__info={true}><CaretRight /></div>
386386
</div>
@@ -406,7 +406,7 @@
406406
</div>
407407
{/if}
408408
<span class:bx--menu-option__label={true} title={labelText}>
409-
<slot name="labelText">{labelText}</slot>
409+
<slot name="labelChildren">{labelText}</slot>
410410
</span>
411411
<div class:bx--menu-option__info={true}>
412412
<slot name="shortcutText">{shortcutText}</slot>

tests/ContextMenu/ContextMenuOption.slot.test.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44

55
<ContextMenu open={true} x={0} y={0}>
66
<ContextMenuOption labelText="Default label">
7-
<span slot="labelText">Custom label content</span>
7+
<span slot="labelChildren">Custom label content</span>
88
</ContextMenuOption>
99
</ContextMenu>

types/ContextMenu/ContextMenuOption.svelte.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ type $Props = {
3131

3232
/**
3333
* Specify the label text.
34-
* Alternatively, use the "labelText" slot.
34+
* Alternatively, use the "labelChildren" slot.
3535
* @example
3636
* ```svelte
3737
* <ContextMenuOption>
38-
* <span slot="labelText">Custom Label</span>
38+
* <span slot="labelChildren">Custom Label</span>
3939
* </ContextMenuOption>
4040
* ```
4141
* @default ""
@@ -96,7 +96,7 @@ export default class ContextMenuOption extends SvelteComponentTyped<
9696
},
9797
{
9898
icon: Record<string, never>;
99-
labelText: Record<string, never>;
99+
labelChildren: Record<string, never>;
100100
default: Record<string, never>;
101101
shortcutText: Record<string, never>;
102102
}

0 commit comments

Comments
 (0)