@svadmin/ui 0.72.0 → 0.74.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 +62 -22
- package/THIRD_PARTY_NOTICES.md +52 -0
- package/dist/app.css +8488 -6297
- package/dist/app.theme.css +8514 -6374
- package/dist/class-properties.generated.d.ts +1 -0
- package/dist/class-properties.generated.js +2 -0
- package/dist/classnames.d.ts +8 -0
- package/dist/classnames.js +26 -0
- package/dist/component-registry.d.ts +14977 -0
- package/dist/component-registry.js +216 -0
- package/dist/components/AboutSettings.svelte +7 -1
- package/dist/components/AboutSettings.svelte.d.ts +4 -1
- package/dist/components/ActivityFeed.svelte +9 -3
- package/dist/components/ActivityFeed.svelte.d.ts +3 -0
- package/dist/components/AdminApp.svelte +19 -10
- package/dist/components/AdminApp.svelte.d.ts +6 -0
- package/dist/components/ApiSettings.svelte +41 -5
- package/dist/components/ApprovalCenter.svelte +283 -0
- package/dist/components/ApprovalCenter.svelte.d.ts +10 -0
- package/dist/components/AuditLogViewer.svelte +3 -1
- package/dist/components/AutoForm.svelte +53 -9
- package/dist/components/AutoForm.svelte.d.ts +3 -0
- package/dist/components/AutoTable.svelte +846 -43
- package/dist/components/AutoTable.svelte.d.ts +22 -1
- package/dist/components/BoundRecordDetailDrawer.svelte +17 -2
- package/dist/components/BoundRecordDetailDrawer.svelte.d.ts +4 -0
- package/dist/components/Breadcrumbs.svelte +11 -1
- package/dist/components/CancelTaskButton.svelte +12 -42
- package/dist/components/ColorPicker.svelte +73 -0
- package/dist/components/ColorPicker.svelte.d.ts +15 -0
- package/dist/components/ComboboxField.svelte +143 -34
- package/dist/components/ComboboxField.svelte.d.ts +4 -2
- package/dist/components/CreatePage.svelte +4 -0
- package/dist/components/CreatePage.svelte.d.ts +2 -0
- package/dist/components/DashboardView.svelte +99 -0
- package/dist/components/DashboardView.svelte.d.ts +14 -0
- package/dist/components/DatePicker.svelte +10 -0
- package/dist/components/DatePicker.svelte.d.ts +6 -0
- package/dist/components/DateRangeInput.svelte +155 -0
- package/dist/components/DateRangeInput.svelte.d.ts +35 -0
- package/dist/components/DateRangePicker.svelte +10 -0
- package/dist/components/DateRangePicker.svelte.d.ts +6 -0
- package/dist/components/DateTimeInput.svelte +134 -0
- package/dist/components/DateTimeInput.svelte.d.ts +27 -0
- package/dist/components/DateTimePicker.svelte +10 -0
- package/dist/components/DateTimePicker.svelte.d.ts +6 -0
- package/dist/components/DevTools.svelte +36 -28
- package/dist/components/DevframePanel.svelte +123 -0
- package/dist/components/DevframePanel.svelte.d.ts +3 -0
- package/dist/components/EditPage.svelte +4 -0
- package/dist/components/EditPage.svelte.d.ts +2 -0
- package/dist/components/ErrorSummary.svelte +52 -0
- package/dist/components/ErrorSummary.svelte.d.ts +14 -0
- package/dist/components/FieldRenderer.svelte +172 -99
- package/dist/components/FileUpload.svelte +412 -0
- package/dist/components/FileUpload.svelte.d.ts +43 -0
- package/dist/components/FilterBuilder.svelte +244 -265
- package/dist/components/FilterBuilder.svelte.d.ts +3 -0
- package/dist/components/FilterCollectionInput.svelte +80 -0
- package/dist/components/FilterCollectionInput.svelte.d.ts +10 -0
- package/dist/components/GanttChart.svelte +66 -14
- package/dist/components/GanttChart.svelte.d.ts +6 -0
- package/dist/components/Header.svelte +18 -2
- package/dist/components/ImportWizard.svelte +509 -100
- package/dist/components/ImportWizard.svelte.d.ts +11 -0
- package/dist/components/JsonSchemaForm.svelte +322 -98
- package/dist/components/JsonSchemaForm.svelte.d.ts +18 -1
- package/dist/components/KanbanBoard.svelte +195 -40
- package/dist/components/KanbanBoard.svelte.d.ts +9 -2
- package/dist/components/Layout.svelte +4 -3
- package/dist/components/LazyAutoForm.svelte +28 -0
- package/dist/components/LazyAutoForm.svelte.d.ts +8 -0
- package/dist/components/LazyAutoTable.svelte +28 -0
- package/dist/components/LazyAutoTable.svelte.d.ts +8 -0
- package/dist/components/LazySettingsPage.svelte +28 -0
- package/dist/components/LazySettingsPage.svelte.d.ts +8 -0
- package/dist/components/LazyShowPage.svelte +28 -0
- package/dist/components/LazyShowPage.svelte.d.ts +8 -0
- package/dist/components/LazyTaskQueueDrawer.svelte.d.ts +1 -1
- package/dist/components/ListPage.svelte +9 -1
- package/dist/components/ListPage.svelte.d.ts +5 -0
- package/dist/components/LoginPage.svelte +2 -2
- package/dist/components/MoneyInput.svelte +25 -0
- package/dist/components/MoneyInput.svelte.d.ts +20 -0
- package/dist/components/MultiTabKeepAlive.svelte +11 -6
- package/dist/components/NotificationsSettings.svelte +69 -2
- package/dist/components/NotificationsSettings.svelte.d.ts +25 -1
- package/dist/components/NumberInput.svelte +25 -0
- package/dist/components/NumberInput.svelte.d.ts +19 -0
- package/dist/components/NumericInput.svelte +110 -0
- package/dist/components/NumericInput.svelte.d.ts +23 -0
- package/dist/components/PercentInput.svelte +25 -0
- package/dist/components/PercentInput.svelte.d.ts +20 -0
- package/dist/components/PermissionMatrix.svelte +20 -1
- package/dist/components/PivotExportButton.svelte +157 -0
- package/dist/components/PivotExportButton.svelte.d.ts +16 -0
- package/dist/components/PivotTable.svelte +229 -74
- package/dist/components/PivotTable.svelte.d.ts +19 -2
- package/dist/components/QuickEditDrawer.svelte +4 -1
- package/dist/components/QuickEditDrawer.svelte.d.ts +2 -0
- package/dist/components/RadioGroup.svelte +121 -0
- package/dist/components/RadioGroup.svelte.d.ts +43 -0
- package/dist/components/RangeSlider.svelte +127 -0
- package/dist/components/RangeSlider.svelte.d.ts +22 -0
- package/dist/components/Rate.svelte +121 -0
- package/dist/components/Rate.svelte.d.ts +16 -0
- package/dist/components/RecordDetailDrawer.svelte +6 -2
- package/dist/components/RecordDetailDrawer.svelte.d.ts +4 -0
- package/dist/components/RelationPicker.svelte +341 -0
- package/dist/components/RelationPicker.svelte.d.ts +26 -0
- package/dist/components/ResourceOperationsPage.svelte +25 -19
- package/dist/components/ResourceOperationsPage.svelte.d.ts +5 -1
- package/dist/components/RetryTaskButton.svelte +12 -42
- package/dist/components/SecuritySettings.svelte +29 -5
- package/dist/components/SegmentedControl.svelte +145 -0
- package/dist/components/SegmentedControl.svelte.d.ts +38 -0
- package/dist/components/SettingsPage.svelte +3 -1
- package/dist/components/SettingsPage.svelte.d.ts +1 -0
- package/dist/components/ShowInferencer.svelte +4 -2
- package/dist/components/ShowInferencer.svelte.d.ts +2 -0
- package/dist/components/ShowPage.svelte +25 -6
- package/dist/components/ShowPage.svelte.d.ts +5 -0
- package/dist/components/Sidebar.svelte +5 -5
- package/dist/components/Slider.svelte +100 -0
- package/dist/components/Slider.svelte.d.ts +19 -0
- package/dist/components/SpreadsheetView.svelte +1037 -124
- package/dist/components/SpreadsheetView.svelte.d.ts +19 -0
- package/dist/components/StepsForm.svelte +5 -5
- package/dist/components/SvarAutoTable.svelte +39 -0
- package/dist/components/SvarAutoTable.svelte.d.ts +13 -0
- package/dist/components/SvarDataGrid.svelte +362 -0
- package/dist/components/SvarDataGrid.svelte.d.ts +57 -0
- package/dist/components/SvarGridCell.svelte +10 -0
- package/dist/components/SvarGridCell.svelte.d.ts +7 -0
- package/dist/components/SvarResourceRead.svelte +50 -0
- package/dist/components/SvarResourceRead.svelte.d.ts +23 -0
- package/dist/components/SvarResourceTable.svelte +63 -0
- package/dist/components/SvarResourceTable.svelte.d.ts +42 -0
- package/dist/components/SvarResourceTableView.svelte +364 -0
- package/dist/components/SvarResourceTableView.svelte.d.ts +4 -0
- package/dist/components/TagsInput.svelte +178 -0
- package/dist/components/TagsInput.svelte.d.ts +17 -0
- package/dist/components/TaskQueueDrawer.svelte +72 -16
- package/dist/components/TimePicker.svelte +10 -0
- package/dist/components/TimePicker.svelte.d.ts +6 -0
- package/dist/components/TreeSelect.svelte +440 -46
- package/dist/components/TreeSelect.svelte.d.ts +6 -1
- package/dist/components/TreeTable.svelte +484 -82
- package/dist/components/TreeTable.svelte.d.ts +24 -1
- package/dist/components/TwoFactorAuthPage.svelte +85 -48
- package/dist/components/TwoFactorAuthPage.svelte.d.ts +12 -1
- package/dist/components/VirtualTable.svelte +116 -20
- package/dist/components/VirtualTable.svelte.d.ts +5 -0
- package/dist/components/account/CompanyProfilePage.svelte +74 -38
- package/dist/components/account/GetStartedPage.svelte +2 -1
- package/dist/components/account/ImportMembersPage.svelte +22 -167
- package/dist/components/account/ImportMembersPage.svelte.d.ts +4 -1
- package/dist/components/account/MemberDirectory.svelte +156 -0
- package/dist/components/account/MemberDirectory.svelte.d.ts +19 -0
- package/dist/components/account/MembersStarterPage.svelte +9 -55
- package/dist/components/account/MembersStarterPage.svelte.d.ts +5 -1
- package/dist/components/account/SecurityLogPage.svelte +4 -1
- package/dist/components/account/SettingsPlainPage.svelte +7 -38
- package/dist/components/account/SettingsPlainPage.svelte.d.ts +4 -1
- package/dist/components/account/SettingsSidebarPage.svelte +7 -20
- package/dist/components/account/TeamMembersPage.svelte +4 -20
- package/dist/components/account/TeamMembersPage.svelte.d.ts +5 -1
- package/dist/components/account/UserProfilePage.svelte +3 -25
- package/dist/components/account/UserProfilePage.svelte.d.ts +17 -2
- package/dist/components/auto-table-grid.d.ts +26 -0
- package/dist/components/auto-table-grid.js +1 -0
- package/dist/components/buttons/ExportButton.svelte +56 -12
- package/dist/components/buttons/ExportButton.svelte.d.ts +11 -0
- package/dist/components/content/ContentPageHeader.svelte +12 -9
- package/dist/components/content/ContentPageShell.svelte +6 -9
- package/dist/components/content/FileBrowser.svelte +35 -0
- package/dist/components/content/FileBrowser.svelte.d.ts +14 -0
- package/dist/components/content/MetricBlock.svelte +10 -13
- package/dist/components/content/NetworkTable.svelte +3 -3
- package/dist/components/content/NetworkTable.svelte.d.ts +1 -0
- package/dist/components/content/PageToolbar.svelte +6 -10
- package/dist/components/content/ReferenceNotice.svelte +5 -0
- package/dist/components/content/ReferenceNotice.svelte.d.ts +18 -0
- package/dist/components/content/SectionHeader.svelte +8 -13
- package/dist/components/content/SettingsFieldRow.svelte +9 -23
- package/dist/components/content/SettingsGroup.svelte +11 -27
- package/dist/components/content/StatusBadge.svelte +3 -8
- package/dist/components/content/WorkspaceLayout.svelte +8 -12
- package/dist/components/enterprise/filter-tree.d.ts +48 -0
- package/dist/components/enterprise/filter-tree.js +224 -0
- package/dist/components/enterprise/json-schema-form.d.ts +39 -0
- package/dist/components/enterprise/json-schema-form.js +195 -0
- package/dist/components/enterprise/recursive-schema-form.d.ts +30 -0
- package/dist/components/enterprise/recursive-schema-form.js +196 -0
- package/dist/components/enterprise/spreadsheet-formula.d.ts +12 -0
- package/dist/components/enterprise/spreadsheet-formula.js +245 -0
- package/dist/components/export-reference.d.ts +2 -0
- package/dist/components/export-reference.js +9 -0
- package/dist/components/fieldComponentMap.js +2 -0
- package/dist/components/fields/DateField.svelte +12 -12
- package/dist/components/fields/date-display.d.ts +6 -0
- package/dist/components/fields/date-display.js +24 -0
- package/dist/components/fields/date-field-value.d.ts +2 -0
- package/dist/components/fields/date-field-value.js +13 -0
- package/dist/components/json-schema-form-state.d.ts +37 -0
- package/dist/components/json-schema-form-state.js +168 -0
- package/dist/components/network/TeamCrewTablePage.svelte +6 -1
- package/dist/components/network/UserCardsNFTPage.svelte +2 -0
- package/dist/components/profile/PublicProfilePage.svelte +2 -0
- package/dist/components/record-detail.svelte.d.ts +3 -0
- package/dist/components/record-detail.svelte.js +10 -4
- package/dist/components/saved-list-views.d.ts +74 -1
- package/dist/components/saved-list-views.js +191 -3
- package/dist/components/svar-grid-cells.d.ts +14 -0
- package/dist/components/svar-grid-cells.js +2 -0
- package/dist/components/svar-grid-contract.d.ts +80 -0
- package/dist/components/svar-grid-contract.js +159 -0
- package/dist/components/svar-grid-interactions.d.ts +54 -0
- package/dist/components/svar-grid-interactions.js +174 -0
- package/dist/components/svar-grid-loading.d.ts +40 -0
- package/dist/components/svar-grid-loading.js +180 -0
- package/dist/components/svar-grid-operations.d.ts +37 -0
- package/dist/components/svar-grid-operations.js +186 -0
- package/dist/components/svar-grid-panes.d.ts +34 -0
- package/dist/components/svar-grid-panes.js +66 -0
- package/dist/components/svar-grid-resource-loading.d.ts +18 -0
- package/dist/components/svar-grid-resource-loading.js +68 -0
- package/dist/components/svar-grid-resource-session.svelte.d.ts +29 -0
- package/dist/components/svar-grid-resource-session.svelte.js +61 -0
- package/dist/components/table-contract.d.ts +12 -1
- package/dist/components/task-action.svelte.d.ts +13 -0
- package/dist/components/task-action.svelte.js +73 -0
- package/dist/components/ui/DesignSystemShowcase.svelte +164 -0
- package/dist/components/ui/DesignSystemShowcase.svelte.d.ts +3 -0
- package/dist/components/ui/badge/badge-variants.d.ts +3 -2
- package/dist/components/ui/badge/badge-variants.js +2 -1
- package/dist/components/ui/badge/badge.svelte +3 -0
- package/dist/components/ui/badge/badge.svelte.d.ts +1 -0
- package/dist/components/ui/button/button-variants.d.ts +5 -4
- package/dist/components/ui/button/button-variants.js +7 -2
- package/dist/components/ui/checkbox/checkbox.svelte +5 -1
- package/dist/components/ui/checkbox/checkbox.svelte.d.ts +5 -1
- package/dist/components/ui/input/input.svelte +8 -6
- package/dist/components/ui/input/input.svelte.d.ts +4 -1
- package/dist/components/ui/select/select.svelte +4 -1
- package/dist/components/ui/select/select.svelte.d.ts +2 -1
- package/dist/components/ui/textarea/textarea.svelte +2 -1
- package/dist/components.css +3110 -0
- package/dist/date-input-policy.d.ts +4 -0
- package/dist/date-input-policy.js +35 -0
- package/dist/design-contract.d.ts +13 -0
- package/dist/design-contract.js +11 -0
- package/dist/design-system-components.d.ts +100 -0
- package/dist/design-system-components.js +101 -0
- package/dist/design-system.d.ts +15 -0
- package/dist/design-system.js +7 -0
- package/dist/devtools-bridge.d.ts +80 -0
- package/dist/devtools-bridge.js +92 -0
- package/dist/index.d.ts +50 -1
- package/dist/index.js +32 -2
- package/dist/page-chrome.css +12 -49
- package/dist/recipes.d.ts +960 -0
- package/dist/recipes.js +264 -0
- package/dist/rendering/index.d.ts +87 -0
- package/dist/rendering/index.js +117 -0
- package/dist/styles/aliases.css +49 -0
- package/dist/styles/compatibility.epilogue.css +384 -0
- package/dist/styles/compatibility.prelude.css +5513 -0
- package/dist/styles/conditional-states.css +28 -0
- package/dist/styles/conditional-utilities.css +22 -0
- package/dist/tree-table-model.d.ts +24 -0
- package/dist/tree-table-model.js +111 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/package.json +40 -10
- package/styles-compatibility.json +12 -0
|
@@ -1,28 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useTranslation } from '@svadmin/core/i18n';
|
|
3
|
-
import
|
|
4
|
-
import { Button } from '../ui/button/index.js';
|
|
5
|
-
import { Input } from '../ui/input/index.js';
|
|
6
|
-
import { Label } from '../ui/label/index.js';
|
|
7
|
-
import * as Card from '../ui/card/index.js';
|
|
3
|
+
import MemberDirectory, { type MemberDirectoryProvider } from './MemberDirectory.svelte';
|
|
8
4
|
import ContentPageShell from '../content/ContentPageShell.svelte';
|
|
9
5
|
import ContentPageHeader from '../content/ContentPageHeader.svelte';
|
|
10
|
-
|
|
11
|
-
import MemberList from '../content/MemberList.svelte';
|
|
12
|
-
import type { MemberSummary } from '../content/MemberList.svelte';
|
|
13
|
-
import { referenceDemoData } from '../../reference-data.js';
|
|
6
|
+
let { memberProvider }: { memberProvider?: MemberDirectoryProvider } = $props();
|
|
14
7
|
const i18n = useTranslation();
|
|
15
|
-
let query = $state('');
|
|
16
|
-
let inviteEmail = $state('');
|
|
17
|
-
let inviteStatus = $state('');
|
|
18
|
-
let members = $state<MemberSummary[]>(referenceDemoData.members.map((member) => ({ ...member, status: member.status === 'active' ? 'success' : member.status === 'invited' ? 'warning' : 'neutral' })));
|
|
19
|
-
const filtered = $derived(query ? members.filter((member) => `${member.name} ${member.email} ${member.department}`.toLowerCase().includes(query.toLowerCase())) : members);
|
|
20
|
-
function sendInvite() { const email = inviteEmail.trim(); if (!email) return; members = [...members, { id: `invite-${Date.now()}`, name: email.replace(/@.*$/, ''), email, role: 'Viewer', department: 'Pending assignment', status: 'warning' }]; inviteStatus = email; inviteEmail = ''; }
|
|
21
8
|
</script>
|
|
22
|
-
|
|
23
9
|
<ContentPageShell pageId="account-team-members" width="wide">
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
<div class="svadmin-u-f3c543ad5fe9 svadmin-u-0c3bc98565dd svadmin-u-2f27a80ed92b"><Card.Card><Card.CardContent class="svadmin-u-6ed543e2fbbb svadmin-u-c07e54fd1439"><div><h2 class="svadmin-u-fc7473ca09eb svadmin-u-e83a7042bc91 svadmin-u-d4108abe6359">{i18n.t('account.invitePeople')}</h2><p class="svadmin-u-b6b02c0ebef6 svadmin-u-fc7473ca09eb svadmin-u-bfa603190748">{i18n.t('account.invitePeopleDescription')}</p></div><div class="svadmin-u-60fbb7713999 svadmin-u-8dddea0773ed svadmin-u-77a2a20e90d4 svadmin-u-020ba687fa12"><div class="svadmin-u-7e0b7cdf1a94 svadmin-u-36e579c0b41c svadmin-u-6f7e013d6499"><Label for="invite-email">Email</Label><Input id="invite-email" bind:value={inviteEmail} type="email" placeholder="name@example.com" /></div><Button class="svadmin-u-c7d50d5fc0c3" size="sm" disabled={!inviteEmail} onclick={sendInvite}><Send class="svadmin-u-783b0d9d1e2c" />{i18n.t('account.sendInvite')}</Button></div>{#if inviteStatus}<p class="svadmin-u-359090c2d529 svadmin-u-76747e5e02ff" role="status">{i18n.t('account.invited')}: {inviteStatus}</p>{/if}</Card.CardContent></Card.Card><Card.Card><Card.CardContent class="svadmin-u-6ed543e2fbbb svadmin-u-c07e54fd1439"><div class="svadmin-u-60fbb7713999 svadmin-u-3960ffc248d9 svadmin-u-77a2a20e90d4"><Link2 class="svadmin-u-f7b5fa971871 svadmin-u-bfa603190748" /><h2 class="svadmin-u-fc7473ca09eb svadmin-u-e83a7042bc91 svadmin-u-d4108abe6359">{i18n.t('account.inviteWithLink')}</h2></div><p class="svadmin-u-fc7473ca09eb svadmin-u-bfa603190748">{i18n.t('account.inviteLinkHint')}</p><div class="svadmin-u-60fbb7713999 svadmin-u-77a2a20e90d4"><Input readonly value="https://acme.com/invite/xK7fQ2" class="svadmin-u-0e65706bcccd svadmin-u-359090c2d529" /><Button variant="outline" size="sm"><Copy class="svadmin-u-783b0d9d1e2c" />{i18n.t('account.copyLink')}</Button></div></Card.CardContent></Card.Card></div>
|
|
27
|
-
<MemberList members={filtered} />
|
|
10
|
+
<ContentPageHeader title={i18n.t('account.teamMembers')} />
|
|
11
|
+
<MemberDirectory provider={memberProvider} />
|
|
28
12
|
</ContentPageShell>
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { type MemberDirectoryProvider } from './MemberDirectory.svelte';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
memberProvider?: MemberDirectoryProvider;
|
|
4
|
+
};
|
|
5
|
+
declare const TeamMembersPage: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
2
6
|
type TeamMembersPage = ReturnType<typeof TeamMembersPage>;
|
|
3
7
|
export default TeamMembersPage;
|
|
@@ -1,30 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import { Loader2 } from '@lucide/svelte';
|
|
4
|
-
import { Button } from '../ui/button/index.js';
|
|
5
|
-
import { Switch } from '../ui/switch/index.js';
|
|
6
|
-
import * as Card from '../ui/card/index.js';
|
|
2
|
+
import ProfilePage from '../ProfilePage.svelte';
|
|
7
3
|
import ContentPageShell from '../content/ContentPageShell.svelte';
|
|
8
|
-
import ContentPageHeader from '../content/ContentPageHeader.svelte';
|
|
9
|
-
import DescriptionList from '../content/DescriptionList.svelte';
|
|
10
|
-
import FileList from '../content/FileList.svelte';
|
|
11
|
-
import IntegrationCard from '../content/IntegrationCard.svelte';
|
|
12
|
-
import WorkspaceLayout from '../content/WorkspaceLayout.svelte';
|
|
13
|
-
import type { IntegrationSummary } from '../content/IntegrationCard.svelte';
|
|
14
|
-
import { referenceDemoData } from '../../reference-data.js';
|
|
15
|
-
const i18n = useTranslation();
|
|
16
|
-
let availableToHire = $state(true);
|
|
17
|
-
let saving = $state(false);
|
|
18
|
-
async function save() { saving = true; await new Promise((resolve) => setTimeout(resolve, 400)); saving = false; }
|
|
19
|
-
let integrations = $state<IntegrationSummary[]>(referenceDemoData.integrations);
|
|
20
|
-
const files = [{ id: '1', name: 'portfolio-2026.pdf', size: '2.1 MB', type: 'PDF' }, { id: '2', name: 'avatar-pack.zip', size: '8.4 MB', type: 'Archive' }, { id: '3', name: 'cover-photo.png', size: '1.2 MB', type: 'Image' }];
|
|
21
|
-
function toggle(id: string) { integrations = integrations.map((item) => item.id === id ? { ...item, connected: !item.connected } : item); }
|
|
22
4
|
</script>
|
|
23
5
|
|
|
24
|
-
<ContentPageShell pageId="account-user-profile" width="
|
|
25
|
-
<
|
|
26
|
-
<WorkspaceLayout secondaryWidth="20rem">
|
|
27
|
-
{#snippet primary()}<div class="svadmin-u-3e7ce58d64fa"><Card.Card><Card.CardContent class="svadmin-u-b43b4c086d9a svadmin-u-c07e54fd1439"><div><h2 class="svadmin-u-fc7473ca09eb svadmin-u-e83a7042bc91 svadmin-u-d4108abe6359">{i18n.t('account.personalInfo')}</h2><p class="svadmin-u-b6b02c0ebef6 svadmin-u-fc7473ca09eb svadmin-u-bfa603190748">Keep your contact and working details current.</p></div><DescriptionList columns={2} items={[{ label: i18n.t('profile.name'), value: 'Alex Chen' }, { label: i18n.t('account.phone'), value: '+86 138 **** 9527' }, { label: i18n.t('account.dateOfBirth'), value: '1995-04-18' }, { label: i18n.t('account.address'), value: 'Shanghai, CN' }]} /></Card.CardContent></Card.Card><Card.Card><Card.CardContent class="svadmin-u-3e7ce58d64fa svadmin-u-c07e54fd1439"><div class="svadmin-u-60fbb7713999 svadmin-u-3960ffc248d9 svadmin-u-8ef2268efbbc svadmin-u-1004c0c3954c"><div><h2 class="svadmin-u-fc7473ca09eb svadmin-u-e83a7042bc91 svadmin-u-d4108abe6359">{i18n.t('account.work')}</h2><p class="svadmin-u-b6b02c0ebef6 svadmin-u-fc7473ca09eb svadmin-u-bfa603190748">{i18n.t('account.availableNow')}</p></div><Switch bind:checked={availableToHire} /></div><div class="svadmin-u-60fbb7713999 svadmin-u-1eb5c6df38c1 svadmin-u-58284b4ea568">{#each ['TypeScript', 'Svelte', 'Node.js', 'Design Systems'] as skill (skill)}<span class="svadmin-u-421ac2be5045 svadmin-u-ca6bcd4b6f3f svadmin-u-18049387f0af svadmin-u-d5eab218aa34 svadmin-u-660d2effb880 svadmin-u-359090c2d529 svadmin-u-bfa603190748">{skill}</span>{/each}</div></Card.CardContent></Card.Card><section class="svadmin-u-6ed543e2fbbb"><h2 class="svadmin-u-4ee734926ff6 svadmin-u-e83a7042bc91 svadmin-u-d4108abe6359">{i18n.t('account.connections')}</h2>{#each integrations as integration (integration.id)}<IntegrationCard {integration} onconnect={() => toggle(integration.id)} />{/each}</section></div>{/snippet}
|
|
28
|
-
{#snippet secondary()}<div class="svadmin-u-3e7ce58d64fa"><Card.Card><Card.CardContent class="svadmin-u-6ed543e2fbbb svadmin-u-c07e54fd1439"><h2 class="svadmin-u-fc7473ca09eb svadmin-u-e83a7042bc91 svadmin-u-d4108abe6359">{i18n.t('account.myFiles')}</h2><FileList files={files} /></Card.CardContent></Card.Card><Card.Card><Card.CardContent class="svadmin-u-6ed543e2fbbb svadmin-u-c07e54fd1439"><h2 class="svadmin-u-fc7473ca09eb svadmin-u-e83a7042bc91 svadmin-u-d4108abe6359">{i18n.t('account.calendarAccounts')}</h2><DescriptionList items={[{ label: 'Work Calendar', value: 'alex@nebulalabs.io' }, { label: 'Personal Calendar', value: 'alex@example.com' }]} /></Card.CardContent></Card.Card></div>{/snippet}
|
|
29
|
-
</WorkspaceLayout>
|
|
6
|
+
<ContentPageShell pageId="account-user-profile" width="narrow">
|
|
7
|
+
<ProfilePage />
|
|
30
8
|
</ContentPageShell>
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const UserProfilePage: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type UserProfilePage = InstanceType<typeof UserProfilePage>;
|
|
3
18
|
export default UserProfilePage;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { Sort } from '@svadmin/core';
|
|
3
|
+
/** 可信宿主的渲染扩展;资源查询、权限、操作和偏好状态仍由 AutoTable 持有。 */
|
|
4
|
+
export interface AutoTableGridState {
|
|
5
|
+
readonly records: readonly Record<string, unknown>[];
|
|
6
|
+
readonly columns: readonly {
|
|
7
|
+
key: string;
|
|
8
|
+
label: string;
|
|
9
|
+
width: number;
|
|
10
|
+
sortable: boolean;
|
|
11
|
+
}[];
|
|
12
|
+
readonly primaryKey: string;
|
|
13
|
+
readonly sorters: readonly Sort[];
|
|
14
|
+
readonly density: 'compact' | 'comfortable';
|
|
15
|
+
readonly locale: string;
|
|
16
|
+
readonly label: string;
|
|
17
|
+
readonly scopeKey: string;
|
|
18
|
+
readonly disabled: boolean;
|
|
19
|
+
readonly onSortChange: (sorters: readonly Sort[]) => void;
|
|
20
|
+
readonly cell: Snippet<[{
|
|
21
|
+
id: string | number;
|
|
22
|
+
field: string;
|
|
23
|
+
}]>;
|
|
24
|
+
readonly controls: Snippet;
|
|
25
|
+
readonly after: Snippet;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
import { useCan, useTranslation, useExport, useResourceContract } from '@svadmin/core';
|
|
3
|
+
import { useCan, useTranslation, useExport, useResourceContract, type TaskProvider, type ExportFormat, type Filter, type Sort } from '@svadmin/core';
|
|
4
4
|
import { definedReactiveOptions } from '@svadmin/core/options';
|
|
5
5
|
import { Button } from '../ui/button/index.js';
|
|
6
6
|
import { Download } from '@lucide/svelte';
|
|
@@ -14,6 +14,16 @@
|
|
|
14
14
|
children,
|
|
15
15
|
hideText = false,
|
|
16
16
|
accessControl = { enabled: true, hideIfUnauthorized: true },
|
|
17
|
+
taskName,
|
|
18
|
+
taskProvider,
|
|
19
|
+
taskIdempotencyKey,
|
|
20
|
+
initialTaskId,
|
|
21
|
+
onTaskSubmitted,
|
|
22
|
+
filters,
|
|
23
|
+
sorters,
|
|
24
|
+
maxItemCount,
|
|
25
|
+
format = 'csv',
|
|
26
|
+
meta,
|
|
17
27
|
class: className = '',
|
|
18
28
|
} = $props<{
|
|
19
29
|
resource: string;
|
|
@@ -21,15 +31,20 @@
|
|
|
21
31
|
children?: Snippet;
|
|
22
32
|
hideText?: boolean;
|
|
23
33
|
accessControl?: ButtonAccessControl;
|
|
34
|
+
taskName?: string;
|
|
35
|
+
taskProvider?: TaskProvider;
|
|
36
|
+
taskIdempotencyKey?: string;
|
|
37
|
+
initialTaskId?: string;
|
|
38
|
+
onTaskSubmitted?: (taskId: string) => void | Promise<void>;
|
|
39
|
+
filters?: Filter[];
|
|
40
|
+
sorters?: Sort[];
|
|
41
|
+
maxItemCount?: number;
|
|
42
|
+
format?: ExportFormat;
|
|
43
|
+
meta?: Record<string, unknown>;
|
|
24
44
|
class?: string;
|
|
25
45
|
}>();
|
|
26
46
|
|
|
27
47
|
const binding = useResourceContract(() => resource);
|
|
28
|
-
const exporter = useExport(definedReactiveOptions({
|
|
29
|
-
get resource() { return binding.resource; },
|
|
30
|
-
get dataProviderName() { return binding.dataProviderName; },
|
|
31
|
-
get meta() { return binding.meta; },
|
|
32
|
-
}));
|
|
33
48
|
const can = useCan(() => ({
|
|
34
49
|
resource,
|
|
35
50
|
action: 'export',
|
|
@@ -37,11 +52,40 @@
|
|
|
37
52
|
meta: accessControl?.meta,
|
|
38
53
|
queryOptions: { enabled: accessControl?.enabled ?? true }
|
|
39
54
|
}));
|
|
55
|
+
const exporter = useExport(definedReactiveOptions({
|
|
56
|
+
get resource() { return binding.resource; },
|
|
57
|
+
get dataProviderName() { return binding.dataProviderName; },
|
|
58
|
+
get taskName() { return taskName; },
|
|
59
|
+
get taskProvider() { return taskProvider; },
|
|
60
|
+
get taskIdempotencyKey() { return taskIdempotencyKey; },
|
|
61
|
+
get initialTaskId() { return initialTaskId; },
|
|
62
|
+
get onTaskSubmitted() { return onTaskSubmitted; },
|
|
63
|
+
get filters() { return filters; },
|
|
64
|
+
get sorters() { return sorters; },
|
|
65
|
+
get maxItemCount() { return maxItemCount; },
|
|
66
|
+
get format() { return format; },
|
|
67
|
+
get meta() { return meta ?? binding.meta; },
|
|
68
|
+
get enabled() { return can.allowed; },
|
|
69
|
+
}));
|
|
40
70
|
const hidden = $derived(accessControl?.hideIfUnauthorized && !can.allowed);
|
|
41
|
-
const
|
|
71
|
+
const taskDownloadReady = $derived(exporter.artifact !== undefined);
|
|
72
|
+
const busy = $derived(exporter.isLoading || (exporter.isTaskPending && !exporter.taskError));
|
|
73
|
+
const displayText = $derived(taskDownloadReady ? i18n.t('common.download')
|
|
74
|
+
: exporter.taskError ? i18n.t('common.retry')
|
|
75
|
+
: exporter.taskId && exporter.error ? i18n.t('common.error')
|
|
76
|
+
: exporter.taskId && !exporter.isTaskPending ? i18n.t('task.status.cancelled')
|
|
77
|
+
: busy ? i18n.t('common.processing') : label ?? i18n.t('common.export'));
|
|
42
78
|
|
|
43
79
|
async function exportRecords() {
|
|
44
|
-
if (!can.allowed ||
|
|
80
|
+
if (!can.allowed || busy) return;
|
|
81
|
+
if (exporter.taskError) {
|
|
82
|
+
try { await exporter.refetchTask(); } catch { /* 查询错误由 hook 暴露。 */ }
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (taskDownloadReady) {
|
|
86
|
+
exporter.downloadTask();
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
45
89
|
try { await exporter.triggerExport(); }
|
|
46
90
|
catch {
|
|
47
91
|
// The hook exposes a sanitized error; stale-scope cancellations remain silent.
|
|
@@ -55,14 +99,14 @@
|
|
|
55
99
|
size={hideText ? 'icon' : 'sm'}
|
|
56
100
|
class={className}
|
|
57
101
|
aria-label={hideText ? displayText : undefined}
|
|
58
|
-
disabled={
|
|
59
|
-
aria-busy={
|
|
102
|
+
disabled={busy || !can.allowed || (!!exporter.taskId && !taskDownloadReady && !exporter.taskError)}
|
|
103
|
+
aria-busy={busy}
|
|
60
104
|
onclick={exportRecords}
|
|
61
105
|
>
|
|
62
106
|
<Download class="svadmin-u-11e59c6d5f6b svadmin-u-dc7972ebf3f3" />
|
|
63
107
|
{#if !hideText}
|
|
64
108
|
<span class="svadmin-u-f58b02572ab2">
|
|
65
|
-
{#if children}
|
|
109
|
+
{#if children && !taskName}
|
|
66
110
|
{@render children()}
|
|
67
111
|
{:else}
|
|
68
112
|
{displayText}
|
|
@@ -70,7 +114,7 @@
|
|
|
70
114
|
</span>
|
|
71
115
|
{/if}
|
|
72
116
|
</Button>
|
|
73
|
-
{#if exporter.error}
|
|
117
|
+
{#if exporter.error || exporter.taskError}
|
|
74
118
|
<p role="alert">{i18n.t('common.error')}</p>
|
|
75
119
|
{/if}
|
|
76
120
|
{/if}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
+
import { type TaskProvider, type ExportFormat, type Filter, type Sort } from '@svadmin/core';
|
|
2
3
|
import type { ButtonAccessControl } from './access-control';
|
|
3
4
|
type $$ComponentProps = {
|
|
4
5
|
resource: string;
|
|
@@ -6,6 +7,16 @@ type $$ComponentProps = {
|
|
|
6
7
|
children?: Snippet;
|
|
7
8
|
hideText?: boolean;
|
|
8
9
|
accessControl?: ButtonAccessControl;
|
|
10
|
+
taskName?: string;
|
|
11
|
+
taskProvider?: TaskProvider;
|
|
12
|
+
taskIdempotencyKey?: string;
|
|
13
|
+
initialTaskId?: string;
|
|
14
|
+
onTaskSubmitted?: (taskId: string) => void | Promise<void>;
|
|
15
|
+
filters?: Filter[];
|
|
16
|
+
sorters?: Sort[];
|
|
17
|
+
maxItemCount?: number;
|
|
18
|
+
format?: ExportFormat;
|
|
19
|
+
meta?: Record<string, unknown>;
|
|
9
20
|
class?: string;
|
|
10
21
|
};
|
|
11
22
|
declare const ExportButton: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
+
import { contentHeaderRecipe as contentHeader } from '../../recipes.js';
|
|
4
|
+
|
|
3
5
|
interface Props {
|
|
4
6
|
title: string;
|
|
5
7
|
eyebrow?: string;
|
|
@@ -9,23 +11,24 @@
|
|
|
9
11
|
class?: string;
|
|
10
12
|
}
|
|
11
13
|
let { title, eyebrow, description, breadcrumbs = [], actions, class: className = '' }: Props = $props();
|
|
14
|
+
const styles = contentHeader();
|
|
12
15
|
</script>
|
|
13
16
|
|
|
14
|
-
<header class={'
|
|
17
|
+
<header class={styles.root + ' ' + className} data-svadmin-page-header>
|
|
15
18
|
{#if breadcrumbs.length > 0}
|
|
16
|
-
<nav aria-label="Breadcrumb" class=
|
|
19
|
+
<nav aria-label="Breadcrumb" class={styles.breadcrumbs}>
|
|
17
20
|
{#each breadcrumbs as crumb, index (crumb)}
|
|
18
21
|
{#if index > 0}<span aria-hidden="true">/</span>{/if}
|
|
19
|
-
<span class={index === breadcrumbs.length - 1 ?
|
|
22
|
+
<span class={index === breadcrumbs.length - 1 ? styles.currentCrumb : ''}>{crumb}</span>
|
|
20
23
|
{/each}
|
|
21
24
|
</nav>
|
|
22
25
|
{/if}
|
|
23
|
-
<div class=
|
|
24
|
-
<div class=
|
|
25
|
-
{#if eyebrow}<p class=
|
|
26
|
-
<h1 class=
|
|
27
|
-
{#if description}<p class=
|
|
26
|
+
<div class={styles.row}>
|
|
27
|
+
<div class={styles.heading}>
|
|
28
|
+
{#if eyebrow}<p class={styles.eyebrow}>{eyebrow}</p>{/if}
|
|
29
|
+
<h1 class={styles.title}>{title}</h1>
|
|
30
|
+
{#if description}<p class={styles.description}>{description}</p>{/if}
|
|
28
31
|
</div>
|
|
29
|
-
{#if actions}<div class=
|
|
32
|
+
{#if actions}<div class={styles.actions}>{@render actions()}</div>{/if}
|
|
30
33
|
</div>
|
|
31
34
|
</header>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { definedOptions } from '@svadmin/core/options';
|
|
3
|
-
|
|
4
3
|
import type { Snippet } from 'svelte';
|
|
4
|
+
import { contentPageRecipe as contentPage } from '../../recipes.js';
|
|
5
5
|
import ContentPageHeader from './ContentPageHeader.svelte';
|
|
6
6
|
|
|
7
7
|
interface Props {
|
|
@@ -26,16 +26,13 @@
|
|
|
26
26
|
class: className = '',
|
|
27
27
|
}: Props = $props();
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
? 'max-w-[92rem]'
|
|
34
|
-
: 'max-w-[74rem]',
|
|
35
|
-
);
|
|
29
|
+
// 保留旧组件对非窄屏/宽屏输入的默认宽度回退。
|
|
30
|
+
const styles = $derived(contentPage({
|
|
31
|
+
width: width === 'narrow' || width === 'wide' ? width : 'default',
|
|
32
|
+
}));
|
|
36
33
|
</script>
|
|
37
34
|
|
|
38
|
-
<div data-svadmin-content-page={pageId} class={
|
|
35
|
+
<div data-svadmin-content-page={pageId} class={styles.root + ' ' + className}>
|
|
39
36
|
{#if title}<ContentPageHeader {title} {...definedOptions({ "eyebrow": eyebrow })} {...definedOptions({ "description": description })} {...definedOptions({ "actions": actions })} />{/if}
|
|
40
37
|
{@render children()}
|
|
41
38
|
</div>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import type { ComponentProps } from 'svelte';
|
|
3
|
+
import { Filemanager, Willow } from '@svar-ui/svelte-filemanager';
|
|
4
|
+
import { Locale } from '@svar-ui/svelte-core';
|
|
5
|
+
|
|
6
|
+
export type FileBrowserData = ComponentProps<typeof Filemanager>['data'];
|
|
7
|
+
export type FileBrowserInit = ComponentProps<typeof Filemanager>['init'];
|
|
8
|
+
export type FileBrowserMenuOptions = ComponentProps<typeof Filemanager>['menuOptions'];
|
|
9
|
+
export type FileBrowserProps = ComponentProps<typeof Filemanager> & {
|
|
10
|
+
words?: ComponentProps<typeof Locale>['words'];
|
|
11
|
+
fonts?: boolean;
|
|
12
|
+
class?: string;
|
|
13
|
+
};
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<script lang="ts">
|
|
17
|
+
let {
|
|
18
|
+
words, fonts = false, class: className = '',
|
|
19
|
+
mode = 'table', icons = 'simple', readonly = true,
|
|
20
|
+
...managerProps
|
|
21
|
+
}: FileBrowserProps = $props();
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<div class={'svadmin-file-browser ' + className} data-slot="file-browser">
|
|
25
|
+
<Willow {fonts}>
|
|
26
|
+
<Locale words={words ?? {}}>
|
|
27
|
+
<Filemanager {...managerProps} {mode} {icons} {readonly} />
|
|
28
|
+
</Locale>
|
|
29
|
+
</Willow>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<style>
|
|
33
|
+
.svadmin-file-browser { height: 32rem; min-width: 0; max-width: 100%; overflow: hidden; }
|
|
34
|
+
.svadmin-file-browser :global(.wx-willow-theme) { --wx-font-family: inherit; --wx-fm-box-shadow: none; }
|
|
35
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentProps } from 'svelte';
|
|
2
|
+
import { Filemanager } from '@svar-ui/svelte-filemanager';
|
|
3
|
+
import { Locale } from '@svar-ui/svelte-core';
|
|
4
|
+
export type FileBrowserData = ComponentProps<typeof Filemanager>['data'];
|
|
5
|
+
export type FileBrowserInit = ComponentProps<typeof Filemanager>['init'];
|
|
6
|
+
export type FileBrowserMenuOptions = ComponentProps<typeof Filemanager>['menuOptions'];
|
|
7
|
+
export type FileBrowserProps = ComponentProps<typeof Filemanager> & {
|
|
8
|
+
words?: ComponentProps<typeof Locale>['words'];
|
|
9
|
+
fonts?: boolean;
|
|
10
|
+
class?: string;
|
|
11
|
+
};
|
|
12
|
+
declare const FileBrowser: import("svelte").Component<FileBrowserProps, {}, "">;
|
|
13
|
+
type FileBrowser = ReturnType<typeof FileBrowser>;
|
|
14
|
+
export default FileBrowser;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
+
import { metricBlockRecipe as metricBlock } from '../../recipes.js';
|
|
3
4
|
import { Skeleton } from '../ui/skeleton/index.js';
|
|
5
|
+
|
|
4
6
|
export type MetricTrendTone = 'positive' | 'negative' | 'warning' | 'neutral';
|
|
5
7
|
interface Props {
|
|
6
8
|
label: string;
|
|
@@ -22,23 +24,18 @@
|
|
|
22
24
|
loading = false,
|
|
23
25
|
class: className = '',
|
|
24
26
|
}: Props = $props();
|
|
25
|
-
const
|
|
26
|
-
positive: 'text-success',
|
|
27
|
-
negative: 'text-destructive',
|
|
28
|
-
warning: 'text-warning-foreground',
|
|
29
|
-
neutral: 'text-muted-foreground',
|
|
30
|
-
};
|
|
27
|
+
const styles = $derived(metricBlock({ trendTone }));
|
|
31
28
|
</script>
|
|
32
29
|
|
|
33
|
-
<div data-svadmin-metric-card role="region" aria-label={label} class={
|
|
34
|
-
<div class=
|
|
35
|
-
<p class=
|
|
36
|
-
{#if icon}<span class=
|
|
30
|
+
<div data-svadmin-metric-card role="region" aria-label={label} class={styles.root + ' ' + className}>
|
|
31
|
+
<div class={styles.header}>
|
|
32
|
+
<p class={styles.label}>{label}</p>
|
|
33
|
+
{#if icon}<span class={styles.icon} aria-hidden="true">{@render icon()}</span>{/if}
|
|
37
34
|
</div>
|
|
38
35
|
{#if loading}
|
|
39
|
-
<Skeleton class=
|
|
36
|
+
<Skeleton class={styles.skeleton} />
|
|
40
37
|
{:else}
|
|
41
|
-
<p class=
|
|
42
|
-
{#if detail || trend}<div class=
|
|
38
|
+
<p class={styles.value}>{value}</p>
|
|
39
|
+
{#if detail || trend}<div class={styles.meta}>{#if trend}<span class={styles.trend}>{trend}</span>{/if}{#if detail}<span class={styles.detail}>{detail}</span>{/if}</div>{/if}
|
|
43
40
|
{/if}
|
|
44
41
|
</div>
|
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
import DataState from './DataState.svelte';
|
|
7
7
|
import type { DataStateKind } from './DataState.svelte';
|
|
8
8
|
import type { NetworkColumn } from './NetworkTable.types.js';
|
|
9
|
-
interface Props { rows?: T[]; columns: NetworkColumn<T>[]; row?: Snippet<[T]>; state?: DataStateKind; stateTitle?: string; stateDescription?: string; emptyTitle?: string; emptyDescription?: string; retry?: () => void; retryLabel?: string; loadingLabel?: string; class?: string; }
|
|
10
|
-
let { rows = [], columns, row, state, stateTitle, stateDescription, emptyTitle, emptyDescription, retry, retryLabel, loadingLabel, class: className = '' }: Props = $props();
|
|
9
|
+
interface Props { rows?: T[]; columns: NetworkColumn<T>[]; row?: Snippet<[T]>; state?: DataStateKind; stateTitle?: string; stateDescription?: string; emptyTitle?: string; emptyDescription?: string; retry?: () => void; retryLabel?: string; loadingLabel?: string; class?: string; density?: 'comfortable' | 'compact'; }
|
|
10
|
+
let { rows = [], columns, row, state, stateTitle, stateDescription, emptyTitle, emptyDescription, retry, retryLabel, loadingLabel, class: className = '', density = 'comfortable' }: Props = $props();
|
|
11
11
|
const resolvedState = $derived(state ?? (rows.length === 0 ? 'empty' : undefined));
|
|
12
12
|
</script>
|
|
13
13
|
{#if resolvedState}
|
|
14
14
|
<DataState state={resolvedState} {...definedOptions({ title: stateTitle ?? emptyTitle, description: stateDescription ?? emptyDescription, retry, retryLabel, loadingLabel })} class={className} />
|
|
15
15
|
{:else}
|
|
16
16
|
<div class={'svadmin-u-1384f66f41d0 svadmin-u-5f22e64f2282 svadmin-u-ca6bcd4b6f3f svadmin-u-18049387f0af svadmin-u-cd0ad9a56558 ' + className}>
|
|
17
|
-
<Table.Root data-svadmin-datatable>
|
|
17
|
+
<Table.Root {density} data-svadmin-datatable>
|
|
18
18
|
<Table.Header data-svadmin-table-head><Table.Row>{#each columns as column (String(column.key))}<Table.Head>{column.label}</Table.Head>{/each}</Table.Row></Table.Header>
|
|
19
19
|
<Table.Body>
|
|
20
20
|
{#each rows as item, index (String('id' in item ? item.id : index))}
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
trailing?: Snippet;
|
|
6
|
-
children?: Snippet;
|
|
7
|
-
class?: string;
|
|
8
|
-
}
|
|
3
|
+
import { productToolbarRecipe as productToolbar } from '../../recipes.js';
|
|
4
|
+
interface Props { leading?: Snippet; trailing?: Snippet; children?: Snippet; class?: string; }
|
|
9
5
|
let { leading, trailing, children, class: className = '' }: Props = $props();
|
|
6
|
+
const styles = productToolbar();
|
|
10
7
|
</script>
|
|
11
|
-
|
|
12
|
-
<div
|
|
13
|
-
<div class="svadmin-u-60fbb7713999 svadmin-u-7e0b7cdf1a94 svadmin-u-36e579c0b41c svadmin-u-1eb5c6df38c1 svadmin-u-3960ffc248d9 svadmin-u-77a2a20e90d4">
|
|
8
|
+
<div data-svadmin-table-toolbar class={styles.root + ' ' + className}>
|
|
9
|
+
<div class={styles.leading}>
|
|
14
10
|
{#if leading}{@render leading()}{/if}
|
|
15
11
|
{#if children}{@render children()}{/if}
|
|
16
12
|
</div>
|
|
17
|
-
{#if trailing}<div class=
|
|
13
|
+
{#if trailing}<div class={styles.trailing}>{@render trailing()}</div>{/if}
|
|
18
14
|
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { useTranslation } from '@svadmin/core/i18n';
|
|
3
|
+
const i18n = useTranslation();
|
|
4
|
+
</script>
|
|
5
|
+
<p role="note">{i18n.locale === 'zh-CN' ? '示例资料,不代表当前账户或组织。连接状态仅在本页演示,导出只包含示例数据。' : 'Sample content, not your current account or organization. Connection changes are local previews; exports contain sample data only.'}</p>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const ReferenceNotice: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type ReferenceNotice = InstanceType<typeof ReferenceNotice>;
|
|
18
|
+
export default ReferenceNotice;
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
description?: string;
|
|
6
|
-
actions?: Snippet;
|
|
7
|
-
id?: string;
|
|
8
|
-
class?: string;
|
|
9
|
-
}
|
|
3
|
+
import { productSectionRecipe as productSection } from '../../recipes.js';
|
|
4
|
+
interface Props { title: string; description?: string; actions?: Snippet; id?: string; class?: string; }
|
|
10
5
|
let { title, description, actions, id, class: className = '' }: Props = $props();
|
|
6
|
+
const styles = productSection();
|
|
11
7
|
</script>
|
|
12
|
-
|
|
13
|
-
<div class={
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
{#if description}<p class="svadmin-u-fc7473ca09eb svadmin-u-bfa603190748">{description}</p>{/if}
|
|
8
|
+
<div class={styles.root + ' ' + className} data-svadmin-section-header>
|
|
9
|
+
<div class={styles.heading}>
|
|
10
|
+
<h2 {id} class={styles.title}>{title}</h2>
|
|
11
|
+
{#if description}<p class={styles.description}>{description}</p>{/if}
|
|
17
12
|
</div>
|
|
18
|
-
{#if actions}<div class=
|
|
13
|
+
{#if actions}<div class={styles.actions}>{@render actions()}</div>{/if}
|
|
19
14
|
</div>
|
|
@@ -1,28 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
description?: string;
|
|
8
|
-
control: Snippet;
|
|
9
|
-
separated?: boolean;
|
|
10
|
-
class?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
let {
|
|
14
|
-
label,
|
|
15
|
-
description,
|
|
16
|
-
control,
|
|
17
|
-
separated = false,
|
|
18
|
-
class: className = '',
|
|
19
|
-
}: Props = $props();
|
|
3
|
+
import { productSettingsRowRecipe as productSettingsRow } from '../../recipes.js';
|
|
4
|
+
interface Props { label: string; description?: string; control: Snippet; separated?: boolean; class?: string; }
|
|
5
|
+
let { label, description, control, separated = false, class: className = '' }: Props = $props();
|
|
6
|
+
const styles = $derived(productSettingsRow({ separated }));
|
|
20
7
|
</script>
|
|
21
|
-
|
|
22
|
-
<div class={
|
|
23
|
-
|
|
24
|
-
<p class=
|
|
25
|
-
{#if description}<p class="svadmin-u-b6b02c0ebef6 svadmin-u-2cc8041eca99 svadmin-u-fc7473ca09eb svadmin-u-7054e2767710 svadmin-u-bfa603190748">{description}</p>{/if}
|
|
8
|
+
<div class={styles.root + ' ' + className} data-svadmin-settings-field-row>
|
|
9
|
+
<div class={styles.heading}>
|
|
10
|
+
<p class={styles.label}>{label}</p>
|
|
11
|
+
{#if description}<p class={styles.description}>{description}</p>{/if}
|
|
26
12
|
</div>
|
|
27
|
-
<div class=
|
|
13
|
+
<div class={styles.control}>{@render control()}</div>
|
|
28
14
|
</div>
|