289 lines
9.8 KiB
Plaintext
289 lines
9.8 KiB
Plaintext
component Footer {
|
|
outputs {
|
|
select(payload: { value?: string | number | boolean | null; values?: Array<string | number | boolean | null | object>; sourceEvent?: Event; [key: string]: string | number | boolean | null | object } | string | number | boolean | null)
|
|
action(payload: { sourceEvent?: Event; [key: string]: string | number | boolean | null | object })
|
|
}
|
|
|
|
props {
|
|
|
|
size: string = "default"
|
|
color: string = "primary"
|
|
label: string = "Footer navigation"
|
|
items: unknown[] = []
|
|
columns: number = 3
|
|
maxWidth: string = "compact"
|
|
copyright: string = ""
|
|
class: string = ""
|
|
}
|
|
|
|
view {
|
|
<footer
|
|
{...attrs}
|
|
data-ui-component="Footer"
|
|
data-size='{size}'
|
|
data-color='{color}'
|
|
class='wire-footer {maxWidth === "full" ? "wire-footer--width-full" : ""} {class}'
|
|
>
|
|
<div
|
|
class="wire-footer__grid"
|
|
>
|
|
<div
|
|
class="wire-footer__pre"
|
|
>
|
|
<slot
|
|
name="pre-footer"
|
|
>
|
|
</slot>
|
|
</div>
|
|
|
|
{#if items.length > 0}
|
|
<nav
|
|
class='wire-footer__links wire-footer--columns-{columns}'
|
|
aria-label='{label}'
|
|
>
|
|
{#each items as item, itemIndex}
|
|
{#if item.type === "header"}
|
|
<section
|
|
class="wire-footer__column"
|
|
aria-labelledby='footer-heading-{itemIndex}'
|
|
>
|
|
{#if item.icon}
|
|
<span
|
|
class='{item.icon}'
|
|
aria-hidden="true"
|
|
>
|
|
</span>
|
|
{/if}
|
|
|
|
<h2
|
|
id='footer-heading-{itemIndex}'
|
|
class="wire-footer__heading"
|
|
>
|
|
{item.label || item.title}
|
|
</h2>
|
|
|
|
{#if item.description}
|
|
<p>
|
|
{item.description}
|
|
</p>
|
|
{/if}
|
|
|
|
{#if (item.items || item.links || []).length > 0}
|
|
<div
|
|
class="wire-footer__column-links"
|
|
>
|
|
{#each item.items || item.links || [] as child, childIndex}
|
|
<a
|
|
href='{child.href || "#"}'
|
|
target='{child.target || ""}'
|
|
rel='{child.external ? "noopener noreferrer" : (child.rel || "")}'
|
|
aria-current='{child.active ? "page" : ""}'
|
|
class="wire-footer__link"
|
|
@click='event.currentTarget.dispatchEvent(new CustomEvent("select", { bubbles: true, detail: { item: child, parent: item, itemIndex: childIndex, sectionIndex: itemIndex } })); child.action && event.currentTarget.dispatchEvent(new CustomEvent("action", { bubbles: true, detail: { item: child, parent: item, itemIndex: childIndex, sectionIndex: itemIndex } }))'
|
|
>
|
|
{#if child.icon}
|
|
<span
|
|
class='{child.icon}'
|
|
aria-hidden="true"
|
|
>
|
|
</span>
|
|
{/if}
|
|
|
|
<span>
|
|
{child.label || child.title}
|
|
</span>
|
|
|
|
{#if child.badge}
|
|
<span
|
|
class="wire-badge wire-badge--default"
|
|
>
|
|
{child.badge}
|
|
</span>
|
|
{/if}
|
|
|
|
{#if child.external}
|
|
<span
|
|
class="icon-[lucide--arrow-up-right]"
|
|
aria-hidden="true"
|
|
>
|
|
</span>
|
|
{/if}
|
|
</a>
|
|
{/each}
|
|
</div>
|
|
{/if}
|
|
</section>
|
|
|
|
{:else if item.type === "link" || item.href}
|
|
<section
|
|
class="wire-footer__column"
|
|
>
|
|
<div
|
|
class="wire-footer__column-links"
|
|
>
|
|
<a
|
|
href='{item.href || "#"}'
|
|
target='{item.target || ""}'
|
|
rel='{item.external ? "noopener noreferrer" : (item.rel || "")}'
|
|
aria-current='{item.active ? "page" : ""}'
|
|
class="wire-footer__link"
|
|
@click='event.currentTarget.dispatchEvent(new CustomEvent("select", { bubbles: true, detail: { item: item, itemIndex: itemIndex } })); item.action && event.currentTarget.dispatchEvent(new CustomEvent("action", { bubbles: true, detail: { item: item, itemIndex: itemIndex } }))'
|
|
>
|
|
{#if item.icon}
|
|
<span
|
|
class='{item.icon}'
|
|
aria-hidden="true"
|
|
>
|
|
</span>
|
|
{/if}
|
|
|
|
<span>
|
|
{item.label || item.title}
|
|
</span>
|
|
|
|
{#if item.badge}
|
|
<span
|
|
class="wire-badge wire-badge--default"
|
|
>
|
|
{item.badge}
|
|
</span>
|
|
{/if}
|
|
|
|
{#if item.external}
|
|
<span
|
|
class="icon-[lucide--arrow-up-right]"
|
|
aria-hidden="true"
|
|
>
|
|
</span>
|
|
{/if}
|
|
</a>
|
|
</div>
|
|
</section>
|
|
|
|
{:else}
|
|
<section
|
|
class="wire-footer__column"
|
|
aria-labelledby='footer-heading-{itemIndex}'
|
|
>
|
|
{#if item.icon}
|
|
<span
|
|
class='{item.icon}'
|
|
aria-hidden="true"
|
|
>
|
|
</span>
|
|
{/if}
|
|
|
|
{#if item.title || item.label}
|
|
<h2
|
|
id='footer-heading-{itemIndex}'
|
|
class="wire-footer__heading"
|
|
>
|
|
{item.title || item.label}
|
|
</h2>
|
|
{/if}
|
|
|
|
{#if item.description}
|
|
<p>
|
|
{item.description}
|
|
</p>
|
|
{/if}
|
|
|
|
{#if (item.items || item.links || []).length > 0}
|
|
<div
|
|
class="wire-footer__column-links"
|
|
>
|
|
{#each item.items || item.links || [] as child, childIndex}
|
|
<a
|
|
href='{child.href || "#"}'
|
|
target='{child.target || ""}'
|
|
rel='{child.external ? "noopener noreferrer" : (child.rel || "")}'
|
|
aria-current='{child.active ? "page" : ""}'
|
|
class="wire-footer__link"
|
|
@click='event.currentTarget.dispatchEvent(new CustomEvent("select", { bubbles: true, detail: { item: child, parent: item, itemIndex: childIndex, sectionIndex: itemIndex } })); child.action && event.currentTarget.dispatchEvent(new CustomEvent("action", { bubbles: true, detail: { item: child, parent: item, itemIndex: childIndex, sectionIndex: itemIndex } }))'
|
|
>
|
|
{#if child.icon}
|
|
<span
|
|
class='{child.icon}'
|
|
aria-hidden="true"
|
|
>
|
|
</span>
|
|
{/if}
|
|
|
|
<span>
|
|
{child.label || child.title}
|
|
</span>
|
|
|
|
{#if child.badge}
|
|
<span
|
|
class="wire-badge wire-badge--default"
|
|
>
|
|
{child.badge}
|
|
</span>
|
|
{/if}
|
|
|
|
{#if child.external}
|
|
<span
|
|
class="icon-[lucide--arrow-up-right]"
|
|
aria-hidden="true"
|
|
>
|
|
</span>
|
|
{/if}
|
|
</a>
|
|
{/each}
|
|
</div>
|
|
{/if}
|
|
</section>
|
|
{/if}
|
|
{/each}
|
|
</nav>
|
|
{/if}
|
|
|
|
<div
|
|
class="wire-footer__post"
|
|
>
|
|
<slot
|
|
name="post-footer"
|
|
>
|
|
</slot>
|
|
</div>
|
|
</div>
|
|
|
|
<div
|
|
class="wire-footer__bottom wire-footer__bottom--slots"
|
|
>
|
|
<div
|
|
class="wire-footer__copyright-left"
|
|
>
|
|
<slot
|
|
name="copyright-left"
|
|
>
|
|
</slot>
|
|
</div>
|
|
|
|
{#if copyright}
|
|
<div
|
|
class="wire-footer__bottom"
|
|
>
|
|
<div></div>
|
|
<p
|
|
class="wire-footer__copyright"
|
|
>
|
|
{copyright}
|
|
</p>
|
|
<div></div>
|
|
</div>
|
|
{/if}
|
|
|
|
<div
|
|
class="wire-footer__copyright-right"
|
|
>
|
|
<slot
|
|
name="copyright-right"
|
|
>
|
|
</slot>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
}
|
|
}
|