sagittarius-admin-template 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/index.d.ts ADDED
@@ -0,0 +1,203 @@
1
+ import * as sagittarius_admin_template from 'sagittarius-admin-template';
2
+ import * as _angular_core from '@angular/core';
3
+ import { InputSignalWithTransform, ViewContainerRef, Type, ComponentRef, OnInit, AfterViewInit, InjectionToken, Provider } from '@angular/core';
4
+ import { Location } from '@angular/common';
5
+
6
+ /**
7
+ * Referencia na otvorený drawer. Komponent zobrazený v draweri ju získa cez `inject(DrawerRef)`.
8
+ */
9
+ declare class DrawerRef {
10
+ private readonly closeFn;
11
+ readonly title: _angular_core.WritableSignal<string>;
12
+ /** URL samostatnej stránky; ak je nastavená, hlavička drawera zobrazí ikonu na jej otvorenie. */
13
+ readonly fullPageUrl: _angular_core.WritableSignal<string | any[] | null>;
14
+ constructor(closeFn: () => void);
15
+ /** Zatvorí tento drawer (krok späť v histórii prehliadača). */
16
+ close(): void;
17
+ setTitle(title: string): void;
18
+ /** Nastaví (alebo `null` = skryje) odkaz na samostatnú stránku v hlavičke drawera. */
19
+ setFullPageUrl(url: string | any[] | null): void;
20
+ }
21
+
22
+ /** Položka hlavného menu v sidebare. */
23
+ interface SgMenuItem {
24
+ label: string;
25
+ /** Názov Material ikony (ligatúra), napr. `dashboard`. */
26
+ icon?: string;
27
+ /** Cieľová routa pre `routerLink`. */
28
+ route?: string | any[];
29
+ /** `true` = sekčný nadpis (nie je klikateľný). */
30
+ spacer?: boolean;
31
+ /** Presná zhoda pre zvýraznenie aktívnej položky (default `false`). */
32
+ exact?: boolean;
33
+ /** Voliteľný odznak vpravo (napr. počet). */
34
+ badge?: string | number;
35
+ }
36
+ /** Prihlásený používateľ zobrazený v sidebare a v user menu. */
37
+ interface SgUser {
38
+ name: string;
39
+ /** Druhý riadok pod menom (email, rola…). */
40
+ subtitle?: string;
41
+ avatarUrl?: string;
42
+ /** Ak chýba, vypočíta sa z `name`. */
43
+ initials?: string;
44
+ }
45
+ /** Položka rozbaľovacieho menu používateľa v hlavičke. */
46
+ interface SgUserMenuItem {
47
+ label?: string;
48
+ icon?: string;
49
+ route?: string | any[];
50
+ action?: () => void;
51
+ disabled?: boolean;
52
+ /** `true` = oddeľovač, ostatné polia sa ignorujú. */
53
+ divider?: boolean;
54
+ }
55
+ /** Voľby pri otváraní drawera cez `DrawerService.open`. */
56
+ interface DrawerOptions {
57
+ title?: string;
58
+ /**
59
+ * URL samostatnej stránky s rovnakým obsahom (napr. `/users/42` alebo `['/users', 42]`).
60
+ * Ak je zadaná, v pravom rohu hlavičky drawera sa zobrazí ikona, ktorá drawer zavrie
61
+ * a prejde na túto stránku. Dá sa meniť aj za behu cez `DrawerRef.setFullPageUrl()`.
62
+ */
63
+ fullPageUrl?: string | any[];
64
+ /** Material ikona tlačidla (default `open_in_full`). */
65
+ fullPageIcon?: string;
66
+ /** Tooltip / aria-label tlačidla (default `SgAdminLabels.drawerFullPage` – „Open as full page“). */
67
+ fullPageLabel?: string;
68
+ }
69
+ /**
70
+ * Dáta pre komponent v draweri: vlastnosti komponentu, pričom signal `input()`
71
+ * sa zadáva ako jeho hodnota (nie ako signál).
72
+ */
73
+ type DrawerData<T> = {
74
+ [K in keyof T]?: T[K] extends InputSignalWithTransform<any, infer W> ? W : T[K];
75
+ };
76
+
77
+ declare class DrawerComponent {
78
+ vc: ViewContainerRef;
79
+ private readonly drawerService;
80
+ private readonly injector;
81
+ private readonly layers;
82
+ constructor();
83
+ close(): void;
84
+ closeAll(): void;
85
+ loadComponent<T>(component: Type<T>, data?: DrawerData<T>, options?: DrawerOptions): {
86
+ component: ComponentRef<T>;
87
+ drawerRef: DrawerRef;
88
+ };
89
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DrawerComponent, never>;
90
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DrawerComponent, "lib-drawer-component", never, {}, {}, never, never, true, never>;
91
+ }
92
+
93
+ declare class DrawerService {
94
+ private location;
95
+ private host?;
96
+ private app?;
97
+ constructor(location: Location);
98
+ setHost(component: DrawerComponent, app: SagittariusAdmin): void;
99
+ /**
100
+ * Otvorí komponent v draweri nad obsahom. Každé ďalšie volanie pridá novú vrstvu.
101
+ * Otvorenie pridá záznam do histórie, takže tlačidlo Späť v prehliadači zatvorí vrchnú vrstvu.
102
+ *
103
+ * @param data vstupy komponentu (signal `input()` aj bežné properties)
104
+ */
105
+ open<T>(component: Type<T>, data?: DrawerData<T>, options?: DrawerOptions): {
106
+ componentInstance: T;
107
+ drawerRef: DrawerRef;
108
+ close: () => void;
109
+ };
110
+ /** Zatvorí vrchnú vrstvu drawera. */
111
+ closeTop(): void;
112
+ /** Zatvorí všetky vrstvy (bez práce s históriou). */
113
+ closeAll(): void;
114
+ /** @internal volá DrawerComponent, keď zanikne posledná vrstva */
115
+ close(): void;
116
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DrawerService, never>;
117
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<DrawerService>;
118
+ }
119
+
120
+ declare class SagittariusAdmin implements OnInit, AfterViewInit {
121
+ private drawerService;
122
+ /** Názov aplikácie v hlavičke sidebaru. */
123
+ readonly appTitle: _angular_core.InputSignal<string>;
124
+ /** Skratka zobrazená v zbalenom sidebare (default: iniciály z `appTitle`). */
125
+ readonly appShortTitle: _angular_core.InputSignal<string | undefined>;
126
+ /** URL loga; bez neho sa zobrazí farebný štvorec so skratkou. */
127
+ readonly logoUrl: _angular_core.InputSignal<string | undefined>;
128
+ /** Routa, kam vedie klik na logo. */
129
+ readonly homeRoute: _angular_core.InputSignal<string | any[]>;
130
+ readonly menuItems: _angular_core.InputSignal<SgMenuItem[]>;
131
+ readonly user: _angular_core.InputSignal<SgUser | null>;
132
+ readonly userMenuItems: _angular_core.InputSignal<SgUserMenuItem[]>;
133
+ /** Pamätať si zbalenie sidebaru v localStorage. */
134
+ readonly persistSidebarState: _angular_core.InputSignal<boolean>;
135
+ /** Emituje sa pri kliknutí na položku user menu (popri jej `action`). */
136
+ readonly userMenuItemClick: _angular_core.OutputEmitterRef<SgUserMenuItem>;
137
+ /** Texty layoutu (`provideSgAdminLabels`). */
138
+ protected readonly labels: sagittarius_admin_template.SgAdminLabels;
139
+ readonly isHandset: _angular_core.WritableSignal<boolean>;
140
+ readonly sidebarOpen: _angular_core.WritableSignal<boolean>;
141
+ readonly sidebarCollapsed: _angular_core.WritableSignal<boolean>;
142
+ readonly hovered: _angular_core.WritableSignal<boolean>;
143
+ readonly drawerOpen: _angular_core.WritableSignal<boolean>;
144
+ private noHover;
145
+ /** Zbalenie platí len na desktope, na mobile je sidebar vždy v plnej šírke. */
146
+ readonly collapsed: _angular_core.Signal<boolean>;
147
+ readonly shortTitle: _angular_core.Signal<string>;
148
+ readonly userInitials: _angular_core.Signal<string>;
149
+ drawerComponent: DrawerComponent;
150
+ constructor(drawerService: DrawerService);
151
+ ngOnInit(): void;
152
+ ngAfterViewInit(): void;
153
+ onResize(): void;
154
+ openSidebar(): void;
155
+ closeSidebar(): void;
156
+ toggleSidebar(): void;
157
+ setHovered(value: boolean): void;
158
+ onNavigate(): void;
159
+ onUserMenuItem(item: SgUserMenuItem): void;
160
+ openDrawer(): void;
161
+ closeDrawer(): void;
162
+ private calculateWidth;
163
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SagittariusAdmin, never>;
164
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SagittariusAdmin, "lib-sagittarius-admin", never, { "appTitle": { "alias": "appTitle"; "required": false; "isSignal": true; }; "appShortTitle": { "alias": "appShortTitle"; "required": false; "isSignal": true; }; "logoUrl": { "alias": "logoUrl"; "required": false; "isSignal": true; }; "homeRoute": { "alias": "homeRoute"; "required": false; "isSignal": true; }; "menuItems": { "alias": "menuItems"; "required": false; "isSignal": true; }; "user": { "alias": "user"; "required": false; "isSignal": true; }; "userMenuItems": { "alias": "userMenuItems"; "required": false; "isSignal": true; }; "persistSidebarState": { "alias": "persistSidebarState"; "required": false; "isSignal": true; }; }, { "userMenuItemClick": "userMenuItemClick"; }, never, ["[sg-admin-sidebar-bottom]", "[sg-admin-header-left]", "[sg-admin-header-middle]", "[sg-admin-header]", "[sg-admin-header-actions]", "*", "[sg-admin-footer]"], true, never>;
165
+ }
166
+
167
+ /** Texty zabudované v layoute (aria-label, tooltipy). */
168
+ interface SgAdminLabels {
169
+ /** Otvorenie sidebaru hamburgerom na mobile. */
170
+ openMenu: string;
171
+ /** Zatvorenie sidebaru na mobile. */
172
+ closeMenu: string;
173
+ /** Pripnutie (rozbalenie) zbaleného sidebaru. */
174
+ expandMenu: string;
175
+ /** Zbalenie sidebaru. */
176
+ collapseMenu: string;
177
+ /** Tlačidlo používateľského menu v hlavičke. */
178
+ userMenu: string;
179
+ /** Zatvorenie prvej vrstvy drawera. */
180
+ drawerClose: string;
181
+ /** Návrat z vnorenej vrstvy drawera. */
182
+ drawerBack: string;
183
+ /** Predvolený tooltip / aria-label ikony `fullPageUrl` (prebije ho `DrawerOptions.fullPageLabel`). */
184
+ drawerFullPage: string;
185
+ }
186
+ /** Anglické texty (predvolené). */
187
+ declare const SG_ADMIN_LABELS_EN: SgAdminLabels;
188
+ /** Slovenské texty. */
189
+ declare const SG_ADMIN_LABELS_SK: SgAdminLabels;
190
+ /** Texty layoutu; default `SG_ADMIN_LABELS_EN`. Nastav cez `provideSgAdminLabels()`. */
191
+ declare const SG_ADMIN_LABELS: InjectionToken<SgAdminLabels>;
192
+ /**
193
+ * Nastaví texty layoutu. Chýbajúce kľúče sa doplnia z angličtiny.
194
+ *
195
+ * ```ts
196
+ * providers: [provideSgAdminLabels(SG_ADMIN_LABELS_SK)]
197
+ * providers: [provideSgAdminLabels({ drawerClose: 'Schließen' })]
198
+ * ```
199
+ */
200
+ declare function provideSgAdminLabels(labels: Partial<SgAdminLabels>): Provider;
201
+
202
+ export { DrawerRef, DrawerService, SG_ADMIN_LABELS, SG_ADMIN_LABELS_EN, SG_ADMIN_LABELS_SK, SagittariusAdmin, provideSgAdminLabels };
203
+ export type { DrawerData, DrawerOptions, SgAdminLabels, SgMenuItem, SgUser, SgUserMenuItem };
package/package.json CHANGED
@@ -1,6 +1,59 @@
1
1
  {
2
2
  "name": "sagittarius-admin-template",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.0",
4
+ "description": "Angular admin layout: collapsible sidebar, header with user menu, stacked drawers, footer, design tokens (light/dark) and page CSS utilities. Built on Angular Material 3.",
5
+ "keywords": [
6
+ "angular",
7
+ "angular-material",
8
+ "admin",
9
+ "admin-template",
10
+ "dashboard",
11
+ "layout",
12
+ "sidebar",
13
+ "drawer",
14
+ "material3",
15
+ "dark-mode"
16
+ ],
17
+ "author": "Marian Spisiak",
18
+ "license": "MIT",
19
+ "homepage": "https://majo32.github.io/sagittarius-admin-template/",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/majo32/sagittarius-admin-template.git",
23
+ "directory": "projects/sagittarius-admin-template"
24
+ },
25
+ "bugs": {
26
+ "url": "https://github.com/majo32/sagittarius-admin-template/issues"
27
+ },
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "peerDependencies": {
32
+ "@angular/cdk": "^20.2.0",
33
+ "@angular/common": "^20.2.0",
34
+ "@angular/core": "^20.2.0",
35
+ "@angular/material": "^20.2.0",
36
+ "@angular/router": "^20.2.0"
37
+ },
38
+ "dependencies": {
39
+ "tslib": "^2.3.0"
40
+ },
41
+ "exports": {
42
+ "./styles/*": {
43
+ "sass": "./styles/*",
44
+ "default": "./styles/*"
45
+ },
46
+ "./package.json": {
47
+ "default": "./package.json"
48
+ },
49
+ ".": {
50
+ "types": "./index.d.ts",
51
+ "default": "./fesm2022/sagittarius-admin-template.mjs"
52
+ }
53
+ },
54
+ "sideEffects": [
55
+ "*.scss"
56
+ ],
57
+ "module": "fesm2022/sagittarius-admin-template.mjs",
58
+ "typings": "index.d.ts"
6
59
  }