123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- var Unibase;
- (function (Unibase) {
- let Forms;
- (function (Forms) {
- let Controls;
- (function (Controls) {
- class FileDragNDrop_Settings {
- loadSettingHtml() {
- return ``;
- }
- bindControlData(controldatajson) {
- return "";
- }
- SaveControlData(controldatajson) {
- return "";
- }
- loadControlPropertiesHtml(Container) {
- var html = `<section class="">` +
- `<div class="card PropertySettings">` +
- `<div class="card-header"><h6><b>Property Settings</b></h6></div>` +
- `<div class="card-body" id="divPropSetting"><div class="row"><div class="col-sm-6 Controlproperties-Element" data-propertysettingid="0" data-controlpropertyid="0" data-controlpropertyname="IsMultiple"><label for="IsMultiple" style="margin-top:19px"><b>IsMultiple</b></label><label id="lblIsMultiple" class="switch m-t form-inline pull-right mt-10" style="color:grey"><input id="IsMultiple" data-group="IsRequired" type="checkbox"><span></span></label></div><div class="col-sm-6 Controlproperties-Element" data-propertysettingid="0" data-controlpropertyid="0" data-controlpropertyname="IsFileControl"><label for="IsFileControl" style="margin-top:19px"><b>IsFileControl</b></label><label id="lblIsFileControl" class="switch m-t form-inline pull-right mt-10" style="color:grey"><input id="IsFileControl" data-group="IsRequired" type="checkbox"><span></span></label></div></div>` +
- `<div class="row" id="divValidate"><div class="col-sm-6 Controlproperties-Element" data-propertysettingid="0" data-controlpropertyid="0" data-controlpropertyname="IsValidate"><label for="IsValidate" style="margin-top:19px"><b>IsValidate</b></label><label id="lblIsValidate" class="switch m-t form-inline pull-right mt-10" style="color:grey"><input id="IsValidate" data-group="IsRequired" type="checkbox"><span></span></label></div></div></div>` +
- `</div></section>`;
- $(Container).html(html);
- $("#divPropSetting").removeClass('hidden');
- }
- bindPropertySettings(prop) {
- var propertySettings = prop.PropertySettings;
- if (propertySettings != null && propertySettings != undefined) {
- var i = 0;
- $(".Controlproperties-Element").each(function () {
- var currentPropSetting = $(this).children().find("input").attr("id");
- var propSetting = propertySettings.find(x => x.ControlPropertyName == currentPropSetting);
- $(this).attr("data-controlpropertyid", propSetting.ControlPropertyId);
- $(this).attr("data-controlpropertyname", propSetting.ControlPropertyName);
- $(this).attr("data-propertysettingid", propSetting.PropertySettingId);
- if (currentPropSetting == "IsMultiple") {
- if (propSetting.ControlPropertyValue == "true") {
- $("#IsMultiple").prop("checked", true);
- }
- else {
- $("#IsMultiple").prop("checked", false);
- }
- }
- if (currentPropSetting == "IsFileControl") {
- if (propSetting.ControlPropertyValue == "true") {
- $("#IsFileControl").prop("checked", true);
- }
- else {
- $("#IsFileControl").prop("checked", false);
- }
- }
- if (currentPropSetting == "IsValidate") {
- if (propSetting.ControlPropertyValue == "true") {
- $("#IsValidate").prop("checked", true);
- }
- else {
- $("#IsValidate").prop("checked", false);
- }
- }
- i += 1;
- });
- }
- }
- savePropertySettings(prop) {
- var propertySettings = prop.PropertySettings;
- var propSettingReq = [];
- $(".Controlproperties-Element").each(function () {
- var data = {
- FormPropertyId: isNaN(Number(prop.FormPropertyId)) ? 0 : Number(prop.FormPropertyId),
- ControlPropertyId: Number($(this).attr("data-controlpropertyid")),
- ControlPropertyValue: $(this).children().find("input").prop("checked").toString(),
- ControlPropertyName: $(this).attr("data-controlpropertyname"),
- ControlId: isNaN(Number(prop.ControlId)) ? 0 : Number(prop.ControlId),
- PropertySettingId: Number($(this).attr("data-propertysettingid")),
- };
- propSettingReq.push(data);
- });
- return propSettingReq;
- }
- static Instance() {
- if (this._instance === undefined)
- this._instance = new FileDragNDrop_Settings();
- return this._instance;
- }
- }
- Controls.FileDragNDrop_Settings = FileDragNDrop_Settings;
- })(Controls = Forms.Controls || (Forms.Controls = {}));
- })(Forms = Unibase.Forms || (Unibase.Forms = {}));
- })(Unibase || (Unibase = {}));
|