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/README.md CHANGED
@@ -73,7 +73,7 @@ prompt("Your Name"); // Ask for input
73
73
 
74
74
  confirm(
75
75
  "Hello world",
76
- ()=>console.log("ciao"), // callback for YES / OK
76
+ ()=>console.log("hello"), // callback for YES / OK
77
77
  ()=>console.log("bye") // callback for NO / CANCEL (you can use null if you don't want CB)
78
78
  );
79
79
 
@@ -93,8 +93,9 @@ import 'layerpro';
93
93
  layerpro.popup.open(
94
94
  {
95
95
  id: String,
96
- body: String | Component / Module, // text or component
97
- // source: "", // TODO
96
+ body: String | React Component | Module, // text or component
97
+ name: String,
98
+ icon: "⚠", // or from html symbols table
98
99
 
99
100
  buttons: {
100
101
  confirm: {
@@ -106,30 +107,31 @@ layerpro.popup.open(
106
107
  cb: yourFunctionCallBack() // optional
107
108
  }, // optional
108
109
 
109
- width: Number,
110
- height: Number,
111
- minWidth: Number | Percentance,
112
- minHeight: Number | Percentance,
113
- maxWidth: Number | Percentance,
114
- maxHeight: Number | Percentance,
115
- name: String,
116
- icon: "⚠", // or from html symbols table
117
- iconize: true | false,
118
- maximize: true | false,
119
- close: true | false,
120
- isMaximize: true | false,
121
- dockable: true | false,
122
- raised: true | false,
123
- movable: true | false,
124
- resizable: true | false,
125
- store: true | false,
126
- top: Number | Percentance,
127
- left: Number | Percentance,
128
- right: Number | Percentance,
129
- bottom: Number | Percentance,
130
- fadeIn: 0, // Milliseconds
131
- fadeOut: 0, // Milliseconds
132
- timer: 0 // Milliseconds
110
+ top: Number | String,
111
+ left: Number | String,
112
+ right: Number | String,
113
+ bottom: Number | String,
114
+
115
+ width: Number | String,
116
+ height: Number | String,
117
+ minWidth: Number | String,
118
+ minHeight: Number | String,
119
+ maxWidth: Number | String,
120
+ maxHeight: Number | String,
121
+
122
+ fadeIn: Number, // Milliseconds
123
+ fadeOut: Number, // Milliseconds
124
+ timer: Number // Milliseconds
125
+
126
+ iconize: Boolean,
127
+ maximize: Boolean,
128
+ close: Boolean,
129
+ isMaximize: Boolean,
130
+ dockable: Boolean,
131
+ raised: Boolean,
132
+ movable: Boolean,
133
+ resizable: Boolean,
134
+ store: Boolean,
133
135
  }
134
136
  );
135
137
  ```
@@ -146,6 +148,9 @@ function App() {
146
148
  {
147
149
  id: 'examplePopup',
148
150
  body: 'Example',
151
+ name: 'example',
152
+ icon: '⚠',
153
+
149
154
  buttons: {
150
155
  confirm: {
151
156
  text: "accept",
@@ -155,8 +160,83 @@ function App() {
155
160
  text: "cancel"
156
161
  }
157
162
  },
163
+
158
164
  width: 400,
159
165
  height: 300,
166
+ maxWidth: 500,
167
+ maxHeight: 350,
168
+ minWidth: 200,
169
+ minHeight: 150,
170
+ top: '10%',
171
+ left: '10%',
172
+ right: 'auto',
173
+ bottom: 'auto',
174
+
175
+ fadeIn: 500,
176
+ fadeOut: 500,
177
+ timer: 0
178
+
179
+ iconize: true,
180
+ maximize: true,
181
+ close: true,
182
+ isMaximize: false,
183
+ dockable: false,
184
+ raised: true,
185
+ movable: true,
186
+ resizable: false,
187
+ store: false,
188
+ }
189
+ )
190
+ }
191
+
192
+ export default App
193
+
194
+ ```
195
+
196
+ Example with a React component:
197
+
198
+ ```javascript
199
+
200
+ // Example using React Component
201
+
202
+ import React from "react"
203
+ import 'layerpro'
204
+
205
+ export default () => {
206
+
207
+ // Custom Component6
208
+ const TestApp = () => {
209
+ return (
210
+ <div>
211
+ Hello
212
+ <label>
213
+ Alert: <input type="button" value="Alert" onClick={() => alert("Hello")} />
214
+ </label>
215
+ </div>
216
+ )
217
+ }
218
+
219
+ // Run into layerpro
220
+ layerpro.popup.open(
221
+ {
222
+ id: 'examplePopup',
223
+ body: TestApp(),
224
+ buttons: {
225
+ confirm: {
226
+ text: "accept",
227
+ cb: () => {
228
+ message("confirmed")
229
+ }
230
+ },
231
+ cancel: {
232
+ text: "cancel",
233
+ cb: () => {
234
+ alert("cancelled")
235
+ }
236
+ }
237
+ },
238
+ width: 350,
239
+ height: 300,
160
240
  name: 'example',
161
241
  icon: '&#9888;',
162
242
  iconize: true,
@@ -172,10 +252,8 @@ function App() {
172
252
  left: '10%',
173
253
  right: 'auto',
174
254
  bottom: 'auto',
175
- // maxWidth: 500,
176
- // maxHeight: 350,
177
- // minWidth: 200,
178
- // minHeight: 150,
255
+ minWidth: 200,
256
+ minHeight: 150,
179
257
  fadeIn: 500,
180
258
  fadeOut: 500,
181
259
  timer: 0
@@ -183,9 +261,6 @@ function App() {
183
261
  )
184
262
 
185
263
  }
186
-
187
- export default App
188
-
189
264
  ```
190
265
 
191
266
  Here are some of the main advantages of using LayerPro:
package/docs/index.md CHANGED
@@ -73,7 +73,7 @@ prompt("Your Name"); // Ask for input
73
73
 
74
74
  confirm(
75
75
  "Hello world",
76
- ()=>console.log("ciao"), // callback for YES / OK
76
+ ()=>console.log("hello"), // callback for YES / OK
77
77
  ()=>console.log("bye") // callback for NO / CANCEL (you can use null if you don't want CB)
78
78
  );
79
79
 
@@ -93,8 +93,9 @@ import 'layerpro';
93
93
  layerpro.popup.open(
94
94
  {
95
95
  id: String,
96
- body: String | Component / Module, // text or component
97
- // source: "", // TODO
96
+ body: String | React Component | Module, // text or component
97
+ name: String,
98
+ icon: "&#9888;", // or from html symbols table
98
99
 
99
100
  buttons: {
100
101
  confirm: {
@@ -106,30 +107,31 @@ layerpro.popup.open(
106
107
  cb: yourFunctionCallBack() // optional
107
108
  }, // optional
108
109
 
109
- width: Number,
110
- height: Number,
111
- minWidth: Number | Percentance,
112
- minHeight: Number | Percentance,
113
- maxWidth: Number | Percentance,
114
- maxHeight: Number | Percentance,
115
- name: String,
116
- icon: "&#9888;", // or from html symbols table
117
- iconize: true | false,
118
- maximize: true | false,
119
- close: true | false,
120
- isMaximize: true | false,
121
- dockable: true | false,
122
- raised: true | false,
123
- movable: true | false,
124
- resizable: true | false,
125
- store: true | false,
126
- top: Number | Percentance,
127
- left: Number | Percentance,
128
- right: Number | Percentance,
129
- bottom: Number | Percentance,
130
- fadeIn: 0, // Milliseconds
131
- fadeOut: 0, // Milliseconds
132
- timer: 0 // Milliseconds
110
+ top: Number | String,
111
+ left: Number | String,
112
+ right: Number | String,
113
+ bottom: Number | String,
114
+
115
+ width: Number | String,
116
+ height: Number | String,
117
+ minWidth: Number | String,
118
+ minHeight: Number | String,
119
+ maxWidth: Number | String,
120
+ maxHeight: Number | String,
121
+
122
+ fadeIn: Number, // Milliseconds
123
+ fadeOut: Number, // Milliseconds
124
+ timer: Number // Milliseconds
125
+
126
+ iconize: Boolean,
127
+ maximize: Boolean,
128
+ close: Boolean,
129
+ isMaximize: Boolean,
130
+ dockable: Boolean,
131
+ raised: Boolean,
132
+ movable: Boolean,
133
+ resizable: Boolean,
134
+ store: Boolean,
133
135
  }
134
136
  );
135
137
  ```
@@ -146,6 +148,9 @@ function App() {
146
148
  {
147
149
  id: 'examplePopup',
148
150
  body: 'Example',
151
+ name: 'example',
152
+ icon: '&#9888;',
153
+
149
154
  buttons: {
150
155
  confirm: {
151
156
  text: "accept",
@@ -155,8 +160,83 @@ function App() {
155
160
  text: "cancel"
156
161
  }
157
162
  },
163
+
158
164
  width: 400,
159
165
  height: 300,
166
+ maxWidth: 500,
167
+ maxHeight: 350,
168
+ minWidth: 200,
169
+ minHeight: 150,
170
+ top: '10%',
171
+ left: '10%',
172
+ right: 'auto',
173
+ bottom: 'auto',
174
+
175
+ fadeIn: 500,
176
+ fadeOut: 500,
177
+ timer: 0
178
+
179
+ iconize: true,
180
+ maximize: true,
181
+ close: true,
182
+ isMaximize: false,
183
+ dockable: false,
184
+ raised: true,
185
+ movable: true,
186
+ resizable: false,
187
+ store: false,
188
+ }
189
+ )
190
+ }
191
+
192
+ export default App
193
+
194
+ ```
195
+
196
+ Example with a React component:
197
+
198
+ ```javascript
199
+
200
+ // Example using React Component
201
+
202
+ import React from "react"
203
+ import 'layerpro'
204
+
205
+ export default () => {
206
+
207
+ // Custom Component6
208
+ const TestApp = () => {
209
+ return (
210
+ <div>
211
+ Hello
212
+ <label>
213
+ Alert: <input type="button" value="Alert" onClick={() => alert("Hello")} />
214
+ </label>
215
+ </div>
216
+ )
217
+ }
218
+
219
+ // Run into layerpro
220
+ layerpro.popup.open(
221
+ {
222
+ id: 'examplePopup',
223
+ body: TestApp(),
224
+ buttons: {
225
+ confirm: {
226
+ text: "accept",
227
+ cb: () => {
228
+ message("confirmed")
229
+ }
230
+ },
231
+ cancel: {
232
+ text: "cancel",
233
+ cb: () => {
234
+ alert("cancelled")
235
+ }
236
+ }
237
+ },
238
+ width: 350,
239
+ height: 300,
160
240
  name: 'example',
161
241
  icon: '&#9888;',
162
242
  iconize: true,
@@ -172,10 +252,8 @@ function App() {
172
252
  left: '10%',
173
253
  right: 'auto',
174
254
  bottom: 'auto',
175
- // maxWidth: 500,
176
- // maxHeight: 350,
177
- // minWidth: 200,
178
- // minHeight: 150,
255
+ minWidth: 200,
256
+ minHeight: 150,
179
257
  fadeIn: 500,
180
258
  fadeOut: 500,
181
259
  timer: 0
@@ -183,9 +261,6 @@ function App() {
183
261
  )
184
262
 
185
263
  }
186
-
187
- export default App
188
-
189
264
  ```
190
265
 
191
266
  Here are some of the main advantages of using LayerPro:
@@ -0,0 +1,62 @@
1
+ // Example using React Component
2
+
3
+ import React from "react"
4
+ import 'layerpro'
5
+
6
+ export default () => {
7
+
8
+ const TestApp = () => {
9
+ return (
10
+ <div>
11
+ Hello
12
+ <label>
13
+ Alert: <input type="button" value="Alert" onClick={() => alert("Hello")} />
14
+ </label>
15
+ </div>
16
+ )
17
+ }
18
+
19
+ layerpro.popup.open(
20
+ {
21
+ id: 'examplePopup',
22
+ body: TestApp(),
23
+ buttons: {
24
+ confirm: {
25
+ text: "accept",
26
+ cb: () => {
27
+ message("confirmed")
28
+ }
29
+ },
30
+ cancel: {
31
+ text: "cancel",
32
+ cb: () => {
33
+ alert("cancelled")
34
+ }
35
+ }
36
+ },
37
+ width: 350,
38
+ height: 300,
39
+ name: 'example',
40
+ icon: '&#9888;',
41
+ iconize: true,
42
+ maximize: true,
43
+ close: true,
44
+ isMaximize: false,
45
+ dockable: false,
46
+ raised: true,
47
+ movable: true,
48
+ resizable: false,
49
+ store: false,
50
+ top: '10%',
51
+ left: '10%',
52
+ right: 'auto',
53
+ bottom: 'auto',
54
+ minWidth: 200,
55
+ minHeight: 150,
56
+ fadeIn: 500,
57
+ fadeOut: 500,
58
+ timer: 0
59
+ }
60
+ )
61
+
62
+ }
@@ -0,0 +1,108 @@
1
+ // created by Dario Passariello
2
+
3
+ :root {
4
+ --lp-000: hsl(0, 0%, 5%);
5
+ --lp-001: hsl(0, 0%, 100%);
6
+ --lp-011: rgb(80, 170, 250);
7
+ }
8
+
9
+ //////////////////////////////////////
10
+
11
+ @mixin popup-hover-styles {
12
+ background: var(--lp-011) !important;
13
+ color: var(--lp-001) !important;
14
+ box-shadow: none !important;
15
+
16
+ &:before {
17
+ filter: invert(1) !important;
18
+ }
19
+
20
+ &:after {
21
+ background: var(--lp-011) !important;
22
+ color: var(--lp-000) !important;
23
+ }
24
+ }
25
+
26
+ #popup {
27
+ z-index: 10000 !important;
28
+
29
+ * {
30
+ box-sizing: border-box;
31
+ box-shadow: none;
32
+ }
33
+
34
+ [class^=popup_internal_] {
35
+ top: 36px;
36
+ background: var(--lp-001);
37
+ }
38
+
39
+ [class^=popup_body_] {
40
+ color: var(--lp-000);
41
+ }
42
+
43
+ [class^=popup_bar_] {
44
+ border-bottom: 0;
45
+ box-shadow: none;
46
+ }
47
+
48
+ [class^=popup_] input,
49
+ [class^=popup_] button {
50
+ border: 0;
51
+ }
52
+
53
+ [class^=popup_message_] ul {
54
+ padding: 0 10px !important;
55
+ margin: 0 !important;
56
+ text-align: left;
57
+ }
58
+
59
+ [class^=button_] {
60
+ &:hover {
61
+ @include popup-hover-styles;
62
+ }
63
+ }
64
+
65
+ .iconize:before,
66
+ .maximize:before,
67
+ .close:before {
68
+ filter: invert(1);
69
+ }
70
+
71
+ .buttons {
72
+ button {
73
+ background: var(--lp-011) !important;
74
+ border: none;
75
+ margin: 0;
76
+
77
+ &:hover {
78
+ @include popup-hover-styles;
79
+ }
80
+ }
81
+ }
82
+
83
+ .popup_alert,
84
+ .popup_message,
85
+ .popup_prompt,
86
+ .popup_confirm {
87
+ word-break: normal !important;
88
+
89
+ input[type=text] {
90
+ position: relative;
91
+ width: 90%;
92
+ height: 40px;
93
+ padding: 15px;
94
+ margin-top: 10px;
95
+ border: 2px solid rgba(0, 0, 0, 0.3);
96
+ background: var(--lp-001) !important;
97
+ color: var(--lp-000) !important;
98
+ text-align: center;
99
+ }
100
+ }
101
+
102
+ .zHigh {
103
+ border-top-color: var(--lp-011) !important;
104
+ box-shadow: 0 15px 20px rgba(0, 0, 0, 0.5) !important;
105
+ outline: 1px solid rgba(0, 0, 0, 0.1) !important;
106
+ border: 0;
107
+ }
108
+ }