Skip to content

Commit

Permalink
add service to retrive form form API
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdullah Alhazmy committed Oct 26, 2022
1 parent 4a3b6d1 commit 18d4a7e
Show file tree
Hide file tree
Showing 7 changed files with 247 additions and 201 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@godzilla-forms/angular-parser",
"version": "0.0.14",
"version": "0.0.15",
"description": "Godzilla Forms parser library for angular",
"private": false,
"publishConfig": {
Expand Down
95 changes: 50 additions & 45 deletions src/components/form-parser.component.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
<div *ngIf="!form" class="row justify-content-center align-items-center">
<div class="spinner-border text-primary col-auto" role="status">
<span class="visually-hidden">Loading...</span>
</div>
</div>
<div [formGroup]="formGroup" class="row needs-validation">
<div *ngFor="let page of form?.pages" class="row">
<div *ngFor="let control of page.controls" [class]="getCssClass(control)">
<div
*ngIf="isFlowValid(control)"
class="needs-validation"
[class.form-check]="control.type === 'checkbox'">
<godzilla-forms-heading-controller
*ngIf="control.type === 'heading'"
[control]="control"></godzilla-forms-heading-controller>
<godzilla-forms-input-controller
*ngIf="
<div *ngFor="let page of form?.pages" class="row">
<div *ngFor="let control of page.controls" [class]="getCssClass(control)">
<div
*ngIf="isFlowValid(control)"
class="needs-validation"
[class.form-check]="control.type === 'checkbox'">
<godzilla-forms-heading-controller
*ngIf="control.type === 'heading'"
[control]="control"></godzilla-forms-heading-controller>
<godzilla-forms-input-controller
*ngIf="
[
'text',
'password',
Expand All @@ -22,39 +27,39 @@
'color'
].includes(control.type)
"
[control]="control"
[submitted]="submitted"
[controlName]="control.id"></godzilla-forms-input-controller>
<godzilla-forms-textarea-controller
*ngIf="control.type == 'textarea'"
[control]="control"
[submitted]="submitted"
[controlName]="control.id"></godzilla-forms-textarea-controller>
<godzilla-forms-select-controller
*ngIf="control.type == 'dropdown'"
[control]="control"
[submitted]="submitted"
[controlName]="control.id"></godzilla-forms-select-controller>
<godzilla-forms-upload-controller
*ngIf="control.type === 'upload'"
[control]="control"
[submitted]="submitted"
[controlName]="control.id"></godzilla-forms-upload-controller>
<godzilla-forms-radio-controller
*ngIf="control.type === 'radio'"
[control]="control"
[submitted]="submitted"
[controlName]="control.id"></godzilla-forms-radio-controller>
[control]="control"
[submitted]="submitted"
[controlName]="control.id"></godzilla-forms-input-controller>
<godzilla-forms-textarea-controller
*ngIf="control.type == 'textarea'"
[control]="control"
[submitted]="submitted"
[controlName]="control.id"></godzilla-forms-textarea-controller>
<godzilla-forms-select-controller
*ngIf="control.type == 'dropdown'"
[control]="control"
[submitted]="submitted"
[controlName]="control.id"></godzilla-forms-select-controller>
<godzilla-forms-upload-controller
*ngIf="control.type === 'upload'"
[control]="control"
[submitted]="submitted"
[controlName]="control.id"></godzilla-forms-upload-controller>
<godzilla-forms-radio-controller
*ngIf="control.type === 'radio'"
[control]="control"
[submitted]="submitted"
[controlName]="control.id"></godzilla-forms-radio-controller>

<godzilla-forms-error-controller
[control]="control"
[submitted]="submitted"
[controlName]="control.id"></godzilla-forms-error-controller>
</div>
</div>
</div>
<godzilla-forms-button-controller
*ngIf="form?.style?.showSubmitButton"
(onClick)="validate()"
[label]="form?.style?.submitLabel"></godzilla-forms-button-controller>
<godzilla-forms-error-controller
[control]="control"
[submitted]="submitted"
[controlName]="control.id"></godzilla-forms-error-controller>
</div>
</div>
</div>
<godzilla-forms-button-controller
*ngIf="form?.style?.showSubmitButton"
(onClick)="validate()"
[label]="form?.style?.submitLabel"></godzilla-forms-button-controller>
</div>
Loading

0 comments on commit 18d4a7e

Please sign in to comment.