@gnggln/ng-ui-system 1.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/esm2022/gnggln-ng-ui-system.mjs +5 -0
  2. package/esm2022/lib/components/accordion/accordion.component.mjs +353 -0
  3. package/esm2022/lib/components/accordion/accordion.types.mjs +6 -0
  4. package/esm2022/lib/components/accordion/index.mjs +2 -0
  5. package/esm2022/lib/components/base-layout/base-layout.component.mjs +218 -0
  6. package/esm2022/lib/components/base-layout/base-layout.types.mjs +6 -0
  7. package/esm2022/lib/components/base-layout/index.mjs +14 -0
  8. package/esm2022/lib/components/button/button-area.component.mjs +196 -0
  9. package/esm2022/lib/components/button/button.component.mjs +164 -0
  10. package/esm2022/lib/components/button/button.types.mjs +6 -0
  11. package/esm2022/lib/components/button/index.mjs +16 -0
  12. package/esm2022/lib/components/crud-table/crud-table.component.mjs +789 -0
  13. package/esm2022/lib/components/crud-table/crud-table.types.mjs +6 -0
  14. package/esm2022/lib/components/crud-table/index.mjs +16 -0
  15. package/esm2022/lib/components/form-builder/adapters/it-date-adapter.mjs +82 -0
  16. package/esm2022/lib/components/form-builder/directives/currency-input.directive.mjs +184 -0
  17. package/esm2022/lib/components/form-builder/form-builder.component.mjs +824 -0
  18. package/esm2022/lib/components/form-builder/form-wizard.component.mjs +510 -0
  19. package/esm2022/lib/components/form-builder/index.mjs +19 -0
  20. package/esm2022/lib/components/form-builder/services/form-condition.service.mjs +132 -0
  21. package/esm2022/lib/components/form-builder/services/form-validation.service.mjs +381 -0
  22. package/esm2022/lib/components/form-builder/services/location.service.mjs +140 -0
  23. package/esm2022/lib/components/form-builder/services/wizard-sync.service.mjs +84 -0
  24. package/esm2022/lib/components/form-builder/sub-components/error-summary/form-error-summary.component.mjs +161 -0
  25. package/esm2022/lib/components/form-builder/sub-components/file-input/file-input.component.mjs +310 -0
  26. package/esm2022/lib/components/form-builder/sub-components/specifica-territoriale/specifica-territoriale.component.mjs +648 -0
  27. package/esm2022/lib/components/form-builder/sub-components/table-territoriale/table-territoriale.component.mjs +432 -0
  28. package/esm2022/lib/components/form-builder/types/condition.types.mjs +6 -0
  29. package/esm2022/lib/components/form-builder/types/field.types.mjs +6 -0
  30. package/esm2022/lib/components/form-builder/types/index.mjs +2 -0
  31. package/esm2022/lib/components/form-builder/types/schema.types.mjs +6 -0
  32. package/esm2022/lib/components/form-builder/types/territoriale.types.mjs +6 -0
  33. package/esm2022/lib/components/form-builder/types/validation.types.mjs +6 -0
  34. package/esm2022/lib/components/form-builder-editor/form-builder-editor.component.mjs +730 -0
  35. package/esm2022/lib/components/form-builder-editor/form-builder-editor.service.mjs +56 -0
  36. package/esm2022/lib/components/form-builder-editor/index.mjs +21 -0
  37. package/esm2022/lib/components/form-builder-editor/services/editor-persistence.service.mjs +190 -0
  38. package/esm2022/lib/components/form-builder-editor/services/editor-state.service.mjs +324 -0
  39. package/esm2022/lib/components/form-builder-editor/services/field-factory.service.mjs +188 -0
  40. package/esm2022/lib/components/form-builder-editor/sub-components/condition-editor/condition-editor.component.mjs +667 -0
  41. package/esm2022/lib/components/form-builder-editor/sub-components/editor-toolbar/editor-toolbar.component.mjs +317 -0
  42. package/esm2022/lib/components/form-builder-editor/sub-components/field-config-panel/field-config-panel.component.mjs +611 -0
  43. package/esm2022/lib/components/form-builder-editor/sub-components/field-palette/field-palette.component.mjs +267 -0
  44. package/esm2022/lib/components/form-builder-editor/sub-components/form-values-panel/form-values-panel.component.mjs +276 -0
  45. package/esm2022/lib/components/form-builder-editor/sub-components/options-editor/options-editor.component.mjs +323 -0
  46. package/esm2022/lib/components/form-builder-editor/sub-components/preview-container/preview-container.component.mjs +238 -0
  47. package/esm2022/lib/components/form-builder-editor/sub-components/section-editor/section-editor.component.mjs +472 -0
  48. package/esm2022/lib/components/form-builder-editor/sub-components/validation-editor/validation-editor.component.mjs +473 -0
  49. package/esm2022/lib/components/form-builder-editor/types/editor.types.mjs +6 -0
  50. package/esm2022/lib/components/layout-builder/index.mjs +18 -0
  51. package/esm2022/lib/components/layout-builder/layout-builder.component.mjs +1730 -0
  52. package/esm2022/lib/components/layout-builder/layout-builder.types.mjs +9 -0
  53. package/esm2022/lib/components/layout-builder/layout.service.mjs +239 -0
  54. package/esm2022/lib/components/modal/confirm-dialog.component.mjs +151 -0
  55. package/esm2022/lib/components/modal/index.mjs +4 -0
  56. package/esm2022/lib/components/modal/modal.component.mjs +139 -0
  57. package/esm2022/lib/components/modal/modal.service.mjs +194 -0
  58. package/esm2022/lib/components/modal/modal.types.mjs +6 -0
  59. package/esm2022/lib/components/page-header/breadcrumb.service.mjs +242 -0
  60. package/esm2022/lib/components/page-header/index.mjs +20 -0
  61. package/esm2022/lib/components/page-header/page-header.component.mjs +243 -0
  62. package/esm2022/lib/components/page-header/page-header.types.mjs +21 -0
  63. package/esm2022/lib/components/table/index.mjs +2 -0
  64. package/esm2022/lib/components/table/paginated-table.component.mjs +407 -0
  65. package/esm2022/lib/components/table/table.types.mjs +6 -0
  66. package/esm2022/lib/core/types/index.mjs +6 -0
  67. package/esm2022/lib/core/utils/index.mjs +53 -0
  68. package/esm2022/lib/sources/location-data.opt.json +8942 -0
  69. package/esm2022/lib/sources/nazioni.opt.json +215 -0
  70. package/esm2022/public-api.mjs +34 -0
  71. package/fesm2022/gnggln-ng-ui-system.mjs +55752 -0
  72. package/fesm2022/gnggln-ng-ui-system.mjs.map +1 -0
  73. package/index.d.ts +5 -0
  74. package/lib/components/accordion/accordion.component.d.ts +118 -0
  75. package/lib/components/accordion/accordion.types.d.ts +62 -0
  76. package/lib/components/accordion/index.d.ts +2 -0
  77. package/lib/components/base-layout/base-layout.component.d.ts +83 -0
  78. package/lib/components/base-layout/base-layout.types.d.ts +26 -0
  79. package/lib/components/base-layout/index.d.ts +13 -0
  80. package/lib/components/button/button-area.component.d.ts +88 -0
  81. package/lib/components/button/button.component.d.ts +55 -0
  82. package/lib/components/button/button.types.d.ts +70 -0
  83. package/lib/components/button/index.d.ts +15 -0
  84. package/lib/components/crud-table/crud-table.component.d.ts +143 -0
  85. package/lib/components/crud-table/crud-table.types.d.ts +207 -0
  86. package/lib/components/crud-table/index.d.ts +15 -0
  87. package/lib/components/form-builder/adapters/it-date-adapter.d.ts +32 -0
  88. package/lib/components/form-builder/directives/currency-input.directive.d.ts +48 -0
  89. package/lib/components/form-builder/form-builder.component.d.ts +183 -0
  90. package/lib/components/form-builder/form-wizard.component.d.ts +87 -0
  91. package/lib/components/form-builder/index.d.ts +13 -0
  92. package/lib/components/form-builder/services/form-condition.service.d.ts +46 -0
  93. package/lib/components/form-builder/services/form-validation.service.d.ts +63 -0
  94. package/lib/components/form-builder/services/location.service.d.ts +83 -0
  95. package/lib/components/form-builder/services/wizard-sync.service.d.ts +63 -0
  96. package/lib/components/form-builder/sub-components/error-summary/form-error-summary.component.d.ts +28 -0
  97. package/lib/components/form-builder/sub-components/file-input/file-input.component.d.ts +41 -0
  98. package/lib/components/form-builder/sub-components/specifica-territoriale/specifica-territoriale.component.d.ts +145 -0
  99. package/lib/components/form-builder/sub-components/table-territoriale/table-territoriale.component.d.ts +108 -0
  100. package/lib/components/form-builder/types/condition.types.d.ts +51 -0
  101. package/lib/components/form-builder/types/field.types.d.ts +288 -0
  102. package/lib/components/form-builder/types/index.d.ts +5 -0
  103. package/lib/components/form-builder/types/schema.types.d.ts +227 -0
  104. package/lib/components/form-builder/types/territoriale.types.d.ts +170 -0
  105. package/lib/components/form-builder/types/validation.types.d.ts +174 -0
  106. package/lib/components/form-builder-editor/form-builder-editor.component.d.ts +117 -0
  107. package/lib/components/form-builder-editor/form-builder-editor.service.d.ts +38 -0
  108. package/lib/components/form-builder-editor/index.d.ts +15 -0
  109. package/lib/components/form-builder-editor/services/editor-persistence.service.d.ts +42 -0
  110. package/lib/components/form-builder-editor/services/editor-state.service.d.ts +66 -0
  111. package/lib/components/form-builder-editor/services/field-factory.service.d.ts +28 -0
  112. package/lib/components/form-builder-editor/sub-components/condition-editor/condition-editor.component.d.ts +139 -0
  113. package/lib/components/form-builder-editor/sub-components/editor-toolbar/editor-toolbar.component.d.ts +43 -0
  114. package/lib/components/form-builder-editor/sub-components/field-config-panel/field-config-panel.component.d.ts +83 -0
  115. package/lib/components/form-builder-editor/sub-components/field-palette/field-palette.component.d.ts +40 -0
  116. package/lib/components/form-builder-editor/sub-components/form-values-panel/form-values-panel.component.d.ts +51 -0
  117. package/lib/components/form-builder-editor/sub-components/options-editor/options-editor.component.d.ts +63 -0
  118. package/lib/components/form-builder-editor/sub-components/preview-container/preview-container.component.d.ts +68 -0
  119. package/lib/components/form-builder-editor/sub-components/section-editor/section-editor.component.d.ts +82 -0
  120. package/lib/components/form-builder-editor/sub-components/validation-editor/validation-editor.component.d.ts +112 -0
  121. package/lib/components/form-builder-editor/types/editor.types.d.ts +124 -0
  122. package/lib/components/layout-builder/index.d.ts +16 -0
  123. package/lib/components/layout-builder/layout-builder.component.d.ts +85 -0
  124. package/lib/components/layout-builder/layout-builder.types.d.ts +436 -0
  125. package/lib/components/layout-builder/layout.service.d.ts +100 -0
  126. package/lib/components/modal/confirm-dialog.component.d.ts +46 -0
  127. package/lib/components/modal/index.d.ts +4 -0
  128. package/lib/components/modal/modal.component.d.ts +44 -0
  129. package/lib/components/modal/modal.service.d.ts +93 -0
  130. package/lib/components/modal/modal.types.d.ts +110 -0
  131. package/lib/components/page-header/breadcrumb.service.d.ts +96 -0
  132. package/lib/components/page-header/index.d.ts +16 -0
  133. package/lib/components/page-header/page-header.component.d.ts +59 -0
  134. package/lib/components/page-header/page-header.types.d.ts +96 -0
  135. package/lib/components/table/index.d.ts +2 -0
  136. package/lib/components/table/paginated-table.component.d.ts +85 -0
  137. package/lib/components/table/table.types.d.ts +81 -0
  138. package/lib/core/types/index.d.ts +57 -0
  139. package/lib/core/utils/index.d.ts +29 -0
  140. package/package.json +44 -0
  141. package/public-api.d.ts +22 -0
