@svadmin/ui 0.121.0 → 0.122.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 +204 -11
- package/dist/app.theme.css +204 -11
- package/dist/components/AboutSettings.svelte +1 -1
- package/dist/components/AnnouncementBanner.svelte +314 -0
- package/dist/components/AnnouncementBanner.svelte.d.ts +45 -0
- 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/CanvasAnnotation.svelte +1 -1
- package/dist/components/ColumnFilterBuilder.svelte +135 -0
- package/dist/components/ColumnFilterBuilder.svelte.d.ts +20 -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/DecisionTable.svelte +1 -1
- package/dist/components/DevTools.svelte +1 -1
- package/dist/components/DraggableRowTable.svelte +1 -1
- package/dist/components/DualApprovalGate.svelte +418 -0
- package/dist/components/DualApprovalGate.svelte.d.ts +39 -0
- package/dist/components/EditableTable.svelte +1 -1
- package/dist/components/ExcelImportWizard.svelte +2 -2
- package/dist/components/GlobalShortcuts.svelte +1 -1
- package/dist/components/ImageCropper.svelte +1 -1
- package/dist/components/ImportWizard.svelte +1 -1
- package/dist/components/JsonSchemaForm.svelte +1 -1
- 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/MasterDetailView.svelte +1 -1
- 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/OfflineSyncBanner.svelte +1 -1
- package/dist/components/OrgChart.svelte +1 -1
- package/dist/components/OrgTreePicker.svelte +1 -1
- package/dist/components/OtpInput.svelte +5 -5
- package/dist/components/PdfDocumentViewer.svelte +2 -2
- package/dist/components/PivotDrilldownModal.svelte +6 -6
- package/dist/components/PivotTable.svelte +1 -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 +6 -6
- package/dist/components/ResultPage.svelte +2 -2
- 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/SchemaVisualModeler.svelte +336 -0
- package/dist/components/SchemaVisualModeler.svelte.d.ts +17 -0
- package/dist/components/SensitiveDataMask.svelte +81 -22
- package/dist/components/SensitiveDataMask.svelte.d.ts +15 -10
- 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/SplitPaneLayout.svelte +1 -1
- package/dist/components/SpreadsheetView.svelte +1 -1
- 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/TableClipboardManager.svelte +307 -0
- package/dist/components/TableClipboardManager.svelte.d.ts +13 -0
- package/dist/components/TaskCenter.svelte +9 -9
- package/dist/components/TextDiffViewer.svelte +613 -0
- package/dist/components/TextDiffViewer.svelte.d.ts +39 -0
- package/dist/components/TreeTransfer.svelte +1 -1
- package/dist/components/UnsavedChangesGuard.svelte +5 -5
- package/dist/components/UsageCard.svelte +1 -1
- package/dist/components/VersionDiffViewer.svelte +1 -1
- package/dist/components/VirtualTable.svelte +1 -1
- package/dist/components/VirtualTreeSelect.svelte +1 -1
- package/dist/components/WorkflowDesigner.svelte +3 -3
- 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/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/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/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/index.d.ts +28 -9
- package/dist/index.js +35 -0
- package/package.json +1 -1
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import {
|
|
4
|
+
ClipboardCopy,
|
|
5
|
+
ClipboardPaste,
|
|
6
|
+
Check,
|
|
7
|
+
X,
|
|
8
|
+
FileSpreadsheet,
|
|
9
|
+
ArrowRight,
|
|
10
|
+
Undo2,
|
|
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 {
|
|
16
|
+
type ColumnDef,
|
|
17
|
+
type ColumnMapping,
|
|
18
|
+
type ParsedClipboardTable,
|
|
19
|
+
parseClipboardText,
|
|
20
|
+
matchColumnsToDefinitions,
|
|
21
|
+
copyRowsToClipboard,
|
|
22
|
+
} from './useTableClipboard.svelte.js';
|
|
23
|
+
|
|
24
|
+
export interface TableClipboardManagerProps {
|
|
25
|
+
columns: ColumnDef[];
|
|
26
|
+
selectedRows?: Record<string, unknown>[] | undefined;
|
|
27
|
+
class?: string | undefined;
|
|
28
|
+
onPasteConfirmed?: ((rows: Record<string, unknown>[], mode: 'append' | 'overwrite') => void) | undefined;
|
|
29
|
+
onUndo?: (() => void) | undefined;
|
|
30
|
+
children?: Snippet | undefined;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let {
|
|
34
|
+
columns,
|
|
35
|
+
selectedRows = [],
|
|
36
|
+
class: className = '',
|
|
37
|
+
onPasteConfirmed,
|
|
38
|
+
onUndo,
|
|
39
|
+
children,
|
|
40
|
+
}: TableClipboardManagerProps = $props();
|
|
41
|
+
|
|
42
|
+
const i18n = useTranslation();
|
|
43
|
+
const chinese = $derived(i18n.locale.startsWith('zh'));
|
|
44
|
+
|
|
45
|
+
let isModalOpen = $state(false);
|
|
46
|
+
let isCopySuccess = $state(false);
|
|
47
|
+
let pasteMode = $state<'append' | 'overwrite'>('append');
|
|
48
|
+
let parsedTable = $state<ParsedClipboardTable | null>(null);
|
|
49
|
+
let columnMappings = $state<ColumnMapping[]>([]);
|
|
50
|
+
let hasUndoableAction = $state(false);
|
|
51
|
+
|
|
52
|
+
async function handleCopySelection() {
|
|
53
|
+
if (selectedRows.length === 0) return;
|
|
54
|
+
const ok = await copyRowsToClipboard(selectedRows, columns);
|
|
55
|
+
if (ok) {
|
|
56
|
+
isCopySuccess = true;
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
isCopySuccess = false;
|
|
59
|
+
}, 1500);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function handleProcessText(rawText: string) {
|
|
64
|
+
if (!rawText.trim()) return;
|
|
65
|
+
const parsed = parseClipboardText(rawText, columns);
|
|
66
|
+
if (parsed.rowCount === 0) return;
|
|
67
|
+
|
|
68
|
+
parsedTable = parsed;
|
|
69
|
+
columnMappings = matchColumnsToDefinitions(parsed.headers, columns);
|
|
70
|
+
isModalOpen = true;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async function handlePasteFromButton() {
|
|
74
|
+
if (typeof navigator !== 'undefined' && navigator.clipboard) {
|
|
75
|
+
try {
|
|
76
|
+
const text = await navigator.clipboard.readText();
|
|
77
|
+
handleProcessText(text);
|
|
78
|
+
} catch {
|
|
79
|
+
// Clipboard read blocked
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function handleKeydown(e: KeyboardEvent) {
|
|
85
|
+
// Cmd+V / Ctrl+V
|
|
86
|
+
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'v') {
|
|
87
|
+
const target = e.target as HTMLElement | null;
|
|
88
|
+
if (target && (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable)) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
void handlePasteFromButton();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function handleConfirmPaste() {
|
|
96
|
+
if (!parsedTable) return;
|
|
97
|
+
|
|
98
|
+
const mappedRows: Record<string, unknown>[] = parsedTable.rows.map((row) => {
|
|
99
|
+
const obj: Record<string, unknown> = {};
|
|
100
|
+
columnMappings.forEach((map) => {
|
|
101
|
+
const targetKey = map.matchedColumnKey ?? map.clipboardHeader;
|
|
102
|
+
obj[targetKey] = row[map.clipboardHeader] ?? '';
|
|
103
|
+
});
|
|
104
|
+
return obj;
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
onPasteConfirmed?.(mappedRows, pasteMode);
|
|
108
|
+
hasUndoableAction = true;
|
|
109
|
+
isModalOpen = false;
|
|
110
|
+
parsedTable = null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function handleUndo() {
|
|
114
|
+
onUndo?.();
|
|
115
|
+
hasUndoableAction = false;
|
|
116
|
+
}
|
|
117
|
+
</script>
|
|
118
|
+
|
|
119
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
120
|
+
<div
|
|
121
|
+
data-svadmin-component="TableClipboardManager"
|
|
122
|
+
class={cn('inline-flex items-center gap-2', className)}
|
|
123
|
+
onkeydown={handleKeydown}
|
|
124
|
+
>
|
|
125
|
+
{#if children}
|
|
126
|
+
{@render children()}
|
|
127
|
+
{/if}
|
|
128
|
+
|
|
129
|
+
<div class="flex items-center gap-1.5 rounded-lg border border-border bg-card p-1 shadow-2xs text-xs">
|
|
130
|
+
<!-- Copy selected rows button -->
|
|
131
|
+
<Button
|
|
132
|
+
type="button"
|
|
133
|
+
variant="ghost"
|
|
134
|
+
size="sm"
|
|
135
|
+
class="h-7 px-2 gap-1 text-[11px]"
|
|
136
|
+
disabled={selectedRows.length === 0}
|
|
137
|
+
onclick={handleCopySelection}
|
|
138
|
+
title={chinese ? '复制选中行到剪贴板 (Excel TSV 格式)' : 'Copy selected rows as TSV'}
|
|
139
|
+
>
|
|
140
|
+
{#if isCopySuccess}
|
|
141
|
+
<Check class="h-3.5 w-3.5 text-success" />
|
|
142
|
+
<span class="text-success">{chinese ? '已复制' : 'Copied'}</span>
|
|
143
|
+
{:else}
|
|
144
|
+
<ClipboardCopy class="h-3.5 w-3.5 text-muted-foreground" />
|
|
145
|
+
<span>
|
|
146
|
+
{chinese
|
|
147
|
+
? selectedRows.length > 0
|
|
148
|
+
? `复制选中 (${selectedRows.length})`
|
|
149
|
+
: '复制选中'
|
|
150
|
+
: selectedRows.length > 0
|
|
151
|
+
? `Copy (${selectedRows.length})`
|
|
152
|
+
: 'Copy'}
|
|
153
|
+
</span>
|
|
154
|
+
{/if}
|
|
155
|
+
</Button>
|
|
156
|
+
|
|
157
|
+
<div class="h-3.5 w-px bg-border"></div>
|
|
158
|
+
|
|
159
|
+
<!-- Paste from clipboard button -->
|
|
160
|
+
<Button
|
|
161
|
+
type="button"
|
|
162
|
+
variant="ghost"
|
|
163
|
+
size="sm"
|
|
164
|
+
class="h-7 px-2 gap-1 text-[11px]"
|
|
165
|
+
onclick={handlePasteFromButton}
|
|
166
|
+
title={chinese ? '从剪贴板粘贴 Excel / 表格数据' : 'Paste table data from clipboard'}
|
|
167
|
+
>
|
|
168
|
+
<ClipboardPaste class="h-3.5 w-3.5 text-muted-foreground" />
|
|
169
|
+
<span>{chinese ? '粘贴表格' : 'Paste'}</span>
|
|
170
|
+
</Button>
|
|
171
|
+
|
|
172
|
+
{#if hasUndoableAction && onUndo}
|
|
173
|
+
<div class="h-3.5 w-px bg-border"></div>
|
|
174
|
+
<Button
|
|
175
|
+
type="button"
|
|
176
|
+
variant="ghost"
|
|
177
|
+
size="sm"
|
|
178
|
+
class="h-7 px-2 gap-1 text-[11px] text-muted-foreground hover:text-foreground"
|
|
179
|
+
onclick={handleUndo}
|
|
180
|
+
title={chinese ? '撤销上次粘贴' : 'Undo last paste'}
|
|
181
|
+
>
|
|
182
|
+
<Undo2 class="h-3.5 w-3.5" />
|
|
183
|
+
<span>{chinese ? '撤销' : 'Undo'}</span>
|
|
184
|
+
</Button>
|
|
185
|
+
{/if}
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
<!-- Paste Preview Modal Dialog -->
|
|
190
|
+
{#if isModalOpen && parsedTable}
|
|
191
|
+
<div
|
|
192
|
+
role="dialog"
|
|
193
|
+
aria-modal="true"
|
|
194
|
+
aria-labelledby="clipboard-preview-title"
|
|
195
|
+
class="fixed inset-0 z-50 flex items-center justify-center p-4 bg-background/80 backdrop-blur-sm"
|
|
196
|
+
>
|
|
197
|
+
<div
|
|
198
|
+
class="relative z-10 flex flex-col w-full max-w-2xl max-h-[85vh] rounded-md border border-border bg-card text-card-foreground shadow-[var(--shadow-overlay)] overflow-hidden animate-in fade-in zoom-in-95 duration-150"
|
|
199
|
+
>
|
|
200
|
+
<!-- Header -->
|
|
201
|
+
<div class="flex items-center justify-between border-b border-border/70 px-6 py-4 bg-card">
|
|
202
|
+
<div class="flex items-center gap-2.5 text-primary">
|
|
203
|
+
<FileSpreadsheet class="h-5 w-5" />
|
|
204
|
+
<h3 id="clipboard-preview-title" class="text-base font-semibold text-foreground">
|
|
205
|
+
{chinese ? '剪贴板数据导入预览' : 'Paste Data Preview'}
|
|
206
|
+
</h3>
|
|
207
|
+
</div>
|
|
208
|
+
<button
|
|
209
|
+
type="button"
|
|
210
|
+
onclick={() => (isModalOpen = false)}
|
|
211
|
+
class="flex h-7 w-7 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer"
|
|
212
|
+
aria-label="Close"
|
|
213
|
+
>
|
|
214
|
+
<X class="h-4 w-4" />
|
|
215
|
+
</button>
|
|
216
|
+
</div>
|
|
217
|
+
|
|
218
|
+
<!-- Overview bar -->
|
|
219
|
+
<div class="flex items-center justify-between border-b border-border/60 bg-muted/20 px-6 py-3 text-xs">
|
|
220
|
+
<span class="text-muted-foreground">
|
|
221
|
+
{chinese
|
|
222
|
+
? `解析出 ${parsedTable.rowCount} 行数据,${parsedTable.colCount} 列`
|
|
223
|
+
: `Detected ${parsedTable.rowCount} rows, ${parsedTable.colCount} columns`}
|
|
224
|
+
</span>
|
|
225
|
+
|
|
226
|
+
<div class="flex items-center gap-3">
|
|
227
|
+
<span class="font-medium text-foreground">{chinese ? '写入方式:' : 'Mode:'}</span>
|
|
228
|
+
<label class="inline-flex items-center gap-1 cursor-pointer">
|
|
229
|
+
<input type="radio" value="append" bind:group={pasteMode} class="text-primary" />
|
|
230
|
+
<span>{chinese ? '追加为新行' : 'Append'}</span>
|
|
231
|
+
</label>
|
|
232
|
+
<label class="inline-flex items-center gap-1 cursor-pointer">
|
|
233
|
+
<input type="radio" value="overwrite" bind:group={pasteMode} class="text-primary" />
|
|
234
|
+
<span>{chinese ? '覆盖已有行' : 'Overwrite'}</span>
|
|
235
|
+
</label>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
<!-- Column Mapping List -->
|
|
240
|
+
<div class="px-6 py-3 border-b border-border/50 bg-background text-xs">
|
|
241
|
+
<div class="font-semibold text-muted-foreground mb-2 uppercase tracking-wider text-[11px]">
|
|
242
|
+
{chinese ? '字段映射对齐' : 'Column Alignment'}
|
|
243
|
+
</div>
|
|
244
|
+
<div class="flex flex-wrap gap-2">
|
|
245
|
+
{#each columnMappings as map (map.clipboardIndex)}
|
|
246
|
+
<div class="inline-flex items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2.5 py-1">
|
|
247
|
+
<span class="font-medium text-foreground">{map.clipboardHeader}</span>
|
|
248
|
+
<ArrowRight class="h-3 w-3 text-muted-foreground" />
|
|
249
|
+
{#if map.matchedColumnLabel}
|
|
250
|
+
<span class="text-success font-medium">{map.matchedColumnLabel}</span>
|
|
251
|
+
{:else}
|
|
252
|
+
<span class="text-muted-foreground italic">{chinese ? '未映射' : 'Unmapped'}</span>
|
|
253
|
+
{/if}
|
|
254
|
+
</div>
|
|
255
|
+
{/each}
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
|
|
259
|
+
<!-- Data Preview Table (First 5 rows) -->
|
|
260
|
+
<div class="flex-1 overflow-y-auto px-6 py-4">
|
|
261
|
+
<div class="text-[11px] font-semibold text-muted-foreground mb-2 uppercase tracking-wider">
|
|
262
|
+
{chinese ? '前 5 行数据预览' : 'First 5 Rows Preview'}
|
|
263
|
+
</div>
|
|
264
|
+
<div class="rounded-lg border border-border overflow-x-auto">
|
|
265
|
+
<table class="w-full text-left text-xs border-collapse">
|
|
266
|
+
<thead class="bg-muted/40 border-b border-border">
|
|
267
|
+
<tr>
|
|
268
|
+
<th class="p-2 font-mono text-[11px] text-muted-foreground w-10">#</th>
|
|
269
|
+
{#each parsedTable.headers as h (h)}
|
|
270
|
+
<th class="p-2 font-medium text-foreground whitespace-nowrap">{h}</th>
|
|
271
|
+
{/each}
|
|
272
|
+
</tr>
|
|
273
|
+
</thead>
|
|
274
|
+
<tbody class="divide-y divide-border/60">
|
|
275
|
+
{#each parsedTable.rawGrid.slice(0, 5) as row, idx (idx)}
|
|
276
|
+
<tr class="hover:bg-muted/30">
|
|
277
|
+
<td class="p-2 font-mono text-[11px] text-muted-foreground">{idx + 1}</td>
|
|
278
|
+
{#each row as cell, cellIdx (cellIdx)}
|
|
279
|
+
<td class="p-2 text-foreground whitespace-nowrap max-w-44 truncate">{cell}</td>
|
|
280
|
+
{/each}
|
|
281
|
+
</tr>
|
|
282
|
+
{/each}
|
|
283
|
+
</tbody>
|
|
284
|
+
</table>
|
|
285
|
+
</div>
|
|
286
|
+
</div>
|
|
287
|
+
|
|
288
|
+
<!-- Footer -->
|
|
289
|
+
<div class="flex items-center justify-between border-t border-border/70 px-6 py-4 bg-card">
|
|
290
|
+
<span class="text-[11px] text-muted-foreground">
|
|
291
|
+
{chinese ? '确认后将把表格数据批量导入' : 'Confirm to write parsed rows to table'}
|
|
292
|
+
</span>
|
|
293
|
+
|
|
294
|
+
<div class="flex items-center gap-2">
|
|
295
|
+
<Button type="button" variant="ghost" size="sm" onclick={() => (isModalOpen = false)}>
|
|
296
|
+
{chinese ? '取消' : 'Cancel'}
|
|
297
|
+
</Button>
|
|
298
|
+
|
|
299
|
+
<Button type="button" size="sm" onclick={handleConfirmPaste} class="gap-1 min-w-24">
|
|
300
|
+
<Check class="h-3.5 w-3.5" />
|
|
301
|
+
<span>{chinese ? '确认导入' : 'Confirm'}</span>
|
|
302
|
+
</Button>
|
|
303
|
+
</div>
|
|
304
|
+
</div>
|
|
305
|
+
</div>
|
|
306
|
+
</div>
|
|
307
|
+
{/if}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import { type ColumnDef } from './useTableClipboard.svelte.js';
|
|
3
|
+
export interface TableClipboardManagerProps {
|
|
4
|
+
columns: ColumnDef[];
|
|
5
|
+
selectedRows?: Record<string, unknown>[] | undefined;
|
|
6
|
+
class?: string | undefined;
|
|
7
|
+
onPasteConfirmed?: ((rows: Record<string, unknown>[], mode: 'append' | 'overwrite') => void) | undefined;
|
|
8
|
+
onUndo?: (() => void) | undefined;
|
|
9
|
+
children?: Snippet | undefined;
|
|
10
|
+
}
|
|
11
|
+
declare const TableClipboardManager: import("svelte").Component<TableClipboardManagerProps, {}, "">;
|
|
12
|
+
type TableClipboardManager = ReturnType<typeof TableClipboardManager>;
|
|
13
|
+
export default TableClipboardManager;
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
<span>{triggerText}</span>
|
|
148
148
|
{#if runningCount > 0}
|
|
149
149
|
<span
|
|
150
|
-
class="ml-1 inline-flex items-center justify-center h-4 min-w-[1rem] px-1 text-
|
|
150
|
+
class="ml-1 inline-flex items-center justify-center h-4 min-w-[1rem] px-1 text-xs font-semibold rounded-full bg-primary text-primary-foreground"
|
|
151
151
|
data-svadmin-counter="running-tasks"
|
|
152
152
|
>
|
|
153
153
|
{runningCount}
|
|
@@ -230,7 +230,7 @@
|
|
|
230
230
|
Running
|
|
231
231
|
{#if runningCount > 0}
|
|
232
232
|
<span class="inline-flex h-1.5 w-1.5 rounded-full bg-primary animate-pulse"></span>
|
|
233
|
-
<span class="text-
|
|
233
|
+
<span class="text-xs bg-primary/10 text-primary px-1 rounded">{runningCount}</span>
|
|
234
234
|
{/if}
|
|
235
235
|
</button>
|
|
236
236
|
<button
|
|
@@ -321,27 +321,27 @@
|
|
|
321
321
|
</span>
|
|
322
322
|
<!-- Status Badge -->
|
|
323
323
|
{#if task.status === 'running'}
|
|
324
|
-
<span class="inline-flex items-center gap-1 text-
|
|
324
|
+
<span class="inline-flex items-center gap-1 text-xs font-medium px-2 py-0.5 rounded-full bg-primary/10 text-primary">
|
|
325
325
|
<RotateCw class="h-3 w-3 animate-spin" />
|
|
326
326
|
Running
|
|
327
327
|
</span>
|
|
328
328
|
{:else if task.status === 'pending'}
|
|
329
|
-
<span class="inline-flex items-center gap-1 text-
|
|
329
|
+
<span class="inline-flex items-center gap-1 text-xs font-medium px-2 py-0.5 rounded-full bg-muted text-muted-foreground">
|
|
330
330
|
<Clock class="h-3 w-3" />
|
|
331
331
|
Pending
|
|
332
332
|
</span>
|
|
333
333
|
{:else if task.status === 'completed'}
|
|
334
|
-
<span class="inline-flex items-center gap-1 text-
|
|
334
|
+
<span class="inline-flex items-center gap-1 text-xs font-medium px-2 py-0.5 rounded-full bg-success/15 text-success">
|
|
335
335
|
<CheckCircle2 class="h-3 w-3" />
|
|
336
336
|
Completed
|
|
337
337
|
</span>
|
|
338
338
|
{:else if task.status === 'failed'}
|
|
339
|
-
<span class="inline-flex items-center gap-1 text-
|
|
339
|
+
<span class="inline-flex items-center gap-1 text-xs font-medium px-2 py-0.5 rounded-full bg-destructive/15 text-destructive">
|
|
340
340
|
<AlertCircle class="h-3 w-3" />
|
|
341
341
|
Failed
|
|
342
342
|
</span>
|
|
343
343
|
{:else if task.status === 'cancelled'}
|
|
344
|
-
<span class="inline-flex items-center gap-1 text-
|
|
344
|
+
<span class="inline-flex items-center gap-1 text-xs font-medium px-2 py-0.5 rounded-full bg-muted text-muted-foreground">
|
|
345
345
|
<XCircle class="h-3 w-3" />
|
|
346
346
|
Cancelled
|
|
347
347
|
</span>
|
|
@@ -352,7 +352,7 @@
|
|
|
352
352
|
{/if}
|
|
353
353
|
</div>
|
|
354
354
|
|
|
355
|
-
<span class="text-
|
|
355
|
+
<span class="text-xs text-muted-foreground whitespace-nowrap">
|
|
356
356
|
{formatTime(task.createdAt)}
|
|
357
357
|
</span>
|
|
358
358
|
</div>
|
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
|
|
398
398
|
<!-- Card Action Footer -->
|
|
399
399
|
<div class="mt-3 pt-2.5 border-t border-border/60 flex items-center justify-between text-xs">
|
|
400
|
-
<span class="text-muted-foreground text-
|
|
400
|
+
<span class="text-muted-foreground text-xs">
|
|
401
401
|
ID: <span class="font-mono">{task.id}</span>
|
|
402
402
|
</span>
|
|
403
403
|
<div class="flex items-center gap-1">
|