Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ak-layer

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ak-layer - npm Package Compare versions

Comparing version 59.0.0 to 60.0.0

14

CHANGELOG.md

@@ -1,6 +0,16 @@

<a name="59.0.0"></a>
# 59.0.0 (2016-11-07)
<a name="60.0.0"></a>
# 60.0.0 (2016-11-08)
<a name="ak-layer@60.0.0"></a>
# ak-layer@60.0.0 (2016-11-08)
### Bug Fixes
* **popup:** use the proper logic to handle show/hide ([67a018a](https://bitbucket.org/atlassian/atlaskit/commits/67a018a))
<a name="ak-layer@58.0.0"></a>

@@ -7,0 +17,0 @@ # ak-layer@58.0.0 (2016-11-07)

11

dist/bundle-cjs.js

@@ -137,11 +137,2 @@ module.exports = /******/

/**
* @description Callback function that is called whenever layer is rendered.
* The Layer element will be passed in as an argument.
* @memberof Layer
* @instance
* @type function
* @example @js layer.onRender = (elem) => { console.log(elem); };
*/
onRender: {},
/**
* @description Element to act as a boundary for the Layer.

@@ -238,3 +229,3 @@ * The Layer will not sit outside this element if it can help it.

render: function(elem) {
return elem.onRender && elem.onRender(elem), _skatejs.vdom.elementOpen("div", null, null, "ref", function(el) {
return _skatejs.vdom.elementOpen("div", null, null, "ref", function(el) {
return elem.positionedDOM = el;

@@ -241,0 +232,0 @@ }), _skatejs.vdom.elementVoid("slot"), _skatejs.vdom.elementClose("div");

@@ -1,1 +0,1 @@

module.exports=function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.CONSTRAIN_ATTRIBUTE_ENUM=t.POSITION_ATTRIBUTE_ENUM=void 0;var i=n(1),r=o(i),a=n(2),l=n(3),p=n(4),s=n(6),u=t.POSITION_ATTRIBUTE_ENUM={attribute:"position",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"],missingDefault:"right middle",invalidDefault:"right middle"};t.CONSTRAIN_ATTRIBUTE_ENUM={attribute:"constrain",values:["window","scrollParent"],missingDefault:"window",invalidDefault:"window"},t.default=(0,a.define)("ak-layer",{props:(0,r.default)({position:(0,l.enumeration)(u)({attribute:!0,set:s.reCreateAlignmentIfNeeded}),target:{attribute:!0,set:s.reCreateAlignmentIfNeeded},onRender:{},boundariesElement:{attribute:!0,set:s.reCreateAlignmentIfNeeded},enableFlip:a.prop.boolean({attribute:!0,set:s.reCreateAlignmentIfNeeded}),offset:{attribute:!0,set:s.reCreateAlignmentIfNeeded},onUpdate:{initial:void 0}},p.flippedSymbol,a.prop.boolean()),prototype:{reposition:function(){return this.alignment&&this.alignment.reposition(),this},get isFlipped(){return!!this[p.flippedSymbol]}},detached:function(e){e.alignment&&e.alignment.destroy()},render:function(e){return e.onRender&&e.onRender(e),a.vdom.elementOpen("div",null,null,"ref",function(t){return e.positionedDOM=t}),a.vdom.elementVoid("slot"),a.vdom.elementClose("div")},rendered:function(e){e.alignment?e.alignment.reposition():e.alignment=(0,s.createNewAlignment)(e)}})},function(e,t){e.exports=require("babel-runtime/helpers/defineProperty")},function(e,t){e.exports=require("skatejs")},function(e,t){e.exports=require("akutil-common")},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.flippedSymbol=void 0;var i=n(5),r=o(i);t.flippedSymbol=(0,r.default)("flippedSymbol")},function(e,t){e.exports=require("babel-runtime/core-js/symbol")},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=f.default.attachmentMap,n=(0,s.default)(t).find(function(n){return t[n].position===e});return n}function r(e,t){if(e[u.flippedSymbol]=!!t.flipped,e.onUpdate){var n={isFlipped:e[u.flippedSymbol],originalPosition:i(t.originalPlacement),actualPostion:i(t.placement)};e.onUpdate(n)}}function a(e){var t={elem:e.positionedDOM,target:e.target,position:e.position,enableFlip:e.enableFlip,offset:e.offset,onUpdate:function(t){return r(e,t)}};return e.boundariesElement&&(t.boundariesElement=e.boundariesElement),new f.default(t)}function l(e,t){e.alignment&&(t.newValue!==t.oldValue?(e.alignment.destroy(),e.alignment=a(e)):e.alignment.reposition())}Object.defineProperty(t,"__esModule",{value:!0}),t.reCreateAlignmentIfNeeded=t.createNewAlignment=t.handlePopperUpdate=void 0;var p=n(7),s=o(p);n(8);var u=n(4),d=n(9),f=o(d);t.handlePopperUpdate=r,t.createNewAlignment=a,t.reCreateAlignmentIfNeeded=l},function(e,t){e.exports=require("babel-runtime/core-js/object/keys")},function(e,t){e.exports=require("core-js/fn/array/find")},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(10),r=o(i),a=n(11),l=o(a),p=n(12),s=o(p),u=n(13),d=o(u),f=function(){function e(t){if((0,r.default)(this,e),t.target&&t.elem){var n=this.constructor,o=n.defaultPosition,i=n.getElement,a=n.attachmentMap,l=(0,d.default)({position:o},t),p=a[l.position]?a[l.position].position:a[o].position,u={placement:p,modifiers:{}};t.boundariesElement&&(u.boundariesElement=i(t.boundariesElement)),t.offset&&(u.modifiers.offset={offset:t.offset}),t.enableFlip?(u.modifiers.preventOverflow={enabled:!0,moveWithTarget:!0},u.modifiers.flip={enabled:!0,flipVariations:!0}):(u.modifiers.preventOverflow={enabled:!1},u.modifiers.flip={enabled:!1}),this.popper=new s.default(i(l.target),i(l.elem),u),l.onUpdate&&this.popper.onUpdate(l.onUpdate),l.onCreate&&this.popper.onCreate(l.onCreate)}}return(0,l.default)(e,[{key:"destroy",value:function(){return this.popper&&this.popper.destroy(),this}},{key:"reposition",value:function(){return this.popper&&this.popper.update(),this}}],[{key:"getElement",value:function(e){if("string"==typeof e){var t=document.querySelectorAll(e);return t[0]}return e||document.body}},{key:"defaultPosition",get:function(){return"right middle"}},{key:"attachmentMap",get:function(){return{"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"}}}}]),e}();t.default=f},function(e,t){e.exports=require("babel-runtime/helpers/classCallCheck")},function(e,t){e.exports=require("babel-runtime/helpers/createClass")},function(e,t){e.exports=require("popper.js")},function(e,t){e.exports=require("object-assign")}]);
module.exports=function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return e[i].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.CONSTRAIN_ATTRIBUTE_ENUM=t.POSITION_ATTRIBUTE_ENUM=void 0;var o=n(1),r=i(o),a=n(2),l=n(3),p=n(4),s=n(6),u=t.POSITION_ATTRIBUTE_ENUM={attribute:"position",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"],missingDefault:"right middle",invalidDefault:"right middle"};t.CONSTRAIN_ATTRIBUTE_ENUM={attribute:"constrain",values:["window","scrollParent"],missingDefault:"window",invalidDefault:"window"},t.default=(0,a.define)("ak-layer",{props:(0,r.default)({position:(0,l.enumeration)(u)({attribute:!0,set:s.reCreateAlignmentIfNeeded}),target:{attribute:!0,set:s.reCreateAlignmentIfNeeded},boundariesElement:{attribute:!0,set:s.reCreateAlignmentIfNeeded},enableFlip:a.prop.boolean({attribute:!0,set:s.reCreateAlignmentIfNeeded}),offset:{attribute:!0,set:s.reCreateAlignmentIfNeeded},onUpdate:{initial:void 0}},p.flippedSymbol,a.prop.boolean()),prototype:{reposition:function(){return this.alignment&&this.alignment.reposition(),this},get isFlipped(){return!!this[p.flippedSymbol]}},detached:function(e){e.alignment&&e.alignment.destroy()},render:function(e){return a.vdom.elementOpen("div",null,null,"ref",function(t){return e.positionedDOM=t}),a.vdom.elementVoid("slot"),a.vdom.elementClose("div")},rendered:function(e){e.alignment?e.alignment.reposition():e.alignment=(0,s.createNewAlignment)(e)}})},function(e,t){e.exports=require("babel-runtime/helpers/defineProperty")},function(e,t){e.exports=require("skatejs")},function(e,t){e.exports=require("akutil-common")},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.flippedSymbol=void 0;var o=n(5),r=i(o);t.flippedSymbol=(0,r.default)("flippedSymbol")},function(e,t){e.exports=require("babel-runtime/core-js/symbol")},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=f.default.attachmentMap,n=(0,s.default)(t).find(function(n){return t[n].position===e});return n}function r(e,t){if(e[u.flippedSymbol]=!!t.flipped,e.onUpdate){var n={isFlipped:e[u.flippedSymbol],originalPosition:o(t.originalPlacement),actualPostion:o(t.placement)};e.onUpdate(n)}}function a(e){var t={elem:e.positionedDOM,target:e.target,position:e.position,enableFlip:e.enableFlip,offset:e.offset,onUpdate:function(t){return r(e,t)}};return e.boundariesElement&&(t.boundariesElement=e.boundariesElement),new f.default(t)}function l(e,t){e.alignment&&(t.newValue!==t.oldValue?(e.alignment.destroy(),e.alignment=a(e)):e.alignment.reposition())}Object.defineProperty(t,"__esModule",{value:!0}),t.reCreateAlignmentIfNeeded=t.createNewAlignment=t.handlePopperUpdate=void 0;var p=n(7),s=i(p);n(8);var u=n(4),d=n(9),f=i(d);t.handlePopperUpdate=r,t.createNewAlignment=a,t.reCreateAlignmentIfNeeded=l},function(e,t){e.exports=require("babel-runtime/core-js/object/keys")},function(e,t){e.exports=require("core-js/fn/array/find")},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(10),r=i(o),a=n(11),l=i(a),p=n(12),s=i(p),u=n(13),d=i(u),f=function(){function e(t){if((0,r.default)(this,e),t.target&&t.elem){var n=this.constructor,i=n.defaultPosition,o=n.getElement,a=n.attachmentMap,l=(0,d.default)({position:i},t),p=a[l.position]?a[l.position].position:a[i].position,u={placement:p,modifiers:{}};t.boundariesElement&&(u.boundariesElement=o(t.boundariesElement)),t.offset&&(u.modifiers.offset={offset:t.offset}),t.enableFlip?(u.modifiers.preventOverflow={enabled:!0,moveWithTarget:!0},u.modifiers.flip={enabled:!0,flipVariations:!0}):(u.modifiers.preventOverflow={enabled:!1},u.modifiers.flip={enabled:!1}),this.popper=new s.default(o(l.target),o(l.elem),u),l.onUpdate&&this.popper.onUpdate(l.onUpdate),l.onCreate&&this.popper.onCreate(l.onCreate)}}return(0,l.default)(e,[{key:"destroy",value:function(){return this.popper&&this.popper.destroy(),this}},{key:"reposition",value:function(){return this.popper&&this.popper.update(),this}}],[{key:"getElement",value:function(e){if("string"==typeof e){var t=document.querySelectorAll(e);return t[0]}return e||document.body}},{key:"defaultPosition",get:function(){return"right middle"}},{key:"attachmentMap",get:function(){return{"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"}}}}]),e}();t.default=f},function(e,t){e.exports=require("babel-runtime/helpers/classCallCheck")},function(e,t){e.exports=require("babel-runtime/helpers/createClass")},function(e,t){e.exports=require("popper.js")},function(e,t){e.exports=require("object-assign")}]);

@@ -140,11 +140,2 @@ !function(root, factory) {

/**
* @description Callback function that is called whenever layer is rendered.
* The Layer element will be passed in as an argument.
* @memberof Layer
* @instance
* @type function
* @example @js layer.onRender = (elem) => { console.log(elem); };
*/
onRender: {},
/**
* @description Element to act as a boundary for the Layer.

@@ -241,3 +232,3 @@ * The Layer will not sit outside this element if it can help it.

render: function(elem) {
return elem.onRender && elem.onRender(elem), _skatejs.vdom.elementOpen("div", null, null, "ref", function(el) {
return _skatejs.vdom.elementOpen("div", null, null, "ref", function(el) {
return elem.positionedDOM = el;

@@ -244,0 +235,0 @@ }), _skatejs.vdom.elementVoid("slot"), _skatejs.vdom.elementClose("div");

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("babel-runtime/helpers/defineProperty"),require("skatejs"),require("akutil-common"),require("babel-runtime/core-js/symbol"),require("babel-runtime/core-js/object/keys"),require("core-js/fn/array/find"),require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/createClass"),require("popper.js"),require("object-assign")):"function"==typeof define&&define.amd?define(["babel-runtime/helpers/defineProperty","skatejs","akutil-common","babel-runtime/core-js/symbol","babel-runtime/core-js/object/keys","core-js/fn/array/find","babel-runtime/helpers/classCallCheck","babel-runtime/helpers/createClass","popper.js","object-assign"],t):"object"==typeof exports?exports.akLayer=t(require("babel-runtime/helpers/defineProperty"),require("skatejs"),require("akutil-common"),require("babel-runtime/core-js/symbol"),require("babel-runtime/core-js/object/keys"),require("core-js/fn/array/find"),require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/createClass"),require("popper.js"),require("object-assign")):e.akLayer=t(e["babel-runtime/helpers/defineProperty"],e.skatejs,e["akutil-common"],e["babel-runtime/core-js/symbol"],e["babel-runtime/core-js/object/keys"],e["core-js/fn/array/find"],e["babel-runtime/helpers/classCallCheck"],e["babel-runtime/helpers/createClass"],e["popper.js"],e["object-assign"])}(this,function(e,t,n,o,i,r,a,l,s,p){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.CONSTRAIN_ATTRIBUTE_ENUM=t.POSITION_ATTRIBUTE_ENUM=void 0;var i=n(1),r=o(i),a=n(2),l=n(3),s=n(4),p=n(6),u=t.POSITION_ATTRIBUTE_ENUM={attribute:"position",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"],missingDefault:"right middle",invalidDefault:"right middle"};t.CONSTRAIN_ATTRIBUTE_ENUM={attribute:"constrain",values:["window","scrollParent"],missingDefault:"window",invalidDefault:"window"},t.default=(0,a.define)("ak-layer",{props:(0,r.default)({position:(0,l.enumeration)(u)({attribute:!0,set:p.reCreateAlignmentIfNeeded}),target:{attribute:!0,set:p.reCreateAlignmentIfNeeded},onRender:{},boundariesElement:{attribute:!0,set:p.reCreateAlignmentIfNeeded},enableFlip:a.prop.boolean({attribute:!0,set:p.reCreateAlignmentIfNeeded}),offset:{attribute:!0,set:p.reCreateAlignmentIfNeeded},onUpdate:{initial:void 0}},s.flippedSymbol,a.prop.boolean()),prototype:{reposition:function(){return this.alignment&&this.alignment.reposition(),this},get isFlipped(){return!!this[s.flippedSymbol]}},detached:function(e){e.alignment&&e.alignment.destroy()},render:function(e){return e.onRender&&e.onRender(e),a.vdom.elementOpen("div",null,null,"ref",function(t){return e.positionedDOM=t}),a.vdom.elementVoid("slot"),a.vdom.elementClose("div")},rendered:function(e){e.alignment?e.alignment.reposition():e.alignment=(0,p.createNewAlignment)(e)}})},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.flippedSymbol=void 0;var i=n(5),r=o(i);t.flippedSymbol=(0,r.default)("flippedSymbol")},function(e,t){e.exports=o},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=f.default.attachmentMap,n=(0,p.default)(t).find(function(n){return t[n].position===e});return n}function r(e,t){if(e[u.flippedSymbol]=!!t.flipped,e.onUpdate){var n={isFlipped:e[u.flippedSymbol],originalPosition:i(t.originalPlacement),actualPostion:i(t.placement)};e.onUpdate(n)}}function a(e){var t={elem:e.positionedDOM,target:e.target,position:e.position,enableFlip:e.enableFlip,offset:e.offset,onUpdate:function(t){return r(e,t)}};return e.boundariesElement&&(t.boundariesElement=e.boundariesElement),new f.default(t)}function l(e,t){e.alignment&&(t.newValue!==t.oldValue?(e.alignment.destroy(),e.alignment=a(e)):e.alignment.reposition())}Object.defineProperty(t,"__esModule",{value:!0}),t.reCreateAlignmentIfNeeded=t.createNewAlignment=t.handlePopperUpdate=void 0;var s=n(7),p=o(s);n(8);var u=n(4),d=n(9),f=o(d);t.handlePopperUpdate=r,t.createNewAlignment=a,t.reCreateAlignmentIfNeeded=l},function(e,t){e.exports=i},function(e,t){e.exports=r},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(10),r=o(i),a=n(11),l=o(a),s=n(12),p=o(s),u=n(13),d=o(u),f=function(){function e(t){if((0,r.default)(this,e),t.target&&t.elem){var n=this.constructor,o=n.defaultPosition,i=n.getElement,a=n.attachmentMap,l=(0,d.default)({position:o},t),s=a[l.position]?a[l.position].position:a[o].position,u={placement:s,modifiers:{}};t.boundariesElement&&(u.boundariesElement=i(t.boundariesElement)),t.offset&&(u.modifiers.offset={offset:t.offset}),t.enableFlip?(u.modifiers.preventOverflow={enabled:!0,moveWithTarget:!0},u.modifiers.flip={enabled:!0,flipVariations:!0}):(u.modifiers.preventOverflow={enabled:!1},u.modifiers.flip={enabled:!1}),this.popper=new p.default(i(l.target),i(l.elem),u),l.onUpdate&&this.popper.onUpdate(l.onUpdate),l.onCreate&&this.popper.onCreate(l.onCreate)}}return(0,l.default)(e,[{key:"destroy",value:function(){return this.popper&&this.popper.destroy(),this}},{key:"reposition",value:function(){return this.popper&&this.popper.update(),this}}],[{key:"getElement",value:function(e){if("string"==typeof e){var t=document.querySelectorAll(e);return t[0]}return e||document.body}},{key:"defaultPosition",get:function(){return"right middle"}},{key:"attachmentMap",get:function(){return{"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"}}}}]),e}();t.default=f},function(e,t){e.exports=a},function(e,t){e.exports=l},function(e,t){e.exports=s},function(e,t){e.exports=p}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("babel-runtime/helpers/defineProperty"),require("skatejs"),require("akutil-common"),require("babel-runtime/core-js/symbol"),require("babel-runtime/core-js/object/keys"),require("core-js/fn/array/find"),require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/createClass"),require("popper.js"),require("object-assign")):"function"==typeof define&&define.amd?define(["babel-runtime/helpers/defineProperty","skatejs","akutil-common","babel-runtime/core-js/symbol","babel-runtime/core-js/object/keys","core-js/fn/array/find","babel-runtime/helpers/classCallCheck","babel-runtime/helpers/createClass","popper.js","object-assign"],t):"object"==typeof exports?exports.akLayer=t(require("babel-runtime/helpers/defineProperty"),require("skatejs"),require("akutil-common"),require("babel-runtime/core-js/symbol"),require("babel-runtime/core-js/object/keys"),require("core-js/fn/array/find"),require("babel-runtime/helpers/classCallCheck"),require("babel-runtime/helpers/createClass"),require("popper.js"),require("object-assign")):e.akLayer=t(e["babel-runtime/helpers/defineProperty"],e.skatejs,e["akutil-common"],e["babel-runtime/core-js/symbol"],e["babel-runtime/core-js/object/keys"],e["core-js/fn/array/find"],e["babel-runtime/helpers/classCallCheck"],e["babel-runtime/helpers/createClass"],e["popper.js"],e["object-assign"])}(this,function(e,t,i,n,o,r,a,l,s,p){return function(e){function t(n){if(i[n])return i[n].exports;var o=i[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.CONSTRAIN_ATTRIBUTE_ENUM=t.POSITION_ATTRIBUTE_ENUM=void 0;var o=i(1),r=n(o),a=i(2),l=i(3),s=i(4),p=i(6),u=t.POSITION_ATTRIBUTE_ENUM={attribute:"position",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"],missingDefault:"right middle",invalidDefault:"right middle"};t.CONSTRAIN_ATTRIBUTE_ENUM={attribute:"constrain",values:["window","scrollParent"],missingDefault:"window",invalidDefault:"window"},t.default=(0,a.define)("ak-layer",{props:(0,r.default)({position:(0,l.enumeration)(u)({attribute:!0,set:p.reCreateAlignmentIfNeeded}),target:{attribute:!0,set:p.reCreateAlignmentIfNeeded},boundariesElement:{attribute:!0,set:p.reCreateAlignmentIfNeeded},enableFlip:a.prop.boolean({attribute:!0,set:p.reCreateAlignmentIfNeeded}),offset:{attribute:!0,set:p.reCreateAlignmentIfNeeded},onUpdate:{initial:void 0}},s.flippedSymbol,a.prop.boolean()),prototype:{reposition:function(){return this.alignment&&this.alignment.reposition(),this},get isFlipped(){return!!this[s.flippedSymbol]}},detached:function(e){e.alignment&&e.alignment.destroy()},render:function(e){return a.vdom.elementOpen("div",null,null,"ref",function(t){return e.positionedDOM=t}),a.vdom.elementVoid("slot"),a.vdom.elementClose("div")},rendered:function(e){e.alignment?e.alignment.reposition():e.alignment=(0,p.createNewAlignment)(e)}})},function(t,i){t.exports=e},function(e,i){e.exports=t},function(e,t){e.exports=i},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.flippedSymbol=void 0;var o=i(5),r=n(o);t.flippedSymbol=(0,r.default)("flippedSymbol")},function(e,t){e.exports=n},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=f.default.attachmentMap,i=(0,p.default)(t).find(function(i){return t[i].position===e});return i}function r(e,t){if(e[u.flippedSymbol]=!!t.flipped,e.onUpdate){var i={isFlipped:e[u.flippedSymbol],originalPosition:o(t.originalPlacement),actualPostion:o(t.placement)};e.onUpdate(i)}}function a(e){var t={elem:e.positionedDOM,target:e.target,position:e.position,enableFlip:e.enableFlip,offset:e.offset,onUpdate:function(t){return r(e,t)}};return e.boundariesElement&&(t.boundariesElement=e.boundariesElement),new f.default(t)}function l(e,t){e.alignment&&(t.newValue!==t.oldValue?(e.alignment.destroy(),e.alignment=a(e)):e.alignment.reposition())}Object.defineProperty(t,"__esModule",{value:!0}),t.reCreateAlignmentIfNeeded=t.createNewAlignment=t.handlePopperUpdate=void 0;var s=i(7),p=n(s);i(8);var u=i(4),d=i(9),f=n(d);t.handlePopperUpdate=r,t.createNewAlignment=a,t.reCreateAlignmentIfNeeded=l},function(e,t){e.exports=o},function(e,t){e.exports=r},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(10),r=n(o),a=i(11),l=n(a),s=i(12),p=n(s),u=i(13),d=n(u),f=function(){function e(t){if((0,r.default)(this,e),t.target&&t.elem){var i=this.constructor,n=i.defaultPosition,o=i.getElement,a=i.attachmentMap,l=(0,d.default)({position:n},t),s=a[l.position]?a[l.position].position:a[n].position,u={placement:s,modifiers:{}};t.boundariesElement&&(u.boundariesElement=o(t.boundariesElement)),t.offset&&(u.modifiers.offset={offset:t.offset}),t.enableFlip?(u.modifiers.preventOverflow={enabled:!0,moveWithTarget:!0},u.modifiers.flip={enabled:!0,flipVariations:!0}):(u.modifiers.preventOverflow={enabled:!1},u.modifiers.flip={enabled:!1}),this.popper=new p.default(o(l.target),o(l.elem),u),l.onUpdate&&this.popper.onUpdate(l.onUpdate),l.onCreate&&this.popper.onCreate(l.onCreate)}}return(0,l.default)(e,[{key:"destroy",value:function(){return this.popper&&this.popper.destroy(),this}},{key:"reposition",value:function(){return this.popper&&this.popper.update(),this}}],[{key:"getElement",value:function(e){if("string"==typeof e){var t=document.querySelectorAll(e);return t[0]}return e||document.body}},{key:"defaultPosition",get:function(){return"right middle"}},{key:"attachmentMap",get:function(){return{"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"}}}}]),e}();t.default=f},function(e,t){e.exports=a},function(e,t){e.exports=l},function(e,t){e.exports=s},function(e,t){e.exports=p}])});
{
"name": "ak-layer",
"version": "59.0.0",
"version": "60.0.0",
"description": "A layer component",

@@ -25,3 +25,3 @@ "main": "dist/bundle.js",

"devDependencies": {
"akutil-common-test": "^4.0.0"
"akutil-common-test": "*"
},

@@ -28,0 +28,0 @@ "peerDependencies": {

@@ -5,3 +5,3 @@ [![AtlasKit component registry](https://img.shields.io/badge/AtlasKit-components-FF5230.svg)](http://aui-cdn.atlassian.com/atlaskit/registry/)

[![Report an issue](https://img.shields.io/badge/Report-an_issue-6554C0.svg)](https://ecosystem.atlassian.net/browse/AK)
[![Ask in our forum](https://img.shields.io/badge/Ask-in_our_forum-6554C0.svg)](https://answers.atlassian.com/questions/ask?title=AtlasKit%3A%20&topics=atlaskit,ak-layer,ak-layer@59.0.0)
[![Ask in our forum](https://img.shields.io/badge/Ask-in_our_forum-6554C0.svg)](https://answers.atlassian.com/questions/ask?title=AtlasKit%3A%20&topics=atlaskit,ak-layer,ak-layer@60.0.0)

@@ -17,3 +17,3 @@ # Layer

Interact with a [live demo of the ak-layer component](https://aui-cdn.atlassian.com/atlaskit/stories/ak-layer/59.0.0/).
Interact with a [live demo of the ak-layer component](https://aui-cdn.atlassian.com/atlaskit/stories/ak-layer/60.0.0/).

@@ -112,3 +112,2 @@ ## Installation

* [layer.target](#Layer+target) : <code>String</code>
* [layer.onRender](#Layer+onRender) : <code>function</code>
* [layer.boundariesElement](#Layer+boundariesElement) : <code>HTMLElement</code> &#124; <code>String</code>

@@ -183,13 +182,2 @@ * [layer.enableFlip](#Layer+enableFlip) : <code>Boolean</code>

```
<a name="Layer+onRender"></a>
### layer.onRender : <code>function</code>
Callback function that is called whenever layer is rendered.
The Layer element will be passed in as an argument.
**Kind**: instance property of <code>[Layer](#Layer)</code>
**JS Example**
```js
layer.onRender = (elem) => { console.log(elem); };
```
<a name="Layer+boundariesElement"></a>

@@ -357,3 +345,3 @@

Ask a question in our [forum](https://answers.atlassian.com/questions/ask?title=AtlasKit%3A%20&topics=atlaskit,ak-layer,ak-layer@59.0.0).
Ask a question in our [forum](https://answers.atlassian.com/questions/ask?title=AtlasKit%3A%20&topics=atlaskit,ak-layer,ak-layer@60.0.0).

@@ -360,0 +348,0 @@ Check [if someone has already asked the same question before](https://answers.atlassian.com/questions/topics/42926171/atlaskit).

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc