@praxisui/dynamic-form 3.0.0-beta.2 → 3.0.0-beta.4
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.
|
@@ -5672,7 +5672,9 @@ class PraxisDynamicForm {
|
|
|
5672
5672
|
let externalConfigChanged = false;
|
|
5673
5673
|
if (changes['config']?.currentValue) {
|
|
5674
5674
|
const normalizedIncomingConfig = normalizeFormConfig$1(changes['config'].currentValue);
|
|
5675
|
-
externalConfigChanged =
|
|
5675
|
+
externalConfigChanged =
|
|
5676
|
+
changes['config'].firstChange ||
|
|
5677
|
+
!this.isEquivalentFormConfig(this.config, normalizedIncomingConfig);
|
|
5676
5678
|
if (externalConfigChanged) {
|
|
5677
5679
|
this.config = normalizedIncomingConfig;
|
|
5678
5680
|
this.logRowGapsSnapshot('config@input');
|
|
@@ -9031,6 +9033,19 @@ class PraxisDynamicForm {
|
|
|
9031
9033
|
const patchExtra = patch.extra || {};
|
|
9032
9034
|
fm.extra = { ...currExtra, ...patchExtra };
|
|
9033
9035
|
}
|
|
9036
|
+
const extraEntries = Object.entries(patch || {}).filter(([key]) => key.startsWith('extra.'));
|
|
9037
|
+
if (extraEntries.length) {
|
|
9038
|
+
const currExtra = fm.extra && typeof fm.extra === 'object'
|
|
9039
|
+
? { ...fm.extra }
|
|
9040
|
+
: {};
|
|
9041
|
+
for (const [key, value] of extraEntries) {
|
|
9042
|
+
const extraKey = key.slice('extra.'.length);
|
|
9043
|
+
if (!extraKey)
|
|
9044
|
+
continue;
|
|
9045
|
+
currExtra[extraKey] = value;
|
|
9046
|
+
}
|
|
9047
|
+
fm.extra = currExtra;
|
|
9048
|
+
}
|
|
9034
9049
|
// Required canonical top-level only
|
|
9035
9050
|
if (patch.required !== undefined) {
|
|
9036
9051
|
fm.required = patch.required;
|
|
@@ -9199,8 +9214,18 @@ class PraxisDynamicForm {
|
|
|
9199
9214
|
fm.searchable = !!patch.searchable;
|
|
9200
9215
|
if (patch.selectAll !== undefined)
|
|
9201
9216
|
fm.selectAll = !!patch.selectAll;
|
|
9217
|
+
if (patch.searchPlaceholder !== undefined)
|
|
9218
|
+
fm.searchPlaceholder = patch.searchPlaceholder;
|
|
9202
9219
|
if (patch.maxSelections !== undefined)
|
|
9203
9220
|
fm.maxSelections = toNum(patch.maxSelections);
|
|
9221
|
+
if (patch.leftLabel !== undefined)
|
|
9222
|
+
fm.leftLabel = patch.leftLabel;
|
|
9223
|
+
if (patch.rightLabel !== undefined)
|
|
9224
|
+
fm.rightLabel = patch.rightLabel;
|
|
9225
|
+
if (patch.leftPlaceholder !== undefined)
|
|
9226
|
+
fm.leftPlaceholder = patch.leftPlaceholder;
|
|
9227
|
+
if (patch.rightPlaceholder !== undefined)
|
|
9228
|
+
fm.rightPlaceholder = patch.rightPlaceholder;
|
|
9204
9229
|
// Tree-select specific behaviour flags
|
|
9205
9230
|
if (patch.leafOnly !== undefined)
|
|
9206
9231
|
fm.leafOnly = !!patch.leafOnly;
|
|
@@ -10657,6 +10682,12 @@ class PraxisDynamicForm {
|
|
|
10657
10682
|
preserveInteractionState: true,
|
|
10658
10683
|
fallbackToLoadedEntity: true,
|
|
10659
10684
|
});
|
|
10685
|
+
const hasRenderableConfig = (this.config?.sections?.length ?? 0) > 0 ||
|
|
10686
|
+
(this.config?.fieldMetadata?.length ?? 0) > 0;
|
|
10687
|
+
if (hasRenderableConfig) {
|
|
10688
|
+
this.isInitialized = true;
|
|
10689
|
+
this.initializationStatus = 'success';
|
|
10690
|
+
}
|
|
10660
10691
|
}
|
|
10661
10692
|
if (plan.runtime?.rebindMode && targetMode && targetMode !== previousMode) {
|
|
10662
10693
|
this.reloadForModeChange();
|
|
@@ -17861,6 +17892,7 @@ class PraxisFilterForm {
|
|
|
17861
17892
|
formReady = new EventEmitter();
|
|
17862
17893
|
valueChange = new EventEmitter();
|
|
17863
17894
|
submit = new EventEmitter();
|
|
17895
|
+
requestSearch = this.submit;
|
|
17864
17896
|
// Novo: estado de validade do formulário
|
|
17865
17897
|
validityChange = new EventEmitter();
|
|
17866
17898
|
form = new FormGroup({});
|
|
@@ -17917,7 +17949,7 @@ class PraxisFilterForm {
|
|
|
17917
17949
|
return `col-${i}-${col.fields.join(',')}`;
|
|
17918
17950
|
}
|
|
17919
17951
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: PraxisFilterForm, deps: [{ token: i1$2.DynamicFormService }], target: i0.ɵɵFactoryTarget.Component });
|
|
17920
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.17", type: PraxisFilterForm, isStandalone: true, selector: "praxis-filter-form", inputs: { config: "config", formId: "formId", resourcePath: "resourcePath", mode: "mode" }, outputs: { formReady: "formReady", valueChange: "valueChange", submit: "submit", validityChange: "validityChange" }, usesOnChanges: true, ngImport: i0, template: "<form [formGroup]=\"form\" class=\"praxis-filter-form\" (ngSubmit)=\"onFormSubmit()\">\n @if (hasLayout) { @for (section of config.sections; track section?.id ??\n $index) {\n <div class=\"filter-section\">\n @if (section.title) {\n <h3>{{ section.title }}</h3>\n } @for (row of section.rows; track $index) {\n <div class=\"filter-row\">\n @for ( column of row.columns; track (column?.fields?.join(',') ?? $index)\n ) {\n <div class=\"filter-column\">\n <ng-container\n dynamicFieldLoader\n [fields]=\"getColumnFields(column)\"\n [formGroup]=\"form\"\n [enableExternalControlBinding]=\"true\"\n ></ng-container>\n </div>\n }\n </div>\n }\n </div>\n } } @else {\n <div class=\"filter-row\">\n @for (field of (config.fieldMetadata || []); track field?.name ?? $index) {\n <div class=\"filter-column\">\n <ng-container\n dynamicFieldLoader\n [fields]=\"[field]\"\n [formGroup]=\"form\"\n [enableExternalControlBinding]=\"true\"\n ></ng-container>\n </div>\n }\n </div>\n }\n <!-- Bot\u00E3o de submit invis\u00EDvel para garantir submit ao pressionar Enter -->\n <button\n type=\"submit\"\n class=\"hidden-submit\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n ></button>\n</form>", styles: [":host{display:block}.filter-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px 16px}.filter-column{min-width:0}.hidden-submit{display:none;width:0;height:0;padding:0;border:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: DynamicFieldLoaderDirective, selector: "[dynamicFieldLoader]", inputs: ["fields", "formGroup", "enableExternalControlBinding", "itemTemplate", "debugTrace", "debugTraceLabel", "readonlyMode", "disabledMode", "presentationMode", "visible", "canvasMode"], outputs: ["componentsCreated", "fieldCreated", "fieldDestroyed", "renderError", "canvasMouseEnter", "canvasMouseLeave", "canvasClick"] }] });
|
|
17952
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.17", type: PraxisFilterForm, isStandalone: true, selector: "praxis-filter-form", inputs: { config: "config", formId: "formId", resourcePath: "resourcePath", mode: "mode" }, outputs: { formReady: "formReady", valueChange: "valueChange", submit: "submit", requestSearch: "requestSearch", validityChange: "validityChange" }, usesOnChanges: true, ngImport: i0, template: "<form [formGroup]=\"form\" class=\"praxis-filter-form\" (ngSubmit)=\"onFormSubmit()\">\n @if (hasLayout) { @for (section of config.sections; track section?.id ??\n $index) {\n <div class=\"filter-section\">\n @if (section.title) {\n <h3>{{ section.title }}</h3>\n } @for (row of section.rows; track $index) {\n <div class=\"filter-row\">\n @for ( column of row.columns; track (column?.fields?.join(',') ?? $index)\n ) {\n <div class=\"filter-column\">\n <ng-container\n dynamicFieldLoader\n [fields]=\"getColumnFields(column)\"\n [formGroup]=\"form\"\n [enableExternalControlBinding]=\"true\"\n ></ng-container>\n </div>\n }\n </div>\n }\n </div>\n } } @else {\n <div class=\"filter-row\">\n @for (field of (config.fieldMetadata || []); track field?.name ?? $index) {\n <div class=\"filter-column\">\n <ng-container\n dynamicFieldLoader\n [fields]=\"[field]\"\n [formGroup]=\"form\"\n [enableExternalControlBinding]=\"true\"\n ></ng-container>\n </div>\n }\n </div>\n }\n <!-- Bot\u00E3o de submit invis\u00EDvel para garantir submit ao pressionar Enter -->\n <button\n type=\"submit\"\n class=\"hidden-submit\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n ></button>\n</form>", styles: [":host{display:block}.filter-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px 16px}.filter-column{min-width:0}.hidden-submit{display:none;width:0;height:0;padding:0;border:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: DynamicFieldLoaderDirective, selector: "[dynamicFieldLoader]", inputs: ["fields", "formGroup", "enableExternalControlBinding", "itemTemplate", "debugTrace", "debugTraceLabel", "readonlyMode", "disabledMode", "presentationMode", "visible", "canvasMode"], outputs: ["componentsCreated", "fieldCreated", "fieldDestroyed", "renderError", "canvasMouseEnter", "canvasMouseLeave", "canvasClick"] }] });
|
|
17921
17953
|
}
|
|
17922
17954
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: PraxisFilterForm, decorators: [{
|
|
17923
17955
|
type: Component,
|
|
@@ -17937,6 +17969,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
|
|
|
17937
17969
|
type: Output
|
|
17938
17970
|
}], submit: [{
|
|
17939
17971
|
type: Output
|
|
17972
|
+
}], requestSearch: [{
|
|
17973
|
+
type: Output
|
|
17940
17974
|
}], validityChange: [{
|
|
17941
17975
|
type: Output
|
|
17942
17976
|
}] } });
|