aio-popup 4.5.2 → 5.1.0
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/alert1.css +68 -0
- package/alert2.css +70 -0
- package/index.css +406 -203
- package/index.d.ts +155 -153
- package/index.js +13 -9
- package/package.json +1 -3
- package/theme2.css +139 -0
package/index.d.ts
CHANGED
|
@@ -1,153 +1,155 @@
|
|
|
1
|
-
import
|
|
2
|
-
import './index.css';
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
export type
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}) => ReactNode;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
};
|
|
56
|
-
export type
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
declare
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import './index.css';
|
|
3
|
+
export type AP_position = 'fullscreen' | 'center' | 'popover' | 'left' | 'right' | 'top' | 'bottom';
|
|
4
|
+
export type AP_attrsKey = 'backdrop' | 'modal' | 'header' | 'body' | 'footer';
|
|
5
|
+
export type AP_header = ((p: {
|
|
6
|
+
removeModal: () => void;
|
|
7
|
+
state: any;
|
|
8
|
+
setState: any;
|
|
9
|
+
}) => ReactNode) | {
|
|
10
|
+
title?: string;
|
|
11
|
+
subtitle?: string;
|
|
12
|
+
before?: ReactNode;
|
|
13
|
+
after?: ReactNode;
|
|
14
|
+
onClose?: boolean | ((p: {
|
|
15
|
+
state: any;
|
|
16
|
+
setState: (state: any) => void;
|
|
17
|
+
}) => void);
|
|
18
|
+
};
|
|
19
|
+
export type AP_body = (p: {
|
|
20
|
+
removeModal: () => void;
|
|
21
|
+
state: any;
|
|
22
|
+
setState: (state: any) => void;
|
|
23
|
+
}) => ReactNode;
|
|
24
|
+
export type AP_footer = (p: {
|
|
25
|
+
state: any;
|
|
26
|
+
setState: (v: any) => void;
|
|
27
|
+
removeModal: () => void;
|
|
28
|
+
}) => ReactNode;
|
|
29
|
+
type AP_setAttrs = (mode: AP_attrsKey) => any;
|
|
30
|
+
export type AP_modal = {
|
|
31
|
+
getTarget?: () => any;
|
|
32
|
+
limitTo?: string;
|
|
33
|
+
rtl?: boolean;
|
|
34
|
+
id?: string;
|
|
35
|
+
onClose?: boolean | (() => void);
|
|
36
|
+
position?: AP_position;
|
|
37
|
+
header?: AP_header;
|
|
38
|
+
state?: any;
|
|
39
|
+
footer?: AP_footer;
|
|
40
|
+
body?: AP_body;
|
|
41
|
+
animate?: boolean;
|
|
42
|
+
fitHorizontal?: boolean;
|
|
43
|
+
setAttrs?: AP_setAttrs;
|
|
44
|
+
};
|
|
45
|
+
export type AP_alert = {
|
|
46
|
+
icon?: false | ReactNode;
|
|
47
|
+
type: 'success' | 'error' | 'warning' | 'info';
|
|
48
|
+
text?: ReactNode;
|
|
49
|
+
subtext?: string;
|
|
50
|
+
time?: number;
|
|
51
|
+
className?: string;
|
|
52
|
+
closeText?: string;
|
|
53
|
+
animate?: boolean;
|
|
54
|
+
onClose?: boolean | (() => void);
|
|
55
|
+
};
|
|
56
|
+
export type AP_snackebar = {
|
|
57
|
+
id?: string;
|
|
58
|
+
text: string;
|
|
59
|
+
subtext?: string;
|
|
60
|
+
icon?: ReactNode;
|
|
61
|
+
time?: number;
|
|
62
|
+
action?: {
|
|
63
|
+
text: string;
|
|
64
|
+
onClick: () => void;
|
|
65
|
+
};
|
|
66
|
+
type: 'success' | 'error' | 'warning' | 'info';
|
|
67
|
+
align?: ['left' | 'center' | 'right', 'top' | 'bottom'];
|
|
68
|
+
onClose?: boolean | (() => void);
|
|
69
|
+
attrs?: any;
|
|
70
|
+
};
|
|
71
|
+
export type AP_highlight = {
|
|
72
|
+
dom: any;
|
|
73
|
+
html: ReactNode;
|
|
74
|
+
onClick?: () => void;
|
|
75
|
+
mouseAccess?: boolean;
|
|
76
|
+
attrs?: any;
|
|
77
|
+
padding?: number;
|
|
78
|
+
easing?: number | AP_easing;
|
|
79
|
+
duration?: number;
|
|
80
|
+
};
|
|
81
|
+
export type AP_confirm = {
|
|
82
|
+
title?: string;
|
|
83
|
+
subtitle?: string;
|
|
84
|
+
text?: ReactNode;
|
|
85
|
+
submitText?: string;
|
|
86
|
+
canselText?: string;
|
|
87
|
+
onSubmit?: () => Promise<boolean>;
|
|
88
|
+
onCansel?: () => void;
|
|
89
|
+
setAttrs?: AP_setAttrs;
|
|
90
|
+
};
|
|
91
|
+
export type AP_prompt = {
|
|
92
|
+
title?: string;
|
|
93
|
+
subtitle?: string;
|
|
94
|
+
text?: string;
|
|
95
|
+
submitText?: string;
|
|
96
|
+
canselText?: string;
|
|
97
|
+
onSubmit?: (text: string) => Promise<boolean>;
|
|
98
|
+
onCansel?: () => void;
|
|
99
|
+
setAttrs?: AP_setAttrs;
|
|
100
|
+
};
|
|
101
|
+
type AP_removeModal = (arg?: string) => void;
|
|
102
|
+
type AP_addAlert = (p: AP_alert) => void;
|
|
103
|
+
type AP_addSnackebar = (item: AP_snackebar) => void;
|
|
104
|
+
type AP_addModal = (o: AP_modal) => void;
|
|
105
|
+
type AP_addHighlight = (highlight: AP_highlight) => void;
|
|
106
|
+
type AP_removeHighlight = () => void;
|
|
107
|
+
type AP_getModals = () => AP_modal[];
|
|
108
|
+
type AP_addConfirm = (item: AP_confirm) => void;
|
|
109
|
+
type AP_addPrompt = (item: AP_prompt) => void;
|
|
110
|
+
type AP_render = () => ReactNode;
|
|
111
|
+
export type AP_usePopup = {
|
|
112
|
+
addAlert: AP_addAlert;
|
|
113
|
+
addSnackebar: AP_addSnackebar;
|
|
114
|
+
removeModal: AP_removeModal;
|
|
115
|
+
addModal: AP_addModal;
|
|
116
|
+
getModals: AP_getModals;
|
|
117
|
+
addHighlight: AP_addHighlight;
|
|
118
|
+
removeHighlight: AP_removeHighlight;
|
|
119
|
+
render: AP_render;
|
|
120
|
+
addConfirm: AP_addConfirm;
|
|
121
|
+
addPrompt: AP_addPrompt;
|
|
122
|
+
};
|
|
123
|
+
export type I_usePopup = {
|
|
124
|
+
addAlert: AP_addAlert;
|
|
125
|
+
addSnackebar: AP_addSnackebar;
|
|
126
|
+
removeModal: AP_removeModal;
|
|
127
|
+
addModal: AP_addModal;
|
|
128
|
+
getModals: AP_getModals;
|
|
129
|
+
addHighlight: AP_addHighlight;
|
|
130
|
+
removeHighlight: AP_removeHighlight;
|
|
131
|
+
render: AP_render;
|
|
132
|
+
addConfirm: AP_addConfirm;
|
|
133
|
+
addPrompt: AP_addPrompt;
|
|
134
|
+
portal: () => void;
|
|
135
|
+
};
|
|
136
|
+
declare const usePopup: (props?: {
|
|
137
|
+
rtl?: boolean;
|
|
138
|
+
id?: string;
|
|
139
|
+
}) => I_usePopup;
|
|
140
|
+
export default usePopup;
|
|
141
|
+
export type AP_SnackebarItem = {
|
|
142
|
+
item: AP_snackebar;
|
|
143
|
+
index: number;
|
|
144
|
+
};
|
|
145
|
+
export declare function Alert(props: AP_alert): void;
|
|
146
|
+
type AP_easing = 'linear' | 'easeInQuad' | 'easeInCubic' | 'easeInQuart' | 'easeInQuint' | 'easeInSine' | 'easeInExpo' | 'easeInCirc' | 'easeInBack' | 'easeOutQuad' | 'easeOutCubic' | 'easeOutQuart' | 'easeOutQuint' | 'easeOutSine' | 'easeOutExpo' | 'easeOutCirc' | 'easeOutBack' | 'easeInBounce' | 'easeInOutQuad' | 'easeInOutCubic' | 'easeInOutQuart' | 'easeInOutQuint' | 'easeInOutSine' | 'easeInOutExpo' | 'easeInOutCirc' | 'easeInOutBack' | 'easeInOutBounce' | 'easeOutBounce' | 'easeOutInQuad' | 'easeOutInCubic' | 'easeOutInQuart' | 'easeOutInQuint' | 'easeOutInSine' | 'easeOutInExpo' | 'easeOutInCirc' | 'easeOutInBack' | 'easeOutInBounce';
|
|
147
|
+
export declare class Loading {
|
|
148
|
+
loader: any;
|
|
149
|
+
constructor(loader?: string);
|
|
150
|
+
private getLoader_0;
|
|
151
|
+
private getLoaderItem_0;
|
|
152
|
+
getLoader: (id: string) => string;
|
|
153
|
+
show: (id: string, parentSelector?: string) => void;
|
|
154
|
+
hide: (id: string) => void;
|
|
155
|
+
}
|
package/index.js
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import t,{Component as e,createRef as i,useEffect as o,useState as r,createContext as a,useContext as n,useRef as l,forwardRef as s,useImperativeHandle as d,createElement as p}from"react";import*as c from"react-dom/server";import h from"jquery";import"./index.css";import u from"animejs/lib/anime.es.js";import{jsx as _,Fragment as $,jsxs as m}from"react/jsx-runtime";function _defineProperty(t,e,i){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"==typeof e?e:e+""}function _toPrimitive(t,e){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var o=i.call(t,e||"default");if("object"!=typeof o)return o;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}export default class f{constructor(t){_defineProperty(this,"rtl",void 0),_defineProperty(this,"render",void 0),_defineProperty(this,"addModal",void 0),_defineProperty(this,"addHighlight",void 0),_defineProperty(this,"removeHighlight",void 0),_defineProperty(this,"addAlert",void 0),_defineProperty(this,"removeModal",void 0),_defineProperty(this,"addSnackebar",void 0),_defineProperty(this,"getModals",void 0),_defineProperty(this,"addConfirm",void 0),_defineProperty(this,"addPrompt",void 0),_defineProperty(this,"popupId",void 0),_defineProperty(this,"popupsRef",void 0),_defineProperty(this,"highlightRef",void 0);let{rtl:e=!1}=t||{};this.rtl=e,this.addSnackebar=()=>{},this.popupsRef=i(),this.highlightRef=i(),this.getModals=()=>{let t=this.popupsRef.current;return null===t?[]:t.getModals()||[]},this.addModal=t=>{let e=this.popupsRef.current;null!==e&&e.addModal(t)},this.addHighlight=t=>{let e=this.highlightRef.current;null!==e&&e.addHighlight(t)},this.removeModal=t=>{let e=this.popupsRef.current;null!==e&&e.removeModal(t)},this.removeHighlight=()=>{let t=this.highlightRef.current;null!==t&&t.removeHighlight()},this.render=()=>{let t={rtl:e,getActions:({add:t})=>this.addSnackebar=t};return m($,{children:[_(Popups,{rtl:e,ref:this.popupsRef}),_(Snackebar,{...t}),_(Highlight,{ref:this.highlightRef})]})},this.addAlert=t=>Alert(t),this.addConfirm=t=>{let{title:e,subtitle:i,text:o,submitText:r="Yes",canselText:a="No",onSubmit:n,onCansel:l=()=>{},setAttrs:s=()=>({})}=t,d={position:"center",setAttrs(t){let e=s(t);return"modal"===t?AddToAttrs(e,{className:"aio-popup-confirm"}):e},header:{title:e,subtitle:i},body:()=>o,footer:()=>m($,{children:[_("button",{type:"button",onClick:()=>{l(),this.removeModal()},children:a}),_("button",{type:"button",className:"active",onClick:async()=>{if(n)!1!==await n()&&this.removeModal()},children:r})]})};this.addModal(d)},this.addPrompt=t=>{let{title:e,subtitle:i,text:o,submitText:r="Submit",canselText:a="close",onSubmit:n,onCansel:l=()=>{},setAttrs:s=()=>({})}=t,d={position:"center",setAttrs(t){let e=s(t);return"modal"===t?AddToAttrs(e,{className:"aio-popup-prompt"}):e},state:{temp:""},header:{title:e,subtitle:i},body:({state:t,setState:e})=>_("textarea",{placeholder:o,value:t.temp,onChange(t){e&&e({temp:t.target.value})}}),footer:({state:t,setState:e})=>m($,{children:[_("button",{type:"button",onClick:()=>{l(),this.removeModal()},children:a}),_("button",{type:"button",className:"active",onClick:async()=>{if(n)!1!==await n(t.temp)?this.removeModal():e({temp:""})},disabled:!t.temp,children:r})]})};this.addModal(d)}}};let Popups=s((t,e)=>{let[i,o]=r([]),a=l(i);a.current=i;let{rtl:n}=t;function s(t){void 0===t.id&&(t.id="popup"+Math.round(1e6*Math.random()));let e=t;o(i=>[...i.filter(({id:e})=>e!==t.id),e])}async function p(t="last"){if("all"===t){o([]);return}if(!a.current.length)return;"last"===t&&(t=a.current[a.current.length-1].id);let e=a.current.find(e=>e.id===t);e&&(h(`[data-id=${t}]`).addClass("not-mounted"),setTimeout(()=>{e&&"function"==typeof e.onClose&&e.onClose(),o(e=>e.filter(e=>e.id!==t))},300))}function c(){return a.current.map((t,e)=>_(Popup,{modal:t,rtl:n,isLast:e===a.current.length-1,onClose:()=>p(t.id)},t.id))}d(e,()=>({addModal:s,removeModal:p,getModals:()=>a.current}));let u=c();return u.length?_($,{children:u}):null}),CTX=a({});function Popup(t){let{modal:e,rtl:a,onClose:n,isLast:s}=t,{setAttrs:d=()=>({}),id:p,position:c="fullscreen",getTarget:u,maxHeight:$,fixStyle:f=t=>t}=e,[g]=r({dom:i(),backdropDom:i(),dui:void 0,isDown:!1}),[v,b]=r({}),[y,L]=r(e.state),k=d("modal")||{},C=d("backdrop")||{},w=l(!1);async function M(){n()}function N(t){if(!g.dui)return;let e=h(t.target);"popover"===c&&e.attr("data-id")!==g.dui&&!e.parents(`[data-id=${g.dui}]`).length&&M()}o(()=>()=>{h(window).unbind("click",N)}),o(()=>{let t="popover"===c?function t(){if(!u)return{};let i=u();if(!i||!i.length)return{};let o={dom:h(g.dom.current),target:i,fitHorizontal:e.fitHorizontal,fixStyle:f,pageSelector:e.pageSelector,limitTo:e.limitTo,attrs:k,rtl:a},r={...Align(o),position:"absolute"};return $&&(r.maxHeight=$),r}():{};if(console.log("updatedStyle.top",t.top),b(t),u){g.dui="a"+Math.round(1e7*Math.random());u().attr("data-id",g.dui)}setTimeout(()=>{let t=h(g.dom.current);t.removeClass("not-mounted"),h(g.backdropDom.current).removeClass("not-mounted"),t.focus()},0),h(window).unbind("click",N),h(window).bind("click",N)},[]);function A(t){if(s)27===t.keyCode&&n()}function x(){setTimeout(()=>g.isDown=!1,0)}let H,P,S,T;return _(CTX.Provider,{value:{close:M,state:y,setState:L},children:_("div",{...(H="aio-popup-backdrop",H+=` aio-popup-position-${c}`,H+=a?" rtl":" ltr",w&&(H+=" not-mounted"),AddToAttrs(C,{className:H,attrs:{ref:g.backdropDom,onKeyDown:A,tabIndex:0,"data-id":p,onClick:C.onClick?C.onClick:function t(e){if(!g.isDown){e.stopPropagation();h(e.target).hasClass("aio-popup-backdrop")&&M()}}}})),children:m("div",{...(P={...v,...k.style},S="ontouchstart"in document.documentElement?"onTouchStart":"onMouseDown",{...k,ref:g.dom,"data-id":e.id,tabIndex:0,onKeyDown:A,[S]:function t(e){h(window).unbind("mouseup",x),h(window).bind("mouseup",x),g.isDown=!0},className:(T="aio-popup",T+=a?" rtl":" ltr",w&&(T+=" not-mounted"),k.className&&(T+=" "+k.className),T),style:{...P}}),children:[!!e.header&&_(ModalHeader,{modal:e}),_(ModalBody,{modal:e}),!!e.footer&&_("div",{...AddToAttrs(d("footer"),{className:"aio-popup-footer"}),children:e.footer({state:y,setState:L,close:M})})]})})})}let ModalHeader=t=>{let e=n(CTX),{modal:i}=t,{state:o,setState:r}=e,{setAttrs:a=()=>({})}=i,l=a("header")||{};if("function"==typeof i.header)return i.header({close:e.close,state:o,setState:r});if("object"!=typeof i.header)return null;let s="aio-popup-header",{title:d,subtitle:p,onClose:c,before:h,after:u}=i.header;function $(t){t.stopPropagation(),t.preventDefault(),"function"==typeof c?c({state:o,setState:r}):e.close()}function f(){return p?m("div",{className:`${s}-text`,children:[_("div",{className:`${s}-title`,children:d}),_("div",{className:`${s}-subtitle`,children:p})]}):_("div",{className:`${s}-title`,style:{display:"flex",alignItems:"center",flex:1},children:d})}return m("div",{...AddToAttrs(l,{className:s}),children:[void 0!==h&&_("div",{className:`${s}-before`,onClick:t=>$(t),children:h}),!!d&&f(),void 0!==u&&_("div",{className:`${s}-after`,onClick:t=>$(t),children:u}),!1!==c&&_("div",{className:`${s}-close-button`,onClick:t=>$(t),children:_(CloseIcon,{})})]})},ModalBody=t=>{let{state:e,setState:i,close:o}=n(CTX),{modal:r}=t,{body:a=()=>null,setAttrs:l=()=>({})}=r,s=l("body")||{},d={close:o,state:e,setState:i},p=a(d);return p&&null!==p?_("div",{...AddToAttrs(s,{className:"aio-popup-body aio-popup-scroll"}),children:p}):null};function Alert(t){let{icon:e,type:i="",text:o="",subtext:r="",time:a=10,className:n,closeText:l="بستن",position:s="center",onClose:d}=t,p={id:"",time:0,getId:()=>"aa"+Math.round(1e8*Math.random()),getBarRender:()=>`<div class='aio-popup-time-bar' style="width:${p.time}%;"></div>`,updateBarRender(){h(`.aio-popup-alert-container.${p.id} .aio-popup-time`).html(p.getBarRender())},getRender:()=>`
|
|
2
|
-
<div class='aio-popup-alert-container not-mounted ${
|
|
3
|
-
<div class='aio-popup-alert aio-popup-alert-${
|
|
4
|
-
<div class='aio-popup-alert-header'>${
|
|
1
|
+
import{createRef as t,useEffect as e,useState as o,createContext as i,useContext as r,useRef as a}from"react";import*as n from"react-dom/server";import l from"react-dom";import d from"animejs/lib/anime.es.js";import s from"jquery";import"./index.css";import{jsx as p}from"react/jsx-runtime";import{Fragment as c}from"react/jsx-runtime";import{jsxs as u}from"react/jsx-runtime";function _defineProperty(t,e,o){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"==typeof e?e:String(e)}function _toPrimitive(t,e){if("object"!=typeof t||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var i=o.call(t,e||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}let CTX=i({});function Align(t){let{modal:e,target:o,fitHorizontal:i,rtl:r,limitTo:a}=t,n=window.innerWidth,l=window.innerHeight,d={left:0,top:0,bottom:l,right:n,width:n,height:l},s=getBound(o[0]),p=getBound(e[0]);s={...s};let c;if((p={...p}).top=s.bottom,p.bottom=p.top+p.height,i)p.width=s.width,p.left=s.left,p.right=s.left+s.width;else{if(a){let u=e.parents(a);u.length&&(d=getBound(u[0]))}r?(p.right=s.right,p.left=p.right-p.width,p.left<d.left&&(p.left=d.left)):(p.left=s.left,p.right=p.left+p.width,p.right>d.right&&(p.left=d.right-p.width))}return p.bottom>d.bottom?p.height>s.top-d.top?p.top=d.bottom-p.height:p.top=s.top-p.height:p.top=s.bottom,p.height>d.height&&(p.top=d.top,p.height=d.height,c="auto"),{left:p.left,top:p.top,width:p.width,overflowY:c,maxWidth:d.width}}let CloseIcon=()=>p("svg",{viewBox:"0 0 24 24",role:"presentation",style:{width:"1.2rem",height:"1.2rem"},children:p("path",{d:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",style:{fill:"currentcolor"}})});function AddToAttrs(t,e){let{style:o}=e,i,r=[...(t=t||{}).className?t.className.split(" "):[],...(e.className?Array.isArray(e.className)?e.className:e.className.split(" "):[]).filter(t=>!!t)],a=r.length?r.join(" "):void 0,n={...t.style,...o};return{...t,className:a,style:n,...e.attrs}}let usePopup=t=>{let[e,i]=o([]),r=a(e);r.current=e;let[n,d]=o([]),_=a(n);_.current=n;let[h,$]=o(),m=t=>{void 0===t.id&&(t.id="popup"+Math.round(1e6*Math.random()));let e=t;i(o=>[...o.filter(({id:e})=>e!==t.id),e])},g=async t=>{if("string"!=typeof t&&(t="last"),"all"===t){i([]);return}if(!r.current.length)return;"last"===t&&(t=r.current[r.current.length-1].id);let e=r.current.find(e=>e.id===t);e&&(s(`[data-id=${t}]`).addClass("not-mounted"),setTimeout(()=>{e&&"function"==typeof e.onClose&&e.onClose(),i(e=>e.filter(e=>e.id!==t))},300))},f=t=>{d([..._.current,{...t,id:"a"+Math.round(1e9*Math.random())}])},v=t=>{let e=_.current,o=e.find(e=>e.id===t);if(o&&!1!==o.onClose)d(e.filter((e,o)=>e.id!==t)),"function"==typeof o.onClose&&o.onClose()},b=t=>Alert(t),y=t=>$(t),C=()=>$(void 0),L=t=>{let{title:e,subtitle:o,text:i,submitText:r="Yes",canselText:a="No",onSubmit:n,onCansel:l=()=>{},setAttrs:d=()=>({})}=t,s={position:"center",setAttrs(t){let e=d(t);return"modal"===t?AddToAttrs(e,{className:"aio-popup-confirm"}):e},header:{title:e,subtitle:o},body:()=>i,footer:()=>u(c,{children:[p("button",{type:"button",onClick(){l(),g()},children:a}),p("button",{type:"button",className:"active",async onClick(){if(n)!1!==await n()&&g()},children:r})]})};m(s)},k=t=>{let{title:e,subtitle:o,text:i,submitText:r="Submit",canselText:a="close",onSubmit:n,onCansel:l=()=>{},setAttrs:d=()=>({})}=t,s={position:"center",setAttrs(t){let e=d(t);return"modal"===t?AddToAttrs(e,{className:"aio-popup-prompt"}):e},state:{temp:""},header:{title:e,subtitle:o},body:({state:t,setState:e})=>p("textarea",{placeholder:i,value:t.temp,onChange(t){e&&e({temp:t.target.value})}}),footer:({state:t,setState:e})=>u(c,{children:[p("button",{type:"button",onClick(){l(),g()},children:a}),p("button",{type:"button",className:"active",async onClick(){if(n)!1!==await n(t.temp)?g():e({temp:""})},disabled:!t.temp,children:r})]})};m(s)},M=()=>({rtl:!!t&&!!t.rtl,snackebarItems:_.current,removeSnackebar:v,removeModal:g}),S=()=>u(CTX.Provider,{value:M(),children:[r.current.map((t,e)=>p(Popup,{modal:t,isLast:e===r.current.length-1},t.id)),n.map((t,e)=>p(SnackebarItem,{item:t,index:e},t.id)),!!h&&p(Highlight,{highlight:h})]}),P=()=>l.createPortal(S(),document.body);return{addAlert:b,addSnackebar:f,removeModal:g,addModal:m,getModals:()=>r.current,addHighlight:y,removeHighlight:C,render:S,addConfirm:L,addPrompt:k,portal:P}};export default usePopup;let POPUPCTX=i({}),Popup=({modal:i,isLast:n})=>{let l=r(CTX),{setAttrs:d=()=>({}),id:c,position:_="fullscreen",getTarget:h}=i,[$]=o({dom:t(),backdropDom:t(),dui:void 0}),[m,g]=o({}),[f,v]=o(i.state),b=d("modal")||{},y=a(!1);function C(t){if(!$.dui)return;let e=s(t.target);"popover"===_&&e.attr("data-id")!==$.dui&&!e.parents(`[data-id=${$.dui}]`).length&&l.removeModal()}function L(){let t={...m,...b.style},e="ontouchstart"in document.documentElement?"onTouchStart":"onMouseDown";return{...b,ref:$.dom,"data-id":i.id,tabIndex:0,onKeyDown:M,[e]:P,className:w(),style:{...t}}}function k(){if(!h)return{};let t=h();if(!t||!t.length)return{};let e={modal:s($.dom.current),target:t,fitHorizontal:i.fitHorizontal,limitTo:i.limitTo,attrs:b,rtl:l.rtl};return{...Align(e),position:"absolute"}}function M(t){if(n)27===t.keyCode&&l.removeModal()}function S(){}function P(t){s(window).unbind("mouseup",S),s(window).bind("mouseup",S)}function w(){let t="aio-popup";return t+=l.rtl?" rtl":" ltr",y&&(t+=" not-mounted"),b.className&&(t+=" "+b.className),t}e(()=>()=>{s(window).unbind("click",C)}),e(()=>{let t="popover"===_?k():{};if(console.log("updatedStyle.top",t.top),g(t),h){$.dui="a"+Math.round(1e7*Math.random());h().attr("data-id",$.dui)}setTimeout(()=>{let t=s($.dom.current);t.removeClass("not-mounted"),s($.backdropDom.current).removeClass("not-mounted"),t.focus()},0),s(window).unbind("click",C),s(window).bind("click",C)},[]);let T=()=>({mainContext:l,modal:i,isLast:n,state:f,setState:v,onKeyDown:M});return p(POPUPCTX.Provider,{value:T(),children:p(ModalBackdrop,{content:u("div",{...L(),children:[p(ModalHeader,{}),p(ModalBody,{}),p(ModalFooter,{})]}),firstMount:!!y,ref:$.backdropDom})})},ModalBackdrop=({content:t,firstMount:e,ref:i})=>{let{mainContext:a,modal:n,onKeyDown:l}=r(POPUPCTX),{setAttrs:d=()=>({}),id:c,position:u="fullscreen"}=n,[_]=o(d("backdrop")||{});function h(t){if(t.target===t.currentTarget){t.stopPropagation();s(t.target).hasClass("aio-popup-backdrop")&&a.removeModal()}}function $(){let t="aio-popup-backdrop";return t+=` aio-popup-position-${u}`,t+=a.rtl?" rtl":" ltr",e&&(t+=" not-mounted"),AddToAttrs(_,{className:t,attrs:{ref:i,onKeyDown:l,tabIndex:0,"data-id":c,onClick:_.onClick?_.onClick:h}})}return p("div",{...$(),children:t})},ModalHeader=()=>{let{mainContext:t,modal:e,state:o,setState:i}=r(POPUPCTX);if(!e.header)return null;let{setAttrs:a=()=>({})}=e,n=a("header")||{};return"function"==typeof e.header?e.header({removeModal:t.removeModal,state:o,setState:i}):"object"!=typeof e.header?null:u("div",{...AddToAttrs(n,{className:"aio-popup-header"}),children:[p(ModalHeaderElement,{type:"before"},"before"),p(ModalHeaderElement,{type:"title"},"title"),p(ModalHeaderElement,{type:"after"},"after"),p(ModalClose,{})]})},ModalHeaderElement=({type:t})=>{let{modal:e}=r(POPUPCTX),{header:o}=e;return"function"!=typeof o&&o&&o[t]?p("div",{className:`aio-popup-header-${t}`,"data-subtitle":"title"===t?o.subtitle:void 0,children:o[t]}):null},ModalClose=()=>{let{modal:t,state:e,setState:o,mainContext:i}=r(POPUPCTX),{header:a}=t;return"function"!=typeof a&&a&&!1!==a.onClose?p("div",{className:"aio-popup-header-close",onClick(r){r.stopPropagation(),r.preventDefault(),"function"==typeof a.onClose?a.onClose({state:e,setState:o}):i.removeModal(t.id)},children:p(CloseIcon,{})}):null},ModalBody=()=>{let{mainContext:t,state:e,setState:o,modal:i}=r(POPUPCTX),{body:a=()=>null,setAttrs:n=()=>({})}=i,l=n("body")||{},d={removeModal:t.removeModal,state:e,setState:o},s=a(d);return s&&null!==s?p("div",{...AddToAttrs(l,{className:"aio-popup-body aio-popup-scroll"}),children:s}):null},ModalFooter=()=>{let{mainContext:t,modal:e,state:o,setState:i}=r(POPUPCTX),{setAttrs:a=()=>({}),footer:n}=e;if(!n)return null;let l=a("footer")||{},d=AddToAttrs(l,{className:"aio-popup-footer"});return p("div",{...d,children:n({state:o,setState:i,removeModal:t.removeModal})})},SBCTX=i({}),SnackebarItem=t=>{let i=r(CTX),{item:a}=t,{time:n=8,id:l,align:d=["right","top"]}=a;"top"!==d[1]&&"bottom"!==d[1]&&(d[1]="top"),"left"!==d[0]&&"right"!==d[0]&&"center"!==d[0]&&(d[0]="right");let[s,c]=o(!1);function u(){c(!1),setTimeout(()=>i.removeSnackebar(l),200)}e(()=>{setTimeout(()=>c(!0),0),setTimeout(()=>u(),1e3*n)},[]);let _=t=>"error"===t||"warning"===t||"info"===t?p(InfoSvg,{}):p(SuccessSvg,{}),h=()=>({mainContext:i,remove:u,item:{...t.item,time:n,align:d},index:t.index,mounted:s,getSvg:_});return p(SBCTX.Provider,{value:h(),children:p(SnackebarContainer,{})})},SnackebarContainer=()=>{let{mainContext:t,mounted:e,index:o,item:i,remove:a}=r(SBCTX),{rtl:n}=t,{onClose:l,align:d=["right","top"]}=i;function c(t){let e=s(".aio-popup-snackebar-item-container"),o={top:12,bottom:12};for(let i=0;i<t;i++){let r=e.eq(i),a=r.height()+6,n=r.attr("data-vertical-align");o[n]+=a}return{["top"===d[1]?"top":"bottom"]:o[d[1]]}}let u="aio-popup-snackebar-item-container";u+=` aio-popup-snackebar-item-container-horizontal-align-${d[0]}`,e&&(u+=" mounted"),n&&(u+=" rtl");let _=c(o),h={"data-vertical-align":d[1],className:u,style:_,onClick:!1===l?void 0:()=>a()};return p("div",{...h,children:p(SnackebarCard,{})})},SnackebarCard=()=>{let{item:t}=r(SBCTX),{type:e,attrs:o={}}=t,i="aio-popup-snackebar-item";return i+=` aio-popup-snackebar-item-${e}`,o.className&&(i+=` ${o.className}`),u("div",{...{...o,className:i,style:o.style},children:[p(SnackebarIcon,{}),p(SnackebarText,{}),p(SnackebarAction,{}),p(SnackebarBar,{})]})},SnackebarIcon=()=>{let{getSvg:t,item:e}=r(SBCTX);return p("div",{className:"aio-popup-snackebar-item-icon",children:e.icon?e.icon:t(e.type)})},SnackebarText=()=>{let{item:t}=r(SBCTX);return u("div",{className:"aio-popup-snackebar-item-text",children:[p("div",{className:"aio-popup-snackebar-item-uptext",children:t.text}),!!t.subtext&&p("div",{className:"aio-popup-snackebar-item-subtext",children:t.subtext})]})},SnackebarAction=()=>{let{item:t,remove:e}=r(SBCTX),{action:o}=t;return o&&o.text?p("button",{className:"aio-popup-snackebar-item-action",onClick(t){t.stopPropagation(),o&&o.onClick(),e()},children:o.text}):null},SnackebarBar=()=>{let{item:t}=r(SBCTX);return p("div",{className:"aio-popup-snackebar-bar",style:{transition:`${t.time||8}s linear`}})};export function Alert(t){let{icon:e,type:o="",text:i="",subtext:r="",time:a=10,className:l,closeText:d="Close",onClose:p}=t,c={id:"",time:0,getId:()=>"aa"+Math.round(1e8*Math.random()),getBarRender:()=>`<div class='aio-popup-time-bar' style="width:${c.time}%;"></div>`,updateBarRender(){s(`.aio-popup-alert-container.${c.id} .aio-popup-time`).html(c.getBarRender())},getRender:()=>`
|
|
2
|
+
<div class='aio-popup-alert-container not-mounted ${c.id} aio-popup-alert-container-center${l?` ${l}`:""}'>
|
|
3
|
+
<div class='aio-popup-alert aio-popup-alert-${o}'>
|
|
4
|
+
<div class='aio-popup-alert-header'>${c.getIcon()}</div>
|
|
5
5
|
<div class='aio-popup-alert-body aio-popup-scroll'>
|
|
6
|
-
<div class='aio-popup-alert-text'>${
|
|
6
|
+
<div class='aio-popup-alert-text'>${n.renderToStaticMarkup(i)}</div>
|
|
7
7
|
<div class='aio-popup-alert-subtext'>${r}</div>
|
|
8
8
|
</div>
|
|
9
9
|
<div class='aio-popup-alert-footer'>
|
|
10
|
-
<button class='aio-popup-alert-close ${
|
|
10
|
+
<button class='aio-popup-alert-close ${c.id}'>${d}</button>
|
|
11
11
|
</div>
|
|
12
12
|
<div class='aio-popup-time'></div>
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
|
-
`,close(){
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
`,close(){c.toggleClass(!1),setTimeout(()=>{"function"==typeof p&&p(),!1!==p&&s("."+c.id).remove()},200)},getIcon:()=>!1===e?"":e||({error:'<svg viewBox="0 0 24 24" role="presentation" style="width: 4.5rem; height: 4.5rem;"><path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"></path></svg>',warning:'<svg viewBox="0 0 24 24" role="presentation" style="width: 4.5rem; height: 4.5rem;"><path d="M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16"></path></svg>',info:'<svg viewBox="0 0 24 24" role="presentation" style="width: 4.5rem; height: 4.5rem;"><path d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z"></path></svg>',success:'<svg viewBox="0 0 24 24" role="presentation" style="width: 4.5rem; height: 4.5rem;"><path d="M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M12 20C7.59 20 4 16.41 4 12S7.59 4 12 4 20 7.59 20 12 16.41 20 12 20M16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z"></path></svg>'})[o]||"",startTimer(){setTimeout(()=>{if(c.time>=100){c.time=100,c.close();return}c.time+=2,c.updateBarRender(),c.startTimer()},a/50*1e3)},toggleClass(t){let e=s(`.${c.id}`);t?setTimeout(()=>e.removeClass("not-mounted"),0):e.addClass("not-mounted")},render(){s("body").append(c.getRender()),s("button."+c.id).off("click",c.close),s("button."+c.id).on("click",c.close),c.toggleClass(!0)}};c.id=c.getId(),c.render(),a&&c.startTimer()}let Highlight=({highlight:t})=>{let[i,r]=o({Left:0,Top:0,Width:0,Height:0,TopSpace:0,BottomSpace:0}),n=a(i);function l(t){return p("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 512 512",...t,children:u("g",{children:[p("path",{d:"M242.1,45.2c7.7-7.7,20.2-7.7,27.8-0.1l0.1,0.1l236.3,236.3c7.7,7.7,7.7,20.2,0,27.9c-7.7,7.7-20.2,7.7-27.9,0 L256,86.9L33.7,309.3c-7.7,7.7-20.2,7.7-27.9,0c-7.7-7.7-7.7-20.2,0-27.9L242.1,45.2z"}),p("path",{d:"M242.1,202.7c7.7-7.7,20.2-7.7,27.8-0.1l0.1,0.1L506.2,439c7.7,7.7,7.7,20.2,0,27.9c-7.7,7.7-20.2,7.7-27.9,0 L256,244.5L33.7,466.9c-7.7,7.7-20.2,7.7-27.9,0c-7.7-7.7-7.7-20.2,0-27.9L242.1,202.7z"})]})})}function s(t,e,o){return p("div",{className:"aio-popup-highlight-arrow",children:l({width:24,height:24,style:{position:"absolute",height:24,width:24,left:e+o/2-12},className:`aio-popup-highlight-arrow-${t}`})})}function _(e){if(!t.html)return"";let o,i=t.html||"",r=p("div",{className:"aio-popup-highlight-space"}),a=p("div",{className:"aio-popup-highlight-html",children:i}),l=s(e,n.current.Left,n.current.Width);return o="top"===e?u(c,{children:[r,a,l]}):u(c,{children:[l,a,r]}),p("div",{className:"aio-popup-highlight-html-container",children:o})}function h(){!t.mouseAccess&&t.onClick&&t.onClick()}function $(t){let e="",o=0,i="aio-popup-highlight-mask",r=n.current;return"top"===t?(o=r.Top,r.TopSpace>r.BottomSpace&&(e=_("top"))):"bottom"===t?(i+=" aio-popup-highlight-mask-flex",r.TopSpace<=r.BottomSpace&&(e=_("bottom"))):"left"===t?o=r.Left:i+=" aio-popup-highlight-mask-flex",p("div",{className:i,style:{["top"===t||"bottom"===t?"height":"width"]:o},onClick:()=>h(),children:e})}function m(){return p("div",{style:{width:i.Width},className:"aio-popup-highlight-focus-container",onClick:h,children:p("div",{className:"aio-popup-highlight-focus"})})}function g(){return u("div",{className:"aio-popup-highlight-main",style:{height:i.Height},children:[$("left"),m(),$("right")]})}function f(){return{pointerEvents:t.mouseAccess?"none":"all"}}n.current=i,e(()=>{setTimeout(()=>{try{let{dom:e,duration:o=1200}=t;e[0].scrollIntoView();let i=getHLLimit(t),a=getEasing(t),l={...i,targets:[{...n.current}],duration:o,update(t){let{animatables:e}=t;r({...e[0].target})}};a&&(l.easing=a),d(l)}catch{alert("aio-highlighter error => connot find dom")}},0)});let v=AddToAttrs(t.attrs,{className:"aio-popup-highlight",style:f()});return u("div",{...v,children:[$("top"),g(),$("bottom")]})};function getHLLimit(t){let{padding:e=6,dom:o}=t,i=o.offset(),r=i.left-window.pageXOffset,a=i.top-window.pageYOffset,n=window.innerHeight,l=o.outerWidth(),d=o.outerHeight();return{Left:r-1*e,Top:a-1*e,Width:l+2*e,Height:d+2*e,TopSpace:a,BottomSpace:n-(a+d)}}function getEasing(t){let{easing:e}=t;var o=["linear","easeInQuad","easeInSine","easeInCirc","easeInBack","easeOutQuad","easeOutSine","easeOutCirc","easeInOutQuad","easeInOutSine","easeInOutBack","easeOutBounce"];return"number"==typeof e?o[e]||o[0]:e}let InfoSvg=()=>p("svg",{viewBox:"0 0 24 24",role:"presentation",style:{width:"1.2rem",height:"1.2rem"},children:p("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",style:{fill:"currentcolor"}})}),SuccessSvg=()=>p("svg",{viewBox:"0 0 24 24",role:"presentation",style:{width:"1.2rem",height:"1.2rem"},children:p("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M12 20C7.59 20 4 16.41 4 12S7.59 4 12 4 20 7.59 20 12 16.41 20 12 20M16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z",style:{fill:"currentcolor"}})});function getBound(t){try{let e=t.getBoundingClientRect();return{width:e.width,height:e.height,left:e.left,top:e.top,bottom:e.bottom,right:e.right}}catch{return{width:0,height:0,left:0,top:0,bottom:0,right:0}}}export class Loading{constructor(t){_defineProperty(this,"loader","0"),_defineProperty(this,"getLoader_0",()=>`
|
|
16
|
+
<div class="aio-loading-container-0">
|
|
17
|
+
<div class="aio-loading-0">
|
|
18
|
+
${[,,,,,].fill(0).map((t,e)=>this.getLoaderItem_0(`0.${e}`)).join(" ")}
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
`),_defineProperty(this,"getLoaderItem_0",t=>`<div class="aio-loading-item-0" style="animation: 1s ease-in-out ${t}s infinite normal none running aioloading0;"></div>`),_defineProperty(this,"getLoader",t=>{let e="";return"0"===this.loader?e=this.getLoader_0():"string"==typeof this.loader&&(e=this.loader),`<div class="aio-loading" id="aio-loading-${t}">${e}</div>`}),_defineProperty(this,"show",(t,e)=>{e=e||"body";let o=this.getLoader(t),i=document.querySelector(e);i&&i.insertAdjacentHTML("beforeend",o)}),_defineProperty(this,"hide",t=>{let e=document.getElementById("aio-loading-"+t);e||(e=document.querySelector(".aio-loading")),e&&e.remove()}),"string"==typeof t&&(this.loader=t)}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aio-popup",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "handle all types of popup and modals in react",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
"url": "git+https://github.com/mohammadFeiz/aio-popup.git"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@mdi/js": "^7.0.96",
|
|
16
|
-
"@mdi/react": "^1.6.1",
|
|
17
15
|
"jquery": "^3.6.1",
|
|
18
16
|
"animejs": "^3.2.1"
|
|
19
17
|
},
|
package/theme2.css
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--aio-popup-theme2-color: #00b1f2;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.aio-popup-theme-container2 .aio-popup {
|
|
6
|
+
border-radius: 24px;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.aio-popup-theme-container2 .aio-popup-alert-footer {
|
|
11
|
+
justify-content: center;
|
|
12
|
+
padding: 24px;
|
|
13
|
+
height: unset;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.aio-popup-theme-container2 .aio-popup-alert-footer button {
|
|
17
|
+
border-radius: 24px;
|
|
18
|
+
height: 36px;
|
|
19
|
+
width: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.aio-popup-theme-container2 .aio-popup-alert-text {
|
|
23
|
+
font-size: 20px;
|
|
24
|
+
padding: 12px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.aio-popup-theme-container2 .aio-popup-alert-header {
|
|
28
|
+
display: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.aio-popup-theme-container2 .aio-popup-alert-error .aio-popup-alert-text {
|
|
32
|
+
color: #f14747;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.aio-popup-theme-container2 .aio-popup-alert-error .aio-popup-time-bar {
|
|
36
|
+
background: #f14747;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.aio-popup-theme-container2 .aio-popup-alert-error .aio-popup-alert-footer button {
|
|
40
|
+
background: #f14747;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.aio-popup-theme-container2 .aio-popup-alert-warning .aio-popup-alert-text {
|
|
44
|
+
color: #ff7800;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.aio-popup-theme-container2 .aio-popup-alert-warning .aio-popup-time-bar {
|
|
48
|
+
background: #ff7800;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.aio-popup-theme-container2 .aio-popup-alert-warning .aio-popup-alert-footer button {
|
|
52
|
+
background: #ff7800;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.aio-popup-theme-container2 .aio-popup-alert-success .aio-popup-alert-text {
|
|
56
|
+
color: #6EBC3D;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.aio-popup-theme-container2 .aio-popup-alert-success .aio-popup-time-bar {
|
|
60
|
+
background: #6EBC3D;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.aio-popup-theme-container2 .aio-popup-alert-success .aio-popup-alert-footer button {
|
|
64
|
+
background: #6EBC3D;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.aio-popup-theme-container2 .aio-popup-alert-info .aio-popup-alert-text {
|
|
68
|
+
color: var(--aio-popup-theme2-color);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.aio-popup-theme-container2 .aio-popup-alert-info .aio-popup-time-bar {
|
|
72
|
+
background: var(--aio-popup-theme2-color);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.aio-popup-theme-container2 .aio-popup-alert-info .aio-popup-alert-footer button {
|
|
76
|
+
background: var(--aio-popup-theme2-color);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.aio-popup-theme-container2 .aio-popup-confirm {
|
|
80
|
+
border-radius: 24px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.aio-popup-theme-container2 .aio-popup-footer {
|
|
84
|
+
padding: 24px;
|
|
85
|
+
padding-top: 12px;
|
|
86
|
+
border-top: none;
|
|
87
|
+
gap: 6px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.aio-popup-theme-container2 .aio-popup-footer button {
|
|
91
|
+
height: 36px;
|
|
92
|
+
border: none;
|
|
93
|
+
color: var(--aio-popup-theme2-color);
|
|
94
|
+
background: #f1ebed;
|
|
95
|
+
padding: 0 36px;
|
|
96
|
+
border-radius: 24px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.aio-popup-theme-container2 .aio-popup-footer button.active {
|
|
100
|
+
height: 36px;
|
|
101
|
+
border: none;
|
|
102
|
+
color: #fff;
|
|
103
|
+
background: var(--aio-popup-theme2-color);
|
|
104
|
+
padding: 0 36px;
|
|
105
|
+
border-radius: 24px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.aio-popup-theme-container2 .aio-popup-body {
|
|
109
|
+
justify-content: center;
|
|
110
|
+
display: flex;
|
|
111
|
+
color: #000;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.aio-popup-theme-container2 .aio-popup-header-close-button {
|
|
115
|
+
display: none;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.aio-popup-theme-container2 .aio-popup-header {
|
|
119
|
+
border-bottom: none;
|
|
120
|
+
color: var(--aio-popup-theme2-color);
|
|
121
|
+
font-size: 18px;
|
|
122
|
+
font-weight: bold;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.aio-popup-theme-container2 .aio-popup-header-title {
|
|
126
|
+
justify-content: center;
|
|
127
|
+
padding: 8px;
|
|
128
|
+
padding-bottom: 0px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.aio-popup-theme-container2 .aio-popup-prompt textarea {
|
|
132
|
+
border: 1px solid #ddd !important;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.aio-popup-theme-container2 .aio-popup-snackebar-item {
|
|
136
|
+
background: #fff;
|
|
137
|
+
border-radius: 24px;
|
|
138
|
+
color: #000;
|
|
139
|
+
}
|