@functionalcms/svelte-components 3.0.6 → 3.0.7
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/Banner.svelte +5 -3
- package/dist/components/Link.svelte +54 -44
- package/dist/components/Logo.svelte +15 -3
- package/dist/components/Spacer.svelte +10 -7
- package/dist/components/Well.svelte +15 -12
- package/dist/components/agnostic/Alert/Alert.svelte +64 -57
- package/dist/components/agnostic/Avatar/Avatar.svelte +19 -15
- package/dist/components/agnostic/Breadcrumb/Breadcrumb.svelte +19 -10
- package/dist/components/agnostic/Button/Button.svelte +60 -35
- package/dist/components/agnostic/Button/ButtonGroup.svelte +4 -3
- package/dist/components/agnostic/Card/Card.svelte +22 -18
- package/dist/components/agnostic/ChoiceInput/ChoiceInput.svelte +87 -59
- package/dist/components/agnostic/Close/Close.svelte +11 -7
- package/dist/components/agnostic/Dialog/Dialog.svelte +64 -42
- package/dist/components/agnostic/Dialog/SvelteA11yDialog.svelte +76 -51
- package/dist/components/agnostic/Disclose/Disclose.svelte +15 -9
- package/dist/components/agnostic/Divider/Divider.svelte +21 -11
- package/dist/components/agnostic/Drawer/Drawer.svelte +20 -16
- package/dist/components/agnostic/EmptyState/EmptyState.svelte +10 -7
- package/dist/components/agnostic/Header/Header.svelte +22 -15
- package/dist/components/agnostic/Header/HeaderNav.svelte +4 -3
- package/dist/components/agnostic/Header/HeaderNavItem.svelte +3 -2
- package/dist/components/agnostic/Icon/Icon.svelte +28 -20
- package/dist/components/agnostic/Loader/Loader.svelte +6 -3
- package/dist/components/agnostic/Progress/Progress.svelte +5 -4
- package/dist/components/agnostic/Spinner/Spinner.svelte +6 -3
- package/dist/components/agnostic/Table/Table.svelte +191 -134
- package/dist/components/agnostic/Tabs/TabButtonCustom.svelte +24 -12
- package/dist/components/agnostic/Tabs/Tabs.svelte +173 -104
- package/dist/components/agnostic/Tag/Tag.svelte +14 -10
- package/dist/components/agnostic/Tag/TagSlots.svelte +2 -1
- package/dist/components/agnostic/Toasts/Toasts.svelte +29 -19
- package/dist/components/agnostic/Tooltip/Tooltip.svelte +85 -68
- package/dist/components/agnostic/Tooltip/TooltipSlots.svelte +2 -1
- package/dist/components/blog/BlogDescription.svelte +6 -4
- package/dist/components/blog/BlogTitle.svelte +8 -6
- package/dist/components/form/Input.svelte +81 -52
- package/dist/components/form/Input.svelte.d.ts +2 -2
- package/dist/components/form/Select.svelte +40 -24
- package/dist/components/layouts/DefaultLayout.svelte +8 -5
- package/dist/components/layouts/Meta.svelte +7 -6
- package/dist/components/layouts/SimpleFooter.svelte +13 -3
- package/dist/components/layouts/Tracker.svelte +2 -1
- package/dist/components/layouts/TwoColumnsLayout.svelte +3 -2
- package/dist/components/menu/CollapsibleMenu.svelte +18 -13
- package/dist/components/menu/DynamicMenu.svelte +16 -10
- package/dist/components/menu/HamburgerMenu.svelte +24 -18
- package/dist/components/menu/Menu.svelte +279 -219
- package/dist/components/menu/MenuItem.svelte +14 -10
- package/dist/components/menu/NavigationItems.svelte +18 -12
- package/dist/components/presentation/Carusel.svelte +77 -72
- package/dist/components/presentation/Gallery.svelte +14 -8
- package/package.json +9 -10
|
@@ -247,65 +247,93 @@ itself. */
|
|
|
247
247
|
|
|
248
248
|
</style>
|
|
249
249
|
|
|
250
|
-
<script>
|
|
251
|
-
|
|
252
|
-
export let
|
|
253
|
-
export let
|
|
254
|
-
export let
|
|
255
|
-
export let
|
|
256
|
-
export let
|
|
257
|
-
export let
|
|
258
|
-
export let
|
|
259
|
-
export let
|
|
260
|
-
export let
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
//
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
$:
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
//
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
250
|
+
<script lang="ts">
|
|
251
|
+
import type { ChoiceInputOption, ChoiceInputSize, ChoiceInputType } from './api';
|
|
252
|
+
export let id;
|
|
253
|
+
export let isSkinned = true;
|
|
254
|
+
export let isFieldset = true;
|
|
255
|
+
export let isInline = false;
|
|
256
|
+
export let isDisabled = undefined;
|
|
257
|
+
export let isInvalid = false;
|
|
258
|
+
export let options: ChoiceInputOption[] = [];
|
|
259
|
+
export let disabledOptions = [];
|
|
260
|
+
export let checkedOptions = [];
|
|
261
|
+
// If isFieldset falsy this will be screenreader only. If legendLabel is not passed
|
|
262
|
+
// in, it will fallback to the type prop or string choice input. Some content must be
|
|
263
|
+
// within the <legenc>CONTENT</legend> element to meet accessibility requirements
|
|
264
|
+
export let type: ChoiceInputType = "checkbox";
|
|
265
|
+
export let legendLabel = type || "choice input";
|
|
266
|
+
export let size: ChoiceInputSize = "";
|
|
267
|
+
|
|
268
|
+
// Provides bind:checked capabilities that consumer can use
|
|
269
|
+
export let checked = [];
|
|
270
|
+
|
|
271
|
+
$: labelClasses = [
|
|
272
|
+
type ? `${type}-label-wrap` : "",
|
|
273
|
+
isInline ? `${type}-label-wrap-inline` : "",
|
|
274
|
+
isDisabled ? "disabled" : "",
|
|
275
|
+
].filter((c) => c.length).join(" ");
|
|
276
|
+
|
|
277
|
+
$: labelSpanClasses = [
|
|
278
|
+
type ? `${type}-label` : "",
|
|
279
|
+
isInvalid ? 'choice-input-error' : "",
|
|
280
|
+
size ? `${type}-label-${size}` : "",
|
|
281
|
+
].filter((c) => c.length).join(" ");
|
|
282
|
+
|
|
283
|
+
// If consumer sets is skinned to false we don't style the legend
|
|
284
|
+
$: skin = isSkinned ? `${type}-legend` : "";
|
|
285
|
+
|
|
286
|
+
$: labelCopyClasses = [
|
|
287
|
+
// Will also need to work in the small
|
|
288
|
+
// and large sizes here for the text copy
|
|
289
|
+
type ? `${type}-label-copy` : "",
|
|
290
|
+
size ? `${type}-label-copy-${size}` : "",
|
|
291
|
+
isInvalid ? 'choice-input-error' : "",
|
|
292
|
+
].filter((c) => c.length).join(" ");
|
|
293
|
+
|
|
294
|
+
$: legendClasses = [
|
|
295
|
+
skin,
|
|
296
|
+
// .screenreader-only is expected to be globally available via common.min.css
|
|
297
|
+
isFieldset === false ? "screenreader-only" : ""
|
|
298
|
+
].filter(c => c).join(" ");
|
|
299
|
+
|
|
300
|
+
$: fieldsetClasses = (): string => {
|
|
301
|
+
// If consumer sets is skinned to false we don't style the fieldset
|
|
302
|
+
const skin = isSkinned ? `${type}-group` : "";
|
|
303
|
+
|
|
304
|
+
// we only add the fieldset class for large (not small) e.g. radio|checkbox-group-large
|
|
305
|
+
const sizeSkin =
|
|
306
|
+
isSkinned && size === "large" ? `${type}-group-${size}` : "";
|
|
307
|
+
|
|
308
|
+
let klasses = [
|
|
309
|
+
skin,
|
|
310
|
+
sizeSkin,
|
|
311
|
+
isFieldset === false ? `${type}-group-hidden` : "",
|
|
312
|
+
];
|
|
313
|
+
klasses = klasses.filter((klass) => klass.length);
|
|
314
|
+
return klasses.join(" ");
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
$: inputClasses = (): string => {
|
|
318
|
+
let inputKlasses = [
|
|
319
|
+
type ? `${type}` : "",
|
|
320
|
+
size ? `${type}-${size}` : "",
|
|
321
|
+
// isDisabled ? "disabled" : "",
|
|
322
|
+
];
|
|
323
|
+
inputKlasses = inputKlasses.filter((klass) => klass.length);
|
|
324
|
+
return inputKlasses.join(" ");
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
$: onChange = (e) => {
|
|
328
|
+
// This allows the consumer to use bind:checked={checkedValues} idiom.
|
|
329
|
+
// We cannot use the bind:group idiom as we're using dynamic type above,
|
|
330
|
+
// So, essentially, we're manually implementing two-way binding here ;-)
|
|
331
|
+
checked =
|
|
332
|
+
Array.from(document.getElementsByName(e.target.name))
|
|
333
|
+
.filter(el => (el as HTMLInputElement).checked)
|
|
334
|
+
.map(el => (el as HTMLInputElement).value);
|
|
335
|
+
|
|
336
|
+
}
|
|
309
337
|
</script>
|
|
310
338
|
|
|
311
339
|
<fieldset class={fieldsetClasses()}>
|
|
@@ -85,13 +85,17 @@
|
|
|
85
85
|
|
|
86
86
|
</style>
|
|
87
87
|
|
|
88
|
-
<script
|
|
89
|
-
|
|
90
|
-
export let
|
|
91
|
-
|
|
92
|
-
"
|
|
93
|
-
|
|
94
|
-
|
|
88
|
+
<script lang="ts">
|
|
89
|
+
import type { CloseSizes } from './api';
|
|
90
|
+
export let size: CloseSizes = "";
|
|
91
|
+
export let isFaux = false;
|
|
92
|
+
export let color = "inherit";
|
|
93
|
+
const closeButtonClasses = [
|
|
94
|
+
"close-button",
|
|
95
|
+
size ? `close-button-${size}` : "",
|
|
96
|
+
]
|
|
97
|
+
.filter((c) => c)
|
|
98
|
+
.join(" ");
|
|
95
99
|
</script>
|
|
96
100
|
|
|
97
101
|
{#if isFaux}
|
|
@@ -1,45 +1,67 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export let
|
|
8
|
-
export let
|
|
9
|
-
export let
|
|
10
|
-
export let
|
|
11
|
-
export let
|
|
12
|
-
export let
|
|
13
|
-
export let
|
|
14
|
-
export let
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Close from '../Close/Close.svelte';
|
|
3
|
+
import SvelteA11yDialog from './SvelteA11yDialog.svelte';
|
|
4
|
+
import { createEventDispatcher } from 'svelte';
|
|
5
|
+
const dispatch = createEventDispatcher();
|
|
6
|
+
|
|
7
|
+
export let id;
|
|
8
|
+
export let title;
|
|
9
|
+
export let dialogRoot;
|
|
10
|
+
export let role: 'dialog' | 'alertdialog' = 'dialog';
|
|
11
|
+
export let titleId = '';
|
|
12
|
+
export let closeButtonLabel = 'Close button';
|
|
13
|
+
export let closeButtonPosition: 'first' | 'last' | 'none' = 'first';
|
|
14
|
+
export let drawerPlacement = '';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Animates the dialog content by fading in. Set to false to disable.
|
|
18
|
+
*/
|
|
19
|
+
export let isAnimationFadeIn = false;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Animates the dialog content by sliding up. Set to false to disable.
|
|
23
|
+
*/
|
|
24
|
+
export let isAnimationSlideUp = false;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Handles a11y-dialog instantiation and assigning of dialog instance
|
|
28
|
+
*/
|
|
29
|
+
let dialogInstance;
|
|
30
|
+
const assignDialogInstance = (ev) => {
|
|
31
|
+
dialogInstance = ev.detail.instance;
|
|
32
|
+
dispatch('instance', {
|
|
33
|
+
instance: dialogInstance
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export let classNames = {};
|
|
38
|
+
const documentClasses = [
|
|
39
|
+
'dialog-content',
|
|
40
|
+
isAnimationFadeIn && isAnimationSlideUp ? 'dialog-slide-up-fade-in' : '',
|
|
41
|
+
!isAnimationFadeIn && isAnimationSlideUp ? 'dialog-slide-up' : '',
|
|
42
|
+
isAnimationFadeIn && !isAnimationSlideUp ? 'dialog-fade-in' : '',
|
|
43
|
+
drawerPlacement.length ? 'drawer-content' : ''
|
|
44
|
+
]
|
|
45
|
+
.filter((c) => c)
|
|
46
|
+
.join(' ');
|
|
47
|
+
|
|
48
|
+
const containerClasses = ['dialog', drawerPlacement ? `drawer-${drawerPlacement}` : '']
|
|
49
|
+
.filter((c) => c)
|
|
50
|
+
.join(' ');
|
|
51
|
+
|
|
52
|
+
const defaultClassNames = {
|
|
53
|
+
container: containerClasses,
|
|
54
|
+
document: documentClasses,
|
|
55
|
+
overlay: 'dialog-overlay',
|
|
56
|
+
title: 'h4 mbe16',
|
|
57
|
+
// Borrows .close-button (from close.css) as it gives us the transparent
|
|
58
|
+
// style plus the a11y focus ring we want applied to dialog's close button
|
|
59
|
+
closeButton: 'dialog-close dialog-close-button'
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
$: getClassNames = () => {
|
|
63
|
+
return { ...defaultClassNames, ...classNames };
|
|
64
|
+
};
|
|
43
65
|
</script>
|
|
44
66
|
|
|
45
67
|
<SvelteA11yDialog
|
|
@@ -1,54 +1,79 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export let
|
|
8
|
-
export let
|
|
9
|
-
export let
|
|
10
|
-
export let
|
|
11
|
-
export let
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createEventDispatcher, onMount, onDestroy, tick } from "svelte";
|
|
3
|
+
import A11yDialog from './a11y-dialog.js';
|
|
4
|
+
|
|
5
|
+
const dispatch = createEventDispatcher();
|
|
6
|
+
|
|
7
|
+
export let id: string;
|
|
8
|
+
export let titleId = '';
|
|
9
|
+
export let role: 'dialog' | 'alertdialog' = 'dialog';
|
|
10
|
+
export let dialogRoot: string;
|
|
11
|
+
export let title: string;
|
|
12
|
+
export let closeButtonLabel = 'Close this dialog window';
|
|
13
|
+
export let closeButtonPosition: 'first' | 'last' | 'none' = 'first';
|
|
14
|
+
export let classNames = {}
|
|
15
|
+
const defaultClassNames = {
|
|
16
|
+
container: 'dialog-container',
|
|
17
|
+
document: 'dialog-content',
|
|
18
|
+
overlay: 'dialog-overlay',
|
|
19
|
+
element: 'dialog-element',
|
|
20
|
+
title: 'dialog-title h4',
|
|
21
|
+
closeButton: 'dialog-close',
|
|
22
|
+
};
|
|
23
|
+
const classes = {...defaultClassNames, ...classNames};
|
|
24
|
+
|
|
25
|
+
// The dialog instance
|
|
26
|
+
let dialog;
|
|
27
|
+
|
|
28
|
+
// Dialog element's binding
|
|
29
|
+
let rootElement;
|
|
30
|
+
|
|
31
|
+
const portalTarget: string = dialogRoot || "document.body";
|
|
32
|
+
|
|
33
|
+
const fullTitleId = titleId || `${id}-title`;
|
|
34
|
+
|
|
35
|
+
const roleAttribute = ['dialog', 'alertdialog'].includes(role)
|
|
36
|
+
? role
|
|
37
|
+
: 'dialog';
|
|
38
|
+
|
|
39
|
+
// In case of SSR we don't render element until hydration is complete
|
|
40
|
+
let mounted = false;
|
|
41
|
+
onMount(() => mounted = true);
|
|
42
|
+
|
|
43
|
+
onDestroy(() => {
|
|
44
|
+
if (dialog) {
|
|
45
|
+
dialog.destroy();
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const instantiateDialog = async () => {
|
|
50
|
+
await tick();
|
|
51
|
+
dialog = new A11yDialog(rootElement, portalTarget);
|
|
52
|
+
dispatch("instance", {
|
|
53
|
+
"instance": dialog
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const teleportNode = async (node) => {
|
|
58
|
+
const destination = document.querySelector(portalTarget);
|
|
59
|
+
destination.appendChild(node);
|
|
60
|
+
// We don't render the template until mounted. So we need
|
|
61
|
+
// wait one more "tick" before instantiating the dialog
|
|
62
|
+
instantiateDialog();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Svelte actions don't want to be async so this is a hack
|
|
67
|
+
* to get around that by delegating to teleportNode
|
|
68
|
+
*/
|
|
69
|
+
const teleport = (node) => {
|
|
70
|
+
teleportNode(node);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const close = () => {
|
|
74
|
+
dialog.hide();
|
|
75
|
+
}
|
|
76
|
+
</script>
|
|
52
77
|
|
|
53
78
|
{#if mounted}
|
|
54
79
|
<div
|
|
@@ -83,15 +83,21 @@
|
|
|
83
83
|
|
|
84
84
|
</style>
|
|
85
85
|
|
|
86
|
-
<script
|
|
87
|
-
export let
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
86
|
+
<script lang="ts">
|
|
87
|
+
export let title = "";
|
|
88
|
+
// The <details> open attribute indicates whether the details content will be
|
|
89
|
+
// displayed on page load or not.
|
|
90
|
+
export let isOpen = false;
|
|
91
|
+
export let isBackground = false;
|
|
92
|
+
export let isBordered = false;
|
|
93
|
+
|
|
94
|
+
const discloseClasses = [
|
|
95
|
+
"disclose",
|
|
96
|
+
isBackground ? "disclose-bg" : "",
|
|
97
|
+
isBordered ? "disclose-bordered" : ""
|
|
98
|
+
]
|
|
99
|
+
.filter((c) => c)
|
|
100
|
+
.join(" ");
|
|
95
101
|
</script>
|
|
96
102
|
|
|
97
103
|
<details class={discloseClasses} bind:open={isOpen}>
|
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export let
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { DividerJustify, DividerTypes, DividerSizes } from './api';
|
|
3
|
+
|
|
4
|
+
export let isVertical = false;
|
|
5
|
+
|
|
6
|
+
// start, end (centered by default)
|
|
7
|
+
export let justify: DividerJustify = '';
|
|
8
|
+
// info, success, error, warning
|
|
9
|
+
export let type: DividerTypes = '';
|
|
10
|
+
// small (default is medium) large xlarge
|
|
11
|
+
export let size: DividerSizes = '';
|
|
12
|
+
|
|
13
|
+
const dividerClasses: string = [
|
|
14
|
+
'divider',
|
|
15
|
+
isVertical ? 'divider-vertical' : '',
|
|
16
|
+
justify ? `divider-justify-${justify}` : '',
|
|
17
|
+
size ? `divider-${size}` : '',
|
|
18
|
+
type ? `divider-${type}` : ''
|
|
19
|
+
]
|
|
20
|
+
.filter((cl) => cl.length)
|
|
21
|
+
.join(' ');
|
|
12
22
|
</script>
|
|
13
23
|
|
|
14
24
|
<div class={dividerClasses}></div>
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export let
|
|
16
|
-
export let
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { DrawerRoles } from './api';
|
|
3
|
+
import Dialog from "../Dialog/Dialog.svelte";
|
|
4
|
+
import { createEventDispatcher } from "svelte";
|
|
5
|
+
const dispatch = createEventDispatcher();
|
|
6
|
+
|
|
7
|
+
let drawerInstance;
|
|
8
|
+
const assignDrawerRef = (ev) => {
|
|
9
|
+
drawerInstance = ev.detail.instance;
|
|
10
|
+
dispatch("instance", {
|
|
11
|
+
instance: drawerInstance,
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export let id;
|
|
16
|
+
export let drawerRoot;
|
|
17
|
+
export let placement;
|
|
18
|
+
export let title;
|
|
19
|
+
export let role: DrawerRoles = "dialog";
|
|
20
|
+
export let isAnimationFadeIn = true;
|
|
17
21
|
</script>
|
|
18
22
|
<Dialog
|
|
19
23
|
id={id}
|
|
@@ -28,13 +28,16 @@
|
|
|
28
28
|
|
|
29
29
|
</style>
|
|
30
30
|
|
|
31
|
-
<script
|
|
32
|
-
export let
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
<script lang="ts">
|
|
32
|
+
export let isRounded = false;
|
|
33
|
+
export let isBordered = false;
|
|
34
|
+
const emptyClasses: string = [
|
|
35
|
+
"empty",
|
|
36
|
+
isRounded ? "empty-rounded" : "",
|
|
37
|
+
isBordered ? "empty-bordered" : "",
|
|
38
|
+
]
|
|
39
|
+
.filter((cl) => cl.length)
|
|
40
|
+
.join(" ");
|
|
38
41
|
</script>
|
|
39
42
|
|
|
40
43
|
<div class={emptyClasses}>
|
|
@@ -78,21 +78,28 @@
|
|
|
78
78
|
|
|
79
79
|
</style>
|
|
80
80
|
|
|
81
|
-
<script
|
|
82
|
-
export let
|
|
83
|
-
export let
|
|
84
|
-
export let
|
|
85
|
-
export let
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
81
|
+
<script lang="ts">
|
|
82
|
+
export let isSticky = false;
|
|
83
|
+
export let isSkinned = true;
|
|
84
|
+
export let isHeaderContentStart = false;
|
|
85
|
+
export let isHeaderContentEnd = false;
|
|
86
|
+
export let css = "";
|
|
87
|
+
|
|
88
|
+
const klasses: string = [
|
|
89
|
+
isSkinned ? "header" : "header-base",
|
|
90
|
+
isSticky ? "header-sticky" : "",
|
|
91
|
+
css ? `${css}` : "",
|
|
92
|
+
]
|
|
93
|
+
.filter((cl) => cl.length)
|
|
94
|
+
.join(" ");
|
|
95
|
+
|
|
96
|
+
const headerContentClasses: string = [
|
|
97
|
+
"header-content",
|
|
98
|
+
isHeaderContentStart ? "header-content-start" : "",
|
|
99
|
+
isHeaderContentEnd ? "header-content-end" : "",
|
|
100
|
+
]
|
|
101
|
+
.filter((cl) => cl.length)
|
|
102
|
+
.join(" ");
|
|
96
103
|
</script>
|
|
97
104
|
|
|
98
105
|
<nav class={klasses}>
|
|
@@ -16,9 +16,10 @@
|
|
|
16
16
|
|
|
17
17
|
</style>
|
|
18
18
|
|
|
19
|
-
<script
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
<script lang="ts">
|
|
20
|
+
export let css = "";
|
|
21
|
+
const containerClasses = [css ? `${css}` : ""].filter((c) => c.length);
|
|
22
|
+
</script>
|
|
22
23
|
|
|
23
24
|
<nav class={containerClasses}>
|
|
24
25
|
<ul class="header-nav">
|
|
@@ -21,8 +21,9 @@
|
|
|
21
21
|
|
|
22
22
|
</style>
|
|
23
23
|
|
|
24
|
-
<script
|
|
25
|
-
let
|
|
24
|
+
<script lang="ts">
|
|
25
|
+
export let css = "";
|
|
26
|
+
let klasses: string = ["header-nav-item", css ? `${css}` : ""].filter(cl => cl && cl.length).join(' ');
|
|
26
27
|
</script>
|
|
27
28
|
|
|
28
29
|
<li class={klasses}>
|