@masterteam/delegations 0.0.15 → 0.0.16

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": "@masterteam/delegations",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/delegations",
6
6
  "linkDirectory": false,
@@ -20,8 +20,8 @@
20
20
  "tailwindcss": "^4.2.2",
21
21
  "tailwindcss-primeui": "^0.6.1",
22
22
  "@ngxs/store": "^20.1.0",
23
- "@masterteam/components": "^0.0.174",
24
23
  "@masterteam/forms": "^0.0.80",
24
+ "@masterteam/components": "^0.0.174",
25
25
  "@masterteam/icons": "^0.0.15"
26
26
  },
27
27
  "sideEffects": false,
@@ -239,7 +239,7 @@ declare class TopbarDelegationMenu {
239
239
  protected readonly hasCandidates: _angular_core.Signal<boolean>;
240
240
  protected readonly onBehalfOf: _angular_core.Signal<_masterteam_delegations.DelegationParty | null>;
241
241
  protected readonly executedBy: _angular_core.Signal<_masterteam_delegations.DelegationParty | null>;
242
- protected readonly mode: _angular_core.Signal<"active" | "candidates" | "hidden">;
242
+ protected readonly mode: _angular_core.Signal<"hidden" | "active" | "candidates">;
243
243
  togglePopover(event: Event): void;
244
244
  start(row: DelegationRow, event: MouseEvent): void;
245
245
  switchTo(row: DelegationRow, event: MouseEvent): void;
@@ -320,6 +320,13 @@ declare class DelegationsList implements OnInit {
320
320
  * `data: { showBreadcrumb: false }`.
321
321
  */
322
322
  readonly showBreadcrumb: _angular_core.InputSignal<boolean>;
323
+ /**
324
+ * Admin-managed surface: the create/edit form also collects the Delegator /
325
+ * From user (admin creates a delegation between two users). Client
326
+ * self-service leaves this false. Bound from route data via
327
+ * `withComponentInputBinding()` — admin passes `data: { adminMode: true }`.
328
+ */
329
+ readonly adminMode: _angular_core.InputSignal<boolean>;
323
330
  private readonly facade;
324
331
  private readonly modal;
325
332
  private readonly transloco;
@@ -366,7 +373,7 @@ declare class DelegationsList implements OnInit {
366
373
  private startSession;
367
374
  private mark;
368
375
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationsList, never>;
369
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DelegationsList, "mt-delegations-list", never, { "showBreadcrumb": { "alias": "showBreadcrumb"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
376
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DelegationsList, "mt-delegations-list", never, { "showBreadcrumb": { "alias": "showBreadcrumb"; "required": false; "isSignal": true; }; "adminMode": { "alias": "adminMode"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
370
377
  }
371
378
 
372
379
  /**
@@ -380,6 +387,12 @@ declare class DelegationsList implements OnInit {
380
387
  declare class DelegationForm implements OnInit {
381
388
  readonly delegationForEdit: _angular_core.InputSignal<DelegationRow | null>;
382
389
  readonly readonly: _angular_core.InputSignal<boolean>;
390
+ /**
391
+ * Admin-managed mode: also collect the Delegator / From user, so an admin can
392
+ * create a delegation between two selected users (Ahmed → Sara). Self-service
393
+ * leaves this false; the delegator defaults to the current user server-side.
394
+ */
395
+ readonly adminMode: _angular_core.InputSignal<boolean>;
383
396
  private readonly halfWidth;
384
397
  private readonly fullWidth;
385
398
  modal: ModalService;
@@ -393,6 +406,10 @@ declare class DelegationForm implements OnInit {
393
406
  isSaving: _angular_core.Signal<boolean>;
394
407
  context: HttpContext;
395
408
  protected readonly scope: _angular_core.WritableSignal<DelegationScopeSelection>;
409
+ /** Selected delegator id (admin mode only); drives scope/options + create payload. */
410
+ protected readonly selectedDelegatorId: _angular_core.Signal<string | undefined>;
411
+ /** In admin mode the scope picker only loads once a delegator is chosen. */
412
+ protected readonly showScopePicker: _angular_core.Signal<boolean>;
396
413
  protected readonly specificDaysOptions: _angular_core.WritableSignal<{
397
414
  label: string;
398
415
  value: number;
@@ -403,7 +420,7 @@ declare class DelegationForm implements OnInit {
403
420
  protected readonly canSubmit: _angular_core.Signal<boolean>;
404
421
  onSubmit(): void;
405
422
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DelegationForm, never>;
406
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DelegationForm, "mt-delegation-form", never, { "delegationForEdit": { "alias": "delegationForEdit"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
423
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DelegationForm, "mt-delegation-form", never, { "delegationForEdit": { "alias": "delegationForEdit"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "adminMode": { "alias": "adminMode"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
407
424
  }
408
425
 
409
426
  type DetailTab = 'overview' | 'scope';
@@ -444,9 +461,14 @@ interface TargetGroup {
444
461
  * `[(scope)]` two-way binds a `DelegationScopeSelection`. The component never
445
462
  * invents permission metadata — it only echoes grants returned by options.
446
463
  */
447
- declare class ScopePicker implements OnInit {
464
+ declare class ScopePicker {
448
465
  readonly scope: _angular_core.ModelSignal<DelegationScopeSelection>;
449
466
  readonly readonly: _angular_core.InputSignal<boolean>;
467
+ /**
468
+ * Delegator whose grantable scope is loaded. Undefined = current user
469
+ * (self-service). In admin mode the host rebinds this as the selected
470
+ * delegator changes, and options reload reactively.
471
+ */
450
472
  readonly delegatorUserId: _angular_core.InputSignal<string | undefined>;
451
473
  private readonly facade;
452
474
  protected readonly options: _angular_core.Signal<DelegationScopeSelection | null>;
@@ -458,7 +480,6 @@ declare class ScopePicker implements OnInit {
458
480
  /** Selected grant keys for O(1) checkbox state. */
459
481
  protected readonly selectedKeys: _angular_core.Signal<Set<string>>;
460
482
  private readonly expanded;
461
- ngOnInit(): void;
462
483
  constructor();
463
484
  protected isExpanded(group: TargetGroup): boolean;
464
485
  protected toggleAccordion(group: TargetGroup): void;