fx-form-builder-wrapper 0.0.53 → 0.0.55
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/esm2022/fx-form-builder-wrapper.mjs +5 -0
- package/esm2022/lib/components/dynamic-table/dynamic-table.component.mjs +235 -0
- package/esm2022/lib/components/fx-form-component/fx-form-component.component.mjs +103 -0
- package/esm2022/lib/components/toggle/toggle.component.mjs +33 -0
- package/esm2022/lib/components/toggle-button/toggle-button.component.mjs +38 -0
- package/esm2022/lib/components/uploader/uploader.component.mjs +58 -0
- package/esm2022/lib/custom-controls/dispatch-to-clinic/dispatch-to-clinic.component.mjs +42 -0
- package/esm2022/lib/fx-builder-wrapper.component.mjs +79 -0
- package/esm2022/lib/fx-builder-wrapper.service.mjs +44 -0
- package/esm2022/lib/panel/configuration-panel/configuration-panel.component.mjs +117 -0
- package/esm2022/lib/panel/settings-panel/settings-panel.component.mjs +24 -0
- package/esm2022/public-api.mjs +7 -0
- package/fesm2022/fx-form-builder-wrapper.mjs +718 -0
- package/fesm2022/fx-form-builder-wrapper.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/dynamic-table/dynamic-table.component.d.ts +52 -0
- package/lib/components/fx-form-component/fx-form-component.component.d.ts +19 -0
- package/lib/components/toggle/toggle.component.d.ts +13 -0
- package/lib/components/toggle-button/toggle-button.component.d.ts +15 -0
- package/lib/components/uploader/uploader.component.d.ts +16 -0
- package/lib/custom-controls/dispatch-to-clinic/dispatch-to-clinic.component.d.ts +17 -0
- package/lib/fx-builder-wrapper.component.d.ts +19 -0
- package/lib/fx-builder-wrapper.service.d.ts +14 -0
- package/lib/panel/configuration-panel/configuration-panel.component.d.ts +27 -0
- package/lib/panel/settings-panel/settings-panel.component.d.ts +10 -0
- package/package.json +29 -16
- package/public-api.d.ts +3 -0
- package/ng-package.json +0 -9
- package/src/lib/components/button/button.component.css +0 -0
- package/src/lib/components/button/button.component.html +0 -1
- package/src/lib/components/button/button.component.ts +0 -24
- package/src/lib/components/dynamic-table/dynamic-table.component.css +0 -31
- package/src/lib/components/dynamic-table/dynamic-table.component.html +0 -69
- package/src/lib/components/dynamic-table/dynamic-table.component.ts +0 -258
- package/src/lib/components/fx-form-component/fx-form-component.component.ts +0 -86
- package/src/lib/components/toggle/toggle.component.css +0 -51
- package/src/lib/components/toggle/toggle.component.html +0 -12
- package/src/lib/components/toggle/toggle.component.ts +0 -33
- package/src/lib/components/toggle-button/toggle-button.component.css +0 -22
- package/src/lib/components/toggle-button/toggle-button.component.html +0 -10
- package/src/lib/components/toggle-button/toggle-button.component.ts +0 -40
- package/src/lib/components/uploader/uploader.component.css +0 -49
- package/src/lib/components/uploader/uploader.component.html +0 -23
- package/src/lib/components/uploader/uploader.component.ts +0 -59
- package/src/lib/custom-controls/dispatch-to-clinic/dispatch-to-clinic.component.html +0 -78
- package/src/lib/custom-controls/dispatch-to-clinic/dispatch-to-clinic.component.ts +0 -44
- package/src/lib/form-builder.css +0 -9
- package/src/lib/fx-builder-wrapper.component.ts +0 -68
- package/src/lib/fx-builder-wrapper.service.ts +0 -38
- package/src/lib/panel/configuration-panel/configuration-panel.component.css +0 -154
- package/src/lib/panel/configuration-panel/configuration-panel.component.html +0 -162
- package/src/lib/panel/configuration-panel/configuration-panel.component.ts +0 -120
- package/src/lib/panel/settings-panel/settings-panel.component.css +0 -30
- package/src/lib/panel/settings-panel/settings-panel.component.html +0 -28
- package/src/lib/panel/settings-panel/settings-panel.component.ts +0 -23
- package/src/public-api.ts +0 -8
- package/tsconfig.lib.json +0 -15
- package/tsconfig.lib.prod.json +0 -13
- package/tsconfig.spec.json +0 -15
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { ChangeDetectorRef, Component } from '@angular/core';
|
|
3
|
-
import { FormsModule, ReactiveFormsModule, UntypedFormControl } from '@angular/forms';
|
|
4
|
-
import { FxBaseComponent, FxComponent, FxSelectSetting, FxSetting, FxStringSetting, FxValidation, FxValidatorService } from '@instantsys-labs/fx';
|
|
5
|
-
import { v4 as uuidv4} from 'uuid';
|
|
6
|
-
|
|
7
|
-
@Component({
|
|
8
|
-
selector: 'fx-uploader',
|
|
9
|
-
standalone: true,
|
|
10
|
-
imports: [CommonModule, FxComponent, FormsModule, ReactiveFormsModule],
|
|
11
|
-
templateUrl: './uploader.component.html',
|
|
12
|
-
styleUrl: './uploader.component.css'
|
|
13
|
-
})
|
|
14
|
-
export class UploaderComponent extends FxBaseComponent {
|
|
15
|
-
public uploadFileControl = new UntypedFormControl();
|
|
16
|
-
public uploadedFiles: Array<any> = [];
|
|
17
|
-
|
|
18
|
-
constructor(private cdr: ChangeDetectorRef) {
|
|
19
|
-
super(cdr)
|
|
20
|
-
this.onInit.subscribe((fxData)=>{
|
|
21
|
-
this._register(this.uploadFileControl);
|
|
22
|
-
})
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
public onFileSelected(event: Event) {
|
|
26
|
-
const input = event.target as HTMLInputElement;
|
|
27
|
-
if (input.files) {
|
|
28
|
-
for(let i = 0; i < input?.files?.length; i++) {
|
|
29
|
-
const file = input.files[i];
|
|
30
|
-
const reader = new FileReader();
|
|
31
|
-
reader.onload = e => {
|
|
32
|
-
this.uploadedFiles.push({
|
|
33
|
-
file: file,
|
|
34
|
-
previewUrl: e.target?.result,
|
|
35
|
-
name: file?.name,
|
|
36
|
-
id: uuidv4()
|
|
37
|
-
})
|
|
38
|
-
this.uploadFileControl.setValue(this.uploadedFiles)
|
|
39
|
-
}
|
|
40
|
-
reader.readAsDataURL(file);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
public deleteFile(id: string): void {
|
|
46
|
-
this.uploadedFiles = this.uploadedFiles.filter(file => file?.id !== id);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
protected settings(): FxSetting[] {
|
|
50
|
-
return [
|
|
51
|
-
new FxStringSetting({ key: 'upload-text', $title: 'Upload Text', value: 'Upload File'}),
|
|
52
|
-
new FxSelectSetting({key: 'multiple-upload', $title: 'Multiple Upload', value: false}, [{option: 'Enable', value: true}, {option: 'Disable', value: false}])
|
|
53
|
-
];
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
protected validations(): FxValidation[] {
|
|
57
|
-
return [FxValidatorService.required];
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
<fx-component [fxData]="fxData">
|
|
2
|
-
<section
|
|
3
|
-
class="justify-content-around lg:justify-content-between w-full white-color border-1 border-solid stroke_light_grey p-3 mb-3 mt-3">
|
|
4
|
-
<form [formGroup]="dispatchForm">
|
|
5
|
-
<div class="grid">
|
|
6
|
-
<!-- Courier Name -->
|
|
7
|
-
<div class="col-12 sm:col-6 md:col-3 input-container">
|
|
8
|
-
<label for="courierName" class="input-title">Courier Name</label>
|
|
9
|
-
<input autocomplete="off" formControlName="courierName" type="text" id="courierName"
|
|
10
|
-
name="courierName" class="p-inputtext p-component p-element input-field border-1 w-full"
|
|
11
|
-
placeholder="enter courier name" />
|
|
12
|
-
|
|
13
|
-
<!-- validation -->
|
|
14
|
-
<small *ngIf="dispatchForm.get('courierName')?.invalid && dispatchForm.get('courierName')?.touched"
|
|
15
|
-
class="text-danger-color block mt-1">
|
|
16
|
-
Courier Name is required.
|
|
17
|
-
</small>
|
|
18
|
-
<!-- validation -->
|
|
19
|
-
</div>
|
|
20
|
-
<!-- Courier Name -->
|
|
21
|
-
|
|
22
|
-
<!-- Tracking Number -->
|
|
23
|
-
<div class="col-12 sm:col-6 md:col-3 input-container">
|
|
24
|
-
<label for="trackingNumber" class="input-title">Tracking Number</label>
|
|
25
|
-
<input autocomplete="off" formControlName="trackingNumber" type="text" id="trackingNumber"
|
|
26
|
-
name="trackingNumber" class="p-inputtext p-component p-element input-field border-1 w-full"
|
|
27
|
-
placeholder="enter tracking number" />
|
|
28
|
-
<small
|
|
29
|
-
*ngIf="dispatchForm.get('trackingNumber')?.invalid && dispatchForm.get('trackingNumber')?.touched"
|
|
30
|
-
class="text-danger-color block mt-1">
|
|
31
|
-
Tracking Number is required.
|
|
32
|
-
</small>
|
|
33
|
-
</div>
|
|
34
|
-
<!-- Tracking Number -->
|
|
35
|
-
|
|
36
|
-
<!-- Tracking URL -->
|
|
37
|
-
<div class="col-12 sm:col-6 md:col-3 input-container">
|
|
38
|
-
<label for="trackingUrl" class="input-title">Tracking URL</label>
|
|
39
|
-
<input autocomplete="off" formControlName="trackingUrl" type="text" id="trackingUrl"
|
|
40
|
-
name="trackingUrl" class="p-inputtext p-component p-element input-field border-1 w-full"
|
|
41
|
-
placeholder="enter tracking url" />
|
|
42
|
-
<small *ngIf="dispatchForm.get('trackingUrl')?.invalid && dispatchForm.get('trackingUrl')?.touched"
|
|
43
|
-
class="text-danger-color block mt-1">
|
|
44
|
-
<span *ngIf="dispatchForm.get('trackingUrl')?.errors?.['required']">Tracking URL is
|
|
45
|
-
required.</span>
|
|
46
|
-
<span *ngIf="dispatchForm.get('trackingUrl')?.errors?.['pattern']">Invalid URL format.</span>
|
|
47
|
-
</small>
|
|
48
|
-
</div>
|
|
49
|
-
<!-- Tracking URL -->
|
|
50
|
-
|
|
51
|
-
<!-- Notes -->
|
|
52
|
-
<div class="col-12 md:col-6 input-container">
|
|
53
|
-
<label for="notes" class="input-title">Notes</label>
|
|
54
|
-
<textarea autocomplete="off" formControlName="notes" rows="5" id="notes" name="notes"
|
|
55
|
-
class="p-inputtext p-component p-element input-field border-1 w-full"
|
|
56
|
-
placeholder="enter notes"></textarea>
|
|
57
|
-
<small *ngIf="dispatchForm.get('notes')?.invalid && dispatchForm.get('notes')?.touched"
|
|
58
|
-
class="text-danger-color block mt-1">
|
|
59
|
-
Notes are required.
|
|
60
|
-
</small>
|
|
61
|
-
</div>
|
|
62
|
-
<!-- Notes -->
|
|
63
|
-
|
|
64
|
-
<!-- Address with Copy Icon -->
|
|
65
|
-
<div class="col-12 md:col-6 pt-0">
|
|
66
|
-
<div class="mb-1">Address</div>
|
|
67
|
-
<ng-container *ngIf="(clinicAddress$ | async) as address">
|
|
68
|
-
<address #completeAddress>{{address?.street}}, {{address?.state}}, {{address?.postalCode}}
|
|
69
|
-
<i class="pi pi-copy cursor-pointer text-xl text-secondary-color"
|
|
70
|
-
(click)="copyToClipboard(completeAddress.textContent)"></i>
|
|
71
|
-
</address>
|
|
72
|
-
</ng-container>
|
|
73
|
-
</div>
|
|
74
|
-
<!-- Address with Copy Icon -->
|
|
75
|
-
</div>
|
|
76
|
-
</form>
|
|
77
|
-
</section>
|
|
78
|
-
</fx-component>
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { ChangeDetectorRef, Component, inject } from '@angular/core';
|
|
3
|
-
import { FormGroup, ReactiveFormsModule, Validators, FormBuilder, FormsModule } from '@angular/forms';
|
|
4
|
-
import { FxBaseComponent, FxComponent, FxSetting, FxStringSetting, FxValidation, FxValidatorService } from '@instantsys-labs/fx';
|
|
5
|
-
import { BehaviorSubject, take } from 'rxjs';
|
|
6
|
-
|
|
7
|
-
@Component({
|
|
8
|
-
selector: 'lib-dispatch-to-clinic',
|
|
9
|
-
standalone: true,
|
|
10
|
-
imports: [CommonModule, ReactiveFormsModule, FormsModule, FxComponent],
|
|
11
|
-
templateUrl: './dispatch-to-clinic.component.html'
|
|
12
|
-
})
|
|
13
|
-
export class DispatchToClinicComponent extends FxBaseComponent {
|
|
14
|
-
private fb = inject(FormBuilder);
|
|
15
|
-
|
|
16
|
-
public clinicAddress$: BehaviorSubject<any> = new BehaviorSubject<any>({});
|
|
17
|
-
|
|
18
|
-
public dispatchForm: FormGroup = this.fb.group({
|
|
19
|
-
courierName: ['', Validators.required],
|
|
20
|
-
trackingNumber: ['', Validators.required],
|
|
21
|
-
trackingUrl: ['', [Validators.required, Validators.pattern('https?://.+')]],
|
|
22
|
-
notes: ['', Validators.required]
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
constructor(private cdr: ChangeDetectorRef) {
|
|
26
|
-
super(cdr);
|
|
27
|
-
|
|
28
|
-
this.onInit.subscribe(() => {
|
|
29
|
-
this._register(this.dispatchForm);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
protected settings(): FxSetting[] {
|
|
34
|
-
return [new FxStringSetting({ key: 'heading-text', $title: 'Heading Text', value: 'My Default Value' })];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
protected validations(): FxValidation[] {
|
|
38
|
-
return [FxValidatorService.required];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
public copyToClipboard(address: any): void {
|
|
42
|
-
navigator.clipboard.writeText(address);
|
|
43
|
-
}
|
|
44
|
-
}
|
package/src/lib/form-builder.css
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/* @import "../../../../node_modules/@instantsys-labs/fx/css/styles.css";
|
|
3
|
-
@import "../../../../node_modules/@instantsys-labs/icons/fonts/css/all.css"; */
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/* @import "../../node_modules/@instantsys-labs/fx/css/styles.css";
|
|
7
|
-
@import "../../node_modules/@instantsys-labs/icons/fonts/css/all.css"; */
|
|
8
|
-
|
|
9
|
-
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { Component, Input, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
|
|
3
|
-
import { FxBuilderConfiguration, FxComponentBuilder, FxForm, FxMode, FxScope, FxUtils } from '@instantsys-labs/fx';
|
|
4
|
-
import { DispatchToClinicComponent } from './custom-controls/dispatch-to-clinic/dispatch-to-clinic.component';
|
|
5
|
-
import { FxBuilderWrapperService } from './fx-builder-wrapper.service';
|
|
6
|
-
import { DynamicTableComponent } from './components/dynamic-table/dynamic-table.component';
|
|
7
|
-
import { ToggleButtonComponent } from './components/toggle-button/toggle-button.component';
|
|
8
|
-
import { UploaderComponent } from './components/uploader/uploader.component';
|
|
9
|
-
import { ToggleComponent } from './components/toggle/toggle.component';
|
|
10
|
-
|
|
11
|
-
@Component({
|
|
12
|
-
selector: 'fx-builder-wrapper',
|
|
13
|
-
standalone: true,
|
|
14
|
-
imports: [CommonModule, FxComponentBuilder],
|
|
15
|
-
template: `
|
|
16
|
-
<fx-component-builder
|
|
17
|
-
#componentBuilder
|
|
18
|
-
[fx-form]="fxForm"
|
|
19
|
-
[configuration]="fxConfiguration"
|
|
20
|
-
[scope]="FxScope.BUILDER"
|
|
21
|
-
>
|
|
22
|
-
</fx-component-builder>
|
|
23
|
-
`,
|
|
24
|
-
styleUrl: './form-builder.css',
|
|
25
|
-
})
|
|
26
|
-
export class FxBuilderWrapperComponent implements OnInit {
|
|
27
|
-
@ViewChild('componentBuilder') componentBuilder!: FxComponentBuilder;
|
|
28
|
-
@Input({ alias: 'fx-form', required: true }) fxForm: FxForm = FxUtils.createNewForm();
|
|
29
|
-
public fxMode: FxMode = FxMode.EDIT;
|
|
30
|
-
public fxConfiguration: FxBuilderConfiguration = {
|
|
31
|
-
settings: true,
|
|
32
|
-
logics: true,
|
|
33
|
-
customControls: true,
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
protected readonly FxScope = FxScope;
|
|
37
|
-
protected readonly FxMode = FxMode;
|
|
38
|
-
|
|
39
|
-
constructor(private fxWrapperService: FxBuilderWrapperService) { }
|
|
40
|
-
|
|
41
|
-
public ngOnInit(): void {
|
|
42
|
-
if (!Boolean(this.fxWrapperService.getComponent('dispatch-to-clinic'))) {
|
|
43
|
-
this.fxWrapperService.registerCustomComponent('Dispatch To Clinic', 'dispatch-to-clinic', DispatchToClinicComponent);
|
|
44
|
-
}
|
|
45
|
-
if (!Boolean(this.fxWrapperService.getComponent('dynamic-table'))) {
|
|
46
|
-
this.fxWrapperService.registerCustomComponent('Dynamic Table', 'dynamic-table', DynamicTableComponent);
|
|
47
|
-
}
|
|
48
|
-
if (!Boolean(this.fxWrapperService.getComponent('toggle-button'))) {
|
|
49
|
-
this.fxWrapperService.registerCustomComponent('Toggle Button', 'toggle-button', ToggleButtonComponent);
|
|
50
|
-
}
|
|
51
|
-
if (!Boolean(this.fxWrapperService.getComponent('uploader'))) {
|
|
52
|
-
this.fxWrapperService.registerCustomComponent('Uploader', 'uploader', UploaderComponent);
|
|
53
|
-
}
|
|
54
|
-
if (!Boolean(this.fxWrapperService.getComponent('toggle'))) {
|
|
55
|
-
this.fxWrapperService.registerCustomComponent('Toggle', 'toggle', ToggleComponent);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
public getParsedForm(): FxForm {
|
|
60
|
-
return this.componentBuilder.getParsedForm();
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
public getInitializedFxForm(): FxForm {
|
|
64
|
-
return FxUtils.createNewForm();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Injectable, Type } from '@angular/core';
|
|
2
|
-
import { FxBaseComponent, FxComponentRegistryService, FxForm, FxUtils } from '@instantsys-labs/fx';
|
|
3
|
-
import { BehaviorSubject, Subject } from 'rxjs';
|
|
4
|
-
|
|
5
|
-
@Injectable({
|
|
6
|
-
providedIn: 'root'
|
|
7
|
-
})
|
|
8
|
-
export class FxBuilderWrapperService {
|
|
9
|
-
public variables$ = new BehaviorSubject<any | null>(null);
|
|
10
|
-
constructor(private fxComponentRegistry: FxComponentRegistryService) { }
|
|
11
|
-
|
|
12
|
-
public registerCustomComponent(title: string, selector: string, component: Type<FxBaseComponent>
|
|
13
|
-
): void {
|
|
14
|
-
this.fxComponentRegistry.registerComponent(selector, component, {
|
|
15
|
-
registeringAs: "CUSTOM",
|
|
16
|
-
libraryItem: {
|
|
17
|
-
title,
|
|
18
|
-
icon: 'fa-eye',
|
|
19
|
-
fxData: {
|
|
20
|
-
id: null,
|
|
21
|
-
name: selector,
|
|
22
|
-
value: "",
|
|
23
|
-
selector: selector,
|
|
24
|
-
elements: [],
|
|
25
|
-
events: []
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
})
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
public getComponent(selector: string): Type<FxBaseComponent> | undefined {
|
|
32
|
-
return this.fxComponentRegistry.getComponent(selector);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public getInitializedFxForm(): FxForm {
|
|
36
|
-
return FxUtils.createNewForm();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
/* .form__input {
|
|
2
|
-
width: clamp(120px, 50vw, 420px);
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 2.5rem;
|
|
5
|
-
padding: 0 1.25rem;
|
|
6
|
-
border: 1px solid black;
|
|
7
|
-
border-radius: 2px;
|
|
8
|
-
margin: 0.625rem auto;
|
|
9
|
-
transition: all 250ms;
|
|
10
|
-
} */
|
|
11
|
-
@import "../../../../../../node_modules/primeng//resources/primeng.min.css";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/* :host ::ng-deep .p-dialog {
|
|
15
|
-
.p-dialog-content {
|
|
16
|
-
padding: 1.5rem;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.p-dialog-header {
|
|
20
|
-
background: white;
|
|
21
|
-
padding: 1rem;
|
|
22
|
-
font-size: 1.25rem;
|
|
23
|
-
font-weight: bold;
|
|
24
|
-
}
|
|
25
|
-
} */
|
|
26
|
-
|
|
27
|
-
.customDialogClass .p-dialog {
|
|
28
|
-
height: auto;
|
|
29
|
-
}
|
|
30
|
-
.customDialogClass .p-dialog-header {
|
|
31
|
-
padding: 0.8rem 0.55rem !important;
|
|
32
|
-
background-color: white !important;
|
|
33
|
-
}
|
|
34
|
-
.customDialogClass .p-dialog-header-close-icon {
|
|
35
|
-
color: black !important;
|
|
36
|
-
}
|
|
37
|
-
.customDialogClass .p-dialog-content {
|
|
38
|
-
border-top-left-radius: 0%;
|
|
39
|
-
padding: 0px;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
.p-dialog .p-dialog-header {
|
|
44
|
-
background-color: white !important;
|
|
45
|
-
border-bottom: 2px solid #e5e7eb;
|
|
46
|
-
padding: 12px 16px;
|
|
47
|
-
font-weight: bold;
|
|
48
|
-
font-size: 1rem;
|
|
49
|
-
display: flex;
|
|
50
|
-
align-items: center;
|
|
51
|
-
justify-content: space-between;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
.p-dialog-mask {
|
|
56
|
-
background: rgba(0, 0, 0, 0.5) !important;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.p-dialog .p-dialog-content {
|
|
60
|
-
background-color: white;
|
|
61
|
-
padding: 16px;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.p-dialog .p-dialog-footer {
|
|
65
|
-
background-color: #f3f4f6;
|
|
66
|
-
padding: 12px 16px;
|
|
67
|
-
border-top: 2px solid #e5e7eb;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.p-dialog .p-dialog-content::-webkit-scrollbar {
|
|
71
|
-
width: 8px;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.p-dialog .p-dialog-content::-webkit-scrollbar-track {
|
|
75
|
-
background-color: #f1f1f1;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.p-dialog .p-dialog-content::-webkit-scrollbar-thumb {
|
|
79
|
-
background-color: #FAA762;
|
|
80
|
-
border-radius: 10px;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.p-dialog .p-dialog-content::-webkit-scrollbar-thumb:hover {
|
|
84
|
-
background-color: #FAA762;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.custom-save-button {
|
|
88
|
-
background-color: #FAA762 !important;
|
|
89
|
-
color: white !important;
|
|
90
|
-
border: 1px solid #FAA762 !important;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.custom-save-button:hover {
|
|
94
|
-
background-color: #e59550 !important;
|
|
95
|
-
border-color: #e59550 !important;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
.form__input {
|
|
100
|
-
width: 100%;
|
|
101
|
-
padding: 8px;
|
|
102
|
-
border: 1px solid #ccc;
|
|
103
|
-
border-radius: 5px;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
label {
|
|
107
|
-
font-size: 14px;
|
|
108
|
-
font-weight: 600;
|
|
109
|
-
margin-bottom: 5px;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
.button-group {
|
|
114
|
-
display: flex;
|
|
115
|
-
justify-content: flex-end;
|
|
116
|
-
gap: 10px;
|
|
117
|
-
padding-top: 1rem;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
button {
|
|
121
|
-
padding: 8px 12px;
|
|
122
|
-
border: none;
|
|
123
|
-
border-radius: 5px;
|
|
124
|
-
cursor: pointer;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.cancel {
|
|
128
|
-
background: #ccc;
|
|
129
|
-
color: black;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.save {
|
|
133
|
-
background: #007bff;
|
|
134
|
-
color: white;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
button:hover {
|
|
138
|
-
opacity: 0.8;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
.card-width{
|
|
143
|
-
width:295px !important;
|
|
144
|
-
flex-shrink: 0;
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.justify-end{
|
|
149
|
-
justify-content: end;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
<p-dialog header="Edit Configurations" [modal]="true" [draggable]="false" [(visible)]="visible" [style]="{width: '70rem'}" class="customDialogClass">
|
|
2
|
-
<!-- <ng-template pTemplate="header">
|
|
3
|
-
<div class="flex p-2 bg-white border-2">
|
|
4
|
-
<p class="text-base">Edit Configurations</p>
|
|
5
|
-
</div>
|
|
6
|
-
</ng-template> -->
|
|
7
|
-
<div class="flex flex-col gap-4 bg-white p-2 border-2 border-gray-200">
|
|
8
|
-
<div class="flex items-center gap-4 mb-8 w-full">
|
|
9
|
-
<div class="w-1/3">
|
|
10
|
-
<label for="rows" class="font-semibold w-24">Rows</label>
|
|
11
|
-
<input type="text" [disabled]="enableAPI" [(ngModel)]="rows" placeholder="rows" class="form__input" id="name" autocomplete="rows" />
|
|
12
|
-
</div>
|
|
13
|
-
<div class="w-1/3">
|
|
14
|
-
<label for="enableAPI" class="font-semibold w-24">Enable API</label>
|
|
15
|
-
<input type="checkbox" [(ngModel)]="enableAPI" placeholder="API Url" id="enableAPI" autocomplete="enableAPI" />
|
|
16
|
-
</div>
|
|
17
|
-
<div class="w-1/3">
|
|
18
|
-
@if (enableAPI) {
|
|
19
|
-
<ng-container>
|
|
20
|
-
<label for="api" class="font-semibold w-24">API</label>
|
|
21
|
-
<input type="text" [(ngModel)]="api" placeholder="Enter API Url" id="api" class="form__input" autocomplete="api" />
|
|
22
|
-
</ng-container>
|
|
23
|
-
}
|
|
24
|
-
</div>
|
|
25
|
-
|
|
26
|
-
</div>
|
|
27
|
-
<!-- <div class="flex items-center gap-4 mb-8">
|
|
28
|
-
<div class="w-1/2">
|
|
29
|
-
|
|
30
|
-
</div>
|
|
31
|
-
<div class="w-1/2">
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</div>
|
|
38
|
-
|
|
39
|
-
<div class="flex items-center gap-4 mb-8">
|
|
40
|
-
<div class="w-1/2">
|
|
41
|
-
|
|
42
|
-
</div>
|
|
43
|
-
<div class="w-1/2">
|
|
44
|
-
|
|
45
|
-
</div>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</div> -->
|
|
49
|
-
|
|
50
|
-
<div class="flex flex-wrap gap-4 mb-8">
|
|
51
|
-
|
|
52
|
-
<div class="w-full flex items-center justify-between">
|
|
53
|
-
<p class="text-sm font-semibold">Columns:</p>
|
|
54
|
-
<!-- <button type="button" (click)="addColumn()" class="custom-save-button">Add Column</button> -->
|
|
55
|
-
</div>
|
|
56
|
-
|
|
57
|
-
<div class="w-full overflow-x-auto">
|
|
58
|
-
<form [formGroup]="dynamicForm" (ngSubmit)="onSubmit()">
|
|
59
|
-
<!-- Flex container with nowrap to keep all columns in a single row -->
|
|
60
|
-
<div formArrayName="columns" class="flex gap-4 flex-nowrap whitespace-nowrap">
|
|
61
|
-
<div *ngFor="let column of columns.controls; let i = index" [formGroupName]="i"
|
|
62
|
-
class="border p-4 rounded-lg min-w-[20rem] flex-shrink-0 card-width">
|
|
63
|
-
<div class="top-2 right-2 flex gap-2 justify-end">
|
|
64
|
-
<button type="button" (click)="duplicateColumn(i)"
|
|
65
|
-
class="bg-green-500 text-white px-3 py-1 rounded-md hover:bg-green-600">
|
|
66
|
-
➕
|
|
67
|
-
</button>
|
|
68
|
-
<button type="button" (click)="removeColumn(i)"
|
|
69
|
-
class="text-white px-3 py-1 rounded-md hover:bg-red-600" *ngIf="columns.length>1">
|
|
70
|
-
❌
|
|
71
|
-
</button>
|
|
72
|
-
</div>
|
|
73
|
-
<!-- Columns in a Single Row -->
|
|
74
|
-
<div class="grid grid-cols-1 gap-4 items-center mb-2">
|
|
75
|
-
<div class="col-span-3">
|
|
76
|
-
<label class="font-semibold">Column Name:</label>
|
|
77
|
-
<input formControlName="header" placeholder="Enter Column Name"
|
|
78
|
-
class="w-full border rounded-md px-3 py-2 focus:ring focus:ring-blue-200" />
|
|
79
|
-
</div>
|
|
80
|
-
<div class="col-span-3">
|
|
81
|
-
<label class="font-semibold">Column Type:</label>
|
|
82
|
-
<select formControlName="cellType" class="w-full border rounded-md px-3 py-2">
|
|
83
|
-
<option *ngFor="let type of columnTypes" [value]="type">{{ type }}</option>
|
|
84
|
-
</select>
|
|
85
|
-
</div>
|
|
86
|
-
@if (enableAPI) {
|
|
87
|
-
<div class="col-span-3">
|
|
88
|
-
<label class="font-semibold">API Value Key:</label>
|
|
89
|
-
<input formControlName="apiKey" placeholder="Enter Value Key"
|
|
90
|
-
class="w-full border rounded-md px-3 py-2 focus:ring focus:ring-blue-200" />
|
|
91
|
-
</div>
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
</div>
|
|
95
|
-
<div *ngIf="['radio-group', 'dropdown'].includes(column.value.cellType)" class="mt-2">
|
|
96
|
-
|
|
97
|
-
<label class="font-semibold">Options:</label>
|
|
98
|
-
|
|
99
|
-
<div formArrayName="options">
|
|
100
|
-
<div *ngFor="let option of getOptions(i).controls; let j = index" [formGroupName]="j"
|
|
101
|
-
class="grid grid-cols-1 gap-4 items-center mt-2">
|
|
102
|
-
<input formControlName="optionName" placeholder="Enter Option Name"
|
|
103
|
-
class="col-span-4 border rounded-md px-3 py-2 focus:ring focus:ring-blue-200" />
|
|
104
|
-
<input formControlName="optionValue" placeholder="Enter Option Value"
|
|
105
|
-
class="col-span-4 border rounded-md px-3 py-2 focus:ring focus:ring-blue-200" />
|
|
106
|
-
<button type="button" (click)="getOptions(i).removeAt(j)"
|
|
107
|
-
class="col-span-2 bg-red-500 text-white px-2 py-1 rounded-md hover:bg-red-600">
|
|
108
|
-
Remove
|
|
109
|
-
</button>
|
|
110
|
-
</div>
|
|
111
|
-
</div>
|
|
112
|
-
<button type="button" (click)="addOption(i)" class="custom-save-button justify-end">Add Option</button>
|
|
113
|
-
</div>
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
<div *ngIf="['smart-dropdown'].includes(column.value.cellType)" class="grid grid-cols-1 gap-4 mt-4">
|
|
117
|
-
<div class="col-span-4">
|
|
118
|
-
<label class="font-semibold">API Url:</label>
|
|
119
|
-
<input formControlName="apiUrl" placeholder="Enter API URL"
|
|
120
|
-
class="w-full border rounded-md px-3 py-2 focus:ring focus:ring-blue-200" />
|
|
121
|
-
</div>
|
|
122
|
-
<div class="col-span-4">
|
|
123
|
-
<label class="font-semibold">Value Key:</label>
|
|
124
|
-
<input formControlName="valueKey" placeholder="Enter Value Key"
|
|
125
|
-
class="w-full border rounded-md px-3 py-2 focus:ring focus:ring-blue-200" />
|
|
126
|
-
</div>
|
|
127
|
-
<div class="col-span-4">
|
|
128
|
-
<label class="font-semibold">Label Key:</label>
|
|
129
|
-
<input formControlName="labelKey" placeholder="Enter Label Key"
|
|
130
|
-
class="w-full border rounded-md px-3 py-2 focus:ring focus:ring-blue-200" />
|
|
131
|
-
</div>
|
|
132
|
-
</div>
|
|
133
|
-
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
136
|
-
</form>
|
|
137
|
-
</div>
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
</div>
|
|
143
|
-
|
|
144
|
-
</div>
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
<ng-template pTemplate="footer">
|
|
149
|
-
<!-- <hr class="mt-3 mx-2 mb-0 opacity-10"> -->
|
|
150
|
-
<!-- <div class="flex justify-end gap-4 w-full">
|
|
151
|
-
<p-button label="Cancel" severity="secondary" (click)="closeDialog()" />
|
|
152
|
-
<p-button styleClass="border border-indigo-600" label="Save" (click)="saveConfiguration()" />
|
|
153
|
-
</div> -->
|
|
154
|
-
<div class="flex justify-center my-3">
|
|
155
|
-
<p-button label="Cancel" severity="secondary" (click)="closeDialog()"
|
|
156
|
-
styleClass="border-gray-400" />
|
|
157
|
-
<p-button label="Attach" label="Save" (click)="saveConfiguration()"
|
|
158
|
-
styleClass="cta_buttons text-medium button_text_white secondary-color border-1 stroke_secondary no_hightlight no_hightlight_stroke h-max mr-2 w-6rem custom-save-button"
|
|
159
|
-
/>
|
|
160
|
-
</div>
|
|
161
|
-
</ng-template>
|
|
162
|
-
</p-dialog>
|