web-mojo 2.1.46 → 2.1.116
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/dist/admin.cjs.js +1 -1
- package/dist/admin.cjs.js.map +1 -1
- package/dist/admin.es.js +15 -26
- package/dist/admin.es.js.map +1 -1
- package/dist/auth.cjs.js +1 -1
- package/dist/auth.cjs.js.map +1 -1
- package/dist/auth.css +179 -660
- package/dist/auth.es.js +83 -43
- package/dist/auth.es.js.map +1 -1
- package/dist/charts.cjs.js +1 -1
- package/dist/charts.es.js +2 -2
- package/dist/chunks/{ContextMenu-gEcpSz56.js → ContextMenu-CUvwhX0l.js} +2 -2
- package/dist/chunks/{ContextMenu-gEcpSz56.js.map → ContextMenu-CUvwhX0l.js.map} +1 -1
- package/dist/chunks/{ContextMenu-BrHqj0fn.js → ContextMenu-DRp4XFcC.js} +2 -2
- package/dist/chunks/{ContextMenu-BrHqj0fn.js.map → ContextMenu-DRp4XFcC.js.map} +1 -1
- package/dist/chunks/{DataView-DjZQrpba.js → DataView-D4K18g9k.js} +2 -2
- package/dist/chunks/{DataView-DjZQrpba.js.map → DataView-D4K18g9k.js.map} +1 -1
- package/dist/chunks/{DataView-DPryYpEW.js → DataView-DsSzhNcH.js} +2 -2
- package/dist/chunks/{DataView-DPryYpEW.js.map → DataView-DsSzhNcH.js.map} +1 -1
- package/dist/chunks/{Dialog-BsRx4eg3.js → Dialog--4J9O60R.js} +2 -2
- package/dist/chunks/{Dialog-BsRx4eg3.js.map → Dialog--4J9O60R.js.map} +1 -1
- package/dist/chunks/{Dialog-DSlctbon.js → Dialog-DXrIEti_.js} +5 -5
- package/dist/chunks/{Dialog-DSlctbon.js.map → Dialog-DXrIEti_.js.map} +1 -1
- package/dist/chunks/{FilePreviewView-BmFHzK5K.js → FilePreviewView-HtW6KRdR.js} +125 -58
- package/dist/chunks/FilePreviewView-HtW6KRdR.js.map +1 -0
- package/dist/chunks/FilePreviewView-NeIc7I0M.js +2 -0
- package/dist/chunks/FilePreviewView-NeIc7I0M.js.map +1 -0
- package/dist/chunks/{FormView-DqUBMPJ9.js → FormView-CIa1o6FC.js} +55 -34
- package/dist/chunks/FormView-CIa1o6FC.js.map +1 -0
- package/dist/chunks/{FormView-CmBuwKGD.js → FormView-CTGzaTJ0.js} +2 -2
- package/dist/chunks/FormView-CTGzaTJ0.js.map +1 -0
- package/dist/chunks/{MetricsChart-CPidSMaN.js → MetricsChart-DemSixLu.js} +2 -2
- package/dist/chunks/{MetricsChart-CPidSMaN.js.map → MetricsChart-DemSixLu.js.map} +1 -1
- package/dist/chunks/{MetricsChart-CM4CI6eA.js → MetricsChart-Dx66dFfT.js} +3 -3
- package/dist/chunks/{MetricsChart-CM4CI6eA.js.map → MetricsChart-Dx66dFfT.js.map} +1 -1
- package/dist/chunks/{PDFViewer-BNQlnS83.js → PDFViewer-rK7woJFy.js} +2 -2
- package/dist/chunks/{PDFViewer-BNQlnS83.js.map → PDFViewer-rK7woJFy.js.map} +1 -1
- package/dist/chunks/{PDFViewer-Dyo-Oeyd.js → PDFViewer-vqSk5_Md.js} +3 -3
- package/dist/chunks/{PDFViewer-Dyo-Oeyd.js.map → PDFViewer-vqSk5_Md.js.map} +1 -1
- package/dist/chunks/{Page-BFgj0pAA.js → Page-B88l1hS3.js} +2 -2
- package/dist/chunks/{Page-BFgj0pAA.js.map → Page-B88l1hS3.js.map} +1 -1
- package/dist/chunks/{Page-B524zSQs.js → Page-BetG0u0h.js} +2 -2
- package/dist/chunks/{Page-B524zSQs.js.map → Page-BetG0u0h.js.map} +1 -1
- package/dist/chunks/{TopNav-D3I3_25f.js → TopNav-B-ox8ef4.js} +14 -4
- package/dist/chunks/TopNav-B-ox8ef4.js.map +1 -0
- package/dist/chunks/TopNav-aS3Dyowj.js +2 -0
- package/dist/chunks/TopNav-aS3Dyowj.js.map +1 -0
- package/dist/chunks/{User-DwIT-CTQ.js → User-B3Iz5PQD.js} +31 -2
- package/dist/chunks/User-B3Iz5PQD.js.map +1 -0
- package/dist/chunks/User-Bi9SbbzB.js +3 -0
- package/dist/chunks/User-Bi9SbbzB.js.map +1 -0
- package/dist/chunks/{WebApp-B6mgbNn2.js → WebApp-Bdehjb5l.js} +146 -17
- package/dist/chunks/WebApp-Bdehjb5l.js.map +1 -0
- package/dist/chunks/WebApp-DGWgRFwF.js +2 -0
- package/dist/chunks/WebApp-DGWgRFwF.js.map +1 -0
- package/dist/css/web-mojo.css +2 -2
- package/dist/docit.cjs.js +1 -1
- package/dist/docit.css +531 -0
- package/dist/docit.es.js +6 -6
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +40 -19
- package/dist/index.es.js.map +1 -1
- package/dist/lightbox.cjs.js +1 -1
- package/dist/lightbox.es.js +4 -4
- package/dist/portal.css +258 -44
- package/package.json +2 -10
- package/dist/chunks/FilePreviewView-BmFHzK5K.js.map +0 -1
- package/dist/chunks/FilePreviewView-DcdRl_ta.js +0 -2
- package/dist/chunks/FilePreviewView-DcdRl_ta.js.map +0 -1
- package/dist/chunks/FormView-CmBuwKGD.js.map +0 -1
- package/dist/chunks/FormView-DqUBMPJ9.js.map +0 -1
- package/dist/chunks/TopNav-D3I3_25f.js.map +0 -1
- package/dist/chunks/TopNav-MDjL4kV0.js +0 -2
- package/dist/chunks/TopNav-MDjL4kV0.js.map +0 -1
- package/dist/chunks/User-BalfYTEF.js +0 -3
- package/dist/chunks/User-BalfYTEF.js.map +0 -1
- package/dist/chunks/User-DwIT-CTQ.js.map +0 -1
- package/dist/chunks/WebApp-B6mgbNn2.js.map +0 -1
- package/dist/chunks/WebApp-DqDowtkl.js +0 -2
- package/dist/chunks/WebApp-DqDowtkl.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { M as Model, C as Collection, T as ToastService, G as GroupList, c as UserList } from "./User-
|
|
2
|
-
import { r as rest, V as View, d as dataFormatter, M as Mustache } from "./WebApp-
|
|
3
|
-
import { P as Page } from "./Page-
|
|
4
|
-
import Dialog from "./Dialog-
|
|
5
|
-
import { F as FormView } from "./FormView-
|
|
1
|
+
import { M as Model, C as Collection, T as ToastService, G as GroupList, c as UserList } from "./User-B3Iz5PQD.js";
|
|
2
|
+
import { r as rest, V as View, d as dataFormatter, M as Mustache } from "./WebApp-Bdehjb5l.js";
|
|
3
|
+
import { P as Page } from "./Page-BetG0u0h.js";
|
|
4
|
+
import Dialog from "./Dialog-DXrIEti_.js";
|
|
5
|
+
import { F as FormView } from "./FormView-CIa1o6FC.js";
|
|
6
6
|
class S3Bucket extends Model {
|
|
7
7
|
constructor(data = {}) {
|
|
8
8
|
super(data, {
|
|
@@ -1341,22 +1341,38 @@ const FileManagerForms = {
|
|
|
1341
1341
|
owners: {
|
|
1342
1342
|
fields: [
|
|
1343
1343
|
{
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
label: "Owner
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1344
|
+
type: "collection",
|
|
1345
|
+
name: "group",
|
|
1346
|
+
label: "Group (Owner)",
|
|
1347
|
+
Collection: GroupList,
|
|
1348
|
+
// Collection class
|
|
1349
|
+
labelField: "name",
|
|
1350
|
+
// Field to display in dropdown
|
|
1351
|
+
valueField: "id",
|
|
1352
|
+
// Field to use as value
|
|
1353
|
+
maxItems: 10,
|
|
1354
|
+
// Max items to show in dropdown
|
|
1355
|
+
placeholder: "Search groups...",
|
|
1356
|
+
emptyFetch: false,
|
|
1357
|
+
debounceMs: 300
|
|
1358
|
+
// Search debounce delay
|
|
1351
1359
|
},
|
|
1352
1360
|
{
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
label: "Owner
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1361
|
+
type: "collection",
|
|
1362
|
+
name: "user",
|
|
1363
|
+
label: "User (Owner)",
|
|
1364
|
+
Collection: UserList,
|
|
1365
|
+
// Collection class
|
|
1366
|
+
labelField: "display_name",
|
|
1367
|
+
// Field to display in dropdown
|
|
1368
|
+
valueField: "id",
|
|
1369
|
+
// Field to use as value
|
|
1370
|
+
maxItems: 10,
|
|
1371
|
+
// Max items to show in dropdown
|
|
1372
|
+
placeholder: "Search users...",
|
|
1373
|
+
emptyFetch: false,
|
|
1374
|
+
debounceMs: 300
|
|
1375
|
+
// Search debounce delay
|
|
1360
1376
|
}
|
|
1361
1377
|
]
|
|
1362
1378
|
},
|
|
@@ -2355,26 +2371,29 @@ const MemberForms = {
|
|
|
2355
2371
|
title: "Edit Membership",
|
|
2356
2372
|
fields: [
|
|
2357
2373
|
{
|
|
2358
|
-
name: "
|
|
2374
|
+
name: "user.display_name",
|
|
2375
|
+
type: "text",
|
|
2376
|
+
label: "Display Name",
|
|
2377
|
+
placeholder: "Enter Display Name"
|
|
2378
|
+
},
|
|
2379
|
+
{
|
|
2380
|
+
name: "metadata.role",
|
|
2359
2381
|
type: "text",
|
|
2360
2382
|
label: "Role",
|
|
2361
2383
|
required: true,
|
|
2362
2384
|
placeholder: "Enter role"
|
|
2363
2385
|
},
|
|
2364
2386
|
{
|
|
2365
|
-
name:
|
|
2366
|
-
type: "
|
|
2367
|
-
label: "
|
|
2368
|
-
|
|
2369
|
-
options: [
|
|
2370
|
-
{ value: "active", label: "Active" },
|
|
2371
|
-
{ value: "inactive", label: "Inactive" },
|
|
2372
|
-
{ value: "pending", label: "Pending" }
|
|
2373
|
-
]
|
|
2387
|
+
name: `is_active`,
|
|
2388
|
+
type: "switch",
|
|
2389
|
+
label: "Is Enabled",
|
|
2390
|
+
columns: 12
|
|
2374
2391
|
}
|
|
2375
2392
|
]
|
|
2376
2393
|
}
|
|
2377
2394
|
};
|
|
2395
|
+
Member.EDIT_FORM = MemberForms.edit;
|
|
2396
|
+
Member.ADD_FORM = MemberForms.create;
|
|
2378
2397
|
class MetricsPermission extends Model {
|
|
2379
2398
|
constructor(data = {}) {
|
|
2380
2399
|
super(data, {
|
|
@@ -2722,13 +2741,24 @@ class ListView extends View {
|
|
|
2722
2741
|
this.emptyMessage = options.emptyMessage || "No items to display";
|
|
2723
2742
|
this.loading = false;
|
|
2724
2743
|
this.isEmpty = true;
|
|
2725
|
-
|
|
2744
|
+
}
|
|
2745
|
+
/**
|
|
2746
|
+
* Override onInit to set up initial state
|
|
2747
|
+
*/
|
|
2748
|
+
async onInit() {
|
|
2749
|
+
this._initCollection(this.options.collection || this.options.Collection);
|
|
2750
|
+
if (this.collection && this.collection.isEmpty() && this.collection.restEnabled) {
|
|
2751
|
+
await this.collection.fetch();
|
|
2752
|
+
}
|
|
2726
2753
|
}
|
|
2727
2754
|
/**
|
|
2728
2755
|
* Initialize the collection
|
|
2729
2756
|
*/
|
|
2730
2757
|
_initCollection(collectionOrClass) {
|
|
2731
|
-
if (!collectionOrClass)
|
|
2758
|
+
if (!collectionOrClass) {
|
|
2759
|
+
console.log("Collection not provided");
|
|
2760
|
+
return;
|
|
2761
|
+
}
|
|
2732
2762
|
if (collectionOrClass instanceof Collection) {
|
|
2733
2763
|
this.setCollection(collectionOrClass);
|
|
2734
2764
|
} else if (typeof collectionOrClass === "function") {
|
|
@@ -3009,14 +3039,6 @@ class ListView extends View {
|
|
|
3009
3039
|
}
|
|
3010
3040
|
this._buildItems();
|
|
3011
3041
|
}
|
|
3012
|
-
/**
|
|
3013
|
-
* Override onInit to set up initial state
|
|
3014
|
-
*/
|
|
3015
|
-
async onInit() {
|
|
3016
|
-
if (this.collection && this.collection.isEmpty() && this.collection.restEnabled) {
|
|
3017
|
-
await this.collection.fetch();
|
|
3018
|
-
}
|
|
3019
|
-
}
|
|
3020
3042
|
/**
|
|
3021
3043
|
* Override destroy to clean up
|
|
3022
3044
|
*/
|
|
@@ -3065,7 +3087,7 @@ class TableRow extends ListViewItem {
|
|
|
3065
3087
|
*/
|
|
3066
3088
|
buildRowTemplate() {
|
|
3067
3089
|
let template = "";
|
|
3068
|
-
if (this.tableView && this.tableView.
|
|
3090
|
+
if (this.tableView && this.tableView.isSelectable()) {
|
|
3069
3091
|
template += `
|
|
3070
3092
|
<td style="padding: 0;">
|
|
3071
3093
|
<div class="mojo-select-cell {{#selected}}selected{{/selected}}"
|
|
@@ -3371,12 +3393,21 @@ class TableView extends ListView {
|
|
|
3371
3393
|
this.deleteTemplate = options.deleteTemplate;
|
|
3372
3394
|
this.formDialogConfig = options.formDialogConfig || {};
|
|
3373
3395
|
this.viewDialogOptions = options.viewDialogOptions || {};
|
|
3396
|
+
this.exportOptions = options.exportOptions || null;
|
|
3397
|
+
if (this.options.showExport && !this.exportOptions) {
|
|
3398
|
+
this.exportOptions = [
|
|
3399
|
+
{ format: "csv", label: "Export as CSV", icon: "bi bi-file-earmark-spreadsheet" },
|
|
3400
|
+
{ format: "json", label: "Export as JSON", icon: "bi bi-file-earmark-code" }
|
|
3401
|
+
];
|
|
3402
|
+
}
|
|
3403
|
+
this.exportSource = options.exportSource || "remote";
|
|
3374
3404
|
this.filters = {};
|
|
3375
3405
|
this.additionalFilters = options.filters || [];
|
|
3376
3406
|
this.hideActivePills = options.hideActivePills || false;
|
|
3377
3407
|
this.hideActivePillNames = options.hideActivePillNames || [];
|
|
3378
3408
|
this.rowAction = options.rowAction || "row-click";
|
|
3379
3409
|
this.batchBarLocation = options.batchBarLocation || "bottom";
|
|
3410
|
+
this.options.addButtonLabel = options.addButtonLabel || "Add";
|
|
3380
3411
|
this.tableOptions = {
|
|
3381
3412
|
striped: true,
|
|
3382
3413
|
bordered: false,
|
|
@@ -3438,6 +3469,9 @@ class TableView extends ListView {
|
|
|
3438
3469
|
data.searchValue = this.getActiveFilters().search || "";
|
|
3439
3470
|
return data;
|
|
3440
3471
|
}
|
|
3472
|
+
isSelectable() {
|
|
3473
|
+
return this.batchActions && this.batchActions.length > 0 && this.selectionMode == "multiple";
|
|
3474
|
+
}
|
|
3441
3475
|
/**
|
|
3442
3476
|
* Build the complete table template
|
|
3443
3477
|
*/
|
|
@@ -3525,21 +3559,45 @@ class TableView extends ListView {
|
|
|
3525
3559
|
buttons.push(`
|
|
3526
3560
|
<button class="btn btn-sm btn-success btn-add"
|
|
3527
3561
|
data-action="add"
|
|
3528
|
-
title="
|
|
3562
|
+
title="${this.options.addButtonLabel}">
|
|
3529
3563
|
<i class="bi bi-plus-circle me-1"></i>
|
|
3530
|
-
<span class="d-none d-lg-inline"
|
|
3564
|
+
<span class="d-none d-lg-inline">${this.options.addButtonLabel}</span>
|
|
3531
3565
|
</button>
|
|
3532
3566
|
`);
|
|
3533
3567
|
}
|
|
3534
3568
|
if (this.options.showExport) {
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3569
|
+
if (this.exportOptions && this.exportOptions.length > 1) {
|
|
3570
|
+
const dropdownItems = this.exportOptions.map((opt) => `
|
|
3571
|
+
<li>
|
|
3572
|
+
<a class="dropdown-item" href="#" data-action="export" data-format="${opt.format}">
|
|
3573
|
+
<i class="${opt.icon || "bi bi-file-earmark-arrow-down"} me-2"></i>${opt.label}
|
|
3574
|
+
</a>
|
|
3575
|
+
</li>
|
|
3576
|
+
`).join("");
|
|
3577
|
+
buttons.push(`
|
|
3578
|
+
<div class="dropdown">
|
|
3579
|
+
<button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button"
|
|
3580
|
+
data-bs-toggle="dropdown" aria-expanded="false" title="Export">
|
|
3581
|
+
<i class="bi bi-download me-1"></i>
|
|
3582
|
+
<span class="d-none d-lg-inline">Export</span>
|
|
3583
|
+
</button>
|
|
3584
|
+
<ul class="dropdown-menu">
|
|
3585
|
+
${dropdownItems}
|
|
3586
|
+
</ul>
|
|
3587
|
+
</div>
|
|
3588
|
+
`);
|
|
3589
|
+
} else {
|
|
3590
|
+
const format = this.exportOptions && this.exportOptions.length === 1 ? this.exportOptions[0].format : "json";
|
|
3591
|
+
buttons.push(`
|
|
3592
|
+
<button class="btn btn-sm btn-outline-secondary btn-export"
|
|
3593
|
+
data-action="export"
|
|
3594
|
+
data-format="${format}"
|
|
3595
|
+
title="Export">
|
|
3596
|
+
<i class="bi bi-download me-1"></i>
|
|
3597
|
+
<span class="d-none d-lg-inline">Export</span>
|
|
3598
|
+
</button>
|
|
3599
|
+
`);
|
|
3600
|
+
}
|
|
3543
3601
|
}
|
|
3544
3602
|
return buttons.join("");
|
|
3545
3603
|
}
|
|
@@ -3717,7 +3775,7 @@ class TableView extends ListView {
|
|
|
3717
3775
|
*/
|
|
3718
3776
|
buildTableHeaderTemplate() {
|
|
3719
3777
|
let headerCells = "";
|
|
3720
|
-
if (this.
|
|
3778
|
+
if (this.isSelectable()) {
|
|
3721
3779
|
headerCells += `
|
|
3722
3780
|
<th style="width: 40px; padding: 0;">
|
|
3723
3781
|
<div class="mojo-select-all-cell" data-action="select-all">
|
|
@@ -4154,12 +4212,24 @@ class TableView extends ListView {
|
|
|
4154
4212
|
* Handle export action
|
|
4155
4213
|
*/
|
|
4156
4214
|
async onActionExport(event, element) {
|
|
4215
|
+
const format = element.getAttribute("data-format") || "json";
|
|
4157
4216
|
this.emit("table:export", {
|
|
4158
|
-
|
|
4217
|
+
format,
|
|
4218
|
+
source: this.exportSource,
|
|
4159
4219
|
event
|
|
4160
4220
|
});
|
|
4161
|
-
if (this.
|
|
4162
|
-
|
|
4221
|
+
if (this.exportSource === "remote") {
|
|
4222
|
+
if (this.collection) {
|
|
4223
|
+
await this.collection.download(format);
|
|
4224
|
+
} else {
|
|
4225
|
+
console.warn("TableView: Cannot export from remote without a collection.");
|
|
4226
|
+
}
|
|
4227
|
+
} else {
|
|
4228
|
+
if (this.options.onExport) {
|
|
4229
|
+
await this.options.onExport(this.collection?.toJSON() || [], format);
|
|
4230
|
+
} else {
|
|
4231
|
+
console.warn("TableView: onExport handler not implemented for local export.");
|
|
4232
|
+
}
|
|
4163
4233
|
}
|
|
4164
4234
|
}
|
|
4165
4235
|
/**
|
|
@@ -5137,9 +5207,6 @@ class TabView extends View {
|
|
|
5137
5207
|
this._tabComputedStyle = null;
|
|
5138
5208
|
this.isMobileMode = false;
|
|
5139
5209
|
this.hasOverflow = false;
|
|
5140
|
-
if (this.tabLabels.length === 0) {
|
|
5141
|
-
console.warn("TabView: No tabs provided");
|
|
5142
|
-
}
|
|
5143
5210
|
for (const [label, view] of Object.entries(tabs)) {
|
|
5144
5211
|
this.addTab(label, view);
|
|
5145
5212
|
}
|
|
@@ -5865,4 +5932,4 @@ export {
|
|
|
5865
5932
|
IncidentEventForms as y,
|
|
5866
5933
|
Incident as z
|
|
5867
5934
|
};
|
|
5868
|
-
//# sourceMappingURL=FilePreviewView-
|
|
5935
|
+
//# sourceMappingURL=FilePreviewView-HtW6KRdR.js.map
|