web-mojo 2.2.48 → 2.2.49
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.es.js +13 -13
- package/dist/auth.cjs.js +1 -1
- package/dist/auth.es.js +1 -1
- package/dist/charts.cjs.js +1 -1
- package/dist/charts.es.js +4 -4
- package/dist/chunks/{ChatView-D9ZaC_gN.js → ChatView-BUfkeVnX.js} +7 -7
- package/dist/chunks/{ChatView-D9ZaC_gN.js.map → ChatView-BUfkeVnX.js.map} +1 -1
- package/dist/chunks/{ChatView-Ds4cJWJI.js → ChatView-Tj1Kb9Hf.js} +2 -2
- package/dist/chunks/{ChatView-Ds4cJWJI.js.map → ChatView-Tj1Kb9Hf.js.map} +1 -1
- package/dist/chunks/{Collection-Wr1qdfrB.js → Collection-D3K_bEJN.js} +2 -2
- package/dist/chunks/{Collection-Wr1qdfrB.js.map → Collection-D3K_bEJN.js.map} +1 -1
- package/dist/chunks/{Collection-B8r3o6bK.js → Collection-DpUI5_9f.js} +2 -2
- package/dist/chunks/{Collection-B8r3o6bK.js.map → Collection-DpUI5_9f.js.map} +1 -1
- package/dist/chunks/{ContextMenu-DXtMvkaN.js → ContextMenu-BSlbXHBy.js} +2 -2
- package/dist/chunks/{ContextMenu-DXtMvkaN.js.map → ContextMenu-BSlbXHBy.js.map} +1 -1
- package/dist/chunks/{ContextMenu-Bu4Sw_GS.js → ContextMenu-sdxDECHa.js} +3 -3
- package/dist/chunks/{ContextMenu-Bu4Sw_GS.js.map → ContextMenu-sdxDECHa.js.map} +1 -1
- package/dist/chunks/{DataView-GAorw2F1.js → DataView-CACdHJV9.js} +2 -2
- package/dist/chunks/{DataView-GAorw2F1.js.map → DataView-CACdHJV9.js.map} +1 -1
- package/dist/chunks/{DataView-DhG_EmV-.js → DataView-DUOJRtqo.js} +2 -2
- package/dist/chunks/{DataView-DhG_EmV-.js.map → DataView-DUOJRtqo.js.map} +1 -1
- package/dist/chunks/{Dialog-fb2ecL0p.js → Dialog-BVDLaVFL.js} +5 -5
- package/dist/chunks/{Dialog-fb2ecL0p.js.map → Dialog-BVDLaVFL.js.map} +1 -1
- package/dist/chunks/{Dialog-rbzUvwyM.js → Dialog-BmkbDDol.js} +2 -2
- package/dist/chunks/{Dialog-rbzUvwyM.js.map → Dialog-BmkbDDol.js.map} +1 -1
- package/dist/chunks/{FormView-CI-mS8ei.js → FormView-CqiU2UkE.js} +3 -3
- package/dist/chunks/{FormView-CI-mS8ei.js.map → FormView-CqiU2UkE.js.map} +1 -1
- package/dist/chunks/{FormView-nAFrSOID.js → FormView-Cuqamyp7.js} +3 -3
- package/dist/chunks/{FormView-nAFrSOID.js.map → FormView-Cuqamyp7.js.map} +1 -1
- package/dist/chunks/{ListView-CVdyqY9B.js → ListView-B7_jgGeh.js} +2 -2
- package/dist/chunks/{ListView-CVdyqY9B.js.map → ListView-B7_jgGeh.js.map} +1 -1
- package/dist/chunks/{ListView-Dh9FHFip.js → ListView-ChN3NCAY.js} +3 -3
- package/dist/chunks/{ListView-Dh9FHFip.js.map → ListView-ChN3NCAY.js.map} +1 -1
- package/dist/chunks/{MetricsCountryMapView-CvvZhGXI.js → MetricsCountryMapView-BDdS4s7L.js} +2 -2
- package/dist/chunks/{MetricsCountryMapView-CvvZhGXI.js.map → MetricsCountryMapView-BDdS4s7L.js.map} +1 -1
- package/dist/chunks/{MetricsCountryMapView-qU41DcSP.js → MetricsCountryMapView-Pu1VZIJT.js} +2 -2
- package/dist/chunks/{MetricsCountryMapView-qU41DcSP.js.map → MetricsCountryMapView-Pu1VZIJT.js.map} +1 -1
- package/dist/chunks/{MetricsMiniChartWidget-mKq4dgZs.js → MetricsMiniChartWidget-BVS-pJks.js} +4 -4
- package/dist/chunks/{MetricsMiniChartWidget-mKq4dgZs.js.map → MetricsMiniChartWidget-BVS-pJks.js.map} +1 -1
- package/dist/chunks/{MetricsMiniChartWidget-C7AhQWjP.js → MetricsMiniChartWidget-ZqmLtt06.js} +2 -2
- package/dist/chunks/{MetricsMiniChartWidget-C7AhQWjP.js.map → MetricsMiniChartWidget-ZqmLtt06.js.map} +1 -1
- package/dist/chunks/{PDFViewer-B7nrzZli.js → PDFViewer-Byo3kf7Z.js} +3 -3
- package/dist/chunks/{PDFViewer-B7nrzZli.js.map → PDFViewer-Byo3kf7Z.js.map} +1 -1
- package/dist/chunks/{PDFViewer-Be9x6dIX.js → PDFViewer-CCW5ZvRb.js} +2 -2
- package/dist/chunks/{PDFViewer-Be9x6dIX.js.map → PDFViewer-CCW5ZvRb.js.map} +1 -1
- package/dist/chunks/Rest-BSz7rF0G.js +2 -0
- package/dist/chunks/Rest-BSz7rF0G.js.map +1 -0
- package/dist/chunks/{Rest-Bq0Qmce8.js → Rest-DSzjaYYe.js} +60 -15
- package/dist/chunks/Rest-DSzjaYYe.js.map +1 -0
- package/dist/chunks/{TokenManager-BJ92Oaf0.js → TokenManager-C07o8g1O.js} +2 -2
- package/dist/chunks/{TokenManager-BJ92Oaf0.js.map → TokenManager-C07o8g1O.js.map} +1 -1
- package/dist/chunks/{TokenManager-DHm_MUpV.js → TokenManager-DNwuLDw6.js} +5 -5
- package/dist/chunks/{TokenManager-DHm_MUpV.js.map → TokenManager-DNwuLDw6.js.map} +1 -1
- package/dist/chunks/{WebApp-BgKy6_WI.js → WebApp-1HetrsR0.js} +2 -2
- package/dist/chunks/{WebApp-BgKy6_WI.js.map → WebApp-1HetrsR0.js.map} +1 -1
- package/dist/chunks/{WebApp-YAw6Prrk.js → WebApp-Do2IaAGx.js} +12 -12
- package/dist/chunks/{WebApp-YAw6Prrk.js.map → WebApp-Do2IaAGx.js.map} +1 -1
- package/dist/chunks/{WebSocketClient-eCM6D3qg.js → WebSocketClient-BlBSBvYP.js} +2 -2
- package/dist/chunks/{WebSocketClient-eCM6D3qg.js.map → WebSocketClient-BlBSBvYP.js.map} +1 -1
- package/dist/chunks/{WebSocketClient-D4xOzuC5.js → WebSocketClient-BvwLDqeR.js} +2 -2
- package/dist/chunks/{WebSocketClient-D4xOzuC5.js.map → WebSocketClient-BvwLDqeR.js.map} +1 -1
- package/dist/chunks/{version-D9rXuJAi.js → version-DXeLxR_3.js} +4 -4
- package/dist/chunks/{version-D9rXuJAi.js.map → version-DXeLxR_3.js.map} +1 -1
- package/dist/chunks/{version-BiGS3nz0.js → version-e7n3DAiW.js} +2 -2
- package/dist/chunks/{version-BiGS3nz0.js.map → version-e7n3DAiW.js.map} +1 -1
- package/dist/docit.cjs.js +1 -1
- 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 +70 -17
- package/dist/index.es.js.map +1 -1
- package/dist/lightbox.cjs.js +1 -1
- package/dist/lightbox.es.js +5 -5
- package/dist/map.cjs.js +1 -1
- package/dist/map.es.js +5 -5
- package/dist/timeline.cjs.js +1 -1
- package/dist/timeline.es.js +4 -4
- package/dist/web-mojo.lite.css +154 -0
- package/dist/web-mojo.lite.iife.js +21760 -0
- package/dist/web-mojo.lite.iife.js.map +1 -0
- package/dist/web-mojo.lite.iife.min.js +1765 -0
- package/dist/web-mojo.lite.iife.min.js.map +1 -0
- package/package.json +4 -3
- package/dist/chunks/Rest-Bq0Qmce8.js.map +0 -1
- package/dist/chunks/Rest-CpEc4pkD.js +0 -2
- package/dist/chunks/Rest-CpEc4pkD.js.map +0 -1
|
@@ -57,6 +57,7 @@ class DataFormatter {
|
|
|
57
57
|
this.register("lower", (v) => String(v).toLowerCase());
|
|
58
58
|
this.register("capitalize", this.capitalize.bind(this));
|
|
59
59
|
this.register("caps", this.capitalize.bind(this));
|
|
60
|
+
this.register("replace", this.replace.bind(this));
|
|
60
61
|
this.register("truncate", this.truncate.bind(this));
|
|
61
62
|
this.register("truncate_middle", this.truncate_middle.bind(this));
|
|
62
63
|
this.register("truncate_front", this.truncate_front.bind(this));
|
|
@@ -669,35 +670,42 @@ class DataFormatter {
|
|
|
669
670
|
}
|
|
670
671
|
if (diffDays > 365) {
|
|
671
672
|
const years = Math.floor(diffDays / 365);
|
|
672
|
-
const
|
|
673
|
-
|
|
673
|
+
const prefix = isFuture ? "in " : "";
|
|
674
|
+
const suffix = isFuture ? "" : " ago";
|
|
675
|
+
return prefix + years + " year" + (years > 1 ? "s" : "") + suffix;
|
|
674
676
|
}
|
|
675
677
|
if (diffDays > 30) {
|
|
676
678
|
const months = Math.floor(diffDays / 30);
|
|
677
|
-
const
|
|
678
|
-
|
|
679
|
+
const prefix = isFuture ? "in " : "";
|
|
680
|
+
const suffix = isFuture ? "" : " ago";
|
|
681
|
+
return prefix + months + " month" + (months > 1 ? "s" : "") + suffix;
|
|
679
682
|
}
|
|
680
683
|
if (diffDays > 7) {
|
|
681
684
|
const weeks = Math.floor(diffDays / 7);
|
|
682
|
-
const
|
|
683
|
-
|
|
685
|
+
const prefix = isFuture ? "in " : "";
|
|
686
|
+
const suffix = isFuture ? "" : " ago";
|
|
687
|
+
return prefix + weeks + " week" + (weeks > 1 ? "s" : "") + suffix;
|
|
684
688
|
}
|
|
685
689
|
if (diffDays === 1) return isFuture ? "tomorrow" : "yesterday";
|
|
686
690
|
if (diffDays > 0) {
|
|
687
|
-
const
|
|
688
|
-
|
|
691
|
+
const prefix = isFuture ? "in " : "";
|
|
692
|
+
const suffix = isFuture ? "" : " ago";
|
|
693
|
+
return prefix + diffDays + " days" + suffix;
|
|
689
694
|
}
|
|
690
695
|
if (diffHours > 0) {
|
|
691
|
-
const
|
|
692
|
-
|
|
696
|
+
const prefix = isFuture ? "in " : "";
|
|
697
|
+
const suffix = isFuture ? "" : " ago";
|
|
698
|
+
return prefix + diffHours + " hour" + (diffHours > 1 ? "s" : "") + suffix;
|
|
693
699
|
}
|
|
694
700
|
if (diffMins > 0) {
|
|
695
|
-
const
|
|
696
|
-
|
|
701
|
+
const prefix = isFuture ? "in " : "";
|
|
702
|
+
const suffix = isFuture ? "" : " ago";
|
|
703
|
+
return prefix + diffMins + " minute" + (diffMins > 1 ? "s" : "") + suffix;
|
|
697
704
|
}
|
|
698
705
|
if (diffSecs > 30) {
|
|
699
|
-
const
|
|
700
|
-
|
|
706
|
+
const prefix = isFuture ? "in " : "";
|
|
707
|
+
const suffix = isFuture ? "" : " ago";
|
|
708
|
+
return prefix + diffSecs + " seconds" + suffix;
|
|
701
709
|
}
|
|
702
710
|
return "just now";
|
|
703
711
|
}
|
|
@@ -905,6 +913,43 @@ class DataFormatter {
|
|
|
905
913
|
}
|
|
906
914
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
907
915
|
}
|
|
916
|
+
/**
|
|
917
|
+
* Replace occurrences in a string
|
|
918
|
+
* @param {*} value - String value
|
|
919
|
+
* @param {*} search - Search value (string or RegExp-ish string like "/_/g")
|
|
920
|
+
* @param {*} replacement - Replacement string
|
|
921
|
+
* @param {string} flags - Optional RegExp flags when search is a plain string
|
|
922
|
+
* @returns {string} Updated string
|
|
923
|
+
*
|
|
924
|
+
* Examples:
|
|
925
|
+
* - {{model.name|replace:'_':''}} // underscores removed (all occurrences)
|
|
926
|
+
* - {{model.name|replace('_', '')}} // parentheses syntax
|
|
927
|
+
* - {{model.name|replace:'_':' ':'g'}} // replace all underscores with spaces
|
|
928
|
+
* - {{model.name|replace:'/[_-]+/g':' '}} // regex form in a string
|
|
929
|
+
*/
|
|
930
|
+
replace(value, search, replacement = "", flags = "g") {
|
|
931
|
+
if (value === null || value === void 0) return "";
|
|
932
|
+
const str = String(value);
|
|
933
|
+
if (search === null || search === void 0 || search === "") {
|
|
934
|
+
return str;
|
|
935
|
+
}
|
|
936
|
+
if (search instanceof RegExp) {
|
|
937
|
+
return str.replace(search, String(replacement));
|
|
938
|
+
}
|
|
939
|
+
const searchStr = String(search);
|
|
940
|
+
const regexLike = searchStr.match(/^\/(.+)\/([a-z]*)$/i);
|
|
941
|
+
if (regexLike) {
|
|
942
|
+
const [, pattern, rxFlags] = regexLike;
|
|
943
|
+
try {
|
|
944
|
+
return str.replace(new RegExp(pattern, rxFlags), String(replacement));
|
|
945
|
+
} catch (e) {
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
if (String(flags).includes("g")) {
|
|
949
|
+
return str.split(searchStr).join(String(replacement));
|
|
950
|
+
}
|
|
951
|
+
return str.replace(searchStr, String(replacement));
|
|
952
|
+
}
|
|
908
953
|
/**
|
|
909
954
|
* Truncate string
|
|
910
955
|
* @param {*} value - String value
|
|
@@ -4309,4 +4354,4 @@ export {
|
|
|
4309
4354
|
dataFormatter as d,
|
|
4310
4355
|
rest as r
|
|
4311
4356
|
};
|
|
4312
|
-
//# sourceMappingURL=Rest-
|
|
4357
|
+
//# sourceMappingURL=Rest-DSzjaYYe.js.map
|