@testing-library/user-event 14.5.0 → 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.
Files changed (169) hide show
  1. package/dist/cjs/clipboard/copy.js +0 -3
  2. package/dist/cjs/clipboard/cut.js +0 -3
  3. package/dist/cjs/clipboard/index.js +0 -2
  4. package/dist/cjs/clipboard/paste.js +0 -2
  5. package/dist/cjs/convenience/click.js +0 -2
  6. package/dist/cjs/convenience/hover.js +0 -3
  7. package/dist/cjs/convenience/index.js +0 -2
  8. package/dist/cjs/convenience/tab.js +0 -2
  9. package/dist/cjs/document/UI.js +0 -2
  10. package/dist/cjs/document/copySelection.js +0 -2
  11. package/dist/cjs/document/getValueOrTextContent.js +0 -3
  12. package/dist/cjs/document/index.js +0 -2
  13. package/dist/cjs/document/interceptor.js +3 -8
  14. package/dist/cjs/document/prepareDocument.js +0 -3
  15. package/dist/cjs/document/trackValue.js +2 -4
  16. package/dist/cjs/event/behavior/cut.js +0 -1
  17. package/dist/cjs/event/behavior/index.js +0 -2
  18. package/dist/cjs/event/behavior/keydown.js +2 -3
  19. package/dist/cjs/event/behavior/keypress.js +1 -3
  20. package/dist/cjs/event/behavior/keyup.js +2 -3
  21. package/dist/cjs/event/behavior/paste.js +0 -1
  22. package/dist/cjs/event/behavior/registry.js +0 -2
  23. package/dist/cjs/event/createEvent.js +3 -5
  24. package/dist/cjs/event/dispatchEvent.js +2 -4
  25. package/dist/cjs/event/eventMap.js +200 -15
  26. package/dist/cjs/event/focus.js +1 -7
  27. package/dist/cjs/event/index.js +0 -3
  28. package/dist/cjs/event/input.js +0 -3
  29. package/dist/cjs/event/radio.js +0 -2
  30. package/dist/cjs/event/selection/getInputRange.js +0 -2
  31. package/dist/cjs/event/selection/getTargetTypeAndSelection.js +2 -6
  32. package/dist/cjs/event/selection/index.js +0 -2
  33. package/dist/cjs/event/selection/modifySelection.js +0 -3
  34. package/dist/cjs/event/selection/modifySelectionPerMouse.js +2 -6
  35. package/dist/cjs/event/selection/moveSelection.js +1 -5
  36. package/dist/cjs/event/selection/resolveCaretPosition.js +0 -3
  37. package/dist/cjs/event/selection/selectAll.js +1 -5
  38. package/dist/cjs/event/selection/setSelection.js +0 -3
  39. package/dist/cjs/event/selection/setSelectionPerMouse.js +2 -6
  40. package/dist/cjs/event/selection/setSelectionRange.js +0 -3
  41. package/dist/cjs/event/selection/updateSelectionOnFocus.js +1 -5
  42. package/dist/cjs/event/wrapEvent.js +2 -5
  43. package/dist/cjs/index.js +2 -2
  44. package/dist/cjs/keyboard/index.js +0 -3
  45. package/dist/cjs/keyboard/keyMap.js +0 -2
  46. package/dist/cjs/keyboard/parseKeyDef.js +0 -3
  47. package/dist/cjs/options.js +5 -7
  48. package/dist/cjs/pointer/index.js +4 -7
  49. package/dist/cjs/pointer/keyMap.js +0 -2
  50. package/dist/cjs/pointer/parseKeyDef.js +0 -3
  51. package/dist/cjs/setup/api.js +0 -2
  52. package/dist/cjs/setup/directApi.js +0 -2
  53. package/dist/cjs/setup/index.js +0 -2
  54. package/dist/cjs/setup/setup.js +0 -3
  55. package/dist/cjs/setup/wrapAsync.js +2 -5
  56. package/dist/cjs/system/index.js +0 -2
  57. package/dist/cjs/system/keyboard.js +0 -3
  58. package/dist/cjs/system/pointer/buttons.js +0 -2
  59. package/dist/cjs/system/pointer/device.js +0 -2
  60. package/dist/cjs/system/pointer/index.js +12 -17
  61. package/dist/cjs/system/pointer/mouse.js +0 -4
  62. package/dist/cjs/system/pointer/pointer.js +0 -3
  63. package/dist/cjs/system/pointer/shared.js +0 -2
  64. package/dist/cjs/utility/clear.js +0 -4
  65. package/dist/cjs/utility/index.js +0 -2
  66. package/dist/cjs/utility/selectOptions.js +5 -10
  67. package/dist/cjs/utility/type.js +0 -3
  68. package/dist/cjs/utility/upload.js +1 -4
  69. package/dist/cjs/utils/click/isClickableInput.js +8 -10
  70. package/dist/cjs/utils/dataTransfer/Blob.js +0 -2
  71. package/dist/cjs/utils/dataTransfer/Clipboard.js +2 -6
  72. package/dist/cjs/utils/dataTransfer/DataTransfer.js +1 -4
  73. package/dist/cjs/utils/dataTransfer/FileList.js +0 -2
  74. package/dist/cjs/utils/edit/isContentEditable.js +0 -2
  75. package/dist/cjs/utils/edit/isEditable.js +12 -14
  76. package/dist/cjs/utils/edit/maxLength.js +6 -8
  77. package/dist/cjs/utils/edit/setFiles.js +2 -4
  78. package/dist/cjs/utils/edit/timeValue.js +0 -2
  79. package/dist/cjs/utils/focus/cursor.js +0 -2
  80. package/dist/cjs/utils/focus/getActiveElement.js +1 -4
  81. package/dist/cjs/utils/focus/getTabDestination.js +0 -2
  82. package/dist/cjs/utils/focus/isFocusable.js +0 -2
  83. package/dist/cjs/utils/focus/selection.js +0 -2
  84. package/dist/cjs/utils/focus/selector.js +0 -2
  85. package/dist/cjs/utils/index.js +1 -3
  86. package/dist/cjs/utils/keyDef/readNextDescriptor.js +2 -4
  87. package/dist/cjs/utils/misc/cloneEvent.js +0 -2
  88. package/dist/cjs/utils/misc/findClosest.js +0 -2
  89. package/dist/cjs/utils/misc/getDocumentFromNode.js +0 -2
  90. package/dist/cjs/utils/misc/getTreeDiff.js +0 -2
  91. package/dist/cjs/utils/misc/getWindow.js +13 -6
  92. package/dist/cjs/utils/misc/isDescendantOrSelf.js +0 -2
  93. package/dist/cjs/utils/misc/isDisabled.js +0 -2
  94. package/dist/cjs/utils/misc/isElementType.js +0 -2
  95. package/dist/cjs/utils/misc/isVisible.js +1 -4
  96. package/dist/cjs/utils/misc/level.js +0 -2
  97. package/dist/cjs/utils/misc/wait.js +0 -2
  98. package/dist/cjs/utils/pointer/cssPointerEvents.js +7 -13
  99. package/dist/esm/clipboard/copy.js +0 -1
  100. package/dist/esm/clipboard/cut.js +0 -1
  101. package/dist/esm/convenience/hover.js +0 -1
  102. package/dist/esm/document/getValueOrTextContent.js +0 -1
  103. package/dist/esm/document/interceptor.js +3 -6
  104. package/dist/esm/document/prepareDocument.js +0 -1
  105. package/dist/esm/document/trackValue.js +2 -2
  106. package/dist/esm/event/behavior/cut.js +0 -1
  107. package/dist/esm/event/behavior/keydown.js +2 -3
  108. package/dist/esm/event/behavior/keypress.js +1 -3
  109. package/dist/esm/event/behavior/keyup.js +2 -3
  110. package/dist/esm/event/behavior/paste.js +0 -1
  111. package/dist/esm/event/createEvent.js +4 -4
  112. package/dist/esm/event/dispatchEvent.js +2 -2
  113. package/dist/esm/event/eventMap.js +201 -13
  114. package/dist/esm/event/focus.js +1 -5
  115. package/dist/esm/event/index.js +0 -1
  116. package/dist/esm/event/input.js +0 -1
  117. package/dist/esm/event/selection/getTargetTypeAndSelection.js +2 -4
  118. package/dist/esm/event/selection/modifySelection.js +0 -1
  119. package/dist/esm/event/selection/modifySelectionPerMouse.js +2 -4
  120. package/dist/esm/event/selection/moveSelection.js +1 -3
  121. package/dist/esm/event/selection/resolveCaretPosition.js +0 -1
  122. package/dist/esm/event/selection/selectAll.js +1 -3
  123. package/dist/esm/event/selection/setSelection.js +0 -1
  124. package/dist/esm/event/selection/setSelectionPerMouse.js +2 -4
  125. package/dist/esm/event/selection/setSelectionRange.js +0 -1
  126. package/dist/esm/event/selection/updateSelectionOnFocus.js +1 -3
  127. package/dist/esm/event/wrapEvent.js +1 -2
  128. package/dist/esm/keyboard/index.js +0 -1
  129. package/dist/esm/keyboard/parseKeyDef.js +0 -1
  130. package/dist/esm/options.js +5 -5
  131. package/dist/esm/pointer/index.js +4 -5
  132. package/dist/esm/pointer/parseKeyDef.js +0 -1
  133. package/dist/esm/setup/setup.js +0 -1
  134. package/dist/esm/setup/wrapAsync.js +1 -2
  135. package/dist/esm/system/keyboard.js +0 -1
  136. package/dist/esm/system/pointer/index.js +12 -15
  137. package/dist/esm/system/pointer/mouse.js +0 -2
  138. package/dist/esm/system/pointer/pointer.js +0 -1
  139. package/dist/esm/utility/clear.js +0 -2
  140. package/dist/esm/utility/selectOptions.js +1 -4
  141. package/dist/esm/utility/type.js +0 -1
  142. package/dist/esm/utility/upload.js +1 -2
  143. package/dist/esm/utils/click/isClickableInput.js +8 -8
  144. package/dist/esm/utils/dataTransfer/Clipboard.js +2 -4
  145. package/dist/esm/utils/dataTransfer/DataTransfer.js +1 -2
  146. package/dist/esm/utils/edit/isEditable.js +12 -12
  147. package/dist/esm/utils/edit/maxLength.js +6 -6
  148. package/dist/esm/utils/edit/setFiles.js +2 -2
  149. package/dist/esm/utils/focus/getActiveElement.js +1 -2
  150. package/dist/esm/utils/keyDef/readNextDescriptor.js +2 -2
  151. package/dist/esm/utils/misc/getWindow.js +13 -4
  152. package/dist/esm/utils/misc/isVisible.js +1 -2
  153. package/dist/esm/utils/pointer/cssPointerEvents.js +7 -11
  154. package/dist/types/event/eventMap.d.ts +174 -333
  155. package/dist/types/event/types.d.ts +2 -1
  156. package/package.json +15 -4
  157. package/dist/cjs/_interop/dom-events.d.js +0 -2
  158. package/dist/cjs/_interop/dom-helpers.d.js +0 -2
  159. package/dist/cjs/_interop/dtl.js +0 -30
  160. package/dist/cjs/_interop/dtlEventMap.js +0 -30
  161. package/dist/cjs/_interop/dtlHelpers.js +0 -30
  162. package/dist/esm/_interop/dom-events.d.js +0 -1
  163. package/dist/esm/_interop/dom-helpers.d.js +0 -1
  164. package/dist/esm/_interop/dtl.js +0 -6
  165. package/dist/esm/_interop/dtlEventMap.js +0 -6
  166. package/dist/esm/_interop/dtlHelpers.js +0 -6
  167. package/dist/types/_interop/dtl.d.ts +0 -3
  168. package/dist/types/_interop/dtlEventMap.d.ts +0 -3
  169. package/dist/types/_interop/dtlHelpers.d.ts +0 -3
