Your IP : 216.73.216.26


Current Path : /home2/wtmwscom/public_html/post/Track and Trace_files/
Upload File :
Current File : /home2/wtmwscom/public_html/post/Track and Trace_files/OutSystemsUI_025.js

define("OutSystemsUI.Interaction.Sidebar.mvc$model", ["OutSystems/ClientRuntime/Main", "OutSystemsUI.model", "OutSystemsUI.controller", "OutSystemsUI.Utilities.TouchEvents.mvc$model", "OutSystemsUI.controller$MoveElement"], function (OutSystems, OutSystemsUIModel, OutSystemsUIController, OutSystemsUI_Utilities_TouchEvents_mvcModel) {
var OS = OutSystems.Internal;


var VariablesRecord = (function (_super) {
__extends(VariablesRecord, _super);
function VariablesRecord(defaults) {
_super.apply(this, arguments);
}
VariablesRecord.attributesToDeclare = function () {
return [
this.attr("IsMoving", "isMovingVar", "IsMoving", true, false, OS.Types.Boolean, function () {
return false;
}, false), 
this.attr("LastY", "lastYVar", "LastY", true, false, OS.Types.Decimal, function () {
return OS.DataTypes.Decimal.defaultValue;
}, false), 
this.attr("LastX", "lastXVar", "LastX", true, false, OS.Types.Decimal, function () {
return OS.DataTypes.Decimal.defaultValue;
}, false), 
this.attr("MoveX", "moveXVar", "MoveX", true, false, OS.Types.Decimal, function () {
return OS.DataTypes.Decimal.defaultValue;
}, false), 
this.attr("DragDirection", "dragDirectionVar", "DragDirection", true, false, OS.Types.Text, function () {
return "";
}, false), 
this.attr("PreventDefault", "preventDefaultVar", "PreventDefault", true, false, OS.Types.Boolean, function () {
return false;
}, false), 
this.attr("SidebarWidth", "sidebarWidthVar", "SidebarWidth", true, false, OS.Types.Integer, function () {
return 280;
}, false), 
this.attr("RenderBar", "renderBarVar", "RenderBar", true, false, OS.Types.Boolean, function () {
return false;
}, false), 
this.attr("Velocity", "velocityVar", "Velocity", true, false, OS.Types.Decimal, function () {
return (new OS.DataTypes.Decimal("0.3"));
}, false), 
this.attr("IsRTL", "isRTLVar", "IsRTL", true, false, OS.Types.Boolean, function () {
return false;
}, false), 
this.attr("IsOpen", "isOpenIn", "IsOpen", true, false, OS.Types.Boolean, function () {
return false;
}, false), 
this.attr("_isOpenInDataFetchStatus", "_isOpenInDataFetchStatus", "_isOpenInDataFetchStatus", true, false, OS.Types.Integer, function () {
return /*Fetched*/ 1;
}, false), 
this.attr("ExtendedClass", "extendedClassIn", "ExtendedClass", true, false, OS.Types.Text, function () {
return "";
}, false), 
this.attr("_extendedClassInDataFetchStatus", "_extendedClassInDataFetchStatus", "_extendedClassInDataFetchStatus", true, false, OS.Types.Integer, function () {
return /*Fetched*/ 1;
}, false)
].concat(_super.attributesToDeclare.call(this));
};
VariablesRecord.init();
return VariablesRecord;
})(OS.DataTypes.GenericRecord);
var WidgetsRecord = (function (_super) {
__extends(WidgetsRecord, _super);
function WidgetsRecord() {
_super.apply(this, arguments);
}
WidgetsRecord.getWidgetsType = function () {
return {};
};

return WidgetsRecord;
})(OS.Model.BaseWidgetRecordMap);
var Model = (function (_super) {
__extends(Model, _super);
function Model() {
_super.apply(this, arguments);
}
Model.getVariablesRecordConstructor = function () {
return VariablesRecord;
};
Model.getWidgetsRecordConstructor = function () {
return WidgetsRecord;
};
Model._hasValidationWidgetsValue = undefined;
Object.defineProperty(Model, "hasValidationWidgets", {
enumerable: true,
configurable: true,
get: function () {
if((Model._hasValidationWidgetsValue === undefined)) {
Model._hasValidationWidgetsValue = OutSystemsUI_Utilities_TouchEvents_mvcModel.hasValidationWidgets;
}

return Model._hasValidationWidgetsValue;
}
});

Model.prototype.setInputs = function (inputs) {
if("IsOpen" in inputs) {
this.variables.isOpenIn = inputs.IsOpen;
if("_isOpenInDataFetchStatus" in inputs) {
this.variables._isOpenInDataFetchStatus = inputs._isOpenInDataFetchStatus;
}

}

if("ExtendedClass" in inputs) {
this.variables.extendedClassIn = inputs.ExtendedClass;
if("_extendedClassInDataFetchStatus" in inputs) {
this.variables._extendedClassInDataFetchStatus = inputs._extendedClassInDataFetchStatus;
}

}

};
return Model;
})(OS.Model.BaseViewModel);
return new OS.Model.ModelFactory(Model);
});
define("OutSystemsUI.Interaction.Sidebar.mvc$view", ["OutSystems/ClientRuntime/Main", "OutSystemsUI.model", "OutSystemsUI.controller", "react", "OutSystems/ReactView/Main", "OutSystemsUI.Interaction.Sidebar.mvc$model", "OutSystemsUI.Interaction.Sidebar.mvc$controller", "OutSystems/ReactWidgets/Main", "OutSystemsUI.Utilities.TouchEvents.mvc$view", "OutSystemsUI.controller$MoveElement"], function (OutSystems, OutSystemsUIModel, OutSystemsUIController, React, OSView, OutSystemsUI_Interaction_Sidebar_mvc_model, OutSystemsUI_Interaction_Sidebar_mvc_controller, OSWidgets, OutSystemsUI_Utilities_TouchEvents_mvc_view) {
    var OS = OutSystems.Internal;
var PlaceholderContent = OSView.Widget.PlaceholderContent;
var IteratorPlaceholderContent = OSView.Widget.IteratorPlaceholderContent;


    var View = (function (_super) {
        __extends(View,_super);
        function View() {
            try {
                this.initialize.apply(this, arguments);
            } catch (error) {
                View.handleError(error);
                throw error;
            }
        }
        View.prototype.initialize = function() {
            _super.apply(this, arguments);
        };
        View.displayName = "Interaction.Sidebar";
        View.getCssDependencies = function() {
            return ["css/OutSystemsReactWidgets.css"];
        };
        View.getJsDependencies = function() {
            return [];
        };
        View.getBlocks = function() {
            return [OutSystemsUI_Utilities_TouchEvents_mvc_view];
        };
        Object.defineProperty(View.prototype, "modelFactory", {
            get: function () {
                return OutSystemsUI_Interaction_Sidebar_mvc_model;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(View.prototype, "controllerFactory", {
            get: function () {
                return OutSystemsUI_Interaction_Sidebar_mvc_controller;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(View.prototype, "title", {
            get: function () {
                return "";
            },
            enumerable: true,
            configurable: true
        });
        View.prototype.internalRender = function() {
            var model = this.model;
            var controller = this.controller;
            var idService = this.idService;
            var validationService = controller.validationService;
            var widgetsRecordProvider = this.widgetsRecordProvider;
            var callContext = controller.callContext();
            var $if = View.ifWidget;
            var asPrimitiveValue = View.asPrimitiveValue;
            var _this = this;

            return React.createElement("div", this.getRootNodeProperties(), $if(false, false, this, function () {
return [];
}, function () {
return [React.createElement(OSWidgets.Container, {
align: /*Default*/ 0,
animate: false,
style: model.getCachedValue(idService.getId("Sidebar.Style"), function () {
return ((("sidebar" + ((model.variables.isOpenIn) ? (" sidebar-open") : (""))) + " ") + model.variables.extendedClassIn);
}, function () {
return model.variables.isOpenIn;
}, function () {
return model.variables.extendedClassIn;
}),
visible: true,
_idProps: {
service: idService,
name: "Sidebar"
},
_widgetRecordProvider: widgetsRecordProvider,
style_dataFetchStatus: OS.Model.calculateDataFetchStatus(model.variables._isOpenInDataFetchStatus, model.variables._extendedClassInDataFetchStatus)
}, React.createElement(OSWidgets.Placeholder, {
align: /*Default*/ 0,
content: _this.props.placeholders.header,
style: "sidebar-header padding ph",
_idProps: {
service: idService,
name: "Header"
},
_widgetRecordProvider: widgetsRecordProvider
}), React.createElement(OSWidgets.Placeholder, {
align: /*Default*/ 0,
content: _this.props.placeholders.content,
style: "sidebar-content padding",
_idProps: {
service: idService,
name: "Content"
},
_widgetRecordProvider: widgetsRecordProvider
}))];
}), $if(false, false, this, function () {
return [];
}, function () {
return [React.createElement(OutSystemsUI_Utilities_TouchEvents_mvc_view, {
inputs: {
WidgetId: idService.getId("Sidebar")
},
events: {
_handleError: function (ex) {
controller.handleError(ex);
},
move$Action: function (xIn, yIn, offsetXIn, offsetYIn, evtIn) {
var eventHandlerContext = callContext.clone();
controller.gestureMove$Action(xIn, yIn, offsetXIn, offsetYIn, evtIn, controller.callContext(eventHandlerContext));

;
},
end$Action: function (xIn, yIn, offsetXIn, offsetYIn, timeTakenIn) {
return Promise.resolve().then(function () {
var eventHandlerContext = callContext.clone();
controller.gestureEnd$Action(offsetXIn, offsetYIn, timeTakenIn, controller.callContext(eventHandlerContext));
});
;
},
start$Action: function (xIn, yIn) {
var eventHandlerContext = callContext.clone();
controller.gestureStart$Action(xIn, yIn, controller.callContext(eventHandlerContext));

;
}
},
_validationProps: {
validationService: validationService
},
_idProps: {
service: idService,
uuid: "3",
alias: "1"
},
_widgetRecordProvider: widgetsRecordProvider,
_dependencies: []
})];
}));
        };
        return View;
    })(OSView.BaseView.BaseWebBlock);
	
    return View;
});
define("OutSystemsUI.Interaction.Sidebar.mvc$controller", ["OutSystems/ClientRuntime/Main", "OutSystemsUI.model", "OutSystemsUI.controller", "OutSystemsUI.languageResources", "OutSystemsUI.Interaction.Sidebar.mvc$controller.GestureMove.PreventDefautJS", "OutSystemsUI.Interaction.Sidebar.mvc$controller.GestureMove.UpdateUIJS", "OutSystemsUI.Interaction.Sidebar.mvc$controller.UpdateUI.MoveMenuJS", "OutSystemsUI.Interaction.Sidebar.mvc$controller.GestureStart.CheckSideBarOpenJS", "OutSystemsUI.Interaction.Sidebar.mvc$controller.GestureStart.AddNoTransitionJS", "OutSystemsUI.Interaction.Sidebar.mvc$controller.OnReady.InitJS", "OutSystemsUI.Interaction.Sidebar.mvc$controller.OnParametersChanged.CheckOpenJS", "OutSystemsUI.Interaction.Sidebar.mvc$controller.GestureEnd.OpenEnitreSideBarJS", "OutSystemsUI.Interaction.Sidebar.mvc$controller.GestureEnd.RemoveNoTransitionJS", "OutSystemsUI.Interaction.Sidebar.mvc$controller.GestureEnd.SendSideBarToStartJS", "OutSystemsUI.controller$MoveElement"], function (OutSystems, OutSystemsUIModel, OutSystemsUIController, OutSystemsUILanguageResources, OutSystemsUI_Interaction_Sidebar_mvc_controller_GestureMove_PreventDefautJS, OutSystemsUI_Interaction_Sidebar_mvc_controller_GestureMove_UpdateUIJS, OutSystemsUI_Interaction_Sidebar_mvc_controller_UpdateUI_MoveMenuJS, OutSystemsUI_Interaction_Sidebar_mvc_controller_GestureStart_CheckSideBarOpenJS, OutSystemsUI_Interaction_Sidebar_mvc_controller_GestureStart_AddNoTransitionJS, OutSystemsUI_Interaction_Sidebar_mvc_controller_OnReady_InitJS, OutSystemsUI_Interaction_Sidebar_mvc_controller_OnParametersChanged_CheckOpenJS, OutSystemsUI_Interaction_Sidebar_mvc_controller_GestureEnd_OpenEnitreSideBarJS, OutSystemsUI_Interaction_Sidebar_mvc_controller_GestureEnd_RemoveNoTransitionJS, OutSystemsUI_Interaction_Sidebar_mvc_controller_GestureEnd_SendSideBarToStartJS) {
var OS = OutSystems.Internal;
var Controller = (function (_super) {
__extends(Controller, _super);
function Controller() {
_super.apply(this, arguments);
var controller = this.controller;
this.clientActionProxies = {
updateUI$Action: function () {
return controller.executeActionInsideJSNode(controller._updateUI$Action.bind(controller), controller.callContext(), function (actionResults) {
return {};
});
}
};
this.dataFetchDependenciesOriginal = {};
this.dataFetchDependentsGraph = {};
this.useImprovedDataFetch = false;
this.hasDependenciesBetweenSources = false;
this.shouldSendClientVarsToDataSources = false;
}
// Server Actions

// Aggregates and Data Actions

Controller.prototype.dataFetchActionNames = [];
// Client Actions
Controller.prototype._onInitialize$Action = function (callContext) {
var model = this.model;
var controller = this.controller;
var idService = this.idService;
controller.ensureControllerAlive("OnInitialize");
callContext = controller.callContext(callContext);
// Set initial conditions
// IsOpen = False
model.variables.isOpenIn = false;
// SidebarWidth = 0
model.variables.sidebarWidthVar = 0;
// LastX = 0
model.variables.lastXVar = OS.BuiltinFunctions.integerToDecimal(0);
// LastY = 0
model.variables.lastYVar = OS.BuiltinFunctions.integerToDecimal(0);
// MoveX = 0
model.variables.moveXVar = OS.BuiltinFunctions.integerToDecimal(0);
// DragDirection = ""
model.variables.dragDirectionVar = "";
// PreventDefault = False
model.variables.preventDefaultVar = false;
// RenderBar = RenderBar
model.variables.renderBarVar = model.variables.renderBarVar;
};
Controller.prototype._gestureMove$Action = function (xIn, yIn, offsetXIn, offsetYIn, evtIn, callContext) {
var model = this.model;
var controller = this.controller;
var idService = this.idService;
controller.ensureControllerAlive("GestureMove");
callContext = controller.callContext(callContext);
var vars = new OS.DataTypes.VariableHolder(new (controller.constructor.getVariableGroupType("OutSystemsUI.Interaction.Sidebar.GestureMove$vars"))());
vars.value.xInLocal = xIn;
vars.value.yInLocal = yIn;
vars.value.offsetXInLocal = offsetXIn;
vars.value.offsetYInLocal = offsetYIn;
vars.value.evtInLocal = evtIn;
// No direction set?
if(((model.variables.dragDirectionVar === ""))) {
// Set drag direction
// DragDirection = If
model.variables.dragDirectionVar = ((OS.BuiltinFunctions.abs(vars.value.offsetXInLocal).gte(OS.BuiltinFunctions.abs(vars.value.offsetYInLocal))) ? ("horizontal") : ("vertical"));
controller.safeExecuteJSNode(OutSystemsUI_Interaction_Sidebar_mvc_controller_GestureMove_UpdateUIJS, "UpdateUI", "GestureMove", null, function ($parameters) {
}, {
UpdateUI: controller.clientActionProxies.updateUI$Action
}, {});
}

// Is scrolling?
if(((model.variables.dragDirectionVar === "vertical"))) {
// Update Last Positions
// LastY = Y
model.variables.lastYVar = vars.value.yInLocal;
// LastX = X
model.variables.lastXVar = vars.value.xInLocal;
} else {
do {
controller.safeExecuteJSNode(OutSystemsUI_Interaction_Sidebar_mvc_controller_GestureMove_PreventDefautJS, "PreventDefaut", "GestureMove", {
Evt: OS.DataConversion.JSNodeParamConverter.to(vars.value.evtInLocal, OS.Types.Object)
}, function ($parameters) {
}, {}, {});
// IsRTL?
if((model.variables.isRTLVar)) {
// Dragging inside bounds?
if((!((model.variables.moveXVar.plus(vars.value.xInLocal.minus(model.variables.lastXVar)).gt(OS.BuiltinFunctions.integerToDecimal(-model.variables.sidebarWidthVar)) && model.variables.moveXVar.plus(vars.value.xInLocal.minus(model.variables.lastXVar)).lt(OS.BuiltinFunctions.integerToDecimal(0)))))) {
break;
}

} else {
// Dragging inside bounds?
if((!((model.variables.moveXVar.plus(vars.value.xInLocal.minus(model.variables.lastXVar)).lt(OS.BuiltinFunctions.integerToDecimal(model.variables.sidebarWidthVar)) && model.variables.moveXVar.plus(vars.value.xInLocal.minus(model.variables.lastXVar)).gt(OS.BuiltinFunctions.integerToDecimal(0)))))) {
break;
}

}

// Update menu X axis offset
// MoveX = MoveX + X - LastX
model.variables.moveXVar = model.variables.moveXVar.plus(vars.value.xInLocal.minus(model.variables.lastXVar));
} while(false)
;
// Update Last Positions
// LastY = Y
model.variables.lastYVar = vars.value.yInLocal;
// LastX = X
model.variables.lastXVar = vars.value.xInLocal;
}

};
Controller.registerVariableGroupType("OutSystemsUI.Interaction.Sidebar.GestureMove$vars", [{
name: "X",
attrName: "xInLocal",
mandatory: true,
dataType: OS.Types.Decimal,
defaultValue: function () {
return OS.DataTypes.Decimal.defaultValue;
}
}, {
name: "Y",
attrName: "yInLocal",
mandatory: true,
dataType: OS.Types.Decimal,
defaultValue: function () {
return OS.DataTypes.Decimal.defaultValue;
}
}, {
name: "OffsetX",
attrName: "offsetXInLocal",
mandatory: true,
dataType: OS.Types.Decimal,
defaultValue: function () {
return OS.DataTypes.Decimal.defaultValue;
}
}, {
name: "OffsetY",
attrName: "offsetYInLocal",
mandatory: true,
dataType: OS.Types.Decimal,
defaultValue: function () {
return OS.DataTypes.Decimal.defaultValue;
}
}, {
name: "Evt",
attrName: "evtInLocal",
mandatory: true,
dataType: OS.Types.Object,
defaultValue: function () {
return null;
}
}]);
Controller.prototype._updateUI$Action = function (callContext) {
var model = this.model;
var controller = this.controller;
var idService = this.idService;
controller.ensureControllerAlive("UpdateUI");
callContext = controller.callContext(callContext);
if((model.variables.isMovingVar)) {
controller.safeExecuteJSNode(OutSystemsUI_Interaction_Sidebar_mvc_controller_UpdateUI_MoveMenuJS, "MoveMenu", "UpdateUI", {
OffsetX: OS.DataConversion.JSNodeParamConverter.to(model.variables.moveXVar, OS.Types.Decimal),
WidgetId: OS.DataConversion.JSNodeParamConverter.to(idService.getId("Sidebar"), OS.Types.Text)
}, function ($parameters) {
}, {
UpdateUI: controller.clientActionProxies.updateUI$Action
}, {});
}

};
Controller.prototype._gestureStart$Action = function (xIn, yIn, callContext) {
var model = this.model;
var controller = this.controller;
var idService = this.idService;
controller.ensureControllerAlive("GestureStart");
callContext = controller.callContext(callContext);
var vars = new OS.DataTypes.VariableHolder(new (controller.constructor.getVariableGroupType("OutSystemsUI.Interaction.Sidebar.GestureStart$vars"))());
vars.value.xInLocal = xIn;
vars.value.yInLocal = yIn;
var checkSideBarOpenJSResult = new OS.DataTypes.VariableHolder();
// SideBar is moving
// IsMoving = True
model.variables.isMovingVar = true;
checkSideBarOpenJSResult.value = controller.safeExecuteJSNode(OutSystemsUI_Interaction_Sidebar_mvc_controller_GestureStart_CheckSideBarOpenJS, "CheckSideBarOpen", "GestureStart", {
WidgetId: OS.DataConversion.JSNodeParamConverter.to(idService.getId("Sidebar"), OS.Types.Text),
IsOpen: OS.DataConversion.JSNodeParamConverter.to(false, OS.Types.Boolean),
SidebarWidth: OS.DataConversion.JSNodeParamConverter.to(0, OS.Types.Integer),
isRTL: OS.DataConversion.JSNodeParamConverter.to(false, OS.Types.Boolean)
}, function ($parameters) {
var jsNodeResult = new (controller.constructor.getVariableGroupType("OutSystemsUI.Interaction.Sidebar.GestureStart$checkSideBarOpenJSResult"))();
jsNodeResult.isOpenOut = OS.DataConversion.JSNodeParamConverter.from($parameters.IsOpen, OS.Types.Boolean);
jsNodeResult.sidebarWidthOut = OS.DataConversion.JSNodeParamConverter.from($parameters.SidebarWidth, OS.Types.Integer);
jsNodeResult.isRTLOut = OS.DataConversion.JSNodeParamConverter.from($parameters.isRTL, OS.Types.Boolean);
return jsNodeResult;
}, {}, {});
// Set initial conditions
// IsOpen = CheckSideBarOpen.IsOpen
model.variables.isOpenIn = checkSideBarOpenJSResult.value.isOpenOut;
// SidebarWidth = CheckSideBarOpen.SidebarWidth
model.variables.sidebarWidthVar = checkSideBarOpenJSResult.value.sidebarWidthOut;
// LastX = X
model.variables.lastXVar = vars.value.xInLocal;
// LastY = Y
model.variables.lastYVar = vars.value.yInLocal;
// IsRTL = CheckSideBarOpen.isRTL
model.variables.isRTLVar = checkSideBarOpenJSResult.value.isRTLOut;
// MoveX = If
model.variables.moveXVar = OS.BuiltinFunctions.integerToDecimal(((model.variables.isOpenIn) ? (0) : (((model.variables.isRTLVar) ? (-model.variables.sidebarWidthVar) : (model.variables.sidebarWidthVar)))));
// DragDirection = ""
model.variables.dragDirectionVar = "";
// PreventDefault = True
model.variables.preventDefaultVar = true;
controller.safeExecuteJSNode(OutSystemsUI_Interaction_Sidebar_mvc_controller_GestureStart_AddNoTransitionJS, "AddNoTransition", "GestureStart", {
WidgetId: OS.DataConversion.JSNodeParamConverter.to(idService.getId("Sidebar"), OS.Types.Text)
}, function ($parameters) {
}, {}, {});
};
Controller.registerVariableGroupType("OutSystemsUI.Interaction.Sidebar.GestureStart$vars", [{
name: "X",
attrName: "xInLocal",
mandatory: true,
dataType: OS.Types.Decimal,
defaultValue: function () {
return OS.DataTypes.Decimal.defaultValue;
}
}, {
name: "Y",
attrName: "yInLocal",
mandatory: true,
dataType: OS.Types.Decimal,
defaultValue: function () {
return OS.DataTypes.Decimal.defaultValue;
}
}]);
Controller.registerVariableGroupType("OutSystemsUI.Interaction.Sidebar.GestureStart$checkSideBarOpenJSResult", [{
name: "IsOpen",
attrName: "isOpenOut",
mandatory: true,
dataType: OS.Types.Boolean,
defaultValue: function () {
return false;
}
}, {
name: "SidebarWidth",
attrName: "sidebarWidthOut",
mandatory: true,
dataType: OS.Types.Integer,
defaultValue: function () {
return 0;
}
}, {
name: "isRTL",
attrName: "isRTLOut",
mandatory: true,
dataType: OS.Types.Boolean,
defaultValue: function () {
return false;
}
}]);
Controller.prototype._onReady$Action = function (callContext) {
var model = this.model;
var controller = this.controller;
var idService = this.idService;
controller.ensureControllerAlive("OnReady");
callContext = controller.callContext(callContext);
var initJSResult = new OS.DataTypes.VariableHolder();
initJSResult.value = controller.safeExecuteJSNode(OutSystemsUI_Interaction_Sidebar_mvc_controller_OnReady_InitJS, "Init", "OnReady", {
WidgetId: OS.DataConversion.JSNodeParamConverter.to(idService.getId("Sidebar"), OS.Types.Text),
RenderMenu: OS.DataConversion.JSNodeParamConverter.to(false, OS.Types.Boolean)
}, function ($parameters) {
var jsNodeResult = new (controller.constructor.getVariableGroupType("OutSystemsUI.Interaction.Sidebar.OnReady$initJSResult"))();
jsNodeResult.renderMenuOut = OS.DataConversion.JSNodeParamConverter.from($parameters.RenderMenu, OS.Types.Boolean);
return jsNodeResult;
}, {
MoveElement: OutSystemsUIController.default.clientActionProxies.moveElement$Action
}, {});
// RenderBar = Init.RenderMenu
model.variables.renderBarVar = initJSResult.value.renderMenuOut;
};
Controller.registerVariableGroupType("OutSystemsUI.Interaction.Sidebar.OnReady$initJSResult", [{
name: "RenderMenu",
attrName: "renderMenuOut",
mandatory: true,
dataType: OS.Types.Boolean,
defaultValue: function () {
return false;
}
}]);
Controller.prototype._onParametersChanged$Action = function (callContext) {
var model = this.model;
var controller = this.controller;
var idService = this.idService;
controller.ensureControllerAlive("OnParametersChanged");
callContext = controller.callContext(callContext);
var checkOpenJSResult = new OS.DataTypes.VariableHolder();
return OS.Flow.executeAsyncFlow(function () {
checkOpenJSResult.value = controller.safeExecuteJSNode(OutSystemsUI_Interaction_Sidebar_mvc_controller_OnParametersChanged_CheckOpenJS, "CheckOpen", "OnParametersChanged", {
WidgetId: OS.DataConversion.JSNodeParamConverter.to(idService.getId("Sidebar"), OS.Types.Text),
IsOpenIf: OS.DataConversion.JSNodeParamConverter.to(false, OS.Types.Boolean)
}, function ($parameters) {
var jsNodeResult = new (controller.constructor.getVariableGroupType("OutSystemsUI.Interaction.Sidebar.OnParametersChanged$checkOpenJSResult"))();
jsNodeResult.isOpenIfOut = OS.DataConversion.JSNodeParamConverter.from($parameters.IsOpenIf, OS.Types.Boolean);
return jsNodeResult;
}, {}, {});
// IsOpen = CheckOpen.IsOpenIf
model.variables.isOpenIn = checkOpenJSResult.value.isOpenIfOut;
// Trigger Event: OnToggle
return controller.onToggle$Action(callContext);
});
};
Controller.registerVariableGroupType("OutSystemsUI.Interaction.Sidebar.OnParametersChanged$checkOpenJSResult", [{
name: "IsOpenIf",
attrName: "isOpenIfOut",
mandatory: true,
dataType: OS.Types.Boolean,
defaultValue: function () {
return false;
}
}]);
Controller.prototype._gestureEnd$Action = function (offsetXIn, offsetYIn, timeTakenIn, callContext) {
var model = this.model;
var controller = this.controller;
var idService = this.idService;
controller.ensureControllerAlive("GestureEnd");
callContext = controller.callContext(callContext);
var vars = new OS.DataTypes.VariableHolder(new (controller.constructor.getVariableGroupType("OutSystemsUI.Interaction.Sidebar.GestureEnd$vars"))());
vars.value.offsetXInLocal = offsetXIn;
vars.value.offsetYInLocal = offsetYIn;
vars.value.timeTakenInLocal = timeTakenIn;
return OS.Flow.executeAsyncFlow(function () {
// Set not moving
// IsMoving = False
model.variables.isMovingVar = false;
controller.safeExecuteJSNode(OutSystemsUI_Interaction_Sidebar_mvc_controller_GestureEnd_RemoveNoTransitionJS, "RemoveNoTransition", "GestureEnd", {
WidgetId: OS.DataConversion.JSNodeParamConverter.to(idService.getId("Sidebar"), OS.Types.Text)
}, function ($parameters) {
}, {}, {});
// Just Clicked?
return OS.Flow.executeSequence(function () {
if((!((vars.value.offsetXInLocal.equals(OS.BuiltinFunctions.integerToDecimal(0)) && vars.value.offsetYInLocal.equals(OS.BuiltinFunctions.integerToDecimal(0)))))) {
return OS.Flow.doWhileAsync(function () {
return false;
}, function () {
if((model.variables.isRTLVar)) {
// IntervalExpressionForClose = MoveX < -SidebarWidth / 2
vars.value.intervalExpressionForCloseVar = model.variables.moveXVar.lt(OS.BuiltinFunctions.integerToDecimal(-model.variables.sidebarWidthVar).div(OS.BuiltinFunctions.integerToDecimal(2)));
// IntervalExpressionForOpen = MoveX > -SidebarWidth / 2
vars.value.intervalExpressionForOpenVar = model.variables.moveXVar.gt(OS.BuiltinFunctions.integerToDecimal(-model.variables.sidebarWidthVar).div(OS.BuiltinFunctions.integerToDecimal(2)));
// OffsetExpression = OffsetX < 0
vars.value.offsetExpressionVar = vars.value.offsetXInLocal.lt(OS.BuiltinFunctions.integerToDecimal(0));
} else {
// IntervalExpressionForClose = MoveX > -SidebarWidth / 2
vars.value.intervalExpressionForCloseVar = model.variables.moveXVar.gt(OS.BuiltinFunctions.integerToDecimal(-model.variables.sidebarWidthVar).div(OS.BuiltinFunctions.integerToDecimal(2)));
// IntervalExpressionForOpen = MoveX < SidebarWidth / 2
vars.value.intervalExpressionForOpenVar = model.variables.moveXVar.lt(OS.BuiltinFunctions.integerToDecimal(model.variables.sidebarWidthVar).div(OS.BuiltinFunctions.integerToDecimal(2)));
// OffsetExpression = OffsetX > 0
vars.value.offsetExpressionVar = vars.value.offsetXInLocal.gt(OS.BuiltinFunctions.integerToDecimal(0));
}

if((model.variables.isOpenIn)) {
// Closed one third? 
if((((vars.value.intervalExpressionForCloseVar && OS.BuiltinFunctions.abs(vars.value.offsetXInLocal).div(vars.value.timeTakenInLocal).gt(model.variables.velocityVar)) && vars.value.offsetExpressionVar))) {
return OS.Flow.breakAsync();
}

} else {
// Opened two thirds?
if((!((vars.value.intervalExpressionForOpenVar || OS.BuiltinFunctions.abs(vars.value.offsetXInLocal).div(vars.value.timeTakenInLocal).gt(model.variables.velocityVar))))) {
return OS.Flow.breakAsync();
}

}

controller.safeExecuteJSNode(OutSystemsUI_Interaction_Sidebar_mvc_controller_GestureEnd_OpenEnitreSideBarJS, "OpenEnitreSideBar", "GestureEnd", {
WidgetId: OS.DataConversion.JSNodeParamConverter.to(idService.getId("Sidebar"), OS.Types.Text)
}, function ($parameters) {
}, {}, {});
// Open Sidebar
// IsOpen = True
model.variables.isOpenIn = true;
// Trigger Event: OnToggle
return controller.onToggle$Action(callContext).then(function () {
return OS.Flow.returnAsync();

});
}).then(function () {
controller.safeExecuteJSNode(OutSystemsUI_Interaction_Sidebar_mvc_controller_GestureEnd_SendSideBarToStartJS, "SendSideBarToStart", "GestureEnd", {
WidgetId: OS.DataConversion.JSNodeParamConverter.to(idService.getId("Sidebar"), OS.Types.Text)
}, function ($parameters) {
}, {}, {});
// Close Sidebar
// IsOpen = False
model.variables.isOpenIn = false;
// Trigger Event: OnToggle2
return controller.onToggle$Action(callContext);
});
}

});
});
};
Controller.registerVariableGroupType("OutSystemsUI.Interaction.Sidebar.GestureEnd$vars", [{
name: "OffsetX",
attrName: "offsetXInLocal",
mandatory: true,
dataType: OS.Types.Decimal,
defaultValue: function () {
return OS.DataTypes.Decimal.defaultValue;
}
}, {
name: "OffsetY",
attrName: "offsetYInLocal",
mandatory: true,
dataType: OS.Types.Decimal,
defaultValue: function () {
return OS.DataTypes.Decimal.defaultValue;
}
}, {
name: "TimeTaken",
attrName: "timeTakenInLocal",
mandatory: true,
dataType: OS.Types.Decimal,
defaultValue: function () {
return OS.DataTypes.Decimal.defaultValue;
}
}, {
name: "IntervalExpressionForClose",
attrName: "intervalExpressionForCloseVar",
mandatory: false,
dataType: OS.Types.Boolean,
defaultValue: function () {
return false;
}
}, {
name: "OffsetExpression",
attrName: "offsetExpressionVar",
mandatory: false,
dataType: OS.Types.Boolean,
defaultValue: function () {
return false;
}
}, {
name: "IntervalExpressionForOpen",
attrName: "intervalExpressionForOpenVar",
mandatory: false,
dataType: OS.Types.Boolean,
defaultValue: function () {
return false;
}
}]);

Controller.prototype.onInitialize$Action = function (callContext) {
var controller = this.controller;
return controller.safeExecuteClientAction(controller._onInitialize$Action, callContext);

};
Controller.prototype.gestureMove$Action = function (xIn, yIn, offsetXIn, offsetYIn, evtIn, callContext) {
var controller = this.controller;
return controller.safeExecuteClientAction(controller._gestureMove$Action, callContext, xIn, yIn, offsetXIn, offsetYIn, evtIn);

};
Controller.prototype.updateUI$Action = function (callContext) {
var controller = this.controller;
return controller.safeExecuteClientAction(controller._updateUI$Action, callContext);

};
Controller.prototype.gestureStart$Action = function (xIn, yIn, callContext) {
var controller = this.controller;
return controller.safeExecuteClientAction(controller._gestureStart$Action, callContext, xIn, yIn);

};
Controller.prototype.onReady$Action = function (callContext) {
var controller = this.controller;
return controller.safeExecuteClientAction(controller._onReady$Action, callContext);

};
Controller.prototype.onParametersChanged$Action = function (callContext) {
var controller = this.controller;
return controller.safeExecuteClientAction(controller._onParametersChanged$Action, callContext);

};
Controller.prototype.gestureEnd$Action = function (offsetXIn, offsetYIn, timeTakenIn, callContext) {
var controller = this.controller;
return controller.safeExecuteClientAction(controller._gestureEnd$Action, callContext, offsetXIn, offsetYIn, timeTakenIn);

};
Controller.prototype.onToggle$Action = function () {
return Promise.resolve();
};

// Event Handler Actions
Controller.prototype.onInitializeEventHandler = function (callContext) {
var controller = this.controller;
var model = this.model;
var idService = this.idService;

return controller.onInitialize$Action(callContext);

};
Controller.prototype.onReadyEventHandler = function (callContext) {
var controller = this.controller;
var model = this.model;
var idService = this.idService;

return controller.onReady$Action(callContext);

};
Controller.prototype.onRenderEventHandler = null;
Controller.prototype.onDestroyEventHandler = null;
Controller.prototype.onParametersChangedEventHandler = function (callContext) {
var controller = this.controller;
var model = this.model;
var idService = this.idService;

return controller.onParametersChanged$Action(callContext);

};
Controller.prototype.handleError = function (ex) {
return controller.handleError(ex);
};
Controller.checkPermissions = function () {
};
Controller.prototype.getDefaultTimeout = function () {
return OutSystemsUIController.default.defaultTimeout;
};
return Controller;
})(OS.Controller.BaseViewController);
return new OS.Controller.ControllerFactory(Controller, OutSystemsUILanguageResources);
});
define("OutSystemsUI.Interaction.Sidebar.mvc$controller.GestureMove.PreventDefautJS", [], function () {
return function ($parameters, $actions, $roles, $public) {

$parameters.Evt.preventDefault();
};
});
define("OutSystemsUI.Interaction.Sidebar.mvc$controller.GestureMove.UpdateUIJS", [], function () {
return function ($actions, $roles, $public) {
requestAnimationFrame($actions.UpdateUI);
};
});
define("OutSystemsUI.Interaction.Sidebar.mvc$controller.UpdateUI.MoveMenuJS", [], function () {
return function ($parameters, $actions, $roles, $public) {
var el = document.getElementById($parameters.WidgetId);

el.style.transform =  "translateX(" + $parameters.OffsetX + "px)";
el.style.webkitTransform =  "translateX(" + $parameters.OffsetX + "px)";

requestAnimationFrame($actions.UpdateUI);
};
});
define("OutSystemsUI.Interaction.Sidebar.mvc$controller.GestureStart.CheckSideBarOpenJS", [], function () {
return function ($parameters, $actions, $roles, $public) {
var layout = document.getElementById($parameters.WidgetId);
var isRTL = document.querySelector('.is-rtl');

if (layout.classList.contains('sidebar-open')) {
    $parameters.IsOpen = true;
}

if(isRTL) {
    $parameters.isRTL = true;
}

$parameters.SidebarWidth = layout.offsetWidth;
};
});
define("OutSystemsUI.Interaction.Sidebar.mvc$controller.GestureStart.AddNoTransitionJS", [], function () {
return function ($parameters, $actions, $roles, $public) {
var sideBarMenu = document.getElementById($parameters.WidgetId);
sideBarMenu.classList.add('no-transition');

sideBarMenu.offsetHeight;
};
});
define("OutSystemsUI.Interaction.Sidebar.mvc$controller.OnReady.InitJS", [], function () {
return function ($parameters, $actions, $roles, $public) {
var el = document.getElementById($parameters.WidgetId).parentNode.id;
$actions.MoveElement(el, ".active-screen .screen");

$parameters.RenderMenu = document.querySelector('.active-screen .app-menu-icon.back') === null;
};
});
define("OutSystemsUI.Interaction.Sidebar.mvc$controller.OnParametersChanged.CheckOpenJS", [], function () {
return function ($parameters, $actions, $roles, $public) {
$parameters.IsOpenIf = !document.getElementById($parameters.WidgetId).classList.contains("sidebar-open");

};
});
define("OutSystemsUI.Interaction.Sidebar.mvc$controller.GestureEnd.OpenEnitreSideBarJS", [], function () {
return function ($parameters, $actions, $roles, $public) {
var el = document.getElementById($parameters.WidgetId);

el.style.transform =  "";
el.style.webkitTransform =  "";
};
});
define("OutSystemsUI.Interaction.Sidebar.mvc$controller.GestureEnd.RemoveNoTransitionJS", [], function () {
return function ($parameters, $actions, $roles, $public) {
var sideBarMenu = document.getElementById($parameters.WidgetId);
sideBarMenu.classList.remove('no-transition');
};
});
define("OutSystemsUI.Interaction.Sidebar.mvc$controller.GestureEnd.SendSideBarToStartJS", [], function () {
return function ($parameters, $actions, $roles, $public) {
var el = document.getElementById($parameters.WidgetId);

el.style.transform =  "";
el.style.webkitTransform =  "";

};
});