aio-popup 6.2.0 → 6.3.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.
Files changed (3) hide show
  1. package/index.d.ts +150 -145
  2. package/index.js +815 -802
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,145 +1,150 @@
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
- type AP_setAttrs = (mode: AP_attrsKey) => any;
20
- export type AP_modal = {
21
- getTarget?: () => any;
22
- limitTo?: string;
23
- rtl?: boolean;
24
- id?: string;
25
- onClose?: boolean | (() => void);
26
- position?: AP_position;
27
- header?: AP_header;
28
- state?: any;
29
- footer?: ReactNode;
30
- body: ReactNode;
31
- animate?: boolean;
32
- fitHorizontal?: boolean;
33
- setAttrs?: AP_setAttrs;
34
- };
35
- export type AP_alert = {
36
- rtl?: boolean;
37
- icon?: false | ReactNode;
38
- type: 'success' | 'error' | 'warning' | 'info';
39
- title?: ReactNode;
40
- text: string;
41
- time?: number;
42
- className?: string;
43
- closeText?: string;
44
- animate?: boolean;
45
- onClose?: boolean | (() => void);
46
- };
47
- export type AP_snackebar = {
48
- id?: string;
49
- text: string;
50
- subtext?: string;
51
- icon?: ReactNode;
52
- time?: number;
53
- action?: {
54
- text: string;
55
- onClick: () => void;
56
- };
57
- type: 'success' | 'error' | 'warning' | 'info';
58
- align?: ['left' | 'center' | 'right', 'top' | 'bottom'];
59
- onClose?: boolean | (() => void);
60
- attrs?: any;
61
- };
62
- export type AP_highlight = {
63
- dom: any;
64
- html: ReactNode;
65
- onClick?: () => void;
66
- mouseAccess?: boolean;
67
- attrs?: any;
68
- padding?: number;
69
- easing?: number | AP_easing;
70
- duration?: number;
71
- };
72
- export type AP_confirm = {
73
- title?: string;
74
- subtitle?: string;
75
- text: string;
76
- submitText?: string;
77
- canselText?: string;
78
- onSubmit?: () => Promise<boolean>;
79
- onCansel?: () => void;
80
- setAttrs?: AP_setAttrs;
81
- };
82
- export type AP_prompt = {
83
- title?: string;
84
- subtitle?: string;
85
- submitText?: string;
86
- canselText?: string;
87
- onSubmit?: (text: string) => Promise<boolean>;
88
- onCansel?: () => void;
89
- setAttrs?: AP_setAttrs;
90
- };
91
- type AP_removeModal = (arg?: string) => void;
92
- type AP_addAlert = (p: AP_alert) => void;
93
- type AP_addSnackebar = (item: AP_snackebar) => void;
94
- type AP_addModal = (o: AP_modal) => void;
95
- type AP_addHighlight = (highlight: AP_highlight) => void;
96
- type AP_removeHighlight = () => void;
97
- type AP_getModals = () => AP_modal[];
98
- type AP_addConfirm = (item: AP_confirm) => void;
99
- type AP_addPrompt = (item: AP_prompt) => void;
100
- type AP_render = (caller?: string) => ReactNode;
101
- export type AP_usePopup = {
102
- addAlert: AP_addAlert;
103
- addSnackebar: AP_addSnackebar;
104
- removeModal: AP_removeModal;
105
- addModal: AP_addModal;
106
- getModals: AP_getModals;
107
- addHighlight: AP_addHighlight;
108
- removeHighlight: AP_removeHighlight;
109
- render: AP_render;
110
- addConfirm: AP_addConfirm;
111
- addPrompt: AP_addPrompt;
112
- };
113
- export type I_usePopup = {
114
- addAlert: AP_addAlert;
115
- addSnackebar: AP_addSnackebar;
116
- removeModal: AP_removeModal;
117
- addModal: AP_addModal;
118
- getModals: AP_getModals;
119
- addHighlight: AP_addHighlight;
120
- removeHighlight: AP_removeHighlight;
121
- render: AP_render;
122
- addConfirm: AP_addConfirm;
123
- addPrompt: AP_addPrompt;
124
- portal: () => void;
125
- };
126
- declare const usePopup: (props?: {
127
- rtl?: boolean;
128
- id?: string;
129
- }) => I_usePopup;
130
- export default usePopup;
131
- export type AP_SnackebarItem = {
132
- item: AP_snackebar;
133
- index: number;
134
- };
135
- export declare function Alert(props: AP_alert): void;
136
- 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';
137
- export declare class Loading {
138
- loader: any;
139
- constructor(loader?: string);
140
- private getLoader_0;
141
- private getLoaderItem_0;
142
- getLoader: (id: string) => string;
143
- show: (id: string, parentSelector?: string) => void;
144
- hide: (id: string) => void;
145
- }
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
+ type AP_setAttrs = (mode: AP_attrsKey) => any;
20
+ export type AP_modal = {
21
+ getTarget?: () => any;
22
+ limitTo?: string;
23
+ rtl?: boolean;
24
+ id?: string;
25
+ onClose?: boolean | (() => void);
26
+ position?: AP_position;
27
+ header?: AP_header;
28
+ state?: any;
29
+ footer?: ReactNode;
30
+ body: ReactNode;
31
+ animate?: boolean;
32
+ fitHorizontal?: boolean;
33
+ setAttrs?: AP_setAttrs;
34
+ };
35
+ export type AP_alert = {
36
+ rtl?: boolean;
37
+ icon?: false | ReactNode;
38
+ type: 'success' | 'error' | 'warning' | 'info';
39
+ title?: ReactNode;
40
+ text: string;
41
+ time?: number;
42
+ className?: string;
43
+ closeText?: string;
44
+ animate?: boolean;
45
+ onClose?: boolean | (() => void);
46
+ };
47
+ export type AP_snackebar = {
48
+ id?: string;
49
+ text: string;
50
+ subtext?: string;
51
+ icon?: ReactNode;
52
+ time?: number;
53
+ action?: {
54
+ text: string;
55
+ onClick: () => void;
56
+ };
57
+ type: 'success' | 'error' | 'warning' | 'info';
58
+ align?: ['left' | 'center' | 'right', 'top' | 'bottom'];
59
+ onClose?: boolean | (() => void);
60
+ attrs?: any;
61
+ };
62
+ export type AP_highlight = {
63
+ dom: any;
64
+ html: ReactNode;
65
+ onClick?: () => void;
66
+ mouseAccess?: boolean;
67
+ attrs?: any;
68
+ padding?: number;
69
+ easing?: number | AP_easing;
70
+ duration?: number;
71
+ };
72
+ export type AP_confirm = {
73
+ title?: string;
74
+ subtitle?: string;
75
+ text: string;
76
+ submitText?: string;
77
+ canselText?: string;
78
+ onSubmit?: () => Promise<boolean>;
79
+ onCansel?: () => void;
80
+ submitAttrs?: any;
81
+ canselAttrs?: any;
82
+ setAttrs?: AP_setAttrs;
83
+ };
84
+ export type AP_prompt = {
85
+ title?: string;
86
+ text: string;
87
+ subtitle?: string;
88
+ submitText?: string;
89
+ canselText?: string;
90
+ onSubmit?: (text: string) => Promise<boolean>;
91
+ onCansel?: () => void;
92
+ submitAttrs?: any;
93
+ canselAttrs?: any;
94
+ setAttrs?: AP_setAttrs;
95
+ };
96
+ type AP_removeModal = (arg?: string) => void;
97
+ type AP_addAlert = (p: AP_alert) => void;
98
+ type AP_addSnackebar = (item: AP_snackebar) => void;
99
+ type AP_addModal = (o: AP_modal) => void;
100
+ type AP_addHighlight = (highlight: AP_highlight) => void;
101
+ type AP_removeHighlight = () => void;
102
+ type AP_getModals = () => AP_modal[];
103
+ type AP_addConfirm = (item: AP_confirm) => void;
104
+ type AP_addPrompt = (item: AP_prompt) => void;
105
+ type AP_render = (caller?: string) => ReactNode;
106
+ export type AP_usePopup = {
107
+ addAlert: AP_addAlert;
108
+ addSnackebar: AP_addSnackebar;
109
+ removeModal: AP_removeModal;
110
+ addModal: AP_addModal;
111
+ getModals: AP_getModals;
112
+ addHighlight: AP_addHighlight;
113
+ removeHighlight: AP_removeHighlight;
114
+ render: AP_render;
115
+ addConfirm: AP_addConfirm;
116
+ addPrompt: AP_addPrompt;
117
+ };
118
+ export type I_usePopup = {
119
+ addAlert: AP_addAlert;
120
+ addSnackebar: AP_addSnackebar;
121
+ removeModal: AP_removeModal;
122
+ addModal: AP_addModal;
123
+ getModals: AP_getModals;
124
+ addHighlight: AP_addHighlight;
125
+ removeHighlight: AP_removeHighlight;
126
+ render: AP_render;
127
+ addConfirm: AP_addConfirm;
128
+ addPrompt: AP_addPrompt;
129
+ portal: () => void;
130
+ };
131
+ declare const usePopup: (props?: {
132
+ rtl?: boolean;
133
+ id?: string;
134
+ }) => I_usePopup;
135
+ export default usePopup;
136
+ export type AP_SnackebarItem = {
137
+ item: AP_snackebar;
138
+ index: number;
139
+ };
140
+ export declare function Alert(props: AP_alert): void;
141
+ 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';
142
+ export declare class Loading {
143
+ loader: any;
144
+ constructor(loader?: string);
145
+ private getLoader_0;
146
+ private getLoaderItem_0;
147
+ getLoader: (id: string) => string;
148
+ show: (id: string, parentSelector?: string) => void;
149
+ hide: (id: string) => void;
150
+ }