You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.6 KiB
TypeScript
37 lines
1.6 KiB
TypeScript
import { UiElement } from "./ui-element";
|
|
|
|
export class NumberInput extends UiElement {
|
|
constructor(
|
|
private label: string,
|
|
private elementId: string,
|
|
private value: any,
|
|
private containerId: string,
|
|
private disabled: string,
|
|
private hidden: string,
|
|
private required: string) {
|
|
super(elementId, containerId, '');
|
|
this.createElement(this.getTemplate());
|
|
|
|
}
|
|
|
|
public getTemplate() {
|
|
let requiredClass: string = "";
|
|
if (this.required == 'Y')
|
|
requiredClass = "requiredClass"
|
|
if (this.disabled == "N") { this.disabled = "disabled" } else { this.disabled = "" }
|
|
if (this.hidden == "N") { this.hidden = "display:none;" } else { this.hidden = "" }
|
|
const template =
|
|
// "<div class='custom-text-area-element' style='" + this.hidden + "'>" +
|
|
// " <label class='daynamicForm-Label " + requiredClass + "' id='title' >" + this.label + "</label>" +
|
|
// " <input class='daynamicForm-Input' type='number' id='" + this.elementId + "' value='" + this.value + "' " + this.disabled + " />" +
|
|
// "</div> ";
|
|
|
|
"<ion-item style='" + this.hidden + "' class='dynamicField'> " +
|
|
"<ion-label position='floating' style='font-size: medium !important;' class='" + requiredClass + " dynamiclable-float'>" + this.label + "</ion-label>" +
|
|
"<ion-input type='number' id='" + this.elementId + "' value='" + this.value + "' " + this.disabled + "> </ion-input>" +
|
|
"</ion-item> ";
|
|
|
|
return template;
|
|
}
|
|
|
|
} |