@thednp/shorty 1.0.3 → 2.0.0-alpha3

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