@fluentui/react-component-ref
Advanced tools
Comparing version 0.44.0 to 0.45.0
@@ -8,3 +8,3 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
@@ -31,6 +31,5 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); | ||
if (ref !== null && (0, _typeof2.default)(ref) === 'object') { | ||
if (ref !== null && (0, _typeof2["default"])(ref) === 'object') { | ||
// The `current` property is defined as readonly, however it's a valid way because | ||
// `ref` is a mutable object | ||
; | ||
ref.current = node; | ||
@@ -41,2 +40,3 @@ } | ||
var _default = handleRef; | ||
exports.default = _default; | ||
exports["default"] = _default; | ||
//# sourceMappingURL=handleRef.js.map |
@@ -18,3 +18,3 @@ "use strict"; | ||
get: function get() { | ||
return _handleRef.default; | ||
return _handleRef["default"]; | ||
} | ||
@@ -25,3 +25,3 @@ }); | ||
get: function get() { | ||
return _isRefObject.default; | ||
return _isRefObject["default"]; | ||
} | ||
@@ -32,3 +32,3 @@ }); | ||
get: function get() { | ||
return _Ref.default; | ||
return _Ref["default"]; | ||
} | ||
@@ -39,3 +39,3 @@ }); | ||
get: function get() { | ||
return _RefFindNode.default; | ||
return _RefFindNode["default"]; | ||
} | ||
@@ -46,3 +46,3 @@ }); | ||
get: function get() { | ||
return _RefForward.default; | ||
return _RefForward["default"]; | ||
} | ||
@@ -72,2 +72,3 @@ }); | ||
}); | ||
}); | ||
}); | ||
//# sourceMappingURL=index.js.map |
@@ -8,3 +8,3 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
@@ -16,3 +16,3 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); | ||
return (// https://github.com/facebook/react/blob/v16.8.2/packages/react-reconciler/src/ReactFiberCommitWork.js#L665 | ||
ref !== null && (0, _typeof2.default)(ref) === 'object' && ref.hasOwnProperty('current') | ||
ref !== null && (0, _typeof2["default"])(ref) === 'object' && ref.hasOwnProperty('current') | ||
); | ||
@@ -22,2 +22,3 @@ }; | ||
var _default = isRefObject; | ||
exports.default = _default; | ||
exports["default"] = _default; | ||
//# sourceMappingURL=isRefObject.js.map |
@@ -10,3 +10,3 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
@@ -30,5 +30,5 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); | ||
innerRef = props.innerRef, | ||
rest = (0, _objectWithoutProperties2.default)(props, ["children", "innerRef"]); | ||
rest = (0, _objectWithoutProperties2["default"])(props, ["children", "innerRef"]); | ||
var child = React.Children.only(children); | ||
var ElementType = ReactIs.isForwardRef(child) ? _RefForward.default : _RefFindNode.default; | ||
var ElementType = ReactIs.isForwardRef(child) ? _RefForward["default"] : _RefFindNode["default"]; | ||
var childWithProps = child && rest && Object.keys(rest).length > 0 ? React.cloneElement(child, rest) : child; | ||
@@ -50,2 +50,3 @@ return React.createElement(ElementType, { | ||
var _default = Ref; | ||
exports.default = _default; | ||
exports["default"] = _default; | ||
//# sourceMappingURL=Ref.js.map |
@@ -10,3 +10,3 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
@@ -40,3 +40,3 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
function (_React$Component) { | ||
(0, _inherits2.default)(RefFindNode, _React$Component); | ||
(0, _inherits2["default"])(RefFindNode, _React$Component); | ||
@@ -48,3 +48,3 @@ function RefFindNode() { | ||
(0, _classCallCheck2.default)(this, RefFindNode); | ||
(0, _classCallCheck2["default"])(this, RefFindNode); | ||
@@ -55,12 +55,12 @@ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
_this = (0, _possibleConstructorReturn2.default)(this, (_getPrototypeOf2 = (0, _getPrototypeOf3.default)(RefFindNode)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "prevNode", null); | ||
_this = (0, _possibleConstructorReturn2["default"])(this, (_getPrototypeOf2 = (0, _getPrototypeOf3["default"])(RefFindNode)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "prevNode", null); | ||
return _this; | ||
} | ||
(0, _createClass2.default)(RefFindNode, [{ | ||
(0, _createClass2["default"])(RefFindNode, [{ | ||
key: "componentDidMount", | ||
value: function componentDidMount() { | ||
this.prevNode = ReactDOM.findDOMNode(this); | ||
(0, _handleRef.default)(this.props.innerRef, this.prevNode); | ||
(0, _handleRef["default"])(this.props.innerRef, this.prevNode); | ||
} | ||
@@ -74,7 +74,7 @@ }, { | ||
this.prevNode = currentNode; | ||
(0, _handleRef.default)(this.props.innerRef, currentNode); | ||
(0, _handleRef["default"])(this.props.innerRef, currentNode); | ||
} | ||
if (prevProps.innerRef !== this.props.innerRef) { | ||
(0, _handleRef.default)(this.props.innerRef, currentNode); | ||
(0, _handleRef["default"])(this.props.innerRef, currentNode); | ||
} | ||
@@ -85,3 +85,3 @@ } | ||
value: function componentWillUnmount() { | ||
(0, _handleRef.default)(this.props.innerRef, null); | ||
(0, _handleRef["default"])(this.props.innerRef, null); | ||
delete this.prevNode; | ||
@@ -99,7 +99,8 @@ } | ||
exports.default = RefFindNode; | ||
(0, _defineProperty2.default)(RefFindNode, "displayName", 'RefFindNode'); | ||
(0, _defineProperty2.default)(RefFindNode, "propTypes", process.env.NODE_ENV !== 'production' ? { | ||
exports["default"] = RefFindNode; | ||
(0, _defineProperty2["default"])(RefFindNode, "displayName", 'RefFindNode'); | ||
(0, _defineProperty2["default"])(RefFindNode, "propTypes", process.env.NODE_ENV !== 'production' ? { | ||
children: PropTypes.element.isRequired, | ||
innerRef: _types.refPropType.isRequired | ||
} : {}); | ||
} : {}); | ||
//# sourceMappingURL=RefFindNode.js.map |
@@ -10,3 +10,3 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
exports["default"] = void 0; | ||
@@ -38,3 +38,3 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
function (_React$Component) { | ||
(0, _inherits2.default)(RefForward, _React$Component); | ||
(0, _inherits2["default"])(RefForward, _React$Component); | ||
@@ -46,3 +46,3 @@ function RefForward() { | ||
(0, _classCallCheck2.default)(this, RefForward); | ||
(0, _classCallCheck2["default"])(this, RefForward); | ||
@@ -53,9 +53,9 @@ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
_this = (0, _possibleConstructorReturn2.default)(this, (_getPrototypeOf2 = (0, _getPrototypeOf3.default)(RefForward)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleRefOverride", function (node) { | ||
_this = (0, _possibleConstructorReturn2["default"])(this, (_getPrototypeOf2 = (0, _getPrototypeOf3["default"])(RefForward)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleRefOverride", function (node) { | ||
var _this$props = _this.props, | ||
children = _this$props.children, | ||
innerRef = _this$props.innerRef; | ||
(0, _handleRef.default)(children.ref, node); | ||
(0, _handleRef.default)(innerRef, node); | ||
(0, _handleRef["default"])(children.ref, node); | ||
(0, _handleRef["default"])(innerRef, node); | ||
}); | ||
@@ -65,3 +65,3 @@ return _this; | ||
(0, _createClass2.default)(RefForward, [{ | ||
(0, _createClass2["default"])(RefForward, [{ | ||
key: "render", | ||
@@ -78,7 +78,8 @@ value: function render() { | ||
exports.default = RefForward; | ||
(0, _defineProperty2.default)(RefForward, "displayName", 'RefForward'); | ||
(0, _defineProperty2.default)(RefForward, "propTypes", process.env.NODE_ENV !== 'production' ? { | ||
exports["default"] = RefForward; | ||
(0, _defineProperty2["default"])(RefForward, "displayName", 'RefForward'); | ||
(0, _defineProperty2["default"])(RefForward, "propTypes", process.env.NODE_ENV !== 'production' ? { | ||
children: PropTypes.element.isRequired, | ||
innerRef: _types.refPropType.isRequired | ||
} : {}); | ||
} : {}); | ||
//# sourceMappingURL=RefForward.js.map |
@@ -14,2 +14,3 @@ "use strict"; | ||
var refPropType = PropTypes.oneOfType([PropTypes.func, PropTypes.object]); | ||
exports.refPropType = refPropType; | ||
exports.refPropType = refPropType; | ||
//# sourceMappingURL=types.js.map |
@@ -24,3 +24,2 @@ import _typeof from "@babel/runtime/helpers/esm/typeof"; | ||
// `ref` is a mutable object | ||
; | ||
ref.current = node; | ||
@@ -30,2 +29,3 @@ } | ||
export default handleRef; | ||
export default handleRef; | ||
//# sourceMappingURL=handleRef.js.map |
@@ -6,2 +6,3 @@ export { default as handleRef } from './handleRef'; | ||
export { default as RefForward } from './RefForward'; | ||
export * from './types'; | ||
export * from './types'; | ||
//# sourceMappingURL=index.js.map |
@@ -10,2 +10,3 @@ import _typeof from "@babel/runtime/helpers/esm/typeof"; | ||
export default isRefObject; | ||
export default isRefObject; | ||
//# sourceMappingURL=isRefObject.js.map |
@@ -31,2 +31,3 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
export default Ref; | ||
export default Ref; | ||
//# sourceMappingURL=Ref.js.map |
@@ -81,2 +81,3 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
export { RefFindNode as default }; | ||
export { RefFindNode as default }; | ||
//# sourceMappingURL=RefFindNode.js.map |
@@ -62,2 +62,3 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
export { RefForward as default }; | ||
export { RefForward as default }; | ||
//# sourceMappingURL=RefForward.js.map |
import * as PropTypes from 'prop-types'; | ||
/** A checker that matches the React.Ref type. */ | ||
export var refPropType = PropTypes.oneOfType([PropTypes.func, PropTypes.object]); | ||
export var refPropType = PropTypes.oneOfType([PropTypes.func, PropTypes.object]); | ||
//# sourceMappingURL=types.js.map |
{ | ||
"name": "@fluentui/react-component-ref", | ||
"description": "A set of components and utils to deal with React refs.", | ||
"version": "0.44.0", | ||
"version": "0.45.0", | ||
"author": "Oleksandr Fediashov <olfedias@microsoft.com>", | ||
"bugs": "https://github.com/microsoft/fluent-ui-react/issues", | ||
"bugs": "https://github.com/OfficeDev/office-ui-fabric-react/issues", | ||
"dependencies": { | ||
"@babel/runtime": "^7.1.2", | ||
"@babel/runtime": "^7.7.6", | ||
"prop-types": "^15.7.2", | ||
@@ -13,4 +13,5 @@ "react-is": "^16.6.3" | ||
"devDependencies": { | ||
"@fluentui/internal-tooling": "^0.44.0", | ||
"@types/react": "16.8.11", | ||
"@types/react-is": "^16.7.1", | ||
"@uifabric/build": "^7.0.0", | ||
"lerna-alias": "^3.0.3-0" | ||
@@ -21,3 +22,3 @@ }, | ||
], | ||
"homepage": "https://github.com/microsoft/fluent-ui-react/tree/master/packages/react-component-ref", | ||
"homepage": "https://github.com/OfficeDev/office-ui-fabric-react/tree/master/packages/fluentui/react-component-ref", | ||
"jsnext:main": "dist/es/index.js", | ||
@@ -34,6 +35,10 @@ "license": "MIT", | ||
}, | ||
"repository": "microsoft/fluent-ui-react.git", | ||
"repository": "OfficeDev/office-ui-fabric-react.git", | ||
"scripts": { | ||
"build": "gulp bundle:package:no-umd", | ||
"clean": "gulp bundle:package:clean", | ||
"lint": "yarn lint:eslint && yarn lint:old", | ||
"lint:eslint": "eslint --ext .js,.ts,.tsx .", | ||
"lint:fix": "yarn lint:eslint --fix && yarn lint:old --fix", | ||
"lint:old": "tslint -t stylish -p .", | ||
"test": "gulp test", | ||
@@ -44,3 +49,4 @@ "test:watch": "gulp test:watch" | ||
"types": "dist/es/index.d.ts", | ||
"gitHead": "39b6d1fbd11d7444d2808a8ff5d06ca2e997fe3b" | ||
"private": false, | ||
"gitHead": "d08e21664e66fd0203260f1d2f441007bca02915" | ||
} |
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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
156508
64
983
4
12
Updated@babel/runtime@^7.7.6