@testing-library/user-event 14.5.1 → 14.6.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/dist/cjs/clipboard/copy.js +1 -10
- package/dist/cjs/clipboard/cut.js +1 -10
- package/dist/cjs/clipboard/index.js +0 -2
- package/dist/cjs/clipboard/paste.js +2 -10
- package/dist/cjs/convenience/click.js +0 -2
- package/dist/cjs/convenience/hover.js +0 -8
- package/dist/cjs/convenience/index.js +0 -2
- package/dist/cjs/convenience/tab.js +0 -2
- package/dist/cjs/document/UI.js +3 -5
- package/dist/cjs/document/copySelection.js +0 -8
- package/dist/cjs/document/getValueOrTextContent.js +0 -9
- package/dist/cjs/document/index.js +0 -2
- package/dist/cjs/document/interceptor.js +5 -14
- package/dist/cjs/document/patchFocus.js +104 -0
- package/dist/cjs/document/prepareDocument.js +1 -10
- package/dist/cjs/document/trackValue.js +2 -10
- package/dist/cjs/event/behavior/click.js +1 -7
- package/dist/cjs/event/behavior/cut.js +0 -6
- package/dist/cjs/event/behavior/index.js +0 -2
- package/dist/cjs/event/behavior/keydown.js +3 -9
- package/dist/cjs/event/behavior/keypress.js +2 -8
- package/dist/cjs/event/behavior/keyup.js +1 -7
- package/dist/cjs/event/behavior/paste.js +1 -7
- package/dist/cjs/event/behavior/registry.js +0 -2
- package/dist/cjs/event/createEvent.js +36 -31
- package/dist/cjs/event/dispatchEvent.js +1 -3
- package/dist/cjs/event/eventMap.js +232 -35
- package/dist/cjs/event/focus.js +5 -12
- package/dist/cjs/event/index.js +0 -9
- package/dist/cjs/event/input.js +2 -10
- package/dist/cjs/event/radio.js +0 -8
- package/dist/cjs/event/selection/getInputRange.js +1 -3
- package/dist/cjs/event/selection/getTargetTypeAndSelection.js +2 -11
- package/dist/cjs/event/selection/index.js +0 -2
- package/dist/cjs/event/selection/modifySelection.js +1 -10
- package/dist/cjs/event/selection/modifySelectionPerMouse.js +2 -11
- package/dist/cjs/event/selection/moveSelection.js +1 -10
- package/dist/cjs/event/selection/resolveCaretPosition.js +4 -13
- package/dist/cjs/event/selection/selectAll.js +3 -12
- package/dist/cjs/event/selection/setSelection.js +1 -10
- package/dist/cjs/event/selection/setSelectionPerMouse.js +7 -16
- package/dist/cjs/event/selection/setSelectionRange.js +1 -10
- package/dist/cjs/event/selection/updateSelectionOnFocus.js +6 -11
- package/dist/cjs/event/wrapEvent.js +2 -25
- package/dist/cjs/index.js +2 -5
- package/dist/cjs/keyboard/index.js +0 -9
- package/dist/cjs/keyboard/keyMap.js +0 -2
- package/dist/cjs/keyboard/parseKeyDef.js +3 -11
- package/dist/cjs/options.js +10 -10
- package/dist/cjs/pointer/index.js +6 -14
- package/dist/cjs/pointer/keyMap.js +0 -2
- package/dist/cjs/pointer/parseKeyDef.js +0 -8
- 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 +7 -10
- package/dist/cjs/setup/wrapAsync.js +2 -25
- package/dist/cjs/system/index.js +0 -2
- package/dist/cjs/system/keyboard.js +47 -28
- 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 +18 -22
- package/dist/cjs/system/pointer/mouse.js +8 -18
- package/dist/cjs/system/pointer/pointer.js +4 -12
- package/dist/cjs/system/pointer/shared.js +2 -4
- package/dist/cjs/utility/clear.js +0 -9
- package/dist/cjs/utility/index.js +0 -2
- package/dist/cjs/utility/selectOptions.js +6 -36
- package/dist/cjs/utility/type.js +1 -10
- package/dist/cjs/utility/upload.js +4 -12
- package/dist/cjs/utils/click/isClickableInput.js +11 -13
- package/dist/cjs/utils/dataTransfer/Blob.js +0 -2
- package/dist/cjs/utils/dataTransfer/Clipboard.js +5 -8
- package/dist/cjs/utils/dataTransfer/DataTransfer.js +6 -12
- 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 +15 -17
- package/dist/cjs/utils/edit/maxLength.js +10 -12
- package/dist/cjs/utils/edit/setFiles.js +2 -4
- package/dist/cjs/utils/edit/timeValue.js +0 -2
- package/dist/cjs/utils/focus/cursor.js +1 -3
- package/dist/cjs/utils/focus/getActiveElement.js +2 -4
- 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 -6
- package/dist/cjs/utils/keyDef/readNextDescriptor.js +8 -10
- 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 +1 -3
- package/dist/cjs/utils/misc/isElementType.js +0 -2
- package/dist/cjs/utils/misc/isVisible.js +1 -3
- package/dist/cjs/utils/misc/level.js +4 -5
- package/dist/cjs/utils/misc/wait.js +0 -2
- package/dist/cjs/utils/pointer/cssPointerEvents.js +11 -13
- package/dist/esm/clipboard/copy.js +1 -8
- package/dist/esm/clipboard/cut.js +1 -8
- package/dist/esm/clipboard/paste.js +2 -8
- package/dist/esm/convenience/hover.js +0 -6
- package/dist/esm/document/UI.js +3 -3
- package/dist/esm/document/copySelection.js +0 -6
- package/dist/esm/document/getValueOrTextContent.js +0 -7
- package/dist/esm/document/interceptor.js +5 -12
- package/dist/esm/document/patchFocus.js +101 -0
- package/dist/esm/document/prepareDocument.js +1 -8
- package/dist/esm/document/trackValue.js +2 -8
- package/dist/esm/event/behavior/click.js +1 -7
- package/dist/esm/event/behavior/cut.js +0 -6
- package/dist/esm/event/behavior/keydown.js +3 -9
- package/dist/esm/event/behavior/keypress.js +2 -8
- package/dist/esm/event/behavior/keyup.js +1 -7
- package/dist/esm/event/behavior/paste.js +1 -7
- package/dist/esm/event/createEvent.js +37 -30
- package/dist/esm/event/dispatchEvent.js +1 -1
- package/dist/esm/event/eventMap.js +233 -13
- package/dist/esm/event/focus.js +5 -10
- package/dist/esm/event/index.js +0 -7
- package/dist/esm/event/input.js +2 -8
- package/dist/esm/event/radio.js +0 -6
- package/dist/esm/event/selection/getInputRange.js +1 -1
- package/dist/esm/event/selection/getTargetTypeAndSelection.js +2 -9
- package/dist/esm/event/selection/modifySelection.js +1 -8
- package/dist/esm/event/selection/modifySelectionPerMouse.js +2 -9
- package/dist/esm/event/selection/moveSelection.js +1 -8
- package/dist/esm/event/selection/resolveCaretPosition.js +4 -11
- package/dist/esm/event/selection/selectAll.js +3 -10
- package/dist/esm/event/selection/setSelection.js +1 -8
- package/dist/esm/event/selection/setSelectionPerMouse.js +7 -14
- package/dist/esm/event/selection/setSelectionRange.js +1 -8
- package/dist/esm/event/selection/updateSelectionOnFocus.js +6 -9
- package/dist/esm/event/wrapEvent.js +1 -2
- package/dist/esm/keyboard/index.js +0 -7
- package/dist/esm/keyboard/parseKeyDef.js +3 -9
- package/dist/esm/options.js +8 -8
- package/dist/esm/pointer/index.js +6 -12
- package/dist/esm/pointer/parseKeyDef.js +0 -6
- package/dist/esm/setup/setup.js +7 -8
- package/dist/esm/setup/wrapAsync.js +1 -2
- package/dist/esm/system/keyboard.js +46 -26
- package/dist/esm/system/pointer/index.js +18 -20
- package/dist/esm/system/pointer/mouse.js +8 -16
- package/dist/esm/system/pointer/pointer.js +4 -10
- package/dist/esm/system/pointer/shared.js +2 -2
- package/dist/esm/utility/clear.js +0 -7
- package/dist/esm/utility/selectOptions.js +2 -10
- package/dist/esm/utility/type.js +1 -8
- package/dist/esm/utility/upload.js +4 -10
- package/dist/esm/utils/click/isClickableInput.js +11 -11
- package/dist/esm/utils/dataTransfer/Clipboard.js +5 -6
- package/dist/esm/utils/dataTransfer/DataTransfer.js +6 -10
- package/dist/esm/utils/edit/isEditable.js +15 -15
- package/dist/esm/utils/edit/maxLength.js +10 -10
- package/dist/esm/utils/edit/setFiles.js +2 -2
- package/dist/esm/utils/focus/cursor.js +1 -1
- package/dist/esm/utils/focus/getActiveElement.js +2 -2
- package/dist/esm/utils/keyDef/readNextDescriptor.js +8 -8
- package/dist/esm/utils/misc/getWindow.js +13 -4
- package/dist/esm/utils/misc/isDisabled.js +1 -1
- package/dist/esm/utils/misc/isVisible.js +1 -1
- package/dist/esm/utils/misc/level.js +3 -3
- package/dist/esm/utils/pointer/cssPointerEvents.js +11 -11
- package/dist/types/document/patchFocus.d.ts +9 -0
- package/dist/types/event/eventMap.d.ts +204 -331
- package/dist/types/event/types.d.ts +3 -2
- package/dist/types/system/keyboard.d.ts +1 -4
- package/dist/types/utils/dataTransfer/DataTransfer.d.ts +1 -1
- package/package.json +17 -6
- 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,16 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
require('../utils/click/isClickableInput.js');
|
|
6
3
|
require('../utils/dataTransfer/Clipboard.js');
|
|
7
|
-
require('../utils/edit/isEditable.js');
|
|
8
|
-
require('../utils/edit/maxLength.js');
|
|
9
4
|
var getActiveElement = require('../utils/focus/getActiveElement.js');
|
|
10
|
-
require('@testing-library/dom/dist/helpers.js');
|
|
11
|
-
require('../utils/keyDef/readNextDescriptor.js');
|
|
12
|
-
require('../utils/misc/level.js');
|
|
13
|
-
require('../options.js');
|
|
14
5
|
|
|
15
6
|
function _define_property(obj, key, value) {
|
|
16
7
|
if (key in obj) {
|
|
@@ -25,13 +16,13 @@ function _define_property(obj, key, value) {
|
|
|
25
16
|
}
|
|
26
17
|
return obj;
|
|
27
18
|
}
|
|
28
|
-
|
|
29
|
-
(function(DOM_KEY_LOCATION) {
|
|
19
|
+
var DOM_KEY_LOCATION = /*#__PURE__*/ function(DOM_KEY_LOCATION) {
|
|
30
20
|
DOM_KEY_LOCATION[DOM_KEY_LOCATION["STANDARD"] = 0] = "STANDARD";
|
|
31
21
|
DOM_KEY_LOCATION[DOM_KEY_LOCATION["LEFT"] = 1] = "LEFT";
|
|
32
22
|
DOM_KEY_LOCATION[DOM_KEY_LOCATION["RIGHT"] = 2] = "RIGHT";
|
|
33
23
|
DOM_KEY_LOCATION[DOM_KEY_LOCATION["NUMPAD"] = 3] = "NUMPAD";
|
|
34
|
-
|
|
24
|
+
return DOM_KEY_LOCATION;
|
|
25
|
+
}({});
|
|
35
26
|
const modifierKeys = [
|
|
36
27
|
'Alt',
|
|
37
28
|
'AltGraph',
|
|
@@ -56,23 +47,17 @@ function isModifierLock(key) {
|
|
|
56
47
|
}
|
|
57
48
|
class KeyboardHost {
|
|
58
49
|
isKeyPressed(keyDef) {
|
|
59
|
-
return
|
|
50
|
+
return this.pressed.has(String(keyDef.code));
|
|
60
51
|
}
|
|
61
52
|
getPressedKeys() {
|
|
62
|
-
return
|
|
53
|
+
return this.pressed.values().map((p)=>p.keyDef);
|
|
63
54
|
}
|
|
64
55
|
/** Press a key */ async keydown(instance, keyDef) {
|
|
65
|
-
var // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
66
|
-
_this_pressed, _code, _this_pressed_code;
|
|
67
56
|
const key = String(keyDef.key);
|
|
68
57
|
const code = String(keyDef.code);
|
|
69
58
|
const target = getActiveElement.getActiveElementOrBody(instance.config.document);
|
|
70
59
|
this.setKeydownTarget(target);
|
|
71
|
-
|
|
72
|
-
(_ = (_this_pressed = this.pressed)[_code = code]) !== null && _ !== void 0 ? _ : _this_pressed[_code] = {
|
|
73
|
-
keyDef,
|
|
74
|
-
unpreventedDefault: false
|
|
75
|
-
};
|
|
60
|
+
this.pressed.add(code, keyDef);
|
|
76
61
|
if (isModifierKey(key)) {
|
|
77
62
|
this.modifiers[key] = true;
|
|
78
63
|
}
|
|
@@ -84,7 +69,9 @@ class KeyboardHost {
|
|
|
84
69
|
this.modifiers[key] = true;
|
|
85
70
|
this.modifierLockStart[key] = true;
|
|
86
71
|
}
|
|
87
|
-
|
|
72
|
+
if (unprevented) {
|
|
73
|
+
this.pressed.setUnprevented(code);
|
|
74
|
+
}
|
|
88
75
|
if (unprevented && this.hasKeyPress(key)) {
|
|
89
76
|
instance.dispatchUIEvent(getActiveElement.getActiveElementOrBody(instance.config.document), 'keypress', {
|
|
90
77
|
key,
|
|
@@ -96,10 +83,9 @@ class KeyboardHost {
|
|
|
96
83
|
/** Release a key */ async keyup(instance, keyDef) {
|
|
97
84
|
const key = String(keyDef.key);
|
|
98
85
|
const code = String(keyDef.code);
|
|
99
|
-
const unprevented = this.pressed
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if (isModifierKey(key) && !Object.values(this.pressed).find((p)=>p.keyDef.key === key)) {
|
|
86
|
+
const unprevented = this.pressed.isUnprevented(code);
|
|
87
|
+
this.pressed.delete(code);
|
|
88
|
+
if (isModifierKey(key) && !this.pressed.values().find((p)=>p.keyDef.key === key)) {
|
|
103
89
|
this.modifiers[key] = false;
|
|
104
90
|
}
|
|
105
91
|
instance.dispatchUIEvent(getActiveElement.getActiveElementOrBody(instance.config.document), 'keyup', {
|
|
@@ -124,7 +110,7 @@ class KeyboardHost {
|
|
|
124
110
|
return (key.length === 1 || key === 'Enter') && !this.modifiers.Control && !this.modifiers.Alt;
|
|
125
111
|
}
|
|
126
112
|
constructor(system){
|
|
127
|
-
_define_property(this, "system",
|
|
113
|
+
_define_property(this, "system", undefined);
|
|
128
114
|
_define_property(this, "modifiers", {
|
|
129
115
|
Alt: false,
|
|
130
116
|
AltGraph: false,
|
|
@@ -139,7 +125,39 @@ class KeyboardHost {
|
|
|
139
125
|
Symbol: false,
|
|
140
126
|
SymbolLock: false
|
|
141
127
|
});
|
|
142
|
-
_define_property(this, "pressed", {
|
|
128
|
+
_define_property(this, "pressed", new class {
|
|
129
|
+
add(code, keyDef) {
|
|
130
|
+
var _this_registry, _code;
|
|
131
|
+
var _;
|
|
132
|
+
(_ = (_this_registry = this.registry)[_code = code]) !== null && _ !== undefined ? _ : _this_registry[_code] = {
|
|
133
|
+
keyDef,
|
|
134
|
+
unpreventedDefault: false
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
has(code) {
|
|
138
|
+
return !!this.registry[code];
|
|
139
|
+
}
|
|
140
|
+
setUnprevented(code) {
|
|
141
|
+
const o = this.registry[code];
|
|
142
|
+
if (o) {
|
|
143
|
+
o.unpreventedDefault = true;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
isUnprevented(code) {
|
|
147
|
+
var _this_registry_code;
|
|
148
|
+
return !!((_this_registry_code = this.registry[code]) === null || _this_registry_code === undefined ? undefined : _this_registry_code.unpreventedDefault);
|
|
149
|
+
}
|
|
150
|
+
delete(code) {
|
|
151
|
+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
152
|
+
delete this.registry[code];
|
|
153
|
+
}
|
|
154
|
+
values() {
|
|
155
|
+
return Object.values(this.registry);
|
|
156
|
+
}
|
|
157
|
+
constructor(){
|
|
158
|
+
_define_property(this, "registry", {});
|
|
159
|
+
}
|
|
160
|
+
}());
|
|
143
161
|
_define_property(this, "carryChar", '');
|
|
144
162
|
_define_property(this, "lastKeydownTarget", undefined);
|
|
145
163
|
_define_property(this, "modifierLockStart", {});
|
|
@@ -147,4 +165,5 @@ class KeyboardHost {
|
|
|
147
165
|
}
|
|
148
166
|
}
|
|
149
167
|
|
|
168
|
+
exports.DOM_KEY_LOCATION = DOM_KEY_LOCATION;
|
|
150
169
|
exports.KeyboardHost = KeyboardHost;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var buttons = require('./buttons.js');
|
|
6
4
|
var device = require('./device.js');
|
|
7
5
|
var mouse = require('./mouse.js');
|
|
@@ -47,12 +45,12 @@ class PointerHost {
|
|
|
47
45
|
// the order in which they interweave/follow on a user interaction depends on the implementation.
|
|
48
46
|
const pointermove = pointer.move(instance, position);
|
|
49
47
|
const mousemove = pointer.pointerType === 'touch' || pointer.isPrevented && pointer.isDown ? undefined : this.mouse.move(instance, position);
|
|
50
|
-
pointermove === null || pointermove ===
|
|
51
|
-
mousemove === null || mousemove ===
|
|
52
|
-
pointermove === null || pointermove ===
|
|
53
|
-
mousemove === null || mousemove ===
|
|
54
|
-
pointermove === null || pointermove ===
|
|
55
|
-
mousemove === null || mousemove ===
|
|
48
|
+
pointermove === null || pointermove === undefined ? undefined : pointermove.leave();
|
|
49
|
+
mousemove === null || mousemove === undefined ? undefined : mousemove.leave();
|
|
50
|
+
pointermove === null || pointermove === undefined ? undefined : pointermove.enter();
|
|
51
|
+
mousemove === null || mousemove === undefined ? undefined : mousemove.enter();
|
|
52
|
+
pointermove === null || pointermove === undefined ? undefined : pointermove.move();
|
|
53
|
+
mousemove === null || mousemove === undefined ? undefined : mousemove.move();
|
|
56
54
|
}
|
|
57
55
|
async release(instance, keyDef, position) {
|
|
58
56
|
const device = this.devices.get(keyDef.pointerType);
|
|
@@ -73,16 +71,16 @@ class PointerHost {
|
|
|
73
71
|
if (!pointer.isPrevented) {
|
|
74
72
|
if (pointer.pointerType === 'touch' && !pointer.isMultitouch) {
|
|
75
73
|
const mousemove = this.mouse.move(instance, pointer.position);
|
|
76
|
-
mousemove === null || mousemove ===
|
|
77
|
-
mousemove === null || mousemove ===
|
|
78
|
-
mousemove === null || mousemove ===
|
|
74
|
+
mousemove === null || mousemove === undefined ? undefined : mousemove.leave();
|
|
75
|
+
mousemove === null || mousemove === undefined ? undefined : mousemove.enter();
|
|
76
|
+
mousemove === null || mousemove === undefined ? undefined : mousemove.move();
|
|
79
77
|
this.mouse.down(instance, keyDef, pointer);
|
|
80
78
|
}
|
|
81
79
|
if (!pointer.isMultitouch) {
|
|
82
80
|
const mousemove = this.mouse.move(instance, pointer.position);
|
|
83
|
-
mousemove === null || mousemove ===
|
|
84
|
-
mousemove === null || mousemove ===
|
|
85
|
-
mousemove === null || mousemove ===
|
|
81
|
+
mousemove === null || mousemove === undefined ? undefined : mousemove.leave();
|
|
82
|
+
mousemove === null || mousemove === undefined ? undefined : mousemove.enter();
|
|
83
|
+
mousemove === null || mousemove === undefined ? undefined : mousemove.move();
|
|
86
84
|
this.mouse.up(instance, keyDef, pointer);
|
|
87
85
|
}
|
|
88
86
|
}
|
|
@@ -98,23 +96,21 @@ class PointerHost {
|
|
|
98
96
|
}
|
|
99
97
|
getMouseTarget(instance) {
|
|
100
98
|
var _this_mouse_position_target;
|
|
101
|
-
return (_this_mouse_position_target = this.mouse.position.target) !== null && _this_mouse_position_target !==
|
|
99
|
+
return (_this_mouse_position_target = this.mouse.position.target) !== null && _this_mouse_position_target !== undefined ? _this_mouse_position_target : instance.config.document.body;
|
|
102
100
|
}
|
|
103
101
|
setMousePosition(position) {
|
|
104
102
|
this.mouse.position = position;
|
|
105
103
|
this.pointers.get('mouse').position = position;
|
|
106
104
|
}
|
|
107
105
|
constructor(system){
|
|
108
|
-
_define_property(this, "system",
|
|
109
|
-
_define_property(this, "mouse",
|
|
110
|
-
_define_property(this, "buttons",
|
|
106
|
+
_define_property(this, "system", undefined);
|
|
107
|
+
_define_property(this, "mouse", undefined);
|
|
108
|
+
_define_property(this, "buttons", undefined);
|
|
111
109
|
_define_property(this, "devices", new class {
|
|
112
110
|
get(k) {
|
|
113
|
-
var
|
|
114
|
-
_this_registry, _k;
|
|
111
|
+
var _this_registry, _k;
|
|
115
112
|
var _;
|
|
116
|
-
(_ = (_this_registry = this.registry)[_k = k]) !== null && _ !==
|
|
117
|
-
return this.registry[k];
|
|
113
|
+
return (_ = (_this_registry = this.registry)[_k = k]) !== null && _ !== undefined ? _ : _this_registry[_k] = new device.Device();
|
|
118
114
|
}
|
|
119
115
|
constructor(){
|
|
120
116
|
_define_property(this, "registry", {});
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
require('../../event/behavior/click.js');
|
|
6
4
|
require('../../event/behavior/cut.js');
|
|
7
5
|
require('../../event/behavior/keydown.js');
|
|
@@ -9,17 +7,9 @@ require('../../event/behavior/keypress.js');
|
|
|
9
7
|
require('../../event/behavior/keyup.js');
|
|
10
8
|
require('../../event/behavior/paste.js');
|
|
11
9
|
require('@testing-library/dom');
|
|
12
|
-
require('../../event/eventMap.js');
|
|
13
|
-
require('../../utils/click/isClickableInput.js');
|
|
14
10
|
require('../../utils/dataTransfer/Clipboard.js');
|
|
15
|
-
require('../../utils/edit/isEditable.js');
|
|
16
|
-
require('../../utils/edit/maxLength.js');
|
|
17
11
|
var isDisabled = require('../../utils/misc/isDisabled.js');
|
|
18
|
-
require('@testing-library/dom/dist/helpers.js');
|
|
19
|
-
require('../../utils/keyDef/readNextDescriptor.js');
|
|
20
12
|
var getTreeDiff = require('../../utils/misc/getTreeDiff.js');
|
|
21
|
-
require('../../utils/misc/level.js');
|
|
22
|
-
require('../../options.js');
|
|
23
13
|
var focus = require('../../event/focus.js');
|
|
24
14
|
var setSelectionPerMouse = require('../../event/selection/setSelectionPerMouse.js');
|
|
25
15
|
var modifySelectionPerMouse = require('../../event/selection/modifySelectionPerMouse.js');
|
|
@@ -137,7 +127,7 @@ function _define_property(obj, key, value) {
|
|
|
137
127
|
}
|
|
138
128
|
getTarget(instance) {
|
|
139
129
|
var _this_position_target;
|
|
140
|
-
return (_this_position_target = this.position.target) !== null && _this_position_target !==
|
|
130
|
+
return (_this_position_target = this.position.target) !== null && _this_position_target !== undefined ? _this_position_target : instance.config.document.body;
|
|
141
131
|
}
|
|
142
132
|
startSelecting(instance, clickCount) {
|
|
143
133
|
var _this_position_caret, _this_position_caret1;
|
|
@@ -145,8 +135,8 @@ function _define_property(obj, key, value) {
|
|
|
145
135
|
this.selecting = setSelectionPerMouse.setSelectionPerMouseDown({
|
|
146
136
|
document: instance.config.document,
|
|
147
137
|
target: this.getTarget(instance),
|
|
148
|
-
node: (_this_position_caret = this.position.caret) === null || _this_position_caret ===
|
|
149
|
-
offset: (_this_position_caret1 = this.position.caret) === null || _this_position_caret1 ===
|
|
138
|
+
node: (_this_position_caret = this.position.caret) === null || _this_position_caret === undefined ? undefined : _this_position_caret.node,
|
|
139
|
+
offset: (_this_position_caret1 = this.position.caret) === null || _this_position_caret1 === undefined ? undefined : _this_position_caret1.offset,
|
|
150
140
|
clickCount
|
|
151
141
|
});
|
|
152
142
|
}
|
|
@@ -158,8 +148,8 @@ function _define_property(obj, key, value) {
|
|
|
158
148
|
modifySelectionPerMouse.modifySelectionPerMouseMove(this.selecting, {
|
|
159
149
|
document: instance.config.document,
|
|
160
150
|
target: this.getTarget(instance),
|
|
161
|
-
node: (_this_position_caret = this.position.caret) === null || _this_position_caret ===
|
|
162
|
-
offset: (_this_position_caret1 = this.position.caret) === null || _this_position_caret1 ===
|
|
151
|
+
node: (_this_position_caret = this.position.caret) === null || _this_position_caret === undefined ? undefined : _this_position_caret.node,
|
|
152
|
+
offset: (_this_position_caret1 = this.position.caret) === null || _this_position_caret1 === undefined ? undefined : _this_position_caret1.offset
|
|
163
153
|
});
|
|
164
154
|
}
|
|
165
155
|
endSelecting() {
|
|
@@ -168,7 +158,7 @@ function _define_property(obj, key, value) {
|
|
|
168
158
|
constructor(){
|
|
169
159
|
_define_property(this, "position", {});
|
|
170
160
|
_define_property(this, "buttons", new buttons.Buttons());
|
|
171
|
-
_define_property(this, "selecting",
|
|
161
|
+
_define_property(this, "selecting", undefined);
|
|
172
162
|
_define_property(this, "buttonDownTarget", {});
|
|
173
163
|
// According to spec the `detail` on click events should be the number
|
|
174
164
|
// of *consecutive* clicks with a specific button.
|
|
@@ -191,11 +181,11 @@ function _define_property(obj, key, value) {
|
|
|
191
181
|
getOnDown(button) {
|
|
192
182
|
var _this_count_button;
|
|
193
183
|
this.down = {
|
|
194
|
-
[button]: (_this_count_button = this.count[button]) !== null && _this_count_button !==
|
|
184
|
+
[button]: (_this_count_button = this.count[button]) !== null && _this_count_button !== undefined ? _this_count_button : 0
|
|
195
185
|
};
|
|
196
186
|
var _this_count_button1;
|
|
197
187
|
this.count = {
|
|
198
|
-
[button]: (_this_count_button1 = this.count[button]) !== null && _this_count_button1 !==
|
|
188
|
+
[button]: (_this_count_button1 = this.count[button]) !== null && _this_count_button1 !== undefined ? _this_count_button1 : 0
|
|
199
189
|
};
|
|
200
190
|
return Number(this.count[button]) + 1;
|
|
201
191
|
}
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
require('../../utils/click/isClickableInput.js');
|
|
6
3
|
require('../../utils/dataTransfer/Clipboard.js');
|
|
7
|
-
require('../../utils/edit/isEditable.js');
|
|
8
|
-
require('../../utils/edit/maxLength.js');
|
|
9
|
-
require('@testing-library/dom/dist/helpers.js');
|
|
10
|
-
require('../../utils/keyDef/readNextDescriptor.js');
|
|
11
4
|
var getTreeDiff = require('../../utils/misc/getTreeDiff.js');
|
|
12
|
-
require('../../utils/misc/level.js');
|
|
13
5
|
var cssPointerEvents = require('../../utils/pointer/cssPointerEvents.js');
|
|
14
6
|
var shared = require('./shared.js');
|
|
15
7
|
|
|
@@ -100,7 +92,7 @@ class Pointer {
|
|
|
100
92
|
}
|
|
101
93
|
getTarget(instance) {
|
|
102
94
|
var _this_position_target;
|
|
103
|
-
return (_this_position_target = this.position.target) !== null && _this_position_target !==
|
|
95
|
+
return (_this_position_target = this.position.target) !== null && _this_position_target !== undefined ? _this_position_target : instance.config.document.body;
|
|
104
96
|
}
|
|
105
97
|
getEventInit() {
|
|
106
98
|
return {
|
|
@@ -111,9 +103,9 @@ class Pointer {
|
|
|
111
103
|
};
|
|
112
104
|
}
|
|
113
105
|
constructor({ pointerId, pointerType, isPrimary }){
|
|
114
|
-
_define_property(this, "pointerId",
|
|
115
|
-
_define_property(this, "pointerType",
|
|
116
|
-
_define_property(this, "isPrimary",
|
|
106
|
+
_define_property(this, "pointerId", undefined);
|
|
107
|
+
_define_property(this, "pointerType", undefined);
|
|
108
|
+
_define_property(this, "isPrimary", undefined);
|
|
117
109
|
_define_property(this, "isMultitouch", false);
|
|
118
110
|
_define_property(this, "isCancelled", false);
|
|
119
111
|
_define_property(this, "isDown", false);
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
function isDifferentPointerPosition(positionA, positionB) {
|
|
6
|
-
var _positionA_coords, _positionB_coords, _positionA_coords1, _positionB_coords1, _positionA_caret, _positionB_caret, _positionA_caret1, _positionB_caret1;
|
|
7
|
-
return positionA.target !== positionB.target || ((_positionA_coords = positionA.coords) === null || _positionA_coords ===
|
|
4
|
+
var _positionA_coords, _positionB_coords, _positionA_coords1, _positionB_coords1, _positionA_coords2, _positionB_coords2, _positionA_coords3, _positionB_coords3, _positionA_coords4, _positionB_coords4, _positionA_coords5, _positionB_coords5, _positionA_coords6, _positionB_coords6, _positionA_coords7, _positionB_coords7, _positionA_coords8, _positionB_coords8, _positionA_coords9, _positionB_coords9, _positionA_caret, _positionB_caret, _positionA_caret1, _positionB_caret1;
|
|
5
|
+
return positionA.target !== positionB.target || ((_positionA_coords = positionA.coords) === null || _positionA_coords === undefined ? undefined : _positionA_coords.x) !== ((_positionB_coords = positionB.coords) === null || _positionB_coords === undefined ? undefined : _positionB_coords.x) || ((_positionA_coords1 = positionA.coords) === null || _positionA_coords1 === undefined ? undefined : _positionA_coords1.y) !== ((_positionB_coords1 = positionB.coords) === null || _positionB_coords1 === undefined ? undefined : _positionB_coords1.y) || ((_positionA_coords2 = positionA.coords) === null || _positionA_coords2 === undefined ? undefined : _positionA_coords2.clientX) !== ((_positionB_coords2 = positionB.coords) === null || _positionB_coords2 === undefined ? undefined : _positionB_coords2.clientX) || ((_positionA_coords3 = positionA.coords) === null || _positionA_coords3 === undefined ? undefined : _positionA_coords3.clientY) !== ((_positionB_coords3 = positionB.coords) === null || _positionB_coords3 === undefined ? undefined : _positionB_coords3.clientY) || ((_positionA_coords4 = positionA.coords) === null || _positionA_coords4 === undefined ? undefined : _positionA_coords4.offsetX) !== ((_positionB_coords4 = positionB.coords) === null || _positionB_coords4 === undefined ? undefined : _positionB_coords4.offsetX) || ((_positionA_coords5 = positionA.coords) === null || _positionA_coords5 === undefined ? undefined : _positionA_coords5.offsetY) !== ((_positionB_coords5 = positionB.coords) === null || _positionB_coords5 === undefined ? undefined : _positionB_coords5.offsetY) || ((_positionA_coords6 = positionA.coords) === null || _positionA_coords6 === undefined ? undefined : _positionA_coords6.pageX) !== ((_positionB_coords6 = positionB.coords) === null || _positionB_coords6 === undefined ? undefined : _positionB_coords6.pageX) || ((_positionA_coords7 = positionA.coords) === null || _positionA_coords7 === undefined ? undefined : _positionA_coords7.pageY) !== ((_positionB_coords7 = positionB.coords) === null || _positionB_coords7 === undefined ? undefined : _positionB_coords7.pageY) || ((_positionA_coords8 = positionA.coords) === null || _positionA_coords8 === undefined ? undefined : _positionA_coords8.screenX) !== ((_positionB_coords8 = positionB.coords) === null || _positionB_coords8 === undefined ? undefined : _positionB_coords8.screenX) || ((_positionA_coords9 = positionA.coords) === null || _positionA_coords9 === undefined ? undefined : _positionA_coords9.screenY) !== ((_positionB_coords9 = positionB.coords) === null || _positionB_coords9 === undefined ? undefined : _positionB_coords9.screenY) || ((_positionA_caret = positionA.caret) === null || _positionA_caret === undefined ? undefined : _positionA_caret.node) !== ((_positionB_caret = positionB.caret) === null || _positionB_caret === undefined ? undefined : _positionB_caret.node) || ((_positionA_caret1 = positionA.caret) === null || _positionA_caret1 === undefined ? undefined : _positionA_caret1.offset) !== ((_positionB_caret1 = positionB.caret) === null || _positionB_caret1 === undefined ? undefined : _positionB_caret1.offset);
|
|
8
6
|
}
|
|
9
7
|
|
|
10
8
|
exports.isDifferentPointerPosition = isDifferentPointerPosition;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
require('../event/behavior/click.js');
|
|
6
4
|
require('../event/behavior/cut.js');
|
|
7
5
|
require('../event/behavior/keydown.js');
|
|
@@ -9,16 +7,9 @@ require('../event/behavior/keypress.js');
|
|
|
9
7
|
require('../event/behavior/keyup.js');
|
|
10
8
|
require('../event/behavior/paste.js');
|
|
11
9
|
require('@testing-library/dom');
|
|
12
|
-
require('../event/eventMap.js');
|
|
13
|
-
require('../utils/click/isClickableInput.js');
|
|
14
10
|
require('../utils/dataTransfer/Clipboard.js');
|
|
15
11
|
var isEditable = require('../utils/edit/isEditable.js');
|
|
16
|
-
require('../utils/edit/maxLength.js');
|
|
17
12
|
var isDisabled = require('../utils/misc/isDisabled.js');
|
|
18
|
-
require('@testing-library/dom/dist/helpers.js');
|
|
19
|
-
require('../utils/keyDef/readNextDescriptor.js');
|
|
20
|
-
require('../utils/misc/level.js');
|
|
21
|
-
require('../options.js');
|
|
22
13
|
var focus = require('../event/focus.js');
|
|
23
14
|
var input = require('../event/input.js');
|
|
24
15
|
var selectAll = require('../event/selection/selectAll.js');
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var named = require('@testing-library/dom');
|
|
6
|
-
require('../utils/click/isClickableInput.js');
|
|
7
|
-
require('../utils/dataTransfer/Clipboard.js');
|
|
8
|
-
require('../utils/edit/isEditable.js');
|
|
9
|
-
require('../utils/edit/maxLength.js');
|
|
3
|
+
var dom = require('@testing-library/dom');
|
|
10
4
|
var isElementType = require('../utils/misc/isElementType.js');
|
|
5
|
+
require('../utils/dataTransfer/Clipboard.js');
|
|
11
6
|
var isDisabled = require('../utils/misc/isDisabled.js');
|
|
12
|
-
require('@testing-library/dom/dist/helpers.js');
|
|
13
|
-
require('../utils/keyDef/readNextDescriptor.js');
|
|
14
|
-
require('../utils/misc/level.js');
|
|
15
7
|
var wait = require('../utils/misc/wait.js');
|
|
16
8
|
var cssPointerEvents = require('../utils/pointer/cssPointerEvents.js');
|
|
17
9
|
require('../event/behavior/click.js');
|
|
@@ -20,30 +12,8 @@ require('../event/behavior/keydown.js');
|
|
|
20
12
|
require('../event/behavior/keypress.js');
|
|
21
13
|
require('../event/behavior/keyup.js');
|
|
22
14
|
require('../event/behavior/paste.js');
|
|
23
|
-
require('../event/eventMap.js');
|
|
24
15
|
var focus = require('../event/focus.js');
|
|
25
16
|
|
|
26
|
-
function _interopNamespace(e) {
|
|
27
|
-
if (e && e.__esModule) return e;
|
|
28
|
-
var n = Object.create(null);
|
|
29
|
-
if (e) {
|
|
30
|
-
Object.keys(e).forEach(function (k) {
|
|
31
|
-
if (k !== 'default') {
|
|
32
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
33
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
34
|
-
enumerable: true,
|
|
35
|
-
get: function () { return e[k]; }
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
n["default"] = e;
|
|
41
|
-
return Object.freeze(n);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
var named__namespace = /*#__PURE__*/_interopNamespace(named);
|
|
45
|
-
|
|
46
|
-
const { getConfig } = named__namespace;
|
|
47
17
|
async function selectOptions(select, values) {
|
|
48
18
|
return selectOptionsBase.call(this, true, select, values);
|
|
49
19
|
}
|
|
@@ -52,7 +22,7 @@ async function deselectOptions(select, values) {
|
|
|
52
22
|
}
|
|
53
23
|
async function selectOptionsBase(newValue, select, values) {
|
|
54
24
|
if (!newValue && !select.multiple) {
|
|
55
|
-
throw getConfig().getElementError(`Unable to deselect an option in a non-multiple select. Use selectOptions to change the selection instead.`, select);
|
|
25
|
+
throw dom.getConfig().getElementError(`Unable to deselect an option in a non-multiple select. Use selectOptions to change the selection instead.`, select);
|
|
56
26
|
}
|
|
57
27
|
const valArray = Array.isArray(values) ? values : [
|
|
58
28
|
values
|
|
@@ -66,7 +36,7 @@ async function selectOptionsBase(newValue, select, values) {
|
|
|
66
36
|
if (matchingOption) {
|
|
67
37
|
return matchingOption;
|
|
68
38
|
} else {
|
|
69
|
-
throw getConfig().getElementError(`Value "${String(val)}" not found in options`, select);
|
|
39
|
+
throw dom.getConfig().getElementError(`Value "${String(val)}" not found in options`, select);
|
|
70
40
|
}
|
|
71
41
|
}
|
|
72
42
|
}).filter((option)=>!isDisabled.isDisabled(option));
|
|
@@ -128,7 +98,7 @@ async function selectOptionsBase(newValue, select, values) {
|
|
|
128
98
|
}
|
|
129
99
|
await wait.wait(this.config);
|
|
130
100
|
} else {
|
|
131
|
-
throw getConfig().getElementError(`Cannot select multiple options on a non-multiple select`, select);
|
|
101
|
+
throw dom.getConfig().getElementError(`Cannot select multiple options on a non-multiple select`, select);
|
|
132
102
|
}
|
|
133
103
|
} else if (select.getAttribute('role') === 'listbox') {
|
|
134
104
|
for (const option of selectedOptions){
|
|
@@ -136,7 +106,7 @@ async function selectOptionsBase(newValue, select, values) {
|
|
|
136
106
|
await this.unhover(option);
|
|
137
107
|
}
|
|
138
108
|
} else {
|
|
139
|
-
throw getConfig().getElementError(`Cannot select options on elements that are neither select nor listbox elements`, select);
|
|
109
|
+
throw dom.getConfig().getElementError(`Cannot select options on elements that are neither select nor listbox elements`, select);
|
|
140
110
|
}
|
|
141
111
|
}
|
|
142
112
|
|
package/dist/cjs/utility/type.js
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var index = require('../keyboard/index.js');
|
|
6
|
-
require('../utils/click/isClickableInput.js');
|
|
7
4
|
require('../utils/dataTransfer/Clipboard.js');
|
|
8
|
-
require('../utils/edit/isEditable.js');
|
|
9
|
-
require('../utils/edit/maxLength.js');
|
|
10
|
-
require('@testing-library/dom/dist/helpers.js');
|
|
11
|
-
require('../utils/keyDef/readNextDescriptor.js');
|
|
12
|
-
require('../utils/misc/level.js');
|
|
13
|
-
require('../options.js');
|
|
14
5
|
var setSelectionRange = require('../event/selection/setSelectionRange.js');
|
|
15
6
|
|
|
16
7
|
async function type(element, text, { skipClick = this.config.skipClick, skipAutoClose = this.config.skipAutoClose, initialSelectionStart, initialSelectionEnd } = {}) {
|
|
@@ -21,7 +12,7 @@ async function type(element, text, { skipClick = this.config.skipClick, skipAuto
|
|
|
21
12
|
await this.click(element);
|
|
22
13
|
}
|
|
23
14
|
if (initialSelectionStart !== undefined) {
|
|
24
|
-
setSelectionRange.setSelectionRange(element, initialSelectionStart, initialSelectionEnd !== null && initialSelectionEnd !==
|
|
15
|
+
setSelectionRange.setSelectionRange(element, initialSelectionStart, initialSelectionEnd !== null && initialSelectionEnd !== undefined ? initialSelectionEnd : initialSelectionStart);
|
|
25
16
|
}
|
|
26
17
|
await this.keyboard(text);
|
|
27
18
|
if (!skipAutoClose) {
|
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
require('../utils/click/isClickableInput.js');
|
|
3
|
+
var isElementType = require('../utils/misc/isElementType.js');
|
|
6
4
|
var FileList = require('../utils/dataTransfer/FileList.js');
|
|
7
5
|
require('../utils/dataTransfer/Clipboard.js');
|
|
8
|
-
require('../utils/edit/isEditable.js');
|
|
9
|
-
require('../utils/edit/maxLength.js');
|
|
10
6
|
var setFiles = require('../utils/edit/setFiles.js');
|
|
11
|
-
var isElementType = require('../utils/misc/isElementType.js');
|
|
12
7
|
var isDisabled = require('../utils/misc/isDisabled.js');
|
|
13
8
|
var getWindow = require('../utils/misc/getWindow.js');
|
|
14
|
-
require('../utils/keyDef/readNextDescriptor.js');
|
|
15
|
-
require('../utils/misc/level.js');
|
|
16
|
-
require('../options.js');
|
|
17
9
|
|
|
18
10
|
async function upload(element, fileOrFiles) {
|
|
19
11
|
const input = isElementType.isElementType(element, 'label') ? element.control : element;
|
|
20
12
|
if (!input || !isElementType.isElementType(input, 'input', {
|
|
21
13
|
type: 'file'
|
|
22
14
|
})) {
|
|
23
|
-
throw new TypeError(`The ${input === element ? 'given' : 'associated'} ${input === null || input ===
|
|
15
|
+
throw new TypeError(`The ${input === element ? 'given' : 'associated'} ${input === null || input === undefined ? undefined : input.tagName} element does not accept file uploads`);
|
|
24
16
|
}
|
|
25
17
|
if (isDisabled.isDisabled(element)) return;
|
|
26
18
|
const files = (Array.isArray(fileOrFiles) ? fileOrFiles : [
|
|
@@ -29,9 +21,9 @@ async function upload(element, fileOrFiles) {
|
|
|
29
21
|
const fileDialog = ()=>{
|
|
30
22
|
var _input_files;
|
|
31
23
|
// do not fire an input event if the file selection does not change
|
|
32
|
-
if (files.length === ((_input_files = input.files) === null || _input_files ===
|
|
24
|
+
if (files.length === ((_input_files = input.files) === null || _input_files === undefined ? undefined : _input_files.length) && files.every((f, i)=>{
|
|
33
25
|
var _input_files;
|
|
34
|
-
return f === ((_input_files = input.files) === null || _input_files ===
|
|
26
|
+
return f === ((_input_files = input.files) === null || _input_files === undefined ? undefined : _input_files.item(i));
|
|
35
27
|
})) {
|
|
36
28
|
return;
|
|
37
29
|
}
|
|
@@ -1,20 +1,18 @@
|
|
|
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
|
-
var clickableInputTypes
|
|
8
|
-
|
|
9
|
-
clickableInputTypes[
|
|
10
|
-
clickableInputTypes[
|
|
11
|
-
clickableInputTypes[
|
|
12
|
-
clickableInputTypes[
|
|
13
|
-
clickableInputTypes[
|
|
14
|
-
clickableInputTypes[
|
|
15
|
-
clickableInputTypes[
|
|
16
|
-
clickableInputTypes
|
|
17
|
-
}
|
|
5
|
+
var clickableInputTypes = /*#__PURE__*/ function(clickableInputTypes) {
|
|
6
|
+
clickableInputTypes["button"] = "button";
|
|
7
|
+
clickableInputTypes["color"] = "color";
|
|
8
|
+
clickableInputTypes["file"] = "file";
|
|
9
|
+
clickableInputTypes["image"] = "image";
|
|
10
|
+
clickableInputTypes["reset"] = "reset";
|
|
11
|
+
clickableInputTypes["submit"] = "submit";
|
|
12
|
+
clickableInputTypes["checkbox"] = "checkbox";
|
|
13
|
+
clickableInputTypes["radio"] = "radio";
|
|
14
|
+
return clickableInputTypes;
|
|
15
|
+
}(clickableInputTypes || {});
|
|
18
16
|
function isClickableInput(element) {
|
|
19
17
|
return isElementType.isElementType(element, 'button') || isElementType.isElementType(element, 'input') && element.type in clickableInputTypes;
|
|
20
18
|
}
|