fx-form-builder-wrapper 2.0.72 → 2.0.74
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.
|
@@ -1486,38 +1486,41 @@ class UploaderComponent extends FxBaseComponent {
|
|
|
1486
1486
|
});
|
|
1487
1487
|
}
|
|
1488
1488
|
ngAfterViewInit() {
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1489
|
+
setTimeout(() => {
|
|
1490
|
+
const key = this.fxComponent?.fxData?.name;
|
|
1491
|
+
console.log('Uploader Key:', key);
|
|
1492
|
+
console.log('Uploaded Files Map:', this.uploadedFilesMap);
|
|
1493
|
+
const files = this.uploadedFilesMap?.[key];
|
|
1494
|
+
console.log('Files to Patch:', files);
|
|
1495
|
+
// Strong check — ensures patching happens only when files actually exist
|
|
1496
|
+
if (key && Array.isArray(files) && files.length > 0) {
|
|
1497
|
+
const formatted = files
|
|
1498
|
+
.filter((fileObj) => !!fileObj)
|
|
1499
|
+
.map((fileObj) => {
|
|
1500
|
+
const originalUrlObj = fileObj.originalUrl;
|
|
1501
|
+
const fileName = originalUrlObj?.fileName || '';
|
|
1502
|
+
const previewUrl = originalUrlObj?.previewUrl;
|
|
1503
|
+
const type = fileObj?.type;
|
|
1504
|
+
return {
|
|
1505
|
+
id: v4(),
|
|
1506
|
+
file: null,
|
|
1507
|
+
originalUrl: originalUrlObj,
|
|
1508
|
+
result: previewUrl,
|
|
1509
|
+
name: fileName,
|
|
1510
|
+
title: fileObj?.title || '',
|
|
1511
|
+
notes: fileObj?.notes || '',
|
|
1512
|
+
categoryId: fileObj?.categoryId || '',
|
|
1513
|
+
type: type,
|
|
1514
|
+
};
|
|
1515
|
+
});
|
|
1516
|
+
console.log('Formatted Files for Patching:', formatted);
|
|
1517
|
+
if (formatted.length > 0) {
|
|
1518
|
+
this.uploadedFiles = [...this.uploadedFiles, ...formatted];
|
|
1519
|
+
this.formattedData.uploadedFiles = this.uploadedFiles;
|
|
1520
|
+
this.uploadFileControl.setValue(this.formattedData);
|
|
1521
|
+
}
|
|
1519
1522
|
}
|
|
1520
|
-
}
|
|
1523
|
+
}, 100);
|
|
1521
1524
|
}
|
|
1522
1525
|
onFileSelected(event) {
|
|
1523
1526
|
const input = event.target;
|
|
@@ -2511,7 +2514,9 @@ class RadioGroupComponent extends FxBaseComponent {
|
|
|
2511
2514
|
return [];
|
|
2512
2515
|
}
|
|
2513
2516
|
onSelectionChange(selection) {
|
|
2514
|
-
this.
|
|
2517
|
+
const labelData = this.fxComponent?.fxData?.settings?.find((s) => s.key === 'value-show-text')?.value ??
|
|
2518
|
+
'';
|
|
2519
|
+
this.showTextArea = selection === labelData;
|
|
2515
2520
|
}
|
|
2516
2521
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RadioGroupComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.HttpClient }, { token: FxBuilderWrapperService }, { token: i3$2.ApiServiceRegistry }], target: i0.ɵɵFactoryTarget.Component });
|
|
2517
2522
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: RadioGroupComponent, isStandalone: true, selector: "radio-group-custom", inputs: { showOnSelection: "showOnSelection" }, viewQueries: [{ propertyName: "fxComponent", first: true, predicate: ["fxComponent"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<fx-component [fxData]=\"fxData\" #fxComponent>\r\n <form [formGroup]=\"confirmationForm\" class=\"flex flex-col gap-4\">\r\n\r\n <!-- Title -->\r\n <label class=\"font-semibold text-gray-800\">\r\n {{ setting('select-label') }}\r\n </label>\r\n\r\n <!-- ROW -->\r\n <div class=\"flex items-start gap-16\">\r\n\r\n <!-- RADIO GROUP -->\r\n <div class=\"flex flex-col\">\r\n <div class=\"flex items-center custom-gap\">\r\n\r\n <label\r\n *ngFor=\"let opt of options\"\r\n class=\"flex items-center gap-2 cursor-pointer text-gray-700\"\r\n >\r\n <input\r\n type=\"radio\"\r\n formControlName=\"confirmation\"\r\n [value]=\"opt.value\"\r\n (change)=\"onSelectionChange(opt.value)\"\r\n class=\"w-4 h-4 accent-blue-600 cursor-pointer\"\r\n />\r\n <span>{{ opt.option }}</span>\r\n </label>\r\n\r\n </div>\r\n\r\n <!-- Radio error -->\r\n <small\r\n *ngIf=\"\r\n confirmationForm.get('confirmation')?.touched &&\r\n confirmationForm.get('confirmation')?.errors?.['required']\r\n \"\r\n class=\"text-red-500 mt-1\"\r\n >\r\n {{ setting('error-msg') }}\r\n </small>\r\n </div>\r\n\r\n <!-- REMARKS -->\r\n <div *ngIf=\"showTextArea\" class=\"flex flex-col w-80 ml-4\">\r\n\r\n <label class=\"mb-2 font-medium text-gray-700\">\r\n {{ setting('additional-field-label') }}\r\n </label>\r\n\r\n <textarea\r\n formControlName=\"remarks\"\r\n rows=\"3\"\r\n placeholder=\" {{ setting('additional-field-label') }}\"\r\n class=\"border border-gray-300 rounded-lg p-3 w-full \r\n resize-none shadow-sm\r\n focus:outline-none focus:ring-2 focus:ring-blue-500\"\r\n ></textarea>\r\n\r\n <!-- Error -->\r\n <small\r\n *ngIf=\"\r\n confirmationForm.get('remarks')?.touched &&\r\n confirmationForm.get('remarks')?.errors?.['required']\r\n \"\r\n class=\"text-red-500 mt-1\"\r\n >\r\n {{ setting('additional-field-error-msg') }}\r\n </small>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </form>\r\n</fx-component>\r\n", styles: [".custom-gap{gap:1rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: FxComponent, selector: "fx-component", inputs: ["fxData"] }, { kind: "ngmodule", type: CalendarModule }, { kind: "ngmodule", type: RadioButtonModule }] });
|