@svadmin/ui 0.121.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 +757 -7
- package/dist/app.theme.css +757 -7
- 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 +325 -0
- package/dist/components/AnnouncementBanner.svelte.d.ts +49 -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 +551 -0
- package/dist/components/AsyncExportModal.svelte.d.ts +50 -0
- package/dist/components/AudioFeedbackProvider.svelte +131 -0
- package/dist/components/AudioFeedbackProvider.svelte.d.ts +11 -0
- package/dist/components/AuditLogViewer.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/CanvasAnnotation.svelte +1 -1
- 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/ColumnFilterBuilder.svelte +135 -0
- package/dist/components/ColumnFilterBuilder.svelte.d.ts +20 -0
- package/dist/components/ColumnMappingTable.svelte +174 -0
- package/dist/components/ColumnMappingTable.svelte.d.ts +23 -0
- package/dist/components/ColumnSettings.svelte +1 -1
- package/dist/components/ColumnVisibilityDrawer.svelte +541 -0
- package/dist/components/ColumnVisibilityDrawer.svelte.d.ts +16 -0
- package/dist/components/ConcurrentConflictModal.svelte +7 -7
- package/dist/components/ConversionFunnel.svelte +154 -0
- package/dist/components/ConversionFunnel.svelte.d.ts +22 -0
- package/dist/components/CronExpressionBuilder.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/DecisionTable.svelte +1 -1
- package/dist/components/DevTools.svelte +4 -4
- package/dist/components/DraggableRowTable.svelte +1 -1
- package/dist/components/DualApprovalGate.svelte +485 -0
- package/dist/components/DualApprovalGate.svelte.d.ts +58 -0
- package/dist/components/EditableTable.svelte +1 -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/ExcelImportWizard.svelte +2 -2
- 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/GlobalShortcuts.svelte +1 -1
- 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/ImageCropper.svelte +1 -1
- package/dist/components/ImportPreviewValidator.svelte +239 -0
- package/dist/components/ImportPreviewValidator.svelte.d.ts +26 -0
- package/dist/components/ImportWizard.svelte +1 -1
- package/dist/components/IncidentWarRoomDrawer.svelte +194 -0
- package/dist/components/IncidentWarRoomDrawer.svelte.d.ts +24 -0
- package/dist/components/JsonSchemaForm.svelte +5 -5
- package/dist/components/JsonViewer.svelte +11 -11
- package/dist/components/KeyboardShortcutsModal.svelte +362 -0
- package/dist/components/KeyboardShortcutsModal.svelte.d.ts +22 -0
- package/dist/components/KpiCard.svelte +5 -5
- 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/MasterDetailView.svelte +1 -1
- package/dist/components/MasterSubTableDrawer.svelte +223 -0
- package/dist/components/MasterSubTableDrawer.svelte.d.ts +25 -0
- package/dist/components/MetricGrid.svelte +2 -2
- package/dist/components/MicroAppBridge.svelte +59 -0
- package/dist/components/MicroAppBridge.svelte.d.ts +11 -0
- package/dist/components/MockDataInterceptor.svelte +292 -0
- package/dist/components/MockDataInterceptor.svelte.d.ts +27 -0
- package/dist/components/OfflineSyncBanner.svelte +1 -1
- package/dist/components/OmnibarCommandPalette.svelte +320 -0
- package/dist/components/OmnibarCommandPalette.svelte.d.ts +27 -0
- package/dist/components/OrgChart.svelte +1 -1
- package/dist/components/OrgTreePicker.svelte +1 -1
- package/dist/components/OtpInput.svelte +5 -5
- package/dist/components/PageSkeleton.svelte +19 -5
- package/dist/components/PageSkeleton.svelte.d.ts +5 -3
- package/dist/components/PdfDocumentViewer.svelte +2 -2
- 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/PivotDrilldownModal.svelte +6 -6
- package/dist/components/PivotMatrix.svelte +271 -0
- package/dist/components/PivotMatrix.svelte.d.ts +32 -0
- package/dist/components/PivotTable.svelte +1 -1
- 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/PricingCard.svelte +1 -1
- package/dist/components/PricingTable.svelte +1 -1
- package/dist/components/PrintableBill.svelte +2 -2
- package/dist/components/PrintableReportLayout.svelte +259 -0
- package/dist/components/PrintableReportLayout.svelte.d.ts +32 -0
- package/dist/components/ProSkeleton.svelte +10 -6
- 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/ResultPage.svelte +2 -2
- 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/SafeDeleteConfirm.svelte +5 -5
- package/dist/components/SankeyChart.svelte +111 -0
- package/dist/components/SankeyChart.svelte.d.ts +22 -0
- package/dist/components/ScheduledJobManager.svelte +225 -0
- package/dist/components/ScheduledJobManager.svelte.d.ts +23 -0
- package/dist/components/SchemaVisualModeler.svelte +336 -0
- package/dist/components/SchemaVisualModeler.svelte.d.ts +17 -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/SensitiveDataMask.svelte +81 -22
- package/dist/components/SensitiveDataMask.svelte.d.ts +15 -10
- package/dist/components/ServerStatusGrid.svelte +179 -0
- package/dist/components/ServerStatusGrid.svelte.d.ts +21 -0
- package/dist/components/SessionTimeoutGuard.svelte +154 -0
- package/dist/components/SessionTimeoutGuard.svelte.d.ts +25 -0
- package/dist/components/SignaturePad.svelte +1 -1
- package/dist/components/SliderCaptcha.svelte +1 -1
- package/dist/components/SnapshotTimelineReplay.svelte +219 -0
- package/dist/components/SnapshotTimelineReplay.svelte.d.ts +19 -0
- package/dist/components/SplitPaneLayout.svelte +1 -1
- package/dist/components/SpreadsheetView.svelte +1 -1
- package/dist/components/SqlConsole.svelte +247 -0
- package/dist/components/SqlConsole.svelte.d.ts +20 -0
- package/dist/components/StepForm.svelte +1 -1
- package/dist/components/StepWizard.svelte +513 -0
- package/dist/components/StepWizard.svelte.d.ts +49 -0
- 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/TableClipboardManager.svelte +307 -0
- package/dist/components/TableClipboardManager.svelte.d.ts +13 -0
- package/dist/components/TaskCenter.svelte +46 -38
- 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/TextDiffViewer.svelte +613 -0
- package/dist/components/TextDiffViewer.svelte.d.ts +39 -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/TreeTransfer.svelte +1 -1
- package/dist/components/TreeTransferSelect.svelte +333 -0
- package/dist/components/TreeTransferSelect.svelte.d.ts +18 -0
- package/dist/components/UnsavedChangesGuard.svelte +5 -5
- package/dist/components/UsageCard.svelte +1 -1
- package/dist/components/VersionDiffViewer.svelte +1 -1
- package/dist/components/VirtualCardGrid.svelte +180 -0
- package/dist/components/VirtualCardGrid.svelte.d.ts +65 -0
- package/dist/components/VirtualTable.svelte +1 -1
- package/dist/components/VirtualTreeSelect.svelte +1 -1
- 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/WorkflowDesigner.svelte +3 -3
- 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/WorkflowProcessCard.svelte +1 -1
- package/dist/components/WorkflowStepper.svelte +250 -0
- package/dist/components/WorkflowStepper.svelte.d.ts +27 -0
- package/dist/components/charts/GaugeChart.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/useAudioAlert.d.svelte.ts +1 -0
- package/dist/components/useAudioAlert.svelte.d.ts +13 -0
- package/dist/components/useAudioAlert.svelte.js +90 -0
- 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/useHotkeys.d.svelte.ts +1 -0
- package/dist/components/useHotkeys.svelte.d.ts +44 -0
- package/dist/components/useHotkeys.svelte.js +190 -0
- package/dist/components/useMicroAppEvent.d.svelte.ts +1 -0
- package/dist/components/useMicroAppEvent.svelte.d.ts +16 -0
- package/dist/components/useMicroAppEvent.svelte.js +61 -0
- package/dist/components/usePrintExport.d.svelte.ts +1 -0
- package/dist/components/usePrintExport.svelte.d.ts +11 -0
- package/dist/components/usePrintExport.svelte.js +45 -0
- package/dist/components/useSessionTimeout.d.svelte.ts +1 -0
- package/dist/components/useSessionTimeout.svelte.d.ts +28 -0
- package/dist/components/useSessionTimeout.svelte.js +182 -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/useTableClipboard.d.svelte.ts +1 -0
- package/dist/components/useTableClipboard.svelte.d.ts +28 -0
- package/dist/components/useTableClipboard.svelte.js +116 -0
- package/dist/components.css +1 -1
- package/dist/index.d.ts +96 -11
- package/dist/index.js +146 -1
- package/package.json +4 -4
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import {
|
|
4
|
+
AlertTriangle,
|
|
5
|
+
Check,
|
|
6
|
+
Clock,
|
|
7
|
+
Loader2,
|
|
8
|
+
RotateCcw,
|
|
9
|
+
SkipForward,
|
|
10
|
+
XCircle,
|
|
11
|
+
} from '@lucide/svelte';
|
|
12
|
+
import { useTranslation } from '@svadmin/core/i18n';
|
|
13
|
+
import { cn } from '../utils.js';
|
|
14
|
+
import { Button } from './ui/button/index.js';
|
|
15
|
+
import { Progress } from './ui/progress/index.js';
|
|
16
|
+
|
|
17
|
+
export type WorkflowStepStatus =
|
|
18
|
+
| 'wait'
|
|
19
|
+
| 'pending'
|
|
20
|
+
| 'process'
|
|
21
|
+
| 'running'
|
|
22
|
+
| 'finish'
|
|
23
|
+
| 'completed'
|
|
24
|
+
| 'error'
|
|
25
|
+
| 'failed'
|
|
26
|
+
| 'blocked'
|
|
27
|
+
| 'skipped';
|
|
28
|
+
|
|
29
|
+
export interface WorkflowStepItem {
|
|
30
|
+
id: string;
|
|
31
|
+
label: string;
|
|
32
|
+
description?: string | undefined;
|
|
33
|
+
status: WorkflowStepStatus;
|
|
34
|
+
durationMs?: number | undefined;
|
|
35
|
+
startedAt?: string | undefined;
|
|
36
|
+
errorMessage?: string | undefined;
|
|
37
|
+
retryable?: boolean | undefined;
|
|
38
|
+
meta?: Record<string, string | number> | undefined;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface WorkflowStepperProps {
|
|
42
|
+
steps: WorkflowStepItem[];
|
|
43
|
+
activeId?: string | undefined;
|
|
44
|
+
direction?: 'horizontal' | 'vertical' | undefined;
|
|
45
|
+
title?: string | undefined;
|
|
46
|
+
showProgress?: boolean | undefined;
|
|
47
|
+
onSelect?: ((step: WorkflowStepItem) => void) | undefined;
|
|
48
|
+
onRetry?: ((step: WorkflowStepItem) => void) | undefined;
|
|
49
|
+
stepDetail?: Snippet<[WorkflowStepItem]> | undefined;
|
|
50
|
+
class?: string | undefined;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
let {
|
|
54
|
+
steps,
|
|
55
|
+
activeId = $bindable<string | undefined>(undefined),
|
|
56
|
+
direction = 'vertical',
|
|
57
|
+
title,
|
|
58
|
+
showProgress = true,
|
|
59
|
+
onSelect,
|
|
60
|
+
onRetry,
|
|
61
|
+
stepDetail,
|
|
62
|
+
class: className = '',
|
|
63
|
+
}: WorkflowStepperProps = $props();
|
|
64
|
+
|
|
65
|
+
const i18n = useTranslation();
|
|
66
|
+
const chinese = $derived(i18n.locale.startsWith('zh'));
|
|
67
|
+
|
|
68
|
+
type NormalizedState = 'wait' | 'process' | 'finish' | 'error' | 'blocked' | 'skipped';
|
|
69
|
+
|
|
70
|
+
function normalizeState(status: WorkflowStepStatus): NormalizedState {
|
|
71
|
+
switch (status) {
|
|
72
|
+
case 'finish':
|
|
73
|
+
case 'completed':
|
|
74
|
+
return 'finish';
|
|
75
|
+
case 'process':
|
|
76
|
+
case 'running':
|
|
77
|
+
return 'process';
|
|
78
|
+
case 'error':
|
|
79
|
+
case 'failed':
|
|
80
|
+
return 'error';
|
|
81
|
+
case 'blocked':
|
|
82
|
+
return 'blocked';
|
|
83
|
+
case 'skipped':
|
|
84
|
+
return 'skipped';
|
|
85
|
+
default:
|
|
86
|
+
return 'wait';
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function formatDuration(ms: number | undefined): string | null {
|
|
91
|
+
if (ms === undefined || !Number.isFinite(ms)) return null;
|
|
92
|
+
if (ms < 1000) return `${ms}ms`;
|
|
93
|
+
return `${(ms / 1000).toFixed(1)}s`;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const completedCount = $derived(
|
|
97
|
+
steps.filter((s) => {
|
|
98
|
+
const n = normalizeState(s.status);
|
|
99
|
+
return n === 'finish' || n === 'skipped';
|
|
100
|
+
}).length,
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
const progressPercentage = $derived(
|
|
104
|
+
steps.length > 0 ? Math.round((completedCount / steps.length) * 100) : 0,
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
function selectStep(step: WorkflowStepItem) {
|
|
108
|
+
activeId = step.id;
|
|
109
|
+
onSelect?.(step);
|
|
110
|
+
}
|
|
111
|
+
</script>
|
|
112
|
+
|
|
113
|
+
<div
|
|
114
|
+
data-svadmin-component="WorkflowStepper"
|
|
115
|
+
data-direction={direction}
|
|
116
|
+
class={cn(
|
|
117
|
+
'rounded-md border border-border bg-card text-card-foreground shadow-xs p-5 space-y-4',
|
|
118
|
+
className,
|
|
119
|
+
)}
|
|
120
|
+
>
|
|
121
|
+
{#if title || showProgress}
|
|
122
|
+
<div class="space-y-2 border-b border-border/60 pb-3">
|
|
123
|
+
<div class="flex items-center justify-between gap-2">
|
|
124
|
+
{#if title}
|
|
125
|
+
<h3 class="text-sm font-semibold text-foreground">{title}</h3>
|
|
126
|
+
{:else}
|
|
127
|
+
<span class="text-xs font-medium text-muted-foreground">
|
|
128
|
+
{chinese ? '任务执行进度' : 'Workflow Progress'}
|
|
129
|
+
</span>
|
|
130
|
+
{/if}
|
|
131
|
+
<span class="text-xs font-mono text-muted-foreground">
|
|
132
|
+
{completedCount}/{steps.length} ({progressPercentage}%)
|
|
133
|
+
</span>
|
|
134
|
+
</div>
|
|
135
|
+
{#if showProgress}
|
|
136
|
+
<Progress value={progressPercentage} class="h-1.5" />
|
|
137
|
+
{/if}
|
|
138
|
+
</div>
|
|
139
|
+
{/if}
|
|
140
|
+
|
|
141
|
+
<ol
|
|
142
|
+
class={cn(
|
|
143
|
+
'flex m-0 p-0 list-none',
|
|
144
|
+
direction === 'vertical' ? 'flex-col gap-3' : 'flex-row gap-2 overflow-x-auto pb-2',
|
|
145
|
+
)}
|
|
146
|
+
>
|
|
147
|
+
{#each steps as step, index (step.id)}
|
|
148
|
+
{@const state = normalizeState(step.status)}
|
|
149
|
+
{@const duration = formatDuration(step.durationMs)}
|
|
150
|
+
{@const isSelected = activeId === step.id}
|
|
151
|
+
<li
|
|
152
|
+
data-step-id={step.id}
|
|
153
|
+
data-step-status={state}
|
|
154
|
+
class={cn(
|
|
155
|
+
'relative flex',
|
|
156
|
+
direction === 'vertical' ? 'flex-col' : 'flex-1 min-w-44 items-start gap-2',
|
|
157
|
+
)}
|
|
158
|
+
>
|
|
159
|
+
<div
|
|
160
|
+
class={cn(
|
|
161
|
+
'flex items-start justify-between gap-3 rounded-lg border p-3 transition-all',
|
|
162
|
+
isSelected ? 'border-primary bg-primary/5 ring-1 ring-primary/20' : 'border-border/60 bg-background hover:bg-muted/30',
|
|
163
|
+
direction === 'horizontal' && 'w-full',
|
|
164
|
+
)}
|
|
165
|
+
>
|
|
166
|
+
<button
|
|
167
|
+
type="button"
|
|
168
|
+
onclick={() => selectStep(step)}
|
|
169
|
+
aria-current={state === 'process' ? 'step' : undefined}
|
|
170
|
+
class="flex items-start gap-3 text-left flex-1 min-w-0 bg-transparent border-0 p-0 cursor-pointer"
|
|
171
|
+
>
|
|
172
|
+
<span
|
|
173
|
+
class={cn(
|
|
174
|
+
'flex h-7 w-7 shrink-0 items-center justify-center rounded-full border mt-0.5',
|
|
175
|
+
state === 'finish' && 'border-success/30 bg-success/15 text-success',
|
|
176
|
+
state === 'process' && 'border-primary/40 bg-primary/15 text-primary',
|
|
177
|
+
state === 'error' && 'border-destructive/30 bg-destructive/15 text-destructive',
|
|
178
|
+
state === 'blocked' && 'border-warning/40 bg-warning/15 text-warning',
|
|
179
|
+
state === 'skipped' && 'border-border bg-muted text-muted-foreground',
|
|
180
|
+
state === 'wait' && 'border-border bg-card text-muted-foreground',
|
|
181
|
+
)}
|
|
182
|
+
>
|
|
183
|
+
{#if state === 'finish'}
|
|
184
|
+
<Check class="h-3.5 w-3.5" />
|
|
185
|
+
{:else if state === 'process'}
|
|
186
|
+
<Loader2 class="h-3.5 w-3.5 animate-spin" />
|
|
187
|
+
{:else if state === 'error'}
|
|
188
|
+
<XCircle class="h-3.5 w-3.5" />
|
|
189
|
+
{:else if state === 'blocked'}
|
|
190
|
+
<AlertTriangle class="h-3.5 w-3.5" />
|
|
191
|
+
{:else if state === 'skipped'}
|
|
192
|
+
<SkipForward class="h-3.5 w-3.5" />
|
|
193
|
+
{:else}
|
|
194
|
+
<Clock class="h-3.5 w-3.5" />
|
|
195
|
+
{/if}
|
|
196
|
+
</span>
|
|
197
|
+
|
|
198
|
+
<div class="min-w-0 flex-1 space-y-0.5">
|
|
199
|
+
<div class="flex items-center gap-2">
|
|
200
|
+
<span class="text-xs font-semibold text-foreground truncate">{step.label}</span>
|
|
201
|
+
{#if duration}
|
|
202
|
+
<span class="text-[10px] font-mono text-muted-foreground bg-muted px-1.5 py-0.5 rounded">
|
|
203
|
+
{duration}
|
|
204
|
+
</span>
|
|
205
|
+
{/if}
|
|
206
|
+
</div>
|
|
207
|
+
|
|
208
|
+
{#if step.description}
|
|
209
|
+
<p class="text-[11px] text-muted-foreground line-clamp-2">{step.description}</p>
|
|
210
|
+
{/if}
|
|
211
|
+
|
|
212
|
+
{#if step.errorMessage && state === 'error'}
|
|
213
|
+
<p class="text-[11px] text-destructive mt-1 font-medium">{step.errorMessage}</p>
|
|
214
|
+
{/if}
|
|
215
|
+
|
|
216
|
+
{#if stepDetail}
|
|
217
|
+
<div class="pt-1.5">
|
|
218
|
+
{@render stepDetail(step)}
|
|
219
|
+
</div>
|
|
220
|
+
{/if}
|
|
221
|
+
</div>
|
|
222
|
+
</button>
|
|
223
|
+
|
|
224
|
+
{#if state === 'error' && step.retryable !== false && onRetry}
|
|
225
|
+
<Button
|
|
226
|
+
type="button"
|
|
227
|
+
variant="outline"
|
|
228
|
+
size="sm"
|
|
229
|
+
class="h-7 px-2 text-[11px] gap-1 shrink-0"
|
|
230
|
+
onclick={() => onRetry(step)}
|
|
231
|
+
>
|
|
232
|
+
<RotateCcw class="h-3 w-3" />
|
|
233
|
+
{chinese ? '重试' : 'Retry'}
|
|
234
|
+
</Button>
|
|
235
|
+
{/if}
|
|
236
|
+
</div>
|
|
237
|
+
|
|
238
|
+
{#if direction === 'vertical' && index < steps.length - 1}
|
|
239
|
+
<div
|
|
240
|
+
class={cn(
|
|
241
|
+
'ml-6 my-1 w-0.5 h-3 rounded-full',
|
|
242
|
+
state === 'finish' ? 'bg-success/60' : 'bg-border',
|
|
243
|
+
)}
|
|
244
|
+
aria-hidden="true"
|
|
245
|
+
></div>
|
|
246
|
+
{/if}
|
|
247
|
+
</li>
|
|
248
|
+
{/each}
|
|
249
|
+
</ol>
|
|
250
|
+
</div>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export type WorkflowStepStatus = 'wait' | 'pending' | 'process' | 'running' | 'finish' | 'completed' | 'error' | 'failed' | 'blocked' | 'skipped';
|
|
3
|
+
export interface WorkflowStepItem {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
description?: string | undefined;
|
|
7
|
+
status: WorkflowStepStatus;
|
|
8
|
+
durationMs?: number | undefined;
|
|
9
|
+
startedAt?: string | undefined;
|
|
10
|
+
errorMessage?: string | undefined;
|
|
11
|
+
retryable?: boolean | undefined;
|
|
12
|
+
meta?: Record<string, string | number> | undefined;
|
|
13
|
+
}
|
|
14
|
+
export interface WorkflowStepperProps {
|
|
15
|
+
steps: WorkflowStepItem[];
|
|
16
|
+
activeId?: string | undefined;
|
|
17
|
+
direction?: 'horizontal' | 'vertical' | undefined;
|
|
18
|
+
title?: string | undefined;
|
|
19
|
+
showProgress?: boolean | undefined;
|
|
20
|
+
onSelect?: ((step: WorkflowStepItem) => void) | undefined;
|
|
21
|
+
onRetry?: ((step: WorkflowStepItem) => void) | undefined;
|
|
22
|
+
stepDetail?: Snippet<[WorkflowStepItem]> | undefined;
|
|
23
|
+
class?: string | undefined;
|
|
24
|
+
}
|
|
25
|
+
declare const WorkflowStepper: import("svelte").Component<WorkflowStepperProps, {}, "activeId">;
|
|
26
|
+
type WorkflowStepper = ReturnType<typeof WorkflowStepper>;
|
|
27
|
+
export default WorkflowStepper;
|
|
@@ -303,7 +303,7 @@
|
|
|
303
303
|
data-tone={activeTone}
|
|
304
304
|
data-gauge-type={type}
|
|
305
305
|
class={cn(
|
|
306
|
-
'relative flex flex-col items-center justify-between rounded-
|
|
306
|
+
'relative flex flex-col items-center justify-between rounded-md border border-border bg-card p-4 text-card-foreground shadow-sm transition-all',
|
|
307
307
|
className,
|
|
308
308
|
)}
|
|
309
309
|
style="width: {widthPx}px;"
|
|
@@ -20,6 +20,13 @@ declare const english: {
|
|
|
20
20
|
readonly 'listPagination.jumpToAria': "{label} page number";
|
|
21
21
|
readonly 'listPagination.simplePage': "Page {page} / {total}";
|
|
22
22
|
readonly 'listFooter.truncated': "Only the first {maxRecords} records are loaded. Narrow the results using filters.";
|
|
23
|
+
readonly 'cursorListFooter.navigation': "{label} cursor pagination";
|
|
24
|
+
readonly 'cursorListFooter.loaded': "{count} records on current page";
|
|
25
|
+
readonly 'cursorListFooter.page': "Page {page}";
|
|
26
|
+
readonly 'cursorListFooter.previousAria': "{label} previous page";
|
|
27
|
+
readonly 'cursorListFooter.nextAria': "{label} next page";
|
|
28
|
+
readonly 'cursorListFooter.firstPage': "Already on the first page.";
|
|
29
|
+
readonly 'cursorListFooter.nextUnavailable': "No next page is available.";
|
|
23
30
|
readonly 'scrollableTable.horizontalScroll': "Scroll table horizontally";
|
|
24
31
|
readonly 'scrollableTable.topHorizontalScroll': "Scroll table horizontally above the table";
|
|
25
32
|
};
|
|
@@ -19,6 +19,13 @@ const english = {
|
|
|
19
19
|
'listPagination.jumpToAria': '{label} page number',
|
|
20
20
|
'listPagination.simplePage': 'Page {page} / {total}',
|
|
21
21
|
'listFooter.truncated': 'Only the first {maxRecords} records are loaded. Narrow the results using filters.',
|
|
22
|
+
'cursorListFooter.navigation': '{label} cursor pagination',
|
|
23
|
+
'cursorListFooter.loaded': '{count} records on current page',
|
|
24
|
+
'cursorListFooter.page': 'Page {page}',
|
|
25
|
+
'cursorListFooter.previousAria': '{label} previous page',
|
|
26
|
+
'cursorListFooter.nextAria': '{label} next page',
|
|
27
|
+
'cursorListFooter.firstPage': 'Already on the first page.',
|
|
28
|
+
'cursorListFooter.nextUnavailable': 'No next page is available.',
|
|
22
29
|
'scrollableTable.horizontalScroll': 'Scroll table horizontally',
|
|
23
30
|
'scrollableTable.topHorizontalScroll': 'Scroll table horizontally above the table',
|
|
24
31
|
};
|
|
@@ -43,6 +50,13 @@ const chinese = {
|
|
|
43
50
|
'listPagination.jumpToAria': '{label}页码',
|
|
44
51
|
'listPagination.simplePage': '第 {page} / {total} 页',
|
|
45
52
|
'listFooter.truncated': '结果较多,仅加载前 {maxRecords} 条,请用筛选收窄范围。',
|
|
53
|
+
'cursorListFooter.navigation': '{label}游标分页',
|
|
54
|
+
'cursorListFooter.loaded': '当前页 {count} 条',
|
|
55
|
+
'cursorListFooter.page': '第 {page} 页',
|
|
56
|
+
'cursorListFooter.previousAria': '{label}上一页',
|
|
57
|
+
'cursorListFooter.nextAria': '{label}下一页',
|
|
58
|
+
'cursorListFooter.firstPage': '已经是第一页。',
|
|
59
|
+
'cursorListFooter.nextUnavailable': '没有更多页面。',
|
|
46
60
|
'scrollableTable.horizontalScroll': '列表横向滚动',
|
|
47
61
|
'scrollableTable.topHorizontalScroll': '列表上方横向滚动',
|
|
48
62
|
};
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
size?: ButtonSizeValue;
|
|
18
18
|
disabledReason?: string;
|
|
19
19
|
disabledReasonDisplay?: "tooltip" | "inline";
|
|
20
|
+
disabledReasonSide?: "top" | "bottom" | "left" | "right";
|
|
20
21
|
restrictionClass?: string;
|
|
21
22
|
restrictionStyle?: string;
|
|
22
23
|
};
|
|
@@ -48,6 +49,7 @@
|
|
|
48
49
|
disabled,
|
|
49
50
|
disabledReason = "",
|
|
50
51
|
disabledReasonDisplay = "tooltip",
|
|
52
|
+
disabledReasonSide = "top",
|
|
51
53
|
restrictionClass,
|
|
52
54
|
restrictionStyle,
|
|
53
55
|
children,
|
|
@@ -154,7 +156,7 @@
|
|
|
154
156
|
</span>
|
|
155
157
|
{/snippet}
|
|
156
158
|
</Tooltip.Trigger>
|
|
157
|
-
<Tooltip.Content side=
|
|
159
|
+
<Tooltip.Content side={disabledReasonSide} sideOffset={6}>{restriction}</Tooltip.Content>
|
|
158
160
|
</Tooltip.Root>
|
|
159
161
|
{:else}
|
|
160
162
|
{@render control()}
|
|
@@ -7,6 +7,7 @@ export type ButtonProps = WithElementRef<HTMLButtonAttributes & HTMLAnchorAttrib
|
|
|
7
7
|
size?: ButtonSizeValue;
|
|
8
8
|
disabledReason?: string;
|
|
9
9
|
disabledReasonDisplay?: "tooltip" | "inline";
|
|
10
|
+
disabledReasonSide?: "top" | "bottom" | "left" | "right";
|
|
10
11
|
restrictionClass?: string;
|
|
11
12
|
restrictionStyle?: string;
|
|
12
13
|
};
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
);
|
|
137
137
|
const contentClass = $derived(
|
|
138
138
|
cn(
|
|
139
|
-
"animate-in fade-in-0 zoom-in-95 inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs has-data-[slot=kbd]:pr-1.5 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm bg-
|
|
139
|
+
"animate-in fade-in-0 zoom-in-95 inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs has-data-[slot=kbd]:pr-1.5 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm bg-foreground text-background shadow-md dark:bg-card dark:text-foreground dark:border dark:border-border z-50 w-fit max-w-xs",
|
|
140
140
|
className
|
|
141
141
|
)
|
|
142
142
|
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useAudioAlert.svelte.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type AudioAlertType = 'success' | 'error' | 'warning' | 'beep' | 'notify';
|
|
2
|
+
export interface AudioAlertOptions {
|
|
3
|
+
volume?: number | undefined;
|
|
4
|
+
muted?: boolean | undefined;
|
|
5
|
+
}
|
|
6
|
+
export declare function playAudioAlert(alertType: AudioAlertType): void;
|
|
7
|
+
export declare function useAudioAlert(options?: AudioAlertOptions): {
|
|
8
|
+
readonly isMuted: boolean;
|
|
9
|
+
readonly volume: number;
|
|
10
|
+
setMuted: (val: boolean) => void;
|
|
11
|
+
setVolume: (val: number) => void;
|
|
12
|
+
play: (type: AudioAlertType) => void;
|
|
13
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// Global singleton audio state shared across the app
|
|
2
|
+
let globalAudioCtx = null;
|
|
3
|
+
let isMutedState = false;
|
|
4
|
+
let globalVolume = 0.7;
|
|
5
|
+
function getAudioContext() {
|
|
6
|
+
if (typeof window === 'undefined')
|
|
7
|
+
return null;
|
|
8
|
+
const AudioCtx = window.AudioContext || window.webkitAudioContext;
|
|
9
|
+
if (!AudioCtx)
|
|
10
|
+
return null;
|
|
11
|
+
if (!globalAudioCtx) {
|
|
12
|
+
globalAudioCtx = new AudioCtx();
|
|
13
|
+
}
|
|
14
|
+
if (globalAudioCtx.state === 'suspended') {
|
|
15
|
+
void globalAudioCtx.resume().catch(() => { });
|
|
16
|
+
}
|
|
17
|
+
return globalAudioCtx;
|
|
18
|
+
}
|
|
19
|
+
function playTone(freqs, durationSeconds, type = 'sine', gainPeak = 0.3) {
|
|
20
|
+
if (isMutedState || globalVolume <= 0)
|
|
21
|
+
return;
|
|
22
|
+
const ctx = getAudioContext();
|
|
23
|
+
if (!ctx)
|
|
24
|
+
return;
|
|
25
|
+
const now = ctx.currentTime;
|
|
26
|
+
const masterGain = ctx.createGain();
|
|
27
|
+
masterGain.gain.setValueAtTime(globalVolume * gainPeak, now);
|
|
28
|
+
masterGain.connect(ctx.destination);
|
|
29
|
+
freqs.forEach((freq, idx) => {
|
|
30
|
+
const osc = ctx.createOscillator();
|
|
31
|
+
const noteGain = ctx.createGain();
|
|
32
|
+
osc.type = type;
|
|
33
|
+
osc.frequency.setValueAtTime(freq, now + idx * 0.08);
|
|
34
|
+
noteGain.gain.setValueAtTime(1, now + idx * 0.08);
|
|
35
|
+
noteGain.gain.exponentialRampToValueAtTime(0.001, now + idx * 0.08 + durationSeconds);
|
|
36
|
+
osc.connect(noteGain);
|
|
37
|
+
noteGain.connect(masterGain);
|
|
38
|
+
osc.start(now + idx * 0.08);
|
|
39
|
+
osc.stop(now + idx * 0.08 + durationSeconds);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
export function playAudioAlert(alertType) {
|
|
43
|
+
switch (alertType) {
|
|
44
|
+
case 'success':
|
|
45
|
+
// C5 (523.25Hz) -> E5 (659.25Hz) -> G5 (783.99Hz)
|
|
46
|
+
playTone([523.25, 659.25, 783.99], 0.22, 'sine', 0.25);
|
|
47
|
+
break;
|
|
48
|
+
case 'error':
|
|
49
|
+
// Low punchy buzz: 180Hz -> 130Hz sawtooth
|
|
50
|
+
playTone([180, 130], 0.18, 'sawtooth', 0.3);
|
|
51
|
+
break;
|
|
52
|
+
case 'warning':
|
|
53
|
+
// Double pulse: 440Hz -> 880Hz
|
|
54
|
+
playTone([440, 880], 0.15, 'triangle', 0.25);
|
|
55
|
+
break;
|
|
56
|
+
case 'beep':
|
|
57
|
+
// Standard 1000Hz scanner chirp (80ms)
|
|
58
|
+
playTone([1000], 0.08, 'sine', 0.2);
|
|
59
|
+
break;
|
|
60
|
+
case 'notify':
|
|
61
|
+
// Gentle marimba chord: 880Hz -> 1174.66Hz (A5 -> D6)
|
|
62
|
+
playTone([880, 1174.66], 0.18, 'sine', 0.2);
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
export function useAudioAlert(options = {}) {
|
|
67
|
+
let muted = $state(options.muted ?? false);
|
|
68
|
+
let volume = $state(options.volume ?? 0.7);
|
|
69
|
+
isMutedState = options.muted ?? false;
|
|
70
|
+
globalVolume = options.volume ?? 0.7;
|
|
71
|
+
return {
|
|
72
|
+
get isMuted() {
|
|
73
|
+
return muted;
|
|
74
|
+
},
|
|
75
|
+
get volume() {
|
|
76
|
+
return volume;
|
|
77
|
+
},
|
|
78
|
+
setMuted: (val) => {
|
|
79
|
+
muted = val;
|
|
80
|
+
isMutedState = val;
|
|
81
|
+
},
|
|
82
|
+
setVolume: (val) => {
|
|
83
|
+
volume = Math.max(0, Math.min(1, val));
|
|
84
|
+
globalVolume = volume;
|
|
85
|
+
},
|
|
86
|
+
play: (type) => {
|
|
87
|
+
playAudioAlert(type);
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useDynamicLocale.svelte.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function applyLocalePatch(locale: string, patch: Record<string, string>): void;
|
|
2
|
+
export declare function getLocalePatch(locale: string): Record<string, string>;
|
|
3
|
+
export declare function clearLocalePatches(): void;
|
|
4
|
+
export declare function translateDynamic(key: string, locale?: string, fallback?: string): string;
|
|
5
|
+
export declare function useDynamicLocale(): {
|
|
6
|
+
applyPatch: typeof applyLocalePatch;
|
|
7
|
+
getPatch: typeof getLocalePatch;
|
|
8
|
+
clearPatches: typeof clearLocalePatches;
|
|
9
|
+
t: typeof translateDynamic;
|
|
10
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Runtime dynamic locale override storage
|
|
2
|
+
const dynamicPatches = new Map();
|
|
3
|
+
export function applyLocalePatch(locale, patch) {
|
|
4
|
+
let map = dynamicPatches.get(locale);
|
|
5
|
+
if (!map) {
|
|
6
|
+
map = new Map();
|
|
7
|
+
dynamicPatches.set(locale, map);
|
|
8
|
+
}
|
|
9
|
+
Object.entries(patch).forEach(([k, v]) => {
|
|
10
|
+
map?.set(k, v);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export function getLocalePatch(locale) {
|
|
14
|
+
const map = dynamicPatches.get(locale);
|
|
15
|
+
if (!map)
|
|
16
|
+
return {};
|
|
17
|
+
const obj = {};
|
|
18
|
+
map.forEach((v, k) => {
|
|
19
|
+
obj[k] = v;
|
|
20
|
+
});
|
|
21
|
+
return obj;
|
|
22
|
+
}
|
|
23
|
+
export function clearLocalePatches() {
|
|
24
|
+
dynamicPatches.clear();
|
|
25
|
+
}
|
|
26
|
+
export function translateDynamic(key, locale = 'zh-CN', fallback) {
|
|
27
|
+
const map = dynamicPatches.get(locale);
|
|
28
|
+
if (map && map.has(key)) {
|
|
29
|
+
return map.get(key) ?? (fallback ?? key);
|
|
30
|
+
}
|
|
31
|
+
return fallback ?? key;
|
|
32
|
+
}
|
|
33
|
+
export function useDynamicLocale() {
|
|
34
|
+
return {
|
|
35
|
+
applyPatch: applyLocalePatch,
|
|
36
|
+
getPatch: getLocalePatch,
|
|
37
|
+
clearPatches: clearLocalePatches,
|
|
38
|
+
t: translateDynamic,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useFormulaEngine.svelte.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type FormulaScope = Record<string, unknown>;
|
|
2
|
+
export declare function evaluateFormula(formula: string, scope?: FormulaScope): number | null;
|
|
3
|
+
export declare function useFormulaEngine(formula: () => string, scope: () => FormulaScope, options?: {
|
|
4
|
+
precision?: number;
|
|
5
|
+
defaultValue?: number;
|
|
6
|
+
}): {
|
|
7
|
+
readonly value: number | null;
|
|
8
|
+
evaluate: (customFormula?: string, customScope?: FormulaScope) => number | null;
|
|
9
|
+
};
|