-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #206 from matt8707/group
Add 'group' modal support, closes #179
- Loading branch information
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<script lang="ts"> | ||
import { states } from '$lib/Stores'; | ||
import Modal from '$lib/Modal/Index.svelte'; | ||
import StateLogic from '$lib/Components/StateLogic.svelte'; | ||
import ConfigButtons from '$lib/Modal/ConfigButtons.svelte'; | ||
import { getName } from '$lib/Utils'; | ||
export let isOpen: boolean; | ||
export let sel: any; | ||
$: entity = $states?.[sel?.entity_id]; | ||
$: group = entity?.attributes?.entity_id; | ||
</script> | ||
|
||
{#if isOpen} | ||
<Modal> | ||
<h1 slot="title">{getName(sel, entity)}</h1> | ||
|
||
{#each group as child_entity_id} | ||
<h2>{getName(undefined, $states?.[child_entity_id])}</h2> | ||
|
||
<StateLogic entity_id={child_entity_id} selected={undefined} /> | ||
{/each} | ||
|
||
<ConfigButtons /> | ||
</Modal> | ||
{/if} |