@praxisui/dynamic-form 10.0.0-rc.57 → 10.0.0-rc.59
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
|
-
"generatedAt": "2026-11-
|
|
3
|
+
"generatedAt": "2026-11-23T10:34:57.283Z",
|
|
4
4
|
"packageName": "@praxisui/dynamic-form",
|
|
5
|
-
"packageVersion": "10.0.0-rc.
|
|
5
|
+
"packageVersion": "10.0.0-rc.59",
|
|
6
6
|
"sourceRegistry": "praxis-component-registry-ingestion",
|
|
7
7
|
"sourceRegistryVersion": "1.0.0",
|
|
8
8
|
"componentCount": 2,
|
|
@@ -17970,17 +17970,23 @@ class PraxisDynamicForm {
|
|
|
17970
17970
|
this.applyEntityLookupCollectionRequiredValidators(fieldMetadata);
|
|
17971
17971
|
this.restoreFormRuntimeState(previousState, options);
|
|
17972
17972
|
// Inicializar visibilidade padrão por campo
|
|
17973
|
+
const initialNowUtc = new Date().toISOString();
|
|
17974
|
+
const initialValues = this.form.getRawValue();
|
|
17973
17975
|
for (const field of fieldMetadata) {
|
|
17974
|
-
|
|
17976
|
+
const initialCondDisplay = this.evaluateFieldConditionalDisplay(field, initialValues, initialNowUtc);
|
|
17977
|
+
this.fieldVisibility[field.name] = this.resolveFieldVisibility(field, undefined, initialCondDisplay);
|
|
17975
17978
|
}
|
|
17976
17979
|
// Contexto de regras
|
|
17977
17980
|
this.contextService.setAvailableFields(fieldMetadata);
|
|
17978
17981
|
const activeFormRules = this.getActiveFormRules();
|
|
17979
17982
|
this.contextService.setFormRules(activeFormRules);
|
|
17980
|
-
const
|
|
17983
|
+
const hasConditionalRuleFields = fieldMetadata.some((field) => Boolean(field
|
|
17984
|
+
.conditionalReadOnly ||
|
|
17985
|
+
field
|
|
17986
|
+
.conditionalDisplay));
|
|
17981
17987
|
if (activeFormRules.length ||
|
|
17982
17988
|
(this.config.formCommandRules || []).length ||
|
|
17983
|
-
|
|
17989
|
+
hasConditionalRuleFields) {
|
|
17984
17990
|
// Avaliação inicial
|
|
17985
17991
|
this.evaluateAndApplyRules();
|
|
17986
17992
|
}
|
|
@@ -19144,6 +19150,22 @@ class PraxisDynamicForm {
|
|
|
19144
19150
|
if (rawCondition === true) {
|
|
19145
19151
|
return true;
|
|
19146
19152
|
}
|
|
19153
|
+
return this.evaluateFieldConditionExpression(rawCondition, formData, nowUtc);
|
|
19154
|
+
}
|
|
19155
|
+
evaluateFieldConditionalDisplay(field, formData, nowUtc) {
|
|
19156
|
+
const rawCondition = field?.conditionalDisplay;
|
|
19157
|
+
if (rawCondition === undefined || rawCondition === null || rawCondition === '') {
|
|
19158
|
+
return undefined;
|
|
19159
|
+
}
|
|
19160
|
+
if (rawCondition === true) {
|
|
19161
|
+
return true;
|
|
19162
|
+
}
|
|
19163
|
+
if (rawCondition === false) {
|
|
19164
|
+
return false;
|
|
19165
|
+
}
|
|
19166
|
+
return this.evaluateFieldConditionExpression(rawCondition, formData, nowUtc);
|
|
19167
|
+
}
|
|
19168
|
+
evaluateFieldConditionExpression(rawCondition, formData, nowUtc) {
|
|
19147
19169
|
let condition = null;
|
|
19148
19170
|
if (typeof rawCondition === 'string') {
|
|
19149
19171
|
const trimmed = rawCondition.trim();
|
|
@@ -19214,8 +19236,11 @@ class PraxisDynamicForm {
|
|
|
19214
19236
|
const activeFormRules = this.getActiveFormRules();
|
|
19215
19237
|
const commandRules = this.config.formCommandRules || [];
|
|
19216
19238
|
const fieldMetadata = this.getRuntimeFieldMetadata();
|
|
19217
|
-
const
|
|
19218
|
-
|
|
19239
|
+
const hasConditionalRuleFields = fieldMetadata.some((field) => Boolean(field
|
|
19240
|
+
.conditionalReadOnly ||
|
|
19241
|
+
field
|
|
19242
|
+
.conditionalDisplay));
|
|
19243
|
+
if ((!activeFormRules.length && !commandRules.length && !hasConditionalRuleFields) ||
|
|
19219
19244
|
!this.form) {
|
|
19220
19245
|
this.fieldRuleProps = {};
|
|
19221
19246
|
this.sectionRuleProps = {};
|
|
@@ -19270,7 +19295,8 @@ class PraxisDynamicForm {
|
|
|
19270
19295
|
const disabledOverride = overrides.disabled;
|
|
19271
19296
|
const meta = fieldByName.get(field.name);
|
|
19272
19297
|
const condReadOnly = this.evaluateFieldConditionalReadOnly(meta || field, evaluationData, nowUtc);
|
|
19273
|
-
const
|
|
19298
|
+
const condDisplay = this.evaluateFieldConditionalDisplay(meta || field, evaluationData, nowUtc);
|
|
19299
|
+
const isVisible = this.resolveFieldVisibility(meta || field, overrides, condDisplay);
|
|
19274
19300
|
this.fieldVisibility[field.name] = isVisible;
|
|
19275
19301
|
const baseDisabled = meta?.disabled === true || meta?.readOnly === true;
|
|
19276
19302
|
const effectiveReadOnly = readonlyOverride !== undefined
|
|
@@ -21458,8 +21484,8 @@ class PraxisDynamicForm {
|
|
|
21458
21484
|
}
|
|
21459
21485
|
return fallback;
|
|
21460
21486
|
}
|
|
21461
|
-
resolveFieldVisibility(field, props) {
|
|
21462
|
-
const fallback = !this.isFieldMetadataHidden(field);
|
|
21487
|
+
resolveFieldVisibility(field, props, conditionalDisplay) {
|
|
21488
|
+
const fallback = conditionalDisplay !== undefined ? conditionalDisplay : !this.isFieldMetadataHidden(field);
|
|
21463
21489
|
return this.resolveRuleVisibility(props, fallback);
|
|
21464
21490
|
}
|
|
21465
21491
|
isFieldMetadataHidden(field) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/dynamic-form",
|
|
3
|
-
"version": "10.0.0-rc.
|
|
3
|
+
"version": "10.0.0-rc.59",
|
|
4
4
|
"description": "Angular dynamic form engine for Praxis UI: metadata-driven forms, hooks, and services integrating @praxisui/* packages.",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^21.0.0",
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"@angular/forms": "^21.0.0",
|
|
10
10
|
"@angular/material": "^21.0.0",
|
|
11
11
|
"@angular/router": "^21.0.0",
|
|
12
|
-
"@praxisui/ai": "^10.0.0-rc.
|
|
13
|
-
"@praxisui/dynamic-fields": "^10.0.0-rc.
|
|
14
|
-
"@praxisui/metadata-editor": "^10.0.0-rc.
|
|
15
|
-
"@praxisui/rich-content": "^10.0.0-rc.
|
|
16
|
-
"@praxisui/settings-panel": "^10.0.0-rc.
|
|
17
|
-
"@praxisui/visual-builder": "^10.0.0-rc.
|
|
18
|
-
"@praxisui/core": "^10.0.0-rc.
|
|
12
|
+
"@praxisui/ai": "^10.0.0-rc.59",
|
|
13
|
+
"@praxisui/dynamic-fields": "^10.0.0-rc.59",
|
|
14
|
+
"@praxisui/metadata-editor": "^10.0.0-rc.59",
|
|
15
|
+
"@praxisui/rich-content": "^10.0.0-rc.59",
|
|
16
|
+
"@praxisui/settings-panel": "^10.0.0-rc.59",
|
|
17
|
+
"@praxisui/visual-builder": "^10.0.0-rc.59",
|
|
18
|
+
"@praxisui/core": "^10.0.0-rc.59",
|
|
19
19
|
"rxjs": "^7.8.0"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
@@ -1477,6 +1477,8 @@ declare class PraxisDynamicForm implements OnInit, OnChanges, OnDestroy, PraxisR
|
|
|
1477
1477
|
private refreshMaterializedFormRules;
|
|
1478
1478
|
private resolveDomainRulesOptions;
|
|
1479
1479
|
private evaluateFieldConditionalReadOnly;
|
|
1480
|
+
private evaluateFieldConditionalDisplay;
|
|
1481
|
+
private evaluateFieldConditionExpression;
|
|
1480
1482
|
private evaluateAndApplyRules;
|
|
1481
1483
|
private applyRuleComputedFieldValues;
|
|
1482
1484
|
private evaluateAndDispatchFormCommandRules;
|