@atlaskit/layer
Advanced tools
Comparing version 2.5.3 to 2.5.4
@@ -1,6 +0,16 @@ | ||
<a name="2.5.3"></a> | ||
## 2.5.3 (2017-08-09) | ||
<a name="2.5.4"></a> | ||
## 2.5.4 (2017-09-19) | ||
<a name="2.5.4"></a> | ||
## 2.5.4 (2017-09-19) | ||
### Bug Fixes | ||
* **component:** support z-index on layer's content ([42f6b69](https://bitbucket.org/atlassian/atlaskit/commits/42f6b69)) | ||
<a name="2.5.3"></a> | ||
@@ -7,0 +17,0 @@ ## 2.5.3 (2017-08-09) |
@@ -166,3 +166,3 @@ module.exports = /******/ | ||
}, Layer.prototype.render = function() { | ||
var _this2 = this, _state = this.state, cssPosition = _state.cssPosition, transform = _state.transform; | ||
var _this2 = this, zIndex = this.props.zIndex, _state = this.state, cssPosition = _state.cssPosition, transform = _state.transform; | ||
return _react2.default.createElement("div", null, _react2.default.createElement("div", { | ||
@@ -181,3 +181,3 @@ ref: function(_ref) { | ||
transform: transform, | ||
zIndex: _utilSharedStyles.akZIndexLayer | ||
zIndex: zIndex | ||
} | ||
@@ -191,17 +191,19 @@ }, this.props.content)); | ||
Layer.propTypes = { | ||
position: _propTypes2.default.oneOf(_helpers.POSITION_ATTRIBUTE_ENUM.values), | ||
autoFlip: _propTypes2.default.oneOfType([ _propTypes2.default.bool, _propTypes2.default.arrayOf(_propTypes2.default.oneOf([ "top", "right", "bottom", "left" ])) ]), | ||
boundariesElement: _propTypes2.default.oneOf([ "viewport", "window", "scrollParent" ]), | ||
children: _propTypes2.default.node, | ||
content: _propTypes2.default.node, | ||
offset: _propTypes2.default.string, | ||
content: _propTypes2.default.node, | ||
onFlippedChange: _propTypes2.default.func, | ||
children: _propTypes2.default.node | ||
position: _propTypes2.default.oneOf(_helpers.POSITION_ATTRIBUTE_ENUM.values), | ||
zIndex: _propTypes2.default.number | ||
}, Layer.defaultProps = { | ||
position: _helpers.POSITION_ATTRIBUTE_ENUM.default, | ||
autoFlip: !0, | ||
boundariesElement: "viewport", | ||
autoFlip: !0, | ||
children: null, | ||
content: null, | ||
offset: "0 0", | ||
content: null, | ||
onFlippedChange: function() {}, | ||
children: null | ||
position: _helpers.POSITION_ATTRIBUTE_ENUM.default, | ||
zIndex: _utilSharedStyles.akZIndexLayer | ||
}, exports.default = Layer; | ||
@@ -208,0 +210,0 @@ }, /* 2 */ |
@@ -1,1 +0,1 @@ | ||
module.exports=function(t){function o(i){if(e[i])return e[i].exports;var n=e[i]={exports:{},id:i,loaded:!1};return t[i].call(n.exports,n,n.exports,o),n.loaded=!0,n.exports}var e={};return o.m=t,o.c=e,o.p="",o(0)}([function(t,o,e){t.exports=e(1)},function(t,o,e){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(o,"__esModule",{value:!0});var n=e(2),r=i(n),p=e(3),s=i(p),l=e(4),a=i(l),f=e(5),u=i(f),d=e(6),c=i(d),h=e(7),m=i(h),b=e(8),g=e(9),P=function(t){function o(e){(0,r.default)(this,o);var i=(0,s.default)(this,t.call(this,e));return i.extractStyles=function(t){if(t){var o=Math.round(t.offsets.popper.left),e=Math.round(t.offsets.popper.top);i.setState({cssPosition:t.offsets.popper.position,transform:"translate3d("+o+"px, "+e+"px, 0px)",flipped:!!t.flipped,actualPosition:t.position,originalPosition:t.originalPosition})}},i.state={position:null,transform:null,flipped:!1,actualPosition:null,offsets:{popper:{left:-9999,top:-9999}},originalPosition:null,cssPosition:"absolute"},i}return(0,a.default)(o,t),o.prototype.componentDidMount=function(){this.applyPopper(this.props)},o.prototype.componentWillReceiveProps=function(t){this.applyPopper(t)},o.prototype.componentDidUpdate=function(t,o){o.flipped!==this.state.flipped&&this.props.onFlippedChange({flipped:this.state.flipped,actualPosition:this.state.actualPosition,originalPosition:this.state.originalPosition})},o.prototype.componentWillUnmount=function(){this.popper&&this.popper.destroy()},o.prototype.applyPopper=function(t){if(this.targetRef&&this.contentRef&&(this.popper&&this.popper.destroy(),t.content)){var o=this.targetRef.firstChild,e={placement:(0,g.positionPropToPopperPosition)(t.position),onCreate:this.extractStyles,onUpdate:this.extractStyles,modifiers:{applyStyle:{enabled:!1},hide:{enabled:!1},offset:{enabled:!0,offset:this.props.offset},flip:{enabled:!!this.props.autoFlip,flipVariations:!0,boundariesElement:this.props.boundariesElement,padding:0},preventOverflow:{enabled:!!this.props.autoFlip,escapeWithReference:!0}}},i=(0,g.getFlipBehavior)(t);i&&(e.modifiers.flip.behavior=i),this.popper=new m.default(o,this.contentRef,e)}},o.prototype.render=function(){var t=this,o=this.state,e=o.cssPosition,i=o.transform;return c.default.createElement("div",null,c.default.createElement("div",{ref:function(o){return t.targetRef=o}},this.props.children),c.default.createElement("div",{ref:function(o){return t.contentRef=o},style:{top:0,left:0,position:e,transform:i,zIndex:b.akZIndexLayer}},this.props.content))},o}(d.PureComponent);P.propTypes={position:u.default.oneOf(g.POSITION_ATTRIBUTE_ENUM.values),autoFlip:u.default.oneOfType([u.default.bool,u.default.arrayOf(u.default.oneOf(["top","right","bottom","left"]))]),boundariesElement:u.default.oneOf(["viewport","window","scrollParent"]),offset:u.default.string,content:u.default.node,onFlippedChange:u.default.func,children:u.default.node},P.defaultProps={position:g.POSITION_ATTRIBUTE_ENUM.default,boundariesElement:"viewport",autoFlip:!0,offset:"0 0",content:null,onFlippedChange:function(){},children:null},o.default=P},function(t,o){t.exports=require("babel-runtime/helpers/classCallCheck")},function(t,o){t.exports=require("babel-runtime/helpers/possibleConstructorReturn")},function(t,o){t.exports=require("babel-runtime/helpers/inherits")},function(t,o){t.exports=require("prop-types")},function(t,o){t.exports=require("react")},function(t,o){t.exports=require("popper.js")},function(t,o){t.exports=require("@atlaskit/util-shared-styles")},function(t,o){"use strict";function e(t){return r[t]?r[t].position:null}function i(t){return Array.isArray(t.autoFlip)?[t.position.split(" ")[0]].concat(t.autoFlip):null}function n(t){return e(t)||r[p.default].position}Object.defineProperty(o,"__esModule",{value:!0});var r={"top left":{position:"top-start",animation:"top"},"top center":{position:"top",animation:"top"},"top right":{position:"top-end",animation:"top"},"right top":{position:"right-start",animation:"right"},"right middle":{position:"right",animation:"right"},"right bottom":{position:"right-end",animation:"right"},"bottom left":{position:"bottom-start",animation:"bottom"},"bottom center":{position:"bottom",animation:"bottom"},"bottom right":{position:"bottom-end",animation:"bottom"},"left top":{position:"left-start",animation:"left"},"left middle":{position:"left",animation:"left"},"left bottom":{position:"left-end",animation:"left"}},p={values:["top left","top center","top right","right top","right middle","right bottom","bottom left","bottom center","bottom right","left top","left middle","left bottom"],default:"right middle"};o.getFlipBehavior=i,o.positionPropToPopperPosition=n,o.POSITION_ATTRIBUTE_ENUM=p}]); | ||
module.exports=function(t){function o(i){if(e[i])return e[i].exports;var n=e[i]={exports:{},id:i,loaded:!1};return t[i].call(n.exports,n,n.exports,o),n.loaded=!0,n.exports}var e={};return o.m=t,o.c=e,o.p="",o(0)}([function(t,o,e){t.exports=e(1)},function(t,o,e){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(o,"__esModule",{value:!0});var n=e(2),r=i(n),p=e(3),s=i(p),l=e(4),a=i(l),f=e(5),u=i(f),d=e(6),c=i(d),h=e(7),m=i(h),b=e(8),g=e(9),P=function(t){function o(e){(0,r.default)(this,o);var i=(0,s.default)(this,t.call(this,e));return i.extractStyles=function(t){if(t){var o=Math.round(t.offsets.popper.left),e=Math.round(t.offsets.popper.top);i.setState({cssPosition:t.offsets.popper.position,transform:"translate3d("+o+"px, "+e+"px, 0px)",flipped:!!t.flipped,actualPosition:t.position,originalPosition:t.originalPosition})}},i.state={position:null,transform:null,flipped:!1,actualPosition:null,offsets:{popper:{left:-9999,top:-9999}},originalPosition:null,cssPosition:"absolute"},i}return(0,a.default)(o,t),o.prototype.componentDidMount=function(){this.applyPopper(this.props)},o.prototype.componentWillReceiveProps=function(t){this.applyPopper(t)},o.prototype.componentDidUpdate=function(t,o){o.flipped!==this.state.flipped&&this.props.onFlippedChange({flipped:this.state.flipped,actualPosition:this.state.actualPosition,originalPosition:this.state.originalPosition})},o.prototype.componentWillUnmount=function(){this.popper&&this.popper.destroy()},o.prototype.applyPopper=function(t){if(this.targetRef&&this.contentRef&&(this.popper&&this.popper.destroy(),t.content)){var o=this.targetRef.firstChild,e={placement:(0,g.positionPropToPopperPosition)(t.position),onCreate:this.extractStyles,onUpdate:this.extractStyles,modifiers:{applyStyle:{enabled:!1},hide:{enabled:!1},offset:{enabled:!0,offset:this.props.offset},flip:{enabled:!!this.props.autoFlip,flipVariations:!0,boundariesElement:this.props.boundariesElement,padding:0},preventOverflow:{enabled:!!this.props.autoFlip,escapeWithReference:!0}}},i=(0,g.getFlipBehavior)(t);i&&(e.modifiers.flip.behavior=i),this.popper=new m.default(o,this.contentRef,e)}},o.prototype.render=function(){var t=this,o=this.props.zIndex,e=this.state,i=e.cssPosition,n=e.transform;return c.default.createElement("div",null,c.default.createElement("div",{ref:function(o){return t.targetRef=o}},this.props.children),c.default.createElement("div",{ref:function(o){return t.contentRef=o},style:{top:0,left:0,position:i,transform:n,zIndex:o}},this.props.content))},o}(d.PureComponent);P.propTypes={autoFlip:u.default.oneOfType([u.default.bool,u.default.arrayOf(u.default.oneOf(["top","right","bottom","left"]))]),boundariesElement:u.default.oneOf(["viewport","window","scrollParent"]),children:u.default.node,content:u.default.node,offset:u.default.string,onFlippedChange:u.default.func,position:u.default.oneOf(g.POSITION_ATTRIBUTE_ENUM.values),zIndex:u.default.number},P.defaultProps={autoFlip:!0,boundariesElement:"viewport",children:null,content:null,offset:"0 0",onFlippedChange:function(){},position:g.POSITION_ATTRIBUTE_ENUM.default,zIndex:b.akZIndexLayer},o.default=P},function(t,o){t.exports=require("babel-runtime/helpers/classCallCheck")},function(t,o){t.exports=require("babel-runtime/helpers/possibleConstructorReturn")},function(t,o){t.exports=require("babel-runtime/helpers/inherits")},function(t,o){t.exports=require("prop-types")},function(t,o){t.exports=require("react")},function(t,o){t.exports=require("popper.js")},function(t,o){t.exports=require("@atlaskit/util-shared-styles")},function(t,o){"use strict";function e(t){return r[t]?r[t].position:null}function i(t){return Array.isArray(t.autoFlip)?[t.position.split(" ")[0]].concat(t.autoFlip):null}function n(t){return e(t)||r[p.default].position}Object.defineProperty(o,"__esModule",{value:!0});var r={"top left":{position:"top-start",animation:"top"},"top center":{position:"top",animation:"top"},"top right":{position:"top-end",animation:"top"},"right top":{position:"right-start",animation:"right"},"right middle":{position:"right",animation:"right"},"right bottom":{position:"right-end",animation:"right"},"bottom left":{position:"bottom-start",animation:"bottom"},"bottom center":{position:"bottom",animation:"bottom"},"bottom right":{position:"bottom-end",animation:"bottom"},"left top":{position:"left-start",animation:"left"},"left middle":{position:"left",animation:"left"},"left bottom":{position:"left-end",animation:"left"}},p={values:["top left","top center","top right","right top","right middle","right bottom","bottom left","bottom center","bottom right","left top","left middle","left bottom"],default:"right middle"};o.getFlipBehavior=i,o.positionPropToPopperPosition=n,o.POSITION_ATTRIBUTE_ENUM=p}]); |
@@ -169,3 +169,3 @@ !function(root, factory) { | ||
}, Layer.prototype.render = function() { | ||
var _this2 = this, _state = this.state, cssPosition = _state.cssPosition, transform = _state.transform; | ||
var _this2 = this, zIndex = this.props.zIndex, _state = this.state, cssPosition = _state.cssPosition, transform = _state.transform; | ||
return _react2.default.createElement("div", null, _react2.default.createElement("div", { | ||
@@ -184,3 +184,3 @@ ref: function(_ref) { | ||
transform: transform, | ||
zIndex: _utilSharedStyles.akZIndexLayer | ||
zIndex: zIndex | ||
} | ||
@@ -194,17 +194,19 @@ }, this.props.content)); | ||
Layer.propTypes = { | ||
position: _propTypes2.default.oneOf(_helpers.POSITION_ATTRIBUTE_ENUM.values), | ||
autoFlip: _propTypes2.default.oneOfType([ _propTypes2.default.bool, _propTypes2.default.arrayOf(_propTypes2.default.oneOf([ "top", "right", "bottom", "left" ])) ]), | ||
boundariesElement: _propTypes2.default.oneOf([ "viewport", "window", "scrollParent" ]), | ||
children: _propTypes2.default.node, | ||
content: _propTypes2.default.node, | ||
offset: _propTypes2.default.string, | ||
content: _propTypes2.default.node, | ||
onFlippedChange: _propTypes2.default.func, | ||
children: _propTypes2.default.node | ||
position: _propTypes2.default.oneOf(_helpers.POSITION_ATTRIBUTE_ENUM.values), | ||
zIndex: _propTypes2.default.number | ||
}, Layer.defaultProps = { | ||
position: _helpers.POSITION_ATTRIBUTE_ENUM.default, | ||
autoFlip: !0, | ||
boundariesElement: "viewport", | ||
autoFlip: !0, | ||
children: null, | ||
content: null, | ||
offset: "0 0", | ||
content: null, | ||
onFlippedChange: function() {}, | ||
children: null | ||
position: _helpers.POSITION_ATTRIBUTE_ENUM.default, | ||
zIndex: _utilSharedStyles.akZIndexLayer | ||
}, exports.default = Layer; | ||
@@ -211,0 +213,0 @@ }, /* 2 */ |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/possibleConstructorReturn"),require("babel-runtime/helpers/inherits"),require("prop-types"),require("react"),require("popper.js"),require("@atlaskit/util-shared-styles")):"function"==typeof define&&define.amd?define(["babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","prop-types","react","popper.js","@atlaskit/util-shared-styles"],e):"object"==typeof exports?exports["@atlaskit/layer"]=e(require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/possibleConstructorReturn"),require("babel-runtime/helpers/inherits"),require("prop-types"),require("react"),require("popper.js"),require("@atlaskit/util-shared-styles")):t["@atlaskit/layer"]=e(t["babel-runtime/helpers/classCallCheck"],t["babel-runtime/helpers/possibleConstructorReturn"],t["babel-runtime/helpers/inherits"],t["prop-types"],t.react,t["popper.js"],t["@atlaskit/util-shared-styles"])}(this,function(t,e,o,i,n,r,p){return function(t){function e(i){if(o[i])return o[i].exports;var n=o[i]={exports:{},id:i,loaded:!1};return t[i].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var o={};return e.m=t,e.c=o,e.p="",e(0)}([function(t,e,o){t.exports=o(1)},function(t,e,o){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=o(2),r=i(n),p=o(3),s=i(p),l=o(4),a=i(l),u=o(5),f=i(u),d=o(6),c=i(d),h=o(7),m=i(h),b=o(8),y=o(9),g=function(t){function e(o){(0,r.default)(this,e);var i=(0,s.default)(this,t.call(this,o));return i.extractStyles=function(t){if(t){var e=Math.round(t.offsets.popper.left),o=Math.round(t.offsets.popper.top);i.setState({cssPosition:t.offsets.popper.position,transform:"translate3d("+e+"px, "+o+"px, 0px)",flipped:!!t.flipped,actualPosition:t.position,originalPosition:t.originalPosition})}},i.state={position:null,transform:null,flipped:!1,actualPosition:null,offsets:{popper:{left:-9999,top:-9999}},originalPosition:null,cssPosition:"absolute"},i}return(0,a.default)(e,t),e.prototype.componentDidMount=function(){this.applyPopper(this.props)},e.prototype.componentWillReceiveProps=function(t){this.applyPopper(t)},e.prototype.componentDidUpdate=function(t,e){e.flipped!==this.state.flipped&&this.props.onFlippedChange({flipped:this.state.flipped,actualPosition:this.state.actualPosition,originalPosition:this.state.originalPosition})},e.prototype.componentWillUnmount=function(){this.popper&&this.popper.destroy()},e.prototype.applyPopper=function(t){if(this.targetRef&&this.contentRef&&(this.popper&&this.popper.destroy(),t.content)){var e=this.targetRef.firstChild,o={placement:(0,y.positionPropToPopperPosition)(t.position),onCreate:this.extractStyles,onUpdate:this.extractStyles,modifiers:{applyStyle:{enabled:!1},hide:{enabled:!1},offset:{enabled:!0,offset:this.props.offset},flip:{enabled:!!this.props.autoFlip,flipVariations:!0,boundariesElement:this.props.boundariesElement,padding:0},preventOverflow:{enabled:!!this.props.autoFlip,escapeWithReference:!0}}},i=(0,y.getFlipBehavior)(t);i&&(o.modifiers.flip.behavior=i),this.popper=new m.default(e,this.contentRef,o)}},e.prototype.render=function(){var t=this,e=this.state,o=e.cssPosition,i=e.transform;return c.default.createElement("div",null,c.default.createElement("div",{ref:function(e){return t.targetRef=e}},this.props.children),c.default.createElement("div",{ref:function(e){return t.contentRef=e},style:{top:0,left:0,position:o,transform:i,zIndex:b.akZIndexLayer}},this.props.content))},e}(d.PureComponent);g.propTypes={position:f.default.oneOf(y.POSITION_ATTRIBUTE_ENUM.values),autoFlip:f.default.oneOfType([f.default.bool,f.default.arrayOf(f.default.oneOf(["top","right","bottom","left"]))]),boundariesElement:f.default.oneOf(["viewport","window","scrollParent"]),offset:f.default.string,content:f.default.node,onFlippedChange:f.default.func,children:f.default.node},g.defaultProps={position:y.POSITION_ATTRIBUTE_ENUM.default,boundariesElement:"viewport",autoFlip:!0,offset:"0 0",content:null,onFlippedChange:function(){},children:null},e.default=g},function(e,o){e.exports=t},function(t,o){t.exports=e},function(t,e){t.exports=o},function(t,e){t.exports=i},function(t,e){t.exports=n},function(t,e){t.exports=r},function(t,e){t.exports=p},function(t,e){"use strict";function o(t){return r[t]?r[t].position:null}function i(t){return Array.isArray(t.autoFlip)?[t.position.split(" ")[0]].concat(t.autoFlip):null}function n(t){return o(t)||r[p.default].position}Object.defineProperty(e,"__esModule",{value:!0});var r={"top left":{position:"top-start",animation:"top"},"top center":{position:"top",animation:"top"},"top right":{position:"top-end",animation:"top"},"right top":{position:"right-start",animation:"right"},"right middle":{position:"right",animation:"right"},"right bottom":{position:"right-end",animation:"right"},"bottom left":{position:"bottom-start",animation:"bottom"},"bottom center":{position:"bottom",animation:"bottom"},"bottom right":{position:"bottom-end",animation:"bottom"},"left top":{position:"left-start",animation:"left"},"left middle":{position:"left",animation:"left"},"left bottom":{position:"left-end",animation:"left"}},p={values:["top left","top center","top right","right top","right middle","right bottom","bottom left","bottom center","bottom right","left top","left middle","left bottom"],default:"right middle"};e.getFlipBehavior=i,e.positionPropToPopperPosition=n,e.POSITION_ATTRIBUTE_ENUM=p}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/possibleConstructorReturn"),require("babel-runtime/helpers/inherits"),require("prop-types"),require("react"),require("popper.js"),require("@atlaskit/util-shared-styles")):"function"==typeof define&&define.amd?define(["babel-runtime/helpers/classCallCheck","babel-runtime/helpers/possibleConstructorReturn","babel-runtime/helpers/inherits","prop-types","react","popper.js","@atlaskit/util-shared-styles"],e):"object"==typeof exports?exports["@atlaskit/layer"]=e(require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/possibleConstructorReturn"),require("babel-runtime/helpers/inherits"),require("prop-types"),require("react"),require("popper.js"),require("@atlaskit/util-shared-styles")):t["@atlaskit/layer"]=e(t["babel-runtime/helpers/classCallCheck"],t["babel-runtime/helpers/possibleConstructorReturn"],t["babel-runtime/helpers/inherits"],t["prop-types"],t.react,t["popper.js"],t["@atlaskit/util-shared-styles"])}(this,function(t,e,o,i,n,r,p){return function(t){function e(i){if(o[i])return o[i].exports;var n=o[i]={exports:{},id:i,loaded:!1};return t[i].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var o={};return e.m=t,e.c=o,e.p="",e(0)}([function(t,e,o){t.exports=o(1)},function(t,e,o){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=o(2),r=i(n),p=o(3),s=i(p),l=o(4),a=i(l),u=o(5),f=i(u),d=o(6),c=i(d),h=o(7),m=i(h),b=o(8),y=o(9),g=function(t){function e(o){(0,r.default)(this,e);var i=(0,s.default)(this,t.call(this,o));return i.extractStyles=function(t){if(t){var e=Math.round(t.offsets.popper.left),o=Math.round(t.offsets.popper.top);i.setState({cssPosition:t.offsets.popper.position,transform:"translate3d("+e+"px, "+o+"px, 0px)",flipped:!!t.flipped,actualPosition:t.position,originalPosition:t.originalPosition})}},i.state={position:null,transform:null,flipped:!1,actualPosition:null,offsets:{popper:{left:-9999,top:-9999}},originalPosition:null,cssPosition:"absolute"},i}return(0,a.default)(e,t),e.prototype.componentDidMount=function(){this.applyPopper(this.props)},e.prototype.componentWillReceiveProps=function(t){this.applyPopper(t)},e.prototype.componentDidUpdate=function(t,e){e.flipped!==this.state.flipped&&this.props.onFlippedChange({flipped:this.state.flipped,actualPosition:this.state.actualPosition,originalPosition:this.state.originalPosition})},e.prototype.componentWillUnmount=function(){this.popper&&this.popper.destroy()},e.prototype.applyPopper=function(t){if(this.targetRef&&this.contentRef&&(this.popper&&this.popper.destroy(),t.content)){var e=this.targetRef.firstChild,o={placement:(0,y.positionPropToPopperPosition)(t.position),onCreate:this.extractStyles,onUpdate:this.extractStyles,modifiers:{applyStyle:{enabled:!1},hide:{enabled:!1},offset:{enabled:!0,offset:this.props.offset},flip:{enabled:!!this.props.autoFlip,flipVariations:!0,boundariesElement:this.props.boundariesElement,padding:0},preventOverflow:{enabled:!!this.props.autoFlip,escapeWithReference:!0}}},i=(0,y.getFlipBehavior)(t);i&&(o.modifiers.flip.behavior=i),this.popper=new m.default(e,this.contentRef,o)}},e.prototype.render=function(){var t=this,e=this.props.zIndex,o=this.state,i=o.cssPosition,n=o.transform;return c.default.createElement("div",null,c.default.createElement("div",{ref:function(e){return t.targetRef=e}},this.props.children),c.default.createElement("div",{ref:function(e){return t.contentRef=e},style:{top:0,left:0,position:i,transform:n,zIndex:e}},this.props.content))},e}(d.PureComponent);g.propTypes={autoFlip:f.default.oneOfType([f.default.bool,f.default.arrayOf(f.default.oneOf(["top","right","bottom","left"]))]),boundariesElement:f.default.oneOf(["viewport","window","scrollParent"]),children:f.default.node,content:f.default.node,offset:f.default.string,onFlippedChange:f.default.func,position:f.default.oneOf(y.POSITION_ATTRIBUTE_ENUM.values),zIndex:f.default.number},g.defaultProps={autoFlip:!0,boundariesElement:"viewport",children:null,content:null,offset:"0 0",onFlippedChange:function(){},position:y.POSITION_ATTRIBUTE_ENUM.default,zIndex:b.akZIndexLayer},e.default=g},function(e,o){e.exports=t},function(t,o){t.exports=e},function(t,e){t.exports=o},function(t,e){t.exports=i},function(t,e){t.exports=n},function(t,e){t.exports=r},function(t,e){t.exports=p},function(t,e){"use strict";function o(t){return r[t]?r[t].position:null}function i(t){return Array.isArray(t.autoFlip)?[t.position.split(" ")[0]].concat(t.autoFlip):null}function n(t){return o(t)||r[p.default].position}Object.defineProperty(e,"__esModule",{value:!0});var r={"top left":{position:"top-start",animation:"top"},"top center":{position:"top",animation:"top"},"top right":{position:"top-end",animation:"top"},"right top":{position:"right-start",animation:"right"},"right middle":{position:"right",animation:"right"},"right bottom":{position:"right-end",animation:"right"},"bottom left":{position:"bottom-start",animation:"bottom"},"bottom center":{position:"bottom",animation:"bottom"},"bottom right":{position:"bottom-end",animation:"bottom"},"left top":{position:"left-start",animation:"left"},"left middle":{position:"left",animation:"left"},"left bottom":{position:"left-end",animation:"left"}},p={values:["top left","top center","top right","right top","right middle","right bottom","bottom left","bottom center","bottom right","left top","left middle","left bottom"],default:"right middle"};e.getFlipBehavior=i,e.positionPropToPopperPosition=n,e.POSITION_ATTRIBUTE_ENUM=p}])}); |
@@ -142,2 +142,3 @@ import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; | ||
var zIndex = this.props.zIndex; | ||
var _state = this.state, | ||
@@ -147,2 +148,3 @@ cssPosition = _state.cssPosition, | ||
return React.createElement( | ||
@@ -164,3 +166,3 @@ 'div', | ||
}, | ||
style: { top: 0, left: 0, position: cssPosition, transform: transform, zIndex: akZIndexLayer } | ||
style: { top: 0, left: 0, position: cssPosition, transform: transform, zIndex: zIndex } | ||
}, | ||
@@ -179,19 +181,21 @@ this.props.content | ||
Layer.propTypes = { | ||
position: PropTypes.oneOf(POSITION_ATTRIBUTE_ENUM.values), | ||
autoFlip: PropTypes.oneOfType([PropTypes.bool, PropTypes.arrayOf(PropTypes.oneOf(['top', 'right', 'bottom', 'left']))]), | ||
boundariesElement: PropTypes.oneOf(['viewport', 'window', 'scrollParent']), | ||
children: PropTypes.node, | ||
content: PropTypes.node, | ||
offset: PropTypes.string, | ||
content: PropTypes.node, | ||
onFlippedChange: PropTypes.func, | ||
children: PropTypes.node | ||
position: PropTypes.oneOf(POSITION_ATTRIBUTE_ENUM.values), | ||
zIndex: PropTypes.number | ||
}; | ||
Layer.defaultProps = { | ||
position: POSITION_ATTRIBUTE_ENUM.default, | ||
autoFlip: true, | ||
boundariesElement: 'viewport', | ||
autoFlip: true, | ||
children: null, | ||
content: null, | ||
offset: '0 0', | ||
content: null, | ||
onFlippedChange: function onFlippedChange() {}, | ||
children: null | ||
position: POSITION_ATTRIBUTE_ENUM.default, | ||
zIndex: akZIndexLayer | ||
}; | ||
export default Layer; |
{ | ||
"name": "@atlaskit/layer", | ||
"version": "2.5.3", | ||
"version": "2.5.4", | ||
"config": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
@@ -16,3 +16,3 @@ [![AtlasKit component registry](https://img.shields.io/badge/AtlasKit-components-FF5230.svg)](http://atlaskit.atlassian.com) | ||
Interact with a [live demo of the @atlaskit/layer component](https://aui-cdn.atlassian.com/atlaskit/stories/@atlaskit/layer/2.5.3/). | ||
Interact with a [live demo of the @atlaskit/layer component](https://aui-cdn.atlassian.com/atlaskit/stories/@atlaskit/layer/2.5.4/). | ||
@@ -19,0 +19,0 @@ ## Installation |
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
59918
827