@svadmin/ui 0.122.0 → 0.125.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/dist/app.css +561 -4
- package/dist/app.theme.css +561 -4
- package/dist/components/AbacPolicyMatrix.svelte +356 -0
- package/dist/components/AbacPolicyMatrix.svelte.d.ts +30 -0
- package/dist/components/AboutSettings.svelte +1 -1
- package/dist/components/ActionPalette.svelte +272 -0
- package/dist/components/ActionPalette.svelte.d.ts +23 -0
- package/dist/components/AdminCopilotWidget.svelte +316 -0
- package/dist/components/AdminCopilotWidget.svelte.d.ts +33 -0
- package/dist/components/AnnouncementBanner.svelte +12 -1
- package/dist/components/AnnouncementBanner.svelte.d.ts +4 -0
- package/dist/components/ApiPlayground.svelte +255 -0
- package/dist/components/ApiPlayground.svelte.d.ts +24 -0
- package/dist/components/ApprovalChainBuilder.svelte +262 -0
- package/dist/components/ApprovalChainBuilder.svelte.d.ts +20 -0
- package/dist/components/ApprovalTimeline.svelte +8 -1
- package/dist/components/AsyncExportModal.svelte +1 -1
- package/dist/components/AudioFeedbackProvider.svelte +1 -1
- package/dist/components/AuditTrailInspector.svelte +448 -0
- package/dist/components/AuditTrailInspector.svelte.d.ts +44 -0
- package/dist/components/BatchEditModal.svelte +266 -0
- package/dist/components/BatchEditModal.svelte.d.ts +27 -0
- package/dist/components/BillingInvoiceDrawer.svelte +206 -0
- package/dist/components/BillingInvoiceDrawer.svelte.d.ts +30 -0
- package/dist/components/ChartAnnotationOverlay.svelte +228 -0
- package/dist/components/ChartAnnotationOverlay.svelte.d.ts +21 -0
- package/dist/components/ClusterTopologyGraph.svelte +317 -0
- package/dist/components/ClusterTopologyGraph.svelte.d.ts +31 -0
- package/dist/components/ColumnMappingTable.svelte +174 -0
- package/dist/components/ColumnMappingTable.svelte.d.ts +23 -0
- package/dist/components/ConversionFunnel.svelte +1 -1
- package/dist/components/CursorListFooter.svelte +67 -0
- package/dist/components/CursorListFooter.svelte.d.ts +17 -0
- package/dist/components/DashboardGridLayout.svelte +309 -0
- package/dist/components/DashboardGridLayout.svelte.d.ts +30 -0
- package/dist/components/DashboardLayoutStorage.svelte +278 -0
- package/dist/components/DashboardLayoutStorage.svelte.d.ts +23 -0
- package/dist/components/DataFreshnessIndicator.svelte +149 -0
- package/dist/components/DataFreshnessIndicator.svelte.d.ts +20 -0
- package/dist/components/DataImportDropzone.svelte +215 -0
- package/dist/components/DataImportDropzone.svelte.d.ts +24 -0
- package/dist/components/DataLineageGraph.svelte +203 -0
- package/dist/components/DataLineageGraph.svelte.d.ts +26 -0
- package/dist/components/DataMaskPolicyEngine.svelte +291 -0
- package/dist/components/DataMaskPolicyEngine.svelte.d.ts +25 -0
- package/dist/components/DataScopeRuleEditor.svelte +142 -0
- package/dist/components/DataScopeRuleEditor.svelte.d.ts +19 -0
- package/dist/components/DataScreenContainer.svelte +160 -0
- package/dist/components/DataScreenContainer.svelte.d.ts +15 -0
- package/dist/components/DevTools.svelte +3 -3
- package/dist/components/DualApprovalGate.svelte +132 -65
- package/dist/components/DualApprovalGate.svelte.d.ts +20 -1
- package/dist/components/ElectronicSealStamp.svelte +102 -0
- package/dist/components/ElectronicSealStamp.svelte.d.ts +14 -0
- package/dist/components/EnvVariableEditor.svelte +284 -0
- package/dist/components/EnvVariableEditor.svelte.d.ts +17 -0
- package/dist/components/FeatureAnnouncementModal.svelte +173 -0
- package/dist/components/FeatureAnnouncementModal.svelte.d.ts +21 -0
- package/dist/components/FilterTagBar.svelte +210 -0
- package/dist/components/FilterTagBar.svelte.d.ts +23 -0
- package/dist/components/FormulaField.svelte +149 -0
- package/dist/components/FormulaField.svelte.d.ts +18 -0
- package/dist/components/GeoScatterMap.svelte +225 -0
- package/dist/components/GeoScatterMap.svelte.d.ts +22 -0
- package/dist/components/HmacSignatureCalculator.svelte +199 -0
- package/dist/components/HmacSignatureCalculator.svelte.d.ts +10 -0
- package/dist/components/I18nLanguagePackEditor.svelte +208 -0
- package/dist/components/I18nLanguagePackEditor.svelte.d.ts +17 -0
- package/dist/components/ImportPreviewValidator.svelte +239 -0
- package/dist/components/ImportPreviewValidator.svelte.d.ts +26 -0
- package/dist/components/IncidentWarRoomDrawer.svelte +194 -0
- package/dist/components/IncidentWarRoomDrawer.svelte.d.ts +24 -0
- package/dist/components/JsonSchemaForm.svelte +4 -4
- package/dist/components/ListPagination.svelte +39 -3
- package/dist/components/LiveStreamLogViewer.svelte +185 -0
- package/dist/components/LiveStreamLogViewer.svelte.d.ts +21 -0
- package/dist/components/MasterSubTableDrawer.svelte +223 -0
- package/dist/components/MasterSubTableDrawer.svelte.d.ts +25 -0
- package/dist/components/MockDataInterceptor.svelte +292 -0
- package/dist/components/MockDataInterceptor.svelte.d.ts +27 -0
- package/dist/components/OmnibarCommandPalette.svelte +320 -0
- package/dist/components/OmnibarCommandPalette.svelte.d.ts +27 -0
- package/dist/components/PageSkeleton.svelte +19 -5
- package/dist/components/PageSkeleton.svelte.d.ts +5 -3
- package/dist/components/PeriodComparisonCard.svelte +142 -0
- package/dist/components/PeriodComparisonCard.svelte.d.ts +16 -0
- package/dist/components/PermissionSimulator.svelte +319 -0
- package/dist/components/PermissionSimulator.svelte.d.ts +34 -0
- package/dist/components/PivotMatrix.svelte +271 -0
- package/dist/components/PivotMatrix.svelte.d.ts +32 -0
- package/dist/components/PlanUsageQuotaBar.svelte +154 -0
- package/dist/components/PlanUsageQuotaBar.svelte.d.ts +26 -0
- package/dist/components/Popconfirm.svelte +20 -8
- package/dist/components/Popconfirm.svelte.d.ts +3 -1
- package/dist/components/ProSkeleton.svelte +4 -0
- package/dist/components/ProSkeleton.svelte.d.ts +2 -0
- package/dist/components/QueryAiExplainer.svelte +148 -0
- package/dist/components/QueryAiExplainer.svelte.d.ts +16 -0
- package/dist/components/QueryBuilder.svelte +456 -0
- package/dist/components/QueryBuilder.svelte.d.ts +33 -0
- package/dist/components/RolePermissionComparator.svelte +273 -0
- package/dist/components/RolePermissionComparator.svelte.d.ts +28 -0
- package/dist/components/RuleExpressionBuilder.svelte +380 -0
- package/dist/components/RuleExpressionBuilder.svelte.d.ts +31 -0
- package/dist/components/ScheduledJobManager.svelte +225 -0
- package/dist/components/ScheduledJobManager.svelte.d.ts +23 -0
- package/dist/components/ScreenAntiLeakGuard.svelte +88 -0
- package/dist/components/ScreenAntiLeakGuard.svelte.d.ts +12 -0
- package/dist/components/SecureDataExporter.svelte +296 -0
- package/dist/components/SecureDataExporter.svelte.d.ts +29 -0
- package/dist/components/ServerStatusGrid.svelte +179 -0
- package/dist/components/ServerStatusGrid.svelte.d.ts +21 -0
- package/dist/components/SnapshotTimelineReplay.svelte +219 -0
- package/dist/components/SnapshotTimelineReplay.svelte.d.ts +19 -0
- package/dist/components/SqlConsole.svelte +247 -0
- package/dist/components/SqlConsole.svelte.d.ts +20 -0
- package/dist/components/StepWizard.svelte +1 -1
- package/dist/components/SystemCapacityForecastCard.svelte +132 -0
- package/dist/components/SystemCapacityForecastCard.svelte.d.ts +19 -0
- package/dist/components/SystemHealthCheckDashboard.svelte +306 -0
- package/dist/components/SystemHealthCheckDashboard.svelte.d.ts +24 -0
- package/dist/components/TableAggregationFooter.svelte +173 -0
- package/dist/components/TableAggregationFooter.svelte.d.ts +22 -0
- package/dist/components/TaskCenter.svelte +37 -29
- package/dist/components/TenantContextSwitcher.svelte +314 -0
- package/dist/components/TenantContextSwitcher.svelte.d.ts +35 -0
- package/dist/components/TenantQuotasMatrix.svelte +229 -0
- package/dist/components/TenantQuotasMatrix.svelte.d.ts +22 -0
- package/dist/components/ThreadedCommentDrawer.svelte +246 -0
- package/dist/components/ThreadedCommentDrawer.svelte.d.ts +26 -0
- package/dist/components/TierFeatureComparison.svelte +147 -0
- package/dist/components/TierFeatureComparison.svelte.d.ts +28 -0
- package/dist/components/TreeTransferSelect.svelte +333 -0
- package/dist/components/TreeTransferSelect.svelte.d.ts +18 -0
- package/dist/components/VirtualCardGrid.svelte +180 -0
- package/dist/components/VirtualCardGrid.svelte.d.ts +65 -0
- package/dist/components/WebhookSimulator.svelte +263 -0
- package/dist/components/WebhookSimulator.svelte.d.ts +26 -0
- package/dist/components/WidgetContainer.svelte +204 -0
- package/dist/components/WidgetContainer.svelte.d.ts +31 -0
- package/dist/components/WorkflowExecutionTracker.svelte +131 -0
- package/dist/components/WorkflowExecutionTracker.svelte.d.ts +19 -0
- package/dist/components/WorkflowGraphDesigner.svelte +202 -0
- package/dist/components/WorkflowGraphDesigner.svelte.d.ts +24 -0
- package/dist/components/WorkflowNodeInspector.svelte +217 -0
- package/dist/components/WorkflowNodeInspector.svelte.d.ts +24 -0
- package/dist/components/WorkflowStepper.svelte +1 -1
- package/dist/components/list-i18n.d.ts +7 -0
- package/dist/components/list-i18n.js +14 -0
- package/dist/components/ui/button/button.svelte +3 -1
- package/dist/components/ui/button/button.svelte.d.ts +1 -0
- package/dist/components/ui/tooltip/tooltip-content.svelte +1 -1
- package/dist/components/useDynamicLocale.d.svelte.ts +1 -0
- package/dist/components/useDynamicLocale.svelte.d.ts +10 -0
- package/dist/components/useDynamicLocale.svelte.js +40 -0
- package/dist/components/useFormulaEngine.d.svelte.ts +1 -0
- package/dist/components/useFormulaEngine.svelte.d.ts +9 -0
- package/dist/components/useFormulaEngine.svelte.js +209 -0
- package/dist/components/useStorageCache.d.svelte.ts +1 -0
- package/dist/components/useStorageCache.svelte.d.ts +49 -0
- package/dist/components/useStorageCache.svelte.js +229 -0
- package/dist/components.css +1 -1
- package/dist/index.d.ts +69 -3
- package/dist/index.js +112 -2
- package/package.json +4 -4
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { untrack } from 'svelte';
|
|
3
|
+
import { ArrowRightLeft, AlertTriangle, CheckCircle2, Table } from '@lucide/svelte';
|
|
4
|
+
import { cn } from '../utils.js';
|
|
5
|
+
|
|
6
|
+
export interface TargetFieldConfig {
|
|
7
|
+
key: string;
|
|
8
|
+
label: string;
|
|
9
|
+
type?: string | undefined;
|
|
10
|
+
required?: boolean | undefined;
|
|
11
|
+
description?: string | undefined;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ColumnMappingTableProps {
|
|
15
|
+
/** 目标系统字段规范 */
|
|
16
|
+
targetFields: TargetFieldConfig[];
|
|
17
|
+
/** 源文件解析出的表头列名 */
|
|
18
|
+
sourceColumns: string[];
|
|
19
|
+
/** 每列前若干行样本数据,辅助操作员核对 */
|
|
20
|
+
sampleData?: Record<string, unknown[]> | undefined;
|
|
21
|
+
/** 初始映射关系 (targetFieldKey -> sourceColumnName) */
|
|
22
|
+
initialMapping?: Record<string, string> | undefined;
|
|
23
|
+
/** 映射关系发生变更时的回调 */
|
|
24
|
+
onmappingchange?: ((mapping: Record<string, string>) => void) | undefined;
|
|
25
|
+
class?: string | undefined;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let {
|
|
29
|
+
targetFields = [],
|
|
30
|
+
sourceColumns = [],
|
|
31
|
+
sampleData = {},
|
|
32
|
+
initialMapping,
|
|
33
|
+
onmappingchange,
|
|
34
|
+
class: className = '',
|
|
35
|
+
}: ColumnMappingTableProps = $props();
|
|
36
|
+
|
|
37
|
+
function autoInferMapping(): Record<string, string> {
|
|
38
|
+
const map: Record<string, string> = {};
|
|
39
|
+
for (const tf of targetFields) {
|
|
40
|
+
const tfLabel = tf.label.toLowerCase().replace(/[\s_-]+/g, '');
|
|
41
|
+
const tfKey = tf.key.toLowerCase().replace(/[\s_-]+/g, '');
|
|
42
|
+
|
|
43
|
+
const matched = sourceColumns.find((sc) => {
|
|
44
|
+
const scClean = sc.toLowerCase().replace(/[\s_-]+/g, '');
|
|
45
|
+
return scClean === tfLabel || scClean === tfKey || scClean.includes(tfLabel);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
if (matched) {
|
|
49
|
+
map[tf.key] = matched;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return map;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
let currentMapping = $state<Record<string, string>>(
|
|
56
|
+
untrack(() => initialMapping ?? autoInferMapping())
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
function handleSelectColumn(targetKey: string, sourceCol: string) {
|
|
60
|
+
if (sourceCol === '') {
|
|
61
|
+
currentMapping = Object.fromEntries(Object.entries(currentMapping).filter(([k]) => k !== targetKey));
|
|
62
|
+
} else {
|
|
63
|
+
currentMapping = { ...currentMapping, [targetKey]: sourceCol };
|
|
64
|
+
}
|
|
65
|
+
onmappingchange?.(currentMapping);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const unmappedRequiredFields = $derived.by(() => {
|
|
69
|
+
return targetFields.filter((tf) => tf.required && !currentMapping[tf.key]);
|
|
70
|
+
});
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<div
|
|
74
|
+
class={cn('rounded-xl border border-border bg-card p-5 text-card-foreground shadow-xs space-y-4', className)}
|
|
75
|
+
data-svadmin-component="ColumnMappingTable"
|
|
76
|
+
>
|
|
77
|
+
<!-- Header -->
|
|
78
|
+
<header class="flex flex-wrap items-center justify-between gap-3 border-b border-border pb-3">
|
|
79
|
+
<div class="flex items-center gap-2">
|
|
80
|
+
<Table class="h-4 w-4 text-primary" />
|
|
81
|
+
<h3 class="font-bold text-sm text-foreground">字段映射配置表 (Column Mapping)</h3>
|
|
82
|
+
</div>
|
|
83
|
+
<span class="text-xs font-mono text-muted-foreground">
|
|
84
|
+
已映射: <strong class="text-foreground">{Object.keys(currentMapping).length}</strong> / {targetFields.length} 个字段
|
|
85
|
+
</span>
|
|
86
|
+
</header>
|
|
87
|
+
|
|
88
|
+
<!-- Required Warning if missing -->
|
|
89
|
+
{#if unmappedRequiredFields.length > 0}
|
|
90
|
+
<div class="rounded-lg bg-warning/10 border border-warning/30 p-3 flex items-start gap-2 text-xs text-warning">
|
|
91
|
+
<AlertTriangle class="h-4 w-4 shrink-0 mt-0.5" />
|
|
92
|
+
<div>
|
|
93
|
+
<span class="font-bold">缺少必填字段映射:</span>
|
|
94
|
+
<span>
|
|
95
|
+
仍有 <strong>{unmappedRequiredFields.length}</strong> 个必填字段尚未映射({unmappedRequiredFields.map((f) => f.label).join('、')}),请选择源文件对应列。
|
|
96
|
+
</span>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
{/if}
|
|
100
|
+
|
|
101
|
+
<!-- Mapping Table -->
|
|
102
|
+
<div class="rounded-lg border border-border overflow-x-auto">
|
|
103
|
+
<table class="w-full border-collapse text-xs">
|
|
104
|
+
<thead class="bg-muted/40 border-b border-border text-muted-foreground font-mono">
|
|
105
|
+
<tr>
|
|
106
|
+
<th class="p-3 text-left font-medium w-2/5">系统目标字段 (Target Field)</th>
|
|
107
|
+
<th class="p-3 text-center font-medium w-12"><ArrowRightLeft class="h-3.5 w-3.5 mx-auto" /></th>
|
|
108
|
+
<th class="p-3 text-left font-medium w-2/5">源文件表头列 (Source Header)</th>
|
|
109
|
+
<th class="p-3 text-left font-medium w-1/5">样例数据预览 (Sample)</th>
|
|
110
|
+
</tr>
|
|
111
|
+
</thead>
|
|
112
|
+
<tbody class="divide-y divide-border/60">
|
|
113
|
+
{#each targetFields as tf (tf.key)}
|
|
114
|
+
{@const selectedCol = currentMapping[tf.key] ?? ''}
|
|
115
|
+
{@const samples = selectedCol && sampleData ? sampleData[selectedCol] : undefined}
|
|
116
|
+
<tr class="hover:bg-muted/20 transition-colors">
|
|
117
|
+
<!-- Target Field -->
|
|
118
|
+
<td class="p-3">
|
|
119
|
+
<div class="flex items-center gap-1.5">
|
|
120
|
+
<span class="font-semibold text-foreground">{tf.label}</span>
|
|
121
|
+
{#if tf.required}
|
|
122
|
+
<span class="text-destructive font-bold" title="必填项">*</span>
|
|
123
|
+
{/if}
|
|
124
|
+
<code class="font-mono text-[11px] text-muted-foreground bg-muted px-1 rounded">{tf.key}</code>
|
|
125
|
+
</div>
|
|
126
|
+
{#if tf.description}
|
|
127
|
+
<span class="text-[11px] text-muted-foreground block mt-0.5">{tf.description}</span>
|
|
128
|
+
{/if}
|
|
129
|
+
</td>
|
|
130
|
+
|
|
131
|
+
<!-- Arrow -->
|
|
132
|
+
<td class="p-3 text-center text-muted-foreground select-none">←</td>
|
|
133
|
+
|
|
134
|
+
<!-- Source Column Picker -->
|
|
135
|
+
<td class="p-3">
|
|
136
|
+
<select
|
|
137
|
+
class={cn(
|
|
138
|
+
'w-full rounded-md border bg-background px-3 py-1.5 text-xs font-mono outline-none focus:ring-1 focus:ring-primary',
|
|
139
|
+
selectedCol
|
|
140
|
+
? 'border-primary/40 font-semibold text-foreground'
|
|
141
|
+
: tf.required
|
|
142
|
+
? 'border-destructive/40 text-muted-foreground bg-destructive/5'
|
|
143
|
+
: 'border-input text-muted-foreground'
|
|
144
|
+
)}
|
|
145
|
+
value={selectedCol}
|
|
146
|
+
onchange={(e) => handleSelectColumn(tf.key, (e.currentTarget as HTMLSelectElement).value)}
|
|
147
|
+
>
|
|
148
|
+
<option value="">— 不导入此列 (忽略) —</option>
|
|
149
|
+
{#each sourceColumns as sc (sc)}
|
|
150
|
+
<option value={sc}>{sc}</option>
|
|
151
|
+
{/each}
|
|
152
|
+
</select>
|
|
153
|
+
</td>
|
|
154
|
+
|
|
155
|
+
<!-- Sample Data Preview -->
|
|
156
|
+
<td class="p-3 font-mono text-[11px] text-muted-foreground">
|
|
157
|
+
{#if selectedCol && samples && samples.length > 0}
|
|
158
|
+
<span class="truncate block max-w-[180px] text-foreground" title={samples.slice(0, 3).join(', ')}>
|
|
159
|
+
{samples.slice(0, 3).join(', ')}
|
|
160
|
+
</span>
|
|
161
|
+
{:else if selectedCol}
|
|
162
|
+
<span class="text-success inline-flex items-center gap-1">
|
|
163
|
+
<CheckCircle2 class="h-3 w-3" /> 已关联
|
|
164
|
+
</span>
|
|
165
|
+
{:else}
|
|
166
|
+
<span class="text-muted-foreground/60">—</span>
|
|
167
|
+
{/if}
|
|
168
|
+
</td>
|
|
169
|
+
</tr>
|
|
170
|
+
{/each}
|
|
171
|
+
</tbody>
|
|
172
|
+
</table>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface TargetFieldConfig {
|
|
2
|
+
key: string;
|
|
3
|
+
label: string;
|
|
4
|
+
type?: string | undefined;
|
|
5
|
+
required?: boolean | undefined;
|
|
6
|
+
description?: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
export interface ColumnMappingTableProps {
|
|
9
|
+
/** 目标系统字段规范 */
|
|
10
|
+
targetFields: TargetFieldConfig[];
|
|
11
|
+
/** 源文件解析出的表头列名 */
|
|
12
|
+
sourceColumns: string[];
|
|
13
|
+
/** 每列前若干行样本数据,辅助操作员核对 */
|
|
14
|
+
sampleData?: Record<string, unknown[]> | undefined;
|
|
15
|
+
/** 初始映射关系 (targetFieldKey -> sourceColumnName) */
|
|
16
|
+
initialMapping?: Record<string, string> | undefined;
|
|
17
|
+
/** 映射关系发生变更时的回调 */
|
|
18
|
+
onmappingchange?: ((mapping: Record<string, string>) => void) | undefined;
|
|
19
|
+
class?: string | undefined;
|
|
20
|
+
}
|
|
21
|
+
declare const ColumnMappingTable: import("svelte").Component<ColumnMappingTableProps, {}, "">;
|
|
22
|
+
type ColumnMappingTable = ReturnType<typeof ColumnMappingTable>;
|
|
23
|
+
export default ColumnMappingTable;
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
class: className = '',
|
|
37
37
|
onSelectStage,
|
|
38
38
|
}: ConversionFunnelProps = $props();
|
|
39
|
-
void height;
|
|
40
39
|
|
|
41
40
|
const i18n = useTranslation();
|
|
42
41
|
const chinese = $derived(i18n.locale.startsWith('zh'));
|
|
@@ -68,6 +67,7 @@
|
|
|
68
67
|
|
|
69
68
|
<div
|
|
70
69
|
data-svadmin-component="ConversionFunnel"
|
|
70
|
+
style="min-height: {height}px;"
|
|
71
71
|
class={cn(
|
|
72
72
|
'w-full rounded-md border border-border bg-card text-card-foreground shadow-xs p-6 space-y-4',
|
|
73
73
|
className,
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { useTranslation } from '@svadmin/core/i18n';
|
|
4
|
+
import { listText } from './list-i18n.js';
|
|
5
|
+
|
|
6
|
+
type Props = Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'children'> & {
|
|
7
|
+
label: string;
|
|
8
|
+
page: number;
|
|
9
|
+
loadedCount: number;
|
|
10
|
+
hasPrevious: boolean;
|
|
11
|
+
hasNext: boolean;
|
|
12
|
+
loading?: boolean | undefined;
|
|
13
|
+
note?: string | undefined;
|
|
14
|
+
sectionId?: string | undefined;
|
|
15
|
+
onPrevious: () => void;
|
|
16
|
+
onNext: () => void;
|
|
17
|
+
class?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
let {
|
|
21
|
+
label,
|
|
22
|
+
page,
|
|
23
|
+
loadedCount,
|
|
24
|
+
hasPrevious,
|
|
25
|
+
hasNext,
|
|
26
|
+
loading = false,
|
|
27
|
+
note = '',
|
|
28
|
+
sectionId,
|
|
29
|
+
onPrevious,
|
|
30
|
+
onNext,
|
|
31
|
+
class: className = '',
|
|
32
|
+
...restProps
|
|
33
|
+
}: Props = $props();
|
|
34
|
+
|
|
35
|
+
const i18n = useTranslation();
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<div {...restProps} class={`svadmin-cursor-list-footer ${className}`.trim()} data-svadmin-cursor-list-footer data-section={sectionId}>
|
|
39
|
+
<div class="svadmin-cursor-list-footer__status" aria-live="polite">
|
|
40
|
+
<span>{listText(i18n, 'cursorListFooter.loaded', { count: loadedCount })}</span>
|
|
41
|
+
{#if note}<span class="svadmin-cursor-list-footer__note">{note}</span>{/if}
|
|
42
|
+
</div>
|
|
43
|
+
<div class="svadmin-cursor-list-footer__navigation" role="navigation" aria-label={listText(i18n, 'cursorListFooter.navigation', { label })}>
|
|
44
|
+
<button type="button" class="svadmin-cursor-list-footer__control" disabled={loading || !hasPrevious}
|
|
45
|
+
title={listText(i18n, hasPrevious ? 'cursorListFooter.previousAria' : 'cursorListFooter.firstPage', { label })}
|
|
46
|
+
aria-label={listText(i18n, 'cursorListFooter.previousAria', { label })} onclick={onPrevious}>
|
|
47
|
+
← {listText(i18n, 'listPagination.previous')}
|
|
48
|
+
</button>
|
|
49
|
+
<span class="svadmin-cursor-list-footer__page">{listText(i18n, 'cursorListFooter.page', { page })}</span>
|
|
50
|
+
<button type="button" class="svadmin-cursor-list-footer__control" disabled={loading || !hasNext}
|
|
51
|
+
title={listText(i18n, hasNext ? 'cursorListFooter.nextAria' : 'cursorListFooter.nextUnavailable', { label })}
|
|
52
|
+
aria-label={listText(i18n, 'cursorListFooter.nextAria', { label })} onclick={onNext}>
|
|
53
|
+
{listText(i18n, 'listPagination.next')} →
|
|
54
|
+
</button>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<style>
|
|
59
|
+
.svadmin-cursor-list-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem 1rem; min-width: 0; border-top: 1px solid var(--border); padding: .75rem 0 0; }
|
|
60
|
+
.svadmin-cursor-list-footer__status { display: flex; align-items: baseline; flex-wrap: wrap; gap: .35rem .75rem; min-width: 0; font-size: .8125rem; color: var(--muted-foreground); }
|
|
61
|
+
.svadmin-cursor-list-footer__note { color: var(--foreground); }
|
|
62
|
+
.svadmin-cursor-list-footer__navigation { display: flex; align-items: center; gap: .5rem; }
|
|
63
|
+
.svadmin-cursor-list-footer__control { min-width: 2.25rem; min-height: 2.25rem; border: 1px solid var(--border); border-radius: .375rem; background: var(--background); color: inherit; padding: 0 .75rem; cursor: pointer; font: inherit; font-size: .8125rem; }
|
|
64
|
+
.svadmin-cursor-list-footer__control:hover:not(:disabled) { border-color: var(--ring); color: var(--primary); }
|
|
65
|
+
.svadmin-cursor-list-footer__control:disabled { cursor: not-allowed; opacity: .55; }
|
|
66
|
+
.svadmin-cursor-list-footer__page { min-width: 4rem; color: var(--muted-foreground); font-size: .8125rem; text-align: center; }
|
|
67
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
type Props = Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'children'> & {
|
|
3
|
+
label: string;
|
|
4
|
+
page: number;
|
|
5
|
+
loadedCount: number;
|
|
6
|
+
hasPrevious: boolean;
|
|
7
|
+
hasNext: boolean;
|
|
8
|
+
loading?: boolean | undefined;
|
|
9
|
+
note?: string | undefined;
|
|
10
|
+
sectionId?: string | undefined;
|
|
11
|
+
onPrevious: () => void;
|
|
12
|
+
onNext: () => void;
|
|
13
|
+
class?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
declare const CursorListFooter: import("svelte").Component<Props, {}, "">;
|
|
16
|
+
type CursorListFooter = ReturnType<typeof CursorListFooter>;
|
|
17
|
+
export default CursorListFooter;
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
LayoutDashboard,
|
|
4
|
+
GripVertical,
|
|
5
|
+
Plus,
|
|
6
|
+
RotateCcw,
|
|
7
|
+
Edit3,
|
|
8
|
+
Check,
|
|
9
|
+
Trash2,
|
|
10
|
+
Lock,
|
|
11
|
+
Unlock,
|
|
12
|
+
Maximize2,
|
|
13
|
+
Minimize2,
|
|
14
|
+
BarChart3,
|
|
15
|
+
Table as TableIcon,
|
|
16
|
+
} from '@lucide/svelte';
|
|
17
|
+
import { cn } from '../utils.js';
|
|
18
|
+
import { Button } from './ui/button/index.js';
|
|
19
|
+
|
|
20
|
+
export interface DashboardGridItem {
|
|
21
|
+
id: string;
|
|
22
|
+
title: string;
|
|
23
|
+
x?: number | undefined;
|
|
24
|
+
y?: number | undefined;
|
|
25
|
+
w: number; // 1..12
|
|
26
|
+
h: number; // rows
|
|
27
|
+
minW?: number | undefined;
|
|
28
|
+
minH?: number | undefined;
|
|
29
|
+
static?: boolean | undefined;
|
|
30
|
+
category?: string | undefined;
|
|
31
|
+
widgetType?: 'kpi' | 'chart' | 'table' | 'log' | 'custom' | undefined;
|
|
32
|
+
description?: string | undefined;
|
|
33
|
+
metricValue?: string | number | undefined;
|
|
34
|
+
metricTrend?: string | undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface DashboardGridLayoutProps {
|
|
38
|
+
items?: DashboardGridItem[] | undefined;
|
|
39
|
+
isEditable?: boolean | undefined;
|
|
40
|
+
title?: string | undefined;
|
|
41
|
+
description?: string | undefined;
|
|
42
|
+
class?: string | undefined;
|
|
43
|
+
onLayoutChange?: ((items: DashboardGridItem[]) => void) | undefined;
|
|
44
|
+
onAddWidget?: ((type: DashboardGridItem['widgetType']) => void) | undefined;
|
|
45
|
+
onRemoveWidget?: ((id: string) => void) | undefined;
|
|
46
|
+
onResetLayout?: (() => void) | undefined;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
let {
|
|
50
|
+
items = $bindable([
|
|
51
|
+
{ id: 'wgt-kpi-rev', title: '本季度核心营收 (GMV)', w: 4, h: 2, widgetType: 'kpi', category: '财务', metricValue: '¥48,290,000', metricTrend: '+18.4% 同比' },
|
|
52
|
+
{ id: 'wgt-kpi-users', title: '全局活跃企业租户数', w: 4, h: 2, widgetType: 'kpi', category: 'SaaS', metricValue: '1,420 家', metricTrend: '+12.1% 环比' },
|
|
53
|
+
{ id: 'wgt-kpi-sla', title: '核心网关可用率 (SLA)', w: 4, h: 2, widgetType: 'kpi', category: 'SRE', metricValue: '99.985%', metricTrend: '稳定运行 42天' },
|
|
54
|
+
{ id: 'wgt-chart-trend', title: '双大区实时业务吞吐量趋势', w: 8, h: 4, widgetType: 'chart', category: '监控', description: '华东大区与华北多活集群实时 QPS 波动曲线' },
|
|
55
|
+
{ id: 'wgt-table-orders', title: '最新待审批大额采购单', w: 4, h: 4, widgetType: 'table', category: '审批', description: '超 10 万元资金划转与双人复核队列' },
|
|
56
|
+
]),
|
|
57
|
+
isEditable = $bindable(false),
|
|
58
|
+
title = '智能动态业务大屏 (Dashboard Grid)',
|
|
59
|
+
description = '12 栅格自适应流式排版,支持小部件拖拽、尺寸自由伸缩与布局方案持久化',
|
|
60
|
+
class: className = '',
|
|
61
|
+
onLayoutChange,
|
|
62
|
+
onAddWidget,
|
|
63
|
+
onRemoveWidget,
|
|
64
|
+
onResetLayout,
|
|
65
|
+
}: DashboardGridLayoutProps = $props();
|
|
66
|
+
|
|
67
|
+
function toggleEditable() {
|
|
68
|
+
isEditable = !isEditable;
|
|
69
|
+
if (!isEditable) {
|
|
70
|
+
onLayoutChange?.(items);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function resizeItem(id: string, deltaW: number, deltaH: number) {
|
|
75
|
+
items = items.map((it) => {
|
|
76
|
+
if (it.id !== id || it.static) return it;
|
|
77
|
+
const newW = Math.max(1, Math.min(12, it.w + deltaW));
|
|
78
|
+
const newH = Math.max(1, Math.min(8, it.h + deltaH));
|
|
79
|
+
return { ...it, w: newW, h: newH };
|
|
80
|
+
});
|
|
81
|
+
onLayoutChange?.(items);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function toggleLock(id: string) {
|
|
85
|
+
items = items.map((it) => {
|
|
86
|
+
if (it.id !== id) return it;
|
|
87
|
+
return { ...it, static: !it.static };
|
|
88
|
+
});
|
|
89
|
+
onLayoutChange?.(items);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function removeItem(id: string) {
|
|
93
|
+
items = items.filter((it) => it.id !== id);
|
|
94
|
+
onRemoveWidget?.(id);
|
|
95
|
+
onLayoutChange?.(items);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function addSampleWidget(type: DashboardGridItem['widgetType'] = 'kpi') {
|
|
99
|
+
const id = `wgt-${Date.now()}`;
|
|
100
|
+
const newWidget: DashboardGridItem = {
|
|
101
|
+
id,
|
|
102
|
+
title: type === 'kpi' ? '新指标计分卡' : type === 'chart' ? '新业务统计图表' : '新待办数据表',
|
|
103
|
+
w: type === 'chart' ? 6 : 4,
|
|
104
|
+
h: type === 'chart' ? 3 : 2,
|
|
105
|
+
widgetType: type,
|
|
106
|
+
category: '自定义',
|
|
107
|
+
metricValue: type === 'kpi' ? '98.5%' : undefined,
|
|
108
|
+
};
|
|
109
|
+
items = [...items, newWidget];
|
|
110
|
+
onAddWidget?.(type);
|
|
111
|
+
onLayoutChange?.(items);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function resetToDefault() {
|
|
115
|
+
onResetLayout?.();
|
|
116
|
+
}
|
|
117
|
+
</script>
|
|
118
|
+
|
|
119
|
+
<div
|
|
120
|
+
class={cn('w-full rounded-2xl border border-border bg-card text-foreground shadow-sm flex flex-col overflow-hidden', className)}
|
|
121
|
+
data-svadmin-component="dashboard-grid-layout"
|
|
122
|
+
>
|
|
123
|
+
<!-- 头部控制栏 -->
|
|
124
|
+
<div class="p-4 border-b border-border bg-muted/10 flex flex-col sm:flex-row sm:items-center justify-between gap-3">
|
|
125
|
+
<div class="flex items-center gap-2.5">
|
|
126
|
+
<div class="flex items-center justify-center w-8 h-8 rounded-lg bg-primary/10 text-primary border border-primary/20 shrink-0">
|
|
127
|
+
<LayoutDashboard class="w-4 h-4" />
|
|
128
|
+
</div>
|
|
129
|
+
<div>
|
|
130
|
+
<h3 class="text-sm font-semibold text-foreground tracking-tight">{title}</h3>
|
|
131
|
+
<p class="text-xs text-muted-foreground">{description}</p>
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
<!-- 顶部操作按钮 -->
|
|
136
|
+
<div class="flex items-center gap-2">
|
|
137
|
+
{#if isEditable}
|
|
138
|
+
<Button
|
|
139
|
+
variant="outline"
|
|
140
|
+
size="sm"
|
|
141
|
+
class="h-8 gap-1 text-xs"
|
|
142
|
+
onclick={() => addSampleWidget('kpi')}
|
|
143
|
+
>
|
|
144
|
+
<Plus class="w-3.5 h-3.5 text-primary" />
|
|
145
|
+
<span>添加卡片</span>
|
|
146
|
+
</Button>
|
|
147
|
+
|
|
148
|
+
<Button
|
|
149
|
+
variant="outline"
|
|
150
|
+
size="sm"
|
|
151
|
+
class="h-8 gap-1 text-xs"
|
|
152
|
+
onclick={() => addSampleWidget('chart')}
|
|
153
|
+
>
|
|
154
|
+
<BarChart3 class="w-3.5 h-3.5 text-primary" />
|
|
155
|
+
<span>添加图表</span>
|
|
156
|
+
</Button>
|
|
157
|
+
|
|
158
|
+
<Button
|
|
159
|
+
variant="ghost"
|
|
160
|
+
size="sm"
|
|
161
|
+
class="h-8 gap-1 text-xs text-muted-foreground"
|
|
162
|
+
onclick={resetToDefault}
|
|
163
|
+
>
|
|
164
|
+
<RotateCcw class="w-3.5 h-3.5" />
|
|
165
|
+
<span>重置默认</span>
|
|
166
|
+
</Button>
|
|
167
|
+
{/if}
|
|
168
|
+
|
|
169
|
+
<Button
|
|
170
|
+
variant={isEditable ? 'default' : 'outline'}
|
|
171
|
+
size="sm"
|
|
172
|
+
class={cn('h-8 gap-1.5 text-xs', isEditable && 'bg-primary text-primary-foreground')}
|
|
173
|
+
onclick={toggleEditable}
|
|
174
|
+
>
|
|
175
|
+
{#if isEditable}
|
|
176
|
+
<Check class="w-3.5 h-3.5" />
|
|
177
|
+
<span>完成排版</span>
|
|
178
|
+
{:else}
|
|
179
|
+
<Edit3 class="w-3.5 h-3.5" />
|
|
180
|
+
<span>编辑布局</span>
|
|
181
|
+
{/if}
|
|
182
|
+
</Button>
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
|
|
186
|
+
<!-- 12 栅格自适应容器 -->
|
|
187
|
+
<div class="p-4 bg-muted/5 min-h-[420px]">
|
|
188
|
+
{#if items.length === 0}
|
|
189
|
+
<div class="py-24 text-center text-sm text-muted-foreground">
|
|
190
|
+
<LayoutDashboard class="w-10 h-10 mx-auto mb-2 opacity-30" />
|
|
191
|
+
<p>当前画布暂无小部件,点击上方按钮添加小部件</p>
|
|
192
|
+
</div>
|
|
193
|
+
{:else}
|
|
194
|
+
<div class="grid grid-cols-12 gap-3.5">
|
|
195
|
+
{#each items as item (item.id)}
|
|
196
|
+
<div
|
|
197
|
+
class={cn(
|
|
198
|
+
'rounded-xl border border-border bg-card p-3.5 flex flex-col justify-between transition-all duration-150 relative shadow-2xs',
|
|
199
|
+
isEditable && 'ring-1 ring-primary/30 border-primary/40',
|
|
200
|
+
item.static && 'opacity-90'
|
|
201
|
+
)}
|
|
202
|
+
style="grid-column: span {item.w}; min-height: {item.h * 72}px;"
|
|
203
|
+
>
|
|
204
|
+
<!-- 小部件头部 -->
|
|
205
|
+
<div class="flex items-start justify-between gap-2 mb-2">
|
|
206
|
+
<div class="flex items-center gap-1.5 min-w-0">
|
|
207
|
+
{#if isEditable && !item.static}
|
|
208
|
+
<span class="cursor-grab text-muted-foreground/60 hover:text-foreground">
|
|
209
|
+
<GripVertical class="w-3.5 h-3.5" />
|
|
210
|
+
</span>
|
|
211
|
+
{/if}
|
|
212
|
+
<div class="flex flex-col min-w-0">
|
|
213
|
+
<div class="flex items-center gap-1.5">
|
|
214
|
+
<span class="text-xs font-semibold text-foreground truncate">{item.title}</span>
|
|
215
|
+
{#if item.category}
|
|
216
|
+
<span class="text-[9px] px-1.5 py-0.2 rounded bg-muted text-muted-foreground border border-border">
|
|
217
|
+
{item.category}
|
|
218
|
+
</span>
|
|
219
|
+
{/if}
|
|
220
|
+
</div>
|
|
221
|
+
{#if item.description}
|
|
222
|
+
<p class="text-[10px] text-muted-foreground truncate mt-0.5">{item.description}</p>
|
|
223
|
+
{/if}
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
|
|
227
|
+
<!-- 编辑工具按钮 -->
|
|
228
|
+
{#if isEditable}
|
|
229
|
+
<div class="flex items-center gap-1 shrink-0">
|
|
230
|
+
<button
|
|
231
|
+
type="button"
|
|
232
|
+
class="p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted"
|
|
233
|
+
title={item.static ? '解锁小部件' : '锁定位置'}
|
|
234
|
+
onclick={() => toggleLock(item.id)}
|
|
235
|
+
>
|
|
236
|
+
{#if item.static}
|
|
237
|
+
<Lock class="w-3 h-3 text-warning" />
|
|
238
|
+
{:else}
|
|
239
|
+
<Unlock class="w-3 h-3" />
|
|
240
|
+
{/if}
|
|
241
|
+
</button>
|
|
242
|
+
|
|
243
|
+
{#if !item.static}
|
|
244
|
+
<button
|
|
245
|
+
type="button"
|
|
246
|
+
class="p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted"
|
|
247
|
+
title="放大宽度"
|
|
248
|
+
disabled={item.w >= 12}
|
|
249
|
+
onclick={() => resizeItem(item.id, 1, 0)}
|
|
250
|
+
>
|
|
251
|
+
<Maximize2 class="w-3 h-3" />
|
|
252
|
+
</button>
|
|
253
|
+
<button
|
|
254
|
+
type="button"
|
|
255
|
+
class="p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted"
|
|
256
|
+
title="缩小宽度"
|
|
257
|
+
disabled={item.w <= 2}
|
|
258
|
+
onclick={() => resizeItem(item.id, -1, 0)}
|
|
259
|
+
>
|
|
260
|
+
<Minimize2 class="w-3 h-3" />
|
|
261
|
+
</button>
|
|
262
|
+
<button
|
|
263
|
+
type="button"
|
|
264
|
+
class="p-1 rounded text-destructive hover:bg-destructive/10"
|
|
265
|
+
title="移除小部件"
|
|
266
|
+
onclick={() => removeItem(item.id)}
|
|
267
|
+
>
|
|
268
|
+
<Trash2 class="w-3 h-3" />
|
|
269
|
+
</button>
|
|
270
|
+
{/if}
|
|
271
|
+
</div>
|
|
272
|
+
{/if}
|
|
273
|
+
</div>
|
|
274
|
+
|
|
275
|
+
<!-- 小部件内容呈现 -->
|
|
276
|
+
<div class="flex-1 flex flex-col justify-center">
|
|
277
|
+
{#if item.widgetType === 'kpi'}
|
|
278
|
+
<div class="flex items-baseline justify-between mt-1">
|
|
279
|
+
<span class="text-xl font-bold tracking-tight text-foreground font-mono">
|
|
280
|
+
{item.metricValue ?? '0'}
|
|
281
|
+
</span>
|
|
282
|
+
{#if item.metricTrend}
|
|
283
|
+
<span class="text-xs font-medium text-success bg-success/10 px-1.5 py-0.5 rounded border border-success/20">
|
|
284
|
+
{item.metricTrend}
|
|
285
|
+
</span>
|
|
286
|
+
{/if}
|
|
287
|
+
</div>
|
|
288
|
+
{:else if item.widgetType === 'chart'}
|
|
289
|
+
<div class="h-28 w-full rounded-lg bg-muted/20 border border-dashed border-border/70 flex items-center justify-center text-xs text-muted-foreground flex-col gap-1">
|
|
290
|
+
<BarChart3 class="w-6 h-6 text-primary/60 mb-1" />
|
|
291
|
+
<span>实时时序图表绘制区域 ({item.w}x{item.h} 栅格)</span>
|
|
292
|
+
</div>
|
|
293
|
+
{:else if item.widgetType === 'table'}
|
|
294
|
+
<div class="h-28 w-full rounded-lg bg-muted/20 border border-dashed border-border/70 flex items-center justify-center text-xs text-muted-foreground flex-col gap-1">
|
|
295
|
+
<TableIcon class="w-6 h-6 text-primary/60 mb-1" />
|
|
296
|
+
<span>结构化数据表格展示区域</span>
|
|
297
|
+
</div>
|
|
298
|
+
{:else}
|
|
299
|
+
<div class="h-20 w-full rounded bg-muted/30 flex items-center justify-center text-xs text-muted-foreground">
|
|
300
|
+
自定义业务小部件
|
|
301
|
+
</div>
|
|
302
|
+
{/if}
|
|
303
|
+
</div>
|
|
304
|
+
</div>
|
|
305
|
+
{/each}
|
|
306
|
+
</div>
|
|
307
|
+
{/if}
|
|
308
|
+
</div>
|
|
309
|
+
</div>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface DashboardGridItem {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
x?: number | undefined;
|
|
5
|
+
y?: number | undefined;
|
|
6
|
+
w: number;
|
|
7
|
+
h: number;
|
|
8
|
+
minW?: number | undefined;
|
|
9
|
+
minH?: number | undefined;
|
|
10
|
+
static?: boolean | undefined;
|
|
11
|
+
category?: string | undefined;
|
|
12
|
+
widgetType?: 'kpi' | 'chart' | 'table' | 'log' | 'custom' | undefined;
|
|
13
|
+
description?: string | undefined;
|
|
14
|
+
metricValue?: string | number | undefined;
|
|
15
|
+
metricTrend?: string | undefined;
|
|
16
|
+
}
|
|
17
|
+
export interface DashboardGridLayoutProps {
|
|
18
|
+
items?: DashboardGridItem[] | undefined;
|
|
19
|
+
isEditable?: boolean | undefined;
|
|
20
|
+
title?: string | undefined;
|
|
21
|
+
description?: string | undefined;
|
|
22
|
+
class?: string | undefined;
|
|
23
|
+
onLayoutChange?: ((items: DashboardGridItem[]) => void) | undefined;
|
|
24
|
+
onAddWidget?: ((type: DashboardGridItem['widgetType']) => void) | undefined;
|
|
25
|
+
onRemoveWidget?: ((id: string) => void) | undefined;
|
|
26
|
+
onResetLayout?: (() => void) | undefined;
|
|
27
|
+
}
|
|
28
|
+
declare const DashboardGridLayout: import("svelte").Component<DashboardGridLayoutProps, {}, "items" | "isEditable">;
|
|
29
|
+
type DashboardGridLayout = ReturnType<typeof DashboardGridLayout>;
|
|
30
|
+
export default DashboardGridLayout;
|