@functionalcms/svelte-components 2.38.8 → 2.40.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/menu/Menu.d.ts +1 -0
- package/dist/components/menu/Menu.js +1 -0
- package/dist/components/menu/NavigationItems.svelte +4 -44
- package/dist/components/menu/NavigationItems.svelte.d.ts +5 -1
- package/dist/components/presentation/Carusel.svelte +89 -27
- package/dist/components/presentation/Carusel.svelte.d.ts +39 -2
- package/dist/components/presentation/ImageCompare.svelte +178 -0
- package/dist/components/presentation/ImageCompare.svelte.d.ts +47 -0
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ export declare class HeaderNavigationItem {
|
|
|
9
9
|
path?: string | undefined;
|
|
10
10
|
action?: ClickAction | undefined;
|
|
11
11
|
visiblity: Visiblity;
|
|
12
|
+
subItems?: HeaderNavigationItem[];
|
|
12
13
|
}
|
|
13
14
|
export declare function selectVisible(pages: Array<any>, visiblity: Visiblity): any[];
|
|
14
15
|
export declare function isSelected(includeSubpagesForSelect: boolean, page: any, item: HeaderNavigationItem): any;
|
|
@@ -20,56 +20,16 @@ const linkCss = mergedClasses(cssClasses.link);
|
|
|
20
20
|
role="presentation"
|
|
21
21
|
>
|
|
22
22
|
<span class="screenreader-only">Navigate to {pageItem.name}</span>
|
|
23
|
-
<!-- <Link href={pageItem.path} role="menuItem"> -->
|
|
24
23
|
<a href={pageItem.path} role="menuItem">
|
|
25
24
|
{pageItem.name}
|
|
26
25
|
</a>
|
|
27
|
-
|
|
26
|
+
|
|
27
|
+
{#if pageItem.subItems?.length > 0}
|
|
28
|
+
<slot name="mobile" pages={pageItem.subItems} />
|
|
29
|
+
{/if}
|
|
28
30
|
</li>
|
|
29
31
|
{/each}
|
|
30
32
|
</ul>
|
|
31
33
|
|
|
32
34
|
<style>
|
|
33
|
-
/* ul {
|
|
34
|
-
background: var(--functional-menu-background);
|
|
35
|
-
margin: var(--functional-menu-margin);
|
|
36
|
-
padding: var(--functional-menu-padding);
|
|
37
|
-
}
|
|
38
|
-
li {
|
|
39
|
-
}
|
|
40
|
-
a {
|
|
41
|
-
color: var(--functional-menu-item-color);
|
|
42
|
-
margin: var(--functional-menu-item-margin);
|
|
43
|
-
padding: var(--functional-menu-item-padding);
|
|
44
|
-
background: var(--functional-menu-item-background);
|
|
45
|
-
border-top: var(--functional-menu-item-border-top);
|
|
46
|
-
border-right: var(--functional-menu-item-border-right);
|
|
47
|
-
border-bottom: var(--functional-menu-item-border-bottom);
|
|
48
|
-
border-left: var(--functional-menu-item-border-left);
|
|
49
|
-
border-radius: var(--functional-menu-item-radius, var(--functional-radius));
|
|
50
|
-
text-decoration: none;
|
|
51
|
-
display: block;
|
|
52
|
-
}
|
|
53
|
-
a:hover {
|
|
54
|
-
color: var(--functional-menu-item-hover-color);
|
|
55
|
-
margin: var(--functional-menu-item-hover-margin);
|
|
56
|
-
padding: var(--functional-menu-item-hover-padding);
|
|
57
|
-
background: var(--functional-menu-item-hover-background);
|
|
58
|
-
border-top: var(--functional-menu-item-hover-border-top);
|
|
59
|
-
border-right: var(--functional-menu-item-hover-border-right);
|
|
60
|
-
border-bottom: var(--functional-menu-item-hover-border-bottom);
|
|
61
|
-
border-left: var(--functional-menu-item-hover-border-left);
|
|
62
|
-
border-radius: var(--functional-menu-item-hover-radius, var(--functional-radius));
|
|
63
|
-
}
|
|
64
|
-
li[aria-current='true'] a {
|
|
65
|
-
color: var(--functional-menu-item-selected-color);
|
|
66
|
-
margin: var(--functional-menu-item-selected-margin);
|
|
67
|
-
padding: var(--functional-menu-item-selected-padding);
|
|
68
|
-
background: var(--functional-menu-item-selected-background);
|
|
69
|
-
border-top: var(--functional-menu-item-selected-border-top);
|
|
70
|
-
border-right: var(--functional-menu-item-selected-border-right);
|
|
71
|
-
border-bottom: var(--functional-menu-item-selected-border-bottom);
|
|
72
|
-
border-left: var(--functional-menu-item-selected-border-left);
|
|
73
|
-
border-radius: var(--functional-menu-item-selected-radius, var(--functional-radius));
|
|
74
|
-
} */
|
|
75
35
|
</style>
|
|
@@ -1,40 +1,102 @@
|
|
|
1
1
|
<script>import { Splide, SplideSlide } from "@splidejs/svelte-splide";
|
|
2
2
|
export let items = [];
|
|
3
3
|
export let perPage = 1;
|
|
4
|
+
export let rewind = true;
|
|
5
|
+
export let type = "loop";
|
|
6
|
+
export let waitForTransition = true;
|
|
7
|
+
export let autoWidth = void 0;
|
|
8
|
+
export let autoHeight = void 0;
|
|
9
|
+
export let start = void 0;
|
|
10
|
+
export let arrowPath = void 0;
|
|
11
|
+
export let autoplay = void 0;
|
|
12
|
+
export let interval = void 0;
|
|
13
|
+
export let pauseOnHover = void 0;
|
|
14
|
+
export let pauseOnFocus = void 0;
|
|
15
|
+
export let resetProgress = void 0;
|
|
16
|
+
export let lazyLoad = void 0;
|
|
17
|
+
export let preloadPages = void 0;
|
|
18
|
+
export let keyboard = void 0;
|
|
19
|
+
export let wheel = void 0;
|
|
20
|
+
export let wheelMinThreshold = void 0;
|
|
21
|
+
export let wheelSleep = void 0;
|
|
22
|
+
export let releaseWheel = void 0;
|
|
23
|
+
export let direction = "ltr";
|
|
24
|
+
export let cover = void 0;
|
|
25
|
+
export let slideFocus = void 0;
|
|
26
|
+
export let isNavigation;
|
|
27
|
+
export let trimSpace = void 0;
|
|
28
|
+
export let omitEnd = void 0;
|
|
29
|
+
export let updateOnMove = void 0;
|
|
30
|
+
export let mediaQuery = void 0;
|
|
31
|
+
export let focusableNodes = void 0;
|
|
32
|
+
export let noDrag = void 0;
|
|
33
|
+
export let live = void 0;
|
|
34
|
+
export let useScroll = void 0;
|
|
35
|
+
export let reducedMotion = void 0;
|
|
4
36
|
let options = {
|
|
5
37
|
perPage,
|
|
6
|
-
rewind
|
|
38
|
+
rewind,
|
|
39
|
+
type,
|
|
40
|
+
waitForTransition,
|
|
41
|
+
autoWidth,
|
|
42
|
+
autoHeight,
|
|
43
|
+
start,
|
|
44
|
+
arrowPath,
|
|
45
|
+
autoplay,
|
|
46
|
+
interval,
|
|
47
|
+
pauseOnHover,
|
|
48
|
+
pauseOnFocus,
|
|
49
|
+
resetProgress,
|
|
50
|
+
lazyLoad,
|
|
51
|
+
preloadPages,
|
|
52
|
+
keyboard,
|
|
53
|
+
wheel,
|
|
54
|
+
wheelMinThreshold,
|
|
55
|
+
wheelSleep,
|
|
56
|
+
releaseWheel,
|
|
57
|
+
direction,
|
|
58
|
+
cover,
|
|
59
|
+
slideFocus,
|
|
60
|
+
isNavigation,
|
|
61
|
+
trimSpace,
|
|
62
|
+
omitEnd,
|
|
63
|
+
updateOnMove,
|
|
64
|
+
mediaQuery,
|
|
65
|
+
focusableNodes,
|
|
66
|
+
noDrag,
|
|
67
|
+
live,
|
|
68
|
+
useScroll,
|
|
69
|
+
reducedMotion
|
|
7
70
|
};
|
|
8
71
|
</script>
|
|
9
72
|
|
|
10
73
|
<Splide class="carusele" aria-label="gallery" {options}>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
74
|
+
{#each items as item}
|
|
75
|
+
<SplideSlide>
|
|
76
|
+
<slot {item}>
|
|
77
|
+
<h1>{item.text}</h1>
|
|
78
|
+
<a href={item.link}>
|
|
79
|
+
<img src={item.image} alt={item.text} />
|
|
80
|
+
</a>
|
|
81
|
+
</slot>
|
|
82
|
+
</SplideSlide>
|
|
83
|
+
{/each}
|
|
21
84
|
</Splide>
|
|
22
85
|
|
|
23
86
|
<style>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
87
|
+
:global(.carusele) {
|
|
88
|
+
width: 100%;
|
|
89
|
+
}
|
|
90
|
+
:global(.splide__slide) {
|
|
91
|
+
overflow: hidden !important;
|
|
92
|
+
}
|
|
93
|
+
img {
|
|
94
|
+
width: 100%;
|
|
95
|
+
height: auto;
|
|
96
|
+
margin: auto;
|
|
97
|
+
}
|
|
98
|
+
a {
|
|
99
|
+
height: 100%;
|
|
100
|
+
display: flex;
|
|
101
|
+
}
|
|
40
102
|
</style>
|
|
@@ -1,14 +1,51 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Options } from '@splidejs/splide';
|
|
3
|
+
import type { CaruseleItem } from './Carusele';
|
|
3
4
|
declare const __propDef: {
|
|
4
5
|
props: {
|
|
5
6
|
items?: Array<CaruseleItem>;
|
|
6
7
|
perPage?: number;
|
|
8
|
+
rewind?: boolean;
|
|
9
|
+
type?: "slide" | "loop" | "fade";
|
|
10
|
+
waitForTransition?: boolean;
|
|
11
|
+
autoWidth?: boolean | undefined;
|
|
12
|
+
autoHeight?: boolean | undefined;
|
|
13
|
+
start?: number | undefined;
|
|
14
|
+
arrowPath?: string | undefined;
|
|
15
|
+
autoplay?: boolean | "pause" | undefined;
|
|
16
|
+
interval?: number | undefined;
|
|
17
|
+
pauseOnHover?: boolean | undefined;
|
|
18
|
+
pauseOnFocus?: boolean | undefined;
|
|
19
|
+
resetProgress?: boolean | undefined;
|
|
20
|
+
lazyLoad?: boolean | "nearby" | "sequential" | undefined;
|
|
21
|
+
preloadPages?: number | undefined;
|
|
22
|
+
keyboard?: boolean | "global" | "focused" | undefined;
|
|
23
|
+
wheel?: boolean | undefined;
|
|
24
|
+
wheelMinThreshold?: number | undefined;
|
|
25
|
+
wheelSleep?: number | undefined;
|
|
26
|
+
releaseWheel?: boolean | undefined;
|
|
27
|
+
direction?: "ltr" | "rtl" | "ttb";
|
|
28
|
+
cover?: boolean | undefined;
|
|
29
|
+
slideFocus?: boolean | undefined;
|
|
30
|
+
isNavigation: boolean | undefined;
|
|
31
|
+
trimSpace?: boolean | "move" | undefined;
|
|
32
|
+
omitEnd?: boolean | undefined;
|
|
33
|
+
updateOnMove?: boolean | undefined;
|
|
34
|
+
mediaQuery?: "min" | "max" | undefined;
|
|
35
|
+
focusableNodes?: string | undefined;
|
|
36
|
+
noDrag?: string | undefined;
|
|
37
|
+
live?: boolean | undefined;
|
|
38
|
+
useScroll?: boolean | undefined;
|
|
39
|
+
reducedMotion?: Options | undefined;
|
|
7
40
|
};
|
|
8
41
|
events: {
|
|
9
42
|
[evt: string]: CustomEvent<any>;
|
|
10
43
|
};
|
|
11
|
-
slots: {
|
|
44
|
+
slots: {
|
|
45
|
+
default: {
|
|
46
|
+
item: CaruseleItem;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
12
49
|
exports?: {} | undefined;
|
|
13
50
|
bindings?: string | undefined;
|
|
14
51
|
};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
let hideOnSlide = true,
|
|
3
|
+
imgOffset = null,
|
|
4
|
+
sliding = false,
|
|
5
|
+
contain = false,
|
|
6
|
+
overlay = true,
|
|
7
|
+
offset = 0.5,
|
|
8
|
+
before = "",
|
|
9
|
+
after = "",
|
|
10
|
+
lazyLoad = false,
|
|
11
|
+
img;
|
|
12
|
+
|
|
13
|
+
function resize(e) {
|
|
14
|
+
imgOffset = (
|
|
15
|
+
e.type === "load" ? e.target : img
|
|
16
|
+
).getBoundingClientRect();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function move(e) {
|
|
20
|
+
if (sliding && imgOffset) {
|
|
21
|
+
let x = (e.touches ? e.touches[0].pageX : e.pageX) - imgOffset.left;
|
|
22
|
+
x = x < 0 ? 0 : x > w ? w : x;
|
|
23
|
+
offset = x / w;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function start(e) {
|
|
28
|
+
sliding = true;
|
|
29
|
+
move(e);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function end() {
|
|
33
|
+
sliding = false;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
$: w = imgOffset && imgOffset.width;
|
|
37
|
+
$: h = imgOffset && imgOffset.height;
|
|
38
|
+
$: x = w * offset;
|
|
39
|
+
$: opacity = hideOnSlide && sliding ? 0 : 1;
|
|
40
|
+
$: style = contain
|
|
41
|
+
? `width:100%;height:100%;`
|
|
42
|
+
: `width:${w}px;height:${h}px;`;
|
|
43
|
+
$: imageLoading = lazyLoad ? "lazy" : "eager";
|
|
44
|
+
|
|
45
|
+
export { before, after, offset, overlay, contain, lazyLoad, hideOnSlide };
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<svelte:window
|
|
49
|
+
on:touchmove={move}
|
|
50
|
+
on:touchend={end}
|
|
51
|
+
on:mousemove={move}
|
|
52
|
+
on:mouseup={end}
|
|
53
|
+
on:resize={resize}
|
|
54
|
+
/>
|
|
55
|
+
|
|
56
|
+
<div class="container" {style} on:touchstart={start} on:mousedown={start} role="img" aria-roledescription="image slider">
|
|
57
|
+
<img
|
|
58
|
+
bind:this={img}
|
|
59
|
+
loading={imageLoading}
|
|
60
|
+
src={after}
|
|
61
|
+
alt="after"
|
|
62
|
+
on:mousedown|preventDefault
|
|
63
|
+
on:load={resize}
|
|
64
|
+
{style}
|
|
65
|
+
/>
|
|
66
|
+
<img
|
|
67
|
+
loading={imageLoading}
|
|
68
|
+
src={before}
|
|
69
|
+
alt="before"
|
|
70
|
+
on:mousedown|preventDefault
|
|
71
|
+
style="{style}clip:rect(0, {x}px, {h}px, 0);"
|
|
72
|
+
/>
|
|
73
|
+
{#if overlay}
|
|
74
|
+
<div class="overlay" style="opacity:{opacity}"></div>
|
|
75
|
+
{/if}
|
|
76
|
+
<div class="before-label" style="opacity:{opacity}">
|
|
77
|
+
<slot name="before"></slot>
|
|
78
|
+
</div>
|
|
79
|
+
<div class="after-label" style="opacity:{opacity}">
|
|
80
|
+
<slot name="after"></slot>
|
|
81
|
+
</div>
|
|
82
|
+
<div class="handle" style="left: calc({offset * 100}% - 20px)">
|
|
83
|
+
<div class="arrow-left"></div>
|
|
84
|
+
<div class="arrow-right"></div>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
<style>
|
|
89
|
+
.container {
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
position: relative;
|
|
92
|
+
box-sizing: content-box;
|
|
93
|
+
}
|
|
94
|
+
.container img {
|
|
95
|
+
top: 0;
|
|
96
|
+
left: 0;
|
|
97
|
+
z-index: 20;
|
|
98
|
+
display: block;
|
|
99
|
+
max-width: 100%;
|
|
100
|
+
user-select: none;
|
|
101
|
+
object-fit: cover;
|
|
102
|
+
position: absolute;
|
|
103
|
+
}
|
|
104
|
+
.overlay {
|
|
105
|
+
top: 0;
|
|
106
|
+
opacity: 0;
|
|
107
|
+
z-index: 25;
|
|
108
|
+
width: 100%;
|
|
109
|
+
height: 100%;
|
|
110
|
+
position: absolute;
|
|
111
|
+
transition: opacity 0.5s;
|
|
112
|
+
background: rgba(0, 0, 0, 0.5);
|
|
113
|
+
}
|
|
114
|
+
.before-label,
|
|
115
|
+
.after-label {
|
|
116
|
+
top: 0;
|
|
117
|
+
bottom: 0;
|
|
118
|
+
z-index: 25;
|
|
119
|
+
user-select: none;
|
|
120
|
+
position: absolute;
|
|
121
|
+
}
|
|
122
|
+
.before-label {
|
|
123
|
+
left: 0;
|
|
124
|
+
}
|
|
125
|
+
.after-label {
|
|
126
|
+
right: 0;
|
|
127
|
+
}
|
|
128
|
+
.container:hover > .overlay {
|
|
129
|
+
opacity: 1;
|
|
130
|
+
}
|
|
131
|
+
.handle {
|
|
132
|
+
z-index: 30;
|
|
133
|
+
width: 40px;
|
|
134
|
+
height: 40px;
|
|
135
|
+
cursor: move;
|
|
136
|
+
background: none;
|
|
137
|
+
margin-top: -4px;
|
|
138
|
+
margin-left: -4px;
|
|
139
|
+
user-select: none;
|
|
140
|
+
position: absolute;
|
|
141
|
+
border-radius: 50px;
|
|
142
|
+
top: calc(50% - 20px);
|
|
143
|
+
border: 4px solid white;
|
|
144
|
+
}
|
|
145
|
+
.handle:before,
|
|
146
|
+
.handle:after {
|
|
147
|
+
content: "";
|
|
148
|
+
height: 9999px;
|
|
149
|
+
position: absolute;
|
|
150
|
+
left: calc(50% - 2px);
|
|
151
|
+
border: 2px solid white;
|
|
152
|
+
}
|
|
153
|
+
.handle:before {
|
|
154
|
+
top: 40px;
|
|
155
|
+
}
|
|
156
|
+
.handle:after {
|
|
157
|
+
bottom: 40px;
|
|
158
|
+
}
|
|
159
|
+
.arrow-right,
|
|
160
|
+
.arrow-left {
|
|
161
|
+
width: 0;
|
|
162
|
+
height: 0;
|
|
163
|
+
user-select: none;
|
|
164
|
+
position: relative;
|
|
165
|
+
border-top: 10px solid transparent;
|
|
166
|
+
border-bottom: 10px solid transparent;
|
|
167
|
+
}
|
|
168
|
+
.arrow-right {
|
|
169
|
+
left: 23px;
|
|
170
|
+
bottom: 10px;
|
|
171
|
+
border-left: 10px solid white;
|
|
172
|
+
}
|
|
173
|
+
.arrow-left {
|
|
174
|
+
left: 7px;
|
|
175
|
+
top: 10px;
|
|
176
|
+
border-right: 10px solid white;
|
|
177
|
+
}
|
|
178
|
+
</style>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} ImageCompareProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} ImageCompareEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} ImageCompareSlots */
|
|
4
|
+
export default class ImageCompare extends SvelteComponent<{
|
|
5
|
+
before?: string | undefined;
|
|
6
|
+
after?: string | undefined;
|
|
7
|
+
offset?: number | undefined;
|
|
8
|
+
overlay?: boolean | undefined;
|
|
9
|
+
contain?: boolean | undefined;
|
|
10
|
+
lazyLoad?: boolean | undefined;
|
|
11
|
+
hideOnSlide?: boolean | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
mousedown: MouseEvent;
|
|
14
|
+
} & {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {
|
|
17
|
+
before: {};
|
|
18
|
+
after: {};
|
|
19
|
+
}> {
|
|
20
|
+
}
|
|
21
|
+
export type ImageCompareProps = typeof __propDef.props;
|
|
22
|
+
export type ImageCompareEvents = typeof __propDef.events;
|
|
23
|
+
export type ImageCompareSlots = typeof __propDef.slots;
|
|
24
|
+
import { SvelteComponent } from "svelte";
|
|
25
|
+
declare const __propDef: {
|
|
26
|
+
props: {
|
|
27
|
+
before?: string | undefined;
|
|
28
|
+
after?: string | undefined;
|
|
29
|
+
offset?: number | undefined;
|
|
30
|
+
overlay?: boolean | undefined;
|
|
31
|
+
contain?: boolean | undefined;
|
|
32
|
+
lazyLoad?: boolean | undefined;
|
|
33
|
+
hideOnSlide?: boolean | undefined;
|
|
34
|
+
};
|
|
35
|
+
events: {
|
|
36
|
+
mousedown: MouseEvent;
|
|
37
|
+
} & {
|
|
38
|
+
[evt: string]: CustomEvent<any>;
|
|
39
|
+
};
|
|
40
|
+
slots: {
|
|
41
|
+
before: {};
|
|
42
|
+
after: {};
|
|
43
|
+
};
|
|
44
|
+
exports?: undefined;
|
|
45
|
+
bindings?: undefined;
|
|
46
|
+
};
|
|
47
|
+
export {};
|