@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
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  function isDifferentPointerPosition(positionA, positionB) {
6
4
  var _positionA_coords, _positionB_coords, _positionA_coords1, _positionB_coords1, _positionA_caret, _positionB_caret, _positionA_caret1, _positionB_caret1;
7
5
  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);
@@ -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,13 +7,11 @@ 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
10
  require('../utils/click/isClickableInput.js');
14
11
  require('../utils/dataTransfer/Clipboard.js');
15
12
  var isEditable = require('../utils/edit/isEditable.js');
16
13
  require('../utils/edit/maxLength.js');
17
14
  var isDisabled = require('../utils/misc/isDisabled.js');
18
- require('@testing-library/dom/dist/helpers.js');
19
15
  require('../utils/keyDef/readNextDescriptor.js');
20
16
  require('../utils/misc/level.js');
21
17
  require('../options.js');
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var clear = require('./clear.js');
6
4
  var selectOptions = require('./selectOptions.js');
7
5
  var type = require('./type.js');
@@ -1,15 +1,12 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var dtl = require('../_interop/dtl.js');
3
+ var dom = require('@testing-library/dom');
6
4
  require('../utils/click/isClickableInput.js');
7
5
  require('../utils/dataTransfer/Clipboard.js');
8
6
  require('../utils/edit/isEditable.js');
9
7
  require('../utils/edit/maxLength.js');
10
8
  var isElementType = require('../utils/misc/isElementType.js');
11
9
  var isDisabled = require('../utils/misc/isDisabled.js');
12
- require('@testing-library/dom/dist/helpers.js');
13
10
  require('../utils/keyDef/readNextDescriptor.js');
14
11
  require('../utils/misc/level.js');
15
12
  var wait = require('../utils/misc/wait.js');
@@ -20,10 +17,8 @@ require('../event/behavior/keydown.js');
20
17
  require('../event/behavior/keypress.js');
21
18
  require('../event/behavior/keyup.js');
22
19
  require('../event/behavior/paste.js');
23
- require('../event/eventMap.js');
24
20
  var focus = require('../event/focus.js');
25
21
 
26
- const { getConfig } = dtl;
27
22
  async function selectOptions(select, values) {
28
23
  return selectOptionsBase.call(this, true, select, values);
29
24
  }
@@ -32,7 +27,7 @@ async function deselectOptions(select, values) {
32
27
  }
33
28
  async function selectOptionsBase(newValue, select, values) {
34
29
  if (!newValue && !select.multiple) {
35
- throw getConfig().getElementError(`Unable to deselect an option in a non-multiple select. Use selectOptions to change the selection instead.`, select);
30
+ throw dom.getConfig().getElementError(`Unable to deselect an option in a non-multiple select. Use selectOptions to change the selection instead.`, select);
36
31
  }
37
32
  const valArray = Array.isArray(values) ? values : [
38
33
  values
@@ -46,7 +41,7 @@ async function selectOptionsBase(newValue, select, values) {
46
41
  if (matchingOption) {
47
42
  return matchingOption;
48
43
  } else {
49
- throw getConfig().getElementError(`Value "${String(val)}" not found in options`, select);
44
+ throw dom.getConfig().getElementError(`Value "${String(val)}" not found in options`, select);
50
45
  }
51
46
  }
52
47
  }).filter((option)=>!isDisabled.isDisabled(option));
@@ -108,7 +103,7 @@ async function selectOptionsBase(newValue, select, values) {
108
103
  }
109
104
  await wait.wait(this.config);
110
105
  } else {
111
- throw getConfig().getElementError(`Cannot select multiple options on a non-multiple select`, select);
106
+ throw dom.getConfig().getElementError(`Cannot select multiple options on a non-multiple select`, select);
112
107
  }
113
108
  } else if (select.getAttribute('role') === 'listbox') {
114
109
  for (const option of selectedOptions){
@@ -116,7 +111,7 @@ async function selectOptionsBase(newValue, select, values) {
116
111
  await this.unhover(option);
117
112
  }
118
113
  } else {
119
- throw getConfig().getElementError(`Cannot select options on elements that are neither select nor listbox elements`, select);
114
+ throw dom.getConfig().getElementError(`Cannot select options on elements that are neither select nor listbox elements`, select);
120
115
  }
121
116
  }
