var Unibase; (function (Unibase) { let Forms; (function (Forms) { let Controls; (function (Controls) { class TextBox { init(formpropertyid, prop, callback) { var instance = TextBox.Instance(); instance.loadControlSettings(prop.ControlJsonText, prop.UniqueId); instance.loadPropertySettings(prop.PropertySettings, prop.UniqueId); if (callback != null) callback(); } loadControl(containerid, prop) { var regExpr = ""; var ErrMsg = ""; var validationlist = prop.Validations; if (validationlist != null) { for (var i = 0; i < validationlist.length; i++) { regExpr += validationlist[i].RegularExp + '||'; ErrMsg += validationlist[i].ErrorMessage + '||'; } } var Isrequired = prop.IsRequired != true ? 'hidden' : ''; var requiredClass = prop.IsRequired != true ? '' : 'required'; var reqMark = prop.IsRequired != true ? '' : '*'; var CurrentStageId = $("#hf_" + $("#hfLayout_InstalledPageId").val() + "_StageId").val(); if (prop.IncludedStages != null && prop.IncludedStages != "") { var StagesForRequired = prop.IncludedStages.split('|'); Isrequired = StagesForRequired.find(x => x == CurrentStageId) ? '' : 'hidden'; requiredClass = StagesForRequired.find(x => x == CurrentStageId) ? 'required' : ''; reqMark = StagesForRequired.find(x => x == CurrentStageId) ? '*' : ''; } if (prop.ExcludedStages != null && prop.ExcludedStages != "") { var ExcludedStages = prop.ExcludedStages.split('|'); Isrequired = ExcludedStages.find(x => x == CurrentStageId) ? 'hidden' : ''; requiredClass = ExcludedStages.find(x => x == CurrentStageId) ? '' : 'required'; reqMark = ExcludedStages.find(x => x == CurrentStageId) ? '' : '*'; } let ControlId = 'txt_' + prop.UniqueId; if (prop.IsRequired) requiredClass = 'required'; const { helpTooltipHtml, helpTextHtml, helpClass } = Unibase.Platform.Forms.Components.FormViewer.Instance().getControlHelpHtml(prop); let html = `
${helpTextHtml}
`; $("#" + containerid).append(html); } loadControlSettings(controlsettingjson, formpropertyid) { return null; } loadPropertySettings(propertysettings, formpropertyid) { if (propertysettings != null) { for (var i = 0; i < propertysettings.length; i++) { var data = propertysettings[i]; if (data.ControlPropertyName == "MaxLength" && data.ControlPropertyValue != "") { $("#txt_" + formpropertyid).attr("MaxLength", data.ControlPropertyValue); } } } } bindEditFormDetails(formpropertyid, propval, DocPropertyName) { if (propval == 'null') propval = ''; var decodeText = unescape(propval); $("#txt_" + formpropertyid).val(decodeText); if (decodeText != "") { $("#TxtDiv_" + formpropertyid).addClass("floating-label-form-group-with-value"); } } static Instance() { if (this.instance === undefined) { this.instance = new TextBox(); } return this.instance; } } Controls.TextBox = TextBox; })(Controls = Forms.Controls || (Forms.Controls = {})); })(Forms = Unibase.Forms || (Unibase.Forms = {})); })(Unibase || (Unibase = {}));