@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.
Files changed (52) hide show
  1. package/README.md +6 -193
  2. package/dist/index.cjs +995 -1040
  3. package/dist/index.mjs +988 -1028
  4. package/dist/types/event/behavior/click.d.ts +1 -0
  5. package/dist/types/event/behavior/cut.d.ts +1 -0
  6. package/dist/types/event/behavior/index.d.ts +8 -0
  7. package/dist/types/event/behavior/keydown.d.ts +1 -0
  8. package/dist/types/event/behavior/keypress.d.ts +1 -0
  9. package/dist/types/event/behavior/keyup.d.ts +1 -0
  10. package/dist/types/event/behavior/paste.d.ts +1 -0
  11. package/dist/types/event/behavior/registry.d.ts +9 -0
  12. package/dist/types/event/createEvent.d.ts +8 -0
  13. package/dist/types/event/dispatchEvent.d.ts +2 -0
  14. package/dist/types/event/eventMap.d.ts +361 -0
  15. package/dist/types/event/eventTypes.d.ts +2 -0
  16. package/dist/types/event/index.d.ts +6 -0
  17. package/dist/types/event/types.d.ts +13 -0
  18. package/dist/types/event/wrapEvent.d.ts +1 -0
  19. package/dist/types/keyboard/modifiers.d.ts +9 -0
  20. package/dist/types/keyboard/types.d.ts +0 -5
  21. package/dist/types/pointer/firePointerEvents.d.ts +11 -0
  22. package/dist/types/pointer/types.d.ts +2 -1
  23. package/dist/types/setup/index.d.ts +2 -0
  24. package/dist/types/setup/setup.d.ts +1 -0
  25. package/dist/types/utility/clear.d.ts +1 -1
  26. package/dist/types/utils/edit/input.d.ts +2 -0
  27. package/dist/types/utils/edit/isValidDateOrTimeValue.d.ts +3 -0
  28. package/dist/types/utils/focus/focus.d.ts +3 -0
  29. package/dist/types/utils/focus/selection.d.ts +4 -0
  30. package/dist/types/utils/index.d.ts +2 -9
  31. package/dist/types/utils/keyDef/readNextDescriptor.d.ts +3 -1
  32. package/dist/types/utils/keyboard/getKeyEventProps.d.ts +2 -14
  33. package/dist/types/utils/misc/cloneEvent.d.ts +1 -0
  34. package/dist/types/utils/misc/findClosest.d.ts +1 -1
  35. package/package.json +10 -13
  36. package/CHANGELOG.md +0 -5
  37. package/dist/types/keyboard/plugins/arrow.d.ts +0 -6
  38. package/dist/types/keyboard/plugins/character.d.ts +0 -5
  39. package/dist/types/keyboard/plugins/combination.d.ts +0 -5
  40. package/dist/types/keyboard/plugins/control.d.ts +0 -6
  41. package/dist/types/keyboard/plugins/functional.d.ts +0 -8
  42. package/dist/types/keyboard/plugins/index.d.ts +0 -7
  43. package/dist/types/keyboard/plugins/modifiers.d.ts +0 -8
  44. package/dist/types/keyboard/shared/fireChangeForInputTimeIfValid.d.ts +0 -3
  45. package/dist/types/keyboard/shared/index.d.ts +0 -1
  46. package/dist/types/utils/edit/calculateNewValue.d.ts +0 -14
  47. package/dist/types/utils/edit/editInputElement.d.ts +0 -16
  48. package/dist/types/utils/edit/isValidDateValue.d.ts +0 -3
  49. package/dist/types/utils/edit/isValidInputTimeValue.d.ts +0 -3
  50. package/dist/types/utils/edit/prepareInput.d.ts +0 -7
  51. package/dist/types/utils/misc/hasFormSubmit.d.ts +0 -1
  52. package/dist/types/utils/pointer/firePointerEvents.d.ts +0 -25
@@ -1,5 +0,0 @@
1
- /**
2
- * This file should cover the behavior for keys that produce character input
3
- */
4
- import { behaviorPlugin } from '../types';
5
- export declare const keypressBehavior: behaviorPlugin[];
@@ -1,5 +0,0 @@
1
- /**
2
- * Default behavior for key combinations
3
- */
4
- import { behaviorPlugin } from '../types';
5
- export declare const keydownBehavior: behaviorPlugin[];
@@ -1,6 +0,0 @@
1
- /**
2
- * This file should contain behavior for arrow keys as described here:
3
- * https://w3c.github.io/uievents-code/#key-controlpad-section
4
- */
5
- import { behaviorPlugin } from '../types';
6
- export declare const keydownBehavior: behaviorPlugin[];
@@ -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,3 +0,0 @@
1
- export declare function fireChangeForInputTimeIfValid(el: HTMLInputElement & {
2
- type: 'time';
3
- }, prevValue: unknown, timeNewEntry: string): void;
@@ -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,3 +0,0 @@
1
- export declare function isValidDateValue(element: HTMLInputElement & {
2
- type: 'date';
3
- }, value: string): boolean;
@@ -1,3 +0,0 @@
1
- export declare function isValidInputTimeValue(element: HTMLInputElement & {
2
- type: 'time';
3
- }, timeValue: string): boolean;
@@ -1,7 +0,0 @@
1
- export declare function prepareInput(data: string, element: Element, inputType?: string): {
2
- commit: () => void;
3
- getNewValue?: undefined;
4
- } | {
5
- getNewValue: () => string;
6
- commit: () => void;
7
- } | undefined;
@@ -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
- }