Comparing version 2.0.0 to 2.0.1
@@ -0,1 +1,5 @@ | ||
# 2.0.1 | ||
fix: Update type definition | ||
# 2.0.0 | ||
@@ -2,0 +6,0 @@ |
@@ -1,4 +0,3 @@ | ||
// @flow | ||
import getGlobal from '../getGlobal'; | ||
var g = getGlobal(); | ||
export default g.requestAnimationFrame || g.webkitRequestAnimationFrame; |
@@ -1,2 +0,1 @@ | ||
// @flow | ||
import nativeRequestAnimationFrame from './nativeRequestAnimationFrame'; | ||
@@ -3,0 +2,0 @@ import emptyFunction from '../utils/emptyFunction'; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (target: HTMLElement, className: string) => HTMLElement; | ||
declare const _default: (target: Element, className: string) => Element; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (target: HTMLElement, className: string) => boolean; | ||
declare const _default: (target: Element, className: string) => boolean; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (target: HTMLElement, className: string) => HTMLElement; | ||
declare const _default: (target: Element, className: string) => Element; | ||
export default _default; |
@@ -1,2 +0,1 @@ | ||
// @flow | ||
export default (function (target, className) { | ||
@@ -3,0 +2,0 @@ if (className) { |
@@ -1,2 +0,2 @@ | ||
declare const _default: (target: HTMLElement, className: string) => HTMLElement; | ||
declare const _default: (target: Element, className: string) => Element; | ||
export default _default; |
declare class DOMMouseMoveTracker { | ||
isDraggingStatus: boolean; | ||
animationFrameID: any; | ||
domNode: HTMLElement; | ||
domNode: Element; | ||
onMove: any; | ||
@@ -18,3 +18,3 @@ onMoveEnd: any; | ||
*/ | ||
constructor(onMove: Function, onMoveEnd: Function, domNode: HTMLElement); | ||
constructor(onMove: (x: number, y: number, e: Event) => void, onMoveEnd: (e: Event) => void, domNode: Element); | ||
/** | ||
@@ -21,0 +21,0 @@ * This is to set up the listeners for listening to mouse move |
/** | ||
* Unbind `target` event `eventName`'s callback `listener`. | ||
*/ | ||
export default function on<K extends keyof DocumentEventMap>(target: HTMLElement, eventName: K, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; | ||
export default function on<K extends keyof DocumentEventMap>(target: Element | Window, eventName: K, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; |
/** | ||
* Bind `target` event `eventName`'s callback `listener`. | ||
*/ | ||
export default function on<K extends keyof DocumentEventMap>(target: HTMLElement, eventType: K, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): { | ||
export default function on<K extends keyof DocumentEventMap>(target: Element | Window, eventType: K, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): { | ||
off: () => void; | ||
}; |
@@ -9,7 +9,7 @@ import UserAgent from './utils/UserAgent_DEPRECATED'; | ||
function normalizeWheel(event) { | ||
var sX = 0, | ||
sY = 0, | ||
// spinX, spinY | ||
pX = 0, | ||
pY = 0; // pixelX, pixelY | ||
var sX = 0; | ||
var sY = 0; // spinX, spinY | ||
var pX = 0; | ||
var pY = 0; // pixelX, pixelY | ||
// Legacy | ||
@@ -16,0 +16,0 @@ |
@@ -1,2 +0,2 @@ | ||
declare const _default: (context: HTMLElement, node: Node & ParentNode) => boolean; | ||
declare const _default: (context: Element, node: Node & ParentNode) => boolean; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (container: HTMLElement | (() => HTMLElement), defaultContainer: HTMLElement) => HTMLElement; | ||
declare const _default: (container: Element | (() => Element), defaultContainer?: Element) => Element; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (node: HTMLElement, client: HTMLElement) => number; | ||
declare const _default: (node: Element, client?: Element) => number; | ||
export default _default; |
@@ -7,3 +7,3 @@ declare type Offset = { | ||
}; | ||
declare const _default: (node: HTMLElement) => Offset | DOMRect | null; | ||
declare const _default: (node: Element) => Offset | DOMRect | null; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (node: HTMLElement) => HTMLElement; | ||
declare const _default: (node: Element) => Element; | ||
export default _default; |
@@ -1,2 +0,1 @@ | ||
// @flow | ||
import ownerDocument from './ownerDocument'; | ||
@@ -6,4 +5,6 @@ import nodeName from './nodeName'; | ||
export default (function (node) { | ||
var _ref; | ||
var doc = ownerDocument(node); | ||
var offsetParent = node && node.offsetParent; | ||
var offsetParent = (_ref = node) === null || _ref === void 0 ? void 0 : _ref.offsetParent; | ||
@@ -10,0 +11,0 @@ while (offsetParent && nodeName(node) !== 'html' && getStyle(offsetParent, 'position') === 'static') { |
@@ -7,3 +7,3 @@ declare type Offset = { | ||
}; | ||
declare const _default: (node: HTMLElement, offsetParent: HTMLElement) => Offset | DOMRect | null; | ||
declare const _default: (node: Element, offsetParent?: Element) => Offset | DOMRect | null; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (recalc: boolean) => number | void; | ||
declare const _default: (recalc?: boolean) => number | void; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (node: HTMLElement, client: HTMLElement) => number; | ||
declare const _default: (node: Element, client?: Element) => number; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (container: HTMLElement) => boolean; | ||
declare const _default: (container: Element) => boolean; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (node: HTMLElement) => string; | ||
declare const _default: (node: Element) => string; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (node: HTMLElement) => Document; | ||
declare const _default: (node: Element) => Document; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (componentOrElement: HTMLElement) => Window; | ||
declare const _default: (componentOrElement: Element) => Window; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (node: HTMLElement, val?: number) => number; | ||
declare const _default: (node: Element, val?: number) => number; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (node: HTMLElement, val?: number) => number; | ||
declare const _default: (node: Element, val?: number) => number; | ||
export default _default; |
interface CSSProperty { | ||
[key: string]: string | number; | ||
} | ||
declare const _default: (node: HTMLElement, property: string | CSSProperty, value?: string | number) => void; | ||
declare const _default: (node: Element, property: string | CSSProperty, value?: string | number) => void; | ||
export default _default; |
import hyphenateStyleName from './hyphenateStyleName'; | ||
import removeStyle from './removeStyle'; | ||
CSSStyleDeclaration; | ||
export default (function (node, property, value) { | ||
@@ -5,0 +4,0 @@ var css = ''; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (node: HTMLElement) => CSSStyleDeclaration | null; | ||
declare const _default: (node: Element) => CSSStyleDeclaration | null; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (node: HTMLElement, property?: string) => string | CSSStyleDeclaration; | ||
declare const _default: (node: Element, property?: string) => string | CSSStyleDeclaration; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (node: HTMLElement, keys: string | Array<string>) => void; | ||
declare const _default: (node: Element, keys: string | Array<string>) => void; | ||
/** | ||
@@ -3,0 +3,0 @@ * key(s) typeof [string , array] ? |
function removeStyle(node, key) { | ||
var _node$style, _node$style$removePro; | ||
var _style, _style$removeProperty; | ||
(_node$style = node.style) === null || _node$style === void 0 ? void 0 : (_node$style$removePro = _node$style.removeProperty) === null || _node$style$removePro === void 0 ? void 0 : _node$style$removePro.call(_node$style, key); | ||
(_style = node.style) === null || _style === void 0 ? void 0 : (_style$removeProperty = _style.removeProperty) === null || _style$removeProperty === void 0 ? void 0 : _style$removeProperty.call(_style, key); | ||
} | ||
@@ -6,0 +6,0 @@ /** |
@@ -0,1 +1,5 @@ | ||
/** | ||
* Source code reference from: | ||
* https://github.com/facebook/fbjs/blob/d308fa83c9/packages/fbjs/src/dom/translateDOMPositionXY.js | ||
*/ | ||
interface Options { | ||
@@ -2,0 +6,0 @@ enable3DTransform?: boolean; |
@@ -1,3 +0,1 @@ | ||
// @flow | ||
/** | ||
@@ -4,0 +2,0 @@ * Source code reference from: |
@@ -10,3 +10,2 @@ "use strict"; | ||
// @flow | ||
var g = (0, _getGlobal["default"])(); | ||
@@ -13,0 +12,0 @@ |
@@ -14,3 +14,2 @@ "use strict"; | ||
// @flow | ||
var g = (0, _getGlobal["default"])(); | ||
@@ -17,0 +16,0 @@ var lastTime = 0; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (target: HTMLElement, className: string) => HTMLElement; | ||
declare const _default: (target: Element, className: string) => Element; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (target: HTMLElement, className: string) => boolean; | ||
declare const _default: (target: Element, className: string) => boolean; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (target: HTMLElement, className: string) => HTMLElement; | ||
declare const _default: (target: Element, className: string) => Element; | ||
export default _default; |
@@ -6,3 +6,2 @@ "use strict"; | ||
// @flow | ||
var _default = function _default(target, className) { | ||
@@ -9,0 +8,0 @@ if (className) { |
@@ -1,2 +0,2 @@ | ||
declare const _default: (target: HTMLElement, className: string) => HTMLElement; | ||
declare const _default: (target: Element, className: string) => Element; | ||
export default _default; |
declare class DOMMouseMoveTracker { | ||
isDraggingStatus: boolean; | ||
animationFrameID: any; | ||
domNode: HTMLElement; | ||
domNode: Element; | ||
onMove: any; | ||
@@ -18,3 +18,3 @@ onMoveEnd: any; | ||
*/ | ||
constructor(onMove: Function, onMoveEnd: Function, domNode: HTMLElement); | ||
constructor(onMove: (x: number, y: number, e: Event) => void, onMoveEnd: (e: Event) => void, domNode: Element); | ||
/** | ||
@@ -21,0 +21,0 @@ * This is to set up the listeners for listening to mouse move |
/** | ||
* Unbind `target` event `eventName`'s callback `listener`. | ||
*/ | ||
export default function on<K extends keyof DocumentEventMap>(target: HTMLElement, eventName: K, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; | ||
export default function on<K extends keyof DocumentEventMap>(target: Element | Window, eventName: K, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; |
/** | ||
* Bind `target` event `eventName`'s callback `listener`. | ||
*/ | ||
export default function on<K extends keyof DocumentEventMap>(target: HTMLElement, eventType: K, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): { | ||
export default function on<K extends keyof DocumentEventMap>(target: Element | Window, eventType: K, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): { | ||
off: () => void; | ||
}; |
@@ -18,7 +18,7 @@ "use strict"; | ||
function normalizeWheel(event) { | ||
var sX = 0, | ||
sY = 0, | ||
// spinX, spinY | ||
pX = 0, | ||
pY = 0; // pixelX, pixelY | ||
var sX = 0; | ||
var sY = 0; // spinX, spinY | ||
var pX = 0; | ||
var pY = 0; // pixelX, pixelY | ||
// Legacy | ||
@@ -25,0 +25,0 @@ |
@@ -1,2 +0,2 @@ | ||
declare const _default: (context: HTMLElement, node: Node & ParentNode) => boolean; | ||
declare const _default: (context: Element, node: Node & ParentNode) => boolean; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (container: HTMLElement | (() => HTMLElement), defaultContainer: HTMLElement) => HTMLElement; | ||
declare const _default: (container: Element | (() => Element), defaultContainer?: Element) => Element; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (node: HTMLElement, client: HTMLElement) => number; | ||
declare const _default: (node: Element, client?: Element) => number; | ||
export default _default; |
@@ -7,3 +7,3 @@ declare type Offset = { | ||
}; | ||
declare const _default: (node: HTMLElement) => Offset | DOMRect | null; | ||
declare const _default: (node: Element) => Offset | DOMRect | null; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (node: HTMLElement) => HTMLElement; | ||
declare const _default: (node: Element) => Element; | ||
export default _default; |
@@ -14,6 +14,7 @@ "use strict"; | ||
// @flow | ||
var _default = function _default(node) { | ||
var _ref; | ||
var doc = (0, _ownerDocument["default"])(node); | ||
var offsetParent = node && node.offsetParent; | ||
var offsetParent = (_ref = node) === null || _ref === void 0 ? void 0 : _ref.offsetParent; | ||
@@ -20,0 +21,0 @@ while (offsetParent && (0, _nodeName["default"])(node) !== 'html' && (0, _style.getStyle)(offsetParent, 'position') === 'static') { |
@@ -7,3 +7,3 @@ declare type Offset = { | ||
}; | ||
declare const _default: (node: HTMLElement, offsetParent: HTMLElement) => Offset | DOMRect | null; | ||
declare const _default: (node: Element, offsetParent?: Element) => Offset | DOMRect | null; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (recalc: boolean) => number | void; | ||
declare const _default: (recalc?: boolean) => number | void; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (node: HTMLElement, client: HTMLElement) => number; | ||
declare const _default: (node: Element, client?: Element) => number; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (container: HTMLElement) => boolean; | ||
declare const _default: (container: Element) => boolean; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (node: HTMLElement) => string; | ||
declare const _default: (node: Element) => string; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (node: HTMLElement) => Document; | ||
declare const _default: (node: Element) => Document; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (componentOrElement: HTMLElement) => Window; | ||
declare const _default: (componentOrElement: Element) => Window; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (node: HTMLElement, val?: number) => number; | ||
declare const _default: (node: Element, val?: number) => number; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (node: HTMLElement, val?: number) => number; | ||
declare const _default: (node: Element, val?: number) => number; | ||
export default _default; |
interface CSSProperty { | ||
[key: string]: string | number; | ||
} | ||
declare const _default: (node: HTMLElement, property: string | CSSProperty, value?: string | number) => void; | ||
declare const _default: (node: Element, property: string | CSSProperty, value?: string | number) => void; | ||
export default _default; |
@@ -12,4 +12,2 @@ "use strict"; | ||
CSSStyleDeclaration; | ||
var _default = function _default(node, property, value) { | ||
@@ -16,0 +14,0 @@ var css = ''; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (node: HTMLElement) => CSSStyleDeclaration | null; | ||
declare const _default: (node: Element) => CSSStyleDeclaration | null; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (node: HTMLElement, property?: string) => string | CSSStyleDeclaration; | ||
declare const _default: (node: Element, property?: string) => string | CSSStyleDeclaration; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (node: HTMLElement, keys: string | Array<string>) => void; | ||
declare const _default: (node: Element, keys: string | Array<string>) => void; | ||
/** | ||
@@ -3,0 +3,0 @@ * key(s) typeof [string , array] ? |
@@ -7,5 +7,5 @@ "use strict"; | ||
function removeStyle(node, key) { | ||
var _node$style, _node$style$removePro; | ||
var _style, _style$removeProperty; | ||
(_node$style = node.style) === null || _node$style === void 0 ? void 0 : (_node$style$removePro = _node$style.removeProperty) === null || _node$style$removePro === void 0 ? void 0 : _node$style$removePro.call(_node$style, key); | ||
(_style = node.style) === null || _style === void 0 ? void 0 : (_style$removeProperty = _style.removeProperty) === null || _style$removeProperty === void 0 ? void 0 : _style$removeProperty.call(_style, key); | ||
} | ||
@@ -12,0 +12,0 @@ /** |
@@ -0,1 +1,5 @@ | ||
/** | ||
* Source code reference from: | ||
* https://github.com/facebook/fbjs/blob/d308fa83c9/packages/fbjs/src/dom/translateDOMPositionXY.js | ||
*/ | ||
interface Options { | ||
@@ -2,0 +6,0 @@ enable3DTransform?: boolean; |
@@ -14,4 +14,2 @@ "use strict"; | ||
// @flow | ||
/** | ||
@@ -18,0 +16,0 @@ * Source code reference from: |
{ | ||
"name": "dom-lib", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "DOM helper library", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -1,2 +0,2 @@ | ||
# dom-lib [![Travis][build-badge]][build] [![npm][npm-badge]][npm] | ||
# dom-lib [![npm][npm-badge]][npm] | ||
@@ -22,6 +22,6 @@ DOM helper library | ||
```typescript | ||
hasClass: (node: HTMLElement, className: string) => boolean; | ||
addClass: (node: HTMLElement, className: string) => HTMLElement; | ||
removeClass: (node: HTMLElement, className: string) => HTMLElement; | ||
toggleClass: (node: HTMLElement, className: string) => HTMLElement; | ||
hasClass: (node: Element, className: string) => boolean; | ||
addClass: (node: Element, className: string) => Element; | ||
removeClass: (node: Element, className: string) => Element; | ||
toggleClass: (node: Element, className: string) => Element; | ||
``` | ||
@@ -32,10 +32,10 @@ | ||
```typescript | ||
getStyle: (node: HTMLElement, property: string) => string; | ||
getStyle: (node: HTMLElement) => Object; | ||
getStyle: (node: Element, property: string) => string; | ||
getStyle: (node: Element) => Object; | ||
removeStyle: (node: HTMLElement, property: string) => void; | ||
removeStyle: (node: HTMLElement, propertys: Array<string>) => void; | ||
removeStyle: (node: Element, property: string) => void; | ||
removeStyle: (node: Element, propertys: Array<string>) => void; | ||
addStyle: (node: HTMLElement, property: string, value: string) => void; | ||
addStyle: (node: HTMLElement, style: Object) => void; | ||
addStyle: (node: Element, property: string, value: string) => void; | ||
addStyle: (node: Element, style: Object) => void; | ||
``` | ||
@@ -46,6 +46,6 @@ | ||
```typescript | ||
on: (target: HTMLElement, eventName: string, listener: Function, capture: boolean = false) => { | ||
on: (target: Element, eventName: string, listener: Function, capture: boolean = false) => { | ||
off: Function; | ||
}; | ||
off: (target: HTMLElement, eventName: string, listener: Function, capture: boolean = false) => | ||
off: (target: Element, eventName: string, listener: Function, capture: boolean = false) => | ||
void; | ||
@@ -57,15 +57,15 @@ ``` | ||
```typescript | ||
activeElement: () => HTMLElement; | ||
getHeight: (node: HTMLElement, client: HTMLElement) => number; | ||
getWidth: (node: HTMLElement, client: HTMLElement) => number; | ||
getOffset: (node: HTMLElement) => Object; | ||
getOffsetParent: (node: HTMLElement) => Object; | ||
getPosition: (node: HTMLElement, offsetParent) => Object; | ||
getWindow: (node: HTMLElement) => String; | ||
nodeName: (node: HTMLElement) => String; | ||
ownerDocument: (node: HTMLElement) => Object; | ||
ownerWindow: (node: HTMLElement) => Object; | ||
contains: (context: HTMLElement, node: HTMLElement) => boolean; | ||
scrollLeft: (node: HTMLElement) => number; | ||
scrollTop: (node: HTMLElement) => number; | ||
activeElement: () => Element; | ||
getHeight: (node: Element, client: Element) => number; | ||
getWidth: (node: Element, client: Element) => number; | ||
getOffset: (node: Element) => Object; | ||
getOffsetParent: (node: Element) => Object; | ||
getPosition: (node: Element, offsetParent) => Object; | ||
getWindow: (node: Element) => String; | ||
nodeName: (node: Element) => String; | ||
ownerDocument: (node: Element) => Object; | ||
ownerWindow: (node: Element) => Object; | ||
contains: (context: Element, node: Element) => boolean; | ||
scrollLeft: (node: Element) => number; | ||
scrollTop: (node: Element) => number; | ||
``` | ||
@@ -76,9 +76,7 @@ | ||
```typescript | ||
scrollLeft: (node: HTMLElement, val: number) => void; | ||
scrollTop: (node: HTMLElement, val: number) => void; | ||
scrollLeft: (node: Element, val: number) => void; | ||
scrollTop: (node: Element, val: number) => void; | ||
``` | ||
[build-badge]: https://travis-ci.org/rsuite/dom-lib.svg?branch=master | ||
[build]: https://travis-ci.org/rsuite/dom-lib | ||
[npm-badge]: https://badge.fury.io/js/dom-lib.svg | ||
[npm]: http://badge.fury.io/js/dom-lib |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
135392
3710
78