anarock-widgets 1.0.79 → 1.0.81
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/index.cjs.js +1 -1
- package/dist/index.es.js +23 -40
- package/dist/index.umd.js +51 -51
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -45693,7 +45693,7 @@ function wne() {
|
|
|
45693
45693
|
}
|
|
45694
45694
|
function One({ data: e = [] }) {
|
|
45695
45695
|
console.log(e, "complaints data");
|
|
45696
|
-
const t = Array.isArray(e) ? e.map((n) => ({
|
|
45696
|
+
const t = Array.isArray(e?.complaints_by_category) ? e?.complaints_by_category.map((n) => ({
|
|
45697
45697
|
title: n.category_name || "—",
|
|
45698
45698
|
total: n.total || 0,
|
|
45699
45699
|
pending: n.pending || 0
|
|
@@ -45729,51 +45729,35 @@ function One({ data: e = [] }) {
|
|
|
45729
45729
|
}
|
|
45730
45730
|
Rn.register(ro, io, ac, _r, Er);
|
|
45731
45731
|
const TE = [
|
|
45732
|
-
{
|
|
45733
|
-
|
|
45734
|
-
|
|
45735
|
-
|
|
45736
|
-
},
|
|
45737
|
-
{
|
|
45738
|
-
key: "in_progress_count",
|
|
45739
|
-
label: "In Progress",
|
|
45740
|
-
color: "#F59D0D"
|
|
45741
|
-
},
|
|
45742
|
-
{
|
|
45743
|
-
key: "open_count",
|
|
45744
|
-
label: "Open",
|
|
45745
|
-
color: "#EF4444"
|
|
45746
|
-
}
|
|
45747
|
-
], Sne = ({ data: e = [] }) => {
|
|
45732
|
+
{ key: "closed_count", label: "Closed", color: "#12B981" },
|
|
45733
|
+
{ key: "in_progress_count", label: "In Progress", color: "#F59D0D" },
|
|
45734
|
+
{ key: "open_count", label: "Open", color: "#EF4444" }
|
|
45735
|
+
], Sne = ({ data: e = {} }) => {
|
|
45748
45736
|
console.log(e, "data for complaint");
|
|
45749
|
-
const t = Un(() => {
|
|
45750
|
-
if (
|
|
45737
|
+
const t = Array.isArray(e?.complaints_by_level) ? e.complaints_by_level : [], n = Un(() => {
|
|
45738
|
+
if (t.length === 0)
|
|
45751
45739
|
return { labels: [], datasets: [] };
|
|
45752
|
-
const
|
|
45753
|
-
...
|
|
45740
|
+
const i = t.map((l) => l.level || "—"), o = Math.max(
|
|
45741
|
+
...t.map((l) => Number(l.total) || 0),
|
|
45754
45742
|
0
|
|
45755
|
-
),
|
|
45743
|
+
), a = t.map(() => 1), s = TE.flatMap((l, c) => [
|
|
45756
45744
|
{
|
|
45757
|
-
label:
|
|
45758
|
-
data:
|
|
45759
|
-
backgroundColor:
|
|
45745
|
+
label: l.label,
|
|
45746
|
+
data: t.map((u) => Number(u[l.key]) || 0),
|
|
45747
|
+
backgroundColor: l.color,
|
|
45760
45748
|
barThickness: 44
|
|
45761
45749
|
},
|
|
45762
|
-
...
|
|
45750
|
+
...c < TE.length - 1 ? [
|
|
45763
45751
|
{
|
|
45764
45752
|
label: "",
|
|
45765
|
-
data:
|
|
45753
|
+
data: a,
|
|
45766
45754
|
backgroundColor: "transparent",
|
|
45767
45755
|
barThickness: 44
|
|
45768
45756
|
}
|
|
45769
45757
|
] : []
|
|
45770
45758
|
]);
|
|
45771
|
-
return {
|
|
45772
|
-
|
|
45773
|
-
datasets: a,
|
|
45774
|
-
maxTotal: i
|
|
45775
|
-
};
|
|
45776
|
-
}, [e]), n = {
|
|
45759
|
+
return { labels: i, datasets: s, maxTotal: o };
|
|
45760
|
+
}, [t]), r = {
|
|
45777
45761
|
responsive: !0,
|
|
45778
45762
|
maintainAspectRatio: !1,
|
|
45779
45763
|
plugins: {
|
|
@@ -45782,13 +45766,12 @@ const TE = [
|
|
|
45782
45766
|
labels: {
|
|
45783
45767
|
usePointStyle: !0,
|
|
45784
45768
|
boxWidth: 10,
|
|
45785
|
-
boxHeight: 10
|
|
45786
|
-
pointStyle: "rectRot"
|
|
45769
|
+
boxHeight: 10
|
|
45787
45770
|
}
|
|
45788
45771
|
},
|
|
45789
45772
|
tooltip: {
|
|
45790
45773
|
callbacks: {
|
|
45791
|
-
label: (
|
|
45774
|
+
label: (i) => i.dataset.label ? `${i.dataset.label}: ${i.parsed.y}` : null
|
|
45792
45775
|
}
|
|
45793
45776
|
}
|
|
45794
45777
|
},
|
|
@@ -45800,9 +45783,9 @@ const TE = [
|
|
|
45800
45783
|
y: {
|
|
45801
45784
|
stacked: !0,
|
|
45802
45785
|
beginAtZero: !0,
|
|
45803
|
-
suggestedMax: Math.ceil(
|
|
45786
|
+
suggestedMax: Math.ceil(n.maxTotal * 1.2) || 5,
|
|
45804
45787
|
ticks: {
|
|
45805
|
-
stepSize: Math.max(Math.ceil(
|
|
45788
|
+
stepSize: Math.max(Math.ceil(n.maxTotal / 6), 1)
|
|
45806
45789
|
}
|
|
45807
45790
|
}
|
|
45808
45791
|
}
|
|
@@ -45813,7 +45796,7 @@ const TE = [
|
|
|
45813
45796
|
title: "Complaints by Level",
|
|
45814
45797
|
className: "w-full h-[362px]",
|
|
45815
45798
|
period: /* @__PURE__ */ w.jsx(Xt, { className: "text-[20px] text-[#884EA7]" }),
|
|
45816
|
-
children: /* @__PURE__ */ w.jsx(sc, { data:
|
|
45799
|
+
children: t.length > 0 ? /* @__PURE__ */ w.jsx(sc, { data: n, options: r }) : /* @__PURE__ */ w.jsx("div", { className: "flex items-center justify-center h-full text-gray-500", children: "No data available" })
|
|
45817
45800
|
}
|
|
45818
45801
|
);
|
|
45819
45802
|
};
|
|
@@ -45824,7 +45807,7 @@ function Ene({ data: e = {} }) {
|
|
|
45824
45807
|
total: Number(n.total) || 0,
|
|
45825
45808
|
pending: Number(n.pending) || 0
|
|
45826
45809
|
})) : [];
|
|
45827
|
-
return /* @__PURE__ */ w.jsx(
|
|
45810
|
+
return console.log(t, "requests"), /* @__PURE__ */ w.jsx(
|
|
45828
45811
|
dt,
|
|
45829
45812
|
{
|
|
45830
45813
|
title: "Request Box",
|