@masterteam/delegations 0.0.15 → 0.0.17

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.17",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/delegations",
6
6
  "linkDirectory": false,
@@ -20,9 +20,9 @@
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",
23
+ "@masterteam/icons": "^0.0.15",
24
24
  "@masterteam/forms": "^0.0.80",
25
- "@masterteam/icons": "^0.0.15"
25
+ "@masterteam/components": "^0.0.174"
26
26
  },
27
27
  "sideEffects": false,
28
28
  "exports": {
@@ -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;
@@ -342,12 +349,14 @@ declare class DelegationsList implements OnInit {
342
349
  label: string;
343
350
  }[]>;
344
351
  protected readonly isLoading: _angular_core.Signal<boolean>;
352
+ protected readonly scopeOptions: _angular_core.Signal<_masterteam_delegations.DelegationScopeSelection | null>;
345
353
  protected readonly rows: _angular_core.Signal<DelegationRow[]>;
346
354
  statusCol: _angular_core.Signal<TemplateRef<unknown>>;
347
355
  userCol: _angular_core.Signal<TemplateRef<unknown>>;
348
356
  scopeCol: _angular_core.Signal<TemplateRef<unknown>>;
349
357
  daysCol: _angular_core.Signal<TemplateRef<unknown>>;
350
- protected readonly tableActions: _angular_core.WritableSignal<TableAction[]>;
358
+ protected readonly canCreate: _angular_core.Signal<boolean>;
359
+ protected readonly tableActions: _angular_core.Signal<TableAction[]>;
351
360
  protected readonly rowActions: _angular_core.WritableSignal<TableAction[]>;
352
361
  protected readonly tableColumns: _angular_core.WritableSignal<ColumnDef[]>;
353
362
  private readonly busyIds;
@@ -366,7 +375,7 @@ declare class DelegationsList implements OnInit {
366
375
  private startSession;
367
376
  private mark;
368
377
  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>;
378
+ 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
379
  }
371
380
 
372
381
  /**
@@ -380,6 +389,12 @@ declare class DelegationsList implements OnInit {
380
389
  declare class DelegationForm implements OnInit {
381
390
  readonly delegationForEdit: _angular_core.InputSignal<DelegationRow | null>;
382
391
  readonly readonly: _angular_core.InputSignal<boolean>;
392
+ /**
393
+ * Admin-managed mode: also collect the Delegator / From user, so an admin can
394
+ * create a delegation between two selected users (Ahmed → Sara). Self-service
395
+ * leaves this false; the delegator defaults to the current user server-side.
396
+ */
397
+ readonly adminMode: _angular_core.InputSignal<boolean>;
383
398
  private readonly halfWidth;
384
399
  private readonly fullWidth;
385
400
  modal: ModalService;
@@ -390,9 +405,15 @@ declare class DelegationForm implements OnInit {
390
405
  formValue: _angular_core.Signal<any>;
391
406
  detail: _angular_core.Signal<_masterteam_delegations.DelegationDetail | null>;
392
407
  isDetailLoading: _angular_core.Signal<boolean>;
408
+ scopePreview: _angular_core.Signal<_masterteam_delegations.DelegationScopePreview | null>;
409
+ isPreviewingScope: _angular_core.Signal<boolean>;
393
410
  isSaving: _angular_core.Signal<boolean>;
394
411
  context: HttpContext;
395
412
  protected readonly scope: _angular_core.WritableSignal<DelegationScopeSelection>;
413
+ /** Selected delegator id (admin mode only); drives scope/options + create payload. */
414
+ protected readonly selectedDelegatorId: _angular_core.Signal<string | undefined>;
415
+ /** In admin mode the scope picker only loads once a delegator is chosen. */
416
+ protected readonly showScopePicker: _angular_core.Signal<boolean>;
396
417
  protected readonly specificDaysOptions: _angular_core.WritableSignal<{
397
418
  label: string;
398
419
  value: number;
@@ -403,7 +424,7 @@ declare class DelegationForm implements OnInit {
403
424
  protected readonly canSubmit: _angular_core.Signal<boolean>;
404
425
  onSubmit(): void;
405
426
  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>;
427
+ 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
428
  }
408
429
 
409
430
  type DetailTab = 'overview' | 'scope';
@@ -444,9 +465,14 @@ interface TargetGroup {
444
465
  * `[(scope)]` two-way binds a `DelegationScopeSelection`. The component never
445
466
  * invents permission metadata — it only echoes grants returned by options.
446
467
  */
447
- declare class ScopePicker implements OnInit {
468
+ declare class ScopePicker {
448
469
  readonly scope: _angular_core.ModelSignal<DelegationScopeSelection>;
449
470
  readonly readonly: _angular_core.InputSignal<boolean>;
471
+ /**
472
+ * Delegator whose grantable scope is loaded. Undefined = current user
473
+ * (self-service). In admin mode the host rebinds this as the selected
474
+ * delegator changes, and options reload reactively.
475
+ */
450
476
  readonly delegatorUserId: _angular_core.InputSignal<string | undefined>;
451
477
  private readonly facade;
452
478
  protected readonly options: _angular_core.Signal<DelegationScopeSelection | null>;
@@ -458,7 +484,6 @@ declare class ScopePicker implements OnInit {
458
484
  /** Selected grant keys for O(1) checkbox state. */
459
485
  protected readonly selectedKeys: _angular_core.Signal<Set<string>>;
460
486
  private readonly expanded;
461
- ngOnInit(): void;
462
487
  constructor();
463
488
  protected isExpanded(group: TargetGroup): boolean;
464
489
  protected toggleAccordion(group: TargetGroup): void;