@thednp/shorty 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +340 -0
- package/dist/shorty.esm.js +2540 -0
- package/dist/shorty.esm.min.js +2 -0
- package/dist/shorty.js +2563 -0
- package/dist/shorty.min.js +2 -0
- package/package.json +59 -0
- package/src/attr/getAttribute.js +9 -0
- package/src/attr/getAttributeNS.js +10 -0
- package/src/attr/hasAttribute.js +9 -0
- package/src/attr/hasAttributeNS.js +10 -0
- package/src/attr/removeAttribute.js +9 -0
- package/src/attr/removeAttributeNS.js +10 -0
- package/src/attr/setAttribute.js +10 -0
- package/src/attr/setAttributeNS.js +11 -0
- package/src/blocks/documentBody.js +5 -0
- package/src/blocks/documentElement.js +5 -0
- package/src/blocks/documentHead.js +5 -0
- package/src/boolean/isApple.js +13 -0
- package/src/boolean/isFirefox.js +9 -0
- package/src/boolean/isMobile.js +20 -0
- package/src/boolean/support3DTransform.js +8 -0
- package/src/boolean/supportAnimation.js +8 -0
- package/src/boolean/supportPassive.js +28 -0
- package/src/boolean/supportTouch.js +6 -0
- package/src/boolean/supportTransform.js +8 -0
- package/src/boolean/supportTransition.js +8 -0
- package/src/class/addClass.js +10 -0
- package/src/class/hasClass.js +10 -0
- package/src/class/removeClass.js +10 -0
- package/src/event/off.js +13 -0
- package/src/event/on.js +13 -0
- package/src/event/one.js +26 -0
- package/src/get/getBoundingClientRect.js +33 -0
- package/src/get/getDocument.js +11 -0
- package/src/get/getDocumentBody.js +10 -0
- package/src/get/getDocumentElement.js +11 -0
- package/src/get/getDocumentHead.js +10 -0
- package/src/get/getElementAnimationDelay.js +21 -0
- package/src/get/getElementAnimationDelayLegacy.js +21 -0
- package/src/get/getElementAnimationDuration.js +20 -0
- package/src/get/getElementAnimationDurationLegacy.js +21 -0
- package/src/get/getElementStyle.js +18 -0
- package/src/get/getElementTransitionDelay.js +21 -0
- package/src/get/getElementTransitionDelayLegacy.js +21 -0
- package/src/get/getElementTransitionDuration.js +20 -0
- package/src/get/getElementTransitionDurationLegacy.js +21 -0
- package/src/get/getNodeScroll.js +16 -0
- package/src/get/getParentNode.js +24 -0
- package/src/get/getRectRelativeToOffsetParent.js +30 -0
- package/src/get/getUID.js +34 -0
- package/src/get/getWindow.js +20 -0
- package/src/index.js +475 -0
- package/src/is/isArray.js +9 -0
- package/src/is/isCustomElement.js +8 -0
- package/src/is/isDocument.js +9 -0
- package/src/is/isElement.js +9 -0
- package/src/is/isElementInScrollRange.js +18 -0
- package/src/is/isElementInViewport.js +22 -0
- package/src/is/isElementsArray.js +10 -0
- package/src/is/isFunction.js +9 -0
- package/src/is/isHTMLCollection.js +8 -0
- package/src/is/isHTMLElement.js +8 -0
- package/src/is/isHTMLImageElement.js +8 -0
- package/src/is/isMedia.js +12 -0
- package/src/is/isNode.js +8 -0
- package/src/is/isNodeList.js +8 -0
- package/src/is/isRTL.js +9 -0
- package/src/is/isSVGElement.js +8 -0
- package/src/is/isScaledElement.js +15 -0
- package/src/is/isShadowRoot.js +12 -0
- package/src/is/isString.js +8 -0
- package/src/is/isTableElement.js +7 -0
- package/src/is/isWindow.js +9 -0
- package/src/misc/ArrayFrom.js +8 -0
- package/src/misc/Float32ArrayFrom.js +7 -0
- package/src/misc/Float64ArrayFrom.js +7 -0
- package/src/misc/ObjectAssign.js +7 -0
- package/src/misc/ObjectKeys.js +7 -0
- package/src/misc/ObjectValues.js +7 -0
- package/src/misc/OriginalEvent.js +18 -0
- package/src/misc/createElement.js +25 -0
- package/src/misc/createElementNS.js +26 -0
- package/src/misc/data.js +78 -0
- package/src/misc/dispatchEvent.js +8 -0
- package/src/misc/distinct.js +10 -0
- package/src/misc/emulateAnimationEnd.js +37 -0
- package/src/misc/emulateAnimationEndLegacy.js +38 -0
- package/src/misc/emulateTransitionEnd.js +37 -0
- package/src/misc/emulateTransitionEndLegacy.js +38 -0
- package/src/misc/focus.js +8 -0
- package/src/misc/noop.js +3 -0
- package/src/misc/normalizeOptions.js +49 -0
- package/src/misc/normalizeValue.js +32 -0
- package/src/misc/passiveHandler.js +7 -0
- package/src/misc/passiveHandlerLegacy.js +9 -0
- package/src/misc/reflow.js +9 -0
- package/src/misc/setElementStyle.js +10 -0
- package/src/misc/timer.js +78 -0
- package/src/misc/toLowerCase.js +8 -0
- package/src/misc/toUpperCase.js +8 -0
- package/src/misc/tryWrapper.js +11 -0
- package/src/misc/version.js +9 -0
- package/src/selectors/closest.js +16 -0
- package/src/selectors/documentAll.js +8 -0
- package/src/selectors/elementNodes.js +5 -0
- package/src/selectors/getCustomElements.js +18 -0
- package/src/selectors/getElementById.js +11 -0
- package/src/selectors/getElementsByClassName.js +15 -0
- package/src/selectors/getElementsByTagName.js +15 -0
- package/src/selectors/matches.js +10 -0
- package/src/selectors/matchesLegacy.js +23 -0
- package/src/selectors/parentNodes.js +5 -0
- package/src/selectors/querySelector.js +15 -0
- package/src/selectors/querySelectorAll.js +14 -0
- package/src/strings/DOMContentLoadedEvent.js +6 -0
- package/src/strings/DOMMouseScrollEvent.js +6 -0
- package/src/strings/abortEvent.js +6 -0
- package/src/strings/addEventListener.js +6 -0
- package/src/strings/animationDelay.js +6 -0
- package/src/strings/animationDelayLegacy.js +8 -0
- package/src/strings/animationDuration.js +6 -0
- package/src/strings/animationDurationLegacy.js +8 -0
- package/src/strings/animationEndEvent.js +6 -0
- package/src/strings/animationEndEventLegacy.js +8 -0
- package/src/strings/animationName.js +6 -0
- package/src/strings/animationNameLegacy.js +8 -0
- package/src/strings/ariaChecked.js +6 -0
- package/src/strings/ariaDescribedBy.js +6 -0
- package/src/strings/ariaDescription.js +6 -0
- package/src/strings/ariaExpanded.js +6 -0
- package/src/strings/ariaHasPopup.js +6 -0
- package/src/strings/ariaHidden.js +6 -0
- package/src/strings/ariaLabel.js +6 -0
- package/src/strings/ariaLabelledBy.js +6 -0
- package/src/strings/ariaModal.js +6 -0
- package/src/strings/ariaPressed.js +6 -0
- package/src/strings/ariaSelected.js +6 -0
- package/src/strings/ariaValueMax.js +6 -0
- package/src/strings/ariaValueMin.js +6 -0
- package/src/strings/ariaValueNow.js +6 -0
- package/src/strings/ariaValueText.js +6 -0
- package/src/strings/beforeunloadEvent.js +6 -0
- package/src/strings/bezierEasings.js +33 -0
- package/src/strings/blurEvent.js +6 -0
- package/src/strings/changeEvent.js +6 -0
- package/src/strings/contextmenuEvent.js +6 -0
- package/src/strings/errorEvent.js +6 -0
- package/src/strings/focusEvent.js +6 -0
- package/src/strings/focusEvents.js +6 -0
- package/src/strings/focusinEvent.js +6 -0
- package/src/strings/focusoutEvent.js +6 -0
- package/src/strings/gesturechangeEvent.js +6 -0
- package/src/strings/gestureendEvent.js +6 -0
- package/src/strings/gesturestartEvent.js +6 -0
- package/src/strings/keyAlt.js +7 -0
- package/src/strings/keyArrowDown.js +7 -0
- package/src/strings/keyArrowLeft.js +7 -0
- package/src/strings/keyArrowRight.js +7 -0
- package/src/strings/keyArrowUp.js +7 -0
- package/src/strings/keyBackspace.js +7 -0
- package/src/strings/keyCapsLock.js +7 -0
- package/src/strings/keyControl.js +7 -0
- package/src/strings/keyDelete.js +7 -0
- package/src/strings/keyEnter.js +7 -0
- package/src/strings/keyEscape.js +7 -0
- package/src/strings/keyInsert.js +7 -0
- package/src/strings/keyMeta.js +7 -0
- package/src/strings/keyPause.js +7 -0
- package/src/strings/keyScrollLock.js +7 -0
- package/src/strings/keyShift.js +7 -0
- package/src/strings/keySpace.js +7 -0
- package/src/strings/keyTab.js +7 -0
- package/src/strings/keyboardEventKeys.js +27 -0
- package/src/strings/keydownEvent.js +6 -0
- package/src/strings/keypressEvent.js +6 -0
- package/src/strings/keyupEvent.js +6 -0
- package/src/strings/loadEvent.js +6 -0
- package/src/strings/loadstartEvent.js +6 -0
- package/src/strings/mouseClickEvents.js +6 -0
- package/src/strings/mouseHoverEvents.js +6 -0
- package/src/strings/mouseSwipeEvents.js +8 -0
- package/src/strings/mouseclickEvent.js +6 -0
- package/src/strings/mousedblclickEvent.js +6 -0
- package/src/strings/mousedownEvent.js +6 -0
- package/src/strings/mouseenterEvent.js +6 -0
- package/src/strings/mousehoverEvent.js +6 -0
- package/src/strings/mouseinEvent.js +6 -0
- package/src/strings/mouseleaveEvent.js +6 -0
- package/src/strings/mousemoveEvent.js +6 -0
- package/src/strings/mouseoutEvent.js +6 -0
- package/src/strings/mouseoverEvent.js +6 -0
- package/src/strings/mouseupEvent.js +6 -0
- package/src/strings/mousewheelEvent.js +6 -0
- package/src/strings/moveEvent.js +6 -0
- package/src/strings/nativeEvents.js +108 -0
- package/src/strings/offsetHeight.js +6 -0
- package/src/strings/offsetWidth.js +6 -0
- package/src/strings/orientationchangeEvent.js +6 -0
- package/src/strings/pointercancelEvent.js +6 -0
- package/src/strings/pointerdownEvent.js +6 -0
- package/src/strings/pointerleaveEvent.js +6 -0
- package/src/strings/pointermoveEvent.js +6 -0
- package/src/strings/pointerupEvent.js +6 -0
- package/src/strings/readystatechangeEvent.js +6 -0
- package/src/strings/removeEventListener.js +6 -0
- package/src/strings/resetEvent.js +6 -0
- package/src/strings/resizeEvent.js +6 -0
- package/src/strings/scrollEvent.js +6 -0
- package/src/strings/scrollHeight.js +6 -0
- package/src/strings/scrollWidth.js +6 -0
- package/src/strings/selectEvent.js +6 -0
- package/src/strings/selectendEvent.js +6 -0
- package/src/strings/selectstartEvent.js +6 -0
- package/src/strings/submitEvent.js +6 -0
- package/src/strings/touchEvents.js +8 -0
- package/src/strings/touchcancelEvent.js +6 -0
- package/src/strings/touchendEvent.js +6 -0
- package/src/strings/touchmoveEvent.js +6 -0
- package/src/strings/touchstartEvent.js +6 -0
- package/src/strings/transitionDelay.js +6 -0
- package/src/strings/transitionDelayLegacy.js +8 -0
- package/src/strings/transitionDuration.js +6 -0
- package/src/strings/transitionDurationLegacy.js +8 -0
- package/src/strings/transitionEndEvent.js +6 -0
- package/src/strings/transitionEndEventLegacy.js +8 -0
- package/src/strings/transitionProperty.js +7 -0
- package/src/strings/transitionPropertyLegacy.js +12 -0
- package/src/strings/unloadEvent.js +6 -0
- package/src/strings/userAgent.js +7 -0
- package/src/strings/userAgentData.js +8 -0
- package/types/index.d.ts +252 -0
- package/types/module/shorty.ts +249 -0
- package/types/shorty.d.ts +2317 -0
package/src/index.js
ADDED
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
// strings
|
|
2
|
+
import ariaChecked from './strings/ariaChecked';
|
|
3
|
+
import ariaDescription from './strings/ariaDescription';
|
|
4
|
+
import ariaDescribedBy from './strings/ariaDescribedBy';
|
|
5
|
+
import ariaExpanded from './strings/ariaExpanded';
|
|
6
|
+
import ariaHasPopup from './strings/ariaHasPopup';
|
|
7
|
+
import ariaHidden from './strings/ariaHidden';
|
|
8
|
+
import ariaLabel from './strings/ariaLabel';
|
|
9
|
+
import ariaLabelledBy from './strings/ariaLabelledBy';
|
|
10
|
+
import ariaModal from './strings/ariaModal';
|
|
11
|
+
import ariaPressed from './strings/ariaPressed';
|
|
12
|
+
import ariaSelected from './strings/ariaSelected';
|
|
13
|
+
import ariaValueMin from './strings/ariaValueMin';
|
|
14
|
+
import ariaValueMax from './strings/ariaValueMax';
|
|
15
|
+
import ariaValueNow from './strings/ariaValueNow';
|
|
16
|
+
import ariaValueText from './strings/ariaValueText';
|
|
17
|
+
|
|
18
|
+
import nativeEvents from './strings/nativeEvents';
|
|
19
|
+
import abortEvent from './strings/abortEvent';
|
|
20
|
+
import blurEvent from './strings/blurEvent';
|
|
21
|
+
import moveEvent from './strings/moveEvent';
|
|
22
|
+
import changeEvent from './strings/changeEvent';
|
|
23
|
+
import errorEvent from './strings/errorEvent';
|
|
24
|
+
import resetEvent from './strings/resetEvent';
|
|
25
|
+
import resizeEvent from './strings/resizeEvent';
|
|
26
|
+
import scrollEvent from './strings/scrollEvent';
|
|
27
|
+
import submitEvent from './strings/submitEvent';
|
|
28
|
+
import loadEvent from './strings/loadEvent';
|
|
29
|
+
import loadstartEvent from './strings/loadstartEvent';
|
|
30
|
+
import unloadEvent from './strings/unloadEvent';
|
|
31
|
+
import readystatechangeEvent from './strings/readystatechangeEvent';
|
|
32
|
+
import beforeunloadEvent from './strings/beforeunloadEvent';
|
|
33
|
+
import orientationchangeEvent from './strings/orientationchangeEvent';
|
|
34
|
+
import contextmenuEvent from './strings/contextmenuEvent';
|
|
35
|
+
import DOMContentLoadedEvent from './strings/DOMContentLoadedEvent';
|
|
36
|
+
import DOMMouseScrollEvent from './strings/DOMMouseScrollEvent';
|
|
37
|
+
|
|
38
|
+
import selectEvent from './strings/selectEvent';
|
|
39
|
+
import selectendEvent from './strings/selectendEvent';
|
|
40
|
+
import selectstartEvent from './strings/selectstartEvent';
|
|
41
|
+
|
|
42
|
+
import mouseSwipeEvents from './strings/mouseSwipeEvents';
|
|
43
|
+
import mouseClickEvents from './strings/mouseClickEvents';
|
|
44
|
+
import mouseclickEvent from './strings/mouseclickEvent';
|
|
45
|
+
import mousedblclickEvent from './strings/mousedblclickEvent';
|
|
46
|
+
import mousedownEvent from './strings/mousedownEvent';
|
|
47
|
+
import mouseupEvent from './strings/mouseupEvent';
|
|
48
|
+
import mousehoverEvent from './strings/mousehoverEvent';
|
|
49
|
+
import mouseHoverEvents from './strings/mouseHoverEvents';
|
|
50
|
+
import mouseenterEvent from './strings/mouseenterEvent';
|
|
51
|
+
import mouseleaveEvent from './strings/mouseleaveEvent';
|
|
52
|
+
import mouseinEvent from './strings/mouseinEvent';
|
|
53
|
+
import mouseoutEvent from './strings/mouseoutEvent';
|
|
54
|
+
import mouseoverEvent from './strings/mouseoverEvent';
|
|
55
|
+
import mousemoveEvent from './strings/mousemoveEvent';
|
|
56
|
+
import mousewheelEvent from './strings/mousewheelEvent';
|
|
57
|
+
|
|
58
|
+
import touchEvents from './strings/touchEvents';
|
|
59
|
+
import touchstartEvent from './strings/touchstartEvent';
|
|
60
|
+
import touchmoveEvent from './strings/touchmoveEvent';
|
|
61
|
+
import touchcancelEvent from './strings/touchcancelEvent';
|
|
62
|
+
import touchendEvent from './strings/touchendEvent';
|
|
63
|
+
|
|
64
|
+
import pointercancelEvent from './strings/pointercancelEvent';
|
|
65
|
+
import pointerdownEvent from './strings/pointerdownEvent';
|
|
66
|
+
import pointerleaveEvent from './strings/pointerleaveEvent';
|
|
67
|
+
import pointermoveEvent from './strings/pointermoveEvent';
|
|
68
|
+
import pointerupEvent from './strings/pointerupEvent';
|
|
69
|
+
|
|
70
|
+
import focusEvents from './strings/focusEvents';
|
|
71
|
+
import focusEvent from './strings/focusEvent';
|
|
72
|
+
import focusinEvent from './strings/focusinEvent';
|
|
73
|
+
import focusoutEvent from './strings/focusoutEvent';
|
|
74
|
+
|
|
75
|
+
import gesturechangeEvent from './strings/gesturechangeEvent';
|
|
76
|
+
import gestureendEvent from './strings/gestureendEvent';
|
|
77
|
+
import gesturestartEvent from './strings/gesturestartEvent';
|
|
78
|
+
|
|
79
|
+
import keyboardEventKeys from './strings/keyboardEventKeys';
|
|
80
|
+
import keydownEvent from './strings/keydownEvent';
|
|
81
|
+
import keyupEvent from './strings/keyupEvent';
|
|
82
|
+
import keypressEvent from './strings/keypressEvent';
|
|
83
|
+
import keyAlt from './strings/keyAlt';
|
|
84
|
+
import keyArrowDown from './strings/keyArrowDown';
|
|
85
|
+
import keyArrowUp from './strings/keyArrowUp';
|
|
86
|
+
import keyArrowLeft from './strings/keyArrowLeft';
|
|
87
|
+
import keyArrowRight from './strings/keyArrowRight';
|
|
88
|
+
import keyBackspace from './strings/keyBackspace';
|
|
89
|
+
import keyCapsLock from './strings/keyCapsLock';
|
|
90
|
+
import keyControl from './strings/keyControl';
|
|
91
|
+
import keyDelete from './strings/keyDelete';
|
|
92
|
+
import keyEnter from './strings/keyEnter';
|
|
93
|
+
import keyEscape from './strings/keyEscape';
|
|
94
|
+
import keyInsert from './strings/keyInsert';
|
|
95
|
+
import keyMeta from './strings/keyMeta';
|
|
96
|
+
import keyPause from './strings/keyPause';
|
|
97
|
+
import keyScrollLock from './strings/keyScrollLock';
|
|
98
|
+
import keyShift from './strings/keyShift';
|
|
99
|
+
import keySpace from './strings/keySpace';
|
|
100
|
+
import keyTab from './strings/keyTab';
|
|
101
|
+
|
|
102
|
+
import animationDuration from './strings/animationDuration';
|
|
103
|
+
import animationDurationLegacy from './strings/animationDurationLegacy';
|
|
104
|
+
import animationDelay from './strings/animationDelay';
|
|
105
|
+
import animationDelayLegacy from './strings/animationDelayLegacy';
|
|
106
|
+
import animationName from './strings/animationName';
|
|
107
|
+
import animationNameLegacy from './strings/animationNameLegacy';
|
|
108
|
+
import animationEndEvent from './strings/animationEndEvent';
|
|
109
|
+
import animationEndEventLegacy from './strings/animationEndEventLegacy';
|
|
110
|
+
import transitionDuration from './strings/transitionDuration';
|
|
111
|
+
import transitionDurationLegacy from './strings/transitionDurationLegacy';
|
|
112
|
+
import transitionDelay from './strings/transitionDelay';
|
|
113
|
+
import transitionDelayLegacy from './strings/transitionDelayLegacy';
|
|
114
|
+
import transitionEndEvent from './strings/transitionEndEvent';
|
|
115
|
+
import transitionEndEventLegacy from './strings/transitionEndEventLegacy';
|
|
116
|
+
import transitionProperty from './strings/transitionProperty';
|
|
117
|
+
import transitionPropertyLegacy from './strings/transitionPropertyLegacy';
|
|
118
|
+
|
|
119
|
+
import addEventListener from './strings/addEventListener';
|
|
120
|
+
import removeEventListener from './strings/removeEventListener';
|
|
121
|
+
|
|
122
|
+
import bezierEasings from './strings/bezierEasings';
|
|
123
|
+
|
|
124
|
+
import offsetHeight from './strings/offsetHeight';
|
|
125
|
+
import offsetWidth from './strings/offsetWidth';
|
|
126
|
+
import scrollHeight from './strings/scrollHeight';
|
|
127
|
+
import scrollWidth from './strings/scrollWidth';
|
|
128
|
+
|
|
129
|
+
import userAgentData from './strings/userAgentData';
|
|
130
|
+
import userAgent from './strings/userAgent';
|
|
131
|
+
|
|
132
|
+
// boolean
|
|
133
|
+
import isMobile from './boolean/isMobile';
|
|
134
|
+
import isApple from './boolean/isApple';
|
|
135
|
+
import isFirefox from './boolean/isFirefox';
|
|
136
|
+
import support3DTransform from './boolean/support3DTransform';
|
|
137
|
+
import supportPassive from './boolean/supportPassive';
|
|
138
|
+
import supportTransform from './boolean/supportTransform';
|
|
139
|
+
import supportTouch from './boolean/supportTouch';
|
|
140
|
+
import supportAnimation from './boolean/supportAnimation';
|
|
141
|
+
import supportTransition from './boolean/supportTransition';
|
|
142
|
+
|
|
143
|
+
// attributes
|
|
144
|
+
import getAttribute from './attr/getAttribute';
|
|
145
|
+
import getAttributeNS from './attr/getAttributeNS';
|
|
146
|
+
import hasAttribute from './attr/hasAttribute';
|
|
147
|
+
import hasAttributeNS from './attr/hasAttributeNS';
|
|
148
|
+
import setAttribute from './attr/setAttribute';
|
|
149
|
+
import setAttributeNS from './attr/setAttributeNS';
|
|
150
|
+
import removeAttribute from './attr/removeAttribute';
|
|
151
|
+
import removeAttributeNS from './attr/removeAttributeNS';
|
|
152
|
+
|
|
153
|
+
// class
|
|
154
|
+
import addClass from './class/addClass';
|
|
155
|
+
import removeClass from './class/removeClass';
|
|
156
|
+
import hasClass from './class/hasClass';
|
|
157
|
+
|
|
158
|
+
// event
|
|
159
|
+
import on from './event/on';
|
|
160
|
+
import off from './event/off';
|
|
161
|
+
import one from './event/one';
|
|
162
|
+
|
|
163
|
+
// misc
|
|
164
|
+
import ArrayFrom from './misc/ArrayFrom';
|
|
165
|
+
import Data, { getInstance } from './misc/data';
|
|
166
|
+
import createElement from './misc/createElement';
|
|
167
|
+
import createElementNS from './misc/createElementNS';
|
|
168
|
+
import dispatchEvent from './misc/dispatchEvent';
|
|
169
|
+
import distinct from './misc/distinct';
|
|
170
|
+
import emulateAnimationEnd from './misc/emulateAnimationEnd';
|
|
171
|
+
import emulateAnimationEndLegacy from './misc/emulateAnimationEndLegacy';
|
|
172
|
+
import emulateTransitionEnd from './misc/emulateTransitionEnd';
|
|
173
|
+
import emulateTransitionEndLegacy from './misc/emulateTransitionEndLegacy';
|
|
174
|
+
import Float32ArrayFrom from './misc/Float32ArrayFrom';
|
|
175
|
+
import Float64ArrayFrom from './misc/Float64ArrayFrom';
|
|
176
|
+
import focus from './misc/focus';
|
|
177
|
+
import noop from './misc/noop';
|
|
178
|
+
import normalizeOptions from './misc/normalizeOptions';
|
|
179
|
+
import normalizeValue from './misc/normalizeValue';
|
|
180
|
+
import ObjectAssign from './misc/ObjectAssign';
|
|
181
|
+
import ObjectKeys from './misc/ObjectKeys';
|
|
182
|
+
import ObjectValues from './misc/ObjectValues';
|
|
183
|
+
import OriginalEvent from './misc/OriginalEvent';
|
|
184
|
+
import passiveHandler from './misc/passiveHandler';
|
|
185
|
+
import passiveHandlerLegacy from './misc/passiveHandlerLegacy';
|
|
186
|
+
import reflow from './misc/reflow';
|
|
187
|
+
import setElementStyle from './misc/setElementStyle';
|
|
188
|
+
import Timer from './misc/timer';
|
|
189
|
+
import toLowerCase from './misc/toLowerCase';
|
|
190
|
+
import toUpperCase from './misc/toUpperCase';
|
|
191
|
+
import tryWrapper from './misc/tryWrapper';
|
|
192
|
+
|
|
193
|
+
// get
|
|
194
|
+
import getBoundingClientRect from './get/getBoundingClientRect';
|
|
195
|
+
import getDocument from './get/getDocument';
|
|
196
|
+
import getDocumentBody from './get/getDocumentBody';
|
|
197
|
+
import getDocumentElement from './get/getDocumentElement';
|
|
198
|
+
import getDocumentHead from './get/getDocumentHead';
|
|
199
|
+
import getElementAnimationDuration from './get/getElementAnimationDuration';
|
|
200
|
+
import getElementAnimationDurationLegacy from './get/getElementAnimationDurationLegacy';
|
|
201
|
+
import getElementAnimationDelayLegacy from './get/getElementAnimationDelayLegacy';
|
|
202
|
+
import getElementAnimationDelay from './get/getElementAnimationDelay';
|
|
203
|
+
import getElementStyle from './get/getElementStyle';
|
|
204
|
+
import getElementTransitionDuration from './get/getElementTransitionDuration';
|
|
205
|
+
import getElementTransitionDurationLegacy from './get/getElementTransitionDurationLegacy';
|
|
206
|
+
import getElementTransitionDelay from './get/getElementTransitionDelay';
|
|
207
|
+
import getElementTransitionDelayLegacy from './get/getElementTransitionDelayLegacy';
|
|
208
|
+
import getNodeScroll from './get/getNodeScroll';
|
|
209
|
+
import getParentNode from './get/getParentNode';
|
|
210
|
+
import getRectRelativeToOffsetParent from './get/getRectRelativeToOffsetParent';
|
|
211
|
+
import getUID from './get/getUID';
|
|
212
|
+
import getWindow from './get/getWindow';
|
|
213
|
+
|
|
214
|
+
// is
|
|
215
|
+
import isArray from './is/isArray';
|
|
216
|
+
import isDocument from './is/isDocument';
|
|
217
|
+
import isCustomElement from './is/isCustomElement';
|
|
218
|
+
import isElement from './is/isElement';
|
|
219
|
+
import isElementInScrollRange from './is/isElementInScrollRange';
|
|
220
|
+
import isElementInViewport from './is/isElementInViewport';
|
|
221
|
+
import isElementsArray from './is/isElementsArray';
|
|
222
|
+
import isHTMLCollection from './is/isHTMLCollection';
|
|
223
|
+
import isHTMLElement from './is/isHTMLElement';
|
|
224
|
+
import isHTMLImageElement from './is/isHTMLImageElement';
|
|
225
|
+
import isMedia from './is/isMedia';
|
|
226
|
+
import isNode from './is/isNode';
|
|
227
|
+
import isNodeList from './is/isNodeList';
|
|
228
|
+
import isRTL from './is/isRTL';
|
|
229
|
+
import isScaledElement from './is/isScaledElement';
|
|
230
|
+
import isShadowRoot from './is/isShadowRoot';
|
|
231
|
+
import isString from './is/isString';
|
|
232
|
+
import isSVGElement from './is/isSVGElement';
|
|
233
|
+
import isTableElement from './is/isTableElement';
|
|
234
|
+
import isWindow from './is/isWindow';
|
|
235
|
+
|
|
236
|
+
// selectors
|
|
237
|
+
import closest from './selectors/closest';
|
|
238
|
+
import documentAll from './selectors/documentAll';
|
|
239
|
+
import elementNodes from './selectors/elementNodes';
|
|
240
|
+
import parentNodes from './selectors/parentNodes';
|
|
241
|
+
import querySelector from './selectors/querySelector';
|
|
242
|
+
import getCustomElements from './selectors/getCustomElements';
|
|
243
|
+
import getElementById from './selectors/getElementById';
|
|
244
|
+
import querySelectorAll from './selectors/querySelectorAll';
|
|
245
|
+
import getElementsByTagName from './selectors/getElementsByTagName';
|
|
246
|
+
import getElementsByClassName from './selectors/getElementsByClassName';
|
|
247
|
+
import matches from './selectors/matches';
|
|
248
|
+
import matchesLegacy from './selectors/matchesLegacy';
|
|
249
|
+
|
|
250
|
+
import Version from './misc/version';
|
|
251
|
+
|
|
252
|
+
const SHORTER = {
|
|
253
|
+
ariaChecked,
|
|
254
|
+
ariaDescription,
|
|
255
|
+
ariaDescribedBy,
|
|
256
|
+
ariaExpanded,
|
|
257
|
+
ariaHidden,
|
|
258
|
+
ariaHasPopup,
|
|
259
|
+
ariaLabel,
|
|
260
|
+
ariaLabelledBy,
|
|
261
|
+
ariaModal,
|
|
262
|
+
ariaPressed,
|
|
263
|
+
ariaSelected,
|
|
264
|
+
ariaValueMin,
|
|
265
|
+
ariaValueMax,
|
|
266
|
+
ariaValueNow,
|
|
267
|
+
ariaValueText,
|
|
268
|
+
nativeEvents,
|
|
269
|
+
abortEvent,
|
|
270
|
+
blurEvent,
|
|
271
|
+
moveEvent,
|
|
272
|
+
changeEvent,
|
|
273
|
+
errorEvent,
|
|
274
|
+
resetEvent,
|
|
275
|
+
resizeEvent,
|
|
276
|
+
scrollEvent,
|
|
277
|
+
submitEvent,
|
|
278
|
+
loadEvent,
|
|
279
|
+
loadstartEvent,
|
|
280
|
+
unloadEvent,
|
|
281
|
+
readystatechangeEvent,
|
|
282
|
+
beforeunloadEvent,
|
|
283
|
+
orientationchangeEvent,
|
|
284
|
+
contextmenuEvent,
|
|
285
|
+
DOMContentLoadedEvent,
|
|
286
|
+
DOMMouseScrollEvent,
|
|
287
|
+
selectEvent,
|
|
288
|
+
selectendEvent,
|
|
289
|
+
selectstartEvent,
|
|
290
|
+
mouseClickEvents,
|
|
291
|
+
mouseclickEvent,
|
|
292
|
+
mousedblclickEvent,
|
|
293
|
+
mousedownEvent,
|
|
294
|
+
mouseupEvent,
|
|
295
|
+
mousehoverEvent,
|
|
296
|
+
mouseHoverEvents,
|
|
297
|
+
mouseenterEvent,
|
|
298
|
+
mouseleaveEvent,
|
|
299
|
+
mouseinEvent,
|
|
300
|
+
mouseoutEvent,
|
|
301
|
+
mouseoverEvent,
|
|
302
|
+
mousemoveEvent,
|
|
303
|
+
mousewheelEvent,
|
|
304
|
+
mouseSwipeEvents,
|
|
305
|
+
touchEvents,
|
|
306
|
+
touchstartEvent,
|
|
307
|
+
touchmoveEvent,
|
|
308
|
+
touchcancelEvent,
|
|
309
|
+
touchendEvent,
|
|
310
|
+
pointercancelEvent,
|
|
311
|
+
pointerdownEvent,
|
|
312
|
+
pointerleaveEvent,
|
|
313
|
+
pointermoveEvent,
|
|
314
|
+
pointerupEvent,
|
|
315
|
+
focusEvents,
|
|
316
|
+
focusEvent,
|
|
317
|
+
focusinEvent,
|
|
318
|
+
focusoutEvent,
|
|
319
|
+
gesturechangeEvent,
|
|
320
|
+
gestureendEvent,
|
|
321
|
+
gesturestartEvent,
|
|
322
|
+
bezierEasings,
|
|
323
|
+
animationDuration,
|
|
324
|
+
animationDurationLegacy,
|
|
325
|
+
animationDelay,
|
|
326
|
+
animationDelayLegacy,
|
|
327
|
+
animationName,
|
|
328
|
+
animationNameLegacy,
|
|
329
|
+
animationEndEvent,
|
|
330
|
+
animationEndEventLegacy,
|
|
331
|
+
transitionDuration,
|
|
332
|
+
transitionDurationLegacy,
|
|
333
|
+
transitionDelay,
|
|
334
|
+
transitionDelayLegacy,
|
|
335
|
+
transitionEndEvent,
|
|
336
|
+
transitionEndEventLegacy,
|
|
337
|
+
transitionProperty,
|
|
338
|
+
transitionPropertyLegacy,
|
|
339
|
+
isMobile,
|
|
340
|
+
isApple,
|
|
341
|
+
isFirefox,
|
|
342
|
+
support3DTransform,
|
|
343
|
+
supportPassive,
|
|
344
|
+
supportTransform,
|
|
345
|
+
supportTouch,
|
|
346
|
+
supportAnimation,
|
|
347
|
+
supportTransition,
|
|
348
|
+
addEventListener,
|
|
349
|
+
removeEventListener,
|
|
350
|
+
keyboardEventKeys,
|
|
351
|
+
keydownEvent,
|
|
352
|
+
keypressEvent,
|
|
353
|
+
keyupEvent,
|
|
354
|
+
keyAlt,
|
|
355
|
+
keyArrowDown,
|
|
356
|
+
keyArrowLeft,
|
|
357
|
+
keyArrowRight,
|
|
358
|
+
keyArrowUp,
|
|
359
|
+
keyBackspace,
|
|
360
|
+
keyCapsLock,
|
|
361
|
+
keyControl,
|
|
362
|
+
keyDelete,
|
|
363
|
+
keyEnter,
|
|
364
|
+
keyEscape,
|
|
365
|
+
keyInsert,
|
|
366
|
+
keyMeta,
|
|
367
|
+
keyPause,
|
|
368
|
+
keyScrollLock,
|
|
369
|
+
keyShift,
|
|
370
|
+
keySpace,
|
|
371
|
+
keyTab,
|
|
372
|
+
offsetHeight,
|
|
373
|
+
offsetWidth,
|
|
374
|
+
scrollHeight,
|
|
375
|
+
scrollWidth,
|
|
376
|
+
userAgentData,
|
|
377
|
+
userAgent,
|
|
378
|
+
addClass,
|
|
379
|
+
removeClass,
|
|
380
|
+
hasClass,
|
|
381
|
+
on,
|
|
382
|
+
off,
|
|
383
|
+
one,
|
|
384
|
+
dispatchEvent,
|
|
385
|
+
distinct,
|
|
386
|
+
Data,
|
|
387
|
+
getInstance,
|
|
388
|
+
createElement,
|
|
389
|
+
createElementNS,
|
|
390
|
+
toUpperCase,
|
|
391
|
+
toLowerCase,
|
|
392
|
+
Timer,
|
|
393
|
+
emulateAnimationEnd,
|
|
394
|
+
emulateAnimationEndLegacy,
|
|
395
|
+
emulateTransitionEnd,
|
|
396
|
+
emulateTransitionEndLegacy,
|
|
397
|
+
isElementInScrollRange,
|
|
398
|
+
isElementInViewport,
|
|
399
|
+
passiveHandler,
|
|
400
|
+
passiveHandlerLegacy,
|
|
401
|
+
getElementAnimationDuration,
|
|
402
|
+
getElementAnimationDurationLegacy,
|
|
403
|
+
getElementAnimationDelay,
|
|
404
|
+
getElementAnimationDelayLegacy,
|
|
405
|
+
getElementTransitionDuration,
|
|
406
|
+
getElementTransitionDurationLegacy,
|
|
407
|
+
getElementTransitionDelay,
|
|
408
|
+
getElementTransitionDelayLegacy,
|
|
409
|
+
getNodeScroll,
|
|
410
|
+
getParentNode,
|
|
411
|
+
getRectRelativeToOffsetParent,
|
|
412
|
+
getWindow,
|
|
413
|
+
isArray,
|
|
414
|
+
isString,
|
|
415
|
+
isCustomElement,
|
|
416
|
+
isElement,
|
|
417
|
+
isNode,
|
|
418
|
+
isHTMLElement,
|
|
419
|
+
isHTMLImageElement,
|
|
420
|
+
isSVGElement,
|
|
421
|
+
isNodeList,
|
|
422
|
+
isHTMLCollection,
|
|
423
|
+
isScaledElement,
|
|
424
|
+
isTableElement,
|
|
425
|
+
isShadowRoot,
|
|
426
|
+
isDocument,
|
|
427
|
+
isElementsArray,
|
|
428
|
+
isWindow,
|
|
429
|
+
isMedia,
|
|
430
|
+
isRTL,
|
|
431
|
+
elementNodes,
|
|
432
|
+
parentNodes,
|
|
433
|
+
closest,
|
|
434
|
+
documentAll,
|
|
435
|
+
querySelector,
|
|
436
|
+
getCustomElements,
|
|
437
|
+
getElementById,
|
|
438
|
+
querySelectorAll,
|
|
439
|
+
getElementsByClassName,
|
|
440
|
+
getElementsByTagName,
|
|
441
|
+
matches,
|
|
442
|
+
matchesLegacy,
|
|
443
|
+
normalizeValue,
|
|
444
|
+
normalizeOptions,
|
|
445
|
+
tryWrapper,
|
|
446
|
+
reflow,
|
|
447
|
+
noop,
|
|
448
|
+
focus,
|
|
449
|
+
getUID,
|
|
450
|
+
ArrayFrom,
|
|
451
|
+
Float32ArrayFrom,
|
|
452
|
+
Float64ArrayFrom,
|
|
453
|
+
ObjectAssign,
|
|
454
|
+
ObjectKeys,
|
|
455
|
+
ObjectValues,
|
|
456
|
+
OriginalEvent,
|
|
457
|
+
getBoundingClientRect,
|
|
458
|
+
getDocument,
|
|
459
|
+
getDocumentBody,
|
|
460
|
+
getDocumentElement,
|
|
461
|
+
getDocumentHead,
|
|
462
|
+
getElementStyle,
|
|
463
|
+
setElementStyle,
|
|
464
|
+
hasAttribute,
|
|
465
|
+
hasAttributeNS,
|
|
466
|
+
getAttribute,
|
|
467
|
+
getAttributeNS,
|
|
468
|
+
setAttribute,
|
|
469
|
+
setAttributeNS,
|
|
470
|
+
removeAttribute,
|
|
471
|
+
removeAttributeNS,
|
|
472
|
+
Version,
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
export default SHORTER;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import getBoundingClientRect from '../get/getBoundingClientRect';
|
|
2
|
+
import getDocumentElement from '../get/getDocumentElement';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Utility to determine if an `HTMLElement`
|
|
6
|
+
* is partially visible in viewport.
|
|
7
|
+
*
|
|
8
|
+
* @param {HTMLElement | Element} element target
|
|
9
|
+
* @return {boolean} the query result
|
|
10
|
+
*/
|
|
11
|
+
const isElementInScrollRange = (element) => {
|
|
12
|
+
const { top, bottom } = getBoundingClientRect(element);
|
|
13
|
+
const { clientHeight } = getDocumentElement(element);
|
|
14
|
+
// checks bottom && top
|
|
15
|
+
return top <= clientHeight && bottom >= 0;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default isElementInScrollRange;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import getBoundingClientRect from '../get/getBoundingClientRect';
|
|
2
|
+
import getDocumentElement from '../get/getDocumentElement';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Utility to determine if an `HTMLElement`
|
|
6
|
+
* is fully visible in the viewport.
|
|
7
|
+
*
|
|
8
|
+
* @param {HTMLElement | Element} element target
|
|
9
|
+
* @return {boolean} the query result
|
|
10
|
+
*/
|
|
11
|
+
const isElementInViewport = (element) => {
|
|
12
|
+
const {
|
|
13
|
+
top, left, bottom, right,
|
|
14
|
+
} = getBoundingClientRect(element, true);
|
|
15
|
+
const { clientWidth, clientHeight } = getDocumentElement(element);
|
|
16
|
+
return (
|
|
17
|
+
top >= 0 && left >= 0
|
|
18
|
+
&& bottom <= clientHeight
|
|
19
|
+
&& right <= clientWidth
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
export default isElementInViewport;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if an object is an `Array` in which all items are `Element`.
|
|
3
|
+
*
|
|
4
|
+
* @param {any} object the target object
|
|
5
|
+
* @returns {boolean} the query result
|
|
6
|
+
*/
|
|
7
|
+
const isElementsArray = (object) => Array.isArray(object)
|
|
8
|
+
&& object.every((el) => [HTMLElement, Element].some((x) => el instanceof x));
|
|
9
|
+
|
|
10
|
+
export default isElementsArray;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if an element is an `<svg>` (or any type of SVG element),
|
|
3
|
+
* `<img>` or `<video>`.
|
|
4
|
+
*
|
|
5
|
+
* *Tooltip* / *Popover* works different with media elements.
|
|
6
|
+
* @param {any} element the target element
|
|
7
|
+
* @returns {boolean} the query result
|
|
8
|
+
*/
|
|
9
|
+
const isMedia = (element) => element
|
|
10
|
+
&& [SVGElement, HTMLImageElement, HTMLVideoElement]
|
|
11
|
+
.some((mediaType) => element instanceof mediaType);
|
|
12
|
+
export default isMedia;
|
package/src/is/isNode.js
ADDED
package/src/is/isRTL.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import getDocumentElement from '../get/getDocumentElement';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Checks if a page is Right To Left.
|
|
5
|
+
* @param {(HTMLElement | Element)=} node the target
|
|
6
|
+
* @returns {boolean} the query result
|
|
7
|
+
*/
|
|
8
|
+
const isRTL = (node) => getDocumentElement(node).dir === 'rtl';
|
|
9
|
+
export default isRTL;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import getBoundingClientRect from '../get/getBoundingClientRect';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Checks if a target `HTMLElement` is affected by scale.
|
|
5
|
+
* @see https://github.com/floating-ui/floating-ui
|
|
6
|
+
*
|
|
7
|
+
* @param {HTMLElement} element target
|
|
8
|
+
* @returns {boolean} the query result
|
|
9
|
+
*/
|
|
10
|
+
export default function isScaledElement(element) {
|
|
11
|
+
const { width, height } = getBoundingClientRect(element);
|
|
12
|
+
const { offsetWidth, offsetHeight } = element;
|
|
13
|
+
return Math.round(width) !== offsetWidth
|
|
14
|
+
|| Math.round(height) !== offsetHeight;
|
|
15
|
+
}
|