Skip to content
Permalink
Browse files

amexio form: template driven form added

  • Loading branch information...
sagarjadhav968 committed Nov 20, 2018
1 parent 8061d5f commit fb27277b691de6111a5c4ef4d254c102e3a61c6a
Showing with 629 additions and 724 deletions.
  1. +4 −2 src/module/base/list.base.datepicker.component.ts
  2. +4 −0 src/module/forms/amexio.forms.module.ts
  3. +10 −0 src/module/forms/checkbox-group/checkbox.component.html
  4. +40 −0 src/module/forms/checkbox-group/checkbox.component.ts
  5. +9 −25 src/module/forms/checkbox-group/checkbox.group.component.html
  6. +122 −177 src/module/forms/checkbox-group/checkbox.group.component.ts
  7. +1 −1 src/module/forms/checkbox/checkbox.component.html
  8. +16 −3 src/module/forms/checkbox/checkbox.component.ts
  9. +15 −3 src/module/forms/datetimepicker/datetimepicker.component.ts
  10. +61 −62 src/module/forms/dropdown/dropdown.component.html
  11. +14 −4 src/module/forms/dropdown/dropdown.component.ts
  12. +1 −1 src/module/forms/emailinput/emailinput.component.html
  13. +15 −3 src/module/forms/emailinput/emailinput.component.ts
  14. +15 −0 src/module/forms/form-validator/amexio.form.validator.component.ts
  15. +3 −2 src/module/forms/numberinput/numberinput.component.html
  16. +19 −3 src/module/forms/numberinput/numberinput.component.ts
  17. +3 −3 src/module/forms/passwordinput/passwordinput.component.html
  18. +20 −3 src/module/forms/passwordinput/passwordinput.component.ts
  19. +26 −21 src/module/forms/radio/radiogroup.component.html
  20. +24 −11 src/module/forms/radio/radiogroup.component.ts
  21. +1 −1 src/module/forms/textarea/textarea.component.html
  22. +15 −3 src/module/forms/textarea/textarea.component.ts
  23. +15 −26 src/module/forms/textinput/textinput.component.html
  24. +23 −8 src/module/forms/textinput/textinput.component.ts
  25. +14 −4 src/module/forms/toggle/toggle.component.ts
  26. +3 −3 src/module/forms/typeahead/typeahead.component.html
  27. +17 −7 src/module/forms/typeahead/typeahead.component.ts
  28. +5 −7 src/module/panes/form/form.action.component.ts
  29. +44 −45 src/module/panes/form/form.component.html
  30. +68 −293 src/module/panes/form/form.component.ts
  31. +0 −1 src/module/panes/window/window.pane.component.ts
  32. +2 −2 tsconfig.json
@@ -1,15 +1,17 @@
import { ChangeDetectorRef, ElementRef, Renderer2 } from '@angular/core';
import { AmexioFormValidator } from '../forms/form-validator/amexio.form.validator.component';
import { BaseInput } from './base.input.component';

