@quazardous/qdadm 2.54.0 → 2.56.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 (33) hide show
  1. package/dist/styles/qdadm.css +1 -1
  2. package/package.json +1 -1
  3. package/src/cards/QdFavoritesCard.vue +4 -1
  4. package/src/cards/builtin/cards-index.json +1 -1
  5. package/src/cards/builtin/favorites/meta.json +1 -1
  6. package/src/components/index.ts +7 -0
  7. package/src/components/layout/AppLayout.vue +38 -117
  8. package/src/components/layout/QdFavoriteStar.vue +15 -4
  9. package/src/components/layout/QdSidebarMenus.vue +123 -0
  10. package/src/components/layout/QdTabs.types.ts +12 -0
  11. package/src/components/layout/QdTabs.vue +129 -0
  12. package/src/components/layout/defaults/DefaultMenu.vue +42 -132
  13. package/src/components/lists/ListPage.vue +10 -1
  14. package/src/components/lists/QdSaveSearch.vue +38 -5
  15. package/src/composables/index.ts +1 -0
  16. package/src/composables/useNavigation.ts +43 -3
  17. package/src/composables/useSettingsMenu.ts +80 -0
  18. package/src/domain/QdDomainBar.vue +23 -3
  19. package/src/domain/index.ts +1 -1
  20. package/src/domain/registry.ts +9 -0
  21. package/src/favorites/index.ts +1 -0
  22. package/src/favorites/look.ts +30 -0
  23. package/src/i18n/defaults/core.en.generated.ts +5 -0
  24. package/src/i18n/defaults/core.en.yml +5 -0
  25. package/src/i18n/defaults/core.fr.generated.ts +5 -0
  26. package/src/i18n/defaults/core.fr.yml +5 -0
  27. package/src/index.ts +1 -0
  28. package/src/kernel/Kernel.types.ts +18 -0
  29. package/src/kernel/KernelContext.routing.ts +1 -0
  30. package/src/kernel/KernelContext.types.ts +2 -0
  31. package/src/module/moduleRegistry.ts +2 -0
  32. package/src/styles/_qd-domain-bar.scss +116 -7
  33. package/src/styles/_sidebar.scss +109 -0
@@ -484,6 +484,10 @@ export default `core:
484
484
  urgent: urgent
485
485
  todo: to do
486
486
  # Favourites and recents: the star, "Save this search", the two cards (#5349)
487
+ # The settings menu behind the gear (#5401)
488
+ settingsMenu:
489
+ label: Settings
490
+ back: Back to the menu
487
491
  favorites:
488
492
  add: "Add {label} to favourites"
489
493
  remove: "Remove {label} from favourites"
@@ -492,6 +496,7 @@ export default `core:
492
496
  undoLabel: "Put {label} back in favourites"
493
497
  saveSearch: Save this search
494
498
  searchSaved: Search saved
499
+ removeSearch: "Search saved: remove it from favourites"
495
500
  searchName: Name of the search
496
501
  save: Save
497
502
  title: Favourites
@@ -482,6 +482,10 @@ core:
482
482
  urgent: urgent
483
483
  todo: to do
484
484
  # Favourites and recents: the star, "Save this search", the two cards (#5349)
485
+ # The settings menu behind the gear (#5401)
486
+ settingsMenu:
487
+ label: Settings
488
+ back: Back to the menu
485
489
  favorites:
486
490
  add: "Add {label} to favourites"
487
491
  remove: "Remove {label} from favourites"
@@ -490,6 +494,7 @@ core:
490
494
  undoLabel: "Put {label} back in favourites"
491
495
  saveSearch: Save this search
492
496
  searchSaved: Search saved
497
+ removeSearch: "Search saved: remove it from favourites"
493
498
  searchName: Name of the search
494
499
  save: Save
495
500
  title: Favourites
@@ -484,6 +484,10 @@ export default `core:
484
484
  urgent: urgent
485
485
  todo: à traiter
486
486
  # Favoris et récents : l'étoile, « Enregistrer cette recherche », les deux cartes (#5349)
487
+ # The settings menu behind the gear (#5401)
488
+ settingsMenu:
489
+ label: Paramètres
490
+ back: Retour au menu
487
491
  favorites:
488
492
  add: "Ajouter {label} aux favoris"
489
493
  remove: "Retirer {label} des favoris"
@@ -492,6 +496,7 @@ export default `core:
492
496
  undoLabel: "Remettre {label} dans les favoris"
