web-mojo 2.1.70 → 2.1.144

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.
Files changed (81) hide show
  1. package/dist/admin.cjs.js +1 -1
  2. package/dist/admin.cjs.js.map +1 -1
  3. package/dist/admin.es.js +14 -26
  4. package/dist/admin.es.js.map +1 -1
  5. package/dist/auth.cjs.js +1 -1
  6. package/dist/auth.cjs.js.map +1 -1
  7. package/dist/auth.css +179 -660
  8. package/dist/auth.es.js +83 -43
  9. package/dist/auth.es.js.map +1 -1
  10. package/dist/charts.cjs.js +1 -1
  11. package/dist/charts.es.js +2 -2
  12. package/dist/chunks/{ContextMenu-Cds78Jny.js → ContextMenu-CBsEWxms.js} +2 -2
  13. package/dist/chunks/{ContextMenu-Cds78Jny.js.map → ContextMenu-CBsEWxms.js.map} +1 -1
  14. package/dist/chunks/{ContextMenu-CD5yoYTS.js → ContextMenu-Dp2L51_O.js} +2 -2
  15. package/dist/chunks/{ContextMenu-CD5yoYTS.js.map → ContextMenu-Dp2L51_O.js.map} +1 -1
  16. package/dist/chunks/{DataView-DPSnw5Nb.js → DataView-CP1qLEAn.js} +2 -2
  17. package/dist/chunks/{DataView-DPSnw5Nb.js.map → DataView-CP1qLEAn.js.map} +1 -1
  18. package/dist/chunks/{DataView-CfPr57_R.js → DataView-DYXd8IT_.js} +2 -2
  19. package/dist/chunks/{DataView-CfPr57_R.js.map → DataView-DYXd8IT_.js.map} +1 -1
  20. package/dist/chunks/{Dialog-B9C-Tivh.js → Dialog-BJgl27dz.js} +5 -5
  21. package/dist/chunks/{Dialog-B9C-Tivh.js.map → Dialog-BJgl27dz.js.map} +1 -1
  22. package/dist/chunks/{Dialog-BqNrby-G.js → Dialog-C7eQM655.js} +2 -2
  23. package/dist/chunks/{Dialog-BqNrby-G.js.map → Dialog-C7eQM655.js.map} +1 -1
  24. package/dist/chunks/FilePreviewView-BsX81q61.js +2 -0
  25. package/dist/chunks/FilePreviewView-BsX81q61.js.map +1 -0
  26. package/dist/chunks/{FilePreviewView-Bp09ZiEw.js → FilePreviewView-rWCKXhwS.js} +77 -32
  27. package/dist/chunks/FilePreviewView-rWCKXhwS.js.map +1 -0
  28. package/dist/chunks/{FormView-DWR9Albb.js → FormView-Da3OHCwQ.js} +54 -7
  29. package/dist/chunks/FormView-Da3OHCwQ.js.map +1 -0
  30. package/dist/chunks/FormView-zirMC01H.js +2 -0
  31. package/dist/chunks/FormView-zirMC01H.js.map +1 -0
  32. package/dist/chunks/{MetricsChart-BHv1mj0l.js → MetricsChart-BFZhPmLN.js} +2 -2
  33. package/dist/chunks/{MetricsChart-BHv1mj0l.js.map → MetricsChart-BFZhPmLN.js.map} +1 -1
  34. package/dist/chunks/{MetricsChart-Du8mtBlY.js → MetricsChart-Dx3EUpkC.js} +3 -3
  35. package/dist/chunks/{MetricsChart-Du8mtBlY.js.map → MetricsChart-Dx3EUpkC.js.map} +1 -1
  36. package/dist/chunks/{PDFViewer-9beaQaeq.js → PDFViewer-Cvn5uIzK.js} +3 -3
  37. package/dist/chunks/{PDFViewer-9beaQaeq.js.map → PDFViewer-Cvn5uIzK.js.map} +1 -1
  38. package/dist/chunks/{PDFViewer-C-RkFhlV.js → PDFViewer-DFPUg3Q2.js} +2 -2
  39. package/dist/chunks/{PDFViewer-C-RkFhlV.js.map → PDFViewer-DFPUg3Q2.js.map} +1 -1
  40. package/dist/chunks/{Page-Dg7X1BML.js → Page-CSdWY0RU.js} +2 -2
  41. package/dist/chunks/{Page-Dg7X1BML.js.map → Page-CSdWY0RU.js.map} +1 -1
  42. package/dist/chunks/{Page-KLwFxSBF.js → Page-jLcH5oU3.js} +2 -2
  43. package/dist/chunks/{Page-KLwFxSBF.js.map → Page-jLcH5oU3.js.map} +1 -1
  44. package/dist/chunks/{TopNav-47rWUwBU.js → TopNav-BRMYx23E.js} +14 -4
  45. package/dist/chunks/TopNav-BRMYx23E.js.map +1 -0
  46. package/dist/chunks/TopNav-CXtXM9fQ.js +2 -0
  47. package/dist/chunks/TopNav-CXtXM9fQ.js.map +1 -0
  48. package/dist/chunks/{User-DNxU39NR.js → User-BhmqIo3p.js} +31 -2
  49. package/dist/chunks/User-BhmqIo3p.js.map +1 -0
  50. package/dist/chunks/User-DSQo0K5v.js +3 -0
  51. package/dist/chunks/User-DSQo0K5v.js.map +1 -0
  52. package/dist/chunks/WebApp-0BphS1GM.js +2 -0
  53. package/dist/chunks/WebApp-0BphS1GM.js.map +1 -0
  54. package/dist/chunks/{WebApp-No-qysKc.js → WebApp-Cs-c1f0h.js} +161 -26
  55. package/dist/chunks/WebApp-Cs-c1f0h.js.map +1 -0
  56. package/dist/css/web-mojo.css +2 -2
  57. package/dist/docit.cjs.js +1 -1
  58. package/dist/docit.es.js +6 -6
  59. package/dist/index.cjs.js +1 -1
  60. package/dist/index.cjs.js.map +1 -1
  61. package/dist/index.es.js +16 -15
  62. package/dist/index.es.js.map +1 -1
  63. package/dist/lightbox.cjs.js +1 -1
  64. package/dist/lightbox.es.js +4 -4
  65. package/dist/portal.css +258 -44
  66. package/package.json +1 -1
  67. package/dist/chunks/FilePreviewView-Bp09ZiEw.js.map +0 -1
  68. package/dist/chunks/FilePreviewView-CnZhI3Yw.js +0 -2
  69. package/dist/chunks/FilePreviewView-CnZhI3Yw.js.map +0 -1
  70. package/dist/chunks/FormView-D0dUMQGM.js +0 -2
  71. package/dist/chunks/FormView-D0dUMQGM.js.map +0 -1
  72. package/dist/chunks/FormView-DWR9Albb.js.map +0 -1
  73. package/dist/chunks/TopNav-47rWUwBU.js.map +0 -1
  74. package/dist/chunks/TopNav-DAB4M5C6.js +0 -2
  75. package/dist/chunks/TopNav-DAB4M5C6.js.map +0 -1
  76. package/dist/chunks/User-DNxU39NR.js.map +0 -1
  77. package/dist/chunks/User-lVECCjCu.js +0 -3
  78. package/dist/chunks/User-lVECCjCu.js.map +0 -1
  79. package/dist/chunks/WebApp-Bci5ZTRS.js +0 -2
  80. package/dist/chunks/WebApp-Bci5ZTRS.js.map +0 -1
  81. package/dist/chunks/WebApp-No-qysKc.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-DNxU39NR.js";
2
- import { r as rest, V as View, d as dataFormatter, M as Mustache } from "./WebApp-No-qysKc.js";
3
- import { P as Page } from "./Page-Dg7X1BML.js";
4
- import Dialog from "./Dialog-B9C-Tivh.js";
5
- import { F as FormView } from "./FormView-DWR9Albb.js";
1
+ import { M as Model, C as Collection, T as ToastService, G as GroupList, c as UserList } from "./User-BhmqIo3p.js";
2
+ import { r as rest, V as View, d as dataFormatter, M as Mustache } from "./WebApp-Cs-c1f0h.js";
3
+ import { P as Page } from "./Page-CSdWY0RU.js";
4
+ import Dialog from "./Dialog-BJgl27dz.js";
5
+ import { F as FormView } from "./FormView-Da3OHCwQ.js";
6
6
  class S3Bucket extends Model {
7
7
  constructor(data = {}) {
8
8
  super(data, {
@@ -2741,13 +2741,24 @@ class ListView extends View {
2741
2741
  this.emptyMessage = options.emptyMessage || "No items to display";
2742
2742
  this.loading = false;
2743
2743
  this.isEmpty = true;
2744
- this._initCollection(options.collection);
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
+ }
2745
2753
  }
2746
2754
  /**
2747
2755
  * Initialize the collection
2748
2756
  */
2749
2757
  _initCollection(collectionOrClass) {
2750
- if (!collectionOrClass) return;
2758
+ if (!collectionOrClass) {
2759
+ console.log("Collection not provided");
2760
+ return;
2761
+ }
2751
2762
  if (collectionOrClass instanceof Collection) {
2752
2763
  this.setCollection(collectionOrClass);
2753
2764
  } else if (typeof collectionOrClass === "function") {
@@ -3028,14 +3039,6 @@ class ListView extends View {
3028
3039
  }
3029
3040
  this._buildItems();
3030
3041
  }
3031
- /**
3032
- * Override onInit to set up initial state
3033
- */
3034
- async onInit() {
3035
- if (this.collection && this.collection.isEmpty() && this.collection.restEnabled) {
3036
- await this.collection.fetch();
3037
- }
3038
- }
3039
3042
  /**
3040
3043
  * Override destroy to clean up
3041
3044
  */
@@ -3390,12 +3393,21 @@ class TableView extends ListView {
3390
3393
  this.deleteTemplate = options.deleteTemplate;
3391
3394
  this.formDialogConfig = options.formDialogConfig || {};
3392
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";
3393
3404
  this.filters = {};
3394
3405
  this.additionalFilters = options.filters || [];
3395
3406
  this.hideActivePills = options.hideActivePills || false;
3396
3407
  this.hideActivePillNames = options.hideActivePillNames || [];
3397
3408
  this.rowAction = options.rowAction || "row-click";
3398
3409
  this.batchBarLocation = options.batchBarLocation || "bottom";
3410
+ this.options.addButtonLabel = options.addButtonLabel || "Add";
3399
3411
  this.tableOptions = {
3400
3412
  striped: true,
3401
3413
  bordered: false,
@@ -3547,21 +3559,45 @@ class TableView extends ListView {
3547
3559
  buttons.push(`
3548
3560
  <button class="btn btn-sm btn-success btn-add"
3549
3561
  data-action="add"
3550
- title="Add">
3562
+ title="${this.options.addButtonLabel}">
3551
3563
  <i class="bi bi-plus-circle me-1"></i>
3552
- <span class="d-none d-lg-inline">Add</span>
3564
+ <span class="d-none d-lg-inline">${this.options.addButtonLabel}</span>
3553
3565
  </button>
3554
3566
  `);
3555
3567
  }
3556
3568
  if (this.options.showExport) {
3557
- buttons.push(`
3558
- <button class="btn btn-sm btn-outline-secondary btn-export"
3559
- data-action="export"
3560
- title="Export">
3561
- <i class="bi bi-download me-1"></i>
3562
- <span class="d-none d-lg-inline">Export</span>
3563
- </button>
3564
- `);
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
+ }
3565
3601
  }
3566
3602
  return buttons.join("");
3567
3603
  }
@@ -4176,12 +4212,24 @@ class TableView extends ListView {
4176
4212
  * Handle export action
4177
4213
  */
4178
4214
  async onActionExport(event, element) {
4215
+ const format = element.getAttribute("data-format") || "json";
4179
4216
  this.emit("table:export", {
4180
- data: this.collection?.toJSON() || [],
4217
+ format,
4218
+ source: this.exportSource,
4181
4219
  event
4182
4220
  });
4183
- if (this.options.onExport) {
4184
- await this.options.onExport(this.collection?.toJSON() || []);
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
+ }
4185
4233
  }
4186
4234
  }
4187
4235
  /**
@@ -5159,9 +5207,6 @@ class TabView extends View {
5159
5207
  this._tabComputedStyle = null;
5160
5208
  this.isMobileMode = false;
5161
5209
  this.hasOverflow = false;
5162
- if (this.tabLabels.length === 0) {
5163
- console.warn("TabView: No tabs provided");
5164
- }
5165
5210
  for (const [label, view] of Object.entries(tabs)) {
5166
5211
  this.addTab(label, view);
5167
5212
  }
@@ -5887,4 +5932,4 @@ export {
5887
5932
  IncidentEventForms as y,
5888
5933
  Incident as z
5889
5934
  };
5890
- //# sourceMappingURL=FilePreviewView-Bp09ZiEw.js.map
5935
+ //# sourceMappingURL=FilePreviewView-rWCKXhwS.js.map