@svadmin/ui 0.116.0 → 0.118.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.
Files changed (61) hide show
  1. package/dist/app.css +320 -26
  2. package/dist/app.theme.css +320 -26
  3. package/dist/components/AboutSettings.svelte +1 -1
  4. package/dist/components/ApprovalTimeline.svelte +170 -0
  5. package/dist/components/ApprovalTimeline.svelte.d.ts +26 -0
  6. package/dist/components/CopyableText.svelte +90 -0
  7. package/dist/components/CopyableText.svelte.d.ts +13 -0
  8. package/dist/components/Divider.svelte +89 -0
  9. package/dist/components/Divider.svelte.d.ts +19 -0
  10. package/dist/components/EllipsisText.svelte +78 -0
  11. package/dist/components/EllipsisText.svelte.d.ts +15 -0
  12. package/dist/components/ExcelExportButton.svelte +142 -0
  13. package/dist/components/ExcelExportButton.svelte.d.ts +21 -0
  14. package/dist/components/ExcelImportWizard.svelte +571 -0
  15. package/dist/components/ExcelImportWizard.svelte.d.ts +26 -0
  16. package/dist/components/FloatButtonGroup.svelte +162 -0
  17. package/dist/components/FloatButtonGroup.svelte.d.ts +34 -0
  18. package/dist/components/FullscreenButton.svelte +88 -0
  19. package/dist/components/FullscreenButton.svelte.d.ts +10 -0
  20. package/dist/components/GlobalShortcuts.svelte +229 -0
  21. package/dist/components/GlobalShortcuts.svelte.d.ts +18 -0
  22. package/dist/components/Header.svelte +17 -1
  23. package/dist/components/Header.svelte.d.ts +3 -0
  24. package/dist/components/Layout.svelte +3 -0
  25. package/dist/components/Layout.svelte.d.ts +1 -0
  26. package/dist/components/LightFilter.svelte +281 -0
  27. package/dist/components/LightFilter.svelte.d.ts +36 -0
  28. package/dist/components/LockScreen.svelte +295 -0
  29. package/dist/components/LockScreen.svelte.d.ts +21 -0
  30. package/dist/components/OrgTreePicker.svelte +325 -0
  31. package/dist/components/OrgTreePicker.svelte.d.ts +32 -0
  32. package/dist/components/PivotDrilldownModal.svelte +228 -0
  33. package/dist/components/PivotDrilldownModal.svelte.d.ts +22 -0
  34. package/dist/components/PricingCard.svelte +12 -12
  35. package/dist/components/PricingCard.svelte.d.ts +12 -12
  36. package/dist/components/PricingTable.svelte +185 -0
  37. package/dist/components/PricingTable.svelte.d.ts +40 -0
  38. package/dist/components/ProCard.svelte +267 -0
  39. package/dist/components/ProCard.svelte.d.ts +56 -0
  40. package/dist/components/ProSkeleton.svelte +186 -0
  41. package/dist/components/ProSkeleton.svelte.d.ts +20 -0
  42. package/dist/components/QuotaProgressBar.svelte +8 -8
  43. package/dist/components/QuotaProgressBar.svelte.d.ts +8 -8
  44. package/dist/components/Ribbon.svelte +97 -0
  45. package/dist/components/Ribbon.svelte.d.ts +19 -0
  46. package/dist/components/TreeTransfer.svelte +288 -0
  47. package/dist/components/TreeTransfer.svelte.d.ts +25 -0
  48. package/dist/components/TypographyEllipsis.svelte +12 -9
  49. package/dist/components/TypographyEllipsis.svelte.d.ts +9 -8
  50. package/dist/components/TypographyText.svelte +41 -3
  51. package/dist/components/TypographyText.svelte.d.ts +10 -2
  52. package/dist/components/UsageCard.svelte +97 -0
  53. package/dist/components/UsageCard.svelte.d.ts +26 -0
  54. package/dist/components/WorkflowProcessCard.svelte +93 -0
  55. package/dist/components/WorkflowProcessCard.svelte.d.ts +21 -0
  56. package/dist/components/ui/badge/badge.svelte +156 -12
  57. package/dist/components/ui/badge/badge.svelte.d.ts +9 -0
  58. package/dist/components/ui/badge/index.d.ts +1 -1
  59. package/dist/index.d.ts +44 -3
  60. package/dist/index.js +28 -2
  61. package/package.json +5 -5
