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

contain-by-screen

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contain-by-screen - npm Package Compare versions

Comparing version 1.0.4 to 1.1.0

.eslintignore

18

flow-libs/mocha.js

@@ -1,10 +0,8 @@

// jshint ignore:start
declare function describe(name: string, fn: (done: (err: any) => void) => ?Promise): void;
declare function xdescribe(name: string, fn: (done: (err: any) => void) => ?Promise): void;
declare function before(fn: (done: (err: any) => void) => ?Promise): void;
declare function beforeEach(fn: (done: (err: any) => void) => ?Promise): void;
declare function after(fn: (done: (err: any) => void) => ?Promise): void;
declare function afterEach(fn: (done: (err: any) => void) => ?Promise): void;
declare function it(name: string, fn: (done: (err: any) => void) => ?Promise): void;
declare function xit(name: string, fn: (done: (err: any) => void) => ?Promise): void;
declare function describe(name: string, fn: (done: (err: any) => void) => ?Promise<any>): void;
declare function xdescribe(name: string, fn: (done: (err: any) => void) => ?Promise<any>): void;
declare function before(fn: (done: (err: any) => void) => ?Promise<any>): void;
declare function beforeEach(fn: (done: (err: any) => void) => ?Promise<any>): void;
declare function after(fn: (done: (err: any) => void) => ?Promise<any>): void;
declare function afterEach(fn: (done: (err: any) => void) => ?Promise<any>): void;
declare function it(name: string, fn: (done: (err: any) => void) => ?Promise<any>): void;
declare function xit(name: string, fn: (done: (err: any) => void) => ?Promise<any>): void;

@@ -27,2 +27,3 @@ 'use strict';

if (style.position !== 'fixed') {
// eslint-disable-next-line no-console
console.error('containByScreen only works on fixed position elements', element);

@@ -48,3 +49,7 @@ }

var allPossibleChoices = (0, _flatten2.default)(positions.map(function (position) {
return position === 'top' || position === 'bottom' ? hAligns.map(function (hAlign) {
return position === 'cover' ? (0, _flatten2.default)(hAligns.map(function (hAlign) {
return vAligns.map(function (vAlign) {
return { position: position, hAlign: hAlign, vAlign: vAlign };
});
})) : position === 'top' || position === 'bottom' ? hAligns.map(function (hAlign) {
return { position: position, hAlign: hAlign, vAlign: 'center' };

@@ -107,3 +112,30 @@ }) : vAligns.map(function (vAlign) {

left = 0;
if (position === 'top' || position === 'bottom') {
if (position === 'cover') {
switch (hAlign) {
case 'center':
left = Math.round((anchorRect.left + anchorRect.right - elRect.width) / 2);
break;
case 'left':
left = Math.floor(anchorRect.left);
break;
case 'right':
left = Math.ceil(anchorRect.right - elRect.width);
break;
default:
throw new Error('Should not happen');
}
switch (vAlign) {
case 'center':
top = Math.round((anchorRect.top + anchorRect.bottom - elRect.height) / 2);
break;
case 'top':
top = Math.floor(anchorRect.top);
break;
case 'bottom':
top = Math.ceil(anchorRect.bottom - elRect.height);
break;
default:
throw new Error('Should not happen');
}
} else if (position === 'top' || position === 'bottom') {
switch (position) {

@@ -117,3 +149,3 @@ case 'top':

default:
throw new Error("Should not happen");
throw new Error('Should not happen');
}

@@ -131,3 +163,3 @@ switch (hAlign) {

default:
throw new Error("Should not happen");
throw new Error('Should not happen');
}

@@ -143,3 +175,3 @@ } else {

default:
throw new Error("Should not happen");
throw new Error('Should not happen');
}

@@ -157,3 +189,3 @@ switch (vAlign) {

default:
throw new Error("Should not happen");
throw new Error('Should not happen');
}

@@ -164,2 +196,2 @@ }

module.exports = exports['default'];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O2tCQXFDd0I7O0FBbkN4Qjs7OztBQUNBOzs7Ozs7QUFrQ2UsU0FBUyxlQUFULENBQXlCLE9BQXpCLEVBQStDLFdBQS9DLEVBQXlFLE9BQXpFLEVBQ1I7QUFDTCxNQUFJLFFBQVEsR0FBUixDQUFZLFFBQVosS0FBeUIsWUFBekIsSUFBeUMsT0FBTyxnQkFBUCxFQUF5QjtBQUNwRSxRQUFNLFFBQVEsT0FBTyxnQkFBUCxDQUF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yUmVjdC5ib3R0b20gLSBlbFJlY3QuaGVpZ2h0KTtcbiAgICAgIGJyZWFrO1xuICAgIGRlZmF1bHQ6IHRocm93IG5ldyBFcnJvcignU2hvdWxkIG5vdCBoYXBwZW4nKTtcbiAgICB9XG4gIH1cbiAgcmV0dXJuIHt0b3AsIGxlZnR9O1xufVxuIl19
{
"name": "contain-by-screen",
"version": "1.0.4",
"version": "1.1.0",
"description": "Position a dropdown element near a button in a way that fits on the screen.",

@@ -8,3 +8,6 @@ "main": "js/index.js",

"prepublish": "babel -s inline -d js/ src/ && flow-copy-source -v src js",
"test": "mocha"
"test": "npm run lint && npm run flow_check && mocha",
"flow_check": "flow check",
"lint": "eslint .",
"lint-fix": "eslint . --fix"
},

@@ -32,17 +35,21 @@ "repository": {

"devDependencies": {
"babel-cli": "^6.4.0",
"babel-plugin-add-module-exports": "^0.1.2",
"babel-plugin-transform-class-properties": "^6.4.0",
"babel-plugin-transform-flow-strip-types": "^6.4.0",
"babel-plugin-transform-runtime": "^6.4.3",
"babel-preset-es2015": "^6.3.13",
"babel-register": "^6.4.3",
"babel-cli": "^6.14.0",
"babel-eslint": "^6.1.2",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-class-properties": "^6.11.5",
"babel-plugin-transform-flow-strip-types": "^6.14.0",
"babel-plugin-transform-runtime": "^6.12.0",
"babel-preset-es2015": "^6.14.0",
"babel-register": "^6.14.0",
"eslint": "^3.4.0",
"eslint-plugin-react": "^6.2.0",
"flow-bin": "^0.32.0",
"flow-copy-source": "^1.0.1",
"mocha": "^2.3.4"
"mocha": "^3.0.2"
},
"dependencies": {
"babel-runtime": "^6.3.19",
"envify": "^3.4.0",
"babel-runtime": "^6.11.6",
"envify": "^3.4.1",
"lodash": "^4.6.1"
}
}
# contain-by-screen
[![Circle CI](https://circleci.com/gh/AgentME/contain-by-screen.svg?style=shield)](https://circleci.com/gh/AgentME/contain-by-screen)
[![npm version](https://badge.fury.io/js/contain-by-screen.svg)](https://badge.fury.io/js/contain-by-screen)
This function is for positioning an element next to another in a way that fits

@@ -22,5 +25,5 @@ on the screen. This can be used to position a dropdown menu next to a button.

`position` sets the prioritized position for the target relative to its anchor.
It may be set to null, "top", "bottom", "left", or "right". The element will
use this position unless it is not possible to do so while fitting the element
on-screen.
It may be set to null, "top", "bottom", "left", "right", or "cover". The
element will use this position unless it is not possible to do so while fitting
the element on-screen.

@@ -32,6 +35,6 @@ `forcePosition` is a boolean which controls whether the configured position

relative to its anchor. The horizontal alignment mode is used if the element is
positioned in the top or bottom positions relative to the anchor, and causes
the element to be moved horizontally in order to make a specific edge align. It
may be set to null, "center", "left", or "right". The element will use this
alignment unless it is not possible to do so while fitting the element
positioned in the top, bottom, or cover positions relative to the anchor, and
causes the element to be moved horizontally in order to make a specific edge
align. It may be set to null, "center", "left", or "right". The element will
use this alignment unless it is not possible to do so while fitting the element
on-screen.

@@ -44,6 +47,7 @@

to its anchor. The vertical alignment mode is used if the element is positioned
in the left or right positions relative to the anchor, and causes the element
to be moved vertically in order to make a specific edge align. It may be set to
null, "center", "top", or "bottom". The element will use this alignment unless
it is not possible to do so while fitting the element on-screen.
in the left, right, or cover positions relative to the anchor, and causes the
element to be moved vertically in order to make a specific edge align. It may
be set to null, "center", "top", or "bottom". The element will use this
alignment unless it is not possible to do so while fitting the element
on-screen.

@@ -56,6 +60,6 @@ `forceVAlign` is a boolean which controls whether the configured vAlign value

this much larger in all directions, requiring it to be placed with the given
amount of space between it, the anchor element, and the edges of the screen.
The buffer option is useful if the element has children which are positioned
such that they escape the boundaries of the element. Buffers do not affect
alignment with the anchor element.
amount of space between it, the anchor element when position is not "cover",
and the edges of the screen. The buffer option is useful if the element has
children which are positioned such that they escape the boundaries of the
element. Buffers do not affect alignment with the anchor element.

@@ -72,3 +76,3 @@ `topBuffer` specifies an additional buffer space only for the top edge.

Full [Flow Type](http://flowtype.org/) declarations for this module are
Full [Flow](http://flowtype.org/) type declarations for this module are
included!

Sorry, the diff of this file is not supported yet

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