@testing-library/user-event 14.5.1 → 14.5.2
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/cjs/clipboard/copy.js +0 -3
- package/dist/cjs/clipboard/cut.js +0 -3
- package/dist/cjs/clipboard/index.js +0 -2
- package/dist/cjs/clipboard/paste.js +0 -2
- package/dist/cjs/convenience/click.js +0 -2
- package/dist/cjs/convenience/hover.js +0 -3
- package/dist/cjs/convenience/index.js +0 -2
- package/dist/cjs/convenience/tab.js +0 -2
- package/dist/cjs/document/UI.js +0 -2
- package/dist/cjs/document/copySelection.js +0 -2
- package/dist/cjs/document/getValueOrTextContent.js +0 -3
- package/dist/cjs/document/index.js +0 -2
- package/dist/cjs/document/interceptor.js +0 -3
- package/dist/cjs/document/prepareDocument.js +0 -3
- package/dist/cjs/document/trackValue.js +0 -2
- package/dist/cjs/event/behavior/cut.js +0 -1
- package/dist/cjs/event/behavior/index.js +0 -2
- package/dist/cjs/event/behavior/keydown.js +0 -1
- package/dist/cjs/event/behavior/keypress.js +0 -1
- package/dist/cjs/event/behavior/keyup.js +0 -1
- package/dist/cjs/event/behavior/paste.js +0 -1
- package/dist/cjs/event/behavior/registry.js +0 -2
- package/dist/cjs/event/createEvent.js +3 -5
- package/dist/cjs/event/dispatchEvent.js +0 -2
- package/dist/cjs/event/eventMap.js +200 -35
- package/dist/cjs/event/focus.js +0 -3
- package/dist/cjs/event/index.js +0 -3
- package/dist/cjs/event/input.js +0 -3
- package/dist/cjs/event/radio.js +0 -2
- package/dist/cjs/event/selection/getInputRange.js +0 -2
- package/dist/cjs/event/selection/getTargetTypeAndSelection.js +0 -3
- package/dist/cjs/event/selection/index.js +0 -2
- package/dist/cjs/event/selection/modifySelection.js +0 -3
- package/dist/cjs/event/selection/modifySelectionPerMouse.js +0 -3
- package/dist/cjs/event/selection/moveSelection.js +0 -3
- package/dist/cjs/event/selection/resolveCaretPosition.js +0 -3
- package/dist/cjs/event/selection/selectAll.js +0 -3
- package/dist/cjs/event/selection/setSelection.js +0 -3
- package/dist/cjs/event/selection/setSelectionPerMouse.js +0 -3
- package/dist/cjs/event/selection/setSelectionRange.js +0 -3
- package/dist/cjs/event/selection/updateSelectionOnFocus.js +0 -3
- package/dist/cjs/event/wrapEvent.js +2 -25
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/keyboard/index.js +0 -3
- package/dist/cjs/keyboard/keyMap.js +0 -2
- package/dist/cjs/keyboard/parseKeyDef.js +0 -3
- package/dist/cjs/options.js +5 -7
- package/dist/cjs/pointer/index.js +0 -3
- package/dist/cjs/pointer/keyMap.js +0 -2
- package/dist/cjs/pointer/parseKeyDef.js +0 -3
- package/dist/cjs/setup/api.js +0 -2
- package/dist/cjs/setup/directApi.js +0 -2
- package/dist/cjs/setup/index.js +0 -2
- package/dist/cjs/setup/setup.js +0 -3
- package/dist/cjs/setup/wrapAsync.js +2 -25
- package/dist/cjs/system/index.js +0 -2
- package/dist/cjs/system/keyboard.js +0 -3
- package/dist/cjs/system/pointer/buttons.js +0 -2
- package/dist/cjs/system/pointer/device.js +0 -2
- package/dist/cjs/system/pointer/index.js +0 -2
- package/dist/cjs/system/pointer/mouse.js +0 -4
- package/dist/cjs/system/pointer/pointer.js +0 -3
- package/dist/cjs/system/pointer/shared.js +0 -2
- package/dist/cjs/utility/clear.js +0 -4
- package/dist/cjs/utility/index.js +0 -2
- package/dist/cjs/utility/selectOptions.js +5 -30
- package/dist/cjs/utility/type.js +0 -3
- package/dist/cjs/utility/upload.js +0 -2
- package/dist/cjs/utils/click/isClickableInput.js +8 -10
- package/dist/cjs/utils/dataTransfer/Blob.js +0 -2
- package/dist/cjs/utils/dataTransfer/Clipboard.js +0 -2
- package/dist/cjs/utils/dataTransfer/DataTransfer.js +0 -2
- package/dist/cjs/utils/dataTransfer/FileList.js +0 -2
- package/dist/cjs/utils/edit/isContentEditable.js +0 -2
- package/dist/cjs/utils/edit/isEditable.js +12 -14
- package/dist/cjs/utils/edit/maxLength.js +6 -8
- package/dist/cjs/utils/edit/setFiles.js +0 -2
- package/dist/cjs/utils/edit/timeValue.js +0 -2
- package/dist/cjs/utils/focus/cursor.js +0 -2
- package/dist/cjs/utils/focus/getActiveElement.js +0 -2
- package/dist/cjs/utils/focus/getTabDestination.js +0 -2
- package/dist/cjs/utils/focus/isFocusable.js +0 -2
- package/dist/cjs/utils/focus/selection.js +0 -2
- package/dist/cjs/utils/focus/selector.js +0 -2
- package/dist/cjs/utils/index.js +1 -3
- package/dist/cjs/utils/keyDef/readNextDescriptor.js +2 -4
- package/dist/cjs/utils/misc/cloneEvent.js +0 -2
- package/dist/cjs/utils/misc/findClosest.js +0 -2
- package/dist/cjs/utils/misc/getDocumentFromNode.js +0 -2
- package/dist/cjs/utils/misc/getTreeDiff.js +0 -2
- package/dist/cjs/utils/misc/getWindow.js +13 -26
- package/dist/cjs/utils/misc/isDescendantOrSelf.js +0 -2
- package/dist/cjs/utils/misc/isDisabled.js +0 -2
- package/dist/cjs/utils/misc/isElementType.js +0 -2
- package/dist/cjs/utils/misc/isVisible.js +0 -2
- package/dist/cjs/utils/misc/level.js +0 -2
- package/dist/cjs/utils/misc/wait.js +0 -2
- package/dist/cjs/utils/pointer/cssPointerEvents.js +0 -2
- package/dist/esm/clipboard/copy.js +0 -1
- package/dist/esm/clipboard/cut.js +0 -1
- package/dist/esm/convenience/hover.js +0 -1
- package/dist/esm/document/getValueOrTextContent.js +0 -1
- package/dist/esm/document/interceptor.js +0 -1
- package/dist/esm/document/prepareDocument.js +0 -1
- package/dist/esm/event/behavior/cut.js +0 -1
- package/dist/esm/event/behavior/keydown.js +0 -1
- package/dist/esm/event/behavior/keypress.js +0 -1
- package/dist/esm/event/behavior/keyup.js +0 -1
- package/dist/esm/event/behavior/paste.js +0 -1
- package/dist/esm/event/createEvent.js +4 -4
- package/dist/esm/event/eventMap.js +201 -13
- package/dist/esm/event/focus.js +0 -1
- package/dist/esm/event/index.js +0 -1
- package/dist/esm/event/input.js +0 -1
- package/dist/esm/event/selection/getTargetTypeAndSelection.js +0 -1
- package/dist/esm/event/selection/modifySelection.js +0 -1
- package/dist/esm/event/selection/modifySelectionPerMouse.js +0 -1
- package/dist/esm/event/selection/moveSelection.js +0 -1
- package/dist/esm/event/selection/resolveCaretPosition.js +0 -1
- package/dist/esm/event/selection/selectAll.js +0 -1
- package/dist/esm/event/selection/setSelection.js +0 -1
- package/dist/esm/event/selection/setSelectionPerMouse.js +0 -1
- package/dist/esm/event/selection/setSelectionRange.js +0 -1
- package/dist/esm/event/selection/updateSelectionOnFocus.js +0 -1
- package/dist/esm/event/wrapEvent.js +1 -2
- package/dist/esm/keyboard/index.js +0 -1
- package/dist/esm/keyboard/parseKeyDef.js +0 -1
- package/dist/esm/options.js +5 -5
- package/dist/esm/pointer/index.js +0 -1
- package/dist/esm/pointer/parseKeyDef.js +0 -1
- package/dist/esm/setup/setup.js +0 -1
- package/dist/esm/setup/wrapAsync.js +1 -2
- package/dist/esm/system/keyboard.js +0 -1
- package/dist/esm/system/pointer/mouse.js +0 -2
- package/dist/esm/system/pointer/pointer.js +0 -1
- package/dist/esm/utility/clear.js +0 -2
- package/dist/esm/utility/selectOptions.js +1 -4
- package/dist/esm/utility/type.js +0 -1
- package/dist/esm/utils/click/isClickableInput.js +8 -8
- package/dist/esm/utils/edit/isEditable.js +12 -12
- package/dist/esm/utils/edit/maxLength.js +6 -6
- package/dist/esm/utils/keyDef/readNextDescriptor.js +2 -2
- package/dist/esm/utils/misc/getWindow.js +13 -4
- package/dist/types/event/eventMap.d.ts +174 -333
- package/dist/types/event/types.d.ts +2 -1
- package/package.json +15 -4
- package/dist/cjs/_interop/dom-events.d.js +0 -2
- package/dist/cjs/_interop/dom-helpers.d.js +0 -2
- package/dist/cjs/_interop/dtl.js +0 -27
- package/dist/cjs/_interop/dtlEventMap.js +0 -27
- package/dist/cjs/_interop/dtlHelpers.js +0 -27
- package/dist/esm/_interop/dom-events.d.js +0 -1
- package/dist/esm/_interop/dom-helpers.d.js +0 -1
- package/dist/esm/_interop/dtl.js +0 -2
- package/dist/esm/_interop/dtlEventMap.js +0 -2
- package/dist/esm/_interop/dtlHelpers.js +0 -2
- package/dist/types/_interop/dtl.d.ts +0 -2
- package/dist/types/_interop/dtlEventMap.d.ts +0 -2
- package/dist/types/_interop/dtlHelpers.d.ts +0 -2
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
//jsdom is not supporting isContentEditable
|
|
6
4
|
function isContentEditable(element) {
|
|
7
5
|
return element.hasAttribute('contenteditable') && (element.getAttribute('contenteditable') == 'true' || element.getAttribute('contenteditable') == '');
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var isElementType = require('../misc/isElementType.js');
|
|
6
4
|
var isContentEditable = require('./isContentEditable.js');
|
|
7
5
|
|
|
@@ -10,18 +8,18 @@ function isEditable(element) {
|
|
|
10
8
|
}
|
|
11
9
|
var editableInputTypes;
|
|
12
10
|
(function(editableInputTypes) {
|
|
13
|
-
editableInputTypes[
|
|
14
|
-
editableInputTypes[
|
|
15
|
-
editableInputTypes[
|
|
16
|
-
editableInputTypes[
|
|
17
|
-
editableInputTypes[
|
|
18
|
-
editableInputTypes[
|
|
19
|
-
editableInputTypes[
|
|
20
|
-
editableInputTypes[
|
|
21
|
-
editableInputTypes[
|
|
22
|
-
editableInputTypes[
|
|
23
|
-
editableInputTypes[
|
|
24
|
-
editableInputTypes[
|
|
11
|
+
editableInputTypes["text"] = "text";
|
|
12
|
+
editableInputTypes["date"] = "date";
|
|
13
|
+
editableInputTypes["datetime-local"] = "datetime-local";
|
|
14
|
+
editableInputTypes["email"] = "email";
|
|
15
|
+
editableInputTypes["month"] = "month";
|
|
16
|
+
editableInputTypes["number"] = "number";
|
|
17
|
+
editableInputTypes["password"] = "password";
|
|
18
|
+
editableInputTypes["search"] = "search";
|
|
19
|
+
editableInputTypes["tel"] = "tel";
|
|
20
|
+
editableInputTypes["time"] = "time";
|
|
21
|
+
editableInputTypes["url"] = "url";
|
|
22
|
+
editableInputTypes["week"] = "week";
|
|
25
23
|
})(editableInputTypes || (editableInputTypes = {}));
|
|
26
24
|
function isEditableInputOrTextArea(element) {
|
|
27
25
|
return isElementType.isElementType(element, 'textarea') || isElementType.isElementType(element, 'input') && element.type in editableInputTypes;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var isElementType = require('../misc/isElementType.js');
|
|
6
4
|
|
|
7
5
|
var maxLengthSupportedTypes;
|
|
8
6
|
(function(maxLengthSupportedTypes) {
|
|
9
|
-
maxLengthSupportedTypes[
|
|
10
|
-
maxLengthSupportedTypes[
|
|
11
|
-
maxLengthSupportedTypes[
|
|
12
|
-
maxLengthSupportedTypes[
|
|
13
|
-
maxLengthSupportedTypes[
|
|
14
|
-
maxLengthSupportedTypes[
|
|
7
|
+
maxLengthSupportedTypes["email"] = "email";
|
|
8
|
+
maxLengthSupportedTypes["password"] = "password";
|
|
9
|
+
maxLengthSupportedTypes["search"] = "search";
|
|
10
|
+
maxLengthSupportedTypes["telephone"] = "telephone";
|
|
11
|
+
maxLengthSupportedTypes["text"] = "text";
|
|
12
|
+
maxLengthSupportedTypes["url"] = "url";
|
|
15
13
|
})(maxLengthSupportedTypes || (maxLengthSupportedTypes = {}));
|
|
16
14
|
// can't use .maxLength property because of a jsdom bug:
|
|
17
15
|
// https://github.com/jsdom/jsdom/issues/2927
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
// It is not possible to create a real FileList programmatically.
|
|
6
4
|
// Therefore assigning `files` property with a programmatically created FileList results in an error.
|
|
7
5
|
// Just assigning the property (as per fireEvent) breaks the interweaving with the `value` property.
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var isClickableInput = require('./click/isClickableInput.js');
|
|
6
4
|
var Blob = require('./dataTransfer/Blob.js');
|
|
7
5
|
var DataTransfer = require('./dataTransfer/DataTransfer.js');
|
|
@@ -72,7 +70,7 @@ exports.isDescendantOrSelf = isDescendantOrSelf.isDescendantOrSelf;
|
|
|
72
70
|
exports.isElementType = isElementType.isElementType;
|
|
73
71
|
exports.isVisible = isVisible.isVisible;
|
|
74
72
|
exports.isDisabled = isDisabled.isDisabled;
|
|
75
|
-
Object.defineProperty(exports,
|
|
73
|
+
Object.defineProperty(exports, "ApiLevel", {
|
|
76
74
|
enumerable: true,
|
|
77
75
|
get: function () { return level.ApiLevel; }
|
|
78
76
|
});
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var bracketDict;
|
|
6
4
|
(function(bracketDict) {
|
|
7
|
-
bracketDict[
|
|
8
|
-
bracketDict[
|
|
5
|
+
bracketDict["{"] = "}";
|
|
6
|
+
bracketDict["["] = "]";
|
|
9
7
|
})(bracketDict || (bracketDict = {}));
|
|
10
8
|
/**
|
|
11
9
|
* Read the next key definition from user input
|
|
@@ -1,32 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var named = require('@testing-library/dom/dist/helpers.js');
|
|
6
|
-
|
|
7
|
-
function _interopNamespace(e) {
|
|
8
|
-
if (e && e.__esModule) return e;
|
|
9
|
-
var n = Object.create(null);
|
|
10
|
-
if (e) {
|
|
11
|
-
Object.keys(e).forEach(function (k) {
|
|
12
|
-
if (k !== 'default') {
|
|
13
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function () { return e[k]; }
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
n["default"] = e;
|
|
22
|
-
return Object.freeze(n);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
var named__namespace = /*#__PURE__*/_interopNamespace(named);
|
|
26
|
-
|
|
27
|
-
const { getWindowFromNode } = named__namespace;
|
|
28
3
|
function getWindow(node) {
|
|
29
|
-
|
|
4
|
+
var _node_ownerDocument;
|
|
5
|
+
if (isDocument(node) && node.defaultView) {
|
|
6
|
+
return node.defaultView;
|
|
7
|
+
} else if ((_node_ownerDocument = node.ownerDocument) === null || _node_ownerDocument === void 0 ? void 0 : _node_ownerDocument.defaultView) {
|
|
8
|
+
return node.ownerDocument.defaultView;
|
|
9
|
+
}
|
|
10
|
+
throw new Error(`Could not determine window of node. Node was ${describe(node)}`);
|
|
11
|
+
}
|
|
12
|
+
function isDocument(node) {
|
|
13
|
+
return node.nodeType === 9;
|
|
14
|
+
}
|
|
15
|
+
function describe(val) {
|
|
16
|
+
return typeof val === 'function' ? `function ${val.name}` : val === null ? 'null' : String(val);
|
|
30
17
|
}
|
|
31
18
|
|
|
32
19
|
exports.getWindow = getWindow;
|
|
@@ -2,7 +2,6 @@ import '../utils/click/isClickableInput.js';
|
|
|
2
2
|
import { writeDataTransferToClipboard } from '../utils/dataTransfer/Clipboard.js';
|
|
3
3
|
import '../utils/edit/isEditable.js';
|
|
4
4
|
import '../utils/edit/maxLength.js';
|
|
5
|
-
import '@testing-library/dom/dist/helpers.js';
|
|
6
5
|
import '../utils/keyDef/readNextDescriptor.js';
|
|
7
6
|
import '../utils/misc/level.js';
|
|
8
7
|
import '../options.js';
|
|
@@ -2,7 +2,6 @@ import '../utils/click/isClickableInput.js';
|
|
|
2
2
|
import { writeDataTransferToClipboard } from '../utils/dataTransfer/Clipboard.js';
|
|
3
3
|
import '../utils/edit/isEditable.js';
|
|
4
4
|
import '../utils/edit/maxLength.js';
|
|
5
|
-
import '@testing-library/dom/dist/helpers.js';
|
|
6
5
|
import '../utils/keyDef/readNextDescriptor.js';
|
|
7
6
|
import '../utils/misc/level.js';
|
|
8
7
|
import '../options.js';
|
|
@@ -2,7 +2,6 @@ import '../utils/click/isClickableInput.js';
|
|
|
2
2
|
import '../utils/dataTransfer/Clipboard.js';
|
|
3
3
|
import '../utils/edit/isEditable.js';
|
|
4
4
|
import '../utils/edit/maxLength.js';
|
|
5
|
-
import '@testing-library/dom/dist/helpers.js';
|
|
6
5
|
import '../utils/keyDef/readNextDescriptor.js';
|
|
7
6
|
import '../utils/misc/level.js';
|
|
8
7
|
import { assertPointerEvents } from '../utils/pointer/cssPointerEvents.js';
|
|
@@ -3,7 +3,6 @@ import '../utils/dataTransfer/Clipboard.js';
|
|
|
3
3
|
import { isContentEditable } from '../utils/edit/isContentEditable.js';
|
|
4
4
|
import '../utils/edit/isEditable.js';
|
|
5
5
|
import '../utils/edit/maxLength.js';
|
|
6
|
-
import '@testing-library/dom/dist/helpers.js';
|
|
7
6
|
import '../utils/keyDef/readNextDescriptor.js';
|
|
8
7
|
import '../utils/misc/level.js';
|
|
9
8
|
import '../options.js';
|
|
@@ -3,7 +3,6 @@ import '../utils/dataTransfer/Clipboard.js';
|
|
|
3
3
|
import '../utils/edit/isEditable.js';
|
|
4
4
|
import '../utils/edit/maxLength.js';
|
|
5
5
|
import { isElementType } from '../utils/misc/isElementType.js';
|
|
6
|
-
import '@testing-library/dom/dist/helpers.js';
|
|
7
6
|
import '../utils/keyDef/readNextDescriptor.js';
|
|
8
7
|
import '../utils/misc/level.js';
|
|
9
8
|
import '../options.js';
|
|
@@ -4,7 +4,6 @@ import '../utils/dataTransfer/Clipboard.js';
|
|
|
4
4
|
import '../utils/edit/isEditable.js';
|
|
5
5
|
import '../utils/edit/maxLength.js';
|
|
6
6
|
import { isElementType } from '../utils/misc/isElementType.js';
|
|
7
|
-
import '@testing-library/dom/dist/helpers.js';
|
|
8
7
|
import '../utils/keyDef/readNextDescriptor.js';
|
|
9
8
|
import '../utils/misc/level.js';
|
|
10
9
|
import '../options.js';
|
|
@@ -2,7 +2,6 @@ import '../../utils/click/isClickableInput.js';
|
|
|
2
2
|
import '../../utils/dataTransfer/Clipboard.js';
|
|
3
3
|
import { isEditable } from '../../utils/edit/isEditable.js';
|
|
4
4
|
import '../../utils/edit/maxLength.js';
|
|
5
|
-
import '@testing-library/dom/dist/helpers.js';
|
|
6
5
|
import '../../utils/keyDef/readNextDescriptor.js';
|
|
7
6
|
import '../../utils/misc/level.js';
|
|
8
7
|
import '../../options.js';
|
|
@@ -9,7 +9,6 @@ import { isElementType } from '../../utils/misc/isElementType.js';
|
|
|
9
9
|
import { getTabDestination } from '../../utils/focus/getTabDestination.js';
|
|
10
10
|
import { hasOwnSelection } from '../../utils/focus/selection.js';
|
|
11
11
|
import '../../utils/keyDef/readNextDescriptor.js';
|
|
12
|
-
import '@testing-library/dom/dist/helpers.js';
|
|
13
12
|
import '../../utils/misc/level.js';
|
|
14
13
|
import '../../options.js';
|
|
15
14
|
import { focusElement } from '../focus.js';
|
|
@@ -4,7 +4,6 @@ import { isContentEditable } from '../../utils/edit/isContentEditable.js';
|
|
|
4
4
|
import { isEditable } from '../../utils/edit/isEditable.js';
|
|
5
5
|
import '../../utils/edit/maxLength.js';
|
|
6
6
|
import { isElementType } from '../../utils/misc/isElementType.js';
|
|
7
|
-
import '@testing-library/dom/dist/helpers.js';
|
|
8
7
|
import '../../utils/keyDef/readNextDescriptor.js';
|
|
9
8
|
import '../../utils/misc/level.js';
|
|
10
9
|
import '../../options.js';
|
|
@@ -2,7 +2,6 @@ import { isClickableInput } from '../../utils/click/isClickableInput.js';
|
|
|
2
2
|
import '../../utils/dataTransfer/Clipboard.js';
|
|
3
3
|
import '../../utils/edit/isEditable.js';
|
|
4
4
|
import '../../utils/edit/maxLength.js';
|
|
5
|
-
import '@testing-library/dom/dist/helpers.js';
|
|
6
5
|
import '../../utils/keyDef/readNextDescriptor.js';
|
|
7
6
|
import '../../utils/misc/level.js';
|
|
8
7
|
import '../../options.js';
|
|
@@ -2,7 +2,6 @@ import '../../utils/click/isClickableInput.js';
|
|
|
2
2
|
import '../../utils/dataTransfer/Clipboard.js';
|
|
3
3
|
import { isEditable } from '../../utils/edit/isEditable.js';
|
|
4
4
|
import '../../utils/edit/maxLength.js';
|
|
5
|
-
import '@testing-library/dom/dist/helpers.js';
|
|
6
5
|
import '../../utils/keyDef/readNextDescriptor.js';
|
|
7
6
|
import '../../utils/misc/level.js';
|
|
8
7
|
import '../../options.js';
|
|
@@ -6,12 +6,13 @@ import { getWindow } from '../utils/misc/getWindow.js';
|
|
|
6
6
|
import '../utils/keyDef/readNextDescriptor.js';
|
|
7
7
|
import '../utils/misc/level.js';
|
|
8
8
|
import '../options.js';
|
|
9
|
-
import { eventMap
|
|
9
|
+
import { eventMap } from './eventMap.js';
|
|
10
10
|
|
|
11
11
|
const eventInitializer = {
|
|
12
12
|
ClipboardEvent: [
|
|
13
13
|
initClipboardEvent
|
|
14
14
|
],
|
|
15
|
+
Event: [],
|
|
15
16
|
InputEvent: [
|
|
16
17
|
initUIEvent,
|
|
17
18
|
initInputEvent
|
|
@@ -34,11 +35,10 @@ const eventInitializer = {
|
|
|
34
35
|
]
|
|
35
36
|
};
|
|
36
37
|
function createEvent(type, target, init) {
|
|
37
|
-
var _eventInitializer_EventType;
|
|
38
38
|
const window = getWindow(target);
|
|
39
|
-
const { EventType, defaultInit } = eventMap[
|
|
39
|
+
const { EventType, defaultInit } = eventMap[type];
|
|
40
40
|
const event = new (getEventConstructors(window))[EventType](type, defaultInit);
|
|
41
|
-
|
|
41
|
+
eventInitializer[EventType].forEach((f)=>f(event, init !== null && init !== void 0 ? init : {}));
|
|
42
42
|
return event;
|
|
43
43
|
}
|
|
44
44
|
/* istanbul ignore next */ function getEventConstructors(window) {
|