-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
121 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<div class="widget form-group"> | ||
<div class="d-flex justify-content-start"> | ||
<label [attr.for]="id" class="m-0 pt-1 control-label"> | ||
{{ schema.title }} | ||
</label> | ||
| ||
<button (click)="addItem()" class="btn btn-success btn-sm array-add-button"> | ||
Add | ||
<i class="fa fa-plus" aria-hidden="true"></i> | ||
</button> | ||
</div> | ||
<div *ngFor="let itemProperty of formProperty.properties; let i=index; trackBy:trackByIndex" class="mt-2"> | ||
<div class="row"> | ||
<sf-form-element class="col-sm-11" [formProperty]="itemProperty"></sf-form-element> | ||
<div class="col-sm-1"> | ||
<button class="btn btn-link pt-1" (click)="removeItem(i)" role="button"> | ||
<i class="fa fa-fw fa-trash fa-lg text-danger"></i> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
<span *ngIf="schema.description" class="sr-only">{{schema.description}}</span> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
import { ArrayWidget } from 'ngx-schema-form'; | ||
|
||
@Component({ | ||
selector: 'array-component', | ||
templateUrl: `./array.component.html` | ||
}) | ||
export class CustomArrayComponent extends ArrayWidget {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
ui/src/app/schema-form/widget/textarea/textarea.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<div class="widget form-group"> | ||
<label [attr.for]="id" class="d-flex justify-content-between control-label"> | ||
<span>{{ schema.title }}</span> | ||
<span *ngIf="schema.description"> | ||
<ng-template #tooltip i18n="@@tooltip--description">{{ schema.description }}</ng-template> | ||
<i class="info-icon fa fa-fw fa-info-circle text-primary fa-lg" | ||
[ngbPopover]="tooltip" | ||
i18n-aria-label="@@tooltip--instruction" | ||
aria-label="Information icon - press spacebar to read additional information for this form field"></i> | ||
</span> | ||
</label> | ||
<span *ngIf="schema.description" class="sr-only">{{schema.description}}</span> | ||
<textarea [attr.readonly]="schema.readOnly" | ||
[name]="name" | ||
class="text-widget textarea-widget form-control" | ||
[attr.placeholder]="schema.placeholder" | ||
[attr.maxLength]="schema.maxLength || null" | ||
[attr.minLength]="schema.minLength || null" | ||
[rows]="schema.widget.rows || 5" | ||
[formControl]="control"></textarea> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
import { TextAreaWidget } from 'ngx-schema-form'; | ||
|
||
@Component({ | ||
selector: 'textarea-component', | ||
templateUrl: `./textarea.component.html` | ||
}) | ||
export class CustomTextAreaComponent extends TextAreaWidget {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters