feat(component): add TimePicker

Closes #28
This commit is contained in:
Eric Liu 2019-12-25 14:23:20 -08:00
commit bf18b7b65a
19 changed files with 201 additions and 24 deletions

View file

@ -57,8 +57,8 @@
aria-describedby={invalid ? errorId : undefined}
disabled={disabled || undefined}
aria-invalid={invalid || undefined}
on:change={event => {
selected.set(event.target.value);
on:change={({ target }) => {
selected.set(target.value);
}}
{id}>
<slot />
@ -86,8 +86,8 @@
disabled={disabled || undefined}
aria-invalid={invalid || undefined}
on:change
on:change={event => {
selected.set(event.target.value);
on:change={({ target }) => {
selected.set(target.value);
}}
{id}>
<slot />

View file

@ -10,11 +10,11 @@
import { getContext } from 'svelte';
import { cx } from '../../lib';
const { selected } = getContext('Select');
const ctx = getContext('Select') || getContext('TimePickerSelect');
</script>
<option
selected={$selected === value}
selected={ctx.$selected === value}
class={cx('--select-option', className)}
{value}
{disabled}