@aspprev/versi-ds 0.3.0 → 0.4.1
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/README.md +14 -1
- package/dist/charts.js +1 -2
- package/dist/{chunk-ATWH3MA6.js → chunk-2XXVEFFY.js} +18 -35
- package/dist/{chunk-ATWH3MA6.js.map → chunk-2XXVEFFY.js.map} +1 -1
- package/dist/{chunk-V66QL3TD.js → chunk-5MRS4PDD.js} +200 -211
- package/dist/{chunk-V66QL3TD.js.map → chunk-5MRS4PDD.js.map} +1 -1
- package/dist/{chunk-OQECJKGA.js → chunk-6NVJWI5B.js} +556 -608
- package/dist/chunk-6NVJWI5B.js.map +1 -0
- package/dist/chunk-7IY43S3Y.js +2833 -0
- package/dist/chunk-7IY43S3Y.js.map +1 -0
- package/dist/{chunk-EPV6UNUQ.js → chunk-JGCZAVYV.js} +424 -595
- package/dist/chunk-JGCZAVYV.js.map +1 -0
- package/dist/{chunk-FTRF27XF.js → chunk-MMTKCHRP.js} +7 -17
- package/dist/{chunk-FTRF27XF.js.map → chunk-MMTKCHRP.js.map} +1 -1
- package/dist/{chunk-7JI5637G.js → chunk-YIUITJ4V.js} +45 -77
- package/dist/{chunk-7JI5637G.js.map → chunk-YIUITJ4V.js.map} +1 -1
- package/dist/{chunk-DO5C67KS.js → chunk-ZPY72ILO.js} +87 -75
- package/dist/chunk-ZPY72ILO.js.map +1 -0
- package/dist/core.js +3 -4
- package/dist/countries-browser.d.ts +11 -0
- package/dist/countries-browser.js +44 -0
- package/dist/countries-browser.js.map +1 -0
- package/dist/countries.d.ts +6 -46
- package/dist/countries.js +280 -7
- package/dist/countries.js.map +1 -1
- package/dist/country-metadata-DOgzawAc.d.ts +27 -0
- package/dist/documents.js +2 -3
- package/dist/flags-00-MPU4ISEM.js +85 -0
- package/dist/flags-00-MPU4ISEM.js.map +1 -0
- package/dist/flags-01-PWC64NSQ.js +13 -0
- package/dist/flags-01-PWC64NSQ.js.map +1 -0
- package/dist/flags-02-GNF7X6MP.js +10 -0
- package/dist/flags-02-GNF7X6MP.js.map +1 -0
- package/dist/flags-03-STVDA6UG.js +82 -0
- package/dist/flags-03-STVDA6UG.js.map +1 -0
- package/dist/flags-04-Z6AHZIWG.js +31 -0
- package/dist/flags-04-Z6AHZIWG.js.map +1 -0
- package/dist/flags-05-QBADBC6C.js +13 -0
- package/dist/flags-05-QBADBC6C.js.map +1 -0
- package/dist/flags-06-O55E67OI.js +28 -0
- package/dist/flags-06-O55E67OI.js.map +1 -0
- package/dist/flags-07-RSWJQIRW.js +64 -0
- package/dist/flags-07-RSWJQIRW.js.map +1 -0
- package/dist/flags-08-HHXIPTKX.js +31 -0
- package/dist/flags-08-HHXIPTKX.js.map +1 -0
- package/dist/flags-09-OEZBQ62G.js +64 -0
- package/dist/flags-09-OEZBQ62G.js.map +1 -0
- package/dist/flags-10-XJY5UMQR.js +73 -0
- package/dist/flags-10-XJY5UMQR.js.map +1 -0
- package/dist/flags-11-7M75OPUJ.js +34 -0
- package/dist/flags-11-7M75OPUJ.js.map +1 -0
- package/dist/flags-12-JY22PFQH.js +31 -0
- package/dist/flags-12-JY22PFQH.js.map +1 -0
- package/dist/flags-13-BERDGZCT.js +52 -0
- package/dist/flags-13-BERDGZCT.js.map +1 -0
- package/dist/flags-14-XVPM2GQ2.js +31 -0
- package/dist/flags-14-XVPM2GQ2.js.map +1 -0
- package/dist/flags-15-WESIXIDR.js +64 -0
- package/dist/flags-15-WESIXIDR.js.map +1 -0
- package/dist/flags-16-PTNHBPYG.js +40 -0
- package/dist/flags-16-PTNHBPYG.js.map +1 -0
- package/dist/flags-17-UYXBV5BH.js +10 -0
- package/dist/flags-17-UYXBV5BH.js.map +1 -0
- package/dist/flags-18-VMKDO7W4.js +91 -0
- package/dist/flags-18-VMKDO7W4.js.map +1 -0
- package/dist/flags-19-635PQOEQ.js +43 -0
- package/dist/flags-19-635PQOEQ.js.map +1 -0
- package/dist/forms.d.ts +2 -2
- package/dist/forms.js +3 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -9
- package/dist/manifest.json +32 -10
- package/dist/overlays.d.ts +1 -1
- package/dist/overlays.js +1 -2
- package/package.json +10 -2
- package/dist/chunk-2NMEKWO5.js +0 -38
- package/dist/chunk-2NMEKWO5.js.map +0 -1
- package/dist/chunk-DO5C67KS.js.map +0 -1
- package/dist/chunk-EPV6UNUQ.js.map +0 -1
- package/dist/chunk-OQECJKGA.js.map +0 -1
- package/dist/chunk-YCW3REQK.js +0 -3102
- package/dist/chunk-YCW3REQK.js.map +0 -1
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__objRest,
|
|
3
|
-
__spreadProps,
|
|
4
|
-
__spreadValues
|
|
5
|
-
} from "./chunk-2NMEKWO5.js";
|
|
6
|
-
|
|
7
1
|
// src/components/chart/LazyApexChart.tsx
|
|
8
2
|
import { useEffect, useState } from "react";
|
|
9
3
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -29,7 +23,7 @@ function LazyApexChart(props) {
|
|
|
29
23
|
}
|
|
30
24
|
);
|
|
31
25
|
}
|
|
32
|
-
return /* @__PURE__ */ jsx(ApexChart,
|
|
26
|
+
return /* @__PURE__ */ jsx(ApexChart, { ...props });
|
|
33
27
|
}
|
|
34
28
|
|
|
35
29
|
// src/utils/chart-theme.ts
|
|
@@ -62,9 +56,8 @@ var MUTED_SERIES_FALLBACKS = [
|
|
|
62
56
|
"#aeb5bd"
|
|
63
57
|
];
|
|
64
58
|
var readColorToken = (token, fallback) => {
|
|
65
|
-
var _a;
|
|
66
59
|
if (typeof window === "undefined") return fallback;
|
|
67
|
-
const value = window.getComputedStyle(
|
|
60
|
+
const value = window.getComputedStyle(document.body ?? document.documentElement).getPropertyValue(token).trim();
|
|
68
61
|
return value ? `rgb(${value})` : fallback;
|
|
69
62
|
};
|
|
70
63
|
var getChartTheme = () => ({
|
|
@@ -93,7 +86,7 @@ var getChartSeriesRecord = (backendColors, count = 5) => {
|
|
|
93
86
|
);
|
|
94
87
|
const isDarkSchemeActive = typeof document !== "undefined" && document.documentElement.dataset.colorScheme === "dark";
|
|
95
88
|
const highContrastActive = typeof document !== "undefined" && document.documentElement.dataset.contrast === "high";
|
|
96
|
-
return highContrastActive || isDarkSchemeActive ? fallbackColors :
|
|
89
|
+
return highContrastActive || isDarkSchemeActive ? fallbackColors : { ...fallbackColors, ...backendColors };
|
|
97
90
|
};
|
|
98
91
|
|
|
99
92
|
// src/components/chart/interactive-donut-utils.ts
|
|
@@ -127,7 +120,7 @@ var TOOLTIP_ENTITIES = {
|
|
|
127
120
|
"'": "'"
|
|
128
121
|
};
|
|
129
122
|
function escapeDonutTooltipText(value) {
|
|
130
|
-
return String(value
|
|
123
|
+
return String(value ?? "").replace(
|
|
131
124
|
/[&<>"']/g,
|
|
132
125
|
(character) => TOOLTIP_ENTITIES[character]
|
|
133
126
|
);
|
|
@@ -160,36 +153,24 @@ import {
|
|
|
160
153
|
useState as useState3
|
|
161
154
|
} from "react";
|
|
162
155
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
163
|
-
function InteractiveDonutChart(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
"options",
|
|
180
|
-
"series",
|
|
181
|
-
"colors",
|
|
182
|
-
"mutedColors",
|
|
183
|
-
"valueFormatter",
|
|
184
|
-
"ariaLabel",
|
|
185
|
-
"className",
|
|
186
|
-
"chartClassName",
|
|
187
|
-
"responsiveHeight",
|
|
188
|
-
"highContrastOverride"
|
|
189
|
-
]);
|
|
190
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i;
|
|
156
|
+
function InteractiveDonutChart({
|
|
157
|
+
options = {},
|
|
158
|
+
series,
|
|
159
|
+
colors,
|
|
160
|
+
mutedColors,
|
|
161
|
+
valueFormatter = (value) => new Intl.NumberFormat("pt-BR", {
|
|
162
|
+
style: "currency",
|
|
163
|
+
currency: "BRL"
|
|
164
|
+
}).format(value),
|
|
165
|
+
ariaLabel = "Gr\xE1fico de distribui\xE7\xE3o",
|
|
166
|
+
className,
|
|
167
|
+
chartClassName,
|
|
168
|
+
responsiveHeight = false,
|
|
169
|
+
highContrastOverride,
|
|
170
|
+
...rest
|
|
171
|
+
}) {
|
|
191
172
|
const storedHighContrast = useHighContrastPreference();
|
|
192
|
-
const highContrast = highContrastOverride
|
|
173
|
+
const highContrast = highContrastOverride ?? storedHighContrast;
|
|
193
174
|
const [selectedIndex, setSelectedIndex] = useState3(null);
|
|
194
175
|
const [legendSelectedIndex, setLegendSelectedIndex] = useState3(
|
|
195
176
|
null
|
|
@@ -197,12 +178,9 @@ function InteractiveDonutChart(_a) {
|
|
|
197
178
|
const containerRef = useRef(null);
|
|
198
179
|
const instructionsId = useId();
|
|
199
180
|
const chartTheme = getChartTheme();
|
|
200
|
-
const baseColors = !highContrast &&
|
|
201
|
-
const neutralColors = !highContrast &&
|
|
202
|
-
const labels = useMemo(() =>
|
|
203
|
-
var _a3;
|
|
204
|
-
return (_a3 = options.labels) != null ? _a3 : [];
|
|
205
|
-
}, [options.labels]);
|
|
181
|
+
const baseColors = !highContrast && colors?.length ? colors : chartTheme.donutSeries;
|
|
182
|
+
const neutralColors = !highContrast && mutedColors?.length ? mutedColors : chartTheme.mutedSeries;
|
|
183
|
+
const labels = useMemo(() => options.labels ?? [], [options.labels]);
|
|
206
184
|
useEffect3(() => {
|
|
207
185
|
setSelectedIndex(
|
|
208
186
|
(current) => current !== null && current >= series.length ? null : current
|
|
@@ -213,8 +191,7 @@ function InteractiveDonutChart(_a) {
|
|
|
213
191
|
}, [series.length]);
|
|
214
192
|
useEffect3(() => {
|
|
215
193
|
const resetOnOutsideClick = (event) => {
|
|
216
|
-
|
|
217
|
-
if ((_a3 = containerRef.current) == null ? void 0 : _a3.contains(event.target)) return;
|
|
194
|
+
if (containerRef.current?.contains(event.target)) return;
|
|
218
195
|
setSelectedIndex(null);
|
|
219
196
|
setLegendSelectedIndex(null);
|
|
220
197
|
};
|
|
@@ -279,11 +256,10 @@ function InteractiveDonutChart(_a) {
|
|
|
279
256
|
};
|
|
280
257
|
}, [responsiveHeight, rest.height, series.length]);
|
|
281
258
|
const donutSizeRatio = useMemo(() => {
|
|
282
|
-
|
|
283
|
-
const size = (_d2 = (_c2 = (_b3 = (_a3 = options.plotOptions) == null ? void 0 : _a3.pie) == null ? void 0 : _b3.donut) == null ? void 0 : _c2.size) != null ? _d2 : "65%";
|
|
259
|
+
const size = options.plotOptions?.pie?.donut?.size ?? "65%";
|
|
284
260
|
const parsed = parseFloat(String(size));
|
|
285
261
|
return Number.isFinite(parsed) ? parsed / 100 : 0.65;
|
|
286
|
-
}, [
|
|
262
|
+
}, [options.plotOptions?.pie?.donut?.size]);
|
|
287
263
|
const displayColors = resolveInteractiveDonutColors({
|
|
288
264
|
count: series.length,
|
|
289
265
|
colors: baseColors,
|
|
@@ -291,14 +267,14 @@ function InteractiveDonutChart(_a) {
|
|
|
291
267
|
selectedIndex
|
|
292
268
|
});
|
|
293
269
|
const legendValue = legendSelectedIndex !== null ? {
|
|
294
|
-
label:
|
|
295
|
-
value: Number(
|
|
270
|
+
label: labels[legendSelectedIndex] ?? `Categoria ${legendSelectedIndex + 1}`,
|
|
271
|
+
value: Number(series[legendSelectedIndex] ?? 0)
|
|
296
272
|
} : null;
|
|
297
273
|
const interactiveOptions = useMemo(() => {
|
|
298
|
-
|
|
299
|
-
const
|
|
300
|
-
|
|
301
|
-
|
|
274
|
+
const originalSelection = options.chart?.events?.dataPointSelection;
|
|
275
|
+
const originalLegendClick = options.chart?.events?.legendClick;
|
|
276
|
+
return {
|
|
277
|
+
...options,
|
|
302
278
|
colors: displayColors,
|
|
303
279
|
fill: highContrast ? {
|
|
304
280
|
type: "pattern",
|
|
@@ -314,61 +290,70 @@ function InteractiveDonutChart(_a) {
|
|
|
314
290
|
height: 6,
|
|
315
291
|
strokeWidth: 2
|
|
316
292
|
}
|
|
317
|
-
} :
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
293
|
+
} : {
|
|
294
|
+
...options.fill,
|
|
295
|
+
type: options.fill?.type ?? "solid",
|
|
296
|
+
opacity: options.fill?.opacity ?? 1
|
|
297
|
+
},
|
|
298
|
+
stroke: highContrast ? { ...options.stroke, colors: ["#ffffff"], width: 2 } : options.stroke,
|
|
299
|
+
chart: {
|
|
300
|
+
...options.chart,
|
|
301
|
+
events: {
|
|
302
|
+
...options.chart?.events,
|
|
324
303
|
dataPointSelection(event, chart, config) {
|
|
325
|
-
originalSelection
|
|
326
|
-
const nextIndex = Number(config
|
|
304
|
+
originalSelection?.(event, chart, config);
|
|
305
|
+
const nextIndex = Number(config?.dataPointIndex);
|
|
327
306
|
if (!Number.isInteger(nextIndex) || nextIndex < 0) return;
|
|
328
307
|
setSelectedIndex(
|
|
329
308
|
(current) => current === nextIndex ? null : nextIndex
|
|
330
309
|
);
|
|
331
310
|
},
|
|
332
311
|
legendClick(chartContext, seriesIndex, config) {
|
|
333
|
-
originalLegendClick
|
|
312
|
+
originalLegendClick?.(chartContext, seriesIndex, config);
|
|
334
313
|
if (typeof seriesIndex !== "number" || seriesIndex < 0) return;
|
|
335
314
|
setLegendSelectedIndex(
|
|
336
315
|
(current) => current === seriesIndex ? null : seriesIndex
|
|
337
316
|
);
|
|
338
317
|
}
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
legend:
|
|
342
|
-
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
legend: {
|
|
321
|
+
...options.legend,
|
|
322
|
+
labels: {
|
|
323
|
+
...options.legend?.labels,
|
|
343
324
|
colors: chartTheme.axis
|
|
344
|
-
}
|
|
345
|
-
onItemClick:
|
|
325
|
+
},
|
|
326
|
+
onItemClick: {
|
|
327
|
+
...options.legend?.onItemClick,
|
|
346
328
|
toggleDataSeries: false
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
states:
|
|
350
|
-
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
states: {
|
|
332
|
+
...options.states,
|
|
333
|
+
hover: {
|
|
334
|
+
...options.states?.hover,
|
|
351
335
|
filter: { type: "none" }
|
|
352
|
-
}
|
|
353
|
-
active:
|
|
336
|
+
},
|
|
337
|
+
active: {
|
|
338
|
+
...options.states?.active,
|
|
354
339
|
allowMultipleDataPointsSelection: false,
|
|
355
340
|
filter: { type: "none" }
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
tooltip:
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
tooltip: {
|
|
344
|
+
...options.tooltip,
|
|
359
345
|
enabled: true,
|
|
360
346
|
followCursor: true,
|
|
361
347
|
custom({ series: tooltipSeries, seriesIndex }) {
|
|
362
|
-
|
|
363
|
-
const value = Number((_a4 = tooltipSeries == null ? void 0 : tooltipSeries[seriesIndex]) != null ? _a4 : 0);
|
|
348
|
+
const value = Number(tooltipSeries?.[seriesIndex] ?? 0);
|
|
364
349
|
const label = escapeDonutTooltipText(
|
|
365
|
-
|
|
350
|
+
labels[seriesIndex] ?? `Categoria ${seriesIndex + 1}`
|
|
366
351
|
);
|
|
367
352
|
const formattedValue = escapeDonutTooltipText(valueFormatter(value));
|
|
368
353
|
return `<div class="donut-chart-tooltip"><span class="donut-chart-tooltip-label">${label}</span><strong class="donut-chart-tooltip-value">${formattedValue}</strong></div>`;
|
|
369
354
|
}
|
|
370
|
-
}
|
|
371
|
-
}
|
|
355
|
+
}
|
|
356
|
+
};
|
|
372
357
|
}, [
|
|
373
358
|
chartTheme.axis,
|
|
374
359
|
displayColors,
|
|
@@ -377,10 +362,10 @@ function InteractiveDonutChart(_a) {
|
|
|
377
362
|
options,
|
|
378
363
|
valueFormatter
|
|
379
364
|
]);
|
|
380
|
-
const selectedLabel = selectedIndex === null ? "Nenhuma categoria selecionada" : `${
|
|
381
|
-
Number(
|
|
365
|
+
const selectedLabel = selectedIndex === null ? "Nenhuma categoria selecionada" : `${labels[selectedIndex] ?? `Categoria ${selectedIndex + 1}`}: ${valueFormatter(
|
|
366
|
+
Number(series[selectedIndex] ?? 0)
|
|
382
367
|
)}`;
|
|
383
|
-
const legendValueLabel = legendSelectedIndex === null ? "" : `Valor em destaque: ${
|
|
368
|
+
const legendValueLabel = legendSelectedIndex === null ? "" : `Valor em destaque: ${labels[legendSelectedIndex] ?? `Categoria ${legendSelectedIndex + 1}`}: ${valueFormatter(Number(series[legendSelectedIndex] ?? 0))}`;
|
|
384
369
|
const handleKeyDown = (event) => {
|
|
385
370
|
if (["ArrowRight", "ArrowDown", "ArrowLeft", "ArrowUp"].includes(event.key)) {
|
|
386
371
|
event.preventDefault();
|
|
@@ -407,17 +392,18 @@ function InteractiveDonutChart(_a) {
|
|
|
407
392
|
"aria-label": ariaLabel,
|
|
408
393
|
"aria-describedby": instructionsId,
|
|
409
394
|
onKeyDown: handleKeyDown,
|
|
410
|
-
className: `chart-keyboard-focus-ring relative min-w-0 rounded-sm ${className
|
|
395
|
+
className: `chart-keyboard-focus-ring relative min-w-0 rounded-sm ${className ?? ""}`.trim(),
|
|
411
396
|
children: [
|
|
412
397
|
/* @__PURE__ */ jsx2(
|
|
413
398
|
LazyApexChart,
|
|
414
|
-
|
|
399
|
+
{
|
|
400
|
+
...rest,
|
|
415
401
|
className: chartClassName,
|
|
416
402
|
height: responsiveHeight && measuredChartHeight ? measuredChartHeight : rest.height,
|
|
417
403
|
options: interactiveOptions,
|
|
418
404
|
series,
|
|
419
405
|
type: "donut"
|
|
420
|
-
}
|
|
406
|
+
},
|
|
421
407
|
highContrast ? "donut-high-contrast" : "donut-standard"
|
|
422
408
|
),
|
|
423
409
|
legendValue && pieCircle && /* @__PURE__ */ jsxs(
|
|
@@ -448,25 +434,17 @@ function InteractiveDonutChart(_a) {
|
|
|
448
434
|
// src/components/chart/TimeSeriesChart.tsx
|
|
449
435
|
import { useEffect as useEffect4, useRef as useRef2, useState as useState4 } from "react";
|
|
450
436
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
451
|
-
function TimeSeriesChart(
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
"options",
|
|
461
|
-
"ariaLabel",
|
|
462
|
-
"className",
|
|
463
|
-
"chartClassName",
|
|
464
|
-
"responsiveHeight",
|
|
465
|
-
"highContrastOverride"
|
|
466
|
-
]);
|
|
467
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
437
|
+
function TimeSeriesChart({
|
|
438
|
+
options,
|
|
439
|
+
ariaLabel,
|
|
440
|
+
className,
|
|
441
|
+
chartClassName,
|
|
442
|
+
responsiveHeight = false,
|
|
443
|
+
highContrastOverride,
|
|
444
|
+
...chartProps
|
|
445
|
+
}) {
|
|
468
446
|
const storedHighContrast = useHighContrastPreference();
|
|
469
|
-
const highContrast = highContrastOverride
|
|
447
|
+
const highContrast = highContrastOverride ?? storedHighContrast;
|
|
470
448
|
const theme = getChartTheme();
|
|
471
449
|
const containerRef = useRef2(null);
|
|
472
450
|
const [measuredHeight, setMeasuredHeight] = useState4(null);
|
|
@@ -521,7 +499,7 @@ function TimeSeriesChart(_a) {
|
|
|
521
499
|
const renderedHeight = responsiveHeight && measuredHeight ? measuredHeight : chartProps.height;
|
|
522
500
|
const renderedWidth = responsiveHeight && measuredWidth ? measuredWidth : chartProps.width;
|
|
523
501
|
const xAxis = options.xaxis;
|
|
524
|
-
const xAxisCategories = Array.isArray(xAxis
|
|
502
|
+
const xAxisCategories = Array.isArray(xAxis?.categories) ? xAxis.categories : [];
|
|
525
503
|
const availableWidth = typeof renderedWidth === "number" ? renderedWidth : 720;
|
|
526
504
|
const maxVisibleXAxisLabels = Math.max(
|
|
527
505
|
4,
|
|
@@ -534,140 +512,150 @@ function TimeSeriesChart(_a) {
|
|
|
534
512
|
const hasDenseXAxis = xAxisCategories.length > maxVisibleXAxisLabels;
|
|
535
513
|
const xAxisCategoriesKey = JSON.stringify(xAxisCategories);
|
|
536
514
|
const responsiveXAxisFormatter = xAxisCategories.length ? (value, _timestamp, opts) => {
|
|
537
|
-
var _a3, _b3;
|
|
538
515
|
const fallbackIndex = xAxisCategories.findIndex(
|
|
539
516
|
(category) => String(category) === String(value)
|
|
540
517
|
);
|
|
541
|
-
const index =
|
|
518
|
+
const index = opts?.dataPointIndex ?? (fallbackIndex >= 0 ? fallbackIndex : 0);
|
|
542
519
|
const isLast = index === xAxisCategories.length - 1;
|
|
543
|
-
return index % xAxisLabelStep === 0 || isLast ? String(
|
|
544
|
-
} :
|
|
520
|
+
return index % xAxisLabelStep === 0 || isLast ? String(xAxisCategories[index] ?? value) : "";
|
|
521
|
+
} : xAxis?.labels?.formatter;
|
|
545
522
|
const renderKey = [
|
|
546
523
|
themeKey,
|
|
547
|
-
renderedWidth
|
|
548
|
-
renderedHeight
|
|
524
|
+
renderedWidth ?? "auto-width",
|
|
525
|
+
renderedHeight ?? "auto-height",
|
|
549
526
|
xAxisCategoriesKey
|
|
550
527
|
].join("|");
|
|
551
|
-
const yAxis = Array.isArray(options.yaxis) ? options.yaxis.map((axis) => {
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
show: true,
|
|
556
|
-
style: __spreadProps(__spreadValues({
|
|
557
|
-
fontSize: "11px",
|
|
558
|
-
fontWeight: 500
|
|
559
|
-
}, (_a3 = axis.labels) == null ? void 0 : _a3.style), {
|
|
560
|
-
colors: theme.axis
|
|
561
|
-
})
|
|
562
|
-
})
|
|
563
|
-
});
|
|
564
|
-
}) : __spreadProps(__spreadValues({}, options.yaxis), {
|
|
565
|
-
labels: __spreadProps(__spreadValues({}, (_b2 = options.yaxis) == null ? void 0 : _b2.labels), {
|
|
528
|
+
const yAxis = Array.isArray(options.yaxis) ? options.yaxis.map((axis) => ({
|
|
529
|
+
...axis,
|
|
530
|
+
labels: {
|
|
531
|
+
...axis.labels,
|
|
566
532
|
show: true,
|
|
567
|
-
style:
|
|
533
|
+
style: {
|
|
568
534
|
fontSize: "11px",
|
|
569
|
-
fontWeight: 500
|
|
570
|
-
|
|
535
|
+
fontWeight: 500,
|
|
536
|
+
...axis.labels?.style,
|
|
571
537
|
colors: theme.axis
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
})
|
|
575
|
-
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
})) : {
|
|
541
|
+
...options.yaxis,
|
|
542
|
+
labels: {
|
|
543
|
+
...options.yaxis?.labels,
|
|
544
|
+
show: true,
|
|
545
|
+
style: {
|
|
546
|
+
fontSize: "11px",
|
|
547
|
+
fontWeight: 500,
|
|
548
|
+
...options.yaxis?.labels?.style,
|
|
549
|
+
colors: theme.axis
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
const sharedOptions = {
|
|
554
|
+
...options,
|
|
576
555
|
colors: highContrast ? [...theme.series] : options.colors,
|
|
577
|
-
chart:
|
|
556
|
+
chart: {
|
|
578
557
|
toolbar: { show: false },
|
|
579
558
|
zoom: { enabled: false },
|
|
580
559
|
parentHeightOffset: 0,
|
|
581
560
|
redrawOnParentResize: true,
|
|
582
|
-
redrawOnWindowResize: true
|
|
583
|
-
|
|
561
|
+
redrawOnWindowResize: true,
|
|
562
|
+
...options.chart,
|
|
584
563
|
foreColor: theme.axis
|
|
585
|
-
}
|
|
586
|
-
dataLabels:
|
|
587
|
-
enabled: false
|
|
588
|
-
|
|
589
|
-
|
|
564
|
+
},
|
|
565
|
+
dataLabels: {
|
|
566
|
+
enabled: false,
|
|
567
|
+
...options.dataLabels
|
|
568
|
+
},
|
|
569
|
+
grid: {
|
|
590
570
|
show: true,
|
|
591
571
|
borderColor: theme.grid,
|
|
592
|
-
strokeDashArray: 0
|
|
593
|
-
|
|
572
|
+
strokeDashArray: 0,
|
|
573
|
+
...options.grid,
|
|
594
574
|
xaxis: {
|
|
595
|
-
lines:
|
|
596
|
-
|
|
597
|
-
|
|
575
|
+
lines: {
|
|
576
|
+
...options.grid?.xaxis?.lines,
|
|
577
|
+
show: hasDenseXAxis ? false : options.grid?.xaxis?.lines?.show ?? true
|
|
578
|
+
}
|
|
598
579
|
},
|
|
599
580
|
yaxis: {
|
|
600
|
-
lines:
|
|
581
|
+
lines: { show: true, ...options.grid?.yaxis?.lines }
|
|
601
582
|
},
|
|
602
|
-
padding:
|
|
583
|
+
padding: {
|
|
603
584
|
top: 0,
|
|
604
585
|
right: 8,
|
|
605
586
|
bottom: 8,
|
|
606
|
-
left: 8
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
587
|
+
left: 8,
|
|
588
|
+
...options.grid?.padding
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
stroke: {
|
|
610
592
|
width: 2,
|
|
611
|
-
curve: "straight"
|
|
612
|
-
|
|
613
|
-
colors: highContrast ? [...theme.series] :
|
|
614
|
-
dashArray: highContrast ? [0, 6, 2, 8, 4, 10, 1, 7, 3, 9, 5, 11] :
|
|
615
|
-
}
|
|
616
|
-
markers:
|
|
593
|
+
curve: "straight",
|
|
594
|
+
...options.stroke,
|
|
595
|
+
colors: highContrast ? [...theme.series] : options.stroke?.colors,
|
|
596
|
+
dashArray: highContrast ? [0, 6, 2, 8, 4, 10, 1, 7, 3, 9, 5, 11] : options.stroke?.dashArray ?? 0
|
|
597
|
+
},
|
|
598
|
+
markers: {
|
|
617
599
|
strokeWidth: 1,
|
|
618
|
-
strokeColors: [theme.surface]
|
|
619
|
-
|
|
620
|
-
size: highContrast ? 4 :
|
|
621
|
-
hover:
|
|
622
|
-
}
|
|
623
|
-
annotations: highContrast ?
|
|
624
|
-
|
|
600
|
+
strokeColors: [theme.surface],
|
|
601
|
+
...options.markers,
|
|
602
|
+
size: highContrast ? 4 : options.markers?.size ?? 3,
|
|
603
|
+
hover: { size: 4, ...options.markers?.hover }
|
|
604
|
+
},
|
|
605
|
+
annotations: highContrast ? {
|
|
606
|
+
...options.annotations,
|
|
607
|
+
xaxis: options.annotations?.xaxis?.map((annotation, index) => ({
|
|
608
|
+
...annotation,
|
|
625
609
|
fillColor: theme.series[index % theme.series.length],
|
|
626
610
|
opacity: 0.28
|
|
627
611
|
}))
|
|
628
|
-
}
|
|
629
|
-
xaxis:
|
|
612
|
+
} : options.annotations,
|
|
613
|
+
xaxis: {
|
|
630
614
|
tooltip: { enabled: false },
|
|
631
|
-
axisBorder: { color: theme.axisBorder }
|
|
632
|
-
|
|
633
|
-
tickAmount: xAxisCategories.length ? void 0 : xAxis
|
|
634
|
-
axisTicks:
|
|
635
|
-
color: theme.axisBorder
|
|
636
|
-
|
|
637
|
-
show: hasDenseXAxis ? false :
|
|
638
|
-
}
|
|
639
|
-
labels:
|
|
615
|
+
axisBorder: { color: theme.axisBorder },
|
|
616
|
+
...xAxis,
|
|
617
|
+
tickAmount: xAxisCategories.length ? void 0 : xAxis?.tickAmount,
|
|
618
|
+
axisTicks: {
|
|
619
|
+
color: theme.axisBorder,
|
|
620
|
+
...xAxis?.axisTicks,
|
|
621
|
+
show: hasDenseXAxis ? false : xAxis?.axisTicks?.show ?? true
|
|
622
|
+
},
|
|
623
|
+
labels: {
|
|
624
|
+
...xAxis?.labels,
|
|
640
625
|
show: true,
|
|
641
626
|
formatter: responsiveXAxisFormatter,
|
|
642
|
-
style:
|
|
627
|
+
style: {
|
|
643
628
|
fontSize: "11px",
|
|
644
|
-
fontWeight: 500
|
|
645
|
-
|
|
629
|
+
fontWeight: 500,
|
|
630
|
+
...xAxis?.labels?.style,
|
|
646
631
|
colors: theme.axis
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
}
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
},
|
|
650
635
|
yaxis: yAxis,
|
|
651
|
-
tooltip:
|
|
636
|
+
tooltip: {
|
|
652
637
|
shared: true,
|
|
653
638
|
intersect: false,
|
|
654
|
-
followCursor: true
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
639
|
+
followCursor: true,
|
|
640
|
+
...options.tooltip
|
|
641
|
+
},
|
|
642
|
+
legend: {
|
|
643
|
+
...options.legend,
|
|
644
|
+
labels: {
|
|
645
|
+
...options.legend?.labels,
|
|
658
646
|
colors: theme.axis
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
noData:
|
|
662
|
-
text: "Nenhum dado dispon\xEDvel no per\xEDodo selecionado"
|
|
663
|
-
|
|
664
|
-
style:
|
|
665
|
-
fontSize: "15px"
|
|
666
|
-
|
|
647
|
+
}
|
|
648
|
+
},
|
|
649
|
+
noData: {
|
|
650
|
+
text: "Nenhum dado dispon\xEDvel no per\xEDodo selecionado",
|
|
651
|
+
...options.noData,
|
|
652
|
+
style: {
|
|
653
|
+
fontSize: "15px",
|
|
654
|
+
...options.noData?.style,
|
|
667
655
|
color: theme.axis
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
}
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
};
|
|
671
659
|
return /* @__PURE__ */ jsx3(
|
|
672
660
|
"div",
|
|
673
661
|
{
|
|
@@ -677,12 +665,13 @@ function TimeSeriesChart(_a) {
|
|
|
677
665
|
className,
|
|
678
666
|
children: /* @__PURE__ */ jsx3(
|
|
679
667
|
LazyApexChart,
|
|
680
|
-
|
|
668
|
+
{
|
|
669
|
+
...chartProps,
|
|
681
670
|
className: chartClassName,
|
|
682
671
|
width: renderedWidth,
|
|
683
672
|
height: renderedHeight,
|
|
684
673
|
options: sharedOptions
|
|
685
|
-
}
|
|
674
|
+
},
|
|
686
675
|
renderKey
|
|
687
676
|
)
|
|
688
677
|
}
|
|
@@ -703,7 +692,7 @@ function TimeRangeSelector({
|
|
|
703
692
|
{
|
|
704
693
|
role: "group",
|
|
705
694
|
"aria-label": ariaLabel,
|
|
706
|
-
className: `flex min-w-0 flex-wrap justify-start gap-1.5 ${className
|
|
695
|
+
className: `flex min-w-0 flex-wrap justify-start gap-1.5 ${className ?? ""}`.trim(),
|
|
707
696
|
children: options.map((range) => {
|
|
708
697
|
const isSelected = selected === range;
|
|
709
698
|
return /* @__PURE__ */ jsx4(
|
|
@@ -731,14 +720,14 @@ var TOOLTIP_ENTITIES2 = {
|
|
|
731
720
|
"'": "'"
|
|
732
721
|
};
|
|
733
722
|
function escapeTimeSeriesTooltipText(value) {
|
|
734
|
-
return String(value
|
|
723
|
+
return String(value ?? "").replace(
|
|
735
724
|
/[&<>"']/g,
|
|
736
725
|
(character) => TOOLTIP_ENTITIES2[character]
|
|
737
726
|
);
|
|
738
727
|
}
|
|
739
728
|
var SAFE_TOOLTIP_COLOR = /^(?:#[\da-f]{3,8}|rgba?\([\d\s.,%]+\)|hsla?\([\d\s.,%]+\)|var\(--[\w-]+\)|[a-z]+)$/i;
|
|
740
729
|
function normalizeTimeSeriesTooltipColor(value) {
|
|
741
|
-
const color = String(value
|
|
730
|
+
const color = String(value ?? "").trim();
|
|
742
731
|
return SAFE_TOOLTIP_COLOR.test(color) ? color : "currentColor";
|
|
743
732
|
}
|
|
744
733
|
function buildTimeSeriesTooltip({
|
|
@@ -766,4 +755,4 @@ export {
|
|
|
766
755
|
normalizeTimeSeriesTooltipColor,
|
|
767
756
|
buildTimeSeriesTooltip
|
|
768
757
|
};
|
|
769
|
-
//# sourceMappingURL=chunk-
|
|
758
|
+
//# sourceMappingURL=chunk-5MRS4PDD.js.map
|