layerpro 0.9.55 → 0.9.72

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "layerpro",
3
- "version": "0.9.55",
3
+ "version": "0.9.72",
4
4
  "description": "Custom popups, alert, confirmn, prompt... by Dario Passariello",
5
5
  "copyright": "Dario Passariello",
6
6
  "license": "MIT",
@@ -17,111 +17,87 @@ declare function prompt(f1?: string, func1?: Function): any
17
17
 
18
18
  ////////////////////////////////////////////////////////////////////////////////////
19
19
 
20
- // declare var pupop: Object
21
-
22
- interface openProp {
23
- /** Add identificator */
24
- id: string,
25
- /** Add name of popup (also as title) */
26
- name: string,
27
- /** Add text / html or a React Component (no useEffect or useState) */
28
- body: any,
29
- /** Add buttons */
20
+ interface GenLayerProps {
21
+
22
+ id: string
23
+ body?: any
24
+ name?: string
25
+ style?: any
26
+ class?: string
27
+ icon?: string
28
+
30
29
  buttons?: {
31
30
  confirm?: {
32
- text: string,
33
- cb?: Function,
34
- },
31
+ text: string
32
+ cb?: () => void
33
+ }
35
34
  cancel?: {
36
- text: string,
37
- cb?: Function,
35
+ text: string
36
+ cb?: () => void
38
37
  }
39
- },
40
- /** Give the size in width px (exmple "500px") */
41
- width: number,
42
- /** Give the size in width px (exmple "300px") */
43
- height: number,
44
- /** icon from html symbol table */
45
- icon?: string,
46
- /** you want the top/right maximize button */
47
- maximize?: boolean,
48
- /** you want the top/right parking button */
49
- iconize?: boolean,
50
- /** you want the top/right close button */
51
- close?: any,
52
- /** you want at top of everything */
53
- raised?: boolean,
54
- /** move it? */
55
- movable?: boolean,
56
- /** resizable it? */
57
- resizable?: boolean,
58
- /** Run it maximized */
59
- isMaximize?: boolean,
60
- /** You want to see rthe layerpro dock */
61
- dockable?: boolean,
62
- /** You want to memorize last position */
63
- store?: boolean,
64
- /** Add timer to your popup */
65
- timer?: number,
66
-
67
- /** Position in to screen */
68
- top?: number | string,
69
- left?: number | string,
70
- right?: number | string,
71
- bottom?: number | string,
72
-
73
- /** Max and Min sizes */
74
- minWidth?: number | string,
75
- maxWidth?: number | string,
76
- minHeight?: number | string,
77
- maxHeight?: number | string,
78
-
79
- /** Fading time */
80
- fadeIn?: number,
81
- fadeOut?: number,
82
-
83
- // TODO
84
- source?: "",
85
- className?: string,
86
- style?: string
87
- }
38
+ }
88
39
 
89
- interface _layerpro {
90
40
 
91
- readonly alert: (txt: String) => any
92
- readonly prompt: (txt: String, function_: Function, event: Event) => any
93
- readonly message: (txt: String, function_: Function) => any
94
- readonly confirm: (txt: String, function_: Function, noFunction_: Function) => any
95
- readonly purge: (document: Document) => any
96
- readonly credits: (txt: String) => any
97
- readonly popup: {
41
+ top?: number | string
42
+ left?: number | string
43
+ right?: number | string
44
+ bottom?: number | string
98
45
 
99
- [key: string]: any
46
+ width?: number | string
47
+ height?: number | string
100
48
 
101
- /** Open a popup with rules! */
102
- readonly open: (props: openProp) => any,
49
+ minWidth?: number
50
+ minHeight?: number
51
+ maxWidth?: number
52
+ maxHeight?: number
103
53
 
104
- /** Put same id and you can close it from another func */
105
- readonly close: (id: String) => {}
54
+ fadeIn?: number
55
+ fadeOut?: number
56
+ timer?: number
106
57
 
107
- // readonly credits: (name: string) => any
58
+ maximize?: boolean
59
+ isMaximize?: boolean
60
+ dockable?: boolean
61
+ movable?: boolean
108
62
 
109
- // readonly center: (value: any) => {}
110
- // readonly maximize: (value: any) => {}
111
- // readonly iconize: (value: any) => {}
112
- // readonly raised: (value: any) => {}
113
- // readonly movable: (value: any) => {}
114
- // readonly resizable: (value: any) => {}
115
- // readonly dockable: (value: any) => {}
116
- // readonly store: (value: any) => {}
117
- // readonly index: (value: any) => {}
118
- // readonly zIndex: (value: any) => {}
119
- }
63
+ resizable?: boolean
64
+ close?: boolean
65
+ raised?: boolean
66
+ iconize?: boolean
120
67
 
121
- SmoothScroll: (target: any, speed: any, smooth: any) => any
68
+ source?: string
69
+ store?: any
122
70
 
123
71
  }
124
72
 
73
+ /**
74
+ * Interface for the layerpro object
75
+ */
76
+ interface _layerpro {
77
+
78
+ readonly alert: (txt: string) => void
79
+ readonly prompt: (txt: string, callback: (input: string) => void, event: Event) => void
80
+ readonly message: (txt: string, callback: () => void) => void
81
+ readonly confirm: (txt: string, yesCallback: () => void, noCallback: () => void) => void
82
+ readonly purge: (document: Document) => void
83
+ readonly credits: (txt: string) => void
84
+
85
+ readonly popup: {
86
+ readonly open: (props: GenLayerProps) => GenLayerProps
87
+ readonly center: (props: any) => void
88
+ readonly maximize: (props: any) => void
89
+ readonly iconize: (props: any) => void
90
+ readonly raised: (props: any) => void
91
+ readonly movable: (props: any) => void
92
+ readonly resizable: (props: any) => void
93
+ readonly dockable: (props: any) => void
94
+ readonly store: (props: any) => void
95
+ readonly index: (props: any) => void
96
+ readonly zIndex: (props: any) => number
97
+ readonly close: (props: any) => any
98
+ }
99
+ }
100
+
125
101
  declare var layerpro: _layerpro
126
102
  type layerpro = _layerpro
127
103