@spartan-native/desktop-ui 0.0.0-stage → 0.2.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/AGENTS.md +99 -0
- package/LICENSE +21 -0
- package/README.md +98 -2
- package/fesm2022/spartan-native-desktop-ui.mjs +6984 -0
- package/fesm2022/spartan-native-desktop-ui.mjs.map +1 -0
- package/package.json +48 -3
- package/types/spartan-native-desktop-ui.d.ts +1930 -0
|
@@ -0,0 +1,1930 @@
|
|
|
1
|
+
import { MenuItem, PlatformFamily, Skin } from "@spartan-native/theme";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { TemplateRef } from "@angular/core";
|
|
4
|
+
import { FocusableOption } from "@angular/cdk/a11y";
|
|
5
|
+
import { ConnectedPosition } from "@angular/cdk/overlay";
|
|
6
|
+
import { ControlValueAccessor } from "@angular/forms";
|
|
7
|
+
import * as i1 from "@angular/cdk/menu";
|
|
8
|
+
type WindowButton = 'minimize' | 'maximize' | 'close';
|
|
9
|
+
/**
|
|
10
|
+
* The window's own buttons, drawn the way the OS draws them:
|
|
11
|
+
* - Windows 11 (`win`): minimize / maximize / close caption buttons on the right; close turns red
|
|
12
|
+
* - Windows 10 (`w10`): the same caption buttons with square glyphs and the Windows 10 red
|
|
13
|
+
* - macOS 26 (`mac`) and macOS 13–15 (`macc`): the traffic lights (close / minimize / zoom);
|
|
14
|
+
* glyphs appear on hover; grey when the window is inactive
|
|
15
|
+
* - GNOME (`gtk`): a round close button, the GNOME default button layout (`linuxAll` adds the other two)
|
|
16
|
+
* - KDE Plasma (`qt`): Breeze buttons: chevron minimize / maximize and a close cross;
|
|
17
|
+
* a circle appears on hover, red for close
|
|
18
|
+
* - ChromeOS (`cros`): Material 3 round caption buttons
|
|
19
|
+
*
|
|
20
|
+
* Use it inside <sn-title-bar>, or on its own wherever your layout puts it
|
|
21
|
+
* (on macOS the lights often sit at the top of the sidebar).
|
|
22
|
+
*
|
|
23
|
+
* ```html
|
|
24
|
+
* <sn-window-controls /> <!-- in Wails, Tauri, … the buttons act on the real window -->
|
|
25
|
+
* <sn-window-controls [nativeActions]="false" (close)="confirmAndClose()" />
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* With a host that owns a window (wailsHost(), …) the buttons minimize, maximize and close
|
|
29
|
+
* it, and the maximize glyph follows the real state. The outputs always fire too.
|
|
30
|
+
*/
|
|
31
|
+
export declare class SnWindowControls {
|
|
32
|
+
/** Which buttons to show. Close is always shown. */
|
|
33
|
+
readonly buttons: import("@angular/core").InputSignal<readonly WindowButton[]>;
|
|
34
|
+
/** Show the restore glyph instead of maximize (all but macOS). */
|
|
35
|
+
readonly maximized: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
36
|
+
/** GNOME shows only close by default; set to show minimize and maximize too. */
|
|
37
|
+
readonly linuxAll: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
38
|
+
/** Act on the host's real window (when it has one). Default: true. */
|
|
39
|
+
readonly nativeActions: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
40
|
+
readonly minimize: import("@angular/core").OutputEmitterRef<void>;
|
|
41
|
+
readonly maximize: import("@angular/core").OutputEmitterRef<void>;
|
|
42
|
+
readonly close: import("@angular/core").OutputEmitterRef<void>;
|
|
43
|
+
protected readonly skin: import("@angular/core").Signal<Skin>;
|
|
44
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
45
|
+
/** Which button set to draw. */
|
|
46
|
+
protected readonly look: import("@angular/core").Signal<"cros" | "windows" | "macos" | "gnome" | "kde">;
|
|
47
|
+
private readonly hostWindow;
|
|
48
|
+
private readonly hostMaximized;
|
|
49
|
+
protected readonly isMaximized: import("@angular/core").Signal<boolean>;
|
|
50
|
+
constructor();
|
|
51
|
+
protected act(action: WindowButton): void;
|
|
52
|
+
protected show(button: WindowButton): boolean;
|
|
53
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnWindowControls, never>;
|
|
54
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnWindowControls, "sn-window-controls", never, {
|
|
55
|
+
"buttons": {
|
|
56
|
+
"alias": "buttons";
|
|
57
|
+
"required": false;
|
|
58
|
+
"isSignal": true;
|
|
59
|
+
};
|
|
60
|
+
"maximized": {
|
|
61
|
+
"alias": "maximized";
|
|
62
|
+
"required": false;
|
|
63
|
+
"isSignal": true;
|
|
64
|
+
};
|
|
65
|
+
"linuxAll": {
|
|
66
|
+
"alias": "linuxAll";
|
|
67
|
+
"required": false;
|
|
68
|
+
"isSignal": true;
|
|
69
|
+
};
|
|
70
|
+
"nativeActions": {
|
|
71
|
+
"alias": "nativeActions";
|
|
72
|
+
"required": false;
|
|
73
|
+
"isSignal": true;
|
|
74
|
+
};
|
|
75
|
+
}, {
|
|
76
|
+
"minimize": "minimize";
|
|
77
|
+
"maximize": "maximize";
|
|
78
|
+
"close": "close";
|
|
79
|
+
}, never, never, true, never>;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* A complete title bar, laid out the way each OS does it:
|
|
83
|
+
* - Windows 11 (`win`) / Windows 10 (`w10`): app icon and title on the left, caption buttons on the right
|
|
84
|
+
* - macOS 26 (`mac`): traffic lights on the left, title centered, a 38px unified bar
|
|
85
|
+
* - macOS 13–15 (`macc`): the classic 28px title bar, lights inset 8px, title centered
|
|
86
|
+
* - GNOME (`gtk`): an AdwHeaderBar, bold title centered, close button on the right
|
|
87
|
+
* - KDE Plasma (`qt`): the Breeze title bar: app icon on the left, title centered,
|
|
88
|
+
* minimize / maximize / close on the right
|
|
89
|
+
* - ChromeOS (`cros`): the caption bar: app icon and title on the left, round M3 caption buttons on the right
|
|
90
|
+
*
|
|
91
|
+
* The bar is a window drag region for Electron/Chromium (`app-region`), Wails
|
|
92
|
+
* (`--wails-draggable`) and Tauri (`data-tauri-drag-region`); buttons inside are not.
|
|
93
|
+
* It carries `sn-chrome`, so the theme dims it when the window is inactive.
|
|
94
|
+
*
|
|
95
|
+
* ```html
|
|
96
|
+
* <sn-title-bar title="Harbor Backup" (close)="host.close()">
|
|
97
|
+
* <img snTitleBarIcon src="icon.svg" alt="" />
|
|
98
|
+
* <button hlmBtn variant="ghost" snTitleBarEnd>…</button>
|
|
99
|
+
* </sn-title-bar>
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* Set `windowControls="native"` when the OS draws its own buttons
|
|
103
|
+
* (Electron titleBarOverlay, Window Controls Overlay, a macOS hidden-inset title bar): space is
|
|
104
|
+
* left for them where the real OS puts them, so a Mac dressed as Windows keeps the room for its
|
|
105
|
+
* traffic lights at the start, and the layout of the rest follows the skin.
|
|
106
|
+
*/
|
|
107
|
+
export declare class SnTitleBar {
|
|
108
|
+
/** The window title. */
|
|
109
|
+
readonly title: import("@angular/core").InputSignal<string>;
|
|
110
|
+
/** A second, smaller line under the title. */
|
|
111
|
+
readonly subtitle: import("@angular/core").InputSignal<string>;
|
|
112
|
+
/** `custom`: draw the window buttons · `native`: the OS draws them (leave space). */
|
|
113
|
+
readonly windowControls: import("@angular/core").InputSignal<"custom" | "native">;
|
|
114
|
+
/** Which window buttons to draw. Close is always drawn. */
|
|
115
|
+
readonly buttons: import("@angular/core").InputSignal<readonly WindowButton[]>;
|
|
116
|
+
/** Show the restore glyph instead of maximize. */
|
|
117
|
+
readonly maximized: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
118
|
+
readonly minimize: import("@angular/core").OutputEmitterRef<void>;
|
|
119
|
+
readonly maximize: import("@angular/core").OutputEmitterRef<void>;
|
|
120
|
+
readonly close: import("@angular/core").OutputEmitterRef<void>;
|
|
121
|
+
protected readonly skin: import("@angular/core").Signal<Skin>;
|
|
122
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
123
|
+
/** The real OS's skin: where and how big its own window buttons are. */
|
|
124
|
+
protected readonly nativeSkin: import("@angular/core").Signal<Skin>;
|
|
125
|
+
protected readonly showIcon: import("@angular/core").Signal<boolean>;
|
|
126
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnTitleBar, never>;
|
|
127
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnTitleBar, "sn-title-bar", never, {
|
|
128
|
+
"title": {
|
|
129
|
+
"alias": "title";
|
|
130
|
+
"required": false;
|
|
131
|
+
"isSignal": true;
|
|
132
|
+
};
|
|
133
|
+
"subtitle": {
|
|
134
|
+
"alias": "subtitle";
|
|
135
|
+
"required": false;
|
|
136
|
+
"isSignal": true;
|
|
137
|
+
};
|
|
138
|
+
"windowControls": {
|
|
139
|
+
"alias": "windowControls";
|
|
140
|
+
"required": false;
|
|
141
|
+
"isSignal": true;
|
|
142
|
+
};
|
|
143
|
+
"buttons": {
|
|
144
|
+
"alias": "buttons";
|
|
145
|
+
"required": false;
|
|
146
|
+
"isSignal": true;
|
|
147
|
+
};
|
|
148
|
+
"maximized": {
|
|
149
|
+
"alias": "maximized";
|
|
150
|
+
"required": false;
|
|
151
|
+
"isSignal": true;
|
|
152
|
+
};
|
|
153
|
+
}, {
|
|
154
|
+
"minimize": "minimize";
|
|
155
|
+
"maximize": "maximize";
|
|
156
|
+
"close": "close";
|
|
157
|
+
}, never, ["[snTitleBarIcon]", "[snTitleBarStart]", "[snTitleBarEnd]"], true, never>;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* One piece of information in an `<sn-status-bar>`: "4 items", "1 selected · 48 KB",
|
|
161
|
+
* "Last backup 09:12". The bar separates items the way the OS does (spacing on Windows 11,
|
|
162
|
+
* vertical rules on Windows 10 and KDE, commas on macOS).
|
|
163
|
+
*
|
|
164
|
+
* `live` makes a screen reader announce changes to this item (e.g. a progress message);
|
|
165
|
+
* leave it off for text that changes on every selection, so it doesn't interrupt.
|
|
166
|
+
*/
|
|
167
|
+
export declare class SnStatusItem {
|
|
168
|
+
readonly live: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
169
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnStatusItem, never>;
|
|
170
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SnStatusItem, "[snStatusItem]", never, {
|
|
171
|
+
"live": {
|
|
172
|
+
"alias": "live";
|
|
173
|
+
"required": false;
|
|
174
|
+
"isSignal": true;
|
|
175
|
+
};
|
|
176
|
+
}, {}, never, never, true, never>;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* The window's status bar, along the bottom edge:
|
|
180
|
+
* - Windows 11: File Explorer's status bar, small text, items spaced apart, no rules
|
|
181
|
+
* - Windows 10: the classic status bar, items divided by vertical rules
|
|
182
|
+
* - macOS 26 / 13–15: Finder's status bar, small centered text, items joined by commas
|
|
183
|
+
* - GNOME: a GtkActionBar at the bottom of an AdwToolbarView (start · end)
|
|
184
|
+
* - KDE: Dolphin's status bar, items divided by rules, extra controls (zoom, free space) at the end
|
|
185
|
+
* - ChromeOS: a slim M3 footer, muted label-medium text
|
|
186
|
+
*
|
|
187
|
+
* ```html
|
|
188
|
+
* <sn-status-bar>
|
|
189
|
+
* <span snStatusItem>4 items</span>
|
|
190
|
+
* <span snStatusItem>1 selected · 48 KB</span>
|
|
191
|
+
* <span snStatusItem snStatusBarEnd>1.2 TB free</span>
|
|
192
|
+
* </sn-status-bar>
|
|
193
|
+
* ```
|
|
194
|
+
*
|
|
195
|
+
* `[snStatusBarEnd]` items go to the trailing edge (on macOS they join the centered text).
|
|
196
|
+
* It carries `sn-chrome`, so the theme dims it when the window is inactive.
|
|
197
|
+
*/
|
|
198
|
+
export declare class SnStatusBar {
|
|
199
|
+
/** Accessible name of the bar. */
|
|
200
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string>;
|
|
201
|
+
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
202
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
203
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnStatusBar, never>;
|
|
204
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnStatusBar, "sn-status-bar", never, {
|
|
205
|
+
"ariaLabel": {
|
|
206
|
+
"alias": "ariaLabel";
|
|
207
|
+
"required": false;
|
|
208
|
+
"isSignal": true;
|
|
209
|
+
};
|
|
210
|
+
}, {}, never, ["*", "[snStatusBarEnd]"], true, never>;
|
|
211
|
+
}
|
|
212
|
+
export declare const SnStatusBarImports: readonly [typeof SnStatusBar, typeof SnStatusItem];
|
|
213
|
+
/**
|
|
214
|
+
* A group of settings rows, drawn as each OS draws its settings:
|
|
215
|
+
* - Windows 11 (`win`): a stack of SettingsCards under a section title
|
|
216
|
+
* - Windows 10 (`w10`): the Settings app's plain list: a light heading, label above each control
|
|
217
|
+
* - macOS 26 (`mac`): a grouped Form section (small header above an inset rounded glass list)
|
|
218
|
+
* - macOS 13–15 (`macc`): the same section with the classic corner and vibrancy
|
|
219
|
+
* - GNOME (`gtk`): AdwPreferencesGroup (bold title above a boxed list)
|
|
220
|
+
* - KDE Plasma (`qt`): a Kirigami FormLayout (centered section title, "Label:" right-aligned
|
|
221
|
+
* in one column, controls in the next, help text under the control; icons hidden)
|
|
222
|
+
* - ChromeOS (`cros`): a Settings list (M3 list rows inside a tonal card)
|
|
223
|
+
*
|
|
224
|
+
* ```html
|
|
225
|
+
* <sn-settings-group title="Backups" description="Choose when and how backups run.">
|
|
226
|
+
* <sn-settings-row title="Automatic backups" subtitle="Run in the background">
|
|
227
|
+
* <hlm-switch [checked]="true" aria-label="Automatic backups" />
|
|
228
|
+
* </sn-settings-row>
|
|
229
|
+
* </sn-settings-group>
|
|
230
|
+
* ```
|
|
231
|
+
*/
|
|
232
|
+
export declare class SnSettingsGroup {
|
|
233
|
+
/** The group heading (labels the group for assistive tech). */
|
|
234
|
+
readonly title: import("@angular/core").InputSignal<string>;
|
|
235
|
+
/** A line of explanation under the heading. */
|
|
236
|
+
readonly description: import("@angular/core").InputSignal<string>;
|
|
237
|
+
protected readonly headingId: string;
|
|
238
|
+
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
239
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
240
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnSettingsGroup, never>;
|
|
241
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnSettingsGroup, "sn-settings-group", never, {
|
|
242
|
+
"title": {
|
|
243
|
+
"alias": "title";
|
|
244
|
+
"required": false;
|
|
245
|
+
"isSignal": true;
|
|
246
|
+
};
|
|
247
|
+
"description": {
|
|
248
|
+
"alias": "description";
|
|
249
|
+
"required": false;
|
|
250
|
+
"isSignal": true;
|
|
251
|
+
};
|
|
252
|
+
}, {}, never, ["*"], true, never>;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* One setting: title, optional subtitle, and its control on the trailing side
|
|
256
|
+
* (Windows 10: below the label; KDE: in the FormLayout's control column).
|
|
257
|
+
* Put an icon in front with `snSettingsIcon` (hidden on Windows 10 and KDE, which don't use them).
|
|
258
|
+
*/
|
|
259
|
+
export declare class SnSettingsRow {
|
|
260
|
+
/** The setting's name (on KDE: the FormLayout label). */
|
|
261
|
+
readonly title: import("@angular/core").InputSignal<string>;
|
|
262
|
+
/** Help text (on KDE: shown under the control). */
|
|
263
|
+
readonly subtitle: import("@angular/core").InputSignal<string>;
|
|
264
|
+
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
265
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
266
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnSettingsRow, never>;
|
|
267
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnSettingsRow, "sn-settings-row", never, {
|
|
268
|
+
"title": {
|
|
269
|
+
"alias": "title";
|
|
270
|
+
"required": true;
|
|
271
|
+
"isSignal": true;
|
|
272
|
+
};
|
|
273
|
+
"subtitle": {
|
|
274
|
+
"alias": "subtitle";
|
|
275
|
+
"required": false;
|
|
276
|
+
"isSignal": true;
|
|
277
|
+
};
|
|
278
|
+
}, {}, never, ["[snSettingsIcon]", "*"], true, never>;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* A full-page empty or status state:
|
|
282
|
+
* - Windows 11 (`win`) / Windows 10 (`w10`): a Fluent empty state (accent glyph in a tinted circle,
|
|
283
|
+
* subtitle-size title)
|
|
284
|
+
* - macOS 26 (`mac`) / macOS 13–15 (`macc`): ContentUnavailableView (medium grey icon, bold title)
|
|
285
|
+
* - GNOME (`gtk`): AdwStatusPage (128px faded icon, big heavy title, pill buttons)
|
|
286
|
+
* - KDE Plasma (`qt`): Kirigami PlaceholderMessage (faded 64px icon, muted level-2 heading)
|
|
287
|
+
* - ChromeOS (`cros`): the Material 3 empty state (icon in a primary-container circle, light headline)
|
|
288
|
+
*
|
|
289
|
+
* `icon` is an @ng-icons name the app has registered with provideIcons().
|
|
290
|
+
* Buttons go in the content.
|
|
291
|
+
*
|
|
292
|
+
* ```html
|
|
293
|
+
* <sn-status-page icon="lucideArchive" title="No backups yet" description="Add a destination to start protecting your files.">
|
|
294
|
+
* <button hlmBtn>Add destination</button>
|
|
295
|
+
* </sn-status-page>
|
|
296
|
+
* ```
|
|
297
|
+
*/
|
|
298
|
+
export declare class SnStatusPage {
|
|
299
|
+
/** An @ng-icons name registered with provideIcons(). Leave empty for no icon. */
|
|
300
|
+
readonly icon: import("@angular/core").InputSignal<string>;
|
|
301
|
+
/** The headline. */
|
|
302
|
+
readonly title: import("@angular/core").InputSignal<string>;
|
|
303
|
+
/** A sentence that says what to do next. */
|
|
304
|
+
readonly description: import("@angular/core").InputSignal<string>;
|
|
305
|
+
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
306
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
307
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnStatusPage, never>;
|
|
308
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnStatusPage, "sn-status-page", never, {
|
|
309
|
+
"icon": {
|
|
310
|
+
"alias": "icon";
|
|
311
|
+
"required": false;
|
|
312
|
+
"isSignal": true;
|
|
313
|
+
};
|
|
314
|
+
"title": {
|
|
315
|
+
"alias": "title";
|
|
316
|
+
"required": true;
|
|
317
|
+
"isSignal": true;
|
|
318
|
+
};
|
|
319
|
+
"description": {
|
|
320
|
+
"alias": "description";
|
|
321
|
+
"required": false;
|
|
322
|
+
"isSignal": true;
|
|
323
|
+
};
|
|
324
|
+
}, {}, never, ["*"], true, never>;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* One entry of a desktop-ui menu: the host's plain `MenuItem`, plus the function to run.
|
|
328
|
+
* The same data feeds a native menu (the macOS menu bar, an OS context menu) and the
|
|
329
|
+
* in-page menu that stands in for it elsewhere.
|
|
330
|
+
*
|
|
331
|
+
* ```ts
|
|
332
|
+
* const menu: SnMenuItem[] = [
|
|
333
|
+
* { role: 'appMenu' },
|
|
334
|
+
* { label: 'File', submenu: [
|
|
335
|
+
* { label: 'New backup…', accelerator: 'mod+n', action: () => this.create() },
|
|
336
|
+
* { type: 'separator' },
|
|
337
|
+
* { role: 'close' },
|
|
338
|
+
* ]},
|
|
339
|
+
* { role: 'editMenu' },
|
|
340
|
+
* ];
|
|
341
|
+
* ```
|
|
342
|
+
*/
|
|
343
|
+
interface SnMenuItem extends Omit<MenuItem, 'submenu'> {
|
|
344
|
+
/** Runs when the item is chosen (also from its accelerator in the in-page menubar). */
|
|
345
|
+
readonly action?: () => void;
|
|
346
|
+
readonly submenu?: readonly SnMenuItem[];
|
|
347
|
+
}
|
|
348
|
+
/** The window actions a role can fall back to in the page. */
|
|
349
|
+
interface SnMenuWindowActions {
|
|
350
|
+
minimize?(): void;
|
|
351
|
+
toggleMaximize?(): void;
|
|
352
|
+
close?(): void;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Converts to the host's plain data: every item with an `action` gets an `id` (its own, or a
|
|
356
|
+
* generated one), and `actions` maps the ids back to the items.
|
|
357
|
+
*/
|
|
358
|
+
export declare function toHostMenu(items: readonly SnMenuItem[], actions?: Map<string, SnMenuItem>): {
|
|
359
|
+
menu: MenuItem[];
|
|
360
|
+
actions: Map<string, SnMenuItem>;
|
|
361
|
+
};
|
|
362
|
+
/** Drops separators at the edges and next to each other, and submenus left empty. */
|
|
363
|
+
export declare function tidyMenu(items: readonly SnMenuItem[]): SnMenuItem[];
|
|
364
|
+
/**
|
|
365
|
+
* Replaces roles with ordinary items for an in-page menu: Edit and Window submenus, edit
|
|
366
|
+
* commands on the focused field, the window actions through the host. Roles that have no
|
|
367
|
+
* meaning in a page (the macOS app menu, About without an action) are left out.
|
|
368
|
+
*/
|
|
369
|
+
export declare function inPageMenu(items: readonly SnMenuItem[], family: PlatformFamily, window?: SnMenuWindowActions, run?: (command: EditCommand) => void): SnMenuItem[];
|
|
370
|
+
type EditCommand = 'undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'selectAll';
|
|
371
|
+
/** Runs an edit command on the focused field, as the OS Edit menu would. */
|
|
372
|
+
export declare function runEditCommand(command: EditCommand): void;
|
|
373
|
+
/** Whether a key event is the accelerator (`mod` is ⌘ on macOS, Ctrl elsewhere). */
|
|
374
|
+
export declare function matchesAccelerator(event: KeyboardEvent, accelerator: string, family: PlatformFamily): boolean;
|
|
375
|
+
/** @internal The bubble. Styled by the theme, per skin, like hlmTooltip (data-slot="sn-tooltip"). */
|
|
376
|
+
export declare class SnTooltipPanel {
|
|
377
|
+
readonly text: import("@angular/core").WritableSignal<string>;
|
|
378
|
+
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
379
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
380
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnTooltipPanel, never>;
|
|
381
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnTooltipPanel, "sn-tooltip-panel", never, {}, {}, never, never, true, never>;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* A short label that shows when the pointer rests on an element, or when it gets the keyboard
|
|
385
|
+
* focus, drawn the way the active skin draws tooltips (a light card on Windows 11 and macOS, an
|
|
386
|
+
* inverse bubble on GNOME, a framed surface on KDE, an M3 plain tooltip on ChromeOS).
|
|
387
|
+
*
|
|
388
|
+
* The text is a visual hint only (the bubble is `aria-hidden`): give the element its own
|
|
389
|
+
* accessible name. Esc and a click hide it. An empty text shows nothing.
|
|
390
|
+
*
|
|
391
|
+
* ```html
|
|
392
|
+
* <button hlmBtn size="icon" aria-label="Refresh" snTooltip="Refresh">…</button>
|
|
393
|
+
* ```
|
|
394
|
+
*/
|
|
395
|
+
export declare class SnTooltip {
|
|
396
|
+
/** The text. Empty: no tooltip. */
|
|
397
|
+
readonly snTooltip: import("@angular/core").InputSignal<string>;
|
|
398
|
+
readonly snTooltipDisabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
399
|
+
/** Set by components that own the tooltip (e.g. snCommand); wins over the input. */
|
|
400
|
+
readonly text: import("@angular/core").WritableSignal<string | null>;
|
|
401
|
+
private readonly shown;
|
|
402
|
+
private readonly element;
|
|
403
|
+
private readonly injector;
|
|
404
|
+
private readonly modality;
|
|
405
|
+
private overlay;
|
|
406
|
+
private panel;
|
|
407
|
+
private timer;
|
|
408
|
+
constructor();
|
|
409
|
+
protected onPointerEnter(event: PointerEvent): void;
|
|
410
|
+
/** Keyboard focus shows it at once; a click's focus doesn't. */
|
|
411
|
+
protected onFocus(): void;
|
|
412
|
+
private schedule;
|
|
413
|
+
/** Shows the tooltip now (no delay). */
|
|
414
|
+
show(): void;
|
|
415
|
+
/** Hides the tooltip and cancels a pending one. */
|
|
416
|
+
hide(): void;
|
|
417
|
+
private clearTimer;
|
|
418
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnTooltip, never>;
|
|
419
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SnTooltip, "[snTooltip]", never, {
|
|
420
|
+
"snTooltip": {
|
|
421
|
+
"alias": "snTooltip";
|
|
422
|
+
"required": false;
|
|
423
|
+
"isSignal": true;
|
|
424
|
+
};
|
|
425
|
+
"snTooltipDisabled": {
|
|
426
|
+
"alias": "snTooltipDisabled";
|
|
427
|
+
"required": false;
|
|
428
|
+
"isSignal": true;
|
|
429
|
+
};
|
|
430
|
+
}, {}, never, never, true, never>;
|
|
431
|
+
}
|
|
432
|
+
/** Where the title sits: the skin's own place, or forced to the start or the center. */
|
|
433
|
+
type SnCommandBarTitlePosition = 'auto' | 'start' | 'center';
|
|
434
|
+
/**
|
|
435
|
+
* What the bar does when it is too narrow: `auto` first drops the labels (on skins that show
|
|
436
|
+
* them), then moves commands into the overflow menu, lowest `priority` first; `none` does neither.
|
|
437
|
+
*/
|
|
438
|
+
type SnCommandBarCollapse = 'auto' | 'none';
|
|
439
|
+
/**
|
|
440
|
+
* The secondary commands as your own menu, shown by the bar's overflow button (Windows `…`,
|
|
441
|
+
* macOS `…`, GNOME/KDE menu button, ChromeOS `⋮`). Put a stock menu inside, e.g. hlmDropdownMenu:
|
|
442
|
+
*
|
|
443
|
+
* ```html
|
|
444
|
+
* <ng-template snCommandOverflow>
|
|
445
|
+
* <div hlmDropdownMenu>
|
|
446
|
+
* <button hlmDropdownMenuItem>Rename</button>
|
|
447
|
+
* </div>
|
|
448
|
+
* </ng-template>
|
|
449
|
+
* ```
|
|
450
|
+
*
|
|
451
|
+
* It is used while the bar has nothing of its own to put in the menu. Once commands collapse
|
|
452
|
+
* into the overflow (or are `secondary`, or `overflowItems` is set), the bar draws the menu
|
|
453
|
+
* itself: prefer `secondary` commands and `overflowItems` with a collapsing bar.
|
|
454
|
+
*/
|
|
455
|
+
export declare class SnCommandOverflow {
|
|
456
|
+
readonly template: TemplateRef<any>;
|
|
457
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnCommandOverflow, never>;
|
|
458
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SnCommandOverflow, "ng-template[snCommandOverflow]", never, {}, {}, never, never, true, never>;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* A group of commands that belong together: on macOS 26 each group is its own Liquid Glass
|
|
462
|
+
* capsule, elsewhere groups are divided by a separator (Windows, GNOME, KDE) or a gap (ChromeOS).
|
|
463
|
+
*
|
|
464
|
+
* ```html
|
|
465
|
+
* <sn-command-group label="History">
|
|
466
|
+
* <button snCommand icon="lucideUndo2" label="Undo"></button>
|
|
467
|
+
* <button snCommand icon="lucideRedo2" label="Redo"></button>
|
|
468
|
+
* </sn-command-group>
|
|
469
|
+
* ```
|
|
470
|
+
*/
|
|
471
|
+
export declare class SnCommandGroup {
|
|
472
|
+
/** Accessible name of the group. */
|
|
473
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
474
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnCommandGroup, never>;
|
|
475
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnCommandGroup, "sn-command-group", never, {
|
|
476
|
+
"label": {
|
|
477
|
+
"alias": "label";
|
|
478
|
+
"required": false;
|
|
479
|
+
"isSignal": true;
|
|
480
|
+
};
|
|
481
|
+
}, {}, never, ["*"], true, never>;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* One command in an `<sn-command-bar>`: an icon and a label.
|
|
485
|
+
* The label is visible on Windows and KDE; on macOS, GNOME and ChromeOS the command is
|
|
486
|
+
* icon-only, the label stays as its accessible name and shows as the skin's tooltip.
|
|
487
|
+
* Without `icon`, project your own `<svg>`/`<ng-icon>`, or none (then the label always shows).
|
|
488
|
+
*
|
|
489
|
+
* When the bar runs out of room, commands move into its overflow menu, lowest `priority` first.
|
|
490
|
+
* `secondary` commands always live there.
|
|
491
|
+
*/
|
|
492
|
+
export declare class SnCommand implements FocusableOption {
|
|
493
|
+
readonly icon: import("@angular/core").InputSignal<string>;
|
|
494
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
495
|
+
readonly isDisabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
496
|
+
/** Show only the icon on every OS (the label stays as accessible name and tooltip). */
|
|
497
|
+
readonly hideLabel: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
498
|
+
/** `accent`: the window's main action, filled with the accent color (Fluent accent, macOS prominent). */
|
|
499
|
+
readonly variant: import("@angular/core").InputSignal<"default" | "accent">;
|
|
500
|
+
/** Commands with a lower priority move into the overflow menu first. Default: 0. */
|
|
501
|
+
readonly priority: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
502
|
+
/** Always in the overflow menu, never in the bar (WinUI secondary commands). */
|
|
503
|
+
readonly secondary: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
504
|
+
/** Set by the bar: the one command in the tab order (roving tabindex). */
|
|
505
|
+
readonly tabbable: import("@angular/core").WritableSignal<boolean>;
|
|
506
|
+
/** Set by the bar: in the overflow menu instead of the bar. */
|
|
507
|
+
readonly collapsed: import("@angular/core").WritableSignal<boolean>;
|
|
508
|
+
readonly element: HTMLButtonElement;
|
|
509
|
+
private readonly bar;
|
|
510
|
+
protected readonly iconOnly: import("@angular/core").Signal<boolean>;
|
|
511
|
+
constructor();
|
|
512
|
+
/** For the key manager: collapsed commands are skipped like disabled ones. */
|
|
513
|
+
get disabled(): boolean;
|
|
514
|
+
focus(): void;
|
|
515
|
+
/** @internal Moves the command into (or out of) the overflow menu, right away in the DOM so the bar can measure. */
|
|
516
|
+
setCollapsed(collapsed: boolean): void;
|
|
517
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnCommand, never>;
|
|
518
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnCommand, "button[snCommand]", never, {
|
|
519
|
+
"icon": {
|
|
520
|
+
"alias": "icon";
|
|
521
|
+
"required": false;
|
|
522
|
+
"isSignal": true;
|
|
523
|
+
};
|
|
524
|
+
"label": {
|
|
525
|
+
"alias": "label";
|
|
526
|
+
"required": true;
|
|
527
|
+
"isSignal": true;
|
|
528
|
+
};
|
|
529
|
+
"isDisabled": {
|
|
530
|
+
"alias": "disabled";
|
|
531
|
+
"required": false;
|
|
532
|
+
"isSignal": true;
|
|
533
|
+
};
|
|
534
|
+
"hideLabel": {
|
|
535
|
+
"alias": "hideLabel";
|
|
536
|
+
"required": false;
|
|
537
|
+
"isSignal": true;
|
|
538
|
+
};
|
|
539
|
+
"variant": {
|
|
540
|
+
"alias": "variant";
|
|
541
|
+
"required": false;
|
|
542
|
+
"isSignal": true;
|
|
543
|
+
};
|
|
544
|
+
"priority": {
|
|
545
|
+
"alias": "priority";
|
|
546
|
+
"required": false;
|
|
547
|
+
"isSignal": true;
|
|
548
|
+
};
|
|
549
|
+
"secondary": {
|
|
550
|
+
"alias": "secondary";
|
|
551
|
+
"required": false;
|
|
552
|
+
"isSignal": true;
|
|
553
|
+
};
|
|
554
|
+
}, {}, never, ["*"], true, [{
|
|
555
|
+
directive: typeof SnTooltip;
|
|
556
|
+
inputs: {};
|
|
557
|
+
outputs: {};
|
|
558
|
+
}]>;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* The window's command surface, with the same markup on every OS:
|
|
562
|
+
* - Windows 11: a CommandBar, title left, commands right with the label beside the icon, `…` overflow
|
|
563
|
+
* - Windows 10: the same, labels under the icons, square
|
|
564
|
+
* - macOS 26: a unified toolbar, title left, icon-only commands in Liquid Glass capsules (macOS 13–15: plain bezels)
|
|
565
|
+
* - GNOME: an AdwHeaderBar, commands at the start, title centered, menu button at the end
|
|
566
|
+
* - KDE: a KToolBar, title then commands with text beside the icon, menu button at the end
|
|
567
|
+
* - ChromeOS: an M3 top app bar, title left, round icon actions right, `⋮` overflow
|
|
568
|
+
*
|
|
569
|
+
* The title is a heading (`headingLevel`, default 1) and goes where the skin puts it, or where
|
|
570
|
+
* `titlePosition` says. A centered title stays centered while it fits and moves aside instead
|
|
571
|
+
* of running under the commands.
|
|
572
|
+
*
|
|
573
|
+
* The commands form one `role="toolbar"`: Tab enters it once, ← → Home End move between
|
|
574
|
+
* commands (disabled ones are skipped), ↓ or Enter on the overflow button opens its menu.
|
|
575
|
+
* When the bar is too narrow, labels drop first (Windows, KDE), then commands move into the
|
|
576
|
+
* overflow menu by `priority`.
|
|
577
|
+
*
|
|
578
|
+
* ```html
|
|
579
|
+
* <sn-command-bar title="Documents">
|
|
580
|
+
* <button snCommand icon="lucidePlus" label="New" variant="accent" (click)="create()"></button>
|
|
581
|
+
* <sn-command-group label="Selection">
|
|
582
|
+
* <button snCommand icon="lucideShare2" label="Share" priority="1"></button>
|
|
583
|
+
* <button snCommand icon="lucideTrash2" label="Delete" [disabled]="!selection()"></button>
|
|
584
|
+
* </sn-command-group>
|
|
585
|
+
* <button snCommand icon="lucidePencil" label="Rename" secondary></button>
|
|
586
|
+
* </sn-command-bar>
|
|
587
|
+
* ```
|
|
588
|
+
*
|
|
589
|
+
* Commands declared elsewhere (a page's commands shown by the shell's bar): pass them as a
|
|
590
|
+
* template, `<sn-command-bar [commands]="page.commands()">`. Commands in it work exactly like
|
|
591
|
+
* projected ones.
|
|
592
|
+
*
|
|
593
|
+
* Extra content: `[snCommandBarStart]` (e.g. a back button, or the window controls when the
|
|
594
|
+
* bar is the title bar) and `[snCommandBarEnd]` (e.g. a search field). It carries `sn-chrome`,
|
|
595
|
+
* so the theme dims it when the window is inactive.
|
|
596
|
+
*/
|
|
597
|
+
export declare class SnCommandBar {
|
|
598
|
+
readonly title: import("@angular/core").InputSignal<string>;
|
|
599
|
+
/** Where the title goes. `auto`: the skin's place (centered on GNOME, at the start elsewhere). */
|
|
600
|
+
readonly titlePosition: import("@angular/core").InputSignal<SnCommandBarTitlePosition>;
|
|
601
|
+
/** The title's heading level (`role="heading"`). 0: not a heading. Default: 1. */
|
|
602
|
+
readonly headingLevel: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
603
|
+
/** Accessible name of the toolbar; defaults to `title`. */
|
|
604
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string>;
|
|
605
|
+
/** Accessible name and tooltip of the overflow button. */
|
|
606
|
+
readonly overflowLabel: import("@angular/core").InputSignal<string>;
|
|
607
|
+
/** Commands declared somewhere else, e.g. by the current page. Rendered after the projected ones. */
|
|
608
|
+
readonly commands: import("@angular/core").InputSignal<TemplateRef<unknown> | null>;
|
|
609
|
+
/** More entries for the overflow menu, after the collapsed and secondary commands. */
|
|
610
|
+
readonly overflowItems: import("@angular/core").InputSignal<readonly SnMenuItem[]>;
|
|
611
|
+
/** What happens when the bar is too narrow. Default: `auto`. */
|
|
612
|
+
readonly collapse: import("@angular/core").InputSignal<SnCommandBarCollapse>;
|
|
613
|
+
protected readonly skin: import("@angular/core").Signal<Skin>;
|
|
614
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
615
|
+
/** The real OS: how shortcuts in the overflow menu are written. */
|
|
616
|
+
protected readonly platform: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
617
|
+
private readonly layout;
|
|
618
|
+
/** macOS, GNOME, ChromeOS: commands show only their icon. */
|
|
619
|
+
readonly iconOnly: import("@angular/core").Signal<boolean>;
|
|
620
|
+
/** The bar dropped the labels to make room. */
|
|
621
|
+
readonly compact: import("@angular/core").WritableSignal<boolean>;
|
|
622
|
+
protected readonly resolvedTitlePosition: import("@angular/core").Signal<"center" | "start">;
|
|
623
|
+
/** GNOME puts the commands at the start of the header bar, before the title. */
|
|
624
|
+
protected readonly commandsLead: import("@angular/core").Signal<boolean>;
|
|
625
|
+
protected readonly moreGlyph: import("@angular/core").Signal<"menu" | "dots" | "vertical">;
|
|
626
|
+
protected readonly overflow: import("@angular/core").Signal<SnCommandOverflow | undefined>;
|
|
627
|
+
protected readonly menuPosition: ConnectedPosition[];
|
|
628
|
+
protected readonly commandInjector: import("@angular/core").DestroyableInjector;
|
|
629
|
+
private readonly host;
|
|
630
|
+
private readonly destroyRef;
|
|
631
|
+
private readonly titleEl;
|
|
632
|
+
private readonly more;
|
|
633
|
+
private readonly registered;
|
|
634
|
+
/**
|
|
635
|
+
* Every command in document order: projected, grouped, from `[commands]`, and the overflow
|
|
636
|
+
* button (it is a command too).
|
|
637
|
+
*/
|
|
638
|
+
private readonly ordered;
|
|
639
|
+
/** The commands currently in the overflow menu, in document order. */
|
|
640
|
+
private readonly collapsedCommands;
|
|
641
|
+
/** The overflow menu the bar draws: collapsed and secondary commands, then `overflowItems`. */
|
|
642
|
+
protected readonly menuItems: import("@angular/core").Signal<SnMenuItem[]>;
|
|
643
|
+
/** The view exists, so fit() can measure it. */
|
|
644
|
+
private rendered;
|
|
645
|
+
/** Bumped after each fit: which commands are hidden changed. */
|
|
646
|
+
private readonly fitted;
|
|
647
|
+
private readonly active;
|
|
648
|
+
private readonly keys;
|
|
649
|
+
constructor();
|
|
650
|
+
/** @internal */
|
|
651
|
+
register(command: SnCommand): void;
|
|
652
|
+
/** @internal */
|
|
653
|
+
unregister(command: SnCommand): void;
|
|
654
|
+
/** Roving tabindex: the last focused command, or else the first enabled one, is the only tab stop. */
|
|
655
|
+
private keepOneTabStop;
|
|
656
|
+
/** Commands register in creation order; keep them in document order, whichever template they came from. */
|
|
657
|
+
private keepDocumentOrder;
|
|
658
|
+
/** Fit again whenever an input that changes the bar's content width changes. */
|
|
659
|
+
private refitWhenContentChanges;
|
|
660
|
+
/** Fit again when the bar's own width changes. */
|
|
661
|
+
private refitWhenResized;
|
|
662
|
+
/** Text gets wider when a web font arrives, without the bar changing size: fit again then. */
|
|
663
|
+
private refitWhenFontsLoad;
|
|
664
|
+
/** Drops labels and collapses commands until the bar fits. See fitCommandBar(). */
|
|
665
|
+
private fit;
|
|
666
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
667
|
+
protected onFocusin(event: FocusEvent): void;
|
|
668
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnCommandBar, never>;
|
|
669
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnCommandBar, "sn-command-bar", never, {
|
|
670
|
+
"title": {
|
|
671
|
+
"alias": "title";
|
|
672
|
+
"required": false;
|
|
673
|
+
"isSignal": true;
|
|
674
|
+
};
|
|
675
|
+
"titlePosition": {
|
|
676
|
+
"alias": "titlePosition";
|
|
677
|
+
"required": false;
|
|
678
|
+
"isSignal": true;
|
|
679
|
+
};
|
|
680
|
+
"headingLevel": {
|
|
681
|
+
"alias": "headingLevel";
|
|
682
|
+
"required": false;
|
|
683
|
+
"isSignal": true;
|
|
684
|
+
};
|
|
685
|
+
"ariaLabel": {
|
|
686
|
+
"alias": "ariaLabel";
|
|
687
|
+
"required": false;
|
|
688
|
+
"isSignal": true;
|
|
689
|
+
};
|
|
690
|
+
"overflowLabel": {
|
|
691
|
+
"alias": "overflowLabel";
|
|
692
|
+
"required": false;
|
|
693
|
+
"isSignal": true;
|
|
694
|
+
};
|
|
695
|
+
"commands": {
|
|
696
|
+
"alias": "commands";
|
|
697
|
+
"required": false;
|
|
698
|
+
"isSignal": true;
|
|
699
|
+
};
|
|
700
|
+
"overflowItems": {
|
|
701
|
+
"alias": "overflowItems";
|
|
702
|
+
"required": false;
|
|
703
|
+
"isSignal": true;
|
|
704
|
+
};
|
|
705
|
+
"collapse": {
|
|
706
|
+
"alias": "collapse";
|
|
707
|
+
"required": false;
|
|
708
|
+
"isSignal": true;
|
|
709
|
+
};
|
|
710
|
+
}, {}, ["overflow"], ["[snCommandBarStart]", "[snCommandBarEnd]", "*"], true, never>;
|
|
711
|
+
}
|
|
712
|
+
export declare const SnCommandBarImports: readonly [typeof SnCommandBar, typeof SnCommand, typeof SnCommandGroup, typeof SnCommandOverflow];
|
|
713
|
+
/** The side of the anchor the coach mark prefers. It flips to the opposite side when there is no room. */
|
|
714
|
+
type CoachMarkPlacement = 'top' | 'bottom' | 'start' | 'end';
|
|
715
|
+
/** The physical side of the anchor the coach mark ended up on (the beak points back at the anchor). */
|
|
716
|
+
type CoachMarkSide = 'top' | 'bottom' | 'left' | 'right';
|
|
717
|
+
/**
|
|
718
|
+
* An anchored, non-modal teaching popup: title, body, an optional icon or hero image,
|
|
719
|
+
* a close button and action buttons.
|
|
720
|
+
* - Windows 11 / 10: TeachingTip (native): acrylic card with a tail, stretched buttons, primary first
|
|
721
|
+
* - macOS 26 / 13–15: NSPopover: glass popover with an arrow, buttons right-aligned, primary last
|
|
722
|
+
* - GNOME: GtkPopover: opaque rounded popover with an arrow, buttons at the end
|
|
723
|
+
* - KDE Plasma: Kirigami popup: Breeze frame, no arrow, primary first
|
|
724
|
+
* - ChromeOS: Material 3 rich tooltip: tonal container, no arrow, text buttons at the start
|
|
725
|
+
*
|
|
726
|
+
* Anchor it with `[snCoachMarkFor]`. Write the actions secondary first, primary last
|
|
727
|
+
* (the order macOS, GNOME and ChromeOS use); Windows and KDE show them reversed. It doesn't take focus when it opens,
|
|
728
|
+
* but it is placed right after the anchor in the tab order; Esc closes it and returns focus to the anchor.
|
|
729
|
+
*
|
|
730
|
+
* ```html
|
|
731
|
+
* <button hlmBtn [snCoachMarkFor]="tip" (click)="tip.toggle()">Sync</button>
|
|
732
|
+
* <sn-coach-mark #tip title="Sync across devices" [(open)]="showTip">
|
|
733
|
+
* Turn on sync to keep your backups available on every device you sign in to.
|
|
734
|
+
* <button snCoachMarkAction hlmBtn variant="secondary" (click)="tip.hide()">Not now</button>
|
|
735
|
+
* <button snCoachMarkAction hlmBtn (click)="turnOnSync()">Turn on</button>
|
|
736
|
+
* </sn-coach-mark>
|
|
737
|
+
* ```
|
|
738
|
+
*
|
|
739
|
+
* The host gets `data-placed` once the overlay has positioned it, and `data-side` with the side it landed on.
|
|
740
|
+
*/
|
|
741
|
+
export declare class SnCoachMark {
|
|
742
|
+
readonly title: import("@angular/core").InputSignal<string>;
|
|
743
|
+
/** An @ng-icons name the app has registered, shown before the title. */
|
|
744
|
+
readonly icon: import("@angular/core").InputSignal<string>;
|
|
745
|
+
readonly placement: import("@angular/core").InputSignal<CoachMarkPlacement>;
|
|
746
|
+
readonly closeLabel: import("@angular/core").InputSignal<string>;
|
|
747
|
+
readonly open: import("@angular/core").ModelSignal<boolean>;
|
|
748
|
+
/** Set by `[snCoachMarkFor]`. */
|
|
749
|
+
readonly anchor: import("@angular/core").WritableSignal<HTMLElement | null>;
|
|
750
|
+
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
751
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
752
|
+
protected readonly titleId: string;
|
|
753
|
+
readonly bodyId: string;
|
|
754
|
+
private readonly host;
|
|
755
|
+
private readonly document;
|
|
756
|
+
private readonly injector;
|
|
757
|
+
private overlay?;
|
|
758
|
+
private strategy?;
|
|
759
|
+
private overlayAnchor?;
|
|
760
|
+
constructor();
|
|
761
|
+
show(): void;
|
|
762
|
+
hide(): void;
|
|
763
|
+
toggle(): void;
|
|
764
|
+
protected onEscape(event: Event): void;
|
|
765
|
+
private attach;
|
|
766
|
+
private detach;
|
|
767
|
+
/** After each positioning: which side it landed on and where the beak points. */
|
|
768
|
+
private placed;
|
|
769
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnCoachMark, never>;
|
|
770
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnCoachMark, "sn-coach-mark", never, {
|
|
771
|
+
"title": {
|
|
772
|
+
"alias": "title";
|
|
773
|
+
"required": true;
|
|
774
|
+
"isSignal": true;
|
|
775
|
+
};
|
|
776
|
+
"icon": {
|
|
777
|
+
"alias": "icon";
|
|
778
|
+
"required": false;
|
|
779
|
+
"isSignal": true;
|
|
780
|
+
};
|
|
781
|
+
"placement": {
|
|
782
|
+
"alias": "placement";
|
|
783
|
+
"required": false;
|
|
784
|
+
"isSignal": true;
|
|
785
|
+
};
|
|
786
|
+
"closeLabel": {
|
|
787
|
+
"alias": "closeLabel";
|
|
788
|
+
"required": false;
|
|
789
|
+
"isSignal": true;
|
|
790
|
+
};
|
|
791
|
+
"open": {
|
|
792
|
+
"alias": "open";
|
|
793
|
+
"required": false;
|
|
794
|
+
"isSignal": true;
|
|
795
|
+
};
|
|
796
|
+
}, {
|
|
797
|
+
"open": "openChange";
|
|
798
|
+
}, never, ["[snCoachMarkHero]", "*", "[snCoachMarkAction]"], true, never>;
|
|
799
|
+
}
|
|
800
|
+
/**
|
|
801
|
+
* Anchors a `<sn-coach-mark>` to this element. Esc on the anchor closes the open coach mark,
|
|
802
|
+
* and the anchor is described by the coach mark while it is open.
|
|
803
|
+
*/
|
|
804
|
+
export declare class SnCoachMarkFor {
|
|
805
|
+
readonly snCoachMarkFor: import("@angular/core").InputSignal<SnCoachMark>;
|
|
806
|
+
constructor();
|
|
807
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnCoachMarkFor, never>;
|
|
808
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SnCoachMarkFor, "[snCoachMarkFor]", never, {
|
|
809
|
+
"snCoachMarkFor": {
|
|
810
|
+
"alias": "snCoachMarkFor";
|
|
811
|
+
"required": true;
|
|
812
|
+
"isSignal": true;
|
|
813
|
+
};
|
|
814
|
+
}, {}, never, never, true, never>;
|
|
815
|
+
}
|
|
816
|
+
export declare const SnCoachMarkImports: readonly [typeof SnCoachMark, typeof SnCoachMarkFor];
|
|
817
|
+
/**
|
|
818
|
+
* A modal form whose layout follows the OS:
|
|
819
|
+
* - macOS: a sheet that slides down from under the window's title bar, no title bar of its own,
|
|
820
|
+
* buttons bottom-right with the default button rightmost
|
|
821
|
+
* - Windows: a ContentDialog, centered over a smoke backdrop, title top-left, buttons in a footer
|
|
822
|
+
* band (primary first, buttons share the width)
|
|
823
|
+
* - GNOME: an AdwDialog, Cancel and the primary button in a header bar around a centered title, no footer
|
|
824
|
+
* - KDE: a window-modal QDialog with a frame and a title strip, buttons bottom-right (primary, then Cancel)
|
|
825
|
+
* - ChromeOS: a Material 3 dialog, large corners, headline, actions at the bottom end
|
|
826
|
+
*
|
|
827
|
+
* Mark the buttons with `snSheetCancel` and `snSheetPrimary` so they can be placed per OS.
|
|
828
|
+
* Esc and the Cancel button close the sheet (`open` becomes false); the primary button is yours to handle.
|
|
829
|
+
* A third button that doesn't close the sheet (Back, Don't Save, Help) goes in `snSheetSecondary`:
|
|
830
|
+
* at the leading edge on macOS, KDE and ChromeOS, between primary and Cancel on Windows, and in
|
|
831
|
+
* a row under the content on GNOME.
|
|
832
|
+
* On macOS the sheet hangs from the title bar of the nearest ancestor marked `snSheetHost`
|
|
833
|
+
* (the window frame); without one it hangs from the top of the viewport.
|
|
834
|
+
*
|
|
835
|
+
* ```html
|
|
836
|
+
* <div class="sn-window" snSheetHost>
|
|
837
|
+
* <sn-title-bar title="Harbor Backup" />
|
|
838
|
+
* <sn-modal-sheet [(open)]="adding" title="New destination">
|
|
839
|
+
* <label hlmLabel>Name <input hlmInput /></label>
|
|
840
|
+
* <button hlmBtn variant="outline" snSheetCancel>Cancel</button>
|
|
841
|
+
* <button hlmBtn variant="outline" snSheetSecondary (click)="back()">Back</button>
|
|
842
|
+
* <button hlmBtn snSheetPrimary (click)="create()">Create</button>
|
|
843
|
+
* </sn-modal-sheet>
|
|
844
|
+
* </div>
|
|
845
|
+
* ```
|
|
846
|
+
*/
|
|
847
|
+
export declare class SnModalSheet {
|
|
848
|
+
readonly open: import("@angular/core").ModelSignal<boolean>;
|
|
849
|
+
readonly title: import("@angular/core").InputSignal<string>;
|
|
850
|
+
/** Use `alertdialog` for confirmations (e.g. a destructive action). */
|
|
851
|
+
readonly role: import("@angular/core").InputSignal<"dialog" | "alertdialog">;
|
|
852
|
+
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
853
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
854
|
+
protected readonly titleId: string;
|
|
855
|
+
private readonly panel;
|
|
856
|
+
private readonly dialog;
|
|
857
|
+
private readonly injector;
|
|
858
|
+
private readonly host;
|
|
859
|
+
private ref?;
|
|
860
|
+
constructor();
|
|
861
|
+
private show;
|
|
862
|
+
/** The viewport y where a macOS sheet hangs from: the host window's title bar, else its top edge. */
|
|
863
|
+
private sheetTop;
|
|
864
|
+
private position;
|
|
865
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnModalSheet, never>;
|
|
866
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnModalSheet, "sn-modal-sheet", never, {
|
|
867
|
+
"open": {
|
|
868
|
+
"alias": "open";
|
|
869
|
+
"required": false;
|
|
870
|
+
"isSignal": true;
|
|
871
|
+
};
|
|
872
|
+
"title": {
|
|
873
|
+
"alias": "title";
|
|
874
|
+
"required": true;
|
|
875
|
+
"isSignal": true;
|
|
876
|
+
};
|
|
877
|
+
"role": {
|
|
878
|
+
"alias": "role";
|
|
879
|
+
"required": false;
|
|
880
|
+
"isSignal": true;
|
|
881
|
+
};
|
|
882
|
+
}, {
|
|
883
|
+
"open": "openChange";
|
|
884
|
+
}, never, ["*", "[snSheetSecondary]", "[snSheetCancel]", "[snSheetPrimary]"], true, never>;
|
|
885
|
+
}
|
|
886
|
+
/**
|
|
887
|
+
* Lays out the main content with an `<sn-inspector>` on the trailing side. Below 40rem of
|
|
888
|
+
* width the inspector floats over the content instead of squeezing it (AdwOverlaySplitView).
|
|
889
|
+
*
|
|
890
|
+
* ```html
|
|
891
|
+
* <sn-inspector-layout>
|
|
892
|
+
* <div snSelectable [(selection)]="selected">…</div>
|
|
893
|
+
* <sn-inspector [(open)]="infoOpen" [title]="file().name" icon="lucideFileText">…</sn-inspector>
|
|
894
|
+
* </sn-inspector-layout>
|
|
895
|
+
* ```
|
|
896
|
+
*/
|
|
897
|
+
export declare class SnInspectorLayout {
|
|
898
|
+
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
899
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
900
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnInspectorLayout, never>;
|
|
901
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnInspectorLayout, "sn-inspector-layout", never, {}, {}, never, ["*", "sn-inspector"], true, never>;
|
|
902
|
+
}
|
|
903
|
+
/**
|
|
904
|
+
* The detail side panel for the current selection:
|
|
905
|
+
* - macOS: Inspector, a glass trailing column with section headers (floating on macOS 26)
|
|
906
|
+
* - Windows: SplitView pane on the trailing side with a stroke divider
|
|
907
|
+
* - GNOME: AdwOverlaySplitView sidebar (sidebar color, header-bar title; overlays on narrow widths)
|
|
908
|
+
* - KDE: Dolphin information panel, big preview icon on top, then the properties
|
|
909
|
+
* - ChromeOS: Material 3 side sheet with a headline and a close button
|
|
910
|
+
*
|
|
911
|
+
* `icon` is an @ng-icons name the app registered with provideIcons(). Hidden while `open` is false.
|
|
912
|
+
*
|
|
913
|
+
* ```html
|
|
914
|
+
* <sn-inspector [(open)]="infoOpen" title="Q3 report.pdf" icon="lucideFileText">
|
|
915
|
+
* <sn-inspector-section title="General">
|
|
916
|
+
* <sn-inspector-property label="Kind">PDF document</sn-inspector-property>
|
|
917
|
+
* <sn-inspector-property label="Size">2.4 MB</sn-inspector-property>
|
|
918
|
+
* </sn-inspector-section>
|
|
919
|
+
* </sn-inspector>
|
|
920
|
+
* ```
|
|
921
|
+
*/
|
|
922
|
+
export declare class SnInspector {
|
|
923
|
+
/** Shown or hidden. Two-way bindable; the ChromeOS close button sets it to false. */
|
|
924
|
+
readonly open: import("@angular/core").ModelSignal<boolean>;
|
|
925
|
+
/** The panel's heading, usually the selected item's name; also its accessible name. */
|
|
926
|
+
readonly title: import("@angular/core").InputSignal<string>;
|
|
927
|
+
/** Preview icon above (KDE) or next to the title. */
|
|
928
|
+
readonly icon: import("@angular/core").InputSignal<string>;
|
|
929
|
+
protected readonly headingId: string;
|
|
930
|
+
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
931
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
932
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnInspector, never>;
|
|
933
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnInspector, "sn-inspector", never, {
|
|
934
|
+
"open": {
|
|
935
|
+
"alias": "open";
|
|
936
|
+
"required": false;
|
|
937
|
+
"isSignal": true;
|
|
938
|
+
};
|
|
939
|
+
"title": {
|
|
940
|
+
"alias": "title";
|
|
941
|
+
"required": true;
|
|
942
|
+
"isSignal": true;
|
|
943
|
+
};
|
|
944
|
+
"icon": {
|
|
945
|
+
"alias": "icon";
|
|
946
|
+
"required": false;
|
|
947
|
+
"isSignal": true;
|
|
948
|
+
};
|
|
949
|
+
}, {
|
|
950
|
+
"open": "openChange";
|
|
951
|
+
}, never, ["*"], true, never>;
|
|
952
|
+
}
|
|
953
|
+
/** A titled group of properties or controls inside the inspector ("General", "Sharing", …). */
|
|
954
|
+
export declare class SnInspectorSection {
|
|
955
|
+
readonly title: import("@angular/core").InputSignal<string>;
|
|
956
|
+
protected readonly headingId: string;
|
|
957
|
+
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
958
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
959
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnInspectorSection, never>;
|
|
960
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnInspectorSection, "sn-inspector-section", never, {
|
|
961
|
+
"title": {
|
|
962
|
+
"alias": "title";
|
|
963
|
+
"required": false;
|
|
964
|
+
"isSignal": true;
|
|
965
|
+
};
|
|
966
|
+
}, {}, never, ["*"], true, never>;
|
|
967
|
+
}
|
|
968
|
+
/**
|
|
969
|
+
* A label/value row. The value is the content. macOS and KDE align labels in a column
|
|
970
|
+
* ("Kind: PDF document"); Windows, GNOME and ChromeOS stack a small label above the value.
|
|
971
|
+
*/
|
|
972
|
+
export declare class SnInspectorProperty {
|
|
973
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
974
|
+
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
975
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
976
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnInspectorProperty, never>;
|
|
977
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnInspectorProperty, "sn-inspector-property", never, {
|
|
978
|
+
"label": {
|
|
979
|
+
"alias": "label";
|
|
980
|
+
"required": true;
|
|
981
|
+
"isSignal": true;
|
|
982
|
+
};
|
|
983
|
+
}, {}, never, ["*"], true, never>;
|
|
984
|
+
}
|
|
985
|
+
export declare const SnInspectorImports: readonly [typeof SnInspectorLayout, typeof SnInspector, typeof SnInspectorSection, typeof SnInspectorProperty];
|
|
986
|
+
/**
|
|
987
|
+
* The app's sidebar navigation, with the platform's selection idiom on the current item:
|
|
988
|
+
* - Windows 11: NavigationView, hover fill plus the accent pill on the selected item
|
|
989
|
+
* - Windows 10: square items, `primary 30%` fill with a full-height accent bar
|
|
990
|
+
* - macOS: source list on the sidebar material, accent-tinted fill, grey while the window is inactive
|
|
991
|
+
* - GNOME: AdwNavigationSplitView sidebar, neutral rounded selection
|
|
992
|
+
* - KDE: Breeze places panel, accent outline on hover, accent-filled selection
|
|
993
|
+
* - ChromeOS: Material 3 navigation drawer, tonal pill
|
|
994
|
+
*
|
|
995
|
+
* The host carries the theme's `sn-sidebar` material. Items are plain links or buttons
|
|
996
|
+
* (no Router needed); mark the current one with `[active]`. ↑ ↓ Home End move between items.
|
|
997
|
+
*
|
|
998
|
+
* ```html
|
|
999
|
+
* <sn-sidebar-nav aria-label="Sections">
|
|
1000
|
+
* <sn-sidebar-section title="Backups">
|
|
1001
|
+
* <a snSidebarItem href="#" icon="lucideLayoutDashboard" [active]="page() === 'overview'">Overview</a>
|
|
1002
|
+
* <button snSidebarItem icon="lucideHistory" badge="3" (click)="page.set('restore')">Restore files</button>
|
|
1003
|
+
* </sn-sidebar-section>
|
|
1004
|
+
* </sn-sidebar-nav>
|
|
1005
|
+
* ```
|
|
1006
|
+
*
|
|
1007
|
+
* With the Router: `<a snSidebarItem routerLink="/x" routerLinkActive #rla="routerLinkActive" [active]="rla.isActive">`.
|
|
1008
|
+
*/
|
|
1009
|
+
export declare class SnSidebarNav {
|
|
1010
|
+
private readonly items;
|
|
1011
|
+
/** The item that keeps the single Tab stop: the last focused one, else the active one, else the first. */
|
|
1012
|
+
private readonly focused;
|
|
1013
|
+
readonly tabStop: import("@angular/core").Signal<any>;
|
|
1014
|
+
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
1015
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
1016
|
+
/** @internal */
|
|
1017
|
+
setFocused(item: SnSidebarItem): void;
|
|
1018
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
1019
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnSidebarNav, never>;
|
|
1020
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnSidebarNav, "sn-sidebar-nav", never, {}, {}, ["items"], ["*"], true, never>;
|
|
1021
|
+
}
|
|
1022
|
+
/**
|
|
1023
|
+
* A titled group of items: "Favorites", "Locations", … Leave `title` empty for an unlabeled group.
|
|
1024
|
+
*/
|
|
1025
|
+
export declare class SnSidebarSection {
|
|
1026
|
+
readonly title: import("@angular/core").InputSignal<string>;
|
|
1027
|
+
protected readonly headingId: string;
|
|
1028
|
+
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
1029
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
1030
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnSidebarSection, never>;
|
|
1031
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnSidebarSection, "sn-sidebar-section", never, {
|
|
1032
|
+
"title": {
|
|
1033
|
+
"alias": "title";
|
|
1034
|
+
"required": false;
|
|
1035
|
+
"isSignal": true;
|
|
1036
|
+
};
|
|
1037
|
+
}, {}, never, ["*"], true, never>;
|
|
1038
|
+
}
|
|
1039
|
+
/**
|
|
1040
|
+
* One navigation item, on an `<a>` or a `<button>`. `icon` is an @ng-icons name the app
|
|
1041
|
+
* registered with provideIcons(); `badge` is a short count or label on the trailing side.
|
|
1042
|
+
*/
|
|
1043
|
+
export declare class SnSidebarItem {
|
|
1044
|
+
readonly active: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1045
|
+
readonly icon: import("@angular/core").InputSignal<string>;
|
|
1046
|
+
readonly badge: import("@angular/core").InputSignal<string | number>;
|
|
1047
|
+
readonly element: HTMLElement;
|
|
1048
|
+
protected readonly nav: SnSidebarNav | null;
|
|
1049
|
+
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
1050
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
1051
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnSidebarItem, never>;
|
|
1052
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnSidebarItem, "a[snSidebarItem], button[snSidebarItem]", never, {
|
|
1053
|
+
"active": {
|
|
1054
|
+
"alias": "active";
|
|
1055
|
+
"required": false;
|
|
1056
|
+
"isSignal": true;
|
|
1057
|
+
};
|
|
1058
|
+
"icon": {
|
|
1059
|
+
"alias": "icon";
|
|
1060
|
+
"required": false;
|
|
1061
|
+
"isSignal": true;
|
|
1062
|
+
};
|
|
1063
|
+
"badge": {
|
|
1064
|
+
"alias": "badge";
|
|
1065
|
+
"required": false;
|
|
1066
|
+
"isSignal": true;
|
|
1067
|
+
};
|
|
1068
|
+
}, {}, never, ["*"], true, never>;
|
|
1069
|
+
}
|
|
1070
|
+
export declare const SnSidebarNavImports: readonly [typeof SnSidebarNav, typeof SnSidebarSection, typeof SnSidebarItem];
|
|
1071
|
+
/**
|
|
1072
|
+
* One page of an `<sn-assistant>`.
|
|
1073
|
+
*
|
|
1074
|
+
* ```html
|
|
1075
|
+
* <ng-template snAssistantPage title="Destination" [canContinue]="form.valid">…</ng-template>
|
|
1076
|
+
* ```
|
|
1077
|
+
*/
|
|
1078
|
+
export declare class SnAssistantPage {
|
|
1079
|
+
readonly template: TemplateRef<any>;
|
|
1080
|
+
/** The page's title, shown as its heading (and in the KDE step list). */
|
|
1081
|
+
readonly title: import("@angular/core").InputSignal<string>;
|
|
1082
|
+
/** False disables Next / Continue (e.g. while the page's form is invalid). Default: true. */
|
|
1083
|
+
readonly canContinue: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1084
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnAssistantPage, never>;
|
|
1085
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SnAssistantPage, "ng-template[snAssistantPage]", never, {
|
|
1086
|
+
"title": {
|
|
1087
|
+
"alias": "title";
|
|
1088
|
+
"required": true;
|
|
1089
|
+
"isSignal": true;
|
|
1090
|
+
};
|
|
1091
|
+
"canContinue": {
|
|
1092
|
+
"alias": "canContinue";
|
|
1093
|
+
"required": false;
|
|
1094
|
+
"isSignal": true;
|
|
1095
|
+
};
|
|
1096
|
+
}, {}, never, never, true, never>;
|
|
1097
|
+
}
|
|
1098
|
+
/**
|
|
1099
|
+
* A step-by-step setup flow, laid out the way each OS does it:
|
|
1100
|
+
* - Windows: a wizard, "Step 2 of 4" over the page title, Back · Next · Cancel at the bottom right
|
|
1101
|
+
* - macOS: a Setup Assistant page, large centered title, Go Back · Continue at the bottom right
|
|
1102
|
+
* - GNOME: Back and Next in a header bar around the page title, page dots at the bottom
|
|
1103
|
+
* - KDE: a QWizard with the list of steps at the side, Back · Next · Cancel at the bottom right
|
|
1104
|
+
* - ChromeOS: an M3 flow, headline, page dots, Back · Next at the bottom end
|
|
1105
|
+
*
|
|
1106
|
+
* Pages are templates; only the current one is rendered. Next becomes Finish / Done on the last
|
|
1107
|
+
* page and emits `finish`; Cancel emits `cancel`. Bind `step` to keep or set the page. Put it in an
|
|
1108
|
+
* `<sn-modal-sheet>` (without sheet buttons) for a modal assistant, or in a window as a page.
|
|
1109
|
+
*
|
|
1110
|
+
* ```html
|
|
1111
|
+
* <sn-assistant [(step)]="step" (finish)="save()" (cancel)="open.set(false)">
|
|
1112
|
+
* <ng-template snAssistantPage title="Welcome">…</ng-template>
|
|
1113
|
+
* <ng-template snAssistantPage title="Destination" [canContinue]="destination() !== null">…</ng-template>
|
|
1114
|
+
* <ng-template snAssistantPage title="Schedule">…</ng-template>
|
|
1115
|
+
* </sn-assistant>
|
|
1116
|
+
* ```
|
|
1117
|
+
*
|
|
1118
|
+
* The buttons carry spartan's button hooks (`data-slot="button"`), so the theme draws them as each
|
|
1119
|
+
* skin's standard and accent buttons. Their words follow the OS (Continue on macOS, Finish on
|
|
1120
|
+
* Windows…); set `backLabel`, `nextLabel`, `finishLabel`, `cancelLabel` to translate them.
|
|
1121
|
+
*/
|
|
1122
|
+
export declare class SnAssistant {
|
|
1123
|
+
/** The current page, from 0. */
|
|
1124
|
+
readonly step: import("@angular/core").ModelSignal<number>;
|
|
1125
|
+
/** Show a Cancel button. Default: true. */
|
|
1126
|
+
readonly cancelable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1127
|
+
readonly backLabel: import("@angular/core").InputSignal<string>;
|
|
1128
|
+
readonly nextLabel: import("@angular/core").InputSignal<string>;
|
|
1129
|
+
readonly finishLabel: import("@angular/core").InputSignal<string>;
|
|
1130
|
+
readonly cancelLabel: import("@angular/core").InputSignal<string>;
|
|
1131
|
+
/** "Step {current} of {total}" on Windows; `{current}` and `{total}` are replaced. */
|
|
1132
|
+
readonly progressLabel: import("@angular/core").InputSignal<string>;
|
|
1133
|
+
/** Next on the last page. */
|
|
1134
|
+
readonly finish: import("@angular/core").OutputEmitterRef<void>;
|
|
1135
|
+
readonly cancel: import("@angular/core").OutputEmitterRef<void>;
|
|
1136
|
+
protected readonly skin: import("@angular/core").Signal<Skin>;
|
|
1137
|
+
protected readonly family: import("@angular/core").Signal<PlatformFamily>;
|
|
1138
|
+
protected readonly words: import("@angular/core").Signal<{
|
|
1139
|
+
back: string;
|
|
1140
|
+
next: string;
|
|
1141
|
+
finish: string;
|
|
1142
|
+
cancel: string;
|
|
1143
|
+
}>;
|
|
1144
|
+
protected readonly pages: import("@angular/core").Signal<readonly SnAssistantPage[]>;
|
|
1145
|
+
protected readonly current: import("@angular/core").Signal<number>;
|
|
1146
|
+
protected readonly page: import("@angular/core").Signal<SnAssistantPage>;
|
|
1147
|
+
protected readonly last: import("@angular/core").Signal<boolean>;
|
|
1148
|
+
protected readonly showDots: import("@angular/core").Signal<boolean>;
|
|
1149
|
+
protected readonly progressText: import("@angular/core").Signal<string>;
|
|
1150
|
+
protected readonly headingId: string;
|
|
1151
|
+
private readonly heading;
|
|
1152
|
+
private readonly host;
|
|
1153
|
+
constructor();
|
|
1154
|
+
/** Goes to the next page, or emits `finish` on the last one. */
|
|
1155
|
+
next(): void;
|
|
1156
|
+
/** Goes to the previous page. */
|
|
1157
|
+
back(): void;
|
|
1158
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnAssistant, never>;
|
|
1159
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnAssistant, "sn-assistant", never, {
|
|
1160
|
+
"step": {
|
|
1161
|
+
"alias": "step";
|
|
1162
|
+
"required": false;
|
|
1163
|
+
"isSignal": true;
|
|
1164
|
+
};
|
|
1165
|
+
"cancelable": {
|
|
1166
|
+
"alias": "cancelable";
|
|
1167
|
+
"required": false;
|
|
1168
|
+
"isSignal": true;
|
|
1169
|
+
};
|
|
1170
|
+
"backLabel": {
|
|
1171
|
+
"alias": "backLabel";
|
|
1172
|
+
"required": false;
|
|
1173
|
+
"isSignal": true;
|
|
1174
|
+
};
|
|
1175
|
+
"nextLabel": {
|
|
1176
|
+
"alias": "nextLabel";
|
|
1177
|
+
"required": false;
|
|
1178
|
+
"isSignal": true;
|
|
1179
|
+
};
|
|
1180
|
+
"finishLabel": {
|
|
1181
|
+
"alias": "finishLabel";
|
|
1182
|
+
"required": false;
|
|
1183
|
+
"isSignal": true;
|
|
1184
|
+
};
|
|
1185
|
+
"cancelLabel": {
|
|
1186
|
+
"alias": "cancelLabel";
|
|
1187
|
+
"required": false;
|
|
1188
|
+
"isSignal": true;
|
|
1189
|
+
};
|
|
1190
|
+
"progressLabel": {
|
|
1191
|
+
"alias": "progressLabel";
|
|
1192
|
+
"required": false;
|
|
1193
|
+
"isSignal": true;
|
|
1194
|
+
};
|
|
1195
|
+
}, {
|
|
1196
|
+
"step": "stepChange";
|
|
1197
|
+
"finish": "finish";
|
|
1198
|
+
"cancel": "cancel";
|
|
1199
|
+
}, ["pages"], never, true, never>;
|
|
1200
|
+
}
|
|
1201
|
+
export declare const SnAssistantImports: readonly [typeof SnAssistant, typeof SnAssistantPage];
|
|
1202
|
+
/**
|
|
1203
|
+
* A list of setup tasks: numbered rows that tick off as they are done, each with an action.
|
|
1204
|
+
*
|
|
1205
|
+
* ```html
|
|
1206
|
+
* <sn-checklist aria-label="Get started">
|
|
1207
|
+
* <sn-checklist-item title="Add a destination" [done]="hasDestination()">
|
|
1208
|
+
* Where your backups go: a disk, a NAS or the cloud.
|
|
1209
|
+
* <button hlmBtn size="sm" snChecklistAction (click)="add()">Add…</button>
|
|
1210
|
+
* </sn-checklist-item>
|
|
1211
|
+
* <sn-checklist-item title="Choose what to back up">…</sn-checklist-item>
|
|
1212
|
+
* </sn-checklist>
|
|
1213
|
+
* ```
|
|
1214
|
+
*/
|
|
1215
|
+
export declare class SnChecklist {
|
|
1216
|
+
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
1217
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
1218
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnChecklist, never>;
|
|
1219
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnChecklist, "sn-checklist", never, {}, {}, never, ["*"], true, never>;
|
|
1220
|
+
}
|
|
1221
|
+
/**
|
|
1222
|
+
* One task of an `<sn-checklist>`: a number (a tick once `done`), the title, a description
|
|
1223
|
+
* (the content) and an action (`[snChecklistAction]`, hidden once done unless `keepAction`).
|
|
1224
|
+
*/
|
|
1225
|
+
export declare class SnChecklistItem {
|
|
1226
|
+
readonly title: import("@angular/core").InputSignal<string>;
|
|
1227
|
+
readonly done: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1228
|
+
/** Keep the action visible once the task is done (e.g. "Change…"). */
|
|
1229
|
+
readonly keepAction: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1230
|
+
/** Read by screen readers after the title. */
|
|
1231
|
+
readonly doneLabel: import("@angular/core").InputSignal<string>;
|
|
1232
|
+
readonly todoLabel: import("@angular/core").InputSignal<string>;
|
|
1233
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnChecklistItem, never>;
|
|
1234
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnChecklistItem, "sn-checklist-item", never, {
|
|
1235
|
+
"title": {
|
|
1236
|
+
"alias": "title";
|
|
1237
|
+
"required": true;
|
|
1238
|
+
"isSignal": true;
|
|
1239
|
+
};
|
|
1240
|
+
"done": {
|
|
1241
|
+
"alias": "done";
|
|
1242
|
+
"required": false;
|
|
1243
|
+
"isSignal": true;
|
|
1244
|
+
};
|
|
1245
|
+
"keepAction": {
|
|
1246
|
+
"alias": "keepAction";
|
|
1247
|
+
"required": false;
|
|
1248
|
+
"isSignal": true;
|
|
1249
|
+
};
|
|
1250
|
+
"doneLabel": {
|
|
1251
|
+
"alias": "doneLabel";
|
|
1252
|
+
"required": false;
|
|
1253
|
+
"isSignal": true;
|
|
1254
|
+
};
|
|
1255
|
+
"todoLabel": {
|
|
1256
|
+
"alias": "todoLabel";
|
|
1257
|
+
"required": false;
|
|
1258
|
+
"isSignal": true;
|
|
1259
|
+
};
|
|
1260
|
+
}, {}, never, ["*", "[snChecklistAction]"], true, never>;
|
|
1261
|
+
}
|
|
1262
|
+
export declare const SnChecklistImports: readonly [typeof SnChecklist, typeof SnChecklistItem];
|
|
1263
|
+
/**
|
|
1264
|
+
* The menu of an `<sn-split-button>`: the other choices for the action. Put a stock menu
|
|
1265
|
+
* inside, e.g. hlmDropdownMenu:
|
|
1266
|
+
*
|
|
1267
|
+
* ```html
|
|
1268
|
+
* <ng-template snSplitButtonMenu>
|
|
1269
|
+
* <div hlmDropdownMenu>
|
|
1270
|
+
* <button hlmDropdownMenuItem>Back up Documents only</button>
|
|
1271
|
+
* </div>
|
|
1272
|
+
* </ng-template>
|
|
1273
|
+
* ```
|
|
1274
|
+
*/
|
|
1275
|
+
export declare class SnSplitButtonMenu {
|
|
1276
|
+
readonly template: TemplateRef<any>;
|
|
1277
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnSplitButtonMenu, never>;
|
|
1278
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SnSplitButtonMenu, "ng-template[snSplitButtonMenu]", never, {}, {}, never, never, true, never>;
|
|
1279
|
+
}
|
|
1280
|
+
/** standard: the platform's normal button · accent: the suggested / default action */
|
|
1281
|
+
type SnSplitButtonVariant = 'standard' | 'accent';
|
|
1282
|
+
/**
|
|
1283
|
+
* A button that runs its main action, joined to a second button that opens a menu of
|
|
1284
|
+
* alternatives. Each part is drawn as the skin's own button, so it matches the buttons next to it:
|
|
1285
|
+
* - Windows 11 / 10: Fluent SplitButton, one control with a divider before the chevron
|
|
1286
|
+
* - macOS 26 / 13–15: NSComboButton (split style), a capsule (26) or bezel (13–15) with a divider
|
|
1287
|
+
* - GNOME: AdwSplitButton, two linked buttons
|
|
1288
|
+
* - KDE: a QToolButton with a MenuButtonPopup arrow
|
|
1289
|
+
* - ChromeOS: the Material 3 split button, two segments with a 2px gap and tight inner corners
|
|
1290
|
+
*
|
|
1291
|
+
* Two Tab stops: the action, then the menu button. On the action, ↓ (Alt+↓ on Windows)
|
|
1292
|
+
* opens the menu too.
|
|
1293
|
+
*
|
|
1294
|
+
* ```html
|
|
1295
|
+
* <sn-split-button label="Back up now" icon="lucideCloudUpload" variant="accent" (triggered)="backUp()">
|
|
1296
|
+
* <ng-template snSplitButtonMenu>
|
|
1297
|
+
* <div hlmDropdownMenu>
|
|
1298
|
+
* <button hlmDropdownMenuItem (triggered)="backUp('documents')">Documents only</button>
|
|
1299
|
+
* <button hlmDropdownMenuItem (triggered)="verify()">Verify last backup</button>
|
|
1300
|
+
* </div>
|
|
1301
|
+
* </ng-template>
|
|
1302
|
+
* </sn-split-button>
|
|
1303
|
+
* ```
|
|
1304
|
+
*/
|
|
1305
|
+
export declare class SnSplitButton {
|
|
1306
|
+
/** The main action's text (also the group's accessible name). */
|
|
1307
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
1308
|
+
/** An @ng-icons name registered with provideIcons(), shown before the label. */
|
|
1309
|
+
readonly icon: import("@angular/core").InputSignal<string>;
|
|
1310
|
+
readonly variant: import("@angular/core").InputSignal<SnSplitButtonVariant>;
|
|
1311
|
+
/** The compact size (the theme's small button height). */
|
|
1312
|
+
readonly small: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1313
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1314
|
+
/** Accessible name and tooltip of the menu button. */
|
|
1315
|
+
readonly menuLabel: import("@angular/core").InputSignal<string>;
|
|
1316
|
+
/** The main action was clicked (or Enter / Space). */
|
|
1317
|
+
readonly triggered: import("@angular/core").OutputEmitterRef<void>;
|
|
1318
|
+
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
1319
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
1320
|
+
protected readonly menu: import("@angular/core").Signal<SnSplitButtonMenu | undefined>;
|
|
1321
|
+
private readonly trigger;
|
|
1322
|
+
protected readonly partClass: import("@angular/core").Signal<string>;
|
|
1323
|
+
protected readonly menuPosition: ConnectedPosition[];
|
|
1324
|
+
/** Opens the menu, e.g. from a keyboard shortcut. */
|
|
1325
|
+
open(): void;
|
|
1326
|
+
protected onActionKeydown(event: KeyboardEvent): void;
|
|
1327
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnSplitButton, never>;
|
|
1328
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnSplitButton, "sn-split-button", never, {
|
|
1329
|
+
"label": {
|
|
1330
|
+
"alias": "label";
|
|
1331
|
+
"required": true;
|
|
1332
|
+
"isSignal": true;
|
|
1333
|
+
};
|
|
1334
|
+
"icon": {
|
|
1335
|
+
"alias": "icon";
|
|
1336
|
+
"required": false;
|
|
1337
|
+
"isSignal": true;
|
|
1338
|
+
};
|
|
1339
|
+
"variant": {
|
|
1340
|
+
"alias": "variant";
|
|
1341
|
+
"required": false;
|
|
1342
|
+
"isSignal": true;
|
|
1343
|
+
};
|
|
1344
|
+
"small": {
|
|
1345
|
+
"alias": "small";
|
|
1346
|
+
"required": false;
|
|
1347
|
+
"isSignal": true;
|
|
1348
|
+
};
|
|
1349
|
+
"disabled": {
|
|
1350
|
+
"alias": "disabled";
|
|
1351
|
+
"required": false;
|
|
1352
|
+
"isSignal": true;
|
|
1353
|
+
};
|
|
1354
|
+
"menuLabel": {
|
|
1355
|
+
"alias": "menuLabel";
|
|
1356
|
+
"required": false;
|
|
1357
|
+
"isSignal": true;
|
|
1358
|
+
};
|
|
1359
|
+
}, {
|
|
1360
|
+
"triggered": "triggered";
|
|
1361
|
+
}, ["menu"], never, true, never>;
|
|
1362
|
+
}
|
|
1363
|
+
export declare const SnSplitButtonImports: readonly [typeof SnSplitButton, typeof SnSplitButtonMenu];
|
|
1364
|
+
/**
|
|
1365
|
+
* Evaluates the simple arithmetic a Fluent NumberBox accepts: numbers, + − * /, parentheses
|
|
1366
|
+
* and unary minus. A comma works as the decimal separator too. Returns null for anything else
|
|
1367
|
+
* (no variables, no functions, nothing is executed).
|
|
1368
|
+
*
|
|
1369
|
+
* ```ts
|
|
1370
|
+
* evaluateNumberExpression('1.5 * (2 + 2)') // 6
|
|
1371
|
+
* evaluateNumberExpression('12,5') // 12.5
|
|
1372
|
+
* ```
|
|
1373
|
+
*/
|
|
1374
|
+
export declare function evaluateNumberExpression(text: string): number | null;
|
|
1375
|
+
/**
|
|
1376
|
+
* A number field with step buttons, in the OS's own layout:
|
|
1377
|
+
* - Windows 11 / 10: Fluent NumberBox, ∧ ∨ buttons inside the field (SpinButtonPlacementMode.Inline)
|
|
1378
|
+
* - macOS 26 / 13–15: a text field with an NSStepper beside it (stacked arrows)
|
|
1379
|
+
* - GNOME: GtkSpinButton, − and + buttons inside the entry's end, divided by lines
|
|
1380
|
+
* - KDE: QSpinBox (Breeze), small stacked arrows inside the field
|
|
1381
|
+
* - ChromeOS: an M3 text field with round − / + icon buttons at the end
|
|
1382
|
+
*
|
|
1383
|
+
* The field is drawn by the skin's text field, so it has the OS's border, focus and hover.
|
|
1384
|
+
* Keyboard: ↑ ↓ step, PgUp PgDn take a large step, Home End go to min / max, Enter commits,
|
|
1385
|
+
* Esc reverts what you typed. Typing `2*15` or `100/4` works (Fluent NumberBox math).
|
|
1386
|
+
* The step buttons repeat while held; they aren't Tab stops (the arrow keys do the same).
|
|
1387
|
+
*
|
|
1388
|
+
* Bind with `[(value)]`, or as a form control (`formControlName`, `[(ngModel)]`):
|
|
1389
|
+
*
|
|
1390
|
+
* ```html
|
|
1391
|
+
* <label hlmLabel for="keep">Keep versions</label>
|
|
1392
|
+
* <sn-number-box inputId="keep" [(value)]="versions" [min]="1" [max]="100" />
|
|
1393
|
+
* ```
|
|
1394
|
+
*/
|
|
1395
|
+
export declare class SnNumberBox implements ControlValueAccessor {
|
|
1396
|
+
/** The number; null when the field is empty. Two-way bindable. */
|
|
1397
|
+
readonly value: import("@angular/core").ModelSignal<number | null>;
|
|
1398
|
+
readonly min: import("@angular/core").InputSignalWithTransform<number | null, unknown>;
|
|
1399
|
+
readonly max: import("@angular/core").InputSignalWithTransform<number | null, unknown>;
|
|
1400
|
+
/** What ↑ ↓ and the buttons add or subtract. */
|
|
1401
|
+
readonly step: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
1402
|
+
/** What PgUp / PgDn add or subtract; defaults to 10 steps. */
|
|
1403
|
+
readonly largeStep: import("@angular/core").InputSignalWithTransform<number | null, unknown>;
|
|
1404
|
+
/** Round to this many decimal places (and always show them). Default: as typed. */
|
|
1405
|
+
readonly decimals: import("@angular/core").InputSignalWithTransform<number | null, unknown>;
|
|
1406
|
+
/** Show the step buttons. */
|
|
1407
|
+
readonly spinButtons: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1408
|
+
/** Accept arithmetic such as `2*15` (Fluent NumberBox). */
|
|
1409
|
+
readonly acceptsExpression: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1410
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1411
|
+
readonly placeholder: import("@angular/core").InputSignal<string>;
|
|
1412
|
+
/** The input's id, for `<label for>`. */
|
|
1413
|
+
readonly inputId: import("@angular/core").InputSignal<string>;
|
|
1414
|
+
/** Accessible name when there's no `<label for>`. */
|
|
1415
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string>;
|
|
1416
|
+
protected readonly skin: import("@angular/core").Signal<Skin>;
|
|
1417
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
1418
|
+
protected readonly glyphs: import("@angular/core").Signal<"plus-minus" | "chevrons">;
|
|
1419
|
+
private readonly formDisabled;
|
|
1420
|
+
protected readonly isDisabled: import("@angular/core").Signal<boolean>;
|
|
1421
|
+
/** The text in the field: the formatted value, or what the user is typing. */
|
|
1422
|
+
protected readonly draft: import("@angular/core").WritableSignal<string>;
|
|
1423
|
+
/** The text doesn't parse; shown until it's committed or reverted. */
|
|
1424
|
+
protected readonly invalid: import("@angular/core").Signal<boolean>;
|
|
1425
|
+
protected readonly atMin: import("@angular/core").Signal<boolean>;
|
|
1426
|
+
protected readonly atMax: import("@angular/core").Signal<boolean>;
|
|
1427
|
+
private readonly field;
|
|
1428
|
+
private repeatTimer;
|
|
1429
|
+
private onChange;
|
|
1430
|
+
protected onTouched: () => void;
|
|
1431
|
+
constructor();
|
|
1432
|
+
/** Adds `steps` × step (negative to subtract) and commits. */
|
|
1433
|
+
stepBy(steps: number, size?: number): void;
|
|
1434
|
+
/** Parses the text in the field and makes it the value; reverts text that doesn't parse. */
|
|
1435
|
+
commit(): void;
|
|
1436
|
+
focus(): void;
|
|
1437
|
+
protected onInput(event: Event): void;
|
|
1438
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
1439
|
+
protected onWheel(event: WheelEvent): void;
|
|
1440
|
+
protected press(event: PointerEvent, steps: number): void;
|
|
1441
|
+
protected release(): void;
|
|
1442
|
+
writeValue(value: unknown): void;
|
|
1443
|
+
registerOnChange(fn: (value: number | null) => void): void;
|
|
1444
|
+
registerOnTouched(fn: () => void): void;
|
|
1445
|
+
setDisabledState(disabled: boolean): void;
|
|
1446
|
+
private set;
|
|
1447
|
+
/**
|
|
1448
|
+
* Puts `text` in the field. Written to the element too: when the value didn't change, the
|
|
1449
|
+
* `[value]` binding sees the same string as last time and wouldn't replace what was typed.
|
|
1450
|
+
*/
|
|
1451
|
+
private show;
|
|
1452
|
+
private parse;
|
|
1453
|
+
private format;
|
|
1454
|
+
private bound;
|
|
1455
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnNumberBox, never>;
|
|
1456
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnNumberBox, "sn-number-box", never, {
|
|
1457
|
+
"value": {
|
|
1458
|
+
"alias": "value";
|
|
1459
|
+
"required": false;
|
|
1460
|
+
"isSignal": true;
|
|
1461
|
+
};
|
|
1462
|
+
"min": {
|
|
1463
|
+
"alias": "min";
|
|
1464
|
+
"required": false;
|
|
1465
|
+
"isSignal": true;
|
|
1466
|
+
};
|
|
1467
|
+
"max": {
|
|
1468
|
+
"alias": "max";
|
|
1469
|
+
"required": false;
|
|
1470
|
+
"isSignal": true;
|
|
1471
|
+
};
|
|
1472
|
+
"step": {
|
|
1473
|
+
"alias": "step";
|
|
1474
|
+
"required": false;
|
|
1475
|
+
"isSignal": true;
|
|
1476
|
+
};
|
|
1477
|
+
"largeStep": {
|
|
1478
|
+
"alias": "largeStep";
|
|
1479
|
+
"required": false;
|
|
1480
|
+
"isSignal": true;
|
|
1481
|
+
};
|
|
1482
|
+
"decimals": {
|
|
1483
|
+
"alias": "decimals";
|
|
1484
|
+
"required": false;
|
|
1485
|
+
"isSignal": true;
|
|
1486
|
+
};
|
|
1487
|
+
"spinButtons": {
|
|
1488
|
+
"alias": "spinButtons";
|
|
1489
|
+
"required": false;
|
|
1490
|
+
"isSignal": true;
|
|
1491
|
+
};
|
|
1492
|
+
"acceptsExpression": {
|
|
1493
|
+
"alias": "acceptsExpression";
|
|
1494
|
+
"required": false;
|
|
1495
|
+
"isSignal": true;
|
|
1496
|
+
};
|
|
1497
|
+
"disabled": {
|
|
1498
|
+
"alias": "disabled";
|
|
1499
|
+
"required": false;
|
|
1500
|
+
"isSignal": true;
|
|
1501
|
+
};
|
|
1502
|
+
"placeholder": {
|
|
1503
|
+
"alias": "placeholder";
|
|
1504
|
+
"required": false;
|
|
1505
|
+
"isSignal": true;
|
|
1506
|
+
};
|
|
1507
|
+
"inputId": {
|
|
1508
|
+
"alias": "inputId";
|
|
1509
|
+
"required": false;
|
|
1510
|
+
"isSignal": true;
|
|
1511
|
+
};
|
|
1512
|
+
"ariaLabel": {
|
|
1513
|
+
"alias": "ariaLabel";
|
|
1514
|
+
"required": false;
|
|
1515
|
+
"isSignal": true;
|
|
1516
|
+
};
|
|
1517
|
+
}, {
|
|
1518
|
+
"value": "valueChange";
|
|
1519
|
+
}, never, never, true, never>;
|
|
1520
|
+
}
|
|
1521
|
+
/**
|
|
1522
|
+
* A hierarchical list (folders, sections, a document outline) with the desktop selection model:
|
|
1523
|
+
* - Windows 11: WinUI TreeView, chevrons, the accent pill on the selected row
|
|
1524
|
+
* - Windows 10: square rows, chevrons, accent-tinted selection
|
|
1525
|
+
* - macOS 26 / 13–15: NSOutlineView, disclosure triangles, accent selection that turns grey
|
|
1526
|
+
* when the tree loses focus
|
|
1527
|
+
* - GNOME: a GtkListView with GtkTreeExpander, triangles, neutral rounded selection
|
|
1528
|
+
* - KDE: a Breeze QTreeView, chevrons, accent-filled selection (muted without focus)
|
|
1529
|
+
* - ChromeOS: the Files app tree, chevrons, tonal pill selection
|
|
1530
|
+
*
|
|
1531
|
+
* Items nest in markup; any depth, `@for` and `@if` work. Values must be unique in the tree.
|
|
1532
|
+
*
|
|
1533
|
+
* ```html
|
|
1534
|
+
* <sn-tree aria-label="Folders" [(selection)]="folder" (activated)="open($event)">
|
|
1535
|
+
* <sn-tree-item value="docs" label="Documents" icon="lucideFolder" [(expanded)]="docsOpen">
|
|
1536
|
+
* <sn-tree-item value="docs/taxes" label="Taxes" icon="lucideFolder" />
|
|
1537
|
+
* <sn-tree-item value="docs/work" label="Work" icon="lucideFolder" />
|
|
1538
|
+
* </sn-tree-item>
|
|
1539
|
+
* <sn-tree-item value="photos" label="Photos" icon="lucideFolder" />
|
|
1540
|
+
* </sn-tree>
|
|
1541
|
+
* ```
|
|
1542
|
+
*
|
|
1543
|
+
* Mouse: click selects, Ctrl/⌘-click and Shift-click with `multiple`, the expander or a
|
|
1544
|
+
* double-click on a parent opens and closes it, double-click on a leaf activates.
|
|
1545
|
+
* Keyboard: ↑ ↓ Home End PgUp PgDn move (Shift extends, Ctrl/⌘ moves focus only with `multiple`),
|
|
1546
|
+
* → opens or goes to the first child, ← closes or goes to the parent, `*` opens all siblings,
|
|
1547
|
+
* Enter activates, Space selects (Ctrl+Space toggles), Ctrl/⌘+A selects all, type to jump.
|
|
1548
|
+
*/
|
|
1549
|
+
export declare class SnTree<K = unknown> {
|
|
1550
|
+
/** Allow more than one selected item. */
|
|
1551
|
+
readonly multiple: import("@angular/core").InputSignal<boolean>;
|
|
1552
|
+
/** The selected values, in visible order. Two-way bindable. */
|
|
1553
|
+
readonly selection: import("@angular/core").ModelSignal<readonly K[]>;
|
|
1554
|
+
/** Enter, or a double-click on an item without children. */
|
|
1555
|
+
readonly activated: import("@angular/core").OutputEmitterRef<K>;
|
|
1556
|
+
protected readonly skin: import("@angular/core").Signal<Skin>;
|
|
1557
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
1558
|
+
/** @internal */
|
|
1559
|
+
readonly triangle: import("@angular/core").Signal<boolean>;
|
|
1560
|
+
private readonly dir;
|
|
1561
|
+
private readonly injector;
|
|
1562
|
+
private readonly registered;
|
|
1563
|
+
/** Bumped after items render or move, so the document order is read again. */
|
|
1564
|
+
private readonly orderVersion;
|
|
1565
|
+
private orderPending;
|
|
1566
|
+
/** Every item, in document order. */
|
|
1567
|
+
private readonly ordered;
|
|
1568
|
+
/** The items whose ancestors are all open: what the keyboard and Shift ranges walk. */
|
|
1569
|
+
private readonly visible;
|
|
1570
|
+
private readonly visibleKeys;
|
|
1571
|
+
private readonly cursor;
|
|
1572
|
+
private readonly selectedSet;
|
|
1573
|
+
/** The item that holds the single Tab stop. */
|
|
1574
|
+
readonly tabStop: import("@angular/core").Signal<SnTreeItem<K>>;
|
|
1575
|
+
private typeahead;
|
|
1576
|
+
private typeaheadTimer;
|
|
1577
|
+
constructor();
|
|
1578
|
+
/** @internal */
|
|
1579
|
+
register(item: SnTreeItem<K>): void;
|
|
1580
|
+
/** @internal */
|
|
1581
|
+
unregister(item: SnTreeItem<K>): void;
|
|
1582
|
+
/** @internal The direct children of `parent` (null: the top level), in document order. */
|
|
1583
|
+
childrenOf(parent: SnTreeItem<K> | null): SnTreeItem<K>[];
|
|
1584
|
+
/** @internal */
|
|
1585
|
+
isSelected(key: K): boolean;
|
|
1586
|
+
/** @internal Focus landed on an item (Tab, click): it becomes the cursor. */
|
|
1587
|
+
focused(item: SnTreeItem<K>): void;
|
|
1588
|
+
/** @internal */
|
|
1589
|
+
click(item: SnTreeItem<K>, event: MouseEvent): void;
|
|
1590
|
+
/** @internal */
|
|
1591
|
+
activate(item: SnTreeItem<K>): void;
|
|
1592
|
+
/** @internal An item closed: if the cursor or a selection was inside it, it moves to the item. */
|
|
1593
|
+
collapsed(item: SnTreeItem<K>): void;
|
|
1594
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
1595
|
+
private onTypeahead;
|
|
1596
|
+
private state;
|
|
1597
|
+
private apply;
|
|
1598
|
+
/** ⌘ toggles on macOS, Ctrl everywhere else (Ctrl-click is the context menu on macOS). */
|
|
1599
|
+
private modifiers;
|
|
1600
|
+
/** Reads the document order again once the newly registered items are in place. */
|
|
1601
|
+
private reorder;
|
|
1602
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnTree<any>, never>;
|
|
1603
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnTree<any>, "sn-tree", never, {
|
|
1604
|
+
"multiple": {
|
|
1605
|
+
"alias": "multiple";
|
|
1606
|
+
"required": false;
|
|
1607
|
+
"isSignal": true;
|
|
1608
|
+
};
|
|
1609
|
+
"selection": {
|
|
1610
|
+
"alias": "selection";
|
|
1611
|
+
"required": false;
|
|
1612
|
+
"isSignal": true;
|
|
1613
|
+
};
|
|
1614
|
+
}, {
|
|
1615
|
+
"selection": "selectionChange";
|
|
1616
|
+
"activated": "activated";
|
|
1617
|
+
}, never, ["*"], true, never>;
|
|
1618
|
+
}
|
|
1619
|
+
/**
|
|
1620
|
+
* One item of an `<sn-tree>`; nest items inside it for its children. `label` is its text (and
|
|
1621
|
+
* the type-ahead text); `icon` an @ng-icons name registered with provideIcons().
|
|
1622
|
+
* Extra trailing content (a count, a badge) goes in `[snTreeItemEnd]`.
|
|
1623
|
+
*
|
|
1624
|
+
* `expandable` shows the expander before the children exist, for lazy loading: listen to
|
|
1625
|
+
* `(expandedChange)` and add the children then.
|
|
1626
|
+
*/
|
|
1627
|
+
export declare class SnTreeItem<K = unknown> {
|
|
1628
|
+
/** The key this item stands for; unique in the tree. Declared optional because the tree reads its items while Angular is still binding them. */
|
|
1629
|
+
readonly value: import("@angular/core").InputSignal<K>;
|
|
1630
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
1631
|
+
readonly icon: import("@angular/core").InputSignal<string>;
|
|
1632
|
+
/** Open, showing its children. Two-way bindable. */
|
|
1633
|
+
readonly expanded: import("@angular/core").ModelSignal<boolean>;
|
|
1634
|
+
/** Show the expander even without children (they load when it opens). */
|
|
1635
|
+
readonly expandable: import("@angular/core").InputSignal<boolean>;
|
|
1636
|
+
readonly element: HTMLElement;
|
|
1637
|
+
protected readonly tree: SnTree<K>;
|
|
1638
|
+
/** The item this one is nested in; null at the top level. */
|
|
1639
|
+
readonly parent: SnTreeItem<K> | null;
|
|
1640
|
+
readonly level: () => number;
|
|
1641
|
+
readonly children: import("@angular/core").Signal<SnTreeItem<K>[]>;
|
|
1642
|
+
readonly hasChildren: import("@angular/core").Signal<boolean>;
|
|
1643
|
+
readonly selected: import("@angular/core").Signal<boolean>;
|
|
1644
|
+
/** Every ancestor is open. */
|
|
1645
|
+
readonly isVisible: () => boolean;
|
|
1646
|
+
constructor();
|
|
1647
|
+
/** Every item nested below this one, at any depth. */
|
|
1648
|
+
descendants(): SnTreeItem<K>[];
|
|
1649
|
+
setExpanded(open: boolean): void;
|
|
1650
|
+
protected onMouseDown(event: MouseEvent): void;
|
|
1651
|
+
protected onExpanderClick(event: MouseEvent): void;
|
|
1652
|
+
protected onDoubleClick(): void;
|
|
1653
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnTreeItem<any>, never>;
|
|
1654
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnTreeItem<any>, "sn-tree-item", never, {
|
|
1655
|
+
"value": {
|
|
1656
|
+
"alias": "value";
|
|
1657
|
+
"required": false;
|
|
1658
|
+
"isSignal": true;
|
|
1659
|
+
};
|
|
1660
|
+
"label": {
|
|
1661
|
+
"alias": "label";
|
|
1662
|
+
"required": true;
|
|
1663
|
+
"isSignal": true;
|
|
1664
|
+
};
|
|
1665
|
+
"icon": {
|
|
1666
|
+
"alias": "icon";
|
|
1667
|
+
"required": false;
|
|
1668
|
+
"isSignal": true;
|
|
1669
|
+
};
|
|
1670
|
+
"expanded": {
|
|
1671
|
+
"alias": "expanded";
|
|
1672
|
+
"required": false;
|
|
1673
|
+
"isSignal": true;
|
|
1674
|
+
};
|
|
1675
|
+
"expandable": {
|
|
1676
|
+
"alias": "expandable";
|
|
1677
|
+
"required": false;
|
|
1678
|
+
"isSignal": true;
|
|
1679
|
+
};
|
|
1680
|
+
}, {
|
|
1681
|
+
"expanded": "expandedChange";
|
|
1682
|
+
}, never, ["[snTreeItemEnd]", "*"], true, never>;
|
|
1683
|
+
}
|
|
1684
|
+
export declare const SnTreeImports: readonly [typeof SnTree, typeof SnTreeItem];
|
|
1685
|
+
/**
|
|
1686
|
+
* The bridge to the host's native menus (`NativeHost.menus`). It converts desktop-ui menus to
|
|
1687
|
+
* the host's plain data and runs an item's `action` when the host reports it was chosen.
|
|
1688
|
+
* `<sn-menubar>` and `[snContextMenu]` use it; call it directly for menus built in code.
|
|
1689
|
+
*/
|
|
1690
|
+
export declare class SnNativeMenus {
|
|
1691
|
+
private readonly theme;
|
|
1692
|
+
private readonly host;
|
|
1693
|
+
private readonly appActions;
|
|
1694
|
+
private readonly contextActions;
|
|
1695
|
+
private off;
|
|
1696
|
+
constructor();
|
|
1697
|
+
/** The host can set the application menu (the macOS global menu bar, a window menu). */
|
|
1698
|
+
get canSetApplicationMenu(): boolean;
|
|
1699
|
+
/** The host can show OS context menus. */
|
|
1700
|
+
get canShowContextMenu(): boolean;
|
|
1701
|
+
/** Sets (or, with `[]`, removes) the application menu. */
|
|
1702
|
+
setApplicationMenu(items: readonly SnMenuItem[]): Promise<void>;
|
|
1703
|
+
/** Shows an OS context menu at `x`, `y` (CSS pixels from the window's content corner). */
|
|
1704
|
+
showContextMenu(items: readonly SnMenuItem[], position: {
|
|
1705
|
+
x: number;
|
|
1706
|
+
y: number;
|
|
1707
|
+
}): Promise<void>;
|
|
1708
|
+
private listen;
|
|
1709
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnNativeMenus, never>;
|
|
1710
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
1711
|
+
}
|
|
1712
|
+
/** auto: native on macOS when the host can · always: native whenever the host can · never: in the page */
|
|
1713
|
+
type SnMenubarNative = 'auto' | 'always' | 'never';
|
|
1714
|
+
/**
|
|
1715
|
+
* The application menu, from one menu definition:
|
|
1716
|
+
* - macOS with a host that has native menus (Wails): the global menu bar at the top of the
|
|
1717
|
+
* screen. Nothing is drawn in the window, and the OS handles the shortcuts.
|
|
1718
|
+
* - Everywhere else (Windows, Linux, ChromeOS, and macOS in a browser): an in-window menu bar,
|
|
1719
|
+
* drawn by the skin's menubar and menu styles, with the shortcuts bound in the page.
|
|
1720
|
+
*
|
|
1721
|
+
* Roles become the OS's own items natively (`appMenu`, `editMenu`, `windowMenu`, `quit`, …); in
|
|
1722
|
+
* the page `editMenu` and `windowMenu` become Edit and Window menus that act on the focused field
|
|
1723
|
+
* and the host's window, and the macOS-only roles are left out.
|
|
1724
|
+
*
|
|
1725
|
+
* ```ts
|
|
1726
|
+
* readonly menu = computed<SnMenuItem[]>(() => [
|
|
1727
|
+
* { role: 'appMenu' },
|
|
1728
|
+
* { label: 'File', submenu: [
|
|
1729
|
+
* { label: 'New backup…', accelerator: 'mod+n', action: () => this.create() },
|
|
1730
|
+
* { label: 'Pause backups', type: 'checkbox', checked: this.paused(), action: () => this.togglePause() },
|
|
1731
|
+
* { type: 'separator' },
|
|
1732
|
+
* { role: 'close' },
|
|
1733
|
+
* ]},
|
|
1734
|
+
* { role: 'editMenu' },
|
|
1735
|
+
* { role: 'windowMenu' },
|
|
1736
|
+
* ]);
|
|
1737
|
+
* ```
|
|
1738
|
+
* ```html
|
|
1739
|
+
* <sn-menubar [menu]="menu()" />
|
|
1740
|
+
* ```
|
|
1741
|
+
*
|
|
1742
|
+
* Pass a new array to update it (a `computed` is the easy way): the native menu is sent again.
|
|
1743
|
+
* In the page: F10 focuses the bar (Windows, Linux), ← → move between menus, ↓ or Enter opens one.
|
|
1744
|
+
*/
|
|
1745
|
+
export declare class SnMenubar {
|
|
1746
|
+
/** The menus: top-level items with a `submenu` (or a role such as `editMenu`). */
|
|
1747
|
+
readonly menu: import("@angular/core").InputSignal<readonly SnMenuItem[]>;
|
|
1748
|
+
/** When to use the host's native menu bar. Default: `auto` (macOS only). */
|
|
1749
|
+
readonly native: import("@angular/core").InputSignal<SnMenubarNative>;
|
|
1750
|
+
/** Accessible name of the in-page bar. */
|
|
1751
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string>;
|
|
1752
|
+
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
1753
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
1754
|
+
/** The real OS: what the keyboard, the shortcut notation and the macOS menu bar follow. */
|
|
1755
|
+
protected readonly platform: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
1756
|
+
private readonly menus;
|
|
1757
|
+
private readonly hostWindow;
|
|
1758
|
+
private readonly element;
|
|
1759
|
+
private readonly bar;
|
|
1760
|
+
/** The menu bar is the host's native one. */
|
|
1761
|
+
readonly isNative: import("@angular/core").Signal<boolean>;
|
|
1762
|
+
/** The menu as drawn in the page: roles replaced by ordinary items. */
|
|
1763
|
+
protected readonly pageMenu: import("@angular/core").Signal<SnMenuItem[]>;
|
|
1764
|
+
private readonly accelerated;
|
|
1765
|
+
/** The field that had the focus before the menu bar took it (Edit commands act on it). */
|
|
1766
|
+
private lastFocus;
|
|
1767
|
+
protected readonly restoreFocus: () => false | void | undefined;
|
|
1768
|
+
constructor();
|
|
1769
|
+
protected onDocumentKeydown(event: KeyboardEvent): void;
|
|
1770
|
+
protected onDocumentFocusin(event: FocusEvent): void;
|
|
1771
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnMenubar, never>;
|
|
1772
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnMenubar, "sn-menubar", never, {
|
|
1773
|
+
"menu": {
|
|
1774
|
+
"alias": "menu";
|
|
1775
|
+
"required": true;
|
|
1776
|
+
"isSignal": true;
|
|
1777
|
+
};
|
|
1778
|
+
"native": {
|
|
1779
|
+
"alias": "native";
|
|
1780
|
+
"required": false;
|
|
1781
|
+
"isSignal": true;
|
|
1782
|
+
};
|
|
1783
|
+
"ariaLabel": {
|
|
1784
|
+
"alias": "ariaLabel";
|
|
1785
|
+
"required": false;
|
|
1786
|
+
"isSignal": true;
|
|
1787
|
+
};
|
|
1788
|
+
}, {}, never, never, true, never>;
|
|
1789
|
+
}
|
|
1790
|
+
/**
|
|
1791
|
+
* A context menu on an element, from the same menu data as `<sn-menubar>`:
|
|
1792
|
+
* - with a host that has native menus (Wails): the OS's own context menu
|
|
1793
|
+
* - otherwise: an in-page menu at the pointer, drawn by the skin's menu styles
|
|
1794
|
+
*
|
|
1795
|
+
* Right-click, the Menu key and Shift+F10 open it. Roles such as `cut`, `copy`, `paste` and
|
|
1796
|
+
* `selectAll` are the OS's items natively, and act on the focused field in the page.
|
|
1797
|
+
*
|
|
1798
|
+
* ```html
|
|
1799
|
+
* <li [snContextMenu]="fileMenu(file)">{{ file.name }}</li>
|
|
1800
|
+
* ```
|
|
1801
|
+
* ```ts
|
|
1802
|
+
* fileMenu(file: File): SnMenuItem[] {
|
|
1803
|
+
* return [
|
|
1804
|
+
* { label: 'Restore', action: () => this.restore(file) },
|
|
1805
|
+
* { label: 'Rename', accelerator: 'f2', action: () => this.rename(file) },
|
|
1806
|
+
* { type: 'separator' },
|
|
1807
|
+
* { label: 'Delete', accelerator: 'delete', action: () => this.remove(file) },
|
|
1808
|
+
* ];
|
|
1809
|
+
* }
|
|
1810
|
+
* ```
|
|
1811
|
+
*
|
|
1812
|
+
* The accelerators are shown, not bound: bind them where the selection lives.
|
|
1813
|
+
*/
|
|
1814
|
+
export declare class SnContextMenu {
|
|
1815
|
+
/** The menu. */
|
|
1816
|
+
readonly items: import("@angular/core").InputSignal<readonly SnMenuItem[]>;
|
|
1817
|
+
/** `never` keeps the in-page menu even when the host has native menus. */
|
|
1818
|
+
readonly native: import("@angular/core").InputSignal<"auto" | "never">;
|
|
1819
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1820
|
+
private readonly trigger;
|
|
1821
|
+
private readonly menus;
|
|
1822
|
+
private readonly hostWindow;
|
|
1823
|
+
private readonly element;
|
|
1824
|
+
/** The real OS: shortcut notation and the Edit roles' keys follow the keyboard, not the skin. */
|
|
1825
|
+
private readonly family;
|
|
1826
|
+
/** The OS shows the menu. */
|
|
1827
|
+
private readonly useNative;
|
|
1828
|
+
constructor();
|
|
1829
|
+
protected onContextMenu(event: MouseEvent): void;
|
|
1830
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnContextMenu, never>;
|
|
1831
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SnContextMenu, "[snContextMenu]", never, {
|
|
1832
|
+
"items": {
|
|
1833
|
+
"alias": "snContextMenu";
|
|
1834
|
+
"required": true;
|
|
1835
|
+
"isSignal": true;
|
|
1836
|
+
};
|
|
1837
|
+
"native": {
|
|
1838
|
+
"alias": "snContextMenuNative";
|
|
1839
|
+
"required": false;
|
|
1840
|
+
"isSignal": true;
|
|
1841
|
+
};
|
|
1842
|
+
"disabled": {
|
|
1843
|
+
"alias": "snContextMenuDisabled";
|
|
1844
|
+
"required": false;
|
|
1845
|
+
"isSignal": true;
|
|
1846
|
+
};
|
|
1847
|
+
}, {}, never, never, true, [{
|
|
1848
|
+
directive: typeof i1.CdkContextMenuTrigger;
|
|
1849
|
+
inputs: {};
|
|
1850
|
+
outputs: {};
|
|
1851
|
+
}]>;
|
|
1852
|
+
}
|
|
1853
|
+
export declare function formatShortcut(shortcut: string, family: PlatformFamily): string;
|
|
1854
|
+
/**
|
|
1855
|
+
* Shows a shortcut in the notation of the keyboard the user really has: the real OS
|
|
1856
|
+
* (`injectPlatformFamily()`), not the skin, so a Mac dressed as Windows still shows ⌘.
|
|
1857
|
+
* - macOS: symbols in Apple's order, no separators (⇧⌘S)
|
|
1858
|
+
* - Windows, Linux, ChromeOS, web: words joined with `+` (Ctrl+Shift+S)
|
|
1859
|
+
*
|
|
1860
|
+
* The text is also the element's aria-label, so screen readers read the same thing.
|
|
1861
|
+
*
|
|
1862
|
+
* ```html
|
|
1863
|
+
* <kbd snShortcut="mod+shift+s"></kbd> <!-- ⇧⌘S on macOS, Ctrl+Shift+S elsewhere -->
|
|
1864
|
+
* ```
|
|
1865
|
+
*/
|
|
1866
|
+
export declare class SnShortcut {
|
|
1867
|
+
/** The shortcut in the portable notation, e.g. `mod+shift+s`. */
|
|
1868
|
+
readonly shortcut: import("@angular/core").InputSignal<string>;
|
|
1869
|
+
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
1870
|
+
protected readonly family: import("@angular/core").Signal<PlatformFamily>;
|
|
1871
|
+
protected readonly text: import("@angular/core").Signal<string>;
|
|
1872
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnShortcut, never>;
|
|
1873
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SnShortcut, "[snShortcut]", never, {
|
|
1874
|
+
"shortcut": {
|
|
1875
|
+
"alias": "snShortcut";
|
|
1876
|
+
"required": true;
|
|
1877
|
+
"isSignal": true;
|
|
1878
|
+
};
|
|
1879
|
+
}, {}, never, never, true, never>;
|
|
1880
|
+
}
|
|
1881
|
+
/**
|
|
1882
|
+
* A skin or a whole family.
|
|
1883
|
+
* Skins: 'win' (Windows 11), 'w10' (Windows 10), 'mac' (macOS 26), 'macc' (macOS 13–15),
|
|
1884
|
+
* 'gtk' (GNOME), 'qt' (KDE Plasma), 'cros' (ChromeOS).
|
|
1885
|
+
* Families: 'windows' (win, w10), 'macos' (mac, macc), 'linux' (gtk, qt), 'chromeos' (cros), 'web'.
|
|
1886
|
+
*/
|
|
1887
|
+
type PlatformMatch = Skin | PlatformFamily;
|
|
1888
|
+
/**
|
|
1889
|
+
* Renders its template only on the given platforms: a skin, a family, or a list of either
|
|
1890
|
+
* (see PlatformMatch). Follows the skin live. With `else`, renders that template instead.
|
|
1891
|
+
*
|
|
1892
|
+
* ```html
|
|
1893
|
+
* <p *snPlatformIf="'macos'; else other">Use the menu bar.</p>
|
|
1894
|
+
* <ng-template #other><p>Use the ☰ menu.</p></ng-template>
|
|
1895
|
+
*
|
|
1896
|
+
* <button *snPlatformIf="['windows', 'linux']">Exit</button>
|
|
1897
|
+
* <p *snPlatformIf="'qt'">Plasma only: also in System Settings.</p>
|
|
1898
|
+
* ```
|
|
1899
|
+
*/
|
|
1900
|
+
export declare class SnPlatformIf {
|
|
1901
|
+
/** The skins and families to render on. */
|
|
1902
|
+
readonly platforms: import("@angular/core").InputSignal<PlatformMatch | readonly PlatformMatch[]>;
|
|
1903
|
+
/** Rendered on every other platform. */
|
|
1904
|
+
readonly elseTemplate: import("@angular/core").InputSignal<TemplateRef<unknown> | null>;
|
|
1905
|
+
private readonly template;
|
|
1906
|
+
private readonly container;
|
|
1907
|
+
private readonly skin;
|
|
1908
|
+
private shown;
|
|
1909
|
+
constructor();
|
|
1910
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnPlatformIf, never>;
|
|
1911
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SnPlatformIf, "[snPlatformIf]", never, {
|
|
1912
|
+
"platforms": {
|
|
1913
|
+
"alias": "snPlatformIf";
|
|
1914
|
+
"required": true;
|
|
1915
|
+
"isSignal": true;
|
|
1916
|
+
};
|
|
1917
|
+
"elseTemplate": {
|
|
1918
|
+
"alias": "snPlatformIfElse";
|
|
1919
|
+
"required": false;
|
|
1920
|
+
"isSignal": true;
|
|
1921
|
+
};
|
|
1922
|
+
}, {}, never, never, true, never>;
|
|
1923
|
+
}
|
|
1924
|
+
export declare const SnWindowImports: readonly [typeof SnTitleBar, typeof SnWindowControls, typeof import("@spartan-native/desktop-ui").SnStatusBar, typeof import("@spartan-native/desktop-ui").SnStatusItem];
|
|
1925
|
+
export declare const SnControlsImports: readonly [typeof import("@spartan-native/desktop-ui").SnSplitButton, typeof import("@spartan-native/desktop-ui").SnSplitButtonMenu, typeof SnNumberBox, typeof import("@spartan-native/desktop-ui").SnTree, typeof import("@spartan-native/desktop-ui").SnTreeItem, typeof SnTooltip];
|
|
1926
|
+
export declare const SnMenuImports: readonly [typeof SnMenubar, typeof SnContextMenu];
|
|
1927
|
+
export declare const SnSettingsImports: readonly [typeof SnSettingsGroup, typeof SnSettingsRow];
|
|
1928
|
+
export declare const SnPlatformImports: readonly [typeof SnPlatformIf, typeof SnShortcut];
|
|
1929
|
+
export declare const SnDesktopUiImports: readonly [typeof SnTitleBar, typeof SnWindowControls, typeof import("@spartan-native/desktop-ui").SnStatusBar, typeof import("@spartan-native/desktop-ui").SnStatusItem, typeof SnSettingsGroup, typeof SnSettingsRow, typeof SnStatusPage, typeof import("@spartan-native/desktop-ui").SnCommandBar, typeof import("@spartan-native/desktop-ui").SnCommand, typeof import("@spartan-native/desktop-ui").SnCommandGroup, typeof import("@spartan-native/desktop-ui").SnCommandOverflow, typeof import("@spartan-native/desktop-ui").SnCoachMark, typeof import("@spartan-native/desktop-ui").SnCoachMarkFor, typeof SnModalSheet, typeof import("@spartan-native/desktop-ui").SnInspectorLayout, typeof import("@spartan-native/desktop-ui").SnInspector, typeof import("@spartan-native/desktop-ui").SnInspectorSection, typeof import("@spartan-native/desktop-ui").SnInspectorProperty, typeof import("@spartan-native/desktop-ui").SnSidebarNav, typeof import("@spartan-native/desktop-ui").SnSidebarSection, typeof import("@spartan-native/desktop-ui").SnSidebarItem, typeof import("@spartan-native/desktop-ui").SnAssistant, typeof import("@spartan-native/desktop-ui").SnAssistantPage, typeof import("@spartan-native/desktop-ui").SnChecklist, typeof import("@spartan-native/desktop-ui").SnChecklistItem, typeof import("@spartan-native/desktop-ui").SnSplitButton, typeof import("@spartan-native/desktop-ui").SnSplitButtonMenu, typeof SnNumberBox, typeof import("@spartan-native/desktop-ui").SnTree, typeof import("@spartan-native/desktop-ui").SnTreeItem, typeof SnTooltip, typeof SnMenubar, typeof SnContextMenu, typeof SnPlatformIf, typeof SnShortcut];
|
|
1930
|
+
export type { CoachMarkPlacement, CoachMarkSide, EditCommand, PlatformMatch, SnCommandBarCollapse, SnCommandBarTitlePosition, SnMenuItem, SnMenuWindowActions, SnMenubarNative, SnSplitButtonVariant, WindowButton };
|