iss-ctrl 0.0.8 → 0.0.10

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 (27) hide show
  1. package/fesm2022/{iss-ctrl-iss-ctrl-BLjj_Aqu.mjs → iss-ctrl-iss-ctrl-hz0ibyPg.mjs} +929 -438
  2. package/fesm2022/iss-ctrl-iss-ctrl-hz0ibyPg.mjs.map +1 -0
  3. package/fesm2022/{iss-ctrl-load-event-Co3HQu91.mjs → iss-ctrl-load-event-BW5dKG8R.mjs} +3 -3
  4. package/fesm2022/{iss-ctrl-load-event-Co3HQu91.mjs.map → iss-ctrl-load-event-BW5dKG8R.mjs.map} +1 -1
  5. package/fesm2022/{iss-ctrl-load-options-event-BIn0aiHl.mjs → iss-ctrl-load-options-event-ClX9TiiD.mjs} +3 -3
  6. package/fesm2022/{iss-ctrl-load-options-event-BIn0aiHl.mjs.map → iss-ctrl-load-options-event-ClX9TiiD.mjs.map} +1 -1
  7. package/fesm2022/{iss-ctrl-load-value-event-idouR9ST.mjs → iss-ctrl-load-value-event-DThpI9BA.mjs} +3 -3
  8. package/fesm2022/{iss-ctrl-load-value-event-idouR9ST.mjs.map → iss-ctrl-load-value-event-DThpI9BA.mjs.map} +1 -1
  9. package/fesm2022/{iss-ctrl-note.field-CuTQ3YwJ.mjs → iss-ctrl-note.field-4uLl0oS_.mjs} +4 -4
  10. package/fesm2022/{iss-ctrl-note.field-CuTQ3YwJ.mjs.map → iss-ctrl-note.field-4uLl0oS_.mjs.map} +1 -1
  11. package/fesm2022/{iss-ctrl-replace-api-keys-Df8ruZtV.mjs → iss-ctrl-replace-api-keys-BQL9zimJ.mjs} +2 -2
  12. package/fesm2022/{iss-ctrl-replace-api-keys-Df8ruZtV.mjs.map → iss-ctrl-replace-api-keys-BQL9zimJ.mjs.map} +1 -1
  13. package/fesm2022/{iss-ctrl-set-value-event-BNNMVIeT.mjs → iss-ctrl-set-value-event-BbEYFBe3.mjs} +2 -2
  14. package/fesm2022/{iss-ctrl-set-value-event-BNNMVIeT.mjs.map → iss-ctrl-set-value-event-BbEYFBe3.mjs.map} +1 -1
  15. package/fesm2022/iss-ctrl-table.field-kPIwve-M.mjs +517 -0
  16. package/fesm2022/iss-ctrl-table.field-kPIwve-M.mjs.map +1 -0
  17. package/fesm2022/{iss-ctrl-trigger-based-on-json-value-6yh7NOEH.mjs → iss-ctrl-trigger-based-on-json-value-DuLD4SOS.mjs} +2 -2
  18. package/fesm2022/{iss-ctrl-trigger-based-on-json-value-6yh7NOEH.mjs.map → iss-ctrl-trigger-based-on-json-value-DuLD4SOS.mjs.map} +1 -1
  19. package/fesm2022/{iss-ctrl-user-picker.field-Cx0CCAFC.mjs → iss-ctrl-user-picker.field-l-0bW6lP.mjs} +36 -20
  20. package/fesm2022/iss-ctrl-user-picker.field-l-0bW6lP.mjs.map +1 -0
  21. package/fesm2022/iss-ctrl.mjs +1 -1
  22. package/package.json +1 -1
  23. package/types/iss-ctrl.d.ts +44 -29
  24. package/fesm2022/iss-ctrl-iss-ctrl-BLjj_Aqu.mjs.map +0 -1
  25. package/fesm2022/iss-ctrl-table.field-Bs6l5tWV.mjs +0 -310
  26. package/fesm2022/iss-ctrl-table.field-Bs6l5tWV.mjs.map +0 -1
  27. package/fesm2022/iss-ctrl-user-picker.field-Cx0CCAFC.mjs.map +0 -1
