web-mojo 2.1.1044 → 2.1.1090
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 +75 -72
- package/dist/admin.es.js.map +1 -1
- package/dist/auth.cjs.js +1 -1
- package/dist/auth.es.js +1 -1
- package/dist/charts.cjs.js +1 -1
- package/dist/charts.cjs.js.map +1 -1
- package/dist/charts.css +319 -0
- package/dist/charts.es.js +555 -3
- package/dist/charts.es.js.map +1 -1
- package/dist/chunks/{ChatView-Bvkdj-lq.js → ChatView-DBYroDpU.js} +2 -2
- package/dist/chunks/{ChatView-Bvkdj-lq.js.map → ChatView-DBYroDpU.js.map} +1 -1
- package/dist/chunks/{ChatView-DBgQzOyI.js → ChatView-e0mc38Pf.js} +7 -7
- package/dist/chunks/{ChatView-DBgQzOyI.js.map → ChatView-e0mc38Pf.js.map} +1 -1
- package/dist/chunks/{Collection-DD1_31eh.js → Collection-B64LJ92k.js} +2 -2
- package/dist/chunks/{Collection-DD1_31eh.js.map → Collection-B64LJ92k.js.map} +1 -1
- package/dist/chunks/{Collection-DaTm-2LH.js → Collection-DpdzB_n7.js} +2 -2
- package/dist/chunks/{Collection-DaTm-2LH.js.map → Collection-DpdzB_n7.js.map} +1 -1
- package/dist/chunks/{ContextMenu-snx9Dd1s.js → ContextMenu-CfMAB33c.js} +2 -2
- package/dist/chunks/{ContextMenu-snx9Dd1s.js.map → ContextMenu-CfMAB33c.js.map} +1 -1
- package/dist/chunks/{ContextMenu-hQH_6Pyi.js → ContextMenu-DG-2yxqU.js} +3 -3
- package/dist/chunks/{ContextMenu-hQH_6Pyi.js.map → ContextMenu-DG-2yxqU.js.map} +1 -1
- package/dist/chunks/{DataView-D7j4IWyS.js → DataView-DESqBxT-.js} +2 -2
- package/dist/chunks/{DataView-D7j4IWyS.js.map → DataView-DESqBxT-.js.map} +1 -1
- package/dist/chunks/{DataView-CWejLV3B.js → DataView-QXyfcg2M.js} +2 -2
- package/dist/chunks/{DataView-CWejLV3B.js.map → DataView-QXyfcg2M.js.map} +1 -1
- package/dist/chunks/{Dialog-BcJG5Vta.js → Dialog-DvSrCOj1.js} +21 -8
- package/dist/chunks/Dialog-DvSrCOj1.js.map +1 -0
- package/dist/chunks/Dialog-zrXDKGkH.js +2 -0
- package/dist/chunks/Dialog-zrXDKGkH.js.map +1 -0
- package/dist/chunks/{FormView-BClEkzmE.js → FormView-DGRmcKUG.js} +282 -123
- package/dist/chunks/FormView-DGRmcKUG.js.map +1 -0
- package/dist/chunks/FormView-KGvr68ju.js +3 -0
- package/dist/chunks/FormView-KGvr68ju.js.map +1 -0
- package/dist/chunks/{ListView-BrsQ26R6.js → ListView-B2gyVSMW.js} +3 -3
- package/dist/chunks/{ListView-BrsQ26R6.js.map → ListView-B2gyVSMW.js.map} +1 -1
- package/dist/chunks/{ListView-BRGiITfD.js → ListView-BpGEatee.js} +2 -2
- package/dist/chunks/{ListView-BRGiITfD.js.map → ListView-BpGEatee.js.map} +1 -1
- package/dist/chunks/{MetricsMiniChartWidget-CN1HPnWf.js → MetricsMiniChartWidget-C9ou095r.js} +2 -2
- package/dist/chunks/{MetricsMiniChartWidget-CN1HPnWf.js.map → MetricsMiniChartWidget-C9ou095r.js.map} +1 -1
- package/dist/chunks/{MetricsMiniChartWidget-DALWxrzu.js → MetricsMiniChartWidget-Z-Iz-gxt.js} +4 -4
- package/dist/chunks/{MetricsMiniChartWidget-DALWxrzu.js.map → MetricsMiniChartWidget-Z-Iz-gxt.js.map} +1 -1
- package/dist/chunks/{PDFViewer-DtJIlPXi.js → PDFViewer-BXcbKJHv.js} +2 -2
- package/dist/chunks/{PDFViewer-DtJIlPXi.js.map → PDFViewer-BXcbKJHv.js.map} +1 -1
- package/dist/chunks/{PDFViewer-CgdSGU1n.js → PDFViewer-Bq55sL4x.js} +3 -3
- package/dist/chunks/{PDFViewer-CgdSGU1n.js.map → PDFViewer-Bq55sL4x.js.map} +1 -1
- package/dist/chunks/Rest-BpDyhFfG.js +2 -0
- package/dist/chunks/Rest-BpDyhFfG.js.map +1 -0
- package/dist/chunks/{Rest-CS4jRCAs.js → Rest-DpbPbmra.js} +96 -5
- package/dist/chunks/Rest-DpbPbmra.js.map +1 -0
- package/dist/chunks/{TokenManager-BanwFrq7.js → TokenManager-BYVQWApC.js} +5 -5
- package/dist/chunks/{TokenManager-BanwFrq7.js.map → TokenManager-BYVQWApC.js.map} +1 -1
- package/dist/chunks/{TokenManager-DIEFCQ3B.js → TokenManager-D8VO38Nx.js} +2 -2
- package/dist/chunks/{TokenManager-DIEFCQ3B.js.map → TokenManager-D8VO38Nx.js.map} +1 -1
- package/dist/chunks/{WebSocketClient-D-5DJoMX.js → WebSocketClient-DghNkEyO.js} +2 -2
- package/dist/chunks/{WebSocketClient-D-5DJoMX.js.map → WebSocketClient-DghNkEyO.js.map} +1 -1
- package/dist/chunks/{WebSocketClient-DzcqAmho.js → WebSocketClient-E08hfP5f.js} +2 -2
- package/dist/chunks/{WebSocketClient-DzcqAmho.js.map → WebSocketClient-E08hfP5f.js.map} +1 -1
- package/dist/chunks/{version-WMgX72-y.js → version-BDuk3lxD.js} +2 -2
- package/dist/chunks/{version-WMgX72-y.js.map → version-BDuk3lxD.js.map} +1 -1
- package/dist/chunks/{version-BaFu2yii.js → version-BsWmst16.js} +4 -4
- package/dist/chunks/{version-BaFu2yii.js.map → version-BsWmst16.js.map} +1 -1
- package/dist/css/web-mojo.css +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.es.js +15 -15
- package/dist/lightbox.cjs.js +1 -1
- package/dist/lightbox.es.js +5 -5
- package/dist/map.cjs.js +1 -1
- package/dist/map.cjs.js.map +1 -1
- package/dist/map.es.js +82 -3
- package/dist/map.es.js.map +1 -1
- package/dist/timeline.cjs.js +1 -1
- package/dist/timeline.es.js +4 -4
- package/package.json +1 -1
- package/dist/chunks/Dialog-7T8ENHYD.js +0 -2
- package/dist/chunks/Dialog-7T8ENHYD.js.map +0 -1
- package/dist/chunks/Dialog-BcJG5Vta.js.map +0 -1
- package/dist/chunks/FormView-BClEkzmE.js.map +0 -1
- package/dist/chunks/FormView-nulck4nL.js +0 -3
- package/dist/chunks/FormView-nulck4nL.js.map +0 -1
- package/dist/chunks/Rest-BNYqGlnP.js +0 -2
- package/dist/chunks/Rest-BNYqGlnP.js.map +0 -1
- package/dist/chunks/Rest-CS4jRCAs.js.map +0 -1
|
@@ -485,6 +485,7 @@ class DataFormatter {
|
|
|
485
485
|
this.register("datatime_tz", this.datetime_tz.bind(this));
|
|
486
486
|
this.register("relative", this.relative.bind(this));
|
|
487
487
|
this.register("fromNow", this.relative.bind(this));
|
|
488
|
+
this.register("relative_short", this.relative_short.bind(this));
|
|
488
489
|
this.register("iso", this.iso.bind(this));
|
|
489
490
|
this.register("epoch", (v) => {
|
|
490
491
|
if (v === null || v === void 0 || v === "") return v;
|
|
@@ -517,6 +518,7 @@ class DataFormatter {
|
|
|
517
518
|
this.register("phone", this.phone.bind(this));
|
|
518
519
|
this.register("url", this.url.bind(this));
|
|
519
520
|
this.register("badge", this.badge.bind(this));
|
|
521
|
+
this.register("badgeClass", this.badgeClass.bind(this));
|
|
520
522
|
this.register("status", this.status.bind(this));
|
|
521
523
|
this.register("status_text", this.status_text.bind(this));
|
|
522
524
|
this.register("status_icon", this.status_icon.bind(this));
|
|
@@ -528,6 +530,8 @@ class DataFormatter {
|
|
|
528
530
|
this.register("avatar", this.avatar.bind(this));
|
|
529
531
|
this.register("image", this.image.bind(this));
|
|
530
532
|
this.register("tooltip", this.tooltip.bind(this));
|
|
533
|
+
this.register("linkify", this.linkify.bind(this));
|
|
534
|
+
this.register("clipboard", this.clipboard.bind(this));
|
|
531
535
|
this.register("default", this.default.bind(this));
|
|
532
536
|
this.register("equals", this.equals.bind(this));
|
|
533
537
|
this.register("json", this.json.bind(this));
|
|
@@ -552,8 +556,64 @@ class DataFormatter {
|
|
|
552
556
|
this.register("hash", this.hash.bind(this));
|
|
553
557
|
this.register("stripHtml", this.stripHtml.bind(this));
|
|
554
558
|
this.register("highlight", this.highlight.bind(this));
|
|
559
|
+
this.register("nl2br", this.nl2br.bind(this));
|
|
560
|
+
this.register("code", this.code.bind(this));
|
|
555
561
|
this.register("pre", (v) => `<pre class="bg-light p-2 rounded border">${this.escapeHtml(String(v))}</pre>`);
|
|
556
562
|
}
|
|
563
|
+
relative_short(value) {
|
|
564
|
+
return this.relative(value, true);
|
|
565
|
+
}
|
|
566
|
+
linkify(value, options = {}) {
|
|
567
|
+
if (value === null || value === void 0) return "";
|
|
568
|
+
const text = String(value);
|
|
569
|
+
const escaped = this.escapeHtml(text);
|
|
570
|
+
const defaults = { urls: true, emails: true, target: "_blank", rel: "noopener noreferrer" };
|
|
571
|
+
const opts = options && typeof options === "object" ? { ...defaults, ...options } : defaults;
|
|
572
|
+
let result = escaped;
|
|
573
|
+
if (opts.urls !== false) {
|
|
574
|
+
const urlRegex = /(^|\s)((?:https?:\/\/|www\.)[^\s<]+)/gi;
|
|
575
|
+
result = result.replace(urlRegex, (match, prefix, url) => {
|
|
576
|
+
const href = url.startsWith("www.") ? `https://${url}` : url;
|
|
577
|
+
return `${prefix}<a href="${href}" target="${opts.target}" rel="${opts.rel}">${url}</a>`;
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
if (opts.emails !== false) {
|
|
581
|
+
const emailRegex = /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/gi;
|
|
582
|
+
result = result.replace(emailRegex, (email) => `<a href="mailto:${email}">${email}</a>`);
|
|
583
|
+
}
|
|
584
|
+
return result;
|
|
585
|
+
}
|
|
586
|
+
clipboard(value, mode = "text") {
|
|
587
|
+
if (value === null || value === void 0) return "";
|
|
588
|
+
const text = String(value);
|
|
589
|
+
const escapedText = this.escapeHtml(text);
|
|
590
|
+
const showText = mode !== "icon-only";
|
|
591
|
+
const buttonHtml = `
|
|
592
|
+
<button type="button"
|
|
593
|
+
class="btn btn-sm btn-outline-secondary ms-1 p-0 border-0 bg-transparent"
|
|
594
|
+
title="Copy"
|
|
595
|
+
data-bs-toggle="tooltip"
|
|
596
|
+
data-action="copy-to-clipboard"
|
|
597
|
+
data-clipboard="${escapedText}">
|
|
598
|
+
<i class="bi bi-clipboard"></i>
|
|
599
|
+
</button>`.trim();
|
|
600
|
+
return `
|
|
601
|
+
<span class="mojo-clipboard d-inline-flex align-items-center">
|
|
602
|
+
${showText ? `<span class="font-monospace">${escapedText}</span>` : ""}
|
|
603
|
+
${buttonHtml}
|
|
604
|
+
</span>
|
|
605
|
+
`;
|
|
606
|
+
}
|
|
607
|
+
nl2br(value) {
|
|
608
|
+
if (value === null || value === void 0) return "";
|
|
609
|
+
return this.escapeHtml(String(value)).replace(/\r\n|\r|\n/g, "<br>");
|
|
610
|
+
}
|
|
611
|
+
code(value, lang = "") {
|
|
612
|
+
if (value === null || value === void 0) return "";
|
|
613
|
+
const language = lang ? `language-${this.escapeHtml(String(lang))}` : "";
|
|
614
|
+
const content = this.escapeHtml(String(value));
|
|
615
|
+
return `<pre class="bg-light p-2 rounded border"><code class="${language}">${content}</code></pre>`;
|
|
616
|
+
}
|
|
557
617
|
/**
|
|
558
618
|
* Register a custom formatter
|
|
559
619
|
* @param {string} name - Formatter name
|
|
@@ -1006,8 +1066,8 @@ class DataFormatter {
|
|
|
1006
1066
|
value = this.normalizeEpoch(value);
|
|
1007
1067
|
const date = value instanceof Date ? value : new Date(value);
|
|
1008
1068
|
if (isNaN(date.getTime())) return String(value);
|
|
1009
|
-
const
|
|
1010
|
-
const diffMs =
|
|
1069
|
+
const now = /* @__PURE__ */ new Date();
|
|
1070
|
+
const diffMs = now - date;
|
|
1011
1071
|
const diffSecs = Math.floor(diffMs / 1e3);
|
|
1012
1072
|
const diffMins = Math.floor(diffSecs / 60);
|
|
1013
1073
|
const diffHours = Math.floor(diffMins / 60);
|
|
@@ -2854,6 +2914,7 @@ class View {
|
|
|
2854
2914
|
}
|
|
2855
2915
|
canRender() {
|
|
2856
2916
|
if (this.isRendering) return false;
|
|
2917
|
+
const now = Date.now();
|
|
2857
2918
|
if (this.options.renderCooldown > 0 && now - this.lastRenderTime < this.options.renderCooldown) {
|
|
2858
2919
|
View._warn(`View ${this.id}: Render called too quickly, cooldown active`);
|
|
2859
2920
|
return false;
|
|
@@ -2875,12 +2936,12 @@ class View {
|
|
|
2875
2936
|
// Render flow
|
|
2876
2937
|
// ---------------------------------------------
|
|
2877
2938
|
async render(allowMount = true, container = null) {
|
|
2878
|
-
const
|
|
2939
|
+
const now = Date.now();
|
|
2879
2940
|
if (!this.canRender()) {
|
|
2880
2941
|
return this;
|
|
2881
2942
|
}
|
|
2882
2943
|
this.isRendering = true;
|
|
2883
|
-
this.lastRenderTime =
|
|
2944
|
+
this.lastRenderTime = now;
|
|
2884
2945
|
try {
|
|
2885
2946
|
if (!this.initialized) await this.onInitView();
|
|
2886
2947
|
this.unbindEvents();
|
|
@@ -3312,6 +3373,36 @@ class View {
|
|
|
3312
3373
|
}
|
|
3313
3374
|
alert(`Warning: ${message}`);
|
|
3314
3375
|
}
|
|
3376
|
+
// Default action: copy value from data-clipboard to clipboard
|
|
3377
|
+
async onActionCopyToClipboard(event, element) {
|
|
3378
|
+
try {
|
|
3379
|
+
const carrier = element?.closest("[data-clipboard]") || element;
|
|
3380
|
+
const text = carrier?.getAttribute("data-clipboard") || "";
|
|
3381
|
+
if (!text) return true;
|
|
3382
|
+
if (navigator.clipboard && window.isSecureContext) {
|
|
3383
|
+
await navigator.clipboard.writeText(text);
|
|
3384
|
+
} else {
|
|
3385
|
+
const textarea = document.createElement("textarea");
|
|
3386
|
+
textarea.value = text;
|
|
3387
|
+
document.body.appendChild(textarea);
|
|
3388
|
+
textarea.select();
|
|
3389
|
+
document.execCommand("copy");
|
|
3390
|
+
document.body.removeChild(textarea);
|
|
3391
|
+
}
|
|
3392
|
+
const icon = element.querySelector("i");
|
|
3393
|
+
const originalClass = icon && icon.className;
|
|
3394
|
+
if (icon) {
|
|
3395
|
+
icon.className = "bi bi-check";
|
|
3396
|
+
setTimeout(() => {
|
|
3397
|
+
icon.className = originalClass;
|
|
3398
|
+
}, 1e3);
|
|
3399
|
+
}
|
|
3400
|
+
return true;
|
|
3401
|
+
} catch (err) {
|
|
3402
|
+
console.warn("Copy to clipboard failed:", err);
|
|
3403
|
+
return true;
|
|
3404
|
+
}
|
|
3405
|
+
}
|
|
3315
3406
|
static _genId() {
|
|
3316
3407
|
return `view_${Math.random().toString(36).substr(2, 9)}`;
|
|
3317
3408
|
}
|
|
@@ -4042,4 +4133,4 @@ export {
|
|
|
4042
4133
|
dataFormatter as d,
|
|
4043
4134
|
rest as r
|
|
4044
4135
|
};
|
|
4045
|
-
//# sourceMappingURL=Rest-
|
|
4136
|
+
//# sourceMappingURL=Rest-DpbPbmra.js.map
|