@svadmin/lite 0.17.0 → 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 +24 -2
- 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 +4 -1
- package/dist/components/LiteApprovalActionCard.svelte.d.ts +2 -0
- 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/LiteCarousel.svelte +72 -0
- package/dist/components/LiteCarousel.svelte.d.ts +14 -0
- 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 +4 -1
- 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/LiteCountdown.svelte +49 -0
- package/dist/components/LiteCountdown.svelte.d.ts +10 -0
- package/dist/components/LiteDetailDrawer.svelte +45 -0
- package/dist/components/LiteDetailDrawer.svelte.d.ts +14 -0
- package/dist/components/LiteDraggableRowTable.svelte +4 -1
- package/dist/components/LiteDraggableRowTable.svelte.d.ts +2 -0
- package/dist/components/LiteDrawerForm.svelte +4 -1
- package/dist/components/LiteDrawerForm.svelte.d.ts +2 -0
- package/dist/components/LiteEditableTable.svelte +4 -1
- package/dist/components/LiteEditableTable.svelte.d.ts +2 -0
- package/dist/components/LiteEmptyState.svelte +8 -1
- package/dist/components/LiteEmptyState.svelte.d.ts +3 -0
- package/dist/components/LiteFilterBuilder.svelte +4 -1
- 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/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 +4 -1
- 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/LiteItemList.svelte +50 -0
- package/dist/components/LiteItemList.svelte.d.ts +15 -0
- package/dist/components/LiteJsonSchemaForm.svelte +4 -1
- package/dist/components/LiteJsonSchemaForm.svelte.d.ts +2 -0
- package/dist/components/LiteLayout.svelte +16 -4
- 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 +4 -1
- package/dist/components/LiteMasterDetailView.svelte.d.ts +2 -0
- package/dist/components/LiteMediaLibraryModal.svelte +4 -1
- package/dist/components/LiteMediaLibraryModal.svelte.d.ts +2 -0
- 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 +4 -1
- package/dist/components/LiteModalForm.svelte.d.ts +2 -0
- package/dist/components/LiteNotificationCenter.svelte +85 -0
- package/dist/components/LiteNotificationCenter.svelte.d.ts +22 -0
- 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/LitePopconfirm.svelte +49 -0
- package/dist/components/LitePopconfirm.svelte.d.ts +14 -0
- package/dist/components/LitePresenceAvatarGroup.svelte +4 -1
- package/dist/components/LitePresenceAvatarGroup.svelte.d.ts +2 -0
- package/dist/components/LitePrintableBill.svelte +4 -1
- 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/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 +16 -4
- package/dist/components/LiteSplitPaneLayout.svelte.d.ts +8 -0
- 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 +4 -1
- 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 +4 -1
- package/dist/components/LiteTable.svelte.d.ts +2 -0
- package/dist/components/LiteTableSummary.svelte +4 -1
- package/dist/components/LiteTableSummary.svelte.d.ts +2 -0
- package/dist/components/LiteTabs.svelte +28 -18
- 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 +4 -1
- 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/LiteTwoFactorStepper.svelte +53 -0
- package/dist/components/LiteTwoFactorStepper.svelte.d.ts +16 -0
- package/dist/components/LiteVersionDiffViewer.svelte +4 -1
- 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/advanced/LiteAutoSaveIndicator.svelte +42 -13
- package/dist/components/advanced/LiteAutoSaveIndicator.svelte.d.ts +10 -4
- package/dist/components/advanced/LiteDrawerForm.svelte +4 -1
- package/dist/components/advanced/LiteDrawerForm.svelte.d.ts +2 -0
- package/dist/components/advanced/LiteModalForm.svelte +4 -1
- package/dist/components/advanced/LiteModalForm.svelte.d.ts +2 -0
- 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/LiteImageField.svelte +6 -2
- package/dist/components/fields/LiteImageField.svelte.d.ts +2 -0
- 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 +45 -8
- 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/LiteSidebar.svelte +4 -1
- 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/LiteListPage.svelte +4 -1
- package/dist/components/pages/LiteListPage.svelte.d.ts +2 -0
- package/dist/components/pages/LiteShowPage.svelte +4 -1
- package/dist/components/pages/LiteShowPage.svelte.d.ts +2 -0
- package/dist/components/widgets/LiteAnomalyBadge.svelte +5 -2
- 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/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 +34 -12
- package/dist/components/widgets/LiteInsightCard.svelte.d.ts +7 -4
- package/dist/components/widgets/LiteLineChart.svelte +6 -3
- package/dist/components/widgets/LiteLineChart.svelte.d.ts +0 -5
- package/dist/components/widgets/LitePieChart.svelte +5 -3
- 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 +108 -1
- 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,34 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
columns?: number;
|
|
6
|
+
gap?: 'sm' | 'md' | 'lg';
|
|
7
|
+
/** Caller class merged with the built-in class list. */
|
|
8
|
+
class?: string;
|
|
9
|
+
children: Snippet;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let { columns = 3, gap = 'md', class: className = '', children }: Props = $props();
|
|
13
|
+
const safeColumns = $derived(columns >= 4 ? 4 : columns === 2 ? 2 : 3);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<div class="lite-grid {className}" data-columns={safeColumns} data-gap={gap}>
|
|
17
|
+
{@render children()}
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<style>
|
|
21
|
+
.lite-grid { display: flex; flex-wrap: wrap; margin: -6px; }
|
|
22
|
+
.lite-grid > * { box-sizing: border-box; width: calc(33.333% - 12px); margin: 6px; }
|
|
23
|
+
.lite-grid[data-columns='2'] > * { width: calc(50% - 12px); }
|
|
24
|
+
.lite-grid[data-columns='4'] > * { width: calc(25% - 12px); }
|
|
25
|
+
.lite-grid[data-gap='sm'] { margin: -2px; }
|
|
26
|
+
.lite-grid[data-gap='sm'] > * { width: calc(33.333% - 4px); margin: 2px; }
|
|
27
|
+
.lite-grid[data-gap='sm'][data-columns='2'] > * { width: calc(50% - 4px); }
|
|
28
|
+
.lite-grid[data-gap='sm'][data-columns='4'] > * { width: calc(25% - 4px); }
|
|
29
|
+
.lite-grid[data-gap='lg'] { margin: -10px; }
|
|
30
|
+
.lite-grid[data-gap='lg'] > * { width: calc(33.333% - 20px); margin: 10px; }
|
|
31
|
+
.lite-grid[data-gap='lg'][data-columns='2'] > * { width: calc(50% - 20px); }
|
|
32
|
+
.lite-grid[data-gap='lg'][data-columns='4'] > * { width: calc(25% - 20px); }
|
|
33
|
+
@media (max-width: 720px) { .lite-grid > * { width: calc(100% - 12px) !important; } }
|
|
34
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
columns?: number;
|
|
4
|
+
gap?: 'sm' | 'md' | 'lg';
|
|
5
|
+
/** Caller class merged with the built-in class list. */
|
|
6
|
+
class?: string;
|
|
7
|
+
children: Snippet;
|
|
8
|
+
}
|
|
9
|
+
declare const LiteGrid: import("svelte").Component<Props, {}, "">;
|
|
10
|
+
type LiteGrid = ReturnType<typeof LiteGrid>;
|
|
11
|
+
export default LiteGrid;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
src?: string;
|
|
4
|
+
alt?: string;
|
|
5
|
+
width?: string | number;
|
|
6
|
+
height?: string | number;
|
|
7
|
+
fit?: 'cover' | 'contain' | 'fill' | 'none';
|
|
8
|
+
rounded?: boolean;
|
|
9
|
+
fallback?: string;
|
|
10
|
+
href?: string;
|
|
11
|
+
caption?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let {
|
|
15
|
+
src,
|
|
16
|
+
alt = '',
|
|
17
|
+
width,
|
|
18
|
+
height,
|
|
19
|
+
fit = 'cover',
|
|
20
|
+
rounded = false,
|
|
21
|
+
fallback = 'Image unavailable',
|
|
22
|
+
href,
|
|
23
|
+
caption,
|
|
24
|
+
}: Props = $props();
|
|
25
|
+
|
|
26
|
+
const sizeStyle = $derived([
|
|
27
|
+
width === undefined ? undefined : `width:${typeof width === 'number' ? `${width}px` : width}`,
|
|
28
|
+
height === undefined ? undefined : `height:${typeof height === 'number' ? `${height}px` : height}`,
|
|
29
|
+
].filter(Boolean).join(';'));
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<figure class="lite-image" class:lite-image-rounded={rounded} style={sizeStyle || undefined}>
|
|
33
|
+
{#if src}
|
|
34
|
+
{#if href}
|
|
35
|
+
<a href={href} aria-label={alt ? `Open ${alt}` : 'Open image'}>
|
|
36
|
+
<img {src} {alt} loading="lazy" decoding="async" style={`object-fit:${fit}`} />
|
|
37
|
+
</a>
|
|
38
|
+
{:else}
|
|
39
|
+
<img {src} {alt} loading="lazy" decoding="async" style={`object-fit:${fit}`} />
|
|
40
|
+
{/if}
|
|
41
|
+
{:else}
|
|
42
|
+
<span class="lite-image-fallback" role="img" aria-label={fallback}>{fallback}</span>
|
|
43
|
+
{/if}
|
|
44
|
+
{#if caption}<figcaption>{caption}</figcaption>{/if}
|
|
45
|
+
</figure>
|
|
46
|
+
|
|
47
|
+
<style>
|
|
48
|
+
.lite-image { display: block; place-items: center; min-width: 0; max-width: 100%; margin: 0; overflow: hidden; border: 1px solid #E5E6EB; background: #F2F3F5; color: #4E5969; }
|
|
49
|
+
.lite-image-rounded { border-radius: 8px; }
|
|
50
|
+
.lite-image a { display: block; max-width: 100%; }
|
|
51
|
+
.lite-image img { display: block; max-width: 100%; height: auto; }
|
|
52
|
+
.lite-image-fallback { display: inline-block; padding: 24px 16px; font-size: 13px; text-align: center; }
|
|
53
|
+
.lite-image figcaption { width: 100%; padding: 8px 12px; border-top: 1px solid #E5E6EB; background: #fff; color: #4E5969; font-size: 12px; }
|
|
54
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
src?: string;
|
|
3
|
+
alt?: string;
|
|
4
|
+
width?: string | number;
|
|
5
|
+
height?: string | number;
|
|
6
|
+
fit?: 'cover' | 'contain' | 'fill' | 'none';
|
|
7
|
+
rounded?: boolean;
|
|
8
|
+
fallback?: string;
|
|
9
|
+
href?: string;
|
|
10
|
+
caption?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const LiteImage: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type LiteImage = ReturnType<typeof LiteImage>;
|
|
14
|
+
export default LiteImage;
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
aspectRatio?: number;
|
|
5
5
|
action?: string;
|
|
6
6
|
method?: 'get' | 'post' | 'dialog' | 'GET' | 'POST' | 'DIALOG' | null;
|
|
7
|
+
/** Caller class merged with the built-in class list. */
|
|
8
|
+
class?: string;
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
let {
|
|
@@ -11,10 +13,11 @@
|
|
|
11
13
|
aspectRatio = 1,
|
|
12
14
|
action = '',
|
|
13
15
|
method = 'POST',
|
|
16
|
+
class: className = ''
|
|
14
17
|
}: Props = $props();
|
|
15
18
|
</script>
|
|
16
19
|
|
|
17
|
-
<div class="lite-cropper-card">
|
|
20
|
+
<div class="lite-cropper-card {className}">
|
|
18
21
|
<div class="lite-cropper-header">
|
|
19
22
|
<strong>Image Crop (Aspect Ratio: {aspectRatio}:1)</strong>
|
|
20
23
|
</div>
|
|
@@ -3,6 +3,8 @@ interface Props {
|
|
|
3
3
|
aspectRatio?: number;
|
|
4
4
|
action?: string;
|
|
5
5
|
method?: 'get' | 'post' | 'dialog' | 'GET' | 'POST' | 'DIALOG' | null;
|
|
6
|
+
/** Caller class merged with the built-in class list. */
|
|
7
|
+
class?: string;
|
|
6
8
|
}
|
|
7
9
|
declare const LiteImageCropper: import("svelte").Component<Props, {}, "">;
|
|
8
10
|
type LiteImageCropper = ReturnType<typeof LiteImageCropper>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface PreviewImage {
|
|
3
|
+
src: string;
|
|
4
|
+
alt: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
src: string;
|
|
9
|
+
alt?: string;
|
|
10
|
+
images?: PreviewImage[];
|
|
11
|
+
downloadLabel?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let { src, alt = '', images = [], downloadLabel = 'Download image' }: Props = $props();
|
|
15
|
+
const gallery = $derived(images.length > 0 ? images : [{ src, alt }]);
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<div class="lite-image-preview" role="group" aria-label="Image gallery">
|
|
19
|
+
{#each gallery as image, index (image.src)}
|
|
20
|
+
<a class="lite-image-preview__item" href={image.src} target="_blank" rel="noreferrer" aria-label={`Open ${image.alt || alt || `image ${index + 1}`}`}>
|
|
21
|
+
<img src={image.src} alt={image.alt || alt} loading="lazy" decoding="async" />
|
|
22
|
+
<span>{image.alt || alt || `Image ${index + 1}`}</span>
|
|
23
|
+
</a>
|
|
24
|
+
{/each}
|
|
25
|
+
<a class="lite-btn lite-btn-sm" href={src} download={alt || 'image'}>{downloadLabel}</a>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
.lite-image-preview { display: flex; flex-wrap: wrap; align-items: flex-start; }
|
|
30
|
+
.lite-image-preview__item { display: block; width: 160px; max-width: 100%; overflow: hidden; border: 1px solid #E5E6EB; border-radius: 8px; background: #fff; color: #1D2129; text-decoration: none; }
|
|
31
|
+
.lite-image-preview__item:hover { border-color: #165DFF; text-decoration: none; }
|
|
32
|
+
.lite-image-preview__item img { display: block; width: 100%; height: 110px; object-fit: cover; }
|
|
33
|
+
.lite-image-preview__item span { display: block; padding: 6px 8px; overflow: hidden; color: #4E5969; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
|
|
34
|
+
|
|
35
|
+
.lite-image-preview > * { margin: 0 12px 12px 0; }
|
|
36
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface PreviewImage {
|
|
2
|
+
src: string;
|
|
3
|
+
alt: string;
|
|
4
|
+
}
|
|
5
|
+
interface Props {
|
|
6
|
+
src: string;
|
|
7
|
+
alt?: string;
|
|
8
|
+
images?: PreviewImage[];
|
|
9
|
+
downloadLabel?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const LiteImagePreview: import("svelte").Component<Props, {}, "">;
|
|
12
|
+
type LiteImagePreview = ReturnType<typeof LiteImagePreview>;
|
|
13
|
+
export default LiteImagePreview;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
interface ListItem {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
href?: string;
|
|
7
|
+
meta?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
items: ListItem[];
|
|
12
|
+
title?: string;
|
|
13
|
+
emptyText?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let { items, title, emptyText = 'No items' }: Props = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<section class="lite-item-list lite-card">
|
|
20
|
+
{#if title}<h2>{title}</h2>{/if}
|
|
21
|
+
{#if items.length === 0}
|
|
22
|
+
<p class="lite-muted">{emptyText}</p>
|
|
23
|
+
{:else}
|
|
24
|
+
<ul>
|
|
25
|
+
{#each items as item (item.id)}
|
|
26
|
+
<li>
|
|
27
|
+
<div>
|
|
28
|
+
{#if item.href}<a href={item.href}>{item.title}</a>{:else}<strong>{item.title}</strong>{/if}
|
|
29
|
+
{#if item.description}<p>{item.description}</p>{/if}
|
|
30
|
+
</div>
|
|
31
|
+
{#if item.meta}<span>{item.meta}</span>{/if}
|
|
32
|
+
</li>
|
|
33
|
+
{/each}
|
|
34
|
+
</ul>
|
|
35
|
+
{/if}
|
|
36
|
+
</section>
|
|
37
|
+
|
|
38
|
+
<style>
|
|
39
|
+
.lite-item-list { padding: 0; overflow: hidden; }
|
|
40
|
+
.lite-item-list h2 { margin: 0; padding: 12px 16px; border-bottom: 1px solid #E5E6EB; color: #1D2129; font-size: 14px; }
|
|
41
|
+
.lite-item-list > p { margin: 0; padding: 16px; }
|
|
42
|
+
.lite-item-list ul { margin: 0; padding: 0; list-style: none; }
|
|
43
|
+
.lite-item-list li { display: flex; align-items: flex-start; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #F2F3F5; }
|
|
44
|
+
.lite-item-list li:last-child { border-bottom: 0; }
|
|
45
|
+
.lite-item-list a, .lite-item-list strong { color: #1D2129; font-size: 13px; }
|
|
46
|
+
.lite-item-list p { margin: 4px 0 0; color: #4E5969; font-size: 12px; line-height: 1.5; }
|
|
47
|
+
.lite-item-list li > span { color: #86909C; font-size: 12px; white-space: nowrap; }
|
|
48
|
+
|
|
49
|
+
.lite-item-list li > * + * { margin-left: 12px; }
|
|
50
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface ListItem {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
href?: string;
|
|
6
|
+
meta?: string;
|
|
7
|
+
}
|
|
8
|
+
interface Props {
|
|
9
|
+
items: ListItem[];
|
|
10
|
+
title?: string;
|
|
11
|
+
emptyText?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const LiteItemList: import("svelte").Component<Props, {}, "">;
|
|
14
|
+
type LiteItemList = ReturnType<typeof LiteItemList>;
|
|
15
|
+
export default LiteItemList;
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
action?: string;
|
|
10
10
|
method?: 'get' | 'post' | 'dialog' | 'GET' | 'POST' | 'DIALOG' | null;
|
|
11
11
|
submitText?: string;
|
|
12
|
+
/** Caller class merged with the built-in class list. */
|
|
13
|
+
class?: string;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
let {
|
|
@@ -17,6 +19,7 @@
|
|
|
17
19
|
action = '',
|
|
18
20
|
method = 'POST',
|
|
19
21
|
submitText = 'Submit Form',
|
|
22
|
+
class: className = ''
|
|
20
23
|
}: Props = $props();
|
|
21
24
|
const instanceId = $props.id();
|
|
22
25
|
const i18n = useTranslation();
|
|
@@ -119,7 +122,7 @@
|
|
|
119
122
|
}
|
|
120
123
|
</script>
|
|
121
124
|
|
|
122
|
-
<div class="lite-schema-form-card">
|
|
125
|
+
<div class="lite-schema-form-card {className}">
|
|
123
126
|
{#if schema.title}<div class="lite-schema-form-header"><strong>{schema.title}</strong></div>{/if}
|
|
124
127
|
{#if schema.description}<p class="lite-schema-description">{schema.description}</p>{/if}
|
|
125
128
|
|
|
@@ -5,6 +5,8 @@ interface Props {
|
|
|
5
5
|
action?: string;
|
|
6
6
|
method?: 'get' | 'post' | 'dialog' | 'GET' | 'POST' | 'DIALOG' | null;
|
|
7
7
|
submitText?: string;
|
|
8
|
+
/** Caller class merged with the built-in class list. */
|
|
9
|
+
class?: string;
|
|
8
10
|
}
|
|
9
11
|
declare const LiteJsonSchemaForm: import("svelte").Component<Props, {}, "value">;
|
|
10
12
|
type LiteJsonSchemaForm = ReturnType<typeof LiteJsonSchemaForm>;
|
|
@@ -19,6 +19,14 @@
|
|
|
19
19
|
/** Optional server-computed permission check for menu metadata. */
|
|
20
20
|
canAccess?: (resource: string, action: string) => boolean;
|
|
21
21
|
children: Snippet;
|
|
22
|
+
/** Caller class for the layout wrapper. */
|
|
23
|
+
class?: string;
|
|
24
|
+
/** Caller class for the desktop sidebar. */
|
|
25
|
+
classSidebar?: string;
|
|
26
|
+
/** Caller class for the mobile navigation. */
|
|
27
|
+
classMobileNav?: string;
|
|
28
|
+
/** Caller class for the main region. */
|
|
29
|
+
classMain?: string;
|
|
22
30
|
}
|
|
23
31
|
|
|
24
32
|
let {
|
|
@@ -30,6 +38,10 @@
|
|
|
30
38
|
menu,
|
|
31
39
|
canAccess,
|
|
32
40
|
children,
|
|
41
|
+
class: className = '',
|
|
42
|
+
classSidebar = '',
|
|
43
|
+
classMobileNav = '',
|
|
44
|
+
classMain = '',
|
|
33
45
|
}: Props = $props();
|
|
34
46
|
|
|
35
47
|
const menuResources = $derived(filterVisibleResources(resources, canAccess));
|
|
@@ -63,9 +75,9 @@
|
|
|
63
75
|
}
|
|
64
76
|
</script>
|
|
65
77
|
|
|
66
|
-
<div class=
|
|
78
|
+
<div class={`lite-wrapper ${className}`.trim()}>
|
|
67
79
|
<!-- Sidebar -->
|
|
68
|
-
<nav class=
|
|
80
|
+
<nav class={`lite-sidebar ${classSidebar}`.trim()}>
|
|
69
81
|
<div class="lite-sidebar-brand">{brandName}</div>
|
|
70
82
|
{#if hasCustomMenu}
|
|
71
83
|
<LiteMenuList items={visibleMenu} {basePath} {currentResource} />
|
|
@@ -89,7 +101,7 @@
|
|
|
89
101
|
{/if}
|
|
90
102
|
</nav>
|
|
91
103
|
|
|
92
|
-
<nav class=
|
|
104
|
+
<nav class={`lite-mobile-nav ${classMobileNav}`.trim()} aria-label="Mobile navigation">
|
|
93
105
|
<div class="lite-mobile-nav-brand">{brandName}</div>
|
|
94
106
|
<div class="lite-mobile-nav-links">
|
|
95
107
|
{#each mobileItems as item (item.name)}
|
|
@@ -112,7 +124,7 @@
|
|
|
112
124
|
</nav>
|
|
113
125
|
|
|
114
126
|
<!-- Main Content -->
|
|
115
|
-
<main class=
|
|
127
|
+
<main class={`lite-main ${classMain}`.trim()}>
|
|
116
128
|
{@render children()}
|
|
117
129
|
</main>
|
|
118
130
|
</div>
|
|
@@ -15,6 +15,14 @@ interface Props {
|
|
|
15
15
|
/** Optional server-computed permission check for menu metadata. */
|
|
16
16
|
canAccess?: (resource: string, action: string) => boolean;
|
|
17
17
|
children: Snippet;
|
|
18
|
+
/** Caller class for the layout wrapper. */
|
|
19
|
+
class?: string;
|
|
20
|
+
/** Caller class for the desktop sidebar. */
|
|
21
|
+
classSidebar?: string;
|
|
22
|
+
/** Caller class for the mobile navigation. */
|
|
23
|
+
classMobileNav?: string;
|
|
24
|
+
/** Caller class for the main region. */
|
|
25
|
+
classMain?: string;
|
|
18
26
|
}
|
|
19
27
|
declare const LiteLayout: import("svelte").Component<Props, {}, "">;
|
|
20
28
|
type LiteLayout = ReturnType<typeof LiteLayout>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
href: string;
|
|
6
|
+
external?: boolean;
|
|
7
|
+
underline?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
children: Snippet;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let { href, external = false, underline = false, disabled = false, children }: Props = $props();
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
{#if disabled}
|
|
16
|
+
<span class="lite-link" aria-disabled="true">{@render children()}</span>
|
|
17
|
+
{:else}
|
|
18
|
+
<a
|
|
19
|
+
class="lite-link"
|
|
20
|
+
class:lite-link-underline={underline}
|
|
21
|
+
{href}
|
|
22
|
+
target={external ? '_blank' : undefined}
|
|
23
|
+
rel={external ? 'noreferrer' : undefined}
|
|
24
|
+
>{@render children()}</a>
|
|
25
|
+
{/if}
|
|
26
|
+
|
|
27
|
+
<style>
|
|
28
|
+
.lite-link { color: #165DFF; text-decoration: none; }
|
|
29
|
+
.lite-link:hover { text-decoration: underline; }
|
|
30
|
+
.lite-link-underline { text-decoration: underline; }
|
|
31
|
+
.lite-link[aria-disabled='true'] { color: #C9CDD4; cursor: not-allowed; }
|
|
32
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
href: string;
|
|
4
|
+
external?: boolean;
|
|
5
|
+
underline?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
children: Snippet;
|
|
8
|
+
}
|
|
9
|
+
declare const LiteLink: import("svelte").Component<Props, {}, "">;
|
|
10
|
+
type LiteLink = ReturnType<typeof LiteLink>;
|
|
11
|
+
export default LiteLink;
|
|
@@ -9,12 +9,19 @@
|
|
|
9
9
|
error?: string;
|
|
10
10
|
brandName?: string;
|
|
11
11
|
action?: string;
|
|
12
|
+
/** Caller class merged with the built-in class list. */
|
|
13
|
+
class?: string;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
let {
|
|
16
|
+
let {
|
|
17
|
+
error,
|
|
18
|
+
brandName = 'Admin',
|
|
19
|
+
action = '?/login',
|
|
20
|
+
class: className = '',
|
|
21
|
+
}: Props = $props();
|
|
15
22
|
</script>
|
|
16
23
|
|
|
17
|
-
<div class="lite-login-wrapper">
|
|
24
|
+
<div class="lite-login-wrapper {className}">
|
|
18
25
|
<div class="lite-login-card">
|
|
19
26
|
<div class="lite-card">
|
|
20
27
|
<h2 style="text-align:center;margin:0 0 20px;font-size:20px;font-weight:600;">{brandName}</h2>
|
|
@@ -2,6 +2,8 @@ interface Props {
|
|
|
2
2
|
error?: string;
|
|
3
3
|
brandName?: string;
|
|
4
4
|
action?: string;
|
|
5
|
+
/** Caller class merged with the built-in class list. */
|
|
6
|
+
class?: string;
|
|
5
7
|
}
|
|
6
8
|
declare const LiteLogin: import("svelte").Component<Props, {}, "">;
|
|
7
9
|
type LiteLogin = ReturnType<typeof LiteLogin>;
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
idKey?: string;
|
|
8
8
|
titleKey?: string;
|
|
9
9
|
detailSnippet?: Snippet<[Record<string, unknown>]>;
|
|
10
|
+
/** Caller class merged with the built-in class list. */
|
|
11
|
+
class?: string;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
let {
|
|
@@ -15,6 +17,7 @@
|
|
|
15
17
|
idKey = 'id',
|
|
16
18
|
titleKey = 'title',
|
|
17
19
|
detailSnippet,
|
|
20
|
+
class: className = '',
|
|
18
21
|
}: Props = $props();
|
|
19
22
|
|
|
20
23
|
const activeItem = $derived(
|
|
@@ -22,7 +25,7 @@
|
|
|
22
25
|
);
|
|
23
26
|
</script>
|
|
24
27
|
|
|
25
|
-
<div class="lite-master-detail-card">
|
|
28
|
+
<div class="lite-master-detail-card {className}">
|
|
26
29
|
<!-- Left Master List -->
|
|
27
30
|
<div class="lite-master-list">
|
|
28
31
|
<div class="lite-master-header">
|
|
@@ -5,6 +5,8 @@ interface Props {
|
|
|
5
5
|
idKey?: string;
|
|
6
6
|
titleKey?: string;
|
|
7
7
|
detailSnippet?: Snippet<[Record<string, unknown>]>;
|
|
8
|
+
/** Caller class merged with the built-in class list. */
|
|
9
|
+
class?: string;
|
|
8
10
|
}
|
|
9
11
|
declare const LiteMasterDetailView: import("svelte").Component<Props, {}, "">;
|
|
10
12
|
type LiteMasterDetailView = ReturnType<typeof LiteMasterDetailView>;
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
mediaItems?: LiteMediaItem[];
|
|
17
17
|
action?: string;
|
|
18
18
|
method?: 'get' | 'post' | 'dialog' | 'GET' | 'POST' | 'DIALOG' | null;
|
|
19
|
+
/** Caller class merged with the built-in class list. */
|
|
20
|
+
class?: string;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
let {
|
|
@@ -24,10 +26,11 @@
|
|
|
24
26
|
mediaItems = [],
|
|
25
27
|
action = '',
|
|
26
28
|
method = 'POST',
|
|
29
|
+
class: className = '',
|
|
27
30
|
}: Props = $props();
|
|
28
31
|
</script>
|
|
29
32
|
|
|
30
|
-
<div class="lite-media-library-card">
|
|
33
|
+
<div class="lite-media-library-card {className}">
|
|
31
34
|
<div class="lite-media-header">
|
|
32
35
|
<strong>{title}</strong>
|
|
33
36
|
</div>
|
|
@@ -11,6 +11,8 @@ interface Props {
|
|
|
11
11
|
mediaItems?: LiteMediaItem[];
|
|
12
12
|
action?: string;
|
|
13
13
|
method?: 'get' | 'post' | 'dialog' | 'GET' | 'POST' | 'DIALOG' | null;
|
|
14
|
+
/** Caller class merged with the built-in class list. */
|
|
15
|
+
class?: string;
|
|
14
16
|
}
|
|
15
17
|
declare const LiteMediaLibraryModal: import("svelte").Component<Props, {}, "">;
|
|
16
18
|
type LiteMediaLibraryModal = ReturnType<typeof LiteMediaLibraryModal>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import LiteMenuList, { type MenuEntry } from './LiteMenuList.svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
items: MenuEntry[];
|
|
6
|
+
mode?: 'vertical' | 'horizontal';
|
|
7
|
+
selected?: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
/** Caller class merged with the built-in class list. */
|
|
10
|
+
class?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { items, mode = 'vertical', selected, label = 'Menu', class: className = '' }: Props = $props();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<nav class="lite-menu {className}" data-mode={mode} aria-label={label}>
|
|
17
|
+
<LiteMenuList {items} {selected} {mode} />
|
|
18
|
+
</nav>
|
|
19
|
+
|
|
20
|
+
<style>
|
|
21
|
+
.lite-menu { border: 1px solid #E5E6EB; border-radius: 8px; background: #fff; }
|
|
22
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type MenuEntry } from './LiteMenuList.svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
items: MenuEntry[];
|
|
4
|
+
mode?: 'vertical' | 'horizontal';
|
|
5
|
+
selected?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Caller class merged with the built-in class list. */
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const LiteMenu: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type LiteMenu = ReturnType<typeof LiteMenu>;
|
|
12
|
+
export default LiteMenu;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export interface MenuEntry {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
href?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
badge?: string | number;
|
|
8
|
+
children?: MenuEntry[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
items: MenuEntry[];
|
|
13
|
+
selected?: string;
|
|
14
|
+
depth?: number;
|
|
15
|
+
mode?: 'vertical' | 'horizontal';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let { items, selected, depth = 0, mode = 'vertical' }: Props = $props();
|
|
19
|
+
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
{#snippet branch(list: MenuEntry[], level: number, listMode: 'vertical' | 'horizontal')}
|
|
23
|
+
<ul class="lite-menu__list" data-mode={level === 0 ? listMode : 'vertical'} role={level === 0 ? 'menu' : 'group'}>
|
|
24
|
+
{#each list as item (item.id)}
|
|
25
|
+
<li role="none" class:active={selected === item.id} data-disabled={item.disabled || undefined}>
|
|
26
|
+
{#if item.href && !item.disabled}
|
|
27
|
+
<a role="menuitem" href={item.href} aria-current={selected === item.id ? 'page' : undefined}>
|
|
28
|
+
<span>{item.label}</span>
|
|
29
|
+
{#if item.badge !== undefined}<span class="lite-badge lite-badge-secondary">{item.badge}</span>{/if}
|
|
30
|
+
</a>
|
|
31
|
+
{:else}
|
|
32
|
+
<span role="menuitem" aria-disabled={item.disabled || undefined}>
|
|
33
|
+
<span>{item.label}</span>
|
|
34
|
+
{#if item.badge !== undefined}<span class="lite-badge lite-badge-secondary">{item.badge}</span>{/if}
|
|
35
|
+
</span>
|
|
36
|
+
{/if}
|
|
37
|
+
{#if item.children?.length}
|
|
38
|
+
{@render branch(item.children, level + 1, 'vertical')}
|
|
39
|
+
{/if}
|
|
40
|
+
</li>
|
|
41
|
+
{/each}
|
|
42
|
+
</ul>
|
|
43
|
+
{/snippet}
|
|
44
|
+
|
|
45
|
+
{@render branch(items, depth, mode)}
|
|
46
|
+
|
|
47
|
+
<style>
|
|
48
|
+
.lite-menu__list { margin: 0; padding: 4px; list-style: none; }
|
|
49
|
+
.lite-menu__list[data-mode='horizontal'] { display: flex; flex-wrap: wrap; }
|
|
50
|
+
.lite-menu__list li > a, .lite-menu__list li > span { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: 4px; color: #1D2129; font-size: 13px; text-decoration: none; }
|
|
51
|
+
.lite-menu__list li > a:hover, .lite-menu__list li.active > a { background: #E8F3FF; color: #165DFF; text-decoration: none; }
|
|
52
|
+
.lite-menu__list li[data-disabled] > span { color: #C9CDD4; }
|
|
53
|
+
.lite-menu__list li > a > span + span, .lite-menu__list li > span > span + span { margin-left: 8px; }
|
|
54
|
+
.lite-menu__list .lite-menu__list { padding-left: 16px; }
|
|
55
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface MenuEntry {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
href?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
badge?: string | number;
|
|
7
|
+
children?: MenuEntry[];
|
|
8
|
+
}
|
|
9
|
+
interface Props {
|
|
10
|
+
items: MenuEntry[];
|
|
11
|
+
selected?: string;
|
|
12
|
+
depth?: number;
|
|
13
|
+
mode?: 'vertical' | 'horizontal';
|
|
14
|
+
}
|
|
15
|
+
declare const LiteMenuList: import("svelte").Component<Props, {}, "">;
|
|
16
|
+
type LiteMenuList = ReturnType<typeof LiteMenuList>;
|
|
17
|
+
export default LiteMenuList;
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
submitText?: string;
|
|
10
10
|
cancelText?: string;
|
|
11
11
|
children?: Snippet;
|
|
12
|
+
/** Caller class merged with the built-in class list. */
|
|
13
|
+
class?: string;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
let {
|
|
@@ -19,10 +21,11 @@
|
|
|
19
21
|
submitText = 'Confirm',
|
|
20
22
|
cancelText = 'Cancel',
|
|
21
23
|
children,
|
|
24
|
+
class: className = '',
|
|
22
25
|
}: Props = $props();
|
|
23
26
|
</script>
|
|
24
27
|
|
|
25
|
-
<div class="lite-modal-card">
|
|
28
|
+
<div class="lite-modal-card {className}">
|
|
26
29
|
<div class="lite-modal-header">
|
|
27
30
|
<h3 class="lite-modal-title">{title}</h3>
|
|
28
31
|
{#if description}
|