@react-types/shared
Advanced tools
Comparing version 3.0.0-rc.3 to 3.0.0-rc.4
{ | ||
"name": "@react-types/shared", | ||
"version": "3.0.0-rc.3", | ||
"version": "3.0.0-rc.4", | ||
"description": "Spectrum UI components in React", | ||
@@ -17,3 +17,3 @@ "license": "Apache-2.0", | ||
}, | ||
"gitHead": "461d6321126ae9b4f1508aa912f7b36bf8a603f8" | ||
"gitHead": "ee5ad1544ed65366c0fadabc2c63d39573ba3ffd" | ||
} |
@@ -64,28 +64,2 @@ /* | ||
export interface SingleSelection { | ||
/** Whether the collection allows empty selection. */ | ||
disallowEmptySelection?: boolean, | ||
/** The currently selected key in the collection (controlled). */ | ||
selectedKey?: Key, | ||
/** The initial selected key in the collection (uncontrolled). */ | ||
defaultSelectedKey?: Key, | ||
/** Handler that is called when the selection changes. */ | ||
onSelectionChange?: (key: Key) => any | ||
} | ||
export type SelectionMode = 'none' | 'single' | 'multiple'; | ||
export type Selection = 'all' | Set<Key>; | ||
export interface MultipleSelection { | ||
/** The type of selection that is allowed in the collection. */ | ||
selectionMode?: SelectionMode, | ||
/** Whether the collection allows empty selection. */ | ||
disallowEmptySelection?: boolean, | ||
/** The currently selected keys in the collection (controlled). */ | ||
selectedKeys?: 'all' | Iterable<Key>, | ||
/** The initial selected keys in the collection (uncontrolled). */ | ||
defaultSelectedKeys?: 'all' | Iterable<Key>, | ||
/** Handler that is called when the selection changes. */ | ||
onSelectionChange?: (keys: Selection) => any | ||
} | ||
export interface Expandable { | ||
@@ -92,0 +66,0 @@ /** The currently expanded keys in the collection (controlled). */ |
@@ -48,2 +48,5 @@ /* | ||
export interface DOMProps { | ||
/** | ||
* The element's unique identifier. | ||
*/ | ||
id?: string | ||
@@ -53,3 +56,9 @@ } | ||
export interface FocusableDOMProps extends DOMProps { | ||
tabIndex?: number | ||
/** | ||
* Whether to exclude the element from the sequential tab order. If true, | ||
* the element will not be focusable via the keyboard by tabbing. This should | ||
* be avoided except in rare scenarios where an alternative means of accessing | ||
* the element or its functionality via the keyboard is available. | ||
*/ | ||
excludeFromTabOrder?: boolean | ||
} | ||
@@ -60,32 +69,89 @@ | ||
export interface TextInputDOMProps extends DOMProps { | ||
/** | ||
* Describes the type of autocomplete functionality the input should provide if any. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefautocomplete). | ||
*/ | ||
autoComplete?: string, | ||
/** | ||
* The maximum number of characters supported by the input. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefmaxlength). | ||
*/ | ||
maxLength?: number, | ||
/** | ||
* The minimum number of characters required by the input. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefminlength). | ||
*/ | ||
minLength?: number, | ||
/** | ||
* Name of the input control. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname). | ||
*/ | ||
name?: string, | ||
/** | ||
* Regex pattern that the value of the input must match to be valid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefpattern). | ||
*/ | ||
pattern?: string, | ||
/** | ||
* Content that appears in the input when the input is empty. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefplaceholder). | ||
*/ | ||
placeholder?: string, | ||
type?: 'text' | 'search' | 'url' | 'tel' | 'email' | 'password' | string, | ||
/** | ||
* Hints at the type of data that might be entered by the user while editing the element or its contents | ||
* @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute | ||
* The type of input control to render. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdeftype). | ||
*/ | ||
type?: 'text' | 'search' | 'url' | 'tel' | 'email' | 'password' | string, | ||
/** | ||
* Hints at the type of data that might be entered by the user while editing the element or its contents. See [MDN](https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute). | ||
*/ | ||
inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search', | ||
// Clipboard events | ||
/** | ||
* Handler that is called when the user attempts to copy text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncopy). | ||
*/ | ||
onCopy?: ClipboardEventHandler<HTMLInputElement>, | ||
/** | ||
* Handler that is called when the user attempts to cut text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/oncut). | ||
*/ | ||
onCut?: ClipboardEventHandler<HTMLInputElement>, | ||
/** | ||
* Handler that is called when the user attempts to paste text. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/onpaste). | ||
*/ | ||
onPaste?: ClipboardEventHandler<HTMLInputElement>, | ||
// Composition events | ||
/** | ||
* Handler that is called when a text composition system starts a new text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionend_event). | ||
*/ | ||
onCompositionEnd?: CompositionEventHandler<HTMLInputElement>, | ||
/** | ||
* Handler that is called when a text composition system completes or cancels the current text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionstart_event). | ||
*/ | ||
onCompositionStart?: CompositionEventHandler<HTMLInputElement>, | ||
/** | ||
* Handler that is called when a new character is received in the current text composition session. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionupdate_event). | ||
*/ | ||
onCompositionUpdate?: CompositionEventHandler<HTMLInputElement>, | ||
// Selection events | ||
/** | ||
* Handler that fires when some text in the input has been selected. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/select_event). | ||
*/ | ||
onSelect?: ReactEventHandler<HTMLInputElement>, | ||
// Input events | ||
/** | ||
* Handler that fires when the input value is about to be modified. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/beforeinput_event). | ||
*/ | ||
onBeforeInput?: FormEventHandler<HTMLInputElement>, | ||
/** | ||
* Handler that fires when the input value is modified. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event). | ||
*/ | ||
onInput?: FormEventHandler<HTMLInputElement> | ||
} |
@@ -13,2 +13,4 @@ /* | ||
import {Key} from 'react'; | ||
export interface SingleSelection { | ||
@@ -39,1 +41,3 @@ /** Whether the collection allows empty selection. */ | ||
} | ||
export type FocusStrategy = 'first' | 'last'; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66276
1214