@@ -0,0 +1,162 @@
1
+ <script lang="ts">
2
+ import { onMount, type Snippet } from 'svelte';
3
+ import { Plus, X } from '@lucide/svelte';
4
+ import { cn } from '../utils.js';
5
+
6
+ export type FloatButtonPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
7
+ export type FloatButtonShape = 'circle' | 'square';
8
+
9
+ export interface FloatButtonGroupProps {
10
+ /** Trigger mode to open the button group */
11
+ trigger?: 'click' | 'hover';
12
+ /** Two-way bindable open state */
13
+ open?: boolean;
14
+ /** Default open state */
15
+ defaultOpen?: boolean;
16
+ /** Shape of the main button */
17
+ shape?: FloatButtonShape;
18
+ /** Screen corner position */
19
+ position?: FloatButtonPosition;
20
+ /** Primary button style */
21
+ type?: 'default' | 'primary';
22
+ /** Custom main icon snippet */
23
+ icon?: Snippet;
24
+ /** Custom close icon snippet */
25
+ closeIcon?: Snippet;
26
+ /** Tooltip hint */
27
+ tooltip?: string;
28
+ /** Accessible label */
29
+ ariaLabel?: string;
30
+ /** Additional CSS classes */
31
+ class?: string;
32
+ /** Child buttons slot */
33
+ children?: Snippet;
34
+ /** Callback when open state changes */
35
+ onopenchange?: (open: boolean) => void;
36
+ }
37
+
38
+ let {
39
+ trigger = 'click',
40
+ defaultOpen = false,
41
+ open = $bindable(defaultOpen),
42
+ shape = 'circle',
43
+ position = 'bottom-right',
44
+ type = 'primary',
45
+ icon,
46
+ closeIcon,
47
+ tooltip,
48
+ ariaLabel = 'Floating Action Menu',
49
+ class: className = '',
50
+ children,
51
+ onopenchange,
52
+ }: FloatButtonGroupProps = $props();
53
+
54
+ let containerEl: HTMLElement | null = $state(null);
55
+
56
+ function setOpen(next: boolean) {
57
+ if (open === next) return;
58
+ open = next;
59
+ onopenchange?.(next);
60
+ }
61
+
62
+ function toggle() {
63
+ setOpen(!open);
64
+ }
65
+
66
+ function handleMouseEnter() {
67
+ if (trigger === 'hover') {
68
+ setOpen(true);
69
+ }
70
+ }
71
+
72
+ function handleMouseLeave() {
73
+ if (trigger === 'hover') {
74
+ setOpen(false);
75
+ }
76
+ }
77
+
78
+ onMount(() => {
79
+ function handleClickOutside(event: MouseEvent) {
80
+ if (trigger === 'click' && open && containerEl && !containerEl.contains(event.target as Node)) {
81
+ setOpen(false);
82
+ }
83
+ }
84
+
85
+ document.addEventListener('mousedown', handleClickOutside);
86
+ return () => {
87
+ document.removeEventListener('mousedown', handleClickOutside);
88
+ };
89
+ });
90
+
91
+ const positionClasses: Record<FloatButtonPosition, string> = {
92
+ 'bottom-right': 'bottom-6 right-6 flex-col-reverse',
93
+ 'bottom-left': 'bottom-6 left-6 flex-col-reverse',
94
+ 'top-right': 'top-6 right-6 flex-col',
95
+ 'top-left': 'top-6 left-6 flex-col',
96
+ };
97
+ </script>
98
+
99
+ <div
100
+ bind:this={containerEl}
101
+ data-svadmin-component="FloatButtonGroup"
102
+ data-position={position}
103
+ data-open={open}
104
+ class={cn(
105
+ 'fixed z-60 inline-flex items-center gap-2.5 transition-all select-none',
106
+ positionClasses[position],
107
+ className,
108
+ )}
109
+ onmouseenter={handleMouseEnter}
110
+ onmouseleave={handleMouseLeave}
111
+ role="region"
112
+ aria-label={ariaLabel}
113
+ >
114
+ <!-- Main Trigger Button -->
115
+ <button
116
+ type="button"
117
+ onclick={trigger === 'click' ? toggle : undefined}
118
+ aria-expanded={open}
119
+ aria-label={ariaLabel}
120
+ title={tooltip}
121
+ class={cn(
122
+ 'relative flex h-11 w-11 items-center justify-center border shadow-md transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
123
+ shape === 'circle' ? 'rounded-full' : 'rounded-lg',
124
+ type === 'primary'
125
+ ? 'border-primary bg-primary text-primary-foreground hover:bg-primary/90'
126
+ : 'border-border bg-card text-foreground hover:bg-accent hover:text-accent-foreground',
127
+ )}
128
+ >
129
+ <div
130
+ class={cn(
131
+ 'flex items-center justify-center transition-transform duration-200',
132
+ open && 'rotate-90',
133
+ )}
134
+ >
135
+ {#if open}
136
+ {#if closeIcon}
137
+ {@render closeIcon()}
138
+ {:else}
139
+ <X size={20} />
140
+ {/if}
141
+ {:else}
142
+ {#if icon}
143
+ {@render icon()}
144
+ {:else}
145
+ <Plus size={20} />
146
+ {/if}
147
+ {/if}
148
+ </div>
149
+ </button>
150
+
151
+ <!-- Child Buttons List -->
152
+ {#if open && children}
153
+ <div
154
+ class={cn(
155
+ 'flex items-center gap-2 transition-all animate-in fade-in-0 zoom-in-95 duration-150',
156
+ position.startsWith('bottom') ? 'flex-col-reverse' : 'flex-col',
157
+ )}
158
+ >
159
+ {@render children()}
160
+ </div>
161
+ {/if}
162
+ </div>
@@ -0,0 +1,34 @@
1
+ import { type Snippet } from 'svelte';
2
+ export type FloatButtonPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
3
+ export type FloatButtonShape = 'circle' | 'square';
4
+ export interface FloatButtonGroupProps {
5
+ /** Trigger mode to open the button group */
6
+ trigger?: 'click' | 'hover';
7
+ /** Two-way bindable open state */
8
+ open?: boolean;
9
+ /** Default open state */
10
+ defaultOpen?: boolean;
11
+ /** Shape of the main button */
12
+ shape?: FloatButtonShape;
13
+ /** Screen corner position */
14
+ position?: FloatButtonPosition;
15
+ /** Primary button style */
16
+ type?: 'default' | 'primary';
17
+ /** Custom main icon snippet */
18
+ icon?: Snippet;
19
+ /** Custom close icon snippet */
20
+ closeIcon?: Snippet;
21
+ /** Tooltip hint */
22
+ tooltip?: string;
23
+ /** Accessible label */
24
+ ariaLabel?: string;
25
+ /** Additional CSS classes */
26
+ class?: string;
27
+ /** Child buttons slot */
28
+ children?: Snippet;
29
+ /** Callback when open state changes */
30
+ onopenchange?: (open: boolean) => void;
31
+ }
32
+ declare const FloatButtonGroup: import("svelte").Component<FloatButtonGroupProps, {}, "open">;
33
+ type FloatButtonGroup = ReturnType<typeof FloatButtonGroup>;
34
+ export default FloatButtonGroup;
@@ -0,0 +1,88 @@
1
+ <script lang="ts">
2
+ import { onMount } from 'svelte';
3
+ import { Maximize2, Minimize2 } from '@lucide/svelte';
4
+ import { cn } from '../utils.js';
5
+ import { useTranslation } from '@svadmin/core';
6
+
7
+ const i18n = useTranslation();
8
+
9
+ export interface FullscreenButtonProps {
10
+ target?: HTMLElement | undefined;
11
+ title?: string;
12
+ class?: string;
13
+ onchange?: ((isFullscreen: boolean) => void) | undefined;
14
+ }
15
+
16
+ export type FullScreenButtonProps = FullscreenButtonProps;
17
+
18
+ let {
19
+ target,
20
+ title,
21
+ class: className = '',
22
+ onchange,
23
+ }: FullscreenButtonProps = $props();
24
+
25
+ let isFullscreen = $state(false);
26
+
27
+ function checkFullscreen(): boolean {
28
+ if (typeof document === 'undefined') return false;
29
+ return Boolean(document.fullscreenElement);
30
+ }
31
+
32
+ onMount(() => {
33
+ isFullscreen = checkFullscreen();
34
+
35
+ const handleFullscreenChange = () => {
36
+ const active = checkFullscreen();
37
+ isFullscreen = active;
38
+ onchange?.(active);
39
+ };
40
+
41
+ document.addEventListener('fullscreenchange', handleFullscreenChange);
42
+ return () => {
43
+ document.removeEventListener('fullscreenchange', handleFullscreenChange);
44
+ };
45
+ });
46
+
47
+ async function toggleFullscreen() {
48
+ if (typeof document === 'undefined') return;
49
+
50
+ try {
51
+ if (document.fullscreenElement) {
52
+ if (document.exitFullscreen) {
53
+ await document.exitFullscreen();
54
+ }
55
+ } else {
56
+ const el = target ?? document.documentElement;
57
+ if (el && el.requestFullscreen) {
58
+ await el.requestFullscreen();
59
+ }
60
+ }
61
+ } catch {
62
+ // Gracefully ignore permission or security restrictions in iframes
63
+ }
64
+ }
65
+
66
+ const tooltipText = $derived(
67
+ title ?? (isFullscreen ? i18n.t('common.exitFullscreen') : i18n.t('common.fullscreen'))
68
+ );
69
+ </script>
70
+
71
+ <button
72
+ type="button"
73
+ class={cn(
74
+ 'inline-flex h-9 w-9 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-ring',
75
+ className
76
+ )}
77
+ onclick={toggleFullscreen}
78
+ title={tooltipText}
79
+ aria-label={tooltipText}
80
+ aria-pressed={isFullscreen}
81
+ data-svadmin-component="FullscreenButton"
82
+ >
83
+ {#if isFullscreen}
84
+ <Minimize2 class="h-4 w-4" />
85
+ {:else}
86
+ <Maximize2 class="h-4 w-4" />
87
+ {/if}
88
+ </button>
@@ -0,0 +1,10 @@
1
+ export interface FullscreenButtonProps {
2
+ target?: HTMLElement | undefined;
3
+ title?: string;
4
+ class?: string;
5
+ onchange?: ((isFullscreen: boolean) => void) | undefined;
6
+ }
7
+ export type FullScreenButtonProps = FullscreenButtonProps;
8
+ declare const FullscreenButton: import("svelte").Component<FullscreenButtonProps, {}, "">;
9
+ type FullscreenButton = ReturnType<typeof FullscreenButton>;
10
+ export default FullscreenButton;
@@ -0,0 +1,229 @@
1
+ <script lang="ts">
2
+ import { onMount } from 'svelte';
3
+ import { Keyboard, Search, X } from '@lucide/svelte';
4
+ import { useTranslation } from '@svadmin/core';
5
+ import { cn } from '../utils.js';
6
+
7
+ export interface ShortcutItem {
8
+ id: string;
9
+ category: 'navigation' | 'view' | 'action' | 'system';
10
+ label: string;
11
+ keys: string[];
12
+ description?: string;
13
+ action?: () => void;
14
+ }
15
+
16
+ interface Props {
17
+ open?: boolean;
18
+ shortcuts?: ShortcutItem[];
19
+ enableBuiltins?: boolean;
20
+ class?: string;
21
+ onAction?: (shortcutId: string) => void;
22
+ }
23
+
24
+ let {
25
+ open = $bindable(false),
26
+ shortcuts = [],
27
+ enableBuiltins = true,
28
+ class: className = '',
29
+ onAction,
30
+ }: Props = $props();
31
+
32
+ const i18n = useTranslation();
33
+ let query = $state('');
34
+
35
+ const defaultShortcuts: ShortcutItem[] = [
36
+ {
37
+ id: 'command-palette',
38
+ category: 'navigation',
39
+ label: '全局搜索 / 命令面板',
40
+ keys: ['⌘ / Ctrl', 'K'],
41
+ description: '快速定位资源、页面与菜单',
42
+ },
43
+ {
44
+ id: 'toggle-lock',
45
+ category: 'system',
46
+ label: '会话安全锁屏',
47
+ keys: ['Alt', 'L'],
48
+ description: '离开工位时快速锁定当前会话',
49
+ },
50
+ {
51
+ id: 'toggle-fullscreen',
52
+ category: 'view',
53
+ label: '全屏模式切换',
54
+ keys: ['F11'],
55
+ description: '展开全屏或退出全屏',
56
+ },
57
+ {
58
+ id: 'toggle-theme',
59
+ category: 'view',
60
+ label: '切换主题外观',
61
+ keys: ['Alt', 'T'],
62
+ description: '在浅色与深色主题间切换',
63
+ },
64
+ {
65
+ id: 'shortcuts-help',
66
+ category: 'system',
67
+ label: '打开快捷键向导',
68
+ keys: ['?'],
69
+ description: '查看当前系统全部可用快捷键',
70
+ },
71
+ ];
72
+
73
+ const allShortcuts = $derived(enableBuiltins ? [...defaultShortcuts, ...shortcuts] : shortcuts);
74
+
75
+ const filteredShortcuts = $derived.by(() => {
76
+ if (!query.trim()) return allShortcuts;
77
+ const q = query.toLowerCase();
78
+ return allShortcuts.filter(
79
+ (item) =>
80
+ item.label.toLowerCase().includes(q) ||
81
+ item.description?.toLowerCase().includes(q) ||
82
+ item.keys.some((k) => k.toLowerCase().includes(q)),
83
+ );
84
+ });
85
+
86
+ const categories: Record<string, string> = {
87
+ navigation: '导航与检索',
88
+ view: '视图与外观',
89
+ action: '数据操作',
90
+ system: '系统安全',
91
+ };
92
+
93
+ const groupedShortcuts = $derived.by(() => {
94
+ const groups: Record<string, ShortcutItem[]> = {};
95
+ for (const item of filteredShortcuts) {
96
+ const group = groups[item.category] ?? (groups[item.category] = []);
97
+ group.push(item);
98
+ }
99
+ return groups;
100
+ });
101
+
102
+ function handleKeydown(event: KeyboardEvent) {
103
+ const target = event.target as HTMLElement | null;
104
+ const isEditing = target && (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable);
105
+
106
+ // 按 ? (Shift + /) 且非编辑状态唤出帮助面板
107
+ if (event.key === '?' && !isEditing) {
108
+ event.preventDefault();
109
+ open = !open;
110
+ return;
111
+ }
112
+
113
+ // Cmd + / 或 Ctrl + /
114
+ if ((event.metaKey || event.ctrlKey) && event.key === '/') {
115
+ event.preventDefault();
116
+ open = !open;
117
+ return;
118
+ }
119
+
120
+ if (open && event.key === 'Escape') {
121
+ event.preventDefault();
122
+ open = false;
123
+ }
124
+ }
125
+
126
+ function triggerItem(item: ShortcutItem) {
127
+ item.action?.();
128
+ onAction?.(item.id);
129
+ }
130
+
131
+ onMount(() => {
132
+ window.addEventListener('keydown', handleKeydown);
133
+ return () => {
134
+ window.removeEventListener('keydown', handleKeydown);
135
+ };
136
+ });
137
+ </script>
138
+
139
+ {#if open}
140
+ <div
141
+ data-svadmin-component="global-shortcuts"
142
+ class="fixed inset-0 z-50 flex items-center justify-center bg-background/80 p-4 backdrop-blur-xs select-none"
143
+ role="dialog"
144
+ aria-modal="true"
145
+ aria-label={i18n.t('common.shortcutsHelp')}
146
+ >
147
+ <div
148
+ class={cn(
149
+ 'relative flex flex-col w-full max-w-xl max-h-[85vh] rounded-xl border border-border bg-card text-card-foreground shadow-2xl overflow-hidden',
150
+ className,
151
+ )}
152
+ >
153
+ <!-- 头部 -->
154
+ <div class="flex items-center justify-between border-b border-border px-6 py-4">
155
+ <div class="flex items-center gap-2">
156
+ <Keyboard class="h-5 w-5 text-primary" />
157
+ <h2 class="text-base font-semibold">{i18n.t('common.shortcutsHelp')}</h2>
158
+ </div>
159
+ <button
160
+ type="button"
161
+ class="rounded-md p-1.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground"
162
+ onclick={() => (open = false)}
163
+ aria-label="Close"
164
+ >
165
+ <X size={16} />
166
+ </button>
167
+ </div>
168
+
169
+ <!-- 搜索过滤栏 -->
170
+ <div class="px-6 py-3 border-b border-border/50 bg-muted/30">
171
+ <div class="relative flex items-center">
172
+ <Search size={16} class="absolute left-3 text-muted-foreground pointer-events-none" />
173
+ <input
174
+ type="text"
175
+ bind:value={query}
176
+ placeholder="搜索快捷键..."
177
+ class="flex h-9 w-full rounded-md border border-input bg-background pl-9 pr-3 py-1 text-sm shadow-2xs placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring"
178
+ />
179
+ </div>
180
+ </div>
181
+
182
+ <!-- 快捷键列表 -->
183
+ <div class="flex-1 overflow-y-auto px-6 py-4 space-y-6">
184
+ {#each Object.entries(groupedShortcuts) as [categoryKey, items] (categoryKey)}
185
+ <div class="space-y-2.5">
186
+ <div class="text-xs font-medium text-muted-foreground uppercase tracking-wider">
187
+ {categories[categoryKey] || categoryKey}
188
+ </div>
189
+ <div class="space-y-1.5">
190
+ {#each items as item (item.id)}
191
+ <div
192
+ class="flex items-center justify-between rounded-lg px-3 py-2 text-sm transition-colors hover:bg-accent/50 cursor-pointer"
193
+ onclick={() => triggerItem(item)}
194
+ role="button"
195
+ tabindex="0"
196
+ onkeydown={(e) => e.key === 'Enter' && triggerItem(item)}
197
+ >
198
+ <div class="flex flex-col">
199
+ <span class="font-medium text-foreground">{item.label}</span>
200
+ {#if item.description}
201
+ <span class="text-xs text-muted-foreground">{item.description}</span>
202
+ {/if}
203
+ </div>
204
+ <div class="flex items-center gap-1.5 shrink-0">
205
+ {#each item.keys as key, keyIdx (keyIdx)}
206
+ <kbd class="inline-flex min-w-6 h-6 items-center justify-center rounded-md border border-border bg-muted px-1.5 text-xs font-mono font-medium text-muted-foreground shadow-2xs">
207
+ {key}
208
+ </kbd>
209
+ {/each}
210
+ </div>
211
+ </div>
212
+ {/each}
213
+ </div>
214
+ </div>
215
+ {/each}
216
+
217
+ {#if filteredShortcuts.length === 0}
218
+ <div class="text-center py-8 text-sm text-muted-foreground">未找到匹配的快捷键</div>
219
+ {/if}
220
+ </div>
221
+
222
+ <!-- 底部提示 -->
223
+ <div class="border-t border-border px-6 py-3 bg-muted/20 text-xs text-muted-foreground flex items-center justify-between">
224
+ <span>按 <kbd class="px-1 py-0.5 rounded bg-muted border text-[10px]">Esc</kbd> 退出向导</span>
225
+ <span>按 <kbd class="px-1 py-0.5 rounded bg-muted border text-[10px]">?</kbd> 随时唤出</span>
226
+ </div>
227
+ </div>
228
+ </div>
229
+ {/if}
@@ -0,0 +1,18 @@
1
+ export interface ShortcutItem {
2
+ id: string;
3
+ category: 'navigation' | 'view' | 'action' | 'system';
4
+ label: string;
5
+ keys: string[];
6
+ description?: string;
7
+ action?: () => void;
8
+ }
9
+ interface Props {
10
+ open?: boolean;
11
+ shortcuts?: ShortcutItem[];
12
+ enableBuiltins?: boolean;
13
+ class?: string;
14
+ onAction?: (shortcutId: string) => void;
15
+ }
16
+ declare const GlobalShortcuts: import("svelte").Component<Props, {}, "open">;
17
+ type GlobalShortcuts = ReturnType<typeof GlobalShortcuts>;
18
+ export default GlobalShortcuts;
@@ -1,11 +1,12 @@
1
1
  <script lang="ts">
2
- import { Moon, Sun, Search, MonitorUp } from '@lucide/svelte';
2
+ import { Moon, Sun, Search, MonitorUp, Lock } from '@lucide/svelte';
3
3
  import { Button } from './ui/button';
4
4
  import TooltipButton from './TooltipButton.svelte';
5
5
  import { getResolvedTheme, toggleTheme, type MenuItem } from '@svadmin/core';
6
6
  import Breadcrumbs from './Breadcrumbs.svelte';
7
7
  import NotificationCenter, { type NotificationItem } from './NotificationCenter.svelte';
8
8
  import ThemeSettingsDrawer from './ThemeSettingsDrawer.svelte';
9
+ import FullscreenButton from './FullscreenButton.svelte';
9
10
  import { useTranslation } from '@svadmin/core/i18n';
10
11
 
11
12
  import { getComponentRegistry } from '../component-registry.svelte.js';
@@ -15,6 +16,7 @@
15
16
  let {
16
17
  showThemeToggle = false,
17
18
  showThemeSettings = true,
19
+ showFullscreen = false,
18
20
  showNotifications = true,
19
21
  notificationItems = [],
20
22
  notificationUnreadCount,
@@ -29,9 +31,12 @@
29
31
  rightActions,
30
32
  siteUrl,
31
33
  menu,
34
+ showLock = false,
35
+ onlock,
32
36
  } = $props<{
33
37
  showThemeToggle?: boolean;
34
38
  showThemeSettings?: boolean;
39
+ showFullscreen?: boolean;
35
40
  showNotifications?: boolean;
36
41
  notificationItems?: NotificationItem[];
37
42
  notificationUnreadCount?: number;
@@ -45,6 +50,8 @@
45
50
  rightActions?: import('svelte').Snippet;
46
51
  siteUrl?: string;
47
52
  menu?: MenuItem[];
53
+ showLock?: boolean;
54
+ onlock?: () => void;
48
55
  }>();
49
56
 
50
57
  // Retrieve optional component overrides from registry
@@ -95,6 +102,15 @@
95
102
  <ThemeSettingsDrawer />
96
103
  {/if}
97
104
 
105
+ {#if showFullscreen}
106
+ <FullscreenButton />
107
+ {/if}
108
+ {#if showLock}
109
+ <TooltipButton tooltip={i18n.t('common.lockScreen')} onclick={() => onlock?.()} class="rounded-full">
110
+ <Lock class="h-4 w-4" />
111
+ </TooltipButton>
112
+ {/if}
113
+
98
114
  {#if showSearch && onSearchClick}
99
115
  <Button variant="outline" size="sm" onclick={onSearchClick} aria-label={i18n.t('common.search')} class="svadmin-header-search gap-2 text-muted-foreground h-9 px-3 rounded-lg border-border/60">
100
116
  <Search class="h-3.5 w-3.5" />
@@ -3,6 +3,7 @@ import { type NotificationItem } from './NotificationCenter.svelte';
3
3
  type $$ComponentProps = {
4
4
  showThemeToggle?: boolean;
5
5
  showThemeSettings?: boolean;
6
+ showFullscreen?: boolean;
6
7
  showNotifications?: boolean;
7
8
  notificationItems?: NotificationItem[];
8
9
  notificationUnreadCount?: number;
@@ -16,6 +17,8 @@ type $$ComponentProps = {
16
17
  rightActions?: import('svelte').Snippet;
17
18
  siteUrl?: string;
18
19
  menu?: MenuItem[];
20
+ showLock?: boolean;
21
+ onlock?: () => void;
19
22
  };
20
23
  declare const Header: import("svelte").Component<$$ComponentProps, {}, "">;
21
24
  type Header = ReturnType<typeof Header>;
@@ -49,6 +49,7 @@
49
49
  onnotificationread?: (item: NotificationItem) => void | Promise<void>;
50
50
  onnotificationreadall?: () => void | Promise<void>;
51
51
  onnotificationopen?: (item: NotificationItem) => void | Promise<void>;
52
+ showFullscreen?: boolean;
52
53
  class?: string;
53
54
  }
54
55
 
@@ -64,6 +65,7 @@
64
65
  onnotificationread,
65
66
  onnotificationreadall,
66
67
  onnotificationopen,
68
+ showFullscreen = false,
67
69
  class: className = '',
68
70
  }: Props = $props();
69
71
  const layoutId = $props.id();
@@ -298,6 +300,7 @@
298
300
  <Header
299
301
  {...definedOptions({ "siteUrl": siteUrl })}
300
302
  {...definedOptions({ "menu": menu })}
303
+ {showFullscreen}
301
304
  showSearch={true}
302
305
  showThemeToggle={true}
303
306
  notificationItems={notifications ?? []}
@@ -18,6 +18,7 @@ interface Props {
18
18
  onnotificationread?: (item: NotificationItem) => void | Promise<void>;
19
19
  onnotificationreadall?: () => void | Promise<void>;
20
20
  onnotificationopen?: (item: NotificationItem) => void | Promise<void>;
21
+ showFullscreen?: boolean;
21
22
  class?: string;
22
23
  }
23
24
  declare const Layout: import("svelte").Component<Props, {}, "">;