iss-ctrl 0.0.12 → 0.0.14

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 (26) hide show
  1. package/fesm2022/{iss-ctrl-iss-ctrl-WfIqBEcL.mjs → iss-ctrl-iss-ctrl-CDk4_RVA.mjs} +734 -233
  2. package/fesm2022/iss-ctrl-iss-ctrl-CDk4_RVA.mjs.map +1 -0
  3. package/fesm2022/{iss-ctrl-load-event-SlQmVmyf.mjs → iss-ctrl-load-event-5MIEPp-j.mjs} +3 -3
  4. package/fesm2022/{iss-ctrl-load-event-SlQmVmyf.mjs.map → iss-ctrl-load-event-5MIEPp-j.mjs.map} +1 -1
  5. package/fesm2022/{iss-ctrl-load-options-event-CBejHpME.mjs → iss-ctrl-load-options-event-D4gOR-3h.mjs} +3 -3
  6. package/fesm2022/{iss-ctrl-load-options-event-CBejHpME.mjs.map → iss-ctrl-load-options-event-D4gOR-3h.mjs.map} +1 -1
  7. package/fesm2022/{iss-ctrl-load-value-event-Bu9-rZ6T.mjs → iss-ctrl-load-value-event-a_CrlH07.mjs} +3 -3
  8. package/fesm2022/{iss-ctrl-load-value-event-Bu9-rZ6T.mjs.map → iss-ctrl-load-value-event-a_CrlH07.mjs.map} +1 -1
  9. package/fesm2022/{iss-ctrl-note.field-onDjqI_X.mjs → iss-ctrl-note.field-DIU49W4s.mjs} +2 -2
  10. package/fesm2022/{iss-ctrl-note.field-onDjqI_X.mjs.map → iss-ctrl-note.field-DIU49W4s.mjs.map} +1 -1
  11. package/fesm2022/{iss-ctrl-replace-api-keys-Chwe42Nu.mjs → iss-ctrl-replace-api-keys-8o7-XCdX.mjs} +2 -2
  12. package/fesm2022/{iss-ctrl-replace-api-keys-Chwe42Nu.mjs.map → iss-ctrl-replace-api-keys-8o7-XCdX.mjs.map} +1 -1
  13. package/fesm2022/{iss-ctrl-set-value-event-DiHESiPT.mjs → iss-ctrl-set-value-event-BJGXPwPV.mjs} +2 -2
  14. package/fesm2022/{iss-ctrl-set-value-event-DiHESiPT.mjs.map → iss-ctrl-set-value-event-BJGXPwPV.mjs.map} +1 -1
  15. package/fesm2022/{iss-ctrl-table.field-DxwfNXNc.mjs → iss-ctrl-table.field-Ca6d7LvU.mjs} +166 -166
  16. package/fesm2022/iss-ctrl-table.field-Ca6d7LvU.mjs.map +1 -0
  17. package/fesm2022/{iss-ctrl-trigger-based-on-json-value-CprcFCWi.mjs → iss-ctrl-trigger-based-on-json-value-Jp6lQkIa.mjs} +2 -2
  18. package/fesm2022/{iss-ctrl-trigger-based-on-json-value-CprcFCWi.mjs.map → iss-ctrl-trigger-based-on-json-value-Jp6lQkIa.mjs.map} +1 -1
  19. package/fesm2022/{iss-ctrl-user-picker.field-Mqi37i7D.mjs → iss-ctrl-user-picker.field-CFK871y8.mjs} +2 -2
  20. package/fesm2022/{iss-ctrl-user-picker.field-Mqi37i7D.mjs.map → iss-ctrl-user-picker.field-CFK871y8.mjs.map} +1 -1
  21. package/fesm2022/iss-ctrl.mjs +1 -1
  22. package/package.json +1 -1
  23. package/types/iss-ctrl.d.ts +213 -14
  24. package/upgrade.scss +16 -0
  25. package/fesm2022/iss-ctrl-iss-ctrl-WfIqBEcL.mjs.map +0 -1
  26. package/fesm2022/iss-ctrl-table.field-DxwfNXNc.mjs.map +0 -1
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
2
2
  import { viewChild, ViewContainerRef, inject, DestroyRef, effect, Component, input, signal, computed, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
3
3
  import * as i1$1 from '@angular/forms';
4
4
  import { FormGroup, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
5
- import { b as ViewerBase, L as Loader, C as ControlBase, c as FormEngine, I as IssField, O as Outlet, F as FieldBase, V as VIEW_PROVIDER, a as ValidationMessageComponent } from './iss-ctrl-iss-ctrl-WfIqBEcL.mjs';
5
+ import { b as ViewerBase, L as Loader, C as ControlBase, c as FormEngine, I as IssField, O as Outlet, F as FieldBase, V as VIEW_PROVIDER, a as ValidationMessageComponent } from './iss-ctrl-iss-ctrl-CDk4_RVA.mjs';
6
6
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
7
7
  import { MatFormFieldModule } from '@angular/material/form-field';
8
8
  import * as i1 from '@angular/material/input';
@@ -359,72 +359,72 @@ class TableControl extends ControlBase {
359
359
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TableControl, deps: null, target: i0.ɵɵFactoryTarget.Component });
360
360
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: TableControl, isStandalone: true, selector: "iss-ctrl-table", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, withFilter: { classPropertyName: "withFilter", publicName: "withFilter", isSignal: true, isRequired: false, transformFunction: null }, withSort: { classPropertyName: "withSort", publicName: "withSort", isSignal: true, isRequired: false, transformFunction: null }, withPagination: { classPropertyName: "withPagination", publicName: "withPagination", isSignal: true, isRequired: false, transformFunction: null }, jsonValue: { classPropertyName: "jsonValue", publicName: "jsonValue", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
361
361
  { provide: NG_VALUE_ACCESSOR, useExisting: TableControl, multi: true },
362
- ], viewQueries: [{ propertyName: "drawer", first: true, predicate: ["drawer"], descendants: true, isSignal: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, isSignal: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
363
- <mat-sidenav-container [hasBackdrop]="true">
364
- <mat-sidenav #drawer [mode]="'over'" [position]="'start'" [autoFocus]="false">
365
- <form [formGroup]="tableOutletForm">
366
- <iss-form-outlet [fields]="fields()"/>
367
- </form>
368
- <ds-button (click)="saveRow(true)">save
369
- </ds-button>
370
- <ds-button (click)="saveRow(false)">save and add more</ds-button>
371
- </mat-sidenav>
372
- <mat-sidenav-content>
373
- <div>
374
- <ds-button icon="true" (click)="openNewRow()">
375
- <ds-icon icon="plus"></ds-icon>
376
- </ds-button>
377
- <!--<button mat-raised-button (click)="removeRow()" class="demo-button">Remove data</button>-->
378
- </div>
379
- @if (withFilter()) {
380
- <mat-form-field>
381
- <mat-label>Filter</mat-label>
382
- <input matInput (keyup)="applyFilter($event)" placeholder="Search in table" #input>
383
- </mat-form-field>
384
- }
385
- <div class="mat-elevation-z8">
386
- <table mat-table [dataSource]="dataSource" matSort>
387
- <tr mat-header-row *matHeaderRowDef="fieldNames()"></tr>
388
- <tr mat-row *matRowDef="let row; columns: fieldNames();" (click)="onRowClick(row)"></tr>
389
-
390
- @for (col of fieldNames(); track col) {
391
- @if (col !== "actions") {
392
- <ng-container [matColumnDef]="col">
393
- <th mat-header-cell *matHeaderCellDef mat-sort-header [disabled]="!fieldsMap().get(col)?.config?.tableWithSort()">
394
- {{ columnLabels()[$index] }}
395
- </th>
396
- <td mat-cell *matCellDef="let row">
397
- @if (viewFieldOf(row, $index); as viewField) {
398
- <iss-viewer-field [field]="viewField"/>
399
- }
400
- </td>
401
- </ng-container>
402
- }
403
- }
404
-
405
- <!-- Actions -->
406
- <ng-container matColumnDef="actions">
407
- <th mat-header-cell *matHeaderCellDef mat-sort-header></th>
408
- <td mat-cell *matCellDef="let row">
409
- <ds-icon icon="eye" class="cursor-pointer" (click)="viewRow(row)"></ds-icon>
410
- <ds-icon icon="pen" class="cursor-pointer" (click)="editRow(row)"></ds-icon>
411
- <ds-icon icon="trash" class="cursor-pointer fc-red" (click)="removeRow(row)"></ds-icon>
412
- </td>
413
- </ng-container>
414
-
415
- <tr class="mat-row" *matNoDataRow>
416
- <td class="mat-cell" colspan="4">
417
- <ds-message type="emptyCard"></ds-message>
418
- </td>
419
- </tr>
420
- </table>
421
-
422
- @if (withPagination()) {
423
- <mat-paginator [pageSizeOptions]="[5, 10, 25, 100]" aria-label="Select page number"></mat-paginator>
424
- }
425
- </div>
426
- </mat-sidenav-content>
427
- </mat-sidenav-container>
362
+ ], viewQueries: [{ propertyName: "drawer", first: true, predicate: ["drawer"], descendants: true, isSignal: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, isSignal: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
363
+ <mat-sidenav-container [hasBackdrop]="true">
364
+ <mat-sidenav #drawer [mode]="'over'" [position]="'start'" [autoFocus]="false">
365
+ <form [formGroup]="tableOutletForm">
366
+ <iss-form-outlet [fields]="fields()"/>
367
+ </form>
368
+ <ds-button (click)="saveRow(true)">save
369
+ </ds-button>
370
+ <ds-button (click)="saveRow(false)">save and add more</ds-button>
371
+ </mat-sidenav>
372
+ <mat-sidenav-content>
373
+ <div>
374
+ <ds-button icon="true" (click)="openNewRow()">
375
+ <ds-icon icon="plus"></ds-icon>
376
+ </ds-button>
377
+ <!--<button mat-raised-button (click)="removeRow()" class="demo-button">Remove data</button>-->
378
+ </div>
379
+ @if (withFilter()) {
380
+ <mat-form-field>
381
+ <mat-label>Filter</mat-label>
382
+ <input matInput (keyup)="applyFilter($event)" placeholder="Search in table" #input>
383
+ </mat-form-field>
384
+ }
385
+ <div class="mat-elevation-z8">
386
+ <table mat-table [dataSource]="dataSource" matSort>
387
+ <tr mat-header-row *matHeaderRowDef="fieldNames()"></tr>
388
+ <tr mat-row *matRowDef="let row; columns: fieldNames();" (click)="onRowClick(row)"></tr>
389
+
390
+ @for (col of fieldNames(); track col) {
391
+ @if (col !== "actions") {
392
+ <ng-container [matColumnDef]="col">
393
+ <th mat-header-cell *matHeaderCellDef mat-sort-header [disabled]="!fieldsMap().get(col)?.config?.tableWithSort()">
394
+ {{ columnLabels()[$index] }}
395
+ </th>
396
+ <td mat-cell *matCellDef="let row">
397
+ @if (viewFieldOf(row, $index); as viewField) {
398
+ <iss-viewer-field [field]="viewField"/>
399
+ }
400
+ </td>
401
+ </ng-container>
402
+ }
403
+ }
404
+
405
+ <!-- Actions -->
406
+ <ng-container matColumnDef="actions">
407
+ <th mat-header-cell *matHeaderCellDef mat-sort-header></th>
408
+ <td mat-cell *matCellDef="let row">
409
+ <ds-icon icon="eye" class="cursor-pointer" (click)="viewRow(row)"></ds-icon>
410
+ <ds-icon icon="pen" class="cursor-pointer" (click)="editRow(row)"></ds-icon>
411
+ <ds-icon icon="trash" class="cursor-pointer fc-red" (click)="removeRow(row)"></ds-icon>
412
+ </td>
413
+ </ng-container>
414
+
415
+ <tr class="mat-row" *matNoDataRow>
416
+ <td class="mat-cell" colspan="4">
417
+ <ds-message type="emptyCard"></ds-message>
418
+ </td>
419
+ </tr>
420
+ </table>
421
+
422
+ @if (withPagination()) {
423
+ <mat-paginator [pageSizeOptions]="[5, 10, 25, 100]" aria-label="Select page number"></mat-paginator>
424
+ }
425
+ </div>
426
+ </mat-sidenav-content>
427
+ </mat-sidenav-container>
428
428
  `, isInline: true, styles: [".mat-drawer{position:fixed;left:0}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i2.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i2.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i2.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i2.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i2.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i2.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i2.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i2.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i2.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i2.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i2.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "ngmodule", type: MatSortModule }, { kind: "directive", type: i3.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i3.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i4.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "ngmodule", type: MatSidenavModule }, { kind: "component", type: i5.MatSidenav, selector: "mat-sidenav", inputs: ["fixedInViewport", "fixedTopGap", "fixedBottomGap"], exportAs: ["matSidenav"] }, { kind: "component", type: i5.MatSidenavContainer, selector: "mat-sidenav-container", exportAs: ["matSidenavContainer"] }, { kind: "component", type: i5.MatSidenavContent, selector: "mat-sidenav-content" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: Outlet, selector: "iss-form-outlet", inputs: ["fields"], outputs: ["ready"] }, { kind: "component", type: FieldViewer, selector: "iss-viewer-field" }] });
429
429
  }
430
430
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TableControl, decorators: [{
@@ -441,72 +441,72 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
441
441
  FieldViewer,
442
442
  ], providers: [
443
443
  { provide: NG_VALUE_ACCESSOR, useExisting: TableControl, multi: true },
444
- ], schemas: [CUSTOM_ELEMENTS_SCHEMA], template: `
445
- <mat-sidenav-container [hasBackdrop]="true">
446
- <mat-sidenav #drawer [mode]="'over'" [position]="'start'" [autoFocus]="false">
447
- <form [formGroup]="tableOutletForm">
448
- <iss-form-outlet [fields]="fields()"/>
449
- </form>
450
- <ds-button (click)="saveRow(true)">save
451
- </ds-button>
452
- <ds-button (click)="saveRow(false)">save and add more</ds-button>
453
- </mat-sidenav>
454
- <mat-sidenav-content>
455
- <div>
456
- <ds-button icon="true" (click)="openNewRow()">
457
- <ds-icon icon="plus"></ds-icon>
458
- </ds-button>
459
- <!--<button mat-raised-button (click)="removeRow()" class="demo-button">Remove data</button>-->
460
- </div>
461
- @if (withFilter()) {
462
- <mat-form-field>
463
- <mat-label>Filter</mat-label>
464
- <input matInput (keyup)="applyFilter($event)" placeholder="Search in table" #input>
465
- </mat-form-field>
466
- }
467
- <div class="mat-elevation-z8">
468
- <table mat-table [dataSource]="dataSource" matSort>
469
- <tr mat-header-row *matHeaderRowDef="fieldNames()"></tr>
470
- <tr mat-row *matRowDef="let row; columns: fieldNames();" (click)="onRowClick(row)"></tr>
471
-
472
- @for (col of fieldNames(); track col) {
473
- @if (col !== "actions") {
474
- <ng-container [matColumnDef]="col">
475
- <th mat-header-cell *matHeaderCellDef mat-sort-header [disabled]="!fieldsMap().get(col)?.config?.tableWithSort()">
476
- {{ columnLabels()[$index] }}
477
- </th>
478
- <td mat-cell *matCellDef="let row">
479
- @if (viewFieldOf(row, $index); as viewField) {
480
- <iss-viewer-field [field]="viewField"/>
481
- }
482
- </td>
483
- </ng-container>
484
- }
485
- }
486
-
487
- <!-- Actions -->
488
- <ng-container matColumnDef="actions">
489
- <th mat-header-cell *matHeaderCellDef mat-sort-header></th>
490
- <td mat-cell *matCellDef="let row">
491
- <ds-icon icon="eye" class="cursor-pointer" (click)="viewRow(row)"></ds-icon>
492
- <ds-icon icon="pen" class="cursor-pointer" (click)="editRow(row)"></ds-icon>
493
- <ds-icon icon="trash" class="cursor-pointer fc-red" (click)="removeRow(row)"></ds-icon>
494
- </td>
495
- </ng-container>
496
-
497
- <tr class="mat-row" *matNoDataRow>
498
- <td class="mat-cell" colspan="4">
499
- <ds-message type="emptyCard"></ds-message>
500
- </td>
501
- </tr>
502
- </table>
503
-
504
- @if (withPagination()) {
505
- <mat-paginator [pageSizeOptions]="[5, 10, 25, 100]" aria-label="Select page number"></mat-paginator>
506
- }
507
- </div>
508
- </mat-sidenav-content>
509
- </mat-sidenav-container>
444
+ ], schemas: [CUSTOM_ELEMENTS_SCHEMA], template: `
445
+ <mat-sidenav-container [hasBackdrop]="true">
446
+ <mat-sidenav #drawer [mode]="'over'" [position]="'start'" [autoFocus]="false">
447
+ <form [formGroup]="tableOutletForm">
448
+ <iss-form-outlet [fields]="fields()"/>
449
+ </form>
450
+ <ds-button (click)="saveRow(true)">save
451
+ </ds-button>
452
+ <ds-button (click)="saveRow(false)">save and add more</ds-button>
453
+ </mat-sidenav>
454
+ <mat-sidenav-content>
455
+ <div>
456
+ <ds-button icon="true" (click)="openNewRow()">
457
+ <ds-icon icon="plus"></ds-icon>
458
+ </ds-button>
459
+ <!--<button mat-raised-button (click)="removeRow()" class="demo-button">Remove data</button>-->
460
+ </div>
461
+ @if (withFilter()) {
462
+ <mat-form-field>
463
+ <mat-label>Filter</mat-label>
464
+ <input matInput (keyup)="applyFilter($event)" placeholder="Search in table" #input>
465
+ </mat-form-field>
466
+ }
467
+ <div class="mat-elevation-z8">
468
+ <table mat-table [dataSource]="dataSource" matSort>
469
+ <tr mat-header-row *matHeaderRowDef="fieldNames()"></tr>
470
+ <tr mat-row *matRowDef="let row; columns: fieldNames();" (click)="onRowClick(row)"></tr>
471
+
472
+ @for (col of fieldNames(); track col) {
473
+ @if (col !== "actions") {
474
+ <ng-container [matColumnDef]="col">
475
+ <th mat-header-cell *matHeaderCellDef mat-sort-header [disabled]="!fieldsMap().get(col)?.config?.tableWithSort()">
476
+ {{ columnLabels()[$index] }}
477
+ </th>
478
+ <td mat-cell *matCellDef="let row">
479
+ @if (viewFieldOf(row, $index); as viewField) {
480
+ <iss-viewer-field [field]="viewField"/>
481
+ }
482
+ </td>
483
+ </ng-container>
484
+ }
485
+ }
486
+
487
+ <!-- Actions -->
488
+ <ng-container matColumnDef="actions">
489
+ <th mat-header-cell *matHeaderCellDef mat-sort-header></th>
490
+ <td mat-cell *matCellDef="let row">
491
+ <ds-icon icon="eye" class="cursor-pointer" (click)="viewRow(row)"></ds-icon>
492
+ <ds-icon icon="pen" class="cursor-pointer" (click)="editRow(row)"></ds-icon>
493
+ <ds-icon icon="trash" class="cursor-pointer fc-red" (click)="removeRow(row)"></ds-icon>
494
+ </td>
495
+ </ng-container>
496
+
497
+ <tr class="mat-row" *matNoDataRow>
498
+ <td class="mat-cell" colspan="4">
499
+ <ds-message type="emptyCard"></ds-message>
500
+ </td>
501
+ </tr>
502
+ </table>
503
+
504
+ @if (withPagination()) {
505
+ <mat-paginator [pageSizeOptions]="[5, 10, 25, 100]" aria-label="Select page number"></mat-paginator>
506
+ }
507
+ </div>
508
+ </mat-sidenav-content>
509
+ </mat-sidenav-container>
510
510
  `, styles: [".mat-drawer{position:fixed;left:0}\n"] }]
511
511
  }], propDecorators: { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], withFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "withFilter", required: false }] }], withSort: [{ type: i0.Input, args: [{ isSignal: true, alias: "withSort", required: false }] }], withPagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "withPagination", required: false }] }], jsonValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "jsonValue", required: false }] }], drawer: [{ type: i0.ViewChild, args: ["drawer", { isSignal: true }] }], paginator: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatPaginator), { isSignal: true }] }], sort: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatSort), { isSignal: true }] }] } });
