@ruc-lib/metaform 2.0.1 → 2.0.3
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/package.json +39 -20
- package/.eslintrc.json +0 -36
- package/dist/README.md +0 -135
- package/dist/package.json +0 -38
- package/jest.config.ts +0 -22
- package/ng-package.json +0 -6
- package/project.json +0 -50
- package/src/components/ruc-meta-checkbox-group/ruc-meta-checkbox-group.component.css +0 -10
- package/src/components/ruc-meta-checkbox-group/ruc-meta-checkbox-group.component.html +0 -11
- package/src/components/ruc-meta-checkbox-group/ruc-meta-checkbox-group.component.spec.ts +0 -103
- package/src/components/ruc-meta-checkbox-group/ruc-meta-checkbox-group.component.ts +0 -33
- package/src/components/ruc-meta-inputs/ruc-meta-inputs.component.css +0 -16
- package/src/components/ruc-meta-inputs/ruc-meta-inputs.component.html +0 -18
- package/src/components/ruc-meta-inputs/ruc-meta-inputs.component.spec.ts +0 -85
- package/src/components/ruc-meta-inputs/ruc-meta-inputs.component.ts +0 -44
- package/src/components/ruc-meta-radio-group/ruc-meta-radio-group.component.css +0 -13
- package/src/components/ruc-meta-radio-group/ruc-meta-radio-group.component.html +0 -12
- package/src/components/ruc-meta-radio-group/ruc-meta-radio-group.component.spec.ts +0 -98
- package/src/components/ruc-meta-radio-group/ruc-meta-radio-group.component.ts +0 -28
- package/src/components/ruc-meta-select/ruc-meta-select.component.css +0 -9
- package/src/components/ruc-meta-select/ruc-meta-select.component.html +0 -12
- package/src/components/ruc-meta-select/ruc-meta-select.component.spec.ts +0 -1165
- package/src/components/ruc-meta-select/ruc-meta-select.component.ts +0 -45
- package/src/components/ruc-text-area/ruc-text-area.component.css +0 -0
- package/src/components/ruc-text-area/ruc-text-area.component.html +0 -16
- package/src/components/ruc-text-area/ruc-text-area.component.spec.ts +0 -100
- package/src/components/ruc-text-area/ruc-text-area.component.ts +0 -30
- package/src/index.ts +0 -2
- package/src/interfaces/metaFormsDefault.ts +0 -71
- package/src/lib/ruclib-metaform/ruclib-metaform.component.html +0 -99
- package/src/lib/ruclib-metaform/ruclib-metaform.component.scss +0 -15
- package/src/lib/ruclib-metaform/ruclib-metaform.component.spec.ts +0 -1253
- package/src/lib/ruclib-metaform/ruclib-metaform.component.stories.ts +0 -676
- package/src/lib/ruclib-metaform/ruclib-metaform.component.ts +0 -91
- package/src/lib/ruclib-metaform.module.ts +0 -59
- package/src/services/ruc-meta-form-validation.service.spec.ts +0 -75
- package/src/services/ruc-meta-form-validation.service.ts +0 -30
- package/src/services/ruc-meta-form.service.spec.ts +0 -63
- package/src/services/ruc-meta-form.service.ts +0 -20
- package/src/test-setup.ts +0 -1
- package/tsconfig.json +0 -30
- package/tsconfig.lib.json +0 -17
- package/tsconfig.lib.prod.json +0 -9
- package/tsconfig.spec.json +0 -16
- /package/{dist/components → components}/ruc-meta-checkbox-group/ruc-meta-checkbox-group.component.d.ts +0 -0
- /package/{dist/components → components}/ruc-meta-inputs/ruc-meta-inputs.component.d.ts +0 -0
- /package/{dist/components → components}/ruc-meta-radio-group/ruc-meta-radio-group.component.d.ts +0 -0
- /package/{dist/components → components}/ruc-meta-select/ruc-meta-select.component.d.ts +0 -0
- /package/{dist/components → components}/ruc-text-area/ruc-text-area.component.d.ts +0 -0
- /package/{dist/esm2020 → esm2020}/components/ruc-meta-checkbox-group/ruc-meta-checkbox-group.component.mjs +0 -0
- /package/{dist/esm2020 → esm2020}/components/ruc-meta-inputs/ruc-meta-inputs.component.mjs +0 -0
- /package/{dist/esm2020 → esm2020}/components/ruc-meta-radio-group/ruc-meta-radio-group.component.mjs +0 -0
- /package/{dist/esm2020 → esm2020}/components/ruc-meta-select/ruc-meta-select.component.mjs +0 -0
- /package/{dist/esm2020 → esm2020}/components/ruc-text-area/ruc-text-area.component.mjs +0 -0
- /package/{dist/esm2020 → esm2020}/index.mjs +0 -0
- /package/{dist/esm2020 → esm2020}/interfaces/metaFormsDefault.mjs +0 -0
- /package/{dist/esm2020 → esm2020}/lib/ruclib-metaform/ruclib-metaform.component.mjs +0 -0
- /package/{dist/esm2020 → esm2020}/lib/ruclib-metaform.module.mjs +0 -0
- /package/{dist/esm2020 → esm2020}/ruc-lib-metaform.mjs +0 -0
- /package/{dist/esm2020 → esm2020}/services/ruc-meta-form-validation.service.mjs +0 -0
- /package/{dist/esm2020 → esm2020}/services/ruc-meta-form.service.mjs +0 -0
- /package/{dist/fesm2015 → fesm2015}/ruc-lib-metaform.mjs +0 -0
- /package/{dist/fesm2015 → fesm2015}/ruc-lib-metaform.mjs.map +0 -0
- /package/{dist/fesm2020 → fesm2020}/ruc-lib-metaform.mjs +0 -0
- /package/{dist/fesm2020 → fesm2020}/ruc-lib-metaform.mjs.map +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/interfaces → interfaces}/metaFormsDefault.d.ts +0 -0
- /package/{dist/lib → lib}/ruclib-metaform/ruclib-metaform.component.d.ts +0 -0
- /package/{dist/lib → lib}/ruclib-metaform.module.d.ts +0 -0
- /package/{dist/services → services}/ruc-meta-form-validation.service.d.ts +0 -0
- /package/{dist/services → services}/ruc-meta-form.service.d.ts +0 -0
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Component, Input, OnInit, EventEmitter, Output } from '@angular/core';
|
|
2
|
-
import { RucMetaFormService } from "../../services/ruc-meta-form.service"
|
|
3
|
-
import {RucMetaFormValidationService} from '../../services/ruc-meta-form-validation.service';
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
selector: 'ruc-meta-select',
|
|
7
|
-
templateUrl: './ruc-meta-select.component.html',
|
|
8
|
-
styleUrls: ['./ruc-meta-select.component.css']
|
|
9
|
-
})
|
|
10
|
-
export class RucMetaSelectComponent implements OnInit {
|
|
11
|
-
|
|
12
|
-
@Input() rucInputData : any;
|
|
13
|
-
errorMessage: string | undefined
|
|
14
|
-
@Output() transferUserInput = new EventEmitter<any>();
|
|
15
|
-
constructor(public service: RucMetaFormService,public validationService:RucMetaFormValidationService) { }
|
|
16
|
-
|
|
17
|
-
ngOnInit(): void {
|
|
18
|
-
this.errorMessage = this.validationService.defaultErrorMessage;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
modelChangeFn(e:any) {
|
|
22
|
-
this.rucInputData.groupOptions.forEach((x: any)=>{
|
|
23
|
-
if(x.value == e.value){
|
|
24
|
-
this.rucInputData.selectedParentId = x.id;
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
if(this.rucInputData.dependentFields){
|
|
28
|
-
this.removDependentFieldParentIdFromOther(this.rucInputData.dependentFields);
|
|
29
|
-
}
|
|
30
|
-
this.service.currentFormElement = this.rucInputData;
|
|
31
|
-
this.transferUserInput.emit(this.rucInputData);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
removDependentFieldParentIdFromOther(child: any){
|
|
35
|
-
child.forEach((x:any)=>{
|
|
36
|
-
if(x.selectedParentId){
|
|
37
|
-
delete(x.selectedParentId);
|
|
38
|
-
x.value = "";
|
|
39
|
-
if(x.dependentFields){
|
|
40
|
-
this.removDependentFieldParentIdFromOther(x.dependentFields);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
}
|
|
45
|
-
}
|
|
File without changes
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<mat-form-field [ngStyle]="{ 'width.%': rucInputData?.width }" [appearance]="rucInputData?.appearance || 'fill'" class="{{customTheme}}">
|
|
2
|
-
<mat-label>{{rucInputData?.label}}</mat-label>
|
|
3
|
-
<textarea matInput
|
|
4
|
-
placeholder="{{rucInputData?.placeholder}}"
|
|
5
|
-
cdkTextareaAutosize
|
|
6
|
-
#autosize="cdkTextareaAutosize"
|
|
7
|
-
cdkAutosizeMinRows="{{rucInputData.min}}"
|
|
8
|
-
cdkAutosizeMaxRows="{{rucInputData.max}}"
|
|
9
|
-
[readonly]="rucInputData?.readonly"
|
|
10
|
-
[(ngModel)]="rucInputData.value"
|
|
11
|
-
matTooltip="{{rucInputData?.tooltip}}"
|
|
12
|
-
(ngModelChange)="modelChangeFn($event.target)"></textarea>
|
|
13
|
-
</mat-form-field>
|
|
14
|
-
<div *ngIf="rucInputData?.errorMsg" class="form-error">
|
|
15
|
-
{{rucInputData?.customErrorMessage ? rucInputData?.customErrorMessage : errorMessage}}
|
|
16
|
-
</div>
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { RucTextAreaComponent } from './ruc-text-area.component';
|
|
4
|
-
import {TextFieldModule} from '@angular/cdk/text-field';
|
|
5
|
-
import { MetaFormConfig } from '../../interfaces/metaFormsDefault';
|
|
6
|
-
describe('RucTextAreaComponent', () => {
|
|
7
|
-
let component: RucTextAreaComponent;
|
|
8
|
-
let fixture: ComponentFixture<RucTextAreaComponent>;
|
|
9
|
-
const mockFormData: MetaFormConfig = {
|
|
10
|
-
"formType": "simple",
|
|
11
|
-
"fieldType": "textarea",
|
|
12
|
-
"inputType": "text",
|
|
13
|
-
"id": "firstName",
|
|
14
|
-
"name": "firstName",
|
|
15
|
-
"errorMsg": false,
|
|
16
|
-
"label": "First Name",
|
|
17
|
-
"className": "firstName",
|
|
18
|
-
"value": "",
|
|
19
|
-
"alt": "na",
|
|
20
|
-
"appearance": "outline",
|
|
21
|
-
"min": "4",
|
|
22
|
-
"max": "20",
|
|
23
|
-
"width": "100",
|
|
24
|
-
"height": "20",
|
|
25
|
-
"checked": false,
|
|
26
|
-
"disabled": false,
|
|
27
|
-
"maxlength": "100",
|
|
28
|
-
"readonly": false,
|
|
29
|
-
"required": false,
|
|
30
|
-
"size": "100",
|
|
31
|
-
"step": "100",
|
|
32
|
-
"sameRow": true,
|
|
33
|
-
"sameRowColumnWidth": "25",
|
|
34
|
-
"tooltip": "First Name",
|
|
35
|
-
"tooltipPosition": "right",
|
|
36
|
-
"pattern": "any",
|
|
37
|
-
"placeholder": "First Name",
|
|
38
|
-
"autofocus": true,
|
|
39
|
-
"autocomplete": ["amar", "bharat", "charan"],
|
|
40
|
-
"customComponentName": "none",
|
|
41
|
-
"rucDialogInput": {},
|
|
42
|
-
"hasDependentFields": false,
|
|
43
|
-
"dependentFieldParentId": "any",
|
|
44
|
-
"toolTipDescription": "none",
|
|
45
|
-
"showErrorOnPopUp": true,
|
|
46
|
-
"groupOptions": [
|
|
47
|
-
{
|
|
48
|
-
"id": "Winter",
|
|
49
|
-
"name": "Winter",
|
|
50
|
-
"value": ""
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"id": "Spring",
|
|
54
|
-
"name": "Spring",
|
|
55
|
-
"value": ""
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"id": "Summer",
|
|
59
|
-
"name": "Summer",
|
|
60
|
-
"value": ""
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"id": "Autumn",
|
|
64
|
-
"name": "Autumn",
|
|
65
|
-
"value": ""
|
|
66
|
-
}
|
|
67
|
-
],
|
|
68
|
-
"dependentFields": []
|
|
69
|
-
}
|
|
70
|
-
beforeEach(async () => {
|
|
71
|
-
await TestBed.configureTestingModule({
|
|
72
|
-
imports: [TextFieldModule],
|
|
73
|
-
declarations: [ RucTextAreaComponent ]
|
|
74
|
-
})
|
|
75
|
-
.compileComponents();
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
beforeEach(() => {
|
|
79
|
-
fixture = TestBed.createComponent(RucTextAreaComponent);
|
|
80
|
-
component = fixture.componentInstance;
|
|
81
|
-
component.rucInputData = mockFormData;
|
|
82
|
-
fixture.detectChanges();
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it('should create', () => {
|
|
86
|
-
component.rucInputData = mockFormData;
|
|
87
|
-
expect(component).toBeTruthy();
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it('should called modelChangeFn ', () => {
|
|
91
|
-
component.rucInputData = mockFormData;
|
|
92
|
-
const event = {
|
|
93
|
-
value: "Winter"
|
|
94
|
-
}
|
|
95
|
-
const spy = spyOn(component.transferUserInput, 'emit');
|
|
96
|
-
component.modelChangeFn(event);
|
|
97
|
-
|
|
98
|
-
expect(spy).toHaveBeenCalled();
|
|
99
|
-
})
|
|
100
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Component, Input, OnInit, EventEmitter, Output } from '@angular/core';
|
|
2
|
-
import {RucMetaFormValidationService} from '../../services/ruc-meta-form-validation.service';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'ruc-text-area',
|
|
6
|
-
templateUrl: './ruc-text-area.component.html',
|
|
7
|
-
styleUrls: ['./ruc-text-area.component.css']
|
|
8
|
-
})
|
|
9
|
-
export class RucTextAreaComponent implements OnInit {
|
|
10
|
-
@Input() rucInputData : any;
|
|
11
|
-
@Output() transferUserInput = new EventEmitter<any>();
|
|
12
|
-
@Input() customTheme: string | undefined;
|
|
13
|
-
errorMessage: string | undefined
|
|
14
|
-
|
|
15
|
-
constructor(public validationService:RucMetaFormValidationService) {
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
ngOnInit(): void {
|
|
20
|
-
this.errorMessage = this.validationService.defaultErrorMessage;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* @param e
|
|
25
|
-
*/
|
|
26
|
-
modelChangeFn(e:any) {
|
|
27
|
-
this.transferUserInput.emit(this.rucInputData);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export interface MetaFormConfig {
|
|
3
|
-
formType?: 'simple' | 'stepper' // less priority
|
|
4
|
-
inputType: 'text' | 'password' | 'button' | 'checkbox' | 'email' | 'color' | 'date' | 'file' | 'hidden' | 'image' | 'radio' | 'number' | 'range' | 'reset' | 'search' | 'submit' | 'time' | 'tel' | 'url' | 'week' | 'month' | 'number' | 'custom' | 'select' | 'rucMultiFileUpload' | 'rucMultiSelect',
|
|
5
|
-
fieldType: string,
|
|
6
|
-
id?: string,
|
|
7
|
-
errorMsg? : boolean,
|
|
8
|
-
name?: string,
|
|
9
|
-
label?: string,
|
|
10
|
-
value?: any,
|
|
11
|
-
className?: string, // to be check value?: string, //Specifies the default value for an input field src?: string,
|
|
12
|
-
alt?: string,
|
|
13
|
-
appearance?: string,
|
|
14
|
-
min?: string, //Specifies the minimum value for an input field
|
|
15
|
-
max?: string, //Specifies the maximum value for an input field
|
|
16
|
-
width?: string, // like for image
|
|
17
|
-
height?: string, // like for image
|
|
18
|
-
checked?: boolean, //Specifies that an input field should be pre-selected when the page loads (for type="checkbox" or type="radio")
|
|
19
|
-
disabled?: boolean, //Specifies that an input field should be disabled
|
|
20
|
-
maxlength?: string, //Specifies the maximum number of character for an input field
|
|
21
|
-
readonly?: boolean, //Specifies that an input field is read only (cannot be changed)
|
|
22
|
-
required?: boolean, //Specifies that an input field is required (must be filled out)
|
|
23
|
-
size?: string, //Specifies the width (in characters) of an input field
|
|
24
|
-
step?: string, //Specifies the legal number intervals for an input field
|
|
25
|
-
sameRow? : boolean,
|
|
26
|
-
sameRowColumnWidth? : string,
|
|
27
|
-
tooltip? : string,
|
|
28
|
-
tooltipPosition? : string, //'after', 'before', 'above', 'below', 'left', 'right'
|
|
29
|
-
pattern? : any, // The input pattern attribute specifies a regular expression that the input field's value is checked against, when the form is submitted. The pattern attribute works with the following input types: text, date, search, url, tel, email, and password.
|
|
30
|
-
placeholder?: any,
|
|
31
|
-
autofocus?: any, //The input autofocus attribute specifies that an input field should automatically get focus when the page loads.
|
|
32
|
-
autocomplete?: any,
|
|
33
|
-
customComponentName?: 'dialog' | 'multiselect' | 'none',
|
|
34
|
-
rucDialogInput? : any,
|
|
35
|
-
rucMultiselectInput? : {
|
|
36
|
-
rucInputData? : any,
|
|
37
|
-
dataSource? : any
|
|
38
|
-
}, // multiselect interface
|
|
39
|
-
rucMultiFileUpload? : {rucInputData? : any}
|
|
40
|
-
hasDependentFields?: boolean,
|
|
41
|
-
dependentFieldParentId?: any,
|
|
42
|
-
dependentFields?: MetaFormConfig[];
|
|
43
|
-
selectedParentId?: any;
|
|
44
|
-
toolTipDescription?: string,
|
|
45
|
-
customErrorMessage?: string,
|
|
46
|
-
showErrorOnPopUp?: boolean, //need to be discuss more. as a enhancement
|
|
47
|
-
groupOptions?: groupOptions[] // Or like [''],
|
|
48
|
-
stepperForm?: boolean;
|
|
49
|
-
stepper?: Stepper[],
|
|
50
|
-
rucMultiFileUploadInput?:{
|
|
51
|
-
rucInputData? : any,
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
export interface FormAttributes {
|
|
55
|
-
action: any,
|
|
56
|
-
target?: any,
|
|
57
|
-
method?:any,
|
|
58
|
-
novalidate?: boolean,
|
|
59
|
-
showFormProgress?: boolean // need to spend time on it
|
|
60
|
-
}
|
|
61
|
-
export interface groupOptions{
|
|
62
|
-
id: string,
|
|
63
|
-
name: string,
|
|
64
|
-
value?: string, // compulsary if its select option part selected?: boolean
|
|
65
|
-
disable? : boolean
|
|
66
|
-
}
|
|
67
|
-
export interface Stepper{
|
|
68
|
-
stepControl?: string;
|
|
69
|
-
stepperlabel?: string;
|
|
70
|
-
stepperFormData?: MetaFormConfig[];
|
|
71
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
<form novalidate>
|
|
2
|
-
<ng-container *ngFor="let dynamicField of formData; let j = index;" [ngSwitch]="dynamicField?.fieldType">
|
|
3
|
-
<div [ngStyle] = "{ 'width.%': dynamicField.sameRowColumnWidth - 2 }" [ngClass]="dynamicField.sameRow === true ? 'margin-5 column-in-same-row' : 'margin-5 column-in-new-row'"
|
|
4
|
-
*ngIf="dynamicField.formType != 'stepper'">
|
|
5
|
-
|
|
6
|
-
<ng-template [ngSwitchCase]="'input'">
|
|
7
|
-
<div *ngIf="(!selectedParentId && !dynamicField.hasDependentFields) || (selectedParentId && selectedParentId == dynamicField.dependentFieldParentId)">
|
|
8
|
-
<ruc-meta-inputs [customTheme] = "customTheme" [rucInputData]="dynamicField" (transferUserInput)="getMetaFormData($event)"></ruc-meta-inputs>
|
|
9
|
-
</div>
|
|
10
|
-
</ng-template>
|
|
11
|
-
<ng-template [ngSwitchCase]="'radio'">
|
|
12
|
-
<div *ngIf="(!selectedParentId && !dynamicField.dependentFields) || (selectedParentId && selectedParentId == dynamicField.dependentFieldParentId) || (!selectedParentId && dynamicField.dependentFields && !isChild)">
|
|
13
|
-
<ruc-meta-radio-group [customTheme] = "customTheme" [rucInputData]="dynamicField" (transferUserInput)="getMetaFormData($event)"></ruc-meta-radio-group>
|
|
14
|
-
</div>
|
|
15
|
-
</ng-template>
|
|
16
|
-
<ng-template [ngSwitchCase]="'checkbox'">
|
|
17
|
-
<div *ngIf="(!selectedParentId && !dynamicField.dependentFields) || (selectedParentId && selectedParentId == dynamicField.dependentFieldParentId) || (!selectedParentId && dynamicField.dependentFields && !isChild)">
|
|
18
|
-
<ruc-meta-checkbox-group [rucInputData]="dynamicField" (transferUserInput)="getMetaFormData($event)"></ruc-meta-checkbox-group>
|
|
19
|
-
</div>
|
|
20
|
-
</ng-template>
|
|
21
|
-
<ng-template class="" [ngSwitchCase]="'select'">
|
|
22
|
-
<div *ngIf="(!selectedParentId && !dynamicField.dependentFields) || (selectedParentId && selectedParentId == dynamicField.dependentFieldParentId) || (!selectedParentId && dynamicField.dependentFields && !isChild)">
|
|
23
|
-
<ruc-meta-select [rucInputData]="dynamicField" (transferUserInput)="getMetaFormData($event)"></ruc-meta-select>
|
|
24
|
-
</div>
|
|
25
|
-
</ng-template>
|
|
26
|
-
<ng-template class="" [ngSwitchCase]="'textarea'">
|
|
27
|
-
<ruc-text-area [rucInputData]="dynamicField" (transferUserInput)="getMetaFormData($event)"></ruc-text-area>
|
|
28
|
-
</ng-template>
|
|
29
|
-
<ng-template [ngSwitchCase]="'rucMultiSelect'">
|
|
30
|
-
<uxp-ruclib-multi-select [rucInputData]="dynamicField?.rucMultiselectInput?.rucInputData"
|
|
31
|
-
[dataSource]="dynamicField?.rucMultiselectInput?.dataSource" [customTheme]="customTheme"
|
|
32
|
-
(rucEvent)="passEvent($event)"></uxp-ruclib-multi-select>
|
|
33
|
-
</ng-template>
|
|
34
|
-
<ng-template [ngSwitchCase]="'rucMultiFileUpload'">
|
|
35
|
-
<uxp-ruclib-multi-file-upload
|
|
36
|
-
[rucInputData]="dynamicField?.rucMultiFileUploadInput?.rucInputData" [customTheme]="customTheme"
|
|
37
|
-
(rucEvent)="passEvent($event,dynamicField)"></uxp-ruclib-multi-file-upload>
|
|
38
|
-
</ng-template>
|
|
39
|
-
<div *ngIf="dynamicField.hasDependentFields && dynamicField.value">
|
|
40
|
-
<uxp-ruclib-metaform #dynamicField.id [rucInputData]="formData" [childForm] ="dynamicField.dependentFields"
|
|
41
|
-
[isChild]="true" [selectedParentId] = "dynamicField.selectedParentId" (rucEvent)="passEvent($event,dynamicField.id)"></uxp-ruclib-metaform>
|
|
42
|
-
</div>
|
|
43
|
-
|
|
44
|
-
</div>
|
|
45
|
-
<div *ngIf="dynamicField.formType == 'stepper'">
|
|
46
|
-
<mat-stepper linear #stepper>
|
|
47
|
-
<div *ngFor="let stapperField of dynamicField.stepper; let s = index;" [ngSwitch]="stapperField?.fieldType">
|
|
48
|
-
<mat-step [stepControl]="stapperField.stepControl" *ngIf="stapperField.stepControl != 'done'">
|
|
49
|
-
<ng-template matStepLabel>{{stapperField.stepperlabel}}</ng-template>
|
|
50
|
-
<ng-container *ngFor="let stepperFormData of stapperField.stepperFormData; let j = index;" [ngSwitch]="stepperFormData?.fieldType">
|
|
51
|
-
<div [ngStyle] = "{ 'width.%': dynamicField.sameRowColumnWidth - 2 }" [ngClass]="dynamicField.sameRow === true ? 'margin-5 column-in-same-row' : 'margin-5 column-in-new-row'"
|
|
52
|
-
>
|
|
53
|
-
<ng-template [ngSwitchCase]="'input'">
|
|
54
|
-
<div>
|
|
55
|
-
<ruc-meta-inputs [customTheme] = "customTheme" [rucInputData]="stepperFormData" (transferUserInput)="getMetaFormData($event)"></ruc-meta-inputs>
|
|
56
|
-
</div>
|
|
57
|
-
</ng-template>
|
|
58
|
-
<ng-template class="" [ngSwitchCase]="'textarea'">
|
|
59
|
-
<ruc-text-area [rucInputData]="stepperFormData" (transferUserInput)="getMetaFormData($event)"></ruc-text-area>
|
|
60
|
-
</ng-template>
|
|
61
|
-
<ng-template [ngSwitchCase]="'radio'">
|
|
62
|
-
<div>
|
|
63
|
-
<ruc-meta-radio-group [customTheme] = "customTheme" [rucInputData]="stepperFormData" (transferUserInput)="getMetaFormData($event)"></ruc-meta-radio-group>
|
|
64
|
-
</div>
|
|
65
|
-
</ng-template>
|
|
66
|
-
<ng-template [ngSwitchCase]="'checkbox'">
|
|
67
|
-
<div >
|
|
68
|
-
<ruc-meta-checkbox-group [rucInputData]="stepperFormData" (transferUserInput)="getMetaFormData($event)"></ruc-meta-checkbox-group>
|
|
69
|
-
</div>
|
|
70
|
-
</ng-template>
|
|
71
|
-
<ng-template class="" [ngSwitchCase]="'select'">
|
|
72
|
-
<div *ngIf="(!selectedParentId && !dynamicField.dependentFields) || (selectedParentId && selectedParentId == dynamicField.dependentFieldParentId) || (!selectedParentId && dynamicField.dependentFields && !isChild)">
|
|
73
|
-
<ruc-meta-select [rucInputData]="dynamicField" (transferUserInput)="getMetaFormData($event)"></ruc-meta-select>
|
|
74
|
-
</div>
|
|
75
|
-
</ng-template>
|
|
76
|
-
</div>
|
|
77
|
-
</ng-container>
|
|
78
|
-
<div>
|
|
79
|
-
<button mat-button matStepperPrevious *ngIf="s > 0">Back</button>
|
|
80
|
-
<button mat-button matStepperNext *ngIf="s< dynamicField.stepper.length">Next</button>
|
|
81
|
-
</div>
|
|
82
|
-
</mat-step>
|
|
83
|
-
<mat-step *ngIf="stapperField.stepControl == 'done'">
|
|
84
|
-
<ng-template matStepLabel>{{stapperField.stepControl}}</ng-template>
|
|
85
|
-
<p>{{stapperField.stepperlabel}}</p>
|
|
86
|
-
<div>
|
|
87
|
-
<button mat-button matStepperPrevious>Back</button>
|
|
88
|
-
<button mat-button (click)="stepper.reset()">Reset</button>
|
|
89
|
-
</div>
|
|
90
|
-
</mat-step>
|
|
91
|
-
</div>
|
|
92
|
-
</mat-stepper>
|
|
93
|
-
</div>
|
|
94
|
-
</ng-container>
|
|
95
|
-
<ng-container>
|
|
96
|
-
<button mat-raised-button color="primary" (click)="clearForm()" *ngIf="!isChild">Clear Form</button>
|
|
97
|
-
</ng-container>
|
|
98
|
-
|
|
99
|
-
</form>
|