@masterteam/components 0.0.292 → 0.0.293

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.
@@ -812,6 +812,14 @@ class EntityListField {
812
812
  configuration = input(null, ...(ngDevMode ? [{ debugName: "configuration" }] : /* istanbul ignore next */ []));
813
813
  /** Runtime ids needed to call the read endpoint. */
814
814
  runtimeContext = input(null, ...(ngDevMode ? [{ debugName: "runtimeContext" }] : /* istanbul ignore next */ []));
815
+ /**
816
+ * The bound value is an unapplied process submission — an Approval step's
817
+ * frozen create/update/delete operations — rather than a persisted record
818
+ * value. Its `rows[]` and `deletedIds` are pending intent the approver has
819
+ * to see staged over the loaded records, not markers of writes the backend
820
+ * already applied. See `.github/instructions/properties/EntityList.md`.
821
+ */
822
+ pendingSubmission = input(false, ...(ngDevMode ? [{ debugName: "pendingSubmission" }] : /* istanbul ignore next */ []));
815
823
  /**
816
824
  * Full lookup catalog of the host form, forwarded to the add/edit dialog's
817
825
  * nested form. `process-form-load` returns only the lookup *id* per field,
@@ -888,8 +896,22 @@ class EntityListField {
888
896
  * partial updates of existing records; `entityId = 0` rows are creates.
889
897
  */
890
898
  pendingRows = signal([], ...(ngDevMode ? [{ debugName: "pendingRows" }] : /* istanbul ignore next */ []));
891
- /** Existing entity ids the user removed (submitted as `deletedIds`). */
892
- deletedIds = signal([], ...(ngDevMode ? [{ debugName: "deletedIds" }] : /* istanbul ignore next */ []));
899
+ /** Existing entity ids the user removed in this session. */
900
+ stagedDeletedIds = signal([], ...(ngDevMode ? [{ debugName: "stagedDeletedIds" }] : /* istanbul ignore next */ []));
901
+ /** `deletedIds` carried by the loaded value, before they mean anything. */
902
+ loadedDeletedIds = signal([], ...(ngDevMode ? [{ debugName: "loadedDeletedIds" }] : /* istanbul ignore next */ []));
903
+ /**
904
+ * Delete intents that apply to the table right now. On a persisted value the
905
+ * loaded `deletedIds` are historical operation markers — the records are
906
+ * already gone — so only this session's removals count. On an unapplied
907
+ * submission they are deletes awaiting approval and must be staged too.
908
+ */
909
+ deletedIds = computed(() => {
910
+ const staged = this.stagedDeletedIds();
911
+ if (!this.pendingSubmission())
912
+ return staged;
913
+ return [...new Set([...this.loadedDeletedIds(), ...staged])];
914
+ }, ...(ngDevMode ? [{ debugName: "deletedIds" }] : /* istanbul ignore next */ []));
893
915
  /** rowId → original form values / option labels (view state only). */
894
916
  rowDrafts = signal({}, ...(ngDevMode ? [{ debugName: "rowDrafts" }] : /* istanbul ignore next */ []));
895
917
  localRowSeq = 0;
@@ -912,7 +934,7 @@ class EntityListField {
912
934
  .filter((row) => !(row.entityId > 0))
913
935
  .map((row) => {
914
936
  const draft = drafts[row.rowId];
915
- return this.buildRow(row.rowId, row.rowId, 0, draft?.values ?? this.toValueMap(row.values), draft?.display ?? {});
937
+ return this.buildRow(row.rowId, row.rowId, 0, draft?.values ?? this.toValueMap(row.values), draft?.display ?? this.toDisplayMap(row.values));
916
938
  });
917
939
  }, ...(ngDevMode ? [{ debugName: "createdRows" }] : /* istanbul ignore next */ []));
918
940
  /** Pending edits of existing rows, keyed by entity id. */
@@ -927,7 +949,7 @@ class EntityListField {
927
949
  const draft = drafts[row.rowId];
928
950
  // A pending update only carries the keys the user changed.
929
951
  const changed = draft?.values ?? this.toValueMap(row.values);
930
- const display = draft?.display ?? {};
952
+ const display = draft?.display ?? this.toDisplayMap(row.values);
931
953
  if (!base) {
932
954
  map.set(row.entityId, this.buildRow(row.entityId, row.rowId, row.entityId, changed, display));
933
955
  continue;
@@ -956,12 +978,23 @@ class EntityListField {
956
978
  return map;
957
979
  }, ...(ngDevMode ? [{ debugName: "editedRowsByEntityId" }] : /* istanbul ignore next */ []));
958
980
  /**
959
- * Rows rendered in the table. In editable write modes, and in a read-only
960
- * Write-only preview, existing rows are merged with pending edits, removed
961
- * rows are hidden, and locally created rows are appended.
981
+ * Whether the table stages pending operations over the loaded records.
982
+ *
983
+ * Editable write modes stage the user's own edits, and a read-only
984
+ * Write-only field has nothing but its stored rows to show. A pending
985
+ * submission stages them too even though it is read-only and `ReadWrite`:
986
+ * an approver reviewing a request has to see what it *will* do to the target
987
+ * module, not the records as they stand.
988
+ */
989
+ showsPendingOperations = computed(() => this.canWrite() ||
990
+ this.accessMode() === 'Write' ||
991
+ this.pendingSubmission(), ...(ngDevMode ? [{ debugName: "showsPendingOperations" }] : /* istanbul ignore next */ []));
992
+ /**
993
+ * Rows rendered in the table: existing rows merged with pending edits,
994
+ * removed rows hidden, and created rows appended.
962
995
  */
963
996
  displayRows = computed(() => {
964
- if (!this.canWrite() && this.accessMode() !== 'Write')
997
+ if (!this.showsPendingOperations())
965
998
  return this.rows();
966
999
  const deleted = new Set(this.deletedIds());
967
1000
  const edited = this.editedRowsByEntityId();
@@ -1034,11 +1067,16 @@ class EntityListField {
1034
1067
  return;
1035
1068
  this.lastEmittedJson = null;
1036
1069
  this.storedValue.set(incoming);
1037
- // Restore rows the backend left unprocessed. `deletedIds` on a loaded
1038
- // value are historical operation markers, not pending intent.
1070
+ // Restore rows the backend left unprocessed. Whether the loaded
1071
+ // `deletedIds` are historical markers or pending intent depends on the
1072
+ // value's provenance, which `deletedIds` resolves from `pendingSubmission`
1073
+ // — an input, so it cannot be read reliably this early.
1039
1074
  const rows = Array.isArray(incoming?.rows) ? incoming.rows : [];
1040
1075
  this.pendingRows.set(rows.filter((row) => !!row && typeof row === 'object'));
1041
- this.deletedIds.set([]);
1076
+ this.loadedDeletedIds.set((Array.isArray(incoming?.deletedIds) ? incoming.deletedIds : [])
1077
+ .map((id) => Number(id))
1078
+ .filter((id) => Number.isFinite(id) && id > 0));
1079
+ this.stagedDeletedIds.set([]);
1042
1080
  this.rowDrafts.set({});
1043
1081
  }
1044
1082
  /**
@@ -1234,7 +1272,7 @@ class EntityListField {
1234
1272
  const rowId = String(row[ROW_ID_KEY] ?? '');
1235
1273
  if (entityId > 0) {
1236
1274
  if (!this.deletedIds().includes(entityId)) {
1237
- this.deletedIds.set([...this.deletedIds(), entityId]);
1275
+ this.stagedDeletedIds.set([...this.stagedDeletedIds(), entityId]);
1238
1276
  }
1239
1277
  // A queued update for a deleted record is pointless — drop it.
1240
1278
  this.pendingRows.set(this.pendingRows().filter((pending) => pending.entityId !== entityId));
@@ -1320,6 +1358,14 @@ class EntityListField {
1320
1358
  * `label` is the resolved option display (present for select-based fields).
1321
1359
  */
1322
1360
  toLocalEntityValue(viewType, raw, label) {
1361
+ // A row loaded from a staged submission carries the backend's resolved
1362
+ // value as its label, and for the rich view types that object *is* what
1363
+ // the renderer binds — the same shape the raw branches below assemble by
1364
+ // hand. A select's resolved option is a plain string and still falls
1365
+ // through to them.
1366
+ const resolved = label != null && typeof label === 'object' && !Array.isArray(label)
1367
+ ? label
1368
+ : null;
1323
1369
  if (viewType === 'User') {
1324
1370
  if (Array.isArray(raw)) {
1325
1371
  const names = raw
@@ -1329,6 +1375,13 @@ class EntityListField {
1329
1375
  .filter((name) => name != null && name !== '');
1330
1376
  return names.length ? { displayName: names.join(', ') } : '';
1331
1377
  }
1378
+ if (resolved) {
1379
+ return {
1380
+ ...resolved,
1381
+ displayName: resolved['displayName'] ?? '',
1382
+ photoUrl: resolved['photoUrl'] ?? resolved['photo'] ?? '',
1383
+ };
1384
+ }
1332
1385
  if (raw && typeof raw === 'object') {
1333
1386
  const user = raw;
1334
1387
  return {
@@ -1344,6 +1397,8 @@ class EntityListField {
1344
1397
  return '';
1345
1398
  }
1346
1399
  if (viewType === 'Status' || viewType === 'Lookup') {
1400
+ if (resolved)
1401
+ return resolved;
1347
1402
  if (raw && typeof raw === 'object')
1348
1403
  return raw;
1349
1404
  if (raw != null && raw !== '' && label != null) {
@@ -1351,6 +1406,8 @@ class EntityListField {
1351
1406
  }
1352
1407
  return raw ?? '';
1353
1408
  }
1409
+ if (resolved)
1410
+ return resolved;
1354
1411
  // Plain / scalar view types: prefer a resolved option label when present,
1355
1412
  // else the raw value (unchanged for text / number / date / percentage).
1356
1413
  if (label != null && (raw == null || typeof raw !== 'object')) {
@@ -1368,7 +1425,16 @@ class EntityListField {
1368
1425
  // and delete intents.
1369
1426
  const next = {
1370
1427
  ...(current ?? {}),
1371
- rows: this.pendingRows(),
1428
+ // `values[].value` is the backend's rendered label, carried only so the
1429
+ // table can print it. Submitting it back would echo a user object where
1430
+ // the stored scalar belongs.
1431
+ rows: this.pendingRows().map((row) => ({
1432
+ ...row,
1433
+ values: (row.values ?? []).map(({ propertyKey, rawValue }) => ({
1434
+ propertyKey,
1435
+ rawValue,
1436
+ })),
1437
+ })),
1372
1438
  deletedIds: this.deletedIds(),
1373
1439
  };
1374
1440
  this.storedValue.set(next);
@@ -1418,6 +1484,23 @@ class EntityListField {
1418
1484
  }
1419
1485
  return map;
1420
1486
  }
1487
+ /**
1488
+ * Backend-resolved display values of a loaded row, keyed like `toValueMap`.
1489
+ *
1490
+ * A row the user just added carries its labels in a `rowDrafts` entry, but a
1491
+ * row that arrived on a loaded value has none — only what the backend
1492
+ * rendered beside each `rawValue`. Without this the approver's table prints
1493
+ * the stored scalar: a bare GUID where the assignee belongs.
1494
+ */
1495
+ toDisplayMap(values) {
1496
+ const map = {};
1497
+ for (const value of values ?? []) {
1498
+ if (!value?.propertyKey || value.value === undefined)
1499
+ continue;
1500
+ map[value.propertyKey] = value.value;
1501
+ }
1502
+ return map;
1503
+ }
1421
1504
  dropEmptyValues(values) {
1422
1505
  const next = {};
1423
1506
  for (const [key, value] of Object.entries(values)) {
@@ -1670,7 +1753,7 @@ class EntityListField {
1670
1753
  };
1671
1754
  }
1672
1755
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityListField, deps: [], target: i0.ɵɵFactoryTarget.Component });
1673
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityListField, isStandalone: true, selector: "mt-entity-list-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, propertyId: { classPropertyName: "propertyId", publicName: "propertyId", isSignal: true, isRequired: false, transformFunction: null }, configuration: { classPropertyName: "configuration", publicName: "configuration", isSignal: true, isRequired: false, transformFunction: null }, runtimeContext: { classPropertyName: "runtimeContext", publicName: "runtimeContext", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "grid gap-1" }, ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\r\n @if (label()) {\r\n <label class=\"font-medium text-color\">\r\n {{ label() }}\r\n @if (required()) {\r\n <span class=\"text-red-500\">*</span>\r\n }\r\n </label>\r\n }\r\n\r\n @if (errorMessage(); as err) {\r\n <p-message severity=\"error\" [text]=\"err\" styleClass=\"w-full\" />\r\n } @else if (canWrite()) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n [label]=\"'components.entityListField.add' | transloco\"\r\n icon=\"general.plus\"\r\n size=\"small\"\r\n [disabled]=\"disabled()\"\r\n (onClick)=\"openAddDialog()\"\r\n />\r\n </div>\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"displayRows()\"\r\n [columns]=\"columns()\"\r\n [rowActions]=\"writeRowActions()\"\r\n dataKey=\"Id\"\r\n [loading]=\"loading()\"\r\n />\r\n } @else if (!canDisplayRows()) {\r\n <div\r\n class=\"rounded border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.readingNotAllowed\" | transloco }}\r\n </div>\r\n } @else if (!hasRequiredContext()) {\r\n <div\r\n class=\"rounded border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.missingConfiguration\" | transloco }}\r\n </div>\r\n } @else if (loading() && !hasRows()) {\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"100%\" height=\"3rem\" />\r\n <p-skeleton width=\"100%\" height=\"3rem\" />\r\n </div>\r\n } @else if (!hasRows()) {\r\n <div\r\n class=\"rounded border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.noRelatedItems\" | transloco }}\r\n </div>\r\n } @else {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"displayRows()\"\r\n [columns]=\"columns()\"\r\n dataKey=\"Id\"\r\n [loading]=\"loading()\"\r\n />\r\n }\r\n\r\n @if (ngControl?.control) {\r\n <mt-field-validation\r\n [control]=\"ngControl?.control!\"\r\n [touched]=\"ngControl?.touched ?? false\"\r\n />\r\n }\r\n</div>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched", "messageId"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "component", type: Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant", "motionOptions"], outputs: ["onClose"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "captionStartTemplate", "captionEndTemplate", "emptyTitle", "emptyDescription", "emptyActionLabel", "emptyActionIcon", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy", "sortField", "sortDirection"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "emptyAction", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange", "sortFieldChange", "sortDirectionChange"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1756
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityListField, isStandalone: true, selector: "mt-entity-list-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, propertyId: { classPropertyName: "propertyId", publicName: "propertyId", isSignal: true, isRequired: false, transformFunction: null }, configuration: { classPropertyName: "configuration", publicName: "configuration", isSignal: true, isRequired: false, transformFunction: null }, runtimeContext: { classPropertyName: "runtimeContext", publicName: "runtimeContext", isSignal: true, isRequired: false, transformFunction: null }, pendingSubmission: { classPropertyName: "pendingSubmission", publicName: "pendingSubmission", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "grid gap-1" }, ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\r\n @if (label()) {\r\n <label class=\"font-medium text-color\">\r\n {{ label() }}\r\n @if (required()) {\r\n <span class=\"text-red-500\">*</span>\r\n }\r\n </label>\r\n }\r\n\r\n @if (errorMessage(); as err) {\r\n <p-message severity=\"error\" [text]=\"err\" styleClass=\"w-full\" />\r\n } @else if (canWrite()) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n [label]=\"'components.entityListField.add' | transloco\"\r\n icon=\"general.plus\"\r\n size=\"small\"\r\n [disabled]=\"disabled()\"\r\n (onClick)=\"openAddDialog()\"\r\n />\r\n </div>\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"displayRows()\"\r\n [columns]=\"columns()\"\r\n [rowActions]=\"writeRowActions()\"\r\n dataKey=\"Id\"\r\n [loading]=\"loading()\"\r\n />\r\n } @else if (!canDisplayRows()) {\r\n <div\r\n class=\"rounded border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.readingNotAllowed\" | transloco }}\r\n </div>\r\n } @else if (!hasRequiredContext()) {\r\n <div\r\n class=\"rounded border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.missingConfiguration\" | transloco }}\r\n </div>\r\n } @else if (loading() && !hasRows()) {\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"100%\" height=\"3rem\" />\r\n <p-skeleton width=\"100%\" height=\"3rem\" />\r\n </div>\r\n } @else if (!hasRows()) {\r\n <div\r\n class=\"rounded border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.noRelatedItems\" | transloco }}\r\n </div>\r\n } @else {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"displayRows()\"\r\n [columns]=\"columns()\"\r\n dataKey=\"Id\"\r\n [loading]=\"loading()\"\r\n />\r\n }\r\n\r\n @if (ngControl?.control) {\r\n <mt-field-validation\r\n [control]=\"ngControl?.control!\"\r\n [touched]=\"ngControl?.touched ?? false\"\r\n />\r\n }\r\n</div>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched", "messageId"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "component", type: Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant", "motionOptions"], outputs: ["onClose"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "captionStartTemplate", "captionEndTemplate", "emptyTitle", "emptyDescription", "emptyActionLabel", "emptyActionIcon", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy", "sortField", "sortDirection"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "emptyAction", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange", "sortFieldChange", "sortDirectionChange"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1674
1757
  }
1675
1758
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityListField, decorators: [{
1676
1759
  type: Component,
@@ -1683,7 +1766,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
1683
1766
  Button,
1684
1767
  TranslocoPipe,
1685
1768
  ], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'grid gap-1' }, template: "<div class=\"flex flex-col gap-2\">\r\n @if (label()) {\r\n <label class=\"font-medium text-color\">\r\n {{ label() }}\r\n @if (required()) {\r\n <span class=\"text-red-500\">*</span>\r\n }\r\n </label>\r\n }\r\n\r\n @if (errorMessage(); as err) {\r\n <p-message severity=\"error\" [text]=\"err\" styleClass=\"w-full\" />\r\n } @else if (canWrite()) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n [label]=\"'components.entityListField.add' | transloco\"\r\n icon=\"general.plus\"\r\n size=\"small\"\r\n [disabled]=\"disabled()\"\r\n (onClick)=\"openAddDialog()\"\r\n />\r\n </div>\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"displayRows()\"\r\n [columns]=\"columns()\"\r\n [rowActions]=\"writeRowActions()\"\r\n dataKey=\"Id\"\r\n [loading]=\"loading()\"\r\n />\r\n } @else if (!canDisplayRows()) {\r\n <div\r\n class=\"rounded border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.readingNotAllowed\" | transloco }}\r\n </div>\r\n } @else if (!hasRequiredContext()) {\r\n <div\r\n class=\"rounded border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.missingConfiguration\" | transloco }}\r\n </div>\r\n } @else if (loading() && !hasRows()) {\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"100%\" height=\"3rem\" />\r\n <p-skeleton width=\"100%\" height=\"3rem\" />\r\n </div>\r\n } @else if (!hasRows()) {\r\n <div\r\n class=\"rounded border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.noRelatedItems\" | transloco }}\r\n </div>\r\n } @else {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"displayRows()\"\r\n [columns]=\"columns()\"\r\n dataKey=\"Id\"\r\n [loading]=\"loading()\"\r\n />\r\n }\r\n\r\n @if (ngControl?.control) {\r\n <mt-field-validation\r\n [control]=\"ngControl?.control!\"\r\n [touched]=\"ngControl?.touched ?? false\"\r\n />\r\n }\r\n</div>\r\n", styles: [":host{display:block}\n"] }]
1686
- }], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], propertyId: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyId", required: false }] }], configuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "configuration", required: false }] }], runtimeContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "runtimeContext", required: false }] }], lookups: [{ type: i0.Input, args: [{ isSignal: true, alias: "lookups", required: false }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: false }] }] } });
1769
+ }], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], propertyId: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyId", required: false }] }], configuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "configuration", required: false }] }], runtimeContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "runtimeContext", required: false }] }], pendingSubmission: [{ type: i0.Input, args: [{ isSignal: true, alias: "pendingSubmission", required: false }] }], lookups: [{ type: i0.Input, args: [{ isSignal: true, alias: "lookups", required: false }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: false }] }] } });
1687
1770
 
1688
1771
  /** Page size when loading the full deliverable list, and a hard safety cap. */
1689
1772
  const PAGE_SIZE = 100;