@svadmin/ui 0.126.1 → 0.128.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 +660 -81
- package/dist/app.theme.css +660 -81
- package/dist/components/AbacPolicyMatrix.svelte +1 -1
- package/dist/components/AboutSettings.svelte +1 -1
- package/dist/components/ActionPalette.svelte +2 -2
- package/dist/components/ActivityFeed.svelte +1 -1
- package/dist/components/AdminApp.svelte +2 -2
- package/dist/components/AdminCopilotWidget.svelte +4 -4
- package/dist/components/AnimatedCounter.svelte +2 -1
- package/dist/components/ApiPlayground.svelte +2 -2
- package/dist/components/ApiSettings.svelte +3 -3
- package/dist/components/ApprovalActionCard.svelte +1 -1
- package/dist/components/AsyncExportModal.svelte +6 -6
- package/dist/components/AuditLogDrawer.svelte +1 -1
- package/dist/components/AuditLogViewer.svelte +3 -3
- package/dist/components/AuditTrailInspector.svelte +1 -1
- package/dist/components/AutoTable.svelte +2 -1
- package/dist/components/BatchEditModal.svelte +2 -2
- package/dist/components/BillingInvoiceDrawer.svelte +4 -3
- package/dist/components/CanvasAnnotation.svelte +1 -1
- package/dist/components/Cascader.svelte +3 -3
- package/dist/components/ColumnSettings.svelte +1 -1
- package/dist/components/ColumnVisibilityDrawer.svelte +2 -2
- package/dist/components/ComboboxField.svelte +15 -8
- package/dist/components/CommandPalette.svelte +16 -5
- package/dist/components/CommentThread.svelte +2 -1
- package/dist/components/ConcurrentConflictModal.svelte +3 -3
- package/dist/components/ConfirmDialog.svelte +2 -2
- package/dist/components/DashboardLayoutStorage.svelte +2 -2
- package/dist/components/DataFreshnessIndicator.svelte +1 -1
- package/dist/components/DataImportDropzone.svelte +1 -1
- package/dist/components/DrawerForm.svelte +1 -1
- package/dist/components/DualApprovalGate.svelte +2 -2
- package/dist/components/ExcelExportButton.svelte +1 -1
- package/dist/components/ExcelImportWizard.svelte +1 -1
- package/dist/components/FieldRenderer.svelte +6 -6
- package/dist/components/FileUpload.svelte +11 -2
- package/dist/components/FileUpload.svelte.d.ts +2 -0
- package/dist/components/FilterDropdown.svelte +2 -2
- package/dist/components/FilterTagBar.svelte +1 -1
- package/dist/components/GlobalShortcuts.svelte +1 -1
- package/dist/components/HmacSignatureCalculator.svelte +2 -2
- package/dist/components/I18nLanguagePackEditor.svelte +1 -1
- package/dist/components/ImportPreviewValidator.svelte +1 -1
- package/dist/components/ImportWizard.svelte +2 -2
- package/dist/components/IncidentWarRoomDrawer.svelte +1 -1
- package/dist/components/InlineEdit.svelte +1 -1
- package/dist/components/JsonViewer.svelte +1 -1
- package/dist/components/KeyboardShortcutsModal.svelte +1 -1
- package/dist/components/KpiCard.svelte +2 -1
- package/dist/components/LazyPage.svelte +1 -1
- package/dist/components/LiveIndicator.svelte +1 -1
- package/dist/components/LiveStreamLogViewer.svelte +1 -1
- package/dist/components/LockScreen.svelte +4 -4
- package/dist/components/MasterDetailView.svelte +1 -1
- package/dist/components/MasterSubTableDrawer.svelte +1 -1
- package/dist/components/MentionsInput.svelte +1 -1
- package/dist/components/MicroAppFrame.svelte +1 -1
- package/dist/components/MicroAppSandbox.svelte +1 -1
- package/dist/components/MockDataInterceptor.svelte +1 -1
- package/dist/components/ModalForm.svelte +9 -9
- package/dist/components/NavigateToResource.svelte +1 -1
- package/dist/components/NotificationCenter.svelte +2 -1
- package/dist/components/OfflineSyncBanner.svelte +1 -1
- package/dist/components/OmnibarCommandPalette.svelte +1 -1
- package/dist/components/PivotDrilldownModal.svelte +1 -1
- package/dist/components/Popconfirm.svelte +62 -21
- package/dist/components/Popconfirm.svelte.d.ts +5 -0
- package/dist/components/QueryBuilder.svelte +1 -1
- package/dist/components/QuotaProgressBar.svelte +2 -1
- package/dist/components/RadioGroup.svelte +1 -1
- package/dist/components/RecordCompareModal.svelte +1 -1
- package/dist/components/RuleExpressionBuilder.svelte +1 -1
- package/dist/components/SafeDeleteConfirm.svelte +1 -1
- package/dist/components/ScheduledJobManager.svelte +1 -1
- package/dist/components/SchemaVisualModeler.svelte +1 -1
- package/dist/components/SecureDataExporter.svelte +1 -1
- package/dist/components/SecuritySettings.svelte +3 -3
- package/dist/components/SessionTimeoutGuard.svelte +1 -1
- package/dist/components/Space.svelte +19 -3
- package/dist/components/Space.svelte.d.ts +6 -1
- package/dist/components/Statistic.svelte +2 -1
- package/dist/components/StepWizard.svelte +1 -1
- package/dist/components/SvarDataGrid.svelte +1 -1
- package/dist/components/SystemHealthCheckDashboard.svelte +2 -2
- package/dist/components/TableAggregationFooter.svelte +3 -1
- package/dist/components/TaskCenter.svelte +3 -2
- package/dist/components/TenantContextSwitcher.svelte +1 -1
- package/dist/components/ThreadedCommentDrawer.svelte +1 -1
- package/dist/components/Toast.svelte +7 -1
- package/dist/components/Toast.svelte.d.ts +4 -1
- package/dist/components/Transfer.svelte +2 -2
- package/dist/components/TreeSelect.svelte +2 -2
- package/dist/components/TreeTransferSelect.svelte +2 -2
- package/dist/components/VirtualTreeSelect.svelte +2 -2
- package/dist/components/WebhookSimulator.svelte +1 -1
- package/dist/components/WidgetContainer.svelte +2 -1
- package/dist/components/account/SettingsEnterprisePage.svelte +5 -4
- package/dist/components/charts/FunnelChart.svelte +2 -2
- package/dist/components/content/AuditTimeline.svelte +2 -1
- package/dist/components/content/ContentPageHeader.svelte +2 -2
- package/dist/components/fields/CopyField.svelte +1 -1
- package/dist/components/fields/DateRangeField.svelte +7 -13
- package/dist/components/svar-grid-interactions.js +9 -5
- package/dist/components/ui/alert/alert.svelte +1 -0
- package/dist/components/ui/breadcrumb/breadcrumb-separator.svelte +10 -2
- package/dist/components/ui/breadcrumb/breadcrumb-separator.svelte.d.ts +1 -0
- package/dist/components/ui/command/command-list.svelte +2 -0
- package/dist/components/ui/command/command-loading.svelte +13 -7
- package/dist/components/ui/dialog/dialog-content.svelte +15 -1
- package/dist/components/ui/dialog/dialog-content.svelte.d.ts +6 -0
- package/dist/components/ui/input/input.svelte +82 -7
- package/dist/components/ui/input/input.svelte.d.ts +7 -2
- package/dist/components/ui/select/select.svelte +6 -1
- package/dist/components/ui/select/select.svelte.d.ts +4 -1
- package/dist/components/ui/switch/switch.svelte +11 -2
- package/dist/components/ui/switch/switch.svelte.d.ts +2 -0
- package/dist/components/ui/textarea/textarea.svelte +61 -1
- package/dist/components/ui/textarea/textarea.svelte.d.ts +7 -1
- package/dist/components/ui/tooltip/tooltip-content.svelte +5 -1
- package/dist/components/ui/tooltip/tooltip-content.svelte.d.ts +1 -0
- package/dist/components/ui/tooltip/tooltip-context.svelte.js +1 -1
- package/dist/copy-format.d.ts +2 -0
- package/dist/copy-format.js +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/notifications.svelte.js +1 -1
- package/dist/page-chrome.css +5 -0
- package/package.json +4 -4
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
<input
|
|
219
219
|
type="text"
|
|
220
220
|
bind:value={searchKeyword}
|
|
221
|
-
placeholder="
|
|
221
|
+
placeholder="按规则名称、资源类型检索…"
|
|
222
222
|
class="w-64 pl-8 pr-3 py-1.5 text-xs rounded-lg border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary"
|
|
223
223
|
/>
|
|
224
224
|
</div>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
const resources = $derived(adminContext.resources.filter((resource) => resource.meta?.['aboutVisible'] !== false));
|
|
12
12
|
const providerNames = $derived(adminContext.getDataProviderNames());
|
|
13
13
|
let { version: suppliedVersion, headingLevel = 'h1' }: { version?: string; headingLevel?: 'h1' | 'h2' } = $props();
|
|
14
|
-
const buildVersion = "0.
|
|
14
|
+
const buildVersion = "0.128.0";
|
|
15
15
|
const version = $derived(suppliedVersion ?? (
|
|
16
16
|
buildVersion.startsWith('__')
|
|
17
17
|
? (i18n.locale === 'zh-CN' ? '开发构建(未提供版本)' : 'Development build (version unavailable)')
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
const resolvedPlaceholder = $derived(
|
|
134
|
-
placeholder ?? (chinese ? '输入动作名称、拼音首字母或按键 (如 ⌘. 呼出)
|
|
134
|
+
placeholder ?? (chinese ? '输入动作名称、拼音首字母或按键 (如 ⌘. 呼出)…' : 'Type action name or shortcut…'),
|
|
135
135
|
);
|
|
136
136
|
</script>
|
|
137
137
|
|
|
@@ -247,7 +247,7 @@
|
|
|
247
247
|
bind:this={paramInput}
|
|
248
248
|
type="text"
|
|
249
249
|
bind:value={paramValue}
|
|
250
|
-
placeholder={pendingAction.paramPlaceholder ?? (chinese ? '
|
|
250
|
+
placeholder={pendingAction.paramPlaceholder ?? (chinese ? '输入执行参数…' : 'Enter parameter…')}
|
|
251
251
|
class="h-9 w-full rounded-lg border border-input bg-background px-3 text-xs focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
252
252
|
/>
|
|
253
253
|
<Button
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
<div class="svadmin-activity-feed__composer">
|
|
109
109
|
<textarea
|
|
110
110
|
bind:value={newComment}
|
|
111
|
-
placeholder="Add an internal comment or update note
|
|
111
|
+
placeholder="Add an internal comment or update note…"
|
|
112
112
|
class="svadmin-activity-feed__textarea"
|
|
113
113
|
></textarea>
|
|
114
114
|
<div class="svadmin-activity-feed__send">
|
|
@@ -593,7 +593,7 @@
|
|
|
593
593
|
<div class="flex h-screen items-center justify-center">
|
|
594
594
|
<div class="space-y-4 text-center">
|
|
595
595
|
<div class="h-8 w-8 animate-spin rounded-full border-4 border-muted border-t-primary mx-auto"></div>
|
|
596
|
-
<p class="text-sm text-muted-foreground">Loading
|
|
596
|
+
<p class="text-sm text-muted-foreground">Loading…</p>
|
|
597
597
|
</div>
|
|
598
598
|
</div>
|
|
599
599
|
{:else if route === '/login' && loginPage}
|
|
@@ -630,7 +630,7 @@
|
|
|
630
630
|
<div class="absolute inset-0 z-10 flex min-h-40 items-center justify-center bg-background/80" role="status" aria-live="polite">
|
|
631
631
|
<div class="space-y-3 text-center">
|
|
632
632
|
<div class="h-6 w-6 animate-spin rounded-full border-4 border-muted border-t-primary mx-auto"></div>
|
|
633
|
-
<p class="text-sm text-muted-foreground">Loading
|
|
633
|
+
<p class="text-sm text-muted-foreground">Loading…</p>
|
|
634
634
|
</div>
|
|
635
635
|
</div>
|
|
636
636
|
{:else}
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
{
|
|
61
61
|
id: 'msg-init',
|
|
62
62
|
role: 'assistant',
|
|
63
|
-
content: '
|
|
63
|
+
content: '你好。可以询问报表洞察,或用自然语言过滤表格数据。',
|
|
64
64
|
timestamp: '刚刚',
|
|
65
65
|
},
|
|
66
66
|
]);
|
|
@@ -97,11 +97,11 @@
|
|
|
97
97
|
} else {
|
|
98
98
|
// Built-in intelligent simulation with auto filter extraction
|
|
99
99
|
await new Promise((r) => setTimeout(r, 650));
|
|
100
|
-
let replyContent =
|
|
100
|
+
let replyContent = `已检索并分析关于“${q}”的数据记录。`;
|
|
101
101
|
let filterSuggestion: CopilotFilterSuggestion | undefined;
|
|
102
102
|
|
|
103
103
|
if (q.includes('华东') || q.includes('大额') || q.includes('筛选') || q.includes('订单')) {
|
|
104
|
-
replyContent =
|
|
104
|
+
replyContent = `已根据这条指令分析业务规则:建议对当前表格应用复合过滤【所属大区 = 华东大区 且 订单金额 >= ¥50,000】。`;
|
|
105
105
|
filterSuggestion = {
|
|
106
106
|
field: 'region',
|
|
107
107
|
operator: '=',
|
|
@@ -268,7 +268,7 @@
|
|
|
268
268
|
{#if isThinking}
|
|
269
269
|
<div class="flex items-center gap-2 text-xs text-muted-foreground p-2 rounded-lg bg-muted/20 w-fit">
|
|
270
270
|
<Loader2 class="h-3.5 w-3.5 animate-spin text-primary" />
|
|
271
|
-
<span class="font-mono text-[11px]"
|
|
271
|
+
<span class="font-mono text-[11px]">正在解析业务意图并检索数据…</span>
|
|
272
272
|
</div>
|
|
273
273
|
{/if}
|
|
274
274
|
</div>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { untrack } from 'svelte';
|
|
3
|
+
import { formatAdminNumber } from '@svadmin/core';
|
|
3
4
|
|
|
4
5
|
interface Props {
|
|
5
6
|
/** The target number to animate to */
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
// Ease-out cubic
|
|
34
35
|
const eased = 1 - Math.pow(1 - progress, 3);
|
|
35
36
|
const current = Math.round(start + (target - start) * eased);
|
|
36
|
-
displayValue = current
|
|
37
|
+
displayValue = formatAdminNumber(current, { locale: null, maximumFractionDigits: 0 });
|
|
37
38
|
|
|
38
39
|
if (progress < 1) {
|
|
39
40
|
currentRaf = requestAnimationFrame(tick);
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
>
|
|
172
172
|
{#if isExecuting}
|
|
173
173
|
<Loader2 class="h-3.5 w-3.5 animate-spin" />
|
|
174
|
-
<span
|
|
174
|
+
<span>请求中…</span>
|
|
175
175
|
{:else}
|
|
176
176
|
<Play class="h-3.5 w-3.5 fill-current" />
|
|
177
177
|
<span>发送请求</span>
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
id="api-request-body"
|
|
190
190
|
class="w-full h-24 rounded-md border border-input bg-background p-3 font-mono text-xs leading-relaxed text-foreground outline-none focus:ring-1 focus:ring-primary"
|
|
191
191
|
bind:value={requestBody}
|
|
192
|
-
placeholder="输入 JSON
|
|
192
|
+
placeholder="输入 JSON 正文…"
|
|
193
193
|
></textarea>
|
|
194
194
|
</div>
|
|
195
195
|
{/if}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import ConfirmDialog from './ConfirmDialog.svelte';
|
|
3
3
|
import { definedOptions } from '@svadmin/core/options';
|
|
4
|
-
import { captureAdminContext, notifyWithProvider, type ApiCredentialSummary, type WebhookSummary } from '@svadmin/core';
|
|
4
|
+
import { captureAdminContext, formatAdminTime, notifyWithProvider, type ApiCredentialSummary, type WebhookSummary } from '@svadmin/core';
|
|
5
5
|
import { useTranslation } from '@svadmin/core/i18n';
|
|
6
6
|
import { Check, Copy, Plus, ShieldCheck, Trash2 } from '@lucide/svelte';
|
|
7
7
|
import { Button } from './ui/button/index.js';
|
|
@@ -216,8 +216,8 @@
|
|
|
216
216
|
class="rounded-none border-0"
|
|
217
217
|
keys={keys.map((key) => definedOptions({
|
|
218
218
|
id: key.id, name: key.name, prefix: key.prefix,
|
|
219
|
-
createdAt:
|
|
220
|
-
lastUsedAt: key.lastUsedAt ?
|
|
219
|
+
createdAt: formatAdminTime(key.createdAt, { dateStyle: 'medium' }),
|
|
220
|
+
lastUsedAt: key.lastUsedAt ? formatAdminTime(key.lastUsedAt, { dateStyle: 'medium' }) : undefined,
|
|
221
221
|
permissions: key.permissions,
|
|
222
222
|
}))}
|
|
223
223
|
stateTitle={i18n.t('api.noKeys')}
|
|
@@ -224,7 +224,7 @@
|
|
|
224
224
|
<textarea
|
|
225
225
|
id={`${controlId}-reject-reason`}
|
|
226
226
|
bind:value={rejectReason}
|
|
227
|
-
placeholder={isZh ? '请说明驳回原因…' : 'Please explain why this request is being rejected
|
|
227
|
+
placeholder={isZh ? '请说明驳回原因…' : 'Please explain why this request is being rejected…'}
|
|
228
228
|
class="svadmin-approval-card__textarea svadmin-approval-card__textarea--reject"
|
|
229
229
|
required
|
|
230
230
|
></textarea>
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
if (selectedColumnKeys.length === 0 || !fileName.trim()) return;
|
|
133
133
|
taskStatus = 'exporting';
|
|
134
134
|
exportProgress = 15;
|
|
135
|
-
statusMessage = '
|
|
135
|
+
statusMessage = '正在分析数据并生成报表任务…';
|
|
136
136
|
|
|
137
137
|
const fullFileName = `${fileName.trim()}.${currentFormat}`;
|
|
138
138
|
const startTime = Date.now();
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
try {
|
|
141
141
|
if (onexport) {
|
|
142
142
|
exportProgress = 40;
|
|
143
|
-
statusMessage = '
|
|
143
|
+
statusMessage = '正在提取所选字段及筛选记录…';
|
|
144
144
|
|
|
145
145
|
const result = await onexport({
|
|
146
146
|
fileName: fullFileName,
|
|
@@ -156,10 +156,10 @@
|
|
|
156
156
|
// Built-in simulated asynchronous export progression
|
|
157
157
|
await new Promise((r) => setTimeout(r, 600));
|
|
158
158
|
exportProgress = 55;
|
|
159
|
-
statusMessage = '
|
|
159
|
+
statusMessage = '正在序列化结构与压缩数据流…';
|
|
160
160
|
await new Promise((r) => setTimeout(r, 700));
|
|
161
161
|
exportProgress = 85;
|
|
162
|
-
statusMessage = '
|
|
162
|
+
statusMessage = '正在生成云端下载凭证…';
|
|
163
163
|
await new Promise((r) => setTimeout(r, 400));
|
|
164
164
|
exportProgress = 100;
|
|
165
165
|
|
|
@@ -428,7 +428,7 @@
|
|
|
428
428
|
<div class="py-6 flex flex-col items-center justify-center text-center space-y-3">
|
|
429
429
|
<Loader2 class="h-8 w-8 text-primary animate-spin" />
|
|
430
430
|
<div class="space-y-1">
|
|
431
|
-
<h4 class="font-semibold text-foreground text-sm"
|
|
431
|
+
<h4 class="font-semibold text-foreground text-sm">正在后台异步生成数据报表…</h4>
|
|
432
432
|
<p class="text-muted-foreground text-xs">{statusMessage}</p>
|
|
433
433
|
</div>
|
|
434
434
|
|
|
@@ -503,7 +503,7 @@
|
|
|
503
503
|
开始生成报表
|
|
504
504
|
</button>
|
|
505
505
|
{:else if taskStatus === 'exporting'}
|
|
506
|
-
<span class="text-muted-foreground text-xs italic"
|
|
506
|
+
<span class="text-muted-foreground text-xs italic">任务仍在执行。离开页面会中断导出。</span>
|
|
507
507
|
{:else if taskStatus === 'completed'}
|
|
508
508
|
{#if exportResult?.fileUrl}
|
|
509
509
|
<button
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
<Search class="absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground" />
|
|
221
221
|
<input
|
|
222
222
|
type="text"
|
|
223
|
-
placeholder="Filter by user or action
|
|
223
|
+
placeholder="Filter by user or action…"
|
|
224
224
|
class="w-full rounded-md border border-input bg-background pl-8 pr-3 py-1.5 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary"
|
|
225
225
|
bind:value={searchQuery}
|
|
226
226
|
oninput={(e) => { searchQuery = e.currentTarget.value; }}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useTranslation } from '@svadmin/core/i18n';
|
|
3
3
|
|
|
4
|
-
import { captureAdminContext } from '@svadmin/core';
|
|
4
|
+
import { captureAdminContext, formatAdminTime } from '@svadmin/core';
|
|
5
5
|
import type { AuditLog, AuthProvider } from '@svadmin/core';
|
|
6
6
|
import { toast } from '@svadmin/core/toast';
|
|
7
7
|
import * as Table from './ui/table/index.js';
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
function formatDate(d: string | Date) {
|
|
95
|
-
return
|
|
95
|
+
return formatAdminTime(d, { dateStyle: 'medium' });
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
function getActionColor(action: string): 'default' | 'secondary' | 'destructive' | 'outline' {
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
<Search class="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" />
|
|
128
128
|
<Input
|
|
129
129
|
bind:value={searchQuery}
|
|
130
|
-
placeholder={i18n.t('settings.searchLogs') ?? 'Search by user, action, or resource
|
|
130
|
+
placeholder={i18n.t('settings.searchLogs') ?? 'Search by user, action, or resource…'}
|
|
131
131
|
class="pl-9"
|
|
132
132
|
/>
|
|
133
133
|
</div>
|
|
@@ -257,7 +257,7 @@
|
|
|
257
257
|
<input
|
|
258
258
|
type="text"
|
|
259
259
|
bind:value={searchKeyword}
|
|
260
|
-
placeholder="按操作人/IP
|
|
260
|
+
placeholder="按操作人/IP/动作/资源模糊检索…"
|
|
261
261
|
class="w-64 pl-8 pr-3 py-1.5 text-xs rounded-lg border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary"
|
|
262
262
|
/>
|
|
263
263
|
</div>
|
|
@@ -1515,7 +1515,8 @@
|
|
|
1515
1515
|
{/each}
|
|
1516
1516
|
</Table.Header>
|
|
1517
1517
|
</Table.Root>
|
|
1518
|
-
<div class="p-4 space-y-3">
|
|
1518
|
+
<div class="p-4 space-y-3" data-svadmin-table-state="loading" role="status" aria-live="polite" aria-busy="true">
|
|
1519
|
+
<span class="svadmin-sr-only">{i18n.t('common.loading')}</span>
|
|
1519
1520
|
<div class="flex gap-4 mb-2">
|
|
1520
1521
|
{#each visibleFields.slice(0, 4) as _, _i (_i)}
|
|
1521
1522
|
<Skeleton class="h-4 flex-1" />
|
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
type="text"
|
|
203
203
|
class="rounded border border-input bg-background px-2.5 py-1 text-xs text-foreground focus:ring-1 focus:ring-primary flex-1 min-w-[120px]"
|
|
204
204
|
bind:value={row.value}
|
|
205
|
-
placeholder="
|
|
205
|
+
placeholder="输入新内容…"
|
|
206
206
|
disabled={isSubmitting}
|
|
207
207
|
/>
|
|
208
208
|
{/if}
|
|
@@ -255,7 +255,7 @@
|
|
|
255
255
|
>
|
|
256
256
|
{#if isSubmitting}
|
|
257
257
|
<Loader2 class="h-3.5 w-3.5 animate-spin" />
|
|
258
|
-
<span
|
|
258
|
+
<span>正在更新…</span>
|
|
259
259
|
{:else}
|
|
260
260
|
<span>确认批量修改</span>
|
|
261
261
|
{/if}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { X, Receipt, Download, FileText, CheckCircle2, Clock, RotateCcw } from '@lucide/svelte';
|
|
3
|
+
import { formatAdminCurrency } from '@svadmin/core';
|
|
3
4
|
import { cn } from '../utils.js';
|
|
4
5
|
|
|
5
6
|
export interface BillingItem {
|
|
@@ -122,10 +123,10 @@
|
|
|
122
123
|
<div class="rounded-lg border border-primary/20 bg-primary/5 p-4 flex items-baseline justify-between font-mono">
|
|
123
124
|
<div>
|
|
124
125
|
<span class="text-muted-foreground text-xs block">当期应付结算总额</span>
|
|
125
|
-
<span class="text-2xl font-bold text-primary"
|
|
126
|
+
<span class="text-2xl font-bold text-primary">{formatAdminCurrency(invoice.totalAmount, { locale: 'zh-CN', currency: 'CNY' })}</span>
|
|
126
127
|
</div>
|
|
127
128
|
{#if invoice.taxAmount !== undefined}
|
|
128
|
-
<span class="text-xs text-muted-foreground">含增值税额:
|
|
129
|
+
<span class="text-xs text-muted-foreground">含增值税额: {formatAdminCurrency(invoice.taxAmount, { locale: 'zh-CN', currency: 'CNY' })}</span>
|
|
129
130
|
{/if}
|
|
130
131
|
</div>
|
|
131
132
|
|
|
@@ -151,7 +152,7 @@
|
|
|
151
152
|
{/if}
|
|
152
153
|
</td>
|
|
153
154
|
<td class="p-2.5 text-center text-muted-foreground">{item.category}</td>
|
|
154
|
-
<td class="p-2.5 text-right font-bold text-foreground"
|
|
155
|
+
<td class="p-2.5 text-right font-bold text-foreground">{formatAdminCurrency(item.amount, { locale: 'zh-CN', currency: 'CNY' })}</td>
|
|
155
156
|
</tr>
|
|
156
157
|
{/each}
|
|
157
158
|
</tbody>
|
|
@@ -375,7 +375,7 @@
|
|
|
375
375
|
<input
|
|
376
376
|
type="text"
|
|
377
377
|
bind:value={textInputPrompt}
|
|
378
|
-
placeholder="Annotation text
|
|
378
|
+
placeholder="Annotation text…"
|
|
379
379
|
class="h-7 w-36 rounded border border-input bg-background px-2 text-xs text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
380
380
|
onkeydown={(e) => {
|
|
381
381
|
if (e.key === 'Enter') submitText();
|
|
@@ -605,7 +605,7 @@
|
|
|
605
605
|
<span class="svadmin-cascader-tag">+{selectedMultiOptions.length - maxTagCount}</span>
|
|
606
606
|
{/if}
|
|
607
607
|
{:else}
|
|
608
|
-
<span class="truncate">{displayLabel || (placeholder ?? (i18n.t('field.selectPlaceholder', undefined) ?? '
|
|
608
|
+
<span class="truncate">{displayLabel || (placeholder ?? (i18n.t('field.selectPlaceholder', undefined) ?? '请选择…'))}</span>
|
|
609
609
|
{/if}
|
|
610
610
|
</span>
|
|
611
611
|
|
|
@@ -635,7 +635,7 @@
|
|
|
635
635
|
<input
|
|
636
636
|
type="search"
|
|
637
637
|
class="h-7 w-full min-w-0 border-0 bg-transparent text-xs outline-none placeholder:text-muted-foreground"
|
|
638
|
-
placeholder={searchPlaceholder ?? (i18n.t('common.search', undefined) ?? 'Search
|
|
638
|
+
placeholder={searchPlaceholder ?? (i18n.t('common.search', undefined) ?? 'Search…')}
|
|
639
639
|
bind:value={searchTerm}
|
|
640
640
|
aria-label={searchPlaceholder ?? 'Search options'}
|
|
641
641
|
/>
|
|
@@ -705,7 +705,7 @@
|
|
|
705
705
|
{@const parentKey = pathId(activePath.slice(0, colIndex))}
|
|
706
706
|
{#if parent && loadingValues.has(parentKey)}
|
|
707
707
|
<div role="status" class="py-4 text-center text-xs text-muted-foreground">
|
|
708
|
-
{i18n.t('common.loading', undefined) ?? '
|
|
708
|
+
{i18n.t('common.loading', undefined) ?? '加载中…'}
|
|
709
709
|
</div>
|
|
710
710
|
{:else if parent && loadErrors.has(parentKey)}
|
|
711
711
|
<div role="alert" class="py-4 text-center text-xs text-muted-foreground">
|
|
@@ -232,7 +232,7 @@
|
|
|
232
232
|
<input
|
|
233
233
|
type="text"
|
|
234
234
|
bind:value={filterText}
|
|
235
|
-
placeholder={i18n.t('common.search', { defaultValue: 'Search columns
|
|
235
|
+
placeholder={i18n.t('common.search', { defaultValue: 'Search columns…' })}
|
|
236
236
|
class="h-7.5 w-full rounded-md border border-input bg-muted/40 pl-7 pr-2 text-xs placeholder:text-muted-foreground/60 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
237
237
|
/>
|
|
238
238
|
</div>
|
|
@@ -354,7 +354,7 @@
|
|
|
354
354
|
<input
|
|
355
355
|
type="text"
|
|
356
356
|
bind:value={newPresetName}
|
|
357
|
-
placeholder={chinese ? '输入视图名称 (如: 财务视图)
|
|
357
|
+
placeholder={chinese ? '输入视图名称 (如: 财务视图)…' : 'Preset name…'}
|
|
358
358
|
class="h-7 flex-1 rounded border border-input bg-background px-2 text-xs focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
359
359
|
/>
|
|
360
360
|
<Button size="sm" class="h-7 px-2.5 text-xs" onclick={saveCurrentAsPreset}>
|
|
@@ -407,7 +407,7 @@
|
|
|
407
407
|
<input
|
|
408
408
|
type="text"
|
|
409
409
|
bind:value={filterQuery}
|
|
410
|
-
placeholder={chinese ? '快速检索列名或字段 Key
|
|
410
|
+
placeholder={chinese ? '快速检索列名或字段 Key…' : 'Search column name or key…'}
|
|
411
411
|
class="h-8 w-full rounded-md border border-input bg-muted/30 pl-8 pr-2.5 text-xs placeholder:text-muted-foreground/60 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
412
412
|
/>
|
|
413
413
|
{#if filterQuery}
|
|
@@ -88,6 +88,12 @@
|
|
|
88
88
|
const normalizedViewportHeight = $derived(
|
|
89
89
|
Number.isSafeInteger(viewportHeight) && viewportHeight >= 120 && viewportHeight <= 800 ? viewportHeight : 280,
|
|
90
90
|
);
|
|
91
|
+
// 选项溢出时,滚动面板露出最后一项大约一半,提示下面还有内容。
|
|
92
|
+
const menuViewportHeight = $derived.by(() => {
|
|
93
|
+
const item = normalizedItemHeight;
|
|
94
|
+
const full = Math.max(1, Math.floor(normalizedViewportHeight / item));
|
|
95
|
+
return full * item + Math.round(item / 2);
|
|
96
|
+
});
|
|
91
97
|
|
|
92
98
|
const binding = useResourceContract(() => resource);
|
|
93
99
|
const context = captureAdminContext();
|
|
@@ -189,11 +195,11 @@
|
|
|
189
195
|
const totalOptions = $derived(select.query.data?.total ?? availableOptions.length);
|
|
190
196
|
const shouldVirtualize = $derived(virtualized && availableOptions.length >= 200);
|
|
191
197
|
const virtualTotalHeight = $derived(availableOptions.length * normalizedItemHeight);
|
|
192
|
-
const virtualMaxScroll = $derived(Math.max(0, virtualTotalHeight -
|
|
198
|
+
const virtualMaxScroll = $derived(Math.max(0, virtualTotalHeight - menuViewportHeight));
|
|
193
199
|
const clampedListScrollTop = $derived(Math.max(0, Math.min(listScrollTop, virtualMaxScroll)));
|
|
194
200
|
const virtualStart = $derived(Math.max(0, Math.floor(clampedListScrollTop / normalizedItemHeight) - 5));
|
|
195
201
|
const virtualEnd = $derived(Math.min(availableOptions.length,
|
|
196
|
-
Math.ceil((clampedListScrollTop +
|
|
202
|
+
Math.ceil((clampedListScrollTop + menuViewportHeight) / normalizedItemHeight) + 5));
|
|
197
203
|
const renderedOptions = $derived(shouldVirtualize
|
|
198
204
|
? availableOptions.slice(virtualStart, virtualEnd) : availableOptions);
|
|
199
205
|
const activeOptionId = $derived(shouldVirtualize && activeIndex >= 0 && availableOptions[activeIndex]
|
|
@@ -351,8 +357,8 @@
|
|
|
351
357
|
const top = activeIndex * normalizedItemHeight;
|
|
352
358
|
const bottom = top + normalizedItemHeight;
|
|
353
359
|
if (top < clampedListScrollTop) listScrollTop = top;
|
|
354
|
-
else if (bottom > clampedListScrollTop +
|
|
355
|
-
listScrollTop = bottom -
|
|
360
|
+
else if (bottom > clampedListScrollTop + menuViewportHeight) {
|
|
361
|
+
listScrollTop = bottom - menuViewportHeight;
|
|
356
362
|
}
|
|
357
363
|
if (listElement) listElement.scrollTop = listScrollTop;
|
|
358
364
|
}
|
|
@@ -411,8 +417,8 @@
|
|
|
411
417
|
disabled={select.isFetching || searchInputValue !== appliedSearch}
|
|
412
418
|
value={`${typeof opt.value}:${opt.value}`}
|
|
413
419
|
onSelect={() => handleSelect(opt.value)}
|
|
414
|
-
style={
|
|
415
|
-
class="relative flex cursor-default select-none items-center rounded-sm px-2
|
|
420
|
+
style={`height:${normalizedItemHeight}px;`}
|
|
421
|
+
class="relative box-border flex cursor-default select-none items-center overflow-hidden rounded-sm px-2 text-sm outline-none data-[selected]:bg-accent data-[selected]:text-accent-foreground"
|
|
416
422
|
>
|
|
417
423
|
<Check class="mr-2 h-3.5 w-3.5 {selectedValues.includes(opt.value) ? 'opacity-100' : 'opacity-0'}" />
|
|
418
424
|
{opt.label}
|
|
@@ -486,11 +492,12 @@
|
|
|
486
492
|
aria-activedescendant={activeOptionId}
|
|
487
493
|
aria-multiselectable={multiple || undefined}
|
|
488
494
|
style={shouldVirtualize
|
|
489
|
-
? `height:${
|
|
495
|
+
? `height:${menuViewportHeight}px;max-height:${menuViewportHeight}px;overflow-y:auto;`
|
|
496
|
+
: `max-height:${menuViewportHeight}px;`}
|
|
490
497
|
onscroll={(event: Event) => {
|
|
491
498
|
if (event.currentTarget instanceof HTMLElement) listScrollTop = event.currentTarget.scrollTop;
|
|
492
499
|
}}
|
|
493
|
-
class="
|
|
500
|
+
class="overflow-y-auto px-1"
|
|
494
501
|
>
|
|
495
502
|
{#if select.isLoading}
|
|
496
503
|
{#each Array(3) as _, _i (_i)}
|
|
@@ -29,6 +29,15 @@
|
|
|
29
29
|
searchValue = '';
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
function localizedFallback(zh: string, en: string): string {
|
|
33
|
+
return i18n.locale.toLowerCase().startsWith('zh') ? zh : en;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function translateOrFallback(key: string, fallback: string): string {
|
|
37
|
+
const value = i18n.t(key);
|
|
38
|
+
return value && value !== key ? value : fallback;
|
|
39
|
+
}
|
|
40
|
+
|
|
32
41
|
function act(fn: () => void) {
|
|
33
42
|
fn();
|
|
34
43
|
close();
|
|
@@ -49,14 +58,16 @@
|
|
|
49
58
|
<Dialog.DialogContent class="overflow-hidden p-0 sm:max-w-[560px]">
|
|
50
59
|
<Dialog.DialogTitle class="sr-only">{i18n.t('common.search')}</Dialog.DialogTitle>
|
|
51
60
|
<Command.Root class="flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground [&_[data-command-group-heading]]:text-muted-foreground [&_[data-command-group-heading]]:px-2 [&_[data-command-group-heading]]:py-1.5 [&_[data-command-group-heading]]:text-xs [&_[data-command-group-heading]]:font-semibold [&_[data-command-group-heading]]:uppercase [&_[data-command-group-heading]]:tracking-wider">
|
|
52
|
-
<div class="flex items-center border-b
|
|
61
|
+
<div class="flex items-center border-b pl-3 pr-12" data-cmdk-input-wrapper="">
|
|
53
62
|
<Search class="mr-2 h-4 w-4 shrink-0 opacity-50" />
|
|
54
63
|
<Command.Input
|
|
55
64
|
bind:value={searchValue}
|
|
56
|
-
placeholder={hasAI
|
|
65
|
+
placeholder={hasAI
|
|
66
|
+
? translateOrFallback('commandPalette.searchOrAsk', localizedFallback('搜索命令或询问 AI…', 'Search commands or ask AI…'))
|
|
67
|
+
: i18n.t('common.search')}
|
|
57
68
|
class="flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50"
|
|
58
69
|
/>
|
|
59
|
-
<kbd class="ml-2 text-[10px] font-mono font-medium text-muted-foreground bg-muted px-1.5 py-0.5 rounded border border-border">ESC</kbd>
|
|
70
|
+
<kbd class="ml-2 shrink-0 text-[10px] font-mono font-medium text-muted-foreground bg-muted px-1.5 py-0.5 rounded border border-border">ESC</kbd>
|
|
60
71
|
</div>
|
|
61
72
|
<Command.List class="max-h-[320px] overflow-y-auto overflow-x-hidden p-1">
|
|
62
73
|
<Command.Empty class="py-6 text-center text-sm text-muted-foreground">
|
|
@@ -66,7 +77,7 @@
|
|
|
66
77
|
onclick={askAI}
|
|
67
78
|
>
|
|
68
79
|
<Sparkles class="h-3.5 w-3.5" />
|
|
69
|
-
{
|
|
80
|
+
{translateOrFallback('commandPalette.askAI', localizedFallback('询问 AI', 'Ask AI'))}: "{searchValue.trim()}"
|
|
70
81
|
</button>
|
|
71
82
|
{:else}
|
|
72
83
|
{i18n.t('common.noData')}
|
|
@@ -82,7 +93,7 @@
|
|
|
82
93
|
class={itemClass}
|
|
83
94
|
>
|
|
84
95
|
<Sparkles class="h-4 w-4 text-primary" />
|
|
85
|
-
<span class="text-primary font-medium">{
|
|
96
|
+
<span class="text-primary font-medium">{translateOrFallback('commandPalette.askAI', localizedFallback('询问 AI', 'Ask AI'))}</span>
|
|
86
97
|
<span class="text-muted-foreground truncate ml-1">"{searchValue.trim()}"</span>
|
|
87
98
|
</Command.Item>
|
|
88
99
|
</Command.Group>
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { Avatar } from './ui/avatar/index.js';
|
|
4
4
|
import { Button } from './ui/button/index.js';
|
|
5
5
|
import { Textarea } from './ui/textarea/index.js';
|
|
6
|
+
import { formatAdminTime } from '@svadmin/core';
|
|
6
7
|
import { cn } from '../utils.js';
|
|
7
8
|
|
|
8
9
|
export interface CommentItem {
|
|
@@ -40,7 +41,7 @@
|
|
|
40
41
|
function formatTime(value: string | Date | undefined): string {
|
|
41
42
|
if (!value) return '';
|
|
42
43
|
const date = value instanceof Date ? value : new Date(value);
|
|
43
|
-
return Number.isNaN(date.getTime()) ? String(value) :
|
|
44
|
+
return Number.isNaN(date.getTime()) ? String(value) : formatAdminTime(date, { dateStyle: 'medium', seconds: false });
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
async function submit(): Promise<void> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { X, AlertTriangle, Check, Loader2 } from '@lucide/svelte';
|
|
3
3
|
import { cn } from '../utils.js';
|
|
4
|
-
import { useTranslation } from '@svadmin/core';
|
|
4
|
+
import { formatAdminTime, useTranslation } from '@svadmin/core';
|
|
5
5
|
|
|
6
6
|
export interface ConflictFieldDiff {
|
|
7
7
|
field: string;
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
if (!t) return '';
|
|
77
77
|
try {
|
|
78
78
|
const d = typeof t === 'number' ? new Date(t) : new Date(t);
|
|
79
|
-
return isNaN(d.getTime()) ? String(t) : d
|
|
79
|
+
return isNaN(d.getTime()) ? String(t) : formatAdminTime(d);
|
|
80
80
|
} catch {
|
|
81
81
|
return String(t);
|
|
82
82
|
}
|
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
>
|
|
280
280
|
{#if loading || isSubmitting}
|
|
281
281
|
<Loader2 class="h-3.5 w-3.5 animate-spin" />
|
|
282
|
-
<span
|
|
282
|
+
<span>处理中…</span>
|
|
283
283
|
{:else}
|
|
284
284
|
<Check class="h-3.5 w-3.5" />
|
|
285
285
|
<span>应用合并方案并保存</span>
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
const variantMap = {
|
|
26
26
|
danger: 'destructive' as const,
|
|
27
|
-
warning: '
|
|
27
|
+
warning: 'default' as const,
|
|
28
28
|
info: 'default' as const,
|
|
29
29
|
};
|
|
30
30
|
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
</AlertDialog.Cancel>
|
|
64
64
|
<AlertDialog.Action>
|
|
65
65
|
{#snippet child({ props })}
|
|
66
|
-
<Button variant={variantMap[variant as keyof typeof variantMap]} {
|
|
66
|
+
<Button {...props} variant={variantMap[variant as keyof typeof variantMap]} data-status={variant === 'warning' ? 'warning' : undefined} disabled={confirming} onclick={handleConfirm}>
|
|
67
67
|
{#if confirming}
|
|
68
68
|
<Loader2 class="mr-2 h-4 w-4 animate-spin" aria-hidden="true" />
|
|
69
69
|
{/if}
|
|
@@ -184,13 +184,13 @@
|
|
|
184
184
|
<input
|
|
185
185
|
type="text"
|
|
186
186
|
bind:value={newPresetName}
|
|
187
|
-
placeholder="输入大屏方案名称 (如:双十一作战指挥大屏)
|
|
187
|
+
placeholder="输入大屏方案名称 (如:双十一作战指挥大屏)…"
|
|
188
188
|
class="w-full sm:flex-1 px-3 py-1.5 text-xs rounded-lg border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary"
|
|
189
189
|
/>
|
|
190
190
|
<input
|
|
191
191
|
type="text"
|
|
192
192
|
bind:value={newPresetDesc}
|
|
193
|
-
placeholder="方案简要说明 (可选)
|
|
193
|
+
placeholder="方案简要说明 (可选)…"
|
|
194
194
|
class="w-full sm:w-64 px-3 py-1.5 text-xs rounded-lg border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary"
|
|
195
195
|
/>
|
|
196
196
|
<Button
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
});
|
|
57
57
|
|
|
58
58
|
const relativeText = $derived.by(() => {
|
|
59
|
-
if (loading) return '
|
|
59
|
+
if (loading) return '正在同步数据…';
|
|
60
60
|
if (elapsedSeconds < 5) return '刚刚更新';
|
|
61
61
|
if (elapsedSeconds < 60) return `${elapsedSeconds} 秒前`;
|
|
62
62
|
const mins = Math.floor(elapsedSeconds / 60);
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
<div class="flex justify-between text-muted-foreground">
|
|
199
199
|
<span class="flex items-center gap-1">
|
|
200
200
|
<RefreshCw class="h-3 w-3 animate-spin text-primary" />
|
|
201
|
-
<span
|
|
201
|
+
<span>正在解析文件数据结构并校验列头…</span>
|
|
202
202
|
</span>
|
|
203
203
|
{#if progress !== undefined}
|
|
204
204
|
<span class="font-bold text-foreground">{progress}%</span>
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
open = false;
|
|
109
109
|
} catch {
|
|
110
110
|
if (!isCurrentRequest(token)) return;
|
|
111
|
-
submitError = i18n.t('common.
|
|
111
|
+
submitError = i18n.t('common.submitRejected');
|
|
112
112
|
} finally {
|
|
113
113
|
if (activeRequest === token) {
|
|
114
114
|
activeRequest = undefined;
|