-
-
Notifications
You must be signed in to change notification settings - Fork 284
/
Copy pathSection.svelte
56 lines (49 loc) · 1.39 KB
/
Section.svelte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<Paper
bind:this={element}
use={usePass}
class={classMap({
[className]: true,
'smui-bottom-app-bar__section': true,
'smui-bottom-app-bar__section--fab-inset': fabInset,
})}
color={$color}
variant="unelevated"
square
{...$$restProps}><slot /></Paper
>
<script lang="ts">
import { getContext } from 'svelte';
import { get_current_component } from 'svelte/internal';
import type { ActionArray } from '@smui/common/internal';
import { forwardEventsBuilder, classMap } from '@smui/common/internal';
import Paper from '@smui/paper';
type OwnProps = {
use?: ActionArray;
class?: string;
fabInset?: boolean;
};
type $$Props = {
[P in Exclude<
keyof Paper['$$prop_def'],
keyof OwnProps
>]?: Paper['$$prop_def'][P];
} & OwnProps & {
color?: never;
variant?: never;
square?: never;
};
const forwardEvents = forwardEventsBuilder(get_current_component());
// Remember to update $$Props if you add/remove/rename props.
export let use: ActionArray = [];
$: usePass = [forwardEvents, ...use] as ActionArray;
let className = '';
export { className as class };
export let fabInset = false;
let element: Paper;
const color = getContext<
SvelteStore<'default' | 'primary' | 'secondary' | string>
>('SMUI:bottom-app-bar:color');
export function getElement() {
return element.getElement();
}
</script>