var Unibase;
(function (Unibase) {
let Forms;
(function (Forms) {
let Controls;
(function (Controls) {
class Series_Setting {
constructor() {
this.SeriesSettingId = 0;
}
loadControlPropertiesHtml(controlpropList, container) {
return "";
}
bindPropertySettings(prop) {
var propertySettings = prop.PropertySettings;
return "";
}
savePropertySettings(prop) {
var propertySettings = prop.PropertySettings;
var currentpropSettings = [];
var propSettingReq = [];
$(".Controlproperties-Element").each(function () {
var data = {
ControlPropertyId: Number($(this).attr("data-controlpropertyid")),
ControlPropertyValue: $("#chkIsCreateNew").val().toString(),
ControlPropertyName: $(this).attr("data-controlpropertyname"),
ControlId: Number(Unibase.Platform.Forms.Components.ControlEditor.Instance().ControlId),
FormPropertyId: Number(Unibase.Platform.Forms.Components.FormBuilder.Instance().FormPropertyId),
PropertySettingId: Number($(this).attr("data-propertysettingid")),
};
propSettingReq.push(data);
});
return propSettingReq;
}
loadSettingHtml(container) {
let html = '
';
$(container).html(html);
}
bindControlData(controldatajson) {
var data = controldatajson;
Unibase.Forms.Controls.Series_Setting.Instance().SeriesSettingId = data.SeriesSettingPropertyId;
var selectDatalistname = new Option(data.FormPropertyName, data.FormPropertyId, true);
$('#txtAutoComplete_FormProperty').append(selectDatalistname);
$('#txtAutoComplete_FormProperty').val(data.FormPropertyId);
if (data.IsManualSeries == true) {
$("#chk_ApplyIsManualSeries").prop('checked', data.IsManualSeries);
$("#divFormProperty").removeClass("hidden");
}
}
SaveControlData(controldatajson) {
var controldatajson1 = [];
if (controldatajson != null && controldatajson != "") {
controldatajson = JSON.stringify(controldatajson1[0]);
controldatajson = {
DocPropertyId: Number(Unibase.Platform.Forms.Components.PropertyEditor.Instance().DocPropertyId),
DocPropertyName: String(Unibase.Platform.Forms.Components.PropertyEditor.Instance().DocPropertyName),
FormPropertyId: Number($("#txtAutoComplete_FormProperty option:selected").val()),
FormId: Number(Unibase.Platform.Forms.Components.PropertyEditor.Instance().FormId),
FormPropertyName: $("#txtAutoComplete_FormProperty option:selected").text(),
IsManualSeries: $("#chk_ApplyIsManualSeries").is(":checked"),
SeriesSettingPropertyId: Unibase.Forms.Controls.Series_Setting.Instance().SeriesSettingId,
};
}
else {
controldatajson1[0] = {
DocPropertyId: Number(Unibase.Platform.Forms.Components.PropertyEditor.Instance().DocPropertyId),
DocPropertyName: String(Unibase.Platform.Forms.Components.PropertyEditor.Instance().DocPropertyName),
FormPropertyId: Number($("#txtAutoComplete_FormProperty option:selected").val()),
FormId: Number(Unibase.Platform.Forms.Components.PropertyEditor.Instance().FormId),
FormPropertyName: $("#txtAutoComplete_FormProperty option:selected").text(),
IsManualSeries: $("#chk_ApplyIsManualSeries").is(":checked"),
};
controldatajson = JSON.stringify(controldatajson1[0]);
}
return controldatajson;
}
ShowformProperitiess() {
if ($("#chk_ApplyIsManualSeries").is(":checked")) {
$("#chk_ApplyIsManualSeries").prop("checked", true);
$("#chk_ApplyIsManualSeries").val('true');
$("#divFormProperty").removeClass("hidden");
var prop = Unibase.Platform.Forms.Components.FormBuilder.Instance().FormPropertiesJson;
var controlData = [];
for (let i = 0; i < prop.length; i++) {
var controls = prop[i];
if (controls.SectionType == Unibase.Platform.Forms.Enums.SectionType.HiddenSection.toString()) {
controlData.push({ id: controls.FormPropertyId, text: controls.FormPropertyName });
}
}
$("#txtAutoComplete_FormProperty").select2({
placeholder: 'Select Property',
data: controlData,
});
}
else {
$("#divFormProperty").addClass("hidden");
}
}
static Instance() {
if (this._instance === undefined)
this._instance = new Series_Setting();
return this._instance;
}
}
Controls.Series_Setting = Series_Setting;
})(Controls = Forms.Controls || (Forms.Controls = {}));
})(Forms = Unibase.Forms || (Unibase.Forms = {}));
})(Unibase || (Unibase = {}));