122
117
 
@@ -1,13 +1,10 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var index = require('../keyboard/index.js');
6
4
  require('../utils/click/isClickableInput.js');
7
5
  require('../utils/dataTransfer/Clipboard.js');
8
6
  require('../utils/edit/isEditable.js');
9
7
  require('../utils/edit/maxLength.js');
10
- require('@testing-library/dom/dist/helpers.js');
11
8
  require('../utils/keyDef/readNextDescriptor.js');
12
9
  require('../utils/misc/level.js');
13
10
  require('../options.js');
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  require('../utils/click/isClickableInput.js');
6
4
  var FileList = require('../utils/dataTransfer/FileList.js');
7
5
  require('../utils/dataTransfer/Clipboard.js');
@@ -20,8 +18,7 @@ async function upload(element, fileOrFiles) {
20
18
  if (!input || !isElementType.isElementType(input, 'input', {
21
19
  type: 'file'
22
20
  })) {
23
- var _input;
24
- throw new TypeError(`The ${input === element ? 'given' : 'associated'} ${(_input = input) === null || _input === void 0 ? void 0 : _input.tagName} element does not accept file uploads`);
21
+ throw new TypeError(`The ${input === element ? 'given' : 'associated'} ${input === null || input === void 0 ? void 0 : input.tagName} element does not accept file uploads`);
25
22
  }
26
23
  if (isDisabled.isDisabled(element)) return;
27
24
  const files = (Array.isArray(fileOrFiles) ? fileOrFiles : [
@@ -1,19 +1,17 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var isElementType = require('../misc/isElementType.js');
6
4
 
7
5
  var clickableInputTypes;
8
6
  (function(clickableInputTypes) {
9
- clickableInputTypes['button'] = 'button';
10
- clickableInputTypes['color'] = 'color';
11
- clickableInputTypes['file'] = 'file';
12
- clickableInputTypes['image'] = 'image';
13
- clickableInputTypes['reset'] = 'reset';
14
- clickableInputTypes['submit'] = 'submit';
15
- clickableInputTypes['checkbox'] = 'checkbox';
16
- clickableInputTypes['radio'] = 'radio';
7
+ clickableInputTypes["button"] = "button";
8
+ clickableInputTypes["color"] = "color";
9
+ clickableInputTypes["file"] = "file";
10
+ clickableInputTypes["image"] = "image";
11
+ clickableInputTypes["reset"] = "reset";
12
+ clickableInputTypes["submit"] = "submit";
13
+ clickableInputTypes["checkbox"] = "checkbox";
14
+ clickableInputTypes["radio"] = "radio";
17
15
  })(clickableInputTypes || (clickableInputTypes = {}));
18
16
  function isClickableInput(element) {
19
17
  return isElementType.isElementType(element, 'button') || isElementType.isElementType(element, 'input') && element.type in clickableInputTypes;
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  // jsdom does not implement Blob.text()
6
4
  function readBlobText(blob, FileReader) {
7
5
  return new Promise((res, rej)=>{
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var getWindow = require('../misc/getWindow.js');
6
4
  var Blob = require('./Blob.js');
7
5
  var DataTransfer = require('./DataTransfer.js');
@@ -86,8 +84,7 @@ function createClipboardStub(window, control) {
86
84
  });
87
85
  }
88
86
  function isClipboardStub(clipboard) {
89
- var _clipboard;
90
- return !!((_clipboard = clipboard) === null || _clipboard === void 0 ? void 0 : _clipboard[ClipboardStubControl]);
87
+ return !!(clipboard === null || clipboard === void 0 ? void 0 : clipboard[ClipboardStubControl]);
91
88
  }
92
89
  function attachClipboardStubToView(window) {
93
90
  if (isClipboardStub(window.navigator.clipboard)) {
@@ -128,9 +125,8 @@ function detachClipboardStubFromView(window) {
128
125
  }
129
126
  }
130
127
  async function readDataTransferFromClipboard(document) {
131
- var _window;
132
128
  const window = document.defaultView;
133
- const clipboard = (_window = window) === null || _window === void 0 ? void 0 : _window.navigator.clipboard;
129
+ const clipboard = window === null || window === void 0 ? void 0 : window.navigator.clipboard;
134
130
  const items = clipboard && await clipboard.read();
135
131
  if (!items) {
136
132
  throw new Error('The Clipboard API is unavailable.');
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var FileList = require('./FileList.js');
6
4
 
7
5
  function _define_property(obj, key, value) {
@@ -70,11 +68,10 @@ function getTypeMatcher(type, exact) {
70
68
  function createDataTransferStub(window) {
71
69
  return new class DataTransferStub {
72
70
  getData(format) {
73
- var _match;
74
71
  var _this_items_find;
75
72
  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));
76
73
  let text = '';
77
- (_match = match) === null || _match === void 0 ? void 0 : _match.getAsString((t)=>{
74
+ match === null || match === void 0 ? void 0 : match.getAsString((t)=>{
78
75
  text = t;
79
76
  });
80
77
  return text;
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  // FileList can not be created per constructor.
6
4
  function createFileList(window, files) {
7
5
  const list = {
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  //jsdom is not supporting isContentEditable
6
4
  function isContentEditable(element) {
7
5
  return element.hasAttribute('contenteditable') && (element.getAttribute('contenteditable') == 'true' || element.getAttribute('contenteditable') == '');
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var isElementType = require('../misc/isElementType.js');
6
4
  var isContentEditable = require('./isContentEditable.js');
7
5
 
@@ -10,18 +8,18 @@ function isEditable(element) {
10
8
  }
11
9
  var editableInputTypes;
12
10
  (function(editableInputTypes) {
13
- editableInputTypes['text'] = 'text';
14
- editableInputTypes['date'] = 'date';
15
- editableInputTypes['datetime-local'] = 'datetime-local';
16
- editableInputTypes['email'] = 'email';
17
- editableInputTypes['month'] = 'month';
18
- editableInputTypes['number'] = 'number';
19
- editableInputTypes['password'] = 'password';
20
- editableInputTypes['search'] = 'search';
21
- editableInputTypes['tel'] = 'tel';
22
- editableInputTypes['time'] = 'time';
23
- editableInputTypes['url'] = 'url';
24
- editableInputTypes['week'] = 'week';
11
+ editableInputTypes["text"] = "text";
12
+ editableInputTypes["date"] = "date";
13
+ editableInputTypes["datetime-local"] = "datetime-local";
14
+ editableInputTypes["email"] = "email";
15
+ editableInputTypes["month"] = "month";
16
+ editableInputTypes["number"] = "number";
17
+ editableInputTypes["password"] = "password";
18
+ editableInputTypes["search"] = "search";
19
+ editableInputTypes["tel"] = "tel";
20
+ editableInputTypes["time"] = "time";
21
+ editableInputTypes["url"] = "url";
22
+ editableInputTypes["week"] = "week";
25
23
  })(editableInputTypes || (editableInputTypes = {}));
26
24
  function isEditableInputOrTextArea(element) {
27
25
  return isElementType.isElementType(element, 'textarea') || isElementType.isElementType(element, 'input') && element.type in editableInputTypes;
@@ -1,17 +1,15 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var isElementType = require('../misc/isElementType.js');
6
4
 
7
5
  var maxLengthSupportedTypes;
8
6
  (function(maxLengthSupportedTypes) {
9
- maxLengthSupportedTypes['email'] = 'email';
10
- maxLengthSupportedTypes['password'] = 'password';
11
- maxLengthSupportedTypes['search'] = 'search';
12
- maxLengthSupportedTypes['telephone'] = 'telephone';
13
- maxLengthSupportedTypes['text'] = 'text';
14
- maxLengthSupportedTypes['url'] = 'url';
7
+ maxLengthSupportedTypes["email"] = "email";
8
+ maxLengthSupportedTypes["password"] = "password";
9
+ maxLengthSupportedTypes["search"] = "search";
10
+ maxLengthSupportedTypes["telephone"] = "telephone";
11
+ maxLengthSupportedTypes["text"] = "text";
12
+ maxLengthSupportedTypes["url"] = "url";
15
13
  })(maxLengthSupportedTypes || (maxLengthSupportedTypes = {}));
16
14
  // can't use .maxLength property because of a jsdom bug:
17
15
  // https://github.com/jsdom/jsdom/issues/2927
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  // It is not possible to create a real FileList programmatically.
6
4
  // Therefore assigning `files` property with a programmatically created FileList results in an error.
7
5
  // Just assigning the property (as per fireEvent) breaks the interweaving with the `value` property.
@@ -40,8 +38,8 @@ function setFiles(el, files) {
40
38
  if (v === '') {
41
39
  restore();
42
40
  } else {
43
- var _valueDescr_set, _valueDescr;
44
- (_valueDescr = valueDescr) === null || _valueDescr === void 0 ? void 0 : (_valueDescr_set = _valueDescr.set) === null || _valueDescr_set === void 0 ? void 0 : _valueDescr_set.call(el, v);
41
+ var _valueDescr_set;
42
+ valueDescr === null || valueDescr === void 0 ? void 0 : (_valueDescr_set = valueDescr.set) === null || _valueDescr_set === void 0 ? void 0 : _valueDescr_set.call(el, v);
45
43
  }
46
44
  }
47
45
  },
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const parseInt = globalThis.parseInt;
6
4
  function buildTimeValue(value) {
7
5
  const onlyDigitsValue = value.replace(/\D/g, '');
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var isContentEditable = require('../edit/isContentEditable.js');
6
4
  var isElementType = require('../misc/isElementType.js');
7
5
 
@@ -1,13 +1,10 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var isDisabled = require('../misc/isDisabled.js');
6
4
 
7
5
  function getActiveElement(document) {
8
- var _activeElement;
9
6
  const activeElement = document.activeElement;
10
- if ((_activeElement = activeElement) === null || _activeElement === void 0 ? void 0 : _activeElement.shadowRoot) {
7
+ if (activeElement === null || activeElement === void 0 ? void 0 : activeElement.shadowRoot) {
11
8
  return getActiveElement(activeElement.shadowRoot);
12
9
  } else {
13
10
  // Browser does not yield disabled elements as document.activeElement - jsdom does
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var isDisabled = require('../misc/isDisabled.js');
6
4
  var isElementType = require('../misc/isElementType.js');
7
5
  var isVisible = require('../misc/isVisible.js');
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var selector = require('./selector.js');
6
4
 
7
5
  function isFocusable(element) {
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var isClickableInput = require('../click/isClickableInput.js');
6
4
  var isEditable = require('../edit/isEditable.js');
7
5
 
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  const FOCUSABLE_SELECTOR = [
6
4
  'input:not([type=hidden]):not([disabled])',
7
5
  'button:not([disabled])',
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var isClickableInput = require('./click/isClickableInput.js');
6
4
  var Blob = require('./dataTransfer/Blob.js');
7
5
  var DataTransfer = require('./dataTransfer/DataTransfer.js');
@@ -72,7 +70,7 @@ exports.isDescendantOrSelf = isDescendantOrSelf.isDescendantOrSelf;
72
70
  exports.isElementType = isElementType.isElementType;
73
71
  exports.isVisible = isVisible.isVisible;
74
72
  exports.isDisabled = isDisabled.isDisabled;
75
- Object.defineProperty(exports, 'ApiLevel', {
73
+ Object.defineProperty(exports, "ApiLevel", {
76
74
  enumerable: true,
77
75
  get: function () { return level.ApiLevel; }
78
76
  });
@@ -1,11 +1,9 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var bracketDict;
6
4
  (function(bracketDict) {
7
- bracketDict['{'] = '}';
8
- bracketDict['['] = ']';
5
+ bracketDict["{"] = "}";
6
+ bracketDict["["] = "]";
9
7
  })(bracketDict || (bracketDict = {}));
10
8
  /**
11
9
  * Read the next key definition from user input
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  function cloneEvent(event) {
6
4
  return new event.constructor(event.type, event);
7
5
  }
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  function findClosest(element, callback) {
6
4
  let el = element;
7
5
  do {
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  function getDocumentFromNode(el) {
6
4
  return isDocument(el) ? el : el.ownerDocument;
7
5
  }
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  function getTreeDiff(a, b) {
6
4
  const treeA = [];
7
5
  for(let el = a; el; el = el.parentElement){
@@ -1,12 +1,19 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var dtlHelpers = require('../../_interop/dtlHelpers.js');
6
-
7
- const { getWindowFromNode } = dtlHelpers;
8
3
  function getWindow(node) {
9
- return getWindowFromNode(node);
4
+ var _node_ownerDocument;
5
+ if (isDocument(node) && node.defaultView) {
6
+ return node.defaultView;
7
+ } else if ((_node_ownerDocument = node.ownerDocument) === null || _node_ownerDocument === void 0 ? void 0 : _node_ownerDocument.defaultView) {
8
+ return node.ownerDocument.defaultView;
9
+ }
10
+ throw new Error(`Could not determine window of node. Node was ${describe(node)}`);
11
+ }
12
+ function isDocument(node) {
13
+ return node.nodeType === 9;
14
+ }
15
+ function describe(val) {
16
+ return typeof val === 'function' ? `function ${val.name}` : val === null ? 'null' : String(val);
10
17
  }
11
18
 
12
19
  exports.getWindow = getWindow;
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  function isDescendantOrSelf(potentialDescendant, potentialAncestor) {
6
4
  let el = potentialDescendant;
7
5
  do {
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var isElementType = require('./isElementType.js');
6
4
 
7
5
  // This should probably just rely on the :disabled pseudo-class, but JSDOM doesn't implement it properly.
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  function isElementType(element, tag, props) {
6
4
  if (element.namespaceURI && element.namespaceURI !== 'http://www.w3.org/1999/xhtml') {
7
5
  return false;
@@ -1,13 +1,10 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var getWindow = require('./getWindow.js');
6
4
 
7
5
  function isVisible(element) {
8
- var _el;
9
6
  const window = getWindow.getWindow(element);
10
- for(let el = element; (_el = el) === null || _el === void 0 ? void 0 : _el.ownerDocument; el = el.parentElement){
7
+ for(let el = element; el === null || el === void 0 ? void 0 : el.ownerDocument; el = el.parentElement){
11
8
  const { display, visibility } = window.getComputedStyle(el);
12
9
  if (display === 'none') {
13
10
  return false;
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  exports.ApiLevel = void 0;
6
4
  (function(ApiLevel) {
7
5
  ApiLevel[ApiLevel["Trigger"] = 2] = "Trigger";
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  function wait(config) {
6
4
  const delay = config.delay;
7
5
  if (typeof delay !== 'number') {
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var options = require('../../options.js');
6
4
  var getWindow = require('../misc/getWindow.js');
7
5
  var isElementType = require('../misc/isElementType.js');
@@ -12,9 +10,8 @@ function hasPointerEvents(instance, element) {
12
10
  return ((_checkPointerEvents = checkPointerEvents(instance, element)) === null || _checkPointerEvents === void 0 ? void 0 : _checkPointerEvents.pointerEvents) !== 'none';
13
11
  }
14
12
  function closestPointerEventsDeclaration(element) {
15
- var _el;
16
13
  const window = getWindow.getWindow(element);
17
- for(let el = element, tree = []; (_el = el) === null || _el === void 0 ? void 0 : _el.ownerDocument; el = el.parentElement){
14
+ for(let el = element, tree = []; el === null || el === void 0 ? void 0 : el.ownerDocument; el = el.parentElement){
18
15
  tree.push(el);
19
16
  const pointerEvents = window.getComputedStyle(el).pointerEvents;
20
17
  if (pointerEvents && ![
@@ -34,8 +31,7 @@ function checkPointerEvents(instance, element) {
34
31
  const lastCheck = element[PointerEventsCheck];
35
32
  const needsCheck = instance.config.pointerEventsCheck !== options.PointerEventsCheckLevel.Never && (!lastCheck || hasBitFlag(instance.config.pointerEventsCheck, options.PointerEventsCheckLevel.EachApiCall) && lastCheck[level.ApiLevel.Call] !== level.getLevelRef(instance, level.ApiLevel.Call) || hasBitFlag(instance.config.pointerEventsCheck, options.PointerEventsCheckLevel.EachTrigger) && lastCheck[level.ApiLevel.Trigger] !== level.getLevelRef(instance, level.ApiLevel.Trigger));
36
33
  if (!needsCheck) {
37
- var _lastCheck;
38
- return (_lastCheck = lastCheck) === null || _lastCheck === void 0 ? void 0 : _lastCheck.result;
34
+ return lastCheck === null || lastCheck === void 0 ? void 0 : lastCheck.result;
39
35
  }
40
36
  const declaration = closestPointerEventsDeclaration(element);
41
37
  element[PointerEventsCheck] = {
@@ -46,9 +42,8 @@ function checkPointerEvents(instance, element) {
46
42
  return declaration;
47
43
  }
48
44
  function assertPointerEvents(instance, element) {
49
- var _declaration;
50
45
  const declaration = checkPointerEvents(instance, element);
51
- if (((_declaration = declaration) === null || _declaration === void 0 ? void 0 : _declaration.pointerEvents) === 'none') {
46
+ if ((declaration === null || declaration === void 0 ? void 0 : declaration.pointerEvents) === 'none') {
52
47
  throw new Error([
53
48
  `Unable to perform pointer interaction as the element ${declaration.tree.length > 1 ? 'inherits' : 'has'} \`pointer-events: none\`:`,
54
49
  '',
@@ -68,7 +63,7 @@ function printTree(tree) {
68
63
  ].filter(Boolean).join('')).join('\n');
69
64
  }
70
65
  function getLabelDescr(element) {
71
- var _element_labels, _label, _label1;
66
+ var _element_labels;
72
67
  let label;
73
68
  if (element.hasAttribute('aria-label')) {
74
69
  label = element.getAttribute('aria-label');
@@ -92,10 +87,9 @@ function getLabelDescr(element) {
92
87
  var _element_textContent;
93
88
  label = (_element_textContent = element.textContent) === null || _element_textContent === void 0 ? void 0 : _element_textContent.trim();
94
89
  }
95
- label = (_label = label) === null || _label === void 0 ? void 0 : _label.replace(/\n/g, ' ');
96
- if (Number((_label1 = label) === null || _label1 === void 0 ? void 0 : _label1.length) > 30) {
97
- var _label2;
98
- label = `${(_label2 = label) === null || _label2 === void 0 ? void 0 : _label2.substring(0, 29)}…`;
90
+ label = label === null || label === void 0 ? void 0 : label.replace(/\n/g, ' ');
91
+ if (Number(label === null || label === void 0 ? void 0 : label.length) > 30) {
92
+ label = `${label === null || label === void 0 ? void 0 : label.substring(0, 29)}…`;
99
93
  }
100
94
  return label ? `(label=${label})` : '';
101
95
  }
@@ -2,7 +2,6 @@ import '../utils/click/isClickableInput.js';
2
2
  import { writeDataTransferToClipboard } from '../utils/dataTransfer/Clipboard.js';
3
3
  import '../utils/edit/isEditable.js';
4
4
  import '../utils/edit/maxLength.js';
5
- import '@testing-library/dom/dist/helpers.js';
6
5
  import '../utils/keyDef/readNextDescriptor.js';
7
6
  import '../utils/misc/level.js';
8
7
  import '../options.js';