@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.
Files changed (185) hide show
  1. package/dist/cjs/clipboard/copy.js +1 -10
  2. package/dist/cjs/clipboard/cut.js +1 -10
  3. package/dist/cjs/clipboard/index.js +0 -2
  4. package/dist/cjs/clipboard/paste.js +2 -10
  5. package/dist/cjs/convenience/click.js +0 -2
  6. package/dist/cjs/convenience/hover.js +0 -8
  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 +3 -5
  10. package/dist/cjs/document/copySelection.js +0 -8
  11. package/dist/cjs/document/getValueOrTextContent.js +0 -9
  12. package/dist/cjs/document/index.js +0 -2
  13. package/dist/cjs/document/interceptor.js +5 -14
  14. package/dist/cjs/document/patchFocus.js +104 -0
  15. package/dist/cjs/document/prepareDocument.js +1 -10
  16. package/dist/cjs/document/trackValue.js +2 -10
  17. package/dist/cjs/event/behavior/click.js +1 -7
  18. package/dist/cjs/event/behavior/cut.js +0 -6
  19. package/dist/cjs/event/behavior/index.js +0 -2
  20. package/dist/cjs/event/behavior/keydown.js +3 -9
  21. package/dist/cjs/event/behavior/keypress.js +2 -8
  22. package/dist/cjs/event/behavior/keyup.js +1 -7
  23. package/dist/cjs/event/behavior/paste.js +1 -7
  24. package/dist/cjs/event/behavior/registry.js +0 -2
  25. package/dist/cjs/event/createEvent.js +36 -31
  26. package/dist/cjs/event/dispatchEvent.js +1 -3
  27. package/dist/cjs/event/eventMap.js +232 -35
  28. package/dist/cjs/event/focus.js +5 -12
  29. package/dist/cjs/event/index.js +0 -9
  30. package/dist/cjs/event/input.js +2 -10
  31. package/dist/cjs/event/radio.js +0 -8
  32. package/dist/cjs/event/selection/getInputRange.js +1 -3
  33. package/dist/cjs/event/selection/getTargetTypeAndSelection.js +2 -11
  34. package/dist/cjs/event/selection/index.js +0 -2
  35. package/dist/cjs/event/selection/modifySelection.js +1 -10
  36. package/dist/cjs/event/selection/modifySelectionPerMouse.js +2 -11
  37. package/dist/cjs/event/selection/moveSelection.js +1 -10
  38. package/dist/cjs/event/selection/resolveCaretPosition.js +4 -13
  39. package/dist/cjs/event/selection/selectAll.js +3 -12
  40. package/dist/cjs/event/selection/setSelection.js +1 -10
  41. package/dist/cjs/event/selection/setSelectionPerMouse.js +7 -16
  42. package/dist/cjs/event/selection/setSelectionRange.js +1 -10
  43. package/dist/cjs/event/selection/updateSelectionOnFocus.js +6 -11
  44. package/dist/cjs/event/wrapEvent.js +2 -25
  45. package/dist/cjs/index.js +2 -5
  46. package/dist/cjs/keyboard/index.js +0 -9
  47. package/dist/cjs/keyboard/keyMap.js +0 -2
  48. package/dist/cjs/keyboard/parseKeyDef.js +3 -11
  49. package/dist/cjs/options.js +10 -10
  50. package/dist/cjs/pointer/index.js +6 -14
  51. package/dist/cjs/pointer/keyMap.js +0 -2
  52. package/dist/cjs/pointer/parseKeyDef.js +0 -8
  53. package/dist/cjs/setup/api.js +0 -2
  54. package/dist/cjs/setup/directApi.js +0 -2
  55. package/dist/cjs/setup/index.js +0 -2
  56. package/dist/cjs/setup/setup.js +7 -10
  57. package/dist/cjs/setup/wrapAsync.js +2 -25
  58. package/dist/cjs/system/index.js +0 -2
  59. package/dist/cjs/system/keyboard.js +47 -28
  60. package/dist/cjs/system/pointer/buttons.js +0 -2
  61. package/dist/cjs/system/pointer/device.js +0 -2
  62. package/dist/cjs/system/pointer/index.js +18 -22
  63. package/dist/cjs/system/pointer/mouse.js +8 -18
  64. package/dist/cjs/system/pointer/pointer.js +4 -12
  65. package/dist/cjs/system/pointer/shared.js +2 -4
  66. package/dist/cjs/utility/clear.js +0 -9
  67. package/dist/cjs/utility/index.js +0 -2
  68. package/dist/cjs/utility/selectOptions.js +6 -36
  69. package/dist/cjs/utility/type.js +1 -10
  70. package/dist/cjs/utility/upload.js +4 -12
  71. package/dist/cjs/utils/click/isClickableInput.js +11 -13
  72. package/dist/cjs/utils/dataTransfer/Blob.js +0 -2
  73. package/dist/cjs/utils/dataTransfer/Clipboard.js +5 -8
  74. package/dist/cjs/utils/dataTransfer/DataTransfer.js +6 -12
  75. package/dist/cjs/utils/dataTransfer/FileList.js +0 -2
  76. package/dist/cjs/utils/edit/isContentEditable.js +0 -2
  77. package/dist/cjs/utils/edit/isEditable.js +15 -17
  78. package/dist/cjs/utils/edit/maxLength.js +10 -12
  79. package/dist/cjs/utils/edit/setFiles.js +2 -4
  80. package/dist/cjs/utils/edit/timeValue.js +0 -2
  81. package/dist/cjs/utils/focus/cursor.js +1 -3
  82. package/dist/cjs/utils/focus/getActiveElement.js +2 -4
  83. package/dist/cjs/utils/focus/getTabDestination.js +0 -2
  84. package/dist/cjs/utils/focus/isFocusable.js +0 -2
  85. package/dist/cjs/utils/focus/selection.js +0 -2
  86. package/dist/cjs/utils/focus/selector.js +0 -2
  87. package/dist/cjs/utils/index.js +1 -6
  88. package/dist/cjs/utils/keyDef/readNextDescriptor.js +8 -10
  89. package/dist/cjs/utils/misc/cloneEvent.js +0 -2
  90. package/dist/cjs/utils/misc/findClosest.js +0 -2
  91. package/dist/cjs/utils/misc/getDocumentFromNode.js +0 -2
  92. package/dist/cjs/utils/misc/getTreeDiff.js +0 -2
  93. package/dist/cjs/utils/misc/getWindow.js +13 -26
  94. package/dist/cjs/utils/misc/isDescendantOrSelf.js +0 -2
  95. package/dist/cjs/utils/misc/isDisabled.js +1 -3
  96. package/dist/cjs/utils/misc/isElementType.js +0 -2
  97. package/dist/cjs/utils/misc/isVisible.js +1 -3
  98. package/dist/cjs/utils/misc/level.js +4 -5
  99. package/dist/cjs/utils/misc/wait.js +0 -2
  100. package/dist/cjs/utils/pointer/cssPointerEvents.js +11 -13
  101. package/dist/esm/clipboard/copy.js +1 -8
  102. package/dist/esm/clipboard/cut.js +1 -8
  103. package/dist/esm/clipboard/paste.js +2 -8
  104. package/dist/esm/convenience/hover.js +0 -6
  105. package/dist/esm/document/UI.js +3 -3
  106. package/dist/esm/document/copySelection.js +0 -6
  107. package/dist/esm/document/getValueOrTextContent.js +0 -7
  108. package/dist/esm/document/interceptor.js +5 -12
  109. package/dist/esm/document/patchFocus.js +101 -0
  110. package/dist/esm/document/prepareDocument.js +1 -8
  111. package/dist/esm/document/trackValue.js +2 -8
  112. package/dist/esm/event/behavior/click.js +1 -7
  113. package/dist/esm/event/behavior/cut.js +0 -6
  114. package/dist/esm/event/behavior/keydown.js +3 -9
  115. package/dist/esm/event/behavior/keypress.js +2 -8
  116. package/dist/esm/event/behavior/keyup.js +1 -7
  117. package/dist/esm/event/behavior/paste.js +1 -7
  118. package/dist/esm/event/createEvent.js +37 -30
  119. package/dist/esm/event/dispatchEvent.js +1 -1
  120. package/dist/esm/event/eventMap.js +233 -13
  121. package/dist/esm/event/focus.js +5 -10
  122. package/dist/esm/event/index.js +0 -7
  123. package/dist/esm/event/input.js +2 -8
  124. package/dist/esm/event/radio.js +0 -6
  125. package/dist/esm/event/selection/getInputRange.js +1 -1
  126. package/dist/esm/event/selection/getTargetTypeAndSelection.js +2 -9
  127. package/dist/esm/event/selection/modifySelection.js +1 -8
  128. package/dist/esm/event/selection/modifySelectionPerMouse.js +2 -9
  129. package/dist/esm/event/selection/moveSelection.js +1 -8
  130. package/dist/esm/event/selection/resolveCaretPosition.js +4 -11
  131. package/dist/esm/event/selection/selectAll.js +3 -10
  132. package/dist/esm/event/selection/setSelection.js +1 -8
  133. package/dist/esm/event/selection/setSelectionPerMouse.js +7 -14
  134. package/dist/esm/event/selection/setSelectionRange.js +1 -8
  135. package/dist/esm/event/selection/updateSelectionOnFocus.js +6 -9
  136. package/dist/esm/event/wrapEvent.js +1 -2
  137. package/dist/esm/keyboard/index.js +0 -7
  138. package/dist/esm/keyboard/parseKeyDef.js +3 -9
  139. package/dist/esm/options.js +8 -8
  140. package/dist/esm/pointer/index.js +6 -12
  141. package/dist/esm/pointer/parseKeyDef.js +0 -6
  142. package/dist/esm/setup/setup.js +7 -8
  143. package/dist/esm/setup/wrapAsync.js +1 -2
  144. package/dist/esm/system/keyboard.js +46 -26
  145. package/dist/esm/system/pointer/index.js +18 -20
  146. package/dist/esm/system/pointer/mouse.js +8 -16
  147. package/dist/esm/system/pointer/pointer.js +4 -10
  148. package/dist/esm/system/pointer/shared.js +2 -2
  149. package/dist/esm/utility/clear.js +0 -7
  150. package/dist/esm/utility/selectOptions.js +2 -10
  151. package/dist/esm/utility/type.js +1 -8
  152. package/dist/esm/utility/upload.js +4 -10
  153. package/dist/esm/utils/click/isClickableInput.js +11 -11
  154. package/dist/esm/utils/dataTransfer/Clipboard.js +5 -6
  155. package/dist/esm/utils/dataTransfer/DataTransfer.js +6 -10
  156. package/dist/esm/utils/edit/isEditable.js +15 -15
  157. package/dist/esm/utils/edit/maxLength.js +10 -10
  158. package/dist/esm/utils/edit/setFiles.js +2 -2
  159. package/dist/esm/utils/focus/cursor.js +1 -1
  160. package/dist/esm/utils/focus/getActiveElement.js +2 -2
  161. package/dist/esm/utils/keyDef/readNextDescriptor.js +8 -8
  162. package/dist/esm/utils/misc/getWindow.js +13 -4
  163. package/dist/esm/utils/misc/isDisabled.js +1 -1
  164. package/dist/esm/utils/misc/isVisible.js +1 -1
  165. package/dist/esm/utils/misc/level.js +3 -3
  166. package/dist/esm/utils/pointer/cssPointerEvents.js +11 -11
  167. package/dist/types/document/patchFocus.d.ts +9 -0
  168. package/dist/types/event/eventMap.d.ts +204 -331
  169. package/dist/types/event/types.d.ts +3 -2
  170. package/dist/types/system/keyboard.d.ts +1 -4
  171. package/dist/types/utils/dataTransfer/DataTransfer.d.ts +1 -1
  172. package/package.json +17 -6
  173. package/dist/cjs/_interop/dom-events.d.js +0 -2
  174. package/dist/cjs/_interop/dom-helpers.d.js +0 -2
  175. package/dist/cjs/_interop/dtl.js +0 -27
  176. package/dist/cjs/_interop/dtlEventMap.js +0 -27
  177. package/dist/cjs/_interop/dtlHelpers.js +0 -27
  178. package/dist/esm/_interop/dom-events.d.js +0 -1
  179. package/dist/esm/_interop/dom-helpers.d.js +0 -1
  180. package/dist/esm/_interop/dtl.js +0 -2
  181. package/dist/esm/_interop/dtlEventMap.js +0 -2
  182. package/dist/esm/_interop/dtlHelpers.js +0 -2
  183. package/dist/types/_interop/dtl.d.ts +0 -2
  184. package/dist/types/_interop/dtlEventMap.d.ts +0 -2
  185. package/dist/types/_interop/dtlHelpers.d.ts +0 -2
