@object-ui/plugin-charts 2.0.0 → 3.0.0
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/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +20 -0
- package/dist/{AdvancedChartImpl-DFmeUY4Q.js → AdvancedChartImpl-BPJDgZhN.js} +429 -398
- package/dist/{ChartImpl-B5LY4On3.js → ChartImpl-C-IeuOgj.js} +2 -2
- package/dist/{index-DSBO2Kdy.js → index-B49zCCfG.js} +14 -14
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +3 -3
- package/dist/src/ObjectChart.stories.d.ts +24 -0
- package/package.json +8 -8
- package/src/AdvancedChartImpl.tsx +26 -4
- package/src/ChartImpl.tsx +2 -2
- package/src/ChartRenderer.tsx +2 -2
- package/src/ObjectChart.stories.tsx +104 -0
- package/src/ObjectChart.tsx +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as r } from "./index-
|
|
1
|
+
import { j as r } from "./index-B49zCCfG.js";
|
|
2
2
|
import { R as l, B as n, C as d, X as f, Y as p, T as x, L as u, a as c } from "./BarChart-C_I0OFbj.js";
|
|
3
3
|
function j({
|
|
4
4
|
data: e = [],
|
|
@@ -9,7 +9,7 @@ function j({
|
|
|
9
9
|
// Default to standard primary color
|
|
10
10
|
color: o = "hsl(var(--primary))"
|
|
11
11
|
}) {
|
|
12
|
-
return /* @__PURE__ */ r.jsx("div", { className: `p-4 rounded-xl border border-border bg-card/40 backdrop-blur-sm shadow-lg shadow-background/5 ${i}`, children: /* @__PURE__ */ r.jsx(l, { width: "100%", height: t, children: /* @__PURE__ */ r.jsxs(n, { data: e, margin: { top:
|
|
12
|
+
return /* @__PURE__ */ r.jsx("div", { className: `p-2 sm:p-3 md:p-4 rounded-xl border border-border bg-card/40 backdrop-blur-sm shadow-lg shadow-background/5 ${i}`, children: /* @__PURE__ */ r.jsx(l, { width: "100%", height: t, children: /* @__PURE__ */ r.jsxs(n, { data: e, margin: { top: 10, right: 10, left: 10, bottom: 5 }, children: [
|
|
13
13
|
/* @__PURE__ */ r.jsxs("defs", { children: [
|
|
14
14
|
/* @__PURE__ */ r.jsxs("linearGradient", { id: "barGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
15
15
|
/* @__PURE__ */ r.jsx("stop", { offset: "0%", stopColor: o, stopOpacity: 1 }),
|
|
@@ -129,7 +129,7 @@ function de() {
|
|
|
129
129
|
configurable: !0
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function h() {
|
|
133
133
|
var e = a(this.type);
|
|
134
134
|
return Y[e] || (Y[e] = !0, console.error(
|
|
135
135
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
@@ -138,14 +138,14 @@ function de() {
|
|
|
138
138
|
function T(e, r, n, o, S, w) {
|
|
139
139
|
var s = n.ref;
|
|
140
140
|
return e = {
|
|
141
|
-
$$typeof:
|
|
141
|
+
$$typeof: v,
|
|
142
142
|
type: e,
|
|
143
143
|
key: r,
|
|
144
144
|
props: n,
|
|
145
145
|
_owner: o
|
|
146
146
|
}, (s !== void 0 ? s : null) !== null ? Object.defineProperty(e, "ref", {
|
|
147
147
|
enumerable: !1,
|
|
148
|
-
get:
|
|
148
|
+
get: h
|
|
149
149
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
150
150
|
configurable: !1,
|
|
151
151
|
enumerable: !1,
|
|
@@ -220,9 +220,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
220
220
|
A(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === k && (e._payload.status === "fulfilled" ? A(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
221
221
|
}
|
|
222
222
|
function A(e) {
|
|
223
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
223
|
+
return typeof e == "object" && e !== null && e.$$typeof === v;
|
|
224
224
|
}
|
|
225
|
-
var f = O,
|
|
225
|
+
var f = O, v = /* @__PURE__ */ Symbol.for("react.transitional.element"), B = /* @__PURE__ */ Symbol.for("react.portal"), C = /* @__PURE__ */ Symbol.for("react.fragment"), G = /* @__PURE__ */ Symbol.for("react.strict_mode"), H = /* @__PURE__ */ Symbol.for("react.profiler"), Z = /* @__PURE__ */ Symbol.for("react.consumer"), Q = /* @__PURE__ */ Symbol.for("react.context"), ee = /* @__PURE__ */ Symbol.for("react.forward_ref"), re = /* @__PURE__ */ Symbol.for("react.suspense"), ae = /* @__PURE__ */ Symbol.for("react.suspense_list"), te = /* @__PURE__ */ Symbol.for("react.memo"), k = /* @__PURE__ */ Symbol.for("react.lazy"), ne = /* @__PURE__ */ Symbol.for("react.activity"), le = /* @__PURE__ */ Symbol.for("react.client.reference"), N = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, oe = Array.isArray, P = console.createTask ? console.createTask : function() {
|
|
226
226
|
return null;
|
|
227
227
|
};
|
|
228
228
|
f = {
|
|
@@ -262,7 +262,7 @@ function pe() {
|
|
|
262
262
|
return q || (q = 1, process.env.NODE_ENV === "production" ? j.exports = fe() : j.exports = de()), j.exports;
|
|
263
263
|
}
|
|
264
264
|
var g = pe();
|
|
265
|
-
const me = O.lazy(() => import("./ChartImpl-
|
|
265
|
+
const me = O.lazy(() => import("./ChartImpl-C-IeuOgj.js")), be = O.lazy(() => import("./AdvancedChartImpl-BPJDgZhN.js")), U = ({ schema: a }) => /* @__PURE__ */ g.jsx(z, { fallback: /* @__PURE__ */ g.jsx(W, { className: "w-full h-48 sm:h-64 md:h-80 lg:h-[400px]" }), children: /* @__PURE__ */ g.jsx(
|
|
266
266
|
me,
|
|
267
267
|
{
|
|
268
268
|
data: a.data,
|
|
@@ -277,8 +277,8 @@ const me = O.lazy(() => import("./ChartImpl-B5LY4On3.js")), be = O.lazy(() => im
|
|
|
277
277
|
let i = a.series, u = a.xAxisKey, l = a.config;
|
|
278
278
|
if (u || (a.index ? u = a.index : a.category && (u = a.category)), i || (a.categories ? i = a.categories.map((c) => ({ dataKey: c })) : a.value && (i = [{ dataKey: a.value }])), !l && i) {
|
|
279
279
|
const c = a.colors || ["hsl(var(--chart-1))", "hsl(var(--chart-2))", "hsl(var(--chart-3))"], d = {};
|
|
280
|
-
i.forEach((p,
|
|
281
|
-
d[p.dataKey] = { label: p.dataKey, color: c[
|
|
280
|
+
i.forEach((p, h) => {
|
|
281
|
+
d[p.dataKey] = { label: p.dataKey, color: c[h % c.length] };
|
|
282
282
|
}), l = d;
|
|
283
283
|
}
|
|
284
284
|
return {
|
|
@@ -290,7 +290,7 @@ const me = O.lazy(() => import("./ChartImpl-B5LY4On3.js")), be = O.lazy(() => im
|
|
|
290
290
|
className: a.className
|
|
291
291
|
};
|
|
292
292
|
}, [a]);
|
|
293
|
-
return /* @__PURE__ */ g.jsx(z, { fallback: /* @__PURE__ */ g.jsx(W, { className: "w-full h-[400px]" }), children: /* @__PURE__ */ g.jsx(
|
|
293
|
+
return /* @__PURE__ */ g.jsx(z, { fallback: /* @__PURE__ */ g.jsx(W, { className: "w-full h-48 sm:h-64 md:h-80 lg:h-[400px]" }), children: /* @__PURE__ */ g.jsx(
|
|
294
294
|
be,
|
|
295
295
|
{
|
|
296
296
|
chartType: t.chartType,
|
|
@@ -302,22 +302,22 @@ const me = O.lazy(() => import("./ChartImpl-B5LY4On3.js")), be = O.lazy(() => im
|
|
|
302
302
|
}
|
|
303
303
|
) });
|
|
304
304
|
}, X = (a) => {
|
|
305
|
-
const { schema: t } = a, i = ie(), u = a.dataSource || i.dataSource, l = ue(t.bind), [c, d] = L([]), [p,
|
|
305
|
+
const { schema: t } = a, i = ie(), u = a.dataSource || i.dataSource, l = ue(t.bind), [c, d] = L([]), [p, h] = L(!1);
|
|
306
306
|
ce(() => {
|
|
307
307
|
let y = !0;
|
|
308
308
|
const A = async () => {
|
|
309
309
|
if (!(!u || !t.objectName)) {
|
|
310
|
-
y &&
|
|
310
|
+
y && h(!0);
|
|
311
311
|
try {
|
|
312
312
|
const f = await u.find(t.objectName, {
|
|
313
313
|
$filter: t.filter
|
|
314
314
|
});
|
|
315
|
-
let
|
|
316
|
-
Array.isArray(f) ?
|
|
315
|
+
let v = [];
|
|
316
|
+
Array.isArray(f) ? v = f : f && typeof f == "object" && Array.isArray(f.records) && (v = f.records), y && d(v);
|
|
317
317
|
} catch (f) {
|
|
318
318
|
console.error("[ObjectChart] Fetch error:", f);
|
|
319
319
|
} finally {
|
|
320
|
-
y &&
|
|
320
|
+
y && h(!1);
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
};
|
package/dist/index.js
CHANGED