export class ListBaseDatepickerComponent<T> {
export class ListBaseDatepickerComponent<T> extends AmexioFormValidator {

self = false;
itemClick = false;
dropdownstyle: any;
documentClickListener: any;

constructor(private renderer: Renderer2, public element: ElementRef, private cd: ChangeDetectorRef) {
this.hide();
super();
this.hide();
}

focus(event: any) {
@@ -12,6 +12,7 @@ import { AmexioButtonDropDownItemComponent } from './button-dropdown/button.drop
import { AmexioSpiltButtonDropdownComponent } from './button-dropdown/split.button.dropdown';
import { AmexioButtonGroupComponent } from './buttongroup/button.group.component';
import { AmexioButtonComponent } from './buttons/button.component';
import { CheckboxComponent } from './checkbox-group/checkbox.component';
import { AmexioCheckBoxGroupComponent } from './checkbox-group/checkbox.group.component';
import { AmexioCheckBoxComponent } from './checkbox/checkbox.component';
import { AmexioChipComponent } from './chip/chip.component';
@@ -57,6 +58,8 @@ import { LoadRecaptchaService } from './recaptcha/load.recaptcha.service';
export * from '../services/data/common.data.service';
export * from '../services/icon/icon.service';
export * from './recaptcha/load.recaptcha.service';
export * from './buttons/button.component';
export * from './buttongroup/button.group.component';

const FORM_COMPONENTS = [
AmexioTextInputComponent,
@@ -77,6 +80,7 @@ const FORM_COMPONENTS = [
AmexioSpiltButtonDropdownComponent,
AmexioButtonDropDownItemComponent,
AmexioCheckBoxGroupComponent,
CheckboxComponent,
AmexioFormIconComponent,
AmexioSliderComponent,
AmexioTagsInputComponent,
@@ -0,0 +1,10 @@
<!-- <div style="display: flex;" (click)="toggleCheck()">
<input class="form-control" type="checkbox" [checked]="isChecked()" />
<label>{{label}}</label>
</div> <br/> -->

<label class="input-box-container" [ngClass]="{'disable-component' : disabled || disabled}">
{{label}}
<input type="checkbox" class="form-control" [ngClass]="{'checkbox-disable' : disabled}" [checked]="checked" (click)="toggleCheck()">
<span class="input-box-checkbox-label"></span>
</label>
@@ -0,0 +1,40 @@
import { Component, Host, Input, OnInit } from '@angular/core';
import { AmexioCheckBoxGroupComponent } from './checkbox.group.component';
@Component({
selector: 'checkbox',
templateUrl: './checkbox.component.html',
})
export class CheckboxComponent implements OnInit {
@Input() label: any;

@Input() value: any;

@Input() name: any;

@Input() checked: boolean;

@Input() disabled: boolean;

constructor(@Host() private checkboxGroup: AmexioCheckBoxGroupComponent) {}

toggleCheck() {
if (!this.checked) {
this.checkboxGroup.add(this.value);
} else {
this.checkboxGroup.remove(this.value);
}
this.checked = !this.checked;
}

isChecked() {
return this.checked || this.checkboxGroup.contains(this.value);
}

ngOnInit() {
setTimeout(() => {
if (this.checked) {
this.checkboxGroup.add(this.value);
}
}, 200);
}
}
@@ -1,34 +1,18 @@
<div style="height: 300px;" *ngIf="mask">
<div class="spinner"></div>
</div>
<div class="inputgroup " *ngIf="!mask">
<div class="inputgroup form-group" *ngIf="!mask">
<div *ngIf="fieldlabel">
<label>{{fieldlabel}}</label>
</div>

<ng-container *ngIf="horizontal">
<ng-container *ngFor="let row of viewData">

<label class="input-box-container" [ngClass]="{'disable-component' : row?.disabled || disabled}">{{row[displayfield]}}
<input type="checkbox" *ngIf="row[valuefield]" [ngClass]="{'checkbox-disable' : disabled}" [required]="required" checked="checked" (click)="setSelectedCheckBox(row, $event)">
<input type="checkbox" *ngIf="!row[valuefield]" [ngClass]="{'checkbox-disable' : disabled}" [required]="required" (click)="setSelectedCheckBox(row, $event)">
<span class="input-box-checkbox-label"></span>
</label>

</ng-container>
</ng-container>

<ng-container *ngIf="!horizontal">
<ng-container *ngFor="let row of viewData">
<div [ngClass]="{'disable-component' : row?.disabled || disabled}">
<label class="input-box-container">{{row[displayfield]}}
<input type="checkbox" *ngIf="row[valuefield]" [ngClass]="{'checkbox-disable' : disabled}" [required]="required" checked="checked" (click)="setSelectedCheckBox(row, $event)">
<input type="checkbox" *ngIf="!row[valuefield]" [ngClass]="{'checkbox-disable' : disabled}" [required]="required" (click)="setSelectedCheckBox(row, $event)">
<span class="input-box-checkbox-label"></span>
</label>
</div>

</ng-container>
</ng-container>
<div *ngIf="horizontal" style="display: inline-flex; flex-direction :row;">
<checkbox *ngFor="let data of viewdata | async" [checked]="data.checked" [value]="data" [disabled]="data?.disabled || disabled" [label]="data[displayfield]">
</checkbox>
</div>

<div *ngIf="!horizontal" style="display: inline-flex;flex-direction :column;">
<checkbox *ngFor="let data of viewdata | async" [checked]="data.checked" [value]="data" [disabled]="data?.disabled || disabled" [label]="data[displayfield]">
</checkbox>
</div>
</div>
Oops, something went wrong.

0 comments on commit fb27277

Please sign in to comment.
You can’t perform that action at this time.