@@ -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 { hasOwnSelection } from '../../utils/focus/selection.js';
8
7
  import '../../utils/keyDef/readNextDescriptor.js';
9
8
  import '../../utils/misc/level.js';
@@ -3,7 +3,6 @@ import '../../utils/dataTransfer/Clipboard.js';
3
3
  import { getContentEditable } 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 { hasOwnSelection } from '../../utils/focus/selection.js';
8
7
  import '../../utils/keyDef/readNextDescriptor.js';
9
8
  import '../../utils/misc/level.js';
@@ -13,9 +12,8 @@ import '../../options.js';
13
12
  * Reset the Document Selection when moving focus into an element
14
13
  * with own selection implementation.
15
14
  */ function updateSelectionOnFocus(element) {
16
- var _selection;
17
15
  const selection = element.ownerDocument.getSelection();
18
- /* istanbul ignore if */ if (!((_selection = selection) === null || _selection === void 0 ? void 0 : _selection.focusNode)) {
16
+ /* istanbul ignore if */ if (!(selection === null || selection === void 0 ? void 0 : selection.focusNode)) {
19
17
  return;
20
18
  }
21
19
  // If the focus moves inside an element with own selection implementation,
@@ -1,6 +1,5 @@
1
- import dtl from '../_interop/dtl.js';
1
+ import { getConfig } from '@testing-library/dom';
2
2
 
3
- const { getConfig } = dtl;
4
3
  function wrapEvent(cb, _element) {
5
4
  return getConfig().eventWrapper(cb);
6
5
  }
@@ -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 { wait } from '../utils/misc/wait.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 { readNextDescriptor } from '../utils/keyDef/readNextDescriptor.js';
7
6
  import '../utils/misc/level.js';
8
7
  import '../options.js';
@@ -1,12 +1,12 @@
1
1
  var PointerEventsCheckLevel;
2
2
  (function(PointerEventsCheckLevel) {
3
- PointerEventsCheckLevel[PointerEventsCheckLevel[/**
3
+ /**
4
4
  * Check pointer events on every user interaction that triggers a bunch of events.
5
5
  * E.g. once for releasing a mouse button even though this triggers `pointerup`, `mouseup`, `click`, etc...
6
- */ "EachTrigger"] = 4] = "EachTrigger";
7
- PointerEventsCheckLevel[PointerEventsCheckLevel[/** Check each target once per call to pointer (related) API */ "EachApiCall"] = 2] = "EachApiCall";
8
- PointerEventsCheckLevel[PointerEventsCheckLevel[/** Check each event target once */ "EachTarget"] = 1] = "EachTarget";
9
- PointerEventsCheckLevel[PointerEventsCheckLevel[/** No pointer events check */ "Never"] = 0] = "Never";
6
+ */ PointerEventsCheckLevel[PointerEventsCheckLevel["EachTrigger"] = 4] = "EachTrigger";
7
+ /** Check each target once per call to pointer (related) API */ PointerEventsCheckLevel[PointerEventsCheckLevel["EachApiCall"] = 2] = "EachApiCall";
8
+ /** Check each event target once */ PointerEventsCheckLevel[PointerEventsCheckLevel["EachTarget"] = 1] = "EachTarget";
9
+ /** No pointer events check */ PointerEventsCheckLevel[PointerEventsCheckLevel["Never"] = 0] = "Never";
10
10
  })(PointerEventsCheckLevel || (PointerEventsCheckLevel = {}));
11
11
 
12
12
  export { PointerEventsCheckLevel };
@@ -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 { setLevelRef, ApiLevel } from '../utils/misc/level.js';
8
7
  import { wait } from '../utils/misc/wait.js';
@@ -33,16 +32,16 @@ async function pointer(input) {
33
32
  this.system.pointer.resetClickCount();
34
33
  }
35
34
  async function pointerAction(instance, action) {
36
- var _previousPosition, _previousPosition_caret, _previousPosition1, _previousPosition_caret1, _previousPosition2;
35
+ var _previousPosition_caret, _previousPosition_caret1;
37
36
  const pointerName = 'pointerName' in action && action.pointerName ? action.pointerName : 'keyDef' in action ? instance.system.pointer.getPointerName(action.keyDef) : 'mouse';
38
37
  const previousPosition = instance.system.pointer.getPreviousPosition(pointerName);
39
38
  var _action_target, _action_coords, _action_node, _action_offset;
40
39
  const position = {
41
40
  target: (_action_target = action.target) !== null && _action_target !== void 0 ? _action_target : getPrevTarget(instance, previousPosition),
42
- coords: (_action_coords = action.coords) !== null && _action_coords !== void 0 ? _action_coords : (_previousPosition = previousPosition) === null || _previousPosition === void 0 ? void 0 : _previousPosition.coords,
41
+ coords: (_action_coords = action.coords) !== null && _action_coords !== void 0 ? _action_coords : previousPosition === null || previousPosition === void 0 ? void 0 : previousPosition.coords,
43
42
  caret: {
44
- node: (_action_node = action.node) !== null && _action_node !== void 0 ? _action_node : hasCaretPosition(action) ? undefined : (_previousPosition1 = previousPosition) === null || _previousPosition1 === void 0 ? void 0 : (_previousPosition_caret = _previousPosition1.caret) === null || _previousPosition_caret === void 0 ? void 0 : _previousPosition_caret.node,
45
- offset: (_action_offset = action.offset) !== null && _action_offset !== void 0 ? _action_offset : hasCaretPosition(action) ? undefined : (_previousPosition2 = previousPosition) === null || _previousPosition2 === void 0 ? void 0 : (_previousPosition_caret1 = _previousPosition2.caret) === null || _previousPosition_caret1 === void 0 ? void 0 : _previousPosition_caret1.offset
43
+ node: (_action_node = action.node) !== null && _action_node !== void 0 ? _action_node : hasCaretPosition(action) ? undefined : previousPosition === null || previousPosition === void 0 ? void 0 : (_previousPosition_caret = previousPosition.caret) === null || _previousPosition_caret === void 0 ? void 0 : _previousPosition_caret.node,
44
+ offset: (_action_offset = action.offset) !== null && _action_offset !== void 0 ? _action_offset : hasCaretPosition(action) ? undefined : previousPosition === null || previousPosition === void 0 ? void 0 : (_previousPosition_caret1 = previousPosition.caret) === null || _previousPosition_caret1 === void 0 ? void 0 : _previousPosition_caret1.offset
46
45
  }
47
46
  };
48
47
  if ('keyDef' in action) {
@@ -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 { readNextDescriptor } from '../utils/keyDef/readNextDescriptor.js';
7
6
  import '../utils/misc/level.js';
8
7
  import '../options.js';
@@ -4,7 +4,6 @@ import '../utils/click/isClickableInput.js';
4
4
  import { attachClipboardStubToView } from '../utils/dataTransfer/Clipboard.js';
5
5
  import '../utils/edit/isEditable.js';
6
6
  import '../utils/edit/maxLength.js';
7
- import '@testing-library/dom/dist/helpers.js';
8
7
  import '../utils/keyDef/readNextDescriptor.js';
9
8
  import { getDocumentFromNode } from '../utils/misc/getDocumentFromNode.js';
10
9
  import { setLevelRef, ApiLevel } from '../utils/misc/level.js';
@@ -1,6 +1,5 @@
1
- import dtl from '../_interop/dtl.js';
1
+ import { getConfig } from '@testing-library/dom';
2
2
 
3
- const { getConfig } = dtl;
4
3
  /**
5
4
  * Wrap an internal Promise
6
5
  */ function wrapAsync(implementation) {
@@ -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 { getActiveElementOrBody } from '../utils/focus/getActiveElement.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';
@@ -36,7 +36,6 @@ class PointerHost {
36
36
  }
37
37
  }
38
38
  async move(instance, pointerName, position) {
39
- var _pointermove, _mousemove, _pointermove1, _mousemove1, _pointermove2, _mousemove2;
40
39
  const pointer = this.pointers.get(pointerName);
41
40
  // In (some?) browsers this order of events can be observed.
42
41
  // This interweaving of events is probably unnecessary.
@@ -44,12 +43,12 @@ class PointerHost {
44
43
  // the order in which they interweave/follow on a user interaction depends on the implementation.
45
44
  const pointermove = pointer.move(instance, position);
46
45
  const mousemove = pointer.pointerType === 'touch' || pointer.isPrevented && pointer.isDown ? undefined : this.mouse.move(instance, position);
47
- (_pointermove = pointermove) === null || _pointermove === void 0 ? void 0 : _pointermove.leave();
48
- (_mousemove = mousemove) === null || _mousemove === void 0 ? void 0 : _mousemove.leave();
49
- (_pointermove1 = pointermove) === null || _pointermove1 === void 0 ? void 0 : _pointermove1.enter();
50
- (_mousemove1 = mousemove) === null || _mousemove1 === void 0 ? void 0 : _mousemove1.enter();
51
- (_pointermove2 = pointermove) === null || _pointermove2 === void 0 ? void 0 : _pointermove2.move();
52
- (_mousemove2 = mousemove) === null || _mousemove2 === void 0 ? void 0 : _mousemove2.move();
46
+ pointermove === null || pointermove === void 0 ? void 0 : pointermove.leave();
47
+ mousemove === null || mousemove === void 0 ? void 0 : mousemove.leave();
48
+ pointermove === null || pointermove === void 0 ? void 0 : pointermove.enter();
49
+ mousemove === null || mousemove === void 0 ? void 0 : mousemove.enter();
50
+ pointermove === null || pointermove === void 0 ? void 0 : pointermove.move();
51
+ mousemove === null || mousemove === void 0 ? void 0 : mousemove.move();
53
52
  }
54
53
  async release(instance, keyDef, position) {
55
54
  const device = this.devices.get(keyDef.pointerType);
@@ -69,19 +68,17 @@ class PointerHost {
69
68
  }
70
69
  if (!pointer.isPrevented) {
71
70
  if (pointer.pointerType === 'touch' && !pointer.isMultitouch) {
72
- var _mousemove, _mousemove1, _mousemove2;
73
71
  const mousemove = this.mouse.move(instance, pointer.position);
74
- (_mousemove = mousemove) === null || _mousemove === void 0 ? void 0 : _mousemove.leave();
75
- (_mousemove1 = mousemove) === null || _mousemove1 === void 0 ? void 0 : _mousemove1.enter();
76
- (_mousemove2 = mousemove) === null || _mousemove2 === void 0 ? void 0 : _mousemove2.move();
72
+ mousemove === null || mousemove === void 0 ? void 0 : mousemove.leave();
73
+ mousemove === null || mousemove === void 0 ? void 0 : mousemove.enter();
74
+ mousemove === null || mousemove === void 0 ? void 0 : mousemove.move();
77
75
  this.mouse.down(instance, keyDef, pointer);
78
76
  }
79
77
  if (!pointer.isMultitouch) {
80
- var _mousemove3, _mousemove4, _mousemove5;
81
78
  const mousemove = this.mouse.move(instance, pointer.position);
82
- (_mousemove3 = mousemove) === null || _mousemove3 === void 0 ? void 0 : _mousemove3.leave();
83
- (_mousemove4 = mousemove) === null || _mousemove4 === void 0 ? void 0 : _mousemove4.enter();
84
- (_mousemove5 = mousemove) === null || _mousemove5 === void 0 ? void 0 : _mousemove5.move();
79
+ mousemove === null || mousemove === void 0 ? void 0 : mousemove.leave();
80
+ mousemove === null || mousemove === void 0 ? void 0 : mousemove.enter();
81
+ mousemove === null || mousemove === void 0 ? void 0 : mousemove.move();
85
82
  this.mouse.up(instance, keyDef, pointer);
86
83
  }
87
84
  }
@@ -5,13 +5,11 @@ import '../../event/behavior/keypress.js';
5
5
  import '../../event/behavior/keyup.js';
6
6
  import '../../event/behavior/paste.js';
7
7
  import '@testing-library/dom';
8
- import '../../event/eventMap.js';
9
8
  import '../../utils/click/isClickableInput.js';
10
9
  import '../../utils/dataTransfer/Clipboard.js';
11
10
  import '../../utils/edit/isEditable.js';
12
11
  import '../../utils/edit/maxLength.js';
13
12
  import { isDisabled } from '../../utils/misc/isDisabled.js';
14
- import '@testing-library/dom/dist/helpers.js';
15
13
  import '../../utils/keyDef/readNextDescriptor.js';
16
14
  import { getTreeDiff } from '../../utils/misc/getTreeDiff.js';
17
15
  import '../../utils/misc/level.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 { getTreeDiff } from '../../utils/misc/getTreeDiff.js';
8
7
  import '../../utils/misc/level.js';
@@ -5,13 +5,11 @@ import '../event/behavior/keypress.js';
5
5
  import '../event/behavior/keyup.js';
6
6
  import '../event/behavior/paste.js';
7
7
  import '@testing-library/dom';
8
- import '../event/eventMap.js';
9
8
  import '../utils/click/isClickableInput.js';
10
9
  import '../utils/dataTransfer/Clipboard.js';
11
10
  import { isEditable } from '../utils/edit/isEditable.js';
12
11
  import '../utils/edit/maxLength.js';
13
12
  import { isDisabled } from '../utils/misc/isDisabled.js';
14
- import '@testing-library/dom/dist/helpers.js';
15
13
  import '../utils/keyDef/readNextDescriptor.js';
16
14
  import '../utils/misc/level.js';
17
15
  import '../options.js';
@@ -1,11 +1,10 @@
1
- import dtl from '../_interop/dtl.js';
1
+ import { getConfig } from '@testing-library/dom';
2
2
  import '../utils/click/isClickableInput.js';
3
3
  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
7
  import { isDisabled } from '../utils/misc/isDisabled.js';
8
- import '@testing-library/dom/dist/helpers.js';
9
8
  import '../utils/keyDef/readNextDescriptor.js';
10
9
  import '../utils/misc/level.js';
11
10
  import { wait } from '../utils/misc/wait.js';
@@ -16,10 +15,8 @@ import '../event/behavior/keydown.js';
16
15
  import '../event/behavior/keypress.js';
17
16
  import '../event/behavior/keyup.js';
18
17
  import '../event/behavior/paste.js';
19
- import '../event/eventMap.js';
20
18
  import { focusElement } from '../event/focus.js';
21
19
 
22
- const { getConfig } = dtl;
23
20
  async function selectOptions(select, values) {
24
21
  return selectOptionsBase.call(this, true, select, values);
25
22
  }
@@ -3,7 +3,6 @@ import '../utils/click/isClickableInput.js';
3
3
  import '../utils/dataTransfer/Clipboard.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';
@@ -16,8 +16,7 @@ async function upload(element, fileOrFiles) {
16
16
  if (!input || !isElementType(input, 'input', {
17
17
  type: 'file'
18
18
  })) {
19
- var _input;
20
- throw new TypeError(`The ${input === element ? 'given' : 'associated'} ${(_input = input) === null || _input === void 0 ? void 0 : _input.tagName} element does not accept file uploads`);
19
+ throw new TypeError(`The ${input === element ? 'given' : 'associated'} ${input === null || input === void 0 ? void 0 : input.tagName} element does not accept file uploads`);
21
20
  }
22
21
  if (isDisabled(element)) return;
23
22
  const files = (Array.isArray(fileOrFiles) ? fileOrFiles : [
@@ -2,14 +2,14 @@ import { isElementType } from '../misc/isElementType.js';
2
2
 
3
3
  var clickableInputTypes;
4
4
  (function(clickableInputTypes) {
5
- clickableInputTypes['button'] = 'button';
6
- clickableInputTypes['color'] = 'color';
7
- clickableInputTypes['file'] = 'file';
8
- clickableInputTypes['image'] = 'image';
9
- clickableInputTypes['reset'] = 'reset';
10
- clickableInputTypes['submit'] = 'submit';
11
- clickableInputTypes['checkbox'] = 'checkbox';
12
- clickableInputTypes['radio'] = 'radio';
5
+ clickableInputTypes["button"] = "button";
6
+ clickableInputTypes["color"] = "color";
7
+ clickableInputTypes["file"] = "file";
8
+ clickableInputTypes["image"] = "image";
9
+ clickableInputTypes["reset"] = "reset";
10
+ clickableInputTypes["submit"] = "submit";
11
+ clickableInputTypes["checkbox"] = "checkbox";
12
+ clickableInputTypes["radio"] = "radio";
13
13
  })(clickableInputTypes || (clickableInputTypes = {}));
14
14
  function isClickableInput(element) {
15
15
  return isElementType(element, 'button') || isElementType(element, 'input') && element.type in clickableInputTypes;
@@ -82,8 +82,7 @@ function createClipboardStub(window, control) {
82
82
  });
83
83
  }
84
84
  function isClipboardStub(clipboard) {
85
- var _clipboard;
86
- return !!((_clipboard = clipboard) === null || _clipboard === void 0 ? void 0 : _clipboard[ClipboardStubControl]);
85
+ return !!(clipboard === null || clipboard === void 0 ? void 0 : clipboard[ClipboardStubControl]);
87
86
  }
88
87
  function attachClipboardStubToView(window) {
89
88
  if (isClipboardStub(window.navigator.clipboard)) {
@@ -124,9 +123,8 @@ function detachClipboardStubFromView(window) {
124
123
  }
125
124
  }
126
125
  async function readDataTransferFromClipboard(document) {
127
- var _window;
128
126
  const window = document.defaultView;
129
- const clipboard = (_window = window) === null || _window === void 0 ? void 0 : _window.navigator.clipboard;
127
+ const clipboard = window === null || window === void 0 ? void 0 : window.navigator.clipboard;
130
128
  const items = clipboard && await clipboard.read();
131
129
  if (!items) {
132
130
  throw new Error('The Clipboard API is unavailable.');
@@ -66,11 +66,10 @@ function getTypeMatcher(type, exact) {
66
66
  function createDataTransferStub(window) {
67
67
  return new class DataTransferStub {
68
68
  getData(format) {
69
- var _match;
70
69
  var _this_items_find;
71
70
  const match = (_this_items_find = this.items.find(getTypeMatcher(format, true))) !== null && _this_items_find !== void 0 ? _this_items_find : this.items.find(getTypeMatcher(format, false));
72
71
  let text = '';
73
- (_match = match) === null || _match === void 0 ? void 0 : _match.getAsString((t)=>{
72
+ match === null || match === void 0 ? void 0 : match.getAsString((t)=>{
74
73
  text = t;
75
74
  });
76
75
  return text;
@@ -6,18 +6,18 @@ function isEditable(element) {
6
6
  }
7
7
  var editableInputTypes;
8
8
  (function(editableInputTypes) {
9
- editableInputTypes['text'] = 'text';
10
- editableInputTypes['date'] = 'date';
11
- editableInputTypes['datetime-local'] = 'datetime-local';
12
- editableInputTypes['email'] = 'email';
13
- editableInputTypes['month'] = 'month';
14
- editableInputTypes['number'] = 'number';
15
- editableInputTypes['password'] = 'password';
16
- editableInputTypes['search'] = 'search';
17
- editableInputTypes['tel'] = 'tel';
18
- editableInputTypes['time'] = 'time';
19
- editableInputTypes['url'] = 'url';
20
- editableInputTypes['week'] = 'week';
9
+ editableInputTypes["text"] = "text";
10
+ editableInputTypes["date"] = "date";
11
+ editableInputTypes["datetime-local"] = "datetime-local";
12
+ editableInputTypes["email"] = "email";
13
+ editableInputTypes["month"] = "month";
14
+ editableInputTypes["number"] = "number";
15
+ editableInputTypes["password"] = "password";
16
+ editableInputTypes["search"] = "search";
17
+ editableInputTypes["tel"] = "tel";
18
+ editableInputTypes["time"] = "time";
19
+ editableInputTypes["url"] = "url";
20
+ editableInputTypes["week"] = "week";
21
21
  })(editableInputTypes || (editableInputTypes = {}));
22
22
  function isEditableInputOrTextArea(element) {
23
23
  return isElementType(element, 'textarea') || isElementType(element, 'input') && element.type in editableInputTypes;
@@ -2,12 +2,12 @@ import { isElementType } from '../misc/isElementType.js';
2
2
 
3
3
  var maxLengthSupportedTypes;
4
4
  (function(maxLengthSupportedTypes) {
5
- maxLengthSupportedTypes['email'] = 'email';
6
- maxLengthSupportedTypes['password'] = 'password';
7
- maxLengthSupportedTypes['search'] = 'search';
8
- maxLengthSupportedTypes['telephone'] = 'telephone';
9
- maxLengthSupportedTypes['text'] = 'text';
10
- maxLengthSupportedTypes['url'] = 'url';
5
+ maxLengthSupportedTypes["email"] = "email";
6
+ maxLengthSupportedTypes["password"] = "password";
7
+ maxLengthSupportedTypes["search"] = "search";
8
+ maxLengthSupportedTypes["telephone"] = "telephone";
9
+ maxLengthSupportedTypes["text"] = "text";
10
+ maxLengthSupportedTypes["url"] = "url";
11
11
  })(maxLengthSupportedTypes || (maxLengthSupportedTypes = {}));
12
12
  // can't use .maxLength property because of a jsdom bug:
13
13
  // https://github.com/jsdom/jsdom/issues/2927
@@ -36,8 +36,8 @@ function setFiles(el, files) {
36
36
  if (v === '') {
37
37
  restore();
38
38
  } else {
39
- var _valueDescr_set, _valueDescr;
40
- (_valueDescr = valueDescr) === null || _valueDescr === void 0 ? void 0 : (_valueDescr_set = _valueDescr.set) === null || _valueDescr_set === void 0 ? void 0 : _valueDescr_set.call(el, v);
39
+ var _valueDescr_set;
40
+ valueDescr === null || valueDescr === void 0 ? void 0 : (_valueDescr_set = valueDescr.set) === null || _valueDescr_set === void 0 ? void 0 : _valueDescr_set.call(el, v);
41
41
  }
42
42
  }
43
43
  },
@@ -1,9 +1,8 @@
1
1
  import { isDisabled } from '../misc/isDisabled.js';
2
2
 
3
3
  function getActiveElement(document) {
4
- var _activeElement;
5
4
  const activeElement = document.activeElement;
6
- if ((_activeElement = activeElement) === null || _activeElement === void 0 ? void 0 : _activeElement.shadowRoot) {
5
+ if (activeElement === null || activeElement === void 0 ? void 0 : activeElement.shadowRoot) {
7
6
  return getActiveElement(activeElement.shadowRoot);
8
7
  } else {
9
8
  // Browser does not yield disabled elements as document.activeElement - jsdom does
@@ -1,7 +1,7 @@
1
1
  var bracketDict;
2
2
  (function(bracketDict) {
3
- bracketDict['{'] = '}';
4
- bracketDict['['] = ']';
3
+ bracketDict["{"] = "}";
4
+ bracketDict["["] = "]";
5
5
  })(bracketDict || (bracketDict = {}));
6
6
  /**
7
7
  * Read the next key definition from user input
@@ -1,8 +1,17 @@
1
- import dtlHelpers from '../../_interop/dtlHelpers.js';
2
-
3
- const { getWindowFromNode } = dtlHelpers;
4
1
  function getWindow(node) {
5
- return getWindowFromNode(node);
2
+ var _node_ownerDocument;
3
+ if (isDocument(node) && node.defaultView) {
4
+ return node.defaultView;
5
+ } else if ((_node_ownerDocument = node.ownerDocument) === null || _node_ownerDocument === void 0 ? void 0 : _node_ownerDocument.defaultView) {
6
+ return node.ownerDocument.defaultView;
7
+ }
8
+ throw new Error(`Could not determine window of node. Node was ${describe(node)}`);
9
+ }
10
+ function isDocument(node) {
11
+ return node.nodeType === 9;
12
+ }
13
+ function describe(val) {
14
+ return typeof val === 'function' ? `function ${val.name}` : val === null ? 'null' : String(val);
6
15
  }
7
16
 
8
17
  export { getWindow };
@@ -1,9 +1,8 @@
1
1
  import { getWindow } from './getWindow.js';
2
2
 
3
3
  function isVisible(element) {
4
- var _el;
5
4
  const window = getWindow(element);
6
- for(let el = element; (_el = el) === null || _el === void 0 ? void 0 : _el.ownerDocument; el = el.parentElement){
5
+ for(let el = element; el === null || el === void 0 ? void 0 : el.ownerDocument; el = el.parentElement){
7
6
  const { display, visibility } = window.getComputedStyle(el);
8
7
  if (display === 'none') {
9
8
  return false;
@@ -8,9 +8,8 @@ function hasPointerEvents(instance, element) {
8
8
  return ((_checkPointerEvents = checkPointerEvents(instance, element)) === null || _checkPointerEvents === void 0 ? void 0 : _checkPointerEvents.pointerEvents) !== 'none';
9
9
  }
10
10
  function closestPointerEventsDeclaration(element) {
11
- var _el;
12
11
  const window = getWindow(element);
13
- for(let el = element, tree = []; (_el = el) === null || _el === void 0 ? void 0 : _el.ownerDocument; el = el.parentElement){
12
+ for(let el = element, tree = []; el === null || el === void 0 ? void 0 : el.ownerDocument; el = el.parentElement){
14
13
  tree.push(el);
15
14
  const pointerEvents = window.getComputedStyle(el).pointerEvents;
16
15
  if (pointerEvents && ![
@@ -30,8 +29,7 @@ function checkPointerEvents(instance, element) {
30
29
  const lastCheck = element[PointerEventsCheck];
31
30
  const needsCheck = instance.config.pointerEventsCheck !== PointerEventsCheckLevel.Never && (!lastCheck || hasBitFlag(instance.config.pointerEventsCheck, PointerEventsCheckLevel.EachApiCall) && lastCheck[ApiLevel.Call] !== getLevelRef(instance, ApiLevel.Call) || hasBitFlag(instance.config.pointerEventsCheck, PointerEventsCheckLevel.EachTrigger) && lastCheck[ApiLevel.Trigger] !== getLevelRef(instance, ApiLevel.Trigger));
32
31
  if (!needsCheck) {
33
- var _lastCheck;
34
- return (_lastCheck = lastCheck) === null || _lastCheck === void 0 ? void 0 : _lastCheck.result;
32
+ return lastCheck === null || lastCheck === void 0 ? void 0 : lastCheck.result;
35
33
  }
36
34
  const declaration = closestPointerEventsDeclaration(element);
37
35
  element[PointerEventsCheck] = {
@@ -42,9 +40,8 @@ function checkPointerEvents(instance, element) {
42
40
  return declaration;
43
41
  }
44
42
  function assertPointerEvents(instance, element) {
45
- var _declaration;
46
43
  const declaration = checkPointerEvents(instance, element);
47
- if (((_declaration = declaration) === null || _declaration === void 0 ? void 0 : _declaration.pointerEvents) === 'none') {
44
+ if ((declaration === null || declaration === void 0 ? void 0 : declaration.pointerEvents) === 'none') {
48
45
  throw new Error([
49
46
  `Unable to perform pointer interaction as the element ${declaration.tree.length > 1 ? 'inherits' : 'has'} \`pointer-events: none\`:`,
50
47
  '',
@@ -64,7 +61,7 @@ function printTree(tree) {
64
61
  ].filter(Boolean).join('')).join('\n');
65
62
  }
66
63
  function getLabelDescr(element) {
67
- var _element_labels, _label, _label1;
64
+ var _element_labels;
68
65
  let label;
69
66
  if (element.hasAttribute('aria-label')) {
70
67
  label = element.getAttribute('aria-label');
@@ -88,10 +85,9 @@ function getLabelDescr(element) {
88
85
  var _element_textContent;
89
86
  label = (_element_textContent = element.textContent) === null || _element_textContent === void 0 ? void 0 : _element_textContent.trim();
90
87
  }
91
- label = (_label = label) === null || _label === void 0 ? void 0 : _label.replace(/\n/g, ' ');
92
- if (Number((_label1 = label) === null || _label1 === void 0 ? void 0 : _label1.length) > 30) {
93
- var _label2;
94
- label = `${(_label2 = label) === null || _label2 === void 0 ? void 0 : _label2.substring(0, 29)}…`;
88
+ label = label === null || label === void 0 ? void 0 : label.replace(/\n/g, ' ');
89
+ if (Number(label === null || label === void 0 ? void 0 : label.length) > 30) {
90
+ label = `${label === null || label === void 0 ? void 0 : label.substring(0, 29)}…`;
95
91
  }
96
92
  return label ? `(label=${label})` : '';
97
93
  }