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,120 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';
|
|
3
|
-
import { ButtonModule } from 'primeng/button';
|
|
4
|
-
import { DialogModule } from 'primeng/dialog';
|
|
5
|
-
import { InputTextModule } from 'primeng/inputtext';
|
|
6
|
-
import { DropdownModule } from 'primeng/dropdown';
|
|
7
|
-
import { FormArray, FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
8
|
-
|
|
9
|
-
@Component({
|
|
10
|
-
selector: 'fx-configuration-panel',
|
|
11
|
-
standalone: true,
|
|
12
|
-
imports: [CommonModule, ReactiveFormsModule, ButtonModule, DialogModule, InputTextModule, FormsModule, DropdownModule, ButtonModule],
|
|
13
|
-
templateUrl: './configuration-panel.component.html',
|
|
14
|
-
styleUrl: './configuration-panel.component.css',
|
|
15
|
-
})
|
|
16
|
-
export class ConfigurationPanelComponent implements OnInit{
|
|
17
|
-
@Input() visible: boolean = false;
|
|
18
|
-
@Output() isVisible = new EventEmitter<boolean>();
|
|
19
|
-
@Output() configuration = new EventEmitter<any>();
|
|
20
|
-
|
|
21
|
-
public rows: number = 1;
|
|
22
|
-
public enableAPI: boolean = false;
|
|
23
|
-
public api: string = '';
|
|
24
|
-
|
|
25
|
-
public dynamicForm: FormGroup;
|
|
26
|
-
public columnTypes: string[] = ['text', 'input-text', 'input-number', 'dropdown', 'smart-dropdown', 'checkbox', 'radio', 'radio-group', 'file-upload', 'textarea'];
|
|
27
|
-
|
|
28
|
-
constructor(private fb: FormBuilder) {
|
|
29
|
-
this.dynamicForm = this.fb.group({
|
|
30
|
-
columns: this.fb.array([])
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
ngOnInit(): void {
|
|
34
|
-
this.addColumn();
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
get columns(): FormArray {
|
|
38
|
-
return this.dynamicForm.get('columns') as FormArray;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// **🔹 Add Column Dynamically**
|
|
42
|
-
public addColumn(): void {
|
|
43
|
-
const columnFormGroup = this.fb.group({
|
|
44
|
-
header: ['', Validators.required],
|
|
45
|
-
cellType: ['', Validators.required],
|
|
46
|
-
placeholder: '',
|
|
47
|
-
options: this.fb.array([]),
|
|
48
|
-
apiUrl: '',
|
|
49
|
-
valueKey: '',
|
|
50
|
-
labelKey: '',
|
|
51
|
-
className: '',
|
|
52
|
-
apiKey: ''
|
|
53
|
-
});
|
|
54
|
-
this.columns.push(columnFormGroup);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
public removeColumn(index: number): void {
|
|
59
|
-
if (this.columns.length > 1) {
|
|
60
|
-
this.columns.removeAt(index);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// **🔹 Duplicate Column**
|
|
65
|
-
public duplicateColumn(index: number): void {
|
|
66
|
-
const currentColumn = this.columns.at(index).value;
|
|
67
|
-
const duplicateColumn = this.fb.group({
|
|
68
|
-
header: [currentColumn.header, Validators.required],
|
|
69
|
-
cellType: [currentColumn.cellType, Validators.required],
|
|
70
|
-
placeholder: [currentColumn.placeholder],
|
|
71
|
-
apiUrl: [currentColumn.apiUrl],
|
|
72
|
-
valueKey: [currentColumn.valueKey],
|
|
73
|
-
labelKey: [currentColumn.labelKey],
|
|
74
|
-
className: [currentColumn.className],
|
|
75
|
-
apiKey: [currentColumn.apiKey],
|
|
76
|
-
options: this.fb.array(
|
|
77
|
-
currentColumn.options.map((option: any) => this.fb.group({
|
|
78
|
-
optionName: [option.optionName, Validators.required],
|
|
79
|
-
optionValue: [option.optionValue, Validators.required]
|
|
80
|
-
}))
|
|
81
|
-
)
|
|
82
|
-
});
|
|
83
|
-
this.columns.insert(index + 1, duplicateColumn);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// **🔹 Add Options Dynamically**
|
|
87
|
-
public addOption(columnIndex: number): void {
|
|
88
|
-
const optionGroup = this.fb.group({
|
|
89
|
-
optionName: ['', Validators.required],
|
|
90
|
-
optionValue: ['', Validators.required]
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
this.getOptions(columnIndex).push(optionGroup);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// **🔹 Get Options FormArray for a Specific Column**
|
|
97
|
-
public getOptions(columnIndex: number): FormArray {
|
|
98
|
-
return this.columns.at(columnIndex).get('options') as FormArray;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// **🔹 Close Dialog**
|
|
102
|
-
public closeDialog(): void {
|
|
103
|
-
this.isVisible.emit(false);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// **🔹 Save Configuration**
|
|
107
|
-
public saveConfiguration(): void {
|
|
108
|
-
this.configuration.emit({
|
|
109
|
-
rows: this.rows,
|
|
110
|
-
columns: this.dynamicForm.value?.columns,
|
|
111
|
-
enableAPI: this.enableAPI,
|
|
112
|
-
api: this.api
|
|
113
|
-
});
|
|
114
|
-
this.isVisible.emit(false);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
public onSubmit(): void {
|
|
118
|
-
console.log("Value columns formArray", this.dynamicForm.value);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
.fx-element {
|
|
2
|
-
position: relative;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.fx-element .fx-overlay {
|
|
6
|
-
position: absolute;
|
|
7
|
-
top: 0;
|
|
8
|
-
left: 0;
|
|
9
|
-
width: 100%;
|
|
10
|
-
height: 100%;
|
|
11
|
-
background: rgba(0, 0, 0, 0.1); /* Light gray with 0.5 transparency */
|
|
12
|
-
z-index: -1; /* Place it below the content by default */
|
|
13
|
-
pointer-events: none; /* Allow interaction with the underlying content */
|
|
14
|
-
opacity: 0; /* Initially hidden */
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.fx-element:hover .fx-overlay {
|
|
18
|
-
z-index: 1; /* Bring the overlay above content */
|
|
19
|
-
opacity: 1; /* Make the overlay visible */
|
|
20
|
-
pointer-events: auto; /* Allow interaction with the overlay */
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.fx-element:hover .fx-overlay .fx-actions{
|
|
24
|
-
position: absolute;
|
|
25
|
-
margin-top: -26px;
|
|
26
|
-
height: 25px;
|
|
27
|
-
border-top-right-radius: 10px;
|
|
28
|
-
width: 100%;
|
|
29
|
-
border-top-left-radius: 10px;
|
|
30
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<fx-configuration-panel [visible]="visible" (isVisible)="visible = $event" (configuration)="configuration.emit($event)"></fx-configuration-panel>
|
|
2
|
-
|
|
3
|
-
<div class="fx-element">
|
|
4
|
-
<ng-content></ng-content>
|
|
5
|
-
<ng-container *ngIf="fxData.$fxForm?.$mode !== FxMode.VIEW">
|
|
6
|
-
<div class="fx-overlay border-gray-400 border rounded cursor-pointer" (click)="onElementSelect(fxData)"
|
|
7
|
-
(dblclick)="openSettingDialog()">
|
|
8
|
-
<div class="fx-actions flex justify-between">
|
|
9
|
-
|
|
10
|
-
<div class="bg-gray-700 text-gray-300 px-2 rounded-t ml-2 text-xs flex justify-center items-center">
|
|
11
|
-
<div>#{{ fxData.name }}-<span class="text-xs italic">{{ fxData.id }}</span></div>
|
|
12
|
-
</div>
|
|
13
|
-
|
|
14
|
-
<div class="flex justify-around items-end mr-2">
|
|
15
|
-
<div class="cursor-pointer bg-secondary text-white w-8 mr-1 text-center rounded-t" title="Settings"
|
|
16
|
-
(click)="fxSettingService.openSetting(fxData)">
|
|
17
|
-
<i class="fa fa-cog text-xs"></i>
|
|
18
|
-
</div>
|
|
19
|
-
<div (click)="deleteElement(fxData)"
|
|
20
|
-
class="cursor-pointer bg-red-600 text-white w-8 mr-1 text-center rounded-t" title="Delete">
|
|
21
|
-
<i class="fa fa-times text-xs"></i>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
<ng-container #dynamicComponentContainer></ng-container>
|
|
27
|
-
</ng-container>
|
|
28
|
-
</div>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { ChangeDetectorRef, Component, EventEmitter, inject, Input, OnInit, Output, ViewChild, ViewContainerRef } from '@angular/core';
|
|
3
|
-
import { FxComponent, FxData, FxMode, FxSettingComponent, FxSettingsService, FxUtils } from '@instantsys-labs/fx';
|
|
4
|
-
import { Dialog } from 'primeng/dialog';
|
|
5
|
-
import { ButtonModule } from 'primeng/button';
|
|
6
|
-
import { InputTextModule } from 'primeng/inputtext';
|
|
7
|
-
import { ConfigurationPanelComponent } from '../configuration-panel/configuration-panel.component';
|
|
8
|
-
|
|
9
|
-
@Component({
|
|
10
|
-
selector: 'fx-settings-panel',
|
|
11
|
-
standalone: true,
|
|
12
|
-
imports: [CommonModule, ButtonModule, InputTextModule, ConfigurationPanelComponent],
|
|
13
|
-
templateUrl: './settings-panel.component.html',
|
|
14
|
-
styleUrl: './settings-panel.component.css'
|
|
15
|
-
})
|
|
16
|
-
export class SettingsPanelComponent extends FxComponent implements OnInit {
|
|
17
|
-
@Output() configuration = new EventEmitter<any>();
|
|
18
|
-
public visible: boolean = false;
|
|
19
|
-
|
|
20
|
-
public openSettingDialog(): void {
|
|
21
|
-
this.visible = true;
|
|
22
|
-
}
|
|
23
|
-
}
|
package/src/public-api.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Public API Surface of fx-builder-wrapper
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export * from './lib/fx-builder-wrapper.service';
|
|
6
|
-
export * from './lib/fx-builder-wrapper.component'; // builder // admin
|
|
7
|
-
export * from './lib/components/fx-form-component/fx-form-component.component'; // form preview
|
|
8
|
-
|
package/tsconfig.lib.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
-
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
-
{
|
|
4
|
-
"extends": "../../tsconfig.json",
|
|
5
|
-
"compilerOptions": {
|
|
6
|
-
"outDir": "../../out-tsc/lib",
|
|
7
|
-
"declaration": true,
|
|
8
|
-
"declarationMap": true,
|
|
9
|
-
"inlineSources": true,
|
|
10
|
-
"types": []
|
|
11
|
-
},
|
|
12
|
-
"exclude": [
|
|
13
|
-
"**/*.spec.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
package/tsconfig.lib.prod.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
-
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
-
{
|
|
4
|
-
"extends": "./tsconfig.lib.json",
|
|
5
|
-
"compilerOptions": {
|
|
6
|
-
"declarationMap": false
|
|
7
|
-
},
|
|
8
|
-
"angularCompilerOptions": {
|
|
9
|
-
"compilationMode": "partial",
|
|
10
|
-
"enableIvy": true,
|
|
11
|
-
"fullTemplateTypeCheck": true
|
|
12
|
-
}
|
|
13
|
-
}
|
package/tsconfig.spec.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
-
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
-
{
|
|
4
|
-
"extends": "../../tsconfig.json",
|
|
5
|
-
"compilerOptions": {
|
|
6
|
-
"outDir": "../../out-tsc/spec",
|
|
7
|
-
"types": [
|
|
8
|
-
"jasmine"
|
|
9
|
-
]
|
|
10
|
-
},
|
|
11
|
-
"include": [
|
|
12
|
-
"**/*.spec.ts",
|
|
13
|
-
"**/*.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|