@masterteam/client-components 0.0.114 → 0.0.115

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.
@@ -440,6 +440,11 @@ function studioSummaryCell(rows, properties, summary) {
440
440
  return { raw, value: raw === null ? '' : String(raw), missingValueCount };
441
441
  }
442
442
 
443
+ /** A record as the host sees it in `dataLoaded`: everything the backend sent except `values`. */
444
+ function studioRecordMeta(record) {
445
+ const { values: _values, ...rest } = record;
446
+ return rest;
447
+ }
443
448
  const CAPABILITIES = {
444
449
  sort: true,
445
450
  filter: true,
@@ -668,7 +673,7 @@ class StudioRuntime {
668
673
  this.request('GET', this.endpoints.recordState(recordId), null, signal),
669
674
  this.records(this.levelContext(levelId), [], [{ key: 'id', operator: 'Equals', value: String(recordId) }], signal),
670
675
  ]);
671
- const record = response[0];
676
+ const record = response.records[0];
672
677
  if (!record)
673
678
  throw new Error('The record is no longer readable.');
674
679
  const workspace = {
@@ -694,7 +699,22 @@ class StudioRuntime {
694
699
  this.workspaces.delete(this.workspaces.keys().next().value);
695
700
  return workspace;
696
701
  }
697
- async rows(scope, keys, signal, locale, options = {}) {
702
+ rows(scope, keys, signal, locale, options = {}) {
703
+ return this.load(scope, keys, signal, locale, options);
704
+ }
705
+ /**
706
+ * The rows of the root records query plus what the host receives as `dataLoaded`.
707
+ * Only the Studio's own root grid asks for this; internal reads of the same scope
708
+ * (cross-record analysis) go through `rows()` and never report.
709
+ */
710
+ async rootRows(scope, keys, signal, locale, options = {}) {
711
+ let meta;
712
+ const rows = await this.load(scope, keys, signal, locale, options, (value) => (meta = value));
713
+ if (!meta)
714
+ throw new Error('The root records did not load.');
715
+ return { rows, meta };
716
+ }
717
+ async load(scope, keys, signal, locale, options, onRoot) {
698
718
  signal.throwIfAborted();
699
719
  const catalog = await this.catalog(scope.levelId, signal, locale);
700
720
  if (scope.kind === 'module') {
@@ -722,7 +742,7 @@ class StudioRuntime {
722
742
  'email',
723
743
  ].includes(property.normalizedKey))
724
744
  fields.add(property.key);
725
- const records = await this.records(owner.contextKey, [...fields], [
745
+ const { records } = await this.records(owner.contextKey, [...fields], [
726
746
  {
727
747
  key: 'levelDataId',
728
748
  operator: 'Equals',
@@ -781,8 +801,17 @@ class StudioRuntime {
781
801
  ? [{ key: 'id', operator: 'Equals', value: String(scope.recordId) }]
782
802
  : this.rootFilters(scope.levelId);
783
803
  const contextKey = this.levelContext(scope.levelId);
784
- const records = await this.records(contextKey, keys, filters, signal);
785
- const rows = records.map((record) => ({
804
+ const page = await this.records(contextKey, keys, filters, signal);
805
+ if (scope.kind === 'records')
806
+ onRoot?.({
807
+ contextKey,
808
+ key: this.context()?.key ?? '',
809
+ schemaId: scope.levelId,
810
+ schemas: page.schemas,
811
+ records: page.records.map(studioRecordMeta),
812
+ totalCount: page.totalCount,
813
+ });
814
+ const rows = page.records.map((record) => ({
786
815
  ...studioRuntimeRow(record, scope.levelId, catalog.properties, null, contextKey),
787
816
  levelName: catalog.name,
788
817
  }));
@@ -843,6 +872,7 @@ class StudioRuntime {
843
872
  /** Honor server page caps, reject overlap/drift, never silently truncate a dataset. */
844
873
  async records(contextKey, propertyKeys, filters, signal) {
845
874
  const rows = [], ids = new Set();
875
+ let schemas = [];
846
876
  let page = 1, pageSize = 500, total;
847
877
  do {
848
878
  const response = await this.request('POST', this.endpoints.query, {
@@ -867,6 +897,8 @@ class StudioRuntime {
867
897
  throw new Error('The dataset changed while loading. Retry to read a consistent result.');
868
898
  total = paging.totalCount;
869
899
  pageSize = paging.pageSize;
900
+ if (page === 1)
901
+ schemas = response.schemas ?? [];
870
902
  const records = response.records ?? [];
871
903
  if (records.length !== Math.min(pageSize, total - rows.length))
872
904
  throw new Error('The dataset is incomplete.');
@@ -879,7 +911,7 @@ class StudioRuntime {
879
911
  page++;
880
912
  } while (rows.length < total);
881
913
  signal.throwIfAborted();
882
- return rows;
914
+ return { records: rows, schemas, totalCount: total ?? rows.length };
883
915
  }
884
916
  }
885
917
 
@@ -1050,6 +1082,37 @@ async function studioWorkbook(runtime, scope, keys, query, options, signal, prog
1050
1082
  return workbook;
1051
1083
  }
1052
1084
 
1085
+ /**
1086
+ * The title the grid shows for a row. Root and connected-level records carry their name;
1087
+ * a module row usually does not (the backend sends `name: ""` and the title lives in the
1088
+ * module's `Name` property), so fall back to that property's displayed value.
1089
+ */
1090
+ function studioRecordTitle(row) {
1091
+ if (row.name)
1092
+ return row.name;
1093
+ const property = row.properties?.find((item) => item.normalizedKey.toLowerCase() === 'name');
1094
+ const cell = property ? row.values[property.key] : undefined;
1095
+ for (const value of [cell?.value, cell?.raw]) {
1096
+ if (typeof value === 'string' && value.trim())
1097
+ return value;
1098
+ if (typeof value === 'number')
1099
+ return String(value);
1100
+ }
1101
+ return '';
1102
+ }
1103
+ /** The "Open record" row-menu item. Empty unless the host enabled `options.recordOpen`. */
1104
+ function studioOpenRecordItems(host, text, row) {
1105
+ if (!host?.recordOpenEnabled())
1106
+ return [];
1107
+ return [
1108
+ {
1109
+ name: text.text('openRecord'),
1110
+ icon: 'eye',
1111
+ action: () => host.openRecord(row),
1112
+ },
1113
+ ];
1114
+ }
1115
+
1053
1116
  /**
1054
1117
  * Connection tabs (the connected child levels of a record) are hidden by
1055
1118
  * default, at the user's request (2026-10-25), until a better way to present
@@ -1087,9 +1150,23 @@ class StudioHost {
1087
1150
  binding = signal({ context: () => null, options: () => ({}) }, ...(ngDevMode ? [{ debugName: "binding" }] : /* istanbul ignore next */ []));
1088
1151
  context = computed(() => this.binding().context(), { ...(ngDevMode ? { debugName: "context" } : /* istanbul ignore next */ {}), equal: (a, b) => a === b || (!!a && !!b && sameStudioContext(a, b)) });
1089
1152
  options = computed(() => this.binding().options(), ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
1153
+ recordOpenEnabled = computed(() => this.options().recordOpen === true, ...(ngDevMode ? [{ debugName: "recordOpenEnabled" }] : /* istanbul ignore next */ []));
1154
+ recordOpenHandler = null;
1090
1155
  showConnections = computed(() => this.options().showConnections ?? STUDIO_SHOW_CONNECTIONS, ...(ngDevMode ? [{ debugName: "showConnections" }] : /* istanbul ignore next */ []));
1091
- bind(context, options) {
1156
+ bind(context, options, recordOpen) {
1092
1157
  this.binding.set({ context, options });
1158
+ this.recordOpenHandler = recordOpen ?? null;
1159
+ }
1160
+ /** Reports a row the user chose to open. Does nothing unless the host enabled `recordOpen`. */
1161
+ openRecord(row) {
1162
+ if (!this.recordOpenEnabled())
1163
+ return;
1164
+ this.recordOpenHandler?.({
1165
+ recordId: row.recordId,
1166
+ schemaId: row.levelId,
1167
+ name: studioRecordTitle(row),
1168
+ owner: row.owner,
1169
+ });
1093
1170
  }
1094
1171
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StudioHost, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1095
1172
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StudioHost });
@@ -1239,15 +1316,21 @@ class StudioApiService {
1239
1316
  const controller = new AbortController();
1240
1317
  dataset.active++;
1241
1318
  const entry = dataset;
1242
- const result = this.runtime
1243
- .rows(scope, propertyKeys, controller.signal, options.locale ?? 'en', options)
1244
- .then((rows) => {
1319
+ const locale = options.locale ?? 'en';
1320
+ const loading = scope.kind === 'records'
1321
+ ? this.runtime.rootRows(scope, propertyKeys, controller.signal, locale, options)
1322
+ : this.runtime
1323
+ .rows(scope, propertyKeys, controller.signal, locale, options)
1324
+ .then((rows) => ({ rows, meta: undefined }));
1325
+ const result = loading
1326
+ .then(({ rows, meta }) => {
1245
1327
  this.assertScope(identity);
1246
1328
  controller.signal.throwIfAborted();
1247
1329
  const data = {
1248
1330
  rows,
1249
1331
  totalCount: rows.length,
1250
1332
  complete: true,
1333
+ ...(meta ? { rootMeta: meta } : {}),
1251
1334
  };
1252
1335
  entry.pages.set(pageKey, data);
1253
1336
  while (entry.pages.size > 20)
@@ -1467,6 +1550,8 @@ class StudioGridController {
1467
1550
  failed = signal(false, ...(ngDevMode ? [{ debugName: "failed" }] : /* istanbul ignore next */ []));
1468
1551
  /** Successful loads so far; hosts announce the first one (`mt-client-studio (loaded)`). */
1469
1552
  loads = signal(0, ...(ngDevMode ? [{ debugName: "loads" }] : /* istanbul ignore next */ []));
1553
+ /** The root load behind the current rows (root records scope only); a new object for every completed load. */
1554
+ rootMeta = signal(undefined, ...(ngDevMode ? [{ debugName: "rootMeta" }] : /* istanbul ignore next */ []));
1470
1555
  exporting = signal(false, ...(ngDevMode ? [{ debugName: "exporting" }] : /* istanbul ignore next */ []));
1471
1556
  query = signal({ ...STUDIO_INITIAL_QUERY, limit: 50 }, ...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
1472
1557
  selected = signal([], ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
@@ -1537,6 +1622,7 @@ class StudioGridController {
1537
1622
  return;
1538
1623
  }
1539
1624
  if (!source) {
1625
+ this.rootMeta.set(undefined);
1540
1626
  this.api.set(null);
1541
1627
  this.loading.set(false);
1542
1628
  this.scope = undefined;
@@ -1548,6 +1634,7 @@ class StudioGridController {
1548
1634
  }
1549
1635
  if (source.scopeKey !== this.scope) {
1550
1636
  this.scope = source.scopeKey;
1637
+ this.rootMeta.set(undefined);
1551
1638
  this.serverScope = false;
1552
1639
  this.rows.set([]);
1553
1640
  this.selected.set([]);
@@ -1573,6 +1660,8 @@ class StudioGridController {
1573
1660
  void loadMtTableResult(source, query, abort.signal, this.rowId).then((result) => {
1574
1661
  if (abort.signal.aborted)
1575
1662
  return;
1663
+ this.rootMeta.set(result
1664
+ .rootMeta);
1576
1665
  this.rows.set(result.rows);
1577
1666
  this.total.set(result.totalCount);
1578
1667
  this.serverScope ||= !result.complete;
@@ -1897,6 +1986,7 @@ const LABELS = {
1897
1986
  back: ['Back to records', 'العودة إلى السجلات'],
1898
1987
  comparing: ['Compare records', 'مقارنة السجلات'],
1899
1988
  compare: ['Compare selected records', 'مقارنة السجلات المحددة'],
1989
+ openRecord: ['Open record', 'فتح السجل'],
1900
1990
  selectForComparison: [
1901
1991
  'Select at least 2 records using checkboxes or highlight cells across records, then right-click to compare.',
1902
1992
  'حدد سجلين على الأقل بمربعات الاختيار أو ظلّل خلايا عبر السجلات، ثم انقر بزر الفأرة الأيمن للمقارنة.',
@@ -2032,7 +2122,7 @@ class StudioComparison {
2032
2122
  })),
2033
2123
  ], ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
2034
2124
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StudioComparison, deps: [], target: i0.ɵɵFactoryTarget.Component });
2035
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: StudioComparison, isStandalone: true, selector: "mt-client-studio-comparison", inputs: { rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: true, transformFunction: null }, properties: { classPropertyName: "properties", publicName: "properties", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "window:resize": "resize()" } }, providers: [StudioText, provideEntityListTablePreview()], ngImport: i0, template: "<section class=\"studio-comparison\">\r\n <p class=\"studio-comparison-hint\">{{ text.text(\"comparisonHint\") }}</p>\r\n <mt-standard-grid\r\n [rows]=\"fields()\"\r\n [columns]=\"columns()\"\r\n [rowId]=\"fieldId\"\r\n [label]=\"text.text('comparing')\"\r\n [height]=\"height()\"\r\n [paged]=\"false\"\r\n [exportName]=\"text.text('comparing')\"\r\n />\r\n</section>\r\n", styles: [":host{display:block;min-width:0;font:inherit;color:var(--p-text-color, #27364b)}.studio-workspace{display:grid;gap:12px;padding:0;min-width:0}.studio-empty{color:var(--p-text-muted-color, #667085);font-size:12px}.studio-group-heading{margin:12px 0 0;padding-inline-start:10px;border-inline-start:3px solid var(--p-primary-color, #2aaec0);font-size:15px;font-weight:600}.studio-module,.studio-child-level{min-width:0;scroll-margin-block-start:20px}.studio-grid-placeholder{min-height:420px;display:grid;align-content:center;justify-items:center;gap:12px;border:1px solid var(--p-content-border-color, #e4e7ec);border-radius:6px;color:var(--p-text-muted-color, #667085);background:var(--p-content-background, #fff)}.studio-section-error{display:flex;min-height:120px;flex-wrap:wrap;align-items:center;justify-content:center;gap:16px}@media(max-width:1100px){.studio-workspace{gap:0}}@media(max-width:640px){.studio-workspace{padding:0;gap:0}:host .studio-command-content{position:fixed;inset-inline:12px;inset-block-start:20dvh;min-width:0;max-height:60dvh}}.studio-commands{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin-block:.75rem}.studio-command-menu{position:relative;font-size:.875rem}.studio-command-menu>summary{cursor:pointer;padding:.5rem .75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem}.studio-command-content{position:absolute;inset-block-start:100%;inset-inline-end:0;z-index:30;min-width:18rem;max-height:24rem;overflow:auto;background:var(--p-content-background, white);color:var(--p-text-color, #334155);padding:.75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem;display:grid;gap:.75rem}.studio-command-content label{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.studio-command-content select{width:100%;padding:.5rem;border:1px solid var(--p-content-border-color, #ddd);background:inherit;color:inherit;border-radius:.375rem}.studio-command-content button{text-align:start;padding:.5rem;cursor:pointer}.studio-comparison{min-width:0}.studio-comparison-hint{margin:0 0 1rem;color:var(--p-text-muted-color, #667085);font-size:.875rem}button:focus-visible,summary:focus-visible,select:focus-visible{outline:2px solid var(--p-primary-color, #2aaec0);outline-offset:2px}\n"], dependencies: [{ kind: "component", type: MtStandardGridComponent, selector: "mt-standard-grid", inputs: ["rows", "columns", "rowId", "label", "loading", "height", "rowHeight", "selection", "exportable", "exportButtons", "exportName", "exportFormats", "exporter", "rowMenuItems", "server", "paged", "pageSize", "clickableRows", "cellClickFilter", "rowClass", "detail", "chartContext", "search", "emptyTitle", "emptyDescription", "view", "chartPersistence"], outputs: ["gridReady", "rowClicked", "selectionChanged", "sortChanged", "filterChanged", "paginationChanged", "rowGroupOpened", "viewChanged", "chartsChanged"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2125
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: StudioComparison, isStandalone: true, selector: "mt-client-studio-comparison", inputs: { rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: true, transformFunction: null }, properties: { classPropertyName: "properties", publicName: "properties", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "window:resize": "resize()" } }, providers: [StudioText, provideEntityListTablePreview()], ngImport: i0, template: "<section class=\"studio-comparison\">\r\n <p class=\"studio-comparison-hint\">{{ text.text(\"comparisonHint\") }}</p>\r\n <mt-standard-grid\r\n [rows]=\"fields()\"\r\n [columns]=\"columns()\"\r\n [rowId]=\"fieldId\"\r\n [label]=\"text.text('comparing')\"\r\n [height]=\"height()\"\r\n [paged]=\"false\"\r\n [exportName]=\"text.text('comparing')\"\r\n />\r\n</section>\r\n", styles: [":host{display:block;min-width:0;font:inherit;color:var(--p-text-color, #27364b)}.studio-workspace{display:grid;gap:12px;padding:0;min-width:0}.studio-empty{color:var(--p-text-muted-color, #667085);font-size:12px}.studio-group-heading{margin:12px 0 0;padding-inline-start:10px;border-inline-start:3px solid var(--p-primary-color, #2aaec0);font-size:15px;font-weight:600}.studio-module,.studio-child-level{min-width:0;scroll-margin-block-start:20px}.studio-grid-placeholder{min-height:420px;display:grid;align-content:center;justify-items:center;gap:12px;border:1px solid var(--p-content-border-color, #e4e7ec);border-radius:6px;color:var(--p-text-muted-color, #667085);background:var(--p-content-background, #fff)}.studio-section-error{display:flex;min-height:120px;flex-wrap:wrap;align-items:center;justify-content:center;gap:16px}@media(max-width:1100px){.studio-workspace{gap:0}}@media(max-width:640px){.studio-workspace{padding:0;gap:0}:host .studio-command-content{position:fixed;inset-inline:12px;inset-block-start:20dvh;min-width:0;max-height:60dvh}}.studio-commands{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin-block:.75rem}.studio-command-menu{position:relative;font-size:.875rem}.studio-command-menu>summary{cursor:pointer;padding:.5rem .75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem}.studio-command-content{position:absolute;inset-block-start:100%;inset-inline-end:0;z-index:30;min-width:18rem;max-height:24rem;overflow:auto;background:var(--p-content-background, white);color:var(--p-text-color, #334155);padding:.75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem;display:grid;gap:.75rem}.studio-command-content label{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.studio-command-content select{width:100%;padding:.5rem;border:1px solid var(--p-content-border-color, #ddd);background:inherit;color:inherit;border-radius:.375rem}.studio-command-content button{text-align:start;padding:.5rem;cursor:pointer}.studio-comparison{min-width:0}.studio-comparison-hint{margin:0 0 1rem;color:var(--p-text-muted-color, #667085);font-size:.875rem}button:focus-visible,summary:focus-visible,select:focus-visible{outline:2px solid var(--p-primary-color, #2aaec0);outline-offset:2px}\n"], dependencies: [{ kind: "component", type: MtStandardGridComponent, selector: "mt-standard-grid", inputs: ["rows", "columns", "rowId", "label", "loading", "height", "rowHeight", "selection", "exportable", "exportButtons", "exportName", "exportFormats", "exporter", "rowMenuItems", "rowMenuLeadItems", "server", "paged", "pageSize", "clickableRows", "cellClickFilter", "rowClass", "detail", "chartContext", "search", "emptyTitle", "emptyDescription", "view", "chartPersistence"], outputs: ["gridReady", "rowClicked", "selectionChanged", "sortChanged", "filterChanged", "paginationChanged", "rowGroupOpened", "viewChanged", "chartsChanged"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2036
2126
  }
2037
2127
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StudioComparison, decorators: [{
2038
2128
  type: Component,
@@ -2099,6 +2189,9 @@ class StudioModuleTable {
2099
2189
  this.api.scopeIdentity(),
2100
2190
  this.text.language(),
2101
2191
  ]);
2192
+ host = inject(StudioHost, { optional: true });
2193
+ /** "Open record" leads the row menu, above the standard items (host opt-in). */
2194
+ openRecordMenu = (row) => studioOpenRecordItems(this.host, this.text, row);
2102
2195
  comparisonMenu = () => [this.comparison.menuItem()];
2103
2196
  /** A partial result pages on the server; a complete one pages in the grid. */
2104
2197
  modulePage = computed(() => ({
@@ -2165,11 +2258,11 @@ class StudioModuleTable {
2165
2258
  return this.grid.getQuery() ?? STUDIO_INITIAL_QUERY;
2166
2259
  }
2167
2260
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StudioModuleTable, deps: [], target: i0.ɵɵFactoryTarget.Component });
2168
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StudioModuleTable, isStandalone: true, selector: "mt-client-studio-module-table", inputs: { module: { classPropertyName: "module", publicName: "module", isSignal: true, isRequired: true, transformFunction: null }, owner: { classPropertyName: "owner", publicName: "owner", isSignal: true, isRequired: true, transformFunction: null }, scopeOverride: { classPropertyName: "scopeOverride", publicName: "scopeOverride", isSignal: true, isRequired: false, transformFunction: null }, sectionId: { classPropertyName: "sectionId", publicName: "sectionId", isSignal: true, isRequired: false, transformFunction: null }, sourcePath: { classPropertyName: "sourcePath", publicName: "sourcePath", isSignal: true, isRequired: false, transformFunction: null }, includeDescendants: { classPropertyName: "includeDescendants", publicName: "includeDescendants", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "tableHost", first: true, predicate: ["tableHost"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "table", first: true, predicate: MtStandardGridComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<section\n class=\"studio-module\"\n [attr.aria-label]=\"module().name\"\n [id]=\"sectionId()\"\n mtClientStudioViewport\n #viewport=\"studioViewport\"\n>\n @if (viewport.near()) {\n @if (grid.failed()) {\n <div class=\"studio-section-error\" role=\"alert\">\n {{ text.text(\"failed\") }}\n <mt-button\n [label]=\"text.text('retry')\"\n severity=\"secondary\"\n (onClick)=\"grid.retry()\"\n />\n </div>\n }\n <mt-standard-grid\n #tableHost\n [rows]=\"grid.rows()\"\n [columns]=\"grid.renderColumns()\"\n [rowId]=\"rowId\"\n [server]=\"grid.complete() ? null : modulePage()\"\n [pageSize]=\"grid.query().limit\"\n [loading]=\"grid.loading()\"\n [selection]=\"true\"\n [label]=\"module().name\"\n [chartContext]=\"chartContext()\"\n [height]=\"height()\"\n [exportable]=\"grid.exportReady()\"\n [exportFormats]=\"grid.exportFormats()\"\n [exporter]=\"grid.exportAs\"\n [exportName]=\"module().name\"\n [rowMenuItems]=\"comparisonMenu\"\n (gridReady)=\"grid.ready($event)\"\n (viewChanged)=\"grid.changed()\"\n (paginationChanged)=\"grid.page($event)\"\n (selectionChanged)=\"grid.selection()\"\n [chartPersistence]=\"grid.chartPersistence()\"\n (chartsChanged)=\"grid.chartsChanged()\"\n />\n } @else {\n <div\n class=\"studio-grid-placeholder\"\n [attr.aria-busy]=\"prefetching()\"\n [style.min-height.px]=\"reservedHeight()\"\n >\n @if (prefetchError()) {\n <p role=\"alert\">{{ text.text(\"failed\") }}</p>\n <mt-button\n [label]=\"text.text('retry')\"\n (onClick)=\"retry()\"\n severity=\"secondary\"\n />\n } @else if (prefetching()) {\n <span>{{ text.text(\"loading\") }}</span>\n }\n </div>\n }\n</section>\n", styles: [":host{display:block;min-width:0;font:inherit;color:var(--p-text-color, #27364b)}.studio-workspace{display:grid;gap:12px;padding:0;min-width:0}.studio-empty{color:var(--p-text-muted-color, #667085);font-size:12px}.studio-group-heading{margin:12px 0 0;padding-inline-start:10px;border-inline-start:3px solid var(--p-primary-color, #2aaec0);font-size:15px;font-weight:600}.studio-module,.studio-child-level{min-width:0;scroll-margin-block-start:20px}.studio-grid-placeholder{min-height:420px;display:grid;align-content:center;justify-items:center;gap:12px;border:1px solid var(--p-content-border-color, #e4e7ec);border-radius:6px;color:var(--p-text-muted-color, #667085);background:var(--p-content-background, #fff)}.studio-section-error{display:flex;min-height:120px;flex-wrap:wrap;align-items:center;justify-content:center;gap:16px}@media(max-width:1100px){.studio-workspace{gap:0}}@media(max-width:640px){.studio-workspace{padding:0;gap:0}:host .studio-command-content{position:fixed;inset-inline:12px;inset-block-start:20dvh;min-width:0;max-height:60dvh}}.studio-commands{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin-block:.75rem}.studio-command-menu{position:relative;font-size:.875rem}.studio-command-menu>summary{cursor:pointer;padding:.5rem .75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem}.studio-command-content{position:absolute;inset-block-start:100%;inset-inline-end:0;z-index:30;min-width:18rem;max-height:24rem;overflow:auto;background:var(--p-content-background, white);color:var(--p-text-color, #334155);padding:.75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem;display:grid;gap:.75rem}.studio-command-content label{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.studio-command-content select{width:100%;padding:.5rem;border:1px solid var(--p-content-border-color, #ddd);background:inherit;color:inherit;border-radius:.375rem}.studio-command-content button{text-align:start;padding:.5rem;cursor:pointer}.studio-comparison{min-width:0}.studio-comparison-hint{margin:0 0 1rem;color:var(--p-text-muted-color, #667085);font-size:.875rem}button:focus-visible,summary:focus-visible,select:focus-visible{outline:2px solid var(--p-primary-color, #2aaec0);outline-offset:2px}\n"], dependencies: [{ kind: "component", type: MtStandardGridComponent, selector: "mt-standard-grid", inputs: ["rows", "columns", "rowId", "label", "loading", "height", "rowHeight", "selection", "exportable", "exportButtons", "exportName", "exportFormats", "exporter", "rowMenuItems", "server", "paged", "pageSize", "clickableRows", "cellClickFilter", "rowClass", "detail", "chartContext", "search", "emptyTitle", "emptyDescription", "view", "chartPersistence"], outputs: ["gridReady", "rowClicked", "selectionChanged", "sortChanged", "filterChanged", "paginationChanged", "rowGroupOpened", "viewChanged", "chartsChanged"] }, { kind: "directive", type: StudioViewport, selector: "[mtClientStudioViewport]", exportAs: ["studioViewport"] }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2261
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StudioModuleTable, isStandalone: true, selector: "mt-client-studio-module-table", inputs: { module: { classPropertyName: "module", publicName: "module", isSignal: true, isRequired: true, transformFunction: null }, owner: { classPropertyName: "owner", publicName: "owner", isSignal: true, isRequired: true, transformFunction: null }, scopeOverride: { classPropertyName: "scopeOverride", publicName: "scopeOverride", isSignal: true, isRequired: false, transformFunction: null }, sectionId: { classPropertyName: "sectionId", publicName: "sectionId", isSignal: true, isRequired: false, transformFunction: null }, sourcePath: { classPropertyName: "sourcePath", publicName: "sourcePath", isSignal: true, isRequired: false, transformFunction: null }, includeDescendants: { classPropertyName: "includeDescendants", publicName: "includeDescendants", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "tableHost", first: true, predicate: ["tableHost"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "table", first: true, predicate: MtStandardGridComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<section\n class=\"studio-module\"\n [attr.aria-label]=\"module().name\"\n [id]=\"sectionId()\"\n mtClientStudioViewport\n #viewport=\"studioViewport\"\n>\n @if (viewport.near()) {\n @if (grid.failed()) {\n <div class=\"studio-section-error\" role=\"alert\">\n {{ text.text(\"failed\") }}\n <mt-button\n [label]=\"text.text('retry')\"\n severity=\"secondary\"\n (onClick)=\"grid.retry()\"\n />\n </div>\n }\n <mt-standard-grid\n #tableHost\n [rows]=\"grid.rows()\"\n [columns]=\"grid.renderColumns()\"\n [rowId]=\"rowId\"\n [server]=\"grid.complete() ? null : modulePage()\"\n [pageSize]=\"grid.query().limit\"\n [loading]=\"grid.loading()\"\n [selection]=\"true\"\n [label]=\"module().name\"\n [chartContext]=\"chartContext()\"\n [height]=\"height()\"\n [exportable]=\"grid.exportReady()\"\n [exportFormats]=\"grid.exportFormats()\"\n [exporter]=\"grid.exportAs\"\n [exportName]=\"module().name\"\n [rowMenuLeadItems]=\"openRecordMenu\"\n [rowMenuItems]=\"comparisonMenu\"\n (gridReady)=\"grid.ready($event)\"\n (viewChanged)=\"grid.changed()\"\n (paginationChanged)=\"grid.page($event)\"\n (selectionChanged)=\"grid.selection()\"\n [chartPersistence]=\"grid.chartPersistence()\"\n (chartsChanged)=\"grid.chartsChanged()\"\n />\n } @else {\n <div\n class=\"studio-grid-placeholder\"\n [attr.aria-busy]=\"prefetching()\"\n [style.min-height.px]=\"reservedHeight()\"\n >\n @if (prefetchError()) {\n <p role=\"alert\">{{ text.text(\"failed\") }}</p>\n <mt-button\n [label]=\"text.text('retry')\"\n (onClick)=\"retry()\"\n severity=\"secondary\"\n />\n } @else if (prefetching()) {\n <span>{{ text.text(\"loading\") }}</span>\n }\n </div>\n }\n</section>\n", styles: [":host{display:block;min-width:0;font:inherit;color:var(--p-text-color, #27364b)}.studio-workspace{display:grid;gap:12px;padding:0;min-width:0}.studio-empty{color:var(--p-text-muted-color, #667085);font-size:12px}.studio-group-heading{margin:12px 0 0;padding-inline-start:10px;border-inline-start:3px solid var(--p-primary-color, #2aaec0);font-size:15px;font-weight:600}.studio-module,.studio-child-level{min-width:0;scroll-margin-block-start:20px}.studio-grid-placeholder{min-height:420px;display:grid;align-content:center;justify-items:center;gap:12px;border:1px solid var(--p-content-border-color, #e4e7ec);border-radius:6px;color:var(--p-text-muted-color, #667085);background:var(--p-content-background, #fff)}.studio-section-error{display:flex;min-height:120px;flex-wrap:wrap;align-items:center;justify-content:center;gap:16px}@media(max-width:1100px){.studio-workspace{gap:0}}@media(max-width:640px){.studio-workspace{padding:0;gap:0}:host .studio-command-content{position:fixed;inset-inline:12px;inset-block-start:20dvh;min-width:0;max-height:60dvh}}.studio-commands{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin-block:.75rem}.studio-command-menu{position:relative;font-size:.875rem}.studio-command-menu>summary{cursor:pointer;padding:.5rem .75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem}.studio-command-content{position:absolute;inset-block-start:100%;inset-inline-end:0;z-index:30;min-width:18rem;max-height:24rem;overflow:auto;background:var(--p-content-background, white);color:var(--p-text-color, #334155);padding:.75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem;display:grid;gap:.75rem}.studio-command-content label{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.studio-command-content select{width:100%;padding:.5rem;border:1px solid var(--p-content-border-color, #ddd);background:inherit;color:inherit;border-radius:.375rem}.studio-command-content button{text-align:start;padding:.5rem;cursor:pointer}.studio-comparison{min-width:0}.studio-comparison-hint{margin:0 0 1rem;color:var(--p-text-muted-color, #667085);font-size:.875rem}button:focus-visible,summary:focus-visible,select:focus-visible{outline:2px solid var(--p-primary-color, #2aaec0);outline-offset:2px}\n"], dependencies: [{ kind: "component", type: MtStandardGridComponent, selector: "mt-standard-grid", inputs: ["rows", "columns", "rowId", "label", "loading", "height", "rowHeight", "selection", "exportable", "exportButtons", "exportName", "exportFormats", "exporter", "rowMenuItems", "rowMenuLeadItems", "server", "paged", "pageSize", "clickableRows", "cellClickFilter", "rowClass", "detail", "chartContext", "search", "emptyTitle", "emptyDescription", "view", "chartPersistence"], outputs: ["gridReady", "rowClicked", "selectionChanged", "sortChanged", "filterChanged", "paginationChanged", "rowGroupOpened", "viewChanged", "chartsChanged"] }, { kind: "directive", type: StudioViewport, selector: "[mtClientStudioViewport]", exportAs: ["studioViewport"] }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2169
2262
  }
2170
2263
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StudioModuleTable, decorators: [{
2171
2264
  type: Component,
2172
- args: [{ selector: 'mt-client-studio-module-table', imports: [MtStandardGridComponent, StudioViewport, Button], changeDetection: ChangeDetectionStrategy.OnPush, template: "<section\n class=\"studio-module\"\n [attr.aria-label]=\"module().name\"\n [id]=\"sectionId()\"\n mtClientStudioViewport\n #viewport=\"studioViewport\"\n>\n @if (viewport.near()) {\n @if (grid.failed()) {\n <div class=\"studio-section-error\" role=\"alert\">\n {{ text.text(\"failed\") }}\n <mt-button\n [label]=\"text.text('retry')\"\n severity=\"secondary\"\n (onClick)=\"grid.retry()\"\n />\n </div>\n }\n <mt-standard-grid\n #tableHost\n [rows]=\"grid.rows()\"\n [columns]=\"grid.renderColumns()\"\n [rowId]=\"rowId\"\n [server]=\"grid.complete() ? null : modulePage()\"\n [pageSize]=\"grid.query().limit\"\n [loading]=\"grid.loading()\"\n [selection]=\"true\"\n [label]=\"module().name\"\n [chartContext]=\"chartContext()\"\n [height]=\"height()\"\n [exportable]=\"grid.exportReady()\"\n [exportFormats]=\"grid.exportFormats()\"\n [exporter]=\"grid.exportAs\"\n [exportName]=\"module().name\"\n [rowMenuItems]=\"comparisonMenu\"\n (gridReady)=\"grid.ready($event)\"\n (viewChanged)=\"grid.changed()\"\n (paginationChanged)=\"grid.page($event)\"\n (selectionChanged)=\"grid.selection()\"\n [chartPersistence]=\"grid.chartPersistence()\"\n (chartsChanged)=\"grid.chartsChanged()\"\n />\n } @else {\n <div\n class=\"studio-grid-placeholder\"\n [attr.aria-busy]=\"prefetching()\"\n [style.min-height.px]=\"reservedHeight()\"\n >\n @if (prefetchError()) {\n <p role=\"alert\">{{ text.text(\"failed\") }}</p>\n <mt-button\n [label]=\"text.text('retry')\"\n (onClick)=\"retry()\"\n severity=\"secondary\"\n />\n } @else if (prefetching()) {\n <span>{{ text.text(\"loading\") }}</span>\n }\n </div>\n }\n</section>\n", styles: [":host{display:block;min-width:0;font:inherit;color:var(--p-text-color, #27364b)}.studio-workspace{display:grid;gap:12px;padding:0;min-width:0}.studio-empty{color:var(--p-text-muted-color, #667085);font-size:12px}.studio-group-heading{margin:12px 0 0;padding-inline-start:10px;border-inline-start:3px solid var(--p-primary-color, #2aaec0);font-size:15px;font-weight:600}.studio-module,.studio-child-level{min-width:0;scroll-margin-block-start:20px}.studio-grid-placeholder{min-height:420px;display:grid;align-content:center;justify-items:center;gap:12px;border:1px solid var(--p-content-border-color, #e4e7ec);border-radius:6px;color:var(--p-text-muted-color, #667085);background:var(--p-content-background, #fff)}.studio-section-error{display:flex;min-height:120px;flex-wrap:wrap;align-items:center;justify-content:center;gap:16px}@media(max-width:1100px){.studio-workspace{gap:0}}@media(max-width:640px){.studio-workspace{padding:0;gap:0}:host .studio-command-content{position:fixed;inset-inline:12px;inset-block-start:20dvh;min-width:0;max-height:60dvh}}.studio-commands{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin-block:.75rem}.studio-command-menu{position:relative;font-size:.875rem}.studio-command-menu>summary{cursor:pointer;padding:.5rem .75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem}.studio-command-content{position:absolute;inset-block-start:100%;inset-inline-end:0;z-index:30;min-width:18rem;max-height:24rem;overflow:auto;background:var(--p-content-background, white);color:var(--p-text-color, #334155);padding:.75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem;display:grid;gap:.75rem}.studio-command-content label{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.studio-command-content select{width:100%;padding:.5rem;border:1px solid var(--p-content-border-color, #ddd);background:inherit;color:inherit;border-radius:.375rem}.studio-command-content button{text-align:start;padding:.5rem;cursor:pointer}.studio-comparison{min-width:0}.studio-comparison-hint{margin:0 0 1rem;color:var(--p-text-muted-color, #667085);font-size:.875rem}button:focus-visible,summary:focus-visible,select:focus-visible{outline:2px solid var(--p-primary-color, #2aaec0);outline-offset:2px}\n"] }]
2265
+ args: [{ selector: 'mt-client-studio-module-table', imports: [MtStandardGridComponent, StudioViewport, Button], changeDetection: ChangeDetectionStrategy.OnPush, template: "<section\n class=\"studio-module\"\n [attr.aria-label]=\"module().name\"\n [id]=\"sectionId()\"\n mtClientStudioViewport\n #viewport=\"studioViewport\"\n>\n @if (viewport.near()) {\n @if (grid.failed()) {\n <div class=\"studio-section-error\" role=\"alert\">\n {{ text.text(\"failed\") }}\n <mt-button\n [label]=\"text.text('retry')\"\n severity=\"secondary\"\n (onClick)=\"grid.retry()\"\n />\n </div>\n }\n <mt-standard-grid\n #tableHost\n [rows]=\"grid.rows()\"\n [columns]=\"grid.renderColumns()\"\n [rowId]=\"rowId\"\n [server]=\"grid.complete() ? null : modulePage()\"\n [pageSize]=\"grid.query().limit\"\n [loading]=\"grid.loading()\"\n [selection]=\"true\"\n [label]=\"module().name\"\n [chartContext]=\"chartContext()\"\n [height]=\"height()\"\n [exportable]=\"grid.exportReady()\"\n [exportFormats]=\"grid.exportFormats()\"\n [exporter]=\"grid.exportAs\"\n [exportName]=\"module().name\"\n [rowMenuLeadItems]=\"openRecordMenu\"\n [rowMenuItems]=\"comparisonMenu\"\n (gridReady)=\"grid.ready($event)\"\n (viewChanged)=\"grid.changed()\"\n (paginationChanged)=\"grid.page($event)\"\n (selectionChanged)=\"grid.selection()\"\n [chartPersistence]=\"grid.chartPersistence()\"\n (chartsChanged)=\"grid.chartsChanged()\"\n />\n } @else {\n <div\n class=\"studio-grid-placeholder\"\n [attr.aria-busy]=\"prefetching()\"\n [style.min-height.px]=\"reservedHeight()\"\n >\n @if (prefetchError()) {\n <p role=\"alert\">{{ text.text(\"failed\") }}</p>\n <mt-button\n [label]=\"text.text('retry')\"\n (onClick)=\"retry()\"\n severity=\"secondary\"\n />\n } @else if (prefetching()) {\n <span>{{ text.text(\"loading\") }}</span>\n }\n </div>\n }\n</section>\n", styles: [":host{display:block;min-width:0;font:inherit;color:var(--p-text-color, #27364b)}.studio-workspace{display:grid;gap:12px;padding:0;min-width:0}.studio-empty{color:var(--p-text-muted-color, #667085);font-size:12px}.studio-group-heading{margin:12px 0 0;padding-inline-start:10px;border-inline-start:3px solid var(--p-primary-color, #2aaec0);font-size:15px;font-weight:600}.studio-module,.studio-child-level{min-width:0;scroll-margin-block-start:20px}.studio-grid-placeholder{min-height:420px;display:grid;align-content:center;justify-items:center;gap:12px;border:1px solid var(--p-content-border-color, #e4e7ec);border-radius:6px;color:var(--p-text-muted-color, #667085);background:var(--p-content-background, #fff)}.studio-section-error{display:flex;min-height:120px;flex-wrap:wrap;align-items:center;justify-content:center;gap:16px}@media(max-width:1100px){.studio-workspace{gap:0}}@media(max-width:640px){.studio-workspace{padding:0;gap:0}:host .studio-command-content{position:fixed;inset-inline:12px;inset-block-start:20dvh;min-width:0;max-height:60dvh}}.studio-commands{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin-block:.75rem}.studio-command-menu{position:relative;font-size:.875rem}.studio-command-menu>summary{cursor:pointer;padding:.5rem .75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem}.studio-command-content{position:absolute;inset-block-start:100%;inset-inline-end:0;z-index:30;min-width:18rem;max-height:24rem;overflow:auto;background:var(--p-content-background, white);color:var(--p-text-color, #334155);padding:.75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem;display:grid;gap:.75rem}.studio-command-content label{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.studio-command-content select{width:100%;padding:.5rem;border:1px solid var(--p-content-border-color, #ddd);background:inherit;color:inherit;border-radius:.375rem}.studio-command-content button{text-align:start;padding:.5rem;cursor:pointer}.studio-comparison{min-width:0}.studio-comparison-hint{margin:0 0 1rem;color:var(--p-text-muted-color, #667085);font-size:.875rem}button:focus-visible,summary:focus-visible,select:focus-visible{outline:2px solid var(--p-primary-color, #2aaec0);outline-offset:2px}\n"] }]
2173
2266
  }], ctorParameters: () => [], propDecorators: { module: [{ type: i0.Input, args: [{ isSignal: true, alias: "module", required: true }] }], owner: [{ type: i0.Input, args: [{ isSignal: true, alias: "owner", required: true }] }], scopeOverride: [{ type: i0.Input, args: [{ isSignal: true, alias: "scopeOverride", required: false }] }], sectionId: [{ type: i0.Input, args: [{ isSignal: true, alias: "sectionId", required: false }] }], sourcePath: [{ type: i0.Input, args: [{ isSignal: true, alias: "sourcePath", required: false }] }], includeDescendants: [{ type: i0.Input, args: [{ isSignal: true, alias: "includeDescendants", required: false }] }], tableHost: [{ type: i0.ViewChild, args: ['tableHost', { ...{
2174
2267
  read: (ElementRef),
2175
2268
  }, isSignal: true }] }], table: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MtStandardGridComponent), { isSignal: true }] }] } });
@@ -2284,6 +2377,8 @@ class StudioRecordsTable {
2284
2377
  height = input(600, ...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
2285
2378
  /** A records load finished (every successful load; the root Studio announces the first). */
2286
2379
  recordsLoaded = output();
2380
+ /** The root records load finished: what the host receives as `dataLoaded`. */
2381
+ dataLoaded = output();
2287
2382
  /** The catalog or the records failed; the section shows its error and retry. */
2288
2383
  recordsFailed = output();
2289
2384
  tableHost = viewChild('tableHost', { ...(ngDevMode ? { debugName: "tableHost" } : /* istanbul ignore next */ {}), read: (ElementRef) });
@@ -2385,6 +2480,9 @@ class StudioRecordsTable {
2385
2480
  }), ...(ngDevMode ? [{ debugName: "viewIdentity" }] : /* istanbul ignore next */ []));
2386
2481
  grid = new StudioGridController(this.source, this.columns, this.viewIdentity, (keys) => keys.forEach((key) => this.fieldRequested(key)), this.exporter, () => this.catalog()?.exportFormats ?? [], () => this.title() || this.catalog()?.name || '');
2387
2482
  comparison = new StudioComparisonController(() => this.grid.comparisonRows(), this.comparisonProperties, () => !this.grid.loading() && !this.grid.failed(), () => [this.scope(), this.api.scopeIdentity(), this.text.language()]);
2483
+ host = inject(StudioHost, { optional: true });
2484
+ /** "Open record" leads the row menu, above the standard items (host opt-in). */
2485
+ openRecordMenu = (row) => studioOpenRecordItems(this.host, this.text, row);
2388
2486
  comparisonMenu = () => [this.comparison.menuItem()];
2389
2487
  exportRecord = signal(null, ...(ngDevMode ? [{ debugName: "exportRecord" }] : /* istanbul ignore next */ []));
2390
2488
  rowId = (row) => row.id;
@@ -2406,6 +2504,19 @@ class StudioRecordsTable {
2406
2504
  if (this.grid.loads())
2407
2505
  untracked(() => this.recordsLoaded.emit());
2408
2506
  });
2507
+ effect(() => {
2508
+ const meta = this.grid.rootMeta();
2509
+ if (!meta || this.scopeOverride())
2510
+ return;
2511
+ untracked(() => {
2512
+ // A load a later context change has replaced is not the host's data any more.
2513
+ const context = this.host?.context();
2514
+ if (context &&
2515
+ (context.contextKey !== meta.contextKey || context.key !== meta.key))
2516
+ return;
2517
+ this.dataLoaded.emit(meta);
2518
+ });
2519
+ });
2409
2520
  effect(() => {
2410
2521
  if (this.failure())
2411
2522
  untracked(() => this.recordsFailed.emit());
@@ -2510,12 +2621,12 @@ class StudioRecordsTable {
2510
2621
  this.api.refresh();
2511
2622
  }
2512
2623
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StudioRecordsTable, deps: [], target: i0.ɵɵFactoryTarget.Component });
2513
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StudioRecordsTable, isStandalone: true, selector: "mt-client-studio-records-table", inputs: { levelId: { classPropertyName: "levelId", publicName: "levelId", isSignal: true, isRequired: true, transformFunction: null }, scopeOverride: { classPropertyName: "scopeOverride", publicName: "scopeOverride", isSignal: true, isRequired: false, transformFunction: null }, ancestorKeys: { classPropertyName: "ancestorKeys", publicName: "ancestorKeys", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, chartContext: { classPropertyName: "chartContext", publicName: "chartContext", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { recordsLoaded: "recordsLoaded", recordsFailed: "recordsFailed" }, providers: [provideEntityListTablePreview()], viewQueries: [{ propertyName: "tableHost", first: true, predicate: ["tableHost"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "moduleTable", first: true, predicate: StudioModuleTable, descendants: true, isSignal: true }], ngImport: i0, template: "@if (catalog(); as data) {\n @if (toolsOpen()) {\n <div class=\"studio-commands\">\n @if (exportRecord(); as record) {\n <mt-client-studio-export\n [scope]=\"{\n kind: 'record',\n levelId: record.levelId,\n recordId: record.recordId,\n }\"\n kind=\"record\"\n [title]=\"record.name\"\n />\n }\n <mt-button\n [label]=\"text.text('close')\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"toolsOpen.set(false)\"\n />\n <mt-button\n [label]=\"text.text('refresh')\"\n icon=\"arrow.refresh-cw-01\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"refresh()\"\n />\n <details class=\"studio-command-menu\">\n <summary>{{ text.text(\"summaries\") }}</summary>\n <div class=\"studio-command-content\">\n <label\n >{{ text.text(\"selectModule\")\n }}<select\n [value]=\"summaryModuleKey()\"\n (change)=\"\n summaryModuleKey.set($any($event.target).value);\n summaryPropertyKey.set('')\n \"\n >\n <option value=\"\"></option>\n @for (module of data.modules; track module.id) {\n <option [value]=\"module.moduleKey\">{{ module.name }}</option>\n }\n </select></label\n >\n <label\n >{{ text.text(\"measure\")\n }}<select\n [value]=\"summaryAggregation()\"\n (change)=\"summaryAggregation.set($any($event.target).value)\"\n >\n @for (aggregation of aggregationChoices; track aggregation) {\n <option [value]=\"aggregation\">\n {{ text.text(aggregation) }}\n </option>\n }\n </select></label\n >\n @if (summaryAggregation() !== \"count\") {\n <label\n >{{ text.text(\"property\")\n }}<select\n [value]=\"summaryPropertyKey()\"\n (change)=\"summaryPropertyKey.set($any($event.target).value)\"\n >\n <option value=\"\"></option>\n @for (property of summaryProperties(); track property.key) {\n <option [value]=\"property.key\">{{ property.label }}</option>\n }\n </select></label\n >\n }\n <mt-button\n [label]=\"text.text('addSummary')\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"addSummary()\"\n />\n @if (\n analysisModuleKey() && summaryModuleKey() === analysisModuleKey()\n ) {\n <label\n ><input\n type=\"checkbox\"\n [checked]=\"useModuleFilters()\"\n (change)=\"useModuleFilters.set($any($event.target).checked)\"\n />{{ text.text(\"useModuleFilters\") }}</label\n >\n }\n @for (summary of summaries(); track summary.key) {\n <button type=\"button\" (click)=\"removeSummary(summary.key)\">\n {{ summaryLabel(summary) }} \u00B7 {{ text.text(\"remove\") }}\n </button>\n }\n </div>\n </details>\n @if (data.capabilities.exportAll) {\n <mt-client-studio-export\n [scope]=\"scope()\"\n [propertyKeys]=\"exportFields()\"\n [summaries]=\"summaries()\"\n [query]=\"currentQuery()\"\n kind=\"level\"\n [title]=\"data.name\"\n />\n }\n </div>\n }\n @if (analysisModule(); as module) {\n <div class=\"studio-commands\">\n <mt-button\n [label]=\"text.text('back')\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"analysisModuleKey.set('')\"\n /><label\n ><input\n type=\"checkbox\"\n [checked]=\"includeDescendants()\"\n (change)=\"includeDescendants.set($any($event.target).checked)\"\n />{{ text.text(\"descendants\") }}</label\n >\n </div>\n <mt-client-studio-module-table\n [module]=\"module\"\n [owner]=\"analysisOwner()\"\n [scopeOverride]=\"analysisScope()\"\n [includeDescendants]=\"includeDescendants()\"\n />\n }\n <div [hidden]=\"!!analysisModule()\">\n @if (grid.failed()) {\n <div class=\"studio-section-error\" role=\"alert\">\n {{ text.text(\"failed\") }}\n <mt-button\n [label]=\"text.text('retry')\"\n severity=\"secondary\"\n (onClick)=\"grid.retry()\"\n />\n </div>\n }\n <mt-standard-grid\n #tableHost\n [rows]=\"grid.rows()\"\n [columns]=\"grid.renderColumns()\"\n [rowId]=\"rowId\"\n [server]=\"grid.complete() ? null : recordsPage()\"\n [paged]=\"false\"\n [loading]=\"grid.loading()\"\n [selection]=\"true\"\n [label]=\"title() || data.name || text.text('title')\"\n [chartContext]=\"chartContext() || title() || data.name\"\n [height]=\"gridHeight()\"\n [detail]=\"detail()\"\n [exportable]=\"grid.exportReady()\"\n [exportFormats]=\"grid.exportFormats()\"\n [exporter]=\"grid.exportAs\"\n [exportName]=\"title() || data.name\"\n [rowMenuItems]=\"comparisonMenu\"\n (gridReady)=\"grid.ready($event)\"\n (viewChanged)=\"grid.changed()\"\n (selectionChanged)=\"grid.selection()\"\n [chartPersistence]=\"grid.chartPersistence()\"\n (chartsChanged)=\"grid.chartsChanged()\"\n />\n </div>\n} @else if (failed()) {\n <div class=\"studio-section-error\" role=\"alert\">\n <p>{{ text.text(\"failed\") }}</p>\n <mt-button\n [label]=\"text.text('retry')\"\n (onClick)=\"retry()\"\n severity=\"secondary\"\n />\n </div>\n} @else {\n <div class=\"studio-grid-placeholder\" role=\"status\">\n {{ text.text(\"loading\") }}\n </div>\n}\n", styles: [":host{display:block;min-width:0;font:inherit;color:var(--p-text-color, #27364b)}.studio-workspace{display:grid;gap:12px;padding:0;min-width:0}.studio-empty{color:var(--p-text-muted-color, #667085);font-size:12px}.studio-group-heading{margin:12px 0 0;padding-inline-start:10px;border-inline-start:3px solid var(--p-primary-color, #2aaec0);font-size:15px;font-weight:600}.studio-module,.studio-child-level{min-width:0;scroll-margin-block-start:20px}.studio-grid-placeholder{min-height:420px;display:grid;align-content:center;justify-items:center;gap:12px;border:1px solid var(--p-content-border-color, #e4e7ec);border-radius:6px;color:var(--p-text-muted-color, #667085);background:var(--p-content-background, #fff)}.studio-section-error{display:flex;min-height:120px;flex-wrap:wrap;align-items:center;justify-content:center;gap:16px}@media(max-width:1100px){.studio-workspace{gap:0}}@media(max-width:640px){.studio-workspace{padding:0;gap:0}:host .studio-command-content{position:fixed;inset-inline:12px;inset-block-start:20dvh;min-width:0;max-height:60dvh}}.studio-commands{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin-block:.75rem}.studio-command-menu{position:relative;font-size:.875rem}.studio-command-menu>summary{cursor:pointer;padding:.5rem .75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem}.studio-command-content{position:absolute;inset-block-start:100%;inset-inline-end:0;z-index:30;min-width:18rem;max-height:24rem;overflow:auto;background:var(--p-content-background, white);color:var(--p-text-color, #334155);padding:.75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem;display:grid;gap:.75rem}.studio-command-content label{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.studio-command-content select{width:100%;padding:.5rem;border:1px solid var(--p-content-border-color, #ddd);background:inherit;color:inherit;border-radius:.375rem}.studio-command-content button{text-align:start;padding:.5rem;cursor:pointer}.studio-comparison{min-width:0}.studio-comparison-hint{margin:0 0 1rem;color:var(--p-text-muted-color, #667085);font-size:.875rem}button:focus-visible,summary:focus-visible,select:focus-visible{outline:2px solid var(--p-primary-color, #2aaec0);outline-offset:2px}\n"], dependencies: [{ kind: "component", type: MtStandardGridComponent, selector: "mt-standard-grid", inputs: ["rows", "columns", "rowId", "label", "loading", "height", "rowHeight", "selection", "exportable", "exportButtons", "exportName", "exportFormats", "exporter", "rowMenuItems", "server", "paged", "pageSize", "clickableRows", "cellClickFilter", "rowClass", "detail", "chartContext", "search", "emptyTitle", "emptyDescription", "view", "chartPersistence"], outputs: ["gridReady", "rowClicked", "selectionChanged", "sortChanged", "filterChanged", "paginationChanged", "rowGroupOpened", "viewChanged", "chartsChanged"] }, { 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: "component", type: StudioModuleTable, selector: "mt-client-studio-module-table", inputs: ["module", "owner", "scopeOverride", "sectionId", "sourcePath", "includeDescendants"] }, { kind: "component", type: StudioExport, selector: "mt-client-studio-export", inputs: ["scope", "propertyKeys", "summaries", "query", "kind", "title"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2624
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StudioRecordsTable, isStandalone: true, selector: "mt-client-studio-records-table", inputs: { levelId: { classPropertyName: "levelId", publicName: "levelId", isSignal: true, isRequired: true, transformFunction: null }, scopeOverride: { classPropertyName: "scopeOverride", publicName: "scopeOverride", isSignal: true, isRequired: false, transformFunction: null }, ancestorKeys: { classPropertyName: "ancestorKeys", publicName: "ancestorKeys", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, chartContext: { classPropertyName: "chartContext", publicName: "chartContext", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { recordsLoaded: "recordsLoaded", dataLoaded: "dataLoaded", recordsFailed: "recordsFailed" }, providers: [provideEntityListTablePreview()], viewQueries: [{ propertyName: "tableHost", first: true, predicate: ["tableHost"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "moduleTable", first: true, predicate: StudioModuleTable, descendants: true, isSignal: true }], ngImport: i0, template: "@if (catalog(); as data) {\n @if (toolsOpen()) {\n <div class=\"studio-commands\">\n @if (exportRecord(); as record) {\n <mt-client-studio-export\n [scope]=\"{\n kind: 'record',\n levelId: record.levelId,\n recordId: record.recordId,\n }\"\n kind=\"record\"\n [title]=\"record.name\"\n />\n }\n <mt-button\n [label]=\"text.text('close')\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"toolsOpen.set(false)\"\n />\n <mt-button\n [label]=\"text.text('refresh')\"\n icon=\"arrow.refresh-cw-01\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"refresh()\"\n />\n <details class=\"studio-command-menu\">\n <summary>{{ text.text(\"summaries\") }}</summary>\n <div class=\"studio-command-content\">\n <label\n >{{ text.text(\"selectModule\")\n }}<select\n [value]=\"summaryModuleKey()\"\n (change)=\"\n summaryModuleKey.set($any($event.target).value);\n summaryPropertyKey.set('')\n \"\n >\n <option value=\"\"></option>\n @for (module of data.modules; track module.id) {\n <option [value]=\"module.moduleKey\">{{ module.name }}</option>\n }\n </select></label\n >\n <label\n >{{ text.text(\"measure\")\n }}<select\n [value]=\"summaryAggregation()\"\n (change)=\"summaryAggregation.set($any($event.target).value)\"\n >\n @for (aggregation of aggregationChoices; track aggregation) {\n <option [value]=\"aggregation\">\n {{ text.text(aggregation) }}\n </option>\n }\n </select></label\n >\n @if (summaryAggregation() !== \"count\") {\n <label\n >{{ text.text(\"property\")\n }}<select\n [value]=\"summaryPropertyKey()\"\n (change)=\"summaryPropertyKey.set($any($event.target).value)\"\n >\n <option value=\"\"></option>\n @for (property of summaryProperties(); track property.key) {\n <option [value]=\"property.key\">{{ property.label }}</option>\n }\n </select></label\n >\n }\n <mt-button\n [label]=\"text.text('addSummary')\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"addSummary()\"\n />\n @if (\n analysisModuleKey() && summaryModuleKey() === analysisModuleKey()\n ) {\n <label\n ><input\n type=\"checkbox\"\n [checked]=\"useModuleFilters()\"\n (change)=\"useModuleFilters.set($any($event.target).checked)\"\n />{{ text.text(\"useModuleFilters\") }}</label\n >\n }\n @for (summary of summaries(); track summary.key) {\n <button type=\"button\" (click)=\"removeSummary(summary.key)\">\n {{ summaryLabel(summary) }} \u00B7 {{ text.text(\"remove\") }}\n </button>\n }\n </div>\n </details>\n @if (data.capabilities.exportAll) {\n <mt-client-studio-export\n [scope]=\"scope()\"\n [propertyKeys]=\"exportFields()\"\n [summaries]=\"summaries()\"\n [query]=\"currentQuery()\"\n kind=\"level\"\n [title]=\"data.name\"\n />\n }\n </div>\n }\n @if (analysisModule(); as module) {\n <div class=\"studio-commands\">\n <mt-button\n [label]=\"text.text('back')\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"analysisModuleKey.set('')\"\n /><label\n ><input\n type=\"checkbox\"\n [checked]=\"includeDescendants()\"\n (change)=\"includeDescendants.set($any($event.target).checked)\"\n />{{ text.text(\"descendants\") }}</label\n >\n </div>\n <mt-client-studio-module-table\n [module]=\"module\"\n [owner]=\"analysisOwner()\"\n [scopeOverride]=\"analysisScope()\"\n [includeDescendants]=\"includeDescendants()\"\n />\n }\n <div [hidden]=\"!!analysisModule()\">\n @if (grid.failed()) {\n <div class=\"studio-section-error\" role=\"alert\">\n {{ text.text(\"failed\") }}\n <mt-button\n [label]=\"text.text('retry')\"\n severity=\"secondary\"\n (onClick)=\"grid.retry()\"\n />\n </div>\n }\n <mt-standard-grid\n #tableHost\n [rows]=\"grid.rows()\"\n [columns]=\"grid.renderColumns()\"\n [rowId]=\"rowId\"\n [server]=\"grid.complete() ? null : recordsPage()\"\n [paged]=\"false\"\n [loading]=\"grid.loading()\"\n [selection]=\"true\"\n [label]=\"title() || data.name || text.text('title')\"\n [chartContext]=\"chartContext() || title() || data.name\"\n [height]=\"gridHeight()\"\n [detail]=\"detail()\"\n [exportable]=\"grid.exportReady()\"\n [exportFormats]=\"grid.exportFormats()\"\n [exporter]=\"grid.exportAs\"\n [exportName]=\"title() || data.name\"\n [rowMenuLeadItems]=\"openRecordMenu\"\n [rowMenuItems]=\"comparisonMenu\"\n (gridReady)=\"grid.ready($event)\"\n (viewChanged)=\"grid.changed()\"\n (selectionChanged)=\"grid.selection()\"\n [chartPersistence]=\"grid.chartPersistence()\"\n (chartsChanged)=\"grid.chartsChanged()\"\n />\n </div>\n} @else if (failed()) {\n <div class=\"studio-section-error\" role=\"alert\">\n <p>{{ text.text(\"failed\") }}</p>\n <mt-button\n [label]=\"text.text('retry')\"\n (onClick)=\"retry()\"\n severity=\"secondary\"\n />\n </div>\n} @else {\n <div class=\"studio-grid-placeholder\" role=\"status\">\n {{ text.text(\"loading\") }}\n </div>\n}\n", styles: [":host{display:block;min-width:0;font:inherit;color:var(--p-text-color, #27364b)}.studio-workspace{display:grid;gap:12px;padding:0;min-width:0}.studio-empty{color:var(--p-text-muted-color, #667085);font-size:12px}.studio-group-heading{margin:12px 0 0;padding-inline-start:10px;border-inline-start:3px solid var(--p-primary-color, #2aaec0);font-size:15px;font-weight:600}.studio-module,.studio-child-level{min-width:0;scroll-margin-block-start:20px}.studio-grid-placeholder{min-height:420px;display:grid;align-content:center;justify-items:center;gap:12px;border:1px solid var(--p-content-border-color, #e4e7ec);border-radius:6px;color:var(--p-text-muted-color, #667085);background:var(--p-content-background, #fff)}.studio-section-error{display:flex;min-height:120px;flex-wrap:wrap;align-items:center;justify-content:center;gap:16px}@media(max-width:1100px){.studio-workspace{gap:0}}@media(max-width:640px){.studio-workspace{padding:0;gap:0}:host .studio-command-content{position:fixed;inset-inline:12px;inset-block-start:20dvh;min-width:0;max-height:60dvh}}.studio-commands{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin-block:.75rem}.studio-command-menu{position:relative;font-size:.875rem}.studio-command-menu>summary{cursor:pointer;padding:.5rem .75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem}.studio-command-content{position:absolute;inset-block-start:100%;inset-inline-end:0;z-index:30;min-width:18rem;max-height:24rem;overflow:auto;background:var(--p-content-background, white);color:var(--p-text-color, #334155);padding:.75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem;display:grid;gap:.75rem}.studio-command-content label{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.studio-command-content select{width:100%;padding:.5rem;border:1px solid var(--p-content-border-color, #ddd);background:inherit;color:inherit;border-radius:.375rem}.studio-command-content button{text-align:start;padding:.5rem;cursor:pointer}.studio-comparison{min-width:0}.studio-comparison-hint{margin:0 0 1rem;color:var(--p-text-muted-color, #667085);font-size:.875rem}button:focus-visible,summary:focus-visible,select:focus-visible{outline:2px solid var(--p-primary-color, #2aaec0);outline-offset:2px}\n"], dependencies: [{ kind: "component", type: MtStandardGridComponent, selector: "mt-standard-grid", inputs: ["rows", "columns", "rowId", "label", "loading", "height", "rowHeight", "selection", "exportable", "exportButtons", "exportName", "exportFormats", "exporter", "rowMenuItems", "rowMenuLeadItems", "server", "paged", "pageSize", "clickableRows", "cellClickFilter", "rowClass", "detail", "chartContext", "search", "emptyTitle", "emptyDescription", "view", "chartPersistence"], outputs: ["gridReady", "rowClicked", "selectionChanged", "sortChanged", "filterChanged", "paginationChanged", "rowGroupOpened", "viewChanged", "chartsChanged"] }, { 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: "component", type: StudioModuleTable, selector: "mt-client-studio-module-table", inputs: ["module", "owner", "scopeOverride", "sectionId", "sourcePath", "includeDescendants"] }, { kind: "component", type: StudioExport, selector: "mt-client-studio-export", inputs: ["scope", "propertyKeys", "summaries", "query", "kind", "title"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2514
2625
  }
2515
2626
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StudioRecordsTable, decorators: [{
2516
2627
  type: Component,
2517
- args: [{ selector: 'mt-client-studio-records-table', providers: [provideEntityListTablePreview()], imports: [MtStandardGridComponent, Button, StudioModuleTable, StudioExport], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (catalog(); as data) {\n @if (toolsOpen()) {\n <div class=\"studio-commands\">\n @if (exportRecord(); as record) {\n <mt-client-studio-export\n [scope]=\"{\n kind: 'record',\n levelId: record.levelId,\n recordId: record.recordId,\n }\"\n kind=\"record\"\n [title]=\"record.name\"\n />\n }\n <mt-button\n [label]=\"text.text('close')\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"toolsOpen.set(false)\"\n />\n <mt-button\n [label]=\"text.text('refresh')\"\n icon=\"arrow.refresh-cw-01\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"refresh()\"\n />\n <details class=\"studio-command-menu\">\n <summary>{{ text.text(\"summaries\") }}</summary>\n <div class=\"studio-command-content\">\n <label\n >{{ text.text(\"selectModule\")\n }}<select\n [value]=\"summaryModuleKey()\"\n (change)=\"\n summaryModuleKey.set($any($event.target).value);\n summaryPropertyKey.set('')\n \"\n >\n <option value=\"\"></option>\n @for (module of data.modules; track module.id) {\n <option [value]=\"module.moduleKey\">{{ module.name }}</option>\n }\n </select></label\n >\n <label\n >{{ text.text(\"measure\")\n }}<select\n [value]=\"summaryAggregation()\"\n (change)=\"summaryAggregation.set($any($event.target).value)\"\n >\n @for (aggregation of aggregationChoices; track aggregation) {\n <option [value]=\"aggregation\">\n {{ text.text(aggregation) }}\n </option>\n }\n </select></label\n >\n @if (summaryAggregation() !== \"count\") {\n <label\n >{{ text.text(\"property\")\n }}<select\n [value]=\"summaryPropertyKey()\"\n (change)=\"summaryPropertyKey.set($any($event.target).value)\"\n >\n <option value=\"\"></option>\n @for (property of summaryProperties(); track property.key) {\n <option [value]=\"property.key\">{{ property.label }}</option>\n }\n </select></label\n >\n }\n <mt-button\n [label]=\"text.text('addSummary')\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"addSummary()\"\n />\n @if (\n analysisModuleKey() && summaryModuleKey() === analysisModuleKey()\n ) {\n <label\n ><input\n type=\"checkbox\"\n [checked]=\"useModuleFilters()\"\n (change)=\"useModuleFilters.set($any($event.target).checked)\"\n />{{ text.text(\"useModuleFilters\") }}</label\n >\n }\n @for (summary of summaries(); track summary.key) {\n <button type=\"button\" (click)=\"removeSummary(summary.key)\">\n {{ summaryLabel(summary) }} \u00B7 {{ text.text(\"remove\") }}\n </button>\n }\n </div>\n </details>\n @if (data.capabilities.exportAll) {\n <mt-client-studio-export\n [scope]=\"scope()\"\n [propertyKeys]=\"exportFields()\"\n [summaries]=\"summaries()\"\n [query]=\"currentQuery()\"\n kind=\"level\"\n [title]=\"data.name\"\n />\n }\n </div>\n }\n @if (analysisModule(); as module) {\n <div class=\"studio-commands\">\n <mt-button\n [label]=\"text.text('back')\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"analysisModuleKey.set('')\"\n /><label\n ><input\n type=\"checkbox\"\n [checked]=\"includeDescendants()\"\n (change)=\"includeDescendants.set($any($event.target).checked)\"\n />{{ text.text(\"descendants\") }}</label\n >\n </div>\n <mt-client-studio-module-table\n [module]=\"module\"\n [owner]=\"analysisOwner()\"\n [scopeOverride]=\"analysisScope()\"\n [includeDescendants]=\"includeDescendants()\"\n />\n }\n <div [hidden]=\"!!analysisModule()\">\n @if (grid.failed()) {\n <div class=\"studio-section-error\" role=\"alert\">\n {{ text.text(\"failed\") }}\n <mt-button\n [label]=\"text.text('retry')\"\n severity=\"secondary\"\n (onClick)=\"grid.retry()\"\n />\n </div>\n }\n <mt-standard-grid\n #tableHost\n [rows]=\"grid.rows()\"\n [columns]=\"grid.renderColumns()\"\n [rowId]=\"rowId\"\n [server]=\"grid.complete() ? null : recordsPage()\"\n [paged]=\"false\"\n [loading]=\"grid.loading()\"\n [selection]=\"true\"\n [label]=\"title() || data.name || text.text('title')\"\n [chartContext]=\"chartContext() || title() || data.name\"\n [height]=\"gridHeight()\"\n [detail]=\"detail()\"\n [exportable]=\"grid.exportReady()\"\n [exportFormats]=\"grid.exportFormats()\"\n [exporter]=\"grid.exportAs\"\n [exportName]=\"title() || data.name\"\n [rowMenuItems]=\"comparisonMenu\"\n (gridReady)=\"grid.ready($event)\"\n (viewChanged)=\"grid.changed()\"\n (selectionChanged)=\"grid.selection()\"\n [chartPersistence]=\"grid.chartPersistence()\"\n (chartsChanged)=\"grid.chartsChanged()\"\n />\n </div>\n} @else if (failed()) {\n <div class=\"studio-section-error\" role=\"alert\">\n <p>{{ text.text(\"failed\") }}</p>\n <mt-button\n [label]=\"text.text('retry')\"\n (onClick)=\"retry()\"\n severity=\"secondary\"\n />\n </div>\n} @else {\n <div class=\"studio-grid-placeholder\" role=\"status\">\n {{ text.text(\"loading\") }}\n </div>\n}\n", styles: [":host{display:block;min-width:0;font:inherit;color:var(--p-text-color, #27364b)}.studio-workspace{display:grid;gap:12px;padding:0;min-width:0}.studio-empty{color:var(--p-text-muted-color, #667085);font-size:12px}.studio-group-heading{margin:12px 0 0;padding-inline-start:10px;border-inline-start:3px solid var(--p-primary-color, #2aaec0);font-size:15px;font-weight:600}.studio-module,.studio-child-level{min-width:0;scroll-margin-block-start:20px}.studio-grid-placeholder{min-height:420px;display:grid;align-content:center;justify-items:center;gap:12px;border:1px solid var(--p-content-border-color, #e4e7ec);border-radius:6px;color:var(--p-text-muted-color, #667085);background:var(--p-content-background, #fff)}.studio-section-error{display:flex;min-height:120px;flex-wrap:wrap;align-items:center;justify-content:center;gap:16px}@media(max-width:1100px){.studio-workspace{gap:0}}@media(max-width:640px){.studio-workspace{padding:0;gap:0}:host .studio-command-content{position:fixed;inset-inline:12px;inset-block-start:20dvh;min-width:0;max-height:60dvh}}.studio-commands{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin-block:.75rem}.studio-command-menu{position:relative;font-size:.875rem}.studio-command-menu>summary{cursor:pointer;padding:.5rem .75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem}.studio-command-content{position:absolute;inset-block-start:100%;inset-inline-end:0;z-index:30;min-width:18rem;max-height:24rem;overflow:auto;background:var(--p-content-background, white);color:var(--p-text-color, #334155);padding:.75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem;display:grid;gap:.75rem}.studio-command-content label{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.studio-command-content select{width:100%;padding:.5rem;border:1px solid var(--p-content-border-color, #ddd);background:inherit;color:inherit;border-radius:.375rem}.studio-command-content button{text-align:start;padding:.5rem;cursor:pointer}.studio-comparison{min-width:0}.studio-comparison-hint{margin:0 0 1rem;color:var(--p-text-muted-color, #667085);font-size:.875rem}button:focus-visible,summary:focus-visible,select:focus-visible{outline:2px solid var(--p-primary-color, #2aaec0);outline-offset:2px}\n"] }]
2518
- }], ctorParameters: () => [], propDecorators: { levelId: [{ type: i0.Input, args: [{ isSignal: true, alias: "levelId", required: true }] }], scopeOverride: [{ type: i0.Input, args: [{ isSignal: true, alias: "scopeOverride", required: false }] }], ancestorKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "ancestorKeys", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], chartContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "chartContext", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], recordsLoaded: [{ type: i0.Output, args: ["recordsLoaded"] }], recordsFailed: [{ type: i0.Output, args: ["recordsFailed"] }], tableHost: [{ type: i0.ViewChild, args: ['tableHost', { ...{
2628
+ args: [{ selector: 'mt-client-studio-records-table', providers: [provideEntityListTablePreview()], imports: [MtStandardGridComponent, Button, StudioModuleTable, StudioExport], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (catalog(); as data) {\n @if (toolsOpen()) {\n <div class=\"studio-commands\">\n @if (exportRecord(); as record) {\n <mt-client-studio-export\n [scope]=\"{\n kind: 'record',\n levelId: record.levelId,\n recordId: record.recordId,\n }\"\n kind=\"record\"\n [title]=\"record.name\"\n />\n }\n <mt-button\n [label]=\"text.text('close')\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"toolsOpen.set(false)\"\n />\n <mt-button\n [label]=\"text.text('refresh')\"\n icon=\"arrow.refresh-cw-01\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"refresh()\"\n />\n <details class=\"studio-command-menu\">\n <summary>{{ text.text(\"summaries\") }}</summary>\n <div class=\"studio-command-content\">\n <label\n >{{ text.text(\"selectModule\")\n }}<select\n [value]=\"summaryModuleKey()\"\n (change)=\"\n summaryModuleKey.set($any($event.target).value);\n summaryPropertyKey.set('')\n \"\n >\n <option value=\"\"></option>\n @for (module of data.modules; track module.id) {\n <option [value]=\"module.moduleKey\">{{ module.name }}</option>\n }\n </select></label\n >\n <label\n >{{ text.text(\"measure\")\n }}<select\n [value]=\"summaryAggregation()\"\n (change)=\"summaryAggregation.set($any($event.target).value)\"\n >\n @for (aggregation of aggregationChoices; track aggregation) {\n <option [value]=\"aggregation\">\n {{ text.text(aggregation) }}\n </option>\n }\n </select></label\n >\n @if (summaryAggregation() !== \"count\") {\n <label\n >{{ text.text(\"property\")\n }}<select\n [value]=\"summaryPropertyKey()\"\n (change)=\"summaryPropertyKey.set($any($event.target).value)\"\n >\n <option value=\"\"></option>\n @for (property of summaryProperties(); track property.key) {\n <option [value]=\"property.key\">{{ property.label }}</option>\n }\n </select></label\n >\n }\n <mt-button\n [label]=\"text.text('addSummary')\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"addSummary()\"\n />\n @if (\n analysisModuleKey() && summaryModuleKey() === analysisModuleKey()\n ) {\n <label\n ><input\n type=\"checkbox\"\n [checked]=\"useModuleFilters()\"\n (change)=\"useModuleFilters.set($any($event.target).checked)\"\n />{{ text.text(\"useModuleFilters\") }}</label\n >\n }\n @for (summary of summaries(); track summary.key) {\n <button type=\"button\" (click)=\"removeSummary(summary.key)\">\n {{ summaryLabel(summary) }} \u00B7 {{ text.text(\"remove\") }}\n </button>\n }\n </div>\n </details>\n @if (data.capabilities.exportAll) {\n <mt-client-studio-export\n [scope]=\"scope()\"\n [propertyKeys]=\"exportFields()\"\n [summaries]=\"summaries()\"\n [query]=\"currentQuery()\"\n kind=\"level\"\n [title]=\"data.name\"\n />\n }\n </div>\n }\n @if (analysisModule(); as module) {\n <div class=\"studio-commands\">\n <mt-button\n [label]=\"text.text('back')\"\n severity=\"secondary\"\n size=\"small\"\n (onClick)=\"analysisModuleKey.set('')\"\n /><label\n ><input\n type=\"checkbox\"\n [checked]=\"includeDescendants()\"\n (change)=\"includeDescendants.set($any($event.target).checked)\"\n />{{ text.text(\"descendants\") }}</label\n >\n </div>\n <mt-client-studio-module-table\n [module]=\"module\"\n [owner]=\"analysisOwner()\"\n [scopeOverride]=\"analysisScope()\"\n [includeDescendants]=\"includeDescendants()\"\n />\n }\n <div [hidden]=\"!!analysisModule()\">\n @if (grid.failed()) {\n <div class=\"studio-section-error\" role=\"alert\">\n {{ text.text(\"failed\") }}\n <mt-button\n [label]=\"text.text('retry')\"\n severity=\"secondary\"\n (onClick)=\"grid.retry()\"\n />\n </div>\n }\n <mt-standard-grid\n #tableHost\n [rows]=\"grid.rows()\"\n [columns]=\"grid.renderColumns()\"\n [rowId]=\"rowId\"\n [server]=\"grid.complete() ? null : recordsPage()\"\n [paged]=\"false\"\n [loading]=\"grid.loading()\"\n [selection]=\"true\"\n [label]=\"title() || data.name || text.text('title')\"\n [chartContext]=\"chartContext() || title() || data.name\"\n [height]=\"gridHeight()\"\n [detail]=\"detail()\"\n [exportable]=\"grid.exportReady()\"\n [exportFormats]=\"grid.exportFormats()\"\n [exporter]=\"grid.exportAs\"\n [exportName]=\"title() || data.name\"\n [rowMenuLeadItems]=\"openRecordMenu\"\n [rowMenuItems]=\"comparisonMenu\"\n (gridReady)=\"grid.ready($event)\"\n (viewChanged)=\"grid.changed()\"\n (selectionChanged)=\"grid.selection()\"\n [chartPersistence]=\"grid.chartPersistence()\"\n (chartsChanged)=\"grid.chartsChanged()\"\n />\n </div>\n} @else if (failed()) {\n <div class=\"studio-section-error\" role=\"alert\">\n <p>{{ text.text(\"failed\") }}</p>\n <mt-button\n [label]=\"text.text('retry')\"\n (onClick)=\"retry()\"\n severity=\"secondary\"\n />\n </div>\n} @else {\n <div class=\"studio-grid-placeholder\" role=\"status\">\n {{ text.text(\"loading\") }}\n </div>\n}\n", styles: [":host{display:block;min-width:0;font:inherit;color:var(--p-text-color, #27364b)}.studio-workspace{display:grid;gap:12px;padding:0;min-width:0}.studio-empty{color:var(--p-text-muted-color, #667085);font-size:12px}.studio-group-heading{margin:12px 0 0;padding-inline-start:10px;border-inline-start:3px solid var(--p-primary-color, #2aaec0);font-size:15px;font-weight:600}.studio-module,.studio-child-level{min-width:0;scroll-margin-block-start:20px}.studio-grid-placeholder{min-height:420px;display:grid;align-content:center;justify-items:center;gap:12px;border:1px solid var(--p-content-border-color, #e4e7ec);border-radius:6px;color:var(--p-text-muted-color, #667085);background:var(--p-content-background, #fff)}.studio-section-error{display:flex;min-height:120px;flex-wrap:wrap;align-items:center;justify-content:center;gap:16px}@media(max-width:1100px){.studio-workspace{gap:0}}@media(max-width:640px){.studio-workspace{padding:0;gap:0}:host .studio-command-content{position:fixed;inset-inline:12px;inset-block-start:20dvh;min-width:0;max-height:60dvh}}.studio-commands{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin-block:.75rem}.studio-command-menu{position:relative;font-size:.875rem}.studio-command-menu>summary{cursor:pointer;padding:.5rem .75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem}.studio-command-content{position:absolute;inset-block-start:100%;inset-inline-end:0;z-index:30;min-width:18rem;max-height:24rem;overflow:auto;background:var(--p-content-background, white);color:var(--p-text-color, #334155);padding:.75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem;display:grid;gap:.75rem}.studio-command-content label{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.studio-command-content select{width:100%;padding:.5rem;border:1px solid var(--p-content-border-color, #ddd);background:inherit;color:inherit;border-radius:.375rem}.studio-command-content button{text-align:start;padding:.5rem;cursor:pointer}.studio-comparison{min-width:0}.studio-comparison-hint{margin:0 0 1rem;color:var(--p-text-muted-color, #667085);font-size:.875rem}button:focus-visible,summary:focus-visible,select:focus-visible{outline:2px solid var(--p-primary-color, #2aaec0);outline-offset:2px}\n"] }]
2629
+ }], ctorParameters: () => [], propDecorators: { levelId: [{ type: i0.Input, args: [{ isSignal: true, alias: "levelId", required: true }] }], scopeOverride: [{ type: i0.Input, args: [{ isSignal: true, alias: "scopeOverride", required: false }] }], ancestorKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "ancestorKeys", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], chartContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "chartContext", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], recordsLoaded: [{ type: i0.Output, args: ["recordsLoaded"] }], dataLoaded: [{ type: i0.Output, args: ["dataLoaded"] }], recordsFailed: [{ type: i0.Output, args: ["recordsFailed"] }], tableHost: [{ type: i0.ViewChild, args: ['tableHost', { ...{
2519
2630
  read: (ElementRef),
2520
2631
  }, isSignal: true }] }], moduleTable: [{ type: i0.ViewChild, args: [i0.forwardRef(() => StudioModuleTable), { isSignal: true }] }] } });
2521
2632
 
@@ -2635,7 +2746,7 @@ class StudioRecordWorkspace {
2635
2746
  this.retryVersion.update((value) => value + 1);
2636
2747
  }
2637
2748
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StudioRecordWorkspace, deps: [], target: i0.ɵɵFactoryTarget.Component });
2638
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StudioRecordWorkspace, isStandalone: true, selector: "mt-client-studio-record-workspace", inputs: { params: { classPropertyName: "params", publicName: "params", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@if (workspace(); as data) {\r\n <div class=\"studio-workspace\">\r\n @if (tabs().length) {\r\n <mt-tabs\r\n mode=\"underline\"\r\n [options]=\"tabOptions()\"\r\n [(active)]=\"activeTab\"\r\n fluid\r\n />\r\n @if (activeConnection(); as child) {\r\n @for (\r\n entry of [child];\r\n track params().data.id + \":\" + entry.referenceId\r\n ) {\r\n <mt-client-studio-records-table\r\n [levelId]=\"entry.levelId\"\r\n [scopeOverride]=\"connectionScope()\"\r\n [ancestorKeys]=\"ancestorKeys()\"\r\n [title]=\"entry.name\"\r\n [chartContext]=\"chartContext() + ' \u00B7 ' + entry.name\"\r\n />\r\n }\r\n } @else {\r\n @if (moduleOptions().length > 1) {\r\n <mt-tabs\r\n mode=\"underline\"\r\n size=\"small\"\r\n [options]=\"moduleOptions()\"\r\n [(active)]=\"activeModuleId\"\r\n fluid\r\n />\r\n }\r\n @if (activeModule(); as module) {\r\n @for (entry of [module]; track params().data.id + \":\" + entry.id) {\r\n <mt-client-studio-module-table\r\n [module]=\"entry\"\r\n [owner]=\"data.record\"\r\n [sourcePath]=\"chartContext() + ' \u00B7 ' + entry.name\"\r\n />\r\n }\r\n }\r\n }\r\n } @else {\r\n <p class=\"studio-empty\">{{ text.text(\"empty\") }}</p>\r\n }\r\n </div>\r\n} @else if (failed()) {\r\n <div class=\"studio-section-error\" role=\"alert\">\r\n <p>{{ text.text(\"failed\") }}</p>\r\n <mt-button\r\n [label]=\"text.text('retry')\"\r\n severity=\"secondary\"\r\n (onClick)=\"retry()\"\r\n />\r\n </div>\r\n} @else {\r\n <div class=\"studio-grid-placeholder\" role=\"status\">\r\n {{ text.text(\"loading\") }}\r\n </div>\r\n}\r\n", styles: [":host{display:block;min-width:0;font:inherit;color:var(--p-text-color, #27364b)}.studio-workspace{display:grid;gap:12px;padding:0;min-width:0}.studio-empty{color:var(--p-text-muted-color, #667085);font-size:12px}.studio-group-heading{margin:12px 0 0;padding-inline-start:10px;border-inline-start:3px solid var(--p-primary-color, #2aaec0);font-size:15px;font-weight:600}.studio-module,.studio-child-level{min-width:0;scroll-margin-block-start:20px}.studio-grid-placeholder{min-height:420px;display:grid;align-content:center;justify-items:center;gap:12px;border:1px solid var(--p-content-border-color, #e4e7ec);border-radius:6px;color:var(--p-text-muted-color, #667085);background:var(--p-content-background, #fff)}.studio-section-error{display:flex;min-height:120px;flex-wrap:wrap;align-items:center;justify-content:center;gap:16px}@media(max-width:1100px){.studio-workspace{gap:0}}@media(max-width:640px){.studio-workspace{padding:0;gap:0}:host .studio-command-content{position:fixed;inset-inline:12px;inset-block-start:20dvh;min-width:0;max-height:60dvh}}.studio-commands{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin-block:.75rem}.studio-command-menu{position:relative;font-size:.875rem}.studio-command-menu>summary{cursor:pointer;padding:.5rem .75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem}.studio-command-content{position:absolute;inset-block-start:100%;inset-inline-end:0;z-index:30;min-width:18rem;max-height:24rem;overflow:auto;background:var(--p-content-background, white);color:var(--p-text-color, #334155);padding:.75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem;display:grid;gap:.75rem}.studio-command-content label{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.studio-command-content select{width:100%;padding:.5rem;border:1px solid var(--p-content-border-color, #ddd);background:inherit;color:inherit;border-radius:.375rem}.studio-command-content button{text-align:start;padding:.5rem;cursor:pointer}.studio-comparison{min-width:0}.studio-comparison-hint{margin:0 0 1rem;color:var(--p-text-muted-color, #667085);font-size:.875rem}button:focus-visible,summary:focus-visible,select:focus-visible{outline:2px solid var(--p-primary-color, #2aaec0);outline-offset:2px}\n"], dependencies: [{ kind: "component", type: StudioModuleTable, selector: "mt-client-studio-module-table", inputs: ["module", "owner", "scopeOverride", "sectionId", "sourcePath", "includeDescendants"] }, { kind: "component", type: StudioRecordsTable, selector: "mt-client-studio-records-table", inputs: ["levelId", "scopeOverride", "ancestorKeys", "title", "chartContext", "height"], outputs: ["recordsLoaded", "recordsFailed"] }, { 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: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2749
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: StudioRecordWorkspace, isStandalone: true, selector: "mt-client-studio-record-workspace", inputs: { params: { classPropertyName: "params", publicName: "params", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@if (workspace(); as data) {\r\n <div class=\"studio-workspace\">\r\n @if (tabs().length) {\r\n <mt-tabs\r\n mode=\"underline\"\r\n [options]=\"tabOptions()\"\r\n [(active)]=\"activeTab\"\r\n fluid\r\n />\r\n @if (activeConnection(); as child) {\r\n @for (\r\n entry of [child];\r\n track params().data.id + \":\" + entry.referenceId\r\n ) {\r\n <mt-client-studio-records-table\r\n [levelId]=\"entry.levelId\"\r\n [scopeOverride]=\"connectionScope()\"\r\n [ancestorKeys]=\"ancestorKeys()\"\r\n [title]=\"entry.name\"\r\n [chartContext]=\"chartContext() + ' \u00B7 ' + entry.name\"\r\n />\r\n }\r\n } @else {\r\n @if (moduleOptions().length > 1) {\r\n <mt-tabs\r\n mode=\"underline\"\r\n size=\"small\"\r\n [options]=\"moduleOptions()\"\r\n [(active)]=\"activeModuleId\"\r\n fluid\r\n />\r\n }\r\n @if (activeModule(); as module) {\r\n @for (entry of [module]; track params().data.id + \":\" + entry.id) {\r\n <mt-client-studio-module-table\r\n [module]=\"entry\"\r\n [owner]=\"data.record\"\r\n [sourcePath]=\"chartContext() + ' \u00B7 ' + entry.name\"\r\n />\r\n }\r\n }\r\n }\r\n } @else {\r\n <p class=\"studio-empty\">{{ text.text(\"empty\") }}</p>\r\n }\r\n </div>\r\n} @else if (failed()) {\r\n <div class=\"studio-section-error\" role=\"alert\">\r\n <p>{{ text.text(\"failed\") }}</p>\r\n <mt-button\r\n [label]=\"text.text('retry')\"\r\n severity=\"secondary\"\r\n (onClick)=\"retry()\"\r\n />\r\n </div>\r\n} @else {\r\n <div class=\"studio-grid-placeholder\" role=\"status\">\r\n {{ text.text(\"loading\") }}\r\n </div>\r\n}\r\n", styles: [":host{display:block;min-width:0;font:inherit;color:var(--p-text-color, #27364b)}.studio-workspace{display:grid;gap:12px;padding:0;min-width:0}.studio-empty{color:var(--p-text-muted-color, #667085);font-size:12px}.studio-group-heading{margin:12px 0 0;padding-inline-start:10px;border-inline-start:3px solid var(--p-primary-color, #2aaec0);font-size:15px;font-weight:600}.studio-module,.studio-child-level{min-width:0;scroll-margin-block-start:20px}.studio-grid-placeholder{min-height:420px;display:grid;align-content:center;justify-items:center;gap:12px;border:1px solid var(--p-content-border-color, #e4e7ec);border-radius:6px;color:var(--p-text-muted-color, #667085);background:var(--p-content-background, #fff)}.studio-section-error{display:flex;min-height:120px;flex-wrap:wrap;align-items:center;justify-content:center;gap:16px}@media(max-width:1100px){.studio-workspace{gap:0}}@media(max-width:640px){.studio-workspace{padding:0;gap:0}:host .studio-command-content{position:fixed;inset-inline:12px;inset-block-start:20dvh;min-width:0;max-height:60dvh}}.studio-commands{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin-block:.75rem}.studio-command-menu{position:relative;font-size:.875rem}.studio-command-menu>summary{cursor:pointer;padding:.5rem .75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem}.studio-command-content{position:absolute;inset-block-start:100%;inset-inline-end:0;z-index:30;min-width:18rem;max-height:24rem;overflow:auto;background:var(--p-content-background, white);color:var(--p-text-color, #334155);padding:.75rem;border:1px solid var(--p-content-border-color, #ddd);border-radius:.375rem;display:grid;gap:.75rem}.studio-command-content label{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.studio-command-content select{width:100%;padding:.5rem;border:1px solid var(--p-content-border-color, #ddd);background:inherit;color:inherit;border-radius:.375rem}.studio-command-content button{text-align:start;padding:.5rem;cursor:pointer}.studio-comparison{min-width:0}.studio-comparison-hint{margin:0 0 1rem;color:var(--p-text-muted-color, #667085);font-size:.875rem}button:focus-visible,summary:focus-visible,select:focus-visible{outline:2px solid var(--p-primary-color, #2aaec0);outline-offset:2px}\n"], dependencies: [{ kind: "component", type: StudioModuleTable, selector: "mt-client-studio-module-table", inputs: ["module", "owner", "scopeOverride", "sectionId", "sourcePath", "includeDescendants"] }, { kind: "component", type: StudioRecordsTable, selector: "mt-client-studio-records-table", inputs: ["levelId", "scopeOverride", "ancestorKeys", "title", "chartContext", "height"], outputs: ["recordsLoaded", "dataLoaded", "recordsFailed"] }, { 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: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2639
2750
  }
2640
2751
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StudioRecordWorkspace, decorators: [{
2641
2752
  type: Component,
@@ -2669,6 +2780,17 @@ class ClientStudio {
2669
2780
  loaded = output();
2670
2781
  /** The catalog or the records failed, with the message the section shows. */
2671
2782
  errored = output();
2783
+ /**
2784
+ * The user chose "Open record" on a row of any Studio grid. Only offered when
2785
+ * `options.recordOpen` is `true`; the host decides what opening means.
2786
+ */
2787
+ recordOpen = output();
2788
+ /**
2789
+ * The root records load finished (and again after a reload or a context or `key`
2790
+ * change): the root query's `schemas` and each record without its `values`. Tagged
2791
+ * with the context it was loaded for, so a host can discard a stale load.
2792
+ */
2793
+ dataLoaded = output();
2672
2794
  resolved = computed(() => resolveClientStudioContext(this.context()), { ...(ngDevMode ? { debugName: "resolved" } : /* istanbul ignore next */ {}), equal: sameStudioContext });
2673
2795
  schemaId = computed(() => this.resolved().schemaId, ...(ngDevMode ? [{ debugName: "schemaId" }] : /* istanbul ignore next */ []));
2674
2796
  title = computed(() => this.options().title ?? '', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
@@ -2680,7 +2802,7 @@ class ClientStudio {
2680
2802
  text = inject(StudioText);
2681
2803
  announced = null;
2682
2804
  constructor() {
2683
- inject(StudioHost).bind(() => this.resolved(), () => this.options());
2805
+ inject(StudioHost).bind(() => this.resolved(), () => this.options(), (event) => this.recordOpen.emit(event));
2684
2806
  const chartScope = inject(MtGridChartScope), chartStore = inject(MT_GRID_CHART_STORE), configuration = inject(MT_DATA_TABLE_CONFIGURATION$1), injector = inject(Injector);
2685
2807
  let previousScope;
2686
2808
  effect(() => {
@@ -2724,18 +2846,21 @@ class ClientStudio {
2724
2846
  this.announced = identity;
2725
2847
  this.loaded.emit();
2726
2848
  }
2849
+ rootLoaded(event) {
2850
+ this.dataLoaded.emit(event);
2851
+ }
2727
2852
  recordsFailed() {
2728
2853
  this.errored.emit({ message: this.text.text('failed') });
2729
2854
  }
2730
2855
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ClientStudio, deps: [], target: i0.ɵɵFactoryTarget.Component });
2731
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ClientStudio, isStandalone: true, selector: "mt-client-studio", inputs: { context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { loaded: "loaded", errored: "errored" }, host: { styleAttribute: "display:block;min-width:0" }, providers: [
2856
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: ClientStudio, isStandalone: true, selector: "mt-client-studio", inputs: { context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: true, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { loaded: "loaded", errored: "errored", recordOpen: "recordOpen", dataLoaded: "dataLoaded" }, host: { styleAttribute: "display:block;min-width:0" }, providers: [
2732
2857
  StudioHost,
2733
2858
  StudioApiService,
2734
2859
  MtGridChartScope,
2735
2860
  provideStudioChartStore(),
2736
2861
  StudioText,
2737
2862
  { provide: STUDIO_WORKSPACE_RENDERER, useValue: StudioRecordWorkspace },
2738
- ], ngImport: i0, template: "@if (schemaId(); as id) {\r\n <mt-client-studio-records-table\r\n [levelId]=\"id\"\r\n [height]=\"gridHeight()\"\r\n [title]=\"title()\"\r\n (recordsLoaded)=\"recordsLoaded()\"\r\n (recordsFailed)=\"recordsFailed()\"\r\n />\r\n}\r\n", dependencies: [{ kind: "component", type: StudioRecordsTable, selector: "mt-client-studio-records-table", inputs: ["levelId", "scopeOverride", "ancestorKeys", "title", "chartContext", "height"], outputs: ["recordsLoaded", "recordsFailed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2863
+ ], ngImport: i0, template: "@if (schemaId(); as id) {\r\n <mt-client-studio-records-table\r\n [levelId]=\"id\"\r\n [height]=\"gridHeight()\"\r\n [title]=\"title()\"\r\n (recordsLoaded)=\"recordsLoaded()\"\r\n (dataLoaded)=\"rootLoaded($event)\"\r\n (recordsFailed)=\"recordsFailed()\"\r\n />\r\n}\r\n", dependencies: [{ kind: "component", type: StudioRecordsTable, selector: "mt-client-studio-records-table", inputs: ["levelId", "scopeOverride", "ancestorKeys", "title", "chartContext", "height"], outputs: ["recordsLoaded", "dataLoaded", "recordsFailed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2739
2864
  }
2740
2865
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ClientStudio, decorators: [{
2741
2866
  type: Component,
@@ -2746,8 +2871,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
2746
2871
  provideStudioChartStore(),
2747
2872
  StudioText,
2748
2873
  { provide: STUDIO_WORKSPACE_RENDERER, useValue: StudioRecordWorkspace },
2749
- ], host: { style: 'display:block;min-width:0' }, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (schemaId(); as id) {\r\n <mt-client-studio-records-table\r\n [levelId]=\"id\"\r\n [height]=\"gridHeight()\"\r\n [title]=\"title()\"\r\n (recordsLoaded)=\"recordsLoaded()\"\r\n (recordsFailed)=\"recordsFailed()\"\r\n />\r\n}\r\n" }]
2750
- }], ctorParameters: () => [], propDecorators: { context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: true }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], loaded: [{ type: i0.Output, args: ["loaded"] }], errored: [{ type: i0.Output, args: ["errored"] }] } });
2874
+ ], host: { style: 'display:block;min-width:0' }, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (schemaId(); as id) {\r\n <mt-client-studio-records-table\r\n [levelId]=\"id\"\r\n [height]=\"gridHeight()\"\r\n [title]=\"title()\"\r\n (recordsLoaded)=\"recordsLoaded()\"\r\n (dataLoaded)=\"rootLoaded($event)\"\r\n (recordsFailed)=\"recordsFailed()\"\r\n />\r\n}\r\n" }]
2875
+ }], ctorParameters: () => [], propDecorators: { context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: true }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], loaded: [{ type: i0.Output, args: ["loaded"] }], errored: [{ type: i0.Output, args: ["errored"] }], recordOpen: [{ type: i0.Output, args: ["recordOpen"] }], dataLoaded: [{ type: i0.Output, args: ["dataLoaded"] }] } });
2751
2876
 
2752
2877
  /**
2753
2878
  * Generated bundle index. Do not edit.