@svadmin/lite 0.17.0 → 0.22.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 +71 -2
- package/dist/components/LiteActivityFeed.svelte +24 -2
- package/dist/components/LiteActivityFeed.svelte.d.ts +6 -0
- package/dist/components/LiteAffix.svelte +29 -0
- package/dist/components/LiteAffix.svelte.d.ts +13 -0
- package/dist/components/LiteAnchor.svelte +38 -0
- package/dist/components/LiteAnchor.svelte.d.ts +14 -0
- package/dist/components/LiteApprovalActionCard.svelte +4 -1
- package/dist/components/LiteApprovalActionCard.svelte.d.ts +2 -0
- package/dist/components/LiteAutoComplete.svelte +41 -0
- package/dist/components/LiteAutoComplete.svelte.d.ts +13 -0
- package/dist/components/LiteBackTop.svelte +16 -0
- package/dist/components/LiteBackTop.svelte.d.ts +8 -0
- package/dist/components/LiteBreadcrumbs.svelte +4 -1
- package/dist/components/LiteBreadcrumbs.svelte.d.ts +2 -0
- package/dist/components/LiteCalendar.svelte +124 -0
- package/dist/components/LiteCalendar.svelte.d.ts +20 -0
- package/dist/components/LiteCarousel.svelte +72 -0
- package/dist/components/LiteCarousel.svelte.d.ts +14 -0
- package/dist/components/LiteCollapse.svelte +49 -0
- package/dist/components/LiteCollapse.svelte.d.ts +15 -0
- package/dist/components/LiteColumnHeaderFilter.svelte +4 -1
- package/dist/components/LiteColumnHeaderFilter.svelte.d.ts +2 -0
- package/dist/components/LiteColumnSettings.svelte +4 -1
- package/dist/components/LiteColumnSettings.svelte.d.ts +2 -0
- package/dist/components/LiteCommentThread.svelte +113 -0
- package/dist/components/LiteCommentThread.svelte.d.ts +26 -0
- package/dist/components/LiteCountdown.svelte +49 -0
- package/dist/components/LiteCountdown.svelte.d.ts +10 -0
- package/dist/components/LiteDetailDrawer.svelte +45 -0
- package/dist/components/LiteDetailDrawer.svelte.d.ts +14 -0
- package/dist/components/LiteDraggableRowTable.svelte +4 -1
- package/dist/components/LiteDraggableRowTable.svelte.d.ts +2 -0
- package/dist/components/LiteDrawerForm.svelte +4 -1
- package/dist/components/LiteDrawerForm.svelte.d.ts +2 -0
- package/dist/components/LiteEditableTable.svelte +4 -1
- package/dist/components/LiteEditableTable.svelte.d.ts +2 -0
- package/dist/components/LiteEmptyState.svelte +8 -1
- package/dist/components/LiteEmptyState.svelte.d.ts +3 -0
- package/dist/components/LiteFilterBuilder.svelte +4 -1
- package/dist/components/LiteFilterBuilder.svelte.d.ts +2 -0
- package/dist/components/LiteFloatButton.svelte +54 -0
- package/dist/components/LiteFloatButton.svelte.d.ts +15 -0
- package/dist/components/LiteGrid.svelte +34 -0
- package/dist/components/LiteGrid.svelte.d.ts +11 -0
- package/dist/components/LiteImage.svelte +54 -0
- package/dist/components/LiteImage.svelte.d.ts +14 -0
- package/dist/components/LiteImageCropper.svelte +4 -1
- package/dist/components/LiteImageCropper.svelte.d.ts +2 -0
- package/dist/components/LiteImagePreview.svelte +36 -0
- package/dist/components/LiteImagePreview.svelte.d.ts +13 -0
- package/dist/components/LiteItemList.svelte +50 -0
- package/dist/components/LiteItemList.svelte.d.ts +15 -0
- package/dist/components/LiteJsonSchemaForm.svelte +4 -1
- package/dist/components/LiteJsonSchemaForm.svelte.d.ts +2 -0
- package/dist/components/LiteLayout.svelte +16 -4
- package/dist/components/LiteLayout.svelte.d.ts +8 -0
- package/dist/components/LiteLink.svelte +32 -0
- package/dist/components/LiteLink.svelte.d.ts +11 -0
- package/dist/components/LiteLogin.svelte +9 -2
- package/dist/components/LiteLogin.svelte.d.ts +2 -0
- package/dist/components/LiteMasterDetailView.svelte +4 -1
- package/dist/components/LiteMasterDetailView.svelte.d.ts +2 -0
- package/dist/components/LiteMediaLibraryModal.svelte +4 -1
- package/dist/components/LiteMediaLibraryModal.svelte.d.ts +2 -0
- package/dist/components/LiteMenu.svelte +22 -0
- package/dist/components/LiteMenu.svelte.d.ts +12 -0
- package/dist/components/LiteMenuList.svelte +55 -0
- package/dist/components/LiteMenuList.svelte.d.ts +17 -0
- package/dist/components/LiteModalForm.svelte +4 -1
- package/dist/components/LiteModalForm.svelte.d.ts +2 -0
- package/dist/components/LiteNotificationCenter.svelte +85 -0
- package/dist/components/LiteNotificationCenter.svelte.d.ts +22 -0
- package/dist/components/LiteOtpInput.svelte +50 -0
- package/dist/components/LiteOtpInput.svelte.d.ts +15 -0
- package/dist/components/LitePageHeader.svelte +34 -0
- package/dist/components/LitePageHeader.svelte.d.ts +13 -0
- package/dist/components/LitePagination.svelte +10 -2
- package/dist/components/LitePagination.svelte.d.ts +2 -0
- package/dist/components/LitePopconfirm.svelte +49 -0
- package/dist/components/LitePopconfirm.svelte.d.ts +14 -0
- package/dist/components/LitePresenceAvatarGroup.svelte +4 -1
- package/dist/components/LitePresenceAvatarGroup.svelte.d.ts +2 -0
- package/dist/components/LitePrintableBill.svelte +4 -1
- package/dist/components/LitePrintableBill.svelte.d.ts +2 -0
- package/dist/components/LiteProgress.svelte +46 -0
- package/dist/components/LiteProgress.svelte.d.ts +12 -0
- package/dist/components/LiteQRCode.svelte +62 -0
- package/dist/components/LiteQRCode.svelte.d.ts +14 -0
- package/dist/components/LiteResizeBox.svelte +34 -0
- package/dist/components/LiteResizeBox.svelte.d.ts +12 -0
- package/dist/components/LiteResult.svelte +52 -0
- package/dist/components/LiteResult.svelte.d.ts +14 -0
- package/dist/components/LiteRowActions.svelte +36 -0
- package/dist/components/LiteRowActions.svelte.d.ts +17 -0
- package/dist/components/LiteSensitiveDataMask.svelte +4 -1
- package/dist/components/LiteSensitiveDataMask.svelte.d.ts +2 -0
- package/dist/components/LiteSkeleton.svelte +100 -0
- package/dist/components/LiteSkeleton.svelte.d.ts +19 -0
- package/dist/components/LiteSpace.svelte +31 -0
- package/dist/components/LiteSpace.svelte.d.ts +12 -0
- package/dist/components/LiteSpin.svelte +27 -0
- package/dist/components/LiteSpin.svelte.d.ts +10 -0
- package/dist/components/LiteSplitPaneLayout.svelte +16 -4
- package/dist/components/LiteSplitPaneLayout.svelte.d.ts +8 -0
- package/dist/components/LiteStatistic.svelte +63 -0
- package/dist/components/LiteStatistic.svelte.d.ts +15 -0
- package/dist/components/LiteStatsCard.svelte +5 -2
- package/dist/components/LiteStatsCard.svelte.d.ts +2 -0
- package/dist/components/LiteStatusBadge.svelte +33 -0
- package/dist/components/LiteStatusBadge.svelte.d.ts +12 -0
- package/dist/components/LiteStatusTabs.svelte +35 -0
- package/dist/components/LiteStatusTabs.svelte.d.ts +14 -0
- package/dist/components/LiteStepForm.svelte +4 -1
- package/dist/components/LiteStepForm.svelte.d.ts +2 -0
- package/dist/components/LiteSteps.svelte +64 -0
- package/dist/components/LiteSteps.svelte.d.ts +18 -0
- package/dist/components/LiteTable.svelte +4 -1
- package/dist/components/LiteTable.svelte.d.ts +2 -0
- package/dist/components/LiteTableSummary.svelte +4 -1
- package/dist/components/LiteTableSummary.svelte.d.ts +2 -0
- package/dist/components/LiteTabs.svelte +28 -18
- package/dist/components/LiteTabs.svelte.d.ts +11 -2
- package/dist/components/LiteTag.svelte +31 -0
- package/dist/components/LiteTag.svelte.d.ts +13 -0
- package/dist/components/LiteTimeline.svelte +48 -0
- package/dist/components/LiteTimeline.svelte.d.ts +17 -0
- package/dist/components/LiteTour.svelte +54 -0
- package/dist/components/LiteTour.svelte.d.ts +15 -0
- package/dist/components/LiteTransfer.svelte +4 -1
- package/dist/components/LiteTransfer.svelte.d.ts +2 -0
- package/dist/components/LiteTree.svelte +48 -0
- package/dist/components/LiteTree.svelte.d.ts +17 -0
- package/dist/components/LiteTwoFactorStepper.svelte +53 -0
- package/dist/components/LiteTwoFactorStepper.svelte.d.ts +16 -0
- package/dist/components/LiteVersionDiffViewer.svelte +4 -1
- package/dist/components/LiteVersionDiffViewer.svelte.d.ts +2 -0
- package/dist/components/LiteVideoPlayer.svelte +67 -0
- package/dist/components/LiteVideoPlayer.svelte.d.ts +22 -0
- package/dist/components/advanced/LiteAutoSaveIndicator.svelte +42 -13
- package/dist/components/advanced/LiteAutoSaveIndicator.svelte.d.ts +10 -4
- package/dist/components/advanced/LiteDrawerForm.svelte +4 -1
- package/dist/components/advanced/LiteDrawerForm.svelte.d.ts +2 -0
- package/dist/components/advanced/LiteModalForm.svelte +4 -1
- package/dist/components/advanced/LiteModalForm.svelte.d.ts +2 -0
- package/dist/components/compatibility/LiteRealtimeStatus.svelte +41 -2
- package/dist/components/compatibility/LiteRealtimeStatus.svelte.d.ts +15 -0
- package/dist/components/fields/LiteBooleanField.svelte +4 -2
- package/dist/components/fields/LiteBooleanField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteCascader.svelte +5 -2
- package/dist/components/fields/LiteCascader.svelte.d.ts +2 -0
- package/dist/components/fields/LiteDateField.svelte +39 -9
- package/dist/components/fields/LiteDateField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteImageField.svelte +6 -2
- package/dist/components/fields/LiteImageField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteMarkdownField.svelte +49 -3
- package/dist/components/fields/LiteMarkdownField.svelte.d.ts +5 -0
- package/dist/components/fields/LiteNumberField.svelte +5 -3
- package/dist/components/fields/LiteNumberField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteRichTextField.svelte +45 -8
- package/dist/components/fields/LiteRichTextField.svelte.d.ts +3 -0
- package/dist/components/fields/LiteSelectField.svelte +5 -3
- package/dist/components/fields/LiteSelectField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteTagField.svelte +38 -15
- package/dist/components/fields/LiteTagField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteTextField.svelte +26 -5
- package/dist/components/fields/LiteTextField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteTreeSelect.svelte +5 -2
- package/dist/components/fields/LiteTreeSelect.svelte.d.ts +2 -0
- package/dist/components/fields/LiteUrlField.svelte +5 -3
- package/dist/components/fields/LiteUrlField.svelte.d.ts +2 -0
- package/dist/components/layout/LiteSidebar.svelte +4 -1
- package/dist/components/layout/LiteSidebar.svelte.d.ts +2 -0
- package/dist/components/pages/LiteCreatePage.svelte +4 -1
- package/dist/components/pages/LiteCreatePage.svelte.d.ts +2 -0
- package/dist/components/pages/LiteEditPage.svelte +4 -1
- package/dist/components/pages/LiteEditPage.svelte.d.ts +2 -0
- package/dist/components/pages/LiteListPage.svelte +4 -1
- package/dist/components/pages/LiteListPage.svelte.d.ts +2 -0
- package/dist/components/pages/LiteShowPage.svelte +4 -1
- package/dist/components/pages/LiteShowPage.svelte.d.ts +2 -0
- package/dist/components/widgets/LiteAnomalyBadge.svelte +5 -2
- package/dist/components/widgets/LiteAnomalyBadge.svelte.d.ts +2 -0
- package/dist/components/widgets/LiteAreaChart.svelte +20 -0
- package/dist/components/widgets/LiteAreaChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteChartSvg.svelte +102 -0
- package/dist/components/widgets/LiteChartSvg.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteChartTable.svelte +44 -0
- package/dist/components/widgets/LiteChartTable.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteDonutChart.svelte +20 -0
- package/dist/components/widgets/LiteDonutChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteFunnelChart.svelte +20 -0
- package/dist/components/widgets/LiteFunnelChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteGaugeChart.svelte +20 -0
- package/dist/components/widgets/LiteGaugeChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteHeatmapChart.svelte +20 -0
- package/dist/components/widgets/LiteHeatmapChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteInsightCard.svelte +34 -12
- package/dist/components/widgets/LiteInsightCard.svelte.d.ts +7 -4
- package/dist/components/widgets/LiteLineChart.svelte +6 -3
- package/dist/components/widgets/LiteLineChart.svelte.d.ts +0 -5
- package/dist/components/widgets/LitePieChart.svelte +5 -3
- package/dist/components/widgets/LitePieChart.svelte.d.ts +0 -5
- package/dist/components/widgets/LiteRadarChart.svelte +20 -0
- package/dist/components/widgets/LiteRadarChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteRoseChart.svelte +20 -0
- package/dist/components/widgets/LiteRoseChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteScatterChart.svelte +20 -0
- package/dist/components/widgets/LiteScatterChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteWaterfallChart.svelte +20 -0
- package/dist/components/widgets/LiteWaterfallChart.svelte.d.ts +10 -0
- package/dist/components/widgets/chart-geometry.d.ts +65 -0
- package/dist/components/widgets/chart-geometry.js +229 -0
- package/dist/components/widgets/index.d.ts +10 -0
- package/dist/components/widgets/index.js +10 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +47 -0
- package/dist/lite-code-theme.css +139 -0
- package/dist/lite.css +108 -1
- package/dist/rich-content.d.ts +47 -0
- package/dist/rich-content.js +498 -0
- package/dist/schema-generator.js +3 -1
- package/dist/server-adapter.js +6 -11
- package/dist/value-normalization.d.ts +4 -0
- package/dist/value-normalization.js +13 -0
- package/package.json +18 -4
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
areaPath,
|
|
4
|
+
donutSlices,
|
|
5
|
+
funnelRects,
|
|
6
|
+
gaugeArc,
|
|
7
|
+
heatCells,
|
|
8
|
+
hasData,
|
|
9
|
+
labels,
|
|
10
|
+
pieSlices,
|
|
11
|
+
polyline,
|
|
12
|
+
radarPolygon,
|
|
13
|
+
roseSlices,
|
|
14
|
+
scatterPoints,
|
|
15
|
+
series,
|
|
16
|
+
waterfallBars,
|
|
17
|
+
type Basket,
|
|
18
|
+
} from './chart-geometry';
|
|
19
|
+
|
|
20
|
+
interface Props {
|
|
21
|
+
kind: string;
|
|
22
|
+
rows?: Array<Array<string | number>>;
|
|
23
|
+
title?: string;
|
|
24
|
+
/** Value axis hint used by pie and donut legends. */
|
|
25
|
+
summary?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let { kind, rows = [], title, summary }: Props = $props();
|
|
29
|
+
|
|
30
|
+
const basket: Basket = { width: 320, height: 160, padding: 12 };
|
|
31
|
+
const palette = ['#165DFF', '#FF7D00', '#00B42A', '#F53F3F', '#8B5CF6', '#06B6D4', '#F97316', '#EC4899', '#0EA5E9', '#A855F7'];
|
|
32
|
+
const values = $derived(series(rows));
|
|
33
|
+
const names = $derived(labels(rows));
|
|
34
|
+
const label = $derived(`${title ?? kind} chart`);
|
|
35
|
+
const gauge = $derived(gaugeArc(values[0] ?? 0, 100, basket));
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
{#if hasData(rows)}
|
|
39
|
+
<figure class="lite-chart-svg">
|
|
40
|
+
<svg viewBox={`0 0 ${basket.width} ${basket.height}`} role="img" aria-label={label} preserveAspectRatio="xMidYMid meet">
|
|
41
|
+
<title>{label}{summary ? ` — ${summary}` : ''}</title>
|
|
42
|
+
{#if kind === 'area'}
|
|
43
|
+
<path d={areaPath(values, basket)} fill="#165DFF" fill-opacity="0.18" stroke="#165DFF" stroke-width="2" />
|
|
44
|
+
{:else if kind === 'scatter'}
|
|
45
|
+
<polyline points={polyline(values, basket)} fill="none" stroke="#C9CDD4" stroke-width="1" stroke-dasharray="3 3" />
|
|
46
|
+
{#each scatterPoints(values, basket) as point, index (index)}
|
|
47
|
+
<circle cx={point.x} cy={point.y} r="3.5" fill={palette[index % palette.length]} />
|
|
48
|
+
{/each}
|
|
49
|
+
{:else if kind === 'radar'}
|
|
50
|
+
{@const radar = radarPolygon(values, basket)}
|
|
51
|
+
{#each radar.axes as axis, index (index)}
|
|
52
|
+
<polyline points={axis} fill="none" stroke="#E5E6EB" stroke-width="1" />
|
|
53
|
+
{/each}
|
|
54
|
+
<polygon points={radar.polygon} fill="#165DFF" fill-opacity="0.2" stroke="#165DFF" stroke-width="2" />
|
|
55
|
+
{:else if kind === 'gauge'}
|
|
56
|
+
<path d={gauge.track} fill="none" stroke="#E5E6EB" stroke-width="12" stroke-linecap="round" />
|
|
57
|
+
<path d={gauge.value} fill="none" stroke="#165DFF" stroke-width="12" stroke-linecap="round" />
|
|
58
|
+
<text x={basket.width / 2} y={basket.height - 24} text-anchor="middle" font-size="18" fill="#1D2129">{gauge.percent}%</text>
|
|
59
|
+
{:else if kind === 'funnel'}
|
|
60
|
+
{#each funnelRects(values, basket) as rect, index (index)}
|
|
61
|
+
<rect x={rect.x} y={rect.y} width={rect.width} height={rect.height} fill={palette[index % palette.length]} fill-opacity="0.85" />
|
|
62
|
+
{/each}
|
|
63
|
+
{:else if kind === 'heatmap'}
|
|
64
|
+
{#each heatCells(values, basket) as cell, index (index)}
|
|
65
|
+
<rect x={cell.x} y={cell.y} width={cell.width} height={cell.height} rx="2" fill="#165DFF" fill-opacity={cell.opacity} />
|
|
66
|
+
{/each}
|
|
67
|
+
{:else if kind === 'waterfall'}
|
|
68
|
+
{#each waterfallBars(values, basket) as bar, index (index)}
|
|
69
|
+
<rect x={bar.x} y={bar.y} width={bar.width} height={bar.height} fill={bar.positive ? '#00B42A' : '#F53F3F'} fill-opacity="0.85" />
|
|
70
|
+
{/each}
|
|
71
|
+
{:else if kind === 'rose'}
|
|
72
|
+
{#each roseSlices(values, basket) as slice, index (index)}
|
|
73
|
+
<path d={slice.path} fill={palette[index % palette.length]} fill-opacity="0.85" />
|
|
74
|
+
{/each}
|
|
75
|
+
{:else if kind === 'donut'}
|
|
76
|
+
{#each donutSlices(values, basket) as slice, index (index)}
|
|
77
|
+
<path d={slice.path} fill={palette[index % palette.length]} fill-opacity="0.9" />
|
|
78
|
+
{/each}
|
|
79
|
+
{:else}
|
|
80
|
+
{#each pieSlices(values, basket) as slice, index (index)}
|
|
81
|
+
<path d={slice.path} fill={palette[index % palette.length]} fill-opacity="0.9" />
|
|
82
|
+
{/each}
|
|
83
|
+
{/if}
|
|
84
|
+
</svg>
|
|
85
|
+
<figcaption class="lite-chart-svg__legend">
|
|
86
|
+
{#each names as name, index (index)}
|
|
87
|
+
<span class="lite-chart-svg__legend-item">
|
|
88
|
+
<span class="lite-chart-svg__swatch" style={`background:${palette[index % palette.length]}`} aria-hidden="true"></span>
|
|
89
|
+
{name}
|
|
90
|
+
</span>
|
|
91
|
+
{/each}
|
|
92
|
+
</figcaption>
|
|
93
|
+
</figure>
|
|
94
|
+
{/if}
|
|
95
|
+
|
|
96
|
+
<style>
|
|
97
|
+
.lite-chart-svg { display: block; margin: 0; padding: 12px 16px; border-bottom: 1px solid #E5E6EB; }
|
|
98
|
+
.lite-chart-svg svg { display: block; width: 100%; height: auto; max-height: 220px; }
|
|
99
|
+
.lite-chart-svg__legend { display: flex; flex-wrap: wrap; padding-top: 8px; }
|
|
100
|
+
.lite-chart-svg__legend-item { display: inline-flex; align-items: center; margin: 0 12px 4px 0; color: #4E5969; font-size: 12px; }
|
|
101
|
+
.lite-chart-svg__swatch { width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; }
|
|
102
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
kind: string;
|
|
3
|
+
rows?: Array<Array<string | number>>;
|
|
4
|
+
title?: string;
|
|
5
|
+
/** Value axis hint used by pie and donut legends. */
|
|
6
|
+
summary?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const LiteChartSvg: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type LiteChartSvg = ReturnType<typeof LiteChartSvg>;
|
|
10
|
+
export default LiteChartSvg;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
title?: string;
|
|
4
|
+
kind?: string;
|
|
5
|
+
columns?: string[];
|
|
6
|
+
rows?: Array<Array<string | number>>;
|
|
7
|
+
emptyText?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let {
|
|
11
|
+
title,
|
|
12
|
+
kind = 'chart',
|
|
13
|
+
columns = ['Label', 'Value'],
|
|
14
|
+
rows = [],
|
|
15
|
+
emptyText = 'No data',
|
|
16
|
+
}: Props = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<section class="lite-chart-table lite-card" data-kind={kind} aria-label={title ?? `${kind} data`}>
|
|
20
|
+
{#if title}<h2>{title}</h2>{/if}
|
|
21
|
+
{#if rows.length === 0}
|
|
22
|
+
<p class="lite-muted">{emptyText}</p>
|
|
23
|
+
{:else}
|
|
24
|
+
<div class="lite-table-scroll">
|
|
25
|
+
<table class="lite-table">
|
|
26
|
+
<thead>
|
|
27
|
+
<tr>{#each columns as column (column)}<th scope="col">{column}</th>{/each}</tr>
|
|
28
|
+
</thead>
|
|
29
|
+
<tbody>
|
|
30
|
+
{#each rows as row, index (index)}
|
|
31
|
+
<tr>{#each row as cell, cellIndex (cellIndex)}<td>{cell}</td>{/each}</tr>
|
|
32
|
+
{/each}
|
|
33
|
+
</tbody>
|
|
34
|
+
</table>
|
|
35
|
+
</div>
|
|
36
|
+
{/if}
|
|
37
|
+
</section>
|
|
38
|
+
|
|
39
|
+
<style>
|
|
40
|
+
.lite-chart-table { padding: 0; overflow: hidden; }
|
|
41
|
+
.lite-chart-table h2 { margin: 0; padding: 12px 16px; border-bottom: 1px solid #E5E6EB; color: #1D2129; font-size: 14px; }
|
|
42
|
+
.lite-chart-table > p { margin: 0; padding: 16px; }
|
|
43
|
+
.lite-chart-table table { margin: 0; }
|
|
44
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
title?: string;
|
|
3
|
+
kind?: string;
|
|
4
|
+
columns?: string[];
|
|
5
|
+
rows?: Array<Array<string | number>>;
|
|
6
|
+
emptyText?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const LiteChartTable: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type LiteChartTable = ReturnType<typeof LiteChartTable>;
|
|
10
|
+
export default LiteChartTable;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import LiteChartSvg from './LiteChartSvg.svelte';
|
|
3
|
+
import LiteChartTable from './LiteChartTable.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
title?: string;
|
|
7
|
+
data?: Array<Record<string, unknown>>;
|
|
8
|
+
rows?: Array<Array<string | number>>;
|
|
9
|
+
columns?: string[];
|
|
10
|
+
emptyText?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { title, data = [], rows, columns, emptyText }: Props = $props();
|
|
14
|
+
const normalized = $derived(rows ?? data.map((item) => Object.values(item).map((value) => typeof value === 'number' ? value : String(value ?? ''))));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class="lite-chart-widget">
|
|
18
|
+
<LiteChartSvg kind="donut" rows={normalized} {title} />
|
|
19
|
+
<LiteChartTable {title} kind="donut" columns={columns ?? ['Label', 'Value']} rows={normalized} {emptyText} />
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
title?: string;
|
|
3
|
+
data?: Array<Record<string, unknown>>;
|
|
4
|
+
rows?: Array<Array<string | number>>;
|
|
5
|
+
columns?: string[];
|
|
6
|
+
emptyText?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const LiteDonutChart: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type LiteDonutChart = ReturnType<typeof LiteDonutChart>;
|
|
10
|
+
export default LiteDonutChart;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import LiteChartSvg from './LiteChartSvg.svelte';
|
|
3
|
+
import LiteChartTable from './LiteChartTable.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
title?: string;
|
|
7
|
+
data?: Array<Record<string, unknown>>;
|
|
8
|
+
rows?: Array<Array<string | number>>;
|
|
9
|
+
columns?: string[];
|
|
10
|
+
emptyText?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { title, data = [], rows, columns, emptyText }: Props = $props();
|
|
14
|
+
const normalized = $derived(rows ?? data.map((item) => Object.values(item).map((value) => typeof value === 'number' ? value : String(value ?? ''))));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class="lite-chart-widget">
|
|
18
|
+
<LiteChartSvg kind="funnel" rows={normalized} {title} />
|
|
19
|
+
<LiteChartTable {title} kind="funnel" columns={columns ?? ['Label', 'Value']} rows={normalized} {emptyText} />
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
title?: string;
|
|
3
|
+
data?: Array<Record<string, unknown>>;
|
|
4
|
+
rows?: Array<Array<string | number>>;
|
|
5
|
+
columns?: string[];
|
|
6
|
+
emptyText?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const LiteFunnelChart: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type LiteFunnelChart = ReturnType<typeof LiteFunnelChart>;
|
|
10
|
+
export default LiteFunnelChart;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import LiteChartSvg from './LiteChartSvg.svelte';
|
|
3
|
+
import LiteChartTable from './LiteChartTable.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
title?: string;
|
|
7
|
+
data?: Array<Record<string, unknown>>;
|
|
8
|
+
rows?: Array<Array<string | number>>;
|
|
9
|
+
columns?: string[];
|
|
10
|
+
emptyText?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { title, data = [], rows, columns, emptyText }: Props = $props();
|
|
14
|
+
const normalized = $derived(rows ?? data.map((item) => Object.values(item).map((value) => typeof value === 'number' ? value : String(value ?? ''))));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class="lite-chart-widget">
|
|
18
|
+
<LiteChartSvg kind="gauge" rows={normalized} {title} />
|
|
19
|
+
<LiteChartTable {title} kind="gauge" columns={columns ?? ['Label', 'Value']} rows={normalized} {emptyText} />
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
title?: string;
|
|
3
|
+
data?: Array<Record<string, unknown>>;
|
|
4
|
+
rows?: Array<Array<string | number>>;
|
|
5
|
+
columns?: string[];
|
|
6
|
+
emptyText?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const LiteGaugeChart: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type LiteGaugeChart = ReturnType<typeof LiteGaugeChart>;
|
|
10
|
+
export default LiteGaugeChart;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import LiteChartSvg from './LiteChartSvg.svelte';
|
|
3
|
+
import LiteChartTable from './LiteChartTable.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
title?: string;
|
|
7
|
+
data?: Array<Record<string, unknown>>;
|
|
8
|
+
rows?: Array<Array<string | number>>;
|
|
9
|
+
columns?: string[];
|
|
10
|
+
emptyText?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { title, data = [], rows, columns, emptyText }: Props = $props();
|
|
14
|
+
const normalized = $derived(rows ?? data.map((item) => Object.values(item).map((value) => typeof value === 'number' ? value : String(value ?? ''))));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class="lite-chart-widget">
|
|
18
|
+
<LiteChartSvg kind="heatmap" rows={normalized} {title} />
|
|
19
|
+
<LiteChartTable {title} kind="heatmap" columns={columns ?? ['Label', 'Value']} rows={normalized} {emptyText} />
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
title?: string;
|
|
3
|
+
data?: Array<Record<string, unknown>>;
|
|
4
|
+
rows?: Array<Array<string | number>>;
|
|
5
|
+
columns?: string[];
|
|
6
|
+
emptyText?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const LiteHeatmapChart: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type LiteHeatmapChart = ReturnType<typeof LiteHeatmapChart>;
|
|
10
|
+
export default LiteHeatmapChart;
|
|
@@ -1,31 +1,53 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { renderRichContent, type MarkdownRenderOptions } from '../../rich-content.js';
|
|
2
3
|
import { toSafeText } from '../../security.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
|
-
* SSR InsightCard —
|
|
6
|
-
* The SPA version streams AI-generated insights via ChatProvider
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* SSR InsightCard — static pre-rendered content.
|
|
7
|
+
* The SPA version streams AI-generated insights via ChatProvider; in Lite mode
|
|
8
|
+
* the insight must be computed on the server and passed as Markdown or
|
|
9
|
+
* allowlisted HTML, which is rendered here without hydration.
|
|
9
10
|
*/
|
|
10
11
|
interface Props {
|
|
11
12
|
title?: string;
|
|
12
13
|
content?: string;
|
|
14
|
+
/** Per-card renderer options; app-wide defaults come from configureMarkdownRenderer. */
|
|
15
|
+
renderOptions?: MarkdownRenderOptions;
|
|
13
16
|
}
|
|
14
17
|
|
|
15
|
-
let { title = 'Insights', content = '' }: Props = $props();
|
|
16
|
-
const
|
|
18
|
+
let { title = 'Insights', content = '', renderOptions }: Props = $props();
|
|
19
|
+
const renderedContent = $derived(renderRichContent(toSafeText(content), renderOptions));
|
|
17
20
|
</script>
|
|
18
21
|
|
|
19
|
-
<div class="lite-card" style="margin-bottom: 16px;">
|
|
20
|
-
<div class="lite-
|
|
22
|
+
<div class="lite-card lite-insight-card" style="margin-bottom: 16px;">
|
|
23
|
+
<div class="lite-insight-card__header" style="padding: 12px 16px; border-bottom: 1px solid #E5E6EB; font-weight: 600; font-size: 14px; color: #1D2129;">
|
|
21
24
|
<span style="color: #FF7D00;">✦</span>
|
|
22
25
|
{title}
|
|
23
26
|
</div>
|
|
24
|
-
<div style="padding: 16px; font-size: 14px; color: #1D2129; line-height: 1.6;">
|
|
25
|
-
{#if
|
|
26
|
-
|
|
27
|
+
<div class="lite-insight-card__body" style="padding: 16px; font-size: 14px; color: #1D2129; line-height: 1.6;">
|
|
28
|
+
{#if renderedContent}
|
|
29
|
+
<!-- eslint-disable-next-line svelte/no-at-html-tags -- 内容由 renderRichContent 转义或白名单过滤,高亮回调仅允许可信服务端实现。 -->
|
|
30
|
+
<div class="lite-insight-content">{@html renderedContent}</div>
|
|
27
31
|
{:else}
|
|
28
|
-
<p style="color: #86909C; font-style: italic;">No insights available. AI analysis requires JavaScript.</p>
|
|
32
|
+
<p style="color: #86909C; font-style: italic; margin: 0;">No insights available. AI analysis requires JavaScript.</p>
|
|
29
33
|
{/if}
|
|
30
34
|
</div>
|
|
31
35
|
</div>
|
|
36
|
+
|
|
37
|
+
<style>
|
|
38
|
+
.lite-insight-content :global(p) { margin: 0 0 8px; }
|
|
39
|
+
.lite-insight-content :global(p:last-child) { margin-bottom: 0; }
|
|
40
|
+
.lite-insight-content :global(ul),
|
|
41
|
+
.lite-insight-content :global(ol) { margin: 0 0 8px; padding-left: 20px; }
|
|
42
|
+
.lite-insight-content :global(h1),
|
|
43
|
+
.lite-insight-content :global(h2),
|
|
44
|
+
.lite-insight-content :global(h3) { margin: 10px 0 6px; font-size: 15px; }
|
|
45
|
+
.lite-insight-content :global(code) { padding: 1px 4px; border-radius: 3px; background: #F2F3F5; font-family: monospace; font-size: 12px; }
|
|
46
|
+
.lite-insight-content :global(pre) { margin: 0 0 8px; padding: 8px; overflow-x: auto; border-radius: 4px; background: #F2F3F5; }
|
|
47
|
+
.lite-insight-content :global(blockquote) { margin: 0 0 8px; padding-left: 10px; border-left: 3px solid #E5E6EB; color: #4E5969; }
|
|
48
|
+
.lite-insight-content :global(a) { color: #165DFF; }
|
|
49
|
+
.lite-insight-content :global(table) { width: 100%; margin: 0 0 8px; border-collapse: collapse; }
|
|
50
|
+
.lite-insight-content :global(th),
|
|
51
|
+
.lite-insight-content :global(td) { padding: 6px 8px; border: 1px solid #E5E6EB; text-align: left; }
|
|
52
|
+
.lite-insight-content :global(th) { background: #F2F3F5; font-weight: 600; }
|
|
53
|
+
</style>
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import { type MarkdownRenderOptions } from '../../rich-content.js';
|
|
1
2
|
/**
|
|
2
|
-
* SSR InsightCard —
|
|
3
|
-
* The SPA version streams AI-generated insights via ChatProvider
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* SSR InsightCard — static pre-rendered content.
|
|
4
|
+
* The SPA version streams AI-generated insights via ChatProvider; in Lite mode
|
|
5
|
+
* the insight must be computed on the server and passed as Markdown or
|
|
6
|
+
* allowlisted HTML, which is rendered here without hydration.
|
|
6
7
|
*/
|
|
7
8
|
interface Props {
|
|
8
9
|
title?: string;
|
|
9
10
|
content?: string;
|
|
11
|
+
/** Per-card renderer options; app-wide defaults come from configureMarkdownRenderer. */
|
|
12
|
+
renderOptions?: MarkdownRenderOptions;
|
|
10
13
|
}
|
|
11
14
|
declare const LiteInsightCard: import("svelte").Component<Props, {}, "">;
|
|
12
15
|
type LiteInsightCard = ReturnType<typeof LiteInsightCard>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
/**
|
|
3
|
-
* SSR LineChart —
|
|
4
|
-
*
|
|
5
|
-
* For maximum compatibility (IE11), we render data as a simple table.
|
|
3
|
+
* SSR LineChart — renders an inline SVG polyline plus the same values as an
|
|
4
|
+
* accessible data table. No charting library and no client JavaScript.
|
|
6
5
|
*/
|
|
6
|
+
import LiteChartSvg from './LiteChartSvg.svelte';
|
|
7
|
+
|
|
7
8
|
interface DataPoint {
|
|
8
9
|
label: string;
|
|
9
10
|
value: number;
|
|
@@ -16,6 +17,7 @@
|
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
let { data, title, valueLabel = 'Value' }: Props = $props();
|
|
20
|
+
const rows = $derived(data.map((point) => [point.label, point.value] as [string, number]));
|
|
19
21
|
</script>
|
|
20
22
|
|
|
21
23
|
<div class="lite-card" style="margin-bottom: 16px;">
|
|
@@ -24,6 +26,7 @@
|
|
|
24
26
|
{title}
|
|
25
27
|
</div>
|
|
26
28
|
{/if}
|
|
29
|
+
<LiteChartSvg kind="line" {rows} {title} />
|
|
27
30
|
<table style="width: 100%; border-collapse: collapse;">
|
|
28
31
|
<thead>
|
|
29
32
|
<tr>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
/**
|
|
3
|
-
* SSR PieChart —
|
|
4
|
-
* Drawing SVG pie charts inline is technically possible but IE11
|
|
5
|
-
* doesn't support CSS conic-gradient. We fall back to a plain list.
|
|
3
|
+
* SSR PieChart — renders SVG pie slices plus a list with the same shares.
|
|
6
4
|
*/
|
|
5
|
+
import LiteChartSvg from './LiteChartSvg.svelte';
|
|
6
|
+
|
|
7
7
|
interface DataPoint {
|
|
8
8
|
label: string;
|
|
9
9
|
value: number;
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
let { data, title }: Props = $props();
|
|
19
19
|
|
|
20
|
+
const rows = $derived(data.map((point) => [point.label, point.value] as [string, number]));
|
|
20
21
|
const total = $derived(data.reduce((sum, d) => sum + d.value, 0));
|
|
21
22
|
const defaultColors = ['#165DFF', '#FF7D00', '#00B42A', '#F53F3F', '#8b5cf6', '#06b6d4', '#f97316', '#ec4899'];
|
|
22
23
|
</script>
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
{title}
|
|
28
29
|
</div>
|
|
29
30
|
{/if}
|
|
31
|
+
<LiteChartSvg kind="pie" {rows} {title} />
|
|
30
32
|
<div class="lite-stack-md" style="padding: 16px;">
|
|
31
33
|
{#each data as point, i (i)}
|
|
32
34
|
{@const pct = total > 0 ? ((point.value / total) * 100).toFixed(1) : '0.0'}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import LiteChartSvg from './LiteChartSvg.svelte';
|
|
3
|
+
import LiteChartTable from './LiteChartTable.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
title?: string;
|
|
7
|
+
data?: Array<Record<string, unknown>>;
|
|
8
|
+
rows?: Array<Array<string | number>>;
|
|
9
|
+
columns?: string[];
|
|
10
|
+
emptyText?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { title, data = [], rows, columns, emptyText }: Props = $props();
|
|
14
|
+
const normalized = $derived(rows ?? data.map((item) => Object.values(item).map((value) => typeof value === 'number' ? value : String(value ?? ''))));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class="lite-chart-widget">
|
|
18
|
+
<LiteChartSvg kind="radar" rows={normalized} {title} />
|
|
19
|
+
<LiteChartTable {title} kind="radar" columns={columns ?? ['Label', 'Value']} rows={normalized} {emptyText} />
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
title?: string;
|
|
3
|
+
data?: Array<Record<string, unknown>>;
|
|
4
|
+
rows?: Array<Array<string | number>>;
|
|
5
|
+
columns?: string[];
|
|
6
|
+
emptyText?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const LiteRadarChart: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type LiteRadarChart = ReturnType<typeof LiteRadarChart>;
|
|
10
|
+
export default LiteRadarChart;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import LiteChartSvg from './LiteChartSvg.svelte';
|
|
3
|
+
import LiteChartTable from './LiteChartTable.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
title?: string;
|
|
7
|
+
data?: Array<Record<string, unknown>>;
|
|
8
|
+
rows?: Array<Array<string | number>>;
|
|
9
|
+
columns?: string[];
|
|
10
|
+
emptyText?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { title, data = [], rows, columns, emptyText }: Props = $props();
|
|
14
|
+
const normalized = $derived(rows ?? data.map((item) => Object.values(item).map((value) => typeof value === 'number' ? value : String(value ?? ''))));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class="lite-chart-widget">
|
|
18
|
+
<LiteChartSvg kind="rose" rows={normalized} {title} />
|
|
19
|
+
<LiteChartTable {title} kind="rose" columns={columns ?? ['Label', 'Value']} rows={normalized} {emptyText} />
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
title?: string;
|
|
3
|
+
data?: Array<Record<string, unknown>>;
|
|
4
|
+
rows?: Array<Array<string | number>>;
|
|
5
|
+
columns?: string[];
|
|
6
|
+
emptyText?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const LiteRoseChart: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type LiteRoseChart = ReturnType<typeof LiteRoseChart>;
|
|
10
|
+
export default LiteRoseChart;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import LiteChartSvg from './LiteChartSvg.svelte';
|
|
3
|
+
import LiteChartTable from './LiteChartTable.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
title?: string;
|
|
7
|
+
data?: Array<Record<string, unknown>>;
|
|
8
|
+
rows?: Array<Array<string | number>>;
|
|
9
|
+
columns?: string[];
|
|
10
|
+
emptyText?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { title, data = [], rows, columns, emptyText }: Props = $props();
|
|
14
|
+
const normalized = $derived(rows ?? data.map((item) => Object.values(item).map((value) => typeof value === 'number' ? value : String(value ?? ''))));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class="lite-chart-widget">
|
|
18
|
+
<LiteChartSvg kind="scatter" rows={normalized} {title} />
|
|
19
|
+
<LiteChartTable {title} kind="scatter" columns={columns ?? ['Label', 'Value']} rows={normalized} {emptyText} />
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
title?: string;
|
|
3
|
+
data?: Array<Record<string, unknown>>;
|
|
4
|
+
rows?: Array<Array<string | number>>;
|
|
5
|
+
columns?: string[];
|
|
6
|
+
emptyText?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const LiteScatterChart: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type LiteScatterChart = ReturnType<typeof LiteScatterChart>;
|
|
10
|
+
export default LiteScatterChart;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import LiteChartSvg from './LiteChartSvg.svelte';
|
|
3
|
+
import LiteChartTable from './LiteChartTable.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
title?: string;
|
|
7
|
+
data?: Array<Record<string, unknown>>;
|
|
8
|
+
rows?: Array<Array<string | number>>;
|
|
9
|
+
columns?: string[];
|
|
10
|
+
emptyText?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { title, data = [], rows, columns, emptyText }: Props = $props();
|
|
14
|
+
const normalized = $derived(rows ?? data.map((item) => Object.values(item).map((value) => typeof value === 'number' ? value : String(value ?? ''))));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class="lite-chart-widget">
|
|
18
|
+
<LiteChartSvg kind="waterfall" rows={normalized} {title} />
|
|
19
|
+
<LiteChartTable {title} kind="waterfall" columns={columns ?? ['Label', 'Value']} rows={normalized} {emptyText} />
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
title?: string;
|
|
3
|
+
data?: Array<Record<string, unknown>>;
|
|
4
|
+
rows?: Array<Array<string | number>>;
|
|
5
|
+
columns?: string[];
|
|
6
|
+
emptyText?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const LiteWaterfallChart: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type LiteWaterfallChart = ReturnType<typeof LiteWaterfallChart>;
|
|
10
|
+
export default LiteWaterfallChart;
|