@svadmin/lite 0.16.11 → 0.22.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/README.md +71 -2
- package/dist/components/LiteActivityFeed.svelte +31 -9
- package/dist/components/LiteActivityFeed.svelte.d.ts +6 -0
- package/dist/components/LiteAffix.svelte +29 -0
- package/dist/components/LiteAffix.svelte.d.ts +13 -0
- package/dist/components/LiteAnchor.svelte +38 -0
- package/dist/components/LiteAnchor.svelte.d.ts +14 -0
- package/dist/components/LiteApprovalActionCard.svelte +8 -5
- package/dist/components/LiteApprovalActionCard.svelte.d.ts +2 -0
- package/dist/components/LiteAuditLog.svelte +9 -9
- package/dist/components/LiteAutoComplete.svelte +41 -0
- package/dist/components/LiteAutoComplete.svelte.d.ts +13 -0
- package/dist/components/LiteBackTop.svelte +16 -0
- package/dist/components/LiteBackTop.svelte.d.ts +8 -0
- package/dist/components/LiteBreadcrumbs.svelte +4 -1
- package/dist/components/LiteBreadcrumbs.svelte.d.ts +2 -0
- package/dist/components/LiteCalendar.svelte +124 -0
- package/dist/components/LiteCalendar.svelte.d.ts +20 -0
- package/dist/components/LiteCanvasAnnotation.svelte +13 -13
- package/dist/components/LiteCarousel.svelte +72 -0
- package/dist/components/LiteCarousel.svelte.d.ts +14 -0
- package/dist/components/LiteChatDialog.svelte +8 -8
- package/dist/components/LiteCollapse.svelte +49 -0
- package/dist/components/LiteCollapse.svelte.d.ts +15 -0
- package/dist/components/LiteColumnHeaderFilter.svelte +4 -1
- package/dist/components/LiteColumnHeaderFilter.svelte.d.ts +2 -0
- package/dist/components/LiteColumnSettings.svelte +7 -4
- package/dist/components/LiteColumnSettings.svelte.d.ts +2 -0
- package/dist/components/LiteCommentThread.svelte +113 -0
- package/dist/components/LiteCommentThread.svelte.d.ts +26 -0
- package/dist/components/LiteConfirmDialog.svelte +2 -2
- package/dist/components/LiteCountdown.svelte +49 -0
- package/dist/components/LiteCountdown.svelte.d.ts +10 -0
- package/dist/components/LiteDecisionTable.svelte +14 -14
- package/dist/components/LiteDetailDrawer.svelte +45 -0
- package/dist/components/LiteDetailDrawer.svelte.d.ts +14 -0
- package/dist/components/LiteDraggableRowTable.svelte +5 -2
- package/dist/components/LiteDraggableRowTable.svelte.d.ts +2 -0
- package/dist/components/LiteDrawerForm.svelte +11 -8
- package/dist/components/LiteDrawerForm.svelte.d.ts +2 -0
- package/dist/components/LiteDynamicFormList.svelte +5 -5
- package/dist/components/LiteEditableTable.svelte +5 -2
- package/dist/components/LiteEditableTable.svelte.d.ts +2 -0
- package/dist/components/LiteEmptyState.svelte +11 -4
- package/dist/components/LiteEmptyState.svelte.d.ts +3 -0
- package/dist/components/LiteFilterBuilder.svelte +8 -5
- package/dist/components/LiteFilterBuilder.svelte.d.ts +2 -0
- package/dist/components/LiteFloatButton.svelte +54 -0
- package/dist/components/LiteFloatButton.svelte.d.ts +15 -0
- package/dist/components/LiteGanttChart.svelte +20 -20
- package/dist/components/LiteGrid.svelte +34 -0
- package/dist/components/LiteGrid.svelte.d.ts +11 -0
- package/dist/components/LiteImage.svelte +54 -0
- package/dist/components/LiteImage.svelte.d.ts +14 -0
- package/dist/components/LiteImageCropper.svelte +7 -4
- package/dist/components/LiteImageCropper.svelte.d.ts +2 -0
- package/dist/components/LiteImagePreview.svelte +36 -0
- package/dist/components/LiteImagePreview.svelte.d.ts +13 -0
- package/dist/components/LiteImportWizard.svelte +7 -7
- package/dist/components/LiteItemList.svelte +50 -0
- package/dist/components/LiteItemList.svelte.d.ts +15 -0
- package/dist/components/LiteJsonSchemaForm.svelte +10 -7
- package/dist/components/LiteJsonSchemaForm.svelte.d.ts +2 -0
- package/dist/components/LiteKanbanBoard.svelte +19 -19
- package/dist/components/LiteLayout.svelte +18 -6
- package/dist/components/LiteLayout.svelte.d.ts +8 -0
- package/dist/components/LiteLink.svelte +32 -0
- package/dist/components/LiteLink.svelte.d.ts +11 -0
- package/dist/components/LiteLogin.svelte +9 -2
- package/dist/components/LiteLogin.svelte.d.ts +2 -0
- package/dist/components/LiteMasterDetailView.svelte +13 -10
- package/dist/components/LiteMasterDetailView.svelte.d.ts +2 -0
- package/dist/components/LiteMediaLibraryModal.svelte +8 -5
- package/dist/components/LiteMediaLibraryModal.svelte.d.ts +2 -0
- package/dist/components/LiteMediaThumbnail.svelte +3 -3
- package/dist/components/LiteMentionsInput.svelte +9 -9
- package/dist/components/LiteMenu.svelte +22 -0
- package/dist/components/LiteMenu.svelte.d.ts +12 -0
- package/dist/components/LiteMenuList.svelte +55 -0
- package/dist/components/LiteMenuList.svelte.d.ts +17 -0
- package/dist/components/LiteModalForm.svelte +9 -6
- package/dist/components/LiteModalForm.svelte.d.ts +2 -0
- package/dist/components/LiteMultiTabKeepAlive.svelte +6 -6
- package/dist/components/LiteNotificationCenter.svelte +85 -0
- package/dist/components/LiteNotificationCenter.svelte.d.ts +22 -0
- package/dist/components/LiteOfflineSyncBanner.svelte +6 -6
- package/dist/components/LiteOtpInput.svelte +50 -0
- package/dist/components/LiteOtpInput.svelte.d.ts +15 -0
- package/dist/components/LitePageHeader.svelte +34 -0
- package/dist/components/LitePageHeader.svelte.d.ts +13 -0
- package/dist/components/LitePagination.svelte +10 -2
- package/dist/components/LitePagination.svelte.d.ts +2 -0
- package/dist/components/LitePdfDocumentViewer.svelte +14 -14
- package/dist/components/LitePermissionMatrix.svelte +8 -8
- package/dist/components/LitePivotTable.svelte +11 -11
- package/dist/components/LitePopconfirm.svelte +49 -0
- package/dist/components/LitePopconfirm.svelte.d.ts +14 -0
- package/dist/components/LitePresenceAvatarGroup.svelte +8 -5
- package/dist/components/LitePresenceAvatarGroup.svelte.d.ts +2 -0
- package/dist/components/LitePrintableBill.svelte +12 -9
- package/dist/components/LitePrintableBill.svelte.d.ts +2 -0
- package/dist/components/LiteProgress.svelte +46 -0
- package/dist/components/LiteProgress.svelte.d.ts +12 -0
- package/dist/components/LiteQRCode.svelte +62 -0
- package/dist/components/LiteQRCode.svelte.d.ts +14 -0
- package/dist/components/LiteResizeBox.svelte +34 -0
- package/dist/components/LiteResizeBox.svelte.d.ts +12 -0
- package/dist/components/LiteResult.svelte +52 -0
- package/dist/components/LiteResult.svelte.d.ts +14 -0
- package/dist/components/LiteRowActions.svelte +36 -0
- package/dist/components/LiteRowActions.svelte.d.ts +17 -0
- package/dist/components/LiteSensitiveDataMask.svelte +4 -1
- package/dist/components/LiteSensitiveDataMask.svelte.d.ts +2 -0
- package/dist/components/LiteShow.svelte +1 -1
- package/dist/components/LiteShowField.svelte +2 -2
- package/dist/components/LiteSignaturePad.svelte +9 -9
- package/dist/components/LiteSkeleton.svelte +100 -0
- package/dist/components/LiteSkeleton.svelte.d.ts +19 -0
- package/dist/components/LiteSpace.svelte +31 -0
- package/dist/components/LiteSpace.svelte.d.ts +12 -0
- package/dist/components/LiteSpin.svelte +27 -0
- package/dist/components/LiteSpin.svelte.d.ts +10 -0
- package/dist/components/LiteSplitPaneLayout.svelte +18 -6
- package/dist/components/LiteSplitPaneLayout.svelte.d.ts +8 -0
- package/dist/components/LiteSpreadsheetView.svelte +8 -8
- package/dist/components/LiteStatistic.svelte +63 -0
- package/dist/components/LiteStatistic.svelte.d.ts +15 -0
- package/dist/components/LiteStatsCard.svelte +5 -2
- package/dist/components/LiteStatsCard.svelte.d.ts +2 -0
- package/dist/components/LiteStatusBadge.svelte +33 -0
- package/dist/components/LiteStatusBadge.svelte.d.ts +12 -0
- package/dist/components/LiteStatusTabs.svelte +35 -0
- package/dist/components/LiteStatusTabs.svelte.d.ts +14 -0
- package/dist/components/LiteStepForm.svelte +14 -11
- package/dist/components/LiteStepForm.svelte.d.ts +2 -0
- package/dist/components/LiteSteps.svelte +64 -0
- package/dist/components/LiteSteps.svelte.d.ts +18 -0
- package/dist/components/LiteTable.svelte +5 -2
- package/dist/components/LiteTable.svelte.d.ts +2 -0
- package/dist/components/LiteTableSummary.svelte +8 -5
- package/dist/components/LiteTableSummary.svelte.d.ts +2 -0
- package/dist/components/LiteTabs.svelte +30 -20
- package/dist/components/LiteTabs.svelte.d.ts +11 -2
- package/dist/components/LiteTag.svelte +31 -0
- package/dist/components/LiteTag.svelte.d.ts +13 -0
- package/dist/components/LiteTimeline.svelte +48 -0
- package/dist/components/LiteTimeline.svelte.d.ts +17 -0
- package/dist/components/LiteTour.svelte +54 -0
- package/dist/components/LiteTour.svelte.d.ts +15 -0
- package/dist/components/LiteTransfer.svelte +9 -6
- package/dist/components/LiteTransfer.svelte.d.ts +2 -0
- package/dist/components/LiteTree.svelte +48 -0
- package/dist/components/LiteTree.svelte.d.ts +17 -0
- package/dist/components/LiteTreeTable.svelte +1 -1
- package/dist/components/LiteTwoFactorStepper.svelte +53 -0
- package/dist/components/LiteTwoFactorStepper.svelte.d.ts +16 -0
- package/dist/components/LiteVersionDiffViewer.svelte +16 -13
- package/dist/components/LiteVersionDiffViewer.svelte.d.ts +2 -0
- package/dist/components/LiteVideoPlayer.svelte +67 -0
- package/dist/components/LiteVideoPlayer.svelte.d.ts +22 -0
- package/dist/components/LiteVirtualTable.svelte +1 -1
- package/dist/components/advanced/LiteAutoSaveIndicator.svelte +42 -13
- package/dist/components/advanced/LiteAutoSaveIndicator.svelte.d.ts +10 -4
- package/dist/components/advanced/LiteDraggableHeader.svelte +2 -2
- package/dist/components/advanced/LiteDrawerForm.svelte +4 -1
- package/dist/components/advanced/LiteDrawerForm.svelte.d.ts +2 -0
- package/dist/components/advanced/LiteInlineEdit.svelte +1 -1
- package/dist/components/advanced/LiteModalForm.svelte +4 -1
- package/dist/components/advanced/LiteModalForm.svelte.d.ts +2 -0
- package/dist/components/advanced/LiteToast.svelte +3 -3
- package/dist/components/advanced/LiteUndoableNotification.svelte +1 -1
- package/dist/components/compatibility/LiteRealtimeStatus.svelte +41 -2
- package/dist/components/compatibility/LiteRealtimeStatus.svelte.d.ts +15 -0
- package/dist/components/fields/LiteBooleanField.svelte +4 -2
- package/dist/components/fields/LiteBooleanField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteCascader.svelte +5 -2
- package/dist/components/fields/LiteCascader.svelte.d.ts +2 -0
- package/dist/components/fields/LiteDateField.svelte +39 -9
- package/dist/components/fields/LiteDateField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteDateRangeField.svelte +1 -1
- package/dist/components/fields/LiteImageField.svelte +6 -2
- package/dist/components/fields/LiteImageField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteJsonField.svelte +1 -1
- package/dist/components/fields/LiteMarkdownField.svelte +49 -3
- package/dist/components/fields/LiteMarkdownField.svelte.d.ts +5 -0
- package/dist/components/fields/LiteNumberField.svelte +5 -3
- package/dist/components/fields/LiteNumberField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteRichTextField.svelte +49 -12
- package/dist/components/fields/LiteRichTextField.svelte.d.ts +3 -0
- package/dist/components/fields/LiteSelectField.svelte +5 -3
- package/dist/components/fields/LiteSelectField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteTagField.svelte +38 -15
- package/dist/components/fields/LiteTagField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteTextField.svelte +26 -5
- package/dist/components/fields/LiteTextField.svelte.d.ts +2 -0
- package/dist/components/fields/LiteTreeSelect.svelte +5 -2
- package/dist/components/fields/LiteTreeSelect.svelte.d.ts +2 -0
- package/dist/components/fields/LiteUrlField.svelte +5 -3
- package/dist/components/fields/LiteUrlField.svelte.d.ts +2 -0
- package/dist/components/layout/LiteAuthenticated.svelte +2 -2
- package/dist/components/layout/LiteCanAccess.svelte +1 -1
- package/dist/components/layout/LiteErrorComponent.svelte +4 -4
- package/dist/components/layout/LiteHeader.svelte +2 -2
- package/dist/components/layout/LiteSidebar.svelte +6 -3
- package/dist/components/layout/LiteSidebar.svelte.d.ts +2 -0
- package/dist/components/pages/LiteCreatePage.svelte +4 -1
- package/dist/components/pages/LiteCreatePage.svelte.d.ts +2 -0
- package/dist/components/pages/LiteEditPage.svelte +4 -1
- package/dist/components/pages/LiteEditPage.svelte.d.ts +2 -0
- package/dist/components/pages/LiteForgotPasswordPage.svelte +7 -7
- package/dist/components/pages/LiteListPage.svelte +6 -3
- package/dist/components/pages/LiteListPage.svelte.d.ts +2 -0
- package/dist/components/pages/LiteProfilePage.svelte +2 -2
- package/dist/components/pages/LiteRegisterPage.svelte +6 -6
- package/dist/components/pages/LiteShowPage.svelte +6 -3
- package/dist/components/pages/LiteShowPage.svelte.d.ts +2 -0
- package/dist/components/pages/LiteUpdatePasswordPage.svelte +4 -4
- package/dist/components/widgets/LiteAnomalyBadge.svelte +6 -3
- package/dist/components/widgets/LiteAnomalyBadge.svelte.d.ts +2 -0
- package/dist/components/widgets/LiteAreaChart.svelte +20 -0
- package/dist/components/widgets/LiteAreaChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteBarChart.svelte +6 -6
- package/dist/components/widgets/LiteChartSvg.svelte +102 -0
- package/dist/components/widgets/LiteChartSvg.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteChartTable.svelte +44 -0
- package/dist/components/widgets/LiteChartTable.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteDonutChart.svelte +20 -0
- package/dist/components/widgets/LiteDonutChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteFunnelChart.svelte +20 -0
- package/dist/components/widgets/LiteFunnelChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteGaugeChart.svelte +20 -0
- package/dist/components/widgets/LiteGaugeChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteHeatmapChart.svelte +20 -0
- package/dist/components/widgets/LiteHeatmapChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteInsightCard.svelte +35 -13
- package/dist/components/widgets/LiteInsightCard.svelte.d.ts +7 -4
- package/dist/components/widgets/LiteLineChart.svelte +13 -10
- package/dist/components/widgets/LiteLineChart.svelte.d.ts +0 -5
- package/dist/components/widgets/LitePieChart.svelte +11 -9
- package/dist/components/widgets/LitePieChart.svelte.d.ts +0 -5
- package/dist/components/widgets/LiteRadarChart.svelte +20 -0
- package/dist/components/widgets/LiteRadarChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteRoseChart.svelte +20 -0
- package/dist/components/widgets/LiteRoseChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteScatterChart.svelte +20 -0
- package/dist/components/widgets/LiteScatterChart.svelte.d.ts +10 -0
- package/dist/components/widgets/LiteWaterfallChart.svelte +20 -0
- package/dist/components/widgets/LiteWaterfallChart.svelte.d.ts +10 -0
- package/dist/components/widgets/chart-geometry.d.ts +65 -0
- package/dist/components/widgets/chart-geometry.js +229 -0
- package/dist/components/widgets/index.d.ts +10 -0
- package/dist/components/widgets/index.js +10 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +47 -0
- package/dist/lite-code-theme.css +139 -0
- package/dist/lite.css +234 -127
- package/dist/rich-content.d.ts +47 -0
- package/dist/rich-content.js +498 -0
- package/dist/schema-generator.js +3 -1
- package/dist/server-adapter.js +6 -11
- package/dist/value-normalization.d.ts +4 -0
- package/dist/value-normalization.js +13 -0
- package/package.json +18 -4
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
status?: 'success' | 'error' | 'warning' | 'info' | '404' | '403' | '500';
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
actionHref?: string;
|
|
9
|
+
actionLabel?: string;
|
|
10
|
+
secondaryHref?: string;
|
|
11
|
+
secondaryLabel?: string;
|
|
12
|
+
children?: Snippet;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
status = 'info',
|
|
17
|
+
title,
|
|
18
|
+
description,
|
|
19
|
+
actionHref,
|
|
20
|
+
actionLabel,
|
|
21
|
+
secondaryHref,
|
|
22
|
+
secondaryLabel,
|
|
23
|
+
children,
|
|
24
|
+
}: Props = $props();
|
|
25
|
+
|
|
26
|
+
const icon = $derived(status === 'success' ? '✓' : status === 'error' || status === '500' ? '!' : status === 'warning' ? '!' : status === '404' ? '404' : status === '403' ? '403' : 'i');
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<section class="lite-result" data-status={status} role="status">
|
|
30
|
+
<span class="lite-result__icon" aria-hidden="true">{icon}</span>
|
|
31
|
+
<h2>{title}</h2>
|
|
32
|
+
{#if description}<p>{description}</p>{/if}
|
|
33
|
+
{@render children?.()}
|
|
34
|
+
{#if actionHref || secondaryHref}
|
|
35
|
+
<div class="lite-inline-sm">
|
|
36
|
+
{#if actionHref}<a class="lite-btn lite-btn-primary" href={actionHref}>{actionLabel ?? 'Continue'}</a>{/if}
|
|
37
|
+
{#if secondaryHref}<a class="lite-btn" href={secondaryHref}>{secondaryLabel ?? 'Back'}</a>{/if}
|
|
38
|
+
</div>
|
|
39
|
+
{/if}
|
|
40
|
+
</section>
|
|
41
|
+
|
|
42
|
+
<style>
|
|
43
|
+
.lite-result { display: block; justify-items: center; padding: 48px 24px; border: 1px solid #E5E6EB; border-radius: 8px; background: #fff; text-align: center; }
|
|
44
|
+
.lite-result__icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 999px; background: #E8F3FF; color: #165DFF; font-size: 24px; font-weight: 700; }
|
|
45
|
+
.lite-result[data-status='success'] .lite-result__icon { background: #E8FFEA; color: #009A29; }
|
|
46
|
+
.lite-result[data-status='error'] .lite-result__icon, .lite-result[data-status='500'] .lite-result__icon { background: #FFECE8; color: #F53F3F; }
|
|
47
|
+
.lite-result[data-status='warning'] .lite-result__icon { background: #FFF7E8; color: #D25F00; }
|
|
48
|
+
.lite-result h2 { margin: 0; color: #1D2129; font-size: 20px; }
|
|
49
|
+
.lite-result p { max-width: 40rem; margin: 0; color: #4E5969; font-size: 14px; line-height: 1.6; }
|
|
50
|
+
|
|
51
|
+
.lite-result > * + * { margin-top: 10px; }
|
|
52
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
status?: 'success' | 'error' | 'warning' | 'info' | '404' | '403' | '500';
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
actionHref?: string;
|
|
7
|
+
actionLabel?: string;
|
|
8
|
+
secondaryHref?: string;
|
|
9
|
+
secondaryLabel?: string;
|
|
10
|
+
children?: Snippet;
|
|
11
|
+
}
|
|
12
|
+
declare const LiteResult: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type LiteResult = ReturnType<typeof LiteResult>;
|
|
14
|
+
export default LiteResult;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLFormAttributes } from 'svelte/elements';
|
|
3
|
+
|
|
4
|
+
interface RowAction {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
href?: string;
|
|
8
|
+
action?: string;
|
|
9
|
+
method?: HTMLFormAttributes['method'];
|
|
10
|
+
danger?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface Props {
|
|
15
|
+
actions: RowAction[];
|
|
16
|
+
label?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let { actions, label = 'Row actions' }: Props = $props();
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<div class="lite-inline-xs" role="group" aria-label={label}>
|
|
23
|
+
{#each actions as action (action.id)}
|
|
24
|
+
{#if action.disabled}
|
|
25
|
+
<span class="lite-btn lite-btn-sm" aria-disabled="true">{action.label}</span>
|
|
26
|
+
{:else if action.href}
|
|
27
|
+
<a class="lite-btn lite-btn-sm" class:lite-btn-danger={action.danger} href={action.href}>{action.label}</a>
|
|
28
|
+
{:else if action.action}
|
|
29
|
+
<form method={action.method ?? 'POST'} action={action.action}>
|
|
30
|
+
<button class="lite-btn lite-btn-sm" class:lite-btn-danger={action.danger} type="submit">{action.label}</button>
|
|
31
|
+
</form>
|
|
32
|
+
{:else}
|
|
33
|
+
<span class="lite-muted">{action.label}</span>
|
|
34
|
+
{/if}
|
|
35
|
+
{/each}
|
|
36
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HTMLFormAttributes } from 'svelte/elements';
|
|
2
|
+
interface RowAction {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
href?: string;
|
|
6
|
+
action?: string;
|
|
7
|
+
method?: HTMLFormAttributes['method'];
|
|
8
|
+
danger?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface Props {
|
|
12
|
+
actions: RowAction[];
|
|
13
|
+
label?: string;
|
|
14
|
+
}
|
|
15
|
+
declare const LiteRowActions: import("svelte").Component<Props, {}, "">;
|
|
16
|
+
type LiteRowActions = ReturnType<typeof LiteRowActions>;
|
|
17
|
+
export default LiteRowActions;
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
interface Props {
|
|
3
3
|
value?: string | number | null;
|
|
4
4
|
type?: 'phone' | 'id-card' | 'email' | 'bank-card' | 'secret' | 'custom';
|
|
5
|
+
/** Caller class merged with the built-in class list. */
|
|
6
|
+
class?: string;
|
|
5
7
|
}
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
value = '',
|
|
9
11
|
type = 'phone',
|
|
12
|
+
class: className = '',
|
|
10
13
|
}: Props = $props();
|
|
11
14
|
|
|
12
15
|
const rawString = $derived(String(value ?? ''));
|
|
@@ -31,6 +34,6 @@
|
|
|
31
34
|
const masked = $derived(mask(rawString, type));
|
|
32
35
|
</script>
|
|
33
36
|
|
|
34
|
-
<span class="lite-sensitive-mask" style="font-family: monospace; font-size: 12px;">
|
|
37
|
+
<span class="lite-sensitive-mask {className}" style="font-family: monospace; font-size: 12px;">
|
|
35
38
|
{masked}
|
|
36
39
|
</span>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
interface Props {
|
|
2
2
|
value?: string | number | null;
|
|
3
3
|
type?: 'phone' | 'id-card' | 'email' | 'bank-card' | 'secret' | 'custom';
|
|
4
|
+
/** Caller class merged with the built-in class list. */
|
|
5
|
+
class?: string;
|
|
4
6
|
}
|
|
5
7
|
declare const LiteSensitiveDataMask: import("svelte").Component<Props, {}, "">;
|
|
6
8
|
type LiteSensitiveDataMask = ReturnType<typeof LiteSensitiveDataMask>;
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
{#each showFields as field, _i (_i)}
|
|
50
50
|
{@const value = record[field.key]}
|
|
51
51
|
<tr>
|
|
52
|
-
<td style="width:200px;font-weight:600;color:#
|
|
52
|
+
<td style="width:200px;font-weight:600;color:#4E5969;vertical-align:top;">
|
|
53
53
|
{field.label}
|
|
54
54
|
</td>
|
|
55
55
|
<td>
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
<span>••••••••</span>
|
|
64
64
|
{:else if field.type === "color" && value}
|
|
65
65
|
<span style="display:inline-flex;align-items:center;">
|
|
66
|
-
<span style="display:inline-block;width:14px;height:14px;border-radius:3px;background:{toSafeText(value)};border:1px solid #
|
|
66
|
+
<span style="display:inline-block;width:14px;height:14px;border-radius:3px;background:{toSafeText(value)};border:1px solid #E5E6EB;margin-right:6px;"></span>
|
|
67
67
|
<span class="lite-font-mono">{toSafeText(value)}</span>
|
|
68
68
|
</span>
|
|
69
69
|
{:else if field.type === "url" && value}
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
<span class="lite-badge">{tag}</span>
|
|
88
88
|
{/each}
|
|
89
89
|
{:else if field.type === "json" && value}
|
|
90
|
-
<pre style="margin:0;font-size:12px;background:#
|
|
90
|
+
<pre style="margin:0;font-size:12px;background:#F7F8FA;padding:12px;border-radius:6px;border:1px solid #E5E6EB;overflow-x:auto;">{typeof value === "string" ? value : JSON.stringify(value, null, 2)}</pre>
|
|
91
91
|
{:else if field.type === "select" && field.options}
|
|
92
92
|
<span class={getStatusBadgeClass(value)}>{formatValue(value, field)}</span>
|
|
93
93
|
{:else if field.type === "relation" && field.resource && value != null}
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
<style>
|
|
48
48
|
.sv-lite-signature-card {
|
|
49
49
|
display: block;
|
|
50
|
-
border: 1px solid #
|
|
50
|
+
border: 1px solid #E5E6EB;
|
|
51
51
|
border-radius: 6px;
|
|
52
52
|
padding: 12px;
|
|
53
53
|
background-color: #ffffff;
|
|
@@ -56,19 +56,19 @@
|
|
|
56
56
|
.sv-lite-sig-header {
|
|
57
57
|
margin-bottom: 8px;
|
|
58
58
|
font-size: 13px;
|
|
59
|
-
color: #
|
|
59
|
+
color: #1D2129;
|
|
60
60
|
}
|
|
61
61
|
.sv-lite-sig-sub {
|
|
62
|
-
color: #
|
|
62
|
+
color: #4E5969;
|
|
63
63
|
font-size: 11px;
|
|
64
64
|
margin-left: 6px;
|
|
65
65
|
}
|
|
66
66
|
.sv-lite-sig-preview {
|
|
67
|
-
border: 2px dashed #
|
|
67
|
+
border: 2px dashed #E5E6EB;
|
|
68
68
|
border-radius: 4px;
|
|
69
69
|
padding: 10px;
|
|
70
70
|
text-align: center;
|
|
71
|
-
background-color: #
|
|
71
|
+
background-color: #F7F8FA;
|
|
72
72
|
margin-bottom: 10px;
|
|
73
73
|
}
|
|
74
74
|
.sv-lite-sig-img {
|
|
@@ -77,12 +77,12 @@
|
|
|
77
77
|
vertical-align: middle;
|
|
78
78
|
}
|
|
79
79
|
.sv-lite-sig-empty {
|
|
80
|
-
border: 2px dashed #
|
|
80
|
+
border: 2px dashed #E5E6EB;
|
|
81
81
|
border-radius: 4px;
|
|
82
82
|
padding: 24px;
|
|
83
83
|
text-align: center;
|
|
84
|
-
color: #
|
|
85
|
-
background-color: #
|
|
84
|
+
color: #86909C;
|
|
85
|
+
background-color: #F7F8FA;
|
|
86
86
|
margin-bottom: 10px;
|
|
87
87
|
}
|
|
88
88
|
.sv-lite-sig-file {
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
.sv-lite-sig-btn {
|
|
93
93
|
padding: 4px 10px;
|
|
94
94
|
font-size: 11px;
|
|
95
|
-
background-color: #
|
|
95
|
+
background-color: #165DFF;
|
|
96
96
|
color: #ffffff;
|
|
97
97
|
border: none;
|
|
98
98
|
border-radius: 3px;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
lines?: number;
|
|
4
|
+
width?: string;
|
|
5
|
+
height?: string;
|
|
6
|
+
circle?: boolean;
|
|
7
|
+
label?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Page-level skeleton layout, mirroring the reference PageSkeleton: header,
|
|
10
|
+
* then `rows` blocks of the requested shape. `text` keeps the plain lines.
|
|
11
|
+
*/
|
|
12
|
+
variant?: 'text' | 'list' | 'show' | 'form';
|
|
13
|
+
/** Number of body rows/blocks for the page variants. */
|
|
14
|
+
rows?: number;
|
|
15
|
+
/** Caller class merged with the built-in class list. */
|
|
16
|
+
class?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let {
|
|
20
|
+
lines = 3,
|
|
21
|
+
width = '100%',
|
|
22
|
+
height = '14px',
|
|
23
|
+
circle = false,
|
|
24
|
+
label = 'Loading',
|
|
25
|
+
variant = 'text',
|
|
26
|
+
rows = 5,
|
|
27
|
+
class: className = '',
|
|
28
|
+
}: Props = $props();
|
|
29
|
+
|
|
30
|
+
const blockCount = $derived(Math.max(1, rows));
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<div
|
|
34
|
+
class={`lite-skeleton lite-skeleton--${variant} ${className}`.trim()}
|
|
35
|
+
role="status"
|
|
36
|
+
aria-label={label}
|
|
37
|
+
aria-busy="true"
|
|
38
|
+
data-variant={variant}
|
|
39
|
+
>
|
|
40
|
+
{#if variant !== 'text'}
|
|
41
|
+
<!-- Page-level skeleton: same structure as the reference, generated from props. -->
|
|
42
|
+
<div class="lite-skeleton__header" aria-hidden="true">
|
|
43
|
+
<span class="lite-skeleton__line" style="width:200px;height:32px"></span>
|
|
44
|
+
<span class="lite-skeleton__line" style="width:300px"></span>
|
|
45
|
+
{#if variant === 'list'}<span class="lite-skeleton__line" style="width:120px;height:40px"></span>{/if}
|
|
46
|
+
</div>
|
|
47
|
+
<div class="lite-skeleton__panel" aria-hidden="true">
|
|
48
|
+
{#each Array.from({ length: blockCount }, (_, index) => index) as index (index)}
|
|
49
|
+
<div class="lite-skeleton__block" data-shape={variant}>
|
|
50
|
+
{#if variant === 'list'}
|
|
51
|
+
<span class="lite-skeleton__line" style="flex:1;height:24px"></span>
|
|
52
|
+
<span class="lite-skeleton__line" style="flex:1;height:24px"></span>
|
|
53
|
+
<span class="lite-skeleton__line" style="flex:1;height:24px"></span>
|
|
54
|
+
<span class="lite-skeleton__line" style="flex:1;height:24px"></span>
|
|
55
|
+
{:else if variant === 'show'}
|
|
56
|
+
<span class="lite-skeleton__line" style="width:100px"></span>
|
|
57
|
+
<span class="lite-skeleton__line" style="width:250px;height:24px"></span>
|
|
58
|
+
{:else}
|
|
59
|
+
<span class="lite-skeleton__line" style="width:100px"></span>
|
|
60
|
+
<span class="lite-skeleton__line" style="width:100%;max-width:420px;height:40px"></span>
|
|
61
|
+
{/if}
|
|
62
|
+
</div>
|
|
63
|
+
{/each}
|
|
64
|
+
{#if variant === 'form'}
|
|
65
|
+
<div class="lite-skeleton__block" data-shape="actions">
|
|
66
|
+
<span class="lite-skeleton__line" style="width:100px;height:40px"></span>
|
|
67
|
+
<span class="lite-skeleton__line" style="width:100px;height:40px"></span>
|
|
68
|
+
</div>
|
|
69
|
+
{/if}
|
|
70
|
+
</div>
|
|
71
|
+
{:else if circle}
|
|
72
|
+
<span class="lite-skeleton__circle" aria-hidden="true"></span>
|
|
73
|
+
{:else}
|
|
74
|
+
{#each Array.from({ length: Math.max(1, lines) }, (_, index) => index) as index (index)}
|
|
75
|
+
<span class="lite-skeleton__line" style={`width:${index === lines - 1 && lines > 1 ? '65%' : width};height:${height}`} aria-hidden="true"></span>
|
|
76
|
+
{/each}
|
|
77
|
+
{/if}
|
|
78
|
+
<span class="lite-skeleton__sr">{label}</span>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<style>
|
|
82
|
+
.lite-skeleton { display: block; }
|
|
83
|
+
.lite-skeleton__line, .lite-skeleton__circle { display: block; background: #F2F3F5; animation: lite-skeleton-pulse 1.4s ease-in-out infinite; }
|
|
84
|
+
.lite-skeleton__line { border-radius: 4px; }
|
|
85
|
+
.lite-skeleton__circle { width: 40px; height: 40px; border-radius: 999px; }
|
|
86
|
+
.lite-skeleton__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
|
|
87
|
+
@keyframes lite-skeleton-pulse { 50% { opacity: 0.5; } }
|
|
88
|
+
|
|
89
|
+
.lite-skeleton__line + .lite-skeleton__line { margin-top: 8px; }
|
|
90
|
+
|
|
91
|
+
.lite-skeleton__header { display: flex; flex-wrap: wrap; }
|
|
92
|
+
.lite-skeleton__header > * + * { margin-left: 8px; }
|
|
93
|
+
.lite-skeleton__header > :first-child { flex: 0 0 auto; }
|
|
94
|
+
.lite-skeleton__panel { margin-top: 24px; padding: 16px; border: 1px solid #E5E6EB; border-radius: 6px; }
|
|
95
|
+
.lite-skeleton__block + .lite-skeleton__block { margin-top: 16px; }
|
|
96
|
+
.lite-skeleton__block[data-shape='list'] { display: flex; }
|
|
97
|
+
.lite-skeleton__block[data-shape='list'] > * + * { margin-left: 16px; }
|
|
98
|
+
.lite-skeleton__block[data-shape='actions'] { display: flex; }
|
|
99
|
+
.lite-skeleton__block[data-shape='actions'] > * + * { margin-left: 8px; }
|
|
100
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
lines?: number;
|
|
3
|
+
width?: string;
|
|
4
|
+
height?: string;
|
|
5
|
+
circle?: boolean;
|
|
6
|
+
label?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Page-level skeleton layout, mirroring the reference PageSkeleton: header,
|
|
9
|
+
* then `rows` blocks of the requested shape. `text` keeps the plain lines.
|
|
10
|
+
*/
|
|
11
|
+
variant?: 'text' | 'list' | 'show' | 'form';
|
|
12
|
+
/** Number of body rows/blocks for the page variants. */
|
|
13
|
+
rows?: number;
|
|
14
|
+
/** Caller class merged with the built-in class list. */
|
|
15
|
+
class?: string;
|
|
16
|
+
}
|
|
17
|
+
declare const LiteSkeleton: import("svelte").Component<Props, {}, "">;
|
|
18
|
+
type LiteSkeleton = ReturnType<typeof LiteSkeleton>;
|
|
19
|
+
export default LiteSkeleton;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
direction?: 'horizontal' | 'vertical';
|
|
6
|
+
size?: 'sm' | 'md' | 'lg';
|
|
7
|
+
wrap?: boolean;
|
|
8
|
+
/** Caller class merged with the built-in class list. */
|
|
9
|
+
class?: string;
|
|
10
|
+
children: Snippet;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { direction = 'horizontal', size = 'md', wrap = false, class: className = '', children }: Props = $props();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<div class="lite-space {className}" data-direction={direction} data-size={size} data-wrap={wrap || undefined}>
|
|
17
|
+
{@render children()}
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<style>
|
|
21
|
+
.lite-space { display: flex; }
|
|
22
|
+
.lite-space[data-direction='horizontal'] { flex-direction: row; }
|
|
23
|
+
.lite-space[data-direction='vertical'] { flex-direction: column; }
|
|
24
|
+
.lite-space[data-wrap] { flex-wrap: wrap; }
|
|
25
|
+
.lite-space[data-direction='horizontal'] > * + * { margin-left: 8px; }
|
|
26
|
+
.lite-space[data-direction='vertical'] > * + * { margin-top: 8px; }
|
|
27
|
+
.lite-space[data-size='sm'][data-direction='horizontal'] > * + * { margin-left: 4px; }
|
|
28
|
+
.lite-space[data-size='sm'][data-direction='vertical'] > * + * { margin-top: 4px; }
|
|
29
|
+
.lite-space[data-size='lg'][data-direction='horizontal'] > * + * { margin-left: 16px; }
|
|
30
|
+
.lite-space[data-size='lg'][data-direction='vertical'] > * + * { margin-top: 16px; }
|
|
31
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
direction?: 'horizontal' | 'vertical';
|
|
4
|
+
size?: 'sm' | 'md' | 'lg';
|
|
5
|
+
wrap?: boolean;
|
|
6
|
+
/** Caller class merged with the built-in class list. */
|
|
7
|
+
class?: string;
|
|
8
|
+
children: Snippet;
|
|
9
|
+
}
|
|
10
|
+
declare const LiteSpace: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type LiteSpace = ReturnType<typeof LiteSpace>;
|
|
12
|
+
export default LiteSpace;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
spinning?: boolean;
|
|
6
|
+
size?: 'sm' | 'md' | 'lg';
|
|
7
|
+
label?: string;
|
|
8
|
+
children?: Snippet;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
let { spinning = true, size = 'md', label = 'Loading', children }: Props = $props();
|
|
12
|
+
const px = $derived(size === 'sm' ? 16 : size === 'lg' ? 36 : 24);
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<div class="lite-spin" aria-busy={spinning || undefined}>
|
|
16
|
+
{#if spinning}
|
|
17
|
+
<span class="lite-spin__indicator" style={`width:${px}px;height:${px}px`} role="status" aria-label={label}></span>
|
|
18
|
+
{/if}
|
|
19
|
+
{#if children}{@render children()}{/if}
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<style>
|
|
23
|
+
.lite-spin { display: inline-flex; align-items: center; }
|
|
24
|
+
.lite-spin__indicator { display: inline-block; border: 2px solid #E5E6EB; border-top-color: #165DFF; border-radius: 999px; animation: lite-spin 0.8s linear infinite; }
|
|
25
|
+
@keyframes lite-spin { to { transform: rotate(360deg); } }
|
|
26
|
+
@media (prefers-reduced-motion: reduce) { .lite-spin__indicator { animation: none; } }
|
|
27
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
spinning?: boolean;
|
|
4
|
+
size?: 'sm' | 'md' | 'lg';
|
|
5
|
+
label?: string;
|
|
6
|
+
children?: Snippet;
|
|
7
|
+
}
|
|
8
|
+
declare const LiteSpin: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type LiteSpin = ReturnType<typeof LiteSpin>;
|
|
10
|
+
export default LiteSpin;
|
|
@@ -5,25 +5,37 @@
|
|
|
5
5
|
direction?: 'horizontal' | 'vertical';
|
|
6
6
|
pane1?: Snippet;
|
|
7
7
|
pane2?: Snippet;
|
|
8
|
+
/** Caller class for the outer split container. */
|
|
9
|
+
class?: string;
|
|
10
|
+
/** Caller class for the first pane. */
|
|
11
|
+
classPane1?: string;
|
|
12
|
+
/** Caller class for the divider. */
|
|
13
|
+
classDivider?: string;
|
|
14
|
+
/** Caller class for the second pane. */
|
|
15
|
+
classPane2?: string;
|
|
8
16
|
}
|
|
9
17
|
|
|
10
18
|
let {
|
|
11
19
|
direction = 'horizontal',
|
|
12
20
|
pane1,
|
|
13
21
|
pane2,
|
|
22
|
+
class: className = '',
|
|
23
|
+
classPane1 = '',
|
|
24
|
+
classDivider = '',
|
|
25
|
+
classPane2 = '',
|
|
14
26
|
}: Props = $props();
|
|
15
27
|
</script>
|
|
16
28
|
|
|
17
|
-
<div class=
|
|
18
|
-
<div class=
|
|
29
|
+
<div class={`lite-split-layout lite-split-${direction} ${className}`.trim()}>
|
|
30
|
+
<div class={`lite-split-pane-1 ${classPane1}`.trim()}>
|
|
19
31
|
{#if pane1}
|
|
20
32
|
{@render pane1()}
|
|
21
33
|
{/if}
|
|
22
34
|
</div>
|
|
23
35
|
|
|
24
|
-
<div class=
|
|
36
|
+
<div class={`lite-split-divider ${classDivider}`.trim()}></div>
|
|
25
37
|
|
|
26
|
-
<div class=
|
|
38
|
+
<div class={`lite-split-pane-2 ${classPane2}`.trim()}>
|
|
27
39
|
{#if pane2}
|
|
28
40
|
{@render pane2()}
|
|
29
41
|
{/if}
|
|
@@ -34,7 +46,7 @@
|
|
|
34
46
|
.lite-split-layout {
|
|
35
47
|
display: flex;
|
|
36
48
|
background: #ffffff;
|
|
37
|
-
border: 1px solid #
|
|
49
|
+
border: 1px solid #E5E6EB;
|
|
38
50
|
border-radius: 6px;
|
|
39
51
|
margin-bottom: 16px;
|
|
40
52
|
min-height: 300px;
|
|
@@ -56,7 +68,7 @@
|
|
|
56
68
|
overflow-y: auto;
|
|
57
69
|
}
|
|
58
70
|
.lite-split-divider {
|
|
59
|
-
background: #
|
|
71
|
+
background: #E5E6EB;
|
|
60
72
|
width: 2px;
|
|
61
73
|
}
|
|
62
74
|
.lite-split-vertical .lite-split-divider {
|
|
@@ -3,6 +3,14 @@ interface Props {
|
|
|
3
3
|
direction?: 'horizontal' | 'vertical';
|
|
4
4
|
pane1?: Snippet;
|
|
5
5
|
pane2?: Snippet;
|
|
6
|
+
/** Caller class for the outer split container. */
|
|
7
|
+
class?: string;
|
|
8
|
+
/** Caller class for the first pane. */
|
|
9
|
+
classPane1?: string;
|
|
10
|
+
/** Caller class for the divider. */
|
|
11
|
+
classDivider?: string;
|
|
12
|
+
/** Caller class for the second pane. */
|
|
13
|
+
classPane2?: string;
|
|
6
14
|
}
|
|
7
15
|
declare const LiteSplitPaneLayout: import("svelte").Component<Props, {}, "">;
|
|
8
16
|
type LiteSplitPaneLayout = ReturnType<typeof LiteSplitPaneLayout>;
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
<style>
|
|
134
134
|
.sv-lite-sheet-container {
|
|
135
135
|
display: block;
|
|
136
|
-
border: 1px solid #
|
|
136
|
+
border: 1px solid #E5E6EB;
|
|
137
137
|
border-radius: 6px;
|
|
138
138
|
padding: 12px;
|
|
139
139
|
background-color: #ffffff;
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
.sv-lite-sheet-header {
|
|
144
144
|
margin-bottom: 10px;
|
|
145
145
|
font-size: 13px;
|
|
146
|
-
color: #
|
|
146
|
+
color: #1D2129;
|
|
147
147
|
}
|
|
148
148
|
.sv-lite-sheet-table {
|
|
149
149
|
width: 100%;
|
|
@@ -151,22 +151,22 @@
|
|
|
151
151
|
font-family: monospace;
|
|
152
152
|
}
|
|
153
153
|
.sv-lite-sheet-table th, .sv-lite-sheet-table td {
|
|
154
|
-
border: 1px solid #
|
|
154
|
+
border: 1px solid #E5E6EB;
|
|
155
155
|
padding: 2px;
|
|
156
156
|
}
|
|
157
157
|
.sv-lite-sheet-th-num, .sv-lite-sheet-td-num {
|
|
158
|
-
background-color: #
|
|
158
|
+
background-color: #F2F3F5;
|
|
159
159
|
text-align: center;
|
|
160
160
|
width: 32px;
|
|
161
|
-
color: #
|
|
161
|
+
color: #4E5969;
|
|
162
162
|
font-weight: bold;
|
|
163
163
|
font-size: 10px;
|
|
164
164
|
}
|
|
165
165
|
.sv-lite-sheet-th {
|
|
166
|
-
background-color: #
|
|
166
|
+
background-color: #F7F8FA;
|
|
167
167
|
text-align: center;
|
|
168
168
|
font-weight: 600;
|
|
169
|
-
color: #
|
|
169
|
+
color: #1D2129;
|
|
170
170
|
min-width: 80px;
|
|
171
171
|
}
|
|
172
172
|
.sv-lite-cell-input {
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
}
|
|
185
185
|
.sv-lite-sheet-save {
|
|
186
186
|
padding: 5px 12px;
|
|
187
|
-
background-color: #
|
|
187
|
+
background-color: #165DFF;
|
|
188
188
|
color: #ffffff;
|
|
189
189
|
border: none;
|
|
190
190
|
border-radius: 3px;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
title?: string;
|
|
4
|
+
value: number | string;
|
|
5
|
+
precision?: number;
|
|
6
|
+
prefix?: string;
|
|
7
|
+
suffix?: string;
|
|
8
|
+
trend?: 'up' | 'down' | 'neutral';
|
|
9
|
+
trendLabel?: string;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
/** Caller class merged with the built-in class list. */
|
|
12
|
+
class?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
title,
|
|
17
|
+
value,
|
|
18
|
+
precision = 0,
|
|
19
|
+
prefix,
|
|
20
|
+
suffix,
|
|
21
|
+
trend,
|
|
22
|
+
trendLabel,
|
|
23
|
+
loading = false,
|
|
24
|
+
class: className = '',
|
|
25
|
+
}: Props = $props();
|
|
26
|
+
|
|
27
|
+
const display = $derived(
|
|
28
|
+
typeof value === 'number'
|
|
29
|
+
? new Intl.NumberFormat(undefined, { minimumFractionDigits: precision, maximumFractionDigits: precision }).format(value)
|
|
30
|
+
: value,
|
|
31
|
+
);
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<div class="lite-statistic {className}" aria-busy={loading || undefined}>
|
|
35
|
+
{#if title}<p class="lite-statistic__title">{title}</p>{/if}
|
|
36
|
+
<p class="lite-statistic__value">
|
|
37
|
+
{#if prefix}<span>{prefix}</span>{/if}
|
|
38
|
+
{#if loading}<span class="lite-statistic__skeleton" aria-hidden="true"></span><span class="lite-statistic__sr">{display}</span>{:else}{display}{/if}
|
|
39
|
+
{#if suffix}<span>{suffix}</span>{/if}
|
|
40
|
+
</p>
|
|
41
|
+
{#if trend || trendLabel}
|
|
42
|
+
<p class="lite-statistic__trend" data-trend={trend ?? 'neutral'}>
|
|
43
|
+
{#if trend === 'up'}↑{:else if trend === 'down'}↓{:else}→{/if}
|
|
44
|
+
{#if trendLabel}<span>{trendLabel}</span>{/if}
|
|
45
|
+
</p>
|
|
46
|
+
{/if}
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<style>
|
|
50
|
+
.lite-statistic { display: block; min-width: 0; }
|
|
51
|
+
.lite-statistic__title { margin: 0; color: #86909C; font-size: 13px; }
|
|
52
|
+
.lite-statistic__value { display: flex; align-items: baseline; margin: 0; color: #1D2129; font-size: 24px; font-weight: 650; line-height: 1.2; }
|
|
53
|
+
.lite-statistic__value > span:first-child, .lite-statistic__value > span:last-child { color: #86909C; font-size: 13px; font-weight: 500; }
|
|
54
|
+
.lite-statistic__trend { display: flex; margin: 0; color: #86909C; font-size: 12px; }
|
|
55
|
+
.lite-statistic__trend[data-trend='up'] { color: #009A29; }
|
|
56
|
+
.lite-statistic__trend[data-trend='down'] { color: #F53F3F; }
|
|
57
|
+
.lite-statistic__skeleton { display: inline-block; width: 72px; height: 22px; border-radius: 4px; background: #F2F3F5; animation: lite-statistic-pulse 1.4s ease-in-out infinite; }
|
|
58
|
+
.lite-statistic__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
|
|
59
|
+
@keyframes lite-statistic-pulse { 50% { opacity: 0.5; } }
|
|
60
|
+
|
|
61
|
+
.lite-statistic__value > * + * { margin-left: 4px; }
|
|
62
|
+
.lite-statistic__trend > * + * { margin-left: 4px; }
|
|
63
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
title?: string;
|
|
3
|
+
value: number | string;
|
|
4
|
+
precision?: number;
|
|
5
|
+
prefix?: string;
|
|
6
|
+
suffix?: string;
|
|
7
|
+
trend?: 'up' | 'down' | 'neutral';
|
|
8
|
+
trendLabel?: string;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
/** Caller class merged with the built-in class list. */
|
|
11
|
+
class?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const LiteStatistic: import("svelte").Component<Props, {}, "">;
|
|
14
|
+
type LiteStatistic = ReturnType<typeof LiteStatistic>;
|
|
15
|
+
export default LiteStatistic;
|