mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 19:01:05 +00:00
chore: lift components folder
This commit is contained in:
parent
76df51674d
commit
2200b29b92
301 changed files with 57 additions and 76 deletions
33
src/StructuredList/StructuredListInput.svelte
Normal file
33
src/StructuredList/StructuredListInput.svelte
Normal file
|
@ -0,0 +1,33 @@
|
|||
<script>
|
||||
export let checked = false;
|
||||
export let title = "title";
|
||||
export let value = "value";
|
||||
export let id = "ccs-" + Math.random().toString(36);
|
||||
export let name = "";
|
||||
export let ref = null;
|
||||
|
||||
import { getContext } from "svelte";
|
||||
|
||||
const { selectedValue, update } = getContext("StructuredListWrapper");
|
||||
|
||||
if (checked) {
|
||||
update(value);
|
||||
}
|
||||
|
||||
$: checked = $selectedValue === value;
|
||||
</script>
|
||||
|
||||
<input
|
||||
bind:this={ref}
|
||||
type="radio"
|
||||
tabindex="-1"
|
||||
{checked}
|
||||
{id}
|
||||
{name}
|
||||
{title}
|
||||
{value}
|
||||
class:bx--structured-list-input={true}
|
||||
{...$$restProps}
|
||||
on:change={() => {
|
||||
update(value);
|
||||
}} />
|
Loading…
Add table
Add a link
Reference in a new issue