Skip to content

Commit

Permalink
feat(material/form-builder): Added Signature Field to Form Builder. A…
Browse files Browse the repository at this point in the history
…dded readonly flag to form builder field properties.
  • Loading branch information
Marco Tozzi authored and robzan8 committed Oct 16, 2023
1 parent fe4abdf commit b7e4e39
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions projects/material/form-builder/src/form-builder-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,10 @@ export class AjfFormBuilderService {
label: 'Barcode',
nodeType: {node: AjfNodeType.AjfField, field: AjfFieldType.Barcode},
},
{
label: 'Signature',
nodeType: {node: AjfNodeType.AjfField, field: AjfFieldType.Signature},
},
{
label: 'File',
nodeType: {node: AjfNodeType.AjfField, field: AjfFieldType.File},
Expand Down Expand Up @@ -845,6 +849,7 @@ export class AjfFormBuilderService {

if (isField(node)) {
node.hint = properties.hint;
node.editable = !properties.readonlyField;
node.description = properties.description;
node.defaultValue = getDefaultValue(properties.defaultValue, node);
node.formula =
Expand Down
3 changes: 3 additions & 0 deletions projects/material/form-builder/src/node-properties.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ <h3>{{'Properties'|transloco}}</h3>
</div>
</ng-template>
<ng-template [ngIf]="isField(ne)">
<div class="ajf-prop">
<mat-checkbox formControlName="readonlyField">{{'Readonly'|transloco}}</mat-checkbox>
</div>
<div class="ajf-prop">
<mat-form-field>
<mat-label>{{'Field size'|transloco}}</mat-label>
Expand Down
1 change: 1 addition & 0 deletions projects/material/form-builder/src/node-properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ export class AjfFbNodeProperties implements OnDestroy {
controls.notEmpty = notEmpty;
controls.validationConditions = [validationConditions, []];
controls.notEmptyWarning = notEmptyW;
controls.readonlyField = node.editable != null ? !node.editable : false;
controls.warningConditions = [warningConditions, []];
controls.nextSlideCondition = [node.nextSlideCondition];

Expand Down
2 changes: 2 additions & 0 deletions projects/material/node-icon/src/node-icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ export class AjfNodeIcon extends CoreNodeIcon {
return 'image';
case AjfFieldType.VideoUrl:
return 'videocam';
case AjfFieldType.Signature:
return 'draw';
default:
return 'broken_image';
}
Expand Down

0 comments on commit b7e4e39

Please sign in to comment.