mirror of
https://github.com/aleksilassila/reiverr.git
synced 2026-04-22 00:35:12 +02:00
Add Tizen 5.5 Polyfills, implement dpad navigation with specified components
This commit is contained in:
28
src/Container.svelte
Normal file
28
src/Container.svelte
Normal file
@@ -0,0 +1,28 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { Container } from './lib/actions/focusAction';
|
||||
|
||||
export let name: string = '';
|
||||
export let horizontal = false;
|
||||
|
||||
const { registerer, ...rest } = new Container(name)
|
||||
.setDirection(horizontal ? 'horizontal' : 'vertical')
|
||||
.getStores();
|
||||
export const container = rest.container;
|
||||
export const hasFocus = rest.hasFocus;
|
||||
export const hasFocusWithin = rest.hasFocusWithin;
|
||||
|
||||
export let tag = 'div';
|
||||
|
||||
onMount(() => {
|
||||
rest.container._initializeContainer();
|
||||
|
||||
return () => {
|
||||
rest.container._unmountContainer();
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<svelte:element this={tag} on:click tabindex="0" {...$$restProps} use:registerer>
|
||||
<slot />
|
||||
</svelte:element>
|
||||
Reference in New Issue
Block a user