493
497
  saveSearch: Enregistrer cette recherche
494
498
  searchSaved: Recherche enregistrée
499
+ removeSearch: "Recherche enregistrée : la retirer des favoris"
495
500
  searchName: Nom de la recherche
496
501
  save: Enregistrer
497
502
  title: Favoris
@@ -482,6 +482,10 @@ core:
482
482
  urgent: urgent
483
483
  todo: à traiter
484
484
  # Favoris et récents : l'étoile, « Enregistrer cette recherche », les deux cartes (#5349)
485
+ # The settings menu behind the gear (#5401)
486
+ settingsMenu:
487
+ label: Paramètres
488
+ back: Retour au menu
485
489
  favorites:
486
490
  add: "Ajouter {label} aux favoris"
487
491
  remove: "Retirer {label} des favoris"
@@ -490,6 +494,7 @@ core:
490
494
  undoLabel: "Remettre {label} dans les favoris"
491
495
  saveSearch: Enregistrer cette recherche
492
496
  searchSaved: Recherche enregistrée
497
+ removeSearch: "Recherche enregistrée : la retirer des favoris"
493
498
  searchName: Nom de la recherche
494
499
  save: Enregistrer
495
500
  title: Favoris
package/src/index.ts CHANGED
@@ -300,6 +300,7 @@ export {
300
300
  type NavSection,
301
301
  // NavItem already exported from kernel
302
302
  } from './composables/useNavigation'
