-
-
Notifications
You must be signed in to change notification settings - Fork 284
/
Copy pathGroup.svelte
45 lines (39 loc) · 1.1 KB
/
Group.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
<div
bind:this={element}
use:useActions={use}
use:forwardEvents
class={classMap({
[className]: true,
'smui-button__group': true,
'smui-button__group--raised': variant === 'raised',
})}
{...$$restProps}
>
<slot />
</div>
<script lang="ts">
import { get_current_component } from 'svelte/internal';
import type { SmuiAttrs } from '@smui/common';
import type { ActionArray } from '@smui/common/internal';
import {
forwardEventsBuilder,
classMap,
useActions,
} from '@smui/common/internal';
type OwnProps = {
use?: ActionArray;
class?: string;
variant?: 'text' | 'raised' | 'unelevated' | 'outlined';
};
type $$Props = OwnProps & SmuiAttrs<'div', OwnProps>;
const forwardEvents = forwardEventsBuilder(get_current_component());
// Remember to update $$Props if you add/remove/rename props.
export let use: ActionArray = [];
let className = '';
export { className as class };
export let variant: 'text' | 'raised' | 'unelevated' | 'outlined' = 'text';
let element: HTMLDivElement;
export function getElement() {
return element;
}
</script>