aio-popup 8.0.0 → 8.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +16 -16
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -11,13 +11,13 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
11
11
  import { createRef, useEffect, useState, createContext, useContext, useRef } from 'react';
12
12
  import * as ReactDOMServer from 'react-dom/server';
13
13
  import ReactDOM from 'react-dom';
14
- import { $, anime } from 'aio-depencencies';
14
+ import { $, anime } from 'aio-deps';
15
15
  import './index.css';
16
16
  const CTX = createContext({});
17
17
  function Align(p) {
18
18
  let { modal, target, fitHorizontal, rtl, limitTo, pageSelector } = p;
19
- const bodyWidth = window.innerWidth, bodyHeight = window.innerHeight;
20
- let pageLimit = { left: 0, top: 0, bottom: bodyHeight, right: bodyWidth, width: bodyWidth, height: bodyHeight };
19
+ const page = modal.parents('.aio-popup-backdrop');
20
+ let pageLimit = getBound(page[0]);
21
21
  if (pageSelector) {
22
22
  let page = modal.parents(pageSelector);
23
23
  if (page.length) {
@@ -46,7 +46,7 @@ function Align(p) {
46
46
  //اگر راست به چپ باید باشد
47
47
  if (rtl) {
48
48
  //راست المان را با راست هدف ست کن
49
- domLimit.right = targetLimit.right;
49
+ domLimit.right = targetLimit.right - pageLimit.left;
50
50
  //چپ المان را بروز رسانی کن
51
51
  domLimit.left = domLimit.right - domLimit.width;
52
52
  //اگر المان از سمت چپ از صفحه بیرون زد سمت چپ المان را با سمت چپ صفحه ست کن
@@ -56,7 +56,7 @@ function Align(p) {
56
56
  }
57
57
  else {
58
58
  //چپ المان را با چپ هدف ست کن
59
- domLimit.left = targetLimit.left;
59
+ domLimit.left = targetLimit.left + pageLimit.left;
60
60
  //راست المان را بروز رسانی کن
61
61
  domLimit.right = domLimit.left + domLimit.width;
62
62
  //اگر المان از سمت راست صفحه بیرون زد سمت چپ المان را با پهنای المان ست کن
@@ -71,7 +71,7 @@ function Align(p) {
71
71
  domLimit.top = pageLimit.bottom - domLimit.height;
72
72
  }
73
73
  else {
74
- domLimit.top = targetLimit.top - domLimit.height;
74
+ domLimit.top = targetLimit.top - domLimit.height - (pageLimit.top);
75
75
  }
76
76
  }
77
77
  else {
@@ -742,16 +742,16 @@ function getEasing(highlight) {
742
742
  const { easing } = highlight;
743
743
  var easingNames = [
744
744
  'linear',
745
- 'easeInQuad', //1
746
- 'easeInSine', //5
747
- 'easeInCirc', //7
748
- 'easeInBack', //8
749
- 'easeOutQuad', //9
750
- 'easeOutSine', //13
751
- 'easeOutCirc', //15
752
- 'easeInOutQuad', //18
753
- 'easeInOutSine', //22
754
- 'easeInOutBack', //25
745
+ 'easeInQuad',
746
+ 'easeInSine',
747
+ 'easeInCirc',
748
+ 'easeInBack',
749
+ 'easeOutQuad',
750
+ 'easeOutSine',
751
+ 'easeOutCirc',
752
+ 'easeInOutQuad',
753
+ 'easeInOutSine',
754
+ 'easeInOutBack',
755
755
  'easeOutBounce', //27
756
756
  ];
757
757
  if (typeof easing === 'number') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aio-popup",
3
- "version": "8.0.0",
3
+ "version": "8.0.1",
4
4
  "description": "handle all types of popup and modals in react",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -12,7 +12,7 @@
12
12
  "url": "git+https://github.com/mohammadFeiz/aio-popup.git"
13
13
  },
14
14
  "dependencies": {
15
- "aio-depencencies": "latest"
15
+ "aio-deps": "latest"
16
16
  },
17
17
  "keywords": [
18
18
  "popup",