303
+ export { useSettingsMenu, SETTINGS_MENU_IDS, type UseSettingsMenuReturn } from './composables/useSettingsMenu'
303
304
  export {
304
305
  useUnsavedChangesGuard,
305
306
  type UseUnsavedChangesGuardOptions,
@@ -61,6 +61,24 @@ export interface AppConfig {
61
61
  export interface Features {
62
62
  auth?: boolean
63
63
  poweredBy?: boolean
64
+ /**
65
+ * The settings menu behind the gear (#5401): who sees it, beyond the
66
+ * permissions of its entries; its name and icon
67
+ */
68
+ settingsMenu?: {
69
+ visible?: (user: unknown) => boolean
70
+ label?: string
71
+ icon?: string
72
+ /** Whole sections that belong to it (a module's own, say 'Security'), as declared, before i18n */
73
+ sections?: string[]
74
+ }
75
+ /**
76
+ * The favourites' look (#5402): the symbol, filled once a favourite; where a
77
+ * list's search bookmark goes; the text beside the icons or not
78
+ */
79
+ favorites?: { icon?: string; iconActive?: string; saveSearch?: 'filters' | 'header' | false; labels?: boolean }
80
+ /** Every domain bar's look, unless its domain says otherwise (#5396) */
81
+ domainBar?: { look?: 'toolbox' | 'card' | 'ribbon' }
64
82
  [key: string]: unknown
65
83
  }
66
84
 
@@ -328,6 +328,7 @@ export function applyRoutingMethods(KernelContextClass: { prototype: KernelConte
328
328
  route: routePrefix,
329
329
  icon: options.nav.icon,
330
330
  label,
331
+ ...(options.nav.menu ? { menu: options.nav.menu } : {}),
331
332
  }
332
333
  // Only set entity on nav item if registered (avoids permission check
333
334
  // failure). Routes always get entity binding, but nav items need it
@@ -162,6 +162,8 @@ export interface CrudOptions {
162
162
  section: string
163
163
  icon?: string
164
164
  label?: string
165
+ /** The settings menu, behind the gear (#5401); default the main one */
166
+ menu?: 'main' | 'settings'
165
167
  }
166
168
  routePrefix?: string
167
169
  /** Override the URL path segment (defaults to entity name). Useful for camelCase entities like 'jobTasks' → 'tasks'. */
@@ -94,6 +94,8 @@ export interface NavItem {
94
94
  icon?: string
95
95
  entity?: string
96
96
  exact?: boolean
97
+ /** The menu it belongs to (#5401): the main one, or the settings behind the gear */
98
+ menu?: 'main' | 'settings'
97
99
  }
98
100
 
99
101
  /**
@@ -14,7 +14,18 @@
14
14
  margin-bottom: -1px;
15
15
  }
16
16
 
17
+ // Every look is drawn from these: an app changes them in its own CSS, on
18
+ // `.qd-domain-bar`, on one look (`.qd-domain-bar--toolbox`, `--card`) or on one domain
19
+ // (`.qd-domain-bar[data-domain='purchases']`) (#5396, #5400)
17
20
  .qd-domain-bar {
21
+ --qd-domain-bar-bg: var(--qd-card-bg);
22
+ --qd-domain-bar-border: var(--qd-card-border);
23
+ --qd-domain-bar-margin: 0.75rem 1rem 0;
24
+ --qd-domain-bar-padding: 0.5rem 0.75rem;
25
+ --qd-domain-bar-radius: 8px;
26
+ --qd-domain-bar-shadow: none;
27
+ --qd-domain-bar-compact-shadow: 0 2px 6px rgb(0 0 0 / 8%);
28
+
18
29
  position: sticky;
19
30
  top: 0;
20
31
  z-index: 5;
@@ -22,11 +33,12 @@
22
33
  flex-wrap: wrap;
23
34
  align-items: center;
24
35
  gap: 0.5rem 1rem;
25
- margin: 0.75rem 1rem 0;
26
- padding: 0.5rem 0.75rem;
27
- background: var(--qd-card-bg);
28
- border: 1px solid var(--qd-card-border);
29
- border-radius: 8px;
36
+ margin: var(--qd-domain-bar-margin);
37
+ padding: var(--qd-domain-bar-padding);
38
+ background: var(--qd-domain-bar-bg);
39
+ border: 1px solid var(--qd-domain-bar-border);
40
+ border-radius: var(--qd-domain-bar-radius);
41
+ box-shadow: var(--qd-domain-bar-shadow);
30
42
  color: var(--qd-card-ink);
31
43
  font-size: 0.875rem;
32
44
  }
@@ -144,7 +156,7 @@ a.qd-domain-pill-body:focus-visible { outline: 2px solid var(--qd-card-accent);
144
156
  gap: 0.5rem;
145
157
  padding: 0.25rem 0.5rem;
146
158
  overflow-x: auto;
147
- box-shadow: 0 2px 6px rgb(0 0 0 / 8%);
159
+ box-shadow: var(--qd-domain-bar-compact-shadow);
148
160
 
149
161
  .qd-domain-bar-title { font-size: 0.875rem; }
150
162
  .qd-domain-bar-nav, .qd-domain-bar-indicators { flex-wrap: nowrap; }
@@ -153,7 +165,104 @@ a.qd-domain-pill-body:focus-visible { outline: 2px solid var(--qd-card-accent);
153
165
  .qd-domain-bar-toggle { width: 1.75rem; height: 1.75rem; }
154
166
  }
155
167
 
168
+ // The toolbox (#5400), the default: glued to the top edge of the content,
169
+ // full width, one low line with a rule at the bottom, drawn like the side
170
+ // menu (its font size, its icon size, its item height, its square items, the
171
+ // current one marked by an accent bar and a tint, as the side menu does).
172
+ .qd-domain-bar--toolbox {
173
+ --qd-domain-bar-bg: var(--p-surface-0, #fff);
174
+ --qd-domain-bar-margin: 0;
175
+ --qd-domain-bar-padding: 0 0.75rem;
176
+ --qd-domain-bar-radius: 0;
177
+ --qd-domain-bar-height: var(--fad-nav-item-height, 2.25rem);
178
+ --qd-domain-bar-compact-shadow: 0 2px 4px rgb(0 0 0 / 6%);
179
+ --qd-toolbox-entry-ink: var(--p-surface-600, #475569);
180
+ --qd-toolbox-entry-hover-bg: var(--p-surface-100, #f1f5f9);
181
+ --qd-toolbox-current-bg: var(--p-primary-50, #eff6ff);
182
+ --qd-toolbox-current-ink: var(--p-primary-700, #1d4ed8);
183
+ --qd-toolbox-accent: var(--p-primary-500, #3b82f6);
184
+
185
+ flex-wrap: nowrap;
186
+ align-items: stretch;
187
+ gap: 0 0.75rem;
188
+ min-height: var(--qd-domain-bar-height);
189
+ border-width: 0 0 1px;
190
+ font-size: var(--fad-font-size-sm, 0.875rem);
191
+
192
+ .qd-domain-bar-title {
193
+ align-self: center;
194
+ font-size: var(--fad-font-size-sm, 0.875rem);
195
+ white-space: nowrap;
196
+
197
+ i { font-size: var(--fad-nav-icon-size, 1rem); }
198
+ }
199
+
200
+ .qd-domain-bar-nav {
201
+ flex-wrap: nowrap;
202
+ gap: 0;
203
+ min-width: 0;
204
+ overflow-x: auto;
205
+ }
206
+
207
+ .qd-domain-bar-entry {
208
+ gap: 0.4rem;
209
+ padding: 0 0.75rem;
210
+ border: 0;
211
+ border-bottom: 2px solid transparent;
212
+ border-radius: 0;
213
+ color: var(--qd-toolbox-entry-ink);
214
+ white-space: nowrap;
215
+
216
+ i { font-size: var(--fad-nav-icon-size, 1rem); opacity: 0.8; }
217
+ &:hover { background: var(--qd-toolbox-entry-hover-bg); color: var(--qd-card-ink-strong); }
218
+ &:focus-visible { outline-offset: -2px; }
219
+ }
220
+
221
+ .qd-domain-bar-entry--current {
222
+ background: var(--qd-toolbox-current-bg);
223
+ color: var(--qd-toolbox-current-ink);
224
+ border-bottom-color: var(--qd-toolbox-accent);
225
+ font-weight: 600;
226
+
227
+ i { opacity: 1; }
228
+ &:hover { background: var(--qd-toolbox-current-bg); color: var(--qd-toolbox-current-ink); }
229
+ }
230
+
231
+ .qd-domain-bar-indicators {
232
+ flex-wrap: nowrap;
233
+ align-self: center;
234
+ gap: 0.3rem;
235
+ }
236
+
237
+ .qd-domain-pill-body { padding: 0.1rem 0.5rem; font-size: 0.8125rem; }
238
+ .qd-badge { min-width: 1.1rem; height: 1.1rem; font-size: 0.6875rem; }
239
+
240
+ .qd-domain-bar-toggle {
241
+ align-self: center;
242
+ width: 1.75rem;
243
+ height: 1.75rem;
244
+ }
245
+ }
246
+
247
+ // Compact keeps the edge and the line; only the words go
248
+ .qd-domain-bar--toolbox.qd-domain-bar--compact {
249
+ padding: var(--qd-domain-bar-padding);
250
+
251
+ .qd-domain-bar-entry { padding: 0 0.5rem; }
252
+ .qd-domain-pill-body { padding: 0.1rem 0.4rem; }
253
+ }
254
+
255
+ .dark-mode .qd-domain-bar--toolbox {
256
+ --qd-domain-bar-bg: var(--p-surface-900, #0f172a);
257
+ --qd-toolbox-entry-ink: var(--p-surface-300, #cbd5e1);
258
+ --qd-toolbox-entry-hover-bg: var(--p-surface-800, #1e293b);
259
+ --qd-toolbox-current-bg: var(--p-surface-800, #1e293b);
260
+ --qd-toolbox-current-ink: var(--p-primary-300, #93c5fd);
261
+ --qd-toolbox-accent: var(--p-primary-400, #60a5fa);
262
+ }
263
+
156
264
  @media (max-width: 700px) {
157
- .qd-domain-bar { margin: 0.5rem 0.5rem 0; }
265
+ .qd-domain-bar { --qd-domain-bar-margin: 0.5rem 0.5rem 0; }
266
+ .qd-domain-bar--toolbox { --qd-domain-bar-margin: 0; --qd-domain-bar-padding: 0 0.5rem; }
158
267
  .qd-domain-bar-indicators { margin-left: 0; }
159
268
  }
@@ -396,3 +396,112 @@ $nav-item-content-left: calc((var(--fad-sidebar-width-collapsed) + #{$nav-item-i
396
396
  width: $nav-item-icon-width;
397
397
  }
398
398
  }
399
+
400
+ /* =============================================================================
401
+ Two menus: the main one and the settings, behind the gear (#5401)
402
+ ============================================================================= */
403
+
404
+ .sidebar-menus {
405
+ display: flex;
406
+ flex-direction: column;
407
+ flex: 1;
408
+ min-height: 0;
409
+ }
410
+
411
+ // Both in one clipped viewport, one above the other: the main menu slides up
412
+ // and the settings take its place
413
+ .sidebar-menus--two {
414
+ display: grid;
415
+ grid-template: 1fr / 1fr;
416
+ overflow: hidden;
417
+
418
+ > .sidebar-menu {
419
+ grid-area: 1 / 1;
420
+ min-height: 0;
421
+ transition: transform var(--fad-transition-normal, 0.25s) ease, opacity var(--fad-transition-normal, 0.25s) ease;
422
+ }
423
+
424
+ > .sidebar-menu--settings {
425
+ transform: translateY(100%);
426
+ opacity: 0;
427
+ }
428
+ }
429
+
430
+ .sidebar-menus--settings {
431
+ > .sidebar-menu--main {
432
+ transform: translateY(-100%);
433
+ opacity: 0;
434
+ }
435
+
436
+ > .sidebar-menu--settings {
437
+ transform: none;
438
+ opacity: 1;
439
+ }
440
+ }
441
+
442
+ @media (prefers-reduced-motion: reduce) {
443
+ .sidebar-menus--two > .sidebar-menu {
444
+ transition: none;
445
+ }
446
+ }
447
+
448
+ // The settings' head row: back to the main menu
449
+ .sidebar-nav .sidebar-menu-back {
450
+ width: 100%;
451
+ margin-bottom: var(--fad-nav-section-gap);
452
+ border: 0;
453
+ background: none;
454
+ font: inherit;
455
+ font-weight: var(--fad-font-weight-medium);
456
+ text-align: left;
457
+ cursor: pointer;
458
+ color: var(--p-surface-0, white);
459
+ }
460
+
461
+ // The gear, between the user block and "powered by"
462
+ .sidebar-settings-toggle {
463
+ position: relative;
464
+ display: flex;
465
+ align-items: center;
466
+ gap: 0.6rem;
467
+ width: 100%;
468
+ padding: var(--fad-nav-item-padding-y) var(--fad-nav-item-padding-x);
469
+ padding-left: calc((var(--fad-sidebar-width-collapsed) - #{$nav-item-icon-width}) / 2);
470
+ border: 0;
471
+ border-top: 1px solid var(--p-surface-700, #334155);
472
+ background: none;
473
+ color: var(--p-surface-300, #cbd5e1);
474
+ font: inherit;
475
+ font-size: var(--fad-font-size-sm);
476
+ text-align: left;
477
+ cursor: pointer;
478
+ white-space: nowrap;
479
+ overflow: hidden;
480
+
481
+ i {
482
+ width: $nav-item-icon-width;
483
+ flex-shrink: 0;
484
+ text-align: center;
485
+ font-size: var(--fad-nav-icon-size);
486
+ transition: transform var(--fad-transition-normal, 0.25s) ease;
487
+ }
488
+
489
+ &:hover {
490
+ background: var(--p-surface-700, #334155);
491
+ color: var(--p-surface-0, white);
492
+ }
493
+
494
+ &:focus-visible {
495
+ outline: 2px solid var(--p-primary-400, #60a5fa);
496
+ outline-offset: -2px;
497
+ }
498
+ }
499
+
500
+ .sidebar-settings-toggle--open {
501
+ color: var(--p-primary-300, #93c5fd);
502
+ }
503
+
504
+ // Collapsed side menu: the gear alone
505
+ .sidebar--collapsed .sidebar-settings-toggle span {
506
+ opacity: 0;
507
+ }