@masterteam/components 0.0.285 → 0.0.287

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.
@@ -119,7 +119,7 @@
119
119
  "edit": "تعديل",
120
120
  "delete": "حذف",
121
121
  "readingNotAllowed": "القراءة غير مسموح بها لهذا الحقل.",
122
- "saveFormFirst": "احفظ النموذج أولاً لإدارة العناصر المرتبطة.",
122
+ "missingConfiguration": "لم يتم إعداد هذا الحقل بالكامل.",
123
123
  "noRelatedItems": "لا توجد عناصر مرتبطة.",
124
124
  "loadFailed": "فشل تحميل العناصر المرتبطة"
125
125
  },
@@ -119,7 +119,7 @@
119
119
  "edit": "Edit",
120
120
  "delete": "Delete",
121
121
  "readingNotAllowed": "Reading is not allowed for this field.",
122
- "saveFormFirst": "Save the form first to manage related items.",
122
+ "missingConfiguration": "This field is not fully configured.",
123
123
  "noRelatedItems": "No related items.",
124
124
  "loadFailed": "Failed to load related items"
125
125
  },
@@ -161,6 +161,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
161
161
  }, template: "@if (config().label) {\r\n <label class=\"font-medium text-color\">\r\n {{ config().label }}\r\n </label>\r\n}\r\n\r\n<div\r\n class=\"rounded-lg border border-surface-200 bg-surface-50 px-3 flex items-center\"\r\n>\r\n @if (activeCell(); as cell) {\r\n <div class=\"flex flex-1 min-h-6 items-center gap-2 justify-between\">\r\n <span\r\n class=\"h-6 w-2 shrink-0 rounded-[2px] border border-surface-200\"\r\n [style.background-color]=\"getSwatchColor(cell.color)\"\r\n [style.border-color]=\"getSwatchColor(cell.color)\"\r\n ></span>\r\n\r\n <div class=\"min-w-0 flex-1 py-2 flex items-center justify-between\">\r\n <div class=\"truncate font-semibold text-gray-500\">\r\n {{ cell.label }}\r\n </div>\r\n\r\n @if (selectionSummary()) {\r\n <div class=\"font-bold text-gray-500\">\r\n <mt-icon\r\n [mtTooltip]=\"selectionSummary()\"\r\n icon=\"general.info-circle\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n } @else {\r\n <div class=\"flex min-h-6 items-center text-muted-color py-2\">\r\n {{ hasMatrix() ? missingResultMessage() : config().emptyMessage }}\r\n </div>\r\n }\r\n</div>\r\n" }]
162
162
  }], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }] } });
163
163
 
164
+ /**
165
+ * Read a control value as a payload, accepting the serialized JSON string a
166
+ * form load can patch in. {@link SchemaConnectionField.writeValue} and the
167
+ * required validator must agree on this: while only `writeValue` parsed, a
168
+ * string-valued connection rendered as filled but validated as empty.
169
+ */
170
+ function parseConnectionPayload(value) {
171
+ if (typeof value === 'string') {
172
+ const trimmed = value.trim();
173
+ if (!trimmed)
174
+ return null;
175
+ try {
176
+ const parsed = JSON.parse(trimmed);
177
+ return parsed && typeof parsed === 'object'
178
+ ? parsed
179
+ : null;
180
+ }
181
+ catch {
182
+ return null;
183
+ }
184
+ }
185
+ return value ?? null;
186
+ }
164
187
  class SchemaConnectionField {
165
188
  // ============================================================================
166
189
  // Inputs
@@ -208,7 +231,7 @@ class SchemaConnectionField {
208
231
  * collapses a source-less selection to `null`.
209
232
  */
210
233
  connectionRequiredValidator = (control) => {
211
- const value = control.value;
234
+ const value = parseConnectionPayload(control.value);
212
235
  const hasSources = !!value && Array.isArray(value.sources) && value.sources.length > 0;
213
236
  return hasSources ? null : { required: true };
214
237
  };
@@ -436,16 +459,9 @@ class SchemaConnectionField {
436
459
  // ControlValueAccessor
437
460
  // ============================================================================
438
461
  writeValue(value) {
439
- if (typeof value === 'string') {
440
- try {
441
- value = JSON.parse(value);
442
- }
443
- catch {
444
- value = null;
445
- }
446
- }
447
- this.value.set(value ?? null);
448
- this.distributeToSelections(value ?? null);
462
+ const payload = parseConnectionPayload(value);
463
+ this.value.set(payload);
464
+ this.distributeToSelections(payload);
449
465
  }
450
466
  registerOnChange(fn) {
451
467
  this.onModelChange = fn;
@@ -918,13 +934,13 @@ class EntityListField {
918
934
  return [...existing, ...this.createdRows()];
919
935
  }, ...(ngDevMode ? [{ debugName: "displayRows" }] : /* istanbul ignore next */ []));
920
936
  hasRows = computed(() => this.displayRows().length > 0, ...(ngDevMode ? [{ debugName: "hasRows" }] : /* istanbul ignore next */ []));
921
- hasRequiredContext = computed(() => this.levelId() != null &&
922
- this.levelDataId() != null &&
923
- this.moduleId() != null &&
937
+ hasRequiredContext = computed(() => Number(this.levelId()) > 0 &&
938
+ Number(this.moduleId()) > 0 &&
924
939
  this.readFields().length > 0, ...(ngDevMode ? [{ debugName: "hasRequiredContext" }] : /* istanbul ignore next */ []));
925
940
  onTouched = () => { };
926
941
  onModelChange = () => { };
927
942
  http = inject(HttpClient);
943
+ fetchSubscription;
928
944
  destroyRef = inject(DestroyRef);
929
945
  modal = inject(ModalService);
930
946
  transloco = inject(TranslocoService);
@@ -940,8 +956,8 @@ class EntityListField {
940
956
  if (this.ngControl) {
941
957
  this.ngControl.valueAccessor = this;
942
958
  }
943
- // Trigger fetch when context inputs change. Columns always come from
944
- // /api/fetch/query; records are kept whenever access allows reading.
959
+ // Draft parents load column metadata only. Persisted parents load the
960
+ // Table projection, scoped to their record ID.
945
961
  effect(() => {
946
962
  const allowedRead = this.canRead();
947
963
  const allowedWrite = this.writeAllowed();
@@ -951,17 +967,22 @@ class EntityListField {
951
967
  const moduleId = this.moduleId();
952
968
  const readFields = this.readFields();
953
969
  untracked(() => {
970
+ this.fetchSubscription?.unsubscribe();
971
+ this.columns.set([]);
972
+ this.rows.set([]);
973
+ this.errorMessage.set(null);
954
974
  if ((!allowedRead && !allowedWrite) ||
955
975
  !ready ||
956
976
  levelId == null ||
957
- levelDataId == null ||
958
977
  moduleId == null) {
959
- this.columns.set([]);
960
- this.rows.set([]);
961
- this.errorMessage.set(null);
962
978
  return;
963
979
  }
964
- this.fetchRows(levelId, levelDataId, moduleId, readFields);
980
+ if (levelDataId == null || Number(levelDataId) <= 0 || !allowedRead) {
981
+ this.fetchDraftColumns(levelId, moduleId, readFields);
982
+ }
983
+ else {
984
+ this.fetchRows(levelId, levelDataId, moduleId, readFields);
985
+ }
965
986
  });
966
987
  });
967
988
  }
@@ -1381,6 +1402,37 @@ class EntityListField {
1381
1402
  // ============================================================================
1382
1403
  // Read endpoint — POST /api/fetch/query (Table projection)
1383
1404
  // ============================================================================
1405
+ fetchDraftColumns(levelId, moduleId, propertyKeys) {
1406
+ this.loading.set(true);
1407
+ const ctx = this.context();
1408
+ this.fetchSubscription = this.http
1409
+ .get('fetch/catalog', {
1410
+ params: { contextKey: `level:${levelId}/module:${moduleId}` },
1411
+ ...(ctx ? { context: ctx } : {}),
1412
+ })
1413
+ .pipe(takeUntilDestroyed(this.destroyRef), finalize(() => this.loading.set(false)))
1414
+ .subscribe({
1415
+ next: (response) => {
1416
+ const properties = response.data.properties.filter((property) => propertyKeys.includes(property.key) ||
1417
+ propertyKeys.includes(property.normalizedKey));
1418
+ this.applyResponse({
1419
+ catalog: { properties },
1420
+ records: [],
1421
+ projectionMeta: {
1422
+ columns: properties.map((property) => ({
1423
+ key: property.normalizedKey || property.key,
1424
+ label: property.label,
1425
+ viewType: property.viewType,
1426
+ order: property.order,
1427
+ visible: true,
1428
+ configuration: property.configuration ?? null,
1429
+ })),
1430
+ },
1431
+ });
1432
+ },
1433
+ error: () => this.errorMessage.set(this.transloco.translate('components.entityListField.loadFailed')),
1434
+ });
1435
+ }
1384
1436
  fetchRows(levelId, levelDataId, moduleId, propertyKeys) {
1385
1437
  this.loading.set(true);
1386
1438
  this.errorMessage.set(null);
@@ -1400,7 +1452,7 @@ class EntityListField {
1400
1452
  page: 1,
1401
1453
  pageSize: 3000,
1402
1454
  };
1403
- this.http
1455
+ this.fetchSubscription = this.http
1404
1456
  .post('fetch/query', body, ctx ? { context: ctx } : {})
1405
1457
  .pipe(takeUntilDestroyed(this.destroyRef), finalize(() => this.loading.set(false)), catchError((err) => {
1406
1458
  console.error('EntityList fetch/query failed', err);
@@ -1486,7 +1538,7 @@ class EntityListField {
1486
1538
  };
1487
1539
  }
1488
1540
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityListField, deps: [], target: i0.ɵɵFactoryTarget.Component });
1489
- 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 (!canRead()) {\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.saveFormFirst\" | 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 });
1541
+ 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 (!canRead()) {\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 });
1490
1542
  }
1491
1543
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityListField, decorators: [{
1492
1544
  type: Component,
@@ -1498,7 +1550,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
1498
1550
  Table,
1499
1551
  Button,
1500
1552
  TranslocoPipe,
1501
- ], 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 (!canRead()) {\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.saveFormFirst\" | 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"] }]
1553
+ ], 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 (!canRead()) {\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"] }]
1502
1554
  }], 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 }] }] } });
1503
1555
 
1504
1556
  /** Page size when loading the full deliverable list, and a hard safety cap. */