web-mojo 2.1.678 → 2.1.697
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 +18 -10
- package/dist/admin.es.js.map +1 -1
- package/dist/auth.cjs.js +1 -1
- package/dist/auth.cjs.js.map +1 -1
- package/dist/auth.es.js +3 -3
- package/dist/auth.es.js.map +1 -1
- package/dist/charts.cjs.js +1 -1
- package/dist/charts.es.js +2 -2
- package/dist/chunks/ChatView-BN2Rl2UP.js +2 -0
- package/dist/chunks/ChatView-BN2Rl2UP.js.map +1 -0
- package/dist/chunks/{ChatView-iDY-MsDn.js → ChatView-CGiNfhMt.js} +11 -10
- package/dist/chunks/ChatView-CGiNfhMt.js.map +1 -0
- package/dist/chunks/{ContextMenu-zGKcw_a6.js → ContextMenu-9lS3qUwW.js} +2 -2
- package/dist/chunks/{ContextMenu-zGKcw_a6.js.map → ContextMenu-9lS3qUwW.js.map} +1 -1
- package/dist/chunks/{ContextMenu-DZLL0Aeu.js → ContextMenu-BBy3nk5G.js} +2 -2
- package/dist/chunks/{ContextMenu-DZLL0Aeu.js.map → ContextMenu-BBy3nk5G.js.map} +1 -1
- package/dist/chunks/DataView-CvD3EvJ9.js +2 -0
- package/dist/chunks/DataView-CvD3EvJ9.js.map +1 -0
- package/dist/chunks/{DataView-Dx78M3yt.js → DataView-PSRYZfrq.js} +29 -15
- package/dist/chunks/DataView-PSRYZfrq.js.map +1 -0
- package/dist/chunks/{Dialog-B3bD_iSn.js → Dialog-BUZ3RRPM.js} +5 -5
- package/dist/chunks/{Dialog-B3bD_iSn.js.map → Dialog-BUZ3RRPM.js.map} +1 -1
- package/dist/chunks/{Dialog-D9EXh_A9.js → Dialog-C_HOebyH.js} +2 -2
- package/dist/chunks/{Dialog-D9EXh_A9.js.map → Dialog-C_HOebyH.js.map} +1 -1
- package/dist/chunks/{FormView-NSlCK9fF.js → FormView-CeoubZ-s.js} +2 -2
- package/dist/chunks/{FormView-NSlCK9fF.js.map → FormView-CeoubZ-s.js.map} +1 -1
- package/dist/chunks/{FormView-zgLKURWJ.js → FormView-Di5zdS39.js} +2 -2
- package/dist/chunks/{FormView-zgLKURWJ.js.map → FormView-Di5zdS39.js.map} +1 -1
- package/dist/chunks/{MetricsMiniChartWidget-CmEzlyAO.js → MetricsMiniChartWidget-Df_aqXiH.js} +50 -13
- package/dist/chunks/{MetricsMiniChartWidget-CmEzlyAO.js.map → MetricsMiniChartWidget-Df_aqXiH.js.map} +1 -1
- package/dist/chunks/{MetricsMiniChartWidget-DXNa0bT2.js → MetricsMiniChartWidget-RKmQrR86.js} +2 -2
- package/dist/chunks/{MetricsMiniChartWidget-DXNa0bT2.js.map → MetricsMiniChartWidget-RKmQrR86.js.map} +1 -1
- package/dist/chunks/{PDFViewer-C8xUA4Po.js → PDFViewer-CQDTUfSe.js} +3 -3
- package/dist/chunks/{PDFViewer-C8xUA4Po.js.map → PDFViewer-CQDTUfSe.js.map} +1 -1
- package/dist/chunks/{PDFViewer-lbh_aAcj.js → PDFViewer-DL3ALPrt.js} +2 -2
- package/dist/chunks/{PDFViewer-lbh_aAcj.js.map → PDFViewer-DL3ALPrt.js.map} +1 -1
- package/dist/chunks/{Page-UNb6Zq-s.js → Page-B2QytRMU.js} +2 -2
- package/dist/chunks/{Page-UNb6Zq-s.js.map → Page-B2QytRMU.js.map} +1 -1
- package/dist/chunks/{Page-B4C7paFp.js → Page-DpnZbCfy.js} +2 -2
- package/dist/chunks/{Page-B4C7paFp.js.map → Page-DpnZbCfy.js.map} +1 -1
- package/dist/chunks/{TopNav-DLu1JgLn.js → TopNav-BUxuDl2O.js} +5 -5
- package/dist/chunks/{TopNav-DLu1JgLn.js.map → TopNav-BUxuDl2O.js.map} +1 -1
- package/dist/chunks/{TopNav-3cDtaRel.js → TopNav-DB42WdTi.js} +2 -2
- package/dist/chunks/{TopNav-3cDtaRel.js.map → TopNav-DB42WdTi.js.map} +1 -1
- package/dist/chunks/{WebApp-Zl6sz13N.js → WebApp-BsUzNFg3.js} +85 -17
- package/dist/chunks/WebApp-BsUzNFg3.js.map +1 -0
- package/dist/chunks/WebApp-DdLjexxg.js +2 -0
- package/dist/chunks/WebApp-DdLjexxg.js.map +1 -0
- package/dist/docit.cjs.js +1 -1
- package/dist/docit.es.js +5 -5
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +11 -11
- package/dist/lightbox.cjs.js +1 -1
- package/dist/lightbox.es.js +4 -4
- package/package.json +1 -1
- package/dist/chunks/ChatView-DoOb4dyF.js +0 -2
- package/dist/chunks/ChatView-DoOb4dyF.js.map +0 -1
- package/dist/chunks/ChatView-iDY-MsDn.js.map +0 -1
- package/dist/chunks/DataView-CJ10Saok.js +0 -2
- package/dist/chunks/DataView-CJ10Saok.js.map +0 -1
- package/dist/chunks/DataView-Dx78M3yt.js.map +0 -1
- package/dist/chunks/WebApp-CylQA6ix.js +0 -2
- package/dist/chunks/WebApp-CylQA6ix.js.map +0 -1
- package/dist/chunks/WebApp-Zl6sz13N.js.map +0 -1
package/dist/chunks/{MetricsMiniChartWidget-CmEzlyAO.js → MetricsMiniChartWidget-Df_aqXiH.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Dialog from "./Dialog-
|
|
2
|
-
import { V as View, d as dataFormatter } from "./WebApp-
|
|
1
|
+
import Dialog from "./Dialog-BUZ3RRPM.js";
|
|
2
|
+
import { V as View, d as dataFormatter } from "./WebApp-BsUzNFg3.js";
|
|
3
3
|
import { W as WebSocketClient } from "./WebSocketClient-B6ribe3B.js";
|
|
4
4
|
class BaseChart extends View {
|
|
5
5
|
constructor(options = {}) {
|
|
@@ -2697,6 +2697,9 @@ class MetricsMiniChartWidget extends View {
|
|
|
2697
2697
|
this.background = options.background || null;
|
|
2698
2698
|
this.textColor = options.textColor || null;
|
|
2699
2699
|
this.showTrending = !!options.showTrending;
|
|
2700
|
+
this.trendRange = options.trendRange ?? null;
|
|
2701
|
+
this.trendOffset = options.trendOffset ?? 0;
|
|
2702
|
+
this.prevTrendOffset = options.prevTrendOffset ?? 0;
|
|
2700
2703
|
this.total = 0;
|
|
2701
2704
|
this.lastValue = 0;
|
|
2702
2705
|
this.prevValue = 0;
|
|
@@ -2765,7 +2768,7 @@ class MetricsMiniChartWidget extends View {
|
|
|
2765
2768
|
template: `
|
|
2766
2769
|
<div class="d-flex justify-content-between align-items-start mb-2">
|
|
2767
2770
|
<div class="me-3">
|
|
2768
|
-
<h6 class="card-title mb-1" style="${this.textColor ? `color: ${this.textColor}` : ""}"
|
|
2771
|
+
<h6 class="card-title mb-1" style="${this.textColor ? `color: ${this.textColor}` : ""}">${this.title}</h6>
|
|
2769
2772
|
<div class="card-subtitle" style="${this.textColor ? `color: ${this.textColor}` : ""}">${this.subtitle}</div>
|
|
2770
2773
|
{{#hasTrending}}
|
|
2771
2774
|
<div class="small mt-1 fw-semibold {{trendingClass}}" style="${this.textColor ? `color: ${this.textColor}` : ""}">
|
|
@@ -2802,17 +2805,51 @@ class MetricsMiniChartWidget extends View {
|
|
|
2802
2805
|
});
|
|
2803
2806
|
this.header.title = this.title;
|
|
2804
2807
|
this.header.total = nums.reduce((a, b) => a + b, 0);
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2808
|
+
const offset = Math.max(0, parseInt(this.trendOffset || 0, 10) || 0);
|
|
2809
|
+
const endIndex = Math.max(0, nums.length - 1 - offset);
|
|
2810
|
+
this.header.now_value = nums[endIndex];
|
|
2811
|
+
let hasTrend = false;
|
|
2812
|
+
let lastSum = 0;
|
|
2813
|
+
let prevSum = 0;
|
|
2814
|
+
const k = this.trendRange && this.trendRange >= 2 ? Math.max(1, Math.floor(this.trendRange / 2)) : 1;
|
|
2815
|
+
if (endIndex >= 0) {
|
|
2816
|
+
const lastEnd = endIndex;
|
|
2817
|
+
const lastStart = lastEnd - (k - 1);
|
|
2818
|
+
let prevStart, prevEnd;
|
|
2819
|
+
if (this.prevTrendOffset && this.prevTrendOffset > 0) {
|
|
2820
|
+
prevStart = lastStart - this.prevTrendOffset;
|
|
2821
|
+
prevEnd = lastEnd - this.prevTrendOffset;
|
|
2822
|
+
} else {
|
|
2823
|
+
prevEnd = lastStart - 1;
|
|
2824
|
+
prevStart = prevEnd - (k - 1);
|
|
2825
|
+
}
|
|
2826
|
+
if (lastStart >= 0 && prevStart >= 0) {
|
|
2827
|
+
const sumRange = (arr, s, e) => {
|
|
2828
|
+
let sum = 0;
|
|
2829
|
+
for (let i = s; i <= e; i++) sum += arr[i] || 0;
|
|
2830
|
+
return sum;
|
|
2831
|
+
};
|
|
2832
|
+
lastSum = sumRange(nums, lastStart, lastEnd);
|
|
2833
|
+
prevSum = sumRange(nums, prevStart, prevEnd);
|
|
2834
|
+
hasTrend = true;
|
|
2835
|
+
}
|
|
2836
|
+
}
|
|
2837
|
+
if (!hasTrend) {
|
|
2838
|
+
const prevIndex = endIndex - (this.prevTrendOffset && this.prevTrendOffset > 0 ? this.prevTrendOffset : 1);
|
|
2839
|
+
if (prevIndex >= 0) {
|
|
2840
|
+
lastSum = nums[endIndex];
|
|
2841
|
+
prevSum = nums[prevIndex];
|
|
2842
|
+
hasTrend = true;
|
|
2843
|
+
}
|
|
2844
|
+
}
|
|
2845
|
+
if (hasTrend) {
|
|
2846
|
+
this.header.lastValue = lastSum;
|
|
2847
|
+
this.header.prevValue = prevSum;
|
|
2811
2848
|
let percent = 0;
|
|
2812
|
-
if (
|
|
2813
|
-
percent =
|
|
2849
|
+
if (prevSum === 0) {
|
|
2850
|
+
percent = lastSum > 0 ? 100 : 0;
|
|
2814
2851
|
} else {
|
|
2815
|
-
percent = (
|
|
2852
|
+
percent = (lastSum - prevSum) / Math.abs(prevSum) * 100;
|
|
2816
2853
|
}
|
|
2817
2854
|
this.header.trendingPercent = percent;
|
|
2818
2855
|
this.header.trendingUp = percent >= 0;
|
|
@@ -2871,4 +2908,4 @@ export {
|
|
|
2871
2908
|
MetricsMiniChart as b,
|
|
2872
2909
|
MetricsMiniChartWidget as c
|
|
2873
2910
|
};
|
|
2874
|
-
//# sourceMappingURL=MetricsMiniChartWidget-
|
|
2911
|
+
//# sourceMappingURL=MetricsMiniChartWidget-Df_aqXiH.js.map
|