@saltcorn/sbadmin2 0.8.8-beta.6 → 0.8.9
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/index.js +46 -14
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -25,7 +25,7 @@ const {
|
|
|
25
25
|
const renderLayout = require("@saltcorn/markup/layout");
|
|
26
26
|
const { renderForm, link } = require("@saltcorn/markup");
|
|
27
27
|
const {
|
|
28
|
-
|
|
28
|
+
toast,
|
|
29
29
|
headersInHead,
|
|
30
30
|
headersInBody,
|
|
31
31
|
} = require("@saltcorn/markup/layout_utils");
|
|
@@ -46,6 +46,7 @@ const subItem = (currentUrl) => (item) =>
|
|
|
46
46
|
item.class,
|
|
47
47
|
],
|
|
48
48
|
href: text(item.link),
|
|
49
|
+
target: item.target_blank ? "_blank" : undefined,
|
|
49
50
|
},
|
|
50
51
|
item.icon ? i({ class: `fa-fw mr-05 ${item.icon}` }) : "",
|
|
51
52
|
item.label
|
|
@@ -127,7 +128,11 @@ const sideBarItem = (currentUrl) => (item) => {
|
|
|
127
128
|
]
|
|
128
129
|
: item.link
|
|
129
130
|
? a(
|
|
130
|
-
{
|
|
131
|
+
{
|
|
132
|
+
class: "nav-link",
|
|
133
|
+
href: text(item.link),
|
|
134
|
+
target: item.target_blank ? "_blank" : undefined,
|
|
135
|
+
},
|
|
131
136
|
item.icon ? i({ class: `fa-fw ${item.icon}` }) : "",
|
|
132
137
|
span(text(item.label))
|
|
133
138
|
)
|
|
@@ -403,13 +408,11 @@ const authWrap = ({
|
|
|
403
408
|
<div class="row justify-content-center">
|
|
404
409
|
<div class="col-xl-10 col-lg-12 col-md-9">
|
|
405
410
|
<div class="card o-hidden border-0 shadow-lg my-5">
|
|
406
|
-
<div class="card-body p-
|
|
411
|
+
<div class="card-body p-2">
|
|
407
412
|
<div class="row">
|
|
408
413
|
<div class="col">
|
|
409
414
|
<div class="p-5">
|
|
410
|
-
<div id="alerts-area">
|
|
411
|
-
${alerts.map((a) => alert(a.type, a.msg)).join("")}
|
|
412
|
-
</div>
|
|
415
|
+
<div id="alerts-area">${/* deprecated */ ""}</div>
|
|
413
416
|
<div class="text-center">
|
|
414
417
|
<h1 class="h4 text-gray-900 mb-4">${title}</h1>
|
|
415
418
|
</div>
|
|
@@ -423,6 +426,17 @@ const authWrap = ({
|
|
|
423
426
|
</div>
|
|
424
427
|
</div>
|
|
425
428
|
</div>
|
|
429
|
+
<div
|
|
430
|
+
id="toasts-area"
|
|
431
|
+
class="toast-container position-fixed p-2 top-0 ${
|
|
432
|
+
isNode() ? "end-0" : "start-50"
|
|
433
|
+
}
|
|
434
|
+
style: "z-index: 999;"
|
|
435
|
+
aria-live="polite"
|
|
436
|
+
aria-atomic="true"
|
|
437
|
+
>
|
|
438
|
+
${alerts.map((a) => toast(a.type, a.msg)).join("")}
|
|
439
|
+
</div>
|
|
426
440
|
</div>`
|
|
427
441
|
);
|
|
428
442
|
|
|
@@ -460,15 +474,24 @@ const wrap = ({
|
|
|
460
474
|
<div id="content-wrapper" class="d-flex flex-column">
|
|
461
475
|
<div id="content">
|
|
462
476
|
<div id="page-inner-content" class="container-fluid px-2">
|
|
463
|
-
<div id="alerts-area">
|
|
464
|
-
|
|
465
|
-
</div>
|
|
466
|
-
<div >
|
|
477
|
+
<div id="alerts-area">${/* deprecated */ ""}</div>
|
|
478
|
+
<div>
|
|
467
479
|
${renderBody(title, body, role, req)}
|
|
468
480
|
<div>
|
|
469
481
|
</div>
|
|
470
482
|
</div>
|
|
471
483
|
</div>
|
|
484
|
+
<div
|
|
485
|
+
id="toasts-area"
|
|
486
|
+
class="toast-container position-fixed ${
|
|
487
|
+
isNode() ? "top-0 end-0 p-2" : "bottom-0 start-50 p-0"
|
|
488
|
+
} end-0 p-2"
|
|
489
|
+
style: "z-index: 999; ${!isNode() ? "margin-bottom: 1.0rem" : ""}"
|
|
490
|
+
aria-live="polite"
|
|
491
|
+
aria-atomic="true"
|
|
492
|
+
>
|
|
493
|
+
${alerts.map((a) => toast(a.type, a.msg)).join("")}
|
|
494
|
+
</div>
|
|
472
495
|
</div>`
|
|
473
496
|
);
|
|
474
497
|
|
|
@@ -481,12 +504,21 @@ const wrap = ({
|
|
|
481
504
|
* @returns {string}
|
|
482
505
|
*/
|
|
483
506
|
const exportRenderBody = ({ title, body, alerts, role, req }) =>
|
|
484
|
-
`<div id="alerts-area">
|
|
485
|
-
${alerts.map((a) => alert(a.type, a.msg)).join("")}
|
|
486
|
-
</div>
|
|
507
|
+
`<div id="alerts-area">${/* deprecated */ ""}</div>
|
|
487
508
|
<div >
|
|
488
509
|
${renderBody(title, body, role, req)}
|
|
489
|
-
<div
|
|
510
|
+
<div>
|
|
511
|
+
<div
|
|
512
|
+
id="toasts-area"
|
|
513
|
+
class="toast-container position-fixed ${
|
|
514
|
+
isNode() ? "top-0 end-0 p-2" : "bottom-0 start-50 p-0"
|
|
515
|
+
}"
|
|
516
|
+
style: "z-index: 999; ${!isNode() ? "margin-bottom: 1.0rem" : ""}"
|
|
517
|
+
aria-live="polite"
|
|
518
|
+
aria-atomic="true"
|
|
519
|
+
>
|
|
520
|
+
${alerts.map((a) => toast(a.type, a.msg)).join("")}
|
|
521
|
+
</div>`;
|
|
490
522
|
|
|
491
523
|
module.exports = {
|
|
492
524
|
/** @type {number} */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saltcorn/sbadmin2",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.9",
|
|
4
4
|
"description": "SB Admin 2 layout plugin",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"clean": "echo \"Error: no TypeScript support yet\""
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@saltcorn/data": "0.8.
|
|
13
|
-
"@saltcorn/markup": "0.8.
|
|
12
|
+
"@saltcorn/data": "0.8.9",
|
|
13
|
+
"@saltcorn/markup": "0.8.9",
|
|
14
14
|
"startbootstrap-sb-admin-2-bs5": "^4.1.5-beta.8",
|
|
15
15
|
"nunito-fontface": "0.7.3"
|
|
16
16
|
},
|