-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MISC][RL] Update props documentation
- Loading branch information
Quek Ruo Ling
committed
May 18, 2023
1 parent
35dca8c
commit 1753392
Showing
7 changed files
with
107 additions
and
77 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,38 @@ | ||
export type TimeRangePickerFormat = "12hr" | "24hr"; | ||
|
||
export interface TimeRangeInputValue { | ||
startTime: string; | ||
endTime: string; | ||
export interface TimeRangePickerValue { | ||
start: string; | ||
end: string; | ||
} | ||
|
||
export interface TimeRangePickerProps { | ||
// Standard HTML Attributes | ||
className?: string | undefined; | ||
id?: string | undefined; | ||
style?: React.CSSProperties | undefined; | ||
readOnly?: boolean | undefined; | ||
"data-testid"?: string | undefined; | ||
|
||
// Input-specific attributes | ||
|
||
value?: TimeRangeInputValue | undefined; | ||
"data-testid"?: string | undefined; | ||
/** | ||
* An object with `start` and `end` values. Can be an empty string or a | ||
* string based format. 24 hour uses "hh:mm", while 12 hour uses "hh:mma" | ||
*/ | ||
value?: TimeRangePickerValue | undefined; | ||
/** | ||
* The time input format in `12hr` or `24hr`. Defaults to `24hr` | ||
*/ | ||
format?: TimeRangePickerFormat | undefined; | ||
disabled?: boolean | undefined; | ||
readOnly?: boolean | undefined; | ||
error?: boolean | undefined; | ||
onChange?: ((value: TimeRangeInputValue) => void) | undefined; | ||
/** | ||
* Called when a selection is made. Returns an object with `start` and | ||
* `end` values. Can be an empty string or a string based format. | ||
* 24 hour uses "hh:mm", while 12 hour uses "hh:mma" | ||
*/ | ||
onChange?: ((value: TimeRangePickerValue) => void) | undefined; | ||
/** | ||
* Called when a defocus is made on the field | ||
*/ | ||
onBlur?: (() => void) | undefined; | ||
} |
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 |
---|---|---|
@@ -1,23 +1,34 @@ | ||
export type TimepickerFormat = "12hr" | "24hr"; | ||
|
||
export interface TimepickerProps extends React.AriaAttributes { | ||
export interface TimepickerProps { | ||
// Standard HTML Attributes | ||
className?: string | undefined; | ||
id?: string | undefined; | ||
name?: string | undefined; | ||
style?: React.CSSProperties | undefined; | ||
tabIndex?: number | undefined; | ||
"data-testid"?: string | undefined; | ||
|
||
// Input-specific attributes | ||
"data-testid"?: string | undefined; | ||
value?: string | undefined; | ||
placeholder?: string | undefined; | ||
defaultValue?: string | undefined; | ||
/** | ||
* The time input format in `12hr` or `24hr`. Defaults to `24hr` | ||
*/ | ||
format?: TimepickerFormat | undefined; | ||
disabled?: boolean | undefined; | ||
readOnly?: boolean | undefined; | ||
error?: boolean | undefined; | ||
/** | ||
* Called when the user makes a selection and clicks on the "Confirm" button | ||
* in the time selection box. Returns a string based format. | ||
* 24 hour uses "hh:mm", while 12 hour uses "hh:mma" | ||
*/ | ||
onChange?: ((value: string) => void) | undefined; | ||
/** | ||
* Called when a defocus is made on the field | ||
*/ | ||
onBlur?: (() => void) | undefined; | ||
/** | ||
* Called when the "Cancel" button is clicked | ||
*/ | ||
onSelectionCancel?: (() => void) | undefined; | ||
} |
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