@masterteam/components 0.0.303 → 0.0.304

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.
@@ -1924,11 +1924,17 @@ function buildLocalRows(document, data, allowed, lang) {
1924
1924
  order: field.order,
1925
1925
  };
1926
1926
  });
1927
- const [first, ...rest] = rendered;
1927
+ // The title names the row, and it renders without its label. The first
1928
+ // field of a Local list is whatever the field manager put first — often a
1929
+ // progress bar or a date, which as a bare headline reads as the row's
1930
+ // name. So the title is the first filled text field; everything else keeps
1931
+ // its label, in schema order. A row with no text to name it has no title.
1932
+ const titleIndex = rendered.findIndex(isRowNameField);
1933
+ const title = titleIndex >= 0 ? rendered[titleIndex] : null;
1928
1934
  return {
1929
1935
  id: row.rowId,
1930
- title: first ? { ...first, configuration: TITLE_FIELD_CONFIG } : null,
1931
- fields: rest,
1936
+ title: title ? { ...title, configuration: TITLE_FIELD_CONFIG } : null,
1937
+ fields: rendered.filter((_, index) => index !== titleIndex),
1932
1938
  };
1933
1939
  });
1934
1940
  }
@@ -1966,8 +1972,7 @@ function buildSelectionRows(document, data, allowed) {
1966
1972
  .map((item, index) => ({
1967
1973
  key: item.propertyKey,
1968
1974
  name: humanizeEntityListKey(item.propertyKey),
1969
- viewType: 'Text',
1970
- value: selectionDisplayText(item.value, item.rawValue),
1975
+ ...selectionCell(item.value, item.rawValue),
1971
1976
  rawValue: item.rawValue ?? undefined,
1972
1977
  configuration: NESTED_FIELD_CONFIG,
1973
1978
  order: index,
@@ -1994,6 +1999,26 @@ function readConfiguredReadFields(data) {
1994
1999
  }
1995
2000
  return [];
1996
2001
  }
2002
+ /** An ISO date or date-time, as the backend renders a Date / DateTime value. */
2003
+ const ISO_DATE = /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/;
2004
+ /**
2005
+ * How one Selected cell renders without field metadata — a table cell has
2006
+ * none to ask for. The rendered value's own shape decides: an ISO date is a
2007
+ * `Date` (printed `2026/09/20`, not `2026-09-20T00:00:00.0000000Z`), a user
2008
+ * object a `User`, and everything else its display text.
2009
+ */
2010
+ function selectionCell(value, rawValue) {
2011
+ if (typeof value === 'string' && ISO_DATE.test(value.trim())) {
2012
+ return { viewType: 'Date', value: value.trim() };
2013
+ }
2014
+ if (value &&
2015
+ typeof value === 'object' &&
2016
+ !Array.isArray(value) &&
2017
+ typeof value['displayName'] === 'string') {
2018
+ return { viewType: 'User', value: value };
2019
+ }
2020
+ return { viewType: 'Text', value: selectionDisplayText(value, rawValue) };
2021
+ }
1997
2022
  /**
1998
2023
  * A rendered source value as text: a scalar as is, a user or a lookup by its
1999
2024
  * display name, a list joined. Falls back to the stored scalar.
@@ -2017,6 +2042,14 @@ function selectionDisplayText(value, rawValue) {
2017
2042
  }
2018
2043
  return rawValue ?? '';
2019
2044
  }
2045
+ /** A text field with a value — something that can name a row. */
2046
+ function isRowNameField(entity) {
2047
+ if (entity.viewType !== 'Text' && entity.viewType !== 'LongText') {
2048
+ return false;
2049
+ }
2050
+ const value = entity.value;
2051
+ return typeof value === 'string' ? value.trim().length > 0 : value != null;
2052
+ }
2020
2053
  /** The active Local schema from the property configuration, if any. */
2021
2054
  function readConfiguredLocalSchema(data) {
2022
2055
  for (const source of [data.propertyConfiguration, data.configuration]) {
@@ -2246,25 +2279,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
2246
2279
  * and a checklist of fifteen made the grid unreadable. The drawer has the
2247
2280
  * width and height this content actually needs.
2248
2281
  *
2282
+ * With a `table` it renders the list the way a record preview does — the
2283
+ * read-only `mt-entity-list-field`, with its columns, typed cells and access
2284
+ * notices — for a table cell whose host knew the record's runtime ids.
2285
+ * Otherwise it renders the rows the value itself carries.
2286
+ *
2249
2287
  * Created through `ModalService`, so its inputs arrive via `inputValues` and
2250
2288
  * it is built with the **root** injector — nothing route-provided is visible
2251
- * here, which is why it takes the already-resolved entity rather than looking
2252
- * anything up.
2289
+ * here, which is why it takes the already-resolved entity and table rather
2290
+ * than looking anything up.
2253
2291
  */
2254
2292
  class EntityListDrawer {
2255
2293
  data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
2256
2294
  /** Ordered allowlist of nested field keys; empty renders all of them. */
2257
2295
  fields = input([], ...(ngDevMode ? [{ debugName: "fields" }] : /* istanbul ignore next */ []));
2296
+ /** The list's table, when the opener could build one; see above. */
2297
+ table = input(null, ...(ngDevMode ? [{ debugName: "table" }] : /* istanbul ignore next */ []));
2258
2298
  /** A Local list's labels are `{ en, ar }` pairs; see `sharedActiveLang`. */
2259
2299
  activeLang = sharedActiveLang(inject(TranslocoService));
2260
2300
  rows = computed(() => buildEntityListRows(this.data(), this.fields(), this.activeLang()), ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
2261
2301
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityListDrawer, deps: [], target: i0.ɵɵFactoryTarget.Component });
2262
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityListDrawer, isStandalone: true, selector: "mt-entity-list-drawer", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block h-full" }, ngImport: i0, template: "<!--\n Owns its scroll rather than taking the shared `mt-modal-content` shell: that\n class reserves 60px for a footer, and this drawer is read-only and has none,\n so it would leave a dead strip at the bottom. `h-full` chains off the host's,\n which chains off `.p-drawer-content` \u2014 the one definite height here.\n-->\n<div class=\"flex h-full flex-col gap-2 overflow-auto p-5\">\n @for (row of rows(); track row.id) {\n <div class=\"rounded-md border border-surface-200 bg-surface-50 px-3 py-2.5\">\n @if (row.title; as title) {\n <div class=\"min-w-0 text-sm font-medium text-color\">\n <mt-entity-value-preview [data]=\"title\" attachmentShape=\"compact\" />\n </div>\n }\n\n @if (row.fields.length) {\n <!--\n The drawer has room the cell did not, so fields get a real grid with\n their labels instead of being crushed onto one wrapping line.\n `auto-fill` adapts to the drawer's actual width without a container\n query, and the `min()` floor keeps a narrow drawer from being forced\n wider than the viewport.\n -->\n <div\n class=\"mt-2 grid gap-x-4 gap-y-3 [grid-template-columns:repeat(auto-fill,minmax(min(9rem,100%),1fr))]\"\n >\n @for (field of row.fields; track field.key) {\n <div class=\"min-w-0 overflow-hidden\">\n <mt-entity-value-preview\n [data]=\"field\"\n attachmentShape=\"compact\"\n />\n </div>\n }\n </div>\n }\n </div>\n }\n</div>\n", dependencies: [{ kind: "component", type: EntityValuePreview, selector: "mt-entity-value-preview", inputs: ["data", "attachmentShape"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2302
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityListDrawer, isStandalone: true, selector: "mt-entity-list-drawer", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null }, table: { classPropertyName: "table", publicName: "table", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block h-full" }, ngImport: i0, template: "<!--\n Owns its scroll rather than taking the shared `mt-modal-content` shell: that\n class reserves 60px for a footer, and this drawer is read-only and has none,\n so it would leave a dead strip at the bottom. `h-full` chains off the host's,\n which chains off `.p-drawer-content` \u2014 the one definite height here.\n-->\n<div class=\"flex h-full flex-col gap-2 overflow-auto p-5\">\n @if (table(); as host) {\n <!--\n The list as a record preview renders it: the read-only\n `mt-entity-list-field`, through the component the opener handed over \u2014\n it cannot be imported here without a circular entry point.\n -->\n <ng-container\n *ngComponentOutlet=\"host.component; inputs: host.inputs\"\n ></ng-container>\n } @else {\n @for (row of rows(); track row.id) {\n <div\n class=\"rounded-md border border-surface-200 bg-surface-50 px-3 py-2.5\"\n >\n @if (row.title; as title) {\n <div class=\"min-w-0 text-sm font-medium text-color\">\n <mt-entity-value-preview [data]=\"title\" attachmentShape=\"compact\" />\n </div>\n }\n\n @if (row.fields.length) {\n <!--\n The drawer has room the cell did not, so fields get a real grid with\n their labels instead of being crushed onto one wrapping line.\n `auto-fill` adapts to the drawer's actual width without a container\n query, and the `min()` floor keeps a narrow drawer from being forced\n wider than the viewport.\n -->\n <div\n class=\"mt-2 grid gap-x-4 gap-y-3 [grid-template-columns:repeat(auto-fill,minmax(min(9rem,100%),1fr))]\"\n >\n @for (field of row.fields; track field.key) {\n <div class=\"min-w-0 overflow-hidden\">\n <mt-entity-value-preview\n [data]=\"field\"\n attachmentShape=\"compact\"\n />\n </div>\n }\n </div>\n }\n </div>\n }\n }\n</div>\n", dependencies: [{ kind: "component", type: EntityValuePreview, selector: "mt-entity-value-preview", inputs: ["data", "attachmentShape"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2263
2303
  }
2264
2304
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityListDrawer, decorators: [{
2265
2305
  type: Component,
2266
- args: [{ selector: 'mt-entity-list-drawer', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityValuePreview], host: { class: 'block h-full' }, template: "<!--\n Owns its scroll rather than taking the shared `mt-modal-content` shell: that\n class reserves 60px for a footer, and this drawer is read-only and has none,\n so it would leave a dead strip at the bottom. `h-full` chains off the host's,\n which chains off `.p-drawer-content` \u2014 the one definite height here.\n-->\n<div class=\"flex h-full flex-col gap-2 overflow-auto p-5\">\n @for (row of rows(); track row.id) {\n <div class=\"rounded-md border border-surface-200 bg-surface-50 px-3 py-2.5\">\n @if (row.title; as title) {\n <div class=\"min-w-0 text-sm font-medium text-color\">\n <mt-entity-value-preview [data]=\"title\" attachmentShape=\"compact\" />\n </div>\n }\n\n @if (row.fields.length) {\n <!--\n The drawer has room the cell did not, so fields get a real grid with\n their labels instead of being crushed onto one wrapping line.\n `auto-fill` adapts to the drawer's actual width without a container\n query, and the `min()` floor keeps a narrow drawer from being forced\n wider than the viewport.\n -->\n <div\n class=\"mt-2 grid gap-x-4 gap-y-3 [grid-template-columns:repeat(auto-fill,minmax(min(9rem,100%),1fr))]\"\n >\n @for (field of row.fields; track field.key) {\n <div class=\"min-w-0 overflow-hidden\">\n <mt-entity-value-preview\n [data]=\"field\"\n attachmentShape=\"compact\"\n />\n </div>\n }\n </div>\n }\n </div>\n }\n</div>\n" }]
2267
- }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], fields: [{ type: i0.Input, args: [{ isSignal: true, alias: "fields", required: false }] }] } });
2306
+ args: [{ selector: 'mt-entity-list-drawer', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityValuePreview, NgComponentOutlet], host: { class: 'block h-full' }, template: "<!--\n Owns its scroll rather than taking the shared `mt-modal-content` shell: that\n class reserves 60px for a footer, and this drawer is read-only and has none,\n so it would leave a dead strip at the bottom. `h-full` chains off the host's,\n which chains off `.p-drawer-content` \u2014 the one definite height here.\n-->\n<div class=\"flex h-full flex-col gap-2 overflow-auto p-5\">\n @if (table(); as host) {\n <!--\n The list as a record preview renders it: the read-only\n `mt-entity-list-field`, through the component the opener handed over \u2014\n it cannot be imported here without a circular entry point.\n -->\n <ng-container\n *ngComponentOutlet=\"host.component; inputs: host.inputs\"\n ></ng-container>\n } @else {\n @for (row of rows(); track row.id) {\n <div\n class=\"rounded-md border border-surface-200 bg-surface-50 px-3 py-2.5\"\n >\n @if (row.title; as title) {\n <div class=\"min-w-0 text-sm font-medium text-color\">\n <mt-entity-value-preview [data]=\"title\" attachmentShape=\"compact\" />\n </div>\n }\n\n @if (row.fields.length) {\n <!--\n The drawer has room the cell did not, so fields get a real grid with\n their labels instead of being crushed onto one wrapping line.\n `auto-fill` adapts to the drawer's actual width without a container\n query, and the `min()` floor keeps a narrow drawer from being forced\n wider than the viewport.\n -->\n <div\n class=\"mt-2 grid gap-x-4 gap-y-3 [grid-template-columns:repeat(auto-fill,minmax(min(9rem,100%),1fr))]\"\n >\n @for (field of row.fields; track field.key) {\n <div class=\"min-w-0 overflow-hidden\">\n <mt-entity-value-preview\n [data]=\"field\"\n attachmentShape=\"compact\"\n />\n </div>\n }\n </div>\n }\n </div>\n }\n }\n</div>\n" }]
2307
+ }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], fields: [{ type: i0.Input, args: [{ isSignal: true, alias: "fields", required: false }] }], table: [{ type: i0.Input, args: [{ isSignal: true, alias: "table", required: false }] }] } });
2268
2308
 
2269
2309
  /** Rows named in the tooltip before it collapses into "+N more". */
2270
2310
  const TOOLTIP_ROW_LIMIT = 6;
@@ -2363,11 +2403,19 @@ class EntityListPreview {
2363
2403
  * re-applies inputs on identity change — a fresh object per change-detection
2364
2404
  * pass would re-write every input on every tick.
2365
2405
  */
2366
- tableHost = computed(() => {
2406
+ tableHost = computed(() => this.buildTableHost(this.runtimeContextStore?.context() ?? null), ...(ngDevMode ? [{ debugName: "tableHost" }] : /* istanbul ignore next */ []));
2407
+ /**
2408
+ * The same table, for the drawer of a table cell. A cell publishes no
2409
+ * runtime context — an inline table would set the height of every row — but
2410
+ * a host that knows the record's ids puts them on the value
2411
+ * (`EntityData.runtimeContext`), and the drawer then shows the list exactly
2412
+ * as a record preview does, instead of the value-only rows.
2413
+ */
2414
+ drawerTable = computed(() => this.tableHost() ? null : this.buildTableHost(this.data().runtimeContext), ...(ngDevMode ? [{ debugName: "drawerTable" }] : /* istanbul ignore next */ []));
2415
+ buildTableHost(context) {
2367
2416
  const component = this.tableComponent;
2368
2417
  if (!component || !this.moduleBacked())
2369
2418
  return null;
2370
- const context = this.runtimeContextStore?.context() ?? null;
2371
2419
  if (!context || !(Number(context.levelId) > 0))
2372
2420
  return null;
2373
2421
  const data = this.data();
@@ -2390,7 +2438,29 @@ class EntityListPreview {
2390
2438
  label: '',
2391
2439
  },
2392
2440
  };
2393
- }, ...(ngDevMode ? [{ debugName: "tableHost" }] : /* istanbul ignore next */ []));
2441
+ }
2442
+ /**
2443
+ * Whether the value itself holds the list's rows — a Local or Selected
2444
+ * document. A Related list's value is membership and evidence only; its
2445
+ * rows are read by the table, so its cell does not claim a count.
2446
+ */
2447
+ valueHoldsRows = computed(() => {
2448
+ const value = this.data().value;
2449
+ return (isEntityListLocalDocument(value) || isEntityListSelectionDocument(value));
2450
+ }, ...(ngDevMode ? [{ debugName: "valueHoldsRows" }] : /* istanbul ignore next */ []));
2451
+ /** The trigger shows when there are rows to count, or a table to open. */
2452
+ showTrigger = computed(() => this.hasRows() || !!this.drawerTable(), ...(ngDevMode ? [{ debugName: "showTrigger" }] : /* istanbul ignore next */ []));
2453
+ /**
2454
+ * The trigger's label: the row count when the value holds the rows, else
2455
+ * "View" — a Related list's saved membership is not what its table shows,
2456
+ * so it is not presented as a count.
2457
+ */
2458
+ triggerLabel = computed(() => {
2459
+ this.activeLang();
2460
+ return this.valueHoldsRows() || !this.drawerTable()
2461
+ ? this.count().toString()
2462
+ : this.viewLabel();
2463
+ }, ...(ngDevMode ? [{ debugName: "triggerLabel" }] : /* istanbul ignore next */ []));
2394
2464
  /**
2395
2465
  * An empty list reads as the standard empty value, not as a sentence — this
2396
2466
  * sits in a table cell, where a "no related items" line would be louder than
@@ -2404,7 +2474,10 @@ class EntityListPreview {
2404
2474
  */
2405
2475
  ariaLabel = computed(() => {
2406
2476
  this.activeLang();
2407
- return `${this.viewLabel()} (${this.count()})`;
2477
+ const label = this.triggerLabel();
2478
+ return label === this.viewLabel()
2479
+ ? label
2480
+ : `${this.viewLabel()} (${label})`;
2408
2481
  }, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
2409
2482
  /**
2410
2483
  * Names the rows, so the cell answers "which ones?" on hover. Falls back to
@@ -2447,23 +2520,26 @@ class EntityListPreview {
2447
2520
  return this.transloco.translate('components.entityListPreview.view');
2448
2521
  }
2449
2522
  openDrawer() {
2523
+ const table = this.drawerTable();
2450
2524
  this.modal.openModal(EntityListDrawer, 'drawer', {
2451
2525
  header: this.label() || undefined,
2452
2526
  position: 'end',
2453
- styleClass: '!w-[34rem] max-w-[96vw]',
2527
+ // A table needs the width a stack of rows does not.
2528
+ styleClass: table ? '!w-[60rem] max-w-[96vw]' : '!w-[34rem] max-w-[96vw]',
2454
2529
  dismissableMask: true,
2455
2530
  inputValues: {
2456
2531
  data: this.data(),
2457
2532
  fields: this.fields(),
2533
+ table,
2458
2534
  },
2459
2535
  });
2460
2536
  }
2461
2537
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityListPreview, deps: [], target: i0.ɵɵFactoryTarget.Component });
2462
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityListPreview, isStandalone: true, selector: "mt-entity-list-preview", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\r\n [label]=\"label()\"\r\n [configuration]=\"data().configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (tableHost(); as host) {\r\n <!--\r\n The related records, rendered in full by the read-only\r\n `mt-entity-list-field`. It owns the metadata request, the access notices\r\n and the column projection \u2014 see `ENTITY_LIST_TABLE_COMPONENT` for why it\r\n arrives through an outlet rather than an import.\r\n -->\r\n <ng-container\r\n *ngComponentOutlet=\"host.component; inputs: host.inputs\"\r\n ></ng-container>\r\n } @else if (hasRows()) {\r\n <!--\r\n The count carries the information; the button carries the affordance.\r\n `mt-button` owns the tooltip and the accessible name, so the trigger is\r\n one element rather than a button wrapped in a tooltip host.\r\n -->\r\n <mt-button\r\n icon=\"general.eye\"\r\n [label]=\"count().toString()\"\r\n [tooltip]=\"tooltip()\"\r\n [ariaLabel]=\"ariaLabel()\"\r\n variant=\"text\"\r\n size=\"small\"\r\n styleClass=\"!px-2 !py-1 !gap-1\"\r\n (onClick)=\"openDrawer()\"\r\n />\r\n } @else {\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md bg-surface-100 px-3 py-2 text-xs font-semibold text-muted-color\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }, { 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: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2538
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityListPreview, isStandalone: true, selector: "mt-entity-list-preview", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mt-entity-field\n [label]=\"label()\"\n [configuration]=\"data().configuration\"\n gap=\"normal\"\n>\n @if (tableHost(); as host) {\n <!--\n The related records, rendered in full by the read-only\n `mt-entity-list-field`. It owns the metadata request, the access notices\n and the column projection \u2014 see `ENTITY_LIST_TABLE_COMPONENT` for why it\n arrives through an outlet rather than an import.\n -->\n <ng-container\n *ngComponentOutlet=\"host.component; inputs: host.inputs\"\n ></ng-container>\n } @else if (showTrigger()) {\n <!--\n The count carries the information; the button carries the affordance.\n `mt-button` owns the tooltip and the accessible name, so the trigger is\n one element rather than a button wrapped in a tooltip host. A Related\n list opened as a table says \"View\" instead of a count; see\n `triggerLabel`.\n -->\n <mt-button\n icon=\"general.eye\"\n [label]=\"triggerLabel()\"\n [tooltip]=\"tooltip()\"\n [ariaLabel]=\"ariaLabel()\"\n variant=\"text\"\n size=\"small\"\n styleClass=\"!px-2 !py-1 !gap-1\"\n (onClick)=\"openDrawer()\"\n />\n } @else {\n <span\n class=\"inline-flex w-fit items-center rounded-md bg-surface-100 px-3 py-2 text-xs font-semibold text-muted-color\"\n >\n {{ emptyLabel }}\n </span>\n }\n</mt-entity-field>\n", dependencies: [{ kind: "component", type: EntityField, selector: "mt-entity-field", inputs: ["label", "labelIconName", "configuration", "gap"] }, { 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: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2463
2539
  }
2464
2540
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityListPreview, decorators: [{
2465
2541
  type: Component,
2466
- args: [{ selector: 'mt-entity-list-preview', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityField, Button, NgComponentOutlet], template: "<mt-entity-field\r\n [label]=\"label()\"\r\n [configuration]=\"data().configuration\"\r\n gap=\"normal\"\r\n>\r\n @if (tableHost(); as host) {\r\n <!--\r\n The related records, rendered in full by the read-only\r\n `mt-entity-list-field`. It owns the metadata request, the access notices\r\n and the column projection \u2014 see `ENTITY_LIST_TABLE_COMPONENT` for why it\r\n arrives through an outlet rather than an import.\r\n -->\r\n <ng-container\r\n *ngComponentOutlet=\"host.component; inputs: host.inputs\"\r\n ></ng-container>\r\n } @else if (hasRows()) {\r\n <!--\r\n The count carries the information; the button carries the affordance.\r\n `mt-button` owns the tooltip and the accessible name, so the trigger is\r\n one element rather than a button wrapped in a tooltip host.\r\n -->\r\n <mt-button\r\n icon=\"general.eye\"\r\n [label]=\"count().toString()\"\r\n [tooltip]=\"tooltip()\"\r\n [ariaLabel]=\"ariaLabel()\"\r\n variant=\"text\"\r\n size=\"small\"\r\n styleClass=\"!px-2 !py-1 !gap-1\"\r\n (onClick)=\"openDrawer()\"\r\n />\r\n } @else {\r\n <span\r\n class=\"inline-flex w-fit items-center rounded-md bg-surface-100 px-3 py-2 text-xs font-semibold text-muted-color\"\r\n >\r\n {{ emptyLabel }}\r\n </span>\r\n }\r\n</mt-entity-field>\r\n" }]
2542
+ args: [{ selector: 'mt-entity-list-preview', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [EntityField, Button, NgComponentOutlet], template: "<mt-entity-field\n [label]=\"label()\"\n [configuration]=\"data().configuration\"\n gap=\"normal\"\n>\n @if (tableHost(); as host) {\n <!--\n The related records, rendered in full by the read-only\n `mt-entity-list-field`. It owns the metadata request, the access notices\n and the column projection \u2014 see `ENTITY_LIST_TABLE_COMPONENT` for why it\n arrives through an outlet rather than an import.\n -->\n <ng-container\n *ngComponentOutlet=\"host.component; inputs: host.inputs\"\n ></ng-container>\n } @else if (showTrigger()) {\n <!--\n The count carries the information; the button carries the affordance.\n `mt-button` owns the tooltip and the accessible name, so the trigger is\n one element rather than a button wrapped in a tooltip host. A Related\n list opened as a table says \"View\" instead of a count; see\n `triggerLabel`.\n -->\n <mt-button\n icon=\"general.eye\"\n [label]=\"triggerLabel()\"\n [tooltip]=\"tooltip()\"\n [ariaLabel]=\"ariaLabel()\"\n variant=\"text\"\n size=\"small\"\n styleClass=\"!px-2 !py-1 !gap-1\"\n (onClick)=\"openDrawer()\"\n />\n } @else {\n <span\n class=\"inline-flex w-fit items-center rounded-md bg-surface-100 px-3 py-2 text-xs font-semibold text-muted-color\"\n >\n {{ emptyLabel }}\n </span>\n }\n</mt-entity-field>\n" }]
2467
2543
  }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], fields: [{ type: i0.Input, args: [{ isSignal: true, alias: "fields", required: false }] }] } });
2468
2544
 
2469
2545
  /**