@thednp/shorty 1.0.1 → 2.0.0-alpha1

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 (1088) hide show
  1. package/README.md +195 -199
  2. package/dist/index.cjs.js +1564 -0
  3. package/dist/index.cjs.js.map +7 -0
  4. package/dist/index.cjs.min.js +3 -0
  5. package/dist/index.cjs.min.js.map +7 -0
  6. package/dist/index.js +1542 -0
  7. package/dist/index.js.map +7 -0
  8. package/dist/index.min.js +3 -0
  9. package/dist/index.min.js.map +7 -0
  10. package/package.json +32 -24
  11. package/src/attr/getAttribute.js +3 -9
  12. package/src/attr/getAttribute.js.map +1 -0
  13. package/src/attr/getAttribute.ts +10 -0
  14. package/src/attr/getAttributeNS.js +3 -10
  15. package/src/attr/getAttributeNS.js.map +1 -0
  16. package/src/attr/getAttributeNS.ts +11 -0
  17. package/src/attr/hasAttribute.js +3 -9
  18. package/src/attr/hasAttribute.js.map +1 -0
  19. package/src/attr/hasAttribute.ts +9 -0
  20. package/src/attr/hasAttributeNS.js +3 -10
  21. package/src/attr/hasAttributeNS.js.map +1 -0
  22. package/src/attr/hasAttributeNS.ts +11 -0
  23. package/src/attr/removeAttribute.js +3 -9
  24. package/src/attr/removeAttribute.js.map +1 -0
  25. package/src/attr/removeAttribute.ts +8 -0
  26. package/src/attr/removeAttributeNS.js +3 -10
  27. package/src/attr/removeAttributeNS.js.map +1 -0
  28. package/src/attr/removeAttributeNS.ts +10 -0
  29. package/src/attr/setAttribute.js +3 -10
  30. package/src/attr/setAttribute.js.map +1 -0
  31. package/src/attr/setAttribute.ts +10 -0
  32. package/src/attr/setAttributeNS.js +3 -11
  33. package/src/attr/setAttributeNS.js.map +1 -0
  34. package/src/attr/setAttributeNS.ts +11 -0
  35. package/src/blocks/documentBody.js +3 -5
  36. package/src/blocks/documentBody.js.map +1 -0
  37. package/src/blocks/documentBody.ts +5 -0
  38. package/src/blocks/documentElement.js +3 -5
  39. package/src/blocks/documentElement.js.map +1 -0
  40. package/src/blocks/documentElement.ts +5 -0
  41. package/src/blocks/documentHead.js +3 -5
  42. package/src/blocks/documentHead.js.map +1 -0
  43. package/src/blocks/documentHead.ts +5 -0
  44. package/src/boolean/isApple.js +8 -13
  45. package/src/boolean/isApple.js.map +1 -0
  46. package/src/boolean/isApple.ts +14 -0
  47. package/src/boolean/isFirefox.js +4 -9
  48. package/src/boolean/isFirefox.js.map +1 -0
  49. package/src/boolean/isFirefox.ts +9 -0
  50. package/src/boolean/isMobile.js +13 -20
  51. package/src/boolean/isMobile.js.map +1 -0
  52. package/src/boolean/isMobile.ts +19 -0
  53. package/src/boolean/support3DTransform.js +4 -8
  54. package/src/boolean/support3DTransform.js.map +1 -0
  55. package/src/boolean/support3DTransform.ts +10 -0
  56. package/src/boolean/supportAnimation.js +4 -8
  57. package/src/boolean/supportAnimation.js.map +1 -0
  58. package/src/boolean/supportAnimation.ts +8 -0
  59. package/src/boolean/supportPassive.js +19 -28
  60. package/src/boolean/supportPassive.js.map +1 -0
  61. package/src/boolean/supportPassive.ts +28 -0
  62. package/src/boolean/supportTouch.js +3 -6
  63. package/src/boolean/supportTouch.js.map +1 -0
  64. package/src/boolean/supportTouch.ts +7 -0
  65. package/src/boolean/supportTransform.js +4 -8
  66. package/src/boolean/supportTransform.js.map +1 -0
  67. package/src/boolean/supportTransform.ts +8 -0
  68. package/src/boolean/supportTransition.js +4 -8
  69. package/src/boolean/supportTransition.js.map +1 -0
  70. package/src/boolean/supportTransition.ts +8 -0
  71. package/src/class/addClass.js +5 -10
  72. package/src/class/addClass.js.map +1 -0
  73. package/src/class/addClass.ts +11 -0
  74. package/src/class/hasClass.js +5 -10
  75. package/src/class/hasClass.js.map +1 -0
  76. package/src/class/hasClass.ts +11 -0
  77. package/src/class/removeClass.js +5 -10
  78. package/src/class/removeClass.js.map +1 -0
  79. package/src/class/removeClass.ts +11 -0
  80. package/src/event/off.js +5 -13
  81. package/src/event/off.js.map +1 -0
  82. package/src/event/off.ts +12 -0
  83. package/src/event/on.js +5 -13
  84. package/src/event/on.js.map +1 -0
  85. package/src/event/on.ts +12 -0
  86. package/src/event/one.js +13 -26
  87. package/src/event/one.js.map +1 -0
  88. package/src/event/one.ts +25 -0
  89. package/src/get/getBoundingClientRect.js +23 -33
  90. package/src/get/getBoundingClientRect.js.map +1 -0
  91. package/src/get/getBoundingClientRect.ts +38 -0
  92. package/src/get/getDocument.js +14 -11
  93. package/src/get/getDocument.js.map +1 -0
  94. package/src/get/getDocument.ts +23 -0
  95. package/src/get/getDocumentBody.js +6 -10
  96. package/src/get/getDocumentBody.js.map +1 -0
  97. package/src/get/getDocumentBody.ts +13 -0
  98. package/src/get/getDocumentElement.js +6 -11
  99. package/src/get/getDocumentElement.js.map +1 -0
  100. package/src/get/getDocumentElement.ts +13 -0
  101. package/src/get/getDocumentHead.js +6 -10
  102. package/src/get/getDocumentHead.js.map +1 -0
  103. package/src/get/getDocumentHead.ts +12 -0
  104. package/src/get/getElementAnimationDelay.js +12 -21
  105. package/src/get/getElementAnimationDelay.js.map +1 -0
  106. package/src/get/getElementAnimationDelay.ts +23 -0
  107. package/src/get/getElementAnimationDuration.js +12 -20
  108. package/src/get/getElementAnimationDuration.js.map +1 -0
  109. package/src/get/getElementAnimationDuration.ts +22 -0
  110. package/src/get/getElementStyle.js +8 -18
  111. package/src/get/getElementStyle.js.map +1 -0
  112. package/src/get/getElementStyle.ts +22 -0
  113. package/src/get/getElementTransitionDelay.js +12 -21
  114. package/src/get/getElementTransitionDelay.js.map +1 -0
  115. package/src/get/getElementTransitionDelay.ts +22 -0
  116. package/src/get/getElementTransitionDuration.js +12 -20
  117. package/src/get/getElementTransitionDuration.js.map +1 -0
  118. package/src/get/getElementTransitionDuration.ts +22 -0
  119. package/src/get/getNodeScroll.js +9 -16
  120. package/src/get/getNodeScroll.js.map +1 -0
  121. package/src/get/getNodeScroll.ts +20 -0
  122. package/src/get/getParentNode.js +13 -24
  123. package/src/get/getParentNode.js.map +1 -0
  124. package/src/get/getParentNode.ts +25 -0
  125. package/src/get/getRectRelativeToOffsetParent.js +21 -30
  126. package/src/get/getRectRelativeToOffsetParent.js.map +1 -0
  127. package/src/get/getRectRelativeToOffsetParent.ts +39 -0
  128. package/src/get/getUID.js +31 -34
  129. package/src/get/getUID.js.map +1 -0
  130. package/src/get/getUID.ts +36 -0
  131. package/src/get/getWindow.js +13 -20
  132. package/src/get/getWindow.js.map +1 -0
  133. package/src/get/getWindow.ts +22 -0
  134. package/src/index.js +411 -471
  135. package/src/index.js.map +1 -0
  136. package/src/index.ts +442 -0
  137. package/src/interface/boundingClientRect.js +2 -0
  138. package/src/interface/boundingClientRect.js.map +1 -0
  139. package/src/interface/boundingClientRect.ts +10 -0
  140. package/src/interface/navigatorUA.js +2 -0
  141. package/src/interface/navigatorUA.js.map +1 -0
  142. package/src/interface/navigatorUA.ts +15 -0
  143. package/src/interface/offsetRect.js +2 -0
  144. package/src/interface/offsetRect.js.map +1 -0
  145. package/src/interface/offsetRect.ts +6 -0
  146. package/src/interface/originalEvent.js +2 -0
  147. package/src/interface/originalEvent.js.map +1 -0
  148. package/src/interface/originalEvent.ts +3 -0
  149. package/src/is/isArray.js +3 -9
  150. package/src/is/isArray.js.map +1 -0
  151. package/src/is/isArray.ts +9 -0
  152. package/src/is/isCustomElement.js +3 -8
  153. package/src/is/isCustomElement.js.map +1 -0
  154. package/src/is/isCustomElement.ts +10 -0
  155. package/src/is/isDocument.js +3 -9
  156. package/src/is/isDocument.js.map +1 -0
  157. package/src/is/isDocument.ts +10 -0
  158. package/src/is/isElement.js +3 -9
  159. package/src/is/isElement.js.map +1 -0
  160. package/src/is/isElement.ts +22 -0
  161. package/src/is/isElementInScrollRange.js +12 -18
  162. package/src/is/isElementInScrollRange.js.map +1 -0
  163. package/src/is/isElementInScrollRange.ts +20 -0
  164. package/src/is/isElementInViewport.js +12 -22
  165. package/src/is/isElementInViewport.js.map +1 -0
  166. package/src/is/isElementInViewport.ts +20 -0
  167. package/src/is/isElementsArray.js +5 -10
  168. package/src/is/isElementsArray.js.map +1 -0
  169. package/src/is/isElementsArray.ts +13 -0
  170. package/src/is/isFunction.js +3 -9
  171. package/src/is/isFunction.js.map +1 -0
  172. package/src/is/isFunction.ts +10 -0
  173. package/src/is/isHTMLCollection.js +3 -8
  174. package/src/is/isHTMLCollection.js.map +1 -0
  175. package/src/is/isHTMLCollection.ts +10 -0
  176. package/src/is/isHTMLElement.js +3 -8
  177. package/src/is/isHTMLElement.js.map +1 -0
  178. package/src/is/isHTMLElement.ts +10 -0
  179. package/src/is/isHTMLImageElement.js +3 -8
  180. package/src/is/isHTMLImageElement.js.map +1 -0
  181. package/src/is/isHTMLImageElement.ts +9 -0
  182. package/src/is/isMedia.js +6 -12
  183. package/src/is/isMedia.js.map +1 -0
  184. package/src/is/isMedia.ts +16 -0
  185. package/src/is/isNode.js +3 -8
  186. package/src/is/isNode.js.map +1 -0
  187. package/src/is/isNode.ts +11 -0
  188. package/src/is/isNodeList.js +3 -8
  189. package/src/is/isNodeList.js.map +1 -0
  190. package/src/is/isNodeList.ts +11 -0
  191. package/src/is/isNumber.js +3 -0
  192. package/src/is/isNumber.js.map +1 -0
  193. package/src/is/isNumber.ts +9 -0
  194. package/src/is/isObject.js +3 -0
  195. package/src/is/isObject.js.map +1 -0
  196. package/src/is/isObject.ts +9 -0
  197. package/src/is/isRTL.js +4 -9
  198. package/src/is/isRTL.js.map +1 -0
  199. package/src/is/isRTL.ts +10 -0
  200. package/src/is/isSVGElement.js +3 -8
  201. package/src/is/isSVGElement.js.map +1 -0
  202. package/src/is/isSVGElement.ts +11 -0
  203. package/src/is/isScaledElement.js +10 -15
  204. package/src/is/isScaledElement.js.map +1 -0
  205. package/src/is/isScaledElement.ts +16 -0
  206. package/src/is/isShadowRoot.js +3 -12
  207. package/src/is/isShadowRoot.js.map +1 -0
  208. package/src/is/isShadowRoot.ts +10 -0
  209. package/src/is/isString.js +3 -8
  210. package/src/is/isString.js.map +1 -0
  211. package/src/is/isString.ts +9 -0
  212. package/src/is/isTableElement.js +3 -7
  213. package/src/is/isTableElement.js.map +1 -0
  214. package/src/is/isTableElement.ts +12 -0
  215. package/src/is/isWindow.js +3 -9
  216. package/src/is/isWindow.js.map +1 -0
  217. package/src/is/isWindow.ts +10 -0
  218. package/src/misc/ArrayFrom.js +3 -8
  219. package/src/misc/ArrayFrom.js.map +1 -0
  220. package/src/misc/ArrayFrom.ts +9 -0
  221. package/src/misc/Float32ArrayFrom.js +3 -7
  222. package/src/misc/Float32ArrayFrom.js.map +1 -0
  223. package/src/misc/Float32ArrayFrom.ts +9 -0
  224. package/src/misc/Float64ArrayFrom.js +3 -7
  225. package/src/misc/Float64ArrayFrom.js.map +1 -0
  226. package/src/misc/Float64ArrayFrom.ts +9 -0
  227. package/src/misc/ObjectAssign.js +3 -7
  228. package/src/misc/ObjectAssign.js.map +1 -0
  229. package/src/misc/ObjectAssign.ts +8 -0
  230. package/src/misc/ObjectEntries.js +3 -0
  231. package/src/misc/ObjectEntries.js.map +1 -0
  232. package/src/misc/ObjectEntries.ts +8 -0
  233. package/src/misc/ObjectKeys.js +3 -7
  234. package/src/misc/ObjectKeys.js.map +1 -0
  235. package/src/misc/ObjectKeys.ts +8 -0
  236. package/src/misc/ObjectValues.js +3 -7
  237. package/src/misc/ObjectValues.js.map +1 -0
  238. package/src/misc/ObjectValues.ts +8 -0
  239. package/src/misc/OriginalEvent.js +14 -18
  240. package/src/misc/OriginalEvent.js.map +1 -0
  241. package/src/misc/OriginalEvent.ts +24 -0
  242. package/src/misc/createElement.js +22 -25
  243. package/src/misc/createElement.js.map +1 -0
  244. package/src/misc/createElement.ts +36 -0
  245. package/src/misc/createElementNS.js +22 -26
  246. package/src/misc/createElementNS.js.map +1 -0
  247. package/src/misc/createElementNS.ts +41 -0
  248. package/src/misc/data.js +36 -78
  249. package/src/misc/data.js.map +1 -0
  250. package/src/misc/data.ts +79 -0
  251. package/src/misc/dispatchEvent.js +3 -8
  252. package/src/misc/dispatchEvent.js.map +1 -0
  253. package/src/misc/dispatchEvent.ts +9 -0
  254. package/src/misc/distinct.js +3 -10
  255. package/src/misc/distinct.js.map +1 -0
  256. package/src/misc/distinct.ts +17 -0
  257. package/src/misc/emulateAnimationEnd.js +29 -37
  258. package/src/misc/emulateAnimationEnd.js.map +1 -0
  259. package/src/misc/{emulateAnimationEndLegacy.js → emulateAnimationEnd.ts} +15 -12
  260. package/src/misc/emulateTransitionEnd.js +29 -37
  261. package/src/misc/emulateTransitionEnd.js.map +1 -0
  262. package/src/misc/{emulateTransitionEndLegacy.js → emulateTransitionEnd.ts} +15 -12
  263. package/src/misc/focus.js +3 -8
  264. package/src/misc/focus.js.map +1 -0
  265. package/src/misc/focus.ts +8 -0
  266. package/src/misc/noop.js +3 -3
  267. package/src/misc/noop.js.map +1 -0
  268. package/src/misc/noop.ts +4 -0
  269. package/src/misc/normalizeOptions.js +31 -49
  270. package/src/misc/normalizeOptions.js.map +1 -0
  271. package/src/misc/normalizeOptions.ts +51 -0
  272. package/src/misc/normalizeValue.js +17 -32
  273. package/src/misc/normalizeValue.js.map +1 -0
  274. package/src/misc/normalizeValue.ts +40 -0
  275. package/src/misc/passiveHandler.js +3 -7
  276. package/src/misc/passiveHandler.js.map +1 -0
  277. package/src/misc/passiveHandler.ts +6 -0
  278. package/src/misc/reflow.js +3 -9
  279. package/src/misc/reflow.js.map +1 -0
  280. package/src/misc/reflow.ts +9 -0
  281. package/src/misc/setElementStyle.js +16 -10
  282. package/src/misc/setElementStyle.js.map +1 -0
  283. package/src/misc/setElementStyle.ts +20 -0
  284. package/src/misc/timer.js +47 -78
  285. package/src/misc/timer.js.map +1 -0
  286. package/src/misc/timer.ts +74 -0
  287. package/src/misc/toLowerCase.js +3 -8
  288. package/src/misc/toLowerCase.js.map +1 -0
  289. package/src/misc/toLowerCase.ts +9 -0
  290. package/src/misc/toUpperCase.js +3 -8
  291. package/src/misc/toUpperCase.js.map +1 -0
  292. package/src/misc/toUpperCase.ts +9 -0
  293. package/src/selectors/closest.js +8 -16
  294. package/src/selectors/closest.js.map +1 -0
  295. package/src/selectors/closest.ts +20 -0
  296. package/src/selectors/getCustomElements.js +8 -17
  297. package/src/selectors/getCustomElements.js.map +1 -0
  298. package/src/selectors/getCustomElements.ts +18 -0
  299. package/src/selectors/getElementById.js +6 -11
  300. package/src/selectors/getElementById.js.map +1 -0
  301. package/src/selectors/getElementById.ts +16 -0
  302. package/src/selectors/getElementsByClassName.js +8 -14
  303. package/src/selectors/getElementsByClassName.js.map +1 -0
  304. package/src/selectors/getElementsByClassName.ts +22 -0
  305. package/src/selectors/getElementsByTagName.js +8 -14
  306. package/src/selectors/getElementsByTagName.js.map +1 -0
  307. package/src/selectors/getElementsByTagName.ts +20 -0
  308. package/src/selectors/matches.js +3 -10
  309. package/src/selectors/matches.js.map +1 -0
  310. package/src/selectors/matches.ts +10 -0
  311. package/src/selectors/querySelector.js +11 -17
  312. package/src/selectors/querySelector.js.map +1 -0
  313. package/src/selectors/querySelector.ts +21 -0
  314. package/src/selectors/querySelectorAll.js +8 -13
  315. package/src/selectors/querySelectorAll.js.map +1 -0
  316. package/src/selectors/querySelectorAll.ts +16 -0
  317. package/src/strings/DOMContentLoadedEvent.js +3 -6
  318. package/src/strings/DOMContentLoadedEvent.js.map +1 -0
  319. package/src/strings/DOMContentLoadedEvent.ts +5 -0
  320. package/src/strings/DOMMouseScrollEvent.js +3 -6
  321. package/src/strings/DOMMouseScrollEvent.js.map +1 -0
  322. package/src/strings/DOMMouseScrollEvent.ts +5 -0
  323. package/src/strings/abortEvent.js +3 -6
  324. package/src/strings/abortEvent.js.map +1 -0
  325. package/src/strings/abortEvent.ts +5 -0
  326. package/src/strings/addEventListener.js +3 -6
  327. package/src/strings/addEventListener.js.map +1 -0
  328. package/src/strings/addEventListener.ts +5 -0
  329. package/src/strings/animationDelay.js +3 -6
  330. package/src/strings/animationDelay.js.map +1 -0
  331. package/src/strings/animationDelay.ts +5 -0
  332. package/src/strings/animationDuration.js +3 -6
  333. package/src/strings/animationDuration.js.map +1 -0
  334. package/src/strings/animationDuration.ts +5 -0
  335. package/src/strings/animationEndEvent.js +3 -6
  336. package/src/strings/animationEndEvent.js.map +1 -0
  337. package/src/strings/animationEndEvent.ts +5 -0
  338. package/src/strings/animationName.js +3 -6
  339. package/src/strings/animationName.js.map +1 -0
  340. package/src/strings/animationName.ts +5 -0
  341. package/src/strings/ariaChecked.js +3 -6
  342. package/src/strings/ariaChecked.js.map +1 -0
  343. package/src/strings/ariaChecked.ts +5 -0
  344. package/src/strings/ariaDescribedBy.js +3 -6
  345. package/src/strings/ariaDescribedBy.js.map +1 -0
  346. package/src/strings/ariaDescribedBy.ts +5 -0
  347. package/src/strings/ariaDescription.js +3 -6
  348. package/src/strings/ariaDescription.js.map +1 -0
  349. package/src/strings/ariaDescription.ts +5 -0
  350. package/src/strings/ariaExpanded.js +3 -6
  351. package/src/strings/ariaExpanded.js.map +1 -0
  352. package/src/strings/ariaExpanded.ts +5 -0
  353. package/src/strings/ariaHasPopup.js +3 -6
  354. package/src/strings/ariaHasPopup.js.map +1 -0
  355. package/src/strings/ariaHasPopup.ts +5 -0
  356. package/src/strings/ariaHidden.js +3 -6
  357. package/src/strings/ariaHidden.js.map +1 -0
  358. package/src/strings/ariaHidden.ts +5 -0
  359. package/src/strings/ariaLabel.js +3 -6
  360. package/src/strings/ariaLabel.js.map +1 -0
  361. package/src/strings/ariaLabel.ts +5 -0
  362. package/src/strings/ariaLabelledBy.js +3 -6
  363. package/src/strings/ariaLabelledBy.js.map +1 -0
  364. package/src/strings/ariaLabelledBy.ts +5 -0
  365. package/src/strings/ariaModal.js +3 -6
  366. package/src/strings/ariaModal.js.map +1 -0
  367. package/src/strings/ariaModal.ts +5 -0
  368. package/src/strings/ariaPressed.js +3 -6
  369. package/src/strings/ariaPressed.js.map +1 -0
  370. package/src/strings/ariaPressed.ts +5 -0
  371. package/src/strings/ariaSelected.js +3 -6
  372. package/src/strings/ariaSelected.js.map +1 -0
  373. package/src/strings/ariaSelected.ts +5 -0
  374. package/src/strings/ariaValueMax.js +3 -6
  375. package/src/strings/ariaValueMax.js.map +1 -0
  376. package/src/strings/ariaValueMax.ts +5 -0
  377. package/src/strings/ariaValueMin.js +3 -6
  378. package/src/strings/ariaValueMin.js.map +1 -0
  379. package/src/strings/ariaValueMin.ts +5 -0
  380. package/src/strings/ariaValueNow.js +3 -6
  381. package/src/strings/ariaValueNow.js.map +1 -0
  382. package/src/strings/ariaValueNow.ts +5 -0
  383. package/src/strings/ariaValueText.js +3 -6
  384. package/src/strings/ariaValueText.js.map +1 -0
  385. package/src/strings/ariaValueText.ts +5 -0
  386. package/src/strings/beforeunloadEvent.js +3 -6
  387. package/src/strings/beforeunloadEvent.js.map +1 -0
  388. package/src/strings/beforeunloadEvent.ts +5 -0
  389. package/src/strings/bezierEasings.js +29 -33
  390. package/src/strings/bezierEasings.js.map +1 -0
  391. package/src/strings/bezierEasings.ts +32 -0
  392. package/src/strings/blurEvent.js +3 -6
  393. package/src/strings/blurEvent.js.map +1 -0
  394. package/src/strings/blurEvent.ts +5 -0
  395. package/src/strings/changeEvent.js +3 -6
  396. package/src/strings/changeEvent.js.map +1 -0
  397. package/src/strings/changeEvent.ts +5 -0
  398. package/src/strings/contextmenuEvent.js +3 -6
  399. package/src/strings/contextmenuEvent.js.map +1 -0
  400. package/src/strings/contextmenuEvent.ts +5 -0
  401. package/src/strings/errorEvent.js +3 -6
  402. package/src/strings/errorEvent.js.map +1 -0
  403. package/src/strings/errorEvent.ts +5 -0
  404. package/src/strings/focusEvent.js +3 -6
  405. package/src/strings/focusEvent.js.map +1 -0
  406. package/src/strings/focusEvent.ts +5 -0
  407. package/src/strings/focusEvents.js +3 -6
  408. package/src/strings/focusEvents.js.map +1 -0
  409. package/src/strings/focusEvents.ts +5 -0
  410. package/src/strings/focusinEvent.js +3 -6
  411. package/src/strings/focusinEvent.js.map +1 -0
  412. package/src/strings/focusinEvent.ts +5 -0
  413. package/src/strings/focusoutEvent.js +3 -6
  414. package/src/strings/focusoutEvent.js.map +1 -0
  415. package/src/strings/focusoutEvent.ts +5 -0
  416. package/src/strings/gesturechangeEvent.js +3 -6
  417. package/src/strings/gesturechangeEvent.js.map +1 -0
  418. package/src/strings/gesturechangeEvent.ts +5 -0
  419. package/src/strings/gestureendEvent.js +3 -6
  420. package/src/strings/gestureendEvent.js.map +1 -0
  421. package/src/strings/gestureendEvent.ts +5 -0
  422. package/src/strings/gesturestartEvent.js +3 -6
  423. package/src/strings/gesturestartEvent.js.map +1 -0
  424. package/src/strings/gesturestartEvent.ts +5 -0
  425. package/src/strings/keyAlt.js +3 -7
  426. package/src/strings/keyAlt.js.map +1 -0
  427. package/src/strings/keyAlt.ts +7 -0
  428. package/src/strings/keyArrowDown.js +3 -7
  429. package/src/strings/keyArrowDown.js.map +1 -0
  430. package/src/strings/keyArrowDown.ts +7 -0
  431. package/src/strings/keyArrowLeft.js +3 -7
  432. package/src/strings/keyArrowLeft.js.map +1 -0
  433. package/src/strings/keyArrowLeft.ts +7 -0
  434. package/src/strings/keyArrowRight.js +3 -7
  435. package/src/strings/keyArrowRight.js.map +1 -0
  436. package/src/strings/keyArrowRight.ts +7 -0
  437. package/src/strings/keyArrowUp.js +3 -7
  438. package/src/strings/keyArrowUp.js.map +1 -0
  439. package/src/strings/keyArrowUp.ts +7 -0
  440. package/src/strings/keyBackspace.js +3 -7
  441. package/src/strings/keyBackspace.js.map +1 -0
  442. package/src/strings/keyBackspace.ts +7 -0
  443. package/src/strings/keyCapsLock.js +3 -7
  444. package/src/strings/keyCapsLock.js.map +1 -0
  445. package/src/strings/keyCapsLock.ts +7 -0
  446. package/src/strings/keyControl.js +3 -7
  447. package/src/strings/keyControl.js.map +1 -0
  448. package/src/strings/keyControl.ts +7 -0
  449. package/src/strings/keyDelete.js +3 -7
  450. package/src/strings/keyDelete.js.map +1 -0
  451. package/src/strings/keyDelete.ts +7 -0
  452. package/src/strings/keyEnter.js +3 -7
  453. package/src/strings/keyEnter.js.map +1 -0
  454. package/src/strings/keyEnter.ts +7 -0
  455. package/src/strings/keyEscape.js +3 -7
  456. package/src/strings/keyEscape.js.map +1 -0
  457. package/src/strings/keyEscape.ts +7 -0
  458. package/src/strings/keyInsert.js +3 -7
  459. package/src/strings/keyInsert.js.map +1 -0
  460. package/src/strings/keyInsert.ts +7 -0
  461. package/src/strings/keyMeta.js +3 -7
  462. package/src/strings/keyMeta.js.map +1 -0
  463. package/src/strings/keyMeta.ts +7 -0
  464. package/src/strings/keyPause.js +3 -7
  465. package/src/strings/keyPause.js.map +1 -0
  466. package/src/strings/keyPause.ts +7 -0
  467. package/src/strings/keyScrollLock.js +3 -7
  468. package/src/strings/keyScrollLock.js.map +1 -0
  469. package/src/strings/keyScrollLock.ts +7 -0
  470. package/src/strings/keyShift.js +3 -7
  471. package/src/strings/keyShift.js.map +1 -0
  472. package/src/strings/keyShift.ts +7 -0
  473. package/src/strings/keySpace.js +3 -7
  474. package/src/strings/keySpace.js.map +1 -0
  475. package/src/strings/keySpace.ts +7 -0
  476. package/src/strings/keyTab.js +3 -7
  477. package/src/strings/keyTab.js.map +1 -0
  478. package/src/strings/keyTab.ts +7 -0
  479. package/src/strings/keyboardEventKeys.js +23 -27
  480. package/src/strings/keyboardEventKeys.js.map +1 -0
  481. package/src/strings/keyboardEventKeys.ts +26 -0
  482. package/src/strings/keydownEvent.js +3 -6
  483. package/src/strings/keydownEvent.js.map +1 -0
  484. package/src/strings/keydownEvent.ts +5 -0
  485. package/src/strings/keypressEvent.js +3 -6
  486. package/src/strings/keypressEvent.js.map +1 -0
  487. package/src/strings/keypressEvent.ts +5 -0
  488. package/src/strings/keyupEvent.js +3 -6
  489. package/src/strings/keyupEvent.js.map +1 -0
  490. package/src/strings/keyupEvent.ts +5 -0
  491. package/src/strings/loadEvent.js +3 -6
  492. package/src/strings/loadEvent.js.map +1 -0
  493. package/src/strings/loadEvent.ts +5 -0
  494. package/src/strings/loadstartEvent.js +3 -6
  495. package/src/strings/loadstartEvent.js.map +1 -0
  496. package/src/strings/loadstartEvent.ts +5 -0
  497. package/src/strings/mouseClickEvents.js +3 -6
  498. package/src/strings/mouseClickEvents.js.map +1 -0
  499. package/src/strings/mouseClickEvents.ts +5 -0
  500. package/src/strings/mouseHoverEvents.js +5 -6
  501. package/src/strings/mouseHoverEvents.js.map +1 -0
  502. package/src/strings/mouseHoverEvents.ts +8 -0
  503. package/src/strings/mouseSwipeEvents.js +8 -8
  504. package/src/strings/mouseSwipeEvents.js.map +1 -0
  505. package/src/strings/mouseSwipeEvents.ts +10 -0
  506. package/src/strings/mouseclickEvent.js +3 -6
  507. package/src/strings/mouseclickEvent.js.map +1 -0
  508. package/src/strings/mouseclickEvent.ts +5 -0
  509. package/src/strings/mousedblclickEvent.js +3 -6
  510. package/src/strings/mousedblclickEvent.js.map +1 -0
  511. package/src/strings/mousedblclickEvent.ts +5 -0
  512. package/src/strings/mousedownEvent.js +3 -6
  513. package/src/strings/mousedownEvent.js.map +1 -0
  514. package/src/strings/mousedownEvent.ts +5 -0
  515. package/src/strings/mouseenterEvent.js +3 -6
  516. package/src/strings/mouseenterEvent.js.map +1 -0
  517. package/src/strings/mouseenterEvent.ts +5 -0
  518. package/src/strings/mousehoverEvent.js +3 -6
  519. package/src/strings/mousehoverEvent.js.map +1 -0
  520. package/src/strings/mousehoverEvent.ts +5 -0
  521. package/src/strings/mouseinEvent.js +3 -6
  522. package/src/strings/mouseinEvent.js.map +1 -0
  523. package/src/strings/mouseinEvent.ts +5 -0
  524. package/src/strings/mouseleaveEvent.js +3 -6
  525. package/src/strings/mouseleaveEvent.js.map +1 -0
  526. package/src/strings/mouseleaveEvent.ts +5 -0
  527. package/src/strings/mousemoveEvent.js +3 -6
  528. package/src/strings/mousemoveEvent.js.map +1 -0
  529. package/src/strings/mousemoveEvent.ts +5 -0
  530. package/src/strings/mouseoutEvent.js +3 -6
  531. package/src/strings/mouseoutEvent.js.map +1 -0
  532. package/src/strings/mouseoutEvent.ts +5 -0
  533. package/src/strings/mouseoverEvent.js +3 -6
  534. package/src/strings/mouseoverEvent.js.map +1 -0
  535. package/src/strings/mouseoverEvent.ts +5 -0
  536. package/src/strings/mouseupEvent.js +3 -6
  537. package/src/strings/mouseupEvent.js.map +1 -0
  538. package/src/strings/mouseupEvent.ts +5 -0
  539. package/src/strings/mousewheelEvent.js +3 -6
  540. package/src/strings/mousewheelEvent.js.map +1 -0
  541. package/src/strings/mousewheelEvent.ts +5 -0
  542. package/src/strings/moveEvent.js +3 -6
  543. package/src/strings/moveEvent.js.map +1 -0
  544. package/src/strings/moveEvent.ts +5 -0
  545. package/src/strings/nativeEvents.js +104 -108
  546. package/src/strings/nativeEvents.js.map +1 -0
  547. package/src/strings/nativeEvents.ts +108 -0
  548. package/src/strings/offsetHeight.js +3 -6
  549. package/src/strings/offsetHeight.js.map +1 -0
  550. package/src/strings/offsetHeight.ts +5 -0
  551. package/src/strings/offsetWidth.js +3 -6
  552. package/src/strings/offsetWidth.js.map +1 -0
  553. package/src/strings/offsetWidth.ts +5 -0
  554. package/src/strings/orientationchangeEvent.js +3 -6
  555. package/src/strings/orientationchangeEvent.js.map +1 -0
  556. package/src/strings/orientationchangeEvent.ts +5 -0
  557. package/src/strings/pointercancelEvent.js +3 -6
  558. package/src/strings/pointercancelEvent.js.map +1 -0
  559. package/src/strings/pointercancelEvent.ts +5 -0
  560. package/src/strings/pointerdownEvent.js +3 -6
  561. package/src/strings/pointerdownEvent.js.map +1 -0
  562. package/src/strings/pointerdownEvent.ts +5 -0
  563. package/src/strings/pointerleaveEvent.js +3 -6
  564. package/src/strings/pointerleaveEvent.js.map +1 -0
  565. package/src/strings/pointerleaveEvent.ts +5 -0
  566. package/src/strings/pointermoveEvent.js +3 -6
  567. package/src/strings/pointermoveEvent.js.map +1 -0
  568. package/src/strings/pointermoveEvent.ts +5 -0
  569. package/src/strings/pointerupEvent.js +3 -6
  570. package/src/strings/pointerupEvent.js.map +1 -0
  571. package/src/strings/pointerupEvent.ts +5 -0
  572. package/src/strings/readystatechangeEvent.js +3 -6
  573. package/src/strings/readystatechangeEvent.js.map +1 -0
  574. package/src/strings/readystatechangeEvent.ts +5 -0
  575. package/src/strings/removeEventListener.js +3 -6
  576. package/src/strings/removeEventListener.js.map +1 -0
  577. package/src/strings/removeEventListener.ts +5 -0
  578. package/src/strings/resetEvent.js +3 -6
  579. package/src/strings/resetEvent.js.map +1 -0
  580. package/src/strings/resetEvent.ts +5 -0
  581. package/src/strings/resizeEvent.js +3 -6
  582. package/src/strings/resizeEvent.js.map +1 -0
  583. package/src/strings/resizeEvent.ts +5 -0
  584. package/src/strings/scrollEvent.js +3 -6
  585. package/src/strings/scrollEvent.js.map +1 -0
  586. package/src/strings/scrollEvent.ts +5 -0
  587. package/src/strings/scrollHeight.js +3 -6
  588. package/src/strings/scrollHeight.js.map +1 -0
  589. package/src/strings/scrollHeight.ts +5 -0
  590. package/src/strings/scrollWidth.js +3 -6
  591. package/src/strings/scrollWidth.js.map +1 -0
  592. package/src/strings/scrollWidth.ts +5 -0
  593. package/src/strings/selectEvent.js +3 -6
  594. package/src/strings/selectEvent.js.map +1 -0
  595. package/src/strings/selectEvent.ts +5 -0
  596. package/src/strings/selectendEvent.js +3 -6
  597. package/src/strings/selectendEvent.js.map +1 -0
  598. package/src/strings/selectendEvent.ts +5 -0
  599. package/src/strings/selectstartEvent.js +3 -6
  600. package/src/strings/selectstartEvent.js.map +1 -0
  601. package/src/strings/selectstartEvent.ts +5 -0
  602. package/src/strings/submitEvent.js +3 -6
  603. package/src/strings/submitEvent.js.map +1 -0
  604. package/src/strings/submitEvent.ts +5 -0
  605. package/src/strings/tabindex.js +3 -0
  606. package/src/strings/tabindex.js.map +1 -0
  607. package/src/strings/tabindex.ts +5 -0
  608. package/src/strings/touchEvents.js +8 -8
  609. package/src/strings/touchEvents.js.map +1 -0
  610. package/src/strings/touchEvents.ts +10 -0
  611. package/src/strings/touchcancelEvent.js +3 -6
  612. package/src/strings/touchcancelEvent.js.map +1 -0
  613. package/src/strings/touchcancelEvent.ts +5 -0
  614. package/src/strings/touchendEvent.js +3 -6
  615. package/src/strings/touchendEvent.js.map +1 -0
  616. package/src/strings/touchendEvent.ts +5 -0
  617. package/src/strings/touchmoveEvent.js +3 -6
  618. package/src/strings/touchmoveEvent.js.map +1 -0
  619. package/src/strings/touchmoveEvent.ts +5 -0
  620. package/src/strings/touchstartEvent.js +3 -6
  621. package/src/strings/touchstartEvent.js.map +1 -0
  622. package/src/strings/touchstartEvent.ts +5 -0
  623. package/src/strings/transitionDelay.js +3 -6
  624. package/src/strings/transitionDelay.js.map +1 -0
  625. package/src/strings/transitionDelay.ts +5 -0
  626. package/src/strings/transitionDuration.js +3 -6
  627. package/src/strings/transitionDuration.js.map +1 -0
  628. package/src/strings/transitionDuration.ts +5 -0
  629. package/src/strings/transitionEndEvent.js +3 -6
  630. package/src/strings/transitionEndEvent.js.map +1 -0
  631. package/src/strings/transitionEndEvent.ts +5 -0
  632. package/src/strings/transitionProperty.js +3 -7
  633. package/src/strings/transitionProperty.js.map +1 -0
  634. package/src/strings/transitionProperty.ts +5 -0
  635. package/src/strings/unloadEvent.js +3 -6
  636. package/src/strings/unloadEvent.js.map +1 -0
  637. package/src/strings/unloadEvent.ts +5 -0
  638. package/src/strings/userAgent.js +4 -7
  639. package/src/strings/userAgent.js.map +1 -0
  640. package/src/strings/userAgent.ts +7 -0
  641. package/src/strings/userAgentData.js +4 -8
  642. package/src/strings/userAgentData.js.map +1 -0
  643. package/src/strings/userAgentData.ts +9 -0
  644. package/types/attr/getAttribute.d.ts +3 -0
  645. package/types/attr/getAttribute.d.ts.map +1 -0
  646. package/types/attr/getAttributeNS.d.ts +3 -0
  647. package/types/attr/getAttributeNS.d.ts.map +1 -0
  648. package/types/attr/hasAttribute.d.ts +3 -0
  649. package/types/attr/hasAttribute.d.ts.map +1 -0
  650. package/types/attr/hasAttributeNS.d.ts +3 -0
  651. package/types/attr/hasAttributeNS.d.ts.map +1 -0
  652. package/types/attr/removeAttribute.d.ts +3 -0
  653. package/types/attr/removeAttribute.d.ts.map +1 -0
  654. package/types/attr/removeAttributeNS.d.ts +3 -0
  655. package/types/attr/removeAttributeNS.d.ts.map +1 -0
  656. package/types/attr/setAttribute.d.ts +3 -0
  657. package/types/attr/setAttribute.d.ts.map +1 -0
  658. package/types/attr/setAttributeNS.d.ts +3 -0
  659. package/types/attr/setAttributeNS.d.ts.map +1 -0
  660. package/types/blocks/documentBody.d.ts +3 -0
  661. package/types/blocks/documentBody.d.ts.map +1 -0
  662. package/types/blocks/documentElement.d.ts +3 -0
  663. package/types/blocks/documentElement.d.ts.map +1 -0
  664. package/types/blocks/documentHead.d.ts +3 -0
  665. package/types/blocks/documentHead.d.ts.map +1 -0
  666. package/types/boolean/isApple.d.ts +3 -0
  667. package/types/boolean/isApple.d.ts.map +1 -0
  668. package/types/boolean/isFirefox.d.ts +3 -0
  669. package/types/boolean/isFirefox.d.ts.map +1 -0
  670. package/types/boolean/isMobile.d.ts +3 -0
  671. package/types/boolean/isMobile.d.ts.map +1 -0
  672. package/types/boolean/support3DTransform.d.ts +3 -0
  673. package/types/boolean/support3DTransform.d.ts.map +1 -0
  674. package/types/boolean/supportAnimation.d.ts +3 -0
  675. package/types/boolean/supportAnimation.d.ts.map +1 -0
  676. package/types/boolean/supportPassive.d.ts +3 -0
  677. package/types/boolean/supportPassive.d.ts.map +1 -0
  678. package/types/boolean/supportTouch.d.ts +3 -0
  679. package/types/boolean/supportTouch.d.ts.map +1 -0
  680. package/types/boolean/supportTransform.d.ts +3 -0
  681. package/types/boolean/supportTransform.d.ts.map +1 -0
  682. package/types/boolean/supportTransition.d.ts +3 -0
  683. package/types/boolean/supportTransition.d.ts.map +1 -0
  684. package/types/class/addClass.d.ts +3 -0
  685. package/types/class/addClass.d.ts.map +1 -0
  686. package/types/class/hasClass.d.ts +3 -0
  687. package/types/class/hasClass.d.ts.map +1 -0
  688. package/types/class/removeClass.d.ts +3 -0
  689. package/types/class/removeClass.d.ts.map +1 -0
  690. package/types/event/off.d.ts +2 -0
  691. package/types/event/off.d.ts.map +1 -0
  692. package/types/event/on.d.ts +2 -0
  693. package/types/event/on.d.ts.map +1 -0
  694. package/types/event/one.d.ts +3 -0
  695. package/types/event/one.d.ts.map +1 -0
  696. package/types/get/getBoundingClientRect.d.ts +4 -0
  697. package/types/get/getBoundingClientRect.d.ts.map +1 -0
  698. package/types/get/getDocument.d.ts +3 -0
  699. package/types/get/getDocument.d.ts.map +1 -0
  700. package/types/get/getDocumentBody.d.ts +3 -0
  701. package/types/get/getDocumentBody.d.ts.map +1 -0
  702. package/types/get/getDocumentElement.d.ts +3 -0
  703. package/types/get/getDocumentElement.d.ts.map +1 -0
  704. package/types/get/getDocumentHead.d.ts +3 -0
  705. package/types/get/getDocumentHead.d.ts.map +1 -0
  706. package/types/get/getElementAnimationDelay.d.ts +3 -0
  707. package/types/get/getElementAnimationDelay.d.ts.map +1 -0
  708. package/types/get/getElementAnimationDuration.d.ts +3 -0
  709. package/types/get/getElementAnimationDuration.d.ts.map +1 -0
  710. package/types/get/getElementStyle.d.ts +3 -0
  711. package/types/get/getElementStyle.d.ts.map +1 -0
  712. package/types/get/getElementTransitionDelay.d.ts +3 -0
  713. package/types/get/getElementTransitionDelay.d.ts.map +1 -0
  714. package/types/get/getElementTransitionDuration.d.ts +3 -0
  715. package/types/get/getElementTransitionDuration.d.ts.map +1 -0
  716. package/types/get/getNodeScroll.d.ts +6 -0
  717. package/types/get/getNodeScroll.d.ts.map +1 -0
  718. package/types/get/getParentNode.d.ts +3 -0
  719. package/types/get/getParentNode.d.ts.map +1 -0
  720. package/types/get/getRectRelativeToOffsetParent.d.ts +7 -0
  721. package/types/get/getRectRelativeToOffsetParent.d.ts.map +1 -0
  722. package/types/get/getUID.d.ts +3 -0
  723. package/types/get/getUID.d.ts.map +1 -0
  724. package/types/get/getWindow.d.ts +3 -0
  725. package/types/get/getWindow.d.ts.map +1 -0
  726. package/types/index.d.ts +341 -250
  727. package/types/index.d.ts.map +1 -0
  728. package/types/interface/boundingClientRect.d.ts +11 -0
  729. package/types/interface/boundingClientRect.d.ts.map +1 -0
  730. package/types/interface/navigatorUA.d.ts +13 -0
  731. package/types/interface/navigatorUA.d.ts.map +1 -0
  732. package/types/interface/offsetRect.d.ts +7 -0
  733. package/types/interface/offsetRect.d.ts.map +1 -0
  734. package/types/interface/originalEvent.d.ts +4 -0
  735. package/types/interface/originalEvent.d.ts.map +1 -0
  736. package/types/is/isArray.d.ts +3 -0
  737. package/types/is/isArray.d.ts.map +1 -0
  738. package/types/is/isCustomElement.d.ts +5 -0
  739. package/types/is/isCustomElement.d.ts.map +1 -0
  740. package/types/is/isDocument.d.ts +3 -0
  741. package/types/is/isDocument.d.ts.map +1 -0
  742. package/types/is/isElement.d.ts +3 -0
  743. package/types/is/isElement.d.ts.map +1 -0
  744. package/types/is/isElementInScrollRange.d.ts +3 -0
  745. package/types/is/isElementInScrollRange.d.ts.map +1 -0
  746. package/types/is/isElementInViewport.d.ts +3 -0
  747. package/types/is/isElementInViewport.d.ts.map +1 -0
  748. package/types/is/isElementsArray.d.ts +3 -0
  749. package/types/is/isElementsArray.d.ts.map +1 -0
  750. package/types/is/isFunction.d.ts +3 -0
  751. package/types/is/isFunction.d.ts.map +1 -0
  752. package/types/is/isHTMLCollection.d.ts +3 -0
  753. package/types/is/isHTMLCollection.d.ts.map +1 -0
  754. package/types/is/isHTMLElement.d.ts +3 -0
  755. package/types/is/isHTMLElement.d.ts.map +1 -0
  756. package/types/is/isHTMLImageElement.d.ts +3 -0
  757. package/types/is/isHTMLImageElement.d.ts.map +1 -0
  758. package/types/is/isMedia.d.ts +3 -0
  759. package/types/is/isMedia.d.ts.map +1 -0
  760. package/types/is/isNode.d.ts +3 -0
  761. package/types/is/isNode.d.ts.map +1 -0
  762. package/types/is/isNodeList.d.ts +3 -0
  763. package/types/is/isNodeList.d.ts.map +1 -0
  764. package/types/is/isNumber.d.ts +3 -0
  765. package/types/is/isNumber.d.ts.map +1 -0
  766. package/types/is/isObject.d.ts +3 -0
  767. package/types/is/isObject.d.ts.map +1 -0
  768. package/types/is/isRTL.d.ts +3 -0
  769. package/types/is/isRTL.d.ts.map +1 -0
  770. package/types/is/isSVGElement.d.ts +3 -0
  771. package/types/is/isSVGElement.d.ts.map +1 -0
  772. package/types/is/isScaledElement.d.ts +2 -0
  773. package/types/is/isScaledElement.d.ts.map +1 -0
  774. package/types/is/isShadowRoot.d.ts +3 -0
  775. package/types/is/isShadowRoot.d.ts.map +1 -0
  776. package/types/is/isString.d.ts +3 -0
  777. package/types/is/isString.d.ts.map +1 -0
  778. package/types/is/isTableElement.d.ts +3 -0
  779. package/types/is/isTableElement.d.ts.map +1 -0
  780. package/types/is/isWindow.d.ts +3 -0
  781. package/types/is/isWindow.d.ts.map +1 -0
  782. package/types/misc/ArrayFrom.d.ts +3 -0
  783. package/types/misc/ArrayFrom.d.ts.map +1 -0
  784. package/types/misc/Float32ArrayFrom.d.ts +3 -0
  785. package/types/misc/Float32ArrayFrom.d.ts.map +1 -0
  786. package/types/misc/Float64ArrayFrom.d.ts +3 -0
  787. package/types/misc/Float64ArrayFrom.d.ts.map +1 -0
  788. package/types/misc/ObjectAssign.d.ts +3 -0
  789. package/types/misc/ObjectAssign.d.ts.map +1 -0
  790. package/types/misc/ObjectEntries.d.ts +3 -0
  791. package/types/misc/ObjectEntries.d.ts.map +1 -0
  792. package/types/misc/ObjectKeys.d.ts +3 -0
  793. package/types/misc/ObjectKeys.d.ts.map +1 -0
  794. package/types/misc/ObjectValues.d.ts +3 -0
  795. package/types/misc/ObjectValues.d.ts.map +1 -0
  796. package/types/misc/OriginalEvent.d.ts +4 -0
  797. package/types/misc/OriginalEvent.d.ts.map +1 -0
  798. package/types/misc/createElement.d.ts +3 -0
  799. package/types/misc/createElement.d.ts.map +1 -0
  800. package/types/misc/createElementNS.d.ts +3 -0
  801. package/types/misc/createElementNS.d.ts.map +1 -0
  802. package/types/misc/data.d.ts +9 -0
  803. package/types/misc/data.d.ts.map +1 -0
  804. package/types/misc/dispatchEvent.d.ts +3 -0
  805. package/types/misc/dispatchEvent.d.ts.map +1 -0
  806. package/types/misc/distinct.d.ts +3 -0
  807. package/types/misc/distinct.d.ts.map +1 -0
  808. package/types/misc/emulateAnimationEnd.d.ts +3 -0
  809. package/types/misc/emulateAnimationEnd.d.ts.map +1 -0
  810. package/types/misc/emulateTransitionEnd.d.ts +3 -0
  811. package/types/misc/emulateTransitionEnd.d.ts.map +1 -0
  812. package/types/misc/focus.d.ts +3 -0
  813. package/types/misc/focus.d.ts.map +1 -0
  814. package/types/misc/noop.d.ts +3 -0
  815. package/types/misc/noop.d.ts.map +1 -0
  816. package/types/misc/normalizeOptions.d.ts +3 -0
  817. package/types/misc/normalizeOptions.d.ts.map +1 -0
  818. package/types/misc/normalizeValue.d.ts +3 -0
  819. package/types/misc/normalizeValue.d.ts.map +1 -0
  820. package/types/misc/passiveHandler.d.ts +3 -0
  821. package/types/misc/passiveHandler.d.ts.map +1 -0
  822. package/types/misc/reflow.d.ts +3 -0
  823. package/types/misc/reflow.d.ts.map +1 -0
  824. package/types/misc/setElementStyle.d.ts +3 -0
  825. package/types/misc/setElementStyle.d.ts.map +1 -0
  826. package/types/misc/timer.d.ts +7 -0
  827. package/types/misc/timer.d.ts.map +1 -0
  828. package/types/misc/toLowerCase.d.ts +3 -0
  829. package/types/misc/toLowerCase.d.ts.map +1 -0
  830. package/types/misc/toUpperCase.d.ts +3 -0
  831. package/types/misc/toUpperCase.d.ts.map +1 -0
  832. package/types/selectors/closest.d.ts +3 -0
  833. package/types/selectors/closest.d.ts.map +1 -0
  834. package/types/selectors/getCustomElements.d.ts +3 -0
  835. package/types/selectors/getCustomElements.d.ts.map +1 -0
  836. package/types/selectors/getElementById.d.ts +3 -0
  837. package/types/selectors/getElementById.d.ts.map +1 -0
  838. package/types/selectors/getElementsByClassName.d.ts +3 -0
  839. package/types/selectors/getElementsByClassName.d.ts.map +1 -0
  840. package/types/selectors/getElementsByTagName.d.ts +3 -0
  841. package/types/selectors/getElementsByTagName.d.ts.map +1 -0
  842. package/types/selectors/matches.d.ts +3 -0
  843. package/types/selectors/matches.d.ts.map +1 -0
  844. package/types/selectors/querySelector.d.ts +3 -0
  845. package/types/selectors/querySelector.d.ts.map +1 -0
  846. package/types/selectors/querySelectorAll.d.ts +3 -0
  847. package/types/selectors/querySelectorAll.d.ts.map +1 -0
  848. package/types/strings/DOMContentLoadedEvent.d.ts +3 -0
  849. package/types/strings/DOMContentLoadedEvent.d.ts.map +1 -0
  850. package/types/strings/DOMMouseScrollEvent.d.ts +3 -0
  851. package/types/strings/DOMMouseScrollEvent.d.ts.map +1 -0
  852. package/types/strings/abortEvent.d.ts +3 -0
  853. package/types/strings/abortEvent.d.ts.map +1 -0
  854. package/types/strings/addEventListener.d.ts +3 -0
  855. package/types/strings/addEventListener.d.ts.map +1 -0
  856. package/types/strings/animationDelay.d.ts +3 -0
  857. package/types/strings/animationDelay.d.ts.map +1 -0
  858. package/types/strings/animationDuration.d.ts +3 -0
  859. package/types/strings/animationDuration.d.ts.map +1 -0
  860. package/types/strings/animationEndEvent.d.ts +3 -0
  861. package/types/strings/animationEndEvent.d.ts.map +1 -0
  862. package/types/strings/animationName.d.ts +3 -0
  863. package/types/strings/animationName.d.ts.map +1 -0
  864. package/types/strings/ariaChecked.d.ts +3 -0
  865. package/types/strings/ariaChecked.d.ts.map +1 -0
  866. package/types/strings/ariaDescribedBy.d.ts +3 -0
  867. package/types/strings/ariaDescribedBy.d.ts.map +1 -0
  868. package/types/strings/ariaDescription.d.ts +3 -0
  869. package/types/strings/ariaDescription.d.ts.map +1 -0
  870. package/types/strings/ariaExpanded.d.ts +3 -0
  871. package/types/strings/ariaExpanded.d.ts.map +1 -0
  872. package/types/strings/ariaHasPopup.d.ts +3 -0
  873. package/types/strings/ariaHasPopup.d.ts.map +1 -0
  874. package/types/strings/ariaHidden.d.ts +3 -0
  875. package/types/strings/ariaHidden.d.ts.map +1 -0
  876. package/types/strings/ariaLabel.d.ts +3 -0
  877. package/types/strings/ariaLabel.d.ts.map +1 -0
  878. package/types/strings/ariaLabelledBy.d.ts +3 -0
  879. package/types/strings/ariaLabelledBy.d.ts.map +1 -0
  880. package/types/strings/ariaModal.d.ts +3 -0
  881. package/types/strings/ariaModal.d.ts.map +1 -0
  882. package/types/strings/ariaPressed.d.ts +3 -0
  883. package/types/strings/ariaPressed.d.ts.map +1 -0
  884. package/types/strings/ariaSelected.d.ts +3 -0
  885. package/types/strings/ariaSelected.d.ts.map +1 -0
  886. package/types/strings/ariaValueMax.d.ts +3 -0
  887. package/types/strings/ariaValueMax.d.ts.map +1 -0
  888. package/types/strings/ariaValueMin.d.ts +3 -0
  889. package/types/strings/ariaValueMin.d.ts.map +1 -0
  890. package/types/strings/ariaValueNow.d.ts +3 -0
  891. package/types/strings/ariaValueNow.d.ts.map +1 -0
  892. package/types/strings/ariaValueText.d.ts +3 -0
  893. package/types/strings/ariaValueText.d.ts.map +1 -0
  894. package/types/strings/beforeunloadEvent.d.ts +3 -0
  895. package/types/strings/beforeunloadEvent.d.ts.map +1 -0
  896. package/types/strings/bezierEasings.d.ts +29 -0
  897. package/types/strings/bezierEasings.d.ts.map +1 -0
  898. package/types/strings/blurEvent.d.ts +3 -0
  899. package/types/strings/blurEvent.d.ts.map +1 -0
  900. package/types/strings/changeEvent.d.ts +3 -0
  901. package/types/strings/changeEvent.d.ts.map +1 -0
  902. package/types/strings/contextmenuEvent.d.ts +3 -0
  903. package/types/strings/contextmenuEvent.d.ts.map +1 -0
  904. package/types/strings/errorEvent.d.ts +3 -0
  905. package/types/strings/errorEvent.d.ts.map +1 -0
  906. package/types/strings/focusEvent.d.ts +3 -0
  907. package/types/strings/focusEvent.d.ts.map +1 -0
  908. package/types/strings/focusEvents.d.ts +6 -0
  909. package/types/strings/focusEvents.d.ts.map +1 -0
  910. package/types/strings/focusinEvent.d.ts +3 -0
  911. package/types/strings/focusinEvent.d.ts.map +1 -0
  912. package/types/strings/focusoutEvent.d.ts +3 -0
  913. package/types/strings/focusoutEvent.d.ts.map +1 -0
  914. package/types/strings/gesturechangeEvent.d.ts +3 -0
  915. package/types/strings/gesturechangeEvent.d.ts.map +1 -0
  916. package/types/strings/gestureendEvent.d.ts +3 -0
  917. package/types/strings/gestureendEvent.d.ts.map +1 -0
  918. package/types/strings/gesturestartEvent.d.ts +3 -0
  919. package/types/strings/gesturestartEvent.d.ts.map +1 -0
  920. package/types/strings/keyAlt.d.ts +3 -0
  921. package/types/strings/keyAlt.d.ts.map +1 -0
  922. package/types/strings/keyArrowDown.d.ts +3 -0
  923. package/types/strings/keyArrowDown.d.ts.map +1 -0
  924. package/types/strings/keyArrowLeft.d.ts +3 -0
  925. package/types/strings/keyArrowLeft.d.ts.map +1 -0
  926. package/types/strings/keyArrowRight.d.ts +3 -0
  927. package/types/strings/keyArrowRight.d.ts.map +1 -0
  928. package/types/strings/keyArrowUp.d.ts +3 -0
  929. package/types/strings/keyArrowUp.d.ts.map +1 -0
  930. package/types/strings/keyBackspace.d.ts +3 -0
  931. package/types/strings/keyBackspace.d.ts.map +1 -0
  932. package/types/strings/keyCapsLock.d.ts +3 -0
  933. package/types/strings/keyCapsLock.d.ts.map +1 -0
  934. package/types/strings/keyControl.d.ts +3 -0
  935. package/types/strings/keyControl.d.ts.map +1 -0
  936. package/types/strings/keyDelete.d.ts +3 -0
  937. package/types/strings/keyDelete.d.ts.map +1 -0
  938. package/types/strings/keyEnter.d.ts +3 -0
  939. package/types/strings/keyEnter.d.ts.map +1 -0
  940. package/types/strings/keyEscape.d.ts +3 -0
  941. package/types/strings/keyEscape.d.ts.map +1 -0
  942. package/types/strings/keyInsert.d.ts +3 -0
  943. package/types/strings/keyInsert.d.ts.map +1 -0
  944. package/types/strings/keyMeta.d.ts +3 -0
  945. package/types/strings/keyMeta.d.ts.map +1 -0
  946. package/types/strings/keyPause.d.ts +3 -0
  947. package/types/strings/keyPause.d.ts.map +1 -0
  948. package/types/strings/keyScrollLock.d.ts +3 -0
  949. package/types/strings/keyScrollLock.d.ts.map +1 -0
  950. package/types/strings/keyShift.d.ts +3 -0
  951. package/types/strings/keyShift.d.ts.map +1 -0
  952. package/types/strings/keySpace.d.ts +3 -0
  953. package/types/strings/keySpace.d.ts.map +1 -0
  954. package/types/strings/keyTab.d.ts +3 -0
  955. package/types/strings/keyTab.d.ts.map +1 -0
  956. package/types/strings/keyboardEventKeys.d.ts +23 -0
  957. package/types/strings/keyboardEventKeys.d.ts.map +1 -0
  958. package/types/strings/keydownEvent.d.ts +3 -0
  959. package/types/strings/keydownEvent.d.ts.map +1 -0
  960. package/types/strings/keypressEvent.d.ts +3 -0
  961. package/types/strings/keypressEvent.d.ts.map +1 -0
  962. package/types/strings/keyupEvent.d.ts +3 -0
  963. package/types/strings/keyupEvent.d.ts.map +1 -0
  964. package/types/strings/loadEvent.d.ts +3 -0
  965. package/types/strings/loadEvent.d.ts.map +1 -0
  966. package/types/strings/loadstartEvent.d.ts +3 -0
  967. package/types/strings/loadstartEvent.d.ts.map +1 -0
  968. package/types/strings/mouseClickEvents.d.ts +6 -0
  969. package/types/strings/mouseClickEvents.d.ts.map +1 -0
  970. package/types/strings/mouseHoverEvents.d.ts +3 -0
  971. package/types/strings/mouseHoverEvents.d.ts.map +1 -0
  972. package/types/strings/mouseSwipeEvents.d.ts +8 -0
  973. package/types/strings/mouseSwipeEvents.d.ts.map +1 -0
  974. package/types/strings/mouseclickEvent.d.ts +3 -0
  975. package/types/strings/mouseclickEvent.d.ts.map +1 -0
  976. package/types/strings/mousedblclickEvent.d.ts +3 -0
  977. package/types/strings/mousedblclickEvent.d.ts.map +1 -0
  978. package/types/strings/mousedownEvent.d.ts +3 -0
  979. package/types/strings/mousedownEvent.d.ts.map +1 -0
  980. package/types/strings/mouseenterEvent.d.ts +3 -0
  981. package/types/strings/mouseenterEvent.d.ts.map +1 -0
  982. package/types/strings/mousehoverEvent.d.ts +3 -0
  983. package/types/strings/mousehoverEvent.d.ts.map +1 -0
  984. package/types/strings/mouseinEvent.d.ts +3 -0
  985. package/types/strings/mouseinEvent.d.ts.map +1 -0
  986. package/types/strings/mouseleaveEvent.d.ts +3 -0
  987. package/types/strings/mouseleaveEvent.d.ts.map +1 -0
  988. package/types/strings/mousemoveEvent.d.ts +3 -0
  989. package/types/strings/mousemoveEvent.d.ts.map +1 -0
  990. package/types/strings/mouseoutEvent.d.ts +3 -0
  991. package/types/strings/mouseoutEvent.d.ts.map +1 -0
  992. package/types/strings/mouseoverEvent.d.ts +3 -0
  993. package/types/strings/mouseoverEvent.d.ts.map +1 -0
  994. package/types/strings/mouseupEvent.d.ts +3 -0
  995. package/types/strings/mouseupEvent.d.ts.map +1 -0
  996. package/types/strings/mousewheelEvent.d.ts +3 -0
  997. package/types/strings/mousewheelEvent.d.ts.map +1 -0
  998. package/types/strings/moveEvent.d.ts +3 -0
  999. package/types/strings/moveEvent.d.ts.map +1 -0
  1000. package/types/strings/nativeEvents.d.ts +54 -0
  1001. package/types/strings/nativeEvents.d.ts.map +1 -0
  1002. package/types/strings/offsetHeight.d.ts +3 -0
  1003. package/types/strings/offsetHeight.d.ts.map +1 -0
  1004. package/types/strings/offsetWidth.d.ts +3 -0
  1005. package/types/strings/offsetWidth.d.ts.map +1 -0
  1006. package/types/strings/orientationchangeEvent.d.ts +3 -0
  1007. package/types/strings/orientationchangeEvent.d.ts.map +1 -0
  1008. package/types/strings/pointercancelEvent.d.ts +3 -0
  1009. package/types/strings/pointercancelEvent.d.ts.map +1 -0
  1010. package/types/strings/pointerdownEvent.d.ts +3 -0
  1011. package/types/strings/pointerdownEvent.d.ts.map +1 -0
  1012. package/types/strings/pointerleaveEvent.d.ts +3 -0
  1013. package/types/strings/pointerleaveEvent.d.ts.map +1 -0
  1014. package/types/strings/pointermoveEvent.d.ts +3 -0
  1015. package/types/strings/pointermoveEvent.d.ts.map +1 -0
  1016. package/types/strings/pointerupEvent.d.ts +3 -0
  1017. package/types/strings/pointerupEvent.d.ts.map +1 -0
  1018. package/types/strings/readystatechangeEvent.d.ts +3 -0
  1019. package/types/strings/readystatechangeEvent.d.ts.map +1 -0
  1020. package/types/strings/removeEventListener.d.ts +3 -0
  1021. package/types/strings/removeEventListener.d.ts.map +1 -0
  1022. package/types/strings/resetEvent.d.ts +3 -0
  1023. package/types/strings/resetEvent.d.ts.map +1 -0
  1024. package/types/strings/resizeEvent.d.ts +3 -0
  1025. package/types/strings/resizeEvent.d.ts.map +1 -0
  1026. package/types/strings/scrollEvent.d.ts +3 -0
  1027. package/types/strings/scrollEvent.d.ts.map +1 -0
  1028. package/types/strings/scrollHeight.d.ts +3 -0
  1029. package/types/strings/scrollHeight.d.ts.map +1 -0
  1030. package/types/strings/scrollWidth.d.ts +3 -0
  1031. package/types/strings/scrollWidth.d.ts.map +1 -0
  1032. package/types/strings/selectEvent.d.ts +3 -0
  1033. package/types/strings/selectEvent.d.ts.map +1 -0
  1034. package/types/strings/selectendEvent.d.ts +3 -0
  1035. package/types/strings/selectendEvent.d.ts.map +1 -0
  1036. package/types/strings/selectstartEvent.d.ts +3 -0
  1037. package/types/strings/selectstartEvent.d.ts.map +1 -0
  1038. package/types/strings/submitEvent.d.ts +3 -0
  1039. package/types/strings/submitEvent.d.ts.map +1 -0
  1040. package/types/strings/tabindex.d.ts +3 -0
  1041. package/types/strings/tabindex.d.ts.map +1 -0
  1042. package/types/strings/touchEvents.d.ts +8 -0
  1043. package/types/strings/touchEvents.d.ts.map +1 -0
  1044. package/types/strings/touchcancelEvent.d.ts +3 -0
  1045. package/types/strings/touchcancelEvent.d.ts.map +1 -0
  1046. package/types/strings/touchendEvent.d.ts +3 -0
  1047. package/types/strings/touchendEvent.d.ts.map +1 -0
  1048. package/types/strings/touchmoveEvent.d.ts +3 -0
  1049. package/types/strings/touchmoveEvent.d.ts.map +1 -0
  1050. package/types/strings/touchstartEvent.d.ts +3 -0
  1051. package/types/strings/touchstartEvent.d.ts.map +1 -0
  1052. package/types/strings/transitionDelay.d.ts +3 -0
  1053. package/types/strings/transitionDelay.d.ts.map +1 -0
  1054. package/types/strings/transitionDuration.d.ts +3 -0
  1055. package/types/strings/transitionDuration.d.ts.map +1 -0
  1056. package/types/strings/transitionEndEvent.d.ts +3 -0
  1057. package/types/strings/transitionEndEvent.d.ts.map +1 -0
  1058. package/types/strings/transitionProperty.d.ts +3 -0
  1059. package/types/strings/transitionProperty.d.ts.map +1 -0
  1060. package/types/strings/unloadEvent.d.ts +3 -0
  1061. package/types/strings/unloadEvent.d.ts.map +1 -0
  1062. package/types/strings/userAgent.d.ts +3 -0
  1063. package/types/strings/userAgent.d.ts.map +1 -0
  1064. package/types/strings/userAgentData.d.ts +4 -0
  1065. package/types/strings/userAgentData.d.ts.map +1 -0
  1066. package/dist/shorty.esm.js +0 -2527
  1067. package/dist/shorty.esm.min.js +0 -2
  1068. package/dist/shorty.js +0 -2550
  1069. package/dist/shorty.min.js +0 -2
  1070. package/src/get/getElementAnimationDelayLegacy.js +0 -21
  1071. package/src/get/getElementAnimationDurationLegacy.js +0 -21
  1072. package/src/get/getElementTransitionDelayLegacy.js +0 -21
  1073. package/src/get/getElementTransitionDurationLegacy.js +0 -21
  1074. package/src/misc/passiveHandlerLegacy.js +0 -9
  1075. package/src/misc/tryWrapper.js +0 -11
  1076. package/src/misc/version.js +0 -9
  1077. package/src/selectors/documentAll.js +0 -8
  1078. package/src/selectors/matchesLegacy.js +0 -23
  1079. package/src/strings/animationDelayLegacy.js +0 -8
  1080. package/src/strings/animationDurationLegacy.js +0 -8
  1081. package/src/strings/animationEndEventLegacy.js +0 -8
  1082. package/src/strings/animationNameLegacy.js +0 -8
  1083. package/src/strings/transitionDelayLegacy.js +0 -8
  1084. package/src/strings/transitionDurationLegacy.js +0 -8
  1085. package/src/strings/transitionEndEventLegacy.js +0 -8
  1086. package/src/strings/transitionPropertyLegacy.js +0 -12
  1087. package/types/module/shorty.ts +0 -247
  1088. package/types/shorty.d.ts +0 -2292
@@ -1,2527 +0,0 @@
1
- /*!
2
- * Shorty v1.0.1 (https://github.com/thednp/shorty)
3
- * Copyright 2019-2022 © dnp_theme
4
- * Licensed under MIT (https://github.com/thednp/shorty/blob/master/LICENSE)
5
- */
6
- /**
7
- * A global namespace for aria-checked.
8
- * @type {string}
9
- */
10
- const ariaChecked = 'aria-checked';
11
-
12
- /**
13
- * A global namespace for aria-description.
14
- * @type {string}
15
- */
16
- const ariaDescription = 'aria-description';
17
-
18
- /**
19
- * A global namespace for aria-describedby.
20
- * @type {string}
21
- */
22
- const ariaDescribedBy = 'aria-describedby';
23
-
24
- /**
25
- * A global namespace for aria-expanded.
26
- * @type {string}
27
- */
28
- const ariaExpanded = 'aria-expanded';
29
-
30
- /**
31
- * A global namespace for aria-haspopup.
32
- * @type {string}
33
- */
34
- const ariaHasPopup = 'aria-haspopup';
35
-
36
- /**
37
- * A global namespace for aria-hidden.
38
- * @type {string}
39
- */
40
- const ariaHidden = 'aria-hidden';
41
-
42
- /**
43
- * A global namespace for aria-label.
44
- * @type {string}
45
- */
46
- const ariaLabel = 'aria-label';
47
-
48
- /**
49
- * A global namespace for aria-labelledby.
50
- * @type {string}
51
- */
52
- const ariaLabelledBy = 'aria-labelledby';
53
-
54
- /**
55
- * A global namespace for aria-modal.
56
- * @type {string}
57
- */
58
- const ariaModal = 'aria-modal';
59
-
60
- /**
61
- * A global namespace for aria-pressed.
62
- * @type {string}
63
- */
64
- const ariaPressed = 'aria-pressed';
65
-
66
- /**
67
- * A global namespace for aria-selected.
68
- * @type {string}
69
- */
70
- const ariaSelected = 'aria-selected';
71
-
72
- /**
73
- * A global namespace for aria-valuemin.
74
- * @type {string}
75
- */
76
- const ariaValueMin = 'aria-valuemin';
77
-
78
- /**
79
- * A global namespace for aria-valuemax.
80
- * @type {string}
81
- */
82
- const ariaValueMax = 'aria-valuemax';
83
-
84
- /**
85
- * A global namespace for aria-valuenow.
86
- * @type {string}
87
- */
88
- const ariaValueNow = 'aria-valuenow';
89
-
90
- /**
91
- * A global namespace for aria-valuetext.
92
- * @type {string}
93
- */
94
- const ariaValueText = 'aria-valuetext';
95
-
96
- /**
97
- * A global namespace for `abort` event.
98
- * @type {string}
99
- */
100
- const abortEvent = 'abort';
101
-
102
- /**
103
- * A global namespace for `beforeunload` event.
104
- * @type {string}
105
- */
106
- const beforeunloadEvent = 'beforeunload';
107
-
108
- /**
109
- * A global namespace for `blur` event.
110
- * @type {string}
111
- */
112
- const blurEvent = 'blur';
113
-
114
- /**
115
- * A global namespace for `change` event.
116
- * @type {string}
117
- */
118
- const changeEvent = 'change';
119
-
120
- /**
121
- * A global namespace for `contextmenu` event.
122
- * @type {string}
123
- */
124
- const contextmenuEvent = 'contextmenu';
125
-
126
- /**
127
- * A global namespace for `DOMContentLoaded` event.
128
- * @type {string}
129
- */
130
- const DOMContentLoadedEvent = 'DOMContentLoaded';
131
-
132
- /**
133
- * A global namespace for `DOMMouseScroll` event.
134
- * @type {string}
135
- */
136
- const DOMMouseScrollEvent = 'DOMMouseScroll';
137
-
138
- /**
139
- * A global namespace for `error` event.
140
- * @type {string}
141
- */
142
- const errorEvent = 'error';
143
-
144
- /**
145
- * A global namespace for `focus` event.
146
- * @type {string}
147
- */
148
- const focusEvent = 'focus';
149
-
150
- /**
151
- * A global namespace for `focusin` event.
152
- * @type {string}
153
- */
154
- const focusinEvent = 'focusin';
155
-
156
- /**
157
- * A global namespace for `focusout` event.
158
- * @type {string}
159
- */
160
- const focusoutEvent = 'focusout';
161
-
162
- /**
163
- * A global namespace for `gesturechange` event.
164
- * @type {string}
165
- */
166
- const gesturechangeEvent = 'gesturechange';
167
-
168
- /**
169
- * A global namespace for `gestureend` event.
170
- * @type {string}
171
- */
172
- const gestureendEvent = 'gestureend';
173
-
174
- /**
175
- * A global namespace for `gesturestart` event.
176
- * @type {string}
177
- */
178
- const gesturestartEvent = 'gesturestart';
179
-
180
- /**
181
- * A global namespace for `keydown` event.
182
- * @type {string}
183
- */
184
- const keydownEvent = 'keydown';
185
-
186
- /**
187
- * A global namespace for `keypress` event.
188
- * @type {string}
189
- */
190
- const keypressEvent = 'keypress';
191
-
192
- /**
193
- * A global namespace for `keyup` event.
194
- * @type {string}
195
- */
196
- const keyupEvent = 'keyup';
197
-
198
- /**
199
- * A global namespace for `load` event.
200
- * @type {string}
201
- */
202
- const loadEvent = 'load';
203
-
204
- /**
205
- * A global namespace for `click` event.
206
- * @type {string}
207
- */
208
- const mouseclickEvent = 'click';
209
-
210
- /**
211
- * A global namespace for `dblclick` event.
212
- * @type {string}
213
- */
214
- const mousedblclickEvent = 'dblclick';
215
-
216
- /**
217
- * A global namespace for `mousedown` event.
218
- * @type {string}
219
- */
220
- const mousedownEvent = 'mousedown';
221
-
222
- /**
223
- * A global namespace for `mouseup` event.
224
- * @type {string}
225
- */
226
- const mouseupEvent = 'mouseup';
227
-
228
- /**
229
- * A global namespace for `hover` event.
230
- * @type {string}
231
- */
232
- const mousehoverEvent = 'hover';
233
-
234
- /**
235
- * A global namespace for `mouseenter` event.
236
- * @type {string}
237
- */
238
- const mouseenterEvent = 'mouseenter';
239
-
240
- /**
241
- * A global namespace for `mouseleave` event.
242
- * @type {string}
243
- */
244
- const mouseleaveEvent = 'mouseleave';
245
-
246
- /**
247
- * A global namespace for `mousein` event.
248
- * @type {string}
249
- */
250
- const mouseinEvent = 'mousein';
251
-
252
- /**
253
- * A global namespace for `mouseout` event.
254
- * @type {string}
255
- */
256
- const mouseoutEvent = 'mouseout';
257
-
258
- /**
259
- * A global namespace for `mouseover` event.
260
- * @type {string}
261
- */
262
- const mouseoverEvent = 'mouseover';
263
-
264
- /**
265
- * A global namespace for `mousemove` event.
266
- * @type {string}
267
- */
268
- const mousemoveEvent = 'mousemove';
269
-
270
- /**
271
- * A global namespace for `mousewheel` event.
272
- * @type {string}
273
- */
274
- const mousewheelEvent = 'mousewheel';
275
-
276
- /**
277
- * A global namespace for `move` event.
278
- * @type {string}
279
- */
280
- const moveEvent = 'move';
281
-
282
- /**
283
- * A global namespace for `orientationchange` event.
284
- * @type {string}
285
- */
286
- const orientationchangeEvent = 'orientationchange';
287
-
288
- /**
289
- * A global namespace for `pointercancel` event.
290
- * @type {string}
291
- */
292
- const pointercancelEvent = 'pointercancel';
293
-
294
- /**
295
- * A global namespace for `pointerdown` event.
296
- * @type {string}
297
- */
298
- const pointerdownEvent = 'pointerdown';
299
-
300
- /**
301
- * A global namespace for `pointerleave` event.
302
- * @type {string}
303
- */
304
- const pointerleaveEvent = 'pointerleave';
305
-
306
- /**
307
- * A global namespace for `pointermove` event.
308
- * @type {string}
309
- */
310
- const pointermoveEvent = 'pointermove';
311
-
312
- /**
313
- * A global namespace for `pointerup` event.
314
- * @type {string}
315
- */
316
- const pointerupEvent = 'pointerup';
317
-
318
- /**
319
- * A global namespace for `readystatechange` event.
320
- * @type {string}
321
- */
322
- const readystatechangeEvent = 'readystatechange';
323
-
324
- /**
325
- * A global namespace for `reset` event.
326
- * @type {string}
327
- */
328
- const resetEvent = 'reset';
329
-
330
- /**
331
- * A global namespace for `resize` event.
332
- * @type {string}
333
- */
334
- const resizeEvent = 'resize';
335
-
336
- /**
337
- * A global namespace for `select` event.
338
- * @type {string}
339
- */
340
- const selectEvent = 'select';
341
-
342
- /**
343
- * A global namespace for the `selectend` event.
344
- * @type {string}
345
- */
346
- const selectendEvent = 'selectend';
347
-
348
- /**
349
- * A global namespace for the `selectstart` event.
350
- * @type {string}
351
- */
352
- const selectstartEvent = 'selectstart';
353
-
354
- /**
355
- * A global namespace for `scroll` event.
356
- * @type {string}
357
- */
358
- const scrollEvent = 'scroll';
359
-
360
- /**
361
- * A global namespace for `submit` event.
362
- * @type {string}
363
- */
364
- const submitEvent = 'submit';
365
-
366
- /**
367
- * A global namespace for `touchstart` event.
368
- * @type {string}
369
- */
370
- const touchstartEvent = 'touchstart';
371
-
372
- /**
373
- * A global namespace for `touchmove` event.
374
- * @type {string}
375
- */
376
- const touchmoveEvent = 'touchmove';
377
-
378
- /**
379
- * A global namespace for `touchcancel` event.
380
- * @type {string}
381
- */
382
- const touchcancelEvent = 'touchcancel';
383
-
384
- /**
385
- * A global namespace for `touchend` event.
386
- * @type {string}
387
- */
388
- const touchendEvent = 'touchend';
389
-
390
- /**
391
- * A global namespace for `unload` event.
392
- * @type {string}
393
- */
394
- const unloadEvent = 'unload';
395
-
396
- /**
397
- * A global namespace for all browser native events.
398
- */
399
- const nativeEvents = {
400
- DOMContentLoaded: DOMContentLoadedEvent,
401
- DOMMouseScroll: DOMMouseScrollEvent,
402
- abort: abortEvent,
403
- beforeunload: beforeunloadEvent,
404
- blur: blurEvent,
405
- change: changeEvent,
406
- click: mouseclickEvent,
407
- contextmenu: contextmenuEvent,
408
- dblclick: mousedblclickEvent,
409
- error: errorEvent,
410
- focus: focusEvent,
411
- focusin: focusinEvent,
412
- focusout: focusoutEvent,
413
- gesturechange: gesturechangeEvent,
414
- gestureend: gestureendEvent,
415
- gesturestart: gesturestartEvent,
416
- hover: mousehoverEvent,
417
- keydown: keydownEvent,
418
- keypress: keypressEvent,
419
- keyup: keyupEvent,
420
- load: loadEvent,
421
- mousedown: mousedownEvent,
422
- mousemove: mousemoveEvent,
423
- mousein: mouseinEvent,
424
- mouseout: mouseoutEvent,
425
- mouseenter: mouseenterEvent,
426
- mouseleave: mouseleaveEvent,
427
- mouseover: mouseoverEvent,
428
- mouseup: mouseupEvent,
429
- mousewheel: mousewheelEvent,
430
- move: moveEvent,
431
- orientationchange: orientationchangeEvent,
432
- pointercancel: pointercancelEvent,
433
- pointerdown: pointerdownEvent,
434
- pointerleave: pointerleaveEvent,
435
- pointermove: pointermoveEvent,
436
- pointerup: pointerupEvent,
437
- readystatechange: readystatechangeEvent,
438
- reset: resetEvent,
439
- resize: resizeEvent,
440
- scroll: scrollEvent,
441
- select: selectEvent,
442
- selectend: selectendEvent,
443
- selectstart: selectstartEvent,
444
- submit: submitEvent,
445
- touchcancel: touchcancelEvent,
446
- touchend: touchendEvent,
447
- touchmove: touchmoveEvent,
448
- touchstart: touchstartEvent,
449
- unload: unloadEvent,
450
- };
451
-
452
- /**
453
- * A global namespace for `loadstart` event.
454
- * @type {string}
455
- */
456
- const loadstartEvent = 'loadstart';
457
-
458
- /**
459
- * A global namespace for mouse events equivalent to touch events.
460
- * @type {Record<string, string>}
461
- */
462
- const mouseSwipeEvents = {
463
- start: 'mousedown', end: 'mouseup', move: 'mousemove', cancel: 'mouseleave',
464
- };
465
-
466
- /**
467
- * A global namespace for mouse click events.
468
- * @type {Record<string, string>}
469
- */
470
- const mouseClickEvents = { down: 'mousedown', up: 'mouseup' };
471
-
472
- /**
473
- * A global namespace for mouse hover events.
474
- * @type {[string, string]}
475
- */
476
- const mouseHoverEvents = ('onmouseleave' in document) ? ['mouseenter', 'mouseleave'] : ['mouseover', 'mouseout'];
477
-
478
- /**
479
- * A global namespace for touch events.
480
- * @type {Record<string, string>}
481
- */
482
- const touchEvents = {
483
- start: 'touchstart', end: 'touchend', move: 'touchmove', cancel: 'touchcancel',
484
- };
485
-
486
- /**
487
- * A global namespace for focus event names.
488
- * @type {{in: string, out: string}}
489
- */
490
- const focusEvents = { in: 'focusin', out: 'focusout' };
491
-
492
- /**
493
- * A global namespace for keyboard event keys.
494
- * @type {Record<string, string>}
495
- */
496
- const keyboardEventKeys = {
497
- Backspace: 'Backspace', // 8
498
- Tab: 'Tab', // 9
499
- Enter: 'Enter', // 13
500
- Shift: 'Shift', // 16
501
- Control: 'Control', // 17
502
- Alt: 'Alt', // 18
503
- Pause: 'Pause', // 19
504
- CapsLock: 'CapsLock', // 20
505
- Escape: 'Escape', // 27
506
- Scape: 'Space', // 32
507
- ArrowLeft: 'ArrowLeft', // 37
508
- ArrowUp: 'ArrowUp', // 38
509
- ArrowRight: 'ArrowRight', // 39
510
- ArrowDown: 'ArrowDown', // 40
511
- Insert: 'Insert', // 45
512
- Delete: 'Delete', // 46
513
- Meta: 'Meta', // 91 windows key
514
- ContextMenu: 'ContextMenu', // 93
515
- ScrollLock: 'ScrollLock', // 145
516
- };
517
-
518
- /**
519
- * A global namespace for `Alt` key.
520
- * @type {string} e.which = 18
521
- */
522
- const keyAlt = 'Alt';
523
-
524
- /**
525
- * A global namespace for `ArrowDown` key.
526
- * @type {string} e.which = 40 equivalent
527
- */
528
- const keyArrowDown = 'ArrowDown';
529
-
530
- /**
531
- * A global namespace for `ArrowUp` key.
532
- * @type {string} e.which = 38 equivalent
533
- */
534
- const keyArrowUp = 'ArrowUp';
535
-
536
- /**
537
- * A global namespace for `ArrowLeft` key.
538
- * @type {string} e.which = 37 equivalent
539
- */
540
- const keyArrowLeft = 'ArrowLeft';
541
-
542
- /**
543
- * A global namespace for `ArrowRight` key.
544
- * @type {string} e.which = 39 equivalent
545
- */
546
- const keyArrowRight = 'ArrowRight';
547
-
548
- /**
549
- * A global namespace for `Backspace` key.
550
- * @type {string} e.which === 8 equivalent
551
- */
552
- const keyBackspace = 'Backspace';
553
-
554
- /**
555
- * A global namespace for `CapsLock` key.
556
- * @type {string} e.which = 20 equivalent
557
- */
558
- const keyCapsLock = 'CapsLock';
559
-
560
- /**
561
- * A global namespace for `Control` key.
562
- * @type {string} e.which = 17
563
- */
564
- const keyControl = 'Control';
565
-
566
- /**
567
- * A global namespace for `Delete` key.
568
- * @type {string} e.which = 46 equivalent
569
- */
570
- const keyDelete = 'Delete';
571
-
572
- /**
573
- * A global namespace for `Enter` key.
574
- * @type {string} e.which = 13 equivalent
575
- */
576
- const keyEnter = 'Enter';
577
-
578
- /**
579
- * A global namespace for `Escape` key.
580
- * @type {string} e.which = 27 equivalent
581
- */
582
- const keyEscape = 'Escape';
583
-
584
- /**
585
- * A global namespace for `Insert` key.
586
- * @type {string} e.which = 45 equivalent
587
- */
588
- const keyInsert = 'Insert';
589
-
590
- /**
591
- * A global namespace for `Meta` key.
592
- * @type {string} e.which = 93 equivalent
593
- */
594
- const keyMeta = 'Meta';
595
-
596
- /**
597
- * A global namespace for `Pause` key.
598
- * @type {string} e.which = 19
599
- */
600
- const keyPause = 'Pause';
601
-
602
- /**
603
- * A global namespace for `ScrollLock` key.
604
- * @type {string} e.which = 145 equivalent
605
- */
606
- const keyScrollLock = 'ScrollLock';
607
-
608
- /**
609
- * A global namespace for `Shift` key.
610
- * @type {string} e.which = 16
611
- */
612
- const keyShift = 'Shift';
613
-
614
- /**
615
- * A global namespace for `Space` key.
616
- * @type {string} e.which = 32 equivalent
617
- */
618
- const keySpace = 'Space';
619
-
620
- /**
621
- * A global namespace for `Tab` key.
622
- * @type {string} e.which = 9 equivalent
623
- */
624
- const keyTab = 'Tab';
625
-
626
- /**
627
- * A global namespace for 'animationDuration' string.
628
- * @type {string}
629
- */
630
- const animationDuration$1 = 'animationDuration';
631
-
632
- /**
633
- * A global namespace for `document.head`.
634
- */
635
- const { head: documentHead } = document;
636
-
637
- /**
638
- * A global namespace for 'animationDuration' string.
639
- * @type {string}
640
- */
641
- const animationDuration = 'webkitAnimation' in documentHead.style ? 'webkitAnimationDuration' : 'animationDuration';
642
-
643
- /**
644
- * A global namespace for 'animationDelay' string.
645
- * @type {string}
646
- */
647
- const animationDelay$1 = 'animationDelay';
648
-
649
- /**
650
- * A global namespace for 'animationDelay' string.
651
- * @type {string}
652
- */
653
- const animationDelay = 'webkitAnimation' in documentHead.style ? 'webkitAnimationDelay' : 'animationDelay';
654
-
655
- /**
656
- * A global namespace for 'animationName' string.
657
- * @type {string}
658
- */
659
- const animationName$1 = 'animationName';
660
-
661
- /**
662
- * A global namespace for 'animationName' string.
663
- * @type {string}
664
- */
665
- const animationName = 'webkitAnimation' in documentHead.style ? 'webkitAnimationName' : 'animationName';
666
-
667
- /**
668
- * A global namespace for 'animationend' string.
669
- * @type {string}
670
- */
671
- const animationEndEvent$1 = 'animationend';
672
-
673
- /**
674
- * A global namespace for 'animationend' string.
675
- * @type {string}
676
- */
677
- const animationEndEvent = 'webkitAnimation' in documentHead.style ? 'webkitAnimationEnd' : 'animationend';
678
-
679
- /**
680
- * A global namespace for 'transitionDuration' string.
681
- * @type {string}
682
- */
683
- const transitionDuration$1 = 'transitionDuration';
684
-
685
- /**
686
- * A global namespace for 'transitionDuration' string.
687
- * @type {string}
688
- */
689
- const transitionDuration = 'webkitTransition' in documentHead.style ? 'webkitTransitionDuration' : 'transitionDuration';
690
-
691
- /**
692
- * A global namespace for 'transitionDelay' string.
693
- * @type {string}
694
- */
695
- const transitionDelay$1 = 'transitionDelay';
696
-
697
- /**
698
- * A global namespace for 'transitionDelay' string.
699
- * @type {string}
700
- */
701
- const transitionDelay = 'webkitTransition' in documentHead.style ? 'webkitTransitionDelay' : 'transitionDelay';
702
-
703
- /**
704
- * A global namespace for 'transitionend' string.
705
- * @type {string}
706
- */
707
- const transitionEndEvent$1 = 'transitionend';
708
-
709
- /**
710
- * A global namespace for 'transitionend' string.
711
- * @type {string}
712
- */
713
- const transitionEndEvent = 'webkitTransition' in documentHead.style ? 'webkitTransitionEnd' : 'transitionend';
714
-
715
- /**
716
- * A global namespace for `transitionProperty` string for modern browsers.
717
- *
718
- * @type {string}
719
- */
720
- const transitionProperty$1 = 'transitionProperty';
721
-
722
- /**
723
- * A global namespace for:
724
- * * `transitionProperty` string for modern brosers,
725
- * * `webkitTransition` for legacy Chrome / Safari browsers
726
- *
727
- * @type {string}
728
- */
729
- const transitionProperty = 'webkitTransition' in documentHead.style ? 'webkitTransitionProperty' : 'transitionProperty';
730
-
731
- /**
732
- * A global namespace for 'addEventListener' string.
733
- * @type {string}
734
- */
735
- const addEventListener = 'addEventListener';
736
-
737
- /**
738
- * A global namespace for 'removeEventListener' string.
739
- * @type {string}
740
- */
741
- const removeEventListener = 'removeEventListener';
742
-
743
- /**
744
- * A global namespace for predefined
745
- * CSS3 'cubic-bezier()' easing functions.
746
- * @type {Record<string, string>}
747
- */
748
- const bezierEasings = {
749
- linear: 'linear',
750
- easingSinusoidalIn: 'cubic-bezier(0.47,0,0.745,0.715)',
751
- easingSinusoidalOut: 'cubic-bezier(0.39,0.575,0.565,1)',
752
- easingSinusoidalInOut: 'cubic-bezier(0.445,0.05,0.55,0.95)',
753
- easingQuadraticIn: 'cubic-bezier(0.550,0.085,0.680,0.530)',
754
- easingQuadraticOut: 'cubic-bezier(0.250,0.460,0.450,0.940)',
755
- easingQuadraticInOut: 'cubic-bezier(0.455,0.030,0.515,0.955)',
756
- easingCubicIn: 'cubic-bezier(0.55,0.055,0.675,0.19)',
757
- easingCubicOut: 'cubic-bezier(0.215,0.61,0.355,1)',
758
- easingCubicInOut: 'cubic-bezier(0.645,0.045,0.355,1)',
759
- easingQuarticIn: 'cubic-bezier(0.895,0.03,0.685,0.22)',
760
- easingQuarticOut: 'cubic-bezier(0.165,0.84,0.44,1)',
761
- easingQuarticInOut: 'cubic-bezier(0.77,0,0.175,1)',
762
- easingQuinticIn: 'cubic-bezier(0.755,0.05,0.855,0.06)',
763
- easingQuinticOut: 'cubic-bezier(0.23,1,0.32,1)',
764
- easingQuinticInOut: 'cubic-bezier(0.86,0,0.07,1)',
765
- easingExponentialIn: 'cubic-bezier(0.95,0.05,0.795,0.035)',
766
- easingExponentialOut: 'cubic-bezier(0.19,1,0.22,1)',
767
- easingExponentialInOut: 'cubic-bezier(1,0,0,1)',
768
- easingCircularIn: 'cubic-bezier(0.6,0.04,0.98,0.335)',
769
- easingCircularOut: 'cubic-bezier(0.075,0.82,0.165,1)',
770
- easingCircularInOut: 'cubic-bezier(0.785,0.135,0.15,0.86)',
771
- easingBackIn: 'cubic-bezier(0.6,-0.28,0.735,0.045)',
772
- easingBackOut: 'cubic-bezier(0.175,0.885,0.32,1.275)',
773
- easingBackInOut: 'cubic-bezier(0.68,-0.55,0.265,1.55)',
774
- };
775
-
776
- /**
777
- * A global namespace for `offsetHeight` property.
778
- * @type {string}
779
- */
780
- const offsetHeight = 'offsetHeight';
781
-
782
- /**
783
- * A global namespace for `offsetWidth` property.
784
- * @type {string}
785
- */
786
- const offsetWidth = 'offsetWidth';
787
-
788
- /**
789
- * A global namespace for `scrollHeight` property.
790
- * @type {string}
791
- */
792
- const scrollHeight = 'scrollHeight';
793
-
794
- /**
795
- * A global namespace for `scrollWidth` property.
796
- * @type {string}
797
- */
798
- const scrollWidth = 'scrollWidth';
799
-
800
- // @ts-ignore
801
- const { userAgentData: uaDATA } = navigator;
802
-
803
- /**
804
- * A global namespace for `userAgentData` object.
805
- */
806
- const userAgentData = uaDATA;
807
-
808
- const { userAgent: userAgentString } = navigator;
809
-
810
- /**
811
- * A global namespace for `navigator.userAgent` string.
812
- */
813
- const userAgent = userAgentString;
814
-
815
- const mobileBrands = /iPhone|iPad|iPod|Android/i;
816
- let isMobileCheck = false;
817
-
818
- if (userAgentData) {
819
- isMobileCheck = userAgentData.brands
820
- .some((/** @type {Record<String, any>} */x) => mobileBrands.test(x.brand));
821
- } else {
822
- isMobileCheck = mobileBrands.test(userAgent);
823
- }
824
-
825
- /**
826
- * A global `boolean` for mobile detection.
827
- * @type {boolean}
828
- */
829
- const isMobile = isMobileCheck;
830
-
831
- const appleBrands = /(iPhone|iPod|iPad)/;
832
-
833
- /**
834
- * A global `boolean` for Apple browsers.
835
- * @type {boolean}
836
- */
837
- const isApple = !userAgentData ? appleBrands.test(userAgent)
838
- : userAgentData.brands.some((/** @type {Record<string, any>} */x) => appleBrands.test(x.brand));
839
-
840
- /**
841
- * A global boolean for Gecko browsers. When writing this file,
842
- * Gecko was not supporting `userAgentData`.
843
- * @type {boolean}
844
- */
845
- const isFirefox = userAgent ? userAgent.includes('Firefox') : false;
846
-
847
- /**
848
- * A global `boolean` for CSS3 3D transform support.
849
- * @type {boolean}
850
- */
851
- const support3DTransform = 'webkitPerspective' in documentHead.style || 'perspective' in documentHead.style;
852
-
853
- /**
854
- * Add eventListener to an `Element` | `HTMLElement` | `Document` target.
855
- *
856
- * @param {HTMLElement | Element | Document | Window} element event.target
857
- * @param {string} eventName event.type
858
- * @param {EventListener} listener callback
859
- * @param {(EventListenerOptions | boolean)=} options other event options
860
- * @returns {void}
861
- */
862
- function on(element, eventName, listener, options) {
863
- const ops = options || false;
864
- element.addEventListener(eventName, listener, ops);
865
- }
866
-
867
- /**
868
- * Remove eventListener from an `Element` | `HTMLElement` | `Document` | `Window` target.
869
- *
870
- * @param {HTMLElement | Element | Document | Window} element event.target
871
- * @param {string} eventName event.type
872
- * @param {EventListener} listener callback
873
- * @param {(EventListenerOptions | boolean)=} options other event options
874
- * @returns {void}
875
- */
876
- function off(element, eventName, listener, options) {
877
- const ops = options || false;
878
- element.removeEventListener(eventName, listener, ops);
879
- }
880
-
881
- /**
882
- * Add an `eventListener` to an `Element` | `HTMLElement` | `Document` | `Window`
883
- * target and remove it once callback is called.
884
- *
885
- * @param {HTMLElement | Element | Document | Window} element event.target
886
- * @param {string} eventName event.type
887
- * @param {EventListener} listener callback
888
- * @param {(EventListenerOptions | boolean)=} options other event options
889
- * @returns {void}
890
- */
891
- function one(element, eventName, listener, options) {
892
- /**
893
- * Wrap the listener for easy on -> off
894
- * @type {EventListener}
895
- */
896
- const handlerWrapper = (e) => {
897
- if (e.target === element) {
898
- listener.apply(element, [e]);
899
- off(element, eventName, handlerWrapper, options);
900
- }
901
- };
902
- on(element, eventName, handlerWrapper, options);
903
- }
904
-
905
- /**
906
- * A global `boolean` for passive events support,
907
- * in general event options are not suited for scroll prevention.
908
- *
909
- * @see https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection
910
- * @type {boolean}
911
- */
912
- const supportPassive = (() => {
913
- let result = false;
914
- try {
915
- const opts = Object.defineProperty({}, 'passive', {
916
- get() {
917
- result = true;
918
- return result;
919
- },
920
- });
921
- one(document, DOMContentLoadedEvent, () => {}, opts);
922
- } catch (e) {
923
- throw Error('Passive events are not supported');
924
- }
925
-
926
- return result;
927
- })();
928
-
929
- /**
930
- * A global `boolean` for CSS3 transform support.
931
- * @type {boolean}
932
- */
933
- const supportTransform = 'webkitTransform' in documentHead.style || 'transform' in documentHead.style;
934
-
935
- /**
936
- * A global `boolean` for touch events support.
937
- * @type {boolean}
938
- */
939
- const supportTouch = 'ontouchstart' in window || 'msMaxTouchPoints' in navigator;
940
-
941
- /**
942
- * A global `boolean` for CSS3 animation support.
943
- * @type {boolean}
944
- */
945
- const supportAnimation = 'webkitAnimation' in documentHead.style || 'animation' in documentHead.style;
946
-
947
- /**
948
- * A global `boolean` for CSS3 transition support.
949
- * @type {boolean}
950
- */
951
- const supportTransition = 'webkitTransition' in documentHead.style || 'transition' in documentHead.style;
952
-
953
- /**
954
- * Shortcut for `HTMLElement.getAttribute()` method.
955
- * @param {HTMLElement | Element} element target element
956
- * @param {string} attribute attribute name
957
- * @returns {string?} attribute value
958
- */
959
- const getAttribute = (element, attribute) => element.getAttribute(attribute);
960
-
961
- /**
962
- * Shortcut for `HTMLElement.getAttributeNS()` method.
963
- * @param {string} ns attribute namespace
964
- * @param {HTMLElement | Element} element target element
965
- * @param {string} attribute attribute name
966
- * @returns {string?} attribute value
967
- */
968
- const getAttributeNS = (ns, element, attribute) => element.getAttributeNS(ns, attribute);
969
-
970
- /**
971
- * Shortcut for `HTMLElement.hasAttribute()` method.
972
- * @param {HTMLElement | Element} element target element
973
- * @param {string} attribute attribute name
974
- * @returns {boolean} the query result
975
- */
976
- const hasAttribute = (element, attribute) => element.hasAttribute(attribute);
977
-
978
- /**
979
- * Shortcut for `HTMLElement.hasAttributeNS()` method.
980
- * @param {string} ns attribute namespace
981
- * @param {HTMLElement | Element} element target element
982
- * @param {string} att attribute name
983
- * @returns {boolean} the query result
984
- */
985
- const hasAttributeNS = (ns, element, att) => element.hasAttributeNS(ns, att);
986
-
987
- /**
988
- * Shortcut for `HTMLElement.setAttribute()` method.
989
- * @param {HTMLElement | Element} element target element
990
- * @param {string} attribute attribute name
991
- * @param {string} value attribute value
992
- * @returns {void}
993
- */
994
- const setAttribute = (element, attribute, value) => element.setAttribute(attribute, value);
995
-
996
- /**
997
- * Shortcut for `SVGElement.setAttributeNS()` method.
998
- * @param {string} ns attribute namespace
999
- * @param {HTMLElement | Element} element target element
1000
- * @param {string} att attribute name
1001
- * @param {string} value attribute value
1002
- * @returns {void}
1003
- */
1004
- const setAttributeNS = (ns, element, att, value) => element.setAttributeNS(ns, att, value);
1005
-
1006
- /**
1007
- * Shortcut for `HTMLElement.removeAttribute()` method.
1008
- * @param {HTMLElement | Element} element target element
1009
- * @param {string} attribute attribute name
1010
- * @returns {void}
1011
- */
1012
- const removeAttribute = (element, attribute) => element.removeAttribute(attribute);
1013
-
1014
- /**
1015
- * Shortcut for `HTMLElement.removeAttributeNS()` method.
1016
- * @param {string} ns attribute namespace
1017
- * @param {HTMLElement | Element} element target element
1018
- * @param {string} att attribute name
1019
- * @returns {void}
1020
- */
1021
- const removeAttributeNS = (ns, element, att) => element.removeAttributeNS(ns, att);
1022
-
1023
- /**
1024
- * Add class to `HTMLElement.classList`.
1025
- *
1026
- * @param {HTMLElement | Element} element target
1027
- * @param {string} classNAME to add
1028
- * @returns {void}
1029
- */
1030
- function addClass(element, classNAME) {
1031
- element.classList.add(classNAME);
1032
- }
1033
-
1034
- /**
1035
- * Remove class from `HTMLElement.classList`.
1036
- *
1037
- * @param {HTMLElement | Element} element target
1038
- * @param {string} classNAME to remove
1039
- * @returns {void}
1040
- */
1041
- function removeClass(element, classNAME) {
1042
- element.classList.remove(classNAME);
1043
- }
1044
-
1045
- /**
1046
- * Check class in `HTMLElement.classList`.
1047
- *
1048
- * @param {HTMLElement | Element} element target
1049
- * @param {string} classNAME to check
1050
- * @returns {boolean}
1051
- */
1052
- function hasClass(element, classNAME) {
1053
- return element.classList.contains(classNAME);
1054
- }
1055
-
1056
- /**
1057
- * Shortcut for `Array.from()` static method.
1058
- *
1059
- * @param {any[] | HTMLCollection | NodeList | Map<any, any>} arr array-like iterable object
1060
- * @returns {Array<any>}
1061
- */
1062
- const ArrayFrom = (arr) => Array.from(arr);
1063
-
1064
- /**
1065
- * Returns the `document` or the `#document` element.
1066
- * @see https://github.com/floating-ui/floating-ui
1067
- * @param {(Node | HTMLElement | Element | globalThis)=} node
1068
- * @returns {Document}
1069
- */
1070
- function getDocument(node) {
1071
- if (node instanceof HTMLElement) return node.ownerDocument;
1072
- if (node instanceof Window) return node.document;
1073
- return window.document;
1074
- }
1075
-
1076
- /**
1077
- * Utility to check if target is typeof `HTMLElement`, `Element`, `Node`
1078
- * or find one that matches a selector.
1079
- *
1080
- * @param {Node | HTMLElement | Element | string} selector the input selector or target element
1081
- * @param {(Node | HTMLElement | Element | Document)=} parent optional node to look into
1082
- * @return {(HTMLElement | Element)?} the `HTMLElement` or `querySelector` result
1083
- */
1084
- function querySelector(selector, parent) {
1085
- if (typeof selector === 'string') {
1086
- const lookUp = typeof parent !== 'object' ? getDocument() : parent;
1087
- return lookUp.querySelector(selector);
1088
- }
1089
- return selector;
1090
- }
1091
-
1092
- /** @type {Map<string, Map<HTMLElement | Element, Record<string, any>>>} */
1093
- const componentData = new Map();
1094
- /**
1095
- * An interface for web components background data.
1096
- * @see https://github.com/thednp/bootstrap.native/blob/master/src/components/base-component.js
1097
- */
1098
- const Data = {
1099
- /**
1100
- * Sets web components data.
1101
- * @param {HTMLElement | Element | string} target target element
1102
- * @param {string} component the component's name or a unique key
1103
- * @param {Record<string, any>} instance the component instance
1104
- */
1105
- set: (target, component, instance) => {
1106
- const element = querySelector(target);
1107
- if (!element) return;
1108
-
1109
- if (!componentData.has(component)) {
1110
- componentData.set(component, new Map());
1111
- }
1112
-
1113
- const instanceMap = componentData.get(component);
1114
- // @ts-ignore - not undefined, but defined right above
1115
- instanceMap.set(element, instance);
1116
- },
1117
-
1118
- /**
1119
- * Returns all instances for specified component.
1120
- * @param {string} component the component's name or a unique key
1121
- * @returns {Map<HTMLElement | Element, Record<string, any>>?} all the component instances
1122
- */
1123
- getAllFor: (component) => {
1124
- const instanceMap = componentData.get(component);
1125
-
1126
- return instanceMap || null;
1127
- },
1128
-
1129
- /**
1130
- * Returns the instance associated with the target.
1131
- * @param {HTMLElement | Element | string} target target element
1132
- * @param {string} component the component's name or a unique key
1133
- * @returns {Record<string, any>?} the instance
1134
- */
1135
- get: (target, component) => {
1136
- const element = querySelector(target);
1137
- const allForC = Data.getAllFor(component);
1138
- const instance = element && allForC && allForC.get(element);
1139
-
1140
- return instance || null;
1141
- },
1142
-
1143
- /**
1144
- * Removes web components data.
1145
- * @param {HTMLElement | Element | string} target target element
1146
- * @param {string} component the component's name or a unique key
1147
- */
1148
- remove: (target, component) => {
1149
- const element = querySelector(target);
1150
- const instanceMap = componentData.get(component);
1151
- if (!instanceMap || !element) return;
1152
-
1153
- instanceMap.delete(element);
1154
-
1155
- if (instanceMap.size === 0) {
1156
- componentData.delete(component);
1157
- }
1158
- },
1159
- };
1160
-
1161
- /**
1162
- * An alias for `Data.get()`.
1163
- * @type {SHORTER.getInstance<any>}
1164
- */
1165
- const getInstance = (target, component) => Data.get(target, component);
1166
-
1167
- /**
1168
- * Shortcut for `Object.assign()` static method.
1169
- * @param {Record<string, any>} obj a target object
1170
- * @param {Record<string, any>} source a source object
1171
- */
1172
- const ObjectAssign = (obj, source) => Object.assign(obj, source);
1173
-
1174
- /**
1175
- * This is a shortie for `document.createElement` method
1176
- * which allows you to create a new `HTMLElement` for a given `tagName`
1177
- * or based on an object with specific non-readonly attributes:
1178
- * `id`, `className`, `textContent`, `style`, etc.
1179
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement
1180
- *
1181
- * @param {Record<string, string> | string} param `tagName` or object
1182
- * @return {HTMLElement | Element} a new `HTMLElement` or `Element`
1183
- */
1184
- function createElement(param) {
1185
- if (typeof param === 'string') {
1186
- return getDocument().createElement(param);
1187
- }
1188
-
1189
- const { tagName } = param;
1190
- const attr = { ...param };
1191
- const newElement = createElement(tagName);
1192
- delete attr.tagName;
1193
- ObjectAssign(newElement, attr);
1194
- return newElement;
1195
- }
1196
-
1197
- /**
1198
- * This is a shortie for `document.createElementNS` method
1199
- * which allows you to create a new `HTMLElement` for a given `tagName`
1200
- * or based on an object with specific non-readonly attributes:
1201
- * `id`, `className`, `textContent`, `style`, etc.
1202
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createElementNS
1203
- *
1204
- * @param {string} namespace `namespaceURI` to associate with the new `HTMLElement`
1205
- * @param {Record<string, string> | string} param `tagName` or object
1206
- * @return {HTMLElement | Element} a new `HTMLElement` or `Element`
1207
- */
1208
- function createElementNS(namespace, param) {
1209
- if (typeof param === 'string') {
1210
- return getDocument().createElementNS(namespace, param);
1211
- }
1212
-
1213
- const { tagName } = param;
1214
- const attr = { ...param };
1215
- const newElement = createElementNS(namespace, tagName);
1216
- delete attr.tagName;
1217
- ObjectAssign(newElement, attr);
1218
- return newElement;
1219
- }
1220
-
1221
- /**
1222
- * Shortcut for the `Element.dispatchEvent(Event)` method.
1223
- *
1224
- * @param {HTMLElement | Element} element is the target
1225
- * @param {Event} event is the `Event` object
1226
- */
1227
- const dispatchEvent = (element, event) => element.dispatchEvent(event);
1228
-
1229
- /**
1230
- * JavaScript `Array` distinct.
1231
- * @see https://codeburst.io/javascript-array-distinct-5edc93501dc4
1232
- * @param {any} value
1233
- * @param {number} index
1234
- * @param {any} self
1235
- * @returns {boolean}
1236
- */
1237
- const distinct = (value, index, self) => self.indexOf(value) === index;
1238
-
1239
- /**
1240
- * Shortcut for `window.getComputedStyle(element).propertyName`
1241
- * static method.
1242
- *
1243
- * * If `element` parameter is not an `HTMLElement`, `getComputedStyle`
1244
- * throws a `ReferenceError`.
1245
- *
1246
- * @param {HTMLElement | Element} element target
1247
- * @param {string} property the css property
1248
- * @return {string} the css property value
1249
- */
1250
- function getElementStyle(element, property) {
1251
- const computedStyle = getComputedStyle(element);
1252
-
1253
- // @ts-ignore -- must use camelcase strings,
1254
- // or non-camelcase strings with `getPropertyValue`
1255
- return property in computedStyle ? computedStyle[property] : '';
1256
- }
1257
-
1258
- /**
1259
- * Utility to get the computed `animationDelay`
1260
- * from Element in miliseconds.
1261
- *
1262
- * @param {HTMLElement | Element} element target
1263
- * @return {number} the value in miliseconds
1264
- */
1265
- function getElementAnimationDelay$1(element) {
1266
- const propertyValue = getElementStyle(element, animationName$1);
1267
- const durationValue = getElementStyle(element, animationDelay$1);
1268
-
1269
- const durationScale = durationValue.includes('ms') ? 1 : 1000;
1270
- const duration = propertyValue && propertyValue !== 'none'
1271
- ? parseFloat(durationValue) * durationScale : 0;
1272
-
1273
- return !Number.isNaN(duration) ? duration : 0;
1274
- }
1275
-
1276
- /**
1277
- * Utility to get the computed `animationDuration`
1278
- * from `HTMLElement` in miliseconds.
1279
- *
1280
- * @param {HTMLElement | Element} element target
1281
- * @return {number} the value in miliseconds
1282
- */
1283
- function getElementAnimationDuration$1(element) {
1284
- const propertyValue = getElementStyle(element, animationName$1);
1285
- const durationValue = getElementStyle(element, animationDuration$1);
1286
- const durationScale = durationValue.includes('ms') ? 1 : 1000;
1287
- const duration = propertyValue && propertyValue !== 'none'
1288
- ? parseFloat(durationValue) * durationScale : 0;
1289
-
1290
- return !Number.isNaN(duration) ? duration : 0;
1291
- }
1292
-
1293
- /**
1294
- * Utility to make sure callbacks are consistently
1295
- * called when animation ends.
1296
- *
1297
- * @param {HTMLElement | Element} element target
1298
- * @param {EventListener} handler `animationend` callback
1299
- */
1300
- function emulateAnimationEnd$1(element, handler) {
1301
- let called = 0;
1302
- const endEvent = new Event(animationEndEvent$1);
1303
- const duration = getElementAnimationDuration$1(element);
1304
- const delay = getElementAnimationDelay$1(element);
1305
-
1306
- if (duration) {
1307
- /**
1308
- * Wrap the handler in on -> off callback
1309
- * @type {EventListener}
1310
- */
1311
- const animationEndWrapper = (e) => {
1312
- if (e.target === element) {
1313
- handler.apply(element, [e]);
1314
- element.removeEventListener(animationEndEvent$1, animationEndWrapper);
1315
- called = 1;
1316
- }
1317
- };
1318
- element.addEventListener(animationEndEvent$1, animationEndWrapper);
1319
- setTimeout(() => {
1320
- if (!called) element.dispatchEvent(endEvent);
1321
- }, duration + delay + 17);
1322
- } else {
1323
- handler.apply(element, [endEvent]);
1324
- }
1325
- }
1326
-
1327
- /**
1328
- * Utility to get the computed `animationDelay`
1329
- * from Element in miliseconds.
1330
- *
1331
- * @param {HTMLElement | Element} element target
1332
- * @return {number} the value in miliseconds
1333
- */
1334
- function getElementAnimationDelay(element) {
1335
- const propertyValue = getElementStyle(element, animationName);
1336
- const durationValue = getElementStyle(element, animationDelay);
1337
- const durationScale = durationValue.includes('ms') ? 1 : 1000;
1338
- const duration = supportAnimation && propertyValue && propertyValue !== 'none'
1339
- ? parseFloat(durationValue) * durationScale : 0;
1340
-
1341
- return !Number.isNaN(duration) ? duration : 0;
1342
- }
1343
-
1344
- /**
1345
- * Utility to get the computed `animationDuration`
1346
- * from `HTMLElement` in miliseconds.
1347
- *
1348
- * @param {HTMLElement | Element} element target
1349
- * @return {number} the value in miliseconds
1350
- */
1351
- function getElementAnimationDuration(element) {
1352
- const propertyValue = getElementStyle(element, animationName);
1353
- const durationValue = getElementStyle(element, animationDuration);
1354
- const durationScale = durationValue.includes('ms') ? 1 : 1000;
1355
- const duration = supportAnimation && propertyValue && propertyValue !== 'none'
1356
- ? parseFloat(durationValue) * durationScale : 0;
1357
-
1358
- return !Number.isNaN(duration) ? duration : 0;
1359
- }
1360
-
1361
- /**
1362
- * Utility to make sure callbacks are consistently
1363
- * called when animation ends.
1364
- *
1365
- * @param {HTMLElement | Element} element target
1366
- * @param {EventListener} handler `animationend` callback
1367
- */
1368
- function emulateAnimationEnd(element, handler) {
1369
- let called = 0;
1370
- const endEvent = new Event(animationEndEvent);
1371
- const duration = getElementAnimationDuration(element);
1372
- const delay = getElementAnimationDelay(element);
1373
-
1374
- if (supportAnimation && duration) {
1375
- /**
1376
- * Wrap the handler in on -> off callback
1377
- * @param {Event} e Event object
1378
- */
1379
- const animationEndWrapper = (e) => {
1380
- if (e.target === element) {
1381
- handler.apply(element, [e]);
1382
- element.removeEventListener(animationEndEvent, animationEndWrapper);
1383
- called = 1;
1384
- }
1385
- };
1386
- element.addEventListener(animationEndEvent, animationEndWrapper);
1387
- setTimeout(() => {
1388
- if (!called) element.dispatchEvent(endEvent);
1389
- }, duration + delay + 17);
1390
- } else {
1391
- handler.apply(element, [endEvent]);
1392
- }
1393
- }
1394
-
1395
- /**
1396
- * Utility to get the computed `transitionDelay`
1397
- * from Element in miliseconds.
1398
- *
1399
- * @param {HTMLElement | Element} element target
1400
- * @return {number} the value in miliseconds
1401
- */
1402
- function getElementTransitionDelay$1(element) {
1403
- const propertyValue = getElementStyle(element, transitionProperty$1);
1404
- const delayValue = getElementStyle(element, transitionDelay$1);
1405
-
1406
- const delayScale = delayValue.includes('ms') ? 1 : 1000;
1407
- const duration = propertyValue && propertyValue !== 'none'
1408
- ? parseFloat(delayValue) * delayScale : 0;
1409
-
1410
- return !Number.isNaN(duration) ? duration : 0;
1411
- }
1412
-
1413
- /**
1414
- * Utility to get the computed `transitionDuration`
1415
- * from Element in miliseconds.
1416
- *
1417
- * @param {HTMLElement | Element} element target
1418
- * @return {number} the value in miliseconds
1419
- */
1420
- function getElementTransitionDuration$1(element) {
1421
- const propertyValue = getElementStyle(element, transitionProperty$1);
1422
- const durationValue = getElementStyle(element, transitionDuration$1);
1423
- const durationScale = durationValue.includes('ms') ? 1 : 1000;
1424
- const duration = propertyValue && propertyValue !== 'none'
1425
- ? parseFloat(durationValue) * durationScale : 0;
1426
-
1427
- return !Number.isNaN(duration) ? duration : 0;
1428
- }
1429
-
1430
- /**
1431
- * Utility to make sure callbacks are consistently
1432
- * called when transition ends.
1433
- *
1434
- * @param {HTMLElement | Element} element target
1435
- * @param {EventListener} handler `transitionend` callback
1436
- */
1437
- function emulateTransitionEnd$1(element, handler) {
1438
- let called = 0;
1439
- const endEvent = new Event(transitionEndEvent$1);
1440
- const duration = getElementTransitionDuration$1(element);
1441
- const delay = getElementTransitionDelay$1(element);
1442
-
1443
- if (duration) {
1444
- /**
1445
- * Wrap the handler in on -> off callback
1446
- * @type {EventListener} e Event object
1447
- */
1448
- const transitionEndWrapper = (e) => {
1449
- if (e.target === element) {
1450
- handler.apply(element, [e]);
1451
- element.removeEventListener(transitionEndEvent$1, transitionEndWrapper);
1452
- called = 1;
1453
- }
1454
- };
1455
- element.addEventListener(transitionEndEvent$1, transitionEndWrapper);
1456
- setTimeout(() => {
1457
- if (!called) element.dispatchEvent(endEvent);
1458
- }, duration + delay + 17);
1459
- } else {
1460
- handler.apply(element, [endEvent]);
1461
- }
1462
- }
1463
-
1464
- /**
1465
- * Utility to get the computed `transitionDelay`
1466
- * from Element in miliseconds.
1467
- *
1468
- * @param {HTMLElement | Element} element target
1469
- * @return {number} the value in miliseconds
1470
- */
1471
- function getElementTransitionDelay(element) {
1472
- const propertyValue = getElementStyle(element, transitionProperty);
1473
- const delayValue = getElementStyle(element, transitionDelay);
1474
- const delayScale = delayValue.includes('ms') ? 1 : 1000;
1475
- const duration = supportTransition && propertyValue && propertyValue !== 'none'
1476
- ? parseFloat(delayValue) * delayScale : 0;
1477
-
1478
- return !Number.isNaN(duration) ? duration : 0;
1479
- }
1480
-
1481
- /**
1482
- * Utility to get the computed `transitionDuration`
1483
- * from Element in miliseconds.
1484
- *
1485
- * @param {HTMLElement | Element} element target
1486
- * @return {number} the value in miliseconds
1487
- */
1488
- function getElementTransitionDuration(element) {
1489
- const propertyValue = getElementStyle(element, transitionProperty);
1490
- const durationValue = getElementStyle(element, transitionDuration);
1491
- const durationScale = durationValue.includes('ms') ? 1 : 1000;
1492
- const duration = supportTransition && propertyValue && propertyValue !== 'none'
1493
- ? parseFloat(durationValue) * durationScale : 0;
1494
-
1495
- return !Number.isNaN(duration) ? duration : 0;
1496
- }
1497
-
1498
- /**
1499
- * Utility to make sure callbacks are consistently
1500
- * called when transition ends.
1501
- *
1502
- * @param {HTMLElement | Element} element target
1503
- * @param {EventListener} handler `transitionend` callback
1504
- */
1505
- function emulateTransitionEnd(element, handler) {
1506
- let called = 0;
1507
- const endEvent = new Event(transitionEndEvent);
1508
- const duration = getElementTransitionDuration(element);
1509
- const delay = getElementTransitionDelay(element);
1510
-
1511
- if (supportTransition && duration) {
1512
- /**
1513
- * Wrap the handler in on -> off callback
1514
- * @param {Event} e Event object
1515
- */
1516
- const transitionEndWrapper = (e) => {
1517
- if (e.target === element) {
1518
- handler.apply(element, [e]);
1519
- element.removeEventListener(transitionEndEvent, transitionEndWrapper);
1520
- called = 1;
1521
- }
1522
- };
1523
- element.addEventListener(transitionEndEvent, transitionEndWrapper);
1524
- setTimeout(() => {
1525
- if (!called) element.dispatchEvent(endEvent);
1526
- }, duration + delay + 17);
1527
- } else {
1528
- handler.apply(element, [endEvent]);
1529
- }
1530
- }
1531
-
1532
- /**
1533
- * Shortcut for `Float32Array.from()` static method.
1534
- * @param {any[] | HTMLCollection | NodeList} arr array-like iterable object
1535
- * @returns {Float32Array}
1536
- */
1537
- const Float32ArrayFrom = (arr) => Float32Array.from(Array.from(arr));
1538
-
1539
- /**
1540
- * Shortcut for `Float64Array.from()` static method.
1541
- * @param {any[] | HTMLCollection | NodeList} arr array-like iterable object
1542
- * @returns {Float64Array}
1543
- */
1544
- const Float64ArrayFrom = (arr) => Float64Array.from(Array.from(arr));
1545
-
1546
- /**
1547
- * Utility to focus an `HTMLElement` target.
1548
- *
1549
- * @param {HTMLElement | Element} element is the target
1550
- */
1551
- // @ts-ignore -- `Element`s resulted from querySelector can focus too
1552
- const focus = (element) => element.focus();
1553
-
1554
- /** A generic function with empty body. */
1555
- const noop = () => {};
1556
-
1557
- /**
1558
- * The raw value or a given component option.
1559
- *
1560
- * @typedef {string | HTMLElement | Function | number | boolean | null} niceValue
1561
- */
1562
-
1563
- /**
1564
- * Utility to normalize component options
1565
- *
1566
- * @param {any} value the input value
1567
- * @return {niceValue} the normalized value
1568
- */
1569
- function normalizeValue(value) {
1570
- if (value === 'true') { // boolean
1571
- return true;
1572
- }
1573
-
1574
- if (value === 'false') { // boolean
1575
- return false;
1576
- }
1577
-
1578
- if (!Number.isNaN(+value)) { // number
1579
- return +value;
1580
- }
1581
-
1582
- if (value === '' || value === 'null') { // null
1583
- return null;
1584
- }
1585
-
1586
- // string / function / HTMLElement / object
1587
- return value;
1588
- }
1589
-
1590
- /**
1591
- * Shortcut for `Object.keys()` static method.
1592
- * @param {Record<string, any>} obj a target object
1593
- * @returns {string[]}
1594
- */
1595
- const ObjectKeys = (obj) => Object.keys(obj);
1596
-
1597
- /**
1598
- * Shortcut for `String.toLowerCase()`.
1599
- *
1600
- * @param {string} source input string
1601
- * @returns {string} lowercase output string
1602
- */
1603
- const toLowerCase = (source) => source.toLowerCase();
1604
-
1605
- /**
1606
- * Utility to normalize component options.
1607
- *
1608
- * @param {HTMLElement | Element} element target
1609
- * @param {Record<string, any>} defaultOps component default options
1610
- * @param {Record<string, any>} inputOps component instance options
1611
- * @param {string=} ns component namespace
1612
- * @return {Record<string, any>} normalized component options object
1613
- */
1614
- function normalizeOptions(element, defaultOps, inputOps, ns) {
1615
- // @ts-ignore -- our targets are always `HTMLElement`
1616
- const data = { ...element.dataset };
1617
- /** @type {Record<string, any>} */
1618
- const normalOps = {};
1619
- /** @type {Record<string, any>} */
1620
- const dataOps = {};
1621
- const title = 'title';
1622
-
1623
- ObjectKeys(data).forEach((k) => {
1624
- const key = ns && k.includes(ns)
1625
- ? k.replace(ns, '').replace(/[A-Z]/, (match) => toLowerCase(match))
1626
- : k;
1627
-
1628
- dataOps[key] = normalizeValue(data[k]);
1629
- });
1630
-
1631
- ObjectKeys(inputOps).forEach((k) => {
1632
- inputOps[k] = normalizeValue(inputOps[k]);
1633
- });
1634
-
1635
- ObjectKeys(defaultOps).forEach((k) => {
1636
- if (k in inputOps) {
1637
- normalOps[k] = inputOps[k];
1638
- } else if (k in dataOps) {
1639
- normalOps[k] = dataOps[k];
1640
- } else {
1641
- normalOps[k] = k === title
1642
- ? getAttribute(element, title)
1643
- : defaultOps[k];
1644
- }
1645
- });
1646
-
1647
- return normalOps;
1648
- }
1649
-
1650
- /**
1651
- * Shortcut for `Object.values()` static method.
1652
- * @param {Record<string, any>} obj a target object
1653
- * @returns {any[]}
1654
- */
1655
- const ObjectValues = (obj) => Object.values(obj);
1656
-
1657
- /**
1658
- * Returns a namespaced `CustomEvent` specific to each component.
1659
- * @param {string} EventType Event.type
1660
- * @param {Record<string, any>=} config Event.options | Event.properties
1661
- * @returns {SHORTER.OriginalEvent} a new namespaced event
1662
- */
1663
- function OriginalEvent(EventType, config) {
1664
- const OriginalCustomEvent = new CustomEvent(EventType, {
1665
- cancelable: true, bubbles: true,
1666
- });
1667
-
1668
- if (config instanceof Object) {
1669
- ObjectAssign(OriginalCustomEvent, config);
1670
- }
1671
- return OriginalCustomEvent;
1672
- }
1673
-
1674
- /**
1675
- * A global namespace for most scroll event listeners.
1676
- * @type {Partial<AddEventListenerOptions>}
1677
- */
1678
- const passiveHandler$1 = { passive: true };
1679
-
1680
- /**
1681
- * A global namespace for most scroll event listeners in legacy browsers.
1682
- * @type {Partial<AddEventListenerOptions> | boolean}
1683
- */
1684
- const passiveHandler = supportPassive ? { passive: true } : false;
1685
-
1686
- /**
1687
- * Utility to force re-paint of an `HTMLElement` target.
1688
- *
1689
- * @param {HTMLElement | Element} element is the target
1690
- * @return {number} the `Element.offsetHeight` value
1691
- */
1692
- // @ts-ignore
1693
- const reflow = (element) => element.offsetHeight;
1694
-
1695
- /**
1696
- * Shortcut for multiple uses of `HTMLElement.style.propertyName` method.
1697
- * @param {HTMLElement | Element} element target element
1698
- * @param {Partial<CSSStyleDeclaration>} styles attribute value
1699
- */
1700
- // @ts-ignore
1701
- const setElementStyle = (element, styles) => { ObjectAssign(element.style, styles); };
1702
-
1703
- /** @type {Map<HTMLElement | Element, any>} */
1704
- const TimeCache = new Map();
1705
- /**
1706
- * An interface for one or more `TimerHandler`s per `Element`.
1707
- * @see https://github.com/thednp/navbar.js/
1708
- */
1709
- const Timer = {
1710
- /**
1711
- * Sets a new timeout timer for an element, or element -> key association.
1712
- * @param {HTMLElement | Element | string} target target element
1713
- * @param {ReturnType<TimerHandler>} callback the callback
1714
- * @param {number} delay the execution delay
1715
- * @param {string=} key a unique key
1716
- */
1717
- set: (target, callback, delay, key) => {
1718
- const element = querySelector(target);
1719
-
1720
- if (!element) return;
1721
-
1722
- if (key && key.length) {
1723
- if (!TimeCache.has(element)) {
1724
- TimeCache.set(element, new Map());
1725
- }
1726
- const keyTimers = TimeCache.get(element);
1727
- keyTimers.set(key, setTimeout(callback, delay));
1728
- } else {
1729
- TimeCache.set(element, setTimeout(callback, delay));
1730
- }
1731
- },
1732
-
1733
- /**
1734
- * Returns the timer associated with the target.
1735
- * @param {HTMLElement | Element | string} target target element
1736
- * @param {string=} key a unique
1737
- * @returns {number?} the timer
1738
- */
1739
- get: (target, key) => {
1740
- const element = querySelector(target);
1741
-
1742
- if (!element) return null;
1743
- const keyTimers = TimeCache.get(element);
1744
-
1745
- if (key && key.length && keyTimers && keyTimers.get) {
1746
- return keyTimers.get(key) || null;
1747
- }
1748
- return keyTimers || null;
1749
- },
1750
-
1751
- /**
1752
- * Clears the element's timer.
1753
- * @param {HTMLElement | Element | string} target target element
1754
- * @param {string=} key a unique key
1755
- */
1756
- clear: (target, key) => {
1757
- const element = querySelector(target);
1758
-
1759
- if (!element) return;
1760
-
1761
- if (key && key.length) {
1762
- const keyTimers = TimeCache.get(element);
1763
-
1764
- if (keyTimers && keyTimers.get) {
1765
- clearTimeout(keyTimers.get(key));
1766
- keyTimers.delete(key);
1767
- if (keyTimers.size === 0) {
1768
- TimeCache.delete(element);
1769
- }
1770
- }
1771
- } else {
1772
- clearTimeout(TimeCache.get(element));
1773
- TimeCache.delete(element);
1774
- }
1775
- },
1776
- };
1777
-
1778
- /**
1779
- * Shortcut for `String.toUpperCase()`.
1780
- *
1781
- * @param {string} source input string
1782
- * @returns {string} uppercase output string
1783
- */
1784
- const toUpperCase = (source) => source.toUpperCase();
1785
-
1786
- /**
1787
- * Utility to wrap a callback in a try() catch(e)
1788
- *
1789
- * @param {Function} fn callback
1790
- * @param {string} origin callback context description
1791
- */
1792
- function tryWrapper(fn, origin) {
1793
- try { fn(); } catch (e) {
1794
- throw TypeError(`${origin} ${e}`);
1795
- }
1796
- }
1797
-
1798
- /**
1799
- * Returns the bounding client rect of a target `HTMLElement`.
1800
- *
1801
- * @see https://github.com/floating-ui/floating-ui
1802
- *
1803
- * @param {HTMLElement | Element} element event.target
1804
- * @param {boolean=} includeScale when *true*, the target scale is also computed
1805
- * @returns {SHORTER.BoundingClientRect} the bounding client rect object
1806
- */
1807
- function getBoundingClientRect(element, includeScale) {
1808
- const {
1809
- width, height, top, right, bottom, left,
1810
- } = element.getBoundingClientRect();
1811
- let scaleX = 1;
1812
- let scaleY = 1;
1813
-
1814
- if (includeScale && element instanceof HTMLElement) {
1815
- const { offsetWidth, offsetHeight } = element;
1816
- scaleX = offsetWidth > 0 ? Math.round(width) / offsetWidth || 1 : 1;
1817
- scaleY = offsetHeight > 0 ? Math.round(height) / offsetHeight || 1 : 1;
1818
- }
1819
-
1820
- return {
1821
- width: width / scaleX,
1822
- height: height / scaleY,
1823
- top: top / scaleY,
1824
- right: right / scaleX,
1825
- bottom: bottom / scaleY,
1826
- left: left / scaleX,
1827
- x: left / scaleX,
1828
- y: top / scaleY,
1829
- };
1830
- }
1831
-
1832
- /**
1833
- * Returns the `document.body` or the `<body>` element.
1834
- *
1835
- * @param {(Node | HTMLElement | Element | globalThis)=} node
1836
- * @returns {HTMLElement | HTMLBodyElement}
1837
- */
1838
- function getDocumentBody(node) {
1839
- return getDocument(node).body;
1840
- }
1841
-
1842
- /**
1843
- * Returns the `document.documentElement` or the `<html>` element.
1844
- *
1845
- * @param {(Node | HTMLElement | Element | globalThis)=} node
1846
- * @returns {HTMLElement | HTMLHtmlElement}
1847
- */
1848
- function getDocumentElement(node) {
1849
- return getDocument(node).documentElement;
1850
- }
1851
-
1852
- /**
1853
- * Returns the `document.head` or the `<head>` element.
1854
- *
1855
- * @param {(Node | HTMLElement | Element | globalThis)=} node
1856
- * @returns {HTMLElement | HTMLHeadElement}
1857
- */
1858
- function getDocumentHead(node) {
1859
- return getDocument(node).head;
1860
- }
1861
-
1862
- /**
1863
- * Returns an `{x,y}` object with the target
1864
- * `HTMLElement` / `Node` scroll position.
1865
- *
1866
- * @see https://github.com/floating-ui/floating-ui
1867
- *
1868
- * @param {HTMLElement | Element | Window} element target node / element
1869
- * @returns {{x: number, y: number}} the scroll tuple
1870
- */
1871
- function getNodeScroll(element) {
1872
- const isWin = 'scrollX' in element;
1873
- const x = isWin ? element.scrollX : element.scrollLeft;
1874
- const y = isWin ? element.scrollY : element.scrollTop;
1875
-
1876
- return { x, y };
1877
- }
1878
-
1879
- /**
1880
- * Returns the `Window` object of a target node.
1881
- * @see https://github.com/floating-ui/floating-ui
1882
- *
1883
- * @param {(Node | HTMLElement | Element | Window)=} node target node
1884
- * @returns {globalThis}
1885
- */
1886
- function getWindow(node) {
1887
- if (node == null) {
1888
- return window;
1889
- }
1890
-
1891
- if (!(node instanceof Window)) {
1892
- const { ownerDocument } = node;
1893
- return ownerDocument ? ownerDocument.defaultView || window : window;
1894
- }
1895
-
1896
- // @ts-ignore
1897
- return node;
1898
- }
1899
-
1900
- /**
1901
- * Check if target is a `ShadowRoot`.
1902
- *
1903
- * @param {any} element target
1904
- * @returns {boolean} the query result
1905
- */
1906
- const isShadowRoot = (element) => {
1907
- const OwnElement = getWindow(element).ShadowRoot;
1908
- return element instanceof OwnElement || element instanceof ShadowRoot;
1909
- };
1910
-
1911
- /**
1912
- * Returns the `parentNode` also going through `ShadowRoot`.
1913
- * @see https://github.com/floating-ui/floating-ui
1914
- *
1915
- * @param {Node | HTMLElement | Element} node the target node
1916
- * @returns {Node | HTMLElement | Element} the apropriate parent node
1917
- */
1918
- function getParentNode(node) {
1919
- if (node.nodeName === 'HTML') {
1920
- return node;
1921
- }
1922
-
1923
- // this is a quicker (but less type safe) way to save quite some bytes from the bundle
1924
- return (
1925
- // @ts-ignore
1926
- node.assignedSlot // step into the shadow DOM of the parent of a slotted node
1927
- || node.parentNode // @ts-ignore DOM Element detected
1928
- || (isShadowRoot(node) ? node.host : null) // ShadowRoot detected
1929
- || getDocumentElement(node) // fallback
1930
- );
1931
- }
1932
-
1933
- /**
1934
- * Checks if a target `HTMLElement` is affected by scale.
1935
- * @see https://github.com/floating-ui/floating-ui
1936
- *
1937
- * @param {HTMLElement} element target
1938
- * @returns {boolean} the query result
1939
- */
1940
- function isScaledElement(element) {
1941
- const { width, height } = getBoundingClientRect(element);
1942
- const { offsetWidth, offsetHeight } = element;
1943
- return Math.round(width) !== offsetWidth
1944
- || Math.round(height) !== offsetHeight;
1945
- }
1946
-
1947
- /**
1948
- * Returns the rect relative to an offset parent.
1949
- * @see https://github.com/floating-ui/floating-ui
1950
- *
1951
- * @param {HTMLElement | Element} element target
1952
- * @param {HTMLElement | Element | Window} offsetParent the container / offset parent
1953
- * @param {{x: number, y: number}} scroll
1954
- * @returns {SHORTER.OffsetRect}
1955
- */
1956
- function getRectRelativeToOffsetParent(element, offsetParent, scroll) {
1957
- const isParentAnElement = offsetParent instanceof HTMLElement;
1958
- const rect = getBoundingClientRect(element, isParentAnElement && isScaledElement(offsetParent));
1959
- const offsets = { x: 0, y: 0 };
1960
-
1961
- if (isParentAnElement) {
1962
- const offsetRect = getBoundingClientRect(offsetParent, true);
1963
- offsets.x = offsetRect.x + offsetParent.clientLeft;
1964
- offsets.y = offsetRect.y + offsetParent.clientTop;
1965
- }
1966
-
1967
- return {
1968
- x: rect.left + scroll.x - offsets.x,
1969
- y: rect.top + scroll.y - offsets.y,
1970
- width: rect.width,
1971
- height: rect.height,
1972
- };
1973
- }
1974
-
1975
- let elementUID = 0;
1976
- let elementMapUID = 0;
1977
- const elementIDMap = new Map();
1978
-
1979
- /**
1980
- * Returns a unique identifier for popover, tooltip, scrollspy.
1981
- *
1982
- * @param {HTMLElement | Element} element target element
1983
- * @param {string=} key predefined key
1984
- * @returns {number} an existing or new unique ID
1985
- */
1986
- function getUID(element, key) {
1987
- let result = key ? elementUID : elementMapUID;
1988
-
1989
- if (key) {
1990
- const elID = getUID(element);
1991
- const elMap = elementIDMap.get(elID) || new Map();
1992
- if (!elementIDMap.has(elID)) {
1993
- elementIDMap.set(elID, elMap);
1994
- }
1995
- if (!elMap.has(key)) {
1996
- elMap.set(key, result);
1997
- elementUID += 1;
1998
- } else result = elMap.get(key);
1999
- } else {
2000
- const elkey = element.id || element;
2001
-
2002
- if (!elementIDMap.has(elkey)) {
2003
- elementIDMap.set(elkey, result);
2004
- elementMapUID += 1;
2005
- } else result = elementIDMap.get(elkey);
2006
- }
2007
- return result;
2008
- }
2009
-
2010
- /**
2011
- * Shortcut for `Array.isArray()` static method.
2012
- *
2013
- * @param {any} arr array-like iterable object
2014
- * @returns {boolean} the query result
2015
- */
2016
- const isArray = (arr) => Array.isArray(arr);
2017
-
2018
- /**
2019
- * Checks if an object is a `Document`.
2020
- *
2021
- * @param {any} element the target object
2022
- * @returns {boolean} the query result
2023
- */
2024
- const isDocument = (element) => element instanceof Document;
2025
-
2026
- /**
2027
- * Checks if an object is a `CustomElement`.
2028
- *
2029
- * @param {any} element the target object
2030
- * @returns {boolean} the query result
2031
- */
2032
- const isCustomElement = (element) => element && !!element.shadowRoot;
2033
-
2034
- /**
2035
- * Checks if an object is an `Element`.
2036
- *
2037
- * @param {any} element the target object
2038
- * @returns {boolean} the query result
2039
- */
2040
- const isElement = (element) => element instanceof Element;
2041
-
2042
- /**
2043
- * Utility to determine if an `HTMLElement`
2044
- * is partially visible in viewport.
2045
- *
2046
- * @param {HTMLElement | Element} element target
2047
- * @return {boolean} the query result
2048
- */
2049
- const isElementInScrollRange = (element) => {
2050
- const { top, bottom } = getBoundingClientRect(element);
2051
- const { clientHeight } = getDocumentElement(element);
2052
- // checks bottom && top
2053
- return top <= clientHeight && bottom >= 0;
2054
- };
2055
-
2056
- /**
2057
- * Utility to determine if an `HTMLElement`
2058
- * is fully visible in the viewport.
2059
- *
2060
- * @param {HTMLElement | Element} element target
2061
- * @return {boolean} the query result
2062
- */
2063
- const isElementInViewport = (element) => {
2064
- const {
2065
- top, left, bottom, right,
2066
- } = getBoundingClientRect(element, true);
2067
- const { clientWidth, clientHeight } = getDocumentElement(element);
2068
- return (
2069
- top >= 0 && left >= 0
2070
- && bottom <= clientHeight
2071
- && right <= clientWidth
2072
- );
2073
- };
2074
-
2075
- /**
2076
- * Checks if an object is an `Array` in which all items are `Element`.
2077
- *
2078
- * @param {any} object the target object
2079
- * @returns {boolean} the query result
2080
- */
2081
- const isElementsArray = (object) => Array.isArray(object)
2082
- && object.every((el) => [HTMLElement, Element].some((x) => el instanceof x));
2083
-
2084
- /**
2085
- * Checks if an object is an `HTMLCollection`.
2086
- *
2087
- * @param {any} object the target object
2088
- * @returns {boolean} the query result
2089
- */
2090
- const isHTMLCollection = (object) => object instanceof HTMLCollection;
2091
-
2092
- /**
2093
- * Checks if an element is an `HTMLElement`.
2094
- *
2095
- * @param {any} element the target object
2096
- * @returns {boolean} the query result
2097
- */
2098
- const isHTMLElement = (element) => element instanceof HTMLElement;
2099
-
2100
- /**
2101
- * Check if a target element is an `<img>`.
2102
- * @param {any} element the target element
2103
- * @returns {boolean} the query result
2104
- */
2105
- const isHTMLImageElement = (element) => element instanceof HTMLImageElement;
2106
-
2107
- /**
2108
- * Checks if an element is an `<svg>` (or any type of SVG element),
2109
- * `<img>` or `<video>`.
2110
- *
2111
- * *Tooltip* / *Popover* works different with media elements.
2112
- * @param {any} element the target element
2113
- * @returns {boolean} the query result
2114
- */
2115
- const isMedia = (element) => element
2116
- && [SVGElement, HTMLImageElement, HTMLVideoElement]
2117
- .some((mediaType) => element instanceof mediaType);
2118
-
2119
- /**
2120
- * Checks if an object is a `Node`.
2121
- *
2122
- * @param {any} node the target object
2123
- * @returns {boolean} the query result
2124
- */
2125
- const isNode = (node) => node instanceof Node;
2126
-
2127
- /**
2128
- * Checks if an object is a `NodeList`.
2129
- *
2130
- * @param {any} object the target object
2131
- * @returns {boolean} the query result
2132
- */
2133
- const isNodeList = (object) => object instanceof NodeList;
2134
-
2135
- /**
2136
- * Checks if a page is Right To Left.
2137
- * @param {(HTMLElement | Element)=} node the target
2138
- * @returns {boolean} the query result
2139
- */
2140
- const isRTL = (node) => getDocumentElement(node).dir === 'rtl';
2141
-
2142
- /**
2143
- * Shortcut for `typeof SOMETHING === string` static method.
2144
- *
2145
- * @param {any} str array-like iterable object
2146
- * @returns {boolean} the query result
2147
- */
2148
- const isString = (str) => typeof str === 'string';
2149
-
2150
- /**
2151
- * Check if an element is an `<svg>` or any other SVG element.
2152
- * @param {any} element the target element
2153
- * @returns {boolean} the query result
2154
- */
2155
- const isSVGElement = (element) => element instanceof SVGElement;
2156
-
2157
- /**
2158
- * Check if a target element is a `<table>`, `<td>` or `<th>`.
2159
- * @param {any} element the target element
2160
- * @returns {boolean} the query result
2161
- */
2162
- const isTableElement = (element) => ['TABLE', 'TD', 'TH'].includes(element.tagName);
2163
-
2164
- /**
2165
- * Check if a target node is `window`.
2166
- *
2167
- * @param {any} node the target node
2168
- * @returns {boolean} the query result
2169
- */
2170
- function isWindow(node) {
2171
- return node instanceof Window;
2172
- }
2173
-
2174
- /**
2175
- * Shortcut for `HTMLElement.closest` method which also works
2176
- * with children of `ShadowRoot`. The order of the parameters
2177
- * is intentional since they're both required.
2178
- *
2179
- * @see https://stackoverflow.com/q/54520554/803358
2180
- *
2181
- * @param {HTMLElement | Element} element Element to look into
2182
- * @param {string} selector the selector name
2183
- * @return {(HTMLElement | Element)?} the query result
2184
- */
2185
- function closest(element, selector) {
2186
- return element ? (element.closest(selector)
2187
- // @ts-ignore -- break out of `ShadowRoot`
2188
- || closest(element.getRootNode().host, selector)) : null;
2189
- }
2190
-
2191
- /**
2192
- * Shortcut for `HTMLElement.getElementsByTagName` method. Some `Node` elements
2193
- * like `ShadowRoot` do not support `getElementsByTagName`.
2194
- *
2195
- * @param {string} selector the tag name
2196
- * @param {(HTMLElement | Element | Document)=} parent optional Element to look into
2197
- * @return {HTMLCollectionOf<HTMLElement | Element>} the 'HTMLCollection'
2198
- */
2199
- function getElementsByTagName(selector, parent) {
2200
- const lookUp = typeof parent !== 'object' ? getDocument() : parent;
2201
- return lookUp.getElementsByTagName(selector);
2202
- }
2203
-
2204
- /**
2205
- * An `HTMLCollection` with all document elements,
2206
- * which is the equivalent of `document.all`.
2207
- */
2208
- const documentAll = getElementsByTagName('*');
2209
-
2210
- /**
2211
- * Returns an `Array` of `Node` elements that are registered as
2212
- * `CustomElement`.
2213
- * @see https://stackoverflow.com/questions/27334365/how-to-get-list-of-registered-custom-elements
2214
- *
2215
- * @param {(HTMLElement | Element | Node | Document)=} parent parent to look into
2216
- * @returns {Array<HTMLElement | Element>} the query result
2217
- */
2218
- function getCustomElements(parent) {
2219
- const collection = parent && typeof parent === 'object'
2220
- ? getElementsByTagName('*', parent) : documentAll;
2221
- return [...collection].filter(isCustomElement);
2222
- }
2223
-
2224
- /**
2225
- * Returns an `Element` that matches the id in the document.
2226
- *
2227
- * @param {string} id
2228
- * @returns {(HTMLElement | Element)?}
2229
- */
2230
- function getElementById(id) {
2231
- return getDocument().getElementById(id);
2232
- }
2233
-
2234
- /**
2235
- * A shortcut for `(document|Element).querySelectorAll`.
2236
- *
2237
- * @param {string} selector the input selector
2238
- * @param {(HTMLElement | Element | Document | Node)=} parent optional node to look into
2239
- * @return {NodeListOf<HTMLElement | Element>} the query result
2240
- */
2241
- function querySelectorAll(selector, parent) {
2242
- const lookUp = typeof parent !== 'object' ? getDocument() : parent;
2243
- return lookUp.querySelectorAll(selector);
2244
- }
2245
-
2246
- /**
2247
- * Shortcut for `HTMLElement.getElementsByClassName` method. Some `Node` elements
2248
- * like `ShadowRoot` do not support `getElementsByClassName`.
2249
- *
2250
- * @param {string} selector the class name
2251
- * @param {(HTMLElement | Element | Document)=} parent optional Element to look into
2252
- * @return {HTMLCollectionOf<HTMLElement | Element>} the 'HTMLCollection'
2253
- */
2254
- function getElementsByClassName(selector, parent) {
2255
- const lookUp = typeof parent !== 'object' ? getDocument() : parent;
2256
- return lookUp.getElementsByClassName(selector);
2257
- }
2258
-
2259
- /**
2260
- * Check if element matches a CSS selector.
2261
- *
2262
- * @param {HTMLElement | Element} target
2263
- * @param {string} selector
2264
- * @returns {boolean}
2265
- */
2266
- function matches$1(target, selector) {
2267
- return target.matches(selector);
2268
- }
2269
-
2270
- // @ts-nocheck
2271
- const ElementProto = Element.prototype;
2272
- const matchesFn = ElementProto.matches
2273
- || ElementProto.matchesSelector
2274
- || ElementProto.webkitMatchesSelector
2275
- || ElementProto.mozMatchesSelector
2276
- || ElementProto.msMatchesSelector
2277
- || ElementProto.oMatchesSelector
2278
- || function matchesNotSupported() {
2279
- return false;
2280
- };
2281
-
2282
- /**
2283
- * Check if element matches a CSS selector,
2284
- * supporting a range of legacy browsers.
2285
- *
2286
- * @param {HTMLElement | Element} target
2287
- * @param {string} selector
2288
- * @returns {boolean}
2289
- */
2290
- function matches(target, selector) {
2291
- return matchesFn.call(target, selector);
2292
- }
2293
-
2294
- var version = "1.0.1";
2295
-
2296
- // @ts-ignore
2297
-
2298
- /**
2299
- * A global namespace for library version.
2300
- * @type {string}
2301
- */
2302
- const Version = version;
2303
-
2304
- // strings
2305
-
2306
- const SHORTER = {
2307
- ariaChecked,
2308
- ariaDescription,
2309
- ariaDescribedBy,
2310
- ariaExpanded,
2311
- ariaHidden,
2312
- ariaHasPopup,
2313
- ariaLabel,
2314
- ariaLabelledBy,
2315
- ariaModal,
2316
- ariaPressed,
2317
- ariaSelected,
2318
- ariaValueMin,
2319
- ariaValueMax,
2320
- ariaValueNow,
2321
- ariaValueText,
2322
- nativeEvents,
2323
- abortEvent,
2324
- blurEvent,
2325
- moveEvent,
2326
- changeEvent,
2327
- errorEvent,
2328
- resetEvent,
2329
- resizeEvent,
2330
- scrollEvent,
2331
- submitEvent,
2332
- loadEvent,
2333
- loadstartEvent,
2334
- unloadEvent,
2335
- readystatechangeEvent,
2336
- beforeunloadEvent,
2337
- orientationchangeEvent,
2338
- contextmenuEvent,
2339
- DOMContentLoadedEvent,
2340
- DOMMouseScrollEvent,
2341
- selectEvent,
2342
- selectendEvent,
2343
- selectstartEvent,
2344
- mouseClickEvents,
2345
- mouseclickEvent,
2346
- mousedblclickEvent,
2347
- mousedownEvent,
2348
- mouseupEvent,
2349
- mousehoverEvent,
2350
- mouseHoverEvents,
2351
- mouseenterEvent,
2352
- mouseleaveEvent,
2353
- mouseinEvent,
2354
- mouseoutEvent,
2355
- mouseoverEvent,
2356
- mousemoveEvent,
2357
- mousewheelEvent,
2358
- mouseSwipeEvents,
2359
- touchEvents,
2360
- touchstartEvent,
2361
- touchmoveEvent,
2362
- touchcancelEvent,
2363
- touchendEvent,
2364
- pointercancelEvent,
2365
- pointerdownEvent,
2366
- pointerleaveEvent,
2367
- pointermoveEvent,
2368
- pointerupEvent,
2369
- focusEvents,
2370
- focusEvent,
2371
- focusinEvent,
2372
- focusoutEvent,
2373
- gesturechangeEvent,
2374
- gestureendEvent,
2375
- gesturestartEvent,
2376
- bezierEasings,
2377
- animationDuration: animationDuration$1,
2378
- animationDurationLegacy: animationDuration,
2379
- animationDelay: animationDelay$1,
2380
- animationDelayLegacy: animationDelay,
2381
- animationName: animationName$1,
2382
- animationNameLegacy: animationName,
2383
- animationEndEvent: animationEndEvent$1,
2384
- animationEndEventLegacy: animationEndEvent,
2385
- transitionDuration: transitionDuration$1,
2386
- transitionDurationLegacy: transitionDuration,
2387
- transitionDelay: transitionDelay$1,
2388
- transitionDelayLegacy: transitionDelay,
2389
- transitionEndEvent: transitionEndEvent$1,
2390
- transitionEndEventLegacy: transitionEndEvent,
2391
- transitionProperty: transitionProperty$1,
2392
- transitionPropertyLegacy: transitionProperty,
2393
- isMobile,
2394
- isApple,
2395
- isFirefox,
2396
- support3DTransform,
2397
- supportPassive,
2398
- supportTransform,
2399
- supportTouch,
2400
- supportAnimation,
2401
- supportTransition,
2402
- addEventListener,
2403
- removeEventListener,
2404
- keyboardEventKeys,
2405
- keydownEvent,
2406
- keypressEvent,
2407
- keyupEvent,
2408
- keyAlt,
2409
- keyArrowDown,
2410
- keyArrowLeft,
2411
- keyArrowRight,
2412
- keyArrowUp,
2413
- keyBackspace,
2414
- keyCapsLock,
2415
- keyControl,
2416
- keyDelete,
2417
- keyEnter,
2418
- keyEscape,
2419
- keyInsert,
2420
- keyMeta,
2421
- keyPause,
2422
- keyScrollLock,
2423
- keyShift,
2424
- keySpace,
2425
- keyTab,
2426
- offsetHeight,
2427
- offsetWidth,
2428
- scrollHeight,
2429
- scrollWidth,
2430
- userAgentData,
2431
- userAgent,
2432
- addClass,
2433
- removeClass,
2434
- hasClass,
2435
- on,
2436
- off,
2437
- one,
2438
- dispatchEvent,
2439
- distinct,
2440
- Data,
2441
- getInstance,
2442
- createElement,
2443
- createElementNS,
2444
- toUpperCase,
2445
- toLowerCase,
2446
- Timer,
2447
- emulateAnimationEnd: emulateAnimationEnd$1,
2448
- emulateAnimationEndLegacy: emulateAnimationEnd,
2449
- emulateTransitionEnd: emulateTransitionEnd$1,
2450
- emulateTransitionEndLegacy: emulateTransitionEnd,
2451
- isElementInScrollRange,
2452
- isElementInViewport,
2453
- passiveHandler: passiveHandler$1,
2454
- passiveHandlerLegacy: passiveHandler,
2455
- getElementAnimationDuration: getElementAnimationDuration$1,
2456
- getElementAnimationDurationLegacy: getElementAnimationDuration,
2457
- getElementAnimationDelay: getElementAnimationDelay$1,
2458
- getElementAnimationDelayLegacy: getElementAnimationDelay,
2459
- getElementTransitionDuration: getElementTransitionDuration$1,
2460
- getElementTransitionDurationLegacy: getElementTransitionDuration,
2461
- getElementTransitionDelay: getElementTransitionDelay$1,
2462
- getElementTransitionDelayLegacy: getElementTransitionDelay,
2463
- getNodeScroll,
2464
- getParentNode,
2465
- getRectRelativeToOffsetParent,
2466
- getWindow,
2467
- isArray,
2468
- isString,
2469
- isCustomElement,
2470
- isElement,
2471
- isNode,
2472
- isHTMLElement,
2473
- isHTMLImageElement,
2474
- isSVGElement,
2475
- isNodeList,
2476
- isHTMLCollection,
2477
- isScaledElement,
2478
- isTableElement,
2479
- isShadowRoot,
2480
- isDocument,
2481
- isElementsArray,
2482
- isWindow,
2483
- isMedia,
2484
- isRTL,
2485
- closest,
2486
- documentAll,
2487
- querySelector,
2488
- getCustomElements,
2489
- getElementById,
2490
- querySelectorAll,
2491
- getElementsByClassName,
2492
- getElementsByTagName,
2493
- matches: matches$1,
2494
- matchesLegacy: matches,
2495
- normalizeValue,
2496
- normalizeOptions,
2497
- tryWrapper,
2498
- reflow,
2499
- noop,
2500
- focus,
2501
- getUID,
2502
- ArrayFrom,
2503
- Float32ArrayFrom,
2504
- Float64ArrayFrom,
2505
- ObjectAssign,
2506
- ObjectKeys,
2507
- ObjectValues,
2508
- OriginalEvent,
2509
- getBoundingClientRect,
2510
- getDocument,
2511
- getDocumentBody,
2512
- getDocumentElement,
2513
- getDocumentHead,
2514
- getElementStyle,
2515
- setElementStyle,
2516
- hasAttribute,
2517
- hasAttributeNS,
2518
- getAttribute,
2519
- getAttributeNS,
2520
- setAttribute,
2521
- setAttributeNS,
2522
- removeAttribute,
2523
- removeAttributeNS,
2524
- Version,
2525
- };
2526
-
2527
- export { SHORTER as default };