Add Tizen 5.5 Polyfills, implement dpad navigation with specified components

This commit is contained in:
Aleksi Lassila
2024-01-24 01:00:12 +02:00
parent fd1a87a2fe
commit 14eae0fa9b
16 changed files with 322 additions and 147 deletions

28
src/Container.svelte Normal file
View 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>