@@ -1,20 +1,17 @@
1
- import '../../utils/click/isClickableInput.js';
2
1
  import '../../utils/dataTransfer/Clipboard.js';
3
2
  import { getContentEditable } from '../../utils/edit/isContentEditable.js';
4
- import '../../utils/edit/isEditable.js';
5
- import '../../utils/edit/maxLength.js';
6
- import '@testing-library/dom/dist/helpers.js';
7
3
  import { hasOwnSelection } from '../../utils/focus/selection.js';
8
- import '../../utils/keyDef/readNextDescriptor.js';
9
- import '../../utils/misc/level.js';
10
- import '../../options.js';
11
4
 
5
+ // The browser implementation seems to have changed.
6
+ // When focus is inside <input type="text"/>,
7
+ // Chrome updates Selection to be collapsed at the position of the input element.
8
+ // TODO: update implementation to match that of current browsers
12
9
  /**
13
10
  * Reset the Document Selection when moving focus into an element
14
11
  * with own selection implementation.
15
12
  */ function updateSelectionOnFocus(element) {
16
13
  const selection = element.ownerDocument.getSelection();
17
- /* istanbul ignore if */ if (!(selection === null || selection === void 0 ? void 0 : selection.focusNode)) {
14
+ /* istanbul ignore if */ if (!(selection === null || selection === undefined ? undefined : selection.focusNode)) {
18
15
  return;
19
16
  }
20
17
  // If the focus moves inside an element with own selection implementation,
@@ -29,7 +26,7 @@ import '../../options.js';
29
26
  if (contenteditable) {
30
27
  if (!selection.isCollapsed) {
31
28
  var _contenteditable_firstChild;
32
- const focusNode = ((_contenteditable_firstChild = contenteditable.firstChild) === null || _contenteditable_firstChild === void 0 ? void 0 : _contenteditable_firstChild.nodeType) === 3 ? contenteditable.firstChild : contenteditable;
29
+ const focusNode = ((_contenteditable_firstChild = contenteditable.firstChild) === null || _contenteditable_firstChild === undefined ? undefined : _contenteditable_firstChild.nodeType) === 3 ? contenteditable.firstChild : contenteditable;
33
30
  selection.setBaseAndExtent(focusNode, 0, focusNode, 0);
34
31
  }
35
32
  } else {
@@ -1,6 +1,5 @@
1
- import * as named from '@testing-library/dom';
1
+ import { getConfig } from '@testing-library/dom';
2
2
 
3
- const { getConfig } = named;
4
3
  function wrapEvent(cb, _element) {
5
4
  return getConfig().eventWrapper(cb);
6
5
  }
@@ -1,12 +1,5 @@
1
- import '../utils/click/isClickableInput.js';
2
1
  import '../utils/dataTransfer/Clipboard.js';
3
- import '../utils/edit/isEditable.js';
4
- import '../utils/edit/maxLength.js';
5
- import '@testing-library/dom/dist/helpers.js';
6
- import '../utils/keyDef/readNextDescriptor.js';
7
- import '../utils/misc/level.js';
8
2
  import { wait } from '../utils/misc/wait.js';
9
- import '../options.js';
10
3
  import { parseKeyDef } from './parseKeyDef.js';
11
4
 
12
5
  async function keyboard(text) {
@@ -1,11 +1,5 @@
1
- import '../utils/click/isClickableInput.js';
2
1
  import '../utils/dataTransfer/Clipboard.js';
3
- import '../utils/edit/isEditable.js';
4
- import '../utils/edit/maxLength.js';
5
- import '@testing-library/dom/dist/helpers.js';
6
2
  import { readNextDescriptor } from '../utils/keyDef/readNextDescriptor.js';
7
- import '../utils/misc/level.js';
8
- import '../options.js';
9
3
 
10
4
  /**
11
5
  * Parse key defintions per `keyboardMap`
@@ -24,13 +18,13 @@ import '../options.js';
24
18
  const keyDef = (_keyboardMap_find = keyboardMap.find((def)=>{
25
19
  if (type === '[') {
26
20
  var _def_code;
27
- return ((_def_code = def.code) === null || _def_code === void 0 ? void 0 : _def_code.toLowerCase()) === descriptor.toLowerCase();
21
+ return ((_def_code = def.code) === null || _def_code === undefined ? undefined : _def_code.toLowerCase()) === descriptor.toLowerCase();
28
22
  } else if (type === '{') {
29
23
  var _def_key;
30
- return ((_def_key = def.key) === null || _def_key === void 0 ? void 0 : _def_key.toLowerCase()) === descriptor.toLowerCase();
24
+ return ((_def_key = def.key) === null || _def_key === undefined ? undefined : _def_key.toLowerCase()) === descriptor.toLowerCase();
31
25
  }
32
26
  return def.key === descriptor;
33
- })) !== null && _keyboardMap_find !== void 0 ? _keyboardMap_find : {
27
+ })) !== null && _keyboardMap_find !== undefined ? _keyboardMap_find : {
34
28
  key: 'Unknown',
35
29
  code: 'Unknown',
36
30
  [type === '[' ? 'code' : 'key']: descriptor
@@ -1,12 +1,12 @@
1
- var PointerEventsCheckLevel;
2
- (function(PointerEventsCheckLevel) {
3
- PointerEventsCheckLevel[PointerEventsCheckLevel[/**
1
+ var PointerEventsCheckLevel = /*#__PURE__*/ function(PointerEventsCheckLevel) {
2
+ /**
4
3
  * Check pointer events on every user interaction that triggers a bunch of events.
5
4
  * 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";
10
- })(PointerEventsCheckLevel || (PointerEventsCheckLevel = {}));
5
+ */ PointerEventsCheckLevel[PointerEventsCheckLevel["EachTrigger"] = 4] = "EachTrigger";
6
+ /** Check each target once per call to pointer (related) API */ PointerEventsCheckLevel[PointerEventsCheckLevel["EachApiCall"] = 2] = "EachApiCall";
7
+ /** Check each event target once */ PointerEventsCheckLevel[PointerEventsCheckLevel["EachTarget"] = 1] = "EachTarget";
8
+ /** No pointer events check */ PointerEventsCheckLevel[PointerEventsCheckLevel["Never"] = 0] = "Never";
9
+ return PointerEventsCheckLevel;
10
+ }({});
11
11
 
12
12
  export { PointerEventsCheckLevel };
@@ -1,12 +1,6 @@
1
- import '../utils/click/isClickableInput.js';
2
1
  import '../utils/dataTransfer/Clipboard.js';
3
- import '../utils/edit/isEditable.js';
4
- import '../utils/edit/maxLength.js';
5
- import '@testing-library/dom/dist/helpers.js';
6
- import '../utils/keyDef/readNextDescriptor.js';
7
2
  import { setLevelRef, ApiLevel } from '../utils/misc/level.js';
8
3
  import { wait } from '../utils/misc/wait.js';
9
- import '../options.js';
10
4
  import { parseKeyDef } from './parseKeyDef.js';
11
5
 
12
6
  async function pointer(input) {
@@ -38,11 +32,11 @@ async function pointerAction(instance, action) {
38
32
  const previousPosition = instance.system.pointer.getPreviousPosition(pointerName);
39
33
  var _action_target, _action_coords, _action_node, _action_offset;
40
34
  const position = {
41
- 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 === null || previousPosition === void 0 ? void 0 : previousPosition.coords,
35
+ target: (_action_target = action.target) !== null && _action_target !== undefined ? _action_target : getPrevTarget(instance, previousPosition),
36
+ coords: (_action_coords = action.coords) !== null && _action_coords !== undefined ? _action_coords : previousPosition === null || previousPosition === undefined ? undefined : previousPosition.coords,
43
37
  caret: {
44
- 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,
45
- 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
38
+ node: (_action_node = action.node) !== null && _action_node !== undefined ? _action_node : hasCaretPosition(action) ? undefined : previousPosition === null || previousPosition === undefined ? undefined : (_previousPosition_caret = previousPosition.caret) === null || _previousPosition_caret === undefined ? undefined : _previousPosition_caret.node,
39
+ offset: (_action_offset = action.offset) !== null && _action_offset !== undefined ? _action_offset : hasCaretPosition(action) ? undefined : previousPosition === null || previousPosition === undefined ? undefined : (_previousPosition_caret1 = previousPosition.caret) === null || _previousPosition_caret1 === undefined ? undefined : _previousPosition_caret1.offset
46
40
  }
47
41
  };
48
42
  if ('keyDef' in action) {
@@ -65,14 +59,14 @@ async function pointerAction(instance, action) {
65
59
  }
66
60
  function hasCaretPosition(action) {
67
61
  var _action_target, _ref;
68
- return !!((_ref = (_action_target = action.target) !== null && _action_target !== void 0 ? _action_target : action.node) !== null && _ref !== void 0 ? _ref : action.offset !== undefined);
62
+ return !!((_ref = (_action_target = action.target) !== null && _action_target !== undefined ? _action_target : action.node) !== null && _ref !== undefined ? _ref : action.offset !== undefined);
69
63
  }
70
64
  function getPrevTarget(instance, position) {
71
65
  if (!position) {
72
66
  throw new Error('This pointer has no previous position. Provide a target property!');
73
67
  }
74
68
  var _position_target;
75
- return (_position_target = position.target) !== null && _position_target !== void 0 ? _position_target : instance.config.document.body;
69
+ return (_position_target = position.target) !== null && _position_target !== undefined ? _position_target : instance.config.document.body;
76
70
  }
77
71
 
78
72
  export { pointer };
@@ -1,11 +1,5 @@
1
- import '../utils/click/isClickableInput.js';
2
1
  import '../utils/dataTransfer/Clipboard.js';
3
- import '../utils/edit/isEditable.js';
4
- import '../utils/edit/maxLength.js';
5
- import '@testing-library/dom/dist/helpers.js';
6
2
  import { readNextDescriptor } from '../utils/keyDef/readNextDescriptor.js';
7
- import '../utils/misc/level.js';
8
- import '../options.js';
9
3
 
10
4
  function parseKeyDef(pointerMap, keys) {
11
5
  const defs = [];
@@ -1,11 +1,8 @@
1
+ import { patchFocus } from '../document/patchFocus.js';
1
2
  import { prepareDocument } from '../document/prepareDocument.js';
2
3
  import { dispatchEvent, dispatchUIEvent } from '../event/dispatchEvent.js';
3
- import '../utils/click/isClickableInput.js';
4
4
  import { attachClipboardStubToView } from '../utils/dataTransfer/Clipboard.js';
5
- import '../utils/edit/isEditable.js';
6
- import '../utils/edit/maxLength.js';
7
- import '@testing-library/dom/dist/helpers.js';
8
- import '../utils/keyDef/readNextDescriptor.js';
5
+ import { getWindow } from '../utils/misc/getWindow.js';
9
6
  import { getDocumentFromNode } from '../utils/misc/getDocumentFromNode.js';
10
7
  import { setLevelRef, ApiLevel } from '../utils/misc/level.js';
11
8
  import { wait } from '../utils/misc/wait.js';
@@ -53,8 +50,9 @@ function createConfig(options = {}, defaults = defaultOptionsSetup, node) {
53
50
  */ function setupMain(options = {}) {
54
51
  const config = createConfig(options);
55
52
  prepareDocument(config.document);
53
+ patchFocus(getWindow(config.document).HTMLElement);
56
54
  var _config_document_defaultView;
57
- const view = (_config_document_defaultView = config.document.defaultView) !== null && _config_document_defaultView !== void 0 ? _config_document_defaultView : /* istanbul ignore next */ globalThis.window;
55
+ const view = (_config_document_defaultView = config.document.defaultView) !== null && _config_document_defaultView !== undefined ? _config_document_defaultView : /* istanbul ignore next */ globalThis.window;
58
56
  attachClipboardStubToView(view);
59
57
  return createInstance(config).api;
60
58
  }
@@ -63,8 +61,9 @@ function createConfig(options = {}, defaults = defaultOptionsSetup, node) {
63
61
  */ function setupDirect({ keyboardState, pointerState, ...options } = {}, node) {
64
62
  const config = createConfig(options, defaultOptionsDirect, node);
65
63
  prepareDocument(config.document);
64
+ patchFocus(getWindow(config.document).HTMLElement);
66
65
  var _ref;
67
- const system = (_ref = pointerState !== null && pointerState !== void 0 ? pointerState : keyboardState) !== null && _ref !== void 0 ? _ref : new System();
66
+ const system = (_ref = pointerState !== null && pointerState !== undefined ? pointerState : keyboardState) !== null && _ref !== undefined ? _ref : new System();
68
67
  return {
69
68
  api: createInstance(config, system).api,
70
69
  system
@@ -114,7 +113,7 @@ function createInstance(config, system = new System()) {
114
113
  }
115
114
  function getDocument(options, node, defaults) {
116
115
  var _options_document, _ref;
117
- return (_ref = (_options_document = options.document) !== null && _options_document !== void 0 ? _options_document : node && getDocumentFromNode(node)) !== null && _ref !== void 0 ? _ref : defaults.document;
116
+ return (_ref = (_options_document = options.document) !== null && _options_document !== undefined ? _options_document : node && getDocumentFromNode(node)) !== null && _ref !== undefined ? _ref : defaults.document;
118
117
  }
119
118
 
120
119
  export { createConfig, createInstance, setupDirect, setupMain, setupSub };
@@ -1,6 +1,5 @@
1
- import * as named from '@testing-library/dom';
1
+ import { getConfig } from '@testing-library/dom';
2
2
 
3
- const { getConfig } = named;
4
3
  /**
5
4
  * Wrap an internal Promise
6
5
  */ function wrapAsync(implementation) {
@@ -1,12 +1,5 @@
1
- import '../utils/click/isClickableInput.js';
2
1
  import '../utils/dataTransfer/Clipboard.js';
3
- import '../utils/edit/isEditable.js';
4
- import '../utils/edit/maxLength.js';
5
2
  import { getActiveElementOrBody } from '../utils/focus/getActiveElement.js';
6
- import '@testing-library/dom/dist/helpers.js';
7
- import '../utils/keyDef/readNextDescriptor.js';
8
- import '../utils/misc/level.js';
9
- import '../options.js';
10
3
 
11
4
  function _define_property(obj, key, value) {
12
5
  if (key in obj) {
@@ -21,13 +14,13 @@ function _define_property(obj, key, value) {
21
14
  }
22
15
  return obj;
23
16
  }
24
- var DOM_KEY_LOCATION;
25
- (function(DOM_KEY_LOCATION) {
17
+ var DOM_KEY_LOCATION = /*#__PURE__*/ function(DOM_KEY_LOCATION) {
26
18
  DOM_KEY_LOCATION[DOM_KEY_LOCATION["STANDARD"] = 0] = "STANDARD";
27
19
  DOM_KEY_LOCATION[DOM_KEY_LOCATION["LEFT"] = 1] = "LEFT";
28
20
  DOM_KEY_LOCATION[DOM_KEY_LOCATION["RIGHT"] = 2] = "RIGHT";
29
21
  DOM_KEY_LOCATION[DOM_KEY_LOCATION["NUMPAD"] = 3] = "NUMPAD";
30
- })(DOM_KEY_LOCATION || (DOM_KEY_LOCATION = {}));
22
+ return DOM_KEY_LOCATION;
23
+ }({});
31
24
  const modifierKeys = [
32
25
  'Alt',
33
26
  'AltGraph',
@@ -52,23 +45,17 @@ function isModifierLock(key) {
52
45
  }
53
46
  class KeyboardHost {
54
47
  isKeyPressed(keyDef) {
55
- return !!this.pressed[String(keyDef.code)];
48
+ return this.pressed.has(String(keyDef.code));
56
49
  }
57
50
  getPressedKeys() {
58
- return Object.values(this.pressed).map((p)=>p.keyDef);
51
+ return this.pressed.values().map((p)=>p.keyDef);
59
52
  }
60
53
  /** Press a key */ async keydown(instance, keyDef) {
61
- var // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
62
- _this_pressed, _code, _this_pressed_code;
63
54
  const key = String(keyDef.key);
64
55
  const code = String(keyDef.code);
65
56
  const target = getActiveElementOrBody(instance.config.document);
66
57
  this.setKeydownTarget(target);
67
- var _;
68
- (_ = (_this_pressed = this.pressed)[_code = code]) !== null && _ !== void 0 ? _ : _this_pressed[_code] = {
69
- keyDef,
70
- unpreventedDefault: false
71
- };
58
+ this.pressed.add(code, keyDef);
72
59
  if (isModifierKey(key)) {
73
60
  this.modifiers[key] = true;
74
61
  }
@@ -80,7 +67,9 @@ class KeyboardHost {
80
67
  this.modifiers[key] = true;
81
68
  this.modifierLockStart[key] = true;
82
69
  }
83
- (_this_pressed_code = this.pressed[code]).unpreventedDefault || (_this_pressed_code.unpreventedDefault = unprevented);
70
+ if (unprevented) {
71
+ this.pressed.setUnprevented(code);
72
+ }
84
73
  if (unprevented && this.hasKeyPress(key)) {
85
74
  instance.dispatchUIEvent(getActiveElementOrBody(instance.config.document), 'keypress', {
86
75
  key,
@@ -92,10 +81,9 @@ class KeyboardHost {
92
81
  /** Release a key */ async keyup(instance, keyDef) {
93
82
  const key = String(keyDef.key);
94
83
  const code = String(keyDef.code);
95
- const unprevented = this.pressed[code].unpreventedDefault;
96
- // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
97
- delete this.pressed[code];
98
- if (isModifierKey(key) && !Object.values(this.pressed).find((p)=>p.keyDef.key === key)) {
84
+ const unprevented = this.pressed.isUnprevented(code);
85
+ this.pressed.delete(code);
86
+ if (isModifierKey(key) && !this.pressed.values().find((p)=>p.keyDef.key === key)) {
99
87
  this.modifiers[key] = false;
100
88
  }
101
89
  instance.dispatchUIEvent(getActiveElementOrBody(instance.config.document), 'keyup', {
@@ -120,7 +108,7 @@ class KeyboardHost {
120
108
  return (key.length === 1 || key === 'Enter') && !this.modifiers.Control && !this.modifiers.Alt;
121
109
  }
122
110
  constructor(system){
123
- _define_property(this, "system", void 0);
111
+ _define_property(this, "system", undefined);
124
112
  _define_property(this, "modifiers", {
125
113
  Alt: false,
126
114
  AltGraph: false,
@@ -135,7 +123,39 @@ class KeyboardHost {
135
123
  Symbol: false,
136
124
  SymbolLock: false
137
125
  });
138
- _define_property(this, "pressed", {});
126
+ _define_property(this, "pressed", new class {
127
+ add(code, keyDef) {
128
+ var _this_registry, _code;
129
+ var _;
130
+ (_ = (_this_registry = this.registry)[_code = code]) !== null && _ !== undefined ? _ : _this_registry[_code] = {
131
+ keyDef,
132
+ unpreventedDefault: false
133
+ };
134
+ }
135
+ has(code) {
136
+ return !!this.registry[code];
137
+ }
138
+ setUnprevented(code) {
139
+ const o = this.registry[code];
140
+ if (o) {
141
+ o.unpreventedDefault = true;
142
+ }
143
+ }
144
+ isUnprevented(code) {
145
+ var _this_registry_code;
146
+ return !!((_this_registry_code = this.registry[code]) === null || _this_registry_code === undefined ? undefined : _this_registry_code.unpreventedDefault);
147
+ }
148
+ delete(code) {
149
+ // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
150
+ delete this.registry[code];
151
+ }
152
+ values() {
153
+ return Object.values(this.registry);
154
+ }
155
+ constructor(){
156
+ _define_property(this, "registry", {});
157
+ }
158
+ }());
139
159
  _define_property(this, "carryChar", '');
140
160
  _define_property(this, "lastKeydownTarget", undefined);
141
161
  _define_property(this, "modifierLockStart", {});
@@ -43,12 +43,12 @@ class PointerHost {
43
43
  // the order in which they interweave/follow on a user interaction depends on the implementation.
44
44
  const pointermove = pointer.move(instance, position);
45
45
  const mousemove = pointer.pointerType === 'touch' || pointer.isPrevented && pointer.isDown ? undefined : this.mouse.move(instance, position);
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();
46
+ pointermove === null || pointermove === undefined ? undefined : pointermove.leave();
47
+ mousemove === null || mousemove === undefined ? undefined : mousemove.leave();
48
+ pointermove === null || pointermove === undefined ? undefined : pointermove.enter();
49
+ mousemove === null || mousemove === undefined ? undefined : mousemove.enter();
50
+ pointermove === null || pointermove === undefined ? undefined : pointermove.move();
51
+ mousemove === null || mousemove === undefined ? undefined : mousemove.move();
52
52
  }
53
53
  async release(instance, keyDef, position) {
54
54
  const device = this.devices.get(keyDef.pointerType);
@@ -69,16 +69,16 @@ class PointerHost {
69
69
  if (!pointer.isPrevented) {
70
70
  if (pointer.pointerType === 'touch' && !pointer.isMultitouch) {
71
71
  const mousemove = this.mouse.move(instance, pointer.position);
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();
72
+ mousemove === null || mousemove === undefined ? undefined : mousemove.leave();
73
+ mousemove === null || mousemove === undefined ? undefined : mousemove.enter();
74
+ mousemove === null || mousemove === undefined ? undefined : mousemove.move();
75
75
  this.mouse.down(instance, keyDef, pointer);
76
76
  }
77
77
  if (!pointer.isMultitouch) {
78
78
  const mousemove = this.mouse.move(instance, pointer.position);
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();
79
+ mousemove === null || mousemove === undefined ? undefined : mousemove.leave();
80
+ mousemove === null || mousemove === undefined ? undefined : mousemove.enter();
81
+ mousemove === null || mousemove === undefined ? undefined : mousemove.move();
82
82
  this.mouse.up(instance, keyDef, pointer);
83
83
  }
84
84
  }
@@ -94,23 +94,21 @@ class PointerHost {
94
94
  }
95
95
  getMouseTarget(instance) {
96
96
  var _this_mouse_position_target;
97
- return (_this_mouse_position_target = this.mouse.position.target) !== null && _this_mouse_position_target !== void 0 ? _this_mouse_position_target : instance.config.document.body;
97
+ return (_this_mouse_position_target = this.mouse.position.target) !== null && _this_mouse_position_target !== undefined ? _this_mouse_position_target : instance.config.document.body;
98
98
  }
99
99
  setMousePosition(position) {
100
100
  this.mouse.position = position;
101
101
  this.pointers.get('mouse').position = position;
102
102
  }
103
103
  constructor(system){
104
- _define_property(this, "system", void 0);
105
- _define_property(this, "mouse", void 0);
106
- _define_property(this, "buttons", void 0);
104
+ _define_property(this, "system", undefined);
105
+ _define_property(this, "mouse", undefined);
106
+ _define_property(this, "buttons", undefined);
107
107
  _define_property(this, "devices", new class {
108
108
  get(k) {
109
- var // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
110
- _this_registry, _k;
109
+ var _this_registry, _k;
111
110
  var _;
112
- (_ = (_this_registry = this.registry)[_k = k]) !== null && _ !== void 0 ? _ : _this_registry[_k] = new Device();
113
- return this.registry[k];
111
+ return (_ = (_this_registry = this.registry)[_k = k]) !== null && _ !== undefined ? _ : _this_registry[_k] = new Device();
114
112
  }
115
113
  constructor(){
116
114
  _define_property(this, "registry", {});
@@ -5,17 +5,9 @@ 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
- import '../../utils/click/isClickableInput.js';
10
8
  import '../../utils/dataTransfer/Clipboard.js';
11
- import '../../utils/edit/isEditable.js';
12
- import '../../utils/edit/maxLength.js';
13
9
  import { isDisabled } from '../../utils/misc/isDisabled.js';
14
- import '@testing-library/dom/dist/helpers.js';
15
- import '../../utils/keyDef/readNextDescriptor.js';
16
10
  import { getTreeDiff } from '../../utils/misc/getTreeDiff.js';
17
- import '../../utils/misc/level.js';
18
- import '../../options.js';
19
11
  import { focusElement } from '../../event/focus.js';
20
12
  import { setSelectionPerMouseDown } from '../../event/selection/setSelectionPerMouse.js';
21
13
  import { modifySelectionPerMouseMove } from '../../event/selection/modifySelectionPerMouse.js';
@@ -133,7 +125,7 @@ function _define_property(obj, key, value) {
133
125
  }
134
126
  getTarget(instance) {
135
127
  var _this_position_target;
136
- return (_this_position_target = this.position.target) !== null && _this_position_target !== void 0 ? _this_position_target : instance.config.document.body;
128
+ return (_this_position_target = this.position.target) !== null && _this_position_target !== undefined ? _this_position_target : instance.config.document.body;
137
129
  }
138
130
  startSelecting(instance, clickCount) {
139
131
  var _this_position_caret, _this_position_caret1;
@@ -141,8 +133,8 @@ function _define_property(obj, key, value) {
141
133
  this.selecting = setSelectionPerMouseDown({
142
134
  document: instance.config.document,
143
135
  target: this.getTarget(instance),
144
- node: (_this_position_caret = this.position.caret) === null || _this_position_caret === void 0 ? void 0 : _this_position_caret.node,
145
- offset: (_this_position_caret1 = this.position.caret) === null || _this_position_caret1 === void 0 ? void 0 : _this_position_caret1.offset,
136
+ node: (_this_position_caret = this.position.caret) === null || _this_position_caret === undefined ? undefined : _this_position_caret.node,
137
+ offset: (_this_position_caret1 = this.position.caret) === null || _this_position_caret1 === undefined ? undefined : _this_position_caret1.offset,
146
138
  clickCount
147
139
  });
148
140
  }
@@ -154,8 +146,8 @@ function _define_property(obj, key, value) {
154
146
  modifySelectionPerMouseMove(this.selecting, {
155
147
  document: instance.config.document,
156
148
  target: this.getTarget(instance),
157
- node: (_this_position_caret = this.position.caret) === null || _this_position_caret === void 0 ? void 0 : _this_position_caret.node,
158
- offset: (_this_position_caret1 = this.position.caret) === null || _this_position_caret1 === void 0 ? void 0 : _this_position_caret1.offset
149
+ node: (_this_position_caret = this.position.caret) === null || _this_position_caret === undefined ? undefined : _this_position_caret.node,
150
+ offset: (_this_position_caret1 = this.position.caret) === null || _this_position_caret1 === undefined ? undefined : _this_position_caret1.offset
159
151
  });
160
152
  }
161
153
  endSelecting() {
@@ -164,7 +156,7 @@ function _define_property(obj, key, value) {
164
156
  constructor(){
165
157
  _define_property(this, "position", {});
166
158
  _define_property(this, "buttons", new Buttons());
167
- _define_property(this, "selecting", void 0);
159
+ _define_property(this, "selecting", undefined);
168
160
  _define_property(this, "buttonDownTarget", {});
169
161
  // According to spec the `detail` on click events should be the number
170
162
  // of *consecutive* clicks with a specific button.
@@ -187,11 +179,11 @@ function _define_property(obj, key, value) {
187
179
  getOnDown(button) {
188
180
  var _this_count_button;
189
181
  this.down = {
190
- [button]: (_this_count_button = this.count[button]) !== null && _this_count_button !== void 0 ? _this_count_button : 0
182
+ [button]: (_this_count_button = this.count[button]) !== null && _this_count_button !== undefined ? _this_count_button : 0
191
183
  };
192
184
  var _this_count_button1;
193
185
  this.count = {
194
- [button]: (_this_count_button1 = this.count[button]) !== null && _this_count_button1 !== void 0 ? _this_count_button1 : 0
186
+ [button]: (_this_count_button1 = this.count[button]) !== null && _this_count_button1 !== undefined ? _this_count_button1 : 0
195
187
  };
196
188
  return Number(this.count[button]) + 1;
197
189
  }
@@ -1,11 +1,5 @@
1
- import '../../utils/click/isClickableInput.js';
2
1
  import '../../utils/dataTransfer/Clipboard.js';
3
- import '../../utils/edit/isEditable.js';
4
- import '../../utils/edit/maxLength.js';
5
- import '@testing-library/dom/dist/helpers.js';
6
- import '../../utils/keyDef/readNextDescriptor.js';
7
2
  import { getTreeDiff } from '../../utils/misc/getTreeDiff.js';
8
- import '../../utils/misc/level.js';
9
3
  import { assertPointerEvents, hasPointerEvents } from '../../utils/pointer/cssPointerEvents.js';
10
4
  import { isDifferentPointerPosition } from './shared.js';
11
5
 
@@ -96,7 +90,7 @@ class Pointer {
96
90
  }
97
91
  getTarget(instance) {
98
92
  var _this_position_target;
99
- return (_this_position_target = this.position.target) !== null && _this_position_target !== void 0 ? _this_position_target : instance.config.document.body;
93
+ return (_this_position_target = this.position.target) !== null && _this_position_target !== undefined ? _this_position_target : instance.config.document.body;
100
94
  }
101
95
  getEventInit() {
102
96
  return {
@@ -107,9 +101,9 @@ class Pointer {
107
101
  };
108
102
  }
109
103
  constructor({ pointerId, pointerType, isPrimary }){
110
- _define_property(this, "pointerId", void 0);
111
- _define_property(this, "pointerType", void 0);
112
- _define_property(this, "isPrimary", void 0);
104
+ _define_property(this, "pointerId", undefined);
105
+ _define_property(this, "pointerType", undefined);
106
+ _define_property(this, "isPrimary", undefined);
113
107
  _define_property(this, "isMultitouch", false);
114
108
  _define_property(this, "isCancelled", false);
115
109
  _define_property(this, "isDown", false);
@@ -1,6 +1,6 @@
1
1
  function isDifferentPointerPosition(positionA, positionB) {
2
- var _positionA_coords, _positionB_coords, _positionA_coords1, _positionB_coords1, _positionA_caret, _positionB_caret, _positionA_caret1, _positionB_caret1;
3
- return positionA.target !== positionB.target || ((_positionA_coords = positionA.coords) === null || _positionA_coords === void 0 ? void 0 : _positionA_coords.x) !== ((_positionB_coords = positionB.coords) === null || _positionB_coords === void 0 ? void 0 : _positionB_coords.y) || ((_positionA_coords1 = positionA.coords) === null || _positionA_coords1 === void 0 ? void 0 : _positionA_coords1.y) !== ((_positionB_coords1 = positionB.coords) === null || _positionB_coords1 === void 0 ? void 0 : _positionB_coords1.y) || ((_positionA_caret = positionA.caret) === null || _positionA_caret === void 0 ? void 0 : _positionA_caret.node) !== ((_positionB_caret = positionB.caret) === null || _positionB_caret === void 0 ? void 0 : _positionB_caret.node) || ((_positionA_caret1 = positionA.caret) === null || _positionA_caret1 === void 0 ? void 0 : _positionA_caret1.offset) !== ((_positionB_caret1 = positionB.caret) === null || _positionB_caret1 === void 0 ? void 0 : _positionB_caret1.offset);
2
+ 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;
3
+ 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);
4
4
  }
5
5
 
6
6
  export { isDifferentPointerPosition };
@@ -5,16 +5,9 @@ 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
- import '../utils/click/isClickableInput.js';
10
8
  import '../utils/dataTransfer/Clipboard.js';
11
9
  import { isEditable } from '../utils/edit/isEditable.js';
12
- import '../utils/edit/maxLength.js';
13
10
  import { isDisabled } from '../utils/misc/isDisabled.js';
14
- import '@testing-library/dom/dist/helpers.js';
15
- import '../utils/keyDef/readNextDescriptor.js';
16
- import '../utils/misc/level.js';
17
- import '../options.js';
18
11
  import { focusElement } from '../event/focus.js';
19
12
  import { input } from '../event/input.js';
20
13
  import { selectAll, isAllSelected } from '../event/selection/selectAll.js';
@@ -1,13 +1,7 @@
1
- import * as named from '@testing-library/dom';
2
- import '../utils/click/isClickableInput.js';
3
- import '../utils/dataTransfer/Clipboard.js';
4
- import '../utils/edit/isEditable.js';
5
- import '../utils/edit/maxLength.js';
1
+ import { getConfig } from '@testing-library/dom';
6
2
  import { isElementType } from '../utils/misc/isElementType.js';
3
+ import '../utils/dataTransfer/Clipboard.js';
7
4
  import { isDisabled } from '../utils/misc/isDisabled.js';
8
- import '@testing-library/dom/dist/helpers.js';
9
- import '../utils/keyDef/readNextDescriptor.js';
10
- import '../utils/misc/level.js';
11
5
  import { wait } from '../utils/misc/wait.js';
12
6
  import { hasPointerEvents } from '../utils/pointer/cssPointerEvents.js';
13
7
  import '../event/behavior/click.js';
@@ -16,10 +10,8 @@ import '../event/behavior/keydown.js';
16
10
  import '../event/behavior/keypress.js';
17
11
  import '../event/behavior/keyup.js';
18
12
  import '../event/behavior/paste.js';
19
- import '../event/eventMap.js';
20
13
  import { focusElement } from '../event/focus.js';
21
14
 
22
- const { getConfig } = named;
23
15
  async function selectOptions(select, values) {
24
16
  return selectOptionsBase.call(this, true, select, values);
25
17
  }
@@ -1,12 +1,5 @@
1
1
  import { releaseAllKeys } from '../keyboard/index.js';
2
- import '../utils/click/isClickableInput.js';
3
2
  import '../utils/dataTransfer/Clipboard.js';
4
- import '../utils/edit/isEditable.js';
5
- import '../utils/edit/maxLength.js';
6
- import '@testing-library/dom/dist/helpers.js';
7
- import '../utils/keyDef/readNextDescriptor.js';
8
- import '../utils/misc/level.js';
9
- import '../options.js';
10
3
  import { setSelectionRange } from '../event/selection/setSelectionRange.js';
11
4
 
12
5
  async function type(element, text, { skipClick = this.config.skipClick, skipAutoClose = this.config.skipAutoClose, initialSelectionStart, initialSelectionEnd } = {}) {
@@ -17,7 +10,7 @@ async function type(element, text, { skipClick = this.config.skipClick, skipAuto
17
10
  await this.click(element);
18
11
  }
19
12
  if (initialSelectionStart !== undefined) {
20
- setSelectionRange(element, initialSelectionStart, initialSelectionEnd !== null && initialSelectionEnd !== void 0 ? initialSelectionEnd : initialSelectionStart);
13
+ setSelectionRange(element, initialSelectionStart, initialSelectionEnd !== null && initialSelectionEnd !== undefined ? initialSelectionEnd : initialSelectionStart);
21
14
  }
22
15
  await this.keyboard(text);
23
16
  if (!skipAutoClose) {