@@ -0,0 +1,436 @@
1
+ /**
2
+ * @module ng-ui-system/layout-builder
3
+ * Types and interfaces for the UiLayoutBuilder shell component.
4
+ *
5
+ * The layout builder uses a schema-driven approach (similar to UiFormBuilder)
6
+ * to materialize a full responsive application shell from a single descriptor.
7
+ */
8
+ import { UiIconName, UiVariant } from '../../core/types/index';
9
+ /** Layout mode controlling the overall navigation strategy. */
10
+ export type UiLayoutMode = 'sidebar' | 'topbar';
11
+ /** Content area sizing strategy. */
12
+ export type UiContentType = 'fluid' | 'boxed' | 'fullscreen';
13
+ /** Single breadcrumb entry derived from the navigation schema. */
14
+ export interface UiLayoutBreadcrumb {
15
+ /** Display label. */
16
+ label: string;
17
+ /** Route URL (omitted for the current/last crumb). */
18
+ url?: string;
19
+ /** Whether this is the last (current) breadcrumb in the trail. */
20
+ isLast: boolean;
21
+ }
22
+ /** Discriminator for navigation item behaviour. */
23
+ export type UiNavItemType = 'route' | 'external' | 'divider';
24
+ /**
25
+ * Single navigation item descriptor.
26
+ *
27
+ * @usageNotes
28
+ * ### Internal route
29
+ * ```typescript
30
+ * { id: 'users', label: 'Utenti', icon: 'users', route: '/users' }
31
+ * ```
32
+ *
33
+ * ### External link
34
+ * ```typescript
35
+ * { id: 'docs', label: 'Docs', icon: 'external-link', type: 'external',
36
+ * href: 'https://docs.example.com', target: '_blank' }
37
+ * ```
38
+ *
39
+ * ### Expandable with children
40
+ * ```typescript
41
+ * {
42
+ * id: 'form-builder', label: 'Form Builder', icon: 'file-text',
43
+ * route: '/form-builder',
44
+ * children: [
45
+ * { label: 'Panoramica', items: [
46
+ * { id: 'fb-all', label: 'Tutti i campi', route: '/form-builder/all-fields' }
47
+ * ]}
48
+ * ]
49
+ * }
50
+ * ```
51
+ */
52
+ export interface UiNavItem {
53
+ /** Unique item identifier. */
54
+ id: string;
55
+ /** Display label. */
56
+ label: string;
57
+ /** Lucide icon name. */
58
+ icon?: UiIconName;
59
+ /** Item behaviour type. @default 'route' */
60
+ type?: UiNavItemType;
61
+ /** Angular router path (for `type: 'route'`). */
62
+ route?: string;
63
+ /** Whether to use exact matching for active state. @default false */
64
+ routeActiveExact?: boolean;
65
+ /** External URL (for `type: 'external'`). */
66
+ href?: string;
67
+ /** Link target for external links. @default '_blank' */
68
+ target?: '_blank' | '_self';
69
+ /** Nested child groups for expandable navigation. */
70
+ children?: UiNavGroup[];
71
+ /** Whether this item is hidden. @default false */
72
+ hidden?: boolean;
73
+ /** Badge text or count displayed next to the label. */
74
+ badge?: string | number;
75
+ /** Whether to include this item in the mobile bottom navigation bar. @default false */
76
+ bottomNav?: boolean;
77
+ /** Sort order in the bottom navigation bar (lower = first). */
78
+ bottomNavOrder?: number;
79
+ }
80
+ /**
81
+ * Labelled group of navigation items (nested under a parent `UiNavItem`).
82
+ *
83
+ * @usageNotes
84
+ * ```typescript
85
+ * const group: UiNavGroup = {
86
+ * label: 'Validazioni',
87
+ * items: [
88
+ * { id: 'v-std', label: 'Standard', route: '/form-builder/validations-standard' },
89
+ * { id: 'v-cross', label: 'Cross-field', route: '/form-builder/validations-crossfield' },
90
+ * ]
91
+ * };
92
+ * ```
93
+ */
94
+ export interface UiNavGroup {
95
+ /** Group heading displayed above the items. */
96
+ label: string;
97
+ /** Items belonging to this group. */
98
+ items: UiNavItem[];
99
+ }
100
+ /**
101
+ * Top-level grouping used to partition `UiNavItem[]` into labelled sections
102
+ * in the sidebar (e.g. "Overview", "Components").
103
+ */
104
+ export interface UiNavSection {
105
+ /** Unique section identifier. */
106
+ id: string;
107
+ /** Section heading displayed in the sidebar. */
108
+ label: string;
109
+ /** IDs of `UiNavItem`s belonging to this section (order preserved). */
110
+ itemIds: string[];
111
+ }
112
+ /**
113
+ * Auto-discovery configuration for generating navigation items from Angular routes.
114
+ *
115
+ * When enabled, the layout builder scans the route tree and creates
116
+ * `UiNavItem` entries from routes that declare `data.id` and `data.title`.
117
+ */
118
+ export interface UiNavAutoDiscoveryConfig {
119
+ /** Whether auto-discovery is enabled. */
120
+ enabled: boolean;
121
+ /** Route paths to exclude from discovery (exact match). */
122
+ excludePaths?: string[];
123
+ /** How to merge discovered items with manually defined items. @default 'append' */
124
+ mergeStrategy?: 'prepend' | 'append' | 'replace';
125
+ }
126
+ /** Navigation configuration block within `UiLayoutSchema`. */
127
+ export interface UiLayoutNavigationConfig {
128
+ /** Flat list of all navigation items. */
129
+ items: UiNavItem[];
130
+ /** Optional grouping into labelled sidebar sections. */
131
+ sections?: UiNavSection[];
132
+ /** Whether the desktop sidebar can collapse to icon-only mode. @default true */
133
+ collapsible?: boolean;
134
+ /** Mobile navigation behaviour. @default 'both' */
135
+ mobileMode?: 'drawer' | 'bottom-nav' | 'both';
136
+ /** Auto-discovery settings for route-driven navigation. */
137
+ autoDiscovery?: UiNavAutoDiscoveryConfig;
138
+ }
139
+ /** Logo configuration for the layout header. */
140
+ export interface UiLayoutLogo {
141
+ /** Short text rendered inside a styled badge (e.g. "UI"). Mutually exclusive with `src`. */
142
+ text?: string;
143
+ /** Image URL for the logo. Mutually exclusive with `text`. */
144
+ src?: string;
145
+ /** Alt text for the logo image. */
146
+ alt?: string;
147
+ }
148
+ /** Header / top-bar configuration. */
149
+ export interface UiLayoutHeaderConfig {
150
+ /** Logo displayed in the sidebar header and mobile top-bar. */
151
+ logo?: UiLayoutLogo;
152
+ /** Application title. */
153
+ title: string;
154
+ /** Optional subtitle or tagline. */
155
+ subtitle?: string;
156
+ }
157
+ /** Single link rendered in the layout footer. */
158
+ export interface UiFooterLink {
159
+ /** Display label. */
160
+ label: string;
161
+ /** External URL. */
162
+ href?: string;
163
+ /** Angular router path (alternative to `href`). */
164
+ route?: string;
165
+ /** Lucide icon name. */
166
+ icon?: UiIconName;
167
+ /** Link target for external links. @default '_self' */
168
+ target?: '_blank' | '_self';
169
+ }
170
+ /** Footer configuration. */
171
+ export interface UiLayoutFooterConfig {
172
+ /** Links rendered in the footer. */
173
+ links?: UiFooterLink[];
174
+ /** Static text (e.g. copyright, version). */
175
+ text?: string;
176
+ }
177
+ /**
178
+ * Single action within the speed-dial FAB.
179
+ *
180
+ * @usageNotes
181
+ * ```typescript
182
+ * const action: UiFabAction = {
183
+ * id: 'new-user',
184
+ * label: 'Nuovo utente',
185
+ * icon: 'user',
186
+ * variant: 'primary',
187
+ * action: () => router.navigate(['/users/new']),
188
+ * };
189
+ * ```
190
+ */
191
+ export interface UiFabAction {
192
+ /** Unique action identifier. */
193
+ id: string;
194
+ /** Tooltip / label text. */
195
+ label: string;
196
+ /** Lucide icon name. */
197
+ icon: UiIconName;
198
+ /** Callback invoked on click. */
199
+ action?: () => void;
200
+ /** Visual variant for the button. @default 'primary' */
201
+ variant?: UiVariant;
202
+ /** Accessible label (falls back to `label` if omitted). */
203
+ ariaLabel?: string;
204
+ }
205
+ /** Speed-dial FAB configuration. */
206
+ export interface UiLayoutFabConfig {
207
+ /** Primary FAB action (always visible). */
208
+ mainAction: UiFabAction;
209
+ /** Secondary actions revealed on expand. */
210
+ secondaryActions?: UiFabAction[];
211
+ /** Screen corner position. @default 'bottom-right' */
212
+ position?: 'bottom-right' | 'bottom-left';
213
+ }
214
+ /** Default page-header settings applied to every route unless overridden. */
215
+ export interface UiLayoutPageHeaderConfig {
216
+ /** Whether to show the page header (breadcrumbs + title). @default true */
217
+ show?: boolean;
218
+ /** Home breadcrumb route path. @default '/' */
219
+ homeRoute?: string;
220
+ /** Whether to show the Home link in breadcrumbs. @default true */
221
+ showHome?: boolean;
222
+ /** Whether to sync `document.title` with the current page. @default false */
223
+ updateDocumentTitle?: boolean;
224
+ /** Suffix appended to `document.title`. */
225
+ titleSuffix?: string;
226
+ }
227
+ /** Overlay loader configuration. */
228
+ export interface UiLayoutLoaderConfig {
229
+ /** Show the loader when the layout mounts (hides on first NavigationEnd). @default false */
230
+ showOnInit?: boolean;
231
+ /** Minimum display duration in milliseconds (prevents flicker). @default 0 */
232
+ minDuration?: number;
233
+ }
234
+ /** Discriminator for topbar bar type. */
235
+ export type UiBarType = 'notification' | 'brand' | 'navigation' | 'links';
236
+ /**
237
+ * Notification bar displayed at the top of the page.
238
+ *
239
+ * @usageNotes
240
+ * ```typescript
241
+ * { text: 'Manutenzione prevista alle 22:00', variant: 'warn', dismissible: true }
242
+ * ```
243
+ */
244
+ export interface UiNotificationBarConfig {
245
+ /** Notification message text. */
246
+ text: string;
247
+ /** Visual variant. @default 'primary' */
248
+ variant?: UiVariant;
249
+ /** Whether the user can dismiss this bar. @default true */
250
+ dismissible?: boolean;
251
+ /** Lucide icon shown before the text. */
252
+ icon?: UiIconName;
253
+ }
254
+ /**
255
+ * Brand bar with logo, title, and optional user dropdown.
256
+ *
257
+ * @usageNotes
258
+ * ```typescript
259
+ * {
260
+ * logo: { src: '/assets/logo.svg', alt: 'My App' },
261
+ * title: 'My App',
262
+ * userDropdown: {
263
+ * label: 'Mario Rossi',
264
+ * avatar: { src: '/avatar.jpg' },
265
+ * items: [
266
+ * { id: 'profile', label: 'Profilo', icon: 'user', route: '/profile' },
267
+ * { id: 'logout', label: 'Logout', icon: 'log-out', action: () => auth.logout() },
268
+ * ],
269
+ * },
270
+ * }
271
+ * ```
272
+ */
273
+ export interface UiBrandBarConfig {
274
+ /** Logo displayed on the left. */
275
+ logo?: UiLayoutLogo;
276
+ /** Application title. */
277
+ title?: string;
278
+ /** User dropdown aligned to the right. */
279
+ userDropdown?: UiUserDropdownConfig;
280
+ }
281
+ /** User dropdown menu configuration for the brand bar. */
282
+ export interface UiUserDropdownConfig {
283
+ /** Display label (e.g. user's name). */
284
+ label: string;
285
+ /** Lucide icon name (fallback when no avatar). */
286
+ icon?: UiIconName;
287
+ /** User avatar image. */
288
+ avatar?: {
289
+ src: string;
290
+ alt?: string;
291
+ };
292
+ /** Dropdown menu items. */
293
+ items: UiDropdownItem[];
294
+ }
295
+ /** Single item in a dropdown menu. */
296
+ export interface UiDropdownItem {
297
+ /** Unique item identifier. */
298
+ id: string;
299
+ /** Display label. */
300
+ label: string;
301
+ /** Lucide icon name. */
302
+ icon?: UiIconName;
303
+ /** Angular router path. */
304
+ route?: string;
305
+ /** Callback invoked on click. */
306
+ action?: () => void;
307
+ /** Render a divider above this item. */
308
+ divider?: boolean;
309
+ }
310
+ /** Navigation bar (used in topbar mode to render horizontal nav links). */
311
+ export interface UiNavigationBarConfig {
312
+ /** Override items for this bar (defaults to `schema.navigation.items`). */
313
+ items?: UiNavItem[];
314
+ }
315
+ /**
316
+ * Links bar with icon links (e.g. social media, external resources).
317
+ *
318
+ * @usageNotes
319
+ * ```typescript
320
+ * {
321
+ * align: 'end',
322
+ * items: [
323
+ * { icon: 'github', href: 'https://github.com/...', ariaLabel: 'GitHub' },
324
+ * { label: 'Docs', icon: 'book-open', href: 'https://docs.example.com' },
325
+ * ],
326
+ * }
327
+ * ```
328
+ */
329
+ export interface UiLinksBarConfig {
330
+ /** Horizontal alignment of items. @default 'end' */
331
+ align?: 'start' | 'center' | 'end' | 'space-between';
332
+ /** Link items. */
333
+ items: UiBarLinkItem[];
334
+ }
335
+ /** Single link item in a links bar. */
336
+ export interface UiBarLinkItem {
337
+ /** Display label (optional, icon-only if omitted). */
338
+ label?: string;
339
+ /** Lucide icon name. */
340
+ icon?: UiIconName;
341
+ /** External URL. */
342
+ href?: string;
343
+ /** Angular router path. */
344
+ route?: string;
345
+ /** Link target. @default '_self' */
346
+ target?: '_blank' | '_self';
347
+ /** Accessible label for icon-only items. */
348
+ ariaLabel?: string;
349
+ }
350
+ /**
351
+ * Single bar descriptor in the topbar bar stack.
352
+ *
353
+ * @usageNotes
354
+ * ```typescript
355
+ * const bars: UiBarConfig[] = [
356
+ * { id: 'promo', type: 'notification', notification: { text: 'Promo attiva!', dismissible: true } },
357
+ * { id: 'main', type: 'brand', brand: { logo: { text: 'UI' }, title: 'My App' } },
358
+ * { id: 'nav', type: 'navigation' },
359
+ * { id: 'social', type: 'links', links: { align: 'end', items: [...] } },
360
+ * ];
361
+ * ```
362
+ */
363
+ export interface UiBarConfig {
364
+ /** Unique bar identifier. */
365
+ id: string;
366
+ /** Bar type discriminator. */
367
+ type: UiBarType;
368
+ /** Whether the bar is initially visible. @default true */
369
+ visible?: boolean;
370
+ /** Configuration when `type === 'notification'`. */
371
+ notification?: UiNotificationBarConfig;
372
+ /** Configuration when `type === 'brand'`. */
373
+ brand?: UiBrandBarConfig;
374
+ /** Configuration when `type === 'navigation'`. */
375
+ navigation?: UiNavigationBarConfig;
376
+ /** Configuration when `type === 'links'`. */
377
+ links?: UiLinksBarConfig;
378
+ }
379
+ /** Topbar configuration (bar stack). */
380
+ export interface UiTopbarConfig {
381
+ /** Ordered list of bars rendered top-to-bottom. */
382
+ bars: UiBarConfig[];
383
+ }
384
+ /**
385
+ * Root descriptor for the `ui-layout-builder` component.
386
+ *
387
+ * @usageNotes
388
+ * ### Minimal sidebar example
389
+ * ```typescript
390
+ * const schema: UiLayoutSchema = {
391
+ * header: { title: 'My App' },
392
+ * navigation: {
393
+ * items: [
394
+ * { id: 'home', label: 'Home', icon: 'home', route: '/', routeActiveExact: true },
395
+ * { id: 'users', label: 'Utenti', icon: 'users', route: '/users' },
396
+ * ],
397
+ * },
398
+ * };
399
+ * ```
400
+ *
401
+ * ### Topbar mode example
402
+ * ```typescript
403
+ * const schema: UiLayoutSchema = {
404
+ * mode: 'topbar',
405
+ * header: { logo: { text: 'UI' }, title: 'My App' },
406
+ * navigation: { items: [...] },
407
+ * topbar: {
408
+ * bars: [
409
+ * { id: 'alert', type: 'notification', notification: { text: 'Beta!', dismissible: true } },
410
+ * { id: 'main', type: 'brand', brand: { logo: { text: 'UI' }, title: 'My App' } },
411
+ * { id: 'nav', type: 'navigation' },
412
+ * ],
413
+ * },
414
+ * };
415
+ * ```
416
+ */
417
+ export interface UiLayoutSchema {
418
+ /** Layout mode. @default 'sidebar' */
419
+ mode?: UiLayoutMode;
420
+ /** Header / top-bar branding (used in sidebar mode and as fallback). */
421
+ header: UiLayoutHeaderConfig;
422
+ /** Navigation structure and behaviour. */
423
+ navigation: UiLayoutNavigationConfig;
424
+ /** Footer content (optional). */
425
+ footer?: UiLayoutFooterConfig;
426
+ /** Floating action button / speed dial (optional). */
427
+ fab?: UiLayoutFabConfig;
428
+ /** Page header defaults applied to every page (optional). */
429
+ pageHeader?: UiLayoutPageHeaderConfig;
430
+ /** Overlay loader configuration (optional). */
431
+ loader?: UiLayoutLoaderConfig;
432
+ /** Content area sizing strategy. @default 'fluid' */
433
+ contentType?: UiContentType;
434
+ /** Topbar configuration (only used when `mode === 'topbar'`). */
435
+ topbar?: UiTopbarConfig;
436
+ }
@@ -0,0 +1,100 @@
1
+ import { Observable } from 'rxjs';
2
+ import { UiFabAction, UiLayoutFabConfig, UiLayoutMode, UiContentType } from './layout-builder.types';
3
+ import * as i0 from "@angular/core";
4
+ export declare class UiLayoutService {
5
+ private readonly platformId;
6
+ private readonly _loading$;
7
+ /** Whether the overlay loader is currently visible. */
8
+ readonly loading$: Observable<boolean>;
9
+ /** Show the full-screen overlay loader and block body scroll. */
10
+ showLoader(): void;
11
+ /** Hide the overlay loader and restore body scroll. */
12
+ hideLoader(): void;
13
+ /** Toggle the overlay loader. */
14
+ toggleLoader(): void;
15
+ /** Synchronous snapshot of the loading state. */
16
+ isLoading(): boolean;
17
+ private readonly _layoutMode$;
18
+ /** Current layout mode (sidebar or topbar). */
19
+ readonly layoutMode$: Observable<UiLayoutMode>;
20
+ /**
21
+ * Switch layout mode with loader masking the transition.
22
+ * Shows the loader, applies the mode change, then hides the loader
23
+ * after a short delay to prevent visible layout shift.
24
+ */
25
+ setLayoutMode(mode: UiLayoutMode, transitionMs?: number): void;
26
+ /** Synchronous snapshot of the current layout mode. */
27
+ getLayoutMode(): UiLayoutMode;
28
+ /**
29
+ * @internal Called by the layout-builder component to set the initial mode
30
+ * from the schema without triggering the loader transition.
31
+ */
32
+ _setInitialLayoutMode(mode: UiLayoutMode): void;
33
+ private readonly _contentType$;
34
+ /** Current content type (fluid, boxed, fullscreen). */
35
+ readonly contentType$: Observable<UiContentType>;
36
+ /** Set the content type per-route or globally. */
37
+ setContentType(type: UiContentType): void;
38
+ /** Synchronous snapshot of the current content type. */
39
+ getContentType(): UiContentType;
40
+ /** @internal */
41
+ _setInitialContentType(type: UiContentType): void;
42
+ private readonly _sidebarOpen$;
43
+ /** Whether the mobile sidebar drawer is open. */
44
+ readonly sidebarOpen$: Observable<boolean>;
45
+ private readonly _sidebarCollapsed$;
46
+ /** Whether the desktop sidebar is in collapsed (icon-only) mode. */
47
+ readonly sidebarCollapsed$: Observable<boolean>;
48
+ /** Toggle the desktop sidebar between expanded and collapsed. */
49
+ toggleSidebar(): void;
50
+ /** Set the desktop sidebar collapsed state explicitly. */
51
+ collapseSidebar(collapsed?: boolean): void;
52
+ /** Open the mobile sidebar drawer. */
53
+ openMobileSidebar(): void;
54
+ /** Close the mobile sidebar drawer. */
55
+ closeMobileSidebar(): void;
56
+ /** Synchronous snapshot: is the mobile sidebar open? */
57
+ isSidebarOpen(): boolean;
58
+ /** Synchronous snapshot: is the desktop sidebar collapsed? */
59
+ isSidebarCollapsed(): boolean;
60
+ private _defaultFabConfig;
61
+ private readonly _fabConfig$;
62
+ /** Current FAB configuration (schema default merged with page overrides). */
63
+ readonly fabConfig$: Observable<UiLayoutFabConfig | null>;
64
+ /**
65
+ * Called internally by the layout-builder component to register the
66
+ * schema-level default FAB config.
67
+ * @internal
68
+ */
69
+ _setDefaultFabConfig(config: UiLayoutFabConfig | null): void;
70
+ /** Override the FAB main action for the current page context. */
71
+ setMainFabAction(action: UiFabAction): void;
72
+ /** Override all FAB actions for the current page context. */
73
+ setFabActions(main: UiFabAction, secondary?: UiFabAction[]): void;
74
+ /** Reset FAB to the schema-level default configuration. */
75
+ clearFabActions(): void;
76
+ private readonly _navBadges$;
77
+ /** Observable map of nav-item badges keyed by item ID. */
78
+ readonly navBadges$: Observable<Map<string, string | number | null>>;
79
+ private readonly _navVisibility$;
80
+ /** Observable map of nav-item visibility overrides keyed by item ID. */
81
+ readonly navVisibility$: Observable<Map<string, boolean>>;
82
+ /** Set or clear a badge on a navigation item. Pass `null` to remove. */
83
+ setNavBadge(itemId: string, badge: string | number | null): void;
84
+ /** Override visibility of a navigation item. */
85
+ setNavItemVisibility(itemId: string, visible: boolean): void;
86
+ private readonly _barVisibility$;
87
+ /** Observable map of topbar bar visibility keyed by bar ID. */
88
+ readonly barVisibility$: Observable<Map<string, boolean>>;
89
+ /** Show a topbar bar by ID. */
90
+ showBar(barId: string): void;
91
+ /** Hide a topbar bar by ID. */
92
+ hideBar(barId: string): void;
93
+ /** Toggle visibility of a topbar bar by ID. */
94
+ toggleBar(barId: string): void;
95
+ /** Synchronous check of bar visibility (schema `visible` fallback). */
96
+ isBarVisible(barId: string, schemaVisible?: boolean): boolean;
97
+ private setBodyOverflow;
98
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiLayoutService, never>;
99
+ static ɵprov: i0.ɵɵInjectableDeclaration<UiLayoutService>;
100
+ }
@@ -0,0 +1,46 @@
1
+ import { UiConfirmDialogData, UiConfirmVariant, UiIconName, UiVariant } from './modal.types';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Dialogo di conferma leggero per azioni condizionali.
5
+ *
6
+ * Non va utilizzato direttamente nel template: viene aperto
7
+ * programmaticamente tramite `UiModalService.confirm()` e i suoi
8
+ * metodi scorciatoia (`confirmDelete`, `confirmDiscard`, `confirmSave`).
9
+ *
10
+ * Supporta quattro varianti semantiche — confirm, delete, warn, info —
11
+ * ciascuna con icona e colore preconfigurati.
12
+ *
13
+ * @selector ui-confirm-dialog
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * // Apertura tramite servizio
18
+ * this.modalService.confirm({
19
+ * title: 'Conferma eliminazione',
20
+ * message: 'Questa azione non puo essere annullata.',
21
+ * variant: 'delete',
22
+ * }).subscribe(confirmed => {
23
+ * if (confirmed) this.deleteItem();
24
+ * });
25
+ * ```
26
+ */
27
+ export declare class UiConfirmDialogComponent {
28
+ /** @internal Dati iniettati dal servizio modale. */
29
+ readonly data: UiConfirmDialogData;
30
+ /** @internal Riferimento al dialogo per la chiusura. */
31
+ private readonly dialogRef;
32
+ /** Variante semantica corrente. */
33
+ get variant(): UiConfirmVariant;
34
+ /** Nome icona Lucide da visualizzare. */
35
+ get iconName(): UiIconName;
36
+ /** Variante del pulsante di conferma. */
37
+ get confirmButtonVariant(): UiVariant;
38
+ /** Classi CSS per il contenitore icona. */
39
+ get iconClasses(): string;
40
+ /** Conferma e chiude il dialogo con `true`. */
41
+ confirm(): void;
42
+ /** Annulla e chiude il dialogo con `false`. */
43
+ cancel(): void;
44
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiConfirmDialogComponent, never>;
45
+ static ɵcmp: i0.ɵɵComponentDeclaration<UiConfirmDialogComponent, "ui-confirm-dialog", never, {}, {}, never, never, true, never>;
46
+ }
@@ -0,0 +1,4 @@
1
+ export { UiModalComponent } from './modal.component';
2
+ export { UiConfirmDialogComponent } from './confirm-dialog.component';
3
+ export { UiModalService } from './modal.service';
4
+ export { UiModalConfig, UiModalOpenConfig, UiModalSize, UiConfirmDialogData, UiConfirmVariant, } from './modal.types';
@@ -0,0 +1,44 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { UiModalConfig } from './modal.types';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Componente modale standalone con struttura header/body/footer.
6
+ *
7
+ * Da utilizzare come wrapper all'interno di componenti aperti
8
+ * tramite `UiModalService.open()`. Fornisce la struttura visuale
9
+ * e gestisce la chiusura programmatica.
10
+ *
11
+ * **Content projection:**
12
+ * - Contenuto di default: va nel body
13
+ * - `[uiModalHeader]`: sostituisce il titolo nell'header
14
+ * - `[uiModalFooter]`: azioni nel footer
15
+ *
16
+ * @selector ui-modal
17
+ *
18
+ * @example
19
+ * ```html
20
+ * <ui-modal [config]="{ title: 'Dettagli', size: 'md' }">
21
+ * <p>Contenuto del body della modale.</p>
22
+ * <div uiModalFooter>
23
+ * <ui-button label="Chiudi" variant="ghost" (click)="close()" />
24
+ * <ui-button label="Salva" variant="primary" (click)="save()" />
25
+ * </div>
26
+ * </ui-modal>
27
+ * ```
28
+ */
29
+ export declare class UiModalComponent {
30
+ /** Configurazione strutturale della modale. */
31
+ config: UiModalConfig;
32
+ /**
33
+ * Emesso quando la modale viene chiusa.
34
+ * Utile se il componente e usato direttamente nel template
35
+ * senza UiModalService.
36
+ */
37
+ closed: EventEmitter<unknown>;
38
+ /** @internal Riferimento al dialogo Material per la chiusura. */
39
+ private dialogRef;
40
+ /** Chiude la modale con un risultato opzionale. */
41
+ close(result?: unknown): void;
42
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiModalComponent, never>;
43
+ static ɵcmp: i0.ɵɵComponentDeclaration<UiModalComponent, "ui-modal", never, { "config": { "alias": "config"; "required": false; }; }, { "closed": "closed"; }, never, ["[uiModalHeader]", "*", "[uiModalFooter]"], true, never>;
44
+ }