@vx/responsive
Advanced tools
Comparing version 0.0.193-alpha.1 to 0.0.193-alpha.2
@@ -0,1 +1,3 @@ | ||
import _pt from "prop-types"; | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
@@ -44,4 +46,4 @@ | ||
_this.state = { | ||
parentWidth: null, | ||
parentHeight: null | ||
parentWidth: undefined, | ||
parentHeight: undefined | ||
}; | ||
@@ -102,5 +104,8 @@ _this.animationFrameID = null; | ||
return WrappedComponent; | ||
}(React.Component), _defineProperty(_class, "defaultProps", { | ||
}(React.Component), _defineProperty(_class, "propTypes", { | ||
parentWidth: _pt.number, | ||
parentHeight: _pt.number | ||
}), _defineProperty(_class, "defaultProps", { | ||
debounceTime: 300 | ||
}), _temp; | ||
} |
@@ -0,1 +1,3 @@ | ||
import _pt from "prop-types"; | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
@@ -40,4 +42,4 @@ | ||
_this.state = { | ||
screenWidth: null, | ||
screenHeight: null | ||
screenWidth: undefined, | ||
screenHeight: undefined | ||
}; | ||
@@ -71,5 +73,8 @@ _this.handleResize = debounce(_this.resize, props.windowResizeDebounceTime); | ||
return WrappedComponent; | ||
}(React.Component), _defineProperty(_class, "defaultProps", { | ||
}(React.Component), _defineProperty(_class, "propTypes", { | ||
screenWidth: _pt.number, | ||
screenHeight: _pt.number | ||
}), _defineProperty(_class, "defaultProps", { | ||
windowResizeDebounceTime: 300 | ||
}), _temp; | ||
} |
@@ -7,8 +7,8 @@ import React from 'react'; | ||
declare type WithParentSizeState = { | ||
parentWidth: number | null; | ||
parentHeight: number | null; | ||
parentWidth?: number; | ||
parentHeight?: number; | ||
}; | ||
export declare type WithParentSizeProvidedProps = WithParentSizeState; | ||
export default function withParentSize<Props extends WithParentSizeProps = {}>(BaseComponent: React.ComponentType<Props>): { | ||
new (props: Props): { | ||
export default function withParentSize<BaseComponentProps extends WithParentSizeProps = {}>(BaseComponent: React.ComponentType<BaseComponentProps & WithParentSizeProvidedProps>): { | ||
new (props: BaseComponentProps & WithParentSizeState): { | ||
animationFrameID: number | null; | ||
@@ -29,5 +29,5 @@ resizeObserver: ResizeObserver | undefined; | ||
context: any; | ||
setState<K extends "parentWidth" | "parentHeight">(state: WithParentSizeState | ((prevState: Readonly<WithParentSizeState>, props: Readonly<Props>) => WithParentSizeState | Pick<WithParentSizeState, K> | null) | Pick<WithParentSizeState, K> | null, callback?: (() => void) | undefined): void; | ||
setState<K extends "parentWidth" | "parentHeight">(state: WithParentSizeState | ((prevState: Readonly<WithParentSizeState>, props: Readonly<BaseComponentProps & WithParentSizeState>) => WithParentSizeState | Pick<WithParentSizeState, K> | null) | Pick<WithParentSizeState, K> | null, callback?: (() => void) | undefined): void; | ||
forceUpdate(callback?: (() => void) | undefined): void; | ||
readonly props: Readonly<Props> & Readonly<{ | ||
readonly props: Readonly<BaseComponentProps & WithParentSizeState> & Readonly<{ | ||
children?: React.ReactNode; | ||
@@ -39,12 +39,12 @@ }>; | ||
}; | ||
shouldComponentUpdate?(nextProps: Readonly<Props>, nextState: Readonly<WithParentSizeState>, nextContext: any): boolean; | ||
shouldComponentUpdate?(nextProps: Readonly<BaseComponentProps & WithParentSizeState>, nextState: Readonly<WithParentSizeState>, nextContext: any): boolean; | ||
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; | ||
getSnapshotBeforeUpdate?(prevProps: Readonly<Props>, prevState: Readonly<WithParentSizeState>): any; | ||
componentDidUpdate?(prevProps: Readonly<Props>, prevState: Readonly<WithParentSizeState>, snapshot?: any): void; | ||
getSnapshotBeforeUpdate?(prevProps: Readonly<BaseComponentProps & WithParentSizeState>, prevState: Readonly<WithParentSizeState>): any; | ||
componentDidUpdate?(prevProps: Readonly<BaseComponentProps & WithParentSizeState>, prevState: Readonly<WithParentSizeState>, snapshot?: any): void; | ||
componentWillMount?(): void; | ||
UNSAFE_componentWillMount?(): void; | ||
componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void; | ||
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void; | ||
componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<WithParentSizeState>, nextContext: any): void; | ||
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<WithParentSizeState>, nextContext: any): void; | ||
componentWillReceiveProps?(nextProps: Readonly<BaseComponentProps & WithParentSizeState>, nextContext: any): void; | ||
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<BaseComponentProps & WithParentSizeState>, nextContext: any): void; | ||
componentWillUpdate?(nextProps: Readonly<BaseComponentProps & WithParentSizeState>, nextState: Readonly<WithParentSizeState>, nextContext: any): void; | ||
UNSAFE_componentWillUpdate?(nextProps: Readonly<BaseComponentProps & WithParentSizeState>, nextState: Readonly<WithParentSizeState>, nextContext: any): void; | ||
}; | ||
@@ -51,0 +51,0 @@ defaultProps: { |
@@ -6,2 +6,4 @@ "use strict"; | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _react = _interopRequireDefault(require("react")); | ||
@@ -55,4 +57,4 @@ | ||
_this.state = { | ||
parentWidth: null, | ||
parentHeight: null | ||
parentWidth: undefined, | ||
parentHeight: undefined | ||
}; | ||
@@ -113,5 +115,8 @@ _this.animationFrameID = null; | ||
return WrappedComponent; | ||
}(_react.default.Component), _defineProperty(_class, "defaultProps", { | ||
}(_react.default.Component), _defineProperty(_class, "propTypes", { | ||
parentWidth: _propTypes.default.number, | ||
parentHeight: _propTypes.default.number | ||
}), _defineProperty(_class, "defaultProps", { | ||
debounceTime: 300 | ||
}), _temp; | ||
} |
@@ -6,8 +6,8 @@ import React from 'react'; | ||
declare type WithScreenSizeState = { | ||
screenWidth: number | null; | ||
screenHeight: number | null; | ||
screenWidth?: number; | ||
screenHeight?: number; | ||
}; | ||
export declare type WithScreenSizeProvidedProps = WithScreenSizeState; | ||
export default function withScreenSize<Props extends WithScreenSizeProps = {}>(BaseComponent: React.ComponentType<Props>): { | ||
new (props: Props): { | ||
export default function withScreenSize<BaseComponentProps extends WithScreenSizeProps = {}>(BaseComponent: React.ComponentType<BaseComponentProps>): { | ||
new (props: BaseComponentProps & WithScreenSizeState): { | ||
handleResize: () => void; | ||
@@ -19,5 +19,5 @@ componentDidMount(): void; | ||
context: any; | ||
setState<K extends "screenWidth" | "screenHeight">(state: WithScreenSizeState | ((prevState: Readonly<WithScreenSizeState>, props: Readonly<Props>) => WithScreenSizeState | Pick<WithScreenSizeState, K> | null) | Pick<WithScreenSizeState, K> | null, callback?: (() => void) | undefined): void; | ||
setState<K extends "screenWidth" | "screenHeight">(state: WithScreenSizeState | ((prevState: Readonly<WithScreenSizeState>, props: Readonly<BaseComponentProps & WithScreenSizeState>) => WithScreenSizeState | Pick<WithScreenSizeState, K> | null) | Pick<WithScreenSizeState, K> | null, callback?: (() => void) | undefined): void; | ||
forceUpdate(callback?: (() => void) | undefined): void; | ||
readonly props: Readonly<Props> & Readonly<{ | ||
readonly props: Readonly<BaseComponentProps & WithScreenSizeState> & Readonly<{ | ||
children?: React.ReactNode; | ||
@@ -29,12 +29,12 @@ }>; | ||
}; | ||
shouldComponentUpdate?(nextProps: Readonly<Props>, nextState: Readonly<WithScreenSizeState>, nextContext: any): boolean; | ||
shouldComponentUpdate?(nextProps: Readonly<BaseComponentProps & WithScreenSizeState>, nextState: Readonly<WithScreenSizeState>, nextContext: any): boolean; | ||
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; | ||
getSnapshotBeforeUpdate?(prevProps: Readonly<Props>, prevState: Readonly<WithScreenSizeState>): any; | ||
componentDidUpdate?(prevProps: Readonly<Props>, prevState: Readonly<WithScreenSizeState>, snapshot?: any): void; | ||
getSnapshotBeforeUpdate?(prevProps: Readonly<BaseComponentProps & WithScreenSizeState>, prevState: Readonly<WithScreenSizeState>): any; | ||
componentDidUpdate?(prevProps: Readonly<BaseComponentProps & WithScreenSizeState>, prevState: Readonly<WithScreenSizeState>, snapshot?: any): void; | ||
componentWillMount?(): void; | ||
UNSAFE_componentWillMount?(): void; | ||
componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void; | ||
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props>, nextContext: any): void; | ||
componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<WithScreenSizeState>, nextContext: any): void; | ||
UNSAFE_componentWillUpdate?(nextProps: Readonly<Props>, nextState: Readonly<WithScreenSizeState>, nextContext: any): void; | ||
componentWillReceiveProps?(nextProps: Readonly<BaseComponentProps & WithScreenSizeState>, nextContext: any): void; | ||
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<BaseComponentProps & WithScreenSizeState>, nextContext: any): void; | ||
componentWillUpdate?(nextProps: Readonly<BaseComponentProps & WithScreenSizeState>, nextState: Readonly<WithScreenSizeState>, nextContext: any): void; | ||
UNSAFE_componentWillUpdate?(nextProps: Readonly<BaseComponentProps & WithScreenSizeState>, nextState: Readonly<WithScreenSizeState>, nextContext: any): void; | ||
}; | ||
@@ -41,0 +41,0 @@ defaultProps: { |
@@ -6,2 +6,4 @@ "use strict"; | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _debounce = _interopRequireDefault(require("lodash/debounce")); | ||
@@ -50,4 +52,4 @@ | ||
_this.state = { | ||
screenWidth: null, | ||
screenHeight: null | ||
screenWidth: undefined, | ||
screenHeight: undefined | ||
}; | ||
@@ -81,5 +83,8 @@ _this.handleResize = (0, _debounce.default)(_this.resize, props.windowResizeDebounceTime); | ||
return WrappedComponent; | ||
}(_react.default.Component), _defineProperty(_class, "defaultProps", { | ||
}(_react.default.Component), _defineProperty(_class, "propTypes", { | ||
screenWidth: _propTypes.default.number, | ||
screenHeight: _propTypes.default.number | ||
}), _defineProperty(_class, "defaultProps", { | ||
windowResizeDebounceTime: 300 | ||
}), _temp; | ||
} |
{ | ||
"name": "@vx/responsive", | ||
"version": "0.0.193-alpha.1", | ||
"version": "0.0.193-alpha.2", | ||
"description": "vx responsive svg", | ||
@@ -46,3 +46,3 @@ "sideEffects": false, | ||
}, | ||
"gitHead": "a26fe227eeb3b1264b8419d43ed5a7deed7a8111" | ||
"gitHead": "8f3783829cc066ca037e6c52b0f51893edca4c3f" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
45675
768