@svadmin/ui 0.99.0 → 0.102.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 +1 -1
- package/dist/app.css +99 -0
- package/dist/app.theme.css +99 -0
- package/dist/components/AboutSettings.svelte +1 -1
- package/dist/components/AdminApp.svelte +13 -1
- package/dist/components/AdminApp.svelte.d.ts +7 -0
- package/dist/components/Affix.svelte +43 -0
- package/dist/components/Affix.svelte.d.ts +11 -0
- package/dist/components/Anchor.svelte +60 -0
- package/dist/components/Anchor.svelte.d.ts +14 -0
- package/dist/components/AutoTable.svelte +35 -16
- package/dist/components/AutoTable.svelte.d.ts +6 -0
- package/dist/components/Calendar.svelte +152 -0
- package/dist/components/Calendar.svelte.d.ts +20 -0
- package/dist/components/Carousel.svelte +107 -0
- package/dist/components/Carousel.svelte.d.ts +15 -0
- package/dist/components/Collapse.svelte +177 -0
- package/dist/components/Collapse.svelte.d.ts +32 -0
- package/dist/components/CommentThread.svelte +109 -0
- package/dist/components/CommentThread.svelte.d.ts +22 -0
- package/dist/components/CopyButton.svelte +148 -0
- package/dist/components/CopyButton.svelte.d.ts +19 -0
- package/dist/components/DataTableShell.svelte +140 -0
- package/dist/components/DataTableShell.svelte.d.ts +18 -0
- package/dist/components/DetailDrawer.svelte +9 -3
- package/dist/components/DetailDrawer.svelte.d.ts +2 -0
- package/dist/components/Header.svelte +28 -0
- package/dist/components/Header.svelte.d.ts +8 -0
- package/dist/components/ImagePreview.svelte +83 -0
- package/dist/components/ImagePreview.svelte.d.ts +14 -0
- package/dist/components/Layout.svelte +86 -6
- package/dist/components/Layout.svelte.d.ts +6 -0
- package/dist/components/ListFooter.svelte +82 -0
- package/dist/components/ListFooter.svelte.d.ts +23 -0
- package/dist/components/ListPagination.svelte +109 -0
- package/dist/components/ListPagination.svelte.d.ts +19 -0
- package/dist/components/NotificationCenter.svelte +215 -0
- package/dist/components/NotificationCenter.svelte.d.ts +28 -0
- package/dist/components/ScrollableTable.svelte +211 -0
- package/dist/components/ScrollableTable.svelte.d.ts +14 -0
- package/dist/components/ThemeSettingsDrawer.svelte +212 -0
- package/dist/components/ThemeSettingsDrawer.svelte.d.ts +10 -0
- package/dist/components/TypographyEllipsis.svelte +123 -0
- package/dist/components/TypographyEllipsis.svelte.d.ts +18 -0
- package/dist/components/ViewModeToggle.svelte +47 -0
- package/dist/components/ViewModeToggle.svelte.d.ts +11 -0
- package/dist/components/list-i18n.d.ts +27 -0
- package/dist/components/list-i18n.js +53 -0
- package/dist/components/list-pagination.d.ts +3 -0
- package/dist/components/list-pagination.js +18 -0
- package/dist/components/templates/AdvancedDetailTemplate.svelte +36 -0
- package/dist/components/templates/AdvancedDetailTemplate.svelte.d.ts +17 -0
- package/dist/components/templates/AdvancedFormTemplate.svelte +32 -0
- package/dist/components/templates/AdvancedFormTemplate.svelte.d.ts +15 -0
- package/dist/components/templates/AnalysisTemplate.svelte +34 -0
- package/dist/components/templates/AnalysisTemplate.svelte.d.ts +16 -0
- package/dist/components/templates/BasicDetailTemplate.svelte +32 -0
- package/dist/components/templates/BasicDetailTemplate.svelte.d.ts +15 -0
- package/dist/components/templates/CardListTemplate.svelte +29 -0
- package/dist/components/templates/CardListTemplate.svelte.d.ts +14 -0
- package/dist/components/templates/ExceptionTemplate.svelte +28 -0
- package/dist/components/templates/ExceptionTemplate.svelte.d.ts +11 -0
- package/dist/components/templates/GroupFormTemplate.svelte +30 -0
- package/dist/components/templates/GroupFormTemplate.svelte.d.ts +14 -0
- package/dist/components/templates/MonitorTemplate.svelte +39 -0
- package/dist/components/templates/MonitorTemplate.svelte.d.ts +15 -0
- package/dist/components/templates/ProfileTemplate.svelte +30 -0
- package/dist/components/templates/ProfileTemplate.svelte.d.ts +14 -0
- package/dist/components/templates/ResultTemplate.svelte +39 -0
- package/dist/components/templates/ResultTemplate.svelte.d.ts +14 -0
- package/dist/components/templates/SearchTableTemplate.svelte +31 -0
- package/dist/components/templates/SearchTableTemplate.svelte.d.ts +15 -0
- package/dist/components/templates/StepFormTemplate.svelte +62 -0
- package/dist/components/templates/StepFormTemplate.svelte.d.ts +23 -0
- package/dist/components/templates/TemplatePageShell.svelte +109 -0
- package/dist/components/templates/TemplatePageShell.svelte.d.ts +20 -0
- package/dist/components/templates/WorkplaceTemplate.svelte +34 -0
- package/dist/components/templates/WorkplaceTemplate.svelte.d.ts +16 -0
- package/dist/components/templates/index.d.ts +16 -0
- package/dist/components/templates/index.js +16 -0
- package/dist/design-system-components.d.ts +64 -0
- package/dist/design-system-components.js +72 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +20 -0
- package/dist/ui-preferences.svelte.d.ts +19 -0
- package/dist/ui-preferences.svelte.js +69 -0
- package/package.json +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const english = {
|
|
2
|
+
'common.total': 'Total: {total}',
|
|
3
|
+
'listPagination.navigation': '{label} pagination',
|
|
4
|
+
'listPagination.range': '{start}–{end} of {total} records',
|
|
5
|
+
'listPagination.pageSizeLabel': 'Rows per page',
|
|
6
|
+
'listPagination.pageSizeAria': '{label} rows per page',
|
|
7
|
+
'listPagination.pageSizeOption': '{size} rows',
|
|
8
|
+
'listPagination.firstPage': 'Already on the first page.',
|
|
9
|
+
'listPagination.lastPage': 'Already on the last page.',
|
|
10
|
+
'listPagination.previous': 'Previous page',
|
|
11
|
+
'listPagination.next': 'Next page',
|
|
12
|
+
'listPagination.previousAria': '{label} previous page',
|
|
13
|
+
'listPagination.nextAria': '{label} next page',
|
|
14
|
+
'listPagination.pageList': '{label} page numbers',
|
|
15
|
+
'listPagination.pageAria': '{label} page {page}',
|
|
16
|
+
'listPagination.currentPage': 'Current page {page}',
|
|
17
|
+
'listPagination.goToPage': 'Go to page {page}',
|
|
18
|
+
'listFooter.truncated': 'Only the first {maxRecords} records are loaded. Narrow the results using filters.',
|
|
19
|
+
'scrollableTable.horizontalScroll': 'Scroll table horizontally',
|
|
20
|
+
'scrollableTable.topHorizontalScroll': 'Scroll table horizontally above the table',
|
|
21
|
+
};
|
|
22
|
+
const chinese = {
|
|
23
|
+
'common.total': '共 {total} 条',
|
|
24
|
+
'listPagination.navigation': '{label}分页导航',
|
|
25
|
+
'listPagination.range': '第 {start}–{end} 条 / 共 {total} 条',
|
|
26
|
+
'listPagination.pageSizeLabel': '每页条数',
|
|
27
|
+
'listPagination.pageSizeAria': '{label}每页条数',
|
|
28
|
+
'listPagination.pageSizeOption': '{size} 条',
|
|
29
|
+
'listPagination.firstPage': '已经是第一页。',
|
|
30
|
+
'listPagination.lastPage': '已经是最后一页。',
|
|
31
|
+
'listPagination.previous': '上一页',
|
|
32
|
+
'listPagination.next': '下一页',
|
|
33
|
+
'listPagination.previousAria': '{label}上一页',
|
|
34
|
+
'listPagination.nextAria': '{label}下一页',
|
|
35
|
+
'listPagination.pageList': '{label}页码列表',
|
|
36
|
+
'listPagination.pageAria': '{label}第 {page} 页',
|
|
37
|
+
'listPagination.currentPage': '当前第 {page} 页',
|
|
38
|
+
'listPagination.goToPage': '前往第 {page} 页',
|
|
39
|
+
'listFooter.truncated': '结果较多,仅加载前 {maxRecords} 条,请用筛选收窄范围。',
|
|
40
|
+
'scrollableTable.horizontalScroll': '列表横向滚动',
|
|
41
|
+
'scrollableTable.topHorizontalScroll': '列表上方横向滚动',
|
|
42
|
+
};
|
|
43
|
+
/** 优先使用宿主翻译;UI 自带回退词条兼容仍在支持范围内的旧版 Core。 */
|
|
44
|
+
export function listText(i18n, key, params = {}) {
|
|
45
|
+
const translated = i18n.t(key, params);
|
|
46
|
+
if (translated !== key)
|
|
47
|
+
return translated;
|
|
48
|
+
let text = (i18n.locale.startsWith('zh') ? chinese : english)[key];
|
|
49
|
+
for (const [name, value] of Object.entries(params)) {
|
|
50
|
+
text = text.replaceAll(`{${name}}`, String(value));
|
|
51
|
+
}
|
|
52
|
+
return text;
|
|
53
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Stable compact page list for desktop list footers. */
|
|
2
|
+
export function listPaginationItems(page, totalPages, maxVisible = 7) {
|
|
3
|
+
const total = Math.max(1, Math.trunc(totalPages));
|
|
4
|
+
const current = Math.min(Math.max(1, Math.trunc(page)), total);
|
|
5
|
+
if (total <= maxVisible)
|
|
6
|
+
return Array.from({ length: total }, (_, index) => index + 1);
|
|
7
|
+
const items = [1];
|
|
8
|
+
const start = Math.max(2, current - 1);
|
|
9
|
+
const end = Math.min(total - 1, current + 1);
|
|
10
|
+
if (start > 2)
|
|
11
|
+
items.push('ellipsis');
|
|
12
|
+
for (let value = start; value <= end; value += 1)
|
|
13
|
+
items.push(value);
|
|
14
|
+
if (end < total - 1)
|
|
15
|
+
items.push('ellipsis');
|
|
16
|
+
items.push(total);
|
|
17
|
+
return items;
|
|
18
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import TemplatePageShell from './TemplatePageShell.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
title: string;
|
|
7
|
+
eyebrow?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
actions?: Snippet;
|
|
10
|
+
metrics?: Snippet;
|
|
11
|
+
details: Snippet;
|
|
12
|
+
activity?: Snippet;
|
|
13
|
+
related?: Snippet;
|
|
14
|
+
footer?: Snippet;
|
|
15
|
+
pageId?: string;
|
|
16
|
+
width?: 'narrow' | 'default' | 'wide';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let { title, eyebrow, description, actions, metrics, details, activity, related, footer, pageId = 'advanced-detail', width = 'wide' }: Props = $props();
|
|
20
|
+
const secondary = $derived(activity ?? related);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<TemplatePageShell
|
|
24
|
+
{title}
|
|
25
|
+
{...(eyebrow ? { eyebrow } : {})}
|
|
26
|
+
{...(description ? { description } : {})}
|
|
27
|
+
{...(actions ? { actions } : {})}
|
|
28
|
+
{...(metrics ? { metrics } : {})}
|
|
29
|
+
primary={details}
|
|
30
|
+
{...(secondary ? { secondary } : {})}
|
|
31
|
+
{...(footer ? { footer } : {})}
|
|
32
|
+
{pageId}
|
|
33
|
+
{width}
|
|
34
|
+
primaryLabel="Record details"
|
|
35
|
+
secondaryLabel="Activity and related records"
|
|
36
|
+
/>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
title: string;
|
|
4
|
+
eyebrow?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
actions?: Snippet;
|
|
7
|
+
metrics?: Snippet;
|
|
8
|
+
details: Snippet;
|
|
9
|
+
activity?: Snippet;
|
|
10
|
+
related?: Snippet;
|
|
11
|
+
footer?: Snippet;
|
|
12
|
+
pageId?: string;
|
|
13
|
+
width?: 'narrow' | 'default' | 'wide';
|
|
14
|
+
}
|
|
15
|
+
declare const AdvancedDetailTemplate: import("svelte").Component<Props, {}, "">;
|
|
16
|
+
type AdvancedDetailTemplate = ReturnType<typeof AdvancedDetailTemplate>;
|
|
17
|
+
export default AdvancedDetailTemplate;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import TemplatePageShell from './TemplatePageShell.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
actions?: Snippet;
|
|
9
|
+
form: Snippet;
|
|
10
|
+
summary?: Snippet;
|
|
11
|
+
activity?: Snippet;
|
|
12
|
+
footer?: Snippet;
|
|
13
|
+
pageId?: string;
|
|
14
|
+
width?: 'narrow' | 'default' | 'wide';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let { title, description, actions, form, summary, activity, footer, pageId = 'advanced-form', width = 'wide' }: Props = $props();
|
|
18
|
+
const secondary = $derived(summary ?? activity);
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<TemplatePageShell
|
|
22
|
+
{title}
|
|
23
|
+
{...(description ? { description } : {})}
|
|
24
|
+
{...(actions ? { actions } : {})}
|
|
25
|
+
primary={form}
|
|
26
|
+
{...(secondary ? { secondary } : {})}
|
|
27
|
+
{...(footer ? { footer } : {})}
|
|
28
|
+
{pageId}
|
|
29
|
+
{width}
|
|
30
|
+
primaryLabel="Form"
|
|
31
|
+
secondaryLabel="Summary"
|
|
32
|
+
/>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
actions?: Snippet;
|
|
6
|
+
form: Snippet;
|
|
7
|
+
summary?: Snippet;
|
|
8
|
+
activity?: Snippet;
|
|
9
|
+
footer?: Snippet;
|
|
10
|
+
pageId?: string;
|
|
11
|
+
width?: 'narrow' | 'default' | 'wide';
|
|
12
|
+
}
|
|
13
|
+
declare const AdvancedFormTemplate: import("svelte").Component<Props, {}, "">;
|
|
14
|
+
type AdvancedFormTemplate = ReturnType<typeof AdvancedFormTemplate>;
|
|
15
|
+
export default AdvancedFormTemplate;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import TemplatePageShell from './TemplatePageShell.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
actions?: Snippet;
|
|
9
|
+
filters?: Snippet;
|
|
10
|
+
metrics?: Snippet;
|
|
11
|
+
charts: Snippet;
|
|
12
|
+
records?: Snippet;
|
|
13
|
+
footer?: Snippet;
|
|
14
|
+
pageId?: string;
|
|
15
|
+
width?: 'narrow' | 'default' | 'wide';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let { title, description, actions, filters, metrics, charts, records, footer, pageId = 'analysis', width = 'wide' }: Props = $props();
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<TemplatePageShell
|
|
22
|
+
{title}
|
|
23
|
+
{...(description ? { description } : {})}
|
|
24
|
+
{...(actions ? { actions } : {})}
|
|
25
|
+
{...(filters ? { toolbar: filters } : {})}
|
|
26
|
+
{...(metrics ? { metrics } : {})}
|
|
27
|
+
primary={charts}
|
|
28
|
+
{...(records ? { secondary: records } : {})}
|
|
29
|
+
{...(footer ? { footer } : {})}
|
|
30
|
+
{pageId}
|
|
31
|
+
{width}
|
|
32
|
+
primaryLabel="Analysis"
|
|
33
|
+
secondaryLabel="Supporting records"
|
|
34
|
+
/>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
actions?: Snippet;
|
|
6
|
+
filters?: Snippet;
|
|
7
|
+
metrics?: Snippet;
|
|
8
|
+
charts: Snippet;
|
|
9
|
+
records?: Snippet;
|
|
10
|
+
footer?: Snippet;
|
|
11
|
+
pageId?: string;
|
|
12
|
+
width?: 'narrow' | 'default' | 'wide';
|
|
13
|
+
}
|
|
14
|
+
declare const AnalysisTemplate: import("svelte").Component<Props, {}, "">;
|
|
15
|
+
type AnalysisTemplate = ReturnType<typeof AnalysisTemplate>;
|
|
16
|
+
export default AnalysisTemplate;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import TemplatePageShell from './TemplatePageShell.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
title: string;
|
|
7
|
+
eyebrow?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
actions?: Snippet;
|
|
10
|
+
details: Snippet;
|
|
11
|
+
summary?: Snippet;
|
|
12
|
+
footer?: Snippet;
|
|
13
|
+
pageId?: string;
|
|
14
|
+
width?: 'narrow' | 'default' | 'wide';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let { title, eyebrow, description, actions, details, summary, footer, pageId = 'detail', width = 'default' }: Props = $props();
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<TemplatePageShell
|
|
21
|
+
{title}
|
|
22
|
+
{...(eyebrow ? { eyebrow } : {})}
|
|
23
|
+
{...(description ? { description } : {})}
|
|
24
|
+
{...(actions ? { actions } : {})}
|
|
25
|
+
primary={details}
|
|
26
|
+
{...(summary ? { secondary: summary } : {})}
|
|
27
|
+
{...(footer ? { footer } : {})}
|
|
28
|
+
{pageId}
|
|
29
|
+
{width}
|
|
30
|
+
primaryLabel="Record details"
|
|
31
|
+
secondaryLabel="Summary"
|
|
32
|
+
/>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
title: string;
|
|
4
|
+
eyebrow?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
actions?: Snippet;
|
|
7
|
+
details: Snippet;
|
|
8
|
+
summary?: Snippet;
|
|
9
|
+
footer?: Snippet;
|
|
10
|
+
pageId?: string;
|
|
11
|
+
width?: 'narrow' | 'default' | 'wide';
|
|
12
|
+
}
|
|
13
|
+
declare const BasicDetailTemplate: import("svelte").Component<Props, {}, "">;
|
|
14
|
+
type BasicDetailTemplate = ReturnType<typeof BasicDetailTemplate>;
|
|
15
|
+
export default BasicDetailTemplate;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import TemplatePageShell from './TemplatePageShell.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
actions?: Snippet;
|
|
9
|
+
filters?: Snippet;
|
|
10
|
+
items: Snippet;
|
|
11
|
+
footer?: Snippet;
|
|
12
|
+
pageId?: string;
|
|
13
|
+
width?: 'narrow' | 'default' | 'wide';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let { title, description, actions, filters, items, footer, pageId = 'card-list', width = 'wide' }: Props = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<TemplatePageShell
|
|
20
|
+
{title}
|
|
21
|
+
{...(description ? { description } : {})}
|
|
22
|
+
{...(actions ? { actions } : {})}
|
|
23
|
+
{...(filters ? { toolbar: filters } : {})}
|
|
24
|
+
primary={items}
|
|
25
|
+
{...(footer ? { footer } : {})}
|
|
26
|
+
{pageId}
|
|
27
|
+
{width}
|
|
28
|
+
primaryLabel="Cards"
|
|
29
|
+
/>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
actions?: Snippet;
|
|
6
|
+
filters?: Snippet;
|
|
7
|
+
items: Snippet;
|
|
8
|
+
footer?: Snippet;
|
|
9
|
+
pageId?: string;
|
|
10
|
+
width?: 'narrow' | 'default' | 'wide';
|
|
11
|
+
}
|
|
12
|
+
declare const CardListTemplate: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type CardListTemplate = ReturnType<typeof CardListTemplate>;
|
|
14
|
+
export default CardListTemplate;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import ResultTemplate from './ResultTemplate.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
status: 403 | 404 | 500;
|
|
7
|
+
title?: string;
|
|
8
|
+
subtitle?: string;
|
|
9
|
+
actions?: Snippet;
|
|
10
|
+
pageId?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { status, title, subtitle, actions, pageId = 'exception' }: Props = $props();
|
|
14
|
+
const defaults: Record<403 | 404 | 500, { title: string; subtitle: string }> = {
|
|
15
|
+
403: { title: 'Access denied', subtitle: 'You do not have permission to view this page.' },
|
|
16
|
+
404: { title: 'Page not found', subtitle: 'The page may have moved or no longer exists.' },
|
|
17
|
+
500: { title: 'Service unavailable', subtitle: 'Try again or contact your administrator.' },
|
|
18
|
+
};
|
|
19
|
+
const copy = $derived(defaults[status]);
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<ResultTemplate
|
|
23
|
+
status={String(status) as '403' | '404' | '500'}
|
|
24
|
+
title={title ?? copy.title}
|
|
25
|
+
subtitle={subtitle ?? copy.subtitle}
|
|
26
|
+
{...(actions ? { actions } : {})}
|
|
27
|
+
{pageId}
|
|
28
|
+
/>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
status: 403 | 404 | 500;
|
|
4
|
+
title?: string;
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
actions?: Snippet;
|
|
7
|
+
pageId?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const ExceptionTemplate: import("svelte").Component<Props, {}, "">;
|
|
10
|
+
type ExceptionTemplate = ReturnType<typeof ExceptionTemplate>;
|
|
11
|
+
export default ExceptionTemplate;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import TemplatePageShell from './TemplatePageShell.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
actions?: Snippet;
|
|
9
|
+
form: Snippet;
|
|
10
|
+
summary?: Snippet;
|
|
11
|
+
footer?: Snippet;
|
|
12
|
+
pageId?: string;
|
|
13
|
+
width?: 'narrow' | 'default' | 'wide';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let { title, description, actions, form, summary, footer, pageId = 'group-form', width = 'default' }: Props = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<TemplatePageShell
|
|
20
|
+
{title}
|
|
21
|
+
{...(description ? { description } : {})}
|
|
22
|
+
{...(actions ? { actions } : {})}
|
|
23
|
+
primary={form}
|
|
24
|
+
{...(summary ? { secondary: summary } : {})}
|
|
25
|
+
{...(footer ? { footer } : {})}
|
|
26
|
+
{pageId}
|
|
27
|
+
{width}
|
|
28
|
+
primaryLabel="Form"
|
|
29
|
+
secondaryLabel="Guidance"
|
|
30
|
+
/>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
actions?: Snippet;
|
|
6
|
+
form: Snippet;
|
|
7
|
+
summary?: Snippet;
|
|
8
|
+
footer?: Snippet;
|
|
9
|
+
pageId?: string;
|
|
10
|
+
width?: 'narrow' | 'default' | 'wide';
|
|
11
|
+
}
|
|
12
|
+
declare const GroupFormTemplate: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type GroupFormTemplate = ReturnType<typeof GroupFormTemplate>;
|
|
14
|
+
export default GroupFormTemplate;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import TemplatePageShell from './TemplatePageShell.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
actions?: Snippet;
|
|
9
|
+
metrics: Snippet;
|
|
10
|
+
alerts?: Snippet;
|
|
11
|
+
activity?: Snippet;
|
|
12
|
+
chart?: Snippet;
|
|
13
|
+
pageId?: string;
|
|
14
|
+
width?: 'narrow' | 'default' | 'wide';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let { title, description, actions, metrics, alerts, activity, chart, pageId = 'monitor', width = 'wide' }: Props = $props();
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<TemplatePageShell
|
|
21
|
+
{title}
|
|
22
|
+
{...(description ? { description } : {})}
|
|
23
|
+
{...(actions ? { actions } : {})}
|
|
24
|
+
{metrics}
|
|
25
|
+
primary={chart ?? alerts ?? fallback}
|
|
26
|
+
{...(activity ? { secondary: activity } : {})}
|
|
27
|
+
{pageId}
|
|
28
|
+
{width}
|
|
29
|
+
primaryLabel="Live monitor"
|
|
30
|
+
secondaryLabel="Recent activity"
|
|
31
|
+
/>
|
|
32
|
+
|
|
33
|
+
{#snippet fallback()}
|
|
34
|
+
<p class="svadmin-monitor-template__empty">No live monitor content.</p>
|
|
35
|
+
{/snippet}
|
|
36
|
+
|
|
37
|
+
<style>
|
|
38
|
+
.svadmin-monitor-template__empty { margin: 0; padding: var(--svadmin-space-5); border: 1px dashed var(--border); border-radius: var(--radius-md); color: var(--muted-foreground); text-align: center; }
|
|
39
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
actions?: Snippet;
|
|
6
|
+
metrics: Snippet;
|
|
7
|
+
alerts?: Snippet;
|
|
8
|
+
activity?: Snippet;
|
|
9
|
+
chart?: Snippet;
|
|
10
|
+
pageId?: string;
|
|
11
|
+
width?: 'narrow' | 'default' | 'wide';
|
|
12
|
+
}
|
|
13
|
+
declare const MonitorTemplate: import("svelte").Component<Props, {}, "">;
|
|
14
|
+
type MonitorTemplate = ReturnType<typeof MonitorTemplate>;
|
|
15
|
+
export default MonitorTemplate;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import TemplatePageShell from './TemplatePageShell.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
actions?: Snippet;
|
|
9
|
+
profile: Snippet;
|
|
10
|
+
activity?: Snippet;
|
|
11
|
+
projects?: Snippet;
|
|
12
|
+
pageId?: string;
|
|
13
|
+
width?: 'narrow' | 'default' | 'wide';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let { title, description, actions, profile, activity, projects, pageId = 'profile', width = 'wide' }: Props = $props();
|
|
17
|
+
const secondary = $derived(activity ?? projects);
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<TemplatePageShell
|
|
21
|
+
{title}
|
|
22
|
+
{...(description ? { description } : {})}
|
|
23
|
+
{...(actions ? { actions } : {})}
|
|
24
|
+
primary={profile}
|
|
25
|
+
{...(secondary ? { secondary } : {})}
|
|
26
|
+
{pageId}
|
|
27
|
+
{width}
|
|
28
|
+
primaryLabel="Profile"
|
|
29
|
+
secondaryLabel="Activity"
|
|
30
|
+
/>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
actions?: Snippet;
|
|
6
|
+
profile: Snippet;
|
|
7
|
+
activity?: Snippet;
|
|
8
|
+
projects?: Snippet;
|
|
9
|
+
pageId?: string;
|
|
10
|
+
width?: 'narrow' | 'default' | 'wide';
|
|
11
|
+
}
|
|
12
|
+
declare const ProfileTemplate: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type ProfileTemplate = ReturnType<typeof ProfileTemplate>;
|
|
14
|
+
export default ProfileTemplate;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import ContentPageShell from '../content/ContentPageShell.svelte';
|
|
4
|
+
import Result from '../Result.svelte';
|
|
5
|
+
import { cn } from '../../utils.js';
|
|
6
|
+
|
|
7
|
+
type ResultStatus = 'success' | 'failure' | '403' | '404' | '500' | 'info' | 'warning';
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
status: ResultStatus;
|
|
11
|
+
title: string;
|
|
12
|
+
subtitle?: string;
|
|
13
|
+
actions?: Snippet;
|
|
14
|
+
details?: Snippet;
|
|
15
|
+
pageId?: string;
|
|
16
|
+
class?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let { status, title, subtitle, actions, details, pageId = 'result', class: className = '' }: Props = $props();
|
|
20
|
+
const resultStatus = $derived(status === 'failure' ? 'error' : status);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<ContentPageShell {pageId} width="narrow" class={cn('svadmin-result-page', className)}>
|
|
24
|
+
<Result status={resultStatus} {title} {...(subtitle ? { subtitle } : {})}>
|
|
25
|
+
{#if details}{@render details()}{/if}
|
|
26
|
+
</Result>
|
|
27
|
+
{#if actions}<div class="svadmin-result-page__actions">{@render actions()}</div>{/if}
|
|
28
|
+
</ContentPageShell>
|
|
29
|
+
|
|
30
|
+
<style>
|
|
31
|
+
:global(.svadmin-result-page) { display: grid; place-items: center; padding-block: var(--svadmin-space-6); }
|
|
32
|
+
.svadmin-result-page__actions {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-wrap: wrap;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
gap: var(--svadmin-space-2);
|
|
37
|
+
margin-block-start: var(--svadmin-space-4);
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type ResultStatus = 'success' | 'failure' | '403' | '404' | '500' | 'info' | 'warning';
|
|
3
|
+
interface Props {
|
|
4
|
+
status: ResultStatus;
|
|
5
|
+
title: string;
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
actions?: Snippet;
|
|
8
|
+
details?: Snippet;
|
|
9
|
+
pageId?: string;
|
|
10
|
+
class?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const ResultTemplate: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type ResultTemplate = ReturnType<typeof ResultTemplate>;
|
|
14
|
+
export default ResultTemplate;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import TemplatePageShell from './TemplatePageShell.svelte';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
actions?: Snippet;
|
|
9
|
+
filters?: Snippet;
|
|
10
|
+
metrics?: Snippet;
|
|
11
|
+
table: Snippet;
|
|
12
|
+
footer?: Snippet;
|
|
13
|
+
pageId?: string;
|
|
14
|
+
width?: 'narrow' | 'default' | 'wide';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let { title, description, actions, filters, metrics, table, footer, pageId = 'search-table', width = 'wide' }: Props = $props();
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<TemplatePageShell
|
|
21
|
+
{title}
|
|
22
|
+
{...(description ? { description } : {})}
|
|
23
|
+
{...(actions ? { actions } : {})}
|
|
24
|
+
{...(filters ? { toolbar: filters } : {})}
|
|
25
|
+
{...(metrics ? { metrics } : {})}
|
|
26
|
+
primary={table}
|
|
27
|
+
{...(footer ? { footer } : {})}
|
|
28
|
+
{pageId}
|
|
29
|
+
{width}
|
|
30
|
+
primaryLabel="Search results"
|
|
31
|
+
/>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
actions?: Snippet;
|
|
6
|
+
filters?: Snippet;
|
|
7
|
+
metrics?: Snippet;
|
|
8
|
+
table: Snippet;
|
|
9
|
+
footer?: Snippet;
|
|
10
|
+
pageId?: string;
|
|
11
|
+
width?: 'narrow' | 'default' | 'wide';
|
|
12
|
+
}
|
|
13
|
+
declare const SearchTableTemplate: import("svelte").Component<Props, {}, "">;
|
|
14
|
+
type SearchTableTemplate = ReturnType<typeof SearchTableTemplate>;
|
|
15
|
+
export default SearchTableTemplate;
|