@spartan-native/desktop-ui 0.2.0 → 0.2.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spartan-native/desktop-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "OS-signature components for spartan/ui apps: window chrome (title bar, window controls), command bar, coach mark, modal sheet, inspector, sidebar navigation, settings lists, status pages, status bar, split button, number box, tree view, shortcut formatting and *snPlatformIf.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Roland Molnár",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@angular/common": "^22.2.0",
|
|
25
25
|
"@angular/core": "^22.2.0",
|
|
26
|
-
"@spartan-native/theme": "0.2.
|
|
26
|
+
"@spartan-native/theme": "0.2.1",
|
|
27
27
|
"@ng-icons/core": ">=32.0.0",
|
|
28
28
|
"@angular/cdk": "^22.2.0",
|
|
29
29
|
"@angular/forms": "^22.2.0",
|
|
30
|
-
"@spartan-native/helm": "0.2.
|
|
30
|
+
"@spartan-native/helm": "0.2.1"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"tslib": "^2.3.0"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MenuItem, PlatformFamily, Skin } from "@spartan-native/theme";
|
|
1
|
+
import { MenuItem, MessageOptions, PlatformFamily, Skin } from "@spartan-native/theme";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
import { TemplateRef } from "@angular/core";
|
|
4
4
|
import { FocusableOption } from "@angular/cdk/a11y";
|
|
@@ -457,6 +457,36 @@ export declare class SnCommandOverflow {
|
|
|
457
457
|
static ɵfac: i0.ɵɵFactoryDeclaration<SnCommandOverflow, never>;
|
|
458
458
|
static ɵdir: i0.ɵɵDirectiveDeclaration<SnCommandOverflow, "ng-template[snCommandOverflow]", never, {}, {}, never, never, true, never>;
|
|
459
459
|
}
|
|
460
|
+
/**
|
|
461
|
+
* The current page's own commands, for a shell whose single command bar is shared by every
|
|
462
|
+
* page. A page declares them with `<ng-template snPageCommands>`; the shell's bar shows them
|
|
463
|
+
* after its own:
|
|
464
|
+
*
|
|
465
|
+
* ```html
|
|
466
|
+
* <!-- the shell -->
|
|
467
|
+
* <sn-command-bar [title]="title()" [commands]="pageCommands.template()">…</sn-command-bar>
|
|
468
|
+
*
|
|
469
|
+
* <!-- a page -->
|
|
470
|
+
* <ng-template snPageCommands>
|
|
471
|
+
* <button snCommand icon="lucideRefreshCw" label="Refresh" (click)="reload()"></button>
|
|
472
|
+
* </ng-template>
|
|
473
|
+
* ```
|
|
474
|
+
*
|
|
475
|
+
* The commands keep the page's context, so its bindings and handlers work as written. They go
|
|
476
|
+
* away with the page. One set at a time: a page that opens later replaces the earlier one's.
|
|
477
|
+
*/
|
|
478
|
+
export declare class SnPageCommands {
|
|
479
|
+
/** The current page's commands; null when the page has none. */
|
|
480
|
+
readonly template: import("@angular/core").WritableSignal<TemplateRef<unknown> | null>;
|
|
481
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnPageCommands, never>;
|
|
482
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
483
|
+
}
|
|
484
|
+
/** Declares the current page's commands; see `SnPageCommands`. */
|
|
485
|
+
export declare class SnPageCommandsTemplate {
|
|
486
|
+
constructor();
|
|
487
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnPageCommandsTemplate, never>;
|
|
488
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SnPageCommandsTemplate, "ng-template[snPageCommands]", never, {}, {}, never, never, true, never>;
|
|
489
|
+
}
|
|
460
490
|
/**
|
|
461
491
|
* A group of commands that belong together: on macOS 26 each group is its own Liquid Glass
|
|
462
492
|
* capsule, elsewhere groups are divided by a separator (Windows, GNOME, KDE) or a gap (ChromeOS).
|
|
@@ -588,7 +618,7 @@ export declare class SnCommand implements FocusableOption {
|
|
|
588
618
|
*
|
|
589
619
|
* Commands declared elsewhere (a page's commands shown by the shell's bar): pass them as a
|
|
590
620
|
* template, `<sn-command-bar [commands]="page.commands()">`. Commands in it work exactly like
|
|
591
|
-
* projected ones.
|
|
621
|
+
* projected ones. `SnPageCommands` and `<ng-template snPageCommands>` do the plumbing.
|
|
592
622
|
*
|
|
593
623
|
* Extra content: `[snCommandBarStart]` (e.g. a back button, or the window controls when the
|
|
594
624
|
* bar is the title bar) and `[snCommandBarEnd]` (e.g. a search field). It carries `sn-chrome`,
|
|
@@ -709,7 +739,7 @@ export declare class SnCommandBar {
|
|
|
709
739
|
};
|
|
710
740
|
}, {}, ["overflow"], ["[snCommandBarStart]", "[snCommandBarEnd]", "*"], true, never>;
|
|
711
741
|
}
|
|
712
|
-
export declare const SnCommandBarImports: readonly [typeof SnCommandBar, typeof SnCommand, typeof SnCommandGroup, typeof SnCommandOverflow];
|
|
742
|
+
export declare const SnCommandBarImports: readonly [typeof SnCommandBar, typeof SnCommand, typeof SnCommandGroup, typeof SnCommandOverflow, typeof SnPageCommandsTemplate];
|
|
713
743
|
/** The side of the anchor the coach mark prefers. It flips to the opposite side when there is no room. */
|
|
714
744
|
type CoachMarkPlacement = 'top' | 'bottom' | 'start' | 'end';
|
|
715
745
|
/** The physical side of the anchor the coach mark ended up on (the beak points back at the anchor). */
|
|
@@ -883,6 +913,60 @@ export declare class SnModalSheet {
|
|
|
883
913
|
"open": "openChange";
|
|
884
914
|
}, never, ["*", "[snSheetSecondary]", "[snSheetCancel]", "[snSheetPrimary]"], true, never>;
|
|
885
915
|
}
|
|
916
|
+
/** The words of `SnAlert.confirm()`. */
|
|
917
|
+
interface SnConfirmOptions {
|
|
918
|
+
/** A short heading; the message goes under it. */
|
|
919
|
+
readonly title?: string;
|
|
920
|
+
/** Default: `'question'`. */
|
|
921
|
+
readonly kind?: MessageOptions['kind'];
|
|
922
|
+
/** The button that confirms. Default: "OK". Say what it does ("Send", "Delete") where you can. */
|
|
923
|
+
readonly confirmLabel?: string;
|
|
924
|
+
/** Default: "Cancel". */
|
|
925
|
+
readonly cancelLabel?: string;
|
|
926
|
+
}
|
|
927
|
+
/**
|
|
928
|
+
* Alerts and confirmations, native where the host can draw them. The host's alert
|
|
929
|
+
* (`NativeHost.dialogs.message`) is used when there is one: the real NSAlert, TaskDialog or
|
|
930
|
+
* AdwAlertDialog. Otherwise, in the browser and on hosts without one, an in-page
|
|
931
|
+
* `alertdialog` sheet in the skin's dialog layout. Either way you get the same answer:
|
|
932
|
+
*
|
|
933
|
+
* ```ts
|
|
934
|
+
* private readonly alert = inject(SnAlert);
|
|
935
|
+
*
|
|
936
|
+
* async remove() {
|
|
937
|
+
* if (!(await this.alert.confirm('Delete “Q3 report.pdf”?', { confirmLabel: 'Delete', kind: 'warning' }))) return;
|
|
938
|
+
* …
|
|
939
|
+
* }
|
|
940
|
+
*
|
|
941
|
+
* const answer = await this.alert.show({
|
|
942
|
+
* kind: 'warning',
|
|
943
|
+
* message: 'Save changes to “Report.md”?',
|
|
944
|
+
* buttons: [{ id: 'save', label: 'Save' }, { id: 'discard', label: "Don't Save" }, { id: 'cancel', label: 'Cancel' }],
|
|
945
|
+
* defaultId: 'save',
|
|
946
|
+
* cancelId: 'cancel',
|
|
947
|
+
* });
|
|
948
|
+
* ```
|
|
949
|
+
*
|
|
950
|
+
* In the in-page sheet, Enter presses the default button (`defaultId`, else the first button
|
|
951
|
+
* that isn't Cancel) and Esc presses `cancelId`. On macOS it hangs from the window marked
|
|
952
|
+
* `snSheetHost`, like `<sn-modal-sheet>`.
|
|
953
|
+
*/
|
|
954
|
+
export declare class SnAlert {
|
|
955
|
+
private readonly host;
|
|
956
|
+
private readonly appRef;
|
|
957
|
+
private readonly environmentInjector;
|
|
958
|
+
private readonly document;
|
|
959
|
+
/**
|
|
960
|
+
* Shows the alert and resolves the id of the pressed button: `cancelId` when it was dismissed
|
|
961
|
+
* (Esc, the window's close button), or null when there is no `cancelId`.
|
|
962
|
+
*/
|
|
963
|
+
show(options: MessageOptions): Promise<string | null>;
|
|
964
|
+
/** "Are you sure?": true when the user pressed the confirm button. */
|
|
965
|
+
confirm(message: string, options?: SnConfirmOptions): Promise<boolean>;
|
|
966
|
+
private inPage;
|
|
967
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnAlert, never>;
|
|
968
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
969
|
+
}
|
|
886
970
|
/**
|
|
887
971
|
* Lays out the main content with an `<sn-inspector>` on the trailing side. Below 40rem of
|
|
888
972
|
* width the inspector floats over the content instead of squeezing it (AdwOverlaySplitView).
|
|
@@ -1005,8 +1089,16 @@ export declare const SnInspectorImports: readonly [typeof SnInspectorLayout, typ
|
|
|
1005
1089
|
* ```
|
|
1006
1090
|
*
|
|
1007
1091
|
* With the Router: `<a snSidebarItem routerLink="/x" routerLinkActive #rla="routerLinkActive" [active]="rla.isActive">`.
|
|
1092
|
+
*
|
|
1093
|
+
* `collapsed` folds it to a strip of icons (Windows NavigationView's compact mode, a folded
|
|
1094
|
+
* GNOME/KDE sidebar): labels and section titles stay for screen readers and show as tooltips,
|
|
1095
|
+
* badges become a small mark on the icon. An item without an `icon` keeps its content (make it
|
|
1096
|
+
* short enough for the strip, e.g. a number), with `tooltip` for what the tooltip should say. Resizable with
|
|
1097
|
+
* `snResizable`; pass `[resizeDisabled]="collapsed"` so the folded strip keeps its own width.
|
|
1008
1098
|
*/
|
|
1009
1099
|
export declare class SnSidebarNav {
|
|
1100
|
+
/** Folded to icons only; labels show as tooltips. */
|
|
1101
|
+
readonly collapsed: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1010
1102
|
private readonly items;
|
|
1011
1103
|
/** The item that keeps the single Tab stop: the last focused one, else the active one, else the first. */
|
|
1012
1104
|
private readonly focused;
|
|
@@ -1017,13 +1109,20 @@ export declare class SnSidebarNav {
|
|
|
1017
1109
|
setFocused(item: SnSidebarItem): void;
|
|
1018
1110
|
protected onKeydown(event: KeyboardEvent): void;
|
|
1019
1111
|
static ɵfac: i0.ɵɵFactoryDeclaration<SnSidebarNav, never>;
|
|
1020
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SnSidebarNav, "sn-sidebar-nav", never, {
|
|
1112
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnSidebarNav, "sn-sidebar-nav", never, {
|
|
1113
|
+
"collapsed": {
|
|
1114
|
+
"alias": "collapsed";
|
|
1115
|
+
"required": false;
|
|
1116
|
+
"isSignal": true;
|
|
1117
|
+
};
|
|
1118
|
+
}, {}, ["items"], ["*"], true, never>;
|
|
1021
1119
|
}
|
|
1022
1120
|
/**
|
|
1023
1121
|
* A titled group of items: "Favorites", "Locations", … Leave `title` empty for an unlabeled group.
|
|
1024
1122
|
*/
|
|
1025
1123
|
export declare class SnSidebarSection {
|
|
1026
1124
|
readonly title: import("@angular/core").InputSignal<string>;
|
|
1125
|
+
protected readonly nav: SnSidebarNav | null;
|
|
1027
1126
|
protected readonly headingId: string;
|
|
1028
1127
|
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
1029
1128
|
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
@@ -1039,15 +1138,23 @@ export declare class SnSidebarSection {
|
|
|
1039
1138
|
/**
|
|
1040
1139
|
* One navigation item, on an `<a>` or a `<button>`. `icon` is an @ng-icons name the app
|
|
1041
1140
|
* registered with provideIcons(); `badge` is a short count or label on the trailing side.
|
|
1141
|
+
*
|
|
1142
|
+
* The styles hang on the `sn-sidebar-item` class, not on `data-slot`, so the item can also be
|
|
1143
|
+
* the trigger of a spartan menu (`hlmDropdownMenuTrigger` sets its own `data-slot`).
|
|
1042
1144
|
*/
|
|
1043
1145
|
export declare class SnSidebarItem {
|
|
1044
1146
|
readonly active: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1045
1147
|
readonly icon: import("@angular/core").InputSignal<string>;
|
|
1046
1148
|
readonly badge: import("@angular/core").InputSignal<string | number>;
|
|
1149
|
+
/** The tooltip while the sidebar is collapsed. Default: the item's text (and badge). */
|
|
1150
|
+
readonly tooltip: import("@angular/core").InputSignal<string>;
|
|
1047
1151
|
readonly element: HTMLElement;
|
|
1048
1152
|
protected readonly nav: SnSidebarNav | null;
|
|
1049
1153
|
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
1050
1154
|
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
1155
|
+
private readonly hint;
|
|
1156
|
+
/** Collapsed: the label (and badge) as the tooltip, read when the pointer or focus arrives. */
|
|
1157
|
+
protected syncTooltip(): void;
|
|
1051
1158
|
static ɵfac: i0.ɵɵFactoryDeclaration<SnSidebarItem, never>;
|
|
1052
1159
|
static ɵcmp: i0.ɵɵComponentDeclaration<SnSidebarItem, "a[snSidebarItem], button[snSidebarItem]", never, {
|
|
1053
1160
|
"active": {
|
|
@@ -1065,7 +1172,16 @@ export declare class SnSidebarItem {
|
|
|
1065
1172
|
"required": false;
|
|
1066
1173
|
"isSignal": true;
|
|
1067
1174
|
};
|
|
1068
|
-
|
|
1175
|
+
"tooltip": {
|
|
1176
|
+
"alias": "tooltip";
|
|
1177
|
+
"required": false;
|
|
1178
|
+
"isSignal": true;
|
|
1179
|
+
};
|
|
1180
|
+
}, {}, never, ["*"], true, [{
|
|
1181
|
+
directive: typeof SnTooltip;
|
|
1182
|
+
inputs: {};
|
|
1183
|
+
outputs: {};
|
|
1184
|
+
}]>;
|
|
1069
1185
|
}
|
|
1070
1186
|
export declare const SnSidebarNavImports: readonly [typeof SnSidebarNav, typeof SnSidebarSection, typeof SnSidebarItem];
|
|
1071
1187
|
/**
|
|
@@ -1682,6 +1798,183 @@ export declare class SnTreeItem<K = unknown> {
|
|
|
1682
1798
|
}, never, ["[snTreeItemEnd]", "*"], true, never>;
|
|
1683
1799
|
}
|
|
1684
1800
|
export declare const SnTreeImports: readonly [typeof SnTree, typeof SnTreeItem];
|
|
1801
|
+
/**
|
|
1802
|
+
* The platform's search field: a text field with a magnifier and a clear button, drawn as each
|
|
1803
|
+
* skin draws its text fields.
|
|
1804
|
+
* - macOS (NSSearchField), GNOME (GtkSearchEntry), KDE and ChromeOS: magnifier at the start
|
|
1805
|
+
* - Windows (AutoSuggestBox): magnifier at the end
|
|
1806
|
+
*
|
|
1807
|
+
* Esc empties a field that has text and stops there; on an empty field it goes on to the
|
|
1808
|
+
* surrounding dialog or menu, so Esc still closes them. The clear button empties it and gives
|
|
1809
|
+
* the focus back to the field.
|
|
1810
|
+
*
|
|
1811
|
+
* ```html
|
|
1812
|
+
* <sn-search-field [(value)]="query" placeholder="Search files" />
|
|
1813
|
+
* <sn-search-field [formControl]="query" label="Filter the list" />
|
|
1814
|
+
* ```
|
|
1815
|
+
*
|
|
1816
|
+
* The placeholder is also the accessible name unless `label` is set. Works with `[(value)]`,
|
|
1817
|
+
* `ngModel` and reactive forms.
|
|
1818
|
+
*/
|
|
1819
|
+
export declare class SnSearchField implements ControlValueAccessor {
|
|
1820
|
+
/** The text. Two-way bindable. */
|
|
1821
|
+
readonly value: import("@angular/core").ModelSignal<string>;
|
|
1822
|
+
/** Default: "Search". Also the accessible name when `label` is empty. */
|
|
1823
|
+
readonly placeholder: import("@angular/core").InputSignal<string>;
|
|
1824
|
+
/** The accessible name, when the placeholder doesn't say enough. */
|
|
1825
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
1826
|
+
/** The clear button's accessible name. Default: "Clear". */
|
|
1827
|
+
readonly clearLabel: import("@angular/core").InputSignal<string>;
|
|
1828
|
+
readonly disabledInput: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1829
|
+
/** Enter in the field, with its text. */
|
|
1830
|
+
readonly submitted: import("@angular/core").OutputEmitterRef<string>;
|
|
1831
|
+
protected readonly skin: import("@angular/core").Signal<import("@spartan-native/theme").Skin>;
|
|
1832
|
+
protected readonly family: import("@angular/core").Signal<import("@spartan-native/theme").PlatformFamily>;
|
|
1833
|
+
private readonly formDisabled;
|
|
1834
|
+
protected readonly isDisabled: import("@angular/core").Signal<boolean>;
|
|
1835
|
+
private readonly field;
|
|
1836
|
+
private onChange;
|
|
1837
|
+
protected touched: () => void;
|
|
1838
|
+
/** Puts the keyboard focus in the field (e.g. for ⌘F / Ctrl+F). */
|
|
1839
|
+
focus(): void;
|
|
1840
|
+
/** Empties the field and keeps the focus in it. */
|
|
1841
|
+
clear(): void;
|
|
1842
|
+
protected onInput(event: Event): void;
|
|
1843
|
+
protected onEscape(event: Event): void;
|
|
1844
|
+
private set;
|
|
1845
|
+
/** @internal ControlValueAccessor */
|
|
1846
|
+
writeValue(value: unknown): void;
|
|
1847
|
+
/** @internal ControlValueAccessor */
|
|
1848
|
+
registerOnChange(fn: (value: string) => void): void;
|
|
1849
|
+
/** @internal ControlValueAccessor */
|
|
1850
|
+
registerOnTouched(fn: () => void): void;
|
|
1851
|
+
/** @internal ControlValueAccessor */
|
|
1852
|
+
setDisabledState(disabled: boolean): void;
|
|
1853
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnSearchField, never>;
|
|
1854
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnSearchField, "sn-search-field", never, {
|
|
1855
|
+
"value": {
|
|
1856
|
+
"alias": "value";
|
|
1857
|
+
"required": false;
|
|
1858
|
+
"isSignal": true;
|
|
1859
|
+
};
|
|
1860
|
+
"placeholder": {
|
|
1861
|
+
"alias": "placeholder";
|
|
1862
|
+
"required": false;
|
|
1863
|
+
"isSignal": true;
|
|
1864
|
+
};
|
|
1865
|
+
"label": {
|
|
1866
|
+
"alias": "label";
|
|
1867
|
+
"required": false;
|
|
1868
|
+
"isSignal": true;
|
|
1869
|
+
};
|
|
1870
|
+
"clearLabel": {
|
|
1871
|
+
"alias": "clearLabel";
|
|
1872
|
+
"required": false;
|
|
1873
|
+
"isSignal": true;
|
|
1874
|
+
};
|
|
1875
|
+
"disabledInput": {
|
|
1876
|
+
"alias": "disabled";
|
|
1877
|
+
"required": false;
|
|
1878
|
+
"isSignal": true;
|
|
1879
|
+
};
|
|
1880
|
+
}, {
|
|
1881
|
+
"value": "valueChange";
|
|
1882
|
+
"submitted": "submitted";
|
|
1883
|
+
}, never, never, true, never>;
|
|
1884
|
+
}
|
|
1885
|
+
/** Which edge of the panel the handle sits on. `auto`: the edge facing the middle of the parent. */
|
|
1886
|
+
type SnResizeEdge = 'auto' | 'start' | 'end';
|
|
1887
|
+
/**
|
|
1888
|
+
* Lets the user widen or narrow a side panel by dragging its inner edge, like the sidebars and
|
|
1889
|
+
* inspectors of Finder, Explorer, Files and Dolphin. Put it on `<sn-sidebar-nav>`,
|
|
1890
|
+
* `<sn-inspector>` or any panel that sits beside the content in a row:
|
|
1891
|
+
*
|
|
1892
|
+
* ```html
|
|
1893
|
+
* <sn-sidebar-nav snResizable="sidebar" aria-label="Sections">…</sn-sidebar-nav>
|
|
1894
|
+
* <sn-inspector snResizable="inspector" resizeLabel="Resize the details">…</sn-inspector>
|
|
1895
|
+
* ```
|
|
1896
|
+
*
|
|
1897
|
+
* The width is kept as a share of the parent's width, so the panel grows and shrinks with the
|
|
1898
|
+
* window instead of staying a fixed number of pixels. The value of `snResizable` is the key the
|
|
1899
|
+
* share is remembered under (`localStorage`, per window); leave it empty to not remember it.
|
|
1900
|
+
* A double-click on the edge goes back to the default. The edge is a focusable separator:
|
|
1901
|
+
* ← → resize it (Shift for bigger steps), Home and End jump to the limits.
|
|
1902
|
+
*
|
|
1903
|
+
* The handle lives in the panel's parent (which becomes `position: relative`), so it doesn't
|
|
1904
|
+
* scroll away with a long panel. While `resizeDisabled` is set (a collapsed sidebar), the panel
|
|
1905
|
+
* keeps its stylesheet width and the handle hides.
|
|
1906
|
+
*/
|
|
1907
|
+
export declare class SnResizable {
|
|
1908
|
+
/** The storage key the width is remembered under; empty: not remembered. */
|
|
1909
|
+
readonly snResizable: import("@angular/core").InputSignal<string>;
|
|
1910
|
+
/** The handle's edge. `auto` (default): the edge facing the middle of the parent. */
|
|
1911
|
+
readonly resizeEdge: import("@angular/core").InputSignal<SnResizeEdge>;
|
|
1912
|
+
/** The share of the parent's width the panel takes until the user drags it. Default: 0.2. */
|
|
1913
|
+
readonly resizeRatio: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
1914
|
+
/** Never narrower than this, in pixels. Default: 192. */
|
|
1915
|
+
readonly resizeMin: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
1916
|
+
/** Never wider than this share of the parent. Default: 0.5. */
|
|
1917
|
+
readonly resizeMaxRatio: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
1918
|
+
/** Keep the stylesheet width and hide the handle (e.g. a collapsed sidebar). */
|
|
1919
|
+
readonly resizeDisabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
1920
|
+
/** The handle's accessible name. Default: "Resize". */
|
|
1921
|
+
readonly resizeLabel: import("@angular/core").InputSignal<string>;
|
|
1922
|
+
/** True while the user drags the edge (also `data-resizing` on the panel: turn transitions off). */
|
|
1923
|
+
readonly dragging: import("@angular/core").WritableSignal<boolean>;
|
|
1924
|
+
/** The share of the parent the user chose; null: `resizeRatio`. */
|
|
1925
|
+
readonly share: import("@angular/core").WritableSignal<number | null>;
|
|
1926
|
+
private readonly el;
|
|
1927
|
+
private handle?;
|
|
1928
|
+
private parent?;
|
|
1929
|
+
constructor();
|
|
1930
|
+
/** The handle is on the panel's left side (a panel on the right of its parent, in LTR). */
|
|
1931
|
+
private onLeft;
|
|
1932
|
+
/** Sizes the panel from its share and puts the handle on its edge. */
|
|
1933
|
+
private layout;
|
|
1934
|
+
private startDrag;
|
|
1935
|
+
private onKey;
|
|
1936
|
+
/** A width in pixels, turned into a share of the parent (clamped); `persist` remembers it. */
|
|
1937
|
+
private setWidth;
|
|
1938
|
+
private save;
|
|
1939
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnResizable, never>;
|
|
1940
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SnResizable, "[snResizable]", ["snResizable"], {
|
|
1941
|
+
"snResizable": {
|
|
1942
|
+
"alias": "snResizable";
|
|
1943
|
+
"required": false;
|
|
1944
|
+
"isSignal": true;
|
|
1945
|
+
};
|
|
1946
|
+
"resizeEdge": {
|
|
1947
|
+
"alias": "resizeEdge";
|
|
1948
|
+
"required": false;
|
|
1949
|
+
"isSignal": true;
|
|
1950
|
+
};
|
|
1951
|
+
"resizeRatio": {
|
|
1952
|
+
"alias": "resizeRatio";
|
|
1953
|
+
"required": false;
|
|
1954
|
+
"isSignal": true;
|
|
1955
|
+
};
|
|
1956
|
+
"resizeMin": {
|
|
1957
|
+
"alias": "resizeMin";
|
|
1958
|
+
"required": false;
|
|
1959
|
+
"isSignal": true;
|
|
1960
|
+
};
|
|
1961
|
+
"resizeMaxRatio": {
|
|
1962
|
+
"alias": "resizeMaxRatio";
|
|
1963
|
+
"required": false;
|
|
1964
|
+
"isSignal": true;
|
|
1965
|
+
};
|
|
1966
|
+
"resizeDisabled": {
|
|
1967
|
+
"alias": "resizeDisabled";
|
|
1968
|
+
"required": false;
|
|
1969
|
+
"isSignal": true;
|
|
1970
|
+
};
|
|
1971
|
+
"resizeLabel": {
|
|
1972
|
+
"alias": "resizeLabel";
|
|
1973
|
+
"required": false;
|
|
1974
|
+
"isSignal": true;
|
|
1975
|
+
};
|
|
1976
|
+
}, {}, never, never, true, never>;
|
|
1977
|
+
}
|
|
1685
1978
|
/**
|
|
1686
1979
|
* The bridge to the host's native menus (`NativeHost.menus`). It converts desktop-ui menus to
|
|
1687
1980
|
* the host's plain data and runs an item's `action` when the host reports it was chosen.
|
|
@@ -1922,9 +2215,9 @@ export declare class SnPlatformIf {
|
|
|
1922
2215
|
}, {}, never, never, true, never>;
|
|
1923
2216
|
}
|
|
1924
2217
|
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];
|
|
2218
|
+
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, typeof SnSearchField, typeof SnResizable];
|
|
1926
2219
|
export declare const SnMenuImports: readonly [typeof SnMenubar, typeof SnContextMenu];
|
|
1927
2220
|
export declare const SnSettingsImports: readonly [typeof SnSettingsGroup, typeof SnSettingsRow];
|
|
1928
2221
|
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 };
|
|
2222
|
+
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").SnPageCommandsTemplate, 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 SnSearchField, typeof SnResizable, typeof SnMenubar, typeof SnContextMenu, typeof SnPlatformIf, typeof SnShortcut];
|
|
2223
|
+
export type { CoachMarkPlacement, CoachMarkSide, EditCommand, PlatformMatch, SnCommandBarCollapse, SnCommandBarTitlePosition, SnConfirmOptions, SnMenuItem, SnMenuWindowActions, SnMenubarNative, SnResizeEdge, SnSplitButtonVariant, WindowButton };
|