Skip to content

Commit 51a69cd

Browse files
committed
Remove unnecessary code from input widgets.
1 parent 91b9607 commit 51a69cd

10 files changed

+17
-21
lines changed

src/lib/src/framework-library/material-design-framework/material-datepicker.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { dateToString, hasOwn, stringToDate } from '../../shared';
1111
[style.width]="'100%'">
1212
<span matPrefix *ngIf="options?.prefix || options?.fieldAddonLeft"
1313
[innerHTML]="options?.prefix || options?.fieldAddonLeft"></span>
14-
<input matInput #inputControl *ngIf="boundControl"
14+
<input matInput *ngIf="boundControl"
1515
[formControl]="formControl"
1616
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
1717
[attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
@@ -25,7 +25,7 @@ import { dateToString, hasOwn, stringToDate } from '../../shared';
2525
[required]="options?.required"
2626
[style.width]="'100%'"
2727
(blur)="options.showErrors = true">
28-
<input matInput #inputControl *ngIf="!boundControl"
28+
<input matInput *ngIf="!boundControl"
2929
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
3030
[attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
3131
[attr.readonly]="options?.readonly ? 'readonly' : null"

src/lib/src/framework-library/material-design-framework/material-design-framework.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export class MaterialDesignFrameworkComponent implements OnInit, OnChanges {
7676
options: any; // Options used in this framework
7777
widgetLayoutNode: any; // layoutNode passed to child widget
7878
widgetOptions: any; // Options passed to child widget
79-
layoutPointer: string;
8079
formControl: any = null;
8180
parentArray: any = null;
8281
isOrderable: boolean = false;
@@ -121,7 +120,6 @@ export class MaterialDesignFrameworkComponent implements OnInit, OnChanges {
121120
options: _.cloneDeep(this.layoutNode.options || {})
122121
};
123122
this.widgetOptions = this.widgetLayoutNode.options;
124-
this.layoutPointer = this.jsf.getLayoutPointer(this);
125123
this.formControl = this.jsf.getFormControl(this);
126124

127125
if (this.options) {

src/lib/src/framework-library/material-design-framework/material-input.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { hasOwn } from '../../shared';
1313
[style.width]="'100%'">
1414
<span matPrefix *ngIf="options?.prefix || options?.fieldAddonLeft"
1515
[innerHTML]="options?.prefix || options?.fieldAddonLeft"></span>
16-
<input matInput #inputControl *ngIf="boundControl"
16+
<input matInput *ngIf="boundControl"
1717
[formControl]="formControl"
1818
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
1919
[attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
@@ -28,7 +28,7 @@ import { hasOwn } from '../../shared';
2828
[style.width]="'100%'"
2929
[type]="layoutNode?.type"
3030
(blur)="options.showErrors = true">
31-
<input matInput #inputControl *ngIf="!boundControl"
31+
<input matInput *ngIf="!boundControl"
3232
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
3333
[attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
3434
[attr.maxlength]="options?.maxLength"

src/lib/src/framework-library/material-design-framework/material-number.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { hasOwn } from '../../shared';
1313
[style.width]="'100%'">
1414
<span matPrefix *ngIf="options?.prefix || options?.fieldAddonLeft"
1515
[innerHTML]="options?.prefix || options?.fieldAddonLeft"></span>
16-
<input matInput #inputControl *ngIf="boundControl"
16+
<input matInput *ngIf="boundControl"
1717
[formControl]="formControl"
1818
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
1919
[attr.max]="options?.maximum"
@@ -27,7 +27,7 @@ import { hasOwn } from '../../shared';
2727
[style.width]="'100%'"
2828
[type]="'number'"
2929
(blur)="options.showErrors = true">
30-
<input matInput #inputControl *ngIf="!boundControl"
30+
<input matInput *ngIf="!boundControl"
3131
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
3232
[attr.max]="options?.maximum"
3333
[attr.min]="options?.minimum"

src/lib/src/framework-library/material-design-framework/material-select.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { buildTitleMap, isArray } from '../../shared';
1515
[style.width]="'100%'">
1616
<span matPrefix *ngIf="options?.prefix || options?.fieldAddonLeft"
1717
[innerHTML]="options?.prefix || options?.fieldAddonLeft"></span>
18-
<mat-select #inputControl *ngIf="boundControl"
18+
<mat-select *ngIf="boundControl"
1919
[formControl]="formControl"
2020
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
2121
[attr.name]="controlName"
@@ -39,7 +39,7 @@ import { buildTitleMap, isArray } from '../../shared';
3939
</mat-optgroup>
4040
</ng-template>
4141
</mat-select>
42-
<mat-select #inputControl *ngIf="!boundControl"
42+
<mat-select *ngIf="!boundControl"
4343
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
4444
[attr.name]="controlName"
4545
[disabled]="controlDisabled || options?.readonly"

src/lib/src/framework-library/material-design-framework/material-slider.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { getControl, hasOwn, inArray, isDefined } from '../../shared';
77
@Component({
88
selector: 'material-slider-widget',
99
template: `
10-
<mat-slider thumbLabel #inputControl *ngIf="boundControl && isConditionallyShown()"
10+
<mat-slider thumbLabel *ngIf="boundControl && isConditionallyShown()"
1111
[formControl]="formControl"
1212
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
1313
[id]="'control' + layoutNode?._id"
@@ -16,7 +16,7 @@ import { getControl, hasOwn, inArray, isDefined } from '../../shared';
1616
[step]="options?.multipleOf || options?.step || 'any'"
1717
[style.width]="'100%'"
1818
(blur)="options.showErrors = true"></mat-slider>
19-
<mat-slider thumbLabel #inputControl *ngIf="!boundControl && isConditionallyShown()"
19+
<mat-slider thumbLabel *ngIf="!boundControl && isConditionallyShown()"
2020
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
2121
[disabled]="controlDisabled || options?.readonly"
2222
[id]="'control' + layoutNode?._id"

src/lib/src/framework-library/material-design-framework/material-textarea.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { hasOwn } from '../../shared';
1313
[style.width]="'100%'">
1414
<span matPrefix *ngIf="options?.prefix || options?.fieldAddonLeft"
1515
[innerHTML]="options?.prefix || options?.fieldAddonLeft"></span>
16-
<textarea matInput #inputControl *ngIf="boundControl"
16+
<textarea matInput *ngIf="boundControl"
1717
[formControl]="formControl"
1818
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
1919
[attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
@@ -27,7 +27,7 @@ import { hasOwn } from '../../shared';
2727
[readonly]="options?.readonly ? 'readonly' : null"
2828
[style.width]="'100%'"
2929
(blur)="options.showErrors = true"></textarea>
30-
<textarea matInput #inputControl *ngIf="!boundControl"
30+
<textarea matInput *ngIf="!boundControl"
3131
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
3232
[attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
3333
[attr.maxlength]="options?.maxLength"

src/lib/src/widget-library/hidden.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import { JsonSchemaFormService } from '../json-schema-form.service';
66
@Component({
77
selector: 'hidden-widget',
88
template: `
9-
<input #inputControl *ngIf="boundControl"
9+
<input *ngIf="boundControl"
1010
[formControl]="formControl"
1111
[id]="'control' + layoutNode?._id"
1212
[name]="controlName"
1313
type="hidden">
14-
<input #inputControl *ngIf="!boundControl"
14+
<input *ngIf="!boundControl"
1515
[disabled]="controlDisabled"
1616
[name]="controlName"
1717
[id]="'control' + layoutNode?._id"

src/lib/src/widget-library/input.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { JsonSchemaFormService } from '../json-schema-form.service';
1212
[class]="options?.labelHtmlClass"
1313
[style.display]="options?.notitle ? 'none' : ''"
1414
[innerHTML]="options?.title"></label>
15-
<input #inputControl *ngIf="boundControl"
15+
<input *ngIf="boundControl"
1616
[formControl]="formControl"
1717
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
1818
[attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
@@ -26,7 +26,7 @@ import { JsonSchemaFormService } from '../json-schema-form.service';
2626
[name]="controlName"
2727
[readonly]="options?.readonly ? 'readonly' : null"
2828
[type]="layoutNode?.type">
29-
<input #inputControl *ngIf="!boundControl"
29+
<input *ngIf="!boundControl"
3030
[attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
3131
[attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
3232
[attr.maxlength]="options?.maxLength"

src/lib/src/widget-library/message.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import {
2-
ChangeDetectorRef, Component, Input, OnChanges, OnInit
3-
} from '@angular/core';
1+
import { Component, Input, OnInit } from '@angular/core';
42
import { FormGroup } from '@angular/forms';
53

64
import { JsonSchemaFormService } from '../json-schema-form.service';

0 commit comments

Comments
 (0)