@thednp/shorty 2.0.0-alpha2 → 2.0.0-alpha21
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/.eslintrc.cjs +224 -0
- package/.lgtm.yml +8 -0
- package/.prettierrc.json +15 -0
- package/README.md +9 -3
- package/cypress/e2e/att.cy.ts +46 -0
- package/cypress/e2e/boolean.cy.ts +44 -0
- package/cypress/e2e/class.cy.ts +28 -0
- package/cypress/e2e/event.cy.ts +51 -0
- package/cypress/e2e/get.cy.ts +168 -0
- package/cypress/e2e/is.cy.ts +233 -0
- package/cypress/e2e/misc.cy.ts +354 -0
- package/cypress/e2e/selectors.cy.ts +85 -0
- package/cypress/fixtures/custom-elem.js +18 -0
- package/cypress/plugins/esbuild-istanbul.ts +50 -0
- package/cypress/plugins/tsCompile.ts +34 -0
- package/cypress/support/commands.ts +37 -0
- package/cypress/support/e2e.ts +21 -0
- package/cypress/support/index.js +22 -0
- package/cypress/test.html +63 -0
- package/cypress.config.ts +30 -0
- package/dist/shorty.cjs +2 -0
- package/dist/shorty.cjs.map +1 -0
- package/dist/shorty.d.ts +1700 -0
- package/dist/shorty.js +1 -1566
- package/dist/shorty.js.map +1 -7
- package/dist/shorty.mjs +669 -0
- package/dist/shorty.mjs.map +1 -0
- package/dts.config.ts +22 -0
- package/package.json +72 -68
- package/src/attr/getAttribute.ts +1 -0
- package/src/attr/getAttributeNS.ts +1 -0
- package/src/attr/hasAttribute.ts +1 -0
- package/src/attr/hasAttributeNS.ts +1 -0
- package/src/attr/removeAttribute.ts +1 -0
- package/src/attr/removeAttributeNS.ts +1 -0
- package/src/attr/setAttribute.ts +1 -0
- package/src/attr/setAttributeNS.ts +1 -0
- package/src/boolean/isApple.ts +3 -3
- package/src/boolean/isFirefox.ts +2 -2
- package/src/boolean/isMobile.ts +3 -3
- package/src/boolean/support3DTransform.ts +2 -4
- package/src/boolean/supportAnimation.ts +2 -2
- package/src/boolean/supportPassive.ts +6 -5
- package/src/boolean/supportTouch.ts +1 -1
- package/src/boolean/supportTransform.ts +2 -2
- package/src/boolean/supportTransition.ts +2 -2
- package/src/event/off.ts +9 -7
- package/src/event/on.ts +9 -7
- package/src/event/one.ts +8 -7
- package/src/get/getBoundingClientRect.ts +4 -3
- package/src/get/getDocument.ts +8 -7
- package/src/get/getDocumentBody.ts +1 -1
- package/src/get/getDocumentElement.ts +1 -1
- package/src/get/getDocumentHead.ts +2 -2
- package/src/get/getElementAnimationDelay.ts +5 -5
- package/src/get/getElementAnimationDuration.ts +5 -5
- package/src/get/getElementStyle.ts +8 -7
- package/src/get/getElementTransitionDelay.ts +7 -5
- package/src/get/getElementTransitionDuration.ts +7 -5
- package/src/get/getParentNode.ts +2 -1
- package/src/get/getRectRelativeToOffsetParent.ts +3 -2
- package/src/get/getUID.ts +3 -3
- package/src/get/getWindow.ts +5 -4
- package/src/index.ts +37 -5
- package/src/interface/{boundingClientRect.ts → boundingClientRect.d.ts} +10 -10
- package/src/interface/css4Declaration.d.ts +4 -0
- package/src/interface/{customElement.ts → customElement.d.ts} +8 -8
- package/src/interface/event.d.ts +247 -0
- package/src/interface/{navigatorUA.ts → navigatorUA.d.ts} +15 -15
- package/src/interface/{offsetRect.ts → offsetRect.d.ts} +6 -6
- package/src/interface/originalEvent.d.ts +4 -0
- package/src/is/isArray.ts +1 -1
- package/src/is/isCanvas.ts +4 -2
- package/src/is/isCustomElement.ts +4 -3
- package/src/is/isDocument.ts +4 -1
- package/src/is/isElement.ts +8 -3
- package/src/is/isElementInScrollRange.ts +3 -3
- package/src/is/isElementInViewport.ts +3 -3
- package/src/is/isElementsArray.ts +3 -3
- package/src/is/isFunction.ts +2 -2
- package/src/is/isHTMLCollection.ts +4 -2
- package/src/is/isHTMLElement.ts +5 -2
- package/src/is/isHTMLImageElement.ts +5 -2
- package/src/is/isJSON.ts +20 -0
- package/src/is/isMap.ts +11 -8
- package/src/is/isMedia.ts +6 -4
- package/src/is/isNode.ts +9 -3
- package/src/is/isNodeList.ts +4 -2
- package/src/is/isNumber.ts +1 -1
- package/src/is/isObject.ts +2 -1
- package/src/is/isRTL.ts +3 -2
- package/src/is/isSVGElement.ts +4 -2
- package/src/is/isScaledElement.ts +7 -4
- package/src/is/isShadowRoot.ts +4 -2
- package/src/is/isString.ts +1 -1
- package/src/is/isTableElement.ts +4 -2
- package/src/is/isWeakMap.ts +11 -9
- package/src/is/isWindow.ts +4 -1
- package/src/misc/Float32ArrayFrom.ts +1 -0
- package/src/misc/Float64ArrayFrom.ts +1 -0
- package/src/misc/ObjectAssign.ts +35 -3
- package/src/misc/ObjectEntries.ts +4 -1
- package/src/misc/ObjectFromEntries.ts +11 -0
- package/src/misc/ObjectHasOwn.ts +17 -0
- package/src/misc/ObjectKeys.ts +3 -1
- package/src/misc/ObjectValues.ts +4 -1
- package/src/misc/{OriginalEvent.ts → createCustomEvent.ts} +10 -6
- package/src/misc/createElement.ts +9 -14
- package/src/misc/createElementNS.ts +15 -19
- package/src/misc/data.ts +21 -19
- package/src/misc/distinct.ts +1 -0
- package/src/misc/emulateAnimationEnd.ts +4 -4
- package/src/misc/emulateTransitionEnd.ts +4 -4
- package/src/misc/getInstance.ts +9 -0
- package/src/misc/noop.ts +3 -1
- package/src/misc/normalizeOptions.ts +6 -6
- package/src/misc/normalizeValue.ts +8 -8
- package/src/misc/setElementStyle.ts +7 -5
- package/src/misc/timer.ts +16 -13
- package/src/selectors/getCustomElements.ts +2 -1
- package/src/selectors/getElementsByClassName.ts +2 -2
- package/src/selectors/getElementsByTagName.ts +3 -3
- package/src/selectors/querySelector.ts +5 -4
- 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 +5 -0
- package/src/strings/dragendEvent.ts +5 -0
- package/src/strings/dragenterEvent.ts +5 -0
- package/src/strings/dragleaveEvent.ts +5 -0
- package/src/strings/dragoverEvent.ts +5 -0
- package/src/strings/dragstartEvent.ts +5 -0
- 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 +7 -0
- 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 -3
- 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/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 +2 -2
- package/tsconfig.json +30 -0
- package/vite.config.ts +30 -0
- package/dist/shorty.cjs.js +0 -1592
- package/dist/shorty.cjs.js.map +0 -7
- package/dist/shorty.cjs.min.js +0 -3
- package/dist/shorty.cjs.min.js.map +0 -7
- package/dist/shorty.es5.js +0 -1593
- package/dist/shorty.es5.js.map +0 -7
- package/dist/shorty.es5.min.js +0 -4
- package/dist/shorty.es5.min.js.map +0 -7
- package/dist/shorty.min.js +0 -3
- package/dist/shorty.min.js.map +0 -7
- package/src/attr/getAttribute.js +0 -2
- package/src/attr/getAttribute.js.map +0 -1
- package/src/attr/getAttributeNS.js +0 -2
- package/src/attr/getAttributeNS.js.map +0 -1
- package/src/attr/hasAttribute.js +0 -2
- package/src/attr/hasAttribute.js.map +0 -1
- package/src/attr/hasAttributeNS.js +0 -2
- package/src/attr/hasAttributeNS.js.map +0 -1
- package/src/attr/removeAttribute.js +0 -2
- package/src/attr/removeAttribute.js.map +0 -1
- package/src/attr/removeAttributeNS.js +0 -2
- package/src/attr/removeAttributeNS.js.map +0 -1
- package/src/attr/setAttribute.js +0 -2
- package/src/attr/setAttribute.js.map +0 -1
- package/src/attr/setAttributeNS.js +0 -2
- package/src/attr/setAttributeNS.js.map +0 -1
- package/src/blocks/documentBody.js +0 -2
- package/src/blocks/documentBody.js.map +0 -1
- package/src/blocks/documentElement.js +0 -2
- package/src/blocks/documentElement.js.map +0 -1
- package/src/blocks/documentHead.js +0 -2
- package/src/blocks/documentHead.js.map +0 -1
- package/src/boolean/isApple.js +0 -7
- package/src/boolean/isApple.js.map +0 -1
- package/src/boolean/isFirefox.js +0 -3
- package/src/boolean/isFirefox.js.map +0 -1
- package/src/boolean/isMobile.js +0 -12
- package/src/boolean/isMobile.js.map +0 -1
- package/src/boolean/support3DTransform.js +0 -3
- package/src/boolean/support3DTransform.js.map +0 -1
- package/src/boolean/supportAnimation.js +0 -3
- package/src/boolean/supportAnimation.js.map +0 -1
- package/src/boolean/supportPassive.js +0 -18
- package/src/boolean/supportPassive.js.map +0 -1
- package/src/boolean/supportTouch.js +0 -2
- package/src/boolean/supportTouch.js.map +0 -1
- package/src/boolean/supportTransform.js +0 -3
- package/src/boolean/supportTransform.js.map +0 -1
- package/src/boolean/supportTransition.js +0 -3
- package/src/boolean/supportTransition.js.map +0 -1
- package/src/class/addClass.js +0 -4
- package/src/class/addClass.js.map +0 -1
- package/src/class/hasClass.js +0 -4
- package/src/class/hasClass.js.map +0 -1
- package/src/class/removeClass.js +0 -4
- package/src/class/removeClass.js.map +0 -1
- package/src/event/off.js +0 -4
- package/src/event/off.js.map +0 -1
- package/src/event/on.js +0 -4
- package/src/event/on.js.map +0 -1
- package/src/event/one.js +0 -12
- package/src/event/one.js.map +0 -1
- package/src/get/getBoundingClientRect.js +0 -22
- package/src/get/getBoundingClientRect.js.map +0 -1
- package/src/get/getDocument.js +0 -13
- package/src/get/getDocument.js.map +0 -1
- package/src/get/getDocumentBody.js +0 -5
- package/src/get/getDocumentBody.js.map +0 -1
- package/src/get/getDocumentElement.js +0 -5
- package/src/get/getDocumentElement.js.map +0 -1
- package/src/get/getDocumentHead.js +0 -5
- package/src/get/getDocumentHead.js.map +0 -1
- package/src/get/getElementAnimationDelay.js +0 -11
- package/src/get/getElementAnimationDelay.js.map +0 -1
- package/src/get/getElementAnimationDuration.js +0 -11
- package/src/get/getElementAnimationDuration.js.map +0 -1
- package/src/get/getElementStyle.js +0 -7
- package/src/get/getElementStyle.js.map +0 -1
- package/src/get/getElementTransitionDelay.js +0 -11
- package/src/get/getElementTransitionDelay.js.map +0 -1
- package/src/get/getElementTransitionDuration.js +0 -11
- package/src/get/getElementTransitionDuration.js.map +0 -1
- package/src/get/getNodeScroll.js +0 -8
- package/src/get/getNodeScroll.js.map +0 -1
- package/src/get/getParentNode.js +0 -14
- package/src/get/getParentNode.js.map +0 -1
- package/src/get/getRectRelativeToOffsetParent.js +0 -20
- package/src/get/getRectRelativeToOffsetParent.js.map +0 -1
- package/src/get/getUID.js +0 -31
- package/src/get/getUID.js.map +0 -1
- package/src/get/getWindow.js +0 -12
- package/src/get/getWindow.js.map +0 -1
- package/src/index.js +0 -416
- package/src/index.js.map +0 -1
- package/src/interface/boundingClientRect.js +0 -1
- package/src/interface/boundingClientRect.js.map +0 -1
- package/src/interface/css4Declaration.js +0 -1
- package/src/interface/css4Declaration.js.map +0 -1
- package/src/interface/css4Declaration.ts +0 -3
- package/src/interface/customElement.js +0 -1
- package/src/interface/customElement.js.map +0 -1
- package/src/interface/navigatorUA.js +0 -1
- package/src/interface/navigatorUA.js.map +0 -1
- package/src/interface/offsetRect.js +0 -1
- package/src/interface/offsetRect.js.map +0 -1
- package/src/interface/originalEvent.js +0 -1
- package/src/interface/originalEvent.js.map +0 -1
- package/src/interface/originalEvent.ts +0 -3
- package/src/is/isArray.js +0 -2
- package/src/is/isArray.js.map +0 -1
- package/src/is/isCanvas.js +0 -2
- package/src/is/isCanvas.js.map +0 -1
- package/src/is/isCustomElement.js +0 -2
- package/src/is/isCustomElement.js.map +0 -1
- package/src/is/isDocument.js +0 -2
- package/src/is/isDocument.js.map +0 -1
- package/src/is/isElement.js +0 -2
- package/src/is/isElement.js.map +0 -1
- package/src/is/isElementInScrollRange.js +0 -11
- package/src/is/isElementInScrollRange.js.map +0 -1
- package/src/is/isElementInViewport.js +0 -11
- package/src/is/isElementInViewport.js.map +0 -1
- package/src/is/isElementsArray.js +0 -4
- package/src/is/isElementsArray.js.map +0 -1
- package/src/is/isFunction.js +0 -2
- package/src/is/isFunction.js.map +0 -1
- package/src/is/isHTMLCollection.js +0 -2
- package/src/is/isHTMLCollection.js.map +0 -1
- package/src/is/isHTMLElement.js +0 -2
- package/src/is/isHTMLElement.js.map +0 -1
- package/src/is/isHTMLImageElement.js +0 -2
- package/src/is/isHTMLImageElement.js.map +0 -1
- package/src/is/isMap.js +0 -2
- package/src/is/isMap.js.map +0 -1
- package/src/is/isMedia.js +0 -5
- package/src/is/isMedia.js.map +0 -1
- package/src/is/isNode.js +0 -2
- package/src/is/isNode.js.map +0 -1
- package/src/is/isNodeList.js +0 -2
- package/src/is/isNodeList.js.map +0 -1
- package/src/is/isNumber.js +0 -2
- package/src/is/isNumber.js.map +0 -1
- package/src/is/isObject.js +0 -2
- package/src/is/isObject.js.map +0 -1
- package/src/is/isRTL.js +0 -3
- package/src/is/isRTL.js.map +0 -1
- package/src/is/isSVGElement.js +0 -2
- package/src/is/isSVGElement.js.map +0 -1
- package/src/is/isScaledElement.js +0 -9
- package/src/is/isScaledElement.js.map +0 -1
- package/src/is/isShadowRoot.js +0 -2
- package/src/is/isShadowRoot.js.map +0 -1
- package/src/is/isString.js +0 -2
- package/src/is/isString.js.map +0 -1
- package/src/is/isTableElement.js +0 -2
- package/src/is/isTableElement.js.map +0 -1
- package/src/is/isWeakMap.js +0 -2
- package/src/is/isWeakMap.js.map +0 -1
- package/src/is/isWindow.js +0 -2
- package/src/is/isWindow.js.map +0 -1
- package/src/misc/ArrayFrom.js +0 -2
- package/src/misc/ArrayFrom.js.map +0 -1
- package/src/misc/Float32ArrayFrom.js +0 -2
- package/src/misc/Float32ArrayFrom.js.map +0 -1
- package/src/misc/Float64ArrayFrom.js +0 -2
- package/src/misc/Float64ArrayFrom.js.map +0 -1
- package/src/misc/ObjectAssign.js +0 -2
- package/src/misc/ObjectAssign.js.map +0 -1
- package/src/misc/ObjectEntries.js +0 -2
- package/src/misc/ObjectEntries.js.map +0 -1
- package/src/misc/ObjectKeys.js +0 -2
- package/src/misc/ObjectKeys.js.map +0 -1
- package/src/misc/ObjectValues.js +0 -2
- package/src/misc/ObjectValues.js.map +0 -1
- package/src/misc/OriginalEvent.js +0 -13
- package/src/misc/OriginalEvent.js.map +0 -1
- package/src/misc/createElement.js +0 -24
- package/src/misc/createElement.js.map +0 -1
- package/src/misc/createElementNS.js +0 -24
- package/src/misc/createElementNS.js.map +0 -1
- package/src/misc/data.js +0 -35
- package/src/misc/data.js.map +0 -1
- package/src/misc/dispatchEvent.js +0 -2
- package/src/misc/dispatchEvent.js.map +0 -1
- package/src/misc/distinct.js +0 -2
- package/src/misc/distinct.js.map +0 -1
- package/src/misc/emulateAnimationEnd.js +0 -28
- package/src/misc/emulateAnimationEnd.js.map +0 -1
- package/src/misc/emulateTransitionEnd.js +0 -28
- package/src/misc/emulateTransitionEnd.js.map +0 -1
- package/src/misc/focus.js +0 -2
- package/src/misc/focus.js.map +0 -1
- package/src/misc/noop.js +0 -2
- package/src/misc/noop.js.map +0 -1
- package/src/misc/normalizeOptions.js +0 -33
- package/src/misc/normalizeOptions.js.map +0 -1
- package/src/misc/normalizeValue.js +0 -16
- package/src/misc/normalizeValue.js.map +0 -1
- package/src/misc/passiveHandler.js +0 -2
- package/src/misc/passiveHandler.js.map +0 -1
- package/src/misc/reflow.js +0 -2
- package/src/misc/reflow.js.map +0 -1
- package/src/misc/setElementStyle.js +0 -15
- package/src/misc/setElementStyle.js.map +0 -1
- package/src/misc/timer.js +0 -50
- package/src/misc/timer.js.map +0 -1
- package/src/misc/toLowerCase.js +0 -2
- package/src/misc/toLowerCase.js.map +0 -1
- package/src/misc/toUpperCase.js +0 -2
- package/src/misc/toUpperCase.js.map +0 -1
- package/src/selectors/closest.js +0 -7
- package/src/selectors/closest.js.map +0 -1
- package/src/selectors/getCustomElements.js +0 -7
- package/src/selectors/getCustomElements.js.map +0 -1
- package/src/selectors/getElementById.js +0 -5
- package/src/selectors/getElementById.js.map +0 -1
- package/src/selectors/getElementsByClassName.js +0 -7
- package/src/selectors/getElementsByClassName.js.map +0 -1
- package/src/selectors/getElementsByTagName.js +0 -7
- package/src/selectors/getElementsByTagName.js.map +0 -1
- package/src/selectors/matches.js +0 -2
- package/src/selectors/matches.js.map +0 -1
- package/src/selectors/querySelector.js +0 -10
- package/src/selectors/querySelector.js.map +0 -1
- package/src/selectors/querySelectorAll.js +0 -7
- package/src/selectors/querySelectorAll.js.map +0 -1
- package/src/strings/DOMContentLoadedEvent.js +0 -2
- package/src/strings/DOMContentLoadedEvent.js.map +0 -1
- package/src/strings/DOMMouseScrollEvent.js +0 -2
- package/src/strings/DOMMouseScrollEvent.js.map +0 -1
- package/src/strings/abortEvent.js +0 -2
- package/src/strings/abortEvent.js.map +0 -1
- package/src/strings/addEventListener.js +0 -2
- package/src/strings/addEventListener.js.map +0 -1
- package/src/strings/animationDelay.js +0 -2
- package/src/strings/animationDelay.js.map +0 -1
- package/src/strings/animationDuration.js +0 -2
- package/src/strings/animationDuration.js.map +0 -1
- package/src/strings/animationEndEvent.js +0 -2
- package/src/strings/animationEndEvent.js.map +0 -1
- package/src/strings/animationName.js +0 -2
- package/src/strings/animationName.js.map +0 -1
- package/src/strings/ariaChecked.js +0 -2
- package/src/strings/ariaChecked.js.map +0 -1
- package/src/strings/ariaDescribedBy.js +0 -2
- package/src/strings/ariaDescribedBy.js.map +0 -1
- package/src/strings/ariaDescription.js +0 -2
- package/src/strings/ariaDescription.js.map +0 -1
- package/src/strings/ariaExpanded.js +0 -2
- package/src/strings/ariaExpanded.js.map +0 -1
- package/src/strings/ariaHasPopup.js +0 -2
- package/src/strings/ariaHasPopup.js.map +0 -1
- package/src/strings/ariaHidden.js +0 -2
- package/src/strings/ariaHidden.js.map +0 -1
- package/src/strings/ariaLabel.js +0 -2
- package/src/strings/ariaLabel.js.map +0 -1
- package/src/strings/ariaLabelledBy.js +0 -2
- package/src/strings/ariaLabelledBy.js.map +0 -1
- package/src/strings/ariaModal.js +0 -2
- package/src/strings/ariaModal.js.map +0 -1
- package/src/strings/ariaPressed.js +0 -2
- package/src/strings/ariaPressed.js.map +0 -1
- package/src/strings/ariaSelected.js +0 -2
- package/src/strings/ariaSelected.js.map +0 -1
- package/src/strings/ariaValueMax.js +0 -2
- package/src/strings/ariaValueMax.js.map +0 -1
- package/src/strings/ariaValueMin.js +0 -2
- package/src/strings/ariaValueMin.js.map +0 -1
- package/src/strings/ariaValueNow.js +0 -2
- package/src/strings/ariaValueNow.js.map +0 -1
- package/src/strings/ariaValueText.js +0 -2
- package/src/strings/ariaValueText.js.map +0 -1
- package/src/strings/beforeunloadEvent.js +0 -2
- package/src/strings/beforeunloadEvent.js.map +0 -1
- package/src/strings/bezierEasings.js +0 -28
- package/src/strings/bezierEasings.js.map +0 -1
- package/src/strings/blurEvent.js +0 -2
- package/src/strings/blurEvent.js.map +0 -1
- package/src/strings/changeEvent.js +0 -2
- package/src/strings/changeEvent.js.map +0 -1
- package/src/strings/contextmenuEvent.js +0 -2
- package/src/strings/contextmenuEvent.js.map +0 -1
- package/src/strings/errorEvent.js +0 -2
- package/src/strings/errorEvent.js.map +0 -1
- package/src/strings/focusEvent.js +0 -2
- package/src/strings/focusEvent.js.map +0 -1
- package/src/strings/focusEvents.js +0 -2
- package/src/strings/focusEvents.js.map +0 -1
- package/src/strings/focusinEvent.js +0 -2
- package/src/strings/focusinEvent.js.map +0 -1
- package/src/strings/focusoutEvent.js +0 -2
- package/src/strings/focusoutEvent.js.map +0 -1
- package/src/strings/gesturechangeEvent.js +0 -2
- package/src/strings/gesturechangeEvent.js.map +0 -1
- package/src/strings/gestureendEvent.js +0 -2
- package/src/strings/gestureendEvent.js.map +0 -1
- package/src/strings/gesturestartEvent.js +0 -2
- package/src/strings/gesturestartEvent.js.map +0 -1
- package/src/strings/keyAlt.js +0 -2
- package/src/strings/keyAlt.js.map +0 -1
- package/src/strings/keyArrowDown.js +0 -2
- package/src/strings/keyArrowDown.js.map +0 -1
- package/src/strings/keyArrowLeft.js +0 -2
- package/src/strings/keyArrowLeft.js.map +0 -1
- package/src/strings/keyArrowRight.js +0 -2
- package/src/strings/keyArrowRight.js.map +0 -1
- package/src/strings/keyArrowUp.js +0 -2
- package/src/strings/keyArrowUp.js.map +0 -1
- package/src/strings/keyBackspace.js +0 -2
- package/src/strings/keyBackspace.js.map +0 -1
- package/src/strings/keyCapsLock.js +0 -2
- package/src/strings/keyCapsLock.js.map +0 -1
- package/src/strings/keyControl.js +0 -2
- package/src/strings/keyControl.js.map +0 -1
- package/src/strings/keyDelete.js +0 -2
- package/src/strings/keyDelete.js.map +0 -1
- package/src/strings/keyEnter.js +0 -2
- package/src/strings/keyEnter.js.map +0 -1
- package/src/strings/keyEscape.js +0 -2
- package/src/strings/keyEscape.js.map +0 -1
- package/src/strings/keyInsert.js +0 -2
- package/src/strings/keyInsert.js.map +0 -1
- package/src/strings/keyMeta.js +0 -2
- package/src/strings/keyMeta.js.map +0 -1
- package/src/strings/keyPause.js +0 -2
- package/src/strings/keyPause.js.map +0 -1
- package/src/strings/keyScrollLock.js +0 -2
- package/src/strings/keyScrollLock.js.map +0 -1
- package/src/strings/keyShift.js +0 -2
- package/src/strings/keyShift.js.map +0 -1
- package/src/strings/keySpace.js +0 -2
- package/src/strings/keySpace.js.map +0 -1
- package/src/strings/keyTab.js +0 -2
- package/src/strings/keyTab.js.map +0 -1
- package/src/strings/keyboardEventKeys.js +0 -22
- package/src/strings/keyboardEventKeys.js.map +0 -1
- package/src/strings/keydownEvent.js +0 -2
- package/src/strings/keydownEvent.js.map +0 -1
- package/src/strings/keypressEvent.js +0 -2
- package/src/strings/keypressEvent.js.map +0 -1
- package/src/strings/keyupEvent.js +0 -2
- package/src/strings/keyupEvent.js.map +0 -1
- package/src/strings/loadEvent.js +0 -2
- package/src/strings/loadEvent.js.map +0 -1
- package/src/strings/loadstartEvent.js +0 -2
- package/src/strings/loadstartEvent.js.map +0 -1
- package/src/strings/mouseClickEvents.js +0 -2
- package/src/strings/mouseClickEvents.js.map +0 -1
- package/src/strings/mouseHoverEvents.js +0 -4
- package/src/strings/mouseHoverEvents.js.map +0 -1
- package/src/strings/mouseSwipeEvents.js +0 -7
- package/src/strings/mouseSwipeEvents.js.map +0 -1
- package/src/strings/mouseclickEvent.js +0 -2
- package/src/strings/mouseclickEvent.js.map +0 -1
- package/src/strings/mousedblclickEvent.js +0 -2
- package/src/strings/mousedblclickEvent.js.map +0 -1
- package/src/strings/mousedownEvent.js +0 -2
- package/src/strings/mousedownEvent.js.map +0 -1
- package/src/strings/mouseenterEvent.js +0 -2
- package/src/strings/mouseenterEvent.js.map +0 -1
- package/src/strings/mousehoverEvent.js +0 -2
- package/src/strings/mousehoverEvent.js.map +0 -1
- package/src/strings/mouseinEvent.js +0 -2
- package/src/strings/mouseinEvent.js.map +0 -1
- package/src/strings/mouseleaveEvent.js +0 -2
- package/src/strings/mouseleaveEvent.js.map +0 -1
- package/src/strings/mousemoveEvent.js +0 -2
- package/src/strings/mousemoveEvent.js.map +0 -1
- package/src/strings/mouseoutEvent.js +0 -2
- package/src/strings/mouseoutEvent.js.map +0 -1
- package/src/strings/mouseoverEvent.js +0 -2
- package/src/strings/mouseoverEvent.js.map +0 -1
- package/src/strings/mouseupEvent.js +0 -2
- package/src/strings/mouseupEvent.js.map +0 -1
- package/src/strings/mousewheelEvent.js +0 -2
- package/src/strings/mousewheelEvent.js.map +0 -1
- package/src/strings/moveEvent.js +0 -2
- package/src/strings/moveEvent.js.map +0 -1
- package/src/strings/nativeEvents.js +0 -103
- package/src/strings/nativeEvents.js.map +0 -1
- package/src/strings/offsetHeight.js +0 -2
- package/src/strings/offsetHeight.js.map +0 -1
- package/src/strings/offsetWidth.js +0 -2
- package/src/strings/offsetWidth.js.map +0 -1
- package/src/strings/orientationchangeEvent.js +0 -2
- package/src/strings/orientationchangeEvent.js.map +0 -1
- package/src/strings/pointercancelEvent.js +0 -2
- package/src/strings/pointercancelEvent.js.map +0 -1
- package/src/strings/pointerdownEvent.js +0 -2
- package/src/strings/pointerdownEvent.js.map +0 -1
- package/src/strings/pointerleaveEvent.js +0 -2
- package/src/strings/pointerleaveEvent.js.map +0 -1
- package/src/strings/pointermoveEvent.js +0 -2
- package/src/strings/pointermoveEvent.js.map +0 -1
- package/src/strings/pointerupEvent.js +0 -2
- package/src/strings/pointerupEvent.js.map +0 -1
- package/src/strings/readystatechangeEvent.js +0 -2
- package/src/strings/readystatechangeEvent.js.map +0 -1
- package/src/strings/removeEventListener.js +0 -2
- package/src/strings/removeEventListener.js.map +0 -1
- package/src/strings/resetEvent.js +0 -2
- package/src/strings/resetEvent.js.map +0 -1
- package/src/strings/resizeEvent.js +0 -2
- package/src/strings/resizeEvent.js.map +0 -1
- package/src/strings/scrollEvent.js +0 -2
- package/src/strings/scrollEvent.js.map +0 -1
- package/src/strings/scrollHeight.js +0 -2
- package/src/strings/scrollHeight.js.map +0 -1
- package/src/strings/scrollWidth.js +0 -2
- package/src/strings/scrollWidth.js.map +0 -1
- package/src/strings/selectEvent.js +0 -2
- package/src/strings/selectEvent.js.map +0 -1
- package/src/strings/selectendEvent.js +0 -2
- package/src/strings/selectendEvent.js.map +0 -1
- package/src/strings/selectstartEvent.js +0 -2
- package/src/strings/selectstartEvent.js.map +0 -1
- package/src/strings/submitEvent.js +0 -2
- package/src/strings/submitEvent.js.map +0 -1
- package/src/strings/tabindex.js +0 -2
- package/src/strings/tabindex.js.map +0 -1
- package/src/strings/touchEvents.js +0 -7
- package/src/strings/touchEvents.js.map +0 -1
- package/src/strings/touchcancelEvent.js +0 -2
- package/src/strings/touchcancelEvent.js.map +0 -1
- package/src/strings/touchendEvent.js +0 -2
- package/src/strings/touchendEvent.js.map +0 -1
- package/src/strings/touchmoveEvent.js +0 -2
- package/src/strings/touchmoveEvent.js.map +0 -1
- package/src/strings/touchstartEvent.js +0 -2
- package/src/strings/touchstartEvent.js.map +0 -1
- package/src/strings/transitionDelay.js +0 -2
- package/src/strings/transitionDelay.js.map +0 -1
- package/src/strings/transitionDuration.js +0 -2
- package/src/strings/transitionDuration.js.map +0 -1
- package/src/strings/transitionEndEvent.js +0 -2
- package/src/strings/transitionEndEvent.js.map +0 -1
- package/src/strings/transitionProperty.js +0 -2
- package/src/strings/transitionProperty.js.map +0 -1
- package/src/strings/unloadEvent.js +0 -2
- package/src/strings/unloadEvent.js.map +0 -1
- package/src/strings/userAgent.js +0 -3
- package/src/strings/userAgent.js.map +0 -1
- package/src/strings/userAgentData.js +0 -3
- package/src/strings/userAgentData.js.map +0 -1
- package/src/types.js +0 -1
- package/src/types.js.map +0 -1
- package/src/types.ts +0 -1
- package/types/attr/getAttribute.d.ts +0 -2
- package/types/attr/getAttributeNS.d.ts +0 -2
- package/types/attr/hasAttribute.d.ts +0 -2
- package/types/attr/hasAttributeNS.d.ts +0 -2
- package/types/attr/removeAttribute.d.ts +0 -2
- package/types/attr/removeAttributeNS.d.ts +0 -2
- package/types/attr/setAttribute.d.ts +0 -2
- package/types/attr/setAttributeNS.d.ts +0 -2
- package/types/blocks/documentBody.d.ts +0 -2
- package/types/blocks/documentElement.d.ts +0 -2
- package/types/blocks/documentHead.d.ts +0 -2
- package/types/boolean/isApple.d.ts +0 -2
- package/types/boolean/isFirefox.d.ts +0 -2
- package/types/boolean/isMobile.d.ts +0 -2
- package/types/boolean/support3DTransform.d.ts +0 -2
- package/types/boolean/supportAnimation.d.ts +0 -2
- package/types/boolean/supportPassive.d.ts +0 -2
- package/types/boolean/supportTouch.d.ts +0 -2
- package/types/boolean/supportTransform.d.ts +0 -2
- package/types/boolean/supportTransition.d.ts +0 -2
- package/types/class/addClass.d.ts +0 -2
- package/types/class/hasClass.d.ts +0 -2
- package/types/class/removeClass.d.ts +0 -2
- package/types/event/off.d.ts +0 -1
- package/types/event/on.d.ts +0 -1
- package/types/event/one.d.ts +0 -2
- package/types/get/getBoundingClientRect.d.ts +0 -3
- package/types/get/getDocument.d.ts +0 -2
- package/types/get/getDocumentBody.d.ts +0 -2
- package/types/get/getDocumentElement.d.ts +0 -2
- package/types/get/getDocumentHead.d.ts +0 -2
- package/types/get/getElementAnimationDelay.d.ts +0 -2
- package/types/get/getElementAnimationDuration.d.ts +0 -2
- package/types/get/getElementStyle.d.ts +0 -2
- package/types/get/getElementTransitionDelay.d.ts +0 -2
- package/types/get/getElementTransitionDuration.d.ts +0 -2
- package/types/get/getNodeScroll.d.ts +0 -5
- package/types/get/getParentNode.d.ts +0 -2
- package/types/get/getRectRelativeToOffsetParent.d.ts +0 -6
- package/types/get/getUID.d.ts +0 -2
- package/types/get/getWindow.d.ts +0 -2
- package/types/index.d.ts +0 -351
- package/types/interface/boundingClientRect.d.ts +0 -10
- package/types/interface/css4Declaration.d.ts +0 -3
- package/types/interface/customElement.d.ts +0 -8
- package/types/interface/navigatorUA.d.ts +0 -12
- package/types/interface/offsetRect.d.ts +0 -6
- package/types/interface/originalEvent.d.ts +0 -3
- package/types/is/isArray.d.ts +0 -2
- package/types/is/isCanvas.d.ts +0 -2
- package/types/is/isCustomElement.d.ts +0 -3
- package/types/is/isDocument.d.ts +0 -2
- package/types/is/isElement.d.ts +0 -2
- package/types/is/isElementInScrollRange.d.ts +0 -2
- package/types/is/isElementInViewport.d.ts +0 -2
- package/types/is/isElementsArray.d.ts +0 -2
- package/types/is/isFunction.d.ts +0 -2
- package/types/is/isHTMLCollection.d.ts +0 -2
- package/types/is/isHTMLElement.d.ts +0 -2
- package/types/is/isHTMLImageElement.d.ts +0 -2
- package/types/is/isMap.d.ts +0 -2
- package/types/is/isMedia.d.ts +0 -2
- package/types/is/isNode.d.ts +0 -2
- package/types/is/isNodeList.d.ts +0 -2
- package/types/is/isNumber.d.ts +0 -2
- package/types/is/isObject.d.ts +0 -2
- package/types/is/isRTL.d.ts +0 -2
- package/types/is/isSVGElement.d.ts +0 -2
- package/types/is/isScaledElement.d.ts +0 -1
- package/types/is/isShadowRoot.d.ts +0 -2
- package/types/is/isString.d.ts +0 -2
- package/types/is/isTableElement.d.ts +0 -2
- package/types/is/isWeakMap.d.ts +0 -2
- package/types/is/isWindow.d.ts +0 -2
- package/types/misc/ArrayFrom.d.ts +0 -2
- package/types/misc/Float32ArrayFrom.d.ts +0 -2
- package/types/misc/Float64ArrayFrom.d.ts +0 -2
- package/types/misc/ObjectAssign.d.ts +0 -2
- package/types/misc/ObjectEntries.d.ts +0 -2
- package/types/misc/ObjectKeys.d.ts +0 -2
- package/types/misc/ObjectValues.d.ts +0 -2
- package/types/misc/OriginalEvent.d.ts +0 -3
- package/types/misc/createElement.d.ts +0 -2
- package/types/misc/createElementNS.d.ts +0 -2
- package/types/misc/data.d.ts +0 -10
- package/types/misc/dispatchEvent.d.ts +0 -2
- package/types/misc/distinct.d.ts +0 -2
- package/types/misc/emulateAnimationEnd.d.ts +0 -2
- package/types/misc/emulateTransitionEnd.d.ts +0 -2
- package/types/misc/focus.d.ts +0 -2
- package/types/misc/noop.d.ts +0 -2
- package/types/misc/normalizeOptions.d.ts +0 -5
- package/types/misc/normalizeValue.d.ts +0 -3
- package/types/misc/passiveHandler.d.ts +0 -2
- package/types/misc/reflow.d.ts +0 -2
- package/types/misc/setElementStyle.d.ts +0 -3
- package/types/misc/timer.d.ts +0 -6
- package/types/misc/toLowerCase.d.ts +0 -2
- package/types/misc/toUpperCase.d.ts +0 -2
- package/types/selectors/closest.d.ts +0 -2
- package/types/selectors/getCustomElements.d.ts +0 -3
- package/types/selectors/getElementById.d.ts +0 -2
- package/types/selectors/getElementsByClassName.d.ts +0 -2
- package/types/selectors/getElementsByTagName.d.ts +0 -2
- package/types/selectors/matches.d.ts +0 -2
- package/types/selectors/querySelector.d.ts +0 -2
- package/types/selectors/querySelectorAll.d.ts +0 -2
- package/types/strings/DOMContentLoadedEvent.d.ts +0 -2
- package/types/strings/DOMMouseScrollEvent.d.ts +0 -2
- package/types/strings/abortEvent.d.ts +0 -2
- package/types/strings/addEventListener.d.ts +0 -2
- package/types/strings/animationDelay.d.ts +0 -2
- package/types/strings/animationDuration.d.ts +0 -2
- package/types/strings/animationEndEvent.d.ts +0 -2
- package/types/strings/animationName.d.ts +0 -2
- package/types/strings/ariaChecked.d.ts +0 -2
- package/types/strings/ariaDescribedBy.d.ts +0 -2
- package/types/strings/ariaDescription.d.ts +0 -2
- package/types/strings/ariaExpanded.d.ts +0 -2
- package/types/strings/ariaHasPopup.d.ts +0 -2
- package/types/strings/ariaHidden.d.ts +0 -2
- package/types/strings/ariaLabel.d.ts +0 -2
- package/types/strings/ariaLabelledBy.d.ts +0 -2
- package/types/strings/ariaModal.d.ts +0 -2
- package/types/strings/ariaPressed.d.ts +0 -2
- package/types/strings/ariaSelected.d.ts +0 -2
- package/types/strings/ariaValueMax.d.ts +0 -2
- package/types/strings/ariaValueMin.d.ts +0 -2
- package/types/strings/ariaValueNow.d.ts +0 -2
- package/types/strings/ariaValueText.d.ts +0 -2
- package/types/strings/beforeunloadEvent.d.ts +0 -2
- package/types/strings/bezierEasings.d.ts +0 -28
- package/types/strings/blurEvent.d.ts +0 -2
- package/types/strings/changeEvent.d.ts +0 -2
- package/types/strings/contextmenuEvent.d.ts +0 -2
- package/types/strings/errorEvent.d.ts +0 -2
- package/types/strings/focusEvent.d.ts +0 -2
- package/types/strings/focusEvents.d.ts +0 -5
- package/types/strings/focusinEvent.d.ts +0 -2
- package/types/strings/focusoutEvent.d.ts +0 -2
- package/types/strings/gesturechangeEvent.d.ts +0 -2
- package/types/strings/gestureendEvent.d.ts +0 -2
- package/types/strings/gesturestartEvent.d.ts +0 -2
- package/types/strings/keyAlt.d.ts +0 -2
- package/types/strings/keyArrowDown.d.ts +0 -2
- package/types/strings/keyArrowLeft.d.ts +0 -2
- package/types/strings/keyArrowRight.d.ts +0 -2
- package/types/strings/keyArrowUp.d.ts +0 -2
- package/types/strings/keyBackspace.d.ts +0 -2
- package/types/strings/keyCapsLock.d.ts +0 -2
- package/types/strings/keyControl.d.ts +0 -2
- package/types/strings/keyDelete.d.ts +0 -2
- package/types/strings/keyEnter.d.ts +0 -2
- package/types/strings/keyEscape.d.ts +0 -2
- package/types/strings/keyInsert.d.ts +0 -2
- package/types/strings/keyMeta.d.ts +0 -2
- package/types/strings/keyPause.d.ts +0 -2
- package/types/strings/keyScrollLock.d.ts +0 -2
- package/types/strings/keyShift.d.ts +0 -2
- package/types/strings/keySpace.d.ts +0 -2
- package/types/strings/keyTab.d.ts +0 -2
- package/types/strings/keyboardEventKeys.d.ts +0 -22
- package/types/strings/keydownEvent.d.ts +0 -2
- package/types/strings/keypressEvent.d.ts +0 -2
- package/types/strings/keyupEvent.d.ts +0 -2
- package/types/strings/loadEvent.d.ts +0 -2
- package/types/strings/loadstartEvent.d.ts +0 -2
- package/types/strings/mouseClickEvents.d.ts +0 -5
- package/types/strings/mouseHoverEvents.d.ts +0 -2
- package/types/strings/mouseSwipeEvents.d.ts +0 -7
- package/types/strings/mouseclickEvent.d.ts +0 -2
- package/types/strings/mousedblclickEvent.d.ts +0 -2
- package/types/strings/mousedownEvent.d.ts +0 -2
- package/types/strings/mouseenterEvent.d.ts +0 -2
- package/types/strings/mousehoverEvent.d.ts +0 -2
- package/types/strings/mouseinEvent.d.ts +0 -2
- package/types/strings/mouseleaveEvent.d.ts +0 -2
- package/types/strings/mousemoveEvent.d.ts +0 -2
- package/types/strings/mouseoutEvent.d.ts +0 -2
- package/types/strings/mouseoverEvent.d.ts +0 -2
- package/types/strings/mouseupEvent.d.ts +0 -2
- package/types/strings/mousewheelEvent.d.ts +0 -2
- package/types/strings/moveEvent.d.ts +0 -2
- package/types/strings/nativeEvents.d.ts +0 -53
- package/types/strings/offsetHeight.d.ts +0 -2
- package/types/strings/offsetWidth.d.ts +0 -2
- package/types/strings/orientationchangeEvent.d.ts +0 -2
- package/types/strings/pointercancelEvent.d.ts +0 -2
- package/types/strings/pointerdownEvent.d.ts +0 -2
- package/types/strings/pointerleaveEvent.d.ts +0 -2
- package/types/strings/pointermoveEvent.d.ts +0 -2
- package/types/strings/pointerupEvent.d.ts +0 -2
- package/types/strings/readystatechangeEvent.d.ts +0 -2
- package/types/strings/removeEventListener.d.ts +0 -2
- package/types/strings/resetEvent.d.ts +0 -2
- package/types/strings/resizeEvent.d.ts +0 -2
- package/types/strings/scrollEvent.d.ts +0 -2
- package/types/strings/scrollHeight.d.ts +0 -2
- package/types/strings/scrollWidth.d.ts +0 -2
- package/types/strings/selectEvent.d.ts +0 -2
- package/types/strings/selectendEvent.d.ts +0 -2
- package/types/strings/selectstartEvent.d.ts +0 -2
- package/types/strings/submitEvent.d.ts +0 -2
- package/types/strings/tabindex.d.ts +0 -2
- package/types/strings/touchEvents.d.ts +0 -7
- package/types/strings/touchcancelEvent.d.ts +0 -2
- package/types/strings/touchendEvent.d.ts +0 -2
- package/types/strings/touchmoveEvent.d.ts +0 -2
- package/types/strings/touchstartEvent.d.ts +0 -2
- package/types/strings/transitionDelay.d.ts +0 -2
- package/types/strings/transitionDuration.d.ts +0 -2
- package/types/strings/transitionEndEvent.d.ts +0 -2
- package/types/strings/transitionProperty.d.ts +0 -2
- package/types/strings/unloadEvent.d.ts +0 -2
- package/types/strings/userAgent.d.ts +0 -2
- package/types/strings/userAgentData.d.ts +0 -3
- package/types/types.d.ts +0 -1
package/src/is/isShadowRoot.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import isNode from './isNode';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Check if target is a `ShadowRoot`.
|
|
3
5
|
*
|
|
4
6
|
* @param element target
|
|
5
7
|
* @returns the query result
|
|
6
8
|
*/
|
|
7
|
-
const isShadowRoot = (element?:
|
|
8
|
-
(element && element.constructor.name ===
|
|
9
|
+
const isShadowRoot = (element?: unknown): element is ShadowRoot =>
|
|
10
|
+
(isNode(element) && element.constructor.name === 'ShadowRoot') || false;
|
|
9
11
|
|
|
10
12
|
export default isShadowRoot;
|
package/src/is/isString.ts
CHANGED
package/src/is/isTableElement.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import isNode from './isNode';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Check if a target element is a `<table>`, `<td>` or `<th>`.
|
|
3
5
|
* This specific check is important for determining
|
|
@@ -6,7 +8,7 @@
|
|
|
6
8
|
* @param element the target element
|
|
7
9
|
* @returns the query result
|
|
8
10
|
*/
|
|
9
|
-
const isTableElement = (element?:
|
|
10
|
-
(element && [
|
|
11
|
+
const isTableElement = (element?: unknown): element is HTMLTableElement | HTMLTableCellElement =>
|
|
12
|
+
(isNode(element) && ['TABLE', 'TD', 'TH'].includes(element.nodeName)) || false;
|
|
11
13
|
|
|
12
14
|
export default isTableElement;
|
package/src/is/isWeakMap.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import isObject from './isObject';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Checks if an element is a `WeakMap`.
|
|
5
|
+
*
|
|
6
|
+
* @param obj the target object
|
|
7
|
+
* @returns the query result
|
|
8
|
+
*/
|
|
9
|
+
const isWeakMap = (obj?: unknown): obj is WeakMap<any, any> =>
|
|
10
|
+
(isObject(obj) && obj.constructor.name === 'WeakMap') || false;
|
|
11
|
+
export default isWeakMap;
|
package/src/is/isWindow.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import isObject from './isObject';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Check if a target object is `Window`.
|
|
3
5
|
* => equivalent to `object instanceof Window`
|
|
@@ -5,6 +7,7 @@
|
|
|
5
7
|
* @param obj the target object
|
|
6
8
|
* @returns the query result
|
|
7
9
|
*/
|
|
8
|
-
const isWindow = (obj?:
|
|
10
|
+
const isWindow = (obj?: unknown): obj is Window =>
|
|
11
|
+
(isObject(obj) && obj.constructor.name === 'Window') || false;
|
|
9
12
|
|
|
10
13
|
export default isWindow;
|
package/src/misc/ObjectAssign.ts
CHANGED
|
@@ -1,11 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Overloads for Object.assign.
|
|
3
|
+
*
|
|
4
|
+
* @see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/object-assign/index.d.ts
|
|
5
|
+
*/
|
|
6
|
+
declare function ObjectAssignTyped<T, U>(target: T, source: U): T & U;
|
|
7
|
+
declare function ObjectAssignTyped<T, U, V>(target: T, source1: U, source2: V): T & U & V;
|
|
8
|
+
declare function ObjectAssignTyped<T, U, V, W>(
|
|
9
|
+
target: T,
|
|
10
|
+
source1: U,
|
|
11
|
+
source2: V,
|
|
12
|
+
source3: W,
|
|
13
|
+
): T & U & V & W;
|
|
14
|
+
declare function ObjectAssignTyped<T, U, V, W, Q>(
|
|
15
|
+
target: T,
|
|
16
|
+
source1: U,
|
|
17
|
+
source2: V,
|
|
18
|
+
source3: W,
|
|
19
|
+
source4: Q,
|
|
20
|
+
): T & U & V & W & Q;
|
|
21
|
+
declare function ObjectAssignTyped<T, U, V, W, Q, R>(
|
|
22
|
+
target: T,
|
|
23
|
+
source1: U,
|
|
24
|
+
source2: V,
|
|
25
|
+
source3: W,
|
|
26
|
+
source4: Q,
|
|
27
|
+
source5: R,
|
|
28
|
+
): T & U & V & W & Q & R;
|
|
29
|
+
declare function ObjectAssignTyped(target: any, ...sources: any[]): any;
|
|
30
|
+
|
|
1
31
|
/**
|
|
2
32
|
* Shortcut for `Object.assign()` static method.
|
|
33
|
+
*
|
|
3
34
|
* @param obj a target object
|
|
4
35
|
* @param source source object(s)
|
|
5
36
|
* @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
|
|
6
37
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
38
|
+
const ObjectAssign: typeof ObjectAssignTyped = <A extends Record<string, any>, B>(
|
|
39
|
+
obj: A,
|
|
40
|
+
...source: B[]
|
|
41
|
+
): B extends Record<string, any>[] ? any : A & B => Object.assign(obj, ...source);
|
|
10
42
|
|
|
11
43
|
export default ObjectAssign;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shortcut for `Object.entries()` static method.
|
|
3
|
+
*
|
|
3
4
|
* @param obj a target object
|
|
4
5
|
* @returns the entries of an object in an array format [key, value][]
|
|
6
|
+
* @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
|
|
5
7
|
*/
|
|
6
|
-
const ObjectEntries = <O extends
|
|
8
|
+
const ObjectEntries = <O extends Record<string, any>>(obj: O) =>
|
|
9
|
+
Object.entries(obj) as [keyof O, O[keyof O]][];
|
|
7
10
|
|
|
8
11
|
export default ObjectEntries;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shortcut for `Object.fromEntries()` static method.
|
|
3
|
+
*
|
|
4
|
+
* @param entries a target entries object
|
|
5
|
+
* @returns a new Object created from the specified entries in array format [key, value][]
|
|
6
|
+
* @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
|
|
7
|
+
*/
|
|
8
|
+
const ObjectFromEntries = <K extends string, V>(entries: [K, V][]) =>
|
|
9
|
+
Object.fromEntries(entries) as Record<K, V>;
|
|
10
|
+
|
|
11
|
+
export default ObjectFromEntries;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import isObject from '../is/isObject';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A shortcut to `Object.hasOwn()` static method to work
|
|
5
|
+
* with regular `Object` elements.
|
|
6
|
+
*
|
|
7
|
+
* @see https://fettblog.eu/typescript-hasownproperty/
|
|
8
|
+
* @param obj the target object
|
|
9
|
+
* @param prop the property to check
|
|
10
|
+
* @returns the query result
|
|
11
|
+
*/
|
|
12
|
+
const ObjectHasOwn = <T extends object, K extends PropertyKey>(
|
|
13
|
+
obj: T,
|
|
14
|
+
prop: K,
|
|
15
|
+
): obj is T & Record<K, unknown> => isObject(obj) && (Object.hasOwn(obj, prop) || prop in obj);
|
|
16
|
+
|
|
17
|
+
export default ObjectHasOwn;
|
package/src/misc/ObjectKeys.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shortcut for `Object.keys()` static method.
|
|
3
|
+
*
|
|
3
4
|
* @param obj a target object
|
|
4
5
|
* @returns an array with object keys
|
|
6
|
+
* @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
|
|
5
7
|
*/
|
|
6
|
-
const ObjectKeys =
|
|
8
|
+
const ObjectKeys = <O extends Record<string, any>>(obj: O) => Object.keys(obj) as (keyof O)[];
|
|
7
9
|
|
|
8
10
|
export default ObjectKeys;
|
package/src/misc/ObjectValues.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shortcut for `Object.values()` static method.
|
|
3
|
+
*
|
|
3
4
|
* @param obj a target object
|
|
4
5
|
* @returns an array with the object values
|
|
6
|
+
* @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
|
|
5
7
|
*/
|
|
6
|
-
const ObjectValues = <O extends
|
|
8
|
+
const ObjectValues = <O extends Record<string, unknown>>(obj: O): O[keyof O][] =>
|
|
9
|
+
Object.values(obj) as O[keyof O][];
|
|
7
10
|
|
|
8
11
|
export default ObjectValues;
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import OriginalEvent from '../interface/originalEvent';
|
|
1
|
+
import type { OriginalEvent } from '../interface/originalEvent';
|
|
2
2
|
import isObject from '../is/isObject';
|
|
3
3
|
import ObjectAssign from './ObjectAssign';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Returns a namespaced `CustomEvent` specific to each component.
|
|
7
|
-
*
|
|
7
|
+
*
|
|
8
|
+
* @param eventType Event.type
|
|
8
9
|
* @param config Event.options | Event.properties
|
|
9
10
|
* @returns a new namespaced event
|
|
10
11
|
*/
|
|
11
|
-
const
|
|
12
|
-
|
|
12
|
+
const createCustomEvent = <T extends OriginalEvent>(
|
|
13
|
+
eventType: string,
|
|
14
|
+
config?: CustomEventInit<any>,
|
|
15
|
+
): T => {
|
|
16
|
+
const OriginalCustomEvent = new CustomEvent<any>(eventType, {
|
|
13
17
|
cancelable: true,
|
|
14
18
|
bubbles: true,
|
|
15
|
-
} as CustomEventInit<
|
|
19
|
+
} as CustomEventInit<any>) as T;
|
|
16
20
|
|
|
17
21
|
/* istanbul ignore else */
|
|
18
22
|
if (isObject(config)) {
|
|
@@ -21,4 +25,4 @@ const OriginalEvent = <T>(EventType: string, config?: CustomEventInit<T>): Origi
|
|
|
21
25
|
return OriginalCustomEvent;
|
|
22
26
|
};
|
|
23
27
|
|
|
24
|
-
export default
|
|
28
|
+
export default createCustomEvent;
|
|
@@ -1,39 +1,34 @@
|
|
|
1
1
|
import isString from '../is/isString';
|
|
2
|
-
import setAttribute from '../attr/setAttribute';
|
|
3
2
|
import getDocument from '../get/getDocument';
|
|
4
|
-
import
|
|
3
|
+
import ObjectAssign from './ObjectAssign';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* Shortie for `document.createElement` method
|
|
8
7
|
* which allows you to create a new `HTMLElement` for a given `tagName`
|
|
9
8
|
* or based on an object with specific non-readonly attributes with string values:
|
|
10
9
|
* `id`, `className`, `textContent`, `style`, etc.
|
|
10
|
+
*
|
|
11
11
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement
|
|
12
12
|
*
|
|
13
13
|
* @param param `tagName` or object
|
|
14
|
-
* @return a new `HTMLElement`
|
|
14
|
+
* @return a new `HTMLElement`
|
|
15
15
|
*/
|
|
16
|
-
const createElement = (param?: string | Partial<
|
|
16
|
+
const createElement = <T extends HTMLElement>(param?: string | Partial<T>): T | undefined => {
|
|
17
17
|
if (!param) return undefined;
|
|
18
18
|
|
|
19
|
-
if (
|
|
20
|
-
return getDocument().createElement(param);
|
|
19
|
+
if (isString(param)) {
|
|
20
|
+
return getDocument().createElement(param) as T;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const { tagName } = param;
|
|
24
|
-
const newElement = createElement(tagName);
|
|
24
|
+
const newElement = createElement(tagName as string);
|
|
25
25
|
|
|
26
26
|
if (!newElement) return undefined;
|
|
27
27
|
|
|
28
|
-
const attr = { ...param };
|
|
28
|
+
const attr = { ...(param as Record<string, unknown>) };
|
|
29
29
|
delete attr.tagName;
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
if (isString(value)) {
|
|
33
|
-
setAttribute(newElement, key, value);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
return newElement;
|
|
31
|
+
return ObjectAssign(newElement, attr) as unknown as T;
|
|
37
32
|
};
|
|
38
33
|
|
|
39
34
|
export default createElement;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import getDocument from '../get/getDocument';
|
|
2
|
-
import
|
|
3
|
-
import setAttribute from '../attr/setAttribute';
|
|
2
|
+
import ObjectAssign from './ObjectAssign';
|
|
4
3
|
import isString from '../is/isString';
|
|
5
4
|
|
|
6
5
|
/**
|
|
@@ -8,37 +7,34 @@ import isString from '../is/isString';
|
|
|
8
7
|
* which allows you to create a new `HTMLElement` for a given `tagName`
|
|
9
8
|
* or based on an object with specific non-readonly attributes with string values:
|
|
10
9
|
* `id`, `className`, `textContent`, `style`, etc.
|
|
10
|
+
* Note: some elements resulted from this function call may not be compatible with
|
|
11
|
+
* some attributes.
|
|
12
|
+
*
|
|
11
13
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createElementNS
|
|
12
14
|
*
|
|
13
15
|
* @param ns `namespaceURI` to associate with the new `HTMLElement`
|
|
14
16
|
* @param param `tagName` or object
|
|
15
17
|
* @return a new `HTMLElement`
|
|
16
18
|
*/
|
|
17
|
-
const createElementNS = (
|
|
18
|
-
ns
|
|
19
|
-
param?: string | Partial<
|
|
20
|
-
):
|
|
21
|
-
if (!ns
|
|
22
|
-
|
|
23
|
-
if (
|
|
24
|
-
return getDocument().createElementNS(ns, param) as
|
|
19
|
+
const createElementNS = <T extends HTMLElement>(
|
|
20
|
+
ns: string,
|
|
21
|
+
param?: string | Partial<T>,
|
|
22
|
+
): T | undefined => {
|
|
23
|
+
if (!ns || !param) return undefined;
|
|
24
|
+
|
|
25
|
+
if (isString(param)) {
|
|
26
|
+
return getDocument().createElementNS(ns, param) as T;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
const { tagName } = param;
|
|
28
|
-
const newElement = createElementNS(ns, tagName
|
|
30
|
+
const newElement = createElementNS(ns, tagName);
|
|
29
31
|
|
|
30
32
|
if (!newElement) return undefined;
|
|
31
33
|
|
|
32
|
-
const attr = { ...param };
|
|
34
|
+
const attr = { ...(param as Record<string, unknown>) };
|
|
33
35
|
delete attr.tagName;
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
if (isString(value)) {
|
|
37
|
-
setAttribute(newElement, key, value);
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
return newElement;
|
|
37
|
+
return ObjectAssign(newElement, attr) as unknown as T;
|
|
42
38
|
};
|
|
43
39
|
|
|
44
40
|
export default createElementNS;
|
package/src/misc/data.ts
CHANGED
|
@@ -1,67 +1,74 @@
|
|
|
1
1
|
import isHTMLElement from '../is/isHTMLElement';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
type ElementComponentMap = Map<HTMLElement, ComponentData>;
|
|
5
|
-
type ComponentDataMap = Map<string, ElementComponentMap>;
|
|
6
|
-
|
|
7
|
-
const componentData: ComponentDataMap = new Map();
|
|
3
|
+
const componentData = new Map<string, Map<HTMLElement, any>>();
|
|
8
4
|
|
|
9
5
|
/**
|
|
10
6
|
* An interface for web components background data.
|
|
7
|
+
*
|
|
11
8
|
* @see https://github.com/thednp/bootstrap.native/blob/master/src/components/base-component.js
|
|
12
9
|
*/
|
|
13
10
|
const Data = {
|
|
11
|
+
data: componentData,
|
|
14
12
|
/**
|
|
15
13
|
* Sets web components data.
|
|
14
|
+
*
|
|
16
15
|
* @param element target element
|
|
17
16
|
* @param component the component's name or a unique key
|
|
18
17
|
* @param instance the component instance
|
|
19
18
|
*/
|
|
20
|
-
set: <T
|
|
19
|
+
set: <T>(element: HTMLElement, component: string, instance: T): void => {
|
|
21
20
|
if (!isHTMLElement(element)) return;
|
|
22
21
|
|
|
23
22
|
/* istanbul ignore else */
|
|
24
23
|
if (!componentData.has(component)) {
|
|
25
|
-
componentData.set(component, new Map());
|
|
24
|
+
componentData.set(component, new Map<HTMLElement, T>());
|
|
26
25
|
}
|
|
27
26
|
|
|
28
|
-
const instanceMap = componentData.get(component)
|
|
27
|
+
const instanceMap = componentData.get(component) as Map<HTMLElement, T>;
|
|
29
28
|
// not undefined, but defined right above
|
|
30
29
|
instanceMap.set(element, instance);
|
|
31
30
|
},
|
|
32
31
|
|
|
33
32
|
/**
|
|
34
33
|
* Returns all instances for specified component.
|
|
34
|
+
*
|
|
35
35
|
* @param component the component's name or a unique key
|
|
36
36
|
* @returns all the component instances
|
|
37
37
|
*/
|
|
38
|
-
getAllFor: (component: string):
|
|
39
|
-
const instanceMap = componentData.get(component)
|
|
38
|
+
getAllFor: <T>(component: string): Map<HTMLElement, T> | null => {
|
|
39
|
+
const instanceMap = componentData.get(component) as Map<HTMLElement, T>;
|
|
40
40
|
|
|
41
41
|
return instanceMap || null;
|
|
42
42
|
},
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Returns the instance associated with the target.
|
|
46
|
+
*
|
|
46
47
|
* @param element target element
|
|
47
48
|
* @param component the component's name or a unique key
|
|
48
49
|
* @returns the instance
|
|
49
50
|
*/
|
|
50
|
-
get: (element: HTMLElement, component: string):
|
|
51
|
+
get: <T>(element: HTMLElement, component: string): T | null => {
|
|
51
52
|
if (!isHTMLElement(element) || !component) return null;
|
|
52
|
-
const instanceMap = Data.getAllFor(component);
|
|
53
|
+
const instanceMap = Data.getAllFor<T>(component);
|
|
54
|
+
// const instanceMap = componentData.get(component) as Map<HTMLElement, InstanceType<T>>;
|
|
55
|
+
|
|
53
56
|
const instance = element && instanceMap && instanceMap.get(element);
|
|
54
57
|
|
|
58
|
+
// return (instance as T) || null;
|
|
55
59
|
return instance || null;
|
|
56
60
|
},
|
|
57
61
|
|
|
58
62
|
/**
|
|
59
63
|
* Removes web components data.
|
|
64
|
+
*
|
|
60
65
|
* @param element target element
|
|
61
66
|
* @param component the component's name or a unique key
|
|
62
67
|
*/
|
|
63
|
-
remove: <
|
|
64
|
-
const instanceMap = Data.getAllFor(component);
|
|
68
|
+
remove: <T>(element: HTMLElement, component: string): void => {
|
|
69
|
+
const instanceMap = Data.getAllFor<T>(component);
|
|
70
|
+
// const instanceMap = componentData.get(component) as Map<HTMLElement, InstanceType<T>>;
|
|
71
|
+
|
|
65
72
|
if (!instanceMap || !isHTMLElement(element)) return;
|
|
66
73
|
|
|
67
74
|
instanceMap.delete(element);
|
|
@@ -73,9 +80,4 @@ const Data = {
|
|
|
73
80
|
},
|
|
74
81
|
};
|
|
75
82
|
|
|
76
|
-
/**
|
|
77
|
-
* An alias for `Data.get()`.
|
|
78
|
-
*/
|
|
79
|
-
export const getInstance = (target: HTMLElement, component: string) => Data.get(target, component);
|
|
80
|
-
|
|
81
83
|
export default Data;
|
package/src/misc/distinct.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import animationEndEvent from
|
|
2
|
-
import getElementAnimationDelay from
|
|
3
|
-
import getElementAnimationDuration from
|
|
4
|
-
import dispatchEvent from
|
|
1
|
+
import animationEndEvent from '../strings/animationEndEvent';
|
|
2
|
+
import getElementAnimationDelay from '../get/getElementAnimationDelay';
|
|
3
|
+
import getElementAnimationDuration from '../get/getElementAnimationDuration';
|
|
4
|
+
import dispatchEvent from './dispatchEvent';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Utility to make sure callbacks are consistently
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import transitionEndEvent from
|
|
2
|
-
import getElementTransitionDelay from
|
|
3
|
-
import getElementTransitionDuration from
|
|
4
|
-
import dispatchEvent from
|
|
1
|
+
import transitionEndEvent from '../strings/transitionEndEvent';
|
|
2
|
+
import getElementTransitionDelay from '../get/getElementTransitionDelay';
|
|
3
|
+
import getElementTransitionDuration from '../get/getElementTransitionDuration';
|
|
4
|
+
import dispatchEvent from './dispatchEvent';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Utility to make sure callbacks are consistently
|
package/src/misc/noop.ts
CHANGED
|
@@ -2,7 +2,7 @@ import getAttribute from '../attr/getAttribute';
|
|
|
2
2
|
import normalizeValue from './normalizeValue';
|
|
3
3
|
import ObjectEntries from './ObjectEntries';
|
|
4
4
|
import toLowerCase from './toLowerCase';
|
|
5
|
-
import { optionValues } from '../types';
|
|
5
|
+
// import { optionValues } from '../types';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Utility to normalize component options.
|
|
@@ -13,14 +13,14 @@ import { optionValues } from '../types';
|
|
|
13
13
|
* @param ns component namespace
|
|
14
14
|
* @return normalized component options object
|
|
15
15
|
*/
|
|
16
|
-
const normalizeOptions = <T extends { [key: string]:
|
|
16
|
+
const normalizeOptions = <T extends { [key: string]: any }>(
|
|
17
17
|
element: HTMLElement,
|
|
18
18
|
defaultOps: T,
|
|
19
19
|
inputOps: Partial<T>,
|
|
20
|
-
ns?: string
|
|
20
|
+
ns?: string,
|
|
21
21
|
): T => {
|
|
22
22
|
const INPUT = { ...inputOps };
|
|
23
|
-
const data = { ...element.dataset }
|
|
23
|
+
const data = { ...element.dataset };
|
|
24
24
|
const normalOps = { ...defaultOps };
|
|
25
25
|
const dataOps: Partial<T> = {};
|
|
26
26
|
const title = 'title';
|
|
@@ -41,9 +41,9 @@ const normalizeOptions = <T extends { [key: string]: optionValues }>(
|
|
|
41
41
|
ObjectEntries(defaultOps).forEach(([k, v]) => {
|
|
42
42
|
/* istanbul ignore else */
|
|
43
43
|
if (k in INPUT) {
|
|
44
|
-
normalOps[k] = INPUT[k];
|
|
44
|
+
normalOps[k] = INPUT[k] as T[keyof T];
|
|
45
45
|
} else if (k in dataOps) {
|
|
46
|
-
normalOps[k] = dataOps[k];
|
|
46
|
+
normalOps[k] = dataOps[k] as T[keyof T];
|
|
47
47
|
} else {
|
|
48
48
|
normalOps[k] = (k === title ? getAttribute(element, title) : v) as T[keyof T];
|
|
49
49
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type NormalValue = boolean | number | string | ((...args: any[]) => any) | null;
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Utility to normalize component options
|
|
@@ -6,25 +6,25 @@ import { optionValues } from '../types';
|
|
|
6
6
|
* @param value the input value
|
|
7
7
|
* @return the normalized value
|
|
8
8
|
*/
|
|
9
|
-
const normalizeValue = (value?:
|
|
10
|
-
if (['true', true].includes(value)) {
|
|
9
|
+
const normalizeValue = (value?: boolean | number | string): NormalValue => {
|
|
10
|
+
if (['true', true].includes(value as boolean)) {
|
|
11
11
|
return true;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
if (['false', false].includes(value)) {
|
|
14
|
+
if (['false', false].includes(value as boolean)) {
|
|
15
15
|
return false;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
if (['null', '', null].includes(value)) {
|
|
18
|
+
if (['null', '', null, undefined].includes(value as string | undefined)) {
|
|
19
19
|
return null;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
if (value !== '' && !Number.isNaN(+value)) {
|
|
23
|
-
return +value;
|
|
22
|
+
if (value !== '' && !Number.isNaN(+(value as string))) {
|
|
23
|
+
return +(value as string);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
// string / function / HTMLElement / object / undefined
|
|
27
|
-
return value;
|
|
27
|
+
return value as NormalValue;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
export default normalizeValue;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import ObjectAssign from './ObjectAssign';
|
|
2
2
|
import ObjectEntries from './ObjectEntries';
|
|
3
|
-
import
|
|
3
|
+
import isString from '../is/isString';
|
|
4
|
+
import type { CSS4Declaration } from '../interface/css4Declaration';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Shortcut for multiple uses of `HTMLElement.style.propertyName` method.
|
|
8
|
+
*
|
|
7
9
|
* @param element target element
|
|
8
10
|
* @param styles attribute value
|
|
9
11
|
*/
|
|
10
|
-
const setElementStyle = (element: HTMLElement, styles: CSS4Declaration): void => {
|
|
11
|
-
ObjectEntries(styles).forEach(([key, value]
|
|
12
|
-
if (key.includes('--')) {
|
|
13
|
-
element.style.setProperty(key, value);
|
|
12
|
+
const setElementStyle = (element: HTMLElement, styles: Partial<CSS4Declaration>): void => {
|
|
13
|
+
ObjectEntries(styles).forEach(([key, value]) => {
|
|
14
|
+
if (value && isString(key as string) && (key as string).includes('--')) {
|
|
15
|
+
element.style.setProperty(key as string, value);
|
|
14
16
|
} else {
|
|
15
17
|
const propObject: Partial<CSS4Declaration> = {};
|
|
16
18
|
propObject[key] = value;
|