web-mojo 2.1.533 → 2.1.534

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 (58) hide show
  1. package/dist/admin.cjs.js +1 -1
  2. package/dist/admin.es.js +10 -10
  3. package/dist/auth.cjs.js +1 -1
  4. package/dist/auth.cjs.js.map +1 -1
  5. package/dist/auth.es.js +3 -3
  6. package/dist/auth.es.js.map +1 -1
  7. package/dist/charts.cjs.js +1 -1
  8. package/dist/charts.es.js +3 -3
  9. package/dist/chunks/{ChatView-DLrdDqYC.js → ChatView-BR4MUIQ7.js} +6 -6
  10. package/dist/chunks/{ChatView-DLrdDqYC.js.map → ChatView-BR4MUIQ7.js.map} +1 -1
  11. package/dist/chunks/{ChatView-Dv5_jkEl.js → ChatView-ClUFUtJe.js} +2 -2
  12. package/dist/chunks/{ChatView-Dv5_jkEl.js.map → ChatView-ClUFUtJe.js.map} +1 -1
  13. package/dist/chunks/{ContextMenu-Dxnc7zGe.js → ContextMenu-CKGSU-E0.js} +2 -2
  14. package/dist/chunks/{ContextMenu-Dxnc7zGe.js.map → ContextMenu-CKGSU-E0.js.map} +1 -1
  15. package/dist/chunks/{ContextMenu-rQItz6uC.js → ContextMenu-r62gqzG_.js} +2 -2
  16. package/dist/chunks/{ContextMenu-rQItz6uC.js.map → ContextMenu-r62gqzG_.js.map} +1 -1
  17. package/dist/chunks/{DataView-BQ_wYIMp.js → DataView-C00j4YuH.js} +2 -2
  18. package/dist/chunks/{DataView-BQ_wYIMp.js.map → DataView-C00j4YuH.js.map} +1 -1
  19. package/dist/chunks/{DataView-COAngsJb.js → DataView-DRUU1yu6.js} +2 -2
  20. package/dist/chunks/{DataView-COAngsJb.js.map → DataView-DRUU1yu6.js.map} +1 -1
  21. package/dist/chunks/{Dialog-BpVcHVyt.js → Dialog-CvWIF2VC.js} +2 -2
  22. package/dist/chunks/{Dialog-BpVcHVyt.js.map → Dialog-CvWIF2VC.js.map} +1 -1
  23. package/dist/chunks/{Dialog-BVVHBbb1.js → Dialog-DOltX5lG.js} +5 -5
  24. package/dist/chunks/{Dialog-BVVHBbb1.js.map → Dialog-DOltX5lG.js.map} +1 -1
  25. package/dist/chunks/{FormView-Bso-0GfY.js → FormView-CvUhsQ87.js} +2 -2
  26. package/dist/chunks/{FormView-Bso-0GfY.js.map → FormView-CvUhsQ87.js.map} +1 -1
  27. package/dist/chunks/{FormView-C_n7MeK4.js → FormView-DxyOHSb3.js} +2 -2
  28. package/dist/chunks/{FormView-C_n7MeK4.js.map → FormView-DxyOHSb3.js.map} +1 -1
  29. package/dist/chunks/{MetricsChart-BCAdhZH1.js → MetricsChart-CqX2FxtM.js} +3 -3
  30. package/dist/chunks/{MetricsChart-BCAdhZH1.js.map → MetricsChart-CqX2FxtM.js.map} +1 -1
  31. package/dist/chunks/{MetricsChart-EjbUNKxU.js → MetricsChart-XlMOtMvk.js} +2 -2
  32. package/dist/chunks/{MetricsChart-EjbUNKxU.js.map → MetricsChart-XlMOtMvk.js.map} +1 -1
  33. package/dist/chunks/{PDFViewer-Dn1Jx7t1.js → PDFViewer-0iyFqFcD.js} +2 -2
  34. package/dist/chunks/{PDFViewer-Dn1Jx7t1.js.map → PDFViewer-0iyFqFcD.js.map} +1 -1
  35. package/dist/chunks/{PDFViewer-CFBhDasW.js → PDFViewer-BzQuNUos.js} +3 -3
  36. package/dist/chunks/{PDFViewer-CFBhDasW.js.map → PDFViewer-BzQuNUos.js.map} +1 -1
  37. package/dist/chunks/{Page-BobsRBF8.js → Page-B0pLNM5B.js} +2 -2
  38. package/dist/chunks/{Page-BobsRBF8.js.map → Page-B0pLNM5B.js.map} +1 -1
  39. package/dist/chunks/{Page-Cvz7ziJA.js → Page-CFEQrTH-.js} +2 -2
  40. package/dist/chunks/{Page-Cvz7ziJA.js.map → Page-CFEQrTH-.js.map} +1 -1
  41. package/dist/chunks/{TopNav-CeCIt_Mv.js → TopNav-Cqtmux-V.js} +2 -2
  42. package/dist/chunks/{TopNav-CeCIt_Mv.js.map → TopNav-Cqtmux-V.js.map} +1 -1
  43. package/dist/chunks/{TopNav-DuAz_KgP.js → TopNav-DtOyaoKD.js} +2 -2
  44. package/dist/chunks/{TopNav-DuAz_KgP.js.map → TopNav-DtOyaoKD.js.map} +1 -1
  45. package/dist/chunks/WebApp-CcfMKEFQ.js +2 -0
  46. package/dist/chunks/WebApp-CcfMKEFQ.js.map +1 -0
  47. package/dist/chunks/{WebApp-CfHuLFxV.js → WebApp-DhGNFpF5.js} +127 -30
  48. package/dist/chunks/WebApp-DhGNFpF5.js.map +1 -0
  49. package/dist/docit.cjs.js +1 -1
  50. package/dist/docit.es.js +5 -5
  51. package/dist/index.cjs.js +1 -1
  52. package/dist/index.es.js +11 -11
  53. package/dist/lightbox.cjs.js +1 -1
  54. package/dist/lightbox.es.js +4 -4
  55. package/package.json +1 -1
  56. package/dist/chunks/WebApp-CO6Mdt_i.js +0 -2
  57. package/dist/chunks/WebApp-CO6Mdt_i.js.map +0 -1
  58. package/dist/chunks/WebApp-CfHuLFxV.js.map +0 -1
@@ -1,8 +1,8 @@
1
- const VERSION = "2.1.533";
1
+ const VERSION = "2.1.534";
2
2
  const VERSION_MAJOR = 2;
3
3
  const VERSION_MINOR = 1;
4
- const VERSION_REVISION = 533;
5
- const BUILD_TIME = "2025-10-01T03:45:13.506Z";
4
+ const VERSION_REVISION = 534;
5
+ const BUILD_TIME = "2025-10-01T13:44:40.935Z";
6
6
  const VERSION_INFO = {
7
7
  full: VERSION,
8
8
  major: VERSION_MAJOR,
@@ -552,6 +552,7 @@ class DataFormatter {
552
552
  this.register("icon", this.icon.bind(this));
553
553
  this.register("avatar", this.avatar.bind(this));
554
554
  this.register("image", this.image.bind(this));
555
+ this.register("tooltip", this.tooltip.bind(this));
555
556
  this.register("default", this.default.bind(this));
556
557
  this.register("json", this.json.bind(this));
557
558
  this.register("raw", (v) => v);
@@ -614,11 +615,12 @@ class DataFormatter {
614
615
  * Process pipe string
615
616
  * @param {*} value - Value to format
616
617
  * @param {string} pipeString - Pipe string (e.g., "date('YYYY-MM-DD')|uppercase")
618
+ * @param {object} context - Optional context for resolving variables in formatter arguments
617
619
  * @returns {*} Formatted value
618
620
  */
619
- pipe(value, pipeString) {
621
+ pipe(value, pipeString, context = null) {
620
622
  if (!pipeString) return value;
621
- const pipes = this.parsePipeString(pipeString);
623
+ const pipes = this.parsePipeString(pipeString, context);
622
624
  return pipes.reduce((currentValue, pipe) => {
623
625
  return this.apply(pipe.name, currentValue, ...pipe.args);
624
626
  }, value);
@@ -626,13 +628,14 @@ class DataFormatter {
626
628
  /**
627
629
  * Parse pipe string into formatter calls
628
630
  * @param {string} pipeString - Pipe string
631
+ * @param {object} context - Optional context for resolving variables
629
632
  * @returns {Array} Array of {name, args} objects
630
633
  */
631
- parsePipeString(pipeString) {
634
+ parsePipeString(pipeString, context = null) {
632
635
  const pipes = [];
633
636
  const tokens = pipeString.split("|").map((s) => s.trim());
634
637
  for (const token of tokens) {
635
- const parsed = this.parseFormatter(token);
638
+ const parsed = this.parseFormatter(token, context);
636
639
  if (parsed) {
637
640
  pipes.push(parsed);
638
641
  }
@@ -641,22 +644,36 @@ class DataFormatter {
641
644
  }
642
645
  /**
643
646
  * Parse individual formatter with arguments
647
+ * Supports both syntaxes:
648
+ * - Parentheses: formatter('arg1', 'arg2', 3)
649
+ * - Colon: formatter:'arg1':'arg2':3
650
+ *
644
651
  * @param {string} token - Formatter token
652
+ * @param {object} context - Optional context for resolving variables
645
653
  * @returns {Object} {name, args} object
646
654
  */
647
- parseFormatter(token) {
648
- const match = token.match(/^([a-zA-Z_]\w*)\s*(?:\((.*)\))?$/);
649
- if (!match) return null;
650
- const [, name, argsString] = match;
651
- const args = argsString ? this.parseArguments(argsString) : [];
652
- return { name, args };
655
+ parseFormatter(token, context = null) {
656
+ const parenMatch = token.match(/^([a-zA-Z_]\w*)\s*\((.*)\)$/);
657
+ if (parenMatch) {
658
+ const [, name, argsString] = parenMatch;
659
+ const args = argsString ? this.parseArguments(argsString, context) : [];
660
+ return { name, args };
661
+ }
662
+ const colonMatch = token.match(/^([a-zA-Z_]\w*)(?::(.+))?$/);
663
+ if (colonMatch) {
664
+ const [, name, argsString] = colonMatch;
665
+ const args = argsString ? this.parseColonArguments(argsString, context) : [];
666
+ return { name, args };
667
+ }
668
+ return null;
653
669
  }
654
670
  /**
655
- * Parse formatter arguments
671
+ * Parse formatter arguments (comma-separated, parentheses syntax)
656
672
  * @param {string} argsString - Arguments string
673
+ * @param {object} context - Optional context for resolving variables
657
674
  * @returns {Array} Parsed arguments
658
675
  */
659
- parseArguments(argsString) {
676
+ parseArguments(argsString, context = null) {
660
677
  const args = [];
661
678
  let current = "";
662
679
  let inQuotes = false;
@@ -679,23 +696,58 @@ class DataFormatter {
679
696
  depth--;
680
697
  current += char;
681
698
  } else if (!inQuotes && depth === 0 && char === ",") {
682
- args.push(this.parseValue(current.trim()));
699
+ args.push(this.parseValue(current.trim(), context));
683
700
  current = "";
684
701
  } else {
685
702
  current += char;
686
703
  }
687
704
  }
688
705
  if (current.trim()) {
689
- args.push(this.parseValue(current.trim()));
706
+ args.push(this.parseValue(current.trim(), context));
707
+ }
708
+ return args;
709
+ }
710
+ /**
711
+ * Parse formatter arguments (colon-separated syntax)
712
+ * Handles quoted strings with colons inside them
713
+ * @param {string} argsString - Arguments string
714
+ * @param {object} context - Optional context for resolving variables
715
+ * @returns {Array} Parsed arguments
716
+ */
717
+ parseColonArguments(argsString, context = null) {
718
+ const args = [];
719
+ let current = "";
720
+ let inQuotes = false;
721
+ let quoteChar = null;
722
+ for (let i = 0; i < argsString.length; i++) {
723
+ const char = argsString[i];
724
+ if (!inQuotes && (char === '"' || char === "'")) {
725
+ inQuotes = true;
726
+ quoteChar = char;
727
+ current += char;
728
+ } else if (inQuotes && char === quoteChar && argsString[i - 1] !== "\\") {
729
+ inQuotes = false;
730
+ quoteChar = null;
731
+ current += char;
732
+ } else if (!inQuotes && char === ":") {
733
+ args.push(this.parseValue(current.trim(), context));
734
+ current = "";
735
+ } else {
736
+ current += char;
737
+ }
738
+ }
739
+ if (current.trim()) {
740
+ args.push(this.parseValue(current.trim(), context));
690
741
  }
691
742
  return args;
692
743
  }
693
744
  /**
694
745
  * Parse a single value
695
746
  * @param {string} value - Value string
747
+ * @param {object} context - Optional context for resolving variables
696
748
  * @returns {*} Parsed value
697
749
  */
698
- parseValue(value) {
750
+ parseValue(value, context = null) {
699
751
  if (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'")) {
700
752
  return value.slice(1, -1);
701
753
  }
@@ -712,8 +764,33 @@ class DataFormatter {
712
764
  } catch (e) {
713
765
  }
714
766
  }
767
+ if (context && this.isIdentifier(value)) {
768
+ if (context.hasOwnProperty && context.hasOwnProperty(value)) {
769
+ return context[value];
770
+ }
771
+ if (context.get && typeof context.get === "function") {
772
+ const contextValue = context.get(value);
773
+ if (contextValue !== void 0) {
774
+ return contextValue;
775
+ }
776
+ }
777
+ if (context.getContextValue && typeof context.getContextValue === "function") {
778
+ const contextValue = context.getContextValue(value);
779
+ if (contextValue !== void 0) {
780
+ return contextValue;
781
+ }
782
+ }
783
+ }
715
784
  return value;
716
785
  }
786
+ /**
787
+ * Check if a value is a valid identifier (variable name)
788
+ * @param {string} value - Value to check
789
+ * @returns {boolean} True if valid identifier
790
+ */
791
+ isIdentifier(value) {
792
+ return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(value);
793
+ }
717
794
  // ============= Date/Time Formatters =============
718
795
  /**
719
796
  * Format date
@@ -1414,6 +1491,26 @@ class DataFormatter {
1414
1491
  const allClasses = `${baseClasses} ${classes}`.trim();
1415
1492
  return `<img src="${url}" class="${allClasses}" style="${sizeStyle}" alt="${alt}" />`;
1416
1493
  }
1494
+ /**
1495
+ * Tooltip formatter - wraps value with Bootstrap tooltip
1496
+ * Usage:
1497
+ * {{value|tooltip:'Tooltip text'}}
1498
+ * {{value|tooltip:'Help text':top}}
1499
+ * {{value|tooltip:'Info':bottom:html}}
1500
+ *
1501
+ * @param {*} value - Value to display
1502
+ * @param {string} text - Tooltip text content
1503
+ * @param {string} placement - Tooltip placement: top, bottom, left, right (default: top)
1504
+ * @param {string} html - 'html' to allow HTML in tooltip (default: text only)
1505
+ * @returns {string} HTML with tooltip
1506
+ */
1507
+ tooltip(value, text = "", placement = "top", html = "") {
1508
+ if (value === null || value === void 0) return "";
1509
+ const displayValue = this.escapeHtml(String(value));
1510
+ const tooltipText = html === "html" ? text : this.escapeHtml(text);
1511
+ const dataAttr = html === "html" ? 'data-bs-html="true"' : "";
1512
+ return `<span data-bs-toggle="tooltip" data-bs-placement="${placement}" ${dataAttr} data-bs-title="${tooltipText}">${displayValue}</span>`;
1513
+ }
1417
1514
  /**
1418
1515
  * Helper method to extract image URL from string or file object
1419
1516
  * @param {string|object} value - URL string or file object with renditions
@@ -1665,7 +1762,7 @@ class MOJOUtils {
1665
1762
  }
1666
1763
  const value = this.getNestedValue(context, field);
1667
1764
  if (pipes) {
1668
- return dataFormatter.pipe(value, pipes);
1765
+ return dataFormatter.pipe(value, pipes, context);
1669
1766
  }
1670
1767
  return value;
1671
1768
  }
@@ -2164,7 +2261,7 @@ class DataWrapper {
2164
2261
  value = void 0;
2165
2262
  }
2166
2263
  if (pipes && value !== void 0) {
2167
- return dataFormatter.pipe(value, pipes);
2264
+ return dataFormatter.pipe(value, pipes, this._rootContext || this._data);
2168
2265
  }
2169
2266
  return value;
2170
2267
  }
@@ -4763,7 +4860,7 @@ class WebApp {
4763
4860
  */
4764
4861
  async showError(message) {
4765
4862
  try {
4766
- const Dialog = (await import("./Dialog-BVVHBbb1.js")).default;
4863
+ const Dialog = (await import("./Dialog-DOltX5lG.js")).default;
4767
4864
  await Dialog.alert(message, "Error", { size: "md", class: "text-danger" });
4768
4865
  } catch (e) {
4769
4866
  this.events.emit("notification", { message, type: "error" });
@@ -4780,7 +4877,7 @@ class WebApp {
4780
4877
  */
4781
4878
  async showSuccess(message) {
4782
4879
  try {
4783
- const Dialog = (await import("./Dialog-BVVHBbb1.js")).default;
4880
+ const Dialog = (await import("./Dialog-DOltX5lG.js")).default;
4784
4881
  await Dialog.alert(message, "Success", { size: "md", class: "text-success" });
4785
4882
  } catch (e) {
4786
4883
  this.events.emit("notification", { message, type: "success" });
@@ -4797,7 +4894,7 @@ class WebApp {
4797
4894
  */
4798
4895
  async showInfo(message) {
4799
4896
  try {
4800
- const Dialog = (await import("./Dialog-BVVHBbb1.js")).default;
4897
+ const Dialog = (await import("./Dialog-DOltX5lG.js")).default;
4801
4898
  await Dialog.alert(message, "Information", { size: "md", class: "text-info" });
4802
4899
  } catch (e) {
4803
4900
  this.events.emit("notification", { message, type: "info" });
@@ -4814,7 +4911,7 @@ class WebApp {
4814
4911
  */
4815
4912
  async showWarning(message) {
4816
4913
  try {
4817
- const Dialog = (await import("./Dialog-BVVHBbb1.js")).default;
4914
+ const Dialog = (await import("./Dialog-DOltX5lG.js")).default;
4818
4915
  await Dialog.alert(message, "Warning", { size: "md", class: "text-warning" });
4819
4916
  } catch (e) {
4820
4917
  this.events.emit("notification", { message, type: "warning" });
@@ -4840,7 +4937,7 @@ class WebApp {
4840
4937
  opts = { message: opts };
4841
4938
  }
4842
4939
  try {
4843
- const Dialog = (await import("./Dialog-BVVHBbb1.js")).default;
4940
+ const Dialog = (await import("./Dialog-DOltX5lG.js")).default;
4844
4941
  Dialog.showBusy(opts);
4845
4942
  } catch (e) {
4846
4943
  if (typeof window !== "undefined" && window?.console) {
@@ -4854,7 +4951,7 @@ class WebApp {
4854
4951
  */
4855
4952
  async hideLoading() {
4856
4953
  try {
4857
- const Dialog = (await import("./Dialog-BVVHBbb1.js")).default;
4954
+ const Dialog = (await import("./Dialog-DOltX5lG.js")).default;
4858
4955
  Dialog.hideBusy();
4859
4956
  } catch (e) {
4860
4957
  if (typeof window !== "undefined" && window?.console) {
@@ -4864,7 +4961,7 @@ class WebApp {
4864
4961
  }
4865
4962
  async showModelForm(options = {}) {
4866
4963
  try {
4867
- const Dialog = (await import("./Dialog-BVVHBbb1.js")).default;
4964
+ const Dialog = (await import("./Dialog-DOltX5lG.js")).default;
4868
4965
  return await Dialog.showModelForm(options);
4869
4966
  } catch (e) {
4870
4967
  if (typeof window !== "undefined" && window?.console) {
@@ -4875,7 +4972,7 @@ class WebApp {
4875
4972
  }
4876
4973
  async showForm(options = {}) {
4877
4974
  try {
4878
- const Dialog = (await import("./Dialog-BVVHBbb1.js")).default;
4975
+ const Dialog = (await import("./Dialog-DOltX5lG.js")).default;
4879
4976
  return await Dialog.showForm(options);
4880
4977
  } catch (e) {
4881
4978
  if (typeof window !== "undefined" && window?.console) {
@@ -4885,7 +4982,7 @@ class WebApp {
4885
4982
  }
4886
4983
  }
4887
4984
  async confirm(message, title = "Confirm", options = {}) {
4888
- const Dialog = (await import("./Dialog-BVVHBbb1.js")).default;
4985
+ const Dialog = (await import("./Dialog-DOltX5lG.js")).default;
4889
4986
  return await Dialog.confirm(message, title, options);
4890
4987
  }
4891
4988
  /**
@@ -5138,4 +5235,4 @@ export {
5138
5235
  EventEmitter as i,
5139
5236
  rest as r
5140
5237
  };
5141
- //# sourceMappingURL=WebApp-CfHuLFxV.js.map
5238
+ //# sourceMappingURL=WebApp-DhGNFpF5.js.map