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