layerpro 3.1.0 → 3.1.5
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/FUNDING.yml +12 -0
- package/README.md +44 -19
- package/index.cjs +338 -306
- package/index.js +336 -308
- package/markdown/GUIDE.md +367 -367
- package/package.json +35 -13
- package/react.cjs +18 -0
- package/react.js +18 -0
- package/types/layerpro.d.ts +132 -129
package/FUNDING.yml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# These are supported funding model platforms
|
|
2
|
+
|
|
3
|
+
github: passariello
|
|
4
|
+
patreon: passariello
|
|
5
|
+
ko_fi: passariello
|
|
6
|
+
liberapay: passariello
|
|
7
|
+
issuehunt: passariello
|
|
8
|
+
custom:
|
|
9
|
+
[
|
|
10
|
+
"https://dario.passariello.ca",
|
|
11
|
+
"https://www.indiegogo.com/individuals/28513718",
|
|
12
|
+
]
|
package/README.md
CHANGED
|
@@ -66,7 +66,17 @@ Import LayerPro once in your app entry point:
|
|
|
66
66
|
import "layerpro";
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
That's it. Now you have `alert()`, `confirm()`, `prompt()`, and `
|
|
69
|
+
That's it. Now you have `alert()`, `confirm()`, `prompt()`, `message()`, and `popup()` globally available.
|
|
70
|
+
|
|
71
|
+
The `popup` alias is a shorthand for `layerpro.popup`:
|
|
72
|
+
|
|
73
|
+
```javascript
|
|
74
|
+
import "layerpro";
|
|
75
|
+
|
|
76
|
+
// Both work identically:
|
|
77
|
+
layerpro.popup.open({ id: 'myPopup', body: 'Hello World' });
|
|
78
|
+
popup.open({ id: 'myPopup', body: 'Hello World' });
|
|
79
|
+
```
|
|
70
80
|
|
|
71
81
|
---
|
|
72
82
|
|
|
@@ -90,8 +100,23 @@ message("Operation complete!");
|
|
|
90
100
|
|
|
91
101
|
### Custom Popups
|
|
92
102
|
|
|
103
|
+
You can use either `layerpro.popup.open(...)` or the shorthand `popup.open(...)`:
|
|
104
|
+
|
|
93
105
|
```javascript
|
|
94
|
-
|
|
106
|
+
popup.open({
|
|
107
|
+
id: 'myModal',
|
|
108
|
+
name: 'My Modal',
|
|
109
|
+
body: '<p>Your content here</p>',
|
|
110
|
+
width: 450,
|
|
111
|
+
height: 350,
|
|
112
|
+
buttons: {
|
|
113
|
+
confirm: { text: "OK", cb: () => {} },
|
|
114
|
+
cancel: { text: "Cancel", cb: () => {} }
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
// Or using the global alias:
|
|
119
|
+
popup.open({
|
|
95
120
|
id: 'myModal',
|
|
96
121
|
name: 'My Modal',
|
|
97
122
|
body: '<p>Your content here</p>',
|
|
@@ -109,7 +134,7 @@ layerpro.popup.open({
|
|
|
109
134
|
In a React environment, you can pass React components directly:
|
|
110
135
|
|
|
111
136
|
```jsx
|
|
112
|
-
|
|
137
|
+
popup.open({
|
|
113
138
|
id: 'reactModal',
|
|
114
139
|
name: 'React Modal',
|
|
115
140
|
body: <MyComponent />, // React element
|
|
@@ -226,15 +251,15 @@ message("Done!"); // LayerPro message
|
|
|
226
251
|
|
|
227
252
|
| Method | Description |
|
|
228
253
|
|--------|-------------|
|
|
229
|
-
| `
|
|
230
|
-
| `
|
|
231
|
-
| `
|
|
232
|
-
| `
|
|
233
|
-
| `
|
|
234
|
-
| `
|
|
235
|
-
| `
|
|
236
|
-
| `
|
|
237
|
-
| `
|
|
254
|
+
| `popup.open(props)` | Open a modal; returns the props. Re-opens a same-id window to front + refreshes body. |
|
|
255
|
+
| `popup.close(id)` | Close (and unmount) a modal. |
|
|
256
|
+
| `popup.center(id, offset?)` | Center a modal in the viewport; optional pixel offset |
|
|
257
|
+
| `popup.maximize(props)` | Toggle maximize (pure CSS) |
|
|
258
|
+
| `popup.iconize(id)` | Toggle minimize to the dock |
|
|
259
|
+
| `popup.index(id)` | Bring a modal to the front (select) |
|
|
260
|
+
| `popup.zIndex()` | Get the next z-index counter value |
|
|
261
|
+
| `popup.movable(props)` | Enable dragging |
|
|
262
|
+
| `popup.resizable(props)` | Enable resizing |
|
|
238
263
|
| `layerpro.noGlobals()` | Restore native `alert`/`confirm`/`prompt`; remove `message` |
|
|
239
264
|
|
|
240
265
|
---
|
|
@@ -271,13 +296,13 @@ properties, so theming needs no `!important` or `[class^=popup_…]` selectors:
|
|
|
271
296
|
|
|
272
297
|
| Method | Description |
|
|
273
298
|
|--------|-------------|
|
|
274
|
-
| `
|
|
275
|
-
| `
|
|
276
|
-
| `
|
|
277
|
-
| `
|
|
278
|
-
| `
|
|
279
|
-
| `
|
|
280
|
-
| `
|
|
299
|
+
| `popup.open(props)` | Open a modal |
|
|
300
|
+
| `popup.close(id)` | Close a modal |
|
|
301
|
+
| `popup.center(id)` | Center modal |
|
|
302
|
+
| `popup.maximize(id)` | Maximize modal |
|
|
303
|
+
| `popup.iconize(id)` | Minimize to dock |
|
|
304
|
+
| `popup.movable(id)` | Enable drag |
|
|
305
|
+
| `popup.resizable(id)` | Enable resize |
|
|
281
306
|
|
|
282
307
|
---
|
|
283
308
|
|