@pilotlab/lux-tools
Version:
A luxurious user experience framework, developed by your friends at Pilot.
69 lines • 3.31 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const is = require("@pilotlab/lux-is");
var DeviceType;
(function (DeviceType) {
DeviceType[DeviceType["DESKTOP"] = 0] = "DESKTOP";
DeviceType[DeviceType["MOBILE"] = 1] = "MOBILE";
})(DeviceType = exports.DeviceType || (exports.DeviceType = {}));
class AppContextBase {
constructor(deviceTarget, widthPreferred, heightPreferred, isConstrainMin, isConstrainMax) {
this.p_isConstrainMin = false;
this.p_isConstrainMax = false;
this.p_deviceTarget = deviceTarget;
if (is.notEmpty(widthPreferred))
this.p_widthPreferred = widthPreferred;
if (is.notEmpty(heightPreferred))
this.p_heightPreferred = heightPreferred;
if (is.notEmpty(isConstrainMin))
this.p_isConstrainMin = isConstrainMin;
if (is.notEmpty(isConstrainMax))
this.p_isConstrainMax = isConstrainMax;
}
get deviceTarget() { return this.p_deviceTarget; }
get widthPreferred() { return this.p_widthPreferred; }
get heightPreferred() { return this.p_heightPreferred; }
get isConstrainMin() { return this.p_isConstrainMin; }
get isConstrainMax() { return this.p_isConstrainMax; }
}
exports.AppContextBase = AppContextBase;
class AppContextMobile extends AppContextBase {
constructor(orientationMode = lux.Orientation.BOTH, widthPreferred, heightPreferred, emulationContext) {
super(DeviceType.MOBILE, widthPreferred, heightPreferred);
this.p_orientationMode = lux.Orientation.VERTICAL;
this.p_orientationMode = orientationMode;
if (is.notEmpty(emulationContext))
this.p_emulationContext = emulationContext;
}
get orientationMode() { return this.p_orientationMode; }
get emulationContext() { return this.p_emulationContext; }
}
exports.AppContextMobile = AppContextMobile;
class AppContextWebEmbedded extends AppContextBase {
constructor(widthPreferred, heightPreferred) {
super(DeviceType.DESKTOP, widthPreferred, heightPreferred);
}
}
exports.AppContextWebEmbedded = AppContextWebEmbedded;
class AppContextDesktop extends AppContextBase {
constructor(widthPreferred, heightPreferred, isConstrainMin, isConstrainMax) {
super(DeviceType.DESKTOP, widthPreferred, heightPreferred, isConstrainMin, isConstrainMax);
this.p_mobileOrientationMode = lux.Orientation.VERTICAL;
}
get mobileOrientationMode() { return this.p_mobileOrientationMode; }
}
exports.AppContextDesktop = AppContextDesktop;
class AppContextDesktopEmulation extends AppContextDesktop {
constructor(deviceShellImageSrc, deviceShellOrientation = lux.Orientation.VERTICAL, widthPreferred = 750, heightPreferred = 1334) {
super();
this.p_deviceShellImageSrc = deviceShellImageSrc;
this.p_mobileOrientationMode = deviceShellOrientation;
this.p_appWidthPreferred = widthPreferred;
this.p_appHeightPreferred = heightPreferred;
}
get deviceShellImageSrc() { return this.p_deviceShellImageSrc; }
get appWidthPreferred() { return this.p_appWidthPreferred; }
get appHeightPreferred() { return this.p_appHeightPreferred; }
}
exports.AppContextDesktopEmulation = AppContextDesktopEmulation;
//# sourceMappingURL=appContext.js.map