Skip to content

Commit 4ee0364

Browse files
Add doc comment for select event
1 parent ee88c92 commit 4ee0364

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

src/lib/DateInput.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
import { writable } from 'svelte/store'
99
import { createEventDispatcher } from 'svelte'
1010
11-
const dispatch = createEventDispatcher<{ select: undefined }>()
11+
const dispatch = createEventDispatcher<{
12+
/** Fires when the user selects a new value in the DatePicker by clicking on a date or by pressing enter */
13+
select: undefined
14+
}>()
1215
1316
/** Default date to display in picker before value is assigned */
1417
const defaultDate = new Date()

src/lib/DatePicker.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
import { getInnerLocale, type Locale } from './locale.js'
44
import { createEventDispatcher } from 'svelte'
55
6-
const dispatch = createEventDispatcher<{ select: undefined }>()
6+
const dispatch = createEventDispatcher<{
7+
/** Fires when the user selects a new value by clicking on a date or by pressing enter */
8+
select: undefined
9+
}>()
710
811
function cloneDate(d: Date) {
912
return new Date(d.getTime())

src/routes/docs/+page.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ The component will not assign a date value until a specific date is selected in
2929

3030
### Props
3131

32-
| Prop | Type | Description |
33-
| :----------------------- | :----------- | :--------------------------------------------------- |
34-
| `value` | Date \| null | Date value |
35-
| `min` | Date | The earliest value the user can select |
36-
| `max` | Date | The latest value the user can select |
37-
| `placeholder` | string | Placeholder used when date value is null |
38-
| `valid` | bool | Whether the text is valid |
39-
| `format` | string | Format string |
40-
| `visible` | bool | Whether the date popup is visible |
41-
| `disabled` | bool | Disable the input |
42-
| `closeOnSelection` | bool | Close the date popup when a date is selected |
43-
| `browseWithoutSelecting` | bool | Wait with updating the date until a date is selected |
44-
| `locale` | Locale | Locale object for internationalization |
32+
| Prop | Type | Description |
33+
| :----------------------- | :----------- | :---------------------------------------------------- |
34+
| `value` | Date \| null | Date value |
35+
| `min` | Date | The earliest value the user can select |
36+
| `max` | Date | The latest value the user can select |
37+
| `placeholder` | string | Placeholder used when date value is null |
38+
| `valid` | bool | Whether the text is valid |
39+
| `format` | string | Format string |
40+
| `visible` | bool | Whether the date popup is visible |
41+
| `disabled` | bool | Disable the input |
42+
| `closeOnSelection` | bool | Close the date popup when a date is selected |
43+
| `browseWithoutSelecting` | bool | Wait with updating the date until a value is selected |
44+
| `locale` | Locale | Locale object for internationalization |
4545

4646
#### Format string
4747

0 commit comments

Comments
 (0)