@testing-library/user-event 14.0.0-beta.7 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -193
- package/dist/index.cjs +995 -1040
- package/dist/index.mjs +988 -1028
- package/dist/types/event/behavior/click.d.ts +1 -0
- package/dist/types/event/behavior/cut.d.ts +1 -0
- package/dist/types/event/behavior/index.d.ts +8 -0
- package/dist/types/event/behavior/keydown.d.ts +1 -0
- package/dist/types/event/behavior/keypress.d.ts +1 -0
- package/dist/types/event/behavior/keyup.d.ts +1 -0
- package/dist/types/event/behavior/paste.d.ts +1 -0
- package/dist/types/event/behavior/registry.d.ts +9 -0
- package/dist/types/event/createEvent.d.ts +8 -0
- package/dist/types/event/dispatchEvent.d.ts +2 -0
- package/dist/types/event/eventMap.d.ts +361 -0
- package/dist/types/event/eventTypes.d.ts +2 -0
- package/dist/types/event/index.d.ts +6 -0
- package/dist/types/event/types.d.ts +13 -0
- package/dist/types/event/wrapEvent.d.ts +1 -0
- package/dist/types/keyboard/modifiers.d.ts +9 -0
- package/dist/types/keyboard/types.d.ts +0 -5
- package/dist/types/pointer/firePointerEvents.d.ts +11 -0
- package/dist/types/pointer/types.d.ts +2 -1
- package/dist/types/setup/index.d.ts +2 -0
- package/dist/types/setup/setup.d.ts +1 -0
- package/dist/types/utility/clear.d.ts +1 -1
- package/dist/types/utils/edit/input.d.ts +2 -0
- package/dist/types/utils/edit/isValidDateOrTimeValue.d.ts +3 -0
- package/dist/types/utils/focus/focus.d.ts +3 -0
- package/dist/types/utils/focus/selection.d.ts +4 -0
- package/dist/types/utils/index.d.ts +2 -9
- package/dist/types/utils/keyDef/readNextDescriptor.d.ts +3 -1
- package/dist/types/utils/keyboard/getKeyEventProps.d.ts +2 -14
- package/dist/types/utils/misc/cloneEvent.d.ts +1 -0
- package/dist/types/utils/misc/findClosest.d.ts +1 -1
- package/package.json +10 -13
- package/CHANGELOG.md +0 -5
- package/dist/types/keyboard/plugins/arrow.d.ts +0 -6
- package/dist/types/keyboard/plugins/character.d.ts +0 -5
- package/dist/types/keyboard/plugins/combination.d.ts +0 -5
- package/dist/types/keyboard/plugins/control.d.ts +0 -6
- package/dist/types/keyboard/plugins/functional.d.ts +0 -8
- package/dist/types/keyboard/plugins/index.d.ts +0 -7
- package/dist/types/keyboard/plugins/modifiers.d.ts +0 -8
- package/dist/types/keyboard/shared/fireChangeForInputTimeIfValid.d.ts +0 -3
- package/dist/types/keyboard/shared/index.d.ts +0 -1
- package/dist/types/utils/edit/calculateNewValue.d.ts +0 -14
- package/dist/types/utils/edit/editInputElement.d.ts +0 -16
- package/dist/types/utils/edit/isValidDateValue.d.ts +0 -3
- package/dist/types/utils/edit/isValidInputTimeValue.d.ts +0 -3
- package/dist/types/utils/edit/prepareInput.d.ts +0 -7
- package/dist/types/utils/misc/hasFormSubmit.d.ts +0 -1
- package/dist/types/utils/pointer/firePointerEvents.d.ts +0 -25
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file should contain behavior for functional keys as described here:
|
|
3
|
-
* https://w3c.github.io/uievents-code/#key-alphanumeric-functional
|
|
4
|
-
*/
|
|
5
|
-
import { behaviorPlugin } from '../types';
|
|
6
|
-
export declare const keydownBehavior: behaviorPlugin[];
|
|
7
|
-
export declare const keypressBehavior: behaviorPlugin[];
|
|
8
|
-
export declare const keyupBehavior: behaviorPlugin[];
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { behaviorPlugin } from '../types';
|
|
2
|
-
export declare const preKeydownBehavior: behaviorPlugin[];
|
|
3
|
-
export declare const keydownBehavior: behaviorPlugin[];
|
|
4
|
-
export declare const keypressBehavior: behaviorPlugin[];
|
|
5
|
-
export declare const preKeyupBehavior: behaviorPlugin[];
|
|
6
|
-
export declare const keyupBehavior: behaviorPlugin[];
|
|
7
|
-
export declare const postKeyupBehavior: behaviorPlugin[];
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file should contain behavior for modifier keys:
|
|
3
|
-
* https://www.w3.org/TR/uievents-key/#keys-modifier
|
|
4
|
-
*/
|
|
5
|
-
import { behaviorPlugin } from '../types';
|
|
6
|
-
export declare const preKeydownBehavior: behaviorPlugin[];
|
|
7
|
-
export declare const preKeyupBehavior: behaviorPlugin[];
|
|
8
|
-
export declare const postKeyupBehavior: behaviorPlugin[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './fireChangeForInputTimeIfValid';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { EditableInputType } from './isEditable';
|
|
2
|
-
/**
|
|
3
|
-
* Calculate a new text value.
|
|
4
|
-
*/
|
|
5
|
-
export declare function calculateNewValue(inputData: string, node: (HTMLInputElement & {
|
|
6
|
-
type: EditableInputType;
|
|
7
|
-
}) | HTMLTextAreaElement, { startOffset, endOffset, }: {
|
|
8
|
-
startOffset: number;
|
|
9
|
-
endOffset: number;
|
|
10
|
-
}, inputType?: string): {
|
|
11
|
-
oldValue: string;
|
|
12
|
-
newValue: string;
|
|
13
|
-
newOffset: number;
|
|
14
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { fireEvent } from '@testing-library/dom';
|
|
2
|
-
/**
|
|
3
|
-
* Change the value of an element as if it was changed as a result of a user input.
|
|
4
|
-
*
|
|
5
|
-
* Fires the input event.
|
|
6
|
-
*/
|
|
7
|
-
export declare function editInputElement(element: HTMLInputElement | HTMLTextAreaElement, { newValue, newSelection, eventOverrides, }: {
|
|
8
|
-
newValue: string;
|
|
9
|
-
newSelection: {
|
|
10
|
-
node: Node;
|
|
11
|
-
offset: number;
|
|
12
|
-
};
|
|
13
|
-
eventOverrides: Partial<Parameters<typeof fireEvent>[1]> & {
|
|
14
|
-
[k: string]: unknown;
|
|
15
|
-
};
|
|
16
|
-
}): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const hasFormSubmit: (form: HTMLFormElement | null) => form is HTMLFormElement;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { pointerState } from '../../pointer/types';
|
|
2
|
-
import type { keyboardState } from '../../keyboard/types';
|
|
3
|
-
import { MouseButton } from './mouseButtons';
|
|
4
|
-
export declare function firePointerEvent(target: Element, type: string, { pointerState, keyboardState, pointerType, button, coords, pointerId, isPrimary, clickCount, }: {
|
|
5
|
-
pointerState: pointerState;
|
|
6
|
-
keyboardState: keyboardState;
|
|
7
|
-
pointerType?: 'mouse' | 'pen' | 'touch';
|
|
8
|
-
button?: MouseButton;
|
|
9
|
-
coords?: PointerCoords;
|
|
10
|
-
pointerId?: number;
|
|
11
|
-
isPrimary?: boolean;
|
|
12
|
-
clickCount?: number;
|
|
13
|
-
}): boolean;
|
|
14
|
-
export interface PointerCoords {
|
|
15
|
-
x?: number;
|
|
16
|
-
y?: number;
|
|
17
|
-
clientX?: number;
|
|
18
|
-
clientY?: number;
|
|
19
|
-
offsetX?: number;
|
|
20
|
-
offsetY?: number;
|
|
21
|
-
pageX?: number;
|
|
22
|
-
pageY?: number;
|
|
23
|
-
screenX?: number;
|
|
24
|
-
screenY?: number;
|
|
25
|
-
}
|