mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
feat(ui-shell): make company
in Header
slottable (#1764)
This commit is contained in:
parent
14d584da42
commit
9b3f014a0b
4 changed files with 17 additions and 8 deletions
|
@ -1584,11 +1584,12 @@ None.
|
||||||
|
|
||||||
### Slots
|
### Slots
|
||||||
|
|
||||||
| Slot name | Default | Props | Fallback |
|
| Slot name | Default | Props | Fallback |
|
||||||
| :-------------- | :------ | :---- | :-------------------------- |
|
| :-------------- | :------ | :---- | :--------------------------- |
|
||||||
| -- | Yes | -- | -- |
|
| -- | Yes | -- | -- |
|
||||||
| platform | No | -- | <code>{platformName}</code> |
|
| company | No | -- | <code>{company} </code> |
|
||||||
| skip-to-content | No | -- | -- |
|
| platform | No | -- | <code>{platformName}</code> |
|
||||||
|
| skip-to-content | No | -- | -- |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
|
|
|
@ -4833,6 +4833,12 @@
|
||||||
"moduleExports": [],
|
"moduleExports": [],
|
||||||
"slots": [
|
"slots": [
|
||||||
{ "name": "__default__", "default": true, "slot_props": "{}" },
|
{ "name": "__default__", "default": true, "slot_props": "{}" },
|
||||||
|
{
|
||||||
|
"name": "company",
|
||||||
|
"default": false,
|
||||||
|
"fallback": "{company} ",
|
||||||
|
"slot_props": "{}"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "platform",
|
"name": "platform",
|
||||||
"default": false,
|
"default": false,
|
||||||
|
|
|
@ -94,8 +94,10 @@
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
on:click
|
on:click
|
||||||
>
|
>
|
||||||
{#if company}
|
{#if company || $$slots.company}
|
||||||
<span class:bx--header__name--prefix="{true}">{company} </span>
|
<span class:bx--header__name--prefix="{true}"
|
||||||
|
><slot name="company">{company} </slot></span
|
||||||
|
>
|
||||||
{/if}
|
{/if}
|
||||||
<slot name="platform">{platformName}</slot>
|
<slot name="platform">{platformName}</slot>
|
||||||
</a>
|
</a>
|
||||||
|
|
2
types/UIShell/Header.svelte.d.ts
vendored
2
types/UIShell/Header.svelte.d.ts
vendored
|
@ -84,5 +84,5 @@ export interface HeaderProps
|
||||||
export default class Header extends SvelteComponentTyped<
|
export default class Header extends SvelteComponentTyped<
|
||||||
HeaderProps,
|
HeaderProps,
|
||||||
{ click: WindowEventMap["click"] },
|
{ click: WindowEventMap["click"] },
|
||||||
{ default: {}; platform: {}; ["skip-to-content"]: {} }
|
{ default: {}; company: {}; platform: {}; ["skip-to-content"]: {} }
|
||||||
> {}
|
> {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue