Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/recalculate position windows resize #62

Merged
merged 4 commits into from
Dec 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"presets": [
"@babel/preset-env",
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
}
],
"@babel/preset-react"
],
"plugins": [
Expand Down
21 changes: 21 additions & 0 deletions __test__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ exports[`it should close on click outside popup (closeOnDocumentClick = true ) 1
open={false}
overlayStyle={Object {}}
position="bottom center"
repositionOnResize={true}
trigger={
<button>
Trigger
Expand Down Expand Up @@ -131,6 +132,7 @@ exports[`it should close on click outside popup (closeOnDocumentClick = true ) 2
open={false}
overlayStyle={Object {}}
position="bottom center"
repositionOnResize={true}
trigger={
<button>
Trigger
Expand Down Expand Up @@ -175,6 +177,7 @@ exports[`it should render correctly 1`] = `
open={false}
overlayStyle={Object {}}
position="bottom center"
repositionOnResize={true}
trigger={
<button>
Trigger
Expand Down Expand Up @@ -213,6 +216,7 @@ exports[`it should render correctly on click and will update the the popup conte
open={false}
overlayStyle={Object {}}
position="bottom center"
repositionOnResize={true}
trigger={
<button>
Trigger
Expand Down Expand Up @@ -322,6 +326,7 @@ exports[`it should render correctly on click and will update the the popup conte
open={false}
overlayStyle={Object {}}
position="bottom center"
repositionOnResize={true}
trigger={
<button>
Trigger
Expand Down Expand Up @@ -371,6 +376,7 @@ exports[`it should render correctly on click and will update the trigger text
open={false}
overlayStyle={Object {}}
position="bottom center"
repositionOnResize={true}
trigger={[Function]}
>
<Ref
Expand Down Expand Up @@ -473,6 +479,7 @@ exports[`it should render correctly on click and will update the trigger text
open={false}
overlayStyle={Object {}}
position="bottom center"
repositionOnResize={true}
trigger={[Function]}
>
<Ref
Expand Down Expand Up @@ -518,6 +525,7 @@ exports[`it should rendered in the bottom center position 1`] = `
open={false}
overlayStyle={Object {}}
position="bottom center"
repositionOnResize={true}
trigger={
<button>
Trigger
Expand Down Expand Up @@ -622,6 +630,7 @@ exports[`it should rendered in the bottom left position 1`] = `
open={false}
overlayStyle={Object {}}
position="bottom left"
repositionOnResize={true}
trigger={
<button>
Trigger
Expand Down Expand Up @@ -726,6 +735,7 @@ exports[`it should rendered in the bottom right position 1`] = `
open={false}
overlayStyle={Object {}}
position="bottom right"
repositionOnResize={true}
trigger={
<button>
Trigger
Expand Down Expand Up @@ -830,6 +840,7 @@ exports[`it should rendered in the left bottom position 1`] = `
open={false}
overlayStyle={Object {}}
position="left bottom"
repositionOnResize={true}
trigger={
<button>
Trigger
Expand Down Expand Up @@ -934,6 +945,7 @@ exports[`it should rendered in the left center position 1`] = `
open={false}
overlayStyle={Object {}}
position="left center"
repositionOnResize={true}
trigger={
<button>
Trigger
Expand Down Expand Up @@ -1038,6 +1050,7 @@ exports[`it should rendered in the left top position 1`] = `
open={false}
overlayStyle={Object {}}
position="left top"
repositionOnResize={true}
trigger={
<button>
Trigger
Expand Down Expand Up @@ -1142,6 +1155,7 @@ exports[`it should rendered in the right bottom position 1`] = `
open={false}
overlayStyle={Object {}}
position="right bottom"
repositionOnResize={true}
trigger={
<button>
Trigger
Expand Down Expand Up @@ -1246,6 +1260,7 @@ exports[`it should rendered in the right center position 1`] = `
open={false}
overlayStyle={Object {}}
position="right center"
repositionOnResize={true}
trigger={
<button>
Trigger
Expand Down Expand Up @@ -1350,6 +1365,7 @@ exports[`it should rendered in the right top position 1`] = `
open={false}
overlayStyle={Object {}}
position="right top"
repositionOnResize={true}
trigger={
<button>
Trigger
Expand Down Expand Up @@ -1454,6 +1470,7 @@ exports[`it should rendered in the top center position 1`] = `
open={false}
overlayStyle={Object {}}
position="top center"
repositionOnResize={true}
trigger={
<button>
Trigger
Expand Down Expand Up @@ -1558,6 +1575,7 @@ exports[`it should rendered in the top left position 1`] = `
open={false}
overlayStyle={Object {}}
position="top left"
repositionOnResize={true}
trigger={
<button>
Trigger
Expand Down Expand Up @@ -1662,6 +1680,7 @@ exports[`it should rendered in the top right position 1`] = `
open={false}
overlayStyle={Object {}}
position="top right"
repositionOnResize={true}
trigger={
<button>
Trigger
Expand Down Expand Up @@ -1765,6 +1784,7 @@ exports[`it shouldn't close on click outside popup 1`] = `
open={false}
overlayStyle={Object {}}
position="bottom center"
repositionOnResize={true}
trigger={
<button>
Trigger
Expand Down Expand Up @@ -1868,6 +1888,7 @@ exports[`it shouldn't close on click outside popup 2`] = `
open={false}
overlayStyle={Object {}}
position="bottom center"
repositionOnResize={true}
trigger={
<button>
Trigger
Expand Down
8 changes: 7 additions & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ const babelBiliConfig = {
plugins: ["@babel/plugin-proposal-class-properties"]
};
const babelParcelConfig = {
presets: ["@babel/preset-env", "@babel/preset-react"],
presets: [[
"@babel/preset-env", {
"targets": {
"node": "current"
}
}
], "@babel/preset-react"],
plugins: ["@babel/plugin-proposal-class-properties"]
};

Expand Down
9 changes: 9 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// jest.config.js
'use strict';

module.exports = {
transform: {
'^.+\\.jsx$': 'babel-jest',
'^.+\\.js$': 'babel-jest'
}
};
Loading