@thednp/shorty 1.0.1 → 2.0.0-alpha1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +195 -199
- package/dist/index.cjs.js +1564 -0
- package/dist/index.cjs.js.map +7 -0
- package/dist/index.cjs.min.js +3 -0
- package/dist/index.cjs.min.js.map +7 -0
- package/dist/index.js +1542 -0
- package/dist/index.js.map +7 -0
- package/dist/index.min.js +3 -0
- package/dist/index.min.js.map +7 -0
- package/package.json +32 -24
- package/src/attr/getAttribute.js +3 -9
- package/src/attr/getAttribute.js.map +1 -0
- package/src/attr/getAttribute.ts +10 -0
- package/src/attr/getAttributeNS.js +3 -10
- package/src/attr/getAttributeNS.js.map +1 -0
- package/src/attr/getAttributeNS.ts +11 -0
- package/src/attr/hasAttribute.js +3 -9
- package/src/attr/hasAttribute.js.map +1 -0
- package/src/attr/hasAttribute.ts +9 -0
- package/src/attr/hasAttributeNS.js +3 -10
- package/src/attr/hasAttributeNS.js.map +1 -0
- package/src/attr/hasAttributeNS.ts +11 -0
- package/src/attr/removeAttribute.js +3 -9
- package/src/attr/removeAttribute.js.map +1 -0
- package/src/attr/removeAttribute.ts +8 -0
- package/src/attr/removeAttributeNS.js +3 -10
- package/src/attr/removeAttributeNS.js.map +1 -0
- package/src/attr/removeAttributeNS.ts +10 -0
- package/src/attr/setAttribute.js +3 -10
- package/src/attr/setAttribute.js.map +1 -0
- package/src/attr/setAttribute.ts +10 -0
- package/src/attr/setAttributeNS.js +3 -11
- package/src/attr/setAttributeNS.js.map +1 -0
- package/src/attr/setAttributeNS.ts +11 -0
- package/src/blocks/documentBody.js +3 -5
- package/src/blocks/documentBody.js.map +1 -0
- package/src/blocks/documentBody.ts +5 -0
- package/src/blocks/documentElement.js +3 -5
- package/src/blocks/documentElement.js.map +1 -0
- package/src/blocks/documentElement.ts +5 -0
- package/src/blocks/documentHead.js +3 -5
- package/src/blocks/documentHead.js.map +1 -0
- package/src/blocks/documentHead.ts +5 -0
- package/src/boolean/isApple.js +8 -13
- package/src/boolean/isApple.js.map +1 -0
- package/src/boolean/isApple.ts +14 -0
- package/src/boolean/isFirefox.js +4 -9
- package/src/boolean/isFirefox.js.map +1 -0
- package/src/boolean/isFirefox.ts +9 -0
- package/src/boolean/isMobile.js +13 -20
- package/src/boolean/isMobile.js.map +1 -0
- package/src/boolean/isMobile.ts +19 -0
- package/src/boolean/support3DTransform.js +4 -8
- package/src/boolean/support3DTransform.js.map +1 -0
- package/src/boolean/support3DTransform.ts +10 -0
- package/src/boolean/supportAnimation.js +4 -8
- package/src/boolean/supportAnimation.js.map +1 -0
- package/src/boolean/supportAnimation.ts +8 -0
- package/src/boolean/supportPassive.js +19 -28
- package/src/boolean/supportPassive.js.map +1 -0
- package/src/boolean/supportPassive.ts +28 -0
- package/src/boolean/supportTouch.js +3 -6
- package/src/boolean/supportTouch.js.map +1 -0
- package/src/boolean/supportTouch.ts +7 -0
- package/src/boolean/supportTransform.js +4 -8
- package/src/boolean/supportTransform.js.map +1 -0
- package/src/boolean/supportTransform.ts +8 -0
- package/src/boolean/supportTransition.js +4 -8
- package/src/boolean/supportTransition.js.map +1 -0
- package/src/boolean/supportTransition.ts +8 -0
- package/src/class/addClass.js +5 -10
- package/src/class/addClass.js.map +1 -0
- package/src/class/addClass.ts +11 -0
- package/src/class/hasClass.js +5 -10
- package/src/class/hasClass.js.map +1 -0
- package/src/class/hasClass.ts +11 -0
- package/src/class/removeClass.js +5 -10
- package/src/class/removeClass.js.map +1 -0
- package/src/class/removeClass.ts +11 -0
- package/src/event/off.js +5 -13
- package/src/event/off.js.map +1 -0
- package/src/event/off.ts +12 -0
- package/src/event/on.js +5 -13
- package/src/event/on.js.map +1 -0
- package/src/event/on.ts +12 -0
- package/src/event/one.js +13 -26
- package/src/event/one.js.map +1 -0
- package/src/event/one.ts +25 -0
- package/src/get/getBoundingClientRect.js +23 -33
- package/src/get/getBoundingClientRect.js.map +1 -0
- package/src/get/getBoundingClientRect.ts +38 -0
- package/src/get/getDocument.js +14 -11
- package/src/get/getDocument.js.map +1 -0
- package/src/get/getDocument.ts +23 -0
- package/src/get/getDocumentBody.js +6 -10
- package/src/get/getDocumentBody.js.map +1 -0
- package/src/get/getDocumentBody.ts +13 -0
- package/src/get/getDocumentElement.js +6 -11
- package/src/get/getDocumentElement.js.map +1 -0
- package/src/get/getDocumentElement.ts +13 -0
- package/src/get/getDocumentHead.js +6 -10
- package/src/get/getDocumentHead.js.map +1 -0
- package/src/get/getDocumentHead.ts +12 -0
- package/src/get/getElementAnimationDelay.js +12 -21
- package/src/get/getElementAnimationDelay.js.map +1 -0
- package/src/get/getElementAnimationDelay.ts +23 -0
- package/src/get/getElementAnimationDuration.js +12 -20
- package/src/get/getElementAnimationDuration.js.map +1 -0
- package/src/get/getElementAnimationDuration.ts +22 -0
- package/src/get/getElementStyle.js +8 -18
- package/src/get/getElementStyle.js.map +1 -0
- package/src/get/getElementStyle.ts +22 -0
- package/src/get/getElementTransitionDelay.js +12 -21
- package/src/get/getElementTransitionDelay.js.map +1 -0
- package/src/get/getElementTransitionDelay.ts +22 -0
- package/src/get/getElementTransitionDuration.js +12 -20
- package/src/get/getElementTransitionDuration.js.map +1 -0
- package/src/get/getElementTransitionDuration.ts +22 -0
- package/src/get/getNodeScroll.js +9 -16
- package/src/get/getNodeScroll.js.map +1 -0
- package/src/get/getNodeScroll.ts +20 -0
- package/src/get/getParentNode.js +13 -24
- package/src/get/getParentNode.js.map +1 -0
- package/src/get/getParentNode.ts +25 -0
- package/src/get/getRectRelativeToOffsetParent.js +21 -30
- package/src/get/getRectRelativeToOffsetParent.js.map +1 -0
- package/src/get/getRectRelativeToOffsetParent.ts +39 -0
- package/src/get/getUID.js +31 -34
- package/src/get/getUID.js.map +1 -0
- package/src/get/getUID.ts +36 -0
- package/src/get/getWindow.js +13 -20
- package/src/get/getWindow.js.map +1 -0
- package/src/get/getWindow.ts +22 -0
- package/src/index.js +411 -471
- package/src/index.js.map +1 -0
- package/src/index.ts +442 -0
- package/src/interface/boundingClientRect.js +2 -0
- package/src/interface/boundingClientRect.js.map +1 -0
- package/src/interface/boundingClientRect.ts +10 -0
- package/src/interface/navigatorUA.js +2 -0
- package/src/interface/navigatorUA.js.map +1 -0
- package/src/interface/navigatorUA.ts +15 -0
- package/src/interface/offsetRect.js +2 -0
- package/src/interface/offsetRect.js.map +1 -0
- package/src/interface/offsetRect.ts +6 -0
- package/src/interface/originalEvent.js +2 -0
- package/src/interface/originalEvent.js.map +1 -0
- package/src/interface/originalEvent.ts +3 -0
- package/src/is/isArray.js +3 -9
- package/src/is/isArray.js.map +1 -0
- package/src/is/isArray.ts +9 -0
- package/src/is/isCustomElement.js +3 -8
- package/src/is/isCustomElement.js.map +1 -0
- package/src/is/isCustomElement.ts +10 -0
- package/src/is/isDocument.js +3 -9
- package/src/is/isDocument.js.map +1 -0
- package/src/is/isDocument.ts +10 -0
- package/src/is/isElement.js +3 -9
- package/src/is/isElement.js.map +1 -0
- package/src/is/isElement.ts +22 -0
- package/src/is/isElementInScrollRange.js +12 -18
- package/src/is/isElementInScrollRange.js.map +1 -0
- package/src/is/isElementInScrollRange.ts +20 -0
- package/src/is/isElementInViewport.js +12 -22
- package/src/is/isElementInViewport.js.map +1 -0
- package/src/is/isElementInViewport.ts +20 -0
- package/src/is/isElementsArray.js +5 -10
- package/src/is/isElementsArray.js.map +1 -0
- package/src/is/isElementsArray.ts +13 -0
- package/src/is/isFunction.js +3 -9
- package/src/is/isFunction.js.map +1 -0
- package/src/is/isFunction.ts +10 -0
- package/src/is/isHTMLCollection.js +3 -8
- package/src/is/isHTMLCollection.js.map +1 -0
- package/src/is/isHTMLCollection.ts +10 -0
- package/src/is/isHTMLElement.js +3 -8
- package/src/is/isHTMLElement.js.map +1 -0
- package/src/is/isHTMLElement.ts +10 -0
- package/src/is/isHTMLImageElement.js +3 -8
- package/src/is/isHTMLImageElement.js.map +1 -0
- package/src/is/isHTMLImageElement.ts +9 -0
- package/src/is/isMedia.js +6 -12
- package/src/is/isMedia.js.map +1 -0
- package/src/is/isMedia.ts +16 -0
- package/src/is/isNode.js +3 -8
- package/src/is/isNode.js.map +1 -0
- package/src/is/isNode.ts +11 -0
- package/src/is/isNodeList.js +3 -8
- package/src/is/isNodeList.js.map +1 -0
- package/src/is/isNodeList.ts +11 -0
- package/src/is/isNumber.js +3 -0
- package/src/is/isNumber.js.map +1 -0
- package/src/is/isNumber.ts +9 -0
- package/src/is/isObject.js +3 -0
- package/src/is/isObject.js.map +1 -0
- package/src/is/isObject.ts +9 -0
- package/src/is/isRTL.js +4 -9
- package/src/is/isRTL.js.map +1 -0
- package/src/is/isRTL.ts +10 -0
- package/src/is/isSVGElement.js +3 -8
- package/src/is/isSVGElement.js.map +1 -0
- package/src/is/isSVGElement.ts +11 -0
- package/src/is/isScaledElement.js +10 -15
- package/src/is/isScaledElement.js.map +1 -0
- package/src/is/isScaledElement.ts +16 -0
- package/src/is/isShadowRoot.js +3 -12
- package/src/is/isShadowRoot.js.map +1 -0
- package/src/is/isShadowRoot.ts +10 -0
- package/src/is/isString.js +3 -8
- package/src/is/isString.js.map +1 -0
- package/src/is/isString.ts +9 -0
- package/src/is/isTableElement.js +3 -7
- package/src/is/isTableElement.js.map +1 -0
- package/src/is/isTableElement.ts +12 -0
- package/src/is/isWindow.js +3 -9
- package/src/is/isWindow.js.map +1 -0
- package/src/is/isWindow.ts +10 -0
- package/src/misc/ArrayFrom.js +3 -8
- package/src/misc/ArrayFrom.js.map +1 -0
- package/src/misc/ArrayFrom.ts +9 -0
- package/src/misc/Float32ArrayFrom.js +3 -7
- package/src/misc/Float32ArrayFrom.js.map +1 -0
- package/src/misc/Float32ArrayFrom.ts +9 -0
- package/src/misc/Float64ArrayFrom.js +3 -7
- package/src/misc/Float64ArrayFrom.js.map +1 -0
- package/src/misc/Float64ArrayFrom.ts +9 -0
- package/src/misc/ObjectAssign.js +3 -7
- package/src/misc/ObjectAssign.js.map +1 -0
- package/src/misc/ObjectAssign.ts +8 -0
- package/src/misc/ObjectEntries.js +3 -0
- package/src/misc/ObjectEntries.js.map +1 -0
- package/src/misc/ObjectEntries.ts +8 -0
- package/src/misc/ObjectKeys.js +3 -7
- package/src/misc/ObjectKeys.js.map +1 -0
- package/src/misc/ObjectKeys.ts +8 -0
- package/src/misc/ObjectValues.js +3 -7
- package/src/misc/ObjectValues.js.map +1 -0
- package/src/misc/ObjectValues.ts +8 -0
- package/src/misc/OriginalEvent.js +14 -18
- package/src/misc/OriginalEvent.js.map +1 -0
- package/src/misc/OriginalEvent.ts +24 -0
- package/src/misc/createElement.js +22 -25
- package/src/misc/createElement.js.map +1 -0
- package/src/misc/createElement.ts +36 -0
- package/src/misc/createElementNS.js +22 -26
- package/src/misc/createElementNS.js.map +1 -0
- package/src/misc/createElementNS.ts +41 -0
- package/src/misc/data.js +36 -78
- package/src/misc/data.js.map +1 -0
- package/src/misc/data.ts +79 -0
- package/src/misc/dispatchEvent.js +3 -8
- package/src/misc/dispatchEvent.js.map +1 -0
- package/src/misc/dispatchEvent.ts +9 -0
- package/src/misc/distinct.js +3 -10
- package/src/misc/distinct.js.map +1 -0
- package/src/misc/distinct.ts +17 -0
- package/src/misc/emulateAnimationEnd.js +29 -37
- package/src/misc/emulateAnimationEnd.js.map +1 -0
- package/src/misc/{emulateAnimationEndLegacy.js → emulateAnimationEnd.ts} +15 -12
- package/src/misc/emulateTransitionEnd.js +29 -37
- package/src/misc/emulateTransitionEnd.js.map +1 -0
- package/src/misc/{emulateTransitionEndLegacy.js → emulateTransitionEnd.ts} +15 -12
- package/src/misc/focus.js +3 -8
- package/src/misc/focus.js.map +1 -0
- package/src/misc/focus.ts +8 -0
- package/src/misc/noop.js +3 -3
- package/src/misc/noop.js.map +1 -0
- package/src/misc/noop.ts +4 -0
- package/src/misc/normalizeOptions.js +31 -49
- package/src/misc/normalizeOptions.js.map +1 -0
- package/src/misc/normalizeOptions.ts +51 -0
- package/src/misc/normalizeValue.js +17 -32
- package/src/misc/normalizeValue.js.map +1 -0
- package/src/misc/normalizeValue.ts +40 -0
- package/src/misc/passiveHandler.js +3 -7
- package/src/misc/passiveHandler.js.map +1 -0
- package/src/misc/passiveHandler.ts +6 -0
- package/src/misc/reflow.js +3 -9
- package/src/misc/reflow.js.map +1 -0
- package/src/misc/reflow.ts +9 -0
- package/src/misc/setElementStyle.js +16 -10
- package/src/misc/setElementStyle.js.map +1 -0
- package/src/misc/setElementStyle.ts +20 -0
- package/src/misc/timer.js +47 -78
- package/src/misc/timer.js.map +1 -0
- package/src/misc/timer.ts +74 -0
- package/src/misc/toLowerCase.js +3 -8
- package/src/misc/toLowerCase.js.map +1 -0
- package/src/misc/toLowerCase.ts +9 -0
- package/src/misc/toUpperCase.js +3 -8
- package/src/misc/toUpperCase.js.map +1 -0
- package/src/misc/toUpperCase.ts +9 -0
- package/src/selectors/closest.js +8 -16
- package/src/selectors/closest.js.map +1 -0
- package/src/selectors/closest.ts +20 -0
- package/src/selectors/getCustomElements.js +8 -17
- package/src/selectors/getCustomElements.js.map +1 -0
- package/src/selectors/getCustomElements.ts +18 -0
- package/src/selectors/getElementById.js +6 -11
- package/src/selectors/getElementById.js.map +1 -0
- package/src/selectors/getElementById.ts +16 -0
- package/src/selectors/getElementsByClassName.js +8 -14
- package/src/selectors/getElementsByClassName.js.map +1 -0
- package/src/selectors/getElementsByClassName.ts +22 -0
- package/src/selectors/getElementsByTagName.js +8 -14
- package/src/selectors/getElementsByTagName.js.map +1 -0
- package/src/selectors/getElementsByTagName.ts +20 -0
- package/src/selectors/matches.js +3 -10
- package/src/selectors/matches.js.map +1 -0
- package/src/selectors/matches.ts +10 -0
- package/src/selectors/querySelector.js +11 -17
- package/src/selectors/querySelector.js.map +1 -0
- package/src/selectors/querySelector.ts +21 -0
- package/src/selectors/querySelectorAll.js +8 -13
- package/src/selectors/querySelectorAll.js.map +1 -0
- package/src/selectors/querySelectorAll.ts +16 -0
- package/src/strings/DOMContentLoadedEvent.js +3 -6
- package/src/strings/DOMContentLoadedEvent.js.map +1 -0
- package/src/strings/DOMContentLoadedEvent.ts +5 -0
- package/src/strings/DOMMouseScrollEvent.js +3 -6
- package/src/strings/DOMMouseScrollEvent.js.map +1 -0
- package/src/strings/DOMMouseScrollEvent.ts +5 -0
- package/src/strings/abortEvent.js +3 -6
- package/src/strings/abortEvent.js.map +1 -0
- package/src/strings/abortEvent.ts +5 -0
- package/src/strings/addEventListener.js +3 -6
- package/src/strings/addEventListener.js.map +1 -0
- package/src/strings/addEventListener.ts +5 -0
- package/src/strings/animationDelay.js +3 -6
- package/src/strings/animationDelay.js.map +1 -0
- package/src/strings/animationDelay.ts +5 -0
- package/src/strings/animationDuration.js +3 -6
- package/src/strings/animationDuration.js.map +1 -0
- package/src/strings/animationDuration.ts +5 -0
- package/src/strings/animationEndEvent.js +3 -6
- package/src/strings/animationEndEvent.js.map +1 -0
- package/src/strings/animationEndEvent.ts +5 -0
- package/src/strings/animationName.js +3 -6
- package/src/strings/animationName.js.map +1 -0
- package/src/strings/animationName.ts +5 -0
- package/src/strings/ariaChecked.js +3 -6
- package/src/strings/ariaChecked.js.map +1 -0
- package/src/strings/ariaChecked.ts +5 -0
- package/src/strings/ariaDescribedBy.js +3 -6
- package/src/strings/ariaDescribedBy.js.map +1 -0
- package/src/strings/ariaDescribedBy.ts +5 -0
- package/src/strings/ariaDescription.js +3 -6
- package/src/strings/ariaDescription.js.map +1 -0
- package/src/strings/ariaDescription.ts +5 -0
- package/src/strings/ariaExpanded.js +3 -6
- package/src/strings/ariaExpanded.js.map +1 -0
- package/src/strings/ariaExpanded.ts +5 -0
- package/src/strings/ariaHasPopup.js +3 -6
- package/src/strings/ariaHasPopup.js.map +1 -0
- package/src/strings/ariaHasPopup.ts +5 -0
- package/src/strings/ariaHidden.js +3 -6
- package/src/strings/ariaHidden.js.map +1 -0
- package/src/strings/ariaHidden.ts +5 -0
- package/src/strings/ariaLabel.js +3 -6
- package/src/strings/ariaLabel.js.map +1 -0
- package/src/strings/ariaLabel.ts +5 -0
- package/src/strings/ariaLabelledBy.js +3 -6
- package/src/strings/ariaLabelledBy.js.map +1 -0
- package/src/strings/ariaLabelledBy.ts +5 -0
- package/src/strings/ariaModal.js +3 -6
- package/src/strings/ariaModal.js.map +1 -0
- package/src/strings/ariaModal.ts +5 -0
- package/src/strings/ariaPressed.js +3 -6
- package/src/strings/ariaPressed.js.map +1 -0
- package/src/strings/ariaPressed.ts +5 -0
- package/src/strings/ariaSelected.js +3 -6
- package/src/strings/ariaSelected.js.map +1 -0
- package/src/strings/ariaSelected.ts +5 -0
- package/src/strings/ariaValueMax.js +3 -6
- package/src/strings/ariaValueMax.js.map +1 -0
- package/src/strings/ariaValueMax.ts +5 -0
- package/src/strings/ariaValueMin.js +3 -6
- package/src/strings/ariaValueMin.js.map +1 -0
- package/src/strings/ariaValueMin.ts +5 -0
- package/src/strings/ariaValueNow.js +3 -6
- package/src/strings/ariaValueNow.js.map +1 -0
- package/src/strings/ariaValueNow.ts +5 -0
- package/src/strings/ariaValueText.js +3 -6
- package/src/strings/ariaValueText.js.map +1 -0
- package/src/strings/ariaValueText.ts +5 -0
- package/src/strings/beforeunloadEvent.js +3 -6
- package/src/strings/beforeunloadEvent.js.map +1 -0
- package/src/strings/beforeunloadEvent.ts +5 -0
- package/src/strings/bezierEasings.js +29 -33
- package/src/strings/bezierEasings.js.map +1 -0
- package/src/strings/bezierEasings.ts +32 -0
- package/src/strings/blurEvent.js +3 -6
- package/src/strings/blurEvent.js.map +1 -0
- package/src/strings/blurEvent.ts +5 -0
- package/src/strings/changeEvent.js +3 -6
- package/src/strings/changeEvent.js.map +1 -0
- package/src/strings/changeEvent.ts +5 -0
- package/src/strings/contextmenuEvent.js +3 -6
- package/src/strings/contextmenuEvent.js.map +1 -0
- package/src/strings/contextmenuEvent.ts +5 -0
- package/src/strings/errorEvent.js +3 -6
- package/src/strings/errorEvent.js.map +1 -0
- package/src/strings/errorEvent.ts +5 -0
- package/src/strings/focusEvent.js +3 -6
- package/src/strings/focusEvent.js.map +1 -0
- package/src/strings/focusEvent.ts +5 -0
- package/src/strings/focusEvents.js +3 -6
- package/src/strings/focusEvents.js.map +1 -0
- package/src/strings/focusEvents.ts +5 -0
- package/src/strings/focusinEvent.js +3 -6
- package/src/strings/focusinEvent.js.map +1 -0
- package/src/strings/focusinEvent.ts +5 -0
- package/src/strings/focusoutEvent.js +3 -6
- package/src/strings/focusoutEvent.js.map +1 -0
- package/src/strings/focusoutEvent.ts +5 -0
- package/src/strings/gesturechangeEvent.js +3 -6
- package/src/strings/gesturechangeEvent.js.map +1 -0
- package/src/strings/gesturechangeEvent.ts +5 -0
- package/src/strings/gestureendEvent.js +3 -6
- package/src/strings/gestureendEvent.js.map +1 -0
- package/src/strings/gestureendEvent.ts +5 -0
- package/src/strings/gesturestartEvent.js +3 -6
- package/src/strings/gesturestartEvent.js.map +1 -0
- package/src/strings/gesturestartEvent.ts +5 -0
- package/src/strings/keyAlt.js +3 -7
- package/src/strings/keyAlt.js.map +1 -0
- package/src/strings/keyAlt.ts +7 -0
- package/src/strings/keyArrowDown.js +3 -7
- package/src/strings/keyArrowDown.js.map +1 -0
- package/src/strings/keyArrowDown.ts +7 -0
- package/src/strings/keyArrowLeft.js +3 -7
- package/src/strings/keyArrowLeft.js.map +1 -0
- package/src/strings/keyArrowLeft.ts +7 -0
- package/src/strings/keyArrowRight.js +3 -7
- package/src/strings/keyArrowRight.js.map +1 -0
- package/src/strings/keyArrowRight.ts +7 -0
- package/src/strings/keyArrowUp.js +3 -7
- package/src/strings/keyArrowUp.js.map +1 -0
- package/src/strings/keyArrowUp.ts +7 -0
- package/src/strings/keyBackspace.js +3 -7
- package/src/strings/keyBackspace.js.map +1 -0
- package/src/strings/keyBackspace.ts +7 -0
- package/src/strings/keyCapsLock.js +3 -7
- package/src/strings/keyCapsLock.js.map +1 -0
- package/src/strings/keyCapsLock.ts +7 -0
- package/src/strings/keyControl.js +3 -7
- package/src/strings/keyControl.js.map +1 -0
- package/src/strings/keyControl.ts +7 -0
- package/src/strings/keyDelete.js +3 -7
- package/src/strings/keyDelete.js.map +1 -0
- package/src/strings/keyDelete.ts +7 -0
- package/src/strings/keyEnter.js +3 -7
- package/src/strings/keyEnter.js.map +1 -0
- package/src/strings/keyEnter.ts +7 -0
- package/src/strings/keyEscape.js +3 -7
- package/src/strings/keyEscape.js.map +1 -0
- package/src/strings/keyEscape.ts +7 -0
- package/src/strings/keyInsert.js +3 -7
- package/src/strings/keyInsert.js.map +1 -0
- package/src/strings/keyInsert.ts +7 -0
- package/src/strings/keyMeta.js +3 -7
- package/src/strings/keyMeta.js.map +1 -0
- package/src/strings/keyMeta.ts +7 -0
- package/src/strings/keyPause.js +3 -7
- package/src/strings/keyPause.js.map +1 -0
- package/src/strings/keyPause.ts +7 -0
- package/src/strings/keyScrollLock.js +3 -7
- package/src/strings/keyScrollLock.js.map +1 -0
- package/src/strings/keyScrollLock.ts +7 -0
- package/src/strings/keyShift.js +3 -7
- package/src/strings/keyShift.js.map +1 -0
- package/src/strings/keyShift.ts +7 -0
- package/src/strings/keySpace.js +3 -7
- package/src/strings/keySpace.js.map +1 -0
- package/src/strings/keySpace.ts +7 -0
- package/src/strings/keyTab.js +3 -7
- package/src/strings/keyTab.js.map +1 -0
- package/src/strings/keyTab.ts +7 -0
- package/src/strings/keyboardEventKeys.js +23 -27
- package/src/strings/keyboardEventKeys.js.map +1 -0
- package/src/strings/keyboardEventKeys.ts +26 -0
- package/src/strings/keydownEvent.js +3 -6
- package/src/strings/keydownEvent.js.map +1 -0
- package/src/strings/keydownEvent.ts +5 -0
- package/src/strings/keypressEvent.js +3 -6
- package/src/strings/keypressEvent.js.map +1 -0
- package/src/strings/keypressEvent.ts +5 -0
- package/src/strings/keyupEvent.js +3 -6
- package/src/strings/keyupEvent.js.map +1 -0
- package/src/strings/keyupEvent.ts +5 -0
- package/src/strings/loadEvent.js +3 -6
- package/src/strings/loadEvent.js.map +1 -0
- package/src/strings/loadEvent.ts +5 -0
- package/src/strings/loadstartEvent.js +3 -6
- package/src/strings/loadstartEvent.js.map +1 -0
- package/src/strings/loadstartEvent.ts +5 -0
- package/src/strings/mouseClickEvents.js +3 -6
- package/src/strings/mouseClickEvents.js.map +1 -0
- package/src/strings/mouseClickEvents.ts +5 -0
- package/src/strings/mouseHoverEvents.js +5 -6
- package/src/strings/mouseHoverEvents.js.map +1 -0
- package/src/strings/mouseHoverEvents.ts +8 -0
- package/src/strings/mouseSwipeEvents.js +8 -8
- package/src/strings/mouseSwipeEvents.js.map +1 -0
- package/src/strings/mouseSwipeEvents.ts +10 -0
- package/src/strings/mouseclickEvent.js +3 -6
- package/src/strings/mouseclickEvent.js.map +1 -0
- package/src/strings/mouseclickEvent.ts +5 -0
- package/src/strings/mousedblclickEvent.js +3 -6
- package/src/strings/mousedblclickEvent.js.map +1 -0
- package/src/strings/mousedblclickEvent.ts +5 -0
- package/src/strings/mousedownEvent.js +3 -6
- package/src/strings/mousedownEvent.js.map +1 -0
- package/src/strings/mousedownEvent.ts +5 -0
- package/src/strings/mouseenterEvent.js +3 -6
- package/src/strings/mouseenterEvent.js.map +1 -0
- package/src/strings/mouseenterEvent.ts +5 -0
- package/src/strings/mousehoverEvent.js +3 -6
- package/src/strings/mousehoverEvent.js.map +1 -0
- package/src/strings/mousehoverEvent.ts +5 -0
- package/src/strings/mouseinEvent.js +3 -6
- package/src/strings/mouseinEvent.js.map +1 -0
- package/src/strings/mouseinEvent.ts +5 -0
- package/src/strings/mouseleaveEvent.js +3 -6
- package/src/strings/mouseleaveEvent.js.map +1 -0
- package/src/strings/mouseleaveEvent.ts +5 -0
- package/src/strings/mousemoveEvent.js +3 -6
- package/src/strings/mousemoveEvent.js.map +1 -0
- package/src/strings/mousemoveEvent.ts +5 -0
- package/src/strings/mouseoutEvent.js +3 -6
- package/src/strings/mouseoutEvent.js.map +1 -0
- package/src/strings/mouseoutEvent.ts +5 -0
- package/src/strings/mouseoverEvent.js +3 -6
- package/src/strings/mouseoverEvent.js.map +1 -0
- package/src/strings/mouseoverEvent.ts +5 -0
- package/src/strings/mouseupEvent.js +3 -6
- package/src/strings/mouseupEvent.js.map +1 -0
- package/src/strings/mouseupEvent.ts +5 -0
- package/src/strings/mousewheelEvent.js +3 -6
- package/src/strings/mousewheelEvent.js.map +1 -0
- package/src/strings/mousewheelEvent.ts +5 -0
- package/src/strings/moveEvent.js +3 -6
- package/src/strings/moveEvent.js.map +1 -0
- package/src/strings/moveEvent.ts +5 -0
- package/src/strings/nativeEvents.js +104 -108
- package/src/strings/nativeEvents.js.map +1 -0
- package/src/strings/nativeEvents.ts +108 -0
- package/src/strings/offsetHeight.js +3 -6
- package/src/strings/offsetHeight.js.map +1 -0
- package/src/strings/offsetHeight.ts +5 -0
- package/src/strings/offsetWidth.js +3 -6
- package/src/strings/offsetWidth.js.map +1 -0
- package/src/strings/offsetWidth.ts +5 -0
- package/src/strings/orientationchangeEvent.js +3 -6
- package/src/strings/orientationchangeEvent.js.map +1 -0
- package/src/strings/orientationchangeEvent.ts +5 -0
- package/src/strings/pointercancelEvent.js +3 -6
- package/src/strings/pointercancelEvent.js.map +1 -0
- package/src/strings/pointercancelEvent.ts +5 -0
- package/src/strings/pointerdownEvent.js +3 -6
- package/src/strings/pointerdownEvent.js.map +1 -0
- package/src/strings/pointerdownEvent.ts +5 -0
- package/src/strings/pointerleaveEvent.js +3 -6
- package/src/strings/pointerleaveEvent.js.map +1 -0
- package/src/strings/pointerleaveEvent.ts +5 -0
- package/src/strings/pointermoveEvent.js +3 -6
- package/src/strings/pointermoveEvent.js.map +1 -0
- package/src/strings/pointermoveEvent.ts +5 -0
- package/src/strings/pointerupEvent.js +3 -6
- package/src/strings/pointerupEvent.js.map +1 -0
- package/src/strings/pointerupEvent.ts +5 -0
- package/src/strings/readystatechangeEvent.js +3 -6
- package/src/strings/readystatechangeEvent.js.map +1 -0
- package/src/strings/readystatechangeEvent.ts +5 -0
- package/src/strings/removeEventListener.js +3 -6
- package/src/strings/removeEventListener.js.map +1 -0
- package/src/strings/removeEventListener.ts +5 -0
- package/src/strings/resetEvent.js +3 -6
- package/src/strings/resetEvent.js.map +1 -0
- package/src/strings/resetEvent.ts +5 -0
- package/src/strings/resizeEvent.js +3 -6
- package/src/strings/resizeEvent.js.map +1 -0
- package/src/strings/resizeEvent.ts +5 -0
- package/src/strings/scrollEvent.js +3 -6
- package/src/strings/scrollEvent.js.map +1 -0
- package/src/strings/scrollEvent.ts +5 -0
- package/src/strings/scrollHeight.js +3 -6
- package/src/strings/scrollHeight.js.map +1 -0
- package/src/strings/scrollHeight.ts +5 -0
- package/src/strings/scrollWidth.js +3 -6
- package/src/strings/scrollWidth.js.map +1 -0
- package/src/strings/scrollWidth.ts +5 -0
- package/src/strings/selectEvent.js +3 -6
- package/src/strings/selectEvent.js.map +1 -0
- package/src/strings/selectEvent.ts +5 -0
- package/src/strings/selectendEvent.js +3 -6
- package/src/strings/selectendEvent.js.map +1 -0
- package/src/strings/selectendEvent.ts +5 -0
- package/src/strings/selectstartEvent.js +3 -6
- package/src/strings/selectstartEvent.js.map +1 -0
- package/src/strings/selectstartEvent.ts +5 -0
- package/src/strings/submitEvent.js +3 -6
- package/src/strings/submitEvent.js.map +1 -0
- package/src/strings/submitEvent.ts +5 -0
- package/src/strings/tabindex.js +3 -0
- package/src/strings/tabindex.js.map +1 -0
- package/src/strings/tabindex.ts +5 -0
- package/src/strings/touchEvents.js +8 -8
- package/src/strings/touchEvents.js.map +1 -0
- package/src/strings/touchEvents.ts +10 -0
- package/src/strings/touchcancelEvent.js +3 -6
- package/src/strings/touchcancelEvent.js.map +1 -0
- package/src/strings/touchcancelEvent.ts +5 -0
- package/src/strings/touchendEvent.js +3 -6
- package/src/strings/touchendEvent.js.map +1 -0
- package/src/strings/touchendEvent.ts +5 -0
- package/src/strings/touchmoveEvent.js +3 -6
- package/src/strings/touchmoveEvent.js.map +1 -0
- package/src/strings/touchmoveEvent.ts +5 -0
- package/src/strings/touchstartEvent.js +3 -6
- package/src/strings/touchstartEvent.js.map +1 -0
- package/src/strings/touchstartEvent.ts +5 -0
- package/src/strings/transitionDelay.js +3 -6
- package/src/strings/transitionDelay.js.map +1 -0
- package/src/strings/transitionDelay.ts +5 -0
- package/src/strings/transitionDuration.js +3 -6
- package/src/strings/transitionDuration.js.map +1 -0
- package/src/strings/transitionDuration.ts +5 -0
- package/src/strings/transitionEndEvent.js +3 -6
- package/src/strings/transitionEndEvent.js.map +1 -0
- package/src/strings/transitionEndEvent.ts +5 -0
- package/src/strings/transitionProperty.js +3 -7
- package/src/strings/transitionProperty.js.map +1 -0
- package/src/strings/transitionProperty.ts +5 -0
- package/src/strings/unloadEvent.js +3 -6
- package/src/strings/unloadEvent.js.map +1 -0
- package/src/strings/unloadEvent.ts +5 -0
- package/src/strings/userAgent.js +4 -7
- package/src/strings/userAgent.js.map +1 -0
- package/src/strings/userAgent.ts +7 -0
- package/src/strings/userAgentData.js +4 -8
- package/src/strings/userAgentData.js.map +1 -0
- package/src/strings/userAgentData.ts +9 -0
- package/types/attr/getAttribute.d.ts +3 -0
- package/types/attr/getAttribute.d.ts.map +1 -0
- package/types/attr/getAttributeNS.d.ts +3 -0
- package/types/attr/getAttributeNS.d.ts.map +1 -0
- package/types/attr/hasAttribute.d.ts +3 -0
- package/types/attr/hasAttribute.d.ts.map +1 -0
- package/types/attr/hasAttributeNS.d.ts +3 -0
- package/types/attr/hasAttributeNS.d.ts.map +1 -0
- package/types/attr/removeAttribute.d.ts +3 -0
- package/types/attr/removeAttribute.d.ts.map +1 -0
- package/types/attr/removeAttributeNS.d.ts +3 -0
- package/types/attr/removeAttributeNS.d.ts.map +1 -0
- package/types/attr/setAttribute.d.ts +3 -0
- package/types/attr/setAttribute.d.ts.map +1 -0
- package/types/attr/setAttributeNS.d.ts +3 -0
- package/types/attr/setAttributeNS.d.ts.map +1 -0
- package/types/blocks/documentBody.d.ts +3 -0
- package/types/blocks/documentBody.d.ts.map +1 -0
- package/types/blocks/documentElement.d.ts +3 -0
- package/types/blocks/documentElement.d.ts.map +1 -0
- package/types/blocks/documentHead.d.ts +3 -0
- package/types/blocks/documentHead.d.ts.map +1 -0
- package/types/boolean/isApple.d.ts +3 -0
- package/types/boolean/isApple.d.ts.map +1 -0
- package/types/boolean/isFirefox.d.ts +3 -0
- package/types/boolean/isFirefox.d.ts.map +1 -0
- package/types/boolean/isMobile.d.ts +3 -0
- package/types/boolean/isMobile.d.ts.map +1 -0
- package/types/boolean/support3DTransform.d.ts +3 -0
- package/types/boolean/support3DTransform.d.ts.map +1 -0
- package/types/boolean/supportAnimation.d.ts +3 -0
- package/types/boolean/supportAnimation.d.ts.map +1 -0
- package/types/boolean/supportPassive.d.ts +3 -0
- package/types/boolean/supportPassive.d.ts.map +1 -0
- package/types/boolean/supportTouch.d.ts +3 -0
- package/types/boolean/supportTouch.d.ts.map +1 -0
- package/types/boolean/supportTransform.d.ts +3 -0
- package/types/boolean/supportTransform.d.ts.map +1 -0
- package/types/boolean/supportTransition.d.ts +3 -0
- package/types/boolean/supportTransition.d.ts.map +1 -0
- package/types/class/addClass.d.ts +3 -0
- package/types/class/addClass.d.ts.map +1 -0
- package/types/class/hasClass.d.ts +3 -0
- package/types/class/hasClass.d.ts.map +1 -0
- package/types/class/removeClass.d.ts +3 -0
- package/types/class/removeClass.d.ts.map +1 -0
- package/types/event/off.d.ts +2 -0
- package/types/event/off.d.ts.map +1 -0
- package/types/event/on.d.ts +2 -0
- package/types/event/on.d.ts.map +1 -0
- package/types/event/one.d.ts +3 -0
- package/types/event/one.d.ts.map +1 -0
- package/types/get/getBoundingClientRect.d.ts +4 -0
- package/types/get/getBoundingClientRect.d.ts.map +1 -0
- package/types/get/getDocument.d.ts +3 -0
- package/types/get/getDocument.d.ts.map +1 -0
- package/types/get/getDocumentBody.d.ts +3 -0
- package/types/get/getDocumentBody.d.ts.map +1 -0
- package/types/get/getDocumentElement.d.ts +3 -0
- package/types/get/getDocumentElement.d.ts.map +1 -0
- package/types/get/getDocumentHead.d.ts +3 -0
- package/types/get/getDocumentHead.d.ts.map +1 -0
- package/types/get/getElementAnimationDelay.d.ts +3 -0
- package/types/get/getElementAnimationDelay.d.ts.map +1 -0
- package/types/get/getElementAnimationDuration.d.ts +3 -0
- package/types/get/getElementAnimationDuration.d.ts.map +1 -0
- package/types/get/getElementStyle.d.ts +3 -0
- package/types/get/getElementStyle.d.ts.map +1 -0
- package/types/get/getElementTransitionDelay.d.ts +3 -0
- package/types/get/getElementTransitionDelay.d.ts.map +1 -0
- package/types/get/getElementTransitionDuration.d.ts +3 -0
- package/types/get/getElementTransitionDuration.d.ts.map +1 -0
- package/types/get/getNodeScroll.d.ts +6 -0
- package/types/get/getNodeScroll.d.ts.map +1 -0
- package/types/get/getParentNode.d.ts +3 -0
- package/types/get/getParentNode.d.ts.map +1 -0
- package/types/get/getRectRelativeToOffsetParent.d.ts +7 -0
- package/types/get/getRectRelativeToOffsetParent.d.ts.map +1 -0
- package/types/get/getUID.d.ts +3 -0
- package/types/get/getUID.d.ts.map +1 -0
- package/types/get/getWindow.d.ts +3 -0
- package/types/get/getWindow.d.ts.map +1 -0
- package/types/index.d.ts +341 -250
- package/types/index.d.ts.map +1 -0
- package/types/interface/boundingClientRect.d.ts +11 -0
- package/types/interface/boundingClientRect.d.ts.map +1 -0
- package/types/interface/navigatorUA.d.ts +13 -0
- package/types/interface/navigatorUA.d.ts.map +1 -0
- package/types/interface/offsetRect.d.ts +7 -0
- package/types/interface/offsetRect.d.ts.map +1 -0
- package/types/interface/originalEvent.d.ts +4 -0
- package/types/interface/originalEvent.d.ts.map +1 -0
- package/types/is/isArray.d.ts +3 -0
- package/types/is/isArray.d.ts.map +1 -0
- package/types/is/isCustomElement.d.ts +5 -0
- package/types/is/isCustomElement.d.ts.map +1 -0
- package/types/is/isDocument.d.ts +3 -0
- package/types/is/isDocument.d.ts.map +1 -0
- package/types/is/isElement.d.ts +3 -0
- package/types/is/isElement.d.ts.map +1 -0
- package/types/is/isElementInScrollRange.d.ts +3 -0
- package/types/is/isElementInScrollRange.d.ts.map +1 -0
- package/types/is/isElementInViewport.d.ts +3 -0
- package/types/is/isElementInViewport.d.ts.map +1 -0
- package/types/is/isElementsArray.d.ts +3 -0
- package/types/is/isElementsArray.d.ts.map +1 -0
- package/types/is/isFunction.d.ts +3 -0
- package/types/is/isFunction.d.ts.map +1 -0
- package/types/is/isHTMLCollection.d.ts +3 -0
- package/types/is/isHTMLCollection.d.ts.map +1 -0
- package/types/is/isHTMLElement.d.ts +3 -0
- package/types/is/isHTMLElement.d.ts.map +1 -0
- package/types/is/isHTMLImageElement.d.ts +3 -0
- package/types/is/isHTMLImageElement.d.ts.map +1 -0
- package/types/is/isMedia.d.ts +3 -0
- package/types/is/isMedia.d.ts.map +1 -0
- package/types/is/isNode.d.ts +3 -0
- package/types/is/isNode.d.ts.map +1 -0
- package/types/is/isNodeList.d.ts +3 -0
- package/types/is/isNodeList.d.ts.map +1 -0
- package/types/is/isNumber.d.ts +3 -0
- package/types/is/isNumber.d.ts.map +1 -0
- package/types/is/isObject.d.ts +3 -0
- package/types/is/isObject.d.ts.map +1 -0
- package/types/is/isRTL.d.ts +3 -0
- package/types/is/isRTL.d.ts.map +1 -0
- package/types/is/isSVGElement.d.ts +3 -0
- package/types/is/isSVGElement.d.ts.map +1 -0
- package/types/is/isScaledElement.d.ts +2 -0
- package/types/is/isScaledElement.d.ts.map +1 -0
- package/types/is/isShadowRoot.d.ts +3 -0
- package/types/is/isShadowRoot.d.ts.map +1 -0
- package/types/is/isString.d.ts +3 -0
- package/types/is/isString.d.ts.map +1 -0
- package/types/is/isTableElement.d.ts +3 -0
- package/types/is/isTableElement.d.ts.map +1 -0
- package/types/is/isWindow.d.ts +3 -0
- package/types/is/isWindow.d.ts.map +1 -0
- package/types/misc/ArrayFrom.d.ts +3 -0
- package/types/misc/ArrayFrom.d.ts.map +1 -0
- package/types/misc/Float32ArrayFrom.d.ts +3 -0
- package/types/misc/Float32ArrayFrom.d.ts.map +1 -0
- package/types/misc/Float64ArrayFrom.d.ts +3 -0
- package/types/misc/Float64ArrayFrom.d.ts.map +1 -0
- package/types/misc/ObjectAssign.d.ts +3 -0
- package/types/misc/ObjectAssign.d.ts.map +1 -0
- package/types/misc/ObjectEntries.d.ts +3 -0
- package/types/misc/ObjectEntries.d.ts.map +1 -0
- package/types/misc/ObjectKeys.d.ts +3 -0
- package/types/misc/ObjectKeys.d.ts.map +1 -0
- package/types/misc/ObjectValues.d.ts +3 -0
- package/types/misc/ObjectValues.d.ts.map +1 -0
- package/types/misc/OriginalEvent.d.ts +4 -0
- package/types/misc/OriginalEvent.d.ts.map +1 -0
- package/types/misc/createElement.d.ts +3 -0
- package/types/misc/createElement.d.ts.map +1 -0
- package/types/misc/createElementNS.d.ts +3 -0
- package/types/misc/createElementNS.d.ts.map +1 -0
- package/types/misc/data.d.ts +9 -0
- package/types/misc/data.d.ts.map +1 -0
- package/types/misc/dispatchEvent.d.ts +3 -0
- package/types/misc/dispatchEvent.d.ts.map +1 -0
- package/types/misc/distinct.d.ts +3 -0
- package/types/misc/distinct.d.ts.map +1 -0
- package/types/misc/emulateAnimationEnd.d.ts +3 -0
- package/types/misc/emulateAnimationEnd.d.ts.map +1 -0
- package/types/misc/emulateTransitionEnd.d.ts +3 -0
- package/types/misc/emulateTransitionEnd.d.ts.map +1 -0
- package/types/misc/focus.d.ts +3 -0
- package/types/misc/focus.d.ts.map +1 -0
- package/types/misc/noop.d.ts +3 -0
- package/types/misc/noop.d.ts.map +1 -0
- package/types/misc/normalizeOptions.d.ts +3 -0
- package/types/misc/normalizeOptions.d.ts.map +1 -0
- package/types/misc/normalizeValue.d.ts +3 -0
- package/types/misc/normalizeValue.d.ts.map +1 -0
- package/types/misc/passiveHandler.d.ts +3 -0
- package/types/misc/passiveHandler.d.ts.map +1 -0
- package/types/misc/reflow.d.ts +3 -0
- package/types/misc/reflow.d.ts.map +1 -0
- package/types/misc/setElementStyle.d.ts +3 -0
- package/types/misc/setElementStyle.d.ts.map +1 -0
- package/types/misc/timer.d.ts +7 -0
- package/types/misc/timer.d.ts.map +1 -0
- package/types/misc/toLowerCase.d.ts +3 -0
- package/types/misc/toLowerCase.d.ts.map +1 -0
- package/types/misc/toUpperCase.d.ts +3 -0
- package/types/misc/toUpperCase.d.ts.map +1 -0
- package/types/selectors/closest.d.ts +3 -0
- package/types/selectors/closest.d.ts.map +1 -0
- package/types/selectors/getCustomElements.d.ts +3 -0
- package/types/selectors/getCustomElements.d.ts.map +1 -0
- package/types/selectors/getElementById.d.ts +3 -0
- package/types/selectors/getElementById.d.ts.map +1 -0
- package/types/selectors/getElementsByClassName.d.ts +3 -0
- package/types/selectors/getElementsByClassName.d.ts.map +1 -0
- package/types/selectors/getElementsByTagName.d.ts +3 -0
- package/types/selectors/getElementsByTagName.d.ts.map +1 -0
- package/types/selectors/matches.d.ts +3 -0
- package/types/selectors/matches.d.ts.map +1 -0
- package/types/selectors/querySelector.d.ts +3 -0
- package/types/selectors/querySelector.d.ts.map +1 -0
- package/types/selectors/querySelectorAll.d.ts +3 -0
- package/types/selectors/querySelectorAll.d.ts.map +1 -0
- package/types/strings/DOMContentLoadedEvent.d.ts +3 -0
- package/types/strings/DOMContentLoadedEvent.d.ts.map +1 -0
- package/types/strings/DOMMouseScrollEvent.d.ts +3 -0
- package/types/strings/DOMMouseScrollEvent.d.ts.map +1 -0
- package/types/strings/abortEvent.d.ts +3 -0
- package/types/strings/abortEvent.d.ts.map +1 -0
- package/types/strings/addEventListener.d.ts +3 -0
- package/types/strings/addEventListener.d.ts.map +1 -0
- package/types/strings/animationDelay.d.ts +3 -0
- package/types/strings/animationDelay.d.ts.map +1 -0
- package/types/strings/animationDuration.d.ts +3 -0
- package/types/strings/animationDuration.d.ts.map +1 -0
- package/types/strings/animationEndEvent.d.ts +3 -0
- package/types/strings/animationEndEvent.d.ts.map +1 -0
- package/types/strings/animationName.d.ts +3 -0
- package/types/strings/animationName.d.ts.map +1 -0
- package/types/strings/ariaChecked.d.ts +3 -0
- package/types/strings/ariaChecked.d.ts.map +1 -0
- package/types/strings/ariaDescribedBy.d.ts +3 -0
- package/types/strings/ariaDescribedBy.d.ts.map +1 -0
- package/types/strings/ariaDescription.d.ts +3 -0
- package/types/strings/ariaDescription.d.ts.map +1 -0
- package/types/strings/ariaExpanded.d.ts +3 -0
- package/types/strings/ariaExpanded.d.ts.map +1 -0
- package/types/strings/ariaHasPopup.d.ts +3 -0
- package/types/strings/ariaHasPopup.d.ts.map +1 -0
- package/types/strings/ariaHidden.d.ts +3 -0
- package/types/strings/ariaHidden.d.ts.map +1 -0
- package/types/strings/ariaLabel.d.ts +3 -0
- package/types/strings/ariaLabel.d.ts.map +1 -0
- package/types/strings/ariaLabelledBy.d.ts +3 -0
- package/types/strings/ariaLabelledBy.d.ts.map +1 -0
- package/types/strings/ariaModal.d.ts +3 -0
- package/types/strings/ariaModal.d.ts.map +1 -0
- package/types/strings/ariaPressed.d.ts +3 -0
- package/types/strings/ariaPressed.d.ts.map +1 -0
- package/types/strings/ariaSelected.d.ts +3 -0
- package/types/strings/ariaSelected.d.ts.map +1 -0
- package/types/strings/ariaValueMax.d.ts +3 -0
- package/types/strings/ariaValueMax.d.ts.map +1 -0
- package/types/strings/ariaValueMin.d.ts +3 -0
- package/types/strings/ariaValueMin.d.ts.map +1 -0
- package/types/strings/ariaValueNow.d.ts +3 -0
- package/types/strings/ariaValueNow.d.ts.map +1 -0
- package/types/strings/ariaValueText.d.ts +3 -0
- package/types/strings/ariaValueText.d.ts.map +1 -0
- package/types/strings/beforeunloadEvent.d.ts +3 -0
- package/types/strings/beforeunloadEvent.d.ts.map +1 -0
- package/types/strings/bezierEasings.d.ts +29 -0
- package/types/strings/bezierEasings.d.ts.map +1 -0
- package/types/strings/blurEvent.d.ts +3 -0
- package/types/strings/blurEvent.d.ts.map +1 -0
- package/types/strings/changeEvent.d.ts +3 -0
- package/types/strings/changeEvent.d.ts.map +1 -0
- package/types/strings/contextmenuEvent.d.ts +3 -0
- package/types/strings/contextmenuEvent.d.ts.map +1 -0
- package/types/strings/errorEvent.d.ts +3 -0
- package/types/strings/errorEvent.d.ts.map +1 -0
- package/types/strings/focusEvent.d.ts +3 -0
- package/types/strings/focusEvent.d.ts.map +1 -0
- package/types/strings/focusEvents.d.ts +6 -0
- package/types/strings/focusEvents.d.ts.map +1 -0
- package/types/strings/focusinEvent.d.ts +3 -0
- package/types/strings/focusinEvent.d.ts.map +1 -0
- package/types/strings/focusoutEvent.d.ts +3 -0
- package/types/strings/focusoutEvent.d.ts.map +1 -0
- package/types/strings/gesturechangeEvent.d.ts +3 -0
- package/types/strings/gesturechangeEvent.d.ts.map +1 -0
- package/types/strings/gestureendEvent.d.ts +3 -0
- package/types/strings/gestureendEvent.d.ts.map +1 -0
- package/types/strings/gesturestartEvent.d.ts +3 -0
- package/types/strings/gesturestartEvent.d.ts.map +1 -0
- package/types/strings/keyAlt.d.ts +3 -0
- package/types/strings/keyAlt.d.ts.map +1 -0
- package/types/strings/keyArrowDown.d.ts +3 -0
- package/types/strings/keyArrowDown.d.ts.map +1 -0
- package/types/strings/keyArrowLeft.d.ts +3 -0
- package/types/strings/keyArrowLeft.d.ts.map +1 -0
- package/types/strings/keyArrowRight.d.ts +3 -0
- package/types/strings/keyArrowRight.d.ts.map +1 -0
- package/types/strings/keyArrowUp.d.ts +3 -0
- package/types/strings/keyArrowUp.d.ts.map +1 -0
- package/types/strings/keyBackspace.d.ts +3 -0
- package/types/strings/keyBackspace.d.ts.map +1 -0
- package/types/strings/keyCapsLock.d.ts +3 -0
- package/types/strings/keyCapsLock.d.ts.map +1 -0
- package/types/strings/keyControl.d.ts +3 -0
- package/types/strings/keyControl.d.ts.map +1 -0
- package/types/strings/keyDelete.d.ts +3 -0
- package/types/strings/keyDelete.d.ts.map +1 -0
- package/types/strings/keyEnter.d.ts +3 -0
- package/types/strings/keyEnter.d.ts.map +1 -0
- package/types/strings/keyEscape.d.ts +3 -0
- package/types/strings/keyEscape.d.ts.map +1 -0
- package/types/strings/keyInsert.d.ts +3 -0
- package/types/strings/keyInsert.d.ts.map +1 -0
- package/types/strings/keyMeta.d.ts +3 -0
- package/types/strings/keyMeta.d.ts.map +1 -0
- package/types/strings/keyPause.d.ts +3 -0
- package/types/strings/keyPause.d.ts.map +1 -0
- package/types/strings/keyScrollLock.d.ts +3 -0
- package/types/strings/keyScrollLock.d.ts.map +1 -0
- package/types/strings/keyShift.d.ts +3 -0
- package/types/strings/keyShift.d.ts.map +1 -0
- package/types/strings/keySpace.d.ts +3 -0
- package/types/strings/keySpace.d.ts.map +1 -0
- package/types/strings/keyTab.d.ts +3 -0
- package/types/strings/keyTab.d.ts.map +1 -0
- package/types/strings/keyboardEventKeys.d.ts +23 -0
- package/types/strings/keyboardEventKeys.d.ts.map +1 -0
- package/types/strings/keydownEvent.d.ts +3 -0
- package/types/strings/keydownEvent.d.ts.map +1 -0
- package/types/strings/keypressEvent.d.ts +3 -0
- package/types/strings/keypressEvent.d.ts.map +1 -0
- package/types/strings/keyupEvent.d.ts +3 -0
- package/types/strings/keyupEvent.d.ts.map +1 -0
- package/types/strings/loadEvent.d.ts +3 -0
- package/types/strings/loadEvent.d.ts.map +1 -0
- package/types/strings/loadstartEvent.d.ts +3 -0
- package/types/strings/loadstartEvent.d.ts.map +1 -0
- package/types/strings/mouseClickEvents.d.ts +6 -0
- package/types/strings/mouseClickEvents.d.ts.map +1 -0
- package/types/strings/mouseHoverEvents.d.ts +3 -0
- package/types/strings/mouseHoverEvents.d.ts.map +1 -0
- package/types/strings/mouseSwipeEvents.d.ts +8 -0
- package/types/strings/mouseSwipeEvents.d.ts.map +1 -0
- package/types/strings/mouseclickEvent.d.ts +3 -0
- package/types/strings/mouseclickEvent.d.ts.map +1 -0
- package/types/strings/mousedblclickEvent.d.ts +3 -0
- package/types/strings/mousedblclickEvent.d.ts.map +1 -0
- package/types/strings/mousedownEvent.d.ts +3 -0
- package/types/strings/mousedownEvent.d.ts.map +1 -0
- package/types/strings/mouseenterEvent.d.ts +3 -0
- package/types/strings/mouseenterEvent.d.ts.map +1 -0
- package/types/strings/mousehoverEvent.d.ts +3 -0
- package/types/strings/mousehoverEvent.d.ts.map +1 -0
- package/types/strings/mouseinEvent.d.ts +3 -0
- package/types/strings/mouseinEvent.d.ts.map +1 -0
- package/types/strings/mouseleaveEvent.d.ts +3 -0
- package/types/strings/mouseleaveEvent.d.ts.map +1 -0
- package/types/strings/mousemoveEvent.d.ts +3 -0
- package/types/strings/mousemoveEvent.d.ts.map +1 -0
- package/types/strings/mouseoutEvent.d.ts +3 -0
- package/types/strings/mouseoutEvent.d.ts.map +1 -0
- package/types/strings/mouseoverEvent.d.ts +3 -0
- package/types/strings/mouseoverEvent.d.ts.map +1 -0
- package/types/strings/mouseupEvent.d.ts +3 -0
- package/types/strings/mouseupEvent.d.ts.map +1 -0
- package/types/strings/mousewheelEvent.d.ts +3 -0
- package/types/strings/mousewheelEvent.d.ts.map +1 -0
- package/types/strings/moveEvent.d.ts +3 -0
- package/types/strings/moveEvent.d.ts.map +1 -0
- package/types/strings/nativeEvents.d.ts +54 -0
- package/types/strings/nativeEvents.d.ts.map +1 -0
- package/types/strings/offsetHeight.d.ts +3 -0
- package/types/strings/offsetHeight.d.ts.map +1 -0
- package/types/strings/offsetWidth.d.ts +3 -0
- package/types/strings/offsetWidth.d.ts.map +1 -0
- package/types/strings/orientationchangeEvent.d.ts +3 -0
- package/types/strings/orientationchangeEvent.d.ts.map +1 -0
- package/types/strings/pointercancelEvent.d.ts +3 -0
- package/types/strings/pointercancelEvent.d.ts.map +1 -0
- package/types/strings/pointerdownEvent.d.ts +3 -0
- package/types/strings/pointerdownEvent.d.ts.map +1 -0
- package/types/strings/pointerleaveEvent.d.ts +3 -0
- package/types/strings/pointerleaveEvent.d.ts.map +1 -0
- package/types/strings/pointermoveEvent.d.ts +3 -0
- package/types/strings/pointermoveEvent.d.ts.map +1 -0
- package/types/strings/pointerupEvent.d.ts +3 -0
- package/types/strings/pointerupEvent.d.ts.map +1 -0
- package/types/strings/readystatechangeEvent.d.ts +3 -0
- package/types/strings/readystatechangeEvent.d.ts.map +1 -0
- package/types/strings/removeEventListener.d.ts +3 -0
- package/types/strings/removeEventListener.d.ts.map +1 -0
- package/types/strings/resetEvent.d.ts +3 -0
- package/types/strings/resetEvent.d.ts.map +1 -0
- package/types/strings/resizeEvent.d.ts +3 -0
- package/types/strings/resizeEvent.d.ts.map +1 -0
- package/types/strings/scrollEvent.d.ts +3 -0
- package/types/strings/scrollEvent.d.ts.map +1 -0
- package/types/strings/scrollHeight.d.ts +3 -0
- package/types/strings/scrollHeight.d.ts.map +1 -0
- package/types/strings/scrollWidth.d.ts +3 -0
- package/types/strings/scrollWidth.d.ts.map +1 -0
- package/types/strings/selectEvent.d.ts +3 -0
- package/types/strings/selectEvent.d.ts.map +1 -0
- package/types/strings/selectendEvent.d.ts +3 -0
- package/types/strings/selectendEvent.d.ts.map +1 -0
- package/types/strings/selectstartEvent.d.ts +3 -0
- package/types/strings/selectstartEvent.d.ts.map +1 -0
- package/types/strings/submitEvent.d.ts +3 -0
- package/types/strings/submitEvent.d.ts.map +1 -0
- package/types/strings/tabindex.d.ts +3 -0
- package/types/strings/tabindex.d.ts.map +1 -0
- package/types/strings/touchEvents.d.ts +8 -0
- package/types/strings/touchEvents.d.ts.map +1 -0
- package/types/strings/touchcancelEvent.d.ts +3 -0
- package/types/strings/touchcancelEvent.d.ts.map +1 -0
- package/types/strings/touchendEvent.d.ts +3 -0
- package/types/strings/touchendEvent.d.ts.map +1 -0
- package/types/strings/touchmoveEvent.d.ts +3 -0
- package/types/strings/touchmoveEvent.d.ts.map +1 -0
- package/types/strings/touchstartEvent.d.ts +3 -0
- package/types/strings/touchstartEvent.d.ts.map +1 -0
- package/types/strings/transitionDelay.d.ts +3 -0
- package/types/strings/transitionDelay.d.ts.map +1 -0
- package/types/strings/transitionDuration.d.ts +3 -0
- package/types/strings/transitionDuration.d.ts.map +1 -0
- package/types/strings/transitionEndEvent.d.ts +3 -0
- package/types/strings/transitionEndEvent.d.ts.map +1 -0
- package/types/strings/transitionProperty.d.ts +3 -0
- package/types/strings/transitionProperty.d.ts.map +1 -0
- package/types/strings/unloadEvent.d.ts +3 -0
- package/types/strings/unloadEvent.d.ts.map +1 -0
- package/types/strings/userAgent.d.ts +3 -0
- package/types/strings/userAgent.d.ts.map +1 -0
- package/types/strings/userAgentData.d.ts +4 -0
- package/types/strings/userAgentData.d.ts.map +1 -0
- package/dist/shorty.esm.js +0 -2527
- package/dist/shorty.esm.min.js +0 -2
- package/dist/shorty.js +0 -2550
- package/dist/shorty.min.js +0 -2
- package/src/get/getElementAnimationDelayLegacy.js +0 -21
- package/src/get/getElementAnimationDurationLegacy.js +0 -21
- package/src/get/getElementTransitionDelayLegacy.js +0 -21
- package/src/get/getElementTransitionDurationLegacy.js +0 -21
- package/src/misc/passiveHandlerLegacy.js +0 -9
- package/src/misc/tryWrapper.js +0 -11
- package/src/misc/version.js +0 -9
- package/src/selectors/documentAll.js +0 -8
- package/src/selectors/matchesLegacy.js +0 -23
- package/src/strings/animationDelayLegacy.js +0 -8
- package/src/strings/animationDurationLegacy.js +0 -8
- package/src/strings/animationEndEventLegacy.js +0 -8
- package/src/strings/animationNameLegacy.js +0 -8
- package/src/strings/transitionDelayLegacy.js +0 -8
- package/src/strings/transitionDurationLegacy.js +0 -8
- package/src/strings/transitionEndEventLegacy.js +0 -8
- package/src/strings/transitionPropertyLegacy.js +0 -12
- package/types/module/shorty.ts +0 -247
- package/types/shorty.d.ts +0 -2292
package/README.md
CHANGED
|
@@ -1,26 +1,33 @@
|
|
|
1
|
-
# shorty
|
|
1
|
+
# shorty
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://coveralls.io/github/thednp/shorty)
|
|
4
|
+
[](https://github.com/thednp/shorty/actions/workflows/ci.yml)
|
|
5
|
+
[](https://www.npmjs.com/package/@thednp/shorty)
|
|
6
|
+
[](http://npm-stat.com/charts.html?package=@thednp/shorty)
|
|
7
|
+
[](https://www.jsdelivr.com/package/npm/@thednp/shorty)
|
|
8
|
+

|
|
9
|
+

|
|
4
10
|
|
|
5
|
-
|
|
6
|
-
[](http://npm-stat.com/charts.html?package=shorty)
|
|
7
|
-
[](https://www.jsdelivr.com/package/npm/shorty)
|
|
11
|
+
A small TypeScript library with various tools, all ESLint valid and featuring everything useful for creating light libraries or web components. If there is anything that is consistently repeating itself, **shorty** can help you save up to 50% of the code required, with little to no performance cost.
|
|
8
12
|
|
|
9
|
-
**shorty** is featured in [KUTE.js](https://github.com/thednp/kute.js), [BSN](https://github.com/thednp/bootstrap.native), [Navbar.js](https://github.com/thednp/navbar.js) and other libraries.
|
|
13
|
+
**shorty** is featured in [ColorPicker](https://github.com/thednp/color-picker), [KUTE.js](https://github.com/thednp/kute.js), [BSN](https://github.com/thednp/bootstrap.native), [Navbar.js](https://github.com/thednp/navbar.js) and other libraries.
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
- The purpose of the library is to speed up the development workflow, minimize the size of larger libraries by providing a shorter syntax for most used JavaScript API methods, most used strings or other helpful utilities.
|
|
16
|
+
- Another excellent use for the library is for its selectors in a testing environment where you need to check the `instanceof` for various objects.
|
|
17
|
+
- While the library comes with a working build in the `dist` folder, that is mainly for build consistency testing. You can make use of "tree shaking" to import one or anything your code needs.
|
|
18
|
+
- On that note, all shorties are organized in folders inside the `src` root folder, the structure is key to understanding the purpose of each type of shortie, whether we have `boolean` for various basic browser detection or browser feature support, `attr` for all things _Element_ attributes or `strings` for most common and most used _Element.prototype_ methods.
|
|
14
19
|
|
|
15
20
|
# npm
|
|
21
|
+
|
|
16
22
|
```
|
|
17
23
|
npm install @thednp/shorty
|
|
18
24
|
```
|
|
19
25
|
|
|
20
|
-
# ES6+ Base usage
|
|
26
|
+
# TypeScript / ES6+ Base usage
|
|
27
|
+
|
|
21
28
|
```js
|
|
22
29
|
// import the tool you need
|
|
23
|
-
import { supportTransform } from
|
|
30
|
+
import { supportTransform } from "@thednp/shorty";
|
|
24
31
|
|
|
25
32
|
// use the tool in your ES6/ES7 sources
|
|
26
33
|
if (supportTransform) {
|
|
@@ -29,159 +36,155 @@ if (supportTransform) {
|
|
|
29
36
|
```
|
|
30
37
|
|
|
31
38
|
# attr
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
|
|
40
|
+
- **_getAttribute_** - returns the value of a specified _Element_ attribute;
|
|
41
|
+
- **_getAttributeNS_** - returns the value of a specified namespaced _Element_ attribute (eg: namespaced SVG attributes);
|
|
42
|
+
- **_hasAttribute_** - check if element has a specified attribute;
|
|
43
|
+
- **_hasAttributeNS_** - check if element has a specified namespaced attribute;
|
|
44
|
+
- **_removeAttribute_** - removes a specified attribute from an element;
|
|
45
|
+
- **_removeAttributeNS_** - removes a specified namespaced attribute from an element;
|
|
46
|
+
- **_setAttribute_** - set a new attribute value for a given element;
|
|
47
|
+
- **_setAttributeNS_** - set a new namespaced attribute value for a given element;
|
|
48
|
+
|
|
49
|
+
```js
|
|
42
50
|
// EXAMPLES
|
|
43
|
-
import { getAttribute, hasAttribute, setAttribute } from
|
|
51
|
+
import { getAttribute, hasAttribute, setAttribute } from "@thednp/shorty";
|
|
44
52
|
|
|
45
53
|
// check target has certain attribute
|
|
46
|
-
if (!hasAttribute(myTarget,
|
|
47
|
-
setAttribute(myTarget,
|
|
54
|
+
if (!hasAttribute(myTarget, "attribute-name")) {
|
|
55
|
+
setAttribute(myTarget, "attribute-name", "new-value");
|
|
48
56
|
}
|
|
49
57
|
|
|
50
58
|
// get attribute value
|
|
51
|
-
const currentAttrValue = getAttribute(myTarget,
|
|
59
|
+
const currentAttrValue = getAttribute(myTarget, "attribute-name");
|
|
52
60
|
```
|
|
53
61
|
|
|
54
|
-
|
|
55
62
|
# blocks
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
63
|
+
|
|
64
|
+
- **_documentBody_** - a shortie for `document.body`;
|
|
65
|
+
- **_documentElement_** - a shortie for `document.documentElement`;
|
|
66
|
+
- **_documentHead_** - a shortie for `document.head`;
|
|
59
67
|
|
|
60
68
|
# boolean
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
|
|
70
|
+
- **_isApple_** - checks and preserves a `boolean` value for the client browser is either Apple **Safari** browser or not;
|
|
71
|
+
- **_isFirefox_** - checks and preserves a `boolean` value for the client browser is either **Firefox** or not;
|
|
72
|
+
- **_isMobile_** - checks and preserves a `boolean` value for the client browser is either a Mobile device or not;
|
|
73
|
+
- **_support3DTransform_** - checks and preserves a `boolean` value for the client browser capability for webKit `perspective`;
|
|
74
|
+
- **_supportTouch_** - checks and preserves a `boolean` value for the client browser capability for `touch` events;
|
|
75
|
+
- **_supportPassive_** - checks and preserves a `boolean` value for the client browser capability for `passive` event option;
|
|
76
|
+
- **_supportTransform_** - checks and preserves a `boolean` value for the client browser capability for webKit `transform`;
|
|
77
|
+
- **_supportAnimation_** - checks and preserves a `boolean` value for the client browser capability for webKit keyframe `animation`;
|
|
78
|
+
- **_supportTransition_** - checks and preserves a `boolean` value for the client browser capability for webKit `transition`;
|
|
79
|
+
|
|
80
|
+
```js
|
|
72
81
|
// EXAMPLES
|
|
73
|
-
import { support3DTransform } from
|
|
82
|
+
import { support3DTransform } from "@thednp/shorty";
|
|
74
83
|
|
|
75
84
|
// filter myAction to supported browsers
|
|
76
85
|
if (support3DTransform) {
|
|
77
86
|
// do something with modern browsers
|
|
78
87
|
}
|
|
79
88
|
```
|
|
80
|
-
|
|
89
|
+
|
|
81
90
|
# class
|
|
82
|
-
* ***addClass*** - add a class to a target *Element*;
|
|
83
|
-
* ***removeClass*** - remove a class from a target *Element*;
|
|
84
|
-
* ***hasClass*** - checks the existence of a class for a target *Element*;
|
|
85
91
|
|
|
86
|
-
|
|
92
|
+
- **_addClass_** - add a class to a target _Element_;
|
|
93
|
+
- **_removeClass_** - remove a class from a target _Element_;
|
|
94
|
+
- **_hasClass_** - checks the existence of a class for a target _Element_;
|
|
95
|
+
|
|
96
|
+
```js
|
|
87
97
|
// EXAMPLES
|
|
88
|
-
import { addClass, removeClass, hasClass } from
|
|
98
|
+
import { addClass, removeClass, hasClass } from "@thednp/shorty";
|
|
89
99
|
|
|
90
100
|
// add a class
|
|
91
|
-
addClass(targetElement,
|
|
101
|
+
addClass(targetElement, "className");
|
|
92
102
|
|
|
93
103
|
// remove a class
|
|
94
|
-
removeClass(targetElement,
|
|
104
|
+
removeClass(targetElement, "className");
|
|
95
105
|
|
|
96
106
|
// check for a class
|
|
97
|
-
if (hasClass(targetElement,
|
|
107
|
+
if (hasClass(targetElement, "className")) {
|
|
98
108
|
// do something about that
|
|
99
109
|
}
|
|
100
110
|
```
|
|
101
111
|
|
|
102
112
|
# event
|
|
103
|
-
* ***on*** - attach an event listener to a specific target *Element*;
|
|
104
|
-
* ***off*** - detach an event listener from a specific target *Element*;
|
|
105
|
-
* ***one*** - attach an event listener to a specific target *Element*, and detach when complete;
|
|
106
113
|
|
|
107
|
-
|
|
114
|
+
- **_on_** - attach an event listener to a specific target _Element_;
|
|
115
|
+
- **_off_** - detach an event listener from a specific target _Element_;
|
|
116
|
+
- **_one_** - attach an event listener to a specific target _Element_, and detach when complete;
|
|
117
|
+
|
|
118
|
+
```js
|
|
108
119
|
// EXAMPLES
|
|
109
|
-
import { on, off, one, passiveHandler } from
|
|
120
|
+
import { on, off, one, passiveHandler } from "@thednp/shorty";
|
|
110
121
|
|
|
111
122
|
// attach a passive mousedown eventHandler
|
|
112
|
-
on(targetElement,
|
|
123
|
+
on(targetElement, "click", eventHandler, passiveHandler);
|
|
113
124
|
|
|
114
125
|
// detach a passive mouseup eventHandler
|
|
115
|
-
off(targetElement,
|
|
126
|
+
off(targetElement, "mouseup", eventHandler, passiveHandler);
|
|
116
127
|
|
|
117
128
|
// attach a single instance passive touchstart eventHandler
|
|
118
|
-
one(targetElement,
|
|
129
|
+
one(targetElement, "touchstart", eventHandler, passiveHandler);
|
|
119
130
|
```
|
|
120
131
|
|
|
121
132
|
For a more advanced method to handle event listeners, I recommend using the [event-listener.js](github.com/thednp/event-listener.js).
|
|
122
133
|
|
|
123
|
-
|
|
124
134
|
# get
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
* ***getWindow*** - returns the containing `Window` for a given *Element* or just any *Window*;
|
|
144
|
-
|
|
145
|
-
```js
|
|
135
|
+
|
|
136
|
+
- **_getBoundingClientRect_** - returns the bounding client rectangle of a given _Element_;
|
|
137
|
+
- **_getDocument_** - returns the containing `#Document` for a given _Element_ or just any _Document_, useful when working with *iframe*s;
|
|
138
|
+
- **_getDocumentBody_** - returns the containing `<body>` for a given _Element_ or just any;
|
|
139
|
+
- **_getDocumentElement_** - returns the containing `<html>` for a given _Element_ or just any;
|
|
140
|
+
- **_getDocumentHead_** - returns the containing `<head>` for a given _Element_ or just any;
|
|
141
|
+
- **_getElementAnimationDelay_** - returns the `animationDelay` property of an `animation` property;
|
|
142
|
+
- **_getElementAnimationDuration_** - returns the `animationDuration` property of a `animation` property;
|
|
143
|
+
- **_getElementTransitionDelay_** - returns the `transitionDelay` property of a `transition` property;
|
|
144
|
+
- **_getElementTransitionDuration_** - returns the `transitionDuration` property of a `transition` property;
|
|
145
|
+
- **_getElementStyle_** - returns the _Element_ computed style for a given property;
|
|
146
|
+
- **_getNodeScroll_** - returns the _Element_ / _Window_ current `{ x, y }` scroll position;
|
|
147
|
+
- **_getParentNode_** - returns parent of a given _Element_;
|
|
148
|
+
- **_getRectRelativeToOffsetParent_** - returns the bounding client rectangle of a given _Element_ relative to a given `offsetParent`;
|
|
149
|
+
- **_getUID_** - a nice utility that creates a unique ID for a given _Element_ and returns it;
|
|
150
|
+
- **_getWindow_** - returns the containing `Window` for a given _Element_ or just any _Window_;
|
|
151
|
+
|
|
152
|
+
```js
|
|
146
153
|
// EXAMPLES
|
|
147
|
-
import {
|
|
148
|
-
getElementAnimationDuration,
|
|
149
|
-
getElementAnimationDurationLegacy,
|
|
150
|
-
} from '@thednp/shorty'
|
|
154
|
+
import { getElementAnimationDuration } from "@thednp/shorty";
|
|
151
155
|
|
|
152
156
|
// store the transition duration for target element on a modern browser
|
|
153
157
|
const duration = getElementAnimationDuration(target);
|
|
154
|
-
|
|
155
|
-
// or do the same with legacy browser fallback
|
|
156
|
-
const duration = getElementAnimationDurationLegacy(target);
|
|
157
158
|
```
|
|
158
159
|
|
|
159
160
|
# is
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
161
|
+
|
|
162
|
+
- **_isArray_** - check if a given value is an `Array`;
|
|
163
|
+
- **_isCustomElement_** - check if a given value is a `CustomElement` instance;
|
|
164
|
+
- **_isDocument_** - check if a given value is a `Document` instance;
|
|
165
|
+
- **_isElement_** - check if a given value is an `Element` instance;
|
|
166
|
+
- **_isElementInScrollRange_** - check if a given `Element` is partially visible in the viewport;
|
|
167
|
+
- **_isElementInViewport_** - check if a given `Element` is fully visible in the viewport;
|
|
168
|
+
- **_isElementsArray_** - check if a given value is an `Array` with `Element` instances;
|
|
169
|
+
- **_isFunction_** - check if a given value is a `Function` instance;
|
|
170
|
+
- **_isHTMLCollection_** - check if a given value is an `HTMLCollection` instance;
|
|
171
|
+
- **_isHTMLElement_** - check if a given value is an `HTMLElement` instance;
|
|
172
|
+
- **_isHTMLImageElement_** - check if a given value is an `HTMLImageElement` instance;
|
|
173
|
+
- **_isMedia_** - check if a given value is an `SVGElement`, `HTMLImageElement` or `HTMLVideoElement` instance;
|
|
174
|
+
- **_isNode_** - check if a given value is a `Node` instance;
|
|
175
|
+
- **_isNodeList_** - check if a given value is a `NodeList` instance;
|
|
176
|
+
- **_isNumber_** - check if a given value is string;
|
|
177
|
+
- **_isRTL_** - check if a given node is contained in a `<html dir="rtl">`;
|
|
178
|
+
- **_isScaledElement_** - check if a given _Element_ is affected by scale;
|
|
179
|
+
- **_isShadowRoot_** - check if a given _Node_ is a `ShadowRoot` instance;
|
|
180
|
+
- **_isString_** - check if a given value is string;
|
|
181
|
+
- **_isSVGElement_** - check if a given value is `SVGElement` instance;
|
|
182
|
+
- **_isTableElement_** - check if a given value is `<table>`, `<td>` or `<th>` _Element_;
|
|
183
|
+
- **_isWindow_** - check if a given value is a `Window` instance;
|
|
184
|
+
|
|
185
|
+
```js
|
|
183
186
|
// EXAMPLES
|
|
184
|
-
import { isArray,
|
|
187
|
+
import { isArray, isHTMLElement, isElementsArray } from "@thednp/shorty";
|
|
185
188
|
|
|
186
189
|
// check if a value is an `Array` of `Element` instances
|
|
187
190
|
if (isArray(myValue) && myValue.every(isHTMLElement)) {
|
|
@@ -195,40 +198,38 @@ if (isElementsArray(myValue)) {
|
|
|
195
198
|
```
|
|
196
199
|
|
|
197
200
|
# misc
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
201
|
+
|
|
202
|
+
- **_ArrayFrom_** - a shortie for `Array.from()` method;
|
|
203
|
+
- **_Data_** - a small utility to store web components data that makes use of the native `Map`;
|
|
204
|
+
- **_dispatchEvent_** - a shortie for `Element.dispatchEvent()` method;
|
|
205
|
+
- **_distinct_** - a shortie you can use to filter duplicate values in an `Array`;
|
|
206
|
+
- **_emulateAnimationEnd_** - utility to execute a callback function when `animationend` event is triggered, or execute the callback right after for legacy browsers;
|
|
207
|
+
- **_emulateAnimationEndLegacy_** - for legacy browsers;
|
|
208
|
+
- **_emulateTransitionEnd_** - utility to execute a callback function when `transitionend` event is triggered, or execute the callback right after for legacy browsers;
|
|
209
|
+
- **_emulateTransitionEndLegacy_** - for legacy browsers;
|
|
210
|
+
- **_Float32ArrayFrom_** - a shortie for `Float32Array.from()` method;
|
|
211
|
+
- **_Float64ArrayFrom_** - a shortie for `Float64Array.from()` method;
|
|
212
|
+
- **_focus_** - a shortie for `Element.focus()` method;
|
|
213
|
+
- **_noop_** - is your regular `() => {}` NOOP;
|
|
214
|
+
- **_normalizeOptions_** - a cool utility to normalize and crosscheck JavaScript options and their DATA API counterparts for various web components; supports namespaced options like `data-NAMESPACE-option="value"`; priority: JavaScript options > DATA API options > default options
|
|
215
|
+
- **_ObjectAssign_** - a shortie for `Object.assign()` method;
|
|
216
|
+
- **_ObjectEntries_** - a shortie for `Object.entries()` method;
|
|
217
|
+
- **_ObjectKeys_** - a shortie for `Object.keys()` method;
|
|
218
|
+
- **_ObjectValues_** - a shortie for `Object.values()` method;
|
|
219
|
+
- **_OriginalEvent_** - a small utility that returns a synthetic `CustomEvent` with the added `relatedTarget` and other properties;
|
|
220
|
+
- **_passiveHandler_** - a constant that preserves a standard listener `options` with `passive: true` event option used;
|
|
221
|
+
- **_passiveHandlerLegacy_** - for legacy browsers;
|
|
222
|
+
- **_reflow_** - a small utility that force repaint of a given _Element_ by "checking" its `offsetHeight` value, also because using just `element.offsetHeight;` won't validate on ESLint;
|
|
223
|
+
- **_setElementStyle_** - a small utility that allows you to set multiple CSS properties at once for a given _Element_ target;
|
|
224
|
+
- **_Timer_** - a small but powerful utility that makes `setTimeout` have a meaning;
|
|
225
|
+
- **_toLowerCase_** - a shortie for `String.toLowerCase()` method;
|
|
226
|
+
- **_toUpperCase_** - a shortie for `String.toUpperCase()` method;
|
|
227
|
+
|
|
228
|
+
The **_Data_** and **_Timer_** utilities have their own specifics, you might want to check the [wiki](https://github.com/thednp/shorty/wiki).
|
|
229
|
+
|
|
230
|
+
```js
|
|
227
231
|
// EXAMPLES
|
|
228
|
-
import {
|
|
229
|
-
emulateTransitionEnd,
|
|
230
|
-
distinct,
|
|
231
|
-
} from '@thednp/shorty';
|
|
232
|
+
import { emulateTransitionEnd, distinct } from "@thednp/shorty";
|
|
232
233
|
|
|
233
234
|
// execute a callback when transitionend is triggered for the target
|
|
234
235
|
emulateTransitionEnd(targetElement, callback);
|
|
@@ -243,61 +244,54 @@ const array3 = [...array1, ...array2].filter(distinct);
|
|
|
243
244
|
```
|
|
244
245
|
|
|
245
246
|
# selectors
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
```js
|
|
247
|
+
|
|
248
|
+
- **_closest_** - a shortie for `Element.closest()` method;
|
|
249
|
+
- **_getCustomElements_** - returns an `Array` with all registered `CustomElement`;
|
|
250
|
+
- **_getElementById_** - a shortie for `document.getElementById()` method;
|
|
251
|
+
- **_getElementsByClassName_** - a shortie for `Element.getElementsByClassName()` method;
|
|
252
|
+
- **_getElementsByTagName_** - a shortie for `Element.getElementsByTagName()` method;
|
|
253
|
+
- **_matches_** - a shortie for `Element.matches()` method;
|
|
254
|
+
- **_matchesLegacy_** - for legacy browsers;
|
|
255
|
+
- **_querySelector_** - a simple utility to check if a given value is an _Element_ or a selector string, and if a selector string find the FIRST _Element_ and return it;
|
|
256
|
+
- **_querySelectorAll_** - a simple utility to check if a certain item is an _Element_ or a selector string, and if a selector string find the FIRST _Element_ and return it;
|
|
257
|
+
|
|
258
|
+
```js
|
|
258
259
|
// EXAMPLES
|
|
259
|
-
import { querySelector, querySelectorAll, documentAll, matches } from
|
|
260
|
+
import { querySelector, querySelectorAll, documentAll, matches } from "@thednp/shorty";
|
|
260
261
|
|
|
261
262
|
// get first element that matches a certain selector
|
|
262
|
-
const element = querySelector(
|
|
263
|
+
const element = querySelector(".my-class-name");
|
|
263
264
|
|
|
264
265
|
// get all elements that matches same selector
|
|
265
|
-
const elements = querySelectorAll(
|
|
266
|
+
const elements = querySelectorAll(".my-class-name");
|
|
266
267
|
|
|
267
268
|
// now do the same as the above, but differently
|
|
268
|
-
const elements = [...documentAll].filter((x) => matches(x,
|
|
269
|
+
const elements = [...documentAll].filter((x) => matches(x, ".my-class-name"));
|
|
269
270
|
```
|
|
270
271
|
|
|
271
272
|
# strings
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
* ***transitionDelayLegacy*** - for legacy browsers fallback;
|
|
289
|
-
* ***transitionEndEvent*** - preserves the `transitionend` event name for modern browsers;
|
|
290
|
-
* ***transitionEndEventLegacy*** - for legacy browsers fallback;
|
|
291
|
-
* ***transitionProperty*** - preserves the `transitionProperty` property name for modern browsers;
|
|
292
|
-
* ***transitionPropertyLegacy*** - for legacy browsers fallback;
|
|
293
|
-
* ***addEventListener*** - preserves the `addEventListener` method name;
|
|
294
|
-
* ***removeEventListener*** - preserves the `removeEventListener` method name;
|
|
273
|
+
|
|
274
|
+
- **_bezierEasings_** - an _Object_ comprised or a set of valid CSS `transition-timing-function` based on Cubic Bezier; EG: `cubic-bezier(0.215,0.61,0.355,1)` for `bezierEasings.easingCubicOut`;
|
|
275
|
+
- **_mouseSwipeEvents_** - preserves the pointer events from mouse actions: start: `mousedown`, end: `mouseup`, move: `mousemove`, cancel: `mouseout`;
|
|
276
|
+
- **_mouseClickEvents_** - preserves the pointer events from mouse actions: down: `mousedown`, up: `mouseup`;
|
|
277
|
+
- **_mouseHoverEvents_** - preserve browser specific mouse hover events: `mouseenter` and `mouseleave` OR `mouseover` and `mouseout`;
|
|
278
|
+
- **_touchEvents_** - preserves the pointer events from touch actions: start: `touchstart`, end: `touchend`, move: `touchmove`, cancel: `touchcancel`;
|
|
279
|
+
- **_animationDuration_** - preserves the `animationDuration` property for modern browsers;
|
|
280
|
+
- **_animationDelay_** - preserves the `animationDelay` property for modern browsers;
|
|
281
|
+
- **_animationEndEvent_** - preserves the `animationEndEvent` event for modern browsers;
|
|
282
|
+
- **_animationName_** - preserves the `animationName` property name for modern browsers;
|
|
283
|
+
- **_transitionDuration_** - preserves the `transitionDuration` property name for modern browsers;
|
|
284
|
+
- **_transitionDelay_** - preserves the `transitionDelay` property name for modern browsers;
|
|
285
|
+
- **_transitionEndEvent_** - preserves the `transitionend` event name for modern browsers;
|
|
286
|
+
- **_transitionProperty_** - preserves the `transitionProperty` property name for modern browsers;
|
|
287
|
+
- **_addEventListener_** - preserves the `addEventListener` method name;
|
|
288
|
+
- **_removeEventListener_** - preserves the `removeEventListener` method name;
|
|
295
289
|
|
|
296
290
|
There are lots more string constants available which include native event names, browser strings, keyboard key codes or ARIA specific attribute names. Be sure to check the `src/strings` folder for a complete list.
|
|
297
291
|
|
|
298
|
-
```js
|
|
292
|
+
```js
|
|
299
293
|
// EXAMPLES
|
|
300
|
-
import {on, off, one, mouseClickEvents, touchEvents, passiveHandler} from
|
|
294
|
+
import { on, off, one, mouseClickEvents, touchEvents, passiveHandler } from "@thednp/shorty";
|
|
301
295
|
|
|
302
296
|
// attach a passive mousedown eventHandler
|
|
303
297
|
on(targetElement, mouseClickEvents.down, eventHandler, passiveHandler);
|
|
@@ -310,32 +304,34 @@ one(targetElement, touchEvents.start, eventHandler, passiveHandler);
|
|
|
310
304
|
```
|
|
311
305
|
|
|
312
306
|
# Advanced Use
|
|
313
|
-
|
|
307
|
+
|
|
308
|
+
Here's a simple example to showcase the benefit of using **_shorty_**.
|
|
314
309
|
|
|
315
310
|
```js
|
|
316
311
|
// This is your typical day to day scripting
|
|
317
|
-
const target = document.getElementById(
|
|
312
|
+
const target = document.getElementById("my-element");
|
|
318
313
|
|
|
319
|
-
target.addEventListener(
|
|
320
|
-
target.classList.add(
|
|
321
|
-
})
|
|
314
|
+
target.addEventListener("click", function (e) {
|
|
315
|
+
target.classList.add("my-className");
|
|
316
|
+
});
|
|
322
317
|
```
|
|
323
318
|
|
|
324
319
|
Now make it all shorty. You might want to import shorties directly from their location, something we like to call "tree shaking".
|
|
320
|
+
|
|
325
321
|
```js
|
|
326
322
|
// Example
|
|
327
|
-
import on from
|
|
328
|
-
import addClass from
|
|
329
|
-
import getElementById from
|
|
330
|
-
import mouseclickEvent from
|
|
323
|
+
import on from "@thednp/shorty/src/event/on";
|
|
324
|
+
import addClass from "@thednp/shorty/src/class/addClass";
|
|
325
|
+
import getElementById from "@thednp/shorty/src/selectors/getElementById";
|
|
326
|
+
import mouseclickEvent from "@thednp/shorty/src/strings/mouseclickEvent";
|
|
331
327
|
|
|
332
|
-
const target = getElementById(
|
|
328
|
+
const target = getElementById("my-element");
|
|
333
329
|
|
|
334
|
-
on(target, mouseclickEvent, function(e) {
|
|
335
|
-
addClass(target,
|
|
336
|
-
})
|
|
330
|
+
on(target, mouseclickEvent, function (e) {
|
|
331
|
+
addClass(target, "my-className");
|
|
332
|
+
});
|
|
337
333
|
```
|
|
338
334
|
|
|
339
|
-
|
|
340
335
|
# License
|
|
336
|
+
|
|
341
337
|
**shorty** is released under the [MIT License](https://github.com/thednp/shorty/blob/master/LICENSE)
|