@thednp/shorty 2.0.5 → 2.0.7
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/README.md +1 -3
- package/dist/shorty.cjs +1 -17
- package/dist/shorty.cjs.map +1 -1
- package/dist/shorty.d.ts +2033 -1719
- package/dist/shorty.js +1 -17
- package/dist/shorty.js.map +1 -1
- package/dist/shorty.mjs +514 -516
- package/dist/shorty.mjs.map +1 -1
- package/package.json +13 -24
- package/src/attr/hasAttribute.ts +2 -1
- package/src/attr/hasAttributeNS.ts +5 -2
- package/src/attr/removeAttribute.ts +2 -1
- package/src/attr/removeAttributeNS.ts +5 -2
- package/src/attr/setAttributeNS.ts +6 -2
- package/src/boolean/isApple.ts +11 -10
- package/src/boolean/isFirefox.ts +3 -5
- package/src/boolean/isMobile.ts +9 -14
- package/src/boolean/support3DTransform.ts +2 -3
- package/src/boolean/supportAnimation.ts +2 -3
- package/src/boolean/supportPassive.ts +7 -7
- package/src/boolean/supportTouch.ts +4 -2
- package/src/boolean/supportTransform.ts +2 -3
- package/src/boolean/supportTransition.ts +2 -3
- package/src/event/off.ts +5 -1
- package/src/event/on.ts +5 -1
- package/src/event/one.ts +5 -5
- package/src/get/getBoundingClientRect.ts +10 -5
- package/src/get/getDocument.ts +4 -4
- package/src/get/getDocumentBody.ts +1 -1
- package/src/get/getDocumentElement.ts +1 -1
- package/src/get/getDocumentHead.ts +4 -2
- package/src/get/getElementAnimationDelay.ts +9 -6
- package/src/get/getElementAnimationDuration.ts +9 -6
- package/src/get/getElementStyle.ts +2 -2
- package/src/get/getElementTransitionDelay.ts +9 -8
- package/src/get/getElementTransitionDuration.ts +9 -8
- package/src/get/getNodeScroll.ts +4 -2
- package/src/get/getParentNode.ts +5 -5
- package/src/get/getRectRelativeToOffsetParent.ts +8 -5
- package/src/get/getUID.ts +1 -1
- package/src/get/getWindow.ts +2 -2
- package/src/index.ts +482 -440
- package/src/interface/event.d.ts +49 -41
- package/src/interface/fn.ts +1 -0
- package/src/interface/originalEvent.d.ts +1 -1
- package/src/is/isArray.ts +2 -1
- package/src/is/isCanvas.ts +2 -2
- package/src/is/isCustomElement.ts +5 -3
- package/src/is/isDocument.ts +3 -2
- package/src/is/isElement.ts +3 -2
- package/src/is/isElementInScrollRange.ts +3 -3
- package/src/is/isElementInViewport.ts +5 -4
- package/src/is/isElementsArray.ts +2 -2
- package/src/is/isFunction.ts +4 -2
- package/src/is/isHTMLCollection.ts +2 -2
- package/src/is/isHTMLElement.ts +1 -1
- package/src/is/isHTMLImageElement.ts +2 -2
- package/src/is/isJSON.ts +2 -2
- package/src/is/isMap.ts +3 -3
- package/src/is/isMedia.ts +9 -3
- package/src/is/isNode.ts +5 -3
- package/src/is/isNodeList.ts +2 -2
- package/src/is/isNumber.ts +2 -1
- package/src/is/isObject.ts +1 -1
- package/src/is/isRTL.ts +2 -2
- package/src/is/isSVGElement.ts +2 -2
- package/src/is/isScaledElement.ts +4 -3
- package/src/is/isShadowRoot.ts +2 -2
- package/src/is/isString.ts +2 -1
- package/src/is/isTableElement.ts +6 -3
- package/src/is/isWeakMap.ts +3 -3
- package/src/is/isWindow.ts +2 -2
- package/src/misc/Float32ArrayFrom.ts +3 -2
- package/src/misc/Float64ArrayFrom.ts +3 -2
- package/src/misc/ObjectAssign.ts +15 -4
- package/src/misc/ObjectEntries.ts +1 -1
- package/src/misc/ObjectHasOwn.ts +3 -2
- package/src/misc/ObjectKeys.ts +2 -1
- package/src/misc/ObjectValues.ts +3 -2
- package/src/misc/createCustomEvent.ts +7 -4
- package/src/misc/createElement.ts +6 -4
- package/src/misc/createElementNS.ts +3 -3
- package/src/misc/data.ts +2 -2
- package/src/misc/dispatchEvent.ts +2 -1
- package/src/misc/distinct.ts +2 -1
- package/src/misc/emulateAnimationEnd.ts +8 -5
- package/src/misc/emulateTransitionEnd.ts +8 -5
- package/src/misc/focus.ts +2 -1
- package/src/misc/focusTrap.ts +17 -14
- package/src/misc/getInstance.ts +1 -1
- package/src/misc/normalizeOptions.ts +15 -12
- package/src/misc/normalizeValue.ts +8 -6
- package/src/misc/setElementStyle.ts +9 -6
- package/src/misc/timer.ts +12 -5
- package/src/selectors/closest.ts +2 -2
- package/src/selectors/getCustomElements.ts +3 -3
- package/src/selectors/getElementById.ts +1 -1
- package/src/selectors/getElementsByClassName.ts +9 -4
- package/src/selectors/getElementsByTagName.ts +9 -4
- package/src/selectors/matches.ts +2 -1
- package/src/selectors/querySelector.ts +3 -3
- package/src/selectors/querySelectorAll.ts +2 -2
- package/src/strings/DOMContentLoadedEvent.ts +1 -1
- package/src/strings/DOMMouseScrollEvent.ts +1 -1
- package/src/strings/abortEvent.ts +1 -1
- package/src/strings/addEventListener.ts +1 -1
- package/src/strings/animationDelay.ts +1 -1
- package/src/strings/animationDuration.ts +1 -1
- package/src/strings/animationEndEvent.ts +1 -1
- package/src/strings/animationName.ts +1 -1
- package/src/strings/ariaChecked.ts +1 -1
- package/src/strings/ariaDescribedBy.ts +1 -1
- package/src/strings/ariaDescription.ts +1 -1
- package/src/strings/ariaExpanded.ts +1 -1
- package/src/strings/ariaHasPopup.ts +1 -1
- package/src/strings/ariaHidden.ts +1 -1
- package/src/strings/ariaLabel.ts +1 -1
- package/src/strings/ariaLabelledBy.ts +1 -1
- package/src/strings/ariaModal.ts +1 -1
- package/src/strings/ariaPressed.ts +1 -1
- package/src/strings/ariaSelected.ts +1 -1
- package/src/strings/ariaValueMax.ts +1 -1
- package/src/strings/ariaValueMin.ts +1 -1
- package/src/strings/ariaValueNow.ts +1 -1
- package/src/strings/ariaValueText.ts +1 -1
- package/src/strings/beforeunloadEvent.ts +1 -1
- package/src/strings/bezierEasings.ts +25 -25
- package/src/strings/blurEvent.ts +1 -1
- package/src/strings/changeEvent.ts +1 -1
- package/src/strings/contextmenuEvent.ts +1 -1
- package/src/strings/dragEvent.ts +1 -1
- package/src/strings/dragendEvent.ts +1 -1
- package/src/strings/dragenterEvent.ts +1 -1
- package/src/strings/dragleaveEvent.ts +1 -1
- package/src/strings/dragoverEvent.ts +1 -1
- package/src/strings/dragstartEvent.ts +1 -1
- package/src/strings/errorEvent.ts +1 -1
- package/src/strings/focusEvent.ts +1 -1
- package/src/strings/focusEvents.ts +1 -1
- package/src/strings/focusinEvent.ts +1 -1
- package/src/strings/focusoutEvent.ts +1 -1
- package/src/strings/gesturechangeEvent.ts +1 -1
- package/src/strings/gestureendEvent.ts +1 -1
- package/src/strings/gesturestartEvent.ts +1 -1
- package/src/strings/keyAlt.ts +1 -1
- package/src/strings/keyArrowDown.ts +1 -1
- package/src/strings/keyArrowLeft.ts +1 -1
- package/src/strings/keyArrowRight.ts +1 -1
- package/src/strings/keyArrowUp.ts +1 -1
- package/src/strings/keyBackspace.ts +1 -1
- package/src/strings/keyCapsLock.ts +1 -1
- package/src/strings/keyControl.ts +1 -1
- package/src/strings/keyDelete.ts +1 -1
- package/src/strings/keyEnter.ts +1 -1
- package/src/strings/keyEscape.ts +1 -1
- package/src/strings/keyInsert.ts +1 -1
- package/src/strings/keyMeta.ts +1 -1
- package/src/strings/keyNumpadEnter.ts +1 -1
- package/src/strings/keyPause.ts +1 -1
- package/src/strings/keyScrollLock.ts +1 -1
- package/src/strings/keyShift.ts +1 -1
- package/src/strings/keySpace.ts +1 -1
- package/src/strings/keyTab.ts +1 -1
- package/src/strings/keyboardEventKeys.ts +19 -19
- package/src/strings/keydownEvent.ts +1 -1
- package/src/strings/keypressEvent.ts +1 -1
- package/src/strings/keyupEvent.ts +1 -1
- package/src/strings/loadEvent.ts +1 -1
- package/src/strings/loadstartEvent.ts +1 -1
- package/src/strings/mouseClickEvents.ts +1 -1
- package/src/strings/mouseHoverEvents.ts +3 -4
- package/src/strings/mouseSwipeEvents.ts +4 -4
- package/src/strings/mouseclickEvent.ts +1 -1
- package/src/strings/mousedblclickEvent.ts +1 -1
- package/src/strings/mousedownEvent.ts +1 -1
- package/src/strings/mouseenterEvent.ts +1 -1
- package/src/strings/mousehoverEvent.ts +1 -1
- package/src/strings/mouseinEvent.ts +1 -1
- package/src/strings/mouseleaveEvent.ts +1 -1
- package/src/strings/mousemoveEvent.ts +1 -1
- package/src/strings/mouseoutEvent.ts +1 -1
- package/src/strings/mouseoverEvent.ts +1 -1
- package/src/strings/mouseupEvent.ts +1 -1
- package/src/strings/mousewheelEvent.ts +1 -1
- package/src/strings/moveEvent.ts +1 -1
- package/src/strings/nativeEvents.ts +50 -50
- package/src/strings/offsetHeight.ts +1 -1
- package/src/strings/offsetWidth.ts +1 -1
- package/src/strings/orientationchangeEvent.ts +1 -1
- package/src/strings/pointercancelEvent.ts +1 -1
- package/src/strings/pointerdownEvent.ts +1 -1
- package/src/strings/pointerleaveEvent.ts +1 -1
- package/src/strings/pointermoveEvent.ts +1 -1
- package/src/strings/pointerupEvent.ts +1 -1
- package/src/strings/readystatechangeEvent.ts +1 -1
- package/src/strings/removeEventListener.ts +1 -1
- package/src/strings/resetEvent.ts +1 -1
- package/src/strings/resizeEvent.ts +1 -1
- package/src/strings/scrollEvent.ts +1 -1
- package/src/strings/scrollHeight.ts +1 -1
- package/src/strings/scrollWidth.ts +1 -1
- package/src/strings/selectEvent.ts +1 -1
- package/src/strings/selectendEvent.ts +1 -1
- package/src/strings/selectstartEvent.ts +1 -1
- package/src/strings/submitEvent.ts +1 -1
- package/src/strings/tabindex.ts +1 -1
- package/src/strings/touchEvents.ts +4 -4
- package/src/strings/touchcancelEvent.ts +1 -1
- package/src/strings/touchendEvent.ts +1 -1
- package/src/strings/touchmoveEvent.ts +1 -1
- package/src/strings/touchstartEvent.ts +1 -1
- package/src/strings/transitionDelay.ts +1 -1
- package/src/strings/transitionDuration.ts +1 -1
- package/src/strings/transitionEndEvent.ts +1 -1
- package/src/strings/transitionProperty.ts +1 -1
- package/src/strings/unloadEvent.ts +1 -1
- package/src/strings/userAgentData.ts +3 -4
- package/test/boolean.test.ts +9 -9
- package/tsconfig.json +2 -1
- package/vite.config.mts +20 -0
- package/vitest.config-ui.mts +5 -0
- package/vitest.config.mts +5 -0
- package/dts.config.ts +0 -16
package/src/strings/ariaModal.ts
CHANGED
|
@@ -3,30 +3,30 @@
|
|
|
3
3
|
* CSS3 'cubic-bezier()' easing functions.
|
|
4
4
|
*/
|
|
5
5
|
const bezierEasings = {
|
|
6
|
-
linear:
|
|
7
|
-
easingSinusoidalIn:
|
|
8
|
-
easingSinusoidalOut:
|
|
9
|
-
easingSinusoidalInOut:
|
|
10
|
-
easingQuadraticIn:
|
|
11
|
-
easingQuadraticOut:
|
|
12
|
-
easingQuadraticInOut:
|
|
13
|
-
easingCubicIn:
|
|
14
|
-
easingCubicOut:
|
|
15
|
-
easingCubicInOut:
|
|
16
|
-
easingQuarticIn:
|
|
17
|
-
easingQuarticOut:
|
|
18
|
-
easingQuarticInOut:
|
|
19
|
-
easingQuinticIn:
|
|
20
|
-
easingQuinticOut:
|
|
21
|
-
easingQuinticInOut:
|
|
22
|
-
easingExponentialIn:
|
|
23
|
-
easingExponentialOut:
|
|
24
|
-
easingExponentialInOut:
|
|
25
|
-
easingCircularIn:
|
|
26
|
-
easingCircularOut:
|
|
27
|
-
easingCircularInOut:
|
|
28
|
-
easingBackIn:
|
|
29
|
-
easingBackOut:
|
|
30
|
-
easingBackInOut:
|
|
6
|
+
linear: "linear",
|
|
7
|
+
easingSinusoidalIn: "cubic-bezier(0.47,0,0.745,0.715)",
|
|
8
|
+
easingSinusoidalOut: "cubic-bezier(0.39,0.575,0.565,1)",
|
|
9
|
+
easingSinusoidalInOut: "cubic-bezier(0.445,0.05,0.55,0.95)",
|
|
10
|
+
easingQuadraticIn: "cubic-bezier(0.550,0.085,0.680,0.530)",
|
|
11
|
+
easingQuadraticOut: "cubic-bezier(0.250,0.460,0.450,0.940)",
|
|
12
|
+
easingQuadraticInOut: "cubic-bezier(0.455,0.030,0.515,0.955)",
|
|
13
|
+
easingCubicIn: "cubic-bezier(0.55,0.055,0.675,0.19)",
|
|
14
|
+
easingCubicOut: "cubic-bezier(0.215,0.61,0.355,1)",
|
|
15
|
+
easingCubicInOut: "cubic-bezier(0.645,0.045,0.355,1)",
|
|
16
|
+
easingQuarticIn: "cubic-bezier(0.895,0.03,0.685,0.22)",
|
|
17
|
+
easingQuarticOut: "cubic-bezier(0.165,0.84,0.44,1)",
|
|
18
|
+
easingQuarticInOut: "cubic-bezier(0.77,0,0.175,1)",
|
|
19
|
+
easingQuinticIn: "cubic-bezier(0.755,0.05,0.855,0.06)",
|
|
20
|
+
easingQuinticOut: "cubic-bezier(0.23,1,0.32,1)",
|
|
21
|
+
easingQuinticInOut: "cubic-bezier(0.86,0,0.07,1)",
|
|
22
|
+
easingExponentialIn: "cubic-bezier(0.95,0.05,0.795,0.035)",
|
|
23
|
+
easingExponentialOut: "cubic-bezier(0.19,1,0.22,1)",
|
|
24
|
+
easingExponentialInOut: "cubic-bezier(1,0,0,1)",
|
|
25
|
+
easingCircularIn: "cubic-bezier(0.6,0.04,0.98,0.335)",
|
|
26
|
+
easingCircularOut: "cubic-bezier(0.075,0.82,0.165,1)",
|
|
27
|
+
easingCircularInOut: "cubic-bezier(0.785,0.135,0.15,0.86)",
|
|
28
|
+
easingBackIn: "cubic-bezier(0.6,-0.28,0.735,0.045)",
|
|
29
|
+
easingBackOut: "cubic-bezier(0.175,0.885,0.32,1.275)",
|
|
30
|
+
easingBackInOut: "cubic-bezier(0.68,-0.55,0.265,1.55)",
|
|
31
31
|
};
|
|
32
32
|
export default bezierEasings;
|
package/src/strings/blurEvent.ts
CHANGED
package/src/strings/dragEvent.ts
CHANGED
package/src/strings/keyAlt.ts
CHANGED
package/src/strings/keyDelete.ts
CHANGED
package/src/strings/keyEnter.ts
CHANGED
package/src/strings/keyEscape.ts
CHANGED
package/src/strings/keyInsert.ts
CHANGED
package/src/strings/keyMeta.ts
CHANGED
package/src/strings/keyPause.ts
CHANGED
package/src/strings/keyShift.ts
CHANGED
package/src/strings/keySpace.ts
CHANGED
package/src/strings/keyTab.ts
CHANGED
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
* A global namespace for keyboard event keys.
|
|
3
3
|
*/
|
|
4
4
|
const keyboardEventKeys = {
|
|
5
|
-
Backspace:
|
|
6
|
-
Tab:
|
|
7
|
-
Enter:
|
|
8
|
-
Shift:
|
|
9
|
-
Control:
|
|
10
|
-
Alt:
|
|
11
|
-
Pause:
|
|
12
|
-
CapsLock:
|
|
13
|
-
Escape:
|
|
14
|
-
Scape:
|
|
15
|
-
ArrowLeft:
|
|
16
|
-
ArrowUp:
|
|
17
|
-
ArrowRight:
|
|
18
|
-
ArrowDown:
|
|
19
|
-
Insert:
|
|
20
|
-
Delete:
|
|
21
|
-
Meta:
|
|
22
|
-
ContextMenu:
|
|
23
|
-
ScrollLock:
|
|
5
|
+
Backspace: "Backspace", // 8
|
|
6
|
+
Tab: "Tab", // 9
|
|
7
|
+
Enter: "Enter", // 13
|
|
8
|
+
Shift: "Shift", // 16
|
|
9
|
+
Control: "Control", // 17
|
|
10
|
+
Alt: "Alt", // 18
|
|
11
|
+
Pause: "Pause", // 19
|
|
12
|
+
CapsLock: "CapsLock", // 20
|
|
13
|
+
Escape: "Escape", // 27
|
|
14
|
+
Scape: "Space", // 32
|
|
15
|
+
ArrowLeft: "ArrowLeft", // 37
|
|
16
|
+
ArrowUp: "ArrowUp", // 38
|
|
17
|
+
ArrowRight: "ArrowRight", // 39
|
|
18
|
+
ArrowDown: "ArrowDown", // 40
|
|
19
|
+
Insert: "Insert", // 45
|
|
20
|
+
Delete: "Delete", // 46
|
|
21
|
+
Meta: "Meta", // 91 windows key
|
|
22
|
+
ContextMenu: "ContextMenu", // 93
|
|
23
|
+
ScrollLock: "ScrollLock", // 145
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export default keyboardEventKeys;
|
package/src/strings/loadEvent.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A global namespace for mouse hover events.
|
|
3
3
|
*/
|
|
4
|
-
const mouseHoverEvents =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
: /* istanbul ignore next */ ['mouseover', 'mouseout'];
|
|
4
|
+
const mouseHoverEvents = "onmouseleave" in document
|
|
5
|
+
? ["mouseenter", "mouseleave"]
|
|
6
|
+
: /* istanbul ignore next @preserve */ ["mouseover", "mouseout"];
|
|
8
7
|
export default mouseHoverEvents;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* A global namespace for mouse events equivalent to touch events.
|
|
3
3
|
*/
|
|
4
4
|
const mouseSwipeEvents = {
|
|
5
|
-
start:
|
|
6
|
-
end:
|
|
7
|
-
move:
|
|
8
|
-
cancel:
|
|
5
|
+
start: "mousedown",
|
|
6
|
+
end: "mouseup",
|
|
7
|
+
move: "mousemove",
|
|
8
|
+
cancel: "mouseleave",
|
|
9
9
|
};
|
|
10
10
|
export default mouseSwipeEvents;
|