@aiaiai-pt/design-system 0.39.0 → 0.41.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/components/EChart.svelte +2 -2
- package/components/ResultsChart.svelte +2 -2
- package/components/renderer/registry.ts +7 -8
- package/package.json +2 -1
- package/components/renderer/DonutChartWidget.svelte +0 -11
- package/components/renderer/DonutChartWidget.svelte.d.ts +0 -4
- package/components/renderer/LineChartWidget.svelte +0 -12
- package/components/renderer/LineChartWidget.svelte.d.ts +0 -4
package/components/EChart.svelte
CHANGED
|
@@ -243,7 +243,7 @@
|
|
|
243
243
|
<thead>
|
|
244
244
|
<tr>
|
|
245
245
|
<th scope="col">{labelHeader}</th>
|
|
246
|
-
{#each chartData.series as s (
|
|
246
|
+
{#each chartData.series as s, si (si)}
|
|
247
247
|
<th scope="col">{s.name}</th>
|
|
248
248
|
{/each}
|
|
249
249
|
</tr>
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
{#each chartData.category as cat, r (cat + r)}
|
|
253
253
|
<tr>
|
|
254
254
|
<th scope="row">{cat}</th>
|
|
255
|
-
{#each chartData.series as s (
|
|
255
|
+
{#each chartData.series as s, si (si)}
|
|
256
256
|
<td>{fmt(s.data[r] ?? 0)}</td>
|
|
257
257
|
{/each}
|
|
258
258
|
</tr>
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
<thead>
|
|
116
116
|
<tr>
|
|
117
117
|
<th scope="col">{labelHeader}</th>
|
|
118
|
-
{#each chartData.series as s (
|
|
118
|
+
{#each chartData.series as s, si (si)}
|
|
119
119
|
<th scope="col">{s.name}</th>
|
|
120
120
|
{/each}
|
|
121
121
|
</tr>
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
{#each chartData.category as cat, r (cat + r)}
|
|
125
125
|
<tr>
|
|
126
126
|
<th scope="row">{cat}</th>
|
|
127
|
-
{#each chartData.series as s (
|
|
127
|
+
{#each chartData.series as s, si (si)}
|
|
128
128
|
<td>{fmt(s.data[r] ?? 0)}</td>
|
|
129
129
|
{/each}
|
|
130
130
|
</tr>
|
|
@@ -22,9 +22,7 @@ import {
|
|
|
22
22
|
} from "./dispatch";
|
|
23
23
|
import type { Block, OntologySchema, WidgetKind, WidgetProps } from "./types";
|
|
24
24
|
|
|
25
|
-
import DonutChartWidget from "./DonutChartWidget.svelte";
|
|
26
25
|
import EChartWidget from "./EChartWidget.svelte";
|
|
27
|
-
import LineChartWidget from "./LineChartWidget.svelte";
|
|
28
26
|
import ResultsChartWidget from "./ResultsChartWidget.svelte";
|
|
29
27
|
import StatGridWidget from "./StatGridWidget.svelte";
|
|
30
28
|
|
|
@@ -67,15 +65,16 @@ export function byKind(
|
|
|
67
65
|
* appended in call order. Exported (readonly view) for introspection / testing.
|
|
68
66
|
*/
|
|
69
67
|
const _entries: RegistryEntry<WidgetComponent>[] = [
|
|
70
|
-
// DS base: the
|
|
68
|
+
// DS base: the clean widgets shipped by this package.
|
|
71
69
|
byKind("stat-grid", "kpi", StatGridWidget),
|
|
72
70
|
byTypeOnKind("results-chart", "aggregate", ResultsChartWidget),
|
|
71
|
+
// #176 follow-on — ONE ECharts widget renders any chart spec (supersedes ADR
|
|
72
|
+
// 0003 #4). The per-kind `line-chart` / `donut-chart` keys were a stopgap;
|
|
73
|
+
// in the declarative model the kind is PER-SERIES (a series carries its own
|
|
74
|
+
// bar/line/area/scatter/pie type), so EChartWidget renders every shape and
|
|
75
|
+
// the kind-specific registry keys + wrapper components are retired.
|
|
76
|
+
// `results-chart` stays as the SSR / no-JS a11y fallback key.
|
|
73
77
|
byTypeOnKind("chart", "aggregate", EChartWidget),
|
|
74
|
-
// #176 Tier 1 — chart KINDS as registry entries, so the authoring `type`
|
|
75
|
-
// picker is a real chart picker. All three ECharts kinds share the same
|
|
76
|
-
// aggregate data path + a11y data table; only the rendered geometry differs.
|
|
77
|
-
byTypeOnKind("line-chart", "aggregate", LineChartWidget),
|
|
78
|
-
byTypeOnKind("donut-chart", "aggregate", DonutChartWidget),
|
|
79
78
|
];
|
|
80
79
|
|
|
81
80
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiaiai-pt/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"description": "Design system tokens and Svelte components for aiaiai products",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"@sveltejs/package": "^2.5.7",
|
|
76
76
|
"date-fns": "^4.1.0",
|
|
77
77
|
"echarts": "^5.6.0",
|
|
78
|
+
"jsdom": "^29.1.1",
|
|
78
79
|
"ol": "^10.8.0",
|
|
79
80
|
"svelte": "^5.55.3",
|
|
80
81
|
"svelte-check": "^4.4.6",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import EChartWidget from "./EChartWidget.svelte";
|
|
3
|
-
import type { WidgetProps } from "./types";
|
|
4
|
-
|
|
5
|
-
// `donut-chart` registry key (#176 Tier 1). Thin wrapper binding the ECharts
|
|
6
|
-
// `kind` to a ring pie — the registry maps this key here. Same aggregate data
|
|
7
|
-
// path + a11y data table as the bar/line.
|
|
8
|
-
let p: WidgetProps = $props();
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<EChartWidget {...p} kind="donut" />
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import EChartWidget from "./EChartWidget.svelte";
|
|
3
|
-
import type { WidgetProps } from "./types";
|
|
4
|
-
|
|
5
|
-
// `line-chart` registry key (#176 Tier 1). Thin wrapper that binds the ECharts
|
|
6
|
-
// `kind` the dispatcher can't pass — the registry maps this key to this
|
|
7
|
-
// component, which renders the shared EChart widget as a line. Same aggregate
|
|
8
|
-
// data path + a11y data table as the bar.
|
|
9
|
-
let p: WidgetProps = $props();
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<EChartWidget {...p} kind="line" />
|