512
512
 
@@ -540,22 +540,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
540
540
  */
541
541
  class TableField extends FieldBase {
542
542
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TableField, deps: null, target: i0.ɵɵFactoryTarget.Component });
543
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: TableField, isStandalone: true, selector: "iss-field-table", usesInheritance: true, ngImport: i0, template: `
544
- @if (field.visible()) {
545
- @if (field.mode() === "edit") {
546
- <iss-ctrl-table
547
- [formControlName]="field.name"
548
- [columns]="field.children"
549
- [withFilter]="field.config.tableWithFilter() ?? false"
550
- [withSort]="field.config.tableWithSort() ?? false"
551
- [withPagination]="field.config.tableWithPagination() ?? false"
552
- [readonly]="field.config.readonly() ?? false"
553
- [jsonValue]="field.ctrlJsonValue()"
554
- (onChange)="field.ctrlJsonValue.set($event)"
555
- />
556
- <iss-validation-message-viewer [errors]="ctrl.errors" [showMessage]="!ctrl.untouched"/>
557
- }
558
- }
543
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: TableField, isStandalone: true, selector: "iss-field-table", usesInheritance: true, ngImport: i0, template: `
544
+ @if (field.visible()) {
545
+ @if (field.mode() === "edit") {
546
+ <iss-ctrl-table
547
+ [formControlName]="field.name"
548
+ [columns]="field.children"
549
+ [withFilter]="field.config.tableWithFilter() ?? false"
550
+ [withSort]="field.config.tableWithSort() ?? false"
551
+ [withPagination]="field.config.tableWithPagination() ?? false"
552
+ [readonly]="field.config.readonly() ?? false"
553
+ [jsonValue]="field.ctrlJsonValue()"
554
+ (onChange)="field.ctrlJsonValue.set($event)"
555
+ />
556
+ <iss-validation-message-viewer [errors]="ctrl.errors" [showMessage]="!ctrl.untouched"/>
557
+ }
558
+ }
559
559
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: TableControl, selector: "iss-ctrl-table", inputs: ["columns", "withFilter", "withSort", "withPagination", "jsonValue"] }, { kind: "component", type: ValidationMessageComponent, selector: "iss-validation-message-viewer", inputs: ["errors", "showMessage"] }], viewProviders: [VIEW_PROVIDER] });
560
560
  }