@@ -0,0 +1,517 @@
1
+ import * as i0 from '@angular/core';
2
+ import { viewChild, ViewContainerRef, inject, DestroyRef, effect, Component, input, signal, computed, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
3
+ import * as i1$1 from '@angular/forms';
4
+ import { FormGroup, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
5
+ import { a as ViewerBase, L as Loader, C as ControlBase, b as FormEngine, I as IssField, O as Outlet, F as FieldBase, V as VIEW_PROVIDER, c as ValidationMessageComponent } from './iss-ctrl-iss-ctrl-hz0ibyPg.mjs';
6
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
7
+ import { MatFormFieldModule } from '@angular/material/form-field';
8
+ import * as i1 from '@angular/material/input';
9
+ import { MatInputModule } from '@angular/material/input';
10
+ import * as i4 from '@angular/material/paginator';
11
+ import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
12
+ import * as i5 from '@angular/material/sidenav';
13
+ import { MatSidenavModule } from '@angular/material/sidenav';
14
+ import * as i3 from '@angular/material/sort';
15
+ import { MatSort, MatSortModule } from '@angular/material/sort';
16
+ import * as i2 from '@angular/material/table';
17
+ import { MatTableDataSource, MatTableModule } from '@angular/material/table';
18
+ import { take } from 'rxjs';
19
+
20
+ class FieldViewer extends ViewerBase {
21
+ containerRef = viewChild("container", { ...(ngDevMode ? { debugName: "containerRef" } : /* istanbul ignore next */ {}), read: ViewContainerRef });
22
+ #loader = inject(Loader);
23
+ #destroyRef = inject(DestroyRef);
24
+ #fieldEffectRef = effect(() => {
25
+ const container = this.containerRef();
26
+ const field = this.field();
27
+ if (!container || !field) {
28
+ return;
29
+ }
30
+ this.#loader.loadViewer(field.type)
31
+ .pipe(take(1), takeUntilDestroyed(this.#destroyRef))
32
+ .subscribe((viewer) => {
33
+ // the effect re-runs whenever the field changes, so the previously rendered
34
+ // viewer has to go before a new one takes its place
35
+ container.clear();
36
+ if (!viewer) {
37
+ return;
38
+ }
39
+ const componentRef = container.createComponent(viewer);
40
+ componentRef.setInput("field", field);
41
+ });
42
+ }, ...(ngDevMode ? [{ debugName: "#fieldEffectRef" }] : /* istanbul ignore next */ []));
43
+ ngOnDestroy() {
44
+ this.#fieldEffectRef.destroy();
45
+ }
46
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FieldViewer, deps: null, target: i0.ɵɵFactoryTarget.Component });
47
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.9", type: FieldViewer, isStandalone: true, selector: "iss-viewer-field", viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
48
+ <ng-container #container></ng-container>
49
+ `, isInline: true });
50
+ }
51
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FieldViewer, decorators: [{
52
+ type: Component,
53
+ args: [{
54
+ selector: "iss-viewer-field",
55
+ template: `
56
+ <ng-container #container></ng-container>
57
+ `,
58
+ }]
59
+ }], propDecorators: { containerRef: [{ type: i0.ViewChild, args: ["container", { ...{ read: ViewContainerRef }, isSignal: true }] }] } });
60
+
61
+ class TableControl extends ControlBase {
62
+ // raw child field configs (the same json shape IssField takes), not IssField/host-field
63
+ // instances: this is what lets the control be dropped into a consumer's own wrapper
64
+ // without depending on the outlet/form-engine machinery a host IssField carries
65
+ columns = input.required(...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
66
+ withFilter = input(false, ...(ngDevMode ? [{ debugName: "withFilter" }] : /* istanbul ignore next */ []));
67
+ withSort = input(false, ...(ngDevMode ? [{ debugName: "withSort" }] : /* istanbul ignore next */ []));
68
+ withPagination = input(false, ...(ngDevMode ? [{ debugName: "withPagination" }] : /* istanbul ignore next */ []));
69
+ // the control value stays the "*"/null sentinel (see #emitRows); the row data itself is
70
+ // carried separately here so a wrapper can push a value in on top of a plain ctrl.setValue,
71
+ // e.g. `field.ctrl.setValue("*"); field.ctrlJsonValue.set(rows);`
72
+ jsonValue = input(null, ...(ngDevMode ? [{ debugName: "jsonValue" }] : /* istanbul ignore next */ []));
73
+ loader = inject(Loader);
74
+ drawer = viewChild("drawer", ...(ngDevMode ? [{ debugName: "drawer" }] : /* istanbul ignore next */ []));
75
+ tableOutletForm = new FormGroup({});
76
+ fields = signal([], ...(ngDevMode ? [{ debugName: "fields" }] : /* istanbul ignore next */ []));
77
+ columnLabels = computed(() => {
78
+ const labels = this.fields().map((f) => f.label());
79
+ labels.push("");
80
+ return labels;
81
+ }, ...(ngDevMode ? [{ debugName: "columnLabels" }] : /* istanbul ignore next */ []));
82
+ fieldNames = computed(() => {
83
+ const names = this.fields().map((f) => f.name);
84
+ names.push("actions");
85
+ return names;
86
+ }, ...(ngDevMode ? [{ debugName: "fieldNames" }] : /* istanbul ignore next */ []));
87
+ fieldsMap = computed(() => {
88
+ const m = new Map();
89
+ this.fields().forEach((f) => {
90
+ m.set(f.name, f);
91
+ });
92
+ return m;
93
+ }, ...(ngDevMode ? [{ debugName: "fieldsMap" }] : /* istanbul ignore next */ []));
94
+ dataSource = this.#newDataSource([]);
95
+ clickedRows = new Set();
96
+ paginator = viewChild(MatPaginator, ...(ngDevMode ? [{ debugName: "paginator" }] : /* istanbul ignore next */ []));
97
+ sort = viewChild(MatSort, ...(ngDevMode ? [{ debugName: "sort" }] : /* istanbul ignore next */ []));
98
+ #formEngine = inject(FormEngine);
99
+ #destroyRef = inject(DestroyRef);
100
+ // view-mode cells are keyed by the row object itself, not by position: sorting and
101
+ // paging reorder dataSource.data while keeping the row references, so an array indexed
102
+ // by the rendered row index would show another row's values
103
+ #rowViewFields = new WeakMap();
104
+ // the values the row editor's fields were built with; viewRow overwrites them to show a
105
+ // stored row, so they have to be put back before the editor is used to add a new one
106
+ #pristineFieldValues = new Map();
107
+ #fieldValuesOverridden = false;
108
+ // the last payload this control itself emitted; without this, feeding jsonValue() back
109
+ // into the wrapper's ctrlJsonValue would echo straight back in as a hydration and rebuild
110
+ // dataSource (and the WeakMap-cached view fields) on every single row edit
111
+ #lastEmitted = null;
112
+ #hydrateEffectRef = effect(() => {
113
+ const incoming = this.jsonValue();
114
+ if (incoming === null || incoming === undefined || incoming === this.#lastEmitted) {
115
+ return;
116
+ }
117
+ this.#hydrateRows(incoming);
118
+ }, ...(ngDevMode ? [{ debugName: "#hydrateEffectRef" }] : /* istanbul ignore next */ []));
119
+ // columns() is an input, so it is only guaranteed to be set once Angular runs ngOnInit,
120
+ // not while this class' field initializers run
121
+ ngOnInit() {
122
+ const built = this.constructFieldChildren(this.columns());
123
+ this.fields.set(built);
124
+ this.#pristineFieldValues = new Map(built.map((f) => [f.name, f.value]));
125
+ }
126
+ // the drawer is a viewChild, so it only exists once the view is initialised
127
+ ngAfterViewInit() {
128
+ this.dataSource.paginator = this.paginator() ?? null;
129
+ this.dataSource.sort = this.sort() ?? null;
130
+ this.drawer()?.closedStart
131
+ .pipe(takeUntilDestroyed(this.#destroyRef))
132
+ .subscribe(() => {
133
+ this.tableOutletForm.reset();
134
+ this.tableOutletForm.enable();
135
+ this.#restoreFieldValues();
136
+ });
137
+ }
138
+ ngOnDestroy() {
139
+ this.#hydrateEffectRef.destroy();
140
+ }
141
+ applyFilter(event) {
142
+ const filterValue = event.target.value;
143
+ this.dataSource.filter = filterValue.trim().toLowerCase();
144
+ if (this.dataSource.paginator) {
145
+ this.dataSource.paginator.firstPage();
146
+ }
147
+ }
148
+ onRowClick(row) {
149
+ this.clickedRows.add(row);
150
+ }
151
+ // the cell of a row rendered in view mode; the row's view fields are built once and cached
152
+ // against the row itself, so they follow it through sorting, filtering and paging
153
+ viewFieldOf(row, index) {
154
+ let viewFields = this.#rowViewFields.get(row);
155
+ if (!viewFields) {
156
+ viewFields = this.#fieldValuesMapper(row);
157
+ this.#rowViewFields.set(row, viewFields);
158
+ }
159
+ return viewFields[index];
160
+ }
161
+ // rows carry a stable id (see #buildRow) but sorting/filtering/paging only ever hand back
162
+ // the same row references, so lookup by reference is simplest
163
+ removeRow(row) {
164
+ if (!this.#canModify()) {
165
+ return;
166
+ }
167
+ const index = this.dataSource.data.indexOf(row);
168
+ if (index === -1) {
169
+ return;
170
+ }
171
+ const newData = this.dataSource.data.filter((_, i) => i !== index);
172
+ this.renderRows(newData);
173
+ }
174
+ addRow(values, jsonValues) {
175
+ if (!this.#canModify()) {
176
+ return;
177
+ }
178
+ const row = this.#buildRow(values, jsonValues);
179
+ this.#rowViewFields.set(row, this.#fieldValuesMapper(row));
180
+ this.renderRows([...this.dataSource.data, row]);
181
+ }
182
+ renderRows(rows) {
183
+ this.dataSource = this.#newDataSource(rows);
184
+ this.dataSource.paginator = this.paginator() ?? null;
185
+ this.dataSource.sort = this.sort() ?? null;
186
+ this.#emitRows(rows);
187
+ }
188
+ viewRow(row) {
189
+ this.#applyFieldValues((field) => this.#cellValue(row, field.name), (field) => this.#cellJsonValue(row, field.name));
190
+ this.#fieldValuesOverridden = true;
191
+ this.tableOutletForm.patchValue(this.#toFlatValue(row));
192
+ this.tableOutletForm.disable();
193
+ this.drawer()?.open();
194
+ }
195
+ editRow(row) {
196
+ if (!this.#canModify()) {
197
+ return;
198
+ }
199
+ this.tableOutletForm.enable();
200
+ this.tableOutletForm.patchValue(this.#toFlatValue(row));
201
+ this.drawer()?.open();
202
+ }
203
+ openNewRow() {
204
+ if (!this.#canModify()) {
205
+ return;
206
+ }
207
+ this.drawer()?.toggle();
208
+ }
209
+ saveRow(closeDrawer) {
210
+ if (!this.#canModify()) {
211
+ return;
212
+ }
213
+ const jsonValues = new Map(this.fields().map((f) => [f.name, f.ctrlJsonValue()]));
214
+ this.addRow(this.tableOutletForm.getRawValue(), jsonValues);
215
+ this.tableOutletForm.reset();
216
+ if (closeDrawer) {
217
+ this.drawer()?.close();
218
+ }
219
+ }
220
+ constructFieldChildren(fields) {
221
+ return fields.map((f) => new IssField(f, this.loader));
222
+ }
223
+ #restoreFieldValues() {
224
+ if (!this.#fieldValuesOverridden) {
225
+ return;
226
+ }
227
+ this.#applyFieldValues((field) => this.#pristineFieldValues.get(field.name), () => null);
228
+ this.#fieldValuesOverridden = false;
229
+ }
230
+ #applyFieldValues(valueOf, jsonValueOf) {
231
+ this.fields.update((fields) => fields.map((field) => {
232
+ field.value = valueOf(field);
233
+ field.ctrlJsonValue.set(jsonValueOf(field));
234
+ return field;
235
+ }));
236
+ }
237
+ // builds the view-mode fields for a row directly from its stored cells, so the value and
238
+ // jsonValue shown always match what was captured when the row was saved
239
+ #fieldValuesMapper(row) {
240
+ return this.fields().map((field) => {
241
+ const fieldWithJsonValue = this.#formEngine.getField(this.tableOutletForm, field.name) ?? field;
242
+ return {
243
+ name: fieldWithJsonValue.name,
244
+ type: fieldWithJsonValue.type,
245
+ ctrlValue: signal(this.#cellValue(row, field.name)),
246
+ ctrlJsonValue: signal(this.#cellJsonValue(row, field.name)),
247
+ config: fieldWithJsonValue.config,
248
+ };
249
+ });
250
+ }
251
+ #canModify() {
252
+ return !this.ctrl.disabled && !this.readonly();
253
+ }
254
+ // sets the CVA-bound control value to the "*" sentinel (or null when the table is empty)
255
+ // and emits the full {rows} payload through the onChange output for a wrapper to consume
256
+ #emitRows(rows) {
257
+ const submission = this.#toSubmission(rows);
258
+ this.#lastEmitted = submission;
259
+ this.ctrl.setValue(rows.length ? "*" : null);
260
+ this.propagateValue();
261
+ this.emitOnChangeEvent(submission);
262
+ }
263
+ // rebuilds dataSource from a jsonValue payload pushed in from outside (see the `jsonValue`
264
+ // input); accepts either our own {rows: TableRow[]} shape or a plain array of flat
265
+ // {fieldName: value} row objects
266
+ #hydrateRows(payload) {
267
+ const incomingRows = Array.isArray(payload?.rows) ? payload.rows : Array.isArray(payload) ? payload : [];
268
+ const rows = incomingRows.map((row) => this.#normalizeRow(row));
269
+ rows.forEach((row) => this.#rowViewFields.set(row, this.#fieldValuesMapper(row)));
270
+ this.dataSource = this.#newDataSource(rows);
271
+ this.dataSource.paginator = this.paginator() ?? null;
272
+ this.dataSource.sort = this.sort() ?? null;
273
+ this.ctrl.setValue(rows.length ? "*" : null, { emitEvent: false });
274
+ }
275
+ #normalizeRow(row) {
276
+ if (Array.isArray(row?.cells)) {
277
+ return { id: row.id ?? crypto.randomUUID(), index: row.index ?? 0, cells: row.cells };
278
+ }
279
+ return this.#buildRow(row);
280
+ }
281
+ // the canonical row shape (see TableRow) is used for dataSource.data itself, so the
282
+ // submission is just that shape with the current, post-sort/filter position stamped in
283
+ #toSubmission(rows) {
284
+ return { rows: rows.map((row, index) => ({ ...row, index })) };
285
+ }
286
+ #buildRow(values, jsonValues) {
287
+ return {
288
+ id: crypto.randomUUID(),
289
+ index: this.dataSource.data.length,
290
+ cells: this.fields().map((field) => ({
291
+ fieldName: field.name,
292
+ value: values[field.name],
293
+ jsonValue: jsonValues?.get(field.name) ?? null,
294
+ })),
295
+ };
296
+ }
297
+ #cellValue(row, fieldName) {
298
+ return row.cells.find((cell) => cell.fieldName === fieldName)?.value;
299
+ }
300
+ #cellJsonValue(row, fieldName) {
301
+ return row.cells.find((cell) => cell.fieldName === fieldName)?.jsonValue ?? null;
302
+ }
303
+ #toFlatValue(row) {
304
+ return Object.fromEntries(row.cells.map((cell) => [cell.fieldName, cell.value]));
305
+ }
306
+ #newDataSource(rows) {
307
+ const dataSource = new MatTableDataSource(rows);
308
+ dataSource.filterPredicate = (row, filter) => row.cells.some((cell) => `${cell.value ?? ""}`.toLowerCase().includes(filter));
309
+ dataSource.sortingDataAccessor = (row, sortHeaderId) => this.#cellValue(row, sortHeaderId) ?? "";
310
+ return dataSource;
311
+ }
312
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TableControl, deps: null, target: i0.ɵɵFactoryTarget.Component });
313
+ 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: [
314
+ { provide: NG_VALUE_ACCESSOR, useExisting: TableControl, multi: true },
315
+ ], 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: `
316
+ <mat-sidenav-container [hasBackdrop]="true">
317
+ <mat-sidenav #drawer [mode]="'over'" [position]="'start'" [autoFocus]="false">
318
+ <form [formGroup]="tableOutletForm">
319
+ <iss-form-outlet [fields]="fields()"/>
320
+ </form>
321
+ <ds-button (click)="saveRow(true)">save
322
+ </ds-button>
323
+ <ds-button (click)="saveRow(false)">save and add more</ds-button>
324
+ </mat-sidenav>
325
+ <mat-sidenav-content>
326
+ <div>
327
+ <ds-button icon="true" (click)="openNewRow()">
328
+ <ds-icon icon="plus"></ds-icon>
329
+ </ds-button>
330
+ <!--<button mat-raised-button (click)="removeRow()" class="demo-button">Remove data</button>-->
331
+ </div>
332
+ @if (withFilter()) {
333
+ <mat-form-field>
334
+ <mat-label>Filter</mat-label>
335
+ <input matInput (keyup)="applyFilter($event)" placeholder="Search in table" #input>
336
+ </mat-form-field>
337
+ }
338
+ <div class="mat-elevation-z8">
339
+ <table mat-table [dataSource]="dataSource" matSort>
340
+ <tr mat-header-row *matHeaderRowDef="fieldNames()"></tr>
341
+ <tr mat-row *matRowDef="let row; columns: fieldNames();" (click)="onRowClick(row)"></tr>
342
+
343
+ @for (col of fieldNames(); track col) {
344
+ @if (col !== "actions") {
345
+ <ng-container [matColumnDef]="col">
346
+ <th mat-header-cell *matHeaderCellDef mat-sort-header [disabled]="!fieldsMap().get(col)?.config?.tableWithSort()">
347
+ {{ columnLabels()[$index] }}
348
+ </th>
349
+ <td mat-cell *matCellDef="let row">
350
+ @if (viewFieldOf(row, $index); as viewField) {
351
+ <iss-viewer-field [field]="viewField"/>
352
+ }
353
+ </td>
354
+ </ng-container>
355
+ }
356
+ }
357
+
358
+ <!-- Actions -->
359
+ <ng-container matColumnDef="actions">
360
+ <th mat-header-cell *matHeaderCellDef mat-sort-header></th>
361
+ <td mat-cell *matCellDef="let row">
362
+ <ds-icon icon="eye" class="cursor-pointer" (click)="viewRow(row)"></ds-icon>
363
+ <ds-icon icon="pen" class="cursor-pointer" (click)="editRow(row)"></ds-icon>
364
+ <ds-icon icon="trash" class="cursor-pointer fc-red" (click)="removeRow(row)"></ds-icon>
365
+ </td>
366
+ </ng-container>
367
+
368
+ <tr class="mat-row" *matNoDataRow>
369
+ <td class="mat-cell" colspan="4">
370
+ <ds-message type="emptyCard"></ds-message>
371
+ </td>
372
+ </tr>
373
+ </table>
374
+
375
+ @if (withPagination()) {
376
+ <mat-paginator [pageSizeOptions]="[5, 10, 25, 100]" aria-label="Select page number"></mat-paginator>
377
+ }
378
+ </div>
379
+ </mat-sidenav-content>
380
+ </mat-sidenav-container>
381
+ `, 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" }] });
382
+ }
383
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TableControl, decorators: [{
384
+ type: Component,
385
+ args: [{ selector: "iss-ctrl-table", imports: [
386
+ MatFormFieldModule,
387
+ MatInputModule,
388
+ MatTableModule,
389
+ MatSortModule,
390
+ MatPaginatorModule,
391
+ MatSidenavModule,
392
+ ReactiveFormsModule,
393
+ Outlet,
394
+ FieldViewer,
395
+ ], providers: [
396
+ { provide: NG_VALUE_ACCESSOR, useExisting: TableControl, multi: true },
397
+ ], schemas: [CUSTOM_ELEMENTS_SCHEMA], template: `
398
+ <mat-sidenav-container [hasBackdrop]="true">
399
+ <mat-sidenav #drawer [mode]="'over'" [position]="'start'" [autoFocus]="false">
400
+ <form [formGroup]="tableOutletForm">
401
+ <iss-form-outlet [fields]="fields()"/>
402
+ </form>
403
+ <ds-button (click)="saveRow(true)">save
404
+ </ds-button>
405
+ <ds-button (click)="saveRow(false)">save and add more</ds-button>
406
+ </mat-sidenav>
407
+ <mat-sidenav-content>
408
+ <div>
409
+ <ds-button icon="true" (click)="openNewRow()">
410
+ <ds-icon icon="plus"></ds-icon>
411
+ </ds-button>
412
+ <!--<button mat-raised-button (click)="removeRow()" class="demo-button">Remove data</button>-->
413
+ </div>
414
+ @if (withFilter()) {
415
+ <mat-form-field>
416
+ <mat-label>Filter</mat-label>
417
+ <input matInput (keyup)="applyFilter($event)" placeholder="Search in table" #input>
418
+ </mat-form-field>
419
+ }
420
+ <div class="mat-elevation-z8">
421
+ <table mat-table [dataSource]="dataSource" matSort>
422
+ <tr mat-header-row *matHeaderRowDef="fieldNames()"></tr>
423
+ <tr mat-row *matRowDef="let row; columns: fieldNames();" (click)="onRowClick(row)"></tr>
424
+
425
+ @for (col of fieldNames(); track col) {
426
+ @if (col !== "actions") {
427
+ <ng-container [matColumnDef]="col">
428
+ <th mat-header-cell *matHeaderCellDef mat-sort-header [disabled]="!fieldsMap().get(col)?.config?.tableWithSort()">
429
+ {{ columnLabels()[$index] }}
430
+ </th>
431
+ <td mat-cell *matCellDef="let row">
432
+ @if (viewFieldOf(row, $index); as viewField) {
433
+ <iss-viewer-field [field]="viewField"/>
434
+ }
435
+ </td>
436
+ </ng-container>
437
+ }
438
+ }
439
+
440
+ <!-- Actions -->
441
+ <ng-container matColumnDef="actions">
442
+ <th mat-header-cell *matHeaderCellDef mat-sort-header></th>
443
+ <td mat-cell *matCellDef="let row">
444
+ <ds-icon icon="eye" class="cursor-pointer" (click)="viewRow(row)"></ds-icon>
445
+ <ds-icon icon="pen" class="cursor-pointer" (click)="editRow(row)"></ds-icon>
446
+ <ds-icon icon="trash" class="cursor-pointer fc-red" (click)="removeRow(row)"></ds-icon>
447
+ </td>
448
+ </ng-container>
449
+
450
+ <tr class="mat-row" *matNoDataRow>
451
+ <td class="mat-cell" colspan="4">
452
+ <ds-message type="emptyCard"></ds-message>
453
+ </td>
454
+ </tr>
455
+ </table>
456
+
457
+ @if (withPagination()) {
458
+ <mat-paginator [pageSizeOptions]="[5, 10, 25, 100]" aria-label="Select page number"></mat-paginator>
459
+ }
460
+ </div>
461
+ </mat-sidenav-content>
462
+ </mat-sidenav-container>
463
+ `, styles: [".mat-drawer{position:fixed;left:0}\n"] }]
464
+ }], 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 }] }] } });
465
+
466
+ class TableField extends FieldBase {
467
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TableField, deps: null, target: i0.ɵɵFactoryTarget.Component });
468
+ 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: `
469
+ @if (field.visible()) {
470
+ @if (field.mode() === "edit") {
471
+ <iss-ctrl-table
472
+ [formControlName]="field.name"
473
+ [columns]="field.children"
474
+ [withFilter]="field.config.tableWithFilter() ?? false"
475
+ [withSort]="field.config.tableWithSort() ?? false"
476
+ [withPagination]="field.config.tableWithPagination() ?? false"
477
+ [readonly]="field.config.readonly() ?? false"
478
+ [jsonValue]="field.ctrlJsonValue()"
479
+ (onChange)="field.ctrlJsonValue.set($event)"
480
+ />
481
+ <iss-validation-message-viewer [errors]="ctrl.errors" [showMessage]="!ctrl.untouched"/>
482
+ }
483
+ }
484
+ `, 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] });
485
+ }
486
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TableField, decorators: [{
487
+ type: Component,
488
+ args: [{
489
+ selector: "iss-field-table",
490
+ viewProviders: [VIEW_PROVIDER],
491
+ imports: [
492
+ ReactiveFormsModule,
493
+ TableControl,
494
+ ValidationMessageComponent,
495
+ ],
496
+ template: `
497
+ @if (field.visible()) {
498
+ @if (field.mode() === "edit") {
499
+ <iss-ctrl-table
500
+ [formControlName]="field.name"
501
+ [columns]="field.children"
502
+ [withFilter]="field.config.tableWithFilter() ?? false"
503
+ [withSort]="field.config.tableWithSort() ?? false"
504
+ [withPagination]="field.config.tableWithPagination() ?? false"
505
+ [readonly]="field.config.readonly() ?? false"
506
+ [jsonValue]="field.ctrlJsonValue()"
507
+ (onChange)="field.ctrlJsonValue.set($event)"
508
+ />
509
+ <iss-validation-message-viewer [errors]="ctrl.errors" [showMessage]="!ctrl.untouched"/>
510
+ }
511
+ }
512
+ `
513
+ }]
514
+ }] });
515
+
516
+ export { TableField };
517
+ //# sourceMappingURL=iss-ctrl-table.field-kPIwve-M.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iss-ctrl-table.field-kPIwve-M.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\";\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\nimport { FormGroup, NG_VALUE_ACCESSOR, ReactiveFormsModule } from \"@angular/forms\";\nimport { MatFormFieldModule } from \"@angular/material/form-field\";\nimport { MatInputModule } from \"@angular/material/input\";\nimport { MatPaginator, MatPaginatorModule } from \"@angular/material/paginator\";\nimport { MatSidenav, MatSidenavModule } from \"@angular/material/sidenav\";\nimport { MatSort, MatSortModule } from \"@angular/material/sort\";\nimport { MatTableDataSource, MatTableModule } from \"@angular/material/table\";\nimport { IssField } from \"../../../shared/classes/iss-field\";\nimport { FormEngine } from \"../../../shared/services/form-engine\";\nimport { Loader } from \"../../../shared/services/loader\";\nimport { Outlet } from \"../../outlet/outlet\";\nimport { ControlBase } from \"../base/control-base\";\nimport { FieldViewer } from \"./field.viewer\";\n\n@Component({\n selector: \"iss-ctrl-table\",\n imports: [\n MatFormFieldModule,\n MatInputModule,\n MatTableModule,\n MatSortModule,\n MatPaginatorModule,\n MatSidenavModule,\n ReactiveFormsModule,\n Outlet,\n FieldViewer,\n ],\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: TableControl, multi: true },\n ],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `\n <mat-sidenav-container [hasBackdrop]=\"true\">\n <mat-sidenav #drawer [mode]=\"'over'\" [position]=\"'start'\" [autoFocus]=\"false\">\n <form [formGroup]=\"tableOutletForm\">\n <iss-form-outlet [fields]=\"fields()\"/>\n </form>\n <ds-button (click)=\"saveRow(true)\">save\n </ds-button>\n <ds-button (click)=\"saveRow(false)\">save and add more</ds-button>\n </mat-sidenav>\n <mat-sidenav-content>\n <div>\n <ds-button icon=\"true\" (click)=\"openNewRow()\">\n <ds-icon icon=\"plus\"></ds-icon>\n </ds-button>\n <!--<button mat-raised-button (click)=\"removeRow()\" class=\"demo-button\">Remove data</button>-->\n </div>\n @if (withFilter()) {\n <mat-form-field>\n <mat-label>Filter</mat-label>\n <input matInput (keyup)=\"applyFilter($event)\" placeholder=\"Search in table\" #input>\n </mat-form-field>\n }\n <div class=\"mat-elevation-z8\">\n <table mat-table [dataSource]=\"dataSource\" matSort>\n <tr mat-header-row *matHeaderRowDef=\"fieldNames()\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: fieldNames();\" (click)=\"onRowClick(row)\"></tr>\n\n @for (col of fieldNames(); track col) {\n @if (col !== \"actions\") {\n <ng-container [matColumnDef]=\"col\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header [disabled]=\"!fieldsMap().get(col)?.config?.tableWithSort()\">\n {{ columnLabels()[$index] }}\n </th>\n <td mat-cell *matCellDef=\"let row\">\n @if (viewFieldOf(row, $index); as viewField) {\n <iss-viewer-field [field]=\"viewField\"/>\n }\n </td>\n </ng-container>\n }\n }\n\n <!-- Actions -->\n <ng-container matColumnDef=\"actions\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header></th>\n <td mat-cell *matCellDef=\"let row\">\n <ds-icon icon=\"eye\" class=\"cursor-pointer\" (click)=\"viewRow(row)\"></ds-icon>\n <ds-icon icon=\"pen\" class=\"cursor-pointer\" (click)=\"editRow(row)\"></ds-icon>\n <ds-icon icon=\"trash\" class=\"cursor-pointer fc-red\" (click)=\"removeRow(row)\"></ds-icon>\n </td>\n </ng-container>\n\n <tr class=\"mat-row\" *matNoDataRow>\n <td class=\"mat-cell\" colspan=\"4\">\n <ds-message type=\"emptyCard\"></ds-message>\n </td>\n </tr>\n </table>\n\n @if (withPagination()) {\n <mat-paginator [pageSizeOptions]=\"[5, 10, 25, 100]\" aria-label=\"Select page number\"></mat-paginator>\n }\n </div>\n </mat-sidenav-content>\n </mat-sidenav-container>\n `,\n styles: `\n .mat-drawer {\n position: fixed;\n left: 0;\n }\n `\n})\nexport class TableControl extends ControlBase implements OnInit, AfterViewInit, OnDestroy {\n // raw child field configs (the same json shape IssField takes), not IssField/host-field\n // instances: this is what lets the control be dropped into a consumer's own wrapper\n // without depending on the outlet/form-engine machinery a host IssField carries\n columns: InputSignal<any[]> = input.required<any[]>();\n withFilter: InputSignal<boolean> = input(false);\n withSort: InputSignal<boolean> = input(false);\n withPagination: InputSignal<boolean> = input(false);\n // the control value stays the \"*\"/null sentinel (see #emitRows); the row data itself is\n // carried separately here so a wrapper can push a value in on top of a plain ctrl.setValue,\n // e.g. `field.ctrl.setValue(\"*\"); field.ctrlJsonValue.set(rows);`\n jsonValue: InputSignal<any> = input<any>(null);\n\n loader: Loader = inject(Loader);\n drawer: Signal<MatSidenav | undefined> = viewChild(\"drawer\");\n tableOutletForm: FormGroup = new FormGroup({});\n fields: WritableSignal<IssField[]> = signal<IssField[]>([]);\n columnLabels: Signal<string[]> = computed(() => {\n const labels: string[] = this.fields().map((f: IssField) => f.label());\n labels.push(\"\");\n return labels;\n });\n fieldNames: Signal<string[]> = computed(() => {\n const names = this.fields().map((f: IssField) => f.name);\n names.push(\"actions\");\n return names;\n });\n fieldsMap: Signal<Map<string, IssField>> = computed(() => {\n const m: Map<string, IssField> = new Map<string, IssField>();\n this.fields().forEach((f: IssField) => {\n m.set(f.name, f);\n });\n return m;\n });\n dataSource: MatTableDataSource<TableRow> = this.#newDataSource([]);\n clickedRows = new Set<any>();\n paginator: Signal<MatPaginator | undefined> = viewChild(MatPaginator);\n sort: Signal<MatSort | undefined> = viewChild(MatSort);\n #formEngine: FormEngine = inject(FormEngine);\n #destroyRef: DestroyRef = inject(DestroyRef);\n // view-mode cells are keyed by the row object itself, not by position: sorting and\n // paging reorder dataSource.data while keeping the row references, so an array indexed\n // by the rendered row index would show another row's values\n #rowViewFields: WeakMap<TableRow, IssField[]> = new WeakMap<TableRow, IssField[]>();\n // the values the row editor's fields were built with; viewRow overwrites them to show a\n // stored row, so they have to be put back before the editor is used to add a new one\n #pristineFieldValues: Map<string, string> = new Map<string, string>();\n #fieldValuesOverridden: boolean = false;\n // the last payload this control itself emitted; without this, feeding jsonValue() back\n // into the wrapper's ctrlJsonValue would echo straight back in as a hydration and rebuild\n // dataSource (and the WeakMap-cached view fields) on every single row edit\n #lastEmitted: any = null;\n #hydrateEffectRef: EffectRef = effect(() => {\n const incoming: any = this.jsonValue();\n if (incoming === null || incoming === undefined || incoming === this.#lastEmitted) {\n return;\n }\n this.#hydrateRows(incoming);\n });\n\n // columns() is an input, so it is only guaranteed to be set once Angular runs ngOnInit,\n // not while this class' field initializers run\n ngOnInit(): void {\n const built: IssField[] = this.constructFieldChildren(this.columns());\n this.fields.set(built);\n this.#pristineFieldValues = new Map<string, string>(built.map((f: IssField) => [f.name, f.value]));\n }\n\n // the drawer is a viewChild, so it only exists once the view is initialised\n ngAfterViewInit() {\n this.dataSource.paginator = this.paginator() ?? null;\n this.dataSource.sort = this.sort() ?? null;\n\n this.drawer()?.closedStart\n .pipe(takeUntilDestroyed(this.#destroyRef))\n .subscribe(() => {\n this.tableOutletForm.reset();\n this.tableOutletForm.enable();\n this.#restoreFieldValues();\n });\n }\n\n ngOnDestroy(): void {\n this.#hydrateEffectRef.destroy();\n }\n\n applyFilter(event: Event) {\n const filterValue: string = (event.target as HTMLInputElement).value;\n this.dataSource.filter = filterValue.trim().toLowerCase();\n\n if (this.dataSource.paginator) {\n this.dataSource.paginator.firstPage();\n }\n }\n\n onRowClick(row: any) {\n this.clickedRows.add(row);\n }\n\n // the cell of a row rendered in view mode; the row's view fields are built once and cached\n // against the row itself, so they follow it through sorting, filtering and paging\n viewFieldOf(row: TableRow, index: number): IssField | undefined {\n let viewFields: IssField[] | undefined = this.#rowViewFields.get(row);\n if (!viewFields) {\n viewFields = this.#fieldValuesMapper(row);\n this.#rowViewFields.set(row, viewFields);\n }\n return viewFields[index];\n }\n\n // rows carry a stable id (see #buildRow) but sorting/filtering/paging only ever hand back\n // the same row references, so lookup by reference is simplest\n removeRow(row: TableRow) {\n if (!this.#canModify()) {\n return;\n }\n const index: number = this.dataSource.data.indexOf(row);\n if (index === -1) {\n return;\n }\n const newData = this.dataSource.data.filter((_, i: number) => i !== index);\n this.renderRows(newData);\n }\n\n addRow(values: any, jsonValues?: Map<string, any>) {\n if (!this.#canModify()) {\n return;\n }\n const row: TableRow = this.#buildRow(values, jsonValues);\n this.#rowViewFields.set(row, this.#fieldValuesMapper(row));\n this.renderRows([...this.dataSource.data, row]);\n }\n\n renderRows(rows: TableRow[]) {\n this.dataSource = this.#newDataSource(rows);\n this.dataSource.paginator = this.paginator() ?? null;\n this.dataSource.sort = this.sort() ?? null;\n this.#emitRows(rows);\n }\n\n viewRow(row: TableRow) {\n this.#applyFieldValues(\n (field: IssField) => this.#cellValue(row, field.name),\n (field: IssField) => this.#cellJsonValue(row, field.name)\n );\n this.#fieldValuesOverridden = true;\n this.tableOutletForm.patchValue(this.#toFlatValue(row));\n this.tableOutletForm.disable();\n this.drawer()?.open();\n }\n\n editRow(row: TableRow) {\n if (!this.#canModify()) {\n return;\n }\n this.tableOutletForm.enable();\n this.tableOutletForm.patchValue(this.#toFlatValue(row));\n this.drawer()?.open();\n }\n\n openNewRow(): void {\n if (!this.#canModify()) {\n return;\n }\n this.drawer()?.toggle();\n }\n\n saveRow(closeDrawer: boolean): void {\n if (!this.#canModify()) {\n return;\n }\n const jsonValues = new Map<string, any>(this.fields().map((f: IssField) => [f.name, f.ctrlJsonValue()]));\n this.addRow(this.tableOutletForm.getRawValue(), jsonValues);\n this.tableOutletForm.reset();\n if (closeDrawer) {\n this.drawer()?.close();\n }\n }\n\n private constructFieldChildren(fields: any): IssField[] {\n return fields.map((f: any) => new IssField(f, this.loader));\n }\n\n #restoreFieldValues(): void {\n if (!this.#fieldValuesOverridden) {\n return;\n }\n this.#applyFieldValues(\n (field: IssField) => this.#pristineFieldValues.get(field.name) as string,\n () => null\n );\n this.#fieldValuesOverridden = false;\n }\n\n #applyFieldValues(valueOf: (field: IssField) => string, jsonValueOf: (field: IssField) => any): void {\n this.fields.update((fields: IssField[]): IssField[] => fields.map((field: IssField) => {\n field.value = valueOf(field);\n field.ctrlJsonValue.set(jsonValueOf(field));\n return field;\n }));\n }\n\n // builds the view-mode fields for a row directly from its stored cells, so the value and\n // jsonValue shown always match what was captured when the row was saved\n #fieldValuesMapper(row: TableRow): IssField[] {\n return this.fields().map((field: IssField): any => {\n const fieldWithJsonValue: IssField = this.#formEngine.getField(this.tableOutletForm, field.name) ?? field;\n return {\n name: fieldWithJsonValue.name,\n type: fieldWithJsonValue.type,\n ctrlValue: signal(this.#cellValue(row, field.name)),\n ctrlJsonValue: signal(this.#cellJsonValue(row, field.name)),\n config: fieldWithJsonValue.config,\n };\n });\n }\n\n #canModify(): boolean {\n return !this.ctrl.disabled && !this.readonly();\n }\n\n // sets the CVA-bound control value to the \"*\" sentinel (or null when the table is empty)\n // and emits the full {rows} payload through the onChange output for a wrapper to consume\n #emitRows(rows: TableRow[]): void {\n const submission: { rows: TableRow[] } = this.#toSubmission(rows);\n this.#lastEmitted = submission;\n this.ctrl.setValue(rows.length ? \"*\" : null);\n this.propagateValue();\n this.emitOnChangeEvent(submission);\n }\n\n // rebuilds dataSource from a jsonValue payload pushed in from outside (see the `jsonValue`\n // input); accepts either our own {rows: TableRow[]} shape or a plain array of flat\n // {fieldName: value} row objects\n #hydrateRows(payload: any): void {\n const incomingRows: any[] = Array.isArray(payload?.rows) ? payload.rows : Array.isArray(payload) ? payload : [];\n const rows: TableRow[] = incomingRows.map((row: any) => this.#normalizeRow(row));\n rows.forEach((row: TableRow) => this.#rowViewFields.set(row, this.#fieldValuesMapper(row)));\n this.dataSource = this.#newDataSource(rows);\n this.dataSource.paginator = this.paginator() ?? null;\n this.dataSource.sort = this.sort() ?? null;\n this.ctrl.setValue(rows.length ? \"*\" : null, {emitEvent: false});\n }\n\n #normalizeRow(row: any): TableRow {\n if (Array.isArray(row?.cells)) {\n return {id: row.id ?? crypto.randomUUID(), index: row.index ?? 0, cells: row.cells};\n }\n return this.#buildRow(row);\n }\n\n // the canonical row shape (see TableRow) is used for dataSource.data itself, so the\n // submission is just that shape with the current, post-sort/filter position stamped in\n #toSubmission(rows: TableRow[]): { rows: TableRow[] } {\n return {rows: rows.map((row: TableRow, index: number) => ({...row, index}))};\n }\n\n #buildRow(values: any, jsonValues?: Map<string, any>): TableRow {\n return {\n id: crypto.randomUUID(),\n index: this.dataSource.data.length,\n cells: this.fields().map((field: IssField) => ({\n fieldName: field.name,\n value: values[field.name],\n jsonValue: jsonValues?.get(field.name) ?? null,\n })),\n };\n }\n\n #cellValue(row: TableRow, fieldName: string): string {\n return row.cells.find((cell) => cell.fieldName === fieldName)?.value as string;\n }\n\n #cellJsonValue(row: TableRow, fieldName: string): any {\n return row.cells.find((cell) => cell.fieldName === fieldName)?.jsonValue ?? null;\n }\n\n #toFlatValue(row: TableRow): any {\n return Object.fromEntries(row.cells.map((cell) => [cell.fieldName, cell.value]));\n }\n\n #newDataSource(rows: TableRow[]): MatTableDataSource<TableRow> {\n const dataSource: MatTableDataSource<TableRow> = new MatTableDataSource<TableRow>(rows);\n dataSource.filterPredicate = (row: TableRow, filter: string): boolean =>\n row.cells.some((cell) => `${cell.value ?? \"\"}`.toLowerCase().includes(filter));\n dataSource.sortingDataAccessor = (row: TableRow, sortHeaderId: string): string | number =>\n this.#cellValue(row, sortHeaderId) ?? \"\";\n return dataSource;\n }\n}\n\ninterface TableRow {\n id: string;\n index: number;\n cells: { fieldName: string; value: string; jsonValue: any }[];\n}\n","import { Component } from \"@angular/core\";\nimport { ReactiveFormsModule } from \"@angular/forms\";\nimport { VIEW_PROVIDER } from \"../../../shared/constants/view-provider.const\";\nimport { ValidationMessageComponent } from \"../../shared/validation-message.component\";\nimport { FieldBase } from \"../base/field-base\";\nimport { TableControl } from \"./table.control\";\n\n@Component({\n selector: \"iss-field-table\",\n viewProviders: [VIEW_PROVIDER],\n imports: [\n ReactiveFormsModule,\n TableControl,\n ValidationMessageComponent,\n ],\n template: `\n @if (field.visible()) {\n @if (field.mode() === \"edit\") {\n <iss-ctrl-table\n [formControlName]=\"field.name\"\n [columns]=\"field.children\"\n [withFilter]=\"field.config.tableWithFilter() ?? false\"\n [withSort]=\"field.config.tableWithSort() ?? false\"\n [withPagination]=\"field.config.tableWithPagination() ?? false\"\n [readonly]=\"field.config.readonly() ?? false\"\n [jsonValue]=\"field.ctrlJsonValue()\"\n (onChange)=\"field.ctrlJsonValue.set($event)\"\n />\n <iss-validation-message-viewer [errors]=\"ctrl.errors\" [showMessage]=\"!ctrl.untouched\"/>\n }\n }\n `\n})\nexport class TableField extends FieldBase {\n}\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,IAAI,CAAC,YAAY,EAAE;AACnE,QAAA,MAAM,KAAK,GAAQ,IAAI,CAAC,KAAK,EAAE;AAC/B,QAAA,IAAI,CAAC,SAAS,IAAI,CAAC,KAAK,EAAE;YACxB;QACF;QAEA,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI;AAC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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;;;;;;;;;;;;;;;;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-BLjj_Aqu.mjs';
3
+ import { g as getPropertyByPath } from './iss-ctrl-iss-ctrl-hz0ibyPg.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-6yh7NOEH.mjs.map
24
+ //# sourceMappingURL=iss-ctrl-trigger-based-on-json-value-DuLD4SOS.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"iss-ctrl-trigger-based-on-json-value-6yh7NOEH.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-DuLD4SOS.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;;;;;"}