aio-popup 7.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.
package/index.css CHANGED
@@ -22,7 +22,6 @@
22
22
 
23
23
  .aio-popup {
24
24
  border-radius: 4px;
25
- font-size: 14px;
26
25
  transition: .3s;
27
26
  max-width: 100vw;
28
27
  max-height: 100vh;
@@ -149,7 +148,7 @@
149
148
  background: #fff;
150
149
  color: #323130;
151
150
  padding: 6px 12px;
152
- font-size: 14px;
151
+ font-size: 1.2em;
153
152
  min-height: 36px;
154
153
  gap: 12px;
155
154
  align-items: center;
@@ -188,12 +187,10 @@
188
187
  }
189
188
 
190
189
  .aio-popup-body {
191
- background: #fff;
192
190
  flex: 1;
193
191
  width: 100%;
194
192
  overflow-y: auto;
195
193
  box-sizing: border-box;
196
- border-radius:6px;
197
194
  }
198
195
 
199
196
  .aio-popup-body * {
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { type ReactNode } from 'react';
2
2
  import './index.css';
3
3
  export type AP_position = 'fullscreen' | 'center' | 'popover' | 'left' | 'right' | 'top' | 'bottom';
4
4
  export type AP_attrsKey = 'backdrop' | 'modal' | 'header' | 'body' | 'footer';
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": "7.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",