@masterteam/client-components 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/masterteam-client-components-client-instance-preview.mjs +192 -0
- package/fesm2022/masterteam-client-components-client-instance-preview.mjs.map +1 -0
- package/fesm2022/masterteam-client-components-client-list.mjs +271 -166
- package/fesm2022/masterteam-client-components-client-list.mjs.map +1 -1
- package/package.json +8 -8
- package/types/masterteam-client-components-client-instance-preview.d.ts +104 -0
- package/types/masterteam-client-components-client-list.d.ts +154 -101
- package/fesm2022/masterteam-client-components-client-module-preview.mjs +0 -351
- package/fesm2022/masterteam-client-components-client-module-preview.mjs.map +0 -1
- package/types/masterteam-client-components-client-module-preview.d.ts +0 -35
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Injectable, input, signal, computed, effect, untracked, Component } from '@angular/core';
|
|
3
|
+
import { EntitiesPreview } from '@masterteam/components/entities';
|
|
4
|
+
import { HttpClient } from '@angular/common/http';
|
|
5
|
+
import { forkJoin, map } from 'rxjs';
|
|
6
|
+
|
|
7
|
+
class ClientInstancePreviewApiService {
|
|
8
|
+
http = inject(HttpClient);
|
|
9
|
+
fetchBaseUrl = 'fetch';
|
|
10
|
+
displayConfigBaseUrl = 'display-configurations';
|
|
11
|
+
resolve(config) {
|
|
12
|
+
const contextKey = config.contextKey;
|
|
13
|
+
const areaKeys = config.displayAreas?.length
|
|
14
|
+
? config.displayAreas
|
|
15
|
+
: ['card'];
|
|
16
|
+
return forkJoin({
|
|
17
|
+
recordResponse: this.http.get(`${this.fetchBaseUrl}/records/${config.instanceId}`, {
|
|
18
|
+
params: { contextKey },
|
|
19
|
+
}),
|
|
20
|
+
displayConfigResponse: this.http.get(this.displayConfigBaseUrl, {
|
|
21
|
+
params: {
|
|
22
|
+
contextKey,
|
|
23
|
+
areaKeys,
|
|
24
|
+
},
|
|
25
|
+
}),
|
|
26
|
+
}).pipe(map(({ recordResponse, displayConfigResponse }) => ({
|
|
27
|
+
endpoint: recordResponse.endpoint,
|
|
28
|
+
status: recordResponse.status,
|
|
29
|
+
code: recordResponse.code,
|
|
30
|
+
locale: recordResponse.locale,
|
|
31
|
+
message: recordResponse.message,
|
|
32
|
+
errors: recordResponse.errors,
|
|
33
|
+
cacheSession: recordResponse.cacheSession,
|
|
34
|
+
data: {
|
|
35
|
+
contextKey,
|
|
36
|
+
schemas: recordResponse.data?.schemas ?? [],
|
|
37
|
+
catalog: recordResponse.data?.catalog ?? { properties: [] },
|
|
38
|
+
record: recordResponse.data?.record ?? null,
|
|
39
|
+
displayConfigurations: displayConfigResponse.data ?? [],
|
|
40
|
+
},
|
|
41
|
+
})));
|
|
42
|
+
}
|
|
43
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ClientInstancePreviewApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
44
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ClientInstancePreviewApiService, providedIn: 'root' });
|
|
45
|
+
}
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ClientInstancePreviewApiService, decorators: [{
|
|
47
|
+
type: Injectable,
|
|
48
|
+
args: [{ providedIn: 'root' }]
|
|
49
|
+
}] });
|
|
50
|
+
|
|
51
|
+
class ClientInstancePreview {
|
|
52
|
+
clientInstancePreviewApiService = inject(ClientInstancePreviewApiService);
|
|
53
|
+
loadSub;
|
|
54
|
+
config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
55
|
+
loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
56
|
+
error = signal(null, ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
57
|
+
response = signal(null, ...(ngDevMode ? [{ debugName: "response" }] : []));
|
|
58
|
+
entities = computed(() => mapPreviewToEntities(this.response(), this.config().displayAreas ?? ['card']), ...(ngDevMode ? [{ debugName: "entities" }] : []));
|
|
59
|
+
constructor() {
|
|
60
|
+
effect(() => {
|
|
61
|
+
const config = this.config();
|
|
62
|
+
if (!config) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
untracked(() => this.load(config));
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
load(config) {
|
|
69
|
+
this.loadSub?.unsubscribe();
|
|
70
|
+
this.loading.set(true);
|
|
71
|
+
this.error.set(null);
|
|
72
|
+
this.loadSub = this.clientInstancePreviewApiService
|
|
73
|
+
.resolve(config)
|
|
74
|
+
.subscribe({
|
|
75
|
+
next: (response) => {
|
|
76
|
+
this.loading.set(false);
|
|
77
|
+
this.response.set(response.data);
|
|
78
|
+
},
|
|
79
|
+
error: (error) => {
|
|
80
|
+
this.loading.set(false);
|
|
81
|
+
this.response.set(null);
|
|
82
|
+
const message = error?.error?.message ??
|
|
83
|
+
error?.message ??
|
|
84
|
+
'Failed to load instance preview';
|
|
85
|
+
this.error.set(message);
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
ngOnDestroy() {
|
|
90
|
+
this.loadSub?.unsubscribe();
|
|
91
|
+
}
|
|
92
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ClientInstancePreview, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
93
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.3", type: ClientInstancePreview, isStandalone: true, selector: "mt-client-instance-preview", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@if (loading()) {\r\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\r\n @for (item of [1, 2, 3, 4]; track item) {\r\n <div class=\"rounded-2xl border border-surface-200 bg-surface-50 p-4\">\r\n <div class=\"mb-3 h-4 w-28 animate-pulse rounded bg-surface-200\"></div>\r\n <div class=\"h-5 w-40 animate-pulse rounded bg-surface-200\"></div>\r\n </div>\r\n }\r\n </div>\r\n} @else if (error()) {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-2xl border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ error() }}\r\n </p>\r\n </div>\r\n} @else if (entities().length) {\r\n <mt-entities-preview [entities]=\"entities()\" />\r\n} @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-2xl border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n No preview data is available for this instance.\r\n </p>\r\n </div>\r\n}\r\n", dependencies: [{ kind: "component", type: EntitiesPreview, selector: "mt-entities-preview", inputs: ["entities"] }] });
|
|
94
|
+
}
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ClientInstancePreview, decorators: [{
|
|
96
|
+
type: Component,
|
|
97
|
+
args: [{ selector: 'mt-client-instance-preview', standalone: true, imports: [EntitiesPreview], template: "@if (loading()) {\r\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\r\n @for (item of [1, 2, 3, 4]; track item) {\r\n <div class=\"rounded-2xl border border-surface-200 bg-surface-50 p-4\">\r\n <div class=\"mb-3 h-4 w-28 animate-pulse rounded bg-surface-200\"></div>\r\n <div class=\"h-5 w-40 animate-pulse rounded bg-surface-200\"></div>\r\n </div>\r\n }\r\n </div>\r\n} @else if (error()) {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-2xl border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ error() }}\r\n </p>\r\n </div>\r\n} @else if (entities().length) {\r\n <mt-entities-preview [entities]=\"entities()\" />\r\n} @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-2xl border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n No preview data is available for this instance.\r\n </p>\r\n </div>\r\n}\r\n" }]
|
|
98
|
+
}], ctorParameters: () => [], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }] } });
|
|
99
|
+
function mapPreviewToEntities(response, areaKeys) {
|
|
100
|
+
const record = response?.record;
|
|
101
|
+
if (!record) {
|
|
102
|
+
return [];
|
|
103
|
+
}
|
|
104
|
+
const properties = response?.catalog?.properties ?? [];
|
|
105
|
+
const propertyMetaByKey = new Map(properties.map((property) => [property.normalizedKey, property]));
|
|
106
|
+
const displayConfigurations = response?.displayConfigurations ?? [];
|
|
107
|
+
const orderedKeys = resolvePropertyKeys(record, properties, displayConfigurations, areaKeys);
|
|
108
|
+
return orderedKeys
|
|
109
|
+
.map((propertyKey) => toEntityData(propertyKey, record.values?.[propertyKey], propertyMetaByKey.get(propertyKey), displayConfigurations, areaKeys, record.id))
|
|
110
|
+
.filter((entity) => entity !== null);
|
|
111
|
+
}
|
|
112
|
+
function resolvePropertyKeys(record, properties, displayConfigurations, areaKeys) {
|
|
113
|
+
const orderedDisplayKeys = new Set();
|
|
114
|
+
displayConfigurations
|
|
115
|
+
.filter((config) => areaKeys.includes(config.areaKey))
|
|
116
|
+
.sort((a, b) => {
|
|
117
|
+
const areaDiff = areaKeys.indexOf(a.areaKey) - areaKeys.indexOf(b.areaKey);
|
|
118
|
+
return areaDiff === 0 ? a.order - b.order : areaDiff;
|
|
119
|
+
})
|
|
120
|
+
.forEach((config) => {
|
|
121
|
+
if (config.propertyKey) {
|
|
122
|
+
orderedDisplayKeys.add(config.propertyKey);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
if (orderedDisplayKeys.size) {
|
|
126
|
+
return Array.from(orderedDisplayKeys);
|
|
127
|
+
}
|
|
128
|
+
const propertyKeysWithValues = [...properties]
|
|
129
|
+
.filter((property) => record.values?.[property.normalizedKey] !== undefined)
|
|
130
|
+
.sort((a, b) => a.order - b.order)
|
|
131
|
+
.map((property) => property.normalizedKey);
|
|
132
|
+
if (propertyKeysWithValues.length) {
|
|
133
|
+
return propertyKeysWithValues;
|
|
134
|
+
}
|
|
135
|
+
return Object.keys(record.values ?? {});
|
|
136
|
+
}
|
|
137
|
+
function toEntityData(propertyKey, cell, meta, displayConfigurations, areaKeys, recordId) {
|
|
138
|
+
const displayConfig = resolveDisplayConfiguration(propertyKey, displayConfigurations, areaKeys);
|
|
139
|
+
const viewType = toEntityViewType(meta?.viewType);
|
|
140
|
+
return {
|
|
141
|
+
id: recordId,
|
|
142
|
+
propertyId: meta?.id,
|
|
143
|
+
key: meta?.key ?? propertyKey,
|
|
144
|
+
normalizedKey: meta?.normalizedKey ?? propertyKey,
|
|
145
|
+
name: meta?.label ?? propertyKey,
|
|
146
|
+
rawValue: toRawValue(cell?.raw),
|
|
147
|
+
value: toEntityValue(cell, viewType),
|
|
148
|
+
viewType,
|
|
149
|
+
type: meta?.source,
|
|
150
|
+
order: displayConfig?.order,
|
|
151
|
+
configuration: displayConfig?.configuration ?? meta?.configuration ?? undefined,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function resolveDisplayConfiguration(propertyKey, displayConfigurations, areaKeys) {
|
|
155
|
+
return displayConfigurations
|
|
156
|
+
.filter((config) => config.propertyKey === propertyKey && areaKeys.includes(config.areaKey))
|
|
157
|
+
.sort((a, b) => {
|
|
158
|
+
const areaDiff = areaKeys.indexOf(a.areaKey) - areaKeys.indexOf(b.areaKey);
|
|
159
|
+
return areaDiff === 0 ? a.order - b.order : areaDiff;
|
|
160
|
+
})[0];
|
|
161
|
+
}
|
|
162
|
+
function toEntityValue(cell, viewType) {
|
|
163
|
+
const displayValue = readCellDisplayValue(cell);
|
|
164
|
+
switch (viewType) {
|
|
165
|
+
case 'Status':
|
|
166
|
+
case 'Lookup':
|
|
167
|
+
case 'User':
|
|
168
|
+
case 'Attachment':
|
|
169
|
+
return (cell?.value ?? null);
|
|
170
|
+
default:
|
|
171
|
+
return displayValue;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function readCellDisplayValue(cell) {
|
|
175
|
+
return String(cell?.display ?? cell?.value ?? cell?.raw ?? '');
|
|
176
|
+
}
|
|
177
|
+
function toRawValue(value) {
|
|
178
|
+
if (value === null || value === undefined) {
|
|
179
|
+
return undefined;
|
|
180
|
+
}
|
|
181
|
+
return String(value);
|
|
182
|
+
}
|
|
183
|
+
function toEntityViewType(value) {
|
|
184
|
+
return (value ?? 'Text');
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Generated bundle index. Do not edit.
|
|
189
|
+
*/
|
|
190
|
+
|
|
191
|
+
export { ClientInstancePreview, ClientInstancePreviewApiService };
|
|
192
|
+
//# sourceMappingURL=masterteam-client-components-client-instance-preview.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"masterteam-client-components-client-instance-preview.mjs","sources":["../../../../packages/masterteam/client-components/client-instance-preview/client-instance-preview-api.service.ts","../../../../packages/masterteam/client-components/client-instance-preview/client-instance-preview.ts","../../../../packages/masterteam/client-components/client-instance-preview/client-instance-preview.html","../../../../packages/masterteam/client-components/client-instance-preview/masterteam-client-components-client-instance-preview.ts"],"sourcesContent":["import { Injectable, inject } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { forkJoin, map, Observable } from 'rxjs';\nimport {\n ClientInstancePreviewConfig,\n DisplayConfiguration,\n PreviewFetchRecordResponse,\n PreviewResponse,\n Response,\n} from './client-instance-preview.model';\n\n@Injectable({ providedIn: 'root' })\nexport class ClientInstancePreviewApiService {\n private readonly http = inject(HttpClient);\n private readonly fetchBaseUrl = 'fetch';\n private readonly displayConfigBaseUrl = 'display-configurations';\n\n resolve(\n config: ClientInstancePreviewConfig,\n ): Observable<Response<PreviewResponse>> {\n const contextKey = config.contextKey;\n const areaKeys = config.displayAreas?.length\n ? config.displayAreas\n : ['card'];\n\n return forkJoin({\n recordResponse: this.http.get<Response<PreviewFetchRecordResponse>>(\n `${this.fetchBaseUrl}/records/${config.instanceId}`,\n {\n params: { contextKey },\n },\n ),\n displayConfigResponse: this.http.get<Response<DisplayConfiguration[]>>(\n this.displayConfigBaseUrl,\n {\n params: {\n contextKey,\n areaKeys,\n },\n },\n ),\n }).pipe(\n map(({ recordResponse, displayConfigResponse }) => ({\n endpoint: recordResponse.endpoint,\n status: recordResponse.status,\n code: recordResponse.code,\n locale: recordResponse.locale,\n message: recordResponse.message,\n errors: recordResponse.errors,\n cacheSession: recordResponse.cacheSession,\n data: {\n contextKey,\n schemas: recordResponse.data?.schemas ?? [],\n catalog: recordResponse.data?.catalog ?? { properties: [] },\n record: recordResponse.data?.record ?? null,\n displayConfigurations: displayConfigResponse.data ?? [],\n },\n })),\n );\n }\n}\n","import {\n Component,\n computed,\n effect,\n inject,\n input,\n OnDestroy,\n signal,\n untracked,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\n\nimport { EntitiesPreview, EntityData } from '@masterteam/components/entities';\n\nimport { ClientInstancePreviewApiService } from './client-instance-preview-api.service';\nimport {\n ClientInstancePreviewConfig,\n DisplayConfiguration,\n PreviewFetchPropertyMeta,\n PreviewFetchRecord,\n PreviewFetchValueCell,\n PreviewResponse,\n} from './client-instance-preview.model';\n\n@Component({\n selector: 'mt-client-instance-preview',\n standalone: true,\n imports: [EntitiesPreview],\n templateUrl: './client-instance-preview.html',\n})\nexport class ClientInstancePreview implements OnDestroy {\n private readonly clientInstancePreviewApiService = inject(\n ClientInstancePreviewApiService,\n );\n private loadSub?: Subscription;\n\n readonly config = input.required<ClientInstancePreviewConfig>();\n readonly loading = signal(false);\n readonly error = signal<string | null>(null);\n readonly response = signal<PreviewResponse | null>(null);\n\n readonly entities = computed(() =>\n mapPreviewToEntities(\n this.response(),\n this.config().displayAreas ?? ['card'],\n ),\n );\n\n constructor() {\n effect(() => {\n const config = this.config();\n if (!config) {\n return;\n }\n\n untracked(() => this.load(config));\n });\n }\n\n load(config: ClientInstancePreviewConfig): void {\n this.loadSub?.unsubscribe();\n this.loading.set(true);\n this.error.set(null);\n\n this.loadSub = this.clientInstancePreviewApiService\n .resolve(config)\n .subscribe({\n next: (response) => {\n this.loading.set(false);\n this.response.set(response.data);\n },\n error: (error) => {\n this.loading.set(false);\n this.response.set(null);\n const message =\n error?.error?.message ??\n error?.message ??\n 'Failed to load instance preview';\n this.error.set(message);\n },\n });\n }\n\n ngOnDestroy(): void {\n this.loadSub?.unsubscribe();\n }\n}\n\nfunction mapPreviewToEntities(\n response: PreviewResponse | null,\n areaKeys: string[],\n): EntityData[] {\n const record = response?.record;\n if (!record) {\n return [];\n }\n\n const properties = response?.catalog?.properties ?? [];\n const propertyMetaByKey = new Map(\n properties.map((property) => [property.normalizedKey, property]),\n );\n const displayConfigurations = response?.displayConfigurations ?? [];\n const orderedKeys = resolvePropertyKeys(\n record,\n properties,\n displayConfigurations,\n areaKeys,\n );\n\n return orderedKeys\n .map((propertyKey) =>\n toEntityData(\n propertyKey,\n record.values?.[propertyKey],\n propertyMetaByKey.get(propertyKey),\n displayConfigurations,\n areaKeys,\n record.id,\n ),\n )\n .filter((entity): entity is EntityData => entity !== null);\n}\n\nfunction resolvePropertyKeys(\n record: PreviewFetchRecord,\n properties: PreviewFetchPropertyMeta[],\n displayConfigurations: DisplayConfiguration[],\n areaKeys: string[],\n): string[] {\n const orderedDisplayKeys = new Set<string>();\n\n displayConfigurations\n .filter((config) => areaKeys.includes(config.areaKey))\n .sort((a, b) => {\n const areaDiff =\n areaKeys.indexOf(a.areaKey) - areaKeys.indexOf(b.areaKey);\n\n return areaDiff === 0 ? a.order - b.order : areaDiff;\n })\n .forEach((config) => {\n if (config.propertyKey) {\n orderedDisplayKeys.add(config.propertyKey);\n }\n });\n\n if (orderedDisplayKeys.size) {\n return Array.from(orderedDisplayKeys);\n }\n\n const propertyKeysWithValues = [...properties]\n .filter((property) => record.values?.[property.normalizedKey] !== undefined)\n .sort((a, b) => a.order - b.order)\n .map((property) => property.normalizedKey);\n\n if (propertyKeysWithValues.length) {\n return propertyKeysWithValues;\n }\n\n return Object.keys(record.values ?? {});\n}\n\nfunction toEntityData(\n propertyKey: string,\n cell: PreviewFetchValueCell | undefined,\n meta: PreviewFetchPropertyMeta | undefined,\n displayConfigurations: DisplayConfiguration[],\n areaKeys: string[],\n recordId: number,\n): EntityData | null {\n const displayConfig = resolveDisplayConfiguration(\n propertyKey,\n displayConfigurations,\n areaKeys,\n );\n const viewType = toEntityViewType(meta?.viewType);\n\n return {\n id: recordId,\n propertyId: meta?.id,\n key: meta?.key ?? propertyKey,\n normalizedKey: meta?.normalizedKey ?? propertyKey,\n name: meta?.label ?? propertyKey,\n rawValue: toRawValue(cell?.raw),\n value: toEntityValue(cell, viewType),\n viewType,\n type: meta?.source,\n order: displayConfig?.order,\n configuration:\n displayConfig?.configuration ?? meta?.configuration ?? undefined,\n };\n}\n\nfunction resolveDisplayConfiguration(\n propertyKey: string,\n displayConfigurations: DisplayConfiguration[],\n areaKeys: string[],\n): DisplayConfiguration | undefined {\n return displayConfigurations\n .filter(\n (config) =>\n config.propertyKey === propertyKey && areaKeys.includes(config.areaKey),\n )\n .sort((a, b) => {\n const areaDiff =\n areaKeys.indexOf(a.areaKey) - areaKeys.indexOf(b.areaKey);\n\n return areaDiff === 0 ? a.order - b.order : areaDiff;\n })[0];\n}\n\nfunction toEntityValue(\n cell: PreviewFetchValueCell | undefined,\n viewType: EntityData['viewType'],\n): EntityData['value'] {\n const displayValue = readCellDisplayValue(cell);\n\n switch (viewType) {\n case 'Status':\n case 'Lookup':\n case 'User':\n case 'Attachment':\n return (cell?.value ?? null) as EntityData['value'];\n default:\n return displayValue;\n }\n}\n\nfunction readCellDisplayValue(cell: PreviewFetchValueCell | undefined): string {\n return String(cell?.display ?? cell?.value ?? cell?.raw ?? '');\n}\n\nfunction toRawValue(value: unknown): string | undefined {\n if (value === null || value === undefined) {\n return undefined;\n }\n\n return String(value);\n}\n\nfunction toEntityViewType(value: string | undefined): EntityData['viewType'] {\n return (value ?? 'Text') as EntityData['viewType'];\n}\n","@if (loading()) {\r\n <div class=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\r\n @for (item of [1, 2, 3, 4]; track item) {\r\n <div class=\"rounded-2xl border border-surface-200 bg-surface-50 p-4\">\r\n <div class=\"mb-3 h-4 w-28 animate-pulse rounded bg-surface-200\"></div>\r\n <div class=\"h-5 w-40 animate-pulse rounded bg-surface-200\"></div>\r\n </div>\r\n }\r\n </div>\r\n} @else if (error()) {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-2xl border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n {{ error() }}\r\n </p>\r\n </div>\r\n} @else if (entities().length) {\r\n <mt-entities-preview [entities]=\"entities()\" />\r\n} @else {\r\n <div\r\n class=\"flex min-h-[22rem] items-center justify-center rounded-2xl border border-dashed border-surface-300 bg-surface-50 p-6\"\r\n >\r\n <p class=\"max-w-md text-center text-sm text-surface-500\">\r\n No preview data is available for this instance.\r\n </p>\r\n </div>\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAYa,+BAA+B,CAAA;AACzB,IAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;IACzB,YAAY,GAAG,OAAO;IACtB,oBAAoB,GAAG,wBAAwB;AAEhE,IAAA,OAAO,CACL,MAAmC,EAAA;AAEnC,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU;AACpC,QAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,YAAY,EAAE;cAClC,MAAM,CAAC;AACT,cAAE,CAAC,MAAM,CAAC;AAEZ,QAAA,OAAO,QAAQ,CAAC;A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