mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
feat(breadcrumb): supporot noTrailingSlash in skeleton
This commit is contained in:
parent
8e00ccb025
commit
51034f24a3
3 changed files with 23 additions and 4 deletions
|
@ -1,12 +1,27 @@
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* Set to `true` to hide breadcrumb trailing slash
|
||||||
|
* @type {boolean} [noTrailingSlash=false]
|
||||||
|
*/
|
||||||
|
export let noTrailingSlash = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set number of breadcrumb items to render
|
||||||
|
* @type {number} [count=3]
|
||||||
|
*/
|
||||||
|
export let count = 3;
|
||||||
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class:bx--breadcrumb={true}
|
class:bx--breadcrumb={true}
|
||||||
|
class:bx--breadcrumb--no-trailing-slash={noTrailingSlash}
|
||||||
class:bx--skeleton={true}
|
class:bx--skeleton={true}
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
on:click
|
on:click
|
||||||
on:mouseover
|
on:mouseover
|
||||||
on:mouseenter
|
on:mouseenter
|
||||||
on:mouseleave>
|
on:mouseleave>
|
||||||
{#each [0, 1, 2] as item, i (item)}
|
{#each Array.from({ length: count }, (_, i) => i) as item, i (item)}
|
||||||
<div class:bx--breadcrumb-item={true}>
|
<div class:bx--breadcrumb-item={true}>
|
||||||
<span class:bx--link={true}> </span>
|
<span class:bx--link={true}> </span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<BreadcrumbItem href="#" aria-current="page">Breadcrumb 3</BreadcrumbItem>
|
<BreadcrumbItem href="#" aria-current="page">Breadcrumb 3</BreadcrumbItem>
|
||||||
</Breadcrumb>
|
</Breadcrumb>
|
||||||
{:else if story === 'skeleton'}
|
{:else if story === 'skeleton'}
|
||||||
<BreadcrumbSkeleton />
|
<BreadcrumbSkeleton {noTrailingSlash} {...$$restProps} />
|
||||||
{:else}
|
{:else}
|
||||||
<Breadcrumb {noTrailingSlash}>
|
<Breadcrumb {noTrailingSlash}>
|
||||||
<BreadcrumbItem let:props>
|
<BreadcrumbItem let:props>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { withKnobs, boolean } from "@storybook/addon-knobs";
|
import { withKnobs, boolean, number } from "@storybook/addon-knobs";
|
||||||
import Component from "./Breadcrumb.Story.svelte";
|
import Component from "./Breadcrumb.Story.svelte";
|
||||||
|
|
||||||
export default { title: "Breadcrumb", decorators: [withKnobs] };
|
export default { title: "Breadcrumb", decorators: [withKnobs] };
|
||||||
|
@ -12,7 +12,11 @@ export const Default = () => ({
|
||||||
|
|
||||||
export const Skeleton = () => ({
|
export const Skeleton = () => ({
|
||||||
Component,
|
Component,
|
||||||
props: { story: "skeleton" },
|
props: {
|
||||||
|
story: "skeleton",
|
||||||
|
noTrailingSlash: boolean("No Trailing Slash (noTrailingSlash)", false),
|
||||||
|
count: number("Number of breadcrumb items (count)", 3),
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const CurrentPage = () => ({
|
export const CurrentPage = () => ({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue