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
- const VERSION = "2.1.70";
1
+ const VERSION = "2.1.143";
2
2
  const VERSION_MAJOR = 2;
3
3
  const VERSION_MINOR = 1;
4
- const VERSION_REVISION = 70;
5
- const BUILD_TIME = "2025-09-07T05:28:00.030Z";
4
+ const VERSION_REVISION = 143;
5
+ const BUILD_TIME = "2025-09-12T23:18:10.766Z";
6
6
  const VERSION_INFO = {
7
7
  full: VERSION,
8
8
  major: VERSION_MAJOR,
@@ -2070,18 +2070,24 @@ class EventDelegate {
2070
2070
  }, debounceMs);
2071
2071
  this.debounceTimers.set(timerId, timer);
2072
2072
  };
2073
- const onEnterKey = (event) => {
2074
- if (event.key !== "Enter" || !event.target.matches('[data-filter="search"]')) return;
2073
+ const onKeyDown = (event) => {
2074
+ if (event.target.matches('[data-filter="search"]')) return;
2075
2075
  const el = event.target.closest("[data-change-action]");
2076
2076
  if (!el || !this.shouldHandle(el, event)) return;
2077
- event.preventDefault();
2078
- const action = el.getAttribute("data-change-action");
2079
- this.dispatch(action, event, el).then((handled) => {
2080
- if (handled) {
2081
- event.stopPropagation();
2082
- event.handledByChild = true;
2083
- }
2084
- });
2077
+ let changeKeys = ["Enter"];
2078
+ if (el.getAttribute("data-change-keys")) {
2079
+ changeKeys = el.getAttribute("data-change-keys").split(",").map((key) => key.trim());
2080
+ }
2081
+ if (changeKeys.includes(event.key)) {
2082
+ event.preventDefault();
2083
+ const action = el.getAttribute("data-change-action");
2084
+ this.dispatch(action, event, el).then((handled) => {
2085
+ if (handled) {
2086
+ event.stopPropagation();
2087
+ event.handledByChild = true;
2088
+ }
2089
+ });
2090
+ }
2085
2091
  };
2086
2092
  const onSubmit = (event) => {
2087
2093
  const form = event.target.closest("form[data-action]");
@@ -2093,13 +2099,13 @@ class EventDelegate {
2093
2099
  rootEl.addEventListener("click", onClick);
2094
2100
  rootEl.addEventListener("change", onChange);
2095
2101
  rootEl.addEventListener("input", onInput);
2096
- rootEl.addEventListener("keydown", onEnterKey);
2102
+ rootEl.addEventListener("keydown", onKeyDown);
2097
2103
  rootEl.addEventListener("submit", onSubmit);
2098
2104
  this.domListeners.push(
2099
2105
  { el: rootEl, type: "click", fn: onClick },
2100
2106
  { el: rootEl, type: "change", fn: onChange },
2101
2107
  { el: rootEl, type: "input", fn: onInput },
2102
- { el: rootEl, type: "keydown", fn: onEnterKey },
2108
+ { el: rootEl, type: "keydown", fn: onKeyDown },
2103
2109
  { el: rootEl, type: "submit", fn: onSubmit }
2104
2110
  );
2105
2111
  }
@@ -2493,7 +2499,7 @@ class View {
2493
2499
  this.lastRenderTime = now2;
2494
2500
  try {
2495
2501
  if (!this.initialized) await this.onInitView();
2496
- this.events.unbind();
2502
+ this.unbindEvents();
2497
2503
  await this.onBeforeRender();
2498
2504
  if (this.getViewData) {
2499
2505
  this.data = await this.getViewData();
@@ -2505,7 +2511,7 @@ class View {
2505
2511
  }
2506
2512
  await this._renderChildren();
2507
2513
  await this.onAfterRender();
2508
- this.events.bind(this.element);
2514
+ this.bindEvents();
2509
2515
  } catch (e) {
2510
2516
  View._warn(`Render error in ${this.id}`, e);
2511
2517
  } finally {
@@ -3534,6 +3540,134 @@ class Rest {
3534
3540
  async DELETE(url, params = {}, options = {}) {
3535
3541
  return this.request("DELETE", url, null, params, options);
3536
3542
  }
3543
+ /**
3544
+ * Download a file from a URL
3545
+ * @param {string} url - Request URL
3546
+ * @param {object} params - Query parameters
3547
+ * @param {object} options - Request options
3548
+ * @returns {Promise} Promise that resolves when download is initiated
3549
+ */
3550
+ async download(url, params = {}, options = {}) {
3551
+ const requestUrl = this.buildUrl(url) + this.buildQueryString(params);
3552
+ const request = {
3553
+ method: "GET",
3554
+ url: requestUrl,
3555
+ headers: {
3556
+ ...this.config.headers,
3557
+ "Accept": "*/*",
3558
+ // Default, can be overridden by options
3559
+ ...options.headers
3560
+ },
3561
+ options: {
3562
+ ...options
3563
+ }
3564
+ };
3565
+ delete request.headers["Content-Type"];
3566
+ try {
3567
+ const response = await fetch(request.url, {
3568
+ method: request.method,
3569
+ headers: request.headers,
3570
+ signal: request.options.signal
3571
+ });
3572
+ if (!response.ok) {
3573
+ throw new Error(`Download failed: ${response.status} ${response.statusText}`);
3574
+ }
3575
+ const contentDisposition = response.headers.get("content-disposition");
3576
+ let filename = options.filename || "download";
3577
+ if (contentDisposition) {
3578
+ const filenameMatch = contentDisposition.match(/filename="?(.+)"?/);
3579
+ if (filenameMatch && filenameMatch.length > 1) {
3580
+ filename = filenameMatch[1];
3581
+ }
3582
+ }
3583
+ const reader = response.body.getReader();
3584
+ const stream = new ReadableStream({
3585
+ start(controller) {
3586
+ function pump() {
3587
+ return reader.read().then(({ done, value }) => {
3588
+ if (done) {
3589
+ controller.close();
3590
+ return;
3591
+ }
3592
+ controller.enqueue(value);
3593
+ return pump();
3594
+ });
3595
+ }
3596
+ return pump();
3597
+ }
3598
+ });
3599
+ const blob = await new Response(stream).blob();
3600
+ const downloadUrl = window.URL.createObjectURL(blob);
3601
+ const a = document.createElement("a");
3602
+ a.style.display = "none";
3603
+ a.href = downloadUrl;
3604
+ a.download = filename;
3605
+ document.body.appendChild(a);
3606
+ a.click();
3607
+ window.URL.revokeObjectURL(downloadUrl);
3608
+ a.remove();
3609
+ return { success: true, message: "Download initiated" };
3610
+ } catch (error) {
3611
+ console.error("Download error:", error);
3612
+ return { success: false, message: error.message };
3613
+ }
3614
+ }
3615
+ /**
3616
+ * Download a file from a URL by fetching the entire content into a Blob.
3617
+ * @param {string} url - Request URL
3618
+ * @param {object} params - Query parameters
3619
+ * @param {object} options - Request options
3620
+ * @returns {Promise} Promise that resolves when download is initiated
3621
+ */
3622
+ async downloadBlob(url, params = {}, options = {}) {
3623
+ const requestUrl = this.buildUrl(url) + this.buildQueryString(params);
3624
+ const request = {
3625
+ method: "GET",
3626
+ url: requestUrl,
3627
+ headers: {
3628
+ ...this.config.headers,
3629
+ "Accept": "*/*",
3630
+ // Default, can be overridden by options
3631
+ ...options.headers
3632
+ },
3633
+ options: {
3634
+ ...options
3635
+ }
3636
+ };
3637
+ delete request.headers["Content-Type"];
3638
+ try {
3639
+ const response = await fetch(request.url, {
3640
+ method: request.method,
3641
+ headers: request.headers,
3642
+ signal: request.options.signal
3643
+ });
3644
+ if (!response.ok) {
3645
+ throw new Error(`Download failed: ${response.status} ${response.statusText}`);
3646
+ }
3647
+ const blob = await response.blob();
3648
+ const contentDisposition = response.headers.get("content-disposition");
3649
+ let filename = options.filename || "download";
3650
+ if (contentDisposition) {
3651
+ const filenameMatch = contentDisposition.match(/filename="?(.+)"?/);
3652
+ if (filenameMatch && filenameMatch.length > 1) {
3653
+ filename = filenameMatch[1];
3654
+ }
3655
+ }
3656
+ const downloadUrl = window.URL.createObjectURL(blob);
3657
+ const a = document.createElement("a");
3658
+ a.style.display = "none";
3659
+ a.href = downloadUrl;
3660
+ a.download = filename;
3661
+ document.body.appendChild(a);
3662
+ a.click();
3663
+ window.URL.revokeObjectURL(downloadUrl);
3664
+ a.remove();
3665
+ return { success: true, message: "Download initiated" };
3666
+ } catch (error) {
3667
+ console.error("Download error:", error);
3668
+ return { success: false, message: error.message };
3669
+ }
3670
+ }
3537
3671
  /**
3538
3672
  * Upload file with raw PUT request (compatible with legacy backend)
3539
3673
  * @param {string} url - Upload URL
@@ -4096,6 +4230,7 @@ class EventBus {
4096
4230
  }
4097
4231
  class WebApp {
4098
4232
  constructor(config = {}) {
4233
+ this.config = config;
4099
4234
  this.initPluginRegistry();
4100
4235
  this.name = config.name || "MOJO App";
4101
4236
  this.version = config.version || "1.0.0";
@@ -4436,7 +4571,7 @@ class WebApp {
4436
4571
  */
4437
4572
  async showError(message) {
4438
4573
  try {
4439
- const Dialog = (await import("./Dialog-B9C-Tivh.js")).default;
4574
+ const Dialog = (await import("./Dialog-BJgl27dz.js")).default;
4440
4575
  await Dialog.alert(message, "Error", { size: "md", class: "text-danger" });
4441
4576
  } catch (e) {
4442
4577
  this.events.emit("notification", { message, type: "error" });
@@ -4453,7 +4588,7 @@ class WebApp {
4453
4588
  */
4454
4589
  async showSuccess(message) {
4455
4590
  try {
4456
- const Dialog = (await import("./Dialog-B9C-Tivh.js")).default;
4591
+ const Dialog = (await import("./Dialog-BJgl27dz.js")).default;
4457
4592
  await Dialog.alert(message, "Success", { size: "md", class: "text-success" });
4458
4593
  } catch (e) {
4459
4594
  this.events.emit("notification", { message, type: "success" });
@@ -4470,7 +4605,7 @@ class WebApp {
4470
4605
  */
4471
4606
  async showInfo(message) {
4472
4607
  try {
4473
- const Dialog = (await import("./Dialog-B9C-Tivh.js")).default;
4608
+ const Dialog = (await import("./Dialog-BJgl27dz.js")).default;
4474
4609
  await Dialog.alert(message, "Information", { size: "md", class: "text-info" });
4475
4610
  } catch (e) {
4476
4611
  this.events.emit("notification", { message, type: "info" });
@@ -4487,7 +4622,7 @@ class WebApp {
4487
4622
  */
4488
4623
  async showWarning(message) {
4489
4624
  try {
4490
- const Dialog = (await import("./Dialog-B9C-Tivh.js")).default;
4625
+ const Dialog = (await import("./Dialog-BJgl27dz.js")).default;
4491
4626
  await Dialog.alert(message, "Warning", { size: "md", class: "text-warning" });
4492
4627
  } catch (e) {
4493
4628
  this.events.emit("notification", { message, type: "warning" });
@@ -4513,7 +4648,7 @@ class WebApp {
4513
4648
  opts = { message: opts };
4514
4649
  }
4515
4650
  try {
4516
- const Dialog = (await import("./Dialog-B9C-Tivh.js")).default;
4651
+ const Dialog = (await import("./Dialog-BJgl27dz.js")).default;
4517
4652
  Dialog.showBusy(opts);
4518
4653
  } catch (e) {
4519
4654
  if (typeof window !== "undefined" && window?.console) {
@@ -4527,7 +4662,7 @@ class WebApp {
4527
4662
  */
4528
4663
  async hideLoading() {
4529
4664
  try {
4530
- const Dialog = (await import("./Dialog-B9C-Tivh.js")).default;
4665
+ const Dialog = (await import("./Dialog-BJgl27dz.js")).default;
4531
4666
  Dialog.hideBusy();
4532
4667
  } catch (e) {
4533
4668
  if (typeof window !== "undefined" && window?.console) {
@@ -4537,7 +4672,7 @@ class WebApp {
4537
4672
  }
4538
4673
  async showModelForm(options = {}) {
4539
4674
  try {
4540
- const Dialog = (await import("./Dialog-B9C-Tivh.js")).default;
4675
+ const Dialog = (await import("./Dialog-BJgl27dz.js")).default;
4541
4676
  return await Dialog.showModelForm(options);
4542
4677
  } catch (e) {
4543
4678
  if (typeof window !== "undefined" && window?.console) {
@@ -4548,7 +4683,7 @@ class WebApp {
4548
4683
  }
4549
4684
  async showForm(options = {}) {
4550
4685
  try {
4551
- const Dialog = (await import("./Dialog-B9C-Tivh.js")).default;
4686
+ const Dialog = (await import("./Dialog-BJgl27dz.js")).default;
4552
4687
  return await Dialog.showForm(options);
4553
4688
  } catch (e) {
4554
4689
  if (typeof window !== "undefined" && window?.console) {
@@ -4764,4 +4899,4 @@ export {
4764
4899
  EventEmitter as i,
4765
4900
  rest as r
4766
4901
  };
4767
- //# sourceMappingURL=WebApp-No-qysKc.js.map
4902
+ //# sourceMappingURL=WebApp-Cs-c1f0h.js.map