561
561
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TableField, decorators: [{
@@ -568,25 +568,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
568
568
  TableControl,
569
569
  ValidationMessageComponent,
570
570
  ],
571
- template: `
572
- @if (field.visible()) {
573
- @if (field.mode() === "edit") {
574
- <iss-ctrl-table
575
- [formControlName]="field.name"
576
- [columns]="field.children"
577
- [withFilter]="field.config.tableWithFilter() ?? false"
578
- [withSort]="field.config.tableWithSort() ?? false"
579
- [withPagination]="field.config.tableWithPagination() ?? false"
580
- [readonly]="field.config.readonly() ?? false"
581
- [jsonValue]="field.ctrlJsonValue()"
582
- (onChange)="field.ctrlJsonValue.set($event)"
583
- />
584
- <iss-validation-message-viewer [errors]="ctrl.errors" [showMessage]="!ctrl.untouched"/>
585
- }
586
- }
571
+ template: `
572
+ @if (field.visible()) {
573
+ @if (field.mode() === "edit") {
574
+ <iss-ctrl-table
575
+ [formControlName]="field.name"
576
+ [columns]="field.children"
577
+ [withFilter]="field.config.tableWithFilter() ?? false"
578
+ [withSort]="field.config.tableWithSort() ?? false"
579
+ [withPagination]="field.config.tableWithPagination() ?? false"
580
+ [readonly]="field.config.readonly() ?? false"
581
+ [jsonValue]="field.ctrlJsonValue()"
582
+ (onChange)="field.ctrlJsonValue.set($event)"
583
+ />
584
+ <iss-validation-message-viewer [errors]="ctrl.errors" [showMessage]="!ctrl.untouched"/>
585
+ }
586
+ }
587
587
  `
588
588
  }]
589
589
  }] });
590
590
 
591
591
  export { TableField };
592
- //# sourceMappingURL=iss-ctrl-table.field-DxwfNXNc.mjs.map
592
+ //# sourceMappingURL=iss-ctrl-table.field-Ca6d7LvU.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iss-ctrl-table.field-Ca6d7LvU.mjs","sources":["../../../projects/iss/src/components/controls/table/field.viewer.ts","../../../projects/iss/src/components/controls/table/table.control.ts","../../../projects/iss/src/components/controls/table/table.field.ts"],"sourcesContent":["import { Component, ComponentRef, DestroyRef, effect, EffectRef, inject, OnDestroy, Signal, Type, viewChild, ViewContainerRef } from \"@angular/core\";\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\nimport { take } from \"rxjs\";\nimport { Loader } from \"../../../shared/services/loader\";\nimport { ViewerBase } from \"../base/viewer-base\";\n\n@Component({\n selector: \"iss-viewer-field\",\n template: `\n <ng-container #container></ng-container>\n `,\n})\nexport class FieldViewer extends ViewerBase implements OnDestroy {\n containerRef: Signal<ViewContainerRef | undefined> = viewChild(\"container\", { read: ViewContainerRef });\n #loader: Loader = inject(Loader);\n #destroyRef: DestroyRef = inject(DestroyRef);\n #fieldEffectRef: EffectRef = effect(() => {\n const container: ViewContainerRef | undefined = this.containerRef();\n const field: any = this.field();\n if (!container || !field) {\n return;\n }\n\n this.#loader.loadViewer(field.type)\n .pipe(take(1), takeUntilDestroyed(this.#destroyRef))\n .subscribe((viewer: Type<any> | null) => {\n // the effect re-runs whenever the field changes, so the previously rendered\n // viewer has to go before a new one takes its place\n container.clear();\n if (!viewer) {\n return;\n }\n const componentRef: ComponentRef<any> = container.createComponent(viewer);\n componentRef.setInput(\"field\", field);\n });\n });\n\n ngOnDestroy(): void {\n this.#fieldEffectRef.destroy();\n }\n}\n","import { AfterViewInit, Component, computed, CUSTOM_ELEMENTS_SCHEMA, DestroyRef, effect, EffectRef, inject, input, InputSignal, OnDestroy, OnInit, signal, Signal, viewChild, WritableSignal } from \"@angular/core\";\r\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\r\nimport { FormGroup, NG_VALUE_ACCESSOR, ReactiveFormsModule } from \"@angular/forms\";\r\nimport { MatFormFieldModule } from \"@angular/material/form-field\";\r\nimport { MatInputModule } from \"@angular/material/input\";\r\nimport { MatPaginator, MatPaginatorModule } from \"@angular/material/paginator\";\r\nimport { MatSidenav, MatSidenavModule } from \"@angular/material/sidenav\";\r\nimport { MatSort, MatSortModule } from \"@angular/material/sort\";\r\nimport { MatTableDataSource, MatTableModule } from \"@angular/material/table\";\r\nimport { IssField } from \"../../../shared/classes/iss-field\";\r\nimport { FormEngine } from \"../../../shared/services/form-engine\";\r\nimport { Loader } from \"../../../shared/services/loader\";\r\nimport { Outlet } from \"../../outlet/outlet\";\r\nimport { ControlBase } from \"../base/control-base\";\r\nimport { FieldViewer } from \"./field.viewer\";\r\n\r\n/**\r\n * `<iss-ctrl-table>` — repeatable rows, where each row is itself a small form.\r\n *\r\n * `columns` are field definitions: the control renders them as the row editor and as the\r\n * table columns. The form value holds the raw row values, while `jsonValue` carries the\r\n * resolved payload of each row in and out.\r\n *\r\n * @example\r\n * ```html\r\n * <iss-ctrl-table\r\n * formControlName=\"items\"\r\n * [columns]=\"columns\"\r\n * [withFilter]=\"true\"\r\n * [withSort]=\"true\"\r\n * [withPagination]=\"true\"\r\n * />\r\n * ```\r\n *\r\n * ### Own inputs\r\n * | Property | Type | Default | Description |\r\n * | --- | --- | --- | --- |\r\n * | `columns` | `any[]` | **required** | Field definitions rendered as columns and as the row editor. |\r\n * | `jsonValue` | `any` | `null` | Resolved row payload pushed in from outside. |\r\n * | `withFilter` | `boolean` | `false` | Shows the filter row. |\r\n * | `withSort` | `boolean` | `false` | Enables column sorting. |\r\n * | `withPagination` | `boolean` | `false` | Shows the paginator. |\r\n *\r\n * ### Inherited from {@link ControlBase}\r\n * `formControlName` · `readonly` · `className` · `(onChange)`\r\n *\r\n * Does not project a label — the field label is rendered by the wrapping `iss-field-*`.\r\n */\r\n@Component({\r\n selector: \"iss-ctrl-table\",\r\n imports: [\r\n MatFormFieldModule,\r\n MatInputModule,\r\n MatTableModule,\r\n MatSortModule,\r\n MatPaginatorModule,\r\n MatSidenavModule,\r\n ReactiveFormsModule,\r\n Outlet,\r\n FieldViewer,\r\n ],\r\n providers: [\r\n { provide: NG_VALUE_ACCESSOR, useExisting: TableControl, multi: true },\r\n ],\r\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\r\n template: `\r\n <mat-sidenav-container [hasBackdrop]=\"true\">\r\n <mat-sidenav #drawer [mode]=\"'over'\" [position]=\"'start'\" [autoFocus]=\"false\">\r\n <form [formGroup]=\"tableOutletForm\">\r\n <iss-form-outlet [fields]=\"fields()\"/>\r\n </form>\r\n <ds-button (click)=\"saveRow(true)\">save\r\n </ds-button>\r\n <ds-button (click)=\"saveRow(false)\">save and add more</ds-button>\r\n </mat-sidenav>\r\n <mat-sidenav-content>\r\n <div>\r\n <ds-button icon=\"true\" (click)=\"openNewRow()\">\r\n <ds-icon icon=\"plus\"></ds-icon>\r\n </ds-button>\r\n <!--<button mat-raised-button (click)=\"removeRow()\" class=\"demo-button\">Remove data</button>-->\r\n </div>\r\n @if (withFilter()) {\r\n <mat-form-field>\r\n <mat-label>Filter</mat-label>\r\n <input matInput (keyup)=\"applyFilter($event)\" placeholder=\"Search in table\" #input>\r\n </mat-form-field>\r\n }\r\n <div class=\"mat-elevation-z8\">\r\n <table mat-table [dataSource]=\"dataSource\" matSort>\r\n <tr mat-header-row *matHeaderRowDef=\"fieldNames()\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: fieldNames();\" (click)=\"onRowClick(row)\"></tr>\r\n\r\n @for (col of fieldNames(); track col) {\r\n @if (col !== \"actions\") {\r\n <ng-container [matColumnDef]=\"col\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header [disabled]=\"!fieldsMap().get(col)?.config?.tableWithSort()\">\r\n {{ columnLabels()[$index] }}\r\n </th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n @if (viewFieldOf(row, $index); as viewField) {\r\n <iss-viewer-field [field]=\"viewField\"/>\r\n }\r\n </td>\r\n </ng-container>\r\n }\r\n }\r\n\r\n <!-- Actions -->\r\n <ng-container matColumnDef=\"actions\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header></th>\r\n <td mat-cell *matCellDef=\"let row\">\r\n <ds-icon icon=\"eye\" class=\"cursor-pointer\" (click)=\"viewRow(row)\"></ds-icon>\r\n <ds-icon icon=\"pen\" class=\"cursor-pointer\" (click)=\"editRow(row)\"></ds-icon>\r\n <ds-icon icon=\"trash\" class=\"cursor-pointer fc-red\" (click)=\"removeRow(row)\"></ds-icon>\r\n </td>\r\n </ng-container>\r\n\r\n <tr class=\"mat-row\" *matNoDataRow>\r\n <td class=\"mat-cell\" colspan=\"4\">\r\n <ds-message type=\"emptyCard\"></ds-message>\r\n </td>\r\n </tr>\r\n </table>\r\n\r\n @if (withPagination()) {\r\n <mat-paginator [pageSizeOptions]=\"[5, 10, 25, 100]\" aria-label=\"Select page number\"></mat-paginator>\r\n }\r\n </div>\r\n </mat-sidenav-content>\r\n </mat-sidenav-container>\r\n `,\r\n styles: `\r\n .mat-drawer {\r\n position: fixed;\r\n left: 0;\r\n }\r\n `\r\n})\r\nexport class TableControl extends ControlBase implements OnInit, AfterViewInit, OnDestroy {\r\n // raw child field configs (the same json shape IssField takes), not IssField/host-field\r\n // instances: this is what lets the control be dropped into a consumer's own wrapper\r\n // without depending on the outlet/form-engine machinery a host IssField carries\r\n /**\r\n * Field definitions rendered both as table columns and as the row editor. Required.\r\n */\r\n columns: InputSignal<any[]> = input.required<any[]>();\r\n /**\r\n * Shows the filter row above the table.\r\n */\r\n withFilter: InputSignal<boolean> = input(false);\r\n /**\r\n * Enables sorting by clicking a column header.\r\n */\r\n withSort: InputSignal<boolean> = input(false);\r\n /**\r\n * Shows the paginator under the table.\r\n */\r\n withPagination: InputSignal<boolean> = input(false);\r\n // the control value stays the \"*\"/null sentinel (see #emitRows); the row data itself is\r\n // carried separately here so a wrapper can push a value in on top of a plain ctrl.setValue,\r\n // e.g. `field.ctrl.setValue(\"*\"); field.ctrlJsonValue.set(rows);`\r\n /**\r\n * Resolved row payload pushed in from outside; the control ignores payloads it emitted itself.\r\n */\r\n jsonValue: InputSignal<any> = input<any>(null);\r\n\r\n loader: Loader = inject(Loader);\r\n drawer: Signal<MatSidenav | undefined> = viewChild(\"drawer\");\r\n tableOutletForm: FormGroup = new FormGroup({});\r\n fields: WritableSignal<IssField[]> = signal<IssField[]>([]);\r\n columnLabels: Signal<string[]> = computed(() => {\r\n const labels: string[] = this.fields().map((f: IssField) => f.label());\r\n labels.push(\"\");\r\n return labels;\r\n });\r\n fieldNames: Signal<string[]> = computed(() => {\r\n const names = this.fields().map((f: IssField) => f.name);\r\n names.push(\"actions\");\r\n return names;\r\n });\r\n fieldsMap: Signal<Map<string, IssField>> = computed(() => {\r\n const m: Map<string, IssField> = new Map<string, IssField>();\r\n this.fields().forEach((f: IssField) => {\r\n m.set(f.name, f);\r\n });\r\n return m;\r\n });\r\n dataSource: MatTableDataSource<TableRow> = this.#newDataSource([]);\r\n clickedRows = new Set<any>();\r\n paginator: Signal<MatPaginator | undefined> = viewChild(MatPaginator);\r\n sort: Signal<MatSort | undefined> = viewChild(MatSort);\r\n #formEngine: FormEngine = inject(FormEngine);\r\n #destroyRef: DestroyRef = inject(DestroyRef);\r\n // view-mode cells are keyed by the row object itself, not by position: sorting and\r\n // paging reorder dataSource.data while keeping the row references, so an array indexed\r\n // by the rendered row index would show another row's values\r\n #rowViewFields: WeakMap<TableRow, IssField[]> = new WeakMap<TableRow, IssField[]>();\r\n // the values the row editor's fields were built with; viewRow overwrites them to show a\r\n // stored row, so they have to be put back before the editor is used to add a new one\r\n #pristineFieldValues: Map<string, string> = new Map<string, string>();\r\n #fieldValuesOverridden: boolean = false;\r\n // the last payload this control itself emitted; without this, feeding jsonValue() back\r\n // into the wrapper's ctrlJsonValue would echo straight back in as a hydration and rebuild\r\n // dataSource (and the WeakMap-cached view fields) on every single row edit\r\n #lastEmitted: any = null;\r\n #hydrateEffectRef: EffectRef = effect(() => {\r\n const incoming: any = this.jsonValue();\r\n if (incoming === null || incoming === undefined || incoming === this.#lastEmitted) {\r\n return;\r\n }\r\n this.#hydrateRows(incoming);\r\n });\r\n\r\n // columns() is an input, so it is only guaranteed to be set once Angular runs ngOnInit,\r\n // not while this class' field initializers run\r\n ngOnInit(): void {\r\n const built: IssField[] = this.constructFieldChildren(this.columns());\r\n this.fields.set(built);\r\n this.#pristineFieldValues = new Map<string, string>(built.map((f: IssField) => [f.name, f.value]));\r\n }\r\n\r\n // the drawer is a viewChild, so it only exists once the view is initialised\r\n ngAfterViewInit() {\r\n this.dataSource.paginator = this.paginator() ?? null;\r\n this.dataSource.sort = this.sort() ?? null;\r\n\r\n this.drawer()?.closedStart\r\n .pipe(takeUntilDestroyed(this.#destroyRef))\r\n .subscribe(() => {\r\n this.tableOutletForm.reset();\r\n this.tableOutletForm.enable();\r\n this.#restoreFieldValues();\r\n });\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.#hydrateEffectRef.destroy();\r\n }\r\n\r\n applyFilter(event: Event) {\r\n const filterValue: string = (event.target as HTMLInputElement).value;\r\n this.dataSource.filter = filterValue.trim().toLowerCase();\r\n\r\n if (this.dataSource.paginator) {\r\n this.dataSource.paginator.firstPage();\r\n }\r\n }\r\n\r\n onRowClick(row: any) {\r\n this.clickedRows.add(row);\r\n }\r\n\r\n // the cell of a row rendered in view mode; the row's view fields are built once and cached\r\n // against the row itself, so they follow it through sorting, filtering and paging\r\n viewFieldOf(row: TableRow, index: number): IssField | undefined {\r\n let viewFields: IssField[] | undefined = this.#rowViewFields.get(row);\r\n if (!viewFields) {\r\n viewFields = this.#fieldValuesMapper(row);\r\n this.#rowViewFields.set(row, viewFields);\r\n }\r\n return viewFields[index];\r\n }\r\n\r\n // rows carry a stable id (see #buildRow) but sorting/filtering/paging only ever hand back\r\n // the same row references, so lookup by reference is simplest\r\n removeRow(row: TableRow) {\r\n if (!this.#canModify()) {\r\n return;\r\n }\r\n const index: number = this.dataSource.data.indexOf(row);\r\n if (index === -1) {\r\n return;\r\n }\r\n const newData = this.dataSource.data.filter((_, i: number) => i !== index);\r\n this.renderRows(newData);\r\n }\r\n\r\n addRow(values: any, jsonValues?: Map<string, any>) {\r\n if (!this.#canModify()) {\r\n return;\r\n }\r\n const row: TableRow = this.#buildRow(values, jsonValues);\r\n this.#rowViewFields.set(row, this.#fieldValuesMapper(row));\r\n this.renderRows([...this.dataSource.data, row]);\r\n }\r\n\r\n renderRows(rows: TableRow[]) {\r\n this.dataSource = this.#newDataSource(rows);\r\n this.dataSource.paginator = this.paginator() ?? null;\r\n this.dataSource.sort = this.sort() ?? null;\r\n this.#emitRows(rows);\r\n }\r\n\r\n viewRow(row: TableRow) {\r\n this.#applyFieldValues(\r\n (field: IssField) => this.#cellValue(row, field.name),\r\n (field: IssField) => this.#cellJsonValue(row, field.name)\r\n );\r\n this.#fieldValuesOverridden = true;\r\n this.tableOutletForm.patchValue(this.#toFlatValue(row));\r\n this.tableOutletForm.disable();\r\n this.drawer()?.open();\r\n }\r\n\r\n editRow(row: TableRow) {\r\n if (!this.#canModify()) {\r\n return;\r\n }\r\n this.tableOutletForm.enable();\r\n this.tableOutletForm.patchValue(this.#toFlatValue(row));\r\n this.drawer()?.open();\r\n }\r\n\r\n openNewRow(): void {\r\n if (!this.#canModify()) {\r\n return;\r\n }\r\n this.drawer()?.toggle();\r\n }\r\n\r\n saveRow(closeDrawer: boolean): void {\r\n if (!this.#canModify()) {\r\n return;\r\n }\r\n const jsonValues = new Map<string, any>(this.fields().map((f: IssField) => [f.name, f.ctrlJsonValue()]));\r\n this.addRow(this.tableOutletForm.getRawValue(), jsonValues);\r\n this.tableOutletForm.reset();\r\n if (closeDrawer) {\r\n this.drawer()?.close();\r\n }\r\n }\r\n\r\n private constructFieldChildren(fields: any): IssField[] {\r\n return fields.map((f: any) => new IssField(f, this.loader));\r\n }\r\n\r\n #restoreFieldValues(): void {\r\n if (!this.#fieldValuesOverridden) {\r\n return;\r\n }\r\n this.#applyFieldValues(\r\n (field: IssField) => this.#pristineFieldValues.get(field.name) as string,\r\n () => null\r\n );\r\n this.#fieldValuesOverridden = false;\r\n }\r\n\r\n #applyFieldValues(valueOf: (field: IssField) => string, jsonValueOf: (field: IssField) => any): void {\r\n this.fields.update((fields: IssField[]): IssField[] => fields.map((field: IssField) => {\r\n field.value = valueOf(field);\r\n field.ctrlJsonValue.set(jsonValueOf(field));\r\n return field;\r\n }));\r\n }\r\n\r\n // builds the view-mode fields for a row directly from its stored cells, so the value and\r\n // jsonValue shown always match what was captured when the row was saved\r\n #fieldValuesMapper(row: TableRow): IssField[] {\r\n return this.fields().map((field: IssField): any => {\r\n const fieldWithJsonValue: IssField = this.#formEngine.getField(this.tableOutletForm, field.name) ?? field;\r\n return {\r\n name: fieldWithJsonValue.name,\r\n type: fieldWithJsonValue.type,\r\n ctrlValue: signal(this.#cellValue(row, field.name)),\r\n ctrlJsonValue: signal(this.#cellJsonValue(row, field.name)),\r\n config: fieldWithJsonValue.config,\r\n };\r\n });\r\n }\r\n\r\n #canModify(): boolean {\r\n return !this.ctrl.disabled && !this.readonly();\r\n }\r\n\r\n // sets the CVA-bound control value to the \"*\" sentinel (or null when the table is empty)\r\n // and emits the full {rows} payload through the onChange output for a wrapper to consume\r\n #emitRows(rows: TableRow[]): void {\r\n const submission: { rows: TableRow[] } = this.#toSubmission(rows);\r\n this.#lastEmitted = submission;\r\n this.ctrl.setValue(rows.length ? \"*\" : null);\r\n this.propagateValue();\r\n this.emitOnChangeEvent(submission);\r\n }\r\n\r\n // rebuilds dataSource from a jsonValue payload pushed in from outside (see the `jsonValue`\r\n // input); accepts either our own {rows: TableRow[]} shape or a plain array of flat\r\n // {fieldName: value} row objects\r\n #hydrateRows(payload: any): void {\r\n const incomingRows: any[] = Array.isArray(payload?.rows) ? payload.rows : Array.isArray(payload) ? payload : [];\r\n const rows: TableRow[] = incomingRows.map((row: any) => this.#normalizeRow(row));\r\n rows.forEach((row: TableRow) => this.#rowViewFields.set(row, this.#fieldValuesMapper(row)));\r\n this.dataSource = this.#newDataSource(rows);\r\n this.dataSource.paginator = this.paginator() ?? null;\r\n this.dataSource.sort = this.sort() ?? null;\r\n this.ctrl.setValue(rows.length ? \"*\" : null, { emitEvent: false });\r\n }\r\n\r\n #normalizeRow(row: any): TableRow {\r\n if (Array.isArray(row?.cells)) {\r\n return { id: row.id ?? crypto.randomUUID(), index: row.index ?? 0, cells: row.cells };\r\n }\r\n return this.#buildRow(row);\r\n }\r\n\r\n // the canonical row shape (see TableRow) is used for dataSource.data itself, so the\r\n // submission is just that shape with the current, post-sort/filter position stamped in\r\n #toSubmission(rows: TableRow[]): { rows: TableRow[] } {\r\n return { rows: rows.map((row: TableRow, index: number) => ({ ...row, index })) };\r\n }\r\n\r\n #buildRow(values: any, jsonValues?: Map<string, any>): TableRow {\r\n return {\r\n id: crypto.randomUUID(),\r\n index: this.dataSource.data.length,\r\n cells: this.fields().map((field: IssField) => ({\r\n fieldName: field.name,\r\n value: values[field.name],\r\n jsonValue: jsonValues?.get(field.name) ?? null,\r\n })),\r\n };\r\n }\r\n\r\n #cellValue(row: TableRow, fieldName: string): string {\r\n return row.cells.find((cell) => cell.fieldName === fieldName)?.value as string;\r\n }\r\n\r\n #cellJsonValue(row: TableRow, fieldName: string): any {\r\n return row.cells.find((cell) => cell.fieldName === fieldName)?.jsonValue ?? null;\r\n }\r\n\r\n #toFlatValue(row: TableRow): any {\r\n return Object.fromEntries(row.cells.map((cell) => [cell.fieldName, cell.value]));\r\n }\r\n\r\n #newDataSource(rows: TableRow[]): MatTableDataSource<TableRow> {\r\n const dataSource: MatTableDataSource<TableRow> = new MatTableDataSource<TableRow>(rows);\r\n dataSource.filterPredicate = (row: TableRow, filter: string): boolean =>\r\n row.cells.some((cell) => `${cell.value ?? \"\"}`.toLowerCase().includes(filter));\r\n dataSource.sortingDataAccessor = (row: TableRow, sortHeaderId: string): string | number =>\r\n this.#cellValue(row, sortHeaderId) ?? \"\";\r\n return dataSource;\r\n }\r\n}\r\n\r\ninterface TableRow {\r\n id: string;\r\n index: number;\r\n cells: { fieldName: string; value: string; jsonValue: any }[];\r\n}\r\n","import { Component } from \"@angular/core\";\r\nimport { ReactiveFormsModule } from \"@angular/forms\";\r\nimport { VIEW_PROVIDER } from \"../../../shared/constants/view-provider.const\";\r\nimport { ValidationMessageComponent } from \"../../shared/validation-message.component\";\r\nimport { FieldBase } from \"../base/field-base\";\r\nimport { TableControl } from \"./table.control\";\r\n\r\n/**\r\n * `<iss-field-table>` — repeatable rows, each row being a small form built from the child fields.\r\n *\r\n * Rendered by the outlet for fields of type `table`. It renders {@link TableControl} plus the\r\n * validation message in `edit` mode; there is no `view` mode template, so the field renders\r\n * nothing outside edit mode.\r\n *\r\n * ### Supported `config` keys\r\n * | Key | Type | Description |\r\n * | --- | --- | --- |\r\n * | `tableWithFilter` | `boolean` | Shows the filter row. |\r\n * | `tableWithSort` | `boolean` | Enables column sorting. |\r\n * | `tableWithPagination` | `boolean` | Shows the paginator. |\r\n * | `readonly` | `boolean` | Shows the value but blocks interaction. |\r\n *\r\n * ### Other field members used\r\n * `children` · `ctrlJsonValue()`\r\n *\r\n * Every field also honours `visible`, `mode`, `validation`, `asyncValidation` and\r\n * `events` — see {@link IssField} for the full model and {@link FieldConfig} for all keys.\r\n *\r\n * Columns come from `field.children`: every child is both a column and an editor input.\r\n *\r\n * @example\r\n * ```json\r\n * { \"name\": \"items\", \"type\": \"table\", \"children\": [{ \"name\": \"qty\", \"type\": \"text_input\", \"label\": \"Qty\" }] }\r\n * ```\r\n */\r\n@Component({\r\n selector: \"iss-field-table\",\r\n viewProviders: [VIEW_PROVIDER],\r\n imports: [\r\n ReactiveFormsModule,\r\n TableControl,\r\n ValidationMessageComponent,\r\n ],\r\n template: `\r\n @if (field.visible()) {\r\n @if (field.mode() === \"edit\") {\r\n <iss-ctrl-table\r\n [formControlName]=\"field.name\"\r\n [columns]=\"field.children\"\r\n [withFilter]=\"field.config.tableWithFilter() ?? false\"\r\n [withSort]=\"field.config.tableWithSort() ?? false\"\r\n [withPagination]=\"field.config.tableWithPagination() ?? false\"\r\n [readonly]=\"field.config.readonly() ?? false\"\r\n [jsonValue]=\"field.ctrlJsonValue()\"\r\n (onChange)=\"field.ctrlJsonValue.set($event)\"\r\n />\r\n <iss-validation-message-viewer [errors]=\"ctrl.errors\" [showMessage]=\"!ctrl.untouched\"/>\r\n }\r\n }\r\n `\r\n})\r\nexport class TableField extends FieldBase {\r\n}\r\n"],"names":["i6"],"mappings":";;;;;;;;;;;;;;;;;;;AAYM,MAAO,WAAY,SAAQ,UAAU,CAAA;IACzC,YAAY,GAAyC,SAAS,CAAC,WAAW,oFAAI,IAAI,EAAE,gBAAgB,EAAA,CAAG;AACvG,IAAA,OAAO,GAAW,MAAM,CAAC,MAAM,CAAC;AAChC,IAAA,WAAW,GAAe,MAAM,CAAC,UAAU,CAAC;AAC5C,IAAA,eAAe,GAAc,MAAM,CAAC,MAAK;AACvC,QAAA,MAAM,SAAS,GAAiC,IAA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A,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAU,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAlBX,CAAA;;;;;;;;;;;;;;;;GAgBT,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EApBC,mBAAmB,2SACnB,YAAY,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,YAAA,EAAA,UAAA,EAAA,gBAAA,EAAA,WAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACZ,0BAA0B,EAAA,QAAA,EAAA,+BAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,aAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAJb,CAAC,aAAa,CAAC,EAAA,CAAA;;2FAwBnB,UAAU,EAAA,UAAA,EAAA,CAAA;kBA1BtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;oBAC3B,aAAa,EAAE,CAAC,aAAa,CAAC;AAC9B,oBAAA,OAAO,EAAE;wBACP,mBAAmB;wBACnB,YAAY;wBACZ,0BAA0B;AAC3B,qBAAA;AACD,oBAAA,QAAQ,EAAE,CAAA;;;;;;;;;;;;;;;;AAgBT,EAAA;AACF,iBAAA;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable } from '@angular/core';
3
- import { g as getPropertyByPath } from './iss-ctrl-iss-ctrl-WfIqBEcL.mjs';
3
+ import { g as getPropertyByPath } from './iss-ctrl-iss-ctrl-CDk4_RVA.mjs';
4
4
 
5
5
  class TriggerBasedOnJsonValue {
6
6
  isTriggered(field, change, action, masterField) {
@@ -21,4 +21,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
21
21
  }] });
22
22
 
23
23
  export { TriggerBasedOnJsonValue };
24
- //# sourceMappingURL=iss-ctrl-trigger-based-on-json-value-CprcFCWi.mjs.map
24
+ //# sourceMappingURL=iss-ctrl-trigger-based-on-json-value-Jp6lQkIa.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"iss-ctrl-trigger-based-on-json-value-CprcFCWi.mjs","sources":["../../../projects/iss/src/events/triggers/trigger-based-on-json-value.ts"],"sourcesContent":["import { Injectable } from \"@angular/core\";\r\nimport { FieldEvent } from \"../../shared/classes/field-event\";\r\nimport { IssField } from \"../../shared/classes/iss-field\";\r\nimport { FieldChange } from \"../../shared/interfaces/event-strategy\";\r\nimport { ActionTriggerFn } from \"../../shared/interfaces/event-trigger-fn\";\r\nimport { getPropertyByPath } from \"../../shared/utilities/get-property-by-path.util\";\r\n\r\n@Injectable({providedIn: \"root\"})\r\nexport class TriggerBasedOnJsonValue implements ActionTriggerFn {\r\n isTriggered(field: IssField, change: FieldChange, action: FieldEvent, masterField: IssField): boolean {\r\n if (masterField) {\r\n const actionTriggersOnAnyValue: boolean = action.value === \"*\" && (change.value !== null && change.value !== undefined);\r\n const triggerValue = getPropertyByPath(masterField.ctrlJsonValue(), action.config?.triggerFromJsonValue);\r\n const actionTriggersOnSpecificValue: boolean = triggerValue === action.value;\r\n return actionTriggersOnAnyValue || actionTriggersOnSpecificValue;\r\n }\r\n return false;\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;MAQa,uBAAuB,CAAA;AAClC,IAAA,WAAW,CAAC,KAAe,EAAE,MAAmB,EAAE,MAAkB,EAAE,WAAqB,EAAA;QACzF,IAAI,WAAW,EAAE;YACf,MAAM,wBAAwB,GAAY,MAAM,CAAC,KAAK,KAAK,GAAG,KAAK,MAAM,CAAC,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC;AACvH,YAAA,MAAM,YAAY,GAAG,iBAAiB,CAAC,WAAW,CAAC,aAAa,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC;AACxG,YAAA,MAAM,6BAA6B,GAAY,YAAY,KAAK,MAAM,CAAC,KAAK;YAC5E,OAAO,wBAAwB,IAAI,6BAA6B;QAClE;AACA,QAAA,OAAO,KAAK;IACd;uGATW,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAvB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,cADX,MAAM,EAAA,CAAA;;2FAClB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBADnC,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;;;;"}
1
+ {"version":3,"file":"iss-ctrl-trigger-based-on-json-value-Jp6lQkIa.mjs","sources":["../../../projects/iss/src/events/triggers/trigger-based-on-json-value.ts"],"sourcesContent":["import { Injectable } from \"@angular/core\";\r\nimport { FieldEvent } from \"../../shared/classes/field-event\";\r\nimport { IssField } from \"../../shared/classes/iss-field\";\r\nimport { FieldChange } from \"../../shared/interfaces/event-strategy\";\r\nimport { ActionTriggerFn } from \"../../shared/interfaces/event-trigger-fn\";\r\nimport { getPropertyByPath } from \"../../shared/utilities/get-property-by-path.util\";\r\n\r\n@Injectable({providedIn: \"root\"})\r\nexport class TriggerBasedOnJsonValue implements ActionTriggerFn {\r\n isTriggered(field: IssField, change: FieldChange, action: FieldEvent, masterField: IssField): boolean {\r\n if (masterField) {\r\n const actionTriggersOnAnyValue: boolean = action.value === \"*\" && (change.value !== null && change.value !== undefined);\r\n const triggerValue = getPropertyByPath(masterField.ctrlJsonValue(), action.config?.triggerFromJsonValue);\r\n const actionTriggersOnSpecificValue: boolean = triggerValue === action.value;\r\n return actionTriggersOnAnyValue || actionTriggersOnSpecificValue;\r\n }\r\n return false;\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;MAQa,uBAAuB,CAAA;AAClC,IAAA,WAAW,CAAC,KAAe,EAAE,MAAmB,EAAE,MAAkB,EAAE,WAAqB,EAAA;QACzF,IAAI,WAAW,EAAE;YACf,MAAM,wBAAwB,GAAY,MAAM,CAAC,KAAK,KAAK,GAAG,KAAK,MAAM,CAAC,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC;AACvH,YAAA,MAAM,YAAY,GAAG,iBAAiB,CAAC,WAAW,CAAC,aAAa,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC;AACxG,YAAA,MAAM,6BAA6B,GAAY,YAAY,KAAK,MAAM,CAAC,KAAK;YAC5E,OAAO,wBAAwB,IAAI,6BAA6B;QAClE;AACA,QAAA,OAAO,KAAK;IACd;uGATW,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAvB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,cADX,MAAM,EAAA,CAAA;;2FAClB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBADnC,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;;;;"}
@@ -3,7 +3,7 @@ import { inject, signal, CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core
3
3
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
4
  import { MatSidenav, MatSidenavContainer } from '@angular/material/sidenav';
5
5
  import { Subject, debounceTime, distinctUntilChanged, switchMap, map } from 'rxjs';
6
- import { F as FieldBase, E as Employee, V as VIEW_PROVIDER, S as SelectControl, a as ValidationMessageComponent } from './iss-ctrl-iss-ctrl-WfIqBEcL.mjs';
6
+ import { F as FieldBase, E as Employee, V as VIEW_PROVIDER, S as SelectControl, a as ValidationMessageComponent } from './iss-ctrl-iss-ctrl-CDk4_RVA.mjs';
7
7
 
8
8
  /**
9
9
  * `<iss-user-picker>` — employee lookup, searched against the directory API.
@@ -222,4 +222,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
222
222
  }], ctorParameters: () => [] });
223
223
 
224
224
  export { UserPickerField };
225
- //# sourceMappingURL=iss-ctrl-user-picker.field-Mqi37i7D.mjs.map
225
+ //# sourceMappingURL=iss-ctrl-user-picker.field-CFK871y8.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"iss-ctrl-user-picker.field-Mqi37i7D.mjs","sources":["../../../projects/iss/src/components/controls/user-picker/user-picker.field.ts"],"sourcesContent":["import { Component, CUSTOM_ELEMENTS_SCHEMA, inject, signal } from \"@angular/core\";\r\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\r\nimport { MatSidenav, MatSidenavContainer } from \"@angular/material/sidenav\";\r\nimport { debounceTime, distinctUntilChanged, map, Subject, switchMap } from \"rxjs\";\r\nimport { ValidationMessageComponent } from \"../../shared/validation-message.component\";\r\nimport { FieldBase } from \"../base/field-base\";\r\nimport { SelectControl } from \"../select/select.control\";\r\nimport { Employee } from \"./employee\";\r\nimport { VIEW_PROVIDER } from \"../../../shared/constants/view-provider.const\";\r\n\r\n/**\r\n * `<iss-user-picker>` — employee lookup, searched against the directory API.\r\n *\r\n * Rendered by the outlet for fields of type `userPicker`. In `edit` mode it renders\r\n * {@link SelectControl} — always multi-select — over the employees returned by the search;\r\n * in `view` mode the stored value as plain text. Selecting a user opens a details drawer.\r\n *\r\n * ### Supported `config` keys\r\n * | Key | Type | Description |\r\n * | --- | --- | --- |\r\n * | `min` | `number` | Minimum number of users required. |\r\n * | `max` | `number` | Maximum number of users allowed. |\r\n * | `readonly` | `boolean` | Shows the value but blocks interaction. |\r\n *\r\n * ### Other field members used\r\n * `label()` · `value` · `ctrlJsonValue()`\r\n *\r\n * Every field also honours `visible`, `mode`, `validation`, `asyncValidation` and\r\n * `events` — see {@link IssField} for the full model and {@link FieldConfig} for all keys.\r\n *\r\n * @example\r\n * ```json\r\n * { \"name\": \"approvers\", \"type\": \"userPicker\", \"label\": \"Approvers\", \"config\": { \"max\": 3 } }\r\n * ```\r\n */\r\n@Component({\r\n selector: \"iss-user-picker\",\r\n viewProviders: [VIEW_PROVIDER],\r\n imports: [\r\n SelectControl,\r\n ValidationMessageComponent,\r\n MatSidenav,\r\n MatSidenavContainer,\r\n ],\r\n template: `\r\n @if (field.visible()) {\r\n @if (field.mode() === \"edit\") {\r\n <iss-ctrl-select\r\n [formControlName]=\"field.name\"\r\n [min]=\"field.config.min() ?? null\"\r\n [max]=\"field.config.max() ?? null\"\r\n [options]=\"options()\"\r\n [multiple]=\"true\"\r\n [readonly]=\"field.config.readonly() ?? false\"\r\n (onQueryChange)=\"search($event)\"\r\n (onChange)=\"updateField($event)\"\r\n >\r\n <label>{{ field.label() }}</label>\r\n <ng-template let-item #optionTemplate>\r\n <div class=\"d-flex align-items-center gap-2\">\r\n <ds-avatar size=\"x-small\" [attr.image]=\"item.image\"></ds-avatar>\r\n <span class=\"fs-14 fw-medium fc-black\">{{ item.name }}</span>\r\n </div>\r\n </ng-template>\r\n <ng-template let-item #cardViewerTemplate>\r\n <div (click)=\"showUserData(item);drawer.open()\">\r\n {{ item.name }}\r\n </div>\r\n </ng-template>\r\n </iss-ctrl-select>\r\n <iss-validation-message-viewer [errors]=\"ctrl.errors\" [showMessage]=\"!ctrl.untouched\"/>\r\n } @else {\r\n <p>{{ field.value }}</p>\r\n }\r\n }\r\n <mat-sidenav-container [hasBackdrop]=\"true\">\r\n <mat-sidenav #drawer [mode]=\"'over'\" [position]=\"'start'\" [autoFocus]=\"false\">\r\n <div class=\"main-sidenav\">\r\n <div class=\"sidenav-title bc-white\">\r\n <h3> Employee Information </h3>\r\n <ds-icon icon=\"close\" class=\"fc-black fs-20 p-3 cursor-pointer\" (click)=\"drawer.close()\"></ds-icon>\r\n </div>\r\n <div class=\"sidenav-body p-0\">\r\n <div class=\"d-flex flex-column align-items-center gap-3 sidenav-user bc-off-white text-center\">\r\n <ds-avatar [attr.image]=\"userImage()\" [attr.label]=\"userData?.name\"></ds-avatar>\r\n @if (userData?.employeeNumber) {\r\n <div class=\"d-flex flex-column gap-1\">\r\n <h4 class=\"fs-16 fc-black fw-medium mb-0\">{{ userData?.name }}</h4>\r\n @if (!userData?.job?.name) {\r\n <h6 class=\"fs-12 fc-dark-gray fw-normal mb-0\">{{ userData?.position?.name }}</h6>\r\n }\r\n @if (!userData?.position?.name) {\r\n <h6 class=\"fs-12 fc-dark-gray fw-normal mb-0\">{{ userData?.job?.name }}</h6>\r\n }\r\n </div>\r\n }\r\n <div class=\"d-flex flex-wrap gap-2\">\r\n <div class=\"fs-12 fc-black d-flex align-items-center gap-2 box-shadow bc-white radius-4 p-2 profile-box\">\r\n <ds-icon icon=\"mail-o\" class=\"fc-coral fs-20\"></ds-icon>\r\n <a [href]=\"'mailTo:' + userData?.email\" class=\"fc-black\">{{ userData?.email }}</a>\r\n </div>\r\n @if (userData?.contact?.mobile) {\r\n <div class=\"fs-12 fc-black d-flex align-items-center gap-2 box-shadow bc-white radius-4 p-2 profile-box\">\r\n <ds-icon icon=\"phone\" class=\"fc-coral fs-20\"></ds-icon>\r\n <a [href]=\"'tel:' + userData?.contact?.mobile\" class=\"fc-black\">\r\n <bdi>{{ userData?.contact?.mobile }}</bdi>\r\n </a>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </mat-sidenav>\r\n </mat-sidenav-container>\r\n `,\r\n styles: `\r\n .mat-drawer {\r\n position: fixed;\r\n left: 0;\r\n }`,\r\n schemas: [CUSTOM_ELEMENTS_SCHEMA]\r\n})\r\nexport class UserPickerField extends FieldBase {\r\n userImageHost = \"https://igateapp.stc.com.sa\";\r\n employeeService = inject(Employee);\r\n options: any = signal([]);\r\n userData: any;\r\n #query: Subject<string> = new Subject<string>();\r\n\r\n constructor() {\r\n super();\r\n this.#query.pipe(\r\n debounceTime(300),\r\n distinctUntilChanged(),\r\n // a new query cancels the request still in flight\r\n switchMap((query: string) => this.employeeService.search(query)),\r\n map((res: any) => {\r\n return res.map((user: any) => {\r\n user.value = user.email;\r\n user.label = user.name;\r\n return user;\r\n });\r\n }),\r\n takeUntilDestroyed(this.destroyRef)\r\n ).subscribe((res: any) => {\r\n this.options.set(res);\r\n });\r\n }\r\n\r\n userImage(): string | null {\r\n const image: string | undefined = this.userData?.profileImage ?? this.userData?.profileImageUrl;\r\n if (!image) {\r\n return null;\r\n }\r\n return image.startsWith(\"http\") ? image : this.userImageHost + image;\r\n }\r\n\r\n search(event: string) {\r\n this.#query.next(event);\r\n }\r\n\r\n updateField($event: string | FormData) {\r\n this.options.set([]);\r\n }\r\n\r\n showUserData(item: any) {\r\n this.userData = item;\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;AAUA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AAyFG,MAAO,eAAgB,SAAQ,SAAS,CAAA;IAC5C,aAAa,GAAG,6BAA6B;AAC7C,IAAA,eAAe,GAAG,MAAM,CAAC,QAAQ,CAAC;AAClC,IAAA,OAAO,GAAQ,MAAM,CAAC,EAAE,8EAAC;AACzB,IAAA,QAAQ;AACR,IAAA,MAAM,GAAoB,IAAI,OAAO,EAAU;AAE/C,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;QACP,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,YAAY,CAAC,GAAG,CAAC,EACjB,oBAAoB,EAAE;;QAEtB,SAAS,CAAC,CAAC,KAAa,KAAK,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAChE,GAAG,CAAC,CAAC,GAAQ,KAAI;AACf,YAAA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ss-ctrl-user-picker.field-CFK871y8.mjs","sources":["../../../projects/iss/src/components/controls/user-picker/user-picker.field.ts"],"sourcesContent":["import { Component, CUSTOM_ELEMENTS_SCHEMA, inject, signal } from \"@angular/core\";\r\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\r\nimport { MatSidenav, MatSidenavContainer } from \"@angular/material/sidenav\";\r\nimport { debounceTime, distinctUntilChanged, map, Subject, switchMap } from \"rxjs\";\r\nimport { ValidationMessageComponent } from \"../../shared/validation-message.component\";\r\nimport { FieldBase } from \"../base/field-base\";\r\nimport { SelectControl } from \"../select/select.control\";\r\nimport { Employee } from \"./employee\";\r\nimport { VIEW_PROVIDER } from \"../../../shared/constants/view-provider.const\";\r\n\r\n/**\r\n * `<iss-user-picker>` — employee lookup, searched against the directory API.\r\n *\r\n * Rendered by the outlet for fields of type `userPicker`. In `edit` mode it renders\r\n * {@link SelectControl} — always multi-select — over the employees returned by the search;\r\n * in `view` mode the stored value as plain text. Selecting a user opens a details drawer.\r\n *\r\n * ### Supported `config` keys\r\n * | Key | Type | Description |\r\n * | --- | --- | --- |\r\n * | `min` | `number` | Minimum number of users required. |\r\n * | `max` | `number` | Maximum number of users allowed. |\r\n * | `readonly` | `boolean` | Shows the value but blocks interaction. |\r\n *\r\n * ### Other field members used\r\n * `label()` · `value` · `ctrlJsonValue()`\r\n *\r\n * Every field also honours `visible`, `mode`, `validation`, `asyncValidation` and\r\n * `events` — see {@link IssField} for the full model and {@link FieldConfig} for all keys.\r\n *\r\n * @example\r\n * ```json\r\n * { \"name\": \"approvers\", \"type\": \"userPicker\", \"label\": \"Approvers\", \"config\": { \"max\": 3 } }\r\n * ```\r\n */\r\n@Component({\r\n selector: \"iss-user-picker\",\r\n viewProviders: [VIEW_PROVIDER],\r\n imports: [\r\n SelectControl,\r\n ValidationMessageComponent,\r\n MatSidenav,\r\n MatSidenavContainer,\r\n ],\r\n template: `\r\n @if (field.visible()) {\r\n @if (field.mode() === \"edit\") {\r\n <iss-ctrl-select\r\n [formControlName]=\"field.name\"\r\n [min]=\"field.config.min() ?? null\"\r\n [max]=\"field.config.max() ?? null\"\r\n [options]=\"options()\"\r\n [multiple]=\"true\"\r\n [readonly]=\"field.config.readonly() ?? false\"\r\n (onQueryChange)=\"search($event)\"\r\n (onChange)=\"updateField($event)\"\r\n >\r\n <label>{{ field.label() }}</label>\r\n <ng-template let-item #optionTemplate>\r\n <div class=\"d-flex align-items-center gap-2\">\r\n <ds-avatar size=\"x-small\" [attr.image]=\"item.image\"></ds-avatar>\r\n <span class=\"fs-14 fw-medium fc-black\">{{ item.name }}</span>\r\n </div>\r\n </ng-template>\r\n <ng-template let-item #cardViewerTemplate>\r\n <div (click)=\"showUserData(item);drawer.open()\">\r\n {{ item.name }}\r\n </div>\r\n </ng-template>\r\n </iss-ctrl-select>\r\n <iss-validation-message-viewer [errors]=\"ctrl.errors\" [showMessage]=\"!ctrl.untouched\"/>\r\n } @else {\r\n <p>{{ field.value }}</p>\r\n }\r\n }\r\n <mat-sidenav-container [hasBackdrop]=\"true\">\r\n <mat-sidenav #drawer [mode]=\"'over'\" [position]=\"'start'\" [autoFocus]=\"false\">\r\n <div class=\"main-sidenav\">\r\n <div class=\"sidenav-title bc-white\">\r\n <h3> Employee Information </h3>\r\n <ds-icon icon=\"close\" class=\"fc-black fs-20 p-3 cursor-pointer\" (click)=\"drawer.close()\"></ds-icon>\r\n </div>\r\n <div class=\"sidenav-body p-0\">\r\n <div class=\"d-flex flex-column align-items-center gap-3 sidenav-user bc-off-white text-center\">\r\n <ds-avatar [attr.image]=\"userImage()\" [attr.label]=\"userData?.name\"></ds-avatar>\r\n @if (userData?.employeeNumber) {\r\n <div class=\"d-flex flex-column gap-1\">\r\n <h4 class=\"fs-16 fc-black fw-medium mb-0\">{{ userData?.name }}</h4>\r\n @if (!userData?.job?.name) {\r\n <h6 class=\"fs-12 fc-dark-gray fw-normal mb-0\">{{ userData?.position?.name }}</h6>\r\n }\r\n @if (!userData?.position?.name) {\r\n <h6 class=\"fs-12 fc-dark-gray fw-normal mb-0\">{{ userData?.job?.name }}</h6>\r\n }\r\n </div>\r\n }\r\n <div class=\"d-flex flex-wrap gap-2\">\r\n <div class=\"fs-12 fc-black d-flex align-items-center gap-2 box-shadow bc-white radius-4 p-2 profile-box\">\r\n <ds-icon icon=\"mail-o\" class=\"fc-coral fs-20\"></ds-icon>\r\n <a [href]=\"'mailTo:' + userData?.email\" class=\"fc-black\">{{ userData?.email }}</a>\r\n </div>\r\n @if (userData?.contact?.mobile) {\r\n <div class=\"fs-12 fc-black d-flex align-items-center gap-2 box-shadow bc-white radius-4 p-2 profile-box\">\r\n <ds-icon icon=\"phone\" class=\"fc-coral fs-20\"></ds-icon>\r\n <a [href]=\"'tel:' + userData?.contact?.mobile\" class=\"fc-black\">\r\n <bdi>{{ userData?.contact?.mobile }}</bdi>\r\n </a>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </mat-sidenav>\r\n </mat-sidenav-container>\r\n `,\r\n styles: `\r\n .mat-drawer {\r\n position: fixed;\r\n left: 0;\r\n }`,\r\n schemas: [CUSTOM_ELEMENTS_SCHEMA]\r\n})\r\nexport class UserPickerField extends FieldBase {\r\n userImageHost = \"https://igateapp.stc.com.sa\";\r\n employeeService = inject(Employee);\r\n options: any = signal([]);\r\n userData: any;\r\n #query: Subject<string> = new Subject<string>();\r\n\r\n constructor() {\r\n super();\r\n this.#query.pipe(\r\n debounceTime(300),\r\n distinctUntilChanged(),\r\n // a new query cancels the request still in flight\r\n switchMap((query: string) => this.employeeService.search(query)),\r\n map((res: any) => {\r\n return res.map((user: any) => {\r\n user.value = user.email;\r\n user.label = user.name;\r\n return user;\r\n });\r\n }),\r\n takeUntilDestroyed(this.destroyRef)\r\n ).subscribe((res: any) => {\r\n this.options.set(res);\r\n });\r\n }\r\n\r\n userImage(): string | null {\r\n const image: string | undefined = this.userData?.profileImage ?? this.userData?.profileImageUrl;\r\n if (!image) {\r\n return null;\r\n }\r\n return image.startsWith(\"http\") ? image : this.userImageHost + image;\r\n }\r\n\r\n search(event: string) {\r\n this.#query.next(event);\r\n }\r\n\r\n updateField($event: string | FormData) {\r\n this.options.set([]);\r\n }\r\n\r\n showUserData(item: any) {\r\n this.userData = item;\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;AAUA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AAyFG,MAAO,eAAgB,SAAQ,SAAS,CAAA;IAC5C,aAAa,GAAG,6BAA6B;AAC7C,IAAA,eAAe,GAAG,MAAM,CAAC,QAAQ,CAAC;AAClC,IAAA,OAAO,GAAQ,MAAM,CAAC,EAAE,8EAAC;AACzB,IAAA,QAAQ;AACR,IAAA,MAAM,GAAoB,IAAI,OAAO,EAAU;AAE/C,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;QACP,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,YAAY,CAAC,GAAG,CAAC,EACjB,oBAAoB,EAAE;;QAEtB,SAAS,CAAC,CAAC,KAAa,KAAK,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAChE,GAAG,CAAC,CAAC,GAAQ,KAAI;AACf,YAAA,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,IAAS,KAAI;AAC3B,gBAAA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK;AACvB,gBAAA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI;AACtB,gBAAA,OAAO,IAAI;AACb,YAAA,CAAC,CAAC;AACJ,QAAA,CAAC,CAAC,EACF,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,CACpC,CAAC,SAAS,CAAC,CAAC,GAAQ,KAAI;AACvB,YAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;AACvB,QAAA,CAAC,CAAC;IACJ;IAEA,SAAS,GAAA;AACP,QAAA,MAAM,KAAK,GAAuB,IAAI,CAAC,QAAQ,EAAE,YA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AAA,IAAA,EACb,0BAA0B,EAAA,QAAA,EAAA,+BAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,aAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAC1B,UAAU,gJACV,mBAAmB,EAAA,QAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EALN,CAAC,aAAa,CAAC,EAAA,CAAA;;2FAsFnB,eAAe,EAAA,UAAA,EAAA,CAAA;kBAxF3B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,EAAA,aAAA,EACZ,CAAC,aAAa,CAAC,EAAA,OAAA,EACrB;wBACP,aAAa;wBACb,0BAA0B;wBAC1B,UAAU;wBACV,mBAAmB;qBACpB,EAAA,QAAA,EACS,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuET,EAAA,OAAA,EAMQ,CAAC,sBAAsB,CAAC,EAAA,MAAA,EAAA,CAAA,sCAAA,CAAA,EAAA;;;;;"}
@@ -1,2 +1,2 @@
1
- export { ai as ATTACHMENT_DOWNLOAD_URL, ah as ATTACHMENT_UPLOAD_RESPONSE_MAPPER, ag as ATTACHMENT_UPLOAD_URL, am as ArabicNumberPipe, a0 as AttachmentViewer, ab as COMPONENTS, a6 as COUNTRIES, d as CheckboxControl, v as CheckboxField, Y as CheckboxViewer, e as ChipsControl, q as ChipsField, Q as ChipsViewer, C as ControlBase, a8 as DATETIME_FORMAT, a7 as DATE_FORMAT_ADAPTER, a5 as DEFAULT_COUNTRY, D as DatePickerControl, B as DatePickerField, a3 as DatePickerTimeViewer, a2 as DatePickerViewer, f as DateRangePickerControl, J as DateRangePickerField, a4 as DateRangePickerViewer, h as DatetimePickerControl, G as DatetimePickerField, al as Droppable, E as Employee, ae as FIELD_DATA, F as FieldBase, an as FieldDataInjector, ar as FileHandler, i as FilePickerControl, z as FilePickerField, aw as FileValidators, c as FormEngine, H as HOST, ak as HintsComponent, j as InputControl, o as InputField, K as InputViewer, av as IssValidators, L as Loader, M as MobileControl, u as MobileField, X as MobileViewer, O as Outlet, P as PLACEHOLDER_REGEX, a9 as PLATE_LETTERS, as as Phone, k as PlateControl, y as PlateField, ao as PlateLetterPipe, $ as PlateViewer, R as RadioControl, s as RadioField, U as RadioViewer, ac as SERVICES, S as SelectControl, t as SelectField, ap as SelectStatusPipe, W as SelectViewer, l as SlideToggleControl, x as SlideToggleField, _ as SlideToggleViewer, T as TextareaControl, p as TextareaField, N as TextareaViewer, m as TimePickerControl, A as TimePickerField, a1 as TimePickerViewer, ax as TimeValidator, n as ToggleButtonControl, w as ToggleButtonField, Z as ToggleButtonViewer, aq as TranslatePipe, af as UI_LANGUAGE, aj as USER_SEARCH_API, aa as VALIDATION_MESSAGES, ad as VALIDATORS, V as VIEW_PROVIDER, a as ValidationMessageComponent, at as arrayFrom, au as formatFileSize, g as getPropertyByPath, r as replacePlaceholders } from './iss-ctrl-iss-ctrl-WfIqBEcL.mjs';
1
+ export { ai as ATTACHMENT_DOWNLOAD_URL, ah as ATTACHMENT_UPLOAD_RESPONSE_MAPPER, ag as ATTACHMENT_UPLOAD_URL, am as ArabicNumberPipe, a0 as AttachmentViewer, ab as COMPONENTS, a6 as COUNTRIES, d as CheckboxControl, v as CheckboxField, Y as CheckboxViewer, e as ChipsControl, q as ChipsField, Q as ChipsViewer, C as ControlBase, a8 as DATETIME_FORMAT, a7 as DATE_FORMAT_ADAPTER, a5 as DEFAULT_COUNTRY, D as DatePickerControl, B as DatePickerField, a3 as DatePickerTimeViewer, a2 as DatePickerViewer, f as DateRangePickerControl, J as DateRangePickerField, a4 as DateRangePickerViewer, h as DatetimePickerControl, G as DatetimePickerField, al as Droppable, E as Employee, ae as FIELD_DATA, F as FieldBase, an as FieldDataInjector, ar as FileHandler, i as FilePickerControl, z as FilePickerField, aH as FileValidators, c as FormEngine, ax as HIJRI_LOCALE, ay as HIJRI_MONTH_NAMES, H as HOST, ak as HintsComponent, j as InputControl, o as InputField, K as InputViewer, as as IssDateAdapter, aG as IssValidators, L as Loader, M as MobileControl, u as MobileField, X as MobileViewer, O as Outlet, P as PLACEHOLDER_REGEX, a9 as PLATE_LETTERS, au as Phone, k as PlateControl, y as PlateField, ao as PlateLetterPipe, $ as PlateViewer, R as RadioControl, s as RadioField, U as RadioViewer, ac as SERVICES, S as SelectControl, t as SelectField, ap as SelectStatusPipe, W as SelectViewer, l as SlideToggleControl, x as SlideToggleField, _ as SlideToggleViewer, T as TextareaControl, p as TextareaField, N as TextareaViewer, m as TimePickerControl, A as TimePickerField, a1 as TimePickerViewer, aI as TimeValidator, n as ToggleButtonControl, w as ToggleButtonField, Z as ToggleButtonViewer, aq as TranslatePipe, af as UI_LANGUAGE, aj as USER_SEARCH_API, aa as VALIDATION_MESSAGES, ad as VALIDATORS, V as VIEW_PROVIDER, a as ValidationMessageComponent, av as arrayFrom, aC as createHijriDate, aw as formatFileSize, aD as formatHijriDate, aB as getHijriDaysInMonth, az as getHijriParts, g as getPropertyByPath, aE as parseHijriDate, at as provideIssDateAdapter, r as replacePlaceholders, aA as startOfHijriMonth, aF as toHijriDisplay } from './iss-ctrl-iss-ctrl-CDk4_RVA.mjs';
2
2
  //# sourceMappingURL=iss-ctrl.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iss-ctrl",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.0.6",
6
6
  "@angular/core": "^21.0.6",