@praxisui/core 0.0.1 → 1.0.0-beta.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/README.md +81 -21
- package/fesm2022/praxisui-core.mjs +290 -31
- package/fesm2022/praxisui-core.mjs.map +1 -1
- package/index.d.ts +257 -3
- package/package.json +12 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, InjectionToken, Injectable, inject, APP_INITIALIZER, Inject, makeEnvironmentProviders, ViewContainerRef, EventEmitter, Output, Input, Directive, signal, computed, HostListener, Optional } from '@angular/core';
|
|
2
|
+
import { Component, InjectionToken, Injectable, inject, APP_INITIALIZER, Inject, makeEnvironmentProviders, ViewContainerRef, EventEmitter, Output, Input, Directive, signal, computed, HostListener, Optional, ChangeDetectionStrategy } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common/http';
|
|
4
4
|
import { HttpHeaders, HttpClient, HttpParams } from '@angular/common/http';
|
|
5
5
|
import { BehaviorSubject, from, of, EMPTY, throwError, firstValueFrom } from 'rxjs';
|
|
@@ -8,20 +8,22 @@ import * as i1$1 from '@angular/forms';
|
|
|
8
8
|
import { Validators, FormGroup, FormControl, FormsModule } from '@angular/forms';
|
|
9
9
|
import * as i2 from '@angular/common';
|
|
10
10
|
import { CommonModule } from '@angular/common';
|
|
11
|
-
import * as
|
|
11
|
+
import * as i3 from '@angular/material/card';
|
|
12
12
|
import { MatCardModule } from '@angular/material/card';
|
|
13
|
-
import * as i3 from '@angular/material/button';
|
|
13
|
+
import * as i3$1 from '@angular/material/button';
|
|
14
14
|
import { MatButtonModule } from '@angular/material/button';
|
|
15
15
|
import * as i4 from '@angular/material/icon';
|
|
16
16
|
import { MatIconModule } from '@angular/material/icon';
|
|
17
|
-
import * as i2$
|
|
17
|
+
import * as i2$1 from '@angular/material/form-field';
|
|
18
18
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
19
|
-
import * as i3$
|
|
19
|
+
import * as i3$2 from '@angular/material/input';
|
|
20
20
|
import { MatInputModule } from '@angular/material/input';
|
|
21
21
|
import * as i8 from '@angular/material/chips';
|
|
22
22
|
import { MatChipsModule } from '@angular/material/chips';
|
|
23
23
|
import * as i1$2 from '@angular/material/dialog';
|
|
24
24
|
import { MAT_DIALOG_DATA, MatDialogModule, MatDialog } from '@angular/material/dialog';
|
|
25
|
+
import * as i2$2 from '@angular/material/tabs';
|
|
26
|
+
import { MatTabsModule } from '@angular/material/tabs';
|
|
25
27
|
|
|
26
28
|
class PraxisCore {
|
|
27
29
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PraxisCore, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -1004,7 +1006,7 @@ class GenericCrudService {
|
|
|
1004
1006
|
}
|
|
1005
1007
|
resource = resource.replace(/^\/+/, '');
|
|
1006
1008
|
// Normalize known suffixes accidentally passed as part of the resource path
|
|
1007
|
-
// Avoid cases like "
|
|
1009
|
+
// Avoid cases like "module/items/filter" which would lead to duplicate suffixes (e.g., "/filter/filter")
|
|
1008
1010
|
resource = resource.replace(/\/(?:filter|all)(?:\/?$)/i, '');
|
|
1009
1011
|
// Remove duplicated `api` segments only if base URL already contains `/api`
|
|
1010
1012
|
try {
|
|
@@ -1115,29 +1117,26 @@ class GenericCrudService {
|
|
|
1115
1117
|
.set('schemaType', schemaType);
|
|
1116
1118
|
// Resolve schemas/filtered honoring relative base (dev proxy) when applicable
|
|
1117
1119
|
let filteredUrl = '/schemas/filtered';
|
|
1120
|
+
let apiOrigin = '';
|
|
1118
1121
|
try {
|
|
1119
1122
|
const baseUrl = buildApiUrl(entry);
|
|
1120
1123
|
const u = new URL(baseUrl);
|
|
1121
|
-
|
|
1124
|
+
apiOrigin = u.origin;
|
|
1125
|
+
filteredUrl = `${apiOrigin}/schemas/filtered`;
|
|
1122
1126
|
}
|
|
1123
1127
|
catch { }
|
|
1124
|
-
|
|
1128
|
+
// Build cache key including the API origin (not the app origin)
|
|
1129
|
+
const schemaId = buildSchemaId({ path, operation, schemaType, includeInternalSchemas: false, tenant, locale, apiOrigin });
|
|
1125
1130
|
const headersBase = composeHeadersWithVersion(entry);
|
|
1126
1131
|
return from(this._schemaCache.get(schemaId)).pipe(concatMap((cached) => {
|
|
1127
|
-
let headers = headersBase;
|
|
1132
|
+
let headers = (headersBase instanceof HttpHeaders ? headersBase : new HttpHeaders(headersBase));
|
|
1128
1133
|
if (cached?.schemaHash) {
|
|
1129
|
-
headers = (
|
|
1130
|
-
.set('If-None-Match', `"${cached.schemaHash}"`)
|
|
1131
|
-
.set('Accept-Language', locale || '')
|
|
1132
|
-
.set('X-Tenant', tenant || '');
|
|
1133
|
-
}
|
|
1134
|
-
else {
|
|
1135
|
-
headers = (headersBase instanceof HttpHeaders ? headersBase : new HttpHeaders(headersBase));
|
|
1136
|
-
if (locale)
|
|
1137
|
-
headers = headers.set('Accept-Language', locale);
|
|
1138
|
-
if (tenant)
|
|
1139
|
-
headers = headers.set('X-Tenant', tenant);
|
|
1134
|
+
headers = headers.set('If-None-Match', `"${cached.schemaHash}"`);
|
|
1140
1135
|
}
|
|
1136
|
+
if (locale)
|
|
1137
|
+
headers = headers.set('Accept-Language', locale);
|
|
1138
|
+
if (tenant)
|
|
1139
|
+
headers = headers.set('X-Tenant', tenant);
|
|
1141
1140
|
console.debug('[CRUD:Service] getSchema (filtered fallback):request', { filteredUrl, path, hasCached: !!cached });
|
|
1142
1141
|
return this.http.get(filteredUrl, { params: httpParams, headers, observe: 'response' });
|
|
1143
1142
|
}), concatMap((resp) => {
|
|
@@ -1167,6 +1166,11 @@ class GenericCrudService {
|
|
|
1167
1166
|
h = h.set('Accept-Language', locale);
|
|
1168
1167
|
if (tenant)
|
|
1169
1168
|
h = h.set('X-Tenant', tenant);
|
|
1169
|
+
// Force a fresh response to avoid intermediary caches when refetching
|
|
1170
|
+
try {
|
|
1171
|
+
h = h.set('Cache-Control', 'no-cache, no-store, max-age=0').set('Pragma', 'no-cache');
|
|
1172
|
+
}
|
|
1173
|
+
catch { }
|
|
1170
1174
|
return this.http.get(filteredUrl, { params: httpParams, headers: h }).pipe(tap((fresh) => {
|
|
1171
1175
|
const now = new Date().toISOString();
|
|
1172
1176
|
const entry = {
|
|
@@ -1179,7 +1183,7 @@ class GenericCrudService {
|
|
|
1179
1183
|
updatedAt: now,
|
|
1180
1184
|
resourcePath: this.resourcePath,
|
|
1181
1185
|
schemaId,
|
|
1182
|
-
apiOrigin
|
|
1186
|
+
apiOrigin,
|
|
1183
1187
|
},
|
|
1184
1188
|
};
|
|
1185
1189
|
this._schemaCache.set(schemaId, entry);
|
|
@@ -1198,7 +1202,7 @@ class GenericCrudService {
|
|
|
1198
1202
|
catch { }
|
|
1199
1203
|
this._schemaCache.set(schemaId, { schema: body, schemaHash, meta: {
|
|
1200
1204
|
version: '2.0.0', name: 'Grid/Response Schema', createdAt: nowIso, updatedAt: nowIso,
|
|
1201
|
-
resourcePath: this.resourcePath, idField: idFieldFromBody, schemaId, apiOrigin
|
|
1205
|
+
resourcePath: this.resourcePath, idField: idFieldFromBody, schemaId, apiOrigin,
|
|
1202
1206
|
} });
|
|
1203
1207
|
this._lastSchemaInfo = { schemaId, schemaHash };
|
|
1204
1208
|
// Extrai idField de x-ui.resource quando presente no body recebido
|
|
@@ -1209,9 +1213,9 @@ class GenericCrudService {
|
|
|
1209
1213
|
catch { }
|
|
1210
1214
|
return of(this.schemaNormalizer.normalizeSchema(body));
|
|
1211
1215
|
}),
|
|
1212
|
-
// Angular HttpClient treats 304 as error; handle
|
|
1216
|
+
// Angular HttpClient treats 304 as error; also handle status 0 (CORS/network) by reusing cache
|
|
1213
1217
|
catchError((err) => {
|
|
1214
|
-
if (err?.status === 304) {
|
|
1218
|
+
if (err?.status === 304 || err?.status === 0) {
|
|
1215
1219
|
return from(this._schemaCache.get(schemaId)).pipe(concatMap((cached) => {
|
|
1216
1220
|
if (cached?.schema) {
|
|
1217
1221
|
try {
|
|
@@ -1231,6 +1235,11 @@ class GenericCrudService {
|
|
|
1231
1235
|
h = h.set('Accept-Language', locale);
|
|
1232
1236
|
if (tenant)
|
|
1233
1237
|
h = h.set('X-Tenant', tenant);
|
|
1238
|
+
// Force a fresh response to avoid intermediary caches when refetching
|
|
1239
|
+
try {
|
|
1240
|
+
h = h.set('Cache-Control', 'no-cache, no-store, max-age=0').set('Pragma', 'no-cache');
|
|
1241
|
+
}
|
|
1242
|
+
catch { }
|
|
1234
1243
|
return this.http
|
|
1235
1244
|
.get(filteredUrl, { params: httpParams, headers: h })
|
|
1236
1245
|
.pipe(tap((fresh) => {
|
|
@@ -1245,7 +1254,7 @@ class GenericCrudService {
|
|
|
1245
1254
|
updatedAt: now,
|
|
1246
1255
|
resourcePath: this.resourcePath,
|
|
1247
1256
|
schemaId,
|
|
1248
|
-
apiOrigin
|
|
1257
|
+
apiOrigin,
|
|
1249
1258
|
},
|
|
1250
1259
|
};
|
|
1251
1260
|
this._schemaCache.set(schemaId, entry);
|
|
@@ -1386,6 +1395,11 @@ class GenericCrudService {
|
|
|
1386
1395
|
h = h.set('Accept-Language', locale);
|
|
1387
1396
|
if (tenant)
|
|
1388
1397
|
h = h.set('X-Tenant', tenant);
|
|
1398
|
+
// Force a fresh response to avoid intermediary caches when refetching
|
|
1399
|
+
try {
|
|
1400
|
+
h = h.set('Cache-Control', 'no-cache, no-store, max-age=0').set('Pragma', 'no-cache');
|
|
1401
|
+
}
|
|
1402
|
+
catch { }
|
|
1389
1403
|
return this.http.get(url, { params: httpParams, headers: h }).pipe(tap((fresh) => {
|
|
1390
1404
|
const now = new Date().toISOString();
|
|
1391
1405
|
const entry = {
|
|
@@ -1419,9 +1433,9 @@ class GenericCrudService {
|
|
|
1419
1433
|
this._schemaCache.set(schemaId, entryToCache);
|
|
1420
1434
|
return of(this.schemaNormalizer.normalizeSchema(body));
|
|
1421
1435
|
}),
|
|
1422
|
-
// Angular HttpClient may surface 304 as error; handle
|
|
1436
|
+
// Angular HttpClient may surface 304 as error; also handle status 0 (CORS/network) by reusing cache
|
|
1423
1437
|
catchError((err) => {
|
|
1424
|
-
if (err?.status === 304) {
|
|
1438
|
+
if (err?.status === 304 || err?.status === 0) {
|
|
1425
1439
|
return from(this._schemaCache.get(schemaId)).pipe(concatMap((cached) => {
|
|
1426
1440
|
if (cached?.schema) {
|
|
1427
1441
|
try {
|
|
@@ -1437,6 +1451,11 @@ class GenericCrudService {
|
|
|
1437
1451
|
h = h.set('Accept-Language', locale);
|
|
1438
1452
|
if (tenant)
|
|
1439
1453
|
h = h.set('X-Tenant', tenant);
|
|
1454
|
+
// Force a fresh response to avoid intermediary caches when refetching
|
|
1455
|
+
try {
|
|
1456
|
+
h = h.set('Cache-Control', 'no-cache, no-store, max-age=0').set('Pragma', 'no-cache');
|
|
1457
|
+
}
|
|
1458
|
+
catch { }
|
|
1440
1459
|
return this.http.get(url, { params: httpParams, headers: h }).pipe(tap((fresh) => {
|
|
1441
1460
|
const now = new Date().toISOString();
|
|
1442
1461
|
const entry = { schema: fresh, schemaHash: '', meta: { version: '2.0.0', name: (schemaTypeParam === 'request' ? 'Filter/Request Schema' : 'Schema'), createdAt: now, updatedAt: now, resourcePath: this.resourcePath, schemaId, apiOrigin: origin } };
|
|
@@ -5727,7 +5746,7 @@ class EmptyStateCardComponent {
|
|
|
5727
5746
|
</div>
|
|
5728
5747
|
</mat-card-content>
|
|
5729
5748
|
</mat-card>
|
|
5730
|
-
`, isInline: true, styles: [".empty-card{display:block;margin:12px}.empty-card.empty-inline{margin:8px 0}.content{display:flex;align-items:center;gap:12px}.icon{font-size:32px;width:32px;height:32px;opacity:.9}.title{margin:0;font-size:16px;font-weight:600}.desc{margin:4px 0 0;opacity:.76}.actions{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatCardModule }, { kind: "component", type:
|
|
5749
|
+
`, isInline: true, styles: [".empty-card{display:block;margin:12px}.empty-card.empty-inline{margin:8px 0}.content{display:flex;align-items:center;gap:12px}.icon{font-size:32px;width:32px;height:32px;opacity:.9}.title{margin:0;font-size:16px;font-weight:600}.desc{margin:4px 0 0;opacity:.76}.actions{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3.MatCardContent, selector: "mat-card-content" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
5731
5750
|
}
|
|
5732
5751
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: EmptyStateCardComponent, decorators: [{
|
|
5733
5752
|
type: Component,
|
|
@@ -5881,7 +5900,7 @@ class ResourceQuickConnectComponent {
|
|
|
5881
5900
|
</mat-form-field>
|
|
5882
5901
|
<small style="opacity:.75">Conecte o componente à fonte de dados (ex.: /api/<rota-do-recurso>)</small>
|
|
5883
5902
|
</div>
|
|
5884
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$
|
|
5903
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }] });
|
|
5885
5904
|
}
|
|
5886
5905
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ResourceQuickConnectComponent, decorators: [{
|
|
5887
5906
|
type: Component,
|
|
@@ -6070,7 +6089,7 @@ class PraxisIconPickerComponent {
|
|
|
6070
6089
|
<span class="pip-typed" *ngIf="query.trim()">{{ previewValue() }}</span>
|
|
6071
6090
|
</div>
|
|
6072
6091
|
</div>
|
|
6073
|
-
`, isInline: true, styles: [".pip-root{display:flex;flex-direction:column;min-width:340px;max-width:760px;max-height:80vh;overflow:hidden;padding:16px}.pip-head{display:flex;gap:12px;align-items:center;margin-bottom:12px}.pip-search{flex:1;min-width:180px}.pip-spacer{flex:1}.pip-body{flex:1;overflow:auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px;padding:4px}.pip-item{display:flex;gap:10px;align-items:center;justify-content:flex-start;padding:10px;border:1px solid rgba(0,0,0,.08);border-radius:10px;background:var(--md-sys-color-surface);cursor:pointer}.pip-item:hover{background:#0000000a}.pip-name{font-size:12px;color:#0009;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.pip-hint{font-size:12px;color:#0009;margin:-6px 0 8px}.pip-footer{display:flex;gap:12px;align-items:center;margin-top:10px}.pip-typed{font-family:monospace;font-size:12px;color:#000000b3}.pip-family{display:flex;align-items:center}.pip-family .mat-mdc-chip-listbox{min-width:260px}.pip-root .mat-icon{font-family:Material Icons,Material Symbols Outlined,Material Symbols Rounded,Material Symbols Sharp!important;font-variation-settings:\"FILL\" 0,\"wght\" 400,\"GRAD\" 0,\"opsz\" 24}.material-symbols-outlined{font-family:Material Symbols Outlined;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased;font-variation-settings:\"FILL\" 0,\"wght\" 400,\"GRAD\" 0,\"opsz\" 24}.material-symbols-rounded{font-family:Material Symbols Rounded;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased;font-variation-settings:\"FILL\" 0,\"wght\" 400,\"GRAD\" 0,\"opsz\" 24}.material-symbols-sharp{font-family:Material Symbols Sharp;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased;font-variation-settings:\"FILL\" 0,\"wght\" 400,\"GRAD\" 0,\"opsz\" 24}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$
|
|
6092
|
+
`, isInline: true, styles: [".pip-root{display:flex;flex-direction:column;min-width:340px;max-width:760px;max-height:80vh;overflow:hidden;padding:16px}.pip-head{display:flex;gap:12px;align-items:center;margin-bottom:12px}.pip-search{flex:1;min-width:180px}.pip-spacer{flex:1}.pip-body{flex:1;overflow:auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px;padding:4px}.pip-item{display:flex;gap:10px;align-items:center;justify-content:flex-start;padding:10px;border:1px solid rgba(0,0,0,.08);border-radius:10px;background:var(--md-sys-color-surface);cursor:pointer}.pip-item:hover{background:#0000000a}.pip-name{font-size:12px;color:#0009;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.pip-hint{font-size:12px;color:#0009;margin:-6px 0 8px}.pip-footer{display:flex;gap:12px;align-items:center;margin-top:10px}.pip-typed{font-family:monospace;font-size:12px;color:#000000b3}.pip-family{display:flex;align-items:center}.pip-family .mat-mdc-chip-listbox{min-width:260px}.pip-root .mat-icon{font-family:Material Icons,Material Symbols Outlined,Material Symbols Rounded,Material Symbols Sharp!important;font-variation-settings:\"FILL\" 0,\"wght\" 400,\"GRAD\" 0,\"opsz\" 24}.material-symbols-outlined{font-family:Material Symbols Outlined;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased;font-variation-settings:\"FILL\" 0,\"wght\" 400,\"GRAD\" 0,\"opsz\" 24}.material-symbols-rounded{font-family:Material Symbols Rounded;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased;font-variation-settings:\"FILL\" 0,\"wght\" 400,\"GRAD\" 0,\"opsz\" 24}.material-symbols-sharp{font-family:Material Symbols Sharp;font-weight:400;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:\"liga\";-webkit-font-smoothing:antialiased;font-variation-settings:\"FILL\" 0,\"wght\" 400,\"GRAD\" 0,\"opsz\" 24}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "component", type: i8.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i8.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["selectable", "selected"], outputs: ["selectionChange"] }, { kind: "ngmodule", type: MatDialogModule }] });
|
|
6074
6093
|
}
|
|
6075
6094
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PraxisIconPickerComponent, decorators: [{
|
|
6076
6095
|
type: Component,
|
|
@@ -6173,6 +6192,246 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
|
|
|
6173
6192
|
args: [{ providedIn: 'root' }]
|
|
6174
6193
|
}] });
|
|
6175
6194
|
|
|
6195
|
+
/** Optional DI token used by SchemaViewer when input is not provided. */
|
|
6196
|
+
const SCHEMA_VIEWER_CONTEXT = new InjectionToken('SCHEMA_VIEWER_CONTEXT');
|
|
6197
|
+
|
|
6198
|
+
class SchemaViewerComponent {
|
|
6199
|
+
registry = inject(ComponentMetadataRegistry);
|
|
6200
|
+
normalizer = inject(SchemaNormalizerService);
|
|
6201
|
+
injected = inject(SCHEMA_VIEWER_CONTEXT, { optional: true });
|
|
6202
|
+
context;
|
|
6203
|
+
// Internal reactive state
|
|
6204
|
+
_ctx = signal(undefined, ...(ngDevMode ? [{ debugName: "_ctx" }] : []));
|
|
6205
|
+
ctx = computed(() => this._ctx(), ...(ngDevMode ? [{ debugName: "ctx" }] : []));
|
|
6206
|
+
_componentMeta = signal(undefined, ...(ngDevMode ? [{ debugName: "_componentMeta" }] : []));
|
|
6207
|
+
componentMeta = computed(() => this._componentMeta(), ...(ngDevMode ? [{ debugName: "componentMeta" }] : []));
|
|
6208
|
+
_normalizedFields = signal([], ...(ngDevMode ? [{ debugName: "_normalizedFields" }] : []));
|
|
6209
|
+
normalizedFields = computed(() => this._normalizedFields(), ...(ngDevMode ? [{ debugName: "normalizedFields" }] : []));
|
|
6210
|
+
ngOnChanges(changes) {
|
|
6211
|
+
if ('context' in changes) {
|
|
6212
|
+
this.refresh();
|
|
6213
|
+
}
|
|
6214
|
+
}
|
|
6215
|
+
refresh() {
|
|
6216
|
+
const ctx = this.context || this.injected || undefined;
|
|
6217
|
+
this._ctx.set(ctx);
|
|
6218
|
+
if (!ctx) {
|
|
6219
|
+
this._componentMeta.set(undefined);
|
|
6220
|
+
this._normalizedFields.set([]);
|
|
6221
|
+
return;
|
|
6222
|
+
}
|
|
6223
|
+
const meta = ctx.componentId ? this.registry.get(ctx.componentId) : undefined;
|
|
6224
|
+
this._componentMeta.set(meta);
|
|
6225
|
+
// Compute normalized fields if needed
|
|
6226
|
+
if (ctx.normalizedFields && ctx.normalizedFields.length) {
|
|
6227
|
+
this._normalizedFields.set(ctx.normalizedFields);
|
|
6228
|
+
}
|
|
6229
|
+
else if (ctx.backendSchema) {
|
|
6230
|
+
try {
|
|
6231
|
+
const defs = this.normalizer.normalizeSchema(ctx.backendSchema);
|
|
6232
|
+
this._normalizedFields.set(defs || []);
|
|
6233
|
+
}
|
|
6234
|
+
catch {
|
|
6235
|
+
this._normalizedFields.set([]);
|
|
6236
|
+
}
|
|
6237
|
+
}
|
|
6238
|
+
else {
|
|
6239
|
+
this._normalizedFields.set([]);
|
|
6240
|
+
}
|
|
6241
|
+
}
|
|
6242
|
+
hasAnyData() {
|
|
6243
|
+
const c = this._ctx();
|
|
6244
|
+
return !!(c?.rawConfig || c?.effectiveConfig || c?.backendSchema || (this._normalizedFields()?.length));
|
|
6245
|
+
}
|
|
6246
|
+
copyAll() {
|
|
6247
|
+
const c = this._ctx();
|
|
6248
|
+
const payload = {
|
|
6249
|
+
component: this._componentMeta(),
|
|
6250
|
+
config: { raw: c?.rawConfig, effective: c?.effectiveConfig },
|
|
6251
|
+
backendSchema: { meta: c?.schemaMeta, body: c?.backendSchema },
|
|
6252
|
+
fields: this._normalizedFields(),
|
|
6253
|
+
};
|
|
6254
|
+
try {
|
|
6255
|
+
const text = JSON.stringify(payload, null, 2);
|
|
6256
|
+
if (typeof navigator !== 'undefined' && navigator.clipboard?.writeText) {
|
|
6257
|
+
navigator.clipboard.writeText(text);
|
|
6258
|
+
}
|
|
6259
|
+
else {
|
|
6260
|
+
// Fallback: create a temp textarea
|
|
6261
|
+
const ta = document.createElement('textarea');
|
|
6262
|
+
ta.value = text;
|
|
6263
|
+
document.body.appendChild(ta);
|
|
6264
|
+
ta.select();
|
|
6265
|
+
document.execCommand('copy');
|
|
6266
|
+
document.body.removeChild(ta);
|
|
6267
|
+
}
|
|
6268
|
+
}
|
|
6269
|
+
catch { }
|
|
6270
|
+
}
|
|
6271
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SchemaViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6272
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: SchemaViewerComponent, isStandalone: true, selector: "praxis-schema-viewer", inputs: { context: "context" }, usesOnChanges: true, ngImport: i0, template: `
|
|
6273
|
+
<mat-card class="schema-viewer" appearance="outlined">
|
|
6274
|
+
<mat-card-header>
|
|
6275
|
+
<div class="header">
|
|
6276
|
+
<div class="title">
|
|
6277
|
+
<mat-icon fontIcon="schema"></mat-icon>
|
|
6278
|
+
<h3>{{ ctx()?.title || 'Schema & Metadata' }}</h3>
|
|
6279
|
+
</div>
|
|
6280
|
+
<div class="actions">
|
|
6281
|
+
<button mat-stroked-button color="primary" (click)="copyAll()" [disabled]="!hasAnyData()">
|
|
6282
|
+
<mat-icon>content_copy</mat-icon>
|
|
6283
|
+
Copiar tudo
|
|
6284
|
+
</button>
|
|
6285
|
+
</div>
|
|
6286
|
+
</div>
|
|
6287
|
+
<div class="notes" *ngIf="ctx()?.notes">{{ ctx()?.notes }}</div>
|
|
6288
|
+
</mat-card-header>
|
|
6289
|
+
<mat-card-content>
|
|
6290
|
+
<mat-tab-group>
|
|
6291
|
+
<mat-tab label="Component">
|
|
6292
|
+
<div class="section">
|
|
6293
|
+
<div class="kv"><span>Id</span><code>{{ componentMeta()?.id }}</code></div>
|
|
6294
|
+
<div class="kv"><span>Selector</span><code>{{ componentMeta()?.selector }}</code></div>
|
|
6295
|
+
<div class="kv"><span>Lib</span><code>{{ componentMeta()?.lib || '—' }}</code></div>
|
|
6296
|
+
<div class="kv"><span>Friendly</span><code>{{ componentMeta()?.friendlyName }}</code></div>
|
|
6297
|
+
<div class="kv" *ngIf="componentMeta()?.description"><span>Descrição</span><code>{{ componentMeta()?.description }}</code></div>
|
|
6298
|
+
|
|
6299
|
+
<div class="sub">Inputs</div>
|
|
6300
|
+
<pre class="pretty" *ngIf="componentMeta()?.inputs?.length; else noInputs">{{ componentMeta()?.inputs | json }}</pre>
|
|
6301
|
+
<ng-template #noInputs><div class="muted">Sem inputs documentados.</div></ng-template>
|
|
6302
|
+
|
|
6303
|
+
<div class="sub">Outputs</div>
|
|
6304
|
+
<pre class="pretty" *ngIf="componentMeta()?.outputs?.length; else noOutputs">{{ componentMeta()?.outputs | json }}</pre>
|
|
6305
|
+
<ng-template #noOutputs><div class="muted">Sem outputs documentados.</div></ng-template>
|
|
6306
|
+
</div>
|
|
6307
|
+
</mat-tab>
|
|
6308
|
+
|
|
6309
|
+
<mat-tab label="Config">
|
|
6310
|
+
<div class="section">
|
|
6311
|
+
<div class="sub">Raw</div>
|
|
6312
|
+
<pre class="pretty" *ngIf="ctx()?.rawConfig as rc; else noRaw">{{ rc | json }}</pre>
|
|
6313
|
+
<ng-template #noRaw><div class="muted">Sem configuração fornecida.</div></ng-template>
|
|
6314
|
+
|
|
6315
|
+
<div class="sub">Effective</div>
|
|
6316
|
+
<pre class="pretty" *ngIf="ctx()?.effectiveConfig as ec; else noEff">{{ ec | json }}</pre>
|
|
6317
|
+
<ng-template #noEff><div class="muted">Sem configuração efetiva (usando raw/defaults do componente).</div></ng-template>
|
|
6318
|
+
</div>
|
|
6319
|
+
</mat-tab>
|
|
6320
|
+
|
|
6321
|
+
<mat-tab label="Backend Schema">
|
|
6322
|
+
<div class="section">
|
|
6323
|
+
<div class="kv" *ngIf="ctx()?.schemaMeta as m">
|
|
6324
|
+
<span>Path</span><code>{{ m.path }}</code>
|
|
6325
|
+
</div>
|
|
6326
|
+
<div class="kv" *ngIf="ctx()?.schemaMeta as m">
|
|
6327
|
+
<span>Operation</span><code>{{ m.operation }}</code>
|
|
6328
|
+
</div>
|
|
6329
|
+
<div class="kv" *ngIf="ctx()?.schemaMeta as m">
|
|
6330
|
+
<span>Schema Type</span><code>{{ m.schemaType }}</code>
|
|
6331
|
+
</div>
|
|
6332
|
+
<div class="kv" *ngIf="ctx()?.schemaMeta?.schemaHash">
|
|
6333
|
+
<span>Server Hash</span><code>{{ ctx()?.schemaMeta?.schemaHash }}</code>
|
|
6334
|
+
</div>
|
|
6335
|
+
<pre class="pretty" *ngIf="ctx()?.backendSchema as bs; else noSchema">{{ bs | json }}</pre>
|
|
6336
|
+
<ng-template #noSchema><div class="muted">Sem schema de backend.</div></ng-template>
|
|
6337
|
+
</div>
|
|
6338
|
+
</mat-tab>
|
|
6339
|
+
|
|
6340
|
+
<mat-tab label="Fields">
|
|
6341
|
+
<div class="section">
|
|
6342
|
+
<div class="muted" *ngIf="!normalizedFields()?.length">Sem campos normalizados.</div>
|
|
6343
|
+
<pre class="pretty" *ngIf="normalizedFields()?.length">{{ normalizedFields() | json }}</pre>
|
|
6344
|
+
</div>
|
|
6345
|
+
</mat-tab>
|
|
6346
|
+
</mat-tab-group>
|
|
6347
|
+
</mat-card-content>
|
|
6348
|
+
</mat-card>
|
|
6349
|
+
`, isInline: true, styles: [".schema-viewer{display:block}.header{display:flex;align-items:center;justify-content:space-between;gap:8px}.title{display:flex;align-items:center;gap:8px}.title h3{margin:0;font-weight:600}.notes{margin-top:6px;opacity:.78;font-size:12px}.section{padding:12px}.sub{font-weight:600;margin:12px 0 4px;opacity:.9}.pretty{background:#0b0b0b0d;padding:8px;border-radius:4px;overflow:auto}.kv{display:grid;grid-template-columns:140px 1fr;align-items:baseline;gap:8px;margin:2px 0}.kv>span{opacity:.75}.kv>code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.muted{opacity:.6}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatTabsModule }, { kind: "component", type: i2$2.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass", "id"], exportAs: ["matTab"] }, { kind: "component", type: i2$2.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "mat-align-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i3.MatCardHeader, selector: "mat-card-header" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: i2.JsonPipe, name: "json" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6350
|
+
}
|
|
6351
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SchemaViewerComponent, decorators: [{
|
|
6352
|
+
type: Component,
|
|
6353
|
+
args: [{ selector: 'praxis-schema-viewer', standalone: true, imports: [CommonModule, MatTabsModule, MatCardModule, MatButtonModule, MatIconModule], template: `
|
|
6354
|
+
<mat-card class="schema-viewer" appearance="outlined">
|
|
6355
|
+
<mat-card-header>
|
|
6356
|
+
<div class="header">
|
|
6357
|
+
<div class="title">
|
|
6358
|
+
<mat-icon fontIcon="schema"></mat-icon>
|
|
6359
|
+
<h3>{{ ctx()?.title || 'Schema & Metadata' }}</h3>
|
|
6360
|
+
</div>
|
|
6361
|
+
<div class="actions">
|
|
6362
|
+
<button mat-stroked-button color="primary" (click)="copyAll()" [disabled]="!hasAnyData()">
|
|
6363
|
+
<mat-icon>content_copy</mat-icon>
|
|
6364
|
+
Copiar tudo
|
|
6365
|
+
</button>
|
|
6366
|
+
</div>
|
|
6367
|
+
</div>
|
|
6368
|
+
<div class="notes" *ngIf="ctx()?.notes">{{ ctx()?.notes }}</div>
|
|
6369
|
+
</mat-card-header>
|
|
6370
|
+
<mat-card-content>
|
|
6371
|
+
<mat-tab-group>
|
|
6372
|
+
<mat-tab label="Component">
|
|
6373
|
+
<div class="section">
|
|
6374
|
+
<div class="kv"><span>Id</span><code>{{ componentMeta()?.id }}</code></div>
|
|
6375
|
+
<div class="kv"><span>Selector</span><code>{{ componentMeta()?.selector }}</code></div>
|
|
6376
|
+
<div class="kv"><span>Lib</span><code>{{ componentMeta()?.lib || '—' }}</code></div>
|
|
6377
|
+
<div class="kv"><span>Friendly</span><code>{{ componentMeta()?.friendlyName }}</code></div>
|
|
6378
|
+
<div class="kv" *ngIf="componentMeta()?.description"><span>Descrição</span><code>{{ componentMeta()?.description }}</code></div>
|
|
6379
|
+
|
|
6380
|
+
<div class="sub">Inputs</div>
|
|
6381
|
+
<pre class="pretty" *ngIf="componentMeta()?.inputs?.length; else noInputs">{{ componentMeta()?.inputs | json }}</pre>
|
|
6382
|
+
<ng-template #noInputs><div class="muted">Sem inputs documentados.</div></ng-template>
|
|
6383
|
+
|
|
6384
|
+
<div class="sub">Outputs</div>
|
|
6385
|
+
<pre class="pretty" *ngIf="componentMeta()?.outputs?.length; else noOutputs">{{ componentMeta()?.outputs | json }}</pre>
|
|
6386
|
+
<ng-template #noOutputs><div class="muted">Sem outputs documentados.</div></ng-template>
|
|
6387
|
+
</div>
|
|
6388
|
+
</mat-tab>
|
|
6389
|
+
|
|
6390
|
+
<mat-tab label="Config">
|
|
6391
|
+
<div class="section">
|
|
6392
|
+
<div class="sub">Raw</div>
|
|
6393
|
+
<pre class="pretty" *ngIf="ctx()?.rawConfig as rc; else noRaw">{{ rc | json }}</pre>
|
|
6394
|
+
<ng-template #noRaw><div class="muted">Sem configuração fornecida.</div></ng-template>
|
|
6395
|
+
|
|
6396
|
+
<div class="sub">Effective</div>
|
|
6397
|
+
<pre class="pretty" *ngIf="ctx()?.effectiveConfig as ec; else noEff">{{ ec | json }}</pre>
|
|
6398
|
+
<ng-template #noEff><div class="muted">Sem configuração efetiva (usando raw/defaults do componente).</div></ng-template>
|
|
6399
|
+
</div>
|
|
6400
|
+
</mat-tab>
|
|
6401
|
+
|
|
6402
|
+
<mat-tab label="Backend Schema">
|
|
6403
|
+
<div class="section">
|
|
6404
|
+
<div class="kv" *ngIf="ctx()?.schemaMeta as m">
|
|
6405
|
+
<span>Path</span><code>{{ m.path }}</code>
|
|
6406
|
+
</div>
|
|
6407
|
+
<div class="kv" *ngIf="ctx()?.schemaMeta as m">
|
|
6408
|
+
<span>Operation</span><code>{{ m.operation }}</code>
|
|
6409
|
+
</div>
|
|
6410
|
+
<div class="kv" *ngIf="ctx()?.schemaMeta as m">
|
|
6411
|
+
<span>Schema Type</span><code>{{ m.schemaType }}</code>
|
|
6412
|
+
</div>
|
|
6413
|
+
<div class="kv" *ngIf="ctx()?.schemaMeta?.schemaHash">
|
|
6414
|
+
<span>Server Hash</span><code>{{ ctx()?.schemaMeta?.schemaHash }}</code>
|
|
6415
|
+
</div>
|
|
6416
|
+
<pre class="pretty" *ngIf="ctx()?.backendSchema as bs; else noSchema">{{ bs | json }}</pre>
|
|
6417
|
+
<ng-template #noSchema><div class="muted">Sem schema de backend.</div></ng-template>
|
|
6418
|
+
</div>
|
|
6419
|
+
</mat-tab>
|
|
6420
|
+
|
|
6421
|
+
<mat-tab label="Fields">
|
|
6422
|
+
<div class="section">
|
|
6423
|
+
<div class="muted" *ngIf="!normalizedFields()?.length">Sem campos normalizados.</div>
|
|
6424
|
+
<pre class="pretty" *ngIf="normalizedFields()?.length">{{ normalizedFields() | json }}</pre>
|
|
6425
|
+
</div>
|
|
6426
|
+
</mat-tab>
|
|
6427
|
+
</mat-tab-group>
|
|
6428
|
+
</mat-card-content>
|
|
6429
|
+
</mat-card>
|
|
6430
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".schema-viewer{display:block}.header{display:flex;align-items:center;justify-content:space-between;gap:8px}.title{display:flex;align-items:center;gap:8px}.title h3{margin:0;font-weight:600}.notes{margin-top:6px;opacity:.78;font-size:12px}.section{padding:12px}.sub{font-weight:600;margin:12px 0 4px;opacity:.9}.pretty{background:#0b0b0b0d;padding:8px;border-radius:4px;overflow:auto}.kv{display:grid;grid-template-columns:140px 1fr;align-items:baseline;gap:8px;margin:2px 0}.kv>span{opacity:.75}.kv>code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.muted{opacity:.6}\n"] }]
|
|
6431
|
+
}], propDecorators: { context: [{
|
|
6432
|
+
type: Input
|
|
6433
|
+
}] } });
|
|
6434
|
+
|
|
6176
6435
|
async function fetchWithETag(params) {
|
|
6177
6436
|
const headers = { Accept: 'application/json' };
|
|
6178
6437
|
if (params.schemaHash)
|
|
@@ -6771,5 +7030,5 @@ function provideHookWhitelist(allowed) {
|
|
|
6771
7030
|
* Generated bundle index. Do not edit.
|
|
6772
7031
|
*/
|
|
6773
7032
|
|
|
6774
|
-
export { API_URL, AllowedFileTypes, ApiEndpoint, CONFIG_STORAGE, CONNECTION_STORAGE, ComponentMetadataRegistry, ConnectionManagerService, DEFAULT_TABLE_CONFIG, DynamicFormService, DynamicGridPageComponent, DynamicWidgetLoaderDirective, DynamicWidgetPageComponent, EmptyStateCardComponent, ErrorMessageService, FORM_HOOKS, FORM_HOOKS_PRESETS, FORM_HOOKS_WHITELIST, FORM_HOOK_RESOLVERS, FieldControlType, FieldDataType, FormHooksRegistry, GLOBAL_CONFIG, GenericCrudService, GlobalConfigService, IconPickerService, IconPosition, IconSize, LocalConnectionStorage, LocalStorageCacheAdapter, LocalStorageConfigService, NumericFormat, OVERLAY_DECIDER_DEBUG, OVERLAY_DECISION_MATRIX, OverlayDeciderService, PraxisCore, PraxisIconDirective, PraxisIconPickerComponent, ResourceQuickConnectComponent, SETTINGS_PANEL_BRIDGE, SETTINGS_PANEL_DATA, STEPPER_CONFIG_EDITOR, SchemaMetadataClient, SchemaNormalizerService, TABLE_CONFIG_EDITOR, TableConfigService, TelemetryService, ValidationPattern, applyLocalCustomizations$2 as applyLocalCustomizations, applyLocalCustomizations$1 as applyLocalFormCustomizations, buildAngularValidators, buildApiUrl, buildBaseColumnFromDef, buildBaseFormField, buildHeaders, buildPageKey, buildSchemaId, buildValidatorsFromValidatorOptions, cancelIfCpfInvalidHook, cloneTableConfig, cnpjAlphaValidator, collapseWhitespace, composeHeadersWithVersion, conditionalAsyncValidator, convertFormLayoutToConfig, createCpfCnpjValidator, createDefaultFormConfig, createDefaultTableConfig, createEmptyFormConfig, createPersistedPage, customAsyncValidatorFn, customValidatorFn, debounceAsyncValidator, deepMerge, ensureIds, ensureNoConflictsHookFactory, ensurePageIds, fetchWithETag, fileTypeValidator, fillUndefined, generateId, getEssentialConfig, getReferencedFieldMetadata, getTextTransformer, isCssTextTransform, isTableConfigV2, isValidFormConfig, isValidTableConfig, legacyCnpjValidator, legacyCpfValidator, logOnErrorHook, mapFieldDefinitionToMetadata, mapFieldDefinitionsToMetadata, matchFieldValidator, maxFileSizeValidator, mergeFieldMetadata, mergeTableConfigs, minWordsValidator, normalizeFieldConstraints, normalizeFormConfig, normalizeFormMetadata, normalizePath, notifySuccessHook, prefillFromContextHook, provideDefaultFormHooks, provideFormHookPresets, provideFormHooks, provideGlobalConfig, provideGlobalConfigSeed, provideGlobalConfigTenant, provideHookResolvers, provideHookWhitelist, provideOverlayDecisionMatrix, provideRemoteGlobalConfig, reconcileFilterConfig, reconcileFormConfig, reconcileTableConfig, removeDiacritics, reportTelemetryHookFactory, requiredCheckedValidator, resolveHidden, resolveOffset, resolveOrder, resolveSpan, slugify, stripMasksHook, syncWithServerMetadata, toCamel, toCapitalize, toKebab, toPascal, toSentenceCase, toSnake, toTitleCase, trim, uniqueAsyncValidator, urlValidator, withMessage };
|
|
7033
|
+
export { API_URL, AllowedFileTypes, ApiEndpoint, CONFIG_STORAGE, CONNECTION_STORAGE, ComponentMetadataRegistry, ConnectionManagerService, DEFAULT_TABLE_CONFIG, DynamicFormService, DynamicGridPageComponent, DynamicWidgetLoaderDirective, DynamicWidgetPageComponent, EmptyStateCardComponent, ErrorMessageService, FORM_HOOKS, FORM_HOOKS_PRESETS, FORM_HOOKS_WHITELIST, FORM_HOOK_RESOLVERS, FieldControlType, FieldDataType, FormHooksRegistry, GLOBAL_CONFIG, GenericCrudService, GlobalConfigService, IconPickerService, IconPosition, IconSize, LocalConnectionStorage, LocalStorageCacheAdapter, LocalStorageConfigService, NumericFormat, OVERLAY_DECIDER_DEBUG, OVERLAY_DECISION_MATRIX, OverlayDeciderService, PraxisCore, PraxisIconDirective, PraxisIconPickerComponent, ResourceQuickConnectComponent, SCHEMA_VIEWER_CONTEXT, SETTINGS_PANEL_BRIDGE, SETTINGS_PANEL_DATA, STEPPER_CONFIG_EDITOR, SchemaMetadataClient, SchemaNormalizerService, SchemaViewerComponent, TABLE_CONFIG_EDITOR, TableConfigService, TelemetryService, ValidationPattern, applyLocalCustomizations$2 as applyLocalCustomizations, applyLocalCustomizations$1 as applyLocalFormCustomizations, buildAngularValidators, buildApiUrl, buildBaseColumnFromDef, buildBaseFormField, buildHeaders, buildPageKey, buildSchemaId, buildValidatorsFromValidatorOptions, cancelIfCpfInvalidHook, cloneTableConfig, cnpjAlphaValidator, collapseWhitespace, composeHeadersWithVersion, conditionalAsyncValidator, convertFormLayoutToConfig, createCpfCnpjValidator, createDefaultFormConfig, createDefaultTableConfig, createEmptyFormConfig, createPersistedPage, customAsyncValidatorFn, customValidatorFn, debounceAsyncValidator, deepMerge, ensureIds, ensureNoConflictsHookFactory, ensurePageIds, fetchWithETag, fileTypeValidator, fillUndefined, generateId, getEssentialConfig, getReferencedFieldMetadata, getTextTransformer, isCssTextTransform, isTableConfigV2, isValidFormConfig, isValidTableConfig, legacyCnpjValidator, legacyCpfValidator, logOnErrorHook, mapFieldDefinitionToMetadata, mapFieldDefinitionsToMetadata, matchFieldValidator, maxFileSizeValidator, mergeFieldMetadata, mergeTableConfigs, minWordsValidator, normalizeFieldConstraints, normalizeFormConfig, normalizeFormMetadata, normalizePath, notifySuccessHook, prefillFromContextHook, provideDefaultFormHooks, provideFormHookPresets, provideFormHooks, provideGlobalConfig, provideGlobalConfigSeed, provideGlobalConfigTenant, provideHookResolvers, provideHookWhitelist, provideOverlayDecisionMatrix, provideRemoteGlobalConfig, reconcileFilterConfig, reconcileFormConfig, reconcileTableConfig, removeDiacritics, reportTelemetryHookFactory, requiredCheckedValidator, resolveHidden, resolveOffset, resolveOrder, resolveSpan, slugify, stripMasksHook, syncWithServerMetadata, toCamel, toCapitalize, toKebab, toPascal, toSentenceCase, toSnake, toTitleCase, trim, uniqueAsyncValidator, urlValidator, withMessage };
|
|
6775
7034
|
//# sourceMappingURL=praxisui-core.mjs.map
|