@quazardous/qdadm 2.55.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.
@@ -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,8 +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 }
64
80
  /** Every domain bar's look, unless its domain says otherwise (#5396) */
65
- domainBar?: { look?: 'card' | 'ribbon' }
81
+ domainBar?: { look?: 'toolbox' | 'card' | 'ribbon' }
66
82
  [key: string]: unknown
67
83
  }
68
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
  /**
@@ -15,8 +15,8 @@
15
15
  }
16
16
 
17
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--ribbon`) or on one domain
19
- // (`.qd-domain-bar[data-domain='purchases']`) (#5396)
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)
20
20
  .qd-domain-bar {
21
21
  --qd-domain-bar-bg: var(--qd-card-bg);
22
22
  --qd-domain-bar-border: var(--qd-card-border);
@@ -165,75 +165,104 @@ a.qd-domain-pill-body:focus-visible { outline: 2px solid var(--qd-card-accent);
165
165
  .qd-domain-bar-toggle { width: 1.75rem; height: 1.75rem; }
166
166
  }
167
167
 
168
- // The ribbon (#5396): a panel glued to the top edge of the content, full
169
- // width, a rule at the bottom; its pages are tabs standing on the rule, the
170
- // current one in the panel's colour, merged into it, the others set back.
171
- .qd-domain-bar--ribbon {
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);
172
174
  --qd-domain-bar-margin: 0;
173
- --qd-domain-bar-padding: 0.4rem 1rem 0;
175
+ --qd-domain-bar-padding: 0 0.75rem;
174
176
  --qd-domain-bar-radius: 0;
177
+ --qd-domain-bar-height: var(--fad-nav-item-height, 2.25rem);
175
178
  --qd-domain-bar-compact-shadow: 0 2px 4px rgb(0 0 0 / 6%);
176
- --qd-ribbon-rule: var(--qd-domain-bar-border);
177
- --qd-ribbon-tab-bg: var(--qd-card-track);
178
- --qd-ribbon-tab-ink: var(--qd-card-muted);
179
- --qd-ribbon-tab-current-bg: var(--qd-domain-bar-bg);
180
- --qd-ribbon-tab-current-ink: var(--qd-card-ink-strong);
181
- --qd-ribbon-tab-radius: 6px 6px 0 0;
182
- --qd-ribbon-accent: var(--qd-card-accent);
183
-
184
- align-items: flex-end;
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);
185
189
  border-width: 0 0 1px;
186
- border-color: var(--qd-ribbon-rule);
190
+ font-size: var(--fad-font-size-sm, 0.875rem);
187
191
 
188
- // The title, the indicators and the toggle sit in the middle, off the rule
189
- .qd-domain-bar-title,
190
- .qd-domain-bar-indicators,
191
- .qd-domain-bar-toggle {
192
+ .qd-domain-bar-title {
192
193
  align-self: center;
193
- margin-bottom: 0.4rem;
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); }
194
198
  }
195
199
 
196
200
  .qd-domain-bar-nav {
197
- gap: 0.2rem;
198
- align-self: flex-end;
201
+ flex-wrap: nowrap;
202
+ gap: 0;
203
+ min-width: 0;
204
+ overflow-x: auto;
199
205
  }
200
206
 
201
207
  .qd-domain-bar-entry {
202
- margin-bottom: -1px; // over the rule
203
- padding: 0.4rem 0.8rem;
204
- border: 1px solid transparent;
205
- border-bottom: 0;
206
- border-radius: var(--qd-ribbon-tab-radius);
207
- background: var(--qd-ribbon-tab-bg);
208
- color: var(--qd-ribbon-tab-ink);
209
-
210
- &:hover { color: var(--qd-card-ink); background: var(--qd-ribbon-tab-bg); filter: brightness(0.97); }
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; }
211
219
  }
212
220
 
213
- // The current tab: the panel's colour, edged like it, the rule under it gone
214
221
  .qd-domain-bar-entry--current {
215
- padding-bottom: calc(0.4rem + 1px);
216
- border-color: var(--qd-ribbon-rule);
217
- border-top: 2px solid var(--qd-ribbon-accent);
218
- background: var(--qd-ribbon-tab-current-bg);
219
- color: var(--qd-ribbon-tab-current-ink);
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
+ }
220
236
 
221
- &:hover { background: var(--qd-ribbon-tab-current-bg); filter: none; }
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;
222
244
  }
223
245
  }
224
246
 
225
- .qd-domain-bar--ribbon.qd-domain-bar--compact {
226
- padding: 0.15rem 0.75rem 0;
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
+ }
227
254
 
228
- .qd-domain-bar-title,
229
- .qd-domain-bar-indicators,
230
- .qd-domain-bar-toggle { margin-bottom: 0.15rem; }
231
- .qd-domain-bar-entry { padding: 0.2rem 0.5rem; }
232
- .qd-domain-bar-entry--current { padding-bottom: calc(0.2rem + 1px); }
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);
233
262
  }
234
263
 
235
264
  @media (max-width: 700px) {
236
265
  .qd-domain-bar { --qd-domain-bar-margin: 0.5rem 0.5rem 0; }
237
- .qd-domain-bar--ribbon { --qd-domain-bar-margin: 0; --qd-domain-bar-padding: 0.4rem 0.5rem 0; }
266
+ .qd-domain-bar--toolbox { --qd-domain-bar-margin: 0; --qd-domain-bar-padding: 0 0.5rem; }
238
267
  .qd-domain-bar-indicators { margin-left: 0; }
239
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
+ }