@fluentui/react-component-ref
Advanced tools
Comparing version 0.46.0 to 0.47.0
@@ -8,3 +8,3 @@ "use strict"; | ||
}); | ||
exports["default"] = void 0; | ||
exports.default = void 0; | ||
@@ -31,3 +31,3 @@ 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 | ||
@@ -40,3 +40,3 @@ // `ref` is a mutable object | ||
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; | ||
} | ||
@@ -49,0 +49,0 @@ }); |
@@ -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,3 +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,3 +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,5 +99,5 @@ } | ||
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, | ||
@@ -104,0 +104,0 @@ innerRef: _types.refPropType.isRequired |
@@ -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,5 +78,5 @@ 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, | ||
@@ -83,0 +83,0 @@ innerRef: _types.refPropType.isRequired |
@@ -22,5 +22,5 @@ "use strict"; | ||
children: PropTypes.element.isRequired, | ||
innerRef: types_1.refPropType.isRequired | ||
innerRef: types_1.refPropType.isRequired, | ||
}; | ||
} | ||
exports.default = Ref; |
@@ -43,3 +43,3 @@ "use strict"; | ||
children: PropTypes.element.isRequired, | ||
innerRef: types_1.refPropType.isRequired | ||
innerRef: types_1.refPropType.isRequired, | ||
} | ||
@@ -46,0 +46,0 @@ : {}; |
@@ -22,3 +22,3 @@ "use strict"; | ||
return React.cloneElement(children, { | ||
ref: this.handleRefOverride | ||
ref: this.handleRefOverride, | ||
}); | ||
@@ -31,3 +31,3 @@ }; | ||
children: PropTypes.element.isRequired, | ||
innerRef: types_1.refPropType.isRequired | ||
innerRef: types_1.refPropType.isRequired, | ||
} | ||
@@ -34,0 +34,0 @@ : {}; |
{ | ||
"name": "@fluentui/react-component-ref", | ||
"description": "A set of components and utils to deal with React refs.", | ||
"version": "0.46.0", | ||
"version": "0.47.0", | ||
"author": "Oleksandr Fediashov <olfedias@microsoft.com>", | ||
@@ -46,3 +46,3 @@ "bugs": "https://github.com/OfficeDev/office-ui-fabric-react/issues", | ||
"types": "dist/es/index.d.ts", | ||
"gitHead": "04b131d5bd3209f5d3daf8c6d5c49f2cc0894730" | ||
"gitHead": "36ed94b0250ee3316e9aaec4697ced1cf229dcb1" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
155123