@functionalcms/svelte-components 2.36.1 → 2.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CssHelper.d.ts +1 -0
- package/dist/components/CssHelper.js +3 -0
- package/dist/components/Link.svelte +2 -2
- package/dist/components/Link.svelte.d.ts +1 -0
- package/dist/components/menu/CollapsibleMenu.svelte +18 -15
- package/dist/components/menu/CollapsibleMenu.svelte.d.ts +5 -3
- package/dist/components/menu/DynamicMenu.svelte +6 -6
- package/dist/components/menu/DynamicMenu.svelte.d.ts +3 -2
- package/dist/components/menu/HamburgerMenu.svelte +12 -25
- package/dist/components/menu/HamburgerMenu.svelte.d.ts +5 -2
- package/dist/components/menu/LinkMenuItem.svelte +25 -0
- package/dist/components/menu/LinkMenuItem.svelte.d.ts +29 -0
- package/dist/components/menu/Menu.d.ts +7 -0
- package/dist/components/menu/Menu.js +17 -0
- package/dist/components/menu/{ColumnMenu.svelte → NavigationItems.svelte} +10 -9
- package/dist/components/menu/{ColumnMenu.svelte.d.ts → NavigationItems.svelte.d.ts} +8 -6
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/package.json +1 -1
- package/dist/components/menu/FlatMenu.svelte +0 -56
- package/dist/components/menu/FlatMenu.svelte.d.ts +0 -21
- package/dist/components/menu/HamburgerButton.svelte +0 -15
- package/dist/components/menu/HamburgerButton.svelte.d.ts +0 -19
- package/dist/components/menu/MenuFunctions.d.ts +0 -3
- package/dist/components/menu/MenuFunctions.js +0 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function mergedClasses(...params: any[]): string;
|
|
@@ -307,6 +307,7 @@ export let size = ComponentSize.Normal;
|
|
|
307
307
|
export let justify = Justify.Center;
|
|
308
308
|
export let alignItems = AlignItmes.Center;
|
|
309
309
|
export let orientation = Orientation.Row;
|
|
310
|
+
export let role = "";
|
|
310
311
|
$: isSmall = size === ComponentSize.Small;
|
|
311
312
|
$: isLarge = size === ComponentSize.Large;
|
|
312
313
|
$: klasses = [
|
|
@@ -330,7 +331,6 @@ $: klasses = [
|
|
|
330
331
|
css ? css : "btn"
|
|
331
332
|
].filter((c) => c).join(" ");
|
|
332
333
|
</script>
|
|
333
|
-
<
|
|
334
|
-
<a class={klasses} href={href}>
|
|
334
|
+
<a class={klasses} href={href} role={role}>
|
|
335
335
|
<slot />
|
|
336
336
|
</a>
|
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
<script>import { Button } from "agnostic-svelte";
|
|
2
2
|
import { Orientation, Placement } from "../Styling.js";
|
|
3
|
-
import ColumnMenu from "./
|
|
4
|
-
import { HeaderNavigationItem } from "./Menu.js";
|
|
5
|
-
|
|
6
|
-
export let
|
|
7
|
-
export let linkCss = "";
|
|
3
|
+
import ColumnMenu from "./NavigationItems.svelte";
|
|
4
|
+
import { HeaderNavigationItem, defaultCss } from "./Menu.js";
|
|
5
|
+
import { mergedClasses } from "../CssHelper.js";
|
|
6
|
+
export let css;
|
|
8
7
|
export let contentPosition = Placement.End;
|
|
9
8
|
export let orientation = Orientation.Column;
|
|
10
9
|
export let localPages = [];
|
|
11
|
-
|
|
10
|
+
const cssClasses = { ...defaultCss, ...css };
|
|
11
|
+
$: expanded = false;
|
|
12
12
|
$: showContentBeforeButton = contentPosition == Placement.Start;
|
|
13
|
+
$: buttonCss = mergedClasses(cssClasses.buttonCss);
|
|
13
14
|
</script>
|
|
14
15
|
|
|
15
|
-
{#if
|
|
16
|
-
<
|
|
16
|
+
{#if expanded && showContentBeforeButton}
|
|
17
|
+
<div aria-expanded={expanded}>
|
|
18
|
+
<ColumnMenu {localPages} {orientation} css={cssClasses} />
|
|
19
|
+
</div>
|
|
17
20
|
{/if}
|
|
18
|
-
<
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
{
|
|
24
|
-
|
|
21
|
+
<Button css={buttonCss} on:click={() => (expanded = !expanded)}>
|
|
22
|
+
<slot name="handle">☰</slot>
|
|
23
|
+
</Button>
|
|
24
|
+
{#if expanded && !showContentBeforeButton}
|
|
25
|
+
<div aria-expanded={expanded}>
|
|
26
|
+
<ColumnMenu {localPages} {orientation} css={cssClasses} />
|
|
27
|
+
</div>
|
|
25
28
|
{/if}
|
|
26
29
|
|
|
27
30
|
<style>
|
|
@@ -3,9 +3,11 @@ import { Orientation, Placement } from '../Styling.js';
|
|
|
3
3
|
import { HeaderNavigationItem } from './Menu.js';
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
css: {
|
|
7
|
+
buttonCss: string[];
|
|
8
|
+
container: string[];
|
|
9
|
+
link: string[];
|
|
10
|
+
};
|
|
9
11
|
contentPosition?: Placement;
|
|
10
12
|
orientation?: Orientation;
|
|
11
13
|
localPages?: Array<HeaderNavigationItem>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
<script>import { HeaderNavigationItem } from "./Menu.js";
|
|
2
|
-
import { selectVisible } from "./MenuFunctions.js";
|
|
1
|
+
<script>import { HeaderNavigationItem, selectVisible, defaultCss } from "./Menu.js";
|
|
3
2
|
import { isAuthenticated } from "./authentication.js";
|
|
4
3
|
import { page } from "$app/stores";
|
|
5
|
-
|
|
6
|
-
export let
|
|
4
|
+
import { mergedClasses } from "../CssHelper.js";
|
|
5
|
+
export let css;
|
|
6
|
+
const cssClasses = { ...defaultCss, ...css };
|
|
7
7
|
export let localPages = [];
|
|
8
8
|
$: pagesVisiblity = isAuthenticated($page);
|
|
9
9
|
$: visibleNavItems = selectVisible(localPages, pagesVisiblity);
|
|
10
|
-
const klasses =
|
|
10
|
+
const klasses = mergedClasses("flex", "flex-dynamic-row", cssClasses.container);
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
|
-
<nav class={
|
|
13
|
+
<nav class={klasses}>
|
|
14
14
|
<div class="mobile">
|
|
15
15
|
<slot name="mobile" pages={visibleNavItems} />
|
|
16
16
|
</div>
|
|
@@ -2,8 +2,9 @@ import { SvelteComponent } from "svelte";
|
|
|
2
2
|
import { HeaderNavigationItem } from './Menu.js';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
css
|
|
6
|
-
|
|
5
|
+
css: {
|
|
6
|
+
container: string[];
|
|
7
|
+
};
|
|
7
8
|
localPages?: Array<HeaderNavigationItem>;
|
|
8
9
|
};
|
|
9
10
|
events: {
|
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
<script>import { HeaderNavigationItem } from "./Menu.js";
|
|
1
|
+
<script>import { HeaderNavigationItem, defaultCss } from "./Menu.js";
|
|
2
2
|
import { afterNavigate } from "$app/navigation";
|
|
3
3
|
import { Drawer, Button } from "agnostic-svelte";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
export let css
|
|
4
|
+
import { Orientation, Placement } from "../Styling.js";
|
|
5
|
+
import ColumnMenu from "./NavigationItems.svelte";
|
|
6
|
+
import { mergedClasses } from "../CssHelper.js";
|
|
7
|
+
export let css;
|
|
8
8
|
export let noBorder = false;
|
|
9
9
|
export let placement = Placement.Start;
|
|
10
10
|
export let localPages = [];
|
|
11
|
-
|
|
11
|
+
const cssClasses = { ...defaultCss, ...css };
|
|
12
12
|
let drawer = null;
|
|
13
13
|
const assignDrawerRef = (ev) => {
|
|
14
14
|
drawer = ev.detail.instance;
|
|
15
15
|
};
|
|
16
16
|
afterNavigate((navigation) => drawer?.hide());
|
|
17
|
-
const
|
|
18
|
-
"hamburger-handle",
|
|
19
|
-
css ? css : "",
|
|
20
|
-
noBorder ? "no-border" : ""
|
|
21
|
-
].filter((c) => c).join(" ");
|
|
17
|
+
const buttonCss = mergedClasses("hamburger-handle", noBorder, cssClasses.buttonCss);
|
|
22
18
|
</script>
|
|
23
19
|
|
|
24
20
|
<Button
|
|
@@ -26,7 +22,7 @@ const klasses = [
|
|
|
26
22
|
data-a11y-dialog-show="hamburger-menu"
|
|
27
23
|
mode="primary"
|
|
28
24
|
noBorder
|
|
29
|
-
css={
|
|
25
|
+
css={buttonCss}
|
|
30
26
|
>
|
|
31
27
|
☰
|
|
32
28
|
</Button>
|
|
@@ -37,26 +33,17 @@ const klasses = [
|
|
|
37
33
|
on:instance={assignDrawerRef}
|
|
38
34
|
title="Menu"
|
|
39
35
|
>
|
|
40
|
-
<
|
|
41
|
-
{#each localPages as pageItem}
|
|
42
|
-
<li aria-current={isSelected(includeSubpagesForSelect, $page, pageItem)}>
|
|
43
|
-
<span class="screenreader-only">Navigate to {pageItem.name}</span>
|
|
44
|
-
<a on:click={pageItem.action} href={pageItem.path}>
|
|
45
|
-
{pageItem.name}
|
|
46
|
-
</a>
|
|
47
|
-
</li>
|
|
48
|
-
{/each}
|
|
49
|
-
</ul>
|
|
36
|
+
<ColumnMenu {localPages} orientation={Orientation.Column} css={cssClasses} />
|
|
50
37
|
</Drawer>
|
|
51
38
|
|
|
52
39
|
<style>
|
|
53
|
-
|
|
40
|
+
:global(.hamburger-handle) {
|
|
54
41
|
background: var(--functional-menu-background) !important;
|
|
55
|
-
|
|
42
|
+
}
|
|
56
43
|
:global(#hamburger-menu) {
|
|
57
44
|
z-index: 10001;
|
|
58
45
|
}
|
|
59
|
-
|
|
46
|
+
:global(#hamburger-menu > .dialog-content) {
|
|
60
47
|
background: var(--functional-menu-background) !important;
|
|
61
48
|
}
|
|
62
49
|
:global(.no-border) {
|
|
@@ -3,11 +3,14 @@ import { HeaderNavigationItem } from './Menu.js';
|
|
|
3
3
|
import { Placement } from '../Styling.js';
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: {
|
|
6
|
-
css
|
|
6
|
+
css: {
|
|
7
|
+
buttonCss: string[];
|
|
8
|
+
container: string[];
|
|
9
|
+
link: string[];
|
|
10
|
+
};
|
|
7
11
|
noBorder?: boolean;
|
|
8
12
|
placement?: Placement;
|
|
9
13
|
localPages?: Array<HeaderNavigationItem>;
|
|
10
|
-
includeSubpagesForSelect?: boolean;
|
|
11
14
|
};
|
|
12
15
|
events: {
|
|
13
16
|
[evt: string]: CustomEvent<any>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script>export let disabled = false;
|
|
2
|
+
export let isSelected = false;
|
|
3
|
+
export let classes;
|
|
4
|
+
let btn;
|
|
5
|
+
export function focus() {
|
|
6
|
+
return btn.focus();
|
|
7
|
+
}
|
|
8
|
+
export function isDisabled() {
|
|
9
|
+
return btn.disabled;
|
|
10
|
+
}
|
|
11
|
+
</script>
|
|
12
|
+
<button
|
|
13
|
+
on:click
|
|
14
|
+
on:keydown
|
|
15
|
+
bind:this={btn}
|
|
16
|
+
role="menuitem"
|
|
17
|
+
tabindex={isSelected ? 0 : -1}
|
|
18
|
+
disabled={disabled}
|
|
19
|
+
class={classes}
|
|
20
|
+
>
|
|
21
|
+
<slot />
|
|
22
|
+
</button>
|
|
23
|
+
|
|
24
|
+
<style>
|
|
25
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
isSelected?: boolean;
|
|
6
|
+
classes: any;
|
|
7
|
+
focus?: () => any;
|
|
8
|
+
isDisabled?: () => any;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
click: MouseEvent;
|
|
12
|
+
keydown: KeyboardEvent;
|
|
13
|
+
} & {
|
|
14
|
+
[evt: string]: CustomEvent<any>;
|
|
15
|
+
};
|
|
16
|
+
slots: {
|
|
17
|
+
default: {};
|
|
18
|
+
};
|
|
19
|
+
exports?: {} | undefined;
|
|
20
|
+
bindings?: string | undefined;
|
|
21
|
+
};
|
|
22
|
+
export type LinkMenuItemProps = typeof __propDef.props;
|
|
23
|
+
export type LinkMenuItemEvents = typeof __propDef.events;
|
|
24
|
+
export type LinkMenuItemSlots = typeof __propDef.slots;
|
|
25
|
+
export default class LinkMenuItem extends SvelteComponent<LinkMenuItemProps, LinkMenuItemEvents, LinkMenuItemSlots> {
|
|
26
|
+
get focus(): () => any;
|
|
27
|
+
get isDisabled(): () => any;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -10,4 +10,11 @@ export declare class HeaderNavigationItem {
|
|
|
10
10
|
action?: ClickAction | undefined;
|
|
11
11
|
visiblity: Visiblity;
|
|
12
12
|
}
|
|
13
|
+
export declare function selectVisible(pages: Array<any>, visiblity: Visiblity): any[];
|
|
14
|
+
export declare function isSelected(includeSubpagesForSelect: boolean, page: any, item: HeaderNavigationItem): any;
|
|
15
|
+
export declare const defaultCss: {
|
|
16
|
+
buttonCss: never[];
|
|
17
|
+
container: never[];
|
|
18
|
+
link: never[];
|
|
19
|
+
};
|
|
13
20
|
export {};
|
|
@@ -10,3 +10,20 @@ export class HeaderNavigationItem {
|
|
|
10
10
|
action;
|
|
11
11
|
visiblity = Visiblity.Always;
|
|
12
12
|
}
|
|
13
|
+
export function selectVisible(pages, visiblity) {
|
|
14
|
+
return pages.filter((page) => page?.visiblity === Visiblity.Always ||
|
|
15
|
+
page?.visiblity === visiblity);
|
|
16
|
+
}
|
|
17
|
+
export function isSelected(includeSubpagesForSelect, page, item) {
|
|
18
|
+
if (page?.url?.pathname === '/') {
|
|
19
|
+
return page?.url?.pathname === item.path;
|
|
20
|
+
}
|
|
21
|
+
return includeSubpagesForSelect
|
|
22
|
+
? (page?.url.pathname.startsWith(item.path ?? '-') && item.path !== '/')
|
|
23
|
+
: page?.url.pathname === item.path;
|
|
24
|
+
}
|
|
25
|
+
export const defaultCss = {
|
|
26
|
+
buttonCss: [],
|
|
27
|
+
container: [],
|
|
28
|
+
link: []
|
|
29
|
+
};
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
<script>import { HeaderNavigationItem } from "./Menu.js";
|
|
2
|
-
import { isSelected } from "./MenuFunctions.js";
|
|
1
|
+
<script>import { HeaderNavigationItem, isSelected, defaultCss } from "./Menu.js";
|
|
3
2
|
import { Orientation } from "../Styling.js";
|
|
4
3
|
import Link from "../Link.svelte";
|
|
5
4
|
import { page } from "$app/stores";
|
|
6
|
-
|
|
7
|
-
export let
|
|
5
|
+
import { mergedClasses } from "../CssHelper.js";
|
|
6
|
+
export let css;
|
|
8
7
|
export let localPages = [];
|
|
9
8
|
export let orientation = Orientation.Column;
|
|
10
|
-
export let includeSubpagesForSelect =
|
|
11
|
-
const
|
|
9
|
+
export let includeSubpagesForSelect = true;
|
|
10
|
+
const cssClasses = { ...defaultCss, ...css };
|
|
11
|
+
const containerCss = mergedClasses("flex", cssClasses.container, orientation);
|
|
12
|
+
const linkCss = mergedClasses(cssClasses.link);
|
|
12
13
|
</script>
|
|
13
14
|
|
|
14
|
-
<ul class={
|
|
15
|
+
<ul class={containerCss} role="menu" aria-roledescription="">
|
|
15
16
|
{#each localPages as pageItem}
|
|
16
|
-
<li aria-current={isSelected(includeSubpagesForSelect, $page, pageItem)}>
|
|
17
|
+
<li aria-current={isSelected(includeSubpagesForSelect, $page, pageItem)} role="presentation">
|
|
17
18
|
<span class="screenreader-only">Navigate to {pageItem.name}</span>
|
|
18
|
-
<Link href={pageItem.path} css={linkCss}>
|
|
19
|
+
<Link href={pageItem.path} css={linkCss} role="menuItem">
|
|
19
20
|
{pageItem.name}
|
|
20
21
|
</Link>
|
|
21
22
|
</li>
|
|
@@ -3,8 +3,10 @@ import { HeaderNavigationItem } from './Menu.js';
|
|
|
3
3
|
import { Orientation } from '../Styling.js';
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: {
|
|
6
|
-
css
|
|
7
|
-
|
|
6
|
+
css: {
|
|
7
|
+
container: string[];
|
|
8
|
+
link: string[];
|
|
9
|
+
};
|
|
8
10
|
localPages?: Array<HeaderNavigationItem>;
|
|
9
11
|
orientation?: Orientation;
|
|
10
12
|
includeSubpagesForSelect?: boolean;
|
|
@@ -16,9 +18,9 @@ declare const __propDef: {
|
|
|
16
18
|
exports?: {} | undefined;
|
|
17
19
|
bindings?: string | undefined;
|
|
18
20
|
};
|
|
19
|
-
export type
|
|
20
|
-
export type
|
|
21
|
-
export type
|
|
22
|
-
export default class
|
|
21
|
+
export type NavigationItemsProps = typeof __propDef.props;
|
|
22
|
+
export type NavigationItemsEvents = typeof __propDef.events;
|
|
23
|
+
export type NavigationItemsSlots = typeof __propDef.slots;
|
|
24
|
+
export default class NavigationItems extends SvelteComponent<NavigationItemsProps, NavigationItemsEvents, NavigationItemsSlots> {
|
|
23
25
|
}
|
|
24
26
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export { default as FlatMenu } from './components/menu/FlatMenu.svelte';
|
|
2
1
|
export { default as HamburgerMenu } from './components/menu/HamburgerMenu.svelte';
|
|
3
|
-
export { default as ColumnMenu } from './components/menu/
|
|
2
|
+
export { default as ColumnMenu } from './components/menu/NavigationItems.svelte';
|
|
4
3
|
export { default as DynamicMenu } from './components/menu/DynamicMenu.svelte';
|
|
5
4
|
export { default as CollapsibleMenu } from './components/menu/CollapsibleMenu.svelte';
|
|
6
5
|
export { default as DropDownMenu } from './components/menu/Menu.svelte';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export { default as FlatMenu } from './components/menu/FlatMenu.svelte';
|
|
2
1
|
export { default as HamburgerMenu } from './components/menu/HamburgerMenu.svelte';
|
|
3
|
-
export { default as ColumnMenu } from './components/menu/
|
|
2
|
+
export { default as ColumnMenu } from './components/menu/NavigationItems.svelte';
|
|
4
3
|
export { default as DynamicMenu } from './components/menu/DynamicMenu.svelte';
|
|
5
4
|
export { default as CollapsibleMenu } from './components/menu/CollapsibleMenu.svelte';
|
|
6
5
|
export { default as DropDownMenu } from './components/menu/Menu.svelte';
|
package/package.json
CHANGED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
<script>import { HeaderNavigationItem } from "./Menu.js";
|
|
2
|
-
import ColumnMenu from "./ColumnMenu.svelte";
|
|
3
|
-
import { Orientation } from "../Styling.js";
|
|
4
|
-
export let css = "";
|
|
5
|
-
export let localPages = [];
|
|
6
|
-
export let includeSubpagesForSelect = false;
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<ColumnMenu localPages={localPages} orientation={Orientation.DynamicRow} css={css}/>
|
|
10
|
-
|
|
11
|
-
<style>
|
|
12
|
-
ul {
|
|
13
|
-
background: var(--functional-menu-background);
|
|
14
|
-
margin: var(--functional-menu-margin);
|
|
15
|
-
padding: var(--functional-menu-padding);
|
|
16
|
-
}
|
|
17
|
-
li {
|
|
18
|
-
}
|
|
19
|
-
a {
|
|
20
|
-
color: var(--functional-menu-item-color);
|
|
21
|
-
margin: var(--functional-menu-item-margin);
|
|
22
|
-
padding: var(--functional-menu-item-padding);
|
|
23
|
-
background: var(--functional-menu-item-background);
|
|
24
|
-
border-top: var(--functional-menu-item-border-top);
|
|
25
|
-
border-right: var(--functional-menu-item-border-right);
|
|
26
|
-
border-bottom: var(--functional-menu-item-border-bottom);
|
|
27
|
-
border-left: var(--functional-menu-item-border-left);
|
|
28
|
-
border-radius: var(--functional-menu-item-radius, var(--functional-radius));
|
|
29
|
-
text-decoration: none;
|
|
30
|
-
display: block;
|
|
31
|
-
}
|
|
32
|
-
a:hover {
|
|
33
|
-
color: var(--functional-menu-item-hover-color);
|
|
34
|
-
margin: var(--functional-menu-item-hover-margin);
|
|
35
|
-
padding: var(--functional-menu-item-hover-padding);
|
|
36
|
-
background: var(--functional-menu-item-hover-background);
|
|
37
|
-
border-top: var(--functional-menu-item-hover-border-top);
|
|
38
|
-
border-right: var(--functional-menu-item-hover-border-right);
|
|
39
|
-
border-bottom: var(--functional-menu-item-hover-border-bottom);
|
|
40
|
-
border-left: var(--functional-menu-item-hover-border-left);
|
|
41
|
-
border-radius: var(--functional-menu-item-hover-radius, var(--functional-radius));
|
|
42
|
-
}
|
|
43
|
-
li[aria-current='true'] a {
|
|
44
|
-
color: var(--functional-menu-item-selected-color);
|
|
45
|
-
margin: var(--functional-menu-item-selected-margin);
|
|
46
|
-
padding: var(--functional-menu-item-selected-padding);
|
|
47
|
-
background: var(--functional-menu-item-selected-background);
|
|
48
|
-
border-top: var(--functional-menu-item-selected-border-top);
|
|
49
|
-
border-right: var(--functional-menu-item-selected-border-right);
|
|
50
|
-
border-bottom: var(--functional-menu-item-selected-border-bottom);
|
|
51
|
-
border-left: var(--functional-menu-item-selected-border-left);
|
|
52
|
-
border-radius: var(--functional-menu-item-selected-radius, var(--functional-radius));
|
|
53
|
-
}
|
|
54
|
-
@media (min-width: 960px) {
|
|
55
|
-
}
|
|
56
|
-
</style>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
import { HeaderNavigationItem } from './Menu.js';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
css?: string;
|
|
6
|
-
localPages?: Array<HeaderNavigationItem>;
|
|
7
|
-
includeSubpagesForSelect?: boolean;
|
|
8
|
-
};
|
|
9
|
-
events: {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {};
|
|
13
|
-
exports?: {} | undefined;
|
|
14
|
-
bindings?: string | undefined;
|
|
15
|
-
};
|
|
16
|
-
export type FlatMenuProps = typeof __propDef.props;
|
|
17
|
-
export type FlatMenuEvents = typeof __propDef.events;
|
|
18
|
-
export type FlatMenuSlots = typeof __propDef.slots;
|
|
19
|
-
export default class FlatMenu extends SvelteComponent<FlatMenuProps, FlatMenuEvents, FlatMenuSlots> {
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<script>import { Button } from "@functionalcms/svelte-components";
|
|
2
|
-
export let css = "";
|
|
3
|
-
export let noBorder = false;
|
|
4
|
-
const klasses = [css ? css : "", noBorder ? "no-border" : ""].filter((c) => c).join(" ");
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<Button
|
|
8
|
-
type="button"
|
|
9
|
-
data-a11y-dialog-show="hamburger-menu"
|
|
10
|
-
mode="primary"
|
|
11
|
-
noBorder
|
|
12
|
-
css={klasses}
|
|
13
|
-
>
|
|
14
|
-
☰
|
|
15
|
-
</Button>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
css?: string;
|
|
5
|
-
noBorder?: boolean;
|
|
6
|
-
};
|
|
7
|
-
events: {
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {};
|
|
11
|
-
exports?: {} | undefined;
|
|
12
|
-
bindings?: string | undefined;
|
|
13
|
-
};
|
|
14
|
-
export type HamburgerButtonProps = typeof __propDef.props;
|
|
15
|
-
export type HamburgerButtonEvents = typeof __propDef.events;
|
|
16
|
-
export type HamburgerButtonSlots = typeof __propDef.slots;
|
|
17
|
-
export default class HamburgerButton extends SvelteComponent<HamburgerButtonProps, HamburgerButtonEvents, HamburgerButtonSlots> {
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Visiblity } from "./Menu.js";
|
|
2
|
-
export function selectVisible(pages, visiblity) {
|
|
3
|
-
return pages.filter((page) => page?.visiblity === Visiblity.Always ||
|
|
4
|
-
page?.visiblity === visiblity);
|
|
5
|
-
}
|
|
6
|
-
export function isSelected(includeSubpagesForSelect, page, item) {
|
|
7
|
-
if (page?.url?.pathname === '/') {
|
|
8
|
-
return page?.url?.pathname === item.path;
|
|
9
|
-
}
|
|
10
|
-
return includeSubpagesForSelect
|
|
11
|
-
? (page?.url.pathname.startsWith(item.path ?? '-') && item.path !== '/')
|
|
12
|
-
: page?.url.pathname === item.path;
|
|
13
|
-
}
|