@plenustech/design-system 0.2.3 → 0.2.5
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 +8 -0
- package/dist/components/actions/ButtonTile/ButtonTile.module.css.cjs +1 -1
- package/dist/components/actions/ButtonTile/ButtonTile.module.css.js +10 -10
- package/dist/components/actions/Toolbar/Toolbar.cjs +1 -1
- package/dist/components/actions/Toolbar/Toolbar.cjs.map +1 -1
- package/dist/components/actions/Toolbar/Toolbar.js +64 -53
- package/dist/components/actions/Toolbar/Toolbar.js.map +1 -1
- package/dist/components/charts/ChartGauge/ChartGauge.cjs +2 -0
- package/dist/components/charts/ChartGauge/ChartGauge.cjs.map +1 -0
- package/dist/components/charts/ChartGauge/ChartGauge.js +307 -0
- package/dist/components/charts/ChartGauge/ChartGauge.js.map +1 -0
- package/dist/components/charts/ChartGauge/ChartGauge.module.css.cjs +2 -0
- package/dist/components/charts/ChartGauge/ChartGauge.module.css.cjs.map +1 -0
- package/dist/components/charts/ChartGauge/ChartGauge.module.css.js +76 -0
- package/dist/components/charts/ChartGauge/ChartGauge.module.css.js.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeLayout.cjs +2 -0
- package/dist/components/charts/ChartGauge/gaugeLayout.cjs.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeLayout.js +107 -0
- package/dist/components/charts/ChartGauge/gaugeLayout.js.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeReading.cjs +2 -0
- package/dist/components/charts/ChartGauge/gaugeReading.cjs.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeReading.js +112 -0
- package/dist/components/charts/ChartGauge/gaugeReading.js.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeScale.cjs +2 -0
- package/dist/components/charts/ChartGauge/gaugeScale.cjs.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeScale.js +57 -0
- package/dist/components/charts/ChartGauge/gaugeScale.js.map +1 -0
- package/dist/components/charts/ChartMap/ChartMap.cjs +2 -0
- package/dist/components/charts/ChartMap/ChartMap.cjs.map +1 -0
- package/dist/components/charts/ChartMap/ChartMap.js +523 -0
- package/dist/components/charts/ChartMap/ChartMap.js.map +1 -0
- package/dist/components/charts/ChartMap/ChartMap.module.css.cjs +2 -0
- package/dist/components/charts/ChartMap/ChartMap.module.css.cjs.map +1 -0
- package/dist/components/charts/ChartMap/ChartMap.module.css.js +124 -0
- package/dist/components/charts/ChartMap/ChartMap.module.css.js.map +1 -0
- package/dist/components/charts/ChartMap/ChartMapLegend.cjs +2 -0
- package/dist/components/charts/ChartMap/ChartMapLegend.cjs.map +1 -0
- package/dist/components/charts/ChartMap/ChartMapLegend.js +102 -0
- package/dist/components/charts/ChartMap/ChartMapLegend.js.map +1 -0
- package/dist/components/charts/ChartMap/ChartMapTable.cjs +2 -0
- package/dist/components/charts/ChartMap/ChartMapTable.cjs.map +1 -0
- package/dist/components/charts/ChartMap/ChartMapTable.js +118 -0
- package/dist/components/charts/ChartMap/ChartMapTable.js.map +1 -0
- package/dist/components/charts/ChartMap/mapGeometry.cjs +2 -0
- package/dist/components/charts/ChartMap/mapGeometry.cjs.map +1 -0
- package/dist/components/charts/ChartMap/mapGeometry.js +113 -0
- package/dist/components/charts/ChartMap/mapGeometry.js.map +1 -0
- package/dist/components/charts/ChartMap/mapLabels.cjs +2 -0
- package/dist/components/charts/ChartMap/mapLabels.cjs.map +1 -0
- package/dist/components/charts/ChartMap/mapLabels.js +80 -0
- package/dist/components/charts/ChartMap/mapLabels.js.map +1 -0
- package/dist/components/charts/ChartMap/mapScales.cjs +2 -0
- package/dist/components/charts/ChartMap/mapScales.cjs.map +1 -0
- package/dist/components/charts/ChartMap/mapScales.js +131 -0
- package/dist/components/charts/ChartMap/mapScales.js.map +1 -0
- package/dist/components/charts/ChartMap/polylabel.cjs +2 -0
- package/dist/components/charts/ChartMap/polylabel.cjs.map +1 -0
- package/dist/components/charts/ChartMap/polylabel.js +50 -0
- package/dist/components/charts/ChartMap/polylabel.js.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.cjs +2 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.js +703 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.js.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.module.css.cjs +2 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.module.css.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.module.css.js +124 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.module.css.js.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimelineTable.cjs +2 -0
- package/dist/components/charts/ChartTimeline/ChartTimelineTable.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimelineTable.js +42 -0
- package/dist/components/charts/ChartTimeline/ChartTimelineTable.js.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineLayout.cjs +2 -0
- package/dist/components/charts/ChartTimeline/timelineLayout.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineLayout.js +109 -0
- package/dist/components/charts/ChartTimeline/timelineLayout.js.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineTime.cjs +2 -0
- package/dist/components/charts/ChartTimeline/timelineTime.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineTime.js +91 -0
- package/dist/components/charts/ChartTimeline/timelineTime.js.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineTooltip.cjs +2 -0
- package/dist/components/charts/ChartTimeline/timelineTooltip.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineTooltip.js +77 -0
- package/dist/components/charts/ChartTimeline/timelineTooltip.js.map +1 -0
- package/dist/components/charts/core/ChartLegend.cjs +1 -1
- package/dist/components/charts/core/ChartLegend.cjs.map +1 -1
- package/dist/components/charts/core/ChartLegend.js +37 -25
- package/dist/components/charts/core/ChartLegend.js.map +1 -1
- package/dist/components/charts/core/useChartMetrics.cjs +1 -1
- package/dist/components/charts/core/useChartMetrics.cjs.map +1 -1
- package/dist/components/charts/core/useChartMetrics.js +20 -25
- package/dist/components/charts/core/useChartMetrics.js.map +1 -1
- package/dist/components/data-display/CodeBlock/syntax.cjs +10 -3
- package/dist/components/data-display/CodeBlock/syntax.cjs.map +1 -1
- package/dist/components/data-display/CodeBlock/syntax.js +68 -48
- package/dist/components/data-display/CodeBlock/syntax.js.map +1 -1
- package/dist/components/data-display/List/List.cjs.map +1 -1
- package/dist/components/data-display/List/List.js.map +1 -1
- package/dist/components/data-display/List/List.module.css.cjs +1 -1
- package/dist/components/data-display/List/List.module.css.js +34 -24
- package/dist/components/data-display/List/List.module.css.js.map +1 -1
- package/dist/components/data-display/List/ListingOptions.cjs +1 -1
- package/dist/components/data-display/List/ListingOptions.cjs.map +1 -1
- package/dist/components/data-display/List/ListingOptions.js +98 -74
- package/dist/components/data-display/List/ListingOptions.js.map +1 -1
- package/dist/components/data-display/List/useListing.cjs.map +1 -1
- package/dist/components/data-display/List/useListing.js.map +1 -1
- package/dist/components/data-display/Timeline/Timeline.cjs +1 -1
- package/dist/components/data-display/Timeline/Timeline.cjs.map +1 -1
- package/dist/components/data-display/Timeline/Timeline.js +6 -6
- package/dist/components/data-display/Timeline/Timeline.js.map +1 -1
- package/dist/components/data-display/Timeline/Timeline.module.css.cjs +1 -1
- package/dist/components/data-display/Timeline/Timeline.module.css.js +18 -16
- package/dist/components/data-display/Timeline/Timeline.module.css.js.map +1 -1
- package/dist/components/forms/Checkbox/Checkbox.module.css.cjs +1 -1
- package/dist/components/forms/Checkbox/Checkbox.module.css.js +5 -5
- package/dist/components/forms/CheckboxGroup/CheckboxGroup.module.css.cjs +1 -1
- package/dist/components/forms/CheckboxGroup/CheckboxGroup.module.css.js +1 -1
- package/dist/components/forms/ComboBox/ComboBox.cjs.map +1 -1
- package/dist/components/forms/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/forms/Field/Field.cjs +1 -1
- package/dist/components/forms/Field/Field.cjs.map +1 -1
- package/dist/components/forms/Field/Field.js +22 -22
- package/dist/components/forms/Field/Field.js.map +1 -1
- package/dist/components/forms/Field/Field.module.css.cjs +1 -1
- package/dist/components/forms/Field/Field.module.css.js +19 -17
- package/dist/components/forms/Field/Field.module.css.js.map +1 -1
- package/dist/components/forms/InputText/InputText.cjs +1 -1
- package/dist/components/forms/InputText/InputText.cjs.map +1 -1
- package/dist/components/forms/InputText/InputText.js +24 -24
- package/dist/components/forms/InputText/InputText.js.map +1 -1
- package/dist/components/forms/InputText/InputText.module.css.cjs +1 -1
- package/dist/components/forms/InputText/InputText.module.css.js +9 -7
- package/dist/components/forms/InputText/InputText.module.css.js.map +1 -1
- package/dist/components/forms/RadioGroup/RadioGroup.module.css.cjs +1 -1
- package/dist/components/forms/RadioGroup/RadioGroup.module.css.js +4 -4
- package/dist/components/forms/Select/Select.cjs.map +1 -1
- package/dist/components/forms/Select/Select.js.map +1 -1
- package/dist/components/forms/Switch/Switch.module.css.cjs +1 -1
- package/dist/components/forms/Switch/Switch.module.css.js +6 -6
- package/dist/components/icons/suite.cjs +1 -0
- package/dist/components/icons/suite.js +10894 -0
- package/dist/components/navigation/Pagination/Pagination.cjs +1 -1
- package/dist/components/navigation/Pagination/Pagination.cjs.map +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +71 -44
- package/dist/components/navigation/Pagination/Pagination.js.map +1 -1
- package/dist/components/navigation/Pagination/Pagination.module.css.cjs +1 -1
- package/dist/components/navigation/Pagination/Pagination.module.css.js +18 -14
- package/dist/components/navigation/Pagination/Pagination.module.css.js.map +1 -1
- package/dist/components/navigation/TabsNav/TabsNav.cjs +2 -0
- package/dist/components/navigation/TabsNav/TabsNav.cjs.map +1 -0
- package/dist/components/navigation/TabsNav/TabsNav.js +21 -0
- package/dist/components/navigation/TabsNav/TabsNav.js.map +1 -0
- package/dist/components/navigation/TabsNav/TabsNav.module.css.cjs +2 -0
- package/dist/components/navigation/TabsNav/TabsNav.module.css.cjs.map +1 -0
- package/dist/components/navigation/TabsNav/TabsNav.module.css.js +18 -0
- package/dist/components/navigation/TabsNav/TabsNav.module.css.js.map +1 -0
- package/dist/components/overlays/Dialog/Dialog.cjs.map +1 -1
- package/dist/components/overlays/Dialog/Dialog.js.map +1 -1
- package/dist/components/overlays/Dialog/DialogFrame.cjs +1 -1
- package/dist/components/overlays/Dialog/DialogFrame.cjs.map +1 -1
- package/dist/components/overlays/Dialog/DialogFrame.js +30 -30
- package/dist/components/overlays/Dialog/DialogFrame.js.map +1 -1
- package/dist/components/overlays/Drawer/Drawer.cjs.map +1 -1
- package/dist/components/overlays/Drawer/Drawer.js.map +1 -1
- package/dist/components/overlays/Menu/Menu.cjs +1 -1
- package/dist/components/overlays/Menu/Menu.cjs.map +1 -1
- package/dist/components/overlays/Menu/Menu.js +37 -36
- package/dist/components/overlays/Menu/Menu.js.map +1 -1
- package/dist/components/overlays/Menu/keyShortcuts.cjs +2 -0
- package/dist/components/overlays/Menu/keyShortcuts.cjs.map +1 -0
- package/dist/components/overlays/Menu/keyShortcuts.js +55 -0
- package/dist/components/overlays/Menu/keyShortcuts.js.map +1 -0
- package/dist/components/overlays/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.cjs.map +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +81 -56
- package/dist/components/overlays/Tooltip/Tooltip.js.map +1 -1
- package/dist/design-system.css +1 -1
- package/dist/icons.cjs +2 -0
- package/dist/icons.cjs.map +1 -0
- package/dist/icons.js +2054 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +184 -174
- package/dist/index.js.map +1 -1
- package/dist/types/components/charts/ChartGauge/ChartGauge.d.ts +83 -0
- package/dist/types/components/charts/ChartGauge/gaugeLayout.d.ts +64 -0
- package/dist/types/components/charts/ChartGauge/gaugeReading.d.ts +97 -0
- package/dist/types/components/charts/ChartGauge/gaugeScale.d.ts +38 -0
- package/dist/types/components/charts/ChartGauge/index.d.ts +2 -0
- package/dist/types/components/charts/ChartMap/ChartMap.d.ts +104 -0
- package/dist/types/components/charts/ChartMap/ChartMapLegend.d.ts +44 -0
- package/dist/types/components/charts/ChartMap/ChartMapTable.d.ts +38 -0
- package/dist/types/components/charts/ChartMap/index.d.ts +4 -0
- package/dist/types/components/charts/ChartMap/mapGeometry.d.ts +56 -0
- package/dist/types/components/charts/ChartMap/mapLabels.d.ts +51 -0
- package/dist/types/components/charts/ChartMap/mapScales.d.ts +76 -0
- package/dist/types/components/charts/ChartMap/polylabel.d.ts +9 -0
- package/dist/types/components/charts/ChartTimeline/ChartTimeline.d.ts +137 -0
- package/dist/types/components/charts/ChartTimeline/ChartTimelineTable.d.ts +25 -0
- package/dist/types/components/charts/ChartTimeline/index.d.ts +2 -0
- package/dist/types/components/charts/ChartTimeline/timelineLayout.d.ts +70 -0
- package/dist/types/components/charts/ChartTimeline/timelineTime.d.ts +16 -0
- package/dist/types/components/charts/ChartTimeline/timelineTooltip.d.ts +45 -0
- package/dist/types/components/charts/core/ChartLegend.d.ts +3 -1
- package/dist/types/components/data-display/CodeBlock/syntax.d.ts +1 -1
- package/dist/types/components/data-display/List/List.d.ts +1 -1
- package/dist/types/components/data-display/List/useListing.d.ts +7 -1
- package/dist/types/components/data-display/Timeline/Timeline.d.ts +4 -1
- package/dist/types/components/data-display/Timeline/index.d.ts +1 -1
- package/dist/types/components/forms/ComboBox/ComboBox.d.ts +7 -1
- package/dist/types/components/forms/Field/Field.d.ts +1 -1
- package/dist/types/components/forms/InputText/InputText.d.ts +1 -1
- package/dist/types/components/forms/Select/Select.d.ts +5 -1
- package/dist/types/components/icons/suite.d.ts +2051 -0
- package/dist/types/components/navigation/Pagination/Pagination.d.ts +13 -1
- package/dist/types/components/navigation/Pagination/index.d.ts +1 -1
- package/dist/types/components/navigation/TabsNav/TabsNav.d.ts +20 -0
- package/dist/types/components/navigation/TabsNav/index.d.ts +2 -0
- package/dist/types/components/overlays/Dialog/Dialog.d.ts +19 -7
- package/dist/types/components/overlays/Dialog/DialogFrame.d.ts +8 -2
- package/dist/types/components/overlays/Drawer/Drawer.d.ts +2 -2
- package/dist/types/components/overlays/Menu/Menu.d.ts +3 -1
- package/dist/types/components/overlays/Menu/keyShortcuts.d.ts +2 -0
- package/dist/types/components/overlays/Tooltip/Tooltip.d.ts +26 -5
- package/dist/types/icons.d.ts +6 -0
- package/dist/types/index.d.ts +11 -3
- package/dist/types/utils/formatters/formatarDuracao.d.ts +5 -0
- package/dist/types/utils/formatters/index.d.ts +1 -0
- package/dist/utils/formatters/formatarDuracao.cjs +2 -0
- package/dist/utils/formatters/formatarDuracao.cjs.map +1 -0
- package/dist/utils/formatters/formatarDuracao.js +10 -0
- package/dist/utils/formatters/formatarDuracao.js.map +1 -0
- package/package.json +10 -1
|
@@ -0,0 +1,703 @@
|
|
|
1
|
+
import { jsxs as w, jsx as n, Fragment as kt } from "react/jsx-runtime";
|
|
2
|
+
import { group as so, min as ao, max as io, sum as pt, least as lo } from "d3-array";
|
|
3
|
+
import { useId as Ie, useState as ie, useRef as co, useMemo as mt } from "react";
|
|
4
|
+
import { formatarDuracao as uo } from "../../../utils/formatters/formatarDuracao.js";
|
|
5
|
+
import { ChartTimelineTable as ho } from "./ChartTimelineTable.js";
|
|
6
|
+
import { toRange as gt, toTimelineSegments as ft, statesToSegments as po, layoutTimeline as mo, rowsInDisplayOrder as go } from "./timelineLayout.js";
|
|
7
|
+
import { autoDomain as fo, timeTicks as wo, toPosition as wt, durationMs as yo, toDate as xo, formatPosition as bo } from "./timelineTime.js";
|
|
8
|
+
import { timelineTooltip as vo } from "./timelineTooltip.js";
|
|
9
|
+
import r from "./ChartTimeline.module.css.js";
|
|
10
|
+
import { useChartMetrics as yt } from "../core/useChartMetrics.js";
|
|
11
|
+
import { useSeriesToggle as xt } from "../core/useSeriesToggle.js";
|
|
12
|
+
import { resolveSeriesColors as No, INTENT_TOKENS as Mo, textColorOn as To } from "../palette/seriesColor.js";
|
|
13
|
+
import { linearScale as $o } from "../scales/scales.js";
|
|
14
|
+
import { measureLabel as ce, truncateToWidth as ko } from "../core/measureText.js";
|
|
15
|
+
import { Grid as Oo } from "../core/Grid.js";
|
|
16
|
+
import { CHART_LABEL_OFFSET as bt } from "../core/spacing.js";
|
|
17
|
+
import { ChartTooltip as Lo } from "../ChartTooltip/ChartTooltip.js";
|
|
18
|
+
import { ChartLegend as Ro } from "../core/ChartLegend.js";
|
|
19
|
+
import { Button as Bo } from "../../actions/Button/Button.js";
|
|
20
|
+
import { EmptyState as Io } from "../../feedback/EmptyState/EmptyState.js";
|
|
21
|
+
import { IconChartBar as So, IconChevronDown as Eo } from "../../icons/icons.js";
|
|
22
|
+
import { roundedBarPath as vt } from "../core/shapes.js";
|
|
23
|
+
import { formatarPercentual as Nt } from "../../../utils/formatters/formatarNumero.js";
|
|
24
|
+
const _o = {
|
|
25
|
+
sm: { bar: 14, row: 26 },
|
|
26
|
+
md: { bar: 20, row: 36 }
|
|
27
|
+
}, Ao = 40, Do = 32, Ho = 3, Co = 28, X = 6, Po = 24, Uo = 6, Fo = 20, V = 6, le = 4, Go = 10, Ko = 14, Wo = 200, Mt = 10, Yo = 22, zo = 12;
|
|
28
|
+
function Tt(h, m, y, b = !0) {
|
|
29
|
+
const g = h ? 0 : y, f = m || !b ? 0 : y;
|
|
30
|
+
return [g, f, f, g];
|
|
31
|
+
}
|
|
32
|
+
function $t({ clippedEnd: h, clippedStart: m }) {
|
|
33
|
+
return m && h ? "começa antes e continua depois do eixo" : m ? "começa antes do eixo" : h ? "continua depois do eixo" : void 0;
|
|
34
|
+
}
|
|
35
|
+
function jo({ height: h, width: m, x: y, y: b }, g) {
|
|
36
|
+
const f = g === "end" ? y + m - 3 : y + 3, u = g === "end" ? f - 4 : f + 4;
|
|
37
|
+
return `M${u},${b + 3}L${f},${b + h / 2}L${u},${b + h - 3}`;
|
|
38
|
+
}
|
|
39
|
+
function Xo(h, m, y, b) {
|
|
40
|
+
if (b !== "hidden") {
|
|
41
|
+
if (ce(h, y) + Mt <= m)
|
|
42
|
+
return h;
|
|
43
|
+
if (!(b === "auto" || m < Yo))
|
|
44
|
+
return ko(h, y, m - Mt) || void 0;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function Vo(h) {
|
|
48
|
+
return `repeating-linear-gradient(45deg, ${h} 0 1.5px, var(--pl-color-surface-muted) 1.5px 4px)`;
|
|
49
|
+
}
|
|
50
|
+
function vr({
|
|
51
|
+
accent: h,
|
|
52
|
+
axisPosition: m = "top",
|
|
53
|
+
bands: y,
|
|
54
|
+
collapsedGroups: b,
|
|
55
|
+
collapsibleGroups: g = !0,
|
|
56
|
+
compactSummary: f = "below",
|
|
57
|
+
defaultCollapsedGroups: u,
|
|
58
|
+
defaultHiddenSeries: S,
|
|
59
|
+
density: Z = "md",
|
|
60
|
+
domain: q,
|
|
61
|
+
emptyMessage: Ot = "Sem dados no período",
|
|
62
|
+
emptyRowLabel: de = "Sem registro",
|
|
63
|
+
formatTick: Lt,
|
|
64
|
+
formatTime: Se,
|
|
65
|
+
formatTooltipValue: Rt,
|
|
66
|
+
formatValue: J = uo,
|
|
67
|
+
groups: Ee = [],
|
|
68
|
+
hiddenSeries: Bt,
|
|
69
|
+
highlightOnHover: It = !1,
|
|
70
|
+
legend: Q = "top",
|
|
71
|
+
legendAlign: St = "left",
|
|
72
|
+
markers: _e,
|
|
73
|
+
mergeConsecutive: Ae = !0,
|
|
74
|
+
minPlotWidth: De = 360,
|
|
75
|
+
onCollapsedGroupsChange: Et,
|
|
76
|
+
onHiddenSeriesChange: _t,
|
|
77
|
+
onSegmentClick: _,
|
|
78
|
+
overlap: He = "stack",
|
|
79
|
+
referenceLines: Ce = [],
|
|
80
|
+
rowBands: Pe,
|
|
81
|
+
rowGap: Ue = 4,
|
|
82
|
+
rowLabelWidth: ue = "auto",
|
|
83
|
+
rowSummary: he,
|
|
84
|
+
rows: pe,
|
|
85
|
+
segmentLabel: At = "duration",
|
|
86
|
+
segmentLabelAlign: me = "center",
|
|
87
|
+
segments: Fe,
|
|
88
|
+
series: A,
|
|
89
|
+
showGrid: Dt = !0,
|
|
90
|
+
showProgress: G = !0,
|
|
91
|
+
showSegmentLabels: Ht = "auto",
|
|
92
|
+
showTooltip: Ct = !0,
|
|
93
|
+
states: D,
|
|
94
|
+
statesEnd: ee,
|
|
95
|
+
timeScale: v = "calendar",
|
|
96
|
+
title: ge,
|
|
97
|
+
xAxis: fe = "visible"
|
|
98
|
+
}) {
|
|
99
|
+
var ht;
|
|
100
|
+
const Ge = Ie(), Ke = Ie(), We = Ie().replace(/[^\w-]/g, ""), H = yt(), te = yt(), we = xt({ defaultHiddenSeries: S, hiddenSeries: Bt, onHiddenSeriesChange: _t }), Ye = xt({
|
|
101
|
+
defaultHiddenSeries: u,
|
|
102
|
+
hiddenSeries: b,
|
|
103
|
+
onHiddenSeriesChange: Et
|
|
104
|
+
}), [K, L] = ie(null), [Pt, ze] = ie(null), [je, ye] = ie(null), [Xe, Ut] = ie(!1), xe = co(/* @__PURE__ */ new Map()), N = _ !== void 0, be = mt(() => No(A, { accent: h }), [h, A]), oe = /* @__PURE__ */ new Map();
|
|
105
|
+
A.forEach((e, o) => {
|
|
106
|
+
oe.has(e.label) || oe.set(e.label, be[o]);
|
|
107
|
+
});
|
|
108
|
+
const E = (e) => oe.get(e), re = (e) => oe.has(e) && !we.isHidden(e), Ft = mt(() => {
|
|
109
|
+
const e = (i) => wt(i, v), o = (Pe ?? []).flatMap((i) => {
|
|
110
|
+
const T = gt(i.start, i.end, v);
|
|
111
|
+
return T ? [{ ...T, row: i.row, series: i.series }] : [];
|
|
112
|
+
}), t = (_e ?? []).flatMap((i) => {
|
|
113
|
+
const T = e(i.time);
|
|
114
|
+
return Number.isFinite(T) ? [{ ...i, position: T }] : [];
|
|
115
|
+
}), s = D ? [] : ft(Fe ?? [], v), l = D ? [...D.map((i) => e(i.time)), ...ee === void 0 ? [] : [e(ee)]] : s.flatMap((i) => [i.start, i.end]), a = q == null ? void 0 : q.map(e), c = a && a[0] < a[1] ? [a[0], a[1]] : fo(
|
|
116
|
+
[
|
|
117
|
+
...l,
|
|
118
|
+
...o.flatMap((i) => [i.start, i.end]),
|
|
119
|
+
...t.map((i) => i.position)
|
|
120
|
+
],
|
|
121
|
+
v
|
|
122
|
+
), d = D ? ft(po(D, ee ?? c[1], Ae, v), v) : s;
|
|
123
|
+
return { allMarkers: t, allRowBands: o, allSegments: d, range: c };
|
|
124
|
+
}, [q, _e, Ae, Pe, Fe, D, ee, v]), { allMarkers: ve, allRowBands: Ve, allSegments: Ze, range: $ } = Ft, C = (e) => yo(e.start, e.end, v), P = (e) => {
|
|
125
|
+
const o = v === "dayHours" && e > 24 ? e - 24 : e;
|
|
126
|
+
return Se ? Se(xo(o, v)) : bo(o, v);
|
|
127
|
+
}, Ne = Ze.filter((e) => re(e.series)), Me = Ve.filter((e) => re(e.series)), qe = ve.filter((e) => re(e.series)), Te = (y ?? []).flatMap((e) => {
|
|
128
|
+
const o = gt(e.start, e.end, v);
|
|
129
|
+
return o && re(e.series) ? [{ ...e, ...o }] : [];
|
|
130
|
+
}), Je = so(Ne, (e) => e.row), Qe = new Set(Ze.map((e) => e.row)), et = /* @__PURE__ */ new Set([
|
|
131
|
+
...Qe,
|
|
132
|
+
...Ve.map((e) => e.row),
|
|
133
|
+
...ve.map((e) => e.row)
|
|
134
|
+
]), tt = pe.length === 0 || et.size === 0, ot = H.width > 0 && H.width < De + Wo, ne = he ? ot ? f : "right" : "none", k = _o[Z], U = ne === "below" ? Math.max(k.row, Ao) : k.row, $e = k.bar + Ho, { height: Gt, items: F } = mo({
|
|
135
|
+
groupHeight: Co,
|
|
136
|
+
groups: Ee,
|
|
137
|
+
isCollapsed: g ? Ye.isHidden : () => !1,
|
|
138
|
+
laneStep: $e,
|
|
139
|
+
overlap: He,
|
|
140
|
+
rowGap: Ue,
|
|
141
|
+
rowHeight: U,
|
|
142
|
+
rows: pe,
|
|
143
|
+
segments: Ne
|
|
144
|
+
}), rt = (e) => [...Je.get(e.key) ?? []].sort((o, t) => o.start - t.start || o.end - t.end), nt = go(pe, Ee), ke = new Map(
|
|
145
|
+
he ? nt.map((e) => [e.key, he(e, rt(e).map((o) => o.source))]) : []
|
|
146
|
+
), Oe = fe === "hidden" ? 0 : Po, W = m === "top", Y = W ? Oe : 0, Kt = Ce.length > 0 || Te.some((e) => e.label), O = Y + (Kt ? Fo : Uo), z = O + Gt, st = z + V + (W ? 0 : Oe), R = Math.max(te.width, De), x = $o({
|
|
147
|
+
domain: { max: $[1], min: $[0] },
|
|
148
|
+
nice: !1,
|
|
149
|
+
range: [Go, R - Ko]
|
|
150
|
+
}), M = x($[0]), B = x($[1]), at = wo($, v, B - M, Lt), se = H.font, Le = H.radius;
|
|
151
|
+
function Wt(e, o, t) {
|
|
152
|
+
const s = x(e.start), l = x(e.end), a = Math.max(s, M), c = Math.min(l, B);
|
|
153
|
+
if (c <= a)
|
|
154
|
+
return;
|
|
155
|
+
const d = c - a > 4 ? 1 : 0;
|
|
156
|
+
return {
|
|
157
|
+
clippedEnd: l > B + 0.5,
|
|
158
|
+
clippedStart: s < M - 0.5,
|
|
159
|
+
height: k.bar,
|
|
160
|
+
row: o,
|
|
161
|
+
segment: e,
|
|
162
|
+
width: Math.max(c - a - d * 2, 2),
|
|
163
|
+
x: a + d,
|
|
164
|
+
y: t + (U - k.bar) / 2 + e.lane * $e
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
const it = new Map(
|
|
168
|
+
F.flatMap(
|
|
169
|
+
(e) => e.kind === "row" ? [
|
|
170
|
+
[
|
|
171
|
+
e.row.key,
|
|
172
|
+
e.segments.flatMap((o) => Wt(o, e.row, O + e.y) ?? [])
|
|
173
|
+
]
|
|
174
|
+
] : []
|
|
175
|
+
)
|
|
176
|
+
), j = [...it.values()].filter((e) => e.length > 0), Re = j.flat(), Yt = Re.some((e) => e.segment.id === je) ? je : (ht = Re[0]) == null ? void 0 : ht.segment.id, I = Re.find((e) => e.segment.id === Pt), lt = It ? (K == null ? void 0 : K.kind) === "segment" ? K.segment.series : I == null ? void 0 : I.segment.series : void 0;
|
|
177
|
+
function zt(e) {
|
|
178
|
+
var o;
|
|
179
|
+
e && (ye(e.segment.id), (o = xe.current.get(e.segment.id)) == null || o.focus());
|
|
180
|
+
}
|
|
181
|
+
function jt(e, o) {
|
|
182
|
+
const t = j.findIndex((d) => d.includes(o)), s = j[t], l = s.indexOf(o);
|
|
183
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
184
|
+
e.preventDefault(), _ == null || _(o.segment.source, o.row);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
const a = (d) => d && lo(d, (i) => Math.abs(i.segment.start - o.segment.start)), c = {
|
|
188
|
+
ArrowDown: a(j[t + 1]),
|
|
189
|
+
ArrowLeft: s[l - 1],
|
|
190
|
+
ArrowRight: s[l + 1],
|
|
191
|
+
ArrowUp: a(j[t - 1]),
|
|
192
|
+
End: s.at(-1),
|
|
193
|
+
Home: s[0]
|
|
194
|
+
};
|
|
195
|
+
e.key in c && (e.preventDefault(), zt(c[e.key]));
|
|
196
|
+
}
|
|
197
|
+
const Xt = (e) => {
|
|
198
|
+
const { row: o, segment: t } = e;
|
|
199
|
+
return [
|
|
200
|
+
o.label,
|
|
201
|
+
t.series,
|
|
202
|
+
t.label !== t.series ? t.label : void 0,
|
|
203
|
+
`${P(t.start)} a ${P(t.end)}`,
|
|
204
|
+
J(C(t)),
|
|
205
|
+
G && t.progress !== void 0 ? `${Nt(t.progress)} concluído` : void 0,
|
|
206
|
+
$t(e)
|
|
207
|
+
].filter(Boolean).join(", ");
|
|
208
|
+
};
|
|
209
|
+
function Vt(e) {
|
|
210
|
+
const { segment: o } = e, t = o.id, s = E(o.series) ?? "currentColor", l = To(s), a = G ? o.progress : void 0, c = Xo(
|
|
211
|
+
At === "label" ? o.label ?? o.series : J(C(o)),
|
|
212
|
+
e.width,
|
|
213
|
+
se,
|
|
214
|
+
Ht
|
|
215
|
+
), d = { center: "middle", end: "end", start: "start" }, i = me === "start" ? e.x + 5 : me === "end" ? e.x + e.width - 5 : e.x + e.width / 2, T = a === void 0 || (i - e.x) / e.width <= a;
|
|
216
|
+
return /* @__PURE__ */ w(
|
|
217
|
+
"g",
|
|
218
|
+
{
|
|
219
|
+
"aria-label": Xt(e),
|
|
220
|
+
className: `${r.segment} ${N ? r.clickable : ""} ${lt !== void 0 && lt !== o.series ? r.dimmed : ""}`,
|
|
221
|
+
onBlur: N ? () => ze(null) : void 0,
|
|
222
|
+
onClick: _ ? () => {
|
|
223
|
+
ye(t), _(o.source, e.row);
|
|
224
|
+
} : void 0,
|
|
225
|
+
onFocus: N ? () => {
|
|
226
|
+
ze(t), ye(t);
|
|
227
|
+
} : void 0,
|
|
228
|
+
onKeyDown: N ? (p) => jt(p, e) : void 0,
|
|
229
|
+
onMouseEnter: () => L({ clip: $t(e), kind: "segment", row: e.row, segment: o }),
|
|
230
|
+
onMouseLeave: () => L(null),
|
|
231
|
+
ref: N ? (p) => {
|
|
232
|
+
p ? xe.current.set(t, p) : xe.current.delete(t);
|
|
233
|
+
} : void 0,
|
|
234
|
+
role: N ? "button" : void 0,
|
|
235
|
+
tabIndex: N ? t === Yt ? 0 : -1 : void 0,
|
|
236
|
+
children: [
|
|
237
|
+
/* @__PURE__ */ n(
|
|
238
|
+
"path",
|
|
239
|
+
{
|
|
240
|
+
className: He === "overlay" ? r.barOverlay : void 0,
|
|
241
|
+
d: vt(
|
|
242
|
+
e.x,
|
|
243
|
+
e.y,
|
|
244
|
+
e.width,
|
|
245
|
+
e.height,
|
|
246
|
+
Tt(e.clippedStart, e.clippedEnd, Le)
|
|
247
|
+
),
|
|
248
|
+
fill: s,
|
|
249
|
+
fillOpacity: a === void 0 ? void 0 : 0.3
|
|
250
|
+
}
|
|
251
|
+
),
|
|
252
|
+
a !== void 0 && a > 0 && /* @__PURE__ */ n(
|
|
253
|
+
"path",
|
|
254
|
+
{
|
|
255
|
+
d: vt(
|
|
256
|
+
e.x,
|
|
257
|
+
e.y,
|
|
258
|
+
Math.max(e.width * a, 2),
|
|
259
|
+
e.height,
|
|
260
|
+
Tt(e.clippedStart, e.clippedEnd, Le, a >= 1)
|
|
261
|
+
),
|
|
262
|
+
fill: s
|
|
263
|
+
}
|
|
264
|
+
),
|
|
265
|
+
e.width >= zo && ["start", "end"].filter((p) => p === "start" ? e.clippedStart : e.clippedEnd).map((p) => /* @__PURE__ */ n("path", { className: r.clipMark, d: jo(e, p), stroke: l }, p)),
|
|
266
|
+
c !== void 0 && /* @__PURE__ */ n(
|
|
267
|
+
"text",
|
|
268
|
+
{
|
|
269
|
+
className: r.segmentLabel,
|
|
270
|
+
dominantBaseline: "central",
|
|
271
|
+
fill: T ? l : "var(--pl-color-text)",
|
|
272
|
+
textAnchor: d[me],
|
|
273
|
+
x: i,
|
|
274
|
+
y: e.y + e.height / 2,
|
|
275
|
+
children: c
|
|
276
|
+
}
|
|
277
|
+
)
|
|
278
|
+
]
|
|
279
|
+
},
|
|
280
|
+
t
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
function Zt(e) {
|
|
284
|
+
const o = O + e.y, { row: t } = e, s = o + (U - k.bar) / 2 - le, l = k.bar + (e.laneCount - 1) * $e + le * 2;
|
|
285
|
+
return /* @__PURE__ */ w("g", { "aria-hidden": "true", children: [
|
|
286
|
+
/* @__PURE__ */ n(
|
|
287
|
+
"rect",
|
|
288
|
+
{
|
|
289
|
+
className: r.track,
|
|
290
|
+
height: l,
|
|
291
|
+
rx: le,
|
|
292
|
+
width: B - M,
|
|
293
|
+
x: M,
|
|
294
|
+
y: s
|
|
295
|
+
}
|
|
296
|
+
),
|
|
297
|
+
Me.filter((a) => a.row === t.key).map((a, c) => {
|
|
298
|
+
const d = Math.max(x(a.start), M), i = Math.min(x(a.end), B);
|
|
299
|
+
return i > d ? /* @__PURE__ */ n(
|
|
300
|
+
"rect",
|
|
301
|
+
{
|
|
302
|
+
fill: E(a.series),
|
|
303
|
+
height: l,
|
|
304
|
+
rx: le,
|
|
305
|
+
width: i - d,
|
|
306
|
+
x: d,
|
|
307
|
+
y: s
|
|
308
|
+
},
|
|
309
|
+
c
|
|
310
|
+
) : null;
|
|
311
|
+
}),
|
|
312
|
+
!et.has(t.key) && /* @__PURE__ */ n("text", { className: r.emptyRowText, dominantBaseline: "central", x: M + 8, y: o + U / 2, children: de }),
|
|
313
|
+
/* @__PURE__ */ n(
|
|
314
|
+
"rect",
|
|
315
|
+
{
|
|
316
|
+
className: r.hoverArea,
|
|
317
|
+
height: e.height,
|
|
318
|
+
onMouseEnter: () => L({
|
|
319
|
+
empty: !Qe.has(t.key),
|
|
320
|
+
kind: "row",
|
|
321
|
+
row: t,
|
|
322
|
+
rowBands: Me.filter((a) => a.row === t.key),
|
|
323
|
+
segments: Je.get(t.key) ?? []
|
|
324
|
+
}),
|
|
325
|
+
onMouseLeave: () => L(null),
|
|
326
|
+
width: R,
|
|
327
|
+
x: 0,
|
|
328
|
+
y: o
|
|
329
|
+
}
|
|
330
|
+
)
|
|
331
|
+
] }, t.key);
|
|
332
|
+
}
|
|
333
|
+
function qt(e, { height: o, row: t, y: s }) {
|
|
334
|
+
if (e.position < $[0] || e.position > $[1])
|
|
335
|
+
return null;
|
|
336
|
+
const l = E(e.series), a = O + s, c = x(e.position), d = a + U / 2, i = e.shape ?? "line";
|
|
337
|
+
return /* @__PURE__ */ w("g", { children: [
|
|
338
|
+
i === "line" && /* @__PURE__ */ n(
|
|
339
|
+
"rect",
|
|
340
|
+
{
|
|
341
|
+
className: r.marker,
|
|
342
|
+
fill: l,
|
|
343
|
+
height: k.bar + 6,
|
|
344
|
+
rx: 1,
|
|
345
|
+
width: 2,
|
|
346
|
+
x: c - 1,
|
|
347
|
+
y: d - k.bar / 2 - 3
|
|
348
|
+
}
|
|
349
|
+
),
|
|
350
|
+
i === "dot" && /* @__PURE__ */ n("circle", { className: r.marker, cx: c, cy: d, fill: l, r: 4 }),
|
|
351
|
+
i === "diamond" && /* @__PURE__ */ n(
|
|
352
|
+
"path",
|
|
353
|
+
{
|
|
354
|
+
className: r.marker,
|
|
355
|
+
d: `M${c},${d - 6}L${c + 6},${d}L${c},${d + 6}L${c - 6},${d}Z`,
|
|
356
|
+
fill: l
|
|
357
|
+
}
|
|
358
|
+
),
|
|
359
|
+
/* @__PURE__ */ n(
|
|
360
|
+
"rect",
|
|
361
|
+
{
|
|
362
|
+
className: r.hoverArea,
|
|
363
|
+
height: o,
|
|
364
|
+
onMouseEnter: () => L({ kind: "marker", marker: e, row: t }),
|
|
365
|
+
onMouseLeave: () => L(null),
|
|
366
|
+
width: 10,
|
|
367
|
+
x: c - 5,
|
|
368
|
+
y: a
|
|
369
|
+
}
|
|
370
|
+
)
|
|
371
|
+
] }, `${t.key}-${ve.indexOf(e)}`);
|
|
372
|
+
}
|
|
373
|
+
function Jt(e) {
|
|
374
|
+
const o = O + e.y, t = o + e.height / 2 - X / 2, s = e.segments.length > 0, l = s ? Math.max(x(ao(e.segments, (p) => p.start) ?? 0), M) : 0, a = s ? Math.min(x(io(e.segments, (p) => p.end) ?? 0), B) : 0, c = e.segments.filter((p) => p.progress !== void 0), d = pt(c, C), i = pt(c, (p) => C(p) * (p.progress ?? 0)), T = Math.max(a - l, 2);
|
|
375
|
+
return /* @__PURE__ */ w("g", { "aria-hidden": "true", children: [
|
|
376
|
+
s && a > l && /* @__PURE__ */ w("g", { className: r.passThrough, children: [
|
|
377
|
+
/* @__PURE__ */ n("rect", { className: r.groupBar, height: X, rx: X / 2, width: T, x: l, y: t }),
|
|
378
|
+
G && i > 0 && d > 0 && /* @__PURE__ */ n(
|
|
379
|
+
"rect",
|
|
380
|
+
{
|
|
381
|
+
className: r.groupProgress,
|
|
382
|
+
height: X,
|
|
383
|
+
rx: X / 2,
|
|
384
|
+
width: Math.max(T * i / d, 2),
|
|
385
|
+
x: l,
|
|
386
|
+
y: t
|
|
387
|
+
}
|
|
388
|
+
)
|
|
389
|
+
] }),
|
|
390
|
+
/* @__PURE__ */ n(
|
|
391
|
+
"rect",
|
|
392
|
+
{
|
|
393
|
+
className: r.hoverArea,
|
|
394
|
+
height: e.height,
|
|
395
|
+
onMouseEnter: () => L({
|
|
396
|
+
collapsed: e.collapsed,
|
|
397
|
+
group: e.group,
|
|
398
|
+
kind: "group",
|
|
399
|
+
rowCount: e.rows.length,
|
|
400
|
+
segments: e.segments
|
|
401
|
+
}),
|
|
402
|
+
onMouseLeave: () => L(null),
|
|
403
|
+
width: R,
|
|
404
|
+
x: 0,
|
|
405
|
+
y: o
|
|
406
|
+
}
|
|
407
|
+
)
|
|
408
|
+
] }, `group-${e.group.key}`);
|
|
409
|
+
}
|
|
410
|
+
const Qt = (e, o) => {
|
|
411
|
+
const t = ce(o, se) / 2;
|
|
412
|
+
return e - t < 0 ? "start" : e + t > R ? "end" : "middle";
|
|
413
|
+
}, ae = W ? Oe - 0.5 : z + V + 0.5, ct = /* @__PURE__ */ w(
|
|
414
|
+
"svg",
|
|
415
|
+
{
|
|
416
|
+
"aria-describedby": N ? Ke : void 0,
|
|
417
|
+
"aria-labelledby": Ge,
|
|
418
|
+
className: r.canvas,
|
|
419
|
+
height: st,
|
|
420
|
+
role: N ? "group" : "img",
|
|
421
|
+
viewBox: `0 0 ${R} ${st}`,
|
|
422
|
+
width: R,
|
|
423
|
+
children: [
|
|
424
|
+
/* @__PURE__ */ n("defs", { children: Te.map((e, o) => /* @__PURE__ */ n(
|
|
425
|
+
"pattern",
|
|
426
|
+
{
|
|
427
|
+
height: 6,
|
|
428
|
+
id: `${We}-${o}`,
|
|
429
|
+
patternTransform: "rotate(45)",
|
|
430
|
+
patternUnits: "userSpaceOnUse",
|
|
431
|
+
width: 6,
|
|
432
|
+
children: /* @__PURE__ */ n("line", { className: r.hatchLine, stroke: E(e.series), x1: 0, x2: 0, y1: 0, y2: 6 })
|
|
433
|
+
},
|
|
434
|
+
o
|
|
435
|
+
)) }),
|
|
436
|
+
F.map((e) => e.kind === "row" ? Zt(e) : null),
|
|
437
|
+
/* @__PURE__ */ n("g", { "aria-hidden": "true", className: r.passThrough, children: Te.map((e, o) => {
|
|
438
|
+
const t = Math.max(x(e.start), M), s = Math.min(x(e.end), B);
|
|
439
|
+
return s <= t ? null : /* @__PURE__ */ w("g", { children: [
|
|
440
|
+
/* @__PURE__ */ n(
|
|
441
|
+
"rect",
|
|
442
|
+
{
|
|
443
|
+
fill: `url(#${We}-${o})`,
|
|
444
|
+
height: z + V - Y,
|
|
445
|
+
width: s - t,
|
|
446
|
+
x: t,
|
|
447
|
+
y: Y
|
|
448
|
+
}
|
|
449
|
+
),
|
|
450
|
+
e.label && ce(e.label, se) + 8 <= s - t && /* @__PURE__ */ n("text", { className: r.bandLabel, x: t + 4, y: O - 7, children: e.label })
|
|
451
|
+
] }, o);
|
|
452
|
+
}) }),
|
|
453
|
+
Dt && /* @__PURE__ */ n("g", { className: r.passThrough, transform: `translate(0 ${Y})`, children: /* @__PURE__ */ n(
|
|
454
|
+
Oo,
|
|
455
|
+
{
|
|
456
|
+
length: z + V - Y,
|
|
457
|
+
lines: at.map((e) => Math.round(x(e.position)) + 0.5),
|
|
458
|
+
orientation: "vertical"
|
|
459
|
+
}
|
|
460
|
+
) }),
|
|
461
|
+
F.map((e) => e.kind === "group" ? Jt(e) : null),
|
|
462
|
+
/* @__PURE__ */ n("g", { children: [...it.values()].flat().map(Vt) }),
|
|
463
|
+
/* @__PURE__ */ n("g", { "aria-hidden": "true", children: F.flatMap(
|
|
464
|
+
(e) => e.kind === "row" ? qe.filter((o) => o.row === e.row.key).map((o) => qt(o, e)) : []
|
|
465
|
+
) }),
|
|
466
|
+
/* @__PURE__ */ n("g", { "aria-hidden": "true", className: r.passThrough, children: Ce.map((e, o) => {
|
|
467
|
+
const t = wt(e.time, v);
|
|
468
|
+
if (!(t >= $[0] && t <= $[1]))
|
|
469
|
+
return null;
|
|
470
|
+
const s = Math.round(x(t)) + 0.5, l = s + 4 + ce(e.label, se) <= R - 2, a = e.intent ? Mo[e.intent] : "var(--pl-color-text-secondary)";
|
|
471
|
+
return /* @__PURE__ */ w("g", { children: [
|
|
472
|
+
/* @__PURE__ */ n(
|
|
473
|
+
"line",
|
|
474
|
+
{
|
|
475
|
+
className: r.referenceLine,
|
|
476
|
+
stroke: a,
|
|
477
|
+
x1: s,
|
|
478
|
+
x2: s,
|
|
479
|
+
y1: O - 16,
|
|
480
|
+
y2: z + V
|
|
481
|
+
}
|
|
482
|
+
),
|
|
483
|
+
/* @__PURE__ */ n(
|
|
484
|
+
"text",
|
|
485
|
+
{
|
|
486
|
+
className: r.referenceLabel,
|
|
487
|
+
textAnchor: l ? "start" : "end",
|
|
488
|
+
x: l ? s + 4 : s - 4,
|
|
489
|
+
y: O - 7,
|
|
490
|
+
children: e.label
|
|
491
|
+
}
|
|
492
|
+
)
|
|
493
|
+
] }, o);
|
|
494
|
+
}) }),
|
|
495
|
+
fe !== "hidden" && /* @__PURE__ */ w("g", { "aria-hidden": "true", className: `${r.passThrough} ${fe === "onHover" ? r.axisOnHover : ""}`, children: [
|
|
496
|
+
/* @__PURE__ */ n("line", { className: r.axisLine, x1: M, x2: B, y1: ae, y2: ae }),
|
|
497
|
+
at.map((e) => /* @__PURE__ */ n(
|
|
498
|
+
"text",
|
|
499
|
+
{
|
|
500
|
+
className: r.axisLabel,
|
|
501
|
+
dominantBaseline: W ? "auto" : "hanging",
|
|
502
|
+
textAnchor: Qt(x(e.position), e.label),
|
|
503
|
+
x: x(e.position),
|
|
504
|
+
y: W ? ae - bt : ae + bt,
|
|
505
|
+
children: e.label
|
|
506
|
+
},
|
|
507
|
+
e.position
|
|
508
|
+
))
|
|
509
|
+
] }),
|
|
510
|
+
I && /* @__PURE__ */ n(
|
|
511
|
+
"rect",
|
|
512
|
+
{
|
|
513
|
+
"aria-hidden": "true",
|
|
514
|
+
className: r.focusRing,
|
|
515
|
+
height: I.height + 6,
|
|
516
|
+
rx: Le,
|
|
517
|
+
width: I.width + 6,
|
|
518
|
+
x: I.x - 3,
|
|
519
|
+
y: I.y - 3
|
|
520
|
+
}
|
|
521
|
+
)
|
|
522
|
+
]
|
|
523
|
+
}
|
|
524
|
+
), eo = vo(K, {
|
|
525
|
+
colorOf: E,
|
|
526
|
+
duration: C,
|
|
527
|
+
emptyRowLabel: de,
|
|
528
|
+
formatDuration: Rt ?? J,
|
|
529
|
+
formatInstant: P,
|
|
530
|
+
seriesOrder: A.map((e) => e.label),
|
|
531
|
+
showProgress: G
|
|
532
|
+
}), Be = R > te.width + 1, to = ue !== "auto" ? r.labelsFixed : ot ? ne === "below" ? r.labelsCompactWithSummary : r.labelsCompact : "", dt = { gap: Ue, paddingTop: O }, oo = /* @__PURE__ */ w("div", { className: r.body, children: [
|
|
533
|
+
/* @__PURE__ */ n(
|
|
534
|
+
Zo,
|
|
535
|
+
{
|
|
536
|
+
className: to,
|
|
537
|
+
collapsibleGroups: g,
|
|
538
|
+
items: F,
|
|
539
|
+
onToggleGroup: Ye.toggle,
|
|
540
|
+
style: { ...dt, width: ue === "auto" ? void 0 : ue },
|
|
541
|
+
summaries: ne === "below" ? ke : void 0
|
|
542
|
+
}
|
|
543
|
+
),
|
|
544
|
+
/* @__PURE__ */ n(
|
|
545
|
+
"div",
|
|
546
|
+
{
|
|
547
|
+
"aria-label": Be && !N ? `${ge}, área rolável de lado` : void 0,
|
|
548
|
+
className: r.scroll,
|
|
549
|
+
ref: te.ref,
|
|
550
|
+
role: Be && !N ? "region" : void 0,
|
|
551
|
+
tabIndex: Be && !N ? 0 : void 0,
|
|
552
|
+
children: te.width > 0 && (Ct ? /* @__PURE__ */ n(Lo, { ...eo, children: ct }) : ct)
|
|
553
|
+
}
|
|
554
|
+
),
|
|
555
|
+
ne === "right" && /* @__PURE__ */ n(
|
|
556
|
+
qo,
|
|
557
|
+
{
|
|
558
|
+
inline: U < Do,
|
|
559
|
+
items: F,
|
|
560
|
+
style: dt,
|
|
561
|
+
summaries: ke
|
|
562
|
+
}
|
|
563
|
+
)
|
|
564
|
+
] });
|
|
565
|
+
function ro() {
|
|
566
|
+
const e = (o, t, s, l) => ({
|
|
567
|
+
color: E(o) ?? "transparent",
|
|
568
|
+
duration: J(C(s)),
|
|
569
|
+
end: P(s.end),
|
|
570
|
+
name: t,
|
|
571
|
+
progress: l === void 0 ? void 0 : Nt(l),
|
|
572
|
+
start: P(s.start)
|
|
573
|
+
});
|
|
574
|
+
return nt.map((o) => ({
|
|
575
|
+
description: o.description,
|
|
576
|
+
entries: [
|
|
577
|
+
...Me.filter((t) => t.row === o.key).map((t) => e(t.series, `${t.series} (referência)`, t)),
|
|
578
|
+
...rt(o).map(
|
|
579
|
+
(t) => e(
|
|
580
|
+
t.series,
|
|
581
|
+
t.label && t.label !== t.series ? `${t.series}: ${t.label}` : t.series,
|
|
582
|
+
t,
|
|
583
|
+
t.progress
|
|
584
|
+
)
|
|
585
|
+
),
|
|
586
|
+
...qe.filter((t) => t.row === o.key).map((t) => ({
|
|
587
|
+
color: E(t.series) ?? "transparent",
|
|
588
|
+
duration: "instante",
|
|
589
|
+
end: "—",
|
|
590
|
+
name: t.label ? `${t.series}: ${t.label}` : t.series,
|
|
591
|
+
start: P(t.position)
|
|
592
|
+
}))
|
|
593
|
+
],
|
|
594
|
+
key: o.key,
|
|
595
|
+
label: o.label,
|
|
596
|
+
summary: ke.get(o.key)
|
|
597
|
+
}));
|
|
598
|
+
}
|
|
599
|
+
const no = new Set((y ?? []).map((e) => e.series)), ut = Q !== "none" && A.length >= 2 && /* @__PURE__ */ n(
|
|
600
|
+
Ro,
|
|
601
|
+
{
|
|
602
|
+
align: St,
|
|
603
|
+
entries: A.map((e, o) => ({
|
|
604
|
+
// A faixa global e hachurada no desenho, e a amostra repete a hachura.
|
|
605
|
+
color: no.has(e.label) ? Vo(be[o]) : be[o],
|
|
606
|
+
hidden: we.isHidden(e.label),
|
|
607
|
+
label: e.label
|
|
608
|
+
})),
|
|
609
|
+
onToggle: we.toggle,
|
|
610
|
+
position: Q
|
|
611
|
+
}
|
|
612
|
+
);
|
|
613
|
+
return /* @__PURE__ */ w("figure", { className: r.figure, children: [
|
|
614
|
+
/* @__PURE__ */ w("figcaption", { className: r.header, children: [
|
|
615
|
+
/* @__PURE__ */ n("span", { className: r.title, id: Ge, children: ge }),
|
|
616
|
+
!tt && /* @__PURE__ */ n(
|
|
617
|
+
Bo,
|
|
618
|
+
{
|
|
619
|
+
"aria-pressed": Xe,
|
|
620
|
+
onClick: () => Ut((e) => !e),
|
|
621
|
+
size: "sm",
|
|
622
|
+
variant: "secondary",
|
|
623
|
+
children: "Ver como tabela"
|
|
624
|
+
}
|
|
625
|
+
)
|
|
626
|
+
] }),
|
|
627
|
+
N && /* @__PURE__ */ n("span", { className: r.visuallyHidden, id: Ke, children: "Use as setas para percorrer os intervalos." }),
|
|
628
|
+
Q === "top" && ut,
|
|
629
|
+
/* @__PURE__ */ n("div", { className: r.plot, ref: H.ref, children: tt ? /* @__PURE__ */ n("div", { className: r.empty, children: /* @__PURE__ */ n(Io, { icon: /* @__PURE__ */ n(So, {}), size: "sm", title: Ot }) }) : H.width === 0 ? null : Xe ? /* @__PURE__ */ n(
|
|
630
|
+
ho,
|
|
631
|
+
{
|
|
632
|
+
emptyRowLabel: de,
|
|
633
|
+
rows: ro(),
|
|
634
|
+
showProgress: G && Ne.some((e) => e.progress !== void 0),
|
|
635
|
+
title: ge
|
|
636
|
+
}
|
|
637
|
+
) : oo }),
|
|
638
|
+
Q === "bottom" && ut
|
|
639
|
+
] });
|
|
640
|
+
}
|
|
641
|
+
function Zo({ className: h, collapsibleGroups: m, items: y, onToggleGroup: b, style: g, summaries: f }) {
|
|
642
|
+
return /* @__PURE__ */ n("div", { className: `${r.labels} ${h}`, style: g, children: y.map((u) => {
|
|
643
|
+
if (u.kind === "group") {
|
|
644
|
+
const Z = /* @__PURE__ */ w(kt, { children: [
|
|
645
|
+
m && /* @__PURE__ */ n(Eo, { className: `${r.chevron} ${u.collapsed ? r.chevronCollapsed : ""}` }),
|
|
646
|
+
/* @__PURE__ */ n("span", { className: r.groupName, children: u.group.label }),
|
|
647
|
+
/* @__PURE__ */ w("span", { className: r.groupCount, children: [
|
|
648
|
+
"(",
|
|
649
|
+
u.rows.length,
|
|
650
|
+
")"
|
|
651
|
+
] })
|
|
652
|
+
] });
|
|
653
|
+
return /* @__PURE__ */ n("div", { className: r.groupLabel, style: { height: u.height }, children: m ? /* @__PURE__ */ n(
|
|
654
|
+
"button",
|
|
655
|
+
{
|
|
656
|
+
"aria-expanded": !u.collapsed,
|
|
657
|
+
className: r.groupButton,
|
|
658
|
+
onClick: () => b(u.group.key),
|
|
659
|
+
type: "button",
|
|
660
|
+
children: Z
|
|
661
|
+
}
|
|
662
|
+
) : /* @__PURE__ */ n("span", { className: r.groupText, children: Z }) }, `group-${u.group.key}`);
|
|
663
|
+
}
|
|
664
|
+
const S = f == null ? void 0 : f.get(u.row.key);
|
|
665
|
+
return /* @__PURE__ */ w(
|
|
666
|
+
"div",
|
|
667
|
+
{
|
|
668
|
+
className: `${r.rowLabel} ${u.child ? r.childLabel : ""}`,
|
|
669
|
+
style: { height: u.height },
|
|
670
|
+
children: [
|
|
671
|
+
/* @__PURE__ */ w("span", { className: r.labelLine, children: [
|
|
672
|
+
/* @__PURE__ */ n("span", { className: r.labelText, title: u.row.label, children: u.row.label }),
|
|
673
|
+
" ",
|
|
674
|
+
u.row.description && /* @__PURE__ */ n("span", { className: r.labelDescription, children: u.row.description })
|
|
675
|
+
] }),
|
|
676
|
+
S && /* @__PURE__ */ n("span", { className: r.labelSummary, children: S.subtitle ? `${S.title} · ${S.subtitle}` : S.title })
|
|
677
|
+
]
|
|
678
|
+
},
|
|
679
|
+
u.row.key
|
|
680
|
+
);
|
|
681
|
+
}) });
|
|
682
|
+
}
|
|
683
|
+
function qo({ inline: h, items: m, style: y, summaries: b }) {
|
|
684
|
+
return /* @__PURE__ */ n("div", { className: r.summary, style: y, children: m.map((g) => {
|
|
685
|
+
const f = g.kind === "row" ? b.get(g.row.key) : void 0;
|
|
686
|
+
return /* @__PURE__ */ n(
|
|
687
|
+
"div",
|
|
688
|
+
{
|
|
689
|
+
className: `${r.summaryItem} ${h ? r.summaryInline : ""}`,
|
|
690
|
+
style: { height: g.height },
|
|
691
|
+
children: f && /* @__PURE__ */ w(kt, { children: [
|
|
692
|
+
/* @__PURE__ */ n("span", { className: r.summaryTitle, children: f.title }),
|
|
693
|
+
f.subtitle && /* @__PURE__ */ n("span", { className: r.summarySubtitle, children: f.subtitle })
|
|
694
|
+
] })
|
|
695
|
+
},
|
|
696
|
+
g.kind === "row" ? g.row.key : `group-${g.group.key}`
|
|
697
|
+
);
|
|
698
|
+
}) });
|
|
699
|
+
}
|
|
700
|
+
export {
|
|
701
|
+
vr as ChartTimeline
|
|
702
|
+
};
|
|
703
|
+
//# sourceMappingURL=ChartTimeline.js.map
|