-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(inputs): change the way props are spread internally
BREAKING CHANGE: Props not declared in propTypes (including className) are no longer being spread on the root element in following components: ButtonToggleGroup, Checkbox, Date, Decimal, GroupedCharacter, Number, RadioButton, Select, MultiSelect, FilterableSelect, Switch, Textarea, Textbox. Furthermore in all these components apart from the ButtonToggleGroup all not declared props will be passed to the underlying HTML input element
- Loading branch information
Showing
73 changed files
with
942 additions
and
621 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// component preview locators | ||
const SWITCH_DATA_COMPONENT = '[data-component="Switch"]'; | ||
const SWITCH_DATA_COMPONENT = '[data-component="switch"]'; | ||
|
||
export default SWITCH_DATA_COMPONENT; |
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
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
42 changes: 42 additions & 0 deletions
42
src/__internal__/checkable-input/hidden-checkable-input.d.ts
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,42 @@ | ||
import * as React from "react"; | ||
|
||
export interface CommonHiddenCheckableInputProps | ||
extends Omit< | ||
React.InputHTMLAttributes<HTMLInputElement>, | ||
"value" | "size" | "type" | ||
> { | ||
/** If true the Component will be focused when page load */ | ||
autoFocus?: boolean; | ||
/** Checked state of the input */ | ||
checked?: boolean; | ||
/** Input name */ | ||
name?: string; | ||
/** OnChange event handler */ | ||
onChange?: (ev: React.ChangeEvent<HTMLInputElement>) => void; | ||
/** OnFocus event handler */ | ||
onFocus?: (ev: React.FocusEvent<HTMLInputElement>) => void; | ||
/** Blur event handler */ | ||
onBlur?: (ev: React.FocusEvent<HTMLInputElement>) => void; | ||
/** OnMouseLeave event handler */ | ||
onMouseLeave?: (ev: React.MouseEvent<HTMLInputElement>) => void; | ||
/** OnMouseEnter event handler */ | ||
onMouseEnter?: (ev: React.MouseEvent<HTMLInputElement>) => void; | ||
/** Value of the input */ | ||
value?: string; | ||
/** A callback to retrieve the input reference */ | ||
inputRef: React.Ref<HTMLInputElement>; | ||
} | ||
|
||
export interface HiddenCheckableInputProps | ||
extends CommonHiddenCheckableInputProps { | ||
/** HTML type attribute of the input */ | ||
type: string; | ||
/** Element id for aria-describedby */ | ||
helpId?: string; | ||
} | ||
|
||
declare function HiddenCheckableInput( | ||
props: HiddenCheckableInputProps | ||
): JSX.Element; | ||
|
||
export default HiddenCheckableInput; |
Oops, something went wrong.