@testing-library/user-event 14.0.0-alpha.1 → 14.0.0-alpha.5
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/dist/{src/clear.d.ts → clear.d.ts} +0 -0
- package/dist/{src/click.d.ts → click.d.ts} +0 -0
- package/dist/{src/document → document}/index.d.ts +2 -3
- package/dist/document/index.js +8 -10
- package/dist/document/interceptor.d.ts +15 -0
- package/dist/document/interceptor.js +7 -4
- package/dist/{src/document → document}/selection.d.ts +0 -1
- package/dist/document/selection.js +22 -15
- package/dist/{src/document → document}/value.d.ts +4 -0
- package/dist/document/value.js +26 -5
- package/dist/{src/hover.d.ts → hover.d.ts} +0 -0
- package/dist/{src/index.d.ts → index.d.ts} +0 -0
- package/dist/{src/keyboard → keyboard}/getEventProps.d.ts +0 -0
- package/dist/{src/keyboard → keyboard}/getNextKeyDef.d.ts +0 -0
- package/dist/{src/keyboard → keyboard}/index.d.ts +0 -0
- package/dist/{src/keyboard → keyboard}/keyMap.d.ts +0 -0
- package/dist/keyboard/keyMap.js +4 -0
- package/dist/{src/keyboard → keyboard}/keyboardImplementation.d.ts +0 -0
- package/dist/keyboard/keyboardImplementation.js +3 -1
- package/dist/{src/keyboard → keyboard}/plugins/arrow.d.ts +0 -0
- package/dist/{src/keyboard → keyboard}/plugins/character.d.ts +0 -0
- package/dist/{src/keyboard → keyboard}/plugins/control.d.ts +0 -0
- package/dist/{src/keyboard → keyboard}/plugins/functional.d.ts +0 -0
- package/dist/keyboard/plugins/functional.js +17 -0
- package/dist/{src/keyboard → keyboard}/plugins/index.d.ts +0 -0
- package/dist/{src/keyboard → keyboard}/shared/fireChangeForInputTimeIfValid.d.ts +0 -0
- package/dist/{src/keyboard → keyboard}/shared/index.d.ts +0 -0
- package/dist/{src/keyboard → keyboard}/specialCharMap.d.ts +0 -0
- package/dist/{src/keyboard → keyboard}/types.d.ts +0 -0
- package/dist/{src/paste.d.ts → paste.d.ts} +0 -0
- package/dist/{src/pointer → pointer}/index.d.ts +0 -0
- package/dist/{src/pointer → pointer}/keyMap.d.ts +0 -0
- package/dist/{src/pointer → pointer}/parseKeyDef.d.ts +0 -0
- package/dist/{src/pointer → pointer}/pointerAction.d.ts +2 -6
- package/dist/pointer/pointerAction.js +2 -26
- package/dist/pointer/pointerMove.d.ts +5 -0
- package/dist/pointer/pointerMove.js +38 -5
- package/dist/pointer/pointerPress.d.ts +7 -0
- package/dist/pointer/pointerPress.js +133 -29
- package/dist/pointer/resolveSelectionTarget.d.ts +5 -0
- package/dist/pointer/resolveSelectionTarget.js +74 -0
- package/dist/{src/pointer → pointer}/types.d.ts +18 -4
- package/dist/{src/selectOptions.d.ts → selectOptions.d.ts} +0 -0
- package/dist/{src/setup.d.ts → setup.d.ts} +1 -1
- package/dist/setup.js +0 -7
- package/dist/tab.d.ts +5 -0
- package/dist/tab.js +3 -132
- package/dist/{src/type.d.ts → type.d.ts} +0 -0
- package/dist/type.js +3 -19
- package/dist/{src/upload.d.ts → upload.d.ts} +0 -0
- package/dist/{src/utils → utils}/click/isClickableInput.d.ts +0 -0
- package/dist/{src/utils → utils}/edit/buildTimeValue.d.ts +0 -0
- package/dist/{src/utils → utils}/edit/calculateNewValue.d.ts +0 -0
- package/dist/{src/utils → utils}/edit/cursorPosition.d.ts +0 -0
- package/dist/{src/utils → utils}/edit/fireInputEvent.d.ts +0 -0
- package/dist/utils/edit/fireInputEvent.js +20 -16
- package/dist/{src/utils → utils}/edit/getValue.d.ts +0 -0
- package/dist/utils/edit/getValue.js +1 -3
- package/dist/{src/utils → utils}/edit/isContentEditable.d.ts +0 -0
- package/dist/{src/utils → utils}/edit/isEditable.d.ts +0 -0
- package/dist/{src/utils → utils}/edit/isValidDateValue.d.ts +0 -0
- package/dist/{src/utils → utils}/edit/isValidInputTimeValue.d.ts +0 -0
- package/dist/{src/utils → utils}/edit/maxLength.d.ts +0 -0
- package/dist/{src/utils → utils}/edit/selectionRange.d.ts +0 -0
- package/dist/{src/utils → utils}/focus/blur.d.ts +0 -0
- package/dist/{src/utils → utils}/focus/focus.d.ts +0 -0
- package/dist/{src/utils → utils}/focus/getActiveElement.d.ts +0 -0
- package/dist/utils/focus/getTabDestination.d.ts +1 -0
- package/dist/utils/focus/getTabDestination.js +71 -0
- package/dist/{src/utils → utils}/focus/isFocusable.d.ts +0 -0
- package/dist/{src/utils → utils}/focus/selector.d.ts +0 -0
- package/dist/{src/utils → utils}/index.d.ts +1 -1
- package/dist/utils/index.js +13 -13
- package/dist/{src/utils → utils}/keyDef/readNextDescriptor.d.ts +0 -0
- package/dist/{src/utils → utils}/misc/eventWrapper.d.ts +0 -0
- package/dist/{src/utils → utils}/misc/findClosest.d.ts +0 -0
- package/dist/{src/utils → utils}/misc/hasFormSubmit.d.ts +0 -0
- package/dist/{src/utils → utils}/misc/hasPointerEvents.d.ts +0 -0
- package/dist/{src/utils → utils}/misc/isDescendantOrSelf.d.ts +0 -0
- package/dist/{src/utils → utils}/misc/isDisabled.d.ts +0 -0
- package/dist/{src/utils → utils}/misc/isElementType.d.ts +0 -0
- package/dist/{src/utils → utils}/misc/isVisible.d.ts +0 -0
- package/dist/{src/utils → utils}/misc/wait.d.ts +0 -0
- package/dist/utils/pointer/fakeEvent.d.ts +20 -0
- package/dist/utils/pointer/fakeEvent.js +18 -9
- package/dist/{src/utils → utils}/pointer/firePointerEvents.d.ts +2 -11
- package/dist/{src/utils → utils}/pointer/mouseButtons.d.ts +0 -0
- package/package.json +2 -2
- package/dist/document/applyNative.js +0 -28
- package/dist/src/document/applyNative.d.ts +0 -8
- package/dist/src/document/interceptor.d.ts +0 -5
- package/dist/src/pointer/pointerMove.d.ts +0 -5
- package/dist/src/pointer/pointerPress.d.ts +0 -7
- package/dist/src/tab.d.ts +0 -6
- package/dist/src/utils/misc/isDocument.d.ts +0 -1
- package/dist/src/utils/pointer/fakeEvent.d.ts +0 -16
- package/dist/tests/_helpers/custom-element.d.ts +0 -8
- package/dist/tests/_helpers/utils.d.ts +0 -73
- package/dist/tests/_setup-env.d.ts +0 -1
- package/dist/tests/clear.d.ts +0 -1
- package/dist/tests/click/click.d.ts +0 -1
- package/dist/tests/click/dblclick.d.ts +0 -1
- package/dist/tests/document/index.d.ts +0 -1
- package/dist/tests/document/selectionRange.d.ts +0 -1
- package/dist/tests/hover/hover.d.ts +0 -1
- package/dist/tests/hover/unhover.d.ts +0 -1
- package/dist/tests/keyboard/getNextKeyDef.d.ts +0 -1
- package/dist/tests/keyboard/index.d.ts +0 -1
- package/dist/tests/keyboard/keyboardImplementation.d.ts +0 -1
- package/dist/tests/keyboard/plugin/arrow.d.ts +0 -1
- package/dist/tests/keyboard/plugin/character.d.ts +0 -1
- package/dist/tests/keyboard/plugin/control.d.ts +0 -1
- package/dist/tests/keyboard/plugin/functional.d.ts +0 -1
- package/dist/tests/keyboard/shared/fireInputEvent.d.ts +0 -1
- package/dist/tests/paste.d.ts +0 -1
- package/dist/tests/pointer/index.d.ts +0 -1
- package/dist/tests/react/keyboard.d.ts +0 -1
- package/dist/tests/react/type.d.ts +0 -1
- package/dist/tests/selectOptions/deselect.d.ts +0 -1
- package/dist/tests/selectOptions/select.d.ts +0 -1
- package/dist/tests/setup.d.ts +0 -10
- package/dist/tests/tab.d.ts +0 -1
- package/dist/tests/type/index.d.ts +0 -1
- package/dist/tests/type/modifiers.d.ts +0 -1
- package/dist/tests/upload.d.ts +0 -1
- package/dist/tests/utils/edit/calculateNewValue.d.ts +0 -1
- package/dist/tests/utils/edit/isContentEditable.d.ts +0 -1
- package/dist/tests/utils/focus/blur.d.ts +0 -1
- package/dist/tests/utils/focus/focus.d.ts +0 -1
- package/dist/tests/utils/misc/hasPointerEvents.d.ts +0 -1
- package/dist/tests/utils/misc/isDescendantOrSelf.d.ts +0 -1
- package/dist/tests/utils/misc/isElementType.d.ts +0 -1
- package/dist/tests/utils/misc/isVisible.d.ts +0 -1
- package/dist/utils/misc/dom-helpers.d.ts +0 -3
- package/dist/utils/misc/isDocument.js +0 -10
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getTabDestination(activeElement: Element, shift: boolean): HTMLElement;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getTabDestination = getTabDestination;
|
|
7
|
+
|
|
8
|
+
var _isDisabled = require("../misc/isDisabled");
|
|
9
|
+
|
|
10
|
+
var _isElementType = require("../misc/isElementType");
|
|
11
|
+
|
|
12
|
+
var _isVisible = require("../misc/isVisible");
|
|
13
|
+
|
|
14
|
+
var _selector = require("./selector");
|
|
15
|
+
|
|
16
|
+
function getTabDestination(activeElement, shift) {
|
|
17
|
+
const document = activeElement.ownerDocument;
|
|
18
|
+
const focusableElements = document.querySelectorAll(_selector.FOCUSABLE_SELECTOR);
|
|
19
|
+
const enabledElements = Array.from(focusableElements).filter(el => el === activeElement || el.getAttribute('tabindex') !== '-1' && !(0, _isDisabled.isDisabled)(el) && // Hidden elements are not tabable
|
|
20
|
+
(0, _isVisible.isVisible)(el));
|
|
21
|
+
|
|
22
|
+
if (activeElement.getAttribute('tabindex') !== '-1') {
|
|
23
|
+
// tabindex has no effect if the active element has tabindex="-1"
|
|
24
|
+
enabledElements.sort((a, b) => Number(a.getAttribute('tabindex')) - Number(b.getAttribute('tabindex')));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const checkedRadio = {};
|
|
28
|
+
let prunedElements = [document.body];
|
|
29
|
+
const activeRadioGroup = (0, _isElementType.isElementType)(activeElement, 'input', {
|
|
30
|
+
type: 'radio'
|
|
31
|
+
}) ? activeElement.name : undefined;
|
|
32
|
+
enabledElements.forEach(currentElement => {
|
|
33
|
+
const el = currentElement; // For radio groups keep only the active radio
|
|
34
|
+
// If there is no active radio, keep only the checked radio
|
|
35
|
+
// If there is no checked radio, treat like everything else
|
|
36
|
+
|
|
37
|
+
if ((0, _isElementType.isElementType)(el, 'input', {
|
|
38
|
+
type: 'radio'
|
|
39
|
+
}) && el.name) {
|
|
40
|
+
// If the active element is part of the group, add only that
|
|
41
|
+
if (el === activeElement) {
|
|
42
|
+
prunedElements.push(el);
|
|
43
|
+
return;
|
|
44
|
+
} else if (el.name === activeRadioGroup) {
|
|
45
|
+
return;
|
|
46
|
+
} // If we stumble upon a checked radio, remove the others
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
if (el.checked) {
|
|
50
|
+
prunedElements = prunedElements.filter(e => !(0, _isElementType.isElementType)(e, 'input', {
|
|
51
|
+
type: 'radio',
|
|
52
|
+
name: el.name
|
|
53
|
+
}));
|
|
54
|
+
prunedElements.push(el);
|
|
55
|
+
checkedRadio[el.name] = el;
|
|
56
|
+
return;
|
|
57
|
+
} // If we already found the checked one, skip
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
if (typeof checkedRadio[el.name] !== 'undefined') {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
prunedElements.push(el);
|
|
66
|
+
});
|
|
67
|
+
const currentIndex = prunedElements.findIndex(el => el === activeElement);
|
|
68
|
+
const nextIndex = shift ? currentIndex - 1 : currentIndex + 1;
|
|
69
|
+
const defaultIndex = shift ? prunedElements.length - 1 : 0;
|
|
70
|
+
return prunedElements[nextIndex] || prunedElements[defaultIndex];
|
|
71
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -13,6 +13,7 @@ export * from './edit/selectionRange';
|
|
|
13
13
|
export * from './focus/blur';
|
|
14
14
|
export * from './focus/focus';
|
|
15
15
|
export * from './focus/getActiveElement';
|
|
16
|
+
export * from './focus/getTabDestination';
|
|
16
17
|
export * from './focus/isFocusable';
|
|
17
18
|
export * from './focus/selector';
|
|
18
19
|
export * from './keyDef/readNextDescriptor';
|
|
@@ -22,7 +23,6 @@ export * from './misc/isDescendantOrSelf';
|
|
|
22
23
|
export * from './misc/isElementType';
|
|
23
24
|
export * from './misc/isVisible';
|
|
24
25
|
export * from './misc/isDisabled';
|
|
25
|
-
export * from './misc/isDocument';
|
|
26
26
|
export * from './misc/wait';
|
|
27
27
|
export * from './misc/hasPointerEvents';
|
|
28
28
|
export * from './misc/hasFormSubmit';
|
package/dist/utils/index.js
CHANGED
|
@@ -199,6 +199,19 @@ Object.keys(_getActiveElement).forEach(function (key) {
|
|
|
199
199
|
});
|
|
200
200
|
});
|
|
201
201
|
|
|
202
|
+
var _getTabDestination = require("./focus/getTabDestination");
|
|
203
|
+
|
|
204
|
+
Object.keys(_getTabDestination).forEach(function (key) {
|
|
205
|
+
if (key === "default" || key === "__esModule") return;
|
|
206
|
+
if (key in exports && exports[key] === _getTabDestination[key]) return;
|
|
207
|
+
Object.defineProperty(exports, key, {
|
|
208
|
+
enumerable: true,
|
|
209
|
+
get: function () {
|
|
210
|
+
return _getTabDestination[key];
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
|
|
202
215
|
var _isFocusable = require("./focus/isFocusable");
|
|
203
216
|
|
|
204
217
|
Object.keys(_isFocusable).forEach(function (key) {
|
|
@@ -316,19 +329,6 @@ Object.keys(_isDisabled).forEach(function (key) {
|
|
|
316
329
|
});
|
|
317
330
|
});
|
|
318
331
|
|
|
319
|
-
var _isDocument = require("./misc/isDocument");
|
|
320
|
-
|
|
321
|
-
Object.keys(_isDocument).forEach(function (key) {
|
|
322
|
-
if (key === "default" || key === "__esModule") return;
|
|
323
|
-
if (key in exports && exports[key] === _isDocument[key]) return;
|
|
324
|
-
Object.defineProperty(exports, key, {
|
|
325
|
-
enumerable: true,
|
|
326
|
-
get: function () {
|
|
327
|
-
return _isDocument[key];
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
});
|
|
331
|
-
|
|
332
332
|
var _wait = require("./misc/wait");
|
|
333
333
|
|
|
334
334
|
Object.keys(_wait).forEach(function (key) {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface PointerCoords {
|
|
2
|
+
x?: number;
|
|
3
|
+
y?: number;
|
|
4
|
+
clientX?: number;
|
|
5
|
+
clientY?: number;
|
|
6
|
+
offsetX?: number;
|
|
7
|
+
offsetY?: number;
|
|
8
|
+
pageX?: number;
|
|
9
|
+
pageY?: number;
|
|
10
|
+
screenX?: number;
|
|
11
|
+
screenY?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface FakePointerEventInit extends MouseEventInit, PointerEventInit, PointerCoords {
|
|
14
|
+
}
|
|
15
|
+
export declare class FakeMouseEvent extends MouseEvent {
|
|
16
|
+
constructor(type: string, init: FakePointerEventInit);
|
|
17
|
+
}
|
|
18
|
+
export declare class FakePointerEvent extends MouseEvent {
|
|
19
|
+
constructor(type: string, init: FakePointerEventInit);
|
|
20
|
+
}
|
|
@@ -22,17 +22,26 @@ function assignPositionInit(obj, {
|
|
|
22
22
|
offsetX,
|
|
23
23
|
offsetY,
|
|
24
24
|
pageX,
|
|
25
|
-
pageY
|
|
25
|
+
pageY,
|
|
26
|
+
screenX,
|
|
27
|
+
screenY
|
|
26
28
|
}) {
|
|
29
|
+
var _ref, _ref2, _ref3, _ref4;
|
|
30
|
+
|
|
27
31
|
assignProps(obj, {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
/* istanbul ignore start */
|
|
33
|
+
x: (_ref = x != null ? x : clientX) != null ? _ref : 0,
|
|
34
|
+
y: (_ref2 = y != null ? y : clientY) != null ? _ref2 : 0,
|
|
35
|
+
clientX: (_ref3 = x != null ? x : clientX) != null ? _ref3 : 0,
|
|
36
|
+
clientY: (_ref4 = y != null ? y : clientY) != null ? _ref4 : 0,
|
|
37
|
+
offsetX: offsetX != null ? offsetX : 0,
|
|
38
|
+
offsetY: offsetY != null ? offsetY : 0,
|
|
39
|
+
pageX: pageX != null ? pageX : 0,
|
|
40
|
+
pageY: pageY != null ? pageY : 0,
|
|
41
|
+
screenX: screenX != null ? screenX : 0,
|
|
42
|
+
screenY: screenY != null ? screenY : 0
|
|
43
|
+
/* istanbul ignore end */
|
|
44
|
+
|
|
36
45
|
});
|
|
37
46
|
}
|
|
38
47
|
|
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
import type { pointerState } from '../../pointer/types';
|
|
2
2
|
import type { keyboardState } from '../../keyboard/types';
|
|
3
|
+
import { PointerCoords } from './fakeEvent';
|
|
3
4
|
import { MouseButton } from './mouseButtons';
|
|
4
|
-
export interface Coords {
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
clientX: number;
|
|
8
|
-
clientY: number;
|
|
9
|
-
offsetX: number;
|
|
10
|
-
offsetY: number;
|
|
11
|
-
pageX: number;
|
|
12
|
-
pageY: number;
|
|
13
|
-
}
|
|
14
5
|
export declare function firePointerEvent(target: Element, type: string, { pointerState, keyboardState, pointerType, button, coords, pointerId, isPrimary, clickCount, }: {
|
|
15
6
|
pointerState: pointerState;
|
|
16
7
|
keyboardState: keyboardState;
|
|
17
8
|
pointerType?: 'mouse' | 'pen' | 'touch';
|
|
18
9
|
button?: MouseButton;
|
|
19
|
-
coords
|
|
10
|
+
coords?: PointerCoords;
|
|
20
11
|
pointerId?: number;
|
|
21
12
|
isPrimary?: boolean;
|
|
22
13
|
clickCount?: number;
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testing-library/user-event",
|
|
3
|
-
"version": "14.0.0-alpha.
|
|
3
|
+
"version": "14.0.0-alpha.5",
|
|
4
4
|
"description": "Fire events the same way the user does",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"keywords": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"scripts": {
|
|
30
|
-
"build": "kcd-scripts build",
|
|
30
|
+
"build": "kcd-scripts build --no-ts-defs && tsc -p tsconfig.build.json",
|
|
31
31
|
"lint": "kcd-scripts lint",
|
|
32
32
|
"setup": "npm install && npm run validate -s",
|
|
33
33
|
"test": "kcd-scripts test",
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.applyNative = applyNative;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* React tracks the changes on element properties.
|
|
10
|
-
* This workaround tries to alter the DOM element without React noticing,
|
|
11
|
-
* so that it later picks up the change.
|
|
12
|
-
*
|
|
13
|
-
* @see https://github.com/facebook/react/blob/148f8e497c7d37a3c7ab99f01dec2692427272b1/packages/react-dom/src/client/inputValueTracking.js#L51-L104
|
|
14
|
-
*/
|
|
15
|
-
function applyNative(element, propName, propValue) {
|
|
16
|
-
const descriptor = Object.getOwnPropertyDescriptor(element, propName);
|
|
17
|
-
const nativeDescriptor = Object.getOwnPropertyDescriptor(element.constructor.prototype, propName);
|
|
18
|
-
|
|
19
|
-
if (descriptor && nativeDescriptor) {
|
|
20
|
-
Object.defineProperty(element, propName, nativeDescriptor);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
element[propName] = propValue;
|
|
24
|
-
|
|
25
|
-
if (descriptor) {
|
|
26
|
-
Object.defineProperty(element, propName, descriptor);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* React tracks the changes on element properties.
|
|
3
|
-
* This workaround tries to alter the DOM element without React noticing,
|
|
4
|
-
* so that it later picks up the change.
|
|
5
|
-
*
|
|
6
|
-
* @see https://github.com/facebook/react/blob/148f8e497c7d37a3c7ab99f01dec2692427272b1/packages/react-dom/src/client/inputValueTracking.js#L51-L104
|
|
7
|
-
*/
|
|
8
|
-
export declare function applyNative<T extends Element, P extends keyof T>(element: T, propName: P, propValue: T[P]): void;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
declare type anyFunc = (...a: any[]) => any;
|
|
2
|
-
declare type Params<Prop> = Prop extends anyFunc ? Parameters<Prop> : [Prop];
|
|
3
|
-
declare type ImplReturn<Prop> = Prop extends anyFunc ? Parameters<Prop> : Prop;
|
|
4
|
-
export declare function prepareInterceptor<ElementType extends Element, PropName extends keyof ElementType>(element: ElementType, propName: PropName, interceptorImpl: (this: ElementType, ...args: Params<ElementType[PropName]>) => ImplReturn<ElementType[PropName]>): void;
|
|
5
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { inputDeviceState, PointerTarget } from './types';
|
|
2
|
-
export interface PointerMoveAction extends PointerTarget {
|
|
3
|
-
pointerName?: string;
|
|
4
|
-
}
|
|
5
|
-
export declare function pointerMove({ pointerName, target, coords }: PointerMoveAction, { pointerState, keyboardState }: inputDeviceState): Promise<void>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { inputDeviceState, pointerKey, PointerTarget } from './types';
|
|
2
|
-
export interface PointerPressAction extends PointerTarget {
|
|
3
|
-
keyDef: pointerKey;
|
|
4
|
-
releasePrevious: boolean;
|
|
5
|
-
releaseSelf: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare function pointerPress({ keyDef, releasePrevious, releaseSelf, target, coords }: PointerPressAction, state: inputDeviceState): Promise<void>;
|
package/dist/src/tab.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isDocument(el: Document | Element): el is Document;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface FakeEventInit extends MouseEventInit, PointerEventInit {
|
|
2
|
-
x?: number;
|
|
3
|
-
y?: number;
|
|
4
|
-
clientX?: number;
|
|
5
|
-
clientY?: number;
|
|
6
|
-
offsetX?: number;
|
|
7
|
-
offsetY?: number;
|
|
8
|
-
pageX?: number;
|
|
9
|
-
pageY?: number;
|
|
10
|
-
}
|
|
11
|
-
export declare class FakeMouseEvent extends MouseEvent {
|
|
12
|
-
constructor(type: string, init: FakeEventInit);
|
|
13
|
-
}
|
|
14
|
-
export declare class FakePointerEvent extends MouseEvent {
|
|
15
|
-
constructor(type: string, init: FakeEventInit);
|
|
16
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
declare const observed: string[];
|
|
2
|
-
declare class CustomEl extends HTMLElement {
|
|
3
|
-
static getObservedAttributes(): string[];
|
|
4
|
-
$input: HTMLInputElement | null;
|
|
5
|
-
connectedCallback(): void;
|
|
6
|
-
attributeChangedCallback(name: any, oldVal: any, newVal: any): void;
|
|
7
|
-
render(name: any, value: any): void;
|
|
8
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
declare type EventHandlers = Record<string, EventListener>;
|
|
2
|
-
declare type HTMLCollection<Elements extends Array<Element>> = Elements & {
|
|
3
|
-
item<N extends number>(i: N): Elements[N];
|
|
4
|
-
};
|
|
5
|
-
declare function setup<Elements extends Element | Element[] = HTMLElement>(ui: string, { eventHandlers, }?: {
|
|
6
|
-
eventHandlers?: EventHandlers;
|
|
7
|
-
}): {
|
|
8
|
-
getEventSnapshot: () => {
|
|
9
|
-
snapshot: string;
|
|
10
|
-
};
|
|
11
|
-
getClickEventsSnapshot: () => {
|
|
12
|
-
snapshot: string;
|
|
13
|
-
};
|
|
14
|
-
clearEventCalls: () => void;
|
|
15
|
-
getEvents: (type?: string | undefined) => Event[];
|
|
16
|
-
eventWasFired: (eventType: string) => boolean;
|
|
17
|
-
element: (Elements extends Element[] ? Elements : [Elements])[0];
|
|
18
|
-
elements: HTMLCollection<Elements extends Element[] ? Elements : [Elements]>;
|
|
19
|
-
};
|
|
20
|
-
declare function setupSelect({ disabled, disabledOptions, multiple, pointerEvents, }?: {
|
|
21
|
-
disabled?: boolean | undefined;
|
|
22
|
-
disabledOptions?: boolean | undefined;
|
|
23
|
-
multiple?: boolean | undefined;
|
|
24
|
-
pointerEvents?: string | undefined;
|
|
25
|
-
}): {
|
|
26
|
-
form: HTMLFormElement;
|
|
27
|
-
select: HTMLSelectElement;
|
|
28
|
-
options: HTMLOptionElement[];
|
|
29
|
-
getEventSnapshot: () => {
|
|
30
|
-
snapshot: string;
|
|
31
|
-
};
|
|
32
|
-
getClickEventsSnapshot: () => {
|
|
33
|
-
snapshot: string;
|
|
34
|
-
};
|
|
35
|
-
clearEventCalls: () => void;
|
|
36
|
-
getEvents: (type?: string | undefined) => Event[];
|
|
37
|
-
eventWasFired: (eventType: string) => boolean;
|
|
38
|
-
};
|
|
39
|
-
declare function setupListbox(): {
|
|
40
|
-
listbox: HTMLUListElement;
|
|
41
|
-
options: HTMLElement[];
|
|
42
|
-
getEventSnapshot: () => {
|
|
43
|
-
snapshot: string;
|
|
44
|
-
};
|
|
45
|
-
getClickEventsSnapshot: () => {
|
|
46
|
-
snapshot: string;
|
|
47
|
-
};
|
|
48
|
-
clearEventCalls: () => void;
|
|
49
|
-
getEvents: (type?: string | undefined) => Event[];
|
|
50
|
-
eventWasFired: (eventType: string) => boolean;
|
|
51
|
-
};
|
|
52
|
-
declare function addEventListener(el: EventTarget, type: string, listener: EventListener, options?: AddEventListenerOptions): void;
|
|
53
|
-
declare type TestData = {
|
|
54
|
-
handled?: boolean;
|
|
55
|
-
before?: Element;
|
|
56
|
-
after?: Element;
|
|
57
|
-
};
|
|
58
|
-
declare function addListeners(element: Element & {
|
|
59
|
-
testData?: TestData;
|
|
60
|
-
}, { eventHandlers, }?: {
|
|
61
|
-
eventHandlers?: EventHandlers;
|
|
62
|
-
}): {
|
|
63
|
-
getEventSnapshot: () => {
|
|
64
|
-
snapshot: string;
|
|
65
|
-
};
|
|
66
|
-
getClickEventsSnapshot: () => {
|
|
67
|
-
snapshot: string;
|
|
68
|
-
};
|
|
69
|
-
clearEventCalls: () => void;
|
|
70
|
-
getEvents: (type?: string | undefined) => Event[];
|
|
71
|
-
eventWasFired: (eventType: string) => boolean;
|
|
72
|
-
};
|
|
73
|
-
export { setup, setupSelect, setupListbox, addEventListener, addListeners };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/tests/clear.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/tests/paste.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/tests/setup.d.ts
DELETED
package/dist/tests/tab.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/tests/upload.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|