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
|
@ -1585,8 +1585,9 @@ None.
|
|||
### Slots
|
||||
|
||||
| Slot name | Default | Props | Fallback |
|
||||
| :-------------- | :------ | :---- | :-------------------------- |
|
||||
| :-------------- | :------ | :---- | :--------------------------- |
|
||||
| -- | Yes | -- | -- |
|
||||
| company | No | -- | <code>{company} </code> |
|
||||
| platform | No | -- | <code>{platformName}</code> |
|
||||
| skip-to-content | No | -- | -- |
|
||||
|
||||
|
|
|
@ -4833,6 +4833,12 @@
|
|||
"moduleExports": [],
|
||||
"slots": [
|
||||
{ "name": "__default__", "default": true, "slot_props": "{}" },
|
||||
{
|
||||
"name": "company",
|
||||
"default": false,
|
||||
"fallback": "{company} ",
|
||||
"slot_props": "{}"
|
||||
},
|
||||
{
|
||||
"name": "platform",
|
||||
"default": false,
|
||||
|
|
|
@ -94,8 +94,10 @@
|
|||
{...$$restProps}
|
||||
on:click
|
||||
>
|
||||
{#if company}
|
||||
<span class:bx--header__name--prefix="{true}">{company} </span>
|
||||
{#if company || $$slots.company}
|
||||
<span class:bx--header__name--prefix="{true}"
|
||||
><slot name="company">{company} </slot></span
|
||||
>
|
||||
{/if}
|
||||
<slot name="platform">{platformName}</slot>
|
||||
</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<
|
||||
HeaderProps,
|
||||
{ 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