@praxisui/core 10.0.0-rc.38 → 10.0.0-rc.39
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/ai/component-registry.json +4 -4
- package/fesm2022/praxisui-core-schema.mjs +483 -4
- package/fesm2022/praxisui-core.mjs +7588 -4548
- package/package.json +1 -1
- package/theme-bridge.css +81 -0
- package/theming/_theming.scss +96 -0
- package/types/praxisui-core-schema.d.ts +221 -131
- package/types/praxisui-core.d.ts +2215 -1586
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
|
-
"generatedAt": "2026-10-
|
|
3
|
+
"generatedAt": "2026-10-26T17:40:14.409Z",
|
|
4
4
|
"packageName": "@praxisui/core",
|
|
5
|
-
"packageVersion": "10.0.0-rc.
|
|
5
|
+
"packageVersion": "10.0.0-rc.39",
|
|
6
6
|
"sourceRegistry": "praxis-component-registry-ingestion",
|
|
7
7
|
"sourceRegistryVersion": "1.0.0",
|
|
8
8
|
"componentCount": 4,
|
|
@@ -5104,9 +5104,9 @@
|
|
|
5104
5104
|
{
|
|
5105
5105
|
"chunkIndex": 201,
|
|
5106
5106
|
"chunkKind": "recipe",
|
|
5107
|
-
"content": "{\"_comment\":\"Recipe para agentes criarem uma Praxis Dynamic Page com tabela rica sobre o quickstart publicado.\",\"_comment2\":\"Use quando a meta for demonstrar renderers, formatters e configuracao de coluna em praxis-table sem mudar o backend.\",\"templateMeta\":{\"registryKey\":\"praxis-dynamic-page\",\"variantId\":\"rich-table-surface\",\"status\":\"public-example\",\"useWhen\":\"Create a metadata-driven page that turns one resource table into a rich operational surface with explicit renderers and formatters.\",\"examplePrompts\":[\"crie uma tabela rica de funcionarios com avatar, badges, salario e datas\",\"gere um exemplo de praxis-table mostrando renderers e formatters\",\"monte uma dynamic page com tabela operacional usando o quickstart publicado\"]},\"platformValue\":{\"canonicalContract\":\"praxis-metadata-starter publishes the structural funcionarios schema through /schemas/filtered.\",\"referenceApi\":\"praxis-api-quickstart serves funcionarios data and options on Render.\",\"angularRuntime\":\"@praxisui/core resolves praxis-dynamic-page and @praxisui/table renders the configured table.\",\"publicExamples\":\"praxis-ui-landing-page exposes the JSON envelope, live runtime preview and capability coverage map.\",\"agentCorpus\":\"praxisui-http-examples provides executable metadata and filter evidence.\"},\"operationalEvidence\":{\"baseUrl\":\"https://praxis-api-quickstart.onrender.com\",\"safeFirstIds\":[\"filtered-schema-response-funcionarios\",\"funcionarios-filter-basic\"],\"httpExamples\":[\"praxisui-http-examples/http/metadata/filtered_schema_response_funcionarios.http\",\"praxisui-http-examples/http/resources/funcionarios_filter_basic.http\"]},\"authoringGuidance\":[\"Keep resourcePath as the base resource path, without /filter.\",\"Let /schemas/filtered provide the canonical field metadata.\",\"Keep columns empty and use columnProjection overrides for renderers, formatting, width, sticky columns and visual density.\",\"Prefer renderer examples that map to real backend fields; do not invent frontend-only fields for a remote example.\",\"Keep status presentation read-only unless a real backend action is configured.\",\"Treat salary as sensitive demonstration data; real hosts should gate visibility and exports through policy.\",\"Emit rowClick and selectionChange so the page can later compose this table with forms, charts or actions.\"],\"teaches\":[\"table.renderers.avatar\",\"table.renderers.compose\",\"table.renderers.badge\",\"table.renderers.chip\",\"table.conditional-renderers.status-badge\",\"table.formatters.currency\",\"table.formatters.date\",\"table.selection-state\"],\"page\":{\"layout\":{\"orientation\":\"columns\",\"columns\":1,\"gap\":\"16px\"},\"widgets\":[{\"key\":\"funcionariosRichTable\",\"shell\":{\"kind\":\"dashboard-card\",\"icon\":\"table\",\"title\":\"Funcionarios rich surface\",\"subtitle\":\"Renderers, formatters and dense business columns\"},\"definition\":{\"id\":\"praxis-table\",\"bindingOrder\":[\"config\",\"resourcePath\"],\"inputs\":{\"resourcePath\":\"human-resources/funcionarios\",\"tableId\":\"human-resources-funcionarios-rich-surface\",\"config\":{\"toolbar\":{\"visible\":true,\"title\":\"Funcionarios\",\"subtitle\":\"Rich metadata-driven employee surface\"},\"columns\":[],\"columnProjection\":{\"source\":\"schema\",\"include\":[\"nomeCompleto\",\"email\",\"telefone\",\"salario\",\"cargoNome\",\"departamentoNome\",\"estadoCivil\",\"dataAdmissao\",\"dataNascimento\",\"ativo\"],\"overrides\":{\"nomeCompleto\":{\"header\":\"Nome Completo\",\"sticky\":\"start\",\"width\":\"260px\",\"renderer\":{\"type\":\"compose\",\"compose\":{\"items\":[{\"type\":\"avatar\",\"avatar\":{\"srcField\":\"avatarUrl\",\"altField\":\"nomeCompleto\",\"initialsField\":\"nomeCompleto\",\"shape\":\"circle\",\"size\":36}},{\"type\":\"value\",\"field\":\"nomeCompleto\"}],\"layout\":{\"direction\":\"
|
|
5107
|
+
"content": "{\"_comment\":\"Recipe para agentes criarem uma Praxis Dynamic Page com tabela rica sobre o quickstart publicado.\",\"_comment2\":\"Use quando a meta for demonstrar renderers, formatters e configuracao de coluna em praxis-table sem mudar o backend.\",\"templateMeta\":{\"registryKey\":\"praxis-dynamic-page\",\"variantId\":\"rich-table-surface\",\"status\":\"public-example\",\"useWhen\":\"Create a metadata-driven page that turns one resource table into a rich operational surface with explicit renderers and formatters.\",\"examplePrompts\":[\"crie uma tabela rica de funcionarios com avatar, badges, salario e datas\",\"gere um exemplo de praxis-table mostrando renderers e formatters\",\"monte uma dynamic page com tabela operacional usando o quickstart publicado\"]},\"platformValue\":{\"canonicalContract\":\"praxis-metadata-starter publishes the structural funcionarios schema through /schemas/filtered.\",\"referenceApi\":\"praxis-api-quickstart serves funcionarios data and options on Render.\",\"angularRuntime\":\"@praxisui/core resolves praxis-dynamic-page and @praxisui/table renders the configured table.\",\"publicExamples\":\"praxis-ui-landing-page exposes the JSON envelope, live runtime preview and capability coverage map.\",\"agentCorpus\":\"praxisui-http-examples provides executable metadata and filter evidence.\"},\"operationalEvidence\":{\"baseUrl\":\"https://praxis-api-quickstart.onrender.com\",\"safeFirstIds\":[\"filtered-schema-response-funcionarios\",\"funcionarios-filter-basic\"],\"httpExamples\":[\"praxisui-http-examples/http/metadata/filtered_schema_response_funcionarios.http\",\"praxisui-http-examples/http/resources/funcionarios_filter_basic.http\"]},\"authoringGuidance\":[\"Keep resourcePath as the base resource path, without /filter.\",\"Let /schemas/filtered provide the canonical field metadata.\",\"Keep columns empty and use columnProjection overrides for renderers, formatting, width, sticky columns and visual density.\",\"Prefer renderer examples that map to real backend fields; do not invent frontend-only fields for a remote example.\",\"Keep status presentation read-only unless a real backend action is configured.\",\"Treat salary as sensitive demonstration data; real hosts should gate visibility and exports through policy.\",\"Use praxis-table when the user needs multi-column alignment, per-column sort/filter/export, media-object identity (direction: media), label/value property groups (direction: column) and radial/bullet micro-visualizations; use praxis-list when the collection is a responsive object stream without tabular column comparison.\",\"Emit rowClick and selectionChange so the page can later compose this table with forms, charts or actions.\"],\"teaches\":[\"table.renderers.avatar\",\"table.renderers.compose\",\"table.renderers.badge\",\"table.renderers.chip\",\"table.conditional-renderers.status-badge\",\"table.formatters.currency\",\"table.formatters.date\",\"table.selection-state\"],\"page\":{\"layout\":{\"orientation\":\"columns\",\"columns\":1,\"gap\":\"16px\"},\"widgets\":[{\"key\":\"funcionariosRichTable\",\"shell\":{\"kind\":\"dashboard-card\",\"icon\":\"table\",\"title\":\"Funcionarios rich surface\",\"subtitle\":\"Renderers, formatters and dense business columns\"},\"definition\":{\"id\":\"praxis-table\",\"bindingOrder\":[\"config\",\"resourcePath\"],\"inputs\":{\"resourcePath\":\"human-resources/funcionarios\",\"tableId\":\"human-resources-funcionarios-rich-surface\",\"config\":{\"toolbar\":{\"visible\":true,\"title\":\"Funcionarios\",\"subtitle\":\"Rich metadata-driven employee surface\"},\"columns\":[],\"columnProjection\":{\"source\":\"schema\",\"include\":[\"nomeCompleto\",\"email\",\"telefone\",\"salario\",\"cargoNome\",\"departamentoNome\",\"estadoCivil\",\"dataAdmissao\",\"dataNascimento\",\"ativo\"],\"overrides\":{\"nomeCompleto\":{\"header\":\"Nome Completo\",\"sticky\":\"start\",\"width\":\"260px\",\"renderer\":{\"type\":\"compose\",\"compose\":{\"items\":[{\"type\":\"avatar\",\"avatar\":{\"srcField\":\"avatarUrl\",\"altField\":\"nomeCompleto\",\"initialsField\":\"nomeCompleto\",\"shape\":\"circle\",\"size\":36}},{\"type\":\"value\",\"field\":\"nomeCompleto\",\"emphasis\":\"strong\"},{\"type\":\"value\",\"field\":\"email\",\"emphasis\":\"subtle\"}],\"layout\":{\"direction\":\"media\",\"align\":\"center\",\"gap\":10,\"ellipsis\":true}}}},\"email\":{\"header\":\"Email\",\"width\":\"260px\"},\"telefone\":{\"header\":\"Telefone\",\"width\":\"160px\"},\"salario\":{\"header\":\"Salario\",\"type\":\"currency\",\"align\":\"end\",\"format\":\"BRL|symbol|2\",\"width\":\"150px\"},\"cargoNome\":{\"header\":\"Cargo\",\"renderer\":{\"type\":\"chip\",\"chip\":{\"textField\":\"cargoNome\",\"variant\":\"outlined\",\"color\":\"primary\"}},\"width\":\"190px\"},\"departamentoNome\":{\"header\":\"Departamento\",\"renderer\":{\"type\":\"badge\",\"badge\":{\"textField\":\"departamentoNome\",\"variant\":\"soft\",\"color\":\"accent\"}},\"width\":\"180px\"},\"estadoCivil\":{\"header\":\"Estado Civil\",\"renderer\":{\"type\":\"badge\",\"badge\":{\"textField\":\"estadoCivil\",\"variant\":\"outlined\",\"color\":\"primary\"}},\"width\":\"150px\"},\"dataAdmissao\":{\"header\":\"Data de Admissao\",\"format\":\"dd/MM/yyyy\",\"width\":\"170px\"},\"dataNascimento\":{\"header\":\"Data de Nascimento\",\"format\":\"dd/MM/yyyy\",\"width\":\"190px\"},\"ativo\":{\"header\":\"Status\",\"align\":\"center\",\"format\":\"active-inactive\",\"width\":\"130px\",\"conditionalRenderers\":[{\"id\":\"status-ativo\",\"condition\":{\"==\":[{\"var\":\"ativo\"},true]},\"renderer\":{\"type\":\"badge\",\"badge\":{\"text\":\"Ativo\",\"color\":\"success\",\"variant\":\"filled\",\"icon\":\"check_circle\"}}},{\"id\":\"status-inativo\",\"condition\":{\"==\":[{\"var\":\"ativo\"},false]},\"renderer\":{\"type\":\"badge\",\"badge\":{\"text\":\"Inativo\",\"color\":\"warn\",\"variant\":\"outlined\",\"icon\":\"block\"}}}]}}},\"behavior\":{\"selection\":{\"enabled\":true,\"type\":\"multiple\"},\"density\":\"compact\"}}},\"outputs\":{\"rowClick\":\"emit\",\"selectionChange\":\"emit\"}}}]}}",
|
|
5108
5108
|
"sourcePointer": "examples/ai-recipes/praxis-dynamic-page.rich-table-surface.json",
|
|
5109
|
-
"contentHash": "
|
|
5109
|
+
"contentHash": "cc807ac71d922a21f8b8ef8435c2e5c7bcf816fab16df96e174077caf807a754",
|
|
5110
5110
|
"sourceKind": "component_definition",
|
|
5111
5111
|
"sourceId": "praxis-dynamic-page",
|
|
5112
5112
|
"corpusVersion": "1.0.0"
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
|
|
1
3
|
function normalizeFieldAccessMetadata(value) {
|
|
2
4
|
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
3
5
|
return undefined;
|
|
@@ -1054,6 +1056,288 @@ function renderFallbackVisualizationHtml(visualization, tone) {
|
|
|
1054
1056
|
>${escapeHtml(visualization.fallbackText)}</span>`;
|
|
1055
1057
|
}
|
|
1056
1058
|
|
|
1059
|
+
const PRAXIS_QUICK_VIEW_PRESENTER = new InjectionToken('PRAXIS_QUICK_VIEW_PRESENTER');
|
|
1060
|
+
const PRAXIS_QUICK_VIEW_BODY_RENDERER = new InjectionToken('PRAXIS_QUICK_VIEW_BODY_RENDERER');
|
|
1061
|
+
const FORBIDDEN_BINDING_KEYS = new Set([
|
|
1062
|
+
'element',
|
|
1063
|
+
'nativeElement',
|
|
1064
|
+
'anchor',
|
|
1065
|
+
'hostElement',
|
|
1066
|
+
'focusOrigin',
|
|
1067
|
+
'getViewportRect',
|
|
1068
|
+
'nodes',
|
|
1069
|
+
'document',
|
|
1070
|
+
'action',
|
|
1071
|
+
'actions',
|
|
1072
|
+
'ctaAction',
|
|
1073
|
+
'overrideAction',
|
|
1074
|
+
'route',
|
|
1075
|
+
'href',
|
|
1076
|
+
'payload',
|
|
1077
|
+
'hostCapabilities',
|
|
1078
|
+
]);
|
|
1079
|
+
const RESOURCE_KEY_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,199}$/;
|
|
1080
|
+
/**
|
|
1081
|
+
* Detecta se um valor candidato à serialização contém referências efêmeras de DOM ou funções.
|
|
1082
|
+
*/
|
|
1083
|
+
function containsEphemeralQuickViewRuntimeValue(value, visited = new Set()) {
|
|
1084
|
+
if (!value || typeof value !== 'object') {
|
|
1085
|
+
return typeof value === 'function';
|
|
1086
|
+
}
|
|
1087
|
+
if (visited.has(value)) {
|
|
1088
|
+
return false;
|
|
1089
|
+
}
|
|
1090
|
+
visited.add(value);
|
|
1091
|
+
if (typeof Element !== 'undefined' && value instanceof Element) {
|
|
1092
|
+
return true;
|
|
1093
|
+
}
|
|
1094
|
+
if (typeof value.nodeType === 'number' &&
|
|
1095
|
+
typeof value.nodeName === 'string') {
|
|
1096
|
+
return true;
|
|
1097
|
+
}
|
|
1098
|
+
if (Array.isArray(value)) {
|
|
1099
|
+
return value.some((item) => containsEphemeralQuickViewRuntimeValue(item, visited));
|
|
1100
|
+
}
|
|
1101
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
1102
|
+
if (key === 'element' ||
|
|
1103
|
+
key === 'nativeElement' ||
|
|
1104
|
+
key === 'hostElement' ||
|
|
1105
|
+
key === 'focusOrigin' ||
|
|
1106
|
+
typeof entry === 'function') {
|
|
1107
|
+
return true;
|
|
1108
|
+
}
|
|
1109
|
+
if (containsEphemeralQuickViewRuntimeValue(entry, visited)) {
|
|
1110
|
+
return true;
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
return false;
|
|
1114
|
+
}
|
|
1115
|
+
function normalizeResourceRecordOpenReference(candidate) {
|
|
1116
|
+
if (!candidate || typeof candidate !== 'object' || Array.isArray(candidate)) {
|
|
1117
|
+
return null;
|
|
1118
|
+
}
|
|
1119
|
+
const record = candidate;
|
|
1120
|
+
const target = record['target'] && typeof record['target'] === 'object' && !Array.isArray(record['target'])
|
|
1121
|
+
? record['target']
|
|
1122
|
+
: null;
|
|
1123
|
+
const sourceIdentityField = typeof record['sourceIdentityField'] === 'string'
|
|
1124
|
+
? record['sourceIdentityField'].trim()
|
|
1125
|
+
: '';
|
|
1126
|
+
const resourceKey = typeof target?.['resourceKey'] === 'string'
|
|
1127
|
+
? target['resourceKey'].trim()
|
|
1128
|
+
: '';
|
|
1129
|
+
const surfaceId = typeof target?.['surfaceId'] === 'string'
|
|
1130
|
+
? target['surfaceId'].trim()
|
|
1131
|
+
: '';
|
|
1132
|
+
if (!sourceIdentityField ||
|
|
1133
|
+
sourceIdentityField.length > 200 ||
|
|
1134
|
+
!RESOURCE_KEY_PATTERN.test(resourceKey) ||
|
|
1135
|
+
!surfaceId ||
|
|
1136
|
+
surfaceId.length > 200) {
|
|
1137
|
+
return null;
|
|
1138
|
+
}
|
|
1139
|
+
return {
|
|
1140
|
+
sourceIdentityField,
|
|
1141
|
+
target: {
|
|
1142
|
+
resourceKey,
|
|
1143
|
+
surfaceId,
|
|
1144
|
+
},
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1147
|
+
/**
|
|
1148
|
+
* Valida e normaliza um `ResourceQuickViewBinding` de forma fail-closed.
|
|
1149
|
+
*/
|
|
1150
|
+
function validateResourceQuickViewBinding(value) {
|
|
1151
|
+
const diagnostics = [];
|
|
1152
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
1153
|
+
return {
|
|
1154
|
+
valid: false,
|
|
1155
|
+
binding: null,
|
|
1156
|
+
diagnostics: ['Quick View binding must be a non-null object.'],
|
|
1157
|
+
};
|
|
1158
|
+
}
|
|
1159
|
+
const record = value;
|
|
1160
|
+
for (const forbiddenKey of FORBIDDEN_BINDING_KEYS) {
|
|
1161
|
+
if (forbiddenKey in record && record[forbiddenKey] !== undefined) {
|
|
1162
|
+
diagnostics.push(`Quick View binding cannot contain runtime, inline document or action override property "${forbiddenKey}".`);
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
if (containsEphemeralQuickViewRuntimeValue(record)) {
|
|
1166
|
+
diagnostics.push('Quick View binding cannot contain DOM elements or functions.');
|
|
1167
|
+
}
|
|
1168
|
+
const rawRecordOpen = record['recordOpen'];
|
|
1169
|
+
if (!rawRecordOpen || typeof rawRecordOpen !== 'object' || Array.isArray(rawRecordOpen)) {
|
|
1170
|
+
diagnostics.push('Quick View binding requires a valid "recordOpen" object.');
|
|
1171
|
+
}
|
|
1172
|
+
else {
|
|
1173
|
+
const recordOpenObj = rawRecordOpen;
|
|
1174
|
+
for (const forbiddenKey of FORBIDDEN_BINDING_KEYS) {
|
|
1175
|
+
if (forbiddenKey in recordOpenObj && recordOpenObj[forbiddenKey] !== undefined) {
|
|
1176
|
+
diagnostics.push(`Quick View recordOpen cannot contain override property "${forbiddenKey}".`);
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
if ('presentation' in recordOpenObj && recordOpenObj['presentation'] === 'popover') {
|
|
1180
|
+
diagnostics.push('Quick View recordOpen cannot declare "popover" presentation.');
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
let detailPresentation;
|
|
1184
|
+
const rawDetailPresentation = record['detailPresentation'];
|
|
1185
|
+
if (rawDetailPresentation !== undefined && rawDetailPresentation !== null) {
|
|
1186
|
+
if (rawDetailPresentation === 'drawer' || rawDetailPresentation === 'modal') {
|
|
1187
|
+
detailPresentation = rawDetailPresentation;
|
|
1188
|
+
}
|
|
1189
|
+
else {
|
|
1190
|
+
diagnostics.push(`Quick View detailPresentation must be "drawer" or "modal"; received "${String(rawDetailPresentation)}".`);
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
const normalizedRecordOpen = normalizeResourceRecordOpenReference(rawRecordOpen);
|
|
1194
|
+
if (!normalizedRecordOpen) {
|
|
1195
|
+
diagnostics.push('Quick View recordOpen must declare non-empty sourceIdentityField and target.{resourceKey, surfaceId}.');
|
|
1196
|
+
}
|
|
1197
|
+
let normalizedContentRef;
|
|
1198
|
+
const rawContentRef = record['contentRef'];
|
|
1199
|
+
if (rawContentRef !== undefined && rawContentRef !== null) {
|
|
1200
|
+
if (typeof rawContentRef !== 'object' || Array.isArray(rawContentRef)) {
|
|
1201
|
+
diagnostics.push('Quick View contentRef must be an object reference to a rich-block preset.');
|
|
1202
|
+
}
|
|
1203
|
+
else {
|
|
1204
|
+
const refObj = rawContentRef;
|
|
1205
|
+
const kind = typeof refObj['kind'] === 'string' ? refObj['kind'].trim() : '';
|
|
1206
|
+
const namespace = typeof refObj['namespace'] === 'string' ? refObj['namespace'].trim() : '';
|
|
1207
|
+
const presetId = typeof refObj['presetId'] === 'string' ? refObj['presetId'].trim() : '';
|
|
1208
|
+
const version = typeof refObj['version'] === 'string' ? refObj['version'].trim() : '';
|
|
1209
|
+
if (kind !== 'rich-block') {
|
|
1210
|
+
diagnostics.push(`Quick View contentRef.kind must be "rich-block"; received "${kind || 'empty'}".`);
|
|
1211
|
+
}
|
|
1212
|
+
if (!namespace) {
|
|
1213
|
+
diagnostics.push('Quick View contentRef.namespace must be a non-empty string.');
|
|
1214
|
+
}
|
|
1215
|
+
if (!presetId) {
|
|
1216
|
+
diagnostics.push('Quick View contentRef.presetId must be a non-empty string.');
|
|
1217
|
+
}
|
|
1218
|
+
if (!version) {
|
|
1219
|
+
diagnostics.push('Quick View contentRef.version must be explicitly declared.');
|
|
1220
|
+
}
|
|
1221
|
+
if ('nodes' in refObj || 'inputs' in refObj || 'action' in refObj) {
|
|
1222
|
+
diagnostics.push('Quick View contentRef cannot embed inline nodes, inputs or actions.');
|
|
1223
|
+
}
|
|
1224
|
+
if (kind === 'rich-block' &&
|
|
1225
|
+
namespace &&
|
|
1226
|
+
presetId &&
|
|
1227
|
+
version &&
|
|
1228
|
+
!('nodes' in refObj || 'inputs' in refObj || 'action' in refObj)) {
|
|
1229
|
+
normalizedContentRef = {
|
|
1230
|
+
kind: 'rich-block',
|
|
1231
|
+
namespace,
|
|
1232
|
+
presetId,
|
|
1233
|
+
version,
|
|
1234
|
+
};
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
if (diagnostics.length > 0 || !normalizedRecordOpen) {
|
|
1239
|
+
return {
|
|
1240
|
+
valid: false,
|
|
1241
|
+
binding: null,
|
|
1242
|
+
diagnostics,
|
|
1243
|
+
};
|
|
1244
|
+
}
|
|
1245
|
+
return {
|
|
1246
|
+
valid: true,
|
|
1247
|
+
binding: {
|
|
1248
|
+
recordOpen: normalizedRecordOpen,
|
|
1249
|
+
...(normalizedContentRef ? { contentRef: normalizedContentRef } : {}),
|
|
1250
|
+
...(detailPresentation ? { detailPresentation } : {}),
|
|
1251
|
+
},
|
|
1252
|
+
diagnostics: [],
|
|
1253
|
+
};
|
|
1254
|
+
}
|
|
1255
|
+
function normalizeResourceQuickViewBinding(value) {
|
|
1256
|
+
return validateResourceQuickViewBinding(value).binding;
|
|
1257
|
+
}
|
|
1258
|
+
/**
|
|
1259
|
+
* Verifica se a âncora efêmera de runtime permanece conectada e visível na viewport.
|
|
1260
|
+
*/
|
|
1261
|
+
function isResourceQuickViewAnchorValid(anchor) {
|
|
1262
|
+
if (!anchor || typeof anchor !== 'object') {
|
|
1263
|
+
return false;
|
|
1264
|
+
}
|
|
1265
|
+
if (typeof anchor.isValid === 'function' && !anchor.isValid()) {
|
|
1266
|
+
return false;
|
|
1267
|
+
}
|
|
1268
|
+
const viewportWidth = typeof window !== 'undefined' && Number.isFinite(window.innerWidth) && window.innerWidth > 0
|
|
1269
|
+
? window.innerWidth
|
|
1270
|
+
: 1920;
|
|
1271
|
+
const viewportHeight = typeof window !== 'undefined' && Number.isFinite(window.innerHeight) && window.innerHeight > 0
|
|
1272
|
+
? window.innerHeight
|
|
1273
|
+
: 1080;
|
|
1274
|
+
if (anchor.kind === 'element') {
|
|
1275
|
+
const el = anchor.element;
|
|
1276
|
+
if (!el || typeof el.getBoundingClientRect !== 'function' || el.isConnected === false) {
|
|
1277
|
+
return false;
|
|
1278
|
+
}
|
|
1279
|
+
const rect = el.getBoundingClientRect();
|
|
1280
|
+
if (!Number.isFinite(rect.left) || !Number.isFinite(rect.top)) {
|
|
1281
|
+
return false;
|
|
1282
|
+
}
|
|
1283
|
+
if (rect.width === 0 && rect.height === 0) {
|
|
1284
|
+
return false;
|
|
1285
|
+
}
|
|
1286
|
+
return (rect.bottom >= 0 &&
|
|
1287
|
+
rect.right >= 0 &&
|
|
1288
|
+
rect.top <= viewportHeight &&
|
|
1289
|
+
rect.left <= viewportWidth);
|
|
1290
|
+
}
|
|
1291
|
+
if (anchor.kind === 'virtual-rect') {
|
|
1292
|
+
if (!anchor.anchorKey || !anchor.anchorKey.trim()) {
|
|
1293
|
+
return false;
|
|
1294
|
+
}
|
|
1295
|
+
if (anchor.hostElement && anchor.hostElement.isConnected === false) {
|
|
1296
|
+
return false;
|
|
1297
|
+
}
|
|
1298
|
+
if (typeof anchor.getViewportRect !== 'function') {
|
|
1299
|
+
return false;
|
|
1300
|
+
}
|
|
1301
|
+
const rect = anchor.getViewportRect();
|
|
1302
|
+
if (!rect ||
|
|
1303
|
+
!Number.isFinite(rect.x) ||
|
|
1304
|
+
!Number.isFinite(rect.y) ||
|
|
1305
|
+
!Number.isFinite(rect.width) ||
|
|
1306
|
+
!Number.isFinite(rect.height) ||
|
|
1307
|
+
rect.width < 0 ||
|
|
1308
|
+
rect.height < 0) {
|
|
1309
|
+
return false;
|
|
1310
|
+
}
|
|
1311
|
+
const right = rect.right ?? rect.x + rect.width;
|
|
1312
|
+
const bottom = rect.bottom ?? rect.y + rect.height;
|
|
1313
|
+
const left = rect.left ?? rect.x;
|
|
1314
|
+
const top = rect.top ?? rect.y;
|
|
1315
|
+
return (bottom >= 0 &&
|
|
1316
|
+
right >= 0 &&
|
|
1317
|
+
top <= viewportHeight &&
|
|
1318
|
+
left <= viewportWidth);
|
|
1319
|
+
}
|
|
1320
|
+
return false;
|
|
1321
|
+
}
|
|
1322
|
+
function resolveQuickViewAnchorKey(anchor) {
|
|
1323
|
+
if (anchor.kind === 'virtual-rect') {
|
|
1324
|
+
return anchor.anchorKey.trim();
|
|
1325
|
+
}
|
|
1326
|
+
const explicit = anchor.anchorKey?.trim();
|
|
1327
|
+
if (explicit) {
|
|
1328
|
+
return explicit;
|
|
1329
|
+
}
|
|
1330
|
+
const focusKey = anchor.element?.getAttribute?.('data-praxis-focus-key')?.trim();
|
|
1331
|
+
if (focusKey) {
|
|
1332
|
+
return focusKey;
|
|
1333
|
+
}
|
|
1334
|
+
const id = anchor.element?.id?.trim();
|
|
1335
|
+
if (id) {
|
|
1336
|
+
return `element:${id}`;
|
|
1337
|
+
}
|
|
1338
|
+
return 'element:anonymous';
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1057
1341
|
const TONES = new Set([
|
|
1058
1342
|
'neutral',
|
|
1059
1343
|
'info',
|
|
@@ -1180,11 +1464,13 @@ function normalizeText(value) {
|
|
|
1180
1464
|
return trimmed.length ? trimmed : undefined;
|
|
1181
1465
|
}
|
|
1182
1466
|
function normalizeInteractions(value) {
|
|
1467
|
+
const quickView = normalizeResourceQuickViewBinding(value.quickView);
|
|
1183
1468
|
return {
|
|
1184
1469
|
...(value.copy === true ? { copy: true } : {}),
|
|
1185
1470
|
...(value.details === true ? { details: true } : {}),
|
|
1186
1471
|
...(value.expand === true ? { expand: true } : {}),
|
|
1187
1472
|
...(value.link === true ? { link: true } : {}),
|
|
1473
|
+
...(quickView ? { quickView } : {}),
|
|
1188
1474
|
};
|
|
1189
1475
|
}
|
|
1190
1476
|
|
|
@@ -1436,6 +1722,33 @@ class SchemaNormalizationKernel {
|
|
|
1436
1722
|
}
|
|
1437
1723
|
return false;
|
|
1438
1724
|
}
|
|
1725
|
+
parseOptionalBoolean(value) {
|
|
1726
|
+
if (typeof value === 'boolean') {
|
|
1727
|
+
return value;
|
|
1728
|
+
}
|
|
1729
|
+
if (typeof value === 'string') {
|
|
1730
|
+
const normalized = value.trim().toLowerCase();
|
|
1731
|
+
if (normalized === 'true') {
|
|
1732
|
+
return true;
|
|
1733
|
+
}
|
|
1734
|
+
if (normalized === 'false') {
|
|
1735
|
+
return false;
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
return undefined;
|
|
1739
|
+
}
|
|
1740
|
+
parseOptionalFiniteNumber(value) {
|
|
1741
|
+
if (typeof value === 'number' && Number.isFinite(value)) {
|
|
1742
|
+
return value;
|
|
1743
|
+
}
|
|
1744
|
+
if (typeof value === 'string' && value.trim().length > 0) {
|
|
1745
|
+
const parsed = Number(value);
|
|
1746
|
+
if (Number.isFinite(parsed)) {
|
|
1747
|
+
return parsed;
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
return undefined;
|
|
1751
|
+
}
|
|
1439
1752
|
/** Ensure an array of strings from various inputs. */
|
|
1440
1753
|
parseStringArray(value) {
|
|
1441
1754
|
if (Array.isArray(value)) {
|
|
@@ -2745,6 +3058,55 @@ class SchemaNormalizationKernel {
|
|
|
2745
3058
|
if (ui.buttons !== undefined) {
|
|
2746
3059
|
field.buttons = this.parseButtons(ui.buttons);
|
|
2747
3060
|
}
|
|
3061
|
+
if (ui.valueLabelDisplay !== undefined) {
|
|
3062
|
+
const normalizedValueLabelDisplay = typeof ui.valueLabelDisplay === 'string'
|
|
3063
|
+
? ui.valueLabelDisplay.trim().toLowerCase()
|
|
3064
|
+
: '';
|
|
3065
|
+
if (normalizedValueLabelDisplay === 'off' ||
|
|
3066
|
+
normalizedValueLabelDisplay === 'auto' ||
|
|
3067
|
+
normalizedValueLabelDisplay === 'on') {
|
|
3068
|
+
field.valueLabelDisplay = normalizedValueLabelDisplay;
|
|
3069
|
+
}
|
|
3070
|
+
}
|
|
3071
|
+
const sliderBooleanKeys = [
|
|
3072
|
+
'thumbLabel',
|
|
3073
|
+
'discrete',
|
|
3074
|
+
'showInputs',
|
|
3075
|
+
'disableThumbSwap',
|
|
3076
|
+
'vertical',
|
|
3077
|
+
'invert',
|
|
3078
|
+
];
|
|
3079
|
+
for (const key of sliderBooleanKeys) {
|
|
3080
|
+
if (ui[key] !== undefined) {
|
|
3081
|
+
const parsed = this.parseOptionalBoolean(ui[key]);
|
|
3082
|
+
if (parsed !== undefined) {
|
|
3083
|
+
field[key] = parsed;
|
|
3084
|
+
}
|
|
3085
|
+
}
|
|
3086
|
+
}
|
|
3087
|
+
if (ui.showTicks !== undefined) {
|
|
3088
|
+
const parsedTicks = this.parseOptionalBoolean(ui.showTicks);
|
|
3089
|
+
if (parsedTicks !== undefined) {
|
|
3090
|
+
field.showTicks = parsedTicks;
|
|
3091
|
+
}
|
|
3092
|
+
else if (typeof ui.showTicks === 'string' &&
|
|
3093
|
+
ui.showTicks.trim().toLowerCase() === 'auto') {
|
|
3094
|
+
field.showTicks = 'auto';
|
|
3095
|
+
}
|
|
3096
|
+
}
|
|
3097
|
+
const sliderNumberKeys = [
|
|
3098
|
+
'shiftStep',
|
|
3099
|
+
'minDistance',
|
|
3100
|
+
'maxDistance',
|
|
3101
|
+
];
|
|
3102
|
+
for (const key of sliderNumberKeys) {
|
|
3103
|
+
if (ui[key] !== undefined) {
|
|
3104
|
+
const parsed = this.parseOptionalFiniteNumber(ui[key]);
|
|
3105
|
+
if (parsed !== undefined) {
|
|
3106
|
+
field[key] = parsed;
|
|
3107
|
+
}
|
|
3108
|
+
}
|
|
3109
|
+
}
|
|
2748
3110
|
// -------------------------------------------------------------------
|
|
2749
3111
|
// Inline filter and specialized control metadata (x-ui)
|
|
2750
3112
|
// -------------------------------------------------------------------
|
|
@@ -2781,7 +3143,6 @@ class SchemaNormalizationKernel {
|
|
|
2781
3143
|
'defaultGranularity',
|
|
2782
3144
|
'selectionGrid',
|
|
2783
3145
|
'showSlider',
|
|
2784
|
-
'showInputs',
|
|
2785
3146
|
'minPeriod',
|
|
2786
3147
|
'maxPeriod',
|
|
2787
3148
|
'minYear',
|
|
@@ -2819,8 +3180,8 @@ class SchemaNormalizationKernel {
|
|
|
2819
3180
|
'marks',
|
|
2820
3181
|
'semanticBands',
|
|
2821
3182
|
'distribution',
|
|
2822
|
-
'
|
|
2823
|
-
'
|
|
3183
|
+
'inlineDistribution',
|
|
3184
|
+
'track',
|
|
2824
3185
|
'trueLabel',
|
|
2825
3186
|
'falseLabel',
|
|
2826
3187
|
'labelTrue',
|
|
@@ -3056,6 +3417,7 @@ function buildBaseColumnFromDef(def) {
|
|
|
3056
3417
|
const format = resolveFormatFromFieldDefinition(def, type);
|
|
3057
3418
|
const valueMapping = resolveSchemaValueMappingFromFieldDefinition(def);
|
|
3058
3419
|
const renderer = resolveRendererFromFieldDefinition(def);
|
|
3420
|
+
const quickView = resolveQuickViewFromFieldDefinition(def);
|
|
3059
3421
|
const isAvatar = renderer?.type === 'avatar';
|
|
3060
3422
|
const explicitWidth = firstNonEmptyString(def.width);
|
|
3061
3423
|
return {
|
|
@@ -3072,6 +3434,7 @@ function buildBaseColumnFromDef(def) {
|
|
|
3072
3434
|
...(format ? { format } : {}),
|
|
3073
3435
|
...(valueMapping ? { valueMapping } : {}),
|
|
3074
3436
|
...(renderer ? { renderer } : {}),
|
|
3437
|
+
...(quickView ? { quickView } : {}),
|
|
3075
3438
|
};
|
|
3076
3439
|
}
|
|
3077
3440
|
function applyLocalCustomizations(baseCol, localCol) {
|
|
@@ -3098,11 +3461,19 @@ function applyLocalCustomizations(baseCol, localCol) {
|
|
|
3098
3461
|
result.headerStyle = localCol.headerStyle ?? baseCol.headerStyle;
|
|
3099
3462
|
result.cssClass = localCol.cssClass ?? baseCol.cssClass;
|
|
3100
3463
|
result.headerCssClass = localCol.headerCssClass ?? baseCol.headerCssClass;
|
|
3464
|
+
const resolvedQuickView = normalizeResourceQuickViewBinding(localCol.quickView) ??
|
|
3465
|
+
normalizeResourceQuickViewBinding(baseCol.quickView);
|
|
3466
|
+
if (resolvedQuickView) {
|
|
3467
|
+
result.quickView = resolvedQuickView;
|
|
3468
|
+
}
|
|
3469
|
+
else {
|
|
3470
|
+
delete result.quickView;
|
|
3471
|
+
}
|
|
3101
3472
|
// If server type changed, drop potentially incompatible formatting/renderers.
|
|
3102
3473
|
if (!typeChanged) {
|
|
3103
3474
|
result.format = localCol.format ?? baseCol.format;
|
|
3104
3475
|
result.valueMapping = localCol.valueMapping ?? baseCol.valueMapping;
|
|
3105
|
-
result.renderer = localCol.renderer ?? baseCol.renderer;
|
|
3476
|
+
result.renderer = normalizeColumnRendererQuickView(localCol.renderer ?? baseCol.renderer);
|
|
3106
3477
|
}
|
|
3107
3478
|
else {
|
|
3108
3479
|
// Drop local presentation that may be incompatible with the new server type,
|
|
@@ -3347,6 +3718,114 @@ function humanizeSchemaEnumValue(value) {
|
|
|
3347
3718
|
.map((part, index) => (index === 0 ? `${part.charAt(0).toUpperCase()}${part.slice(1)}` : part))
|
|
3348
3719
|
.join(' ');
|
|
3349
3720
|
}
|
|
3721
|
+
function resolveQuickViewFromFieldDefinition(def) {
|
|
3722
|
+
return (normalizeResourceQuickViewBinding(def.quickView) ??
|
|
3723
|
+
normalizeResourceQuickViewBinding(def.presentation?.interactions?.quickView) ??
|
|
3724
|
+
normalizeResourceQuickViewBinding(def['extraProperties'] && typeof def['extraProperties'] === 'object' ? def['extraProperties']['quickView'] : undefined) ??
|
|
3725
|
+
undefined);
|
|
3726
|
+
}
|
|
3727
|
+
function normalizeColumnRendererQuickView(renderer) {
|
|
3728
|
+
if (!renderer || typeof renderer !== 'object') {
|
|
3729
|
+
return renderer;
|
|
3730
|
+
}
|
|
3731
|
+
const next = { ...renderer };
|
|
3732
|
+
if (next.link && typeof next.link === 'object') {
|
|
3733
|
+
const qv = normalizeResourceQuickViewBinding(next.link.quickView);
|
|
3734
|
+
next.link = { ...next.link };
|
|
3735
|
+
if (qv) {
|
|
3736
|
+
next.link.quickView = qv;
|
|
3737
|
+
}
|
|
3738
|
+
else {
|
|
3739
|
+
delete next.link.quickView;
|
|
3740
|
+
}
|
|
3741
|
+
}
|
|
3742
|
+
if (next.badge && typeof next.badge === 'object') {
|
|
3743
|
+
const qv = normalizeResourceQuickViewBinding(next.badge.quickView);
|
|
3744
|
+
next.badge = { ...next.badge };
|
|
3745
|
+
if (qv) {
|
|
3746
|
+
next.badge.quickView = qv;
|
|
3747
|
+
}
|
|
3748
|
+
else {
|
|
3749
|
+
delete next.badge.quickView;
|
|
3750
|
+
}
|
|
3751
|
+
}
|
|
3752
|
+
if (next.chip && typeof next.chip === 'object') {
|
|
3753
|
+
const qv = normalizeResourceQuickViewBinding(next.chip.quickView);
|
|
3754
|
+
next.chip = { ...next.chip };
|
|
3755
|
+
if (qv) {
|
|
3756
|
+
next.chip.quickView = qv;
|
|
3757
|
+
}
|
|
3758
|
+
else {
|
|
3759
|
+
delete next.chip.quickView;
|
|
3760
|
+
}
|
|
3761
|
+
}
|
|
3762
|
+
if (next.icon && typeof next.icon === 'object') {
|
|
3763
|
+
const qv = normalizeResourceQuickViewBinding(next.icon.quickView);
|
|
3764
|
+
next.icon = { ...next.icon };
|
|
3765
|
+
if (qv) {
|
|
3766
|
+
next.icon.quickView = qv;
|
|
3767
|
+
}
|
|
3768
|
+
else {
|
|
3769
|
+
delete next.icon.quickView;
|
|
3770
|
+
}
|
|
3771
|
+
}
|
|
3772
|
+
if (next.compose && typeof next.compose === 'object' && Array.isArray(next.compose.items)) {
|
|
3773
|
+
next.compose = {
|
|
3774
|
+
...next.compose,
|
|
3775
|
+
items: next.compose.items.map((item) => {
|
|
3776
|
+
if (!item || typeof item !== 'object')
|
|
3777
|
+
return item;
|
|
3778
|
+
if (item.type === 'value') {
|
|
3779
|
+
const qv = normalizeResourceQuickViewBinding(item.quickView);
|
|
3780
|
+
const cloned = { ...item };
|
|
3781
|
+
if (qv)
|
|
3782
|
+
cloned.quickView = qv;
|
|
3783
|
+
else
|
|
3784
|
+
delete cloned.quickView;
|
|
3785
|
+
return cloned;
|
|
3786
|
+
}
|
|
3787
|
+
if (item.type === 'link' && item.link) {
|
|
3788
|
+
const qv = normalizeResourceQuickViewBinding(item.link.quickView);
|
|
3789
|
+
const link = { ...item.link };
|
|
3790
|
+
if (qv)
|
|
3791
|
+
link.quickView = qv;
|
|
3792
|
+
else
|
|
3793
|
+
delete link.quickView;
|
|
3794
|
+
return { ...item, link };
|
|
3795
|
+
}
|
|
3796
|
+
if (item.type === 'badge' && item.badge) {
|
|
3797
|
+
const qv = normalizeResourceQuickViewBinding(item.badge.quickView);
|
|
3798
|
+
const badge = { ...item.badge };
|
|
3799
|
+
if (qv)
|
|
3800
|
+
badge.quickView = qv;
|
|
3801
|
+
else
|
|
3802
|
+
delete badge.quickView;
|
|
3803
|
+
return { ...item, badge };
|
|
3804
|
+
}
|
|
3805
|
+
if (item.type === 'chip' && item.chip) {
|
|
3806
|
+
const qv = normalizeResourceQuickViewBinding(item.chip.quickView);
|
|
3807
|
+
const chip = { ...item.chip };
|
|
3808
|
+
if (qv)
|
|
3809
|
+
chip.quickView = qv;
|
|
3810
|
+
else
|
|
3811
|
+
delete chip.quickView;
|
|
3812
|
+
return { ...item, chip };
|
|
3813
|
+
}
|
|
3814
|
+
if (item.type === 'icon' && item.icon) {
|
|
3815
|
+
const qv = normalizeResourceQuickViewBinding(item.icon.quickView);
|
|
3816
|
+
const icon = { ...item.icon };
|
|
3817
|
+
if (qv)
|
|
3818
|
+
icon.quickView = qv;
|
|
3819
|
+
else
|
|
3820
|
+
delete icon.quickView;
|
|
3821
|
+
return { ...item, icon };
|
|
3822
|
+
}
|
|
3823
|
+
return item;
|
|
3824
|
+
}),
|
|
3825
|
+
};
|
|
3826
|
+
}
|
|
3827
|
+
return next;
|
|
3828
|
+
}
|
|
3350
3829
|
function resolveRendererFromFieldDefinition(def) {
|
|
3351
3830
|
const presentationRenderer = resolveRendererFromFieldPresentation(def);
|
|
3352
3831
|
if (